@tldraw/editor 4.6.0-next.fecc64eee134 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/index.d.ts +493 -170
- package/dist-cjs/index.js +14 -23
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/TldrawEditor.js +3 -0
- package/dist-cjs/lib/TldrawEditor.js.map +2 -2
- package/dist-cjs/lib/components/MenuClickCapture.js +93 -47
- package/dist-cjs/lib/components/MenuClickCapture.js.map +2 -2
- package/dist-cjs/lib/components/default-components/CanvasOverlays.js +180 -0
- package/dist-cjs/lib/components/default-components/CanvasOverlays.js.map +7 -0
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js +46 -248
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +3 -3
- package/dist-cjs/lib/editor/Editor.js +142 -33
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/assets/AssetUtil.js +1 -0
- package/dist-cjs/lib/editor/assets/AssetUtil.js.map +1 -1
- package/dist-cjs/lib/editor/bindings/BindingUtil.js +1 -0
- package/dist-cjs/lib/editor/bindings/BindingUtil.js.map +1 -1
- package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js +1 -0
- package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js.map +1 -1
- package/dist-cjs/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.js +98 -0
- package/dist-cjs/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.js.map +7 -0
- package/dist-cjs/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.js +1 -0
- package/dist-cjs/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.js.map +1 -1
- package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js +1 -0
- package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js.map +1 -1
- package/dist-cjs/lib/editor/managers/FontManager/FontManager.js +2 -0
- package/dist-cjs/lib/editor/managers/FontManager/FontManager.js.map +1 -1
- package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js +2 -0
- package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js.map +1 -1
- package/dist-cjs/lib/editor/managers/InputsManager/InputsManager.js +12 -0
- package/dist-cjs/lib/editor/managers/InputsManager/InputsManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/ScribbleManager/ScribbleManager.js +1 -0
- package/dist-cjs/lib/editor/managers/ScribbleManager/ScribbleManager.js.map +1 -1
- package/dist-cjs/lib/editor/managers/SnapManager/BoundsSnaps.js +1 -0
- package/dist-cjs/lib/editor/managers/SnapManager/BoundsSnaps.js.map +1 -1
- package/dist-cjs/lib/editor/managers/SnapManager/HandleSnaps.js +1 -0
- package/dist-cjs/lib/editor/managers/SnapManager/HandleSnaps.js.map +1 -1
- package/dist-cjs/lib/editor/managers/SnapManager/SnapManager.js +2 -1
- package/dist-cjs/lib/editor/managers/SnapManager/SnapManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.js +1 -0
- package/dist-cjs/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.js.map +1 -1
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.js +1 -0
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.js.map +1 -1
- package/dist-cjs/lib/editor/managers/ThemeManager/ThemeManager.js +1 -0
- package/dist-cjs/lib/editor/managers/ThemeManager/ThemeManager.js.map +1 -1
- package/dist-cjs/lib/editor/managers/ThemeManager/defaultThemes.js +14 -0
- package/dist-cjs/lib/editor/managers/ThemeManager/defaultThemes.js.map +2 -2
- package/dist-cjs/lib/editor/managers/TickManager/TickManager.js +1 -0
- package/dist-cjs/lib/editor/managers/TickManager/TickManager.js.map +1 -1
- package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js +2 -0
- package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js.map +1 -1
- package/dist-cjs/lib/editor/overlays/OverlayManager.js +154 -0
- package/dist-cjs/lib/editor/overlays/OverlayManager.js.map +7 -0
- package/dist-cjs/lib/editor/overlays/OverlayUtil.js +92 -0
- package/dist-cjs/lib/editor/overlays/OverlayUtil.js.map +7 -0
- package/dist-cjs/lib/editor/overlays/ShapeIndicatorOverlayUtil.js +161 -0
- package/dist-cjs/lib/editor/overlays/ShapeIndicatorOverlayUtil.js.map +7 -0
- package/dist-cjs/lib/editor/overlays/getOverlayDisplayValues.js +39 -0
- package/dist-cjs/lib/editor/overlays/getOverlayDisplayValues.js.map +7 -0
- package/dist-cjs/lib/editor/shapes/BaseFrameLikeShapeUtil.js +79 -0
- package/dist-cjs/lib/editor/shapes/BaseFrameLikeShapeUtil.js.map +7 -0
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js +36 -23
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js +32 -2
- package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js.map +2 -2
- package/dist-cjs/lib/editor/tools/StateNode.js +1 -0
- package/dist-cjs/lib/editor/tools/StateNode.js.map +1 -1
- package/dist-cjs/lib/editor/types/event-types.js.map +2 -2
- package/dist-cjs/lib/exports/ExportDelay.js +1 -0
- package/dist-cjs/lib/exports/ExportDelay.js.map +1 -1
- package/dist-cjs/lib/exports/StyleEmbedder.js +1 -0
- package/dist-cjs/lib/exports/StyleEmbedder.js.map +1 -1
- package/dist-cjs/lib/exports/fetchCache.js +1 -1
- package/dist-cjs/lib/exports/fetchCache.js.map +2 -2
- package/dist-cjs/lib/exports/getSvgJsx.js +2 -1
- package/dist-cjs/lib/exports/getSvgJsx.js.map +2 -2
- package/dist-cjs/lib/hooks/EditorComponentsContext.js.map +2 -2
- package/dist-cjs/lib/hooks/useCanvasEvents.js +25 -4
- package/dist-cjs/lib/hooks/useCanvasEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/useEditorComponents.js +0 -28
- package/dist-cjs/lib/hooks/useEditorComponents.js.map +2 -2
- package/dist-cjs/lib/hooks/usePeerIds.js +1 -36
- package/dist-cjs/lib/hooks/usePeerIds.js.map +2 -2
- package/dist-cjs/lib/hooks/useShapeCulling.js +2 -1
- package/dist-cjs/lib/hooks/useShapeCulling.js.map +2 -2
- package/dist-cjs/lib/options.js +1 -0
- package/dist-cjs/lib/options.js.map +2 -2
- package/dist-cjs/lib/primitives/Vec.js +3 -0
- package/dist-cjs/lib/primitives/Vec.js.map +1 -1
- package/dist-cjs/lib/primitives/geometry/Circle2d.js +1 -0
- package/dist-cjs/lib/primitives/geometry/Circle2d.js.map +1 -1
- package/dist-cjs/lib/primitives/geometry/Ellipse2d.js +1 -0
- package/dist-cjs/lib/primitives/geometry/Ellipse2d.js.map +1 -1
- package/dist-cjs/lib/primitives/geometry/Geometry2d.js +2 -0
- package/dist-cjs/lib/primitives/geometry/Geometry2d.js.map +1 -1
- package/dist-cjs/lib/primitives/geometry/Stadium2d.js +1 -0
- package/dist-cjs/lib/primitives/geometry/Stadium2d.js.map +1 -1
- package/dist-cjs/lib/utils/EditorAtom.js +2 -0
- package/dist-cjs/lib/utils/EditorAtom.js.map +1 -1
- package/dist-cjs/lib/utils/reparenting.js +20 -7
- package/dist-cjs/lib/utils/reparenting.js.map +2 -2
- package/dist-cjs/lib/utils/sync/TLLocalSyncClient.js +5 -0
- package/dist-cjs/lib/utils/sync/TLLocalSyncClient.js.map +2 -2
- package/dist-cjs/version.js +4 -4
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.d.mts +493 -170
- package/dist-esm/index.mjs +21 -41
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/TldrawEditor.mjs +3 -0
- package/dist-esm/lib/TldrawEditor.mjs.map +2 -2
- package/dist-esm/lib/components/MenuClickCapture.mjs +94 -48
- package/dist-esm/lib/components/MenuClickCapture.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/CanvasOverlays.mjs +160 -0
- package/dist-esm/lib/components/default-components/CanvasOverlays.mjs.map +7 -0
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +47 -249
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +3 -3
- package/dist-esm/lib/editor/Editor.mjs +143 -35
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/assets/AssetUtil.mjs +1 -0
- package/dist-esm/lib/editor/assets/AssetUtil.mjs.map +1 -1
- package/dist-esm/lib/editor/bindings/BindingUtil.mjs +1 -0
- package/dist-esm/lib/editor/bindings/BindingUtil.mjs.map +1 -1
- package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs +1 -0
- package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs.map +1 -1
- package/dist-esm/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.mjs +83 -0
- package/dist-esm/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.mjs.map +7 -0
- package/dist-esm/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.mjs +1 -0
- package/dist-esm/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.mjs.map +1 -1
- package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs +1 -0
- package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs.map +1 -1
- package/dist-esm/lib/editor/managers/FontManager/FontManager.mjs +2 -0
- package/dist-esm/lib/editor/managers/FontManager/FontManager.mjs.map +1 -1
- package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs +2 -0
- package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs.map +1 -1
- package/dist-esm/lib/editor/managers/InputsManager/InputsManager.mjs +12 -0
- package/dist-esm/lib/editor/managers/InputsManager/InputsManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/ScribbleManager/ScribbleManager.mjs +1 -0
- package/dist-esm/lib/editor/managers/ScribbleManager/ScribbleManager.mjs.map +1 -1
- package/dist-esm/lib/editor/managers/SnapManager/BoundsSnaps.mjs +1 -0
- package/dist-esm/lib/editor/managers/SnapManager/BoundsSnaps.mjs.map +1 -1
- package/dist-esm/lib/editor/managers/SnapManager/HandleSnaps.mjs +1 -0
- package/dist-esm/lib/editor/managers/SnapManager/HandleSnaps.mjs.map +1 -1
- package/dist-esm/lib/editor/managers/SnapManager/SnapManager.mjs +2 -1
- package/dist-esm/lib/editor/managers/SnapManager/SnapManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.mjs +1 -0
- package/dist-esm/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.mjs.map +1 -1
- package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs +1 -0
- package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs.map +1 -1
- package/dist-esm/lib/editor/managers/ThemeManager/ThemeManager.mjs +1 -0
- package/dist-esm/lib/editor/managers/ThemeManager/ThemeManager.mjs.map +1 -1
- package/dist-esm/lib/editor/managers/ThemeManager/defaultThemes.mjs +14 -0
- package/dist-esm/lib/editor/managers/ThemeManager/defaultThemes.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/TickManager/TickManager.mjs +1 -0
- package/dist-esm/lib/editor/managers/TickManager/TickManager.mjs.map +1 -1
- package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs +2 -0
- package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs.map +1 -1
- package/dist-esm/lib/editor/overlays/OverlayManager.mjs +136 -0
- package/dist-esm/lib/editor/overlays/OverlayManager.mjs.map +7 -0
- package/dist-esm/lib/editor/overlays/OverlayUtil.mjs +72 -0
- package/dist-esm/lib/editor/overlays/OverlayUtil.mjs.map +7 -0
- package/dist-esm/lib/editor/overlays/ShapeIndicatorOverlayUtil.mjs +141 -0
- package/dist-esm/lib/editor/overlays/ShapeIndicatorOverlayUtil.mjs.map +7 -0
- package/dist-esm/lib/editor/overlays/getOverlayDisplayValues.mjs +19 -0
- package/dist-esm/lib/editor/overlays/getOverlayDisplayValues.mjs.map +7 -0
- package/dist-esm/lib/editor/shapes/BaseFrameLikeShapeUtil.mjs +59 -0
- package/dist-esm/lib/editor/shapes/BaseFrameLikeShapeUtil.mjs.map +7 -0
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +36 -23
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs +32 -2
- package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/editor/tools/StateNode.mjs +1 -0
- package/dist-esm/lib/editor/tools/StateNode.mjs.map +1 -1
- package/dist-esm/lib/editor/types/event-types.mjs.map +2 -2
- package/dist-esm/lib/exports/ExportDelay.mjs +1 -0
- package/dist-esm/lib/exports/ExportDelay.mjs.map +1 -1
- package/dist-esm/lib/exports/StyleEmbedder.mjs +1 -0
- package/dist-esm/lib/exports/StyleEmbedder.mjs.map +1 -1
- package/dist-esm/lib/exports/fetchCache.mjs +2 -2
- package/dist-esm/lib/exports/fetchCache.mjs.map +2 -2
- package/dist-esm/lib/exports/getSvgJsx.mjs +2 -1
- package/dist-esm/lib/exports/getSvgJsx.mjs.map +2 -2
- package/dist-esm/lib/hooks/EditorComponentsContext.mjs.map +2 -2
- package/dist-esm/lib/hooks/useCanvasEvents.mjs +25 -4
- package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useEditorComponents.mjs +0 -28
- package/dist-esm/lib/hooks/useEditorComponents.mjs.map +2 -2
- package/dist-esm/lib/hooks/usePeerIds.mjs +2 -40
- package/dist-esm/lib/hooks/usePeerIds.mjs.map +2 -2
- package/dist-esm/lib/hooks/useShapeCulling.mjs +2 -1
- package/dist-esm/lib/hooks/useShapeCulling.mjs.map +2 -2
- package/dist-esm/lib/options.mjs +1 -0
- package/dist-esm/lib/options.mjs.map +2 -2
- package/dist-esm/lib/primitives/Vec.mjs +3 -0
- package/dist-esm/lib/primitives/Vec.mjs.map +1 -1
- package/dist-esm/lib/primitives/geometry/Circle2d.mjs +1 -0
- package/dist-esm/lib/primitives/geometry/Circle2d.mjs.map +1 -1
- package/dist-esm/lib/primitives/geometry/Ellipse2d.mjs +1 -0
- package/dist-esm/lib/primitives/geometry/Ellipse2d.mjs.map +1 -1
- package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +2 -0
- package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +1 -1
- package/dist-esm/lib/primitives/geometry/Stadium2d.mjs +1 -0
- package/dist-esm/lib/primitives/geometry/Stadium2d.mjs.map +1 -1
- package/dist-esm/lib/utils/EditorAtom.mjs +2 -0
- package/dist-esm/lib/utils/EditorAtom.mjs.map +1 -1
- package/dist-esm/lib/utils/reparenting.mjs +20 -7
- package/dist-esm/lib/utils/reparenting.mjs.map +2 -2
- package/dist-esm/lib/utils/sync/TLLocalSyncClient.mjs +5 -0
- package/dist-esm/lib/utils/sync/TLLocalSyncClient.mjs.map +2 -2
- package/dist-esm/version.mjs +4 -4
- package/dist-esm/version.mjs.map +1 -1
- package/editor.css +4 -243
- package/package.json +7 -7
- package/src/index.ts +18 -39
- package/src/lib/TldrawEditor.tsx +9 -0
- package/src/lib/components/MenuClickCapture.tsx +124 -64
- package/src/lib/components/default-components/CanvasOverlays.tsx +208 -0
- package/src/lib/components/default-components/DefaultCanvas.tsx +51 -322
- package/src/lib/editor/Editor.test.ts +3 -1
- package/src/lib/editor/Editor.ts +167 -38
- package/src/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.ts +98 -0
- package/src/lib/editor/managers/InputsManager/InputsManager.ts +12 -0
- package/src/lib/editor/managers/SnapManager/SnapManager.test.ts +13 -2
- package/src/lib/editor/managers/SnapManager/SnapManager.ts +1 -1
- package/src/lib/editor/managers/ThemeManager/defaultThemes.ts +14 -0
- package/src/lib/editor/overlays/OverlayManager.ts +183 -0
- package/src/lib/editor/overlays/OverlayUtil.ts +143 -0
- package/src/lib/editor/overlays/ShapeIndicatorOverlayUtil.ts +216 -0
- package/src/lib/editor/overlays/getOverlayDisplayValues.ts +51 -0
- package/src/lib/editor/shapes/BaseFrameLikeShapeUtil.tsx +128 -0
- package/src/lib/editor/shapes/ShapeUtil.ts +45 -26
- package/src/lib/editor/shapes/group/GroupShapeUtil.tsx +40 -3
- package/src/lib/editor/types/event-types.ts +2 -0
- package/src/lib/exports/fetchCache.ts +2 -4
- package/src/lib/exports/getSvgJsx.test.ts +3 -1
- package/src/lib/exports/getSvgJsx.tsx +2 -1
- package/src/lib/hooks/EditorComponentsContext.tsx +0 -27
- package/src/lib/hooks/useCanvasEvents.ts +45 -3
- package/src/lib/hooks/useEditorComponents.tsx +0 -28
- package/src/lib/hooks/usePeerIds.ts +6 -55
- package/src/lib/hooks/useShapeCulling.tsx +3 -1
- package/src/lib/options.ts +7 -0
- package/src/lib/utils/reparenting.ts +22 -9
- package/src/lib/utils/sync/TLLocalSyncClient.ts +3 -0
- package/src/version.ts +4 -4
- package/dist-cjs/lib/components/GeometryDebuggingView.js +0 -115
- package/dist-cjs/lib/components/GeometryDebuggingView.js.map +0 -7
- package/dist-cjs/lib/components/LiveCollaborators.js +0 -151
- package/dist-cjs/lib/components/LiveCollaborators.js.map +0 -7
- package/dist-cjs/lib/components/default-components/CanvasShapeIndicators.js +0 -227
- package/dist-cjs/lib/components/default-components/CanvasShapeIndicators.js.map +0 -7
- package/dist-cjs/lib/components/default-components/DefaultBrush.js +0 -38
- package/dist-cjs/lib/components/default-components/DefaultBrush.js.map +0 -7
- package/dist-cjs/lib/components/default-components/DefaultCollaboratorHint.js +0 -71
- package/dist-cjs/lib/components/default-components/DefaultCollaboratorHint.js.map +0 -7
- package/dist-cjs/lib/components/default-components/DefaultCursor.js +0 -59
- package/dist-cjs/lib/components/default-components/DefaultCursor.js.map +0 -7
- package/dist-cjs/lib/components/default-components/DefaultHandle.js +0 -56
- package/dist-cjs/lib/components/default-components/DefaultHandle.js.map +0 -7
- package/dist-cjs/lib/components/default-components/DefaultHandles.js +0 -28
- package/dist-cjs/lib/components/default-components/DefaultHandles.js.map +0 -7
- package/dist-cjs/lib/components/default-components/DefaultScribble.js +0 -51
- package/dist-cjs/lib/components/default-components/DefaultScribble.js.map +0 -7
- package/dist-cjs/lib/components/default-components/DefaultSelectionForeground.js +0 -69
- package/dist-cjs/lib/components/default-components/DefaultSelectionForeground.js.map +0 -7
- package/dist-cjs/lib/components/default-components/DefaultShapeIndicator.js +0 -107
- package/dist-cjs/lib/components/default-components/DefaultShapeIndicator.js.map +0 -7
- package/dist-cjs/lib/components/default-components/DefaultShapeIndicatorErrorFallback.js +0 -28
- package/dist-cjs/lib/components/default-components/DefaultShapeIndicatorErrorFallback.js.map +0 -7
- package/dist-cjs/lib/components/default-components/DefaultShapeIndicators.js +0 -101
- package/dist-cjs/lib/components/default-components/DefaultShapeIndicators.js.map +0 -7
- package/dist-cjs/lib/components/default-components/DefaultSnapIndictor.js +0 -170
- package/dist-cjs/lib/components/default-components/DefaultSnapIndictor.js.map +0 -7
- package/dist-cjs/lib/hooks/useHandleEvents.js +0 -100
- package/dist-cjs/lib/hooks/useHandleEvents.js.map +0 -7
- package/dist-cjs/lib/hooks/useSelectionEvents.js +0 -98
- package/dist-cjs/lib/hooks/useSelectionEvents.js.map +0 -7
- package/dist-esm/lib/components/GeometryDebuggingView.mjs +0 -95
- package/dist-esm/lib/components/GeometryDebuggingView.mjs.map +0 -7
- package/dist-esm/lib/components/LiveCollaborators.mjs +0 -134
- package/dist-esm/lib/components/LiveCollaborators.mjs.map +0 -7
- package/dist-esm/lib/components/default-components/CanvasShapeIndicators.mjs +0 -207
- package/dist-esm/lib/components/default-components/CanvasShapeIndicators.mjs.map +0 -7
- package/dist-esm/lib/components/default-components/DefaultBrush.mjs +0 -18
- package/dist-esm/lib/components/default-components/DefaultBrush.mjs.map +0 -7
- package/dist-esm/lib/components/default-components/DefaultCollaboratorHint.mjs +0 -41
- package/dist-esm/lib/components/default-components/DefaultCollaboratorHint.mjs.map +0 -7
- package/dist-esm/lib/components/default-components/DefaultCursor.mjs +0 -29
- package/dist-esm/lib/components/default-components/DefaultCursor.mjs.map +0 -7
- package/dist-esm/lib/components/default-components/DefaultHandle.mjs +0 -26
- package/dist-esm/lib/components/default-components/DefaultHandle.mjs.map +0 -7
- package/dist-esm/lib/components/default-components/DefaultHandles.mjs +0 -8
- package/dist-esm/lib/components/default-components/DefaultHandles.mjs.map +0 -7
- package/dist-esm/lib/components/default-components/DefaultScribble.mjs +0 -21
- package/dist-esm/lib/components/default-components/DefaultScribble.mjs.map +0 -7
- package/dist-esm/lib/components/default-components/DefaultSelectionForeground.mjs +0 -39
- package/dist-esm/lib/components/default-components/DefaultSelectionForeground.mjs.map +0 -7
- package/dist-esm/lib/components/default-components/DefaultShapeIndicator.mjs +0 -77
- package/dist-esm/lib/components/default-components/DefaultShapeIndicator.mjs.map +0 -7
- package/dist-esm/lib/components/default-components/DefaultShapeIndicatorErrorFallback.mjs +0 -8
- package/dist-esm/lib/components/default-components/DefaultShapeIndicatorErrorFallback.mjs.map +0 -7
- package/dist-esm/lib/components/default-components/DefaultShapeIndicators.mjs +0 -81
- package/dist-esm/lib/components/default-components/DefaultShapeIndicators.mjs.map +0 -7
- package/dist-esm/lib/components/default-components/DefaultSnapIndictor.mjs +0 -142
- package/dist-esm/lib/components/default-components/DefaultSnapIndictor.mjs.map +0 -7
- package/dist-esm/lib/hooks/useHandleEvents.mjs +0 -70
- package/dist-esm/lib/hooks/useHandleEvents.mjs.map +0 -7
- package/dist-esm/lib/hooks/useSelectionEvents.mjs +0 -78
- package/dist-esm/lib/hooks/useSelectionEvents.mjs.map +0 -7
- package/src/lib/components/GeometryDebuggingView.tsx +0 -108
- package/src/lib/components/LiveCollaborators.tsx +0 -174
- package/src/lib/components/default-components/CanvasShapeIndicators.tsx +0 -289
- package/src/lib/components/default-components/DefaultBrush.tsx +0 -35
- package/src/lib/components/default-components/DefaultCollaboratorHint.tsx +0 -52
- package/src/lib/components/default-components/DefaultCursor.tsx +0 -59
- package/src/lib/components/default-components/DefaultHandle.tsx +0 -42
- package/src/lib/components/default-components/DefaultHandles.tsx +0 -15
- package/src/lib/components/default-components/DefaultScribble.tsx +0 -31
- package/src/lib/components/default-components/DefaultSelectionForeground.tsx +0 -50
- package/src/lib/components/default-components/DefaultShapeIndicator.tsx +0 -104
- package/src/lib/components/default-components/DefaultShapeIndicatorErrorFallback.tsx +0 -9
- package/src/lib/components/default-components/DefaultShapeIndicators.tsx +0 -116
- package/src/lib/components/default-components/DefaultSnapIndictor.tsx +0 -174
- package/src/lib/hooks/useHandleEvents.ts +0 -88
- package/src/lib/hooks/useSelectionEvents.ts +0 -97
package/editor.css
CHANGED
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
/* User handles need to be above selection edges / corners, matters for sticky note clone handles */
|
|
55
55
|
--tl-layer-overlays-user-handles: 105;
|
|
56
56
|
--tl-layer-overlays-user-indicator-hint: 110;
|
|
57
|
-
--tl-layer-overlays-custom: 115;
|
|
58
57
|
--tl-layer-overlays-collaborator-cursor-hint: 120;
|
|
59
58
|
--tl-layer-overlays-collaborator-cursor: 130;
|
|
60
59
|
|
|
@@ -154,14 +153,11 @@
|
|
|
154
153
|
|
|
155
154
|
.tl-theme__light {
|
|
156
155
|
/* Canvas */
|
|
157
|
-
--tl-color-snap: hsl(0, 76%, 60%);
|
|
158
156
|
--tl-color-selection-fill: hsl(210, 100%, 56%, 24%);
|
|
159
157
|
--tl-color-selection-stroke: hsl(214, 84%, 56%);
|
|
160
158
|
--tl-color-background: hsl(210, 20%, 98%);
|
|
161
159
|
/* if you ever update --tl-color-background, update the hardcoded values in theme-init.js and globals.css
|
|
162
160
|
they're there to make sure the background color matches the user's preference before the actual app loads*/
|
|
163
|
-
--tl-color-brush-fill: hsl(0, 0%, 56%, 10.2%);
|
|
164
|
-
--tl-color-brush-stroke: hsl(0, 0%, 56%, 25.1%);
|
|
165
161
|
--tl-color-grid: hsl(0, 0%, 43%);
|
|
166
162
|
/* UI */
|
|
167
163
|
--tl-color-low: hsl(204, 16%, 94%);
|
|
@@ -195,7 +191,7 @@
|
|
|
195
191
|
--tl-color-info: hsl(201, 98%, 41%);
|
|
196
192
|
--tl-color-warning: hsl(27, 98%, 47%);
|
|
197
193
|
--tl-color-danger: hsl(0, 90%, 43%);
|
|
198
|
-
|
|
194
|
+
|
|
199
195
|
/* Shadows */
|
|
200
196
|
--tl-shadow-1: 0px 1px 2px hsl(0, 0%, 0%, 25%), 0px 1px 3px hsl(0, 0%, 0%, 9%);
|
|
201
197
|
--tl-shadow-2:
|
|
@@ -211,14 +207,11 @@
|
|
|
211
207
|
|
|
212
208
|
.tl-theme__dark {
|
|
213
209
|
/* Canvas */
|
|
214
|
-
--tl-color-snap: hsl(0, 76%, 60%);
|
|
215
210
|
--tl-color-selection-fill: hsl(209, 100%, 57%, 20%);
|
|
216
211
|
--tl-color-selection-stroke: hsl(214, 84%, 56%);
|
|
217
212
|
--tl-color-background: hsl(240, 5%, 6.5%);
|
|
218
213
|
/* if you ever update --tl-color-background, update the hardcoded values in theme-init.js and globals.css
|
|
219
214
|
they're there to make sure the background color matches the user's preference before the actual app loads*/
|
|
220
|
-
--tl-color-brush-fill: hsl(0, 0%, 71%, 5.1%);
|
|
221
|
-
--tl-color-brush-stroke: hsl(0, 0%, 71%, 25.1%);
|
|
222
215
|
--tl-color-grid: hsl(0, 0%, 40%);
|
|
223
216
|
/* UI */
|
|
224
217
|
--tl-color-low: hsl(260, 4.5%, 10.5%);
|
|
@@ -252,7 +245,7 @@
|
|
|
252
245
|
--tl-color-info: hsl(199, 92%, 56%);
|
|
253
246
|
--tl-color-warning: hsl(36, 100%, 57%);
|
|
254
247
|
--tl-color-danger: hsl(0, 82%, 66%);
|
|
255
|
-
|
|
248
|
+
|
|
256
249
|
/* Shadows */
|
|
257
250
|
--tl-shadow-1:
|
|
258
251
|
0px 1px 2px hsl(0, 0%, 0%, 16.1%), 0px 1px 3px hsl(0, 0%, 0%, 22%),
|
|
@@ -324,26 +317,6 @@ input,
|
|
|
324
317
|
z-index: var(--tl-layer-canvas-shapes);
|
|
325
318
|
}
|
|
326
319
|
|
|
327
|
-
.tl-overlays {
|
|
328
|
-
position: absolute;
|
|
329
|
-
top: 0px;
|
|
330
|
-
left: 0px;
|
|
331
|
-
height: 100%;
|
|
332
|
-
width: 100%;
|
|
333
|
-
contain: strict;
|
|
334
|
-
pointer-events: none;
|
|
335
|
-
z-index: var(--tl-layer-canvas-overlays);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
.tl-overlays__item {
|
|
339
|
-
position: absolute;
|
|
340
|
-
top: 0px;
|
|
341
|
-
left: 0px;
|
|
342
|
-
overflow: visible;
|
|
343
|
-
pointer-events: none;
|
|
344
|
-
transform-origin: top left;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
320
|
.tl-svg-context {
|
|
348
321
|
position: absolute;
|
|
349
322
|
top: 0px;
|
|
@@ -399,62 +372,6 @@ input,
|
|
|
399
372
|
|
|
400
373
|
/* --------------- Overlay Stack --------------- */
|
|
401
374
|
|
|
402
|
-
/* back of the stack, behind user's stuff */
|
|
403
|
-
.tl-collaborator__scribble {
|
|
404
|
-
z-index: var(--tl-layer-overlays-collaborator-scribble);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
.tl-collaborator__brush {
|
|
408
|
-
z-index: var(--tl-layer-overlays-collaborator-brush);
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
.tl-collaborator__shape-indicator {
|
|
412
|
-
z-index: var(--tl-layer-overlays-collaborator-shape-indicator);
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
.tl-user-scribble {
|
|
416
|
-
z-index: var(--tl-layer-overlays-user-scribble);
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
.tl-user-brush {
|
|
420
|
-
z-index: var(--tl-layer-overlays-user-brush);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
.tl-user-handles {
|
|
424
|
-
z-index: var(--tl-layer-overlays-user-handles);
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
.tl-user-snapline {
|
|
428
|
-
z-index: var(--tl-layer-overlays-user-snapline);
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
.tl-selection__fg {
|
|
432
|
-
pointer-events: none;
|
|
433
|
-
z-index: var(--tl-layer-overlays-selection-fg);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
.tl-user-indicator__hint {
|
|
437
|
-
z-index: var(--tl-layer-overlays-user-indicator-hint);
|
|
438
|
-
stroke-width: calc(2.5px * var(--tl-scale));
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
.tl-custom-overlays {
|
|
442
|
-
z-index: var(--tl-layer-overlays-custom);
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
/* behind collaborator cursor */
|
|
446
|
-
.tl-collaborator__cursor-hint {
|
|
447
|
-
z-index: var(--tl-layer-overlays-collaborator-cursor-hint);
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
.tl-collaborator__cursor {
|
|
451
|
-
z-index: var(--tl-layer-overlays-collaborator-cursor);
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
.tl-cursor {
|
|
455
|
-
overflow: visible;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
375
|
/* -------------- Selection foreground -------------- */
|
|
459
376
|
|
|
460
377
|
.tl-selection__bg {
|
|
@@ -466,49 +383,6 @@ input,
|
|
|
466
383
|
pointer-events: all;
|
|
467
384
|
}
|
|
468
385
|
|
|
469
|
-
.tl-selection__fg__outline {
|
|
470
|
-
fill: none;
|
|
471
|
-
pointer-events: none;
|
|
472
|
-
stroke: var(--tl-color-selection-stroke);
|
|
473
|
-
stroke-width: calc(1.5px * var(--tl-scale));
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
.tl-corner-handle {
|
|
477
|
-
pointer-events: none;
|
|
478
|
-
stroke: var(--tl-color-selection-stroke);
|
|
479
|
-
fill: var(--tl-color-background);
|
|
480
|
-
stroke-width: calc(1.5px * var(--tl-scale));
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
.tl-text-handle {
|
|
484
|
-
pointer-events: none;
|
|
485
|
-
fill: var(--tl-color-selection-stroke);
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
.tl-corner-crop-handle {
|
|
489
|
-
pointer-events: none;
|
|
490
|
-
fill: none;
|
|
491
|
-
stroke: var(--tl-color-selection-stroke);
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
.tl-corner-crop-edge-handle {
|
|
495
|
-
pointer-events: none;
|
|
496
|
-
fill: none;
|
|
497
|
-
stroke: var(--tl-color-selection-stroke);
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
.tl-mobile-rotate__bg {
|
|
501
|
-
pointer-events: all;
|
|
502
|
-
cursor: var(--tl-cursor-grab);
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
.tl-mobile-rotate__fg {
|
|
506
|
-
pointer-events: none;
|
|
507
|
-
stroke: var(--tl-color-selection-stroke);
|
|
508
|
-
fill: var(--tl-color-background);
|
|
509
|
-
stroke-width: calc(1.5px * var(--tl-scale));
|
|
510
|
-
}
|
|
511
|
-
|
|
512
386
|
.tl-transparent {
|
|
513
387
|
fill: transparent;
|
|
514
388
|
stroke: transparent;
|
|
@@ -534,7 +408,6 @@ input,
|
|
|
534
408
|
overflow: hidden;
|
|
535
409
|
text-overflow: ellipsis;
|
|
536
410
|
font-size: 12px;
|
|
537
|
-
font-family: var(--font-body);
|
|
538
411
|
border-radius: var(--tl-radius-2);
|
|
539
412
|
color: var(--tl-color-selected-contrast);
|
|
540
413
|
}
|
|
@@ -552,7 +425,6 @@ input,
|
|
|
552
425
|
overflow: hidden;
|
|
553
426
|
text-overflow: ellipsis;
|
|
554
427
|
font-size: 12px;
|
|
555
|
-
font-family: var(--font-body);
|
|
556
428
|
text-shadow: var(--tl-text-outline);
|
|
557
429
|
color: var(--tl-color-selected-contrast);
|
|
558
430
|
}
|
|
@@ -568,7 +440,6 @@ input,
|
|
|
568
440
|
position: absolute;
|
|
569
441
|
padding: 3px 6px;
|
|
570
442
|
font-size: 12px;
|
|
571
|
-
font-family: var(--font-body);
|
|
572
443
|
opacity: 1;
|
|
573
444
|
border-radius: var(--tl-radius-2);
|
|
574
445
|
}
|
|
@@ -579,7 +450,6 @@ input,
|
|
|
579
450
|
white-space: nowrap;
|
|
580
451
|
padding: 3px 6px;
|
|
581
452
|
font-size: 12px;
|
|
582
|
-
font-family: var(--font-body);
|
|
583
453
|
pointer-events: none;
|
|
584
454
|
z-index: var(--tl-layer-cursor);
|
|
585
455
|
margin-top: 16px;
|
|
@@ -1007,41 +877,6 @@ input,
|
|
|
1007
877
|
}
|
|
1008
878
|
}
|
|
1009
879
|
|
|
1010
|
-
/* ---------------------- Brush --------------------- */
|
|
1011
|
-
|
|
1012
|
-
.tl-brush {
|
|
1013
|
-
stroke-width: calc(var(--tl-scale) * 1px);
|
|
1014
|
-
contain: size layout;
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
.tl-brush__default {
|
|
1018
|
-
stroke: var(--tl-color-brush-stroke);
|
|
1019
|
-
fill: var(--tl-color-brush-fill);
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
|
-
/* -------------------- Scribble -------------------- */
|
|
1023
|
-
|
|
1024
|
-
.tl-scribble {
|
|
1025
|
-
stroke-linejoin: round;
|
|
1026
|
-
stroke-linecap: round;
|
|
1027
|
-
pointer-events: none;
|
|
1028
|
-
contain: size layout;
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
/* ---------------------- Snaps --------------------- */
|
|
1032
|
-
|
|
1033
|
-
.tl-snap-indicator {
|
|
1034
|
-
stroke: var(--tl-color-snap);
|
|
1035
|
-
stroke-width: calc(1px * var(--tl-scale));
|
|
1036
|
-
fill: none;
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
.tl-snap-point {
|
|
1040
|
-
stroke: var(--tl-color-snap);
|
|
1041
|
-
stroke-width: calc(1px * var(--tl-scale));
|
|
1042
|
-
fill: none;
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
880
|
/* ---------------- Hyperlink Button ---------------- */
|
|
1046
881
|
|
|
1047
882
|
.tl-hyperlink-button {
|
|
@@ -1095,51 +930,6 @@ input,
|
|
|
1095
930
|
display: none;
|
|
1096
931
|
}
|
|
1097
932
|
|
|
1098
|
-
/* --------------------- Handles -------------------- */
|
|
1099
|
-
|
|
1100
|
-
.tl-handle {
|
|
1101
|
-
pointer-events: all;
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
.tl-handle__bg {
|
|
1105
|
-
fill: transparent;
|
|
1106
|
-
stroke: transparent;
|
|
1107
|
-
pointer-events: all;
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
.tl-handle__fg {
|
|
1111
|
-
fill: var(--tl-color-selected-contrast);
|
|
1112
|
-
stroke: var(--tl-color-selection-stroke);
|
|
1113
|
-
stroke-width: calc(1.5px * var(--tl-scale));
|
|
1114
|
-
pointer-events: none;
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
.tl-handle__create {
|
|
1118
|
-
opacity: 0;
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
.tl-handle__clone > .tl-handle__fg {
|
|
1122
|
-
fill: var(--tl-color-selection-stroke);
|
|
1123
|
-
stroke: none;
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
.tl-handle__bg:active {
|
|
1127
|
-
fill: none;
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
.tl-container[data-coarse='true'] .tl-handle__bg:active {
|
|
1131
|
-
fill: var(--tl-color-selection-fill);
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
.tl-container[data-coarse='true'] .tl-handle__create {
|
|
1135
|
-
opacity: 1;
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
.tl-rotate-corner:not(:hover),
|
|
1139
|
-
.tl-resize-handle:not(:hover) {
|
|
1140
|
-
cursor: none;
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
933
|
/* ----------------- Shape indicator ---------------- */
|
|
1144
934
|
|
|
1145
935
|
.tl-shape-indicator {
|
|
@@ -1149,10 +939,11 @@ input,
|
|
|
1149
939
|
contain: size layout;
|
|
1150
940
|
}
|
|
1151
941
|
|
|
1152
|
-
.tl-canvas-
|
|
942
|
+
.tl-canvas-overlays {
|
|
1153
943
|
position: absolute;
|
|
1154
944
|
inset: 0;
|
|
1155
945
|
pointer-events: none;
|
|
946
|
+
z-index: var(--tl-layer-canvas-overlays);
|
|
1156
947
|
}
|
|
1157
948
|
|
|
1158
949
|
/* ---------------------- Shape --------------------- */
|
|
@@ -1227,36 +1018,6 @@ input,
|
|
|
1227
1018
|
height: max-content;
|
|
1228
1019
|
}
|
|
1229
1020
|
|
|
1230
|
-
.tl-arrow-hint {
|
|
1231
|
-
stroke: var(--tl-color-text-1);
|
|
1232
|
-
fill: none;
|
|
1233
|
-
stroke-linecap: round;
|
|
1234
|
-
overflow: visible;
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
.tl-arrow-hint-handle {
|
|
1238
|
-
fill: var(--tl-color-selected-contrast);
|
|
1239
|
-
stroke: var(--tl-color-selection-stroke);
|
|
1240
|
-
stroke-width: calc(1.5px * var(--tl-scale));
|
|
1241
|
-
r: calc(4px * var(--tl-scale));
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
.tl-arrow-hint-snap {
|
|
1245
|
-
stroke: transparent;
|
|
1246
|
-
fill: var(--tl-color-selection-fill);
|
|
1247
|
-
r: calc(12px * var(--tl-scale));
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
.tl-arrow-hint-snap__none,
|
|
1251
|
-
.tl-arrow-hint-snap__center,
|
|
1252
|
-
.tl-arrow-hint-snap__axis {
|
|
1253
|
-
display: none;
|
|
1254
|
-
}
|
|
1255
|
-
|
|
1256
|
-
.tl-arrow-hint-snap__edge {
|
|
1257
|
-
r: calc(8px * var(--tl-scale));
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
1021
|
/* ------------------- Bookmark shape ------------------- */
|
|
1261
1022
|
|
|
1262
1023
|
.tl-bookmark__container {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tldraw/editor",
|
|
3
3
|
"description": "tldraw infinite canvas SDK (editor).",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "tldraw Inc.",
|
|
7
7
|
"email": "hello@tldraw.com"
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"@tiptap/core": "^3.12.1",
|
|
50
50
|
"@tiptap/pm": "^3.12.1",
|
|
51
51
|
"@tiptap/react": "^3.12.1",
|
|
52
|
-
"@tldraw/state": "
|
|
53
|
-
"@tldraw/state-react": "
|
|
54
|
-
"@tldraw/store": "
|
|
55
|
-
"@tldraw/tlschema": "
|
|
56
|
-
"@tldraw/utils": "
|
|
57
|
-
"@tldraw/validate": "
|
|
52
|
+
"@tldraw/state": "5.0.0",
|
|
53
|
+
"@tldraw/state-react": "5.0.0",
|
|
54
|
+
"@tldraw/store": "5.0.0",
|
|
55
|
+
"@tldraw/tlschema": "5.0.0",
|
|
56
|
+
"@tldraw/utils": "5.0.0",
|
|
57
|
+
"@tldraw/validate": "5.0.0",
|
|
58
58
|
"classnames": "^2.5.1",
|
|
59
59
|
"eventemitter3": "^4.0.7",
|
|
60
60
|
"idb": "^7.1.1",
|
package/src/index.ts
CHANGED
|
@@ -14,62 +14,24 @@ export * from '@tldraw/utils'
|
|
|
14
14
|
export * from '@tldraw/validate'
|
|
15
15
|
|
|
16
16
|
export { DefaultBackground } from './lib/components/default-components/DefaultBackground'
|
|
17
|
-
export { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'
|
|
18
17
|
export {
|
|
19
18
|
DefaultCanvas,
|
|
20
19
|
type TLCanvasComponentProps,
|
|
21
20
|
} from './lib/components/default-components/DefaultCanvas'
|
|
22
|
-
export {
|
|
23
|
-
DefaultCollaboratorHint,
|
|
24
|
-
type TLCollaboratorHintProps,
|
|
25
|
-
} from './lib/components/default-components/DefaultCollaboratorHint'
|
|
26
|
-
export {
|
|
27
|
-
DefaultCursor,
|
|
28
|
-
type TLCursorProps,
|
|
29
|
-
} from './lib/components/default-components/DefaultCursor'
|
|
30
21
|
export {
|
|
31
22
|
DefaultErrorFallback,
|
|
32
23
|
type TLErrorFallbackComponent,
|
|
33
24
|
} from './lib/components/default-components/DefaultErrorFallback'
|
|
34
25
|
export { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'
|
|
35
|
-
export {
|
|
36
|
-
DefaultHandle,
|
|
37
|
-
type TLHandleProps,
|
|
38
|
-
} from './lib/components/default-components/DefaultHandle'
|
|
39
|
-
export {
|
|
40
|
-
DefaultHandles,
|
|
41
|
-
type TLHandlesProps,
|
|
42
|
-
} from './lib/components/default-components/DefaultHandles'
|
|
43
|
-
export {
|
|
44
|
-
DefaultScribble,
|
|
45
|
-
type TLScribbleProps,
|
|
46
|
-
} from './lib/components/default-components/DefaultScribble'
|
|
47
26
|
export {
|
|
48
27
|
DefaultSelectionBackground,
|
|
49
28
|
type TLSelectionBackgroundProps,
|
|
50
29
|
} from './lib/components/default-components/DefaultSelectionBackground'
|
|
51
|
-
export {
|
|
52
|
-
DefaultSelectionForeground,
|
|
53
|
-
type TLSelectionForegroundProps,
|
|
54
|
-
} from './lib/components/default-components/DefaultSelectionForeground'
|
|
55
30
|
export { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'
|
|
56
|
-
export {
|
|
57
|
-
DefaultShapeIndicator,
|
|
58
|
-
type TLShapeIndicatorProps,
|
|
59
|
-
} from './lib/components/default-components/DefaultShapeIndicator'
|
|
60
|
-
export { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'
|
|
61
|
-
export {
|
|
62
|
-
DefaultShapeIndicators,
|
|
63
|
-
type TLShapeIndicatorsProps,
|
|
64
|
-
} from './lib/components/default-components/DefaultShapeIndicators'
|
|
65
31
|
export {
|
|
66
32
|
DefaultShapeWrapper,
|
|
67
33
|
type TLShapeWrapperProps,
|
|
68
34
|
} from './lib/components/default-components/DefaultShapeWrapper'
|
|
69
|
-
export {
|
|
70
|
-
DefaultSnapIndicator,
|
|
71
|
-
type TLSnapIndicatorProps,
|
|
72
|
-
} from './lib/components/default-components/DefaultSnapIndictor'
|
|
73
35
|
export { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'
|
|
74
36
|
export { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'
|
|
75
37
|
export {
|
|
@@ -174,6 +136,7 @@ export {
|
|
|
174
136
|
export { DEFAULT_THEME } from './lib/editor/managers/ThemeManager/defaultThemes'
|
|
175
137
|
export { ThemeManager, resolveThemes } from './lib/editor/managers/ThemeManager/ThemeManager'
|
|
176
138
|
export { TickManager } from './lib/editor/managers/TickManager/TickManager'
|
|
139
|
+
export { CollaboratorsManager } from './lib/editor/managers/CollaboratorsManager/CollaboratorsManager'
|
|
177
140
|
export { PerformanceApiAdapter } from './lib/editor/managers/PerformanceManager/PerformanceApiAdapter'
|
|
178
141
|
export { PerformanceManager } from './lib/editor/managers/PerformanceManager/PerformanceManager'
|
|
179
142
|
export {
|
|
@@ -191,6 +154,7 @@ export {
|
|
|
191
154
|
} from './lib/editor/managers/PerformanceManager/perf-types'
|
|
192
155
|
export { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'
|
|
193
156
|
export { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'
|
|
157
|
+
export { BaseFrameLikeShapeUtil } from './lib/editor/shapes/BaseFrameLikeShapeUtil'
|
|
194
158
|
export { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'
|
|
195
159
|
export {
|
|
196
160
|
ShapeUtil,
|
|
@@ -210,6 +174,22 @@ export {
|
|
|
210
174
|
type TLShapeUtilCanvasSvgDef,
|
|
211
175
|
type TLShapeUtilConstructor,
|
|
212
176
|
} from './lib/editor/shapes/ShapeUtil'
|
|
177
|
+
export {
|
|
178
|
+
getOverlayDisplayValues,
|
|
179
|
+
type OverlayOptionsWithDisplayValues,
|
|
180
|
+
} from './lib/editor/overlays/getOverlayDisplayValues'
|
|
181
|
+
export { OverlayManager, type TLOverlayEntry } from './lib/editor/overlays/OverlayManager'
|
|
182
|
+
export {
|
|
183
|
+
OverlayUtil,
|
|
184
|
+
type TLAnyOverlayUtilConstructor,
|
|
185
|
+
type TLOverlay,
|
|
186
|
+
type TLOverlayUtilConstructor,
|
|
187
|
+
} from './lib/editor/overlays/OverlayUtil'
|
|
188
|
+
export {
|
|
189
|
+
ShapeIndicatorOverlayUtil,
|
|
190
|
+
strokeShapeIndicators,
|
|
191
|
+
type TLShapeIndicatorOverlay,
|
|
192
|
+
} from './lib/editor/overlays/ShapeIndicatorOverlayUtil'
|
|
213
193
|
export {
|
|
214
194
|
getPerfectDashProps,
|
|
215
195
|
type PerfectDashTerminal,
|
|
@@ -344,7 +324,6 @@ export {
|
|
|
344
324
|
useUniqueSafeId,
|
|
345
325
|
type SafeId,
|
|
346
326
|
} from './lib/hooks/useSafeId'
|
|
347
|
-
export { useSelectionEvents } from './lib/hooks/useSelectionEvents'
|
|
348
327
|
export { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'
|
|
349
328
|
export { useTransform } from './lib/hooks/useTransform'
|
|
350
329
|
export { useViewportHeight } from './lib/hooks/useViewportHeight'
|
package/src/lib/TldrawEditor.tsx
CHANGED
|
@@ -33,6 +33,7 @@ import { TLAnyShapeUtilConstructor } from './config/defaultShapes'
|
|
|
33
33
|
import { TLEditorSnapshot } from './config/TLEditorSnapshot'
|
|
34
34
|
import { Editor } from './editor/Editor'
|
|
35
35
|
import { resolveThemes } from './editor/managers/ThemeManager/ThemeManager'
|
|
36
|
+
import { TLAnyOverlayUtilConstructor } from './editor/overlays/OverlayUtil'
|
|
36
37
|
import { TLStateNodeConstructor } from './editor/tools/StateNode'
|
|
37
38
|
import { TLCameraOptions } from './editor/types/misc-types'
|
|
38
39
|
import { useEditorComponents } from './hooks/EditorComponentsContext'
|
|
@@ -137,6 +138,11 @@ export interface TldrawEditorBaseProps {
|
|
|
137
138
|
*/
|
|
138
139
|
assetUtils?: readonly TLAnyAssetUtilConstructor[]
|
|
139
140
|
|
|
141
|
+
/**
|
|
142
|
+
* An array of overlay utils to use in the editor for canvas overlay UI elements.
|
|
143
|
+
*/
|
|
144
|
+
overlayUtils?: readonly TLAnyOverlayUtilConstructor[]
|
|
145
|
+
|
|
140
146
|
/**
|
|
141
147
|
* An array of tools to add to the editor's state chart.
|
|
142
148
|
*/
|
|
@@ -461,6 +467,7 @@ function TldrawEditorWithReadyStore({
|
|
|
461
467
|
shapeUtils,
|
|
462
468
|
bindingUtils,
|
|
463
469
|
assetUtils,
|
|
470
|
+
overlayUtils,
|
|
464
471
|
user,
|
|
465
472
|
initialState,
|
|
466
473
|
autoFocus = true,
|
|
@@ -532,6 +539,7 @@ function TldrawEditorWithReadyStore({
|
|
|
532
539
|
shapeUtils,
|
|
533
540
|
bindingUtils,
|
|
534
541
|
assetUtils,
|
|
542
|
+
overlayUtils,
|
|
535
543
|
tools,
|
|
536
544
|
getContainer: () => container,
|
|
537
545
|
user,
|
|
@@ -575,6 +583,7 @@ function TldrawEditorWithReadyStore({
|
|
|
575
583
|
colorScheme,
|
|
576
584
|
container,
|
|
577
585
|
options,
|
|
586
|
+
overlayUtils,
|
|
578
587
|
shapeUtils,
|
|
579
588
|
store,
|
|
580
589
|
tools,
|