11import type { Brush , Options as DrauuOptions , DrawingMode } from 'drauu'
2- import { createSharedComposable , toReactive , useLocalStorage } from '@vueuse/core'
2+ import { createSharedComposable , useLocalStorage } from '@vueuse/core'
33import { createDrauu } from 'drauu'
44import { computed , markRaw , nextTick , reactive , ref , watch } from 'vue'
55import { configs } from '../env'
@@ -22,11 +22,11 @@ export const useDrawings = createSharedComposable(() => {
2222
2323 const drawingEnabled = useLocalStorage ( 'slidev-drawing-enabled' , false )
2424 const drawingPinned = useLocalStorage ( 'slidev-drawing-pinned' , false )
25- const brush = toReactive ( useLocalStorage < Brush > ( 'slidev-drawing-brush' , {
25+ const brush = useLocalStorage < Brush > ( 'slidev-drawing-brush' , {
2626 color : brushColors [ 0 ] ,
2727 size : 4 ,
2828 mode : 'stylus' ,
29- } ) )
29+ } )
3030
3131 const isDrawing = ref ( false )
3232 const canUndo = ref ( false )
@@ -46,12 +46,12 @@ export const useDrawings = createSharedComposable(() => {
4646 if ( v === 'arrow' ) {
4747 // eslint-disable-next-line ts/no-use-before-define
4848 drauu . mode = 'line'
49- brush . arrowEnd = true
49+ brush . value . arrowEnd = true
5050 }
5151 else {
5252 // eslint-disable-next-line ts/no-use-before-define
5353 drauu . mode = v
54- brush . arrowEnd = false
54+ brush . value . arrowEnd = false
5555 }
5656 } ,
5757 } )
@@ -150,7 +150,7 @@ export const useDrawings = createSharedComposable(() => {
150150 clearDrauu ( )
151151 }
152152 else if ( e . code . startsWith ( 'Digit' ) && noModifier && + e . code [ 5 ] <= brushColors . length ) {
153- brush . color = brushColors [ + e . code [ 5 ] - 1 ]
153+ brush . value . color = brushColors [ + e . code [ 5 ] - 1 ]
154154 }
155155 else {
156156 handled = false
0 commit comments