-
-
- {colors.map((color) => {
- return (
-
-
-
-
-
- {color.color}
-
-
- )
- })}
-
-
-
- )
-}
\ No newline at end of file
diff --git a/apps/web/src/components/draw/hooks/use-canvas-rerender.ts b/apps/web/src/components/draw/hooks/use-canvas-rerender.ts
index 0e39e60..0d8e1fe 100644
--- a/apps/web/src/components/draw/hooks/use-canvas-rerender.ts
+++ b/apps/web/src/components/draw/hooks/use-canvas-rerender.ts
@@ -69,10 +69,10 @@ export function useCanvasRerender ({ elements, selection }: UseCanvasRerenderPro
elements.forEach(element => {
if (selection !== undefined && selection.type === 'simple' && (selection.ids ?? []).includes(element.id)) {
// @ts-expect-error find out how to call generic method based on element
- ShapeHandler(element.name).draw({ canvas, context, element: { ...element, selected: true } })
+ ShapeHandler(element.name).draw({ ...element, selected: true }, { canvas, context })
} else {
// @ts-expect-error find out how to call generic method based on element
- ShapeHandler(element.name).draw({ canvas, context, element: { ...element, selected: false } })
+ ShapeHandler(element.name).draw({ ...element, selected: false }, { canvas, context, })
}
})
diff --git a/apps/web/src/components/draw/index.tsx b/apps/web/src/components/draw/index.tsx
index 3b77693..422c703 100644
--- a/apps/web/src/components/draw/index.tsx
+++ b/apps/web/src/components/draw/index.tsx
@@ -4,7 +4,7 @@ import { useDrawing } from './hooks/use-drawing'
import { useHotkeys } from './hooks/hotkeys/use-hotkeys'
import { Menu } from './menu'
import { useEffect, useRef } from 'react'
-import { isDebugEnable } from '@/config/const'
+import { isDebugEnable } from '@bristles/web/config/const'
export function Draw () {
@@ -30,7 +30,6 @@ export function Draw () {
useEffect(() => {
if (action.name === 'writing' && textAreaRef.current != null) {
- console.log('set focus')
textAreaRef.current.focus()
}
}, [action])
diff --git a/apps/web/src/components/draw/menu.tsx b/apps/web/src/components/draw/menu.tsx
index ee202b2..ae75ed2 100644
--- a/apps/web/src/components/draw/menu.tsx
+++ b/apps/web/src/components/draw/menu.tsx
@@ -6,10 +6,10 @@ import {
MenubarSeparator,
MenubarShortcut,
MenubarTrigger
-} from '@/components/ui/menubar'
-import { useTheme } from '@/context/theme-provider'
+} from '@bristles/ui/components/ui/menubar'
+import { useTheme } from '@bristles/ui/context/theme-provider'
import { CursorArrowIcon, DoubleArrowRightIcon, DownloadIcon, DragHandleDots2Icon, FileIcon, MoonIcon, QuestionMarkCircledIcon, Share1Icon, SlashIcon, SquareIcon, SunIcon, TextIcon } from '@radix-ui/react-icons'
-import { Button } from '../ui/button'
+import { Button } from '@bristles/ui/components/ui/button'
import { type ControlProps } from './hooks/use-drawing'
// https://www.svgrepo.com/svg/450678/brush-mark
diff --git a/apps/web/src/components/draw/selector.tsx b/apps/web/src/components/draw/selector.tsx
index f51f8b8..5ca425b 100644
--- a/apps/web/src/components/draw/selector.tsx
+++ b/apps/web/src/components/draw/selector.tsx
@@ -1,12 +1,12 @@
-import { buttonVariants } from '@/components/ui/button'
+import { buttonVariants } from '@bristles/ui/components/ui/button'
import {
Popover,
PopoverContent,
PopoverTrigger
-} from '@/components/ui/popover'
+} from '@bristles/ui/components/ui/popover'
import { BorderDashedIcon, BorderDottedIcon, BorderSolidIcon, BorderStyleIcon, CaretSortIcon, GroupIcon, PaddingIcon, TransparencyGridIcon } from '@radix-ui/react-icons'
-import { AppRadioGroup2 } from './components/radio-group'
-import { cn } from '@/lib/utils'
+import { AppRadioGroup2 } from '@bristles/ui/components/radio-group'
+import { cn } from '@bristles/ui/lib/utils'
import { type ControlProps } from './hooks/use-drawing'
const colorsStyleOptions = [
diff --git a/apps/web/src/components/draw/shapes/index.tsx b/apps/web/src/components/draw/shapes/index.tsx
index 232367b..763ba8f 100644
--- a/apps/web/src/components/draw/shapes/index.tsx
+++ b/apps/web/src/components/draw/shapes/index.tsx
@@ -5,7 +5,7 @@ import { type Shapes } from '../types'
type Handlers = RectangleHandler | TextHandler | LineHandler
-export const ShapeHandler = (shape: Shapes): Handlers => {
+export const ShapeHandler = (shape: Shapes): Handlers=> {
switch (shape) {
case 'rectangle':
return Rectangle
diff --git a/apps/web/src/components/draw/shapes/line/index.ts b/apps/web/src/components/draw/shapes/line/index.ts
index 86d2dfc..8f97db5 100644
--- a/apps/web/src/components/draw/shapes/line/index.ts
+++ b/apps/web/src/components/draw/shapes/line/index.ts
@@ -1,5 +1,5 @@
+import { LineSchemaType } from '@bristles/schema'
import { type GenericHandler } from '../types/handler'
-import { type LineElement } from './types'
import {
draw,
@@ -16,7 +16,7 @@ import {
positionInElement
} from './line'
-export interface LineHandler extends GenericHandler