@yuzhouu/canvas-kit 0.1.2 → 0.1.4
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/README.md +80 -78
- package/_vendor/canvas-core/bindings/bindingUtil.d.ts +45 -0
- package/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
- package/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
- package/_vendor/canvas-core/editor/camera.d.ts +3 -0
- package/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
- package/_vendor/canvas-core/editor/commands.d.ts +131 -0
- package/_vendor/canvas-core/editor/createEditorWithPlugins.d.ts +6 -0
- package/_vendor/canvas-core/editor/edgeScroll.d.ts +5 -0
- package/_vendor/canvas-core/editor/editor.d.ts +559 -0
- package/_vendor/canvas-core/editor/editorComputedHelpers.d.ts +21 -0
- package/_vendor/canvas-core/editor/editorSelectionTransforms.d.ts +6 -0
- package/_vendor/canvas-core/editor/events.d.ts +71 -0
- package/_vendor/canvas-core/editor/historyManager.d.ts +18 -0
- package/_vendor/canvas-core/editor/index.d.ts +11 -0
- package/_vendor/canvas-core/editor/interactions.d.ts +51 -0
- package/_vendor/canvas-core/editor/internal.d.ts +7 -0
- package/_vendor/canvas-core/editor/managers/bindingManager.d.ts +27 -0
- package/_vendor/canvas-core/editor/managers/cameraManager.d.ts +39 -0
- package/_vendor/canvas-core/editor/managers/clipboardManager.d.ts +14 -0
- package/_vendor/canvas-core/editor/managers/documentSnapshotManager.d.ts +28 -0
- package/_vendor/canvas-core/editor/managers/inputsManager.d.ts +44 -0
- package/_vendor/canvas-core/editor/managers/interactionTransientManager.d.ts +55 -0
- package/_vendor/canvas-core/editor/managers/queryManager.d.ts +77 -0
- package/_vendor/canvas-core/editor/managers/queryState.d.ts +18 -0
- package/_vendor/canvas-core/editor/managers/renderWindowManager.d.ts +25 -0
- package/_vendor/canvas-core/editor/managers/selectionGeometry.d.ts +28 -0
- package/_vendor/canvas-core/editor/managers/selectionLayoutManager.d.ts +29 -0
- package/_vendor/canvas-core/editor/managers/selectionManager.d.ts +21 -0
- package/_vendor/canvas-core/editor/managers/selectionOverlayManager.d.ts +24 -0
- package/_vendor/canvas-core/editor/managers/shapeEditingManager.d.ts +29 -0
- package/_vendor/canvas-core/editor/managers/shapeGeometryManager.d.ts +42 -0
- package/_vendor/canvas-core/editor/managers/shapeHierarchyManager.d.ts +55 -0
- package/_vendor/canvas-core/editor/managers/shapeOrder.d.ts +14 -0
- package/_vendor/canvas-core/editor/managers/shapeReparenting.d.ts +6 -0
- package/_vendor/canvas-core/editor/managers/shortcutManager.d.ts +56 -0
- package/_vendor/canvas-core/editor/managers/sideEffectManager.d.ts +23 -0
- package/_vendor/canvas-core/editor/managers/snapCalculations.d.ts +40 -0
- package/_vendor/canvas-core/editor/managers/snapGeometry.d.ts +26 -0
- package/_vendor/canvas-core/editor/managers/snapIndicators.d.ts +22 -0
- package/_vendor/canvas-core/editor/managers/snapManager.d.ts +29 -0
- package/_vendor/canvas-core/editor/managers/snapSnapshotBuilder.d.ts +22 -0
- package/_vendor/canvas-core/editor/managers/snapTypes.d.ts +98 -0
- package/_vendor/canvas-core/editor/managers/spatialIndexManager.d.ts +30 -0
- package/_vendor/canvas-core/editor/managers/toolManager.d.ts +24 -0
- package/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +27 -0
- package/_vendor/canvas-core/editor/renderWindow.d.ts +30 -0
- package/_vendor/canvas-core/editor/resizeGeometry.d.ts +97 -0
- package/_vendor/canvas-core/editor/selection.d.ts +231 -0
- package/_vendor/canvas-core/editor/selectionHandleInteractions.d.ts +11 -0
- package/_vendor/canvas-core/editor/selectionOverlay.d.ts +33 -0
- package/_vendor/canvas-core/editor/stateNode.d.ts +31 -0
- package/_vendor/canvas-core/exports/integrity.d.ts +32 -0
- package/_vendor/canvas-core/exports/svg.d.ts +52 -0
- package/_vendor/canvas-core/geometry/box.d.ts +19 -0
- package/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
- package/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
- package/_vendor/canvas-core/geometry/index.d.ts +8 -0
- package/_vendor/canvas-core/geometry/mat.d.ts +28 -0
- package/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
- package/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
- package/_vendor/canvas-core/geometry/segments.d.ts +5 -0
- package/_vendor/canvas-core/geometry/vec.d.ts +37 -0
- package/_vendor/canvas-core/index.d.ts +59 -0
- package/_vendor/canvas-core/plugins/editorPlugin.d.ts +28 -0
- package/_vendor/canvas-core/plugins/index.d.ts +1 -0
- package/_vendor/canvas-core/reactivity.d.ts +4 -0
- package/_vendor/canvas-core/schema/records.d.ts +112 -0
- package/_vendor/canvas-core/schema/snapshotSupport.d.ts +43 -0
- package/_vendor/canvas-core/schema/snapshots.d.ts +31 -0
- package/_vendor/canvas-core/shapes/capabilities.d.ts +25 -0
- package/_vendor/canvas-core/shapes/colors.d.ts +26 -0
- package/_vendor/canvas-core/shapes/shapeUtil.d.ts +146 -0
- package/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
- package/_vendor/canvas-core/shapes/types.d.ts +2 -0
- package/_vendor/canvas-core/surfaces/actions.d.ts +35 -0
- package/_vendor/canvas-core/surfaces/contextMenu.d.ts +64 -0
- package/_vendor/canvas-core/surfaces/toolbar.d.ts +96 -0
- package/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
- package/_vendor/canvas-core/tools/index.d.ts +2 -0
- package/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
- package/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
- package/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +161 -0
- package/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
- package/_vendor/canvas-core/tools/select/states/draggingSelectionHandleInteractionState.d.ts +15 -0
- package/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
- package/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
- package/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
- package/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
- package/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
- package/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +10 -0
- package/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
- package/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
- package/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
- package/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
- package/_vendor/canvas-core/tools/select/states/translatingState.d.ts +17 -0
- package/_vendor/canvas-react/components/CanvasView.d.ts +14 -0
- package/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
- package/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
- package/_vendor/canvas-react/components/ShapeLayer.d.ts +4 -0
- package/_vendor/canvas-react/components/index.d.ts +2 -0
- package/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
- package/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
- package/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
- package/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
- package/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
- package/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
- package/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
- package/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +1 -0
- package/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
- package/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
- package/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +21 -0
- package/_vendor/canvas-react/dom.d.ts +10 -0
- package/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
- package/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
- package/_vendor/canvas-react/host/canvasOverlayRegistryContext.d.ts +3 -0
- package/_vendor/canvas-react/host/canvasPlugin.d.ts +73 -0
- package/_vendor/canvas-react/host/canvasRendererRegistryContext.d.ts +3 -0
- package/_vendor/canvas-react/host/contextMenuRegistry.d.ts +12 -0
- package/_vendor/canvas-react/host/domEventGuards.d.ts +11 -0
- package/_vendor/canvas-react/host/extension.d.ts +37 -0
- package/_vendor/canvas-react/host/index.d.ts +13 -0
- package/_vendor/canvas-react/host/overlayRegistry.d.ts +18 -0
- package/_vendor/canvas-react/host/pluginHost.d.ts +2 -0
- package/_vendor/canvas-react/host/pluginHostManifest.d.ts +2 -0
- package/_vendor/canvas-react/host/pluginHostRuntime.d.ts +3 -0
- package/_vendor/canvas-react/host/pluginHostTypes.d.ts +102 -0
- package/_vendor/canvas-react/host/pluginHostValidation.d.ts +11 -0
- package/_vendor/canvas-react/host/rendererRegistry.d.ts +12 -0
- package/_vendor/canvas-react/host/toolbarRegistry.d.ts +24 -0
- package/_vendor/canvas-react/index.d.ts +4 -0
- package/_vendor/plugin-arrow/arrowBindingAnchors.d.ts +5 -0
- package/_vendor/plugin-arrow/arrowBindingGeometry.d.ts +28 -0
- package/_vendor/plugin-arrow/arrowBindingUtil.d.ts +27 -0
- package/_vendor/plugin-arrow/arrowGeometry.d.ts +74 -0
- package/_vendor/plugin-arrow/arrowShapeUtil.d.ts +21 -0
- package/_vendor/plugin-arrow/arrowTerminalBindingResolver.d.ts +20 -0
- package/_vendor/plugin-arrow/arrowTerminalCommands.d.ts +12 -0
- package/_vendor/plugin-arrow/arrowTool.d.ts +4 -0
- package/_vendor/plugin-arrow/canvas.d.ts +2 -0
- package/_vendor/plugin-arrow/editor.d.ts +7 -0
- package/_vendor/plugin-arrow/feature.d.ts +3 -0
- package/_vendor/plugin-arrow/index.d.ts +12 -0
- package/_vendor/plugin-arrow/selectionHandleInteractions.d.ts +3 -0
- package/_vendor/plugin-arrow/types.d.ts +31 -0
- package/_vendor/plugin-draw/DrawShapeRenderer.d.ts +10 -0
- package/_vendor/plugin-draw/canvas.d.ts +2 -0
- package/_vendor/plugin-draw/drawGeometry.d.ts +45 -0
- package/_vendor/plugin-draw/drawHitTest.d.ts +11 -0
- package/_vendor/plugin-draw/drawInterpolation.d.ts +5 -0
- package/_vendor/plugin-draw/drawPath.d.ts +37 -0
- package/_vendor/plugin-draw/drawSegments.d.ts +11 -0
- package/_vendor/plugin-draw/drawSelectionTransform.d.ts +18 -0
- package/_vendor/plugin-draw/drawShapeGeometry.d.ts +33 -0
- package/_vendor/plugin-draw/drawShapeUtil.d.ts +21 -0
- package/_vendor/plugin-draw/drawStrokeGeometry.d.ts +17 -0
- package/_vendor/plugin-draw/drawTool.d.ts +6 -0
- package/_vendor/plugin-draw/editor.d.ts +7 -0
- package/_vendor/plugin-draw/feature.d.ts +3 -0
- package/_vendor/plugin-draw/index.d.ts +13 -0
- package/_vendor/plugin-draw/types.d.ts +23 -0
- package/_vendor/plugin-eraser/canvas.d.ts +2 -0
- package/_vendor/plugin-eraser/editor.d.ts +2 -0
- package/_vendor/plugin-eraser/eraserTool.d.ts +5 -0
- package/_vendor/plugin-eraser/feature.d.ts +3 -0
- package/_vendor/plugin-eraser/{index.ts → index.d.ts} +2 -2
- package/_vendor/plugin-frame/canvas.d.ts +9 -0
- package/_vendor/plugin-frame/editor.d.ts +7 -0
- package/_vendor/plugin-frame/feature.d.ts +3 -0
- package/_vendor/plugin-frame/frameShapeUtil.d.ts +23 -0
- package/_vendor/plugin-frame/frameTool.d.ts +6 -0
- package/_vendor/plugin-frame/index.d.ts +6 -0
- package/_vendor/plugin-geo/canvas.d.ts +13 -0
- package/_vendor/plugin-geo/editor.d.ts +7 -0
- package/_vendor/plugin-geo/feature.d.ts +3 -0
- package/_vendor/plugin-geo/geoGeometry.d.ts +8 -0
- package/_vendor/plugin-geo/geoShapeUtil.d.ts +13 -0
- package/_vendor/plugin-geo/geoTools.d.ts +26 -0
- package/_vendor/plugin-geo/index.d.ts +7 -0
- package/_vendor/plugin-geo/types.d.ts +17 -0
- package/_vendor/plugin-group/canvas.d.ts +10 -0
- package/_vendor/plugin-group/editor.d.ts +7 -0
- package/_vendor/plugin-group/feature.d.ts +3 -0
- package/_vendor/plugin-group/groupShapeUtil.d.ts +15 -0
- package/_vendor/plugin-group/index.d.ts +5 -0
- package/_vendor/plugin-image/canvas.d.ts +2 -0
- package/_vendor/plugin-image/crop.d.ts +112 -0
- package/_vendor/plugin-image/cropInteractions.d.ts +3 -0
- package/_vendor/plugin-image/cropSession.d.ts +4 -0
- package/_vendor/plugin-image/editor.d.ts +16 -0
- package/_vendor/plugin-image/feature.d.ts +3 -0
- package/_vendor/plugin-image/imageShapeUtil.d.ts +11 -0
- package/_vendor/plugin-image/index.d.ts +8 -0
- package/_vendor/plugin-image/types.d.ts +37 -0
- package/_vendor/plugin-laser/canvas.d.ts +2 -0
- package/_vendor/plugin-laser/editor.d.ts +2 -0
- package/_vendor/plugin-laser/feature.d.ts +3 -0
- package/_vendor/plugin-laser/{index.ts → index.d.ts} +2 -2
- package/_vendor/plugin-laser/laserTool.d.ts +4 -0
- package/_vendor/plugin-text/arrowLabelBindingUtil.d.ts +42 -0
- package/_vendor/plugin-text/canvas.d.ts +2 -0
- package/_vendor/plugin-text/editor.d.ts +2 -0
- package/_vendor/plugin-text/feature.d.ts +3 -0
- package/_vendor/plugin-text/geoLabelBindingUtil.d.ts +45 -0
- package/_vendor/plugin-text/host/RichTextEditingBox.d.ts +5 -0
- package/_vendor/plugin-text/host/RichTextToolbar.d.ts +8 -0
- package/_vendor/plugin-text/host/TiptapTextEditor.d.ts +24 -0
- package/_vendor/plugin-text/host/richTextBubbleMenuPositionSync.d.ts +7 -0
- package/_vendor/plugin-text/host/richTextRendering.d.ts +3 -0
- package/_vendor/plugin-text/host/textDomSelection.d.ts +7 -0
- package/_vendor/plugin-text/host/textEditingBoxStyle.d.ts +3 -0
- package/_vendor/plugin-text/host/textEntryFocus.d.ts +22 -0
- package/_vendor/plugin-text/host/textFontLoader.d.ts +2 -0
- package/_vendor/plugin-text/host/textMeasurement.d.ts +12 -0
- package/_vendor/plugin-text/host/textMeasurementSync.d.ts +10 -0
- package/_vendor/plugin-text/host/textRangeSelection.d.ts +14 -0
- package/_vendor/plugin-text/host/textShapeRendererRuntime.d.ts +8 -0
- package/_vendor/plugin-text/host/textShapeSync.d.ts +17 -0
- package/_vendor/plugin-text/host/tiptapTextEditorController.d.ts +33 -0
- package/_vendor/plugin-text/index.d.ts +4 -0
- package/_vendor/plugin-text/richTextUtils.d.ts +18 -0
- package/_vendor/plugin-text/textInteractions.d.ts +2 -0
- package/_vendor/plugin-text/textLabelHelpers.d.ts +44 -0
- package/_vendor/plugin-text/textShapeHelpers.d.ts +21 -0
- package/_vendor/plugin-text/textShapeSvgExporter.d.ts +6 -0
- package/_vendor/plugin-text/textShapeUtil.d.ts +19 -0
- package/_vendor/plugin-text/textStyle.d.ts +9 -0
- package/_vendor/plugin-text/textTool.d.ts +4 -0
- package/_vendor/plugin-text/textTypes.d.ts +28 -0
- package/_vendor/signals/atom.d.ts +9 -0
- package/_vendor/signals/computed.d.ts +11 -0
- package/_vendor/signals/core.d.ts +17 -0
- package/_vendor/signals/effect.d.ts +29 -0
- package/_vendor/signals/types.d.ts +15 -0
- package/_vendor/store/diff.d.ts +9 -0
- package/_vendor/store/history.d.ts +37 -0
- package/_vendor/store/index.d.ts +5 -0
- package/_vendor/store/store.d.ts +32 -0
- package/_vendor/store/types.d.ts +27 -0
- package/browser/localSnapshotRestore.d.ts +13 -0
- package/browser/persistence.d.ts +46 -0
- package/builtins/controller/createBuiltInCanvasController.d.ts +16 -0
- package/builtins/controller/layerController.d.ts +9 -0
- package/builtins/controller/shapeCreationController.d.ts +74 -0
- package/builtins/extensions.d.ts +15 -0
- package/builtins/index.d.ts +5 -0
- package/chrome/CanvasKitFloatingToolbarLayer.d.ts +6 -0
- package/chrome/FloatingSelectionToolbarPageSpace.d.ts +9 -0
- package/chrome/bindings/useCanvasKitChromeControls.d.ts +27 -0
- package/chrome/bindings/useContextMenuSurface.d.ts +12 -0
- package/chrome/bindings/useSvgExport.d.ts +15 -0
- package/chrome/bindings/useToolbarSurfaces.d.ts +26 -0
- package/chrome/types.d.ts +66 -0
- package/chrome/useCanvasKitChromeContext.d.ts +19 -0
- package/controller/canvasKitController.d.ts +36 -0
- package/core/controller/canvasProductController.d.ts +114 -0
- package/core/controller/featureControllerRegistry.d.ts +12 -0
- package/core/controller/index.d.ts +4 -0
- package/core/controller/productLayerTree.d.ts +10 -0
- package/core/features/actions/canvasActionContext.d.ts +15 -0
- package/core/features/actions/canvasActions.d.ts +26 -0
- package/core/features/clipboard/clipboardContextMenuContributions.d.ts +2 -0
- package/core/features/clipboard/clipboardContribution.d.ts +19 -0
- package/core/features/clipboard/clipboardService.d.ts +10 -0
- package/core/features/context-menu/contextMenuActions.d.ts +12 -0
- package/core/features/context-menu/contextMenuContext.d.ts +6 -0
- package/core/features/context-menu/contextMenuContribution.d.ts +4 -0
- package/core/features/context-menu/viewContextMenuContributions.d.ts +2 -0
- package/core/features/export/svgExport.d.ts +33 -0
- package/core/features/hostActionIds.d.ts +1 -0
- package/core/features/toolbar/selectionContextMenuContributions.d.ts +2 -0
- package/core/features/toolbar/toolContextMenuContributions.d.ts +2 -0
- package/core/features/toolbar/toolbarContribution.d.ts +4 -0
- package/core/features/toolbar/toolbarLabels.d.ts +8 -0
- package/core/index.d.ts +23 -0
- package/core/runtime/productAssets.d.ts +18 -0
- package/core/runtime/productContributions.d.ts +9 -0
- package/core/runtime/productDefinition.d.ts +32 -0
- package/core/runtime/productEditor.d.ts +3 -0
- package/core/runtime/productHost.d.ts +17 -0
- package/core/runtime/productServices.d.ts +30 -0
- package/features/image/ImageImportController.d.ts +9 -0
- package/features/image/imageAssetService.d.ts +7 -0
- package/features/image/imageBlobStore.d.ts +25 -0
- package/features/image/imageFileHelpers.d.ts +35 -0
- package/features/image/imageHostActions.d.ts +36 -0
- package/features/image/imageHostExtension.d.ts +5 -0
- package/features/image/imageProductController.d.ts +22 -0
- package/features/image/imageProductToolbarActions.d.ts +2 -0
- package/features/image/imageToolbarHostBridge.d.ts +14 -0
- package/features/image/index.d.ts +15 -0
- package/features/image/svgImageAssetInliner.d.ts +3 -0
- package/features/image/useImageImport.d.ts +17 -0
- package/index.css +1 -2
- package/index.d.ts +12 -15
- package/index.mjs +66 -1
- package/package.json +1 -11
- package/product/canvasKitProduct.d.ts +59 -0
- package/react/CanvasKitPersistenceNotice.d.ts +4 -0
- package/react/CanvasKitRoot.d.ts +5 -0
- package/react/useCanvasKitController.d.ts +5 -0
- package/react/useCanvasKitKeyboardShortcuts.d.ts +6 -0
- package/react/useCanvasKitRuntime.d.ts +4 -0
- package/react/useCanvasKitStartup.d.ts +9 -0
- package/runtime/canvasKitHostExtensions.d.ts +19 -0
- package/runtime/canvasKitRuntime.d.ts +19 -0
- package/runtime/canvasKitRuntimeInitializer.d.ts +11 -0
- package/_vendor/canvas-core/bindings/BindingUtil.ts +0 -92
- package/_vendor/canvas-core/bindings/BindingUtilRegistry.ts +0 -22
- package/_vendor/canvas-core/bindings/arrow/arrowBindingHelpers.ts +0 -52
- package/_vendor/canvas-core/contextMenu.ts +0 -85
- package/_vendor/canvas-core/editor/Editor.ts +0 -2614
- package/_vendor/canvas-core/editor/HistoryManager.ts +0 -83
- package/_vendor/canvas-core/editor/StateNode.ts +0 -162
- package/_vendor/canvas-core/editor/camera.ts +0 -6
- package/_vendor/canvas-core/editor/clipboard.ts +0 -478
- package/_vendor/canvas-core/editor/commands.ts +0 -833
- package/_vendor/canvas-core/editor/edgeScroll.ts +0 -37
- package/_vendor/canvas-core/editor/editorComputedHelpers.ts +0 -257
- package/_vendor/canvas-core/editor/editorSelectionTransforms.ts +0 -116
- package/_vendor/canvas-core/editor/events.ts +0 -93
- package/_vendor/canvas-core/editor/index.ts +0 -12
- package/_vendor/canvas-core/editor/interactions.ts +0 -101
- package/_vendor/canvas-core/editor/internal.ts +0 -22
- package/_vendor/canvas-core/editor/managers/BindingManager.ts +0 -262
- package/_vendor/canvas-core/editor/managers/CameraManager.ts +0 -147
- package/_vendor/canvas-core/editor/managers/ClipboardManager.ts +0 -32
- package/_vendor/canvas-core/editor/managers/DocumentSnapshotManager.ts +0 -256
- package/_vendor/canvas-core/editor/managers/InputsManager.ts +0 -319
- package/_vendor/canvas-core/editor/managers/InteractionTransientManager.ts +0 -218
- package/_vendor/canvas-core/editor/managers/QueryManager.ts +0 -837
- package/_vendor/canvas-core/editor/managers/RenderWindowManager.ts +0 -347
- package/_vendor/canvas-core/editor/managers/SelectionLayoutManager.ts +0 -196
- package/_vendor/canvas-core/editor/managers/SelectionManager.ts +0 -98
- package/_vendor/canvas-core/editor/managers/SelectionOverlayManager.ts +0 -308
- package/_vendor/canvas-core/editor/managers/ShapeEditingManager.ts +0 -226
- package/_vendor/canvas-core/editor/managers/ShapeGeometryManager.ts +0 -162
- package/_vendor/canvas-core/editor/managers/ShapeHierarchyManager.ts +0 -797
- package/_vendor/canvas-core/editor/managers/SideEffectManager.ts +0 -83
- package/_vendor/canvas-core/editor/managers/SnapManager.ts +0 -433
- package/_vendor/canvas-core/editor/managers/SnapSnapshotBuilder.ts +0 -430
- package/_vendor/canvas-core/editor/managers/SpatialIndexManager.ts +0 -354
- package/_vendor/canvas-core/editor/managers/ToolManager.ts +0 -81
- package/_vendor/canvas-core/editor/managers/queryState.ts +0 -583
- package/_vendor/canvas-core/editor/managers/selectionGeometry.ts +0 -287
- package/_vendor/canvas-core/editor/managers/shapeOrder.ts +0 -350
- package/_vendor/canvas-core/editor/managers/shapeReparenting.ts +0 -160
- package/_vendor/canvas-core/editor/managers/snapCalculations.ts +0 -412
- package/_vendor/canvas-core/editor/managers/snapGeometry.ts +0 -202
- package/_vendor/canvas-core/editor/managers/snapIndicators.ts +0 -403
- package/_vendor/canvas-core/editor/managers/snapTypes.ts +0 -122
- package/_vendor/canvas-core/editor/queries/shapeTransforms.ts +0 -171
- package/_vendor/canvas-core/editor/renderWindow.ts +0 -439
- package/_vendor/canvas-core/editor/resizeGeometry.ts +0 -654
- package/_vendor/canvas-core/editor/selection.ts +0 -489
- package/_vendor/canvas-core/editor/selectionHandleInteractions.ts +0 -43
- package/_vendor/canvas-core/editor/selectionOverlay.ts +0 -567
- package/_vendor/canvas-core/exports/integrity.ts +0 -174
- package/_vendor/canvas-core/exports/svg.ts +0 -494
- package/_vendor/canvas-core/geometry/Box.ts +0 -80
- package/_vendor/canvas-core/geometry/Ellipse2d.ts +0 -67
- package/_vendor/canvas-core/geometry/Geometry2d.ts +0 -52
- package/_vendor/canvas-core/geometry/Mat.ts +0 -92
- package/_vendor/canvas-core/geometry/Polyline2d.ts +0 -63
- package/_vendor/canvas-core/geometry/Rectangle2d.ts +0 -64
- package/_vendor/canvas-core/geometry/Vec.ts +0 -123
- package/_vendor/canvas-core/geometry/index.ts +0 -13
- package/_vendor/canvas-core/geometry/segments.ts +0 -65
- package/_vendor/canvas-core/index.ts +0 -391
- package/_vendor/canvas-core/plugins/index.ts +0 -5
- package/_vendor/canvas-core/plugins/types.ts +0 -53
- package/_vendor/canvas-core/reactivity.ts +0 -16
- package/_vendor/canvas-core/schema/records.ts +0 -221
- package/_vendor/canvas-core/schema/snapshots.ts +0 -527
- package/_vendor/canvas-core/shapes/ShapeUtil.ts +0 -516
- package/_vendor/canvas-core/shapes/ShapeUtilRegistry.ts +0 -26
- package/_vendor/canvas-core/shapes/capabilities.ts +0 -67
- package/_vendor/canvas-core/shapes/types.ts +0 -20
- package/_vendor/canvas-core/toolbar.ts +0 -148
- package/_vendor/canvas-core/tools/hand/HandTool.ts +0 -75
- package/_vendor/canvas-core/tools/index.ts +0 -2
- package/_vendor/canvas-core/tools/select/SelectTool.ts +0 -33
- package/_vendor/canvas-core/tools/select/selectContainment.ts +0 -104
- package/_vendor/canvas-core/tools/select/selectToolHelpers.ts +0 -801
- package/_vendor/canvas-core/tools/select/states/BrushingState.ts +0 -145
- package/_vendor/canvas-core/tools/select/states/DraggingSelectionHandleInteractionState.ts +0 -116
- package/_vendor/canvas-core/tools/select/states/IdleState.ts +0 -159
- package/_vendor/canvas-core/tools/select/states/PointingCanvasState.ts +0 -41
- package/_vendor/canvas-core/tools/select/states/PointingResizeHandleState.ts +0 -78
- package/_vendor/canvas-core/tools/select/states/PointingRotateHandleState.ts +0 -64
- package/_vendor/canvas-core/tools/select/states/PointingSelectionHandleInteractionState.ts +0 -34
- package/_vendor/canvas-core/tools/select/states/PointingShapeState.ts +0 -140
- package/_vendor/canvas-core/tools/select/states/ResizingState.ts +0 -171
- package/_vendor/canvas-core/tools/select/states/RotatingState.ts +0 -124
- package/_vendor/canvas-core/tools/select/states/SelectStateNode.ts +0 -128
- package/_vendor/canvas-core/tools/select/states/TranslatingState.ts +0 -139
- package/_vendor/canvas-core/tools/select/states/index.ts +0 -11
- package/_vendor/canvas-plugin-api/feature.ts +0 -204
- package/_vendor/canvas-plugin-api/index.ts +0 -142
- package/_vendor/canvas-product-react/api/apiRegistry.ts +0 -35
- package/_vendor/canvas-product-react/api/canvasProductApi.ts +0 -422
- package/_vendor/canvas-product-react/api/index.ts +0 -31
- package/_vendor/canvas-product-react/capabilities/clipboard/clipboardService.ts +0 -36
- package/_vendor/canvas-product-react/capabilities/clipboard/systemClipboard.ts +0 -245
- package/_vendor/canvas-product-react/capabilities/context-menu/systemContextMenu.ts +0 -396
- package/_vendor/canvas-product-react/capabilities/context-menu/useContextMenuSurface.ts +0 -59
- package/_vendor/canvas-product-react/capabilities/export/useSvgExport.ts +0 -156
- package/_vendor/canvas-product-react/capabilities/history/useHistoryControls.ts +0 -23
- package/_vendor/canvas-product-react/capabilities/pages/usePageControls.ts +0 -41
- package/_vendor/canvas-product-react/capabilities/toolbar/systemToolbar.ts +0 -490
- package/_vendor/canvas-product-react/capabilities/toolbar/useToolbarSurfaces.ts +0 -92
- package/_vendor/canvas-product-react/capabilities/zoom/useZoomControls.ts +0 -27
- package/_vendor/canvas-product-react/index.ts +0 -84
- package/_vendor/canvas-product-react/persistence/index.ts +0 -18
- package/_vendor/canvas-product-react/persistence/localSnapshotPersistence.ts +0 -294
- package/_vendor/canvas-product-react/runtime/CanvasProductRoot.tsx +0 -250
- package/_vendor/canvas-product-react/runtime/productDefinition.ts +0 -72
- package/_vendor/canvas-product-react/runtime/productServices.ts +0 -96
- package/_vendor/canvas-react/components/CanvasView.tsx +0 -796
- package/_vendor/canvas-react/components/OverlayLayer.tsx +0 -879
- package/_vendor/canvas-react/components/PageSpace.tsx +0 -34
- package/_vendor/canvas-react/components/ShapeLayer.tsx +0 -428
- package/_vendor/canvas-react/components/index.ts +0 -4
- package/_vendor/canvas-react/hooks/useEditor.ts +0 -11
- package/_vendor/canvas-react/hooks/useValue.ts +0 -14
- package/_vendor/canvas-react/host/CanvasRendererRegistryContext.tsx +0 -14
- package/_vendor/canvas-react/host/contextMenuRegistry.ts +0 -61
- package/_vendor/canvas-react/host/domEventGuards.ts +0 -61
- package/_vendor/canvas-react/host/index.ts +0 -38
- package/_vendor/canvas-react/host/pluginHost.ts +0 -635
- package/_vendor/canvas-react/host/rendererRegistry.tsx +0 -58
- package/_vendor/canvas-react/host/toolbarRegistry.ts +0 -100
- package/_vendor/canvas-react/index.ts +0 -3
- package/_vendor/plugin-arrow/ArrowBindingUtil.ts +0 -239
- package/_vendor/plugin-arrow/ArrowShapeUtil.ts +0 -311
- package/_vendor/plugin-arrow/ArrowTool.ts +0 -208
- package/_vendor/plugin-arrow/arrowGeometry.ts +0 -441
- package/_vendor/plugin-arrow/arrowTerminalBindingResolver.ts +0 -253
- package/_vendor/plugin-arrow/arrowTerminalCommands.ts +0 -230
- package/_vendor/plugin-arrow/canvas.tsx +0 -92
- package/_vendor/plugin-arrow/core.ts +0 -409
- package/_vendor/plugin-arrow/feature.ts +0 -20
- package/_vendor/plugin-arrow/index.ts +0 -28
- package/_vendor/plugin-arrow/selectionHandleInteractions.ts +0 -154
- package/_vendor/plugin-arrow/types.ts +0 -63
- package/_vendor/plugin-draw/DrawShapeRenderer.tsx +0 -60
- package/_vendor/plugin-draw/DrawShapeUtil.ts +0 -372
- package/_vendor/plugin-draw/DrawTool.ts +0 -444
- package/_vendor/plugin-draw/canvas.tsx +0 -24
- package/_vendor/plugin-draw/core.ts +0 -515
- package/_vendor/plugin-draw/drawGeometry.ts +0 -491
- package/_vendor/plugin-draw/drawHitTest.ts +0 -271
- package/_vendor/plugin-draw/drawInterpolation.ts +0 -250
- package/_vendor/plugin-draw/drawPath.ts +0 -550
- package/_vendor/plugin-draw/drawSegments.ts +0 -106
- package/_vendor/plugin-draw/drawSelectionTransform.ts +0 -67
- package/_vendor/plugin-draw/drawShapeGeometry.ts +0 -307
- package/_vendor/plugin-draw/drawStrokeGeometry.ts +0 -454
- package/_vendor/plugin-draw/feature.ts +0 -20
- package/_vendor/plugin-draw/index.ts +0 -31
- package/_vendor/plugin-draw/types.ts +0 -36
- package/_vendor/plugin-eraser/EraserTool.ts +0 -297
- package/_vendor/plugin-eraser/canvas.tsx +0 -616
- package/_vendor/plugin-eraser/core.ts +0 -49
- package/_vendor/plugin-eraser/feature.ts +0 -20
- package/_vendor/plugin-frame/FrameShapeUtil.ts +0 -173
- package/_vendor/plugin-frame/FrameTool.ts +0 -225
- package/_vendor/plugin-frame/canvas.tsx +0 -75
- package/_vendor/plugin-frame/core.ts +0 -534
- package/_vendor/plugin-frame/feature.ts +0 -20
- package/_vendor/plugin-frame/index.ts +0 -6
- package/_vendor/plugin-geo/GeoShapeUtil.ts +0 -463
- package/_vendor/plugin-geo/GeoTools.ts +0 -247
- package/_vendor/plugin-geo/canvas.tsx +0 -90
- package/_vendor/plugin-geo/core.ts +0 -495
- package/_vendor/plugin-geo/feature.ts +0 -20
- package/_vendor/plugin-geo/index.ts +0 -7
- package/_vendor/plugin-geo/types.ts +0 -27
- package/_vendor/plugin-group/GroupShapeUtil.ts +0 -59
- package/_vendor/plugin-group/canvas.tsx +0 -59
- package/_vendor/plugin-group/core.ts +0 -40
- package/_vendor/plugin-group/feature.ts +0 -20
- package/_vendor/plugin-group/index.ts +0 -5
- package/_vendor/plugin-image/ImageShapeUtil.ts +0 -95
- package/_vendor/plugin-image/canvas.tsx +0 -212
- package/_vendor/plugin-image/core.ts +0 -542
- package/_vendor/plugin-image/crop.ts +0 -770
- package/_vendor/plugin-image/cropInteractions.ts +0 -350
- package/_vendor/plugin-image/cropSession.ts +0 -38
- package/_vendor/plugin-image/feature.ts +0 -20
- package/_vendor/plugin-image/index.ts +0 -29
- package/_vendor/plugin-image/types.ts +0 -55
- package/_vendor/plugin-image-product-react/ImageImportController.tsx +0 -143
- package/_vendor/plugin-image-product-react/imageAssetService.ts +0 -52
- package/_vendor/plugin-image-product-react/imageBlobStore.ts +0 -315
- package/_vendor/plugin-image-product-react/imageHostActions.ts +0 -438
- package/_vendor/plugin-image-product-react/imageProductApi.ts +0 -88
- package/_vendor/plugin-image-product-react/imageToolbarHostBridge.ts +0 -48
- package/_vendor/plugin-image-product-react/imageToolbarRuntime.ts +0 -21
- package/_vendor/plugin-image-product-react/index.ts +0 -60
- package/_vendor/plugin-image-product-react/snapshotGuards.ts +0 -33
- package/_vendor/plugin-image-product-react/svgImageAssetInliner.ts +0 -54
- package/_vendor/plugin-image-product-react/useImageImport.ts +0 -64
- package/_vendor/plugin-laser/LaserTool.ts +0 -154
- package/_vendor/plugin-laser/canvas.tsx +0 -645
- package/_vendor/plugin-laser/core.ts +0 -49
- package/_vendor/plugin-laser/feature.ts +0 -20
- package/_vendor/plugin-text/ArrowLabelBindingUtil.ts +0 -336
- package/_vendor/plugin-text/GeoLabelBindingUtil.ts +0 -391
- package/_vendor/plugin-text/TextShapeSvgExporter.ts +0 -101
- package/_vendor/plugin-text/TextShapeUtil.ts +0 -284
- package/_vendor/plugin-text/TextTool.ts +0 -228
- package/_vendor/plugin-text/canvas.tsx +0 -115
- package/_vendor/plugin-text/core.ts +0 -422
- package/_vendor/plugin-text/feature.ts +0 -20
- package/_vendor/plugin-text/host/RichTextEditingBox.tsx +0 -144
- package/_vendor/plugin-text/host/RichTextToolbar.tsx +0 -266
- package/_vendor/plugin-text/host/TiptapTextEditor.tsx +0 -191
- package/_vendor/plugin-text/host/richTextRendering.tsx +0 -49
- package/_vendor/plugin-text/host/textDomSelection.ts +0 -93
- package/_vendor/plugin-text/host/textEditingBoxStyle.ts +0 -36
- package/_vendor/plugin-text/host/textEntryFocus.ts +0 -307
- package/_vendor/plugin-text/host/textFontLoader.ts +0 -149
- package/_vendor/plugin-text/host/textMeasurement.ts +0 -258
- package/_vendor/plugin-text/host/textMeasurementSync.ts +0 -77
- package/_vendor/plugin-text/host/textRangeSelection.ts +0 -134
- package/_vendor/plugin-text/host/textShapeRendererRuntime.tsx +0 -89
- package/_vendor/plugin-text/host/textShapeSync.ts +0 -173
- package/_vendor/plugin-text/host/tiptapTextEditorController.ts +0 -148
- package/_vendor/plugin-text/index.ts +0 -18
- package/_vendor/plugin-text/richTextUtils.ts +0 -259
- package/_vendor/plugin-text/textInteractions.ts +0 -366
- package/_vendor/plugin-text/textLabelHelpers.ts +0 -235
- package/_vendor/plugin-text/textShapeHelpers.ts +0 -123
- package/_vendor/plugin-text/textStyle.ts +0 -96
- package/_vendor/plugin-text/textTypes.ts +0 -48
- package/_vendor/signals/atom.ts +0 -74
- package/_vendor/signals/computed.ts +0 -132
- package/_vendor/signals/core.ts +0 -130
- package/_vendor/signals/effect.ts +0 -117
- package/_vendor/signals/types.ts +0 -17
- package/_vendor/store/Store.ts +0 -171
- package/_vendor/store/diff.ts +0 -229
- package/_vendor/store/history.ts +0 -177
- package/_vendor/store/index.ts +0 -32
- package/_vendor/store/types.ts +0 -37
- package/api/canvasKitApi.d.ts +0 -29
- package/internal-modules.d.ts +0 -187
- package/product/Shell.d.ts +0 -19
- package/product/chromeContext.d.ts +0 -70
- package/product/createCanvasKitEditor.d.ts +0 -6
- package/product/index.d.ts +0 -7
- package/product/persistence.d.ts +0 -3
- package/product/product.d.ts +0 -22
- package/product/useCanvasClipboardShortcuts.d.ts +0 -6
- package/product-iyBbEPIs.mjs +0 -4
- package/product.mjs +0 -1
- package/standard/extensions.d.ts +0 -1
- package/standard/index.d.ts +0 -3
- package/standard/standardApi.d.ts +0 -91
- package/standard-BmrxwqpJ.mjs +0 -44
- package/standard.mjs +0 -1
- /package/_vendor/signals/{index.ts → index.d.ts} +0 -0
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Vec } from "../geometry/Vec";
|
|
2
|
-
|
|
3
|
-
const EDGE_SCROLL_MARGIN_SCREEN = 96;
|
|
4
|
-
const EDGE_SCROLL_MAX_SPEED_SCREEN = 1.25;
|
|
5
|
-
const EDGE_SCROLL_MAX_ELAPSED = 32;
|
|
6
|
-
|
|
7
|
-
function getEdgeScrollFactor(distance: number): number {
|
|
8
|
-
return Math.min(
|
|
9
|
-
1,
|
|
10
|
-
Math.max(
|
|
11
|
-
0,
|
|
12
|
-
(EDGE_SCROLL_MARGIN_SCREEN - distance) / EDGE_SCROLL_MARGIN_SCREEN,
|
|
13
|
-
),
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function getEdgeScrollDelta(
|
|
18
|
-
screenPoint: Vec,
|
|
19
|
-
viewportSize: { w: number; h: number },
|
|
20
|
-
elapsed: number,
|
|
21
|
-
): Vec {
|
|
22
|
-
if (viewportSize.w <= 0 || viewportSize.h <= 0 || elapsed <= 0) {
|
|
23
|
-
return Vec.Zero();
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const clampedElapsed = Math.min(elapsed, EDGE_SCROLL_MAX_ELAPSED);
|
|
27
|
-
const leftFactor = getEdgeScrollFactor(screenPoint.x);
|
|
28
|
-
const rightFactor = getEdgeScrollFactor(viewportSize.w - screenPoint.x);
|
|
29
|
-
const topFactor = getEdgeScrollFactor(screenPoint.y);
|
|
30
|
-
const bottomFactor = getEdgeScrollFactor(viewportSize.h - screenPoint.y);
|
|
31
|
-
const deltaX =
|
|
32
|
-
(rightFactor - leftFactor) * EDGE_SCROLL_MAX_SPEED_SCREEN * clampedElapsed;
|
|
33
|
-
const deltaY =
|
|
34
|
-
(bottomFactor - topFactor) * EDGE_SCROLL_MAX_SPEED_SCREEN * clampedElapsed;
|
|
35
|
-
|
|
36
|
-
return deltaX === 0 && deltaY === 0 ? Vec.Zero() : new Vec(deltaX, deltaY);
|
|
37
|
-
}
|
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
import type { Box } from "../geometry/Box";
|
|
2
|
-
import type { Vec } from "../geometry/Vec";
|
|
3
|
-
import type {
|
|
4
|
-
AssetId,
|
|
5
|
-
PageId,
|
|
6
|
-
ShapeId,
|
|
7
|
-
ShapeRecord,
|
|
8
|
-
} from "../schema/records";
|
|
9
|
-
import type { ArrowBindingPreviewState } from "./selection";
|
|
10
|
-
import type {
|
|
11
|
-
EditorOverlayDebugState,
|
|
12
|
-
EditorRenderHostDebugState,
|
|
13
|
-
RenderItem,
|
|
14
|
-
} from "./Editor";
|
|
15
|
-
|
|
16
|
-
export function areShapeIdArraysEqual(a: ShapeId[], b: ShapeId[]): boolean {
|
|
17
|
-
if (a === b) return true;
|
|
18
|
-
if (a.length !== b.length) return false;
|
|
19
|
-
for (let i = 0; i < a.length; i++) {
|
|
20
|
-
if (a[i] !== b[i]) return false;
|
|
21
|
-
}
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function areVecsEqual(a: Vec | null, b: Vec | null): boolean {
|
|
26
|
-
if (a === b) return true;
|
|
27
|
-
if (!a || !b) return a === b;
|
|
28
|
-
return a.x === b.x && a.y === b.y;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function areVecArraysEqual(a: readonly Vec[], b: readonly Vec[]): boolean {
|
|
32
|
-
if (a === b) return true;
|
|
33
|
-
if (a.length !== b.length) return false;
|
|
34
|
-
for (let index = 0; index < a.length; index += 1) {
|
|
35
|
-
const left = a[index];
|
|
36
|
-
const right = b[index];
|
|
37
|
-
if (!left || !right || left.x !== right.x || left.y !== right.y) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function areBoxesEqual(a: Box | null, b: Box | null): boolean {
|
|
45
|
-
if (a === b) return true;
|
|
46
|
-
if (!a || !b) return a === b;
|
|
47
|
-
return a.x === b.x && a.y === b.y && a.w === b.w && a.h === b.h;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function isValidBox(box: Box): boolean {
|
|
51
|
-
return (
|
|
52
|
-
Number.isFinite(box.x) &&
|
|
53
|
-
Number.isFinite(box.y) &&
|
|
54
|
-
Number.isFinite(box.w) &&
|
|
55
|
-
Number.isFinite(box.h) &&
|
|
56
|
-
box.w >= 0 &&
|
|
57
|
-
box.h >= 0
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function areRenderHostDebugStatesEqual(
|
|
62
|
-
a: EditorRenderHostDebugState,
|
|
63
|
-
b: EditorRenderHostDebugState,
|
|
64
|
-
): boolean {
|
|
65
|
-
return (
|
|
66
|
-
a.culledCount === b.culledCount &&
|
|
67
|
-
a.visibleCount === b.visibleCount &&
|
|
68
|
-
a.retainedCount === b.retainedCount &&
|
|
69
|
-
a.retainedBaseCount === b.retainedBaseCount &&
|
|
70
|
-
a.culledRangeCount === b.culledRangeCount &&
|
|
71
|
-
a.culledRangeSpan === b.culledRangeSpan &&
|
|
72
|
-
a.culledRangesSummary === b.culledRangesSummary &&
|
|
73
|
-
a.retainedBaseRangeCount === b.retainedBaseRangeCount &&
|
|
74
|
-
a.retainedBaseRangeSpan === b.retainedBaseRangeSpan &&
|
|
75
|
-
a.retainedBaseRangesSummary === b.retainedBaseRangesSummary &&
|
|
76
|
-
a.retainedRangeCount === b.retainedRangeCount &&
|
|
77
|
-
a.retainedRangeSpan === b.retainedRangeSpan &&
|
|
78
|
-
a.retainedRangesSummary === b.retainedRangesSummary &&
|
|
79
|
-
a.retainedChangeCount === b.retainedChangeCount &&
|
|
80
|
-
a.retainedAddedCount === b.retainedAddedCount &&
|
|
81
|
-
a.retainedRemovedCount === b.retainedRemovedCount &&
|
|
82
|
-
a.selectedOutsideCulledCount === b.selectedOutsideCulledCount
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export function areOverlayDebugStatesEqual(
|
|
87
|
-
a: EditorOverlayDebugState,
|
|
88
|
-
b: EditorOverlayDebugState,
|
|
89
|
-
): boolean {
|
|
90
|
-
return (
|
|
91
|
-
a.selectionFrameActive === b.selectionFrameActive &&
|
|
92
|
-
a.selectionHandlesActive === b.selectionHandlesActive &&
|
|
93
|
-
a.bindingPreviewActive === b.bindingPreviewActive &&
|
|
94
|
-
a.brushBoxActive === b.brushBoxActive &&
|
|
95
|
-
a.selectionFrameChangeCount === b.selectionFrameChangeCount &&
|
|
96
|
-
a.selectionHandlesChangeCount === b.selectionHandlesChangeCount &&
|
|
97
|
-
a.resizeHandleCount === b.resizeHandleCount &&
|
|
98
|
-
a.rotateHandleCount === b.rotateHandleCount &&
|
|
99
|
-
a.terminalHandleCount === b.terminalHandleCount &&
|
|
100
|
-
a.middleHandleCount === b.middleHandleCount &&
|
|
101
|
-
a.customHandleCount === b.customHandleCount &&
|
|
102
|
-
a.boundsSummary === b.boundsSummary &&
|
|
103
|
-
a.rotation === b.rotation &&
|
|
104
|
-
a.strokeWidth === b.strokeWidth
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function getBoxDebugSummary(box: Box | null): string {
|
|
109
|
-
if (!box) {
|
|
110
|
-
return "none";
|
|
111
|
-
}
|
|
112
|
-
return `${Math.round(box.x)},${Math.round(box.y)},${Math.round(
|
|
113
|
-
box.w,
|
|
114
|
-
)},${Math.round(box.h)}`;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export function getShapePageIdFromParentChain(
|
|
118
|
-
shape: ShapeRecord,
|
|
119
|
-
shapeById: ReadonlyMap<ShapeId, ShapeRecord>,
|
|
120
|
-
pageIds: ReadonlySet<PageId>,
|
|
121
|
-
): PageId | null {
|
|
122
|
-
const seen = new Set<ShapeId>([shape.id]);
|
|
123
|
-
let parentId = shape.parentId;
|
|
124
|
-
|
|
125
|
-
while (parentId.startsWith("shape:")) {
|
|
126
|
-
const parentShapeId = parentId as ShapeId;
|
|
127
|
-
if (seen.has(parentShapeId)) {
|
|
128
|
-
return null;
|
|
129
|
-
}
|
|
130
|
-
seen.add(parentShapeId);
|
|
131
|
-
|
|
132
|
-
const parentShape = shapeById.get(parentShapeId);
|
|
133
|
-
if (!parentShape) {
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
parentId = parentShape.parentId;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
return pageIds.has(parentId as PageId) ? (parentId as PageId) : null;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export function areBindingPreviewStatesEqual(
|
|
143
|
-
a: ArrowBindingPreviewState | null,
|
|
144
|
-
b: ArrowBindingPreviewState | null,
|
|
145
|
-
): boolean {
|
|
146
|
-
if (a === b) return true;
|
|
147
|
-
if (!a || !b) return a === b;
|
|
148
|
-
return (
|
|
149
|
-
a.terminal === b.terminal &&
|
|
150
|
-
a.targetShapeId === b.targetShapeId &&
|
|
151
|
-
areVecsEqual(a.rawPagePoint, b.rawPagePoint) &&
|
|
152
|
-
areVecsEqual(a.resolvedPagePoint, b.resolvedPagePoint)
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export function areRenderItemsEqual(a: RenderItem[], b: RenderItem[]): boolean {
|
|
157
|
-
if (a === b) return true;
|
|
158
|
-
if (a.length !== b.length) return false;
|
|
159
|
-
for (let i = 0; i < a.length; i += 1) {
|
|
160
|
-
const left = a[i];
|
|
161
|
-
const right = b[i];
|
|
162
|
-
if (!left || !right) {
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
if (
|
|
166
|
-
left.id !== right.id ||
|
|
167
|
-
left.shape !== right.shape ||
|
|
168
|
-
left.isSelected !== right.isSelected ||
|
|
169
|
-
!areBoxesEqual(left.bounds, right.bounds)
|
|
170
|
-
) {
|
|
171
|
-
return false;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return true;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export function areShapeIdSetsEqual(a: Set<ShapeId>, b: Set<ShapeId>): boolean {
|
|
178
|
-
if (a === b) return true;
|
|
179
|
-
if (a.size !== b.size) return false;
|
|
180
|
-
for (const id of a) {
|
|
181
|
-
if (!b.has(id)) {
|
|
182
|
-
return false;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
return true;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export function getCommonShapeType(
|
|
189
|
-
shapes: readonly ShapeRecord[],
|
|
190
|
-
): ShapeRecord["type"] | null {
|
|
191
|
-
let commonType: ShapeRecord["type"] | null = null;
|
|
192
|
-
for (const shape of shapes) {
|
|
193
|
-
if (commonType === null) {
|
|
194
|
-
commonType = shape.type;
|
|
195
|
-
continue;
|
|
196
|
-
}
|
|
197
|
-
if (commonType !== shape.type) {
|
|
198
|
-
return null;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
return commonType;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export function getShapeAssetId(shape: ShapeRecord): AssetId | null {
|
|
205
|
-
const assetId = (shape.props as Record<string, unknown>).assetId;
|
|
206
|
-
return typeof assetId === "string" && assetId.startsWith("asset:")
|
|
207
|
-
? (assetId as AssetId)
|
|
208
|
-
: null;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export function areSerializableValuesEqual(a: unknown, b: unknown): boolean {
|
|
212
|
-
if (Object.is(a, b)) return true;
|
|
213
|
-
if (typeof a !== typeof b) return false;
|
|
214
|
-
if (!a || !b || typeof a !== "object" || typeof b !== "object") {
|
|
215
|
-
return false;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (Array.isArray(a) || Array.isArray(b)) {
|
|
219
|
-
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) {
|
|
220
|
-
return false;
|
|
221
|
-
}
|
|
222
|
-
return a.every((value, index) =>
|
|
223
|
-
areSerializableValuesEqual(value, b[index]),
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
const aRecord = a as Record<string, unknown>;
|
|
228
|
-
const bRecord = b as Record<string, unknown>;
|
|
229
|
-
const aKeys = Object.keys(aRecord);
|
|
230
|
-
const bKeys = Object.keys(bRecord);
|
|
231
|
-
if (aKeys.length !== bKeys.length) {
|
|
232
|
-
return false;
|
|
233
|
-
}
|
|
234
|
-
return aKeys.every(
|
|
235
|
-
(key) =>
|
|
236
|
-
Object.prototype.hasOwnProperty.call(bRecord, key) &&
|
|
237
|
-
areSerializableValuesEqual(aRecord[key], bRecord[key]),
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
export function areShapePropsPatchesEqual(
|
|
242
|
-
a: Readonly<Record<string, unknown>>,
|
|
243
|
-
b: Readonly<Record<string, unknown>>,
|
|
244
|
-
): boolean {
|
|
245
|
-
if (a === b) return true;
|
|
246
|
-
const aEntries = Object.entries(a);
|
|
247
|
-
const bEntries = Object.entries(b);
|
|
248
|
-
if (aEntries.length !== bEntries.length) {
|
|
249
|
-
return false;
|
|
250
|
-
}
|
|
251
|
-
for (const [key, value] of aEntries) {
|
|
252
|
-
if (!areSerializableValuesEqual(value, b[key])) {
|
|
253
|
-
return false;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
return true;
|
|
257
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import type { ChangeSource } from "@land/store";
|
|
2
|
-
import { Box } from "../geometry/Box";
|
|
3
|
-
import type { ShapeRecord } from "../schema/records";
|
|
4
|
-
import type { ShapeSelectionFlipAxis } from "../shapes/ShapeUtil";
|
|
5
|
-
import type { ShapeUpdate } from "./commands";
|
|
6
|
-
import type { Editor } from "./Editor";
|
|
7
|
-
import {
|
|
8
|
-
flipSelectionLocalBounds,
|
|
9
|
-
getSelectionLocalBoundsFromPagePoints,
|
|
10
|
-
type SelectionFrame,
|
|
11
|
-
} from "./selection";
|
|
12
|
-
|
|
13
|
-
export function resetEditorSelectionRotation(
|
|
14
|
-
editor: Editor,
|
|
15
|
-
source: ChangeSource = "user",
|
|
16
|
-
): void {
|
|
17
|
-
const selectedShapes = editor.getSelectedShapes().filter((shape) =>
|
|
18
|
-
editor.getShapeUtil(shape).contributesToSelectionFrame(shape, {
|
|
19
|
-
editor,
|
|
20
|
-
}),
|
|
21
|
-
);
|
|
22
|
-
if (selectedShapes.length === 0) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
editor.commands.updateShapes(
|
|
26
|
-
selectedShapes.map((shape) => ({
|
|
27
|
-
id: shape.id,
|
|
28
|
-
rotation: 0,
|
|
29
|
-
})),
|
|
30
|
-
{ source },
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function getEditorSelectionFlipUpdates(
|
|
35
|
-
editor: Editor,
|
|
36
|
-
axis: ShapeSelectionFlipAxis,
|
|
37
|
-
): ShapeUpdate[] {
|
|
38
|
-
const selectedShapes = editor.getSelectionTransformTargetShapes();
|
|
39
|
-
const selectionFrame =
|
|
40
|
-
editor.getSelectionFrame() ?? getPointSelectionFrame(editor, selectedShapes);
|
|
41
|
-
if (!selectionFrame || selectedShapes.length === 0) {
|
|
42
|
-
return [];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return selectedShapes
|
|
46
|
-
.map((shape) => getFlippedShapeUpdate(editor, shape, selectionFrame, axis))
|
|
47
|
-
.filter((update): update is ShapeUpdate => update !== null);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function getFlippedShapeUpdate(
|
|
51
|
-
editor: Editor,
|
|
52
|
-
shape: ShapeRecord,
|
|
53
|
-
selectionFrame: SelectionFrame,
|
|
54
|
-
axis: ShapeSelectionFlipAxis,
|
|
55
|
-
): ShapeUpdate | null {
|
|
56
|
-
const util = editor.getShapeUtil(shape);
|
|
57
|
-
const pointSelection = util.getSelectionPagePoints(shape);
|
|
58
|
-
if (
|
|
59
|
-
!pointSelection &&
|
|
60
|
-
!util.contributesToSelectionFrame(shape, {
|
|
61
|
-
editor,
|
|
62
|
-
})
|
|
63
|
-
) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const pagePoints =
|
|
68
|
-
pointSelection ?
|
|
69
|
-
[...pointSelection]
|
|
70
|
-
: util
|
|
71
|
-
.getPositionedOutlineVertices(shape)
|
|
72
|
-
.map((point) =>
|
|
73
|
-
editor
|
|
74
|
-
.computeShapePositionedToPageTransform(shape)
|
|
75
|
-
.applyToPoint(point),
|
|
76
|
-
);
|
|
77
|
-
const localBounds = getSelectionLocalBoundsFromPagePoints({
|
|
78
|
-
points: pagePoints,
|
|
79
|
-
transform: selectionFrame,
|
|
80
|
-
});
|
|
81
|
-
if (!localBounds) {
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return util.flipSelectionBounds(shape, {
|
|
86
|
-
axis,
|
|
87
|
-
selectionBounds: selectionFrame.bounds,
|
|
88
|
-
selectionLocalBounds: flipSelectionLocalBounds({
|
|
89
|
-
axis,
|
|
90
|
-
bounds: localBounds,
|
|
91
|
-
selectionBounds: selectionFrame.bounds,
|
|
92
|
-
}),
|
|
93
|
-
selectionRotation: selectionFrame.rotation,
|
|
94
|
-
selectionRotationCenter: selectionFrame.rotationCenter,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function getPointSelectionFrame(
|
|
99
|
-
editor: Editor,
|
|
100
|
-
shapes: readonly ShapeRecord[],
|
|
101
|
-
): SelectionFrame | null {
|
|
102
|
-
const points = shapes.flatMap(
|
|
103
|
-
(shape) => editor.getShapeUtil(shape).getSelectionPagePoints(shape) ?? [],
|
|
104
|
-
);
|
|
105
|
-
if (points.length === 0) {
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const bounds = Box.FromPoints(points);
|
|
110
|
-
return {
|
|
111
|
-
bounds,
|
|
112
|
-
rotation: 0,
|
|
113
|
-
rotationCenter: bounds.center,
|
|
114
|
-
hasCompatibleRotation: true,
|
|
115
|
-
};
|
|
116
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import type { Vec } from "../geometry/Vec";
|
|
2
|
-
|
|
3
|
-
export type EditorPointerType = "mouse" | "touch" | "pen";
|
|
4
|
-
export type EditorClickEventName = "double_click";
|
|
5
|
-
|
|
6
|
-
export interface PointerEditorEvent {
|
|
7
|
-
type: "pointer";
|
|
8
|
-
name: "pointer_down" | "pointer_move" | "pointer_up" | "pointer_cancel";
|
|
9
|
-
timestamp: number;
|
|
10
|
-
pointerId: number;
|
|
11
|
-
button: number;
|
|
12
|
-
buttons: number;
|
|
13
|
-
pointerType: EditorPointerType;
|
|
14
|
-
clickCount?: number;
|
|
15
|
-
screenPoint: Vec;
|
|
16
|
-
pagePoint: Vec;
|
|
17
|
-
pressure: number;
|
|
18
|
-
shiftKey: boolean;
|
|
19
|
-
altKey: boolean;
|
|
20
|
-
ctrlKey: boolean;
|
|
21
|
-
metaKey: boolean;
|
|
22
|
-
accelKey: boolean;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface ClickEditorEvent {
|
|
26
|
-
type: "click";
|
|
27
|
-
name: EditorClickEventName;
|
|
28
|
-
phase: "down" | "up";
|
|
29
|
-
timestamp: number;
|
|
30
|
-
pointerId: number;
|
|
31
|
-
button: number;
|
|
32
|
-
buttons: number;
|
|
33
|
-
pointerType: EditorPointerType;
|
|
34
|
-
screenPoint: Vec;
|
|
35
|
-
pagePoint: Vec;
|
|
36
|
-
pressure: number;
|
|
37
|
-
shiftKey: boolean;
|
|
38
|
-
altKey: boolean;
|
|
39
|
-
ctrlKey: boolean;
|
|
40
|
-
metaKey: boolean;
|
|
41
|
-
accelKey: boolean;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface KeyboardEditorEvent {
|
|
45
|
-
type: "keyboard";
|
|
46
|
-
name: "key_down" | "key_up";
|
|
47
|
-
key: string;
|
|
48
|
-
code: string;
|
|
49
|
-
shiftKey: boolean;
|
|
50
|
-
altKey: boolean;
|
|
51
|
-
ctrlKey: boolean;
|
|
52
|
-
metaKey: boolean;
|
|
53
|
-
accelKey: boolean;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface WheelEditorEvent {
|
|
57
|
-
type: "wheel";
|
|
58
|
-
screenPoint: Vec;
|
|
59
|
-
pagePoint: Vec;
|
|
60
|
-
delta: Vec;
|
|
61
|
-
shiftKey: boolean;
|
|
62
|
-
altKey: boolean;
|
|
63
|
-
ctrlKey: boolean;
|
|
64
|
-
metaKey: boolean;
|
|
65
|
-
accelKey: boolean;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface TickEditorEvent {
|
|
69
|
-
type: "tick";
|
|
70
|
-
timestamp: number;
|
|
71
|
-
elapsed: number;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface CancelEditorEvent {
|
|
75
|
-
type: "cancel";
|
|
76
|
-
reason:
|
|
77
|
-
| "escape"
|
|
78
|
-
| "pointer_cancel"
|
|
79
|
-
| "blur"
|
|
80
|
-
| "page_switch"
|
|
81
|
-
| "tool_switch"
|
|
82
|
-
| "dispose"
|
|
83
|
-
| "command"
|
|
84
|
-
| "restore";
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export type EditorEvent =
|
|
88
|
-
| PointerEditorEvent
|
|
89
|
-
| ClickEditorEvent
|
|
90
|
-
| KeyboardEditorEvent
|
|
91
|
-
| WheelEditorEvent
|
|
92
|
-
| TickEditorEvent
|
|
93
|
-
| CancelEditorEvent;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { Editor } from "./Editor";
|
|
2
|
-
export { StateNode } from "./StateNode";
|
|
3
|
-
export { HistoryManager } from "./HistoryManager";
|
|
4
|
-
export { InputsManager } from "./managers/InputsManager";
|
|
5
|
-
export { QueryManager } from "./managers/QueryManager";
|
|
6
|
-
export {
|
|
7
|
-
SpatialIndexManager,
|
|
8
|
-
type ShapeAtPointOptions,
|
|
9
|
-
type SpatialQueryOptions,
|
|
10
|
-
} from "./managers/SpatialIndexManager";
|
|
11
|
-
export { ToolManager } from "./managers/ToolManager";
|
|
12
|
-
export type { EditorEvent } from "./events";
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import type { ChangeSource } from "@land/store";
|
|
2
|
-
import type { Vec } from "../geometry/Vec";
|
|
3
|
-
import type { ShapeId, ShapeRecord } from "../schema/records";
|
|
4
|
-
import type { Editor } from "./Editor";
|
|
5
|
-
import type { EditorEvent } from "./events";
|
|
6
|
-
import type { SelectionHandle } from "./selection";
|
|
7
|
-
import type {
|
|
8
|
-
HandleSnapContext,
|
|
9
|
-
HandleSnapMode,
|
|
10
|
-
} from "./managers/snapTypes";
|
|
11
|
-
|
|
12
|
-
export interface SelectionHandleInteractionInput {
|
|
13
|
-
handle: SelectionHandle;
|
|
14
|
-
shape: ShapeRecord;
|
|
15
|
-
originPagePoint: Vec;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface SelectionHandleInteractionSession {
|
|
19
|
-
readonly shapeId: ShapeId;
|
|
20
|
-
readonly historyMark: string;
|
|
21
|
-
readonly handleSnapMode?: HandleSnapMode;
|
|
22
|
-
readonly handleSnapContext?: HandleSnapContext;
|
|
23
|
-
readonly allowSelfSnap?: boolean;
|
|
24
|
-
readonly excludedSnapShapeIds?: readonly ShapeId[];
|
|
25
|
-
readonly shouldClearBindingPreviewOnExit?: boolean;
|
|
26
|
-
update(input: {
|
|
27
|
-
editor: Editor;
|
|
28
|
-
pagePoint: Vec;
|
|
29
|
-
accelKey: boolean;
|
|
30
|
-
source: ChangeSource;
|
|
31
|
-
}): "continue" | "stop" | SelectionHandleInteractionUpdateResult;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface SelectionHandleInteractionUpdateResult {
|
|
35
|
-
status: "continue" | "stop";
|
|
36
|
-
finalPagePoint?: Vec | null;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface SelectionHandleInteractionHandler {
|
|
40
|
-
createSession(
|
|
41
|
-
editor: Editor,
|
|
42
|
-
input: SelectionHandleInteractionInput,
|
|
43
|
-
): SelectionHandleInteractionSession | null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export type EditorEventInteractionDecision = "continue" | "handled";
|
|
47
|
-
|
|
48
|
-
export interface EditorEventInteractionHandler {
|
|
49
|
-
handleEvent(
|
|
50
|
-
editor: Editor,
|
|
51
|
-
event: EditorEvent,
|
|
52
|
-
): EditorEventInteractionDecision;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface LandInteractionHandler {
|
|
56
|
-
id: string;
|
|
57
|
-
editorEvent?: EditorEventInteractionHandler;
|
|
58
|
-
selectionHandle?: SelectionHandleInteractionHandler;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export class InteractionHandlerRegistry {
|
|
62
|
-
private readonly handlers: LandInteractionHandler[] = [];
|
|
63
|
-
private readonly registeredIds = new Set<string>();
|
|
64
|
-
|
|
65
|
-
register(handler: LandInteractionHandler): void {
|
|
66
|
-
if (this.registeredIds.has(handler.id)) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
this.handlers.push(handler);
|
|
71
|
-
this.registeredIds.add(handler.id);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
getHandlers(): readonly LandInteractionHandler[] {
|
|
75
|
-
return this.handlers;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
handleEvent(editor: Editor, event: EditorEvent): EditorEventInteractionDecision {
|
|
79
|
-
for (const handler of this.handlers) {
|
|
80
|
-
if (handler.editorEvent?.handleEvent(editor, event) === "handled") {
|
|
81
|
-
return "handled";
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return "continue";
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
createSelectionHandleSession(
|
|
89
|
-
editor: Editor,
|
|
90
|
-
input: SelectionHandleInteractionInput,
|
|
91
|
-
): SelectionHandleInteractionSession | null {
|
|
92
|
-
for (const handler of this.handlers) {
|
|
93
|
-
const session = handler.selectionHandle?.createSession(editor, input);
|
|
94
|
-
if (session) {
|
|
95
|
-
return session;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Editor } from "./Editor";
|
|
2
|
-
import type { Store } from "@land/store";
|
|
3
|
-
import type { EditorRecord } from "../schema/records";
|
|
4
|
-
|
|
5
|
-
const editorStoreSymbol = Symbol("editorStore");
|
|
6
|
-
|
|
7
|
-
type EditorWithInternalStore = Editor & {
|
|
8
|
-
[editorStoreSymbol]: Store<EditorRecord>;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export function setEditorStore(
|
|
12
|
-
editor: Editor,
|
|
13
|
-
store: Store<EditorRecord>,
|
|
14
|
-
): void {
|
|
15
|
-
(editor as EditorWithInternalStore)[editorStoreSymbol] = store;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function getEditorStore(editor: Editor): Store<EditorRecord> {
|
|
19
|
-
return (editor as EditorWithInternalStore)[editorStoreSymbol];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export { editorStoreSymbol };
|