diff --git a/packages/core/package.json b/packages/core/package.json index dd9536aa7..272ea1886 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -48,11 +48,6 @@ "react-dom": "^17.0.2" }, "dependencies": { - "@babel/core": "^7.15.0", - "@babel/preset-env": "^7.15.0", - "@radix-ui/react-primitive": "^0.0.15", - "@typescript-eslint/eslint-plugin": "^4.19.0", - "@typescript-eslint/parser": "^4.19.0", "deepmerge": "^4.2.2", "ismobilejs": "^1.1.1", "react-use-gesture": "^9.1.3" diff --git a/packages/core/src/hooks/useBoundsEvents.tsx b/packages/core/src/hooks/useBoundsEvents.tsx index 17a14d0af..ae3ed4d67 100644 --- a/packages/core/src/hooks/useBoundsEvents.tsx +++ b/packages/core/src/hooks/useBoundsEvents.tsx @@ -41,6 +41,8 @@ export function useBoundsEvents() { const onPointerMove = React.useCallback( (e: React.PointerEvent) => { + e.stopPropagation() + if (inputs.pointer && e.pointerId !== inputs.pointer.pointerId) return if (e.currentTarget.hasPointerCapture(e.pointerId)) { diff --git a/packages/core/src/hooks/useBoundsHandleEvents.tsx b/packages/core/src/hooks/useBoundsHandleEvents.tsx index 676511eb8..1b76af53b 100644 --- a/packages/core/src/hooks/useBoundsHandleEvents.tsx +++ b/packages/core/src/hooks/useBoundsHandleEvents.tsx @@ -42,6 +42,7 @@ export function useBoundsHandleEvents(id: TLBoundsCorner | TLBoundsEdge | 'rotat const onPointerMove = React.useCallback( (e: React.PointerEvent) => { + e.stopPropagation() if (e.currentTarget.hasPointerCapture(e.pointerId)) { callbacks.onDragBoundsHandle?.(inputs.pointerMove(e, id), e) } diff --git a/packages/core/src/hooks/useCanvasEvents.tsx b/packages/core/src/hooks/useCanvasEvents.tsx index b49c2ec0a..987941775 100644 --- a/packages/core/src/hooks/useCanvasEvents.tsx +++ b/packages/core/src/hooks/useCanvasEvents.tsx @@ -21,6 +21,7 @@ export function useCanvasEvents() { const onPointerMove = React.useCallback( (e: React.PointerEvent) => { + e.stopPropagation() if (e.currentTarget.hasPointerCapture(e.pointerId)) { const info = inputs.pointerMove(e, 'canvas') callbacks.onDragCanvas?.(info, e) diff --git a/packages/core/src/hooks/useHandleEvents.tsx b/packages/core/src/hooks/useHandleEvents.tsx index 5b67cd754..be075491c 100644 --- a/packages/core/src/hooks/useHandleEvents.tsx +++ b/packages/core/src/hooks/useHandleEvents.tsx @@ -41,6 +41,7 @@ export function useHandleEvents(id: string) { const onPointerMove = React.useCallback( (e: React.PointerEvent) => { + e.stopPropagation() if (e.currentTarget.hasPointerCapture(e.pointerId)) { const info = inputs.pointerMove(e, id) callbacks.onDragHandle?.(info, e) diff --git a/packages/core/src/hooks/useShapeEvents.tsx b/packages/core/src/hooks/useShapeEvents.tsx index 3b6bb5f40..9da82bb78 100644 --- a/packages/core/src/hooks/useShapeEvents.tsx +++ b/packages/core/src/hooks/useShapeEvents.tsx @@ -66,6 +66,7 @@ export function useShapeEvents(id: string, disable = false) { const onPointerMove = React.useCallback( (e: React.PointerEvent) => { if (disable) return + e.stopPropagation() if (inputs.pointer && e.pointerId !== inputs.pointer.pointerId) return diff --git a/packages/tldraw/package.json b/packages/tldraw/package.json index 49143091d..68a80eba2 100644 --- a/packages/tldraw/package.json +++ b/packages/tldraw/package.json @@ -50,14 +50,14 @@ }, "dependencies": { "@radix-ui/react-alert-dialog": "^0.0.20", - "@radix-ui/react-checkbox": "^0.0.17", - "@radix-ui/react-context-menu": "^0.0.24", - "@radix-ui/react-dropdown-menu": "^0.0.23", + "@radix-ui/react-checkbox": "^0.0.16", + "@radix-ui/react-context-menu": "^0.0.23", + "@radix-ui/react-dropdown-menu": "^0.0.22", "@radix-ui/react-icons": "^1.0.3", "@radix-ui/react-id": "^0.0.6", - "@radix-ui/react-radio-group": "^0.0.19", - "@radix-ui/react-tooltip": "^0.0.21", - "@stitches/react": "^1.0.0", + "@radix-ui/react-radio-group": "^0.0.18", + "@radix-ui/react-tooltip": "^0.0.20", + "@stitches/react": "^0.2.3", "@tldraw/core": "^0.0.57", "ismobilejs": "^1.1.1", "perfect-freehand": "^0.5.3", diff --git a/packages/tldraw/src/styles/stitches.config.ts b/packages/tldraw/src/styles/stitches.config.ts index c6d8f9257..d48dfb840 100644 --- a/packages/tldraw/src/styles/stitches.config.ts +++ b/packages/tldraw/src/styles/stitches.config.ts @@ -1,6 +1,6 @@ -import { createStitches, defaultThemeMap } from '@stitches/react' +import { createCss, defaultThemeMap } from '@stitches/react' -const { styled, css, createTheme, getCssText } = createStitches({ +const { styled, css, theme, getCssString } = createCss({ themeMap: { ...defaultThemeMap, }, @@ -99,7 +99,7 @@ const { styled, css, createTheme, getCssText } = createStitches({ }, }) -const dark = createTheme({ +const dark = theme({ colors: { brushFill: 'rgba(180, 180, 180, .05)', brushStroke: 'rgba(180, 180, 180, .25)', @@ -136,4 +136,4 @@ const dark = createTheme({ export default styled -export { css, getCssText, dark } +export { css, getCssString, dark }