@pixerate/editor-react 0.90.0 → 0.90.1
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/animation-editor/AnimationEditor.d.cts +33 -0
- package/dist/animation-editor/AnimationEditor.d.ts +33 -0
- package/dist/animation-editor/AnimationEffectsPanel.d.cts +14 -0
- package/dist/animation-editor/AnimationEffectsPanel.d.ts +14 -0
- package/dist/animation-editor/AnimationStage.d.cts +24 -0
- package/dist/animation-editor/AnimationStage.d.ts +24 -0
- package/dist/animation-editor/CommandInspector.d.cts +14 -0
- package/dist/animation-editor/CommandInspector.d.ts +14 -0
- package/dist/animation-editor/CommandList.d.cts +16 -0
- package/dist/animation-editor/CommandList.d.ts +16 -0
- package/dist/animation-editor/CommitInput.d.cts +6 -0
- package/dist/animation-editor/CommitInput.d.ts +6 -0
- package/dist/animation-editor/EasePicker.d.cts +18 -0
- package/dist/animation-editor/EasePicker.d.ts +18 -0
- package/dist/animation-editor/PlayheadScrubber.d.cts +12 -0
- package/dist/animation-editor/PlayheadScrubber.d.ts +12 -0
- package/dist/animation-editor/SceneSettings.d.cts +12 -0
- package/dist/animation-editor/SceneSettings.d.ts +12 -0
- package/dist/animation-editor/ShotInspector.d.cts +14 -0
- package/dist/animation-editor/ShotInspector.d.ts +14 -0
- package/dist/animation-editor/ShotTimeline.d.cts +11 -0
- package/dist/animation-editor/ShotTimeline.d.ts +11 -0
- package/dist/animation-editor/index.cjs +0 -1
- package/dist/animation-editor/index.d.cts +11 -195
- package/dist/animation-editor/index.d.ts +11 -195
- package/dist/animation-editor/index.js +2 -3
- package/dist/animation-editor/useAnimationEditor.d.cts +34 -0
- package/dist/animation-editor/useAnimationEditor.d.ts +34 -0
- package/dist/canvas/AgentPresenceLayer.d.cts +11 -0
- package/dist/canvas/AgentPresenceLayer.d.ts +11 -0
- package/dist/canvas/AnimationTimeline.d.cts +22 -0
- package/dist/canvas/AnimationTimeline.d.ts +22 -0
- package/dist/canvas/CanvasComponentsPanel.d.cts +44 -0
- package/dist/canvas/CanvasComponentsPanel.d.ts +44 -0
- package/dist/canvas/CanvasDrawLayer.d.cts +23 -0
- package/dist/canvas/CanvasDrawLayer.d.ts +23 -0
- package/dist/canvas/CanvasEffects.d.cts +52 -0
- package/dist/canvas/CanvasEffects.d.ts +52 -0
- package/dist/canvas/CanvasGuidesLayer.d.cts +20 -0
- package/dist/canvas/CanvasGuidesLayer.d.ts +20 -0
- package/dist/canvas/DiagramPresenceLayer.d.cts +14 -0
- package/dist/canvas/DiagramPresenceLayer.d.ts +14 -0
- package/dist/canvas/MermaidDiagramNode.d.cts +37 -0
- package/dist/canvas/MermaidDiagramNode.d.ts +37 -0
- package/dist/canvas/MermaidFamilyScene.d.cts +29 -0
- package/dist/canvas/MermaidFamilyScene.d.ts +29 -0
- package/dist/canvas/MermaidThumbnail.d.cts +15 -0
- package/dist/canvas/MermaidThumbnail.d.ts +15 -0
- package/dist/canvas/ShapeNode.d.cts +31 -0
- package/dist/canvas/ShapeNode.d.ts +31 -0
- package/dist/canvas/TokenBindingPicker.d.cts +37 -0
- package/dist/canvas/TokenBindingPicker.d.ts +37 -0
- package/dist/canvas/index.cjs +0 -1
- package/dist/canvas/index.d.cts +40 -1084
- package/dist/canvas/index.d.ts +40 -1084
- package/dist/canvas/index.js +2 -3
- package/dist/canvas/useCanvasAnimation.d.cts +97 -0
- package/dist/canvas/useCanvasAnimation.d.ts +97 -0
- package/dist/canvas/useCanvasArrange.d.cts +80 -0
- package/dist/canvas/useCanvasArrange.d.ts +80 -0
- package/dist/canvas/useCanvasAutoLayout.d.cts +54 -0
- package/dist/canvas/useCanvasAutoLayout.d.ts +54 -0
- package/dist/canvas/useCanvasCapture.d.cts +20 -0
- package/dist/canvas/useCanvasCapture.d.ts +20 -0
- package/dist/canvas/useCanvasClipboard.d.cts +14 -0
- package/dist/canvas/useCanvasClipboard.d.ts +14 -0
- package/dist/canvas/useCanvasComponents.d.cts +74 -0
- package/dist/canvas/useCanvasComponents.d.ts +74 -0
- package/dist/canvas/useCanvasDocking.d.cts +15 -0
- package/dist/canvas/useCanvasDocking.d.ts +15 -0
- package/dist/canvas/useCanvasDraw.d.cts +37 -0
- package/dist/canvas/useCanvasDraw.d.ts +37 -0
- package/dist/canvas/useCanvasExplosion.d.cts +16 -0
- package/dist/canvas/useCanvasExplosion.d.ts +16 -0
- package/dist/canvas/useCanvasGraph.d.cts +27 -0
- package/dist/canvas/useCanvasGraph.d.ts +27 -0
- package/dist/canvas/useCanvasLayout.d.cts +25 -0
- package/dist/canvas/useCanvasLayout.d.ts +25 -0
- package/dist/canvas/useCanvasMeasure.d.cts +41 -0
- package/dist/canvas/useCanvasMeasure.d.ts +41 -0
- package/dist/canvas/useCanvasScenes.d.cts +61 -0
- package/dist/canvas/useCanvasScenes.d.ts +61 -0
- package/dist/canvas/useCanvasShortcuts.d.cts +22 -0
- package/dist/canvas/useCanvasShortcuts.d.ts +22 -0
- package/dist/canvas/useCanvasTokens.d.cts +24 -0
- package/dist/canvas/useCanvasTokens.d.ts +24 -0
- package/dist/canvas/useDiagramDirector.d.cts +21 -0
- package/dist/canvas/useDiagramDirector.d.ts +21 -0
- package/dist/canvas/useMermaidDiagram.d.cts +79 -0
- package/dist/canvas/useMermaidDiagram.d.ts +79 -0
- package/dist/canvas/useShapeBrushstroke.d.cts +37 -0
- package/dist/canvas/useShapeBrushstroke.d.ts +37 -0
- package/dist/canvas/useStreamingCanvas.d.cts +17 -0
- package/dist/canvas/useStreamingCanvas.d.ts +17 -0
- package/dist/chart/ChartCanvas.d.cts +44 -0
- package/dist/chart/ChartCanvas.d.ts +44 -0
- package/dist/chart/ChartDataGrid.d.cts +24 -0
- package/dist/chart/ChartDataGrid.d.ts +24 -0
- package/dist/chart/ChartEditor.d.cts +20 -0
- package/dist/chart/ChartEditor.d.ts +20 -0
- package/dist/chart/ChartInspector.d.cts +14 -0
- package/dist/chart/ChartInspector.d.ts +14 -0
- package/dist/chart/ChartStreamingView.d.cts +40 -0
- package/dist/chart/ChartStreamingView.d.ts +40 -0
- package/dist/chart/index.cjs +0 -1
- package/dist/chart/index.d.cts +7 -212
- package/dist/chart/index.d.ts +7 -212
- package/dist/chart/index.js +1 -2
- package/dist/chart/styles.d.cts +7 -0
- package/dist/chart/styles.d.ts +7 -0
- package/dist/chart/useChartEditor.d.cts +64 -0
- package/dist/chart/useChartEditor.d.ts +64 -0
- package/dist/chart-node/ChartNodeView.d.cts +27 -0
- package/dist/chart-node/ChartNodeView.d.ts +27 -0
- package/dist/chart-node/index.d.cts +1 -0
- package/dist/chart-node/index.d.ts +1 -0
- package/dist/{chunk-WOQ3H7KA.js → chunk-5R67YSSD.js} +1 -2
- package/dist/{chunk-SIEOYRHX.js → chunk-AILJ4JOW.js} +0 -1
- package/dist/{chunk-MO354USR.js → chunk-AJCWF6SN.js} +0 -1
- package/dist/{chunk-I3E4KSA2.js → chunk-FLS7Q32M.js} +0 -1
- package/dist/{chunk-34HEZX7J.js → chunk-GML6BYCN.js} +0 -1
- package/dist/{chunk-XWFU2CSG.js → chunk-NNM633RN.js} +0 -1
- package/dist/{chunk-ZQZAKUUM.js → chunk-OTGJEYHV.js} +0 -1
- package/dist/{chunk-4ZC2WCUO.js → chunk-SMLHUEEQ.js} +0 -1
- package/dist/{chunk-4FQXRPBN.js → chunk-SMMO7CZB.js} +2 -3
- package/dist/commands/CommandPalette.d.cts +16 -0
- package/dist/commands/CommandPalette.d.ts +16 -0
- package/dist/commands/index.cjs +0 -1
- package/dist/commands/index.d.cts +3 -69
- package/dist/commands/index.d.ts +3 -69
- package/dist/commands/index.js +1 -2
- package/dist/commands/useCommandPalette.d.cts +24 -0
- package/dist/commands/useCommandPalette.d.ts +24 -0
- package/dist/commands/useCommandShortcuts.d.cts +26 -0
- package/dist/commands/useCommandShortcuts.d.ts +26 -0
- package/dist/components/BubbleMenu.d.cts +13 -0
- package/dist/components/BubbleMenu.d.ts +13 -0
- package/dist/components/EditorContent.d.cts +6 -0
- package/dist/components/EditorContent.d.ts +6 -0
- package/dist/components/ExportDocxButton.d.cts +12 -0
- package/dist/components/ExportDocxButton.d.ts +12 -0
- package/dist/components/MergePreview.d.cts +28 -0
- package/dist/components/MergePreview.d.ts +28 -0
- package/dist/components/OutlinePanel.d.cts +28 -0
- package/dist/components/OutlinePanel.d.ts +28 -0
- package/dist/components/StylesGallery.d.cts +31 -0
- package/dist/components/StylesGallery.d.ts +31 -0
- package/dist/components/TemplateRenderer.d.cts +26 -0
- package/dist/components/TemplateRenderer.d.ts +26 -0
- package/dist/components/VariableForm.d.cts +27 -0
- package/dist/components/VariableForm.d.ts +27 -0
- package/dist/effects/EffectParameters.d.cts +28 -0
- package/dist/effects/EffectParameters.d.ts +28 -0
- package/dist/effects/EffectThumbnail.d.cts +15 -0
- package/dist/effects/EffectThumbnail.d.ts +15 -0
- package/dist/effects/EffectsBrowser.d.cts +22 -0
- package/dist/effects/EffectsBrowser.d.ts +22 -0
- package/dist/effects/index.cjs +0 -1
- package/dist/effects/index.d.cts +4 -82
- package/dist/effects/index.d.ts +4 -82
- package/dist/effects/index.js +2 -3
- package/dist/effects/useEffects.d.cts +16 -0
- package/dist/effects/useEffects.d.ts +16 -0
- package/dist/find-replace/FindReplaceBar.d.cts +19 -0
- package/dist/find-replace/FindReplaceBar.d.ts +19 -0
- package/dist/find-replace/index.d.cts +2 -0
- package/dist/find-replace/index.d.ts +2 -0
- package/dist/find-replace/useFindReplace.d.cts +24 -0
- package/dist/find-replace/useFindReplace.d.ts +24 -0
- package/dist/generation/AssetMentionChips.d.cts +24 -0
- package/dist/generation/AssetMentionChips.d.ts +24 -0
- package/dist/generation/GenerationHistory.d.cts +43 -0
- package/dist/generation/GenerationHistory.d.ts +43 -0
- package/dist/generation/GenerationSettings.d.cts +26 -0
- package/dist/generation/GenerationSettings.d.ts +26 -0
- package/dist/generation/JobProgress.d.cts +14 -0
- package/dist/generation/JobProgress.d.ts +14 -0
- package/dist/generation/index.cjs +0 -1
- package/dist/generation/index.d.cts +5 -124
- package/dist/generation/index.d.ts +5 -124
- package/dist/generation/index.js +1 -2
- package/dist/generation/useGenerationPlan.d.cts +18 -0
- package/dist/generation/useGenerationPlan.d.ts +18 -0
- package/dist/hooks/useAgentToolProvider.d.cts +11 -0
- package/dist/hooks/useAgentToolProvider.d.ts +11 -0
- package/dist/hooks/useDismissGuard.d.cts +26 -0
- package/dist/hooks/useDismissGuard.d.ts +26 -0
- package/dist/hooks/useDocxExport.d.cts +14 -0
- package/dist/hooks/useDocxExport.d.ts +14 -0
- package/dist/hooks/useEditor.d.cts +20 -0
- package/dist/hooks/useEditor.d.ts +20 -0
- package/dist/hooks/useFileImport.d.cts +23 -0
- package/dist/hooks/useFileImport.d.ts +23 -0
- package/dist/hooks/useHistory.d.cts +27 -0
- package/dist/hooks/useHistory.d.ts +27 -0
- package/dist/hooks/useHistoryDirty.d.cts +27 -0
- package/dist/hooks/useHistoryDirty.d.ts +27 -0
- package/dist/hooks/useHistoryShortcuts.d.cts +21 -0
- package/dist/hooks/useHistoryShortcuts.d.ts +21 -0
- package/dist/hooks/useMergePreview.d.cts +49 -0
- package/dist/hooks/useMergePreview.d.ts +49 -0
- package/dist/hooks/useNavigationGuard.d.cts +27 -0
- package/dist/hooks/useNavigationGuard.d.ts +27 -0
- package/dist/hooks/useOutline.d.cts +12 -0
- package/dist/hooks/useOutline.d.ts +12 -0
- package/dist/hooks/useParagraphStyles.d.cts +24 -0
- package/dist/hooks/useParagraphStyles.d.ts +24 -0
- package/dist/hooks/usePromptEditor.d.cts +57 -0
- package/dist/hooks/usePromptEditor.d.ts +57 -0
- package/dist/hooks/useToolBridge.d.cts +14 -0
- package/dist/hooks/useToolBridge.d.ts +14 -0
- package/dist/image-editor/AdjustmentLayersPanel.d.cts +13 -0
- package/dist/image-editor/AdjustmentLayersPanel.d.ts +13 -0
- package/dist/image-editor/BrushOptionsBar.d.cts +18 -0
- package/dist/image-editor/BrushOptionsBar.d.ts +18 -0
- package/dist/image-editor/ColorProfilePanel.d.cts +12 -0
- package/dist/image-editor/ColorProfilePanel.d.ts +12 -0
- package/dist/image-editor/ControlSlider.d.cts +12 -0
- package/dist/image-editor/ControlSlider.d.ts +12 -0
- package/dist/image-editor/CurvesEditor.d.cts +15 -0
- package/dist/image-editor/CurvesEditor.d.ts +15 -0
- package/dist/image-editor/FreeTransformOptionsBar.d.cts +14 -0
- package/dist/image-editor/FreeTransformOptionsBar.d.ts +14 -0
- package/dist/image-editor/Histogram.d.cts +14 -0
- package/dist/image-editor/Histogram.d.ts +14 -0
- package/dist/image-editor/ImageEditor.d.cts +22 -0
- package/dist/image-editor/ImageEditor.d.ts +22 -0
- package/dist/image-editor/ImageProviderEffectsPanel.d.cts +13 -0
- package/dist/image-editor/ImageProviderEffectsPanel.d.ts +13 -0
- package/dist/image-editor/LayerEffectsPanel.d.cts +14 -0
- package/dist/image-editor/LayerEffectsPanel.d.ts +14 -0
- package/dist/image-editor/LayersPanel.d.cts +22 -0
- package/dist/image-editor/LayersPanel.d.ts +22 -0
- package/dist/image-editor/PaintGradientEditor.d.cts +5 -0
- package/dist/image-editor/PaintGradientEditor.d.ts +5 -0
- package/dist/image-editor/RefineEdgePanel.d.cts +16 -0
- package/dist/image-editor/RefineEdgePanel.d.ts +16 -0
- package/dist/image-editor/SelectionOptionsBar.d.cts +18 -0
- package/dist/image-editor/SelectionOptionsBar.d.ts +18 -0
- package/dist/image-editor/ShapeOptionsBar.d.cts +14 -0
- package/dist/image-editor/ShapeOptionsBar.d.ts +14 -0
- package/dist/image-editor/TypeOptionsBar.d.cts +16 -0
- package/dist/image-editor/TypeOptionsBar.d.ts +16 -0
- package/dist/image-editor/index.cjs +0 -1
- package/dist/image-editor/index.d.cts +17 -296
- package/dist/image-editor/index.d.ts +17 -296
- package/dist/image-editor/index.js +4 -5
- package/dist/image-editor/useImageEditor.d.cts +70 -0
- package/dist/image-editor/useImageEditor.d.ts +70 -0
- package/dist/index.cjs +0 -1
- package/dist/index.d.cts +35 -802
- package/dist/index.d.ts +35 -802
- package/dist/index.js +9 -10
- package/dist/paint-editor/BrushPanel.d.cts +18 -0
- package/dist/paint-editor/BrushPanel.d.ts +18 -0
- package/dist/paint-editor/ColorPanel.d.cts +17 -0
- package/dist/paint-editor/ColorPanel.d.ts +17 -0
- package/dist/paint-editor/PaintCanvas.d.cts +40 -0
- package/dist/paint-editor/PaintCanvas.d.ts +40 -0
- package/dist/paint-editor/PaintEditor.d.cts +18 -0
- package/dist/paint-editor/PaintEditor.d.ts +18 -0
- package/dist/paint-editor/PaintEffectsPanel.d.cts +19 -0
- package/dist/paint-editor/PaintEffectsPanel.d.ts +19 -0
- package/dist/paint-editor/PaintGradientEditor.d.cts +5 -0
- package/dist/paint-editor/PaintGradientEditor.d.ts +5 -0
- package/dist/paint-editor/PaintGradientEditorView.d.cts +23 -0
- package/dist/paint-editor/PaintGradientEditorView.d.ts +23 -0
- package/dist/paint-editor/PaintLayersPanel.d.cts +12 -0
- package/dist/paint-editor/PaintLayersPanel.d.ts +12 -0
- package/dist/paint-editor/PaintToolbar.d.cts +17 -0
- package/dist/paint-editor/PaintToolbar.d.ts +17 -0
- package/dist/paint-editor/PaperPanel.d.cts +13 -0
- package/dist/paint-editor/PaperPanel.d.ts +13 -0
- package/dist/paint-editor/StickerPanel.d.cts +12 -0
- package/dist/paint-editor/StickerPanel.d.ts +12 -0
- package/dist/paint-editor/WetPanel.d.cts +14 -0
- package/dist/paint-editor/WetPanel.d.ts +14 -0
- package/dist/paint-editor/index.cjs +0 -1
- package/dist/paint-editor/index.d.cts +13 -211
- package/dist/paint-editor/index.d.ts +13 -211
- package/dist/paint-editor/index.js +3 -4
- package/dist/paint-editor/shared.d.cts +38 -0
- package/dist/paint-editor/shared.d.ts +38 -0
- package/dist/paint-editor/usePaintEditor.d.cts +22 -0
- package/dist/paint-editor/usePaintEditor.d.ts +22 -0
- package/dist/parameters/ParametersPanel.d.cts +27 -0
- package/dist/parameters/ParametersPanel.d.ts +27 -0
- package/dist/parameters/fields.d.cts +62 -0
- package/dist/parameters/fields.d.ts +62 -0
- package/dist/parameters/index.cjs +0 -1
- package/dist/parameters/index.d.cts +3 -121
- package/dist/parameters/index.d.ts +3 -121
- package/dist/parameters/index.js +1 -2
- package/dist/parameters/useParameters.d.cts +32 -0
- package/dist/parameters/useParameters.d.ts +32 -0
- package/dist/persistence/RecoveryPrompt.d.cts +20 -0
- package/dist/persistence/RecoveryPrompt.d.ts +20 -0
- package/dist/persistence/index.cjs +0 -1
- package/dist/persistence/index.d.cts +2 -77
- package/dist/persistence/index.d.ts +2 -77
- package/dist/persistence/index.js +1 -2
- package/dist/persistence/useAutosave.d.cts +54 -0
- package/dist/persistence/useAutosave.d.ts +54 -0
- package/dist/review/CommentButton.d.cts +12 -0
- package/dist/review/CommentButton.d.ts +12 -0
- package/dist/review/CommentsPanel.d.cts +21 -0
- package/dist/review/CommentsPanel.d.ts +21 -0
- package/dist/review/ReviewToolbar.d.cts +20 -0
- package/dist/review/ReviewToolbar.d.ts +20 -0
- package/dist/review/TrackedChangesList.d.cts +18 -0
- package/dist/review/TrackedChangesList.d.ts +18 -0
- package/dist/review/index.d.cts +6 -0
- package/dist/review/index.d.ts +6 -0
- package/dist/review/useDocumentCompare.d.cts +20 -0
- package/dist/review/useDocumentCompare.d.ts +20 -0
- package/dist/review/useReview.d.cts +32 -0
- package/dist/review/useReview.d.ts +32 -0
- package/dist/slots.d.cts +14 -0
- package/dist/slots.d.ts +14 -0
- package/dist/spreadsheet/FormulaHints.d.cts +24 -0
- package/dist/spreadsheet/FormulaHints.d.ts +24 -0
- package/dist/spreadsheet/NameManager.d.cts +14 -0
- package/dist/spreadsheet/NameManager.d.ts +14 -0
- package/dist/spreadsheet/SheetTabs.d.cts +13 -0
- package/dist/spreadsheet/SheetTabs.d.ts +13 -0
- package/dist/spreadsheet/SpreadsheetContextMenu.d.cts +14 -0
- package/dist/spreadsheet/SpreadsheetContextMenu.d.ts +14 -0
- package/dist/spreadsheet/SpreadsheetEditor.d.cts +24 -0
- package/dist/spreadsheet/SpreadsheetEditor.d.ts +24 -0
- package/dist/spreadsheet/SpreadsheetGroupRow.d.cts +19 -0
- package/dist/spreadsheet/SpreadsheetGroupRow.d.ts +19 -0
- package/dist/spreadsheet/SpreadsheetRulePanels.d.cts +18 -0
- package/dist/spreadsheet/SpreadsheetRulePanels.d.ts +18 -0
- package/dist/spreadsheet/SpreadsheetValidationDialog.d.cts +11 -0
- package/dist/spreadsheet/SpreadsheetValidationDialog.d.ts +11 -0
- package/dist/spreadsheet/index.cjs +0 -1
- package/dist/spreadsheet/index.d.cts +11 -309
- package/dist/spreadsheet/index.d.ts +11 -309
- package/dist/spreadsheet/index.js +1 -2
- package/dist/spreadsheet/useSpreadsheetEditor.d.cts +126 -0
- package/dist/spreadsheet/useSpreadsheetEditor.d.ts +126 -0
- package/dist/spreadsheet/useSpreadsheetTableInteractions.d.cts +30 -0
- package/dist/spreadsheet/useSpreadsheetTableInteractions.d.ts +30 -0
- package/dist/spreadsheet/useSpreadsheetViewport.d.cts +25 -0
- package/dist/spreadsheet/useSpreadsheetViewport.d.ts +25 -0
- package/dist/tables/InsertTableGrid.d.cts +25 -0
- package/dist/tables/InsertTableGrid.d.ts +25 -0
- package/dist/tables/TableBubbleMenu.d.cts +18 -0
- package/dist/tables/TableBubbleMenu.d.ts +18 -0
- package/dist/tables/TableToolbar.d.cts +23 -0
- package/dist/tables/TableToolbar.d.ts +23 -0
- package/dist/tables/index.d.cts +4 -0
- package/dist/tables/index.d.ts +4 -0
- package/dist/tables/useTableMenu.d.cts +17 -0
- package/dist/tables/useTableMenu.d.ts +17 -0
- package/dist/tokens/TokensPanel.d.cts +22 -0
- package/dist/tokens/TokensPanel.d.ts +22 -0
- package/dist/tokens/index.cjs +0 -1
- package/dist/tokens/index.d.cts +2 -54
- package/dist/tokens/index.d.ts +2 -54
- package/dist/tokens/index.js +0 -1
- package/dist/tokens/useTokens.d.cts +29 -0
- package/dist/tokens/useTokens.d.ts +29 -0
- package/dist/vector/VectorAppearancePanel.d.cts +14 -0
- package/dist/vector/VectorAppearancePanel.d.ts +14 -0
- package/dist/vector/VectorCanvas.d.cts +58 -0
- package/dist/vector/VectorCanvas.d.ts +58 -0
- package/dist/vector/VectorConnectorPanel.d.cts +12 -0
- package/dist/vector/VectorConnectorPanel.d.ts +12 -0
- package/dist/vector/VectorConstraintsPanel.d.cts +12 -0
- package/dist/vector/VectorConstraintsPanel.d.ts +12 -0
- package/dist/vector/VectorEditor.d.cts +23 -0
- package/dist/vector/VectorEditor.d.ts +23 -0
- package/dist/vector/VectorEffectsPanel.d.cts +13 -0
- package/dist/vector/VectorEffectsPanel.d.ts +13 -0
- package/dist/vector/VectorEnvelopePanel.d.cts +13 -0
- package/dist/vector/VectorEnvelopePanel.d.ts +13 -0
- package/dist/vector/VectorFramePanel.d.cts +12 -0
- package/dist/vector/VectorFramePanel.d.ts +12 -0
- package/dist/vector/VectorGeneratePanel.d.cts +15 -0
- package/dist/vector/VectorGeneratePanel.d.ts +15 -0
- package/dist/vector/VectorGradientEditor.d.cts +12 -0
- package/dist/vector/VectorGradientEditor.d.ts +12 -0
- package/dist/vector/VectorLensPanel.d.cts +12 -0
- package/dist/vector/VectorLensPanel.d.ts +12 -0
- package/dist/vector/VectorMaskPanel.d.cts +13 -0
- package/dist/vector/VectorMaskPanel.d.ts +13 -0
- package/dist/vector/VectorPagesPanel.d.cts +11 -0
- package/dist/vector/VectorPagesPanel.d.ts +11 -0
- package/dist/vector/VectorPerspectivePanel.d.cts +12 -0
- package/dist/vector/VectorPerspectivePanel.d.ts +12 -0
- package/dist/vector/VectorProviderEffectsPanel.d.cts +12 -0
- package/dist/vector/VectorProviderEffectsPanel.d.ts +12 -0
- package/dist/vector/VectorShadingPanel.d.cts +12 -0
- package/dist/vector/VectorShadingPanel.d.ts +12 -0
- package/dist/vector/VectorSymbolsPanel.d.cts +12 -0
- package/dist/vector/VectorSymbolsPanel.d.ts +12 -0
- package/dist/vector/VectorSymmetryPanel.d.cts +12 -0
- package/dist/vector/VectorSymmetryPanel.d.ts +12 -0
- package/dist/vector/VectorTextPanel.d.cts +14 -0
- package/dist/vector/VectorTextPanel.d.ts +14 -0
- package/dist/vector/VectorToolbar.d.cts +39 -0
- package/dist/vector/VectorToolbar.d.ts +39 -0
- package/dist/vector/VectorTracePanel.d.cts +12 -0
- package/dist/vector/VectorTracePanel.d.ts +12 -0
- package/dist/vector/VectorWidthPointEditor.d.cts +18 -0
- package/dist/vector/VectorWidthPointEditor.d.ts +18 -0
- package/dist/vector/index.cjs +0 -1
- package/dist/vector/index.d.cts +23 -384
- package/dist/vector/index.d.ts +23 -384
- package/dist/vector/index.js +2 -3
- package/dist/vector/useVectorEditor.d.cts +40 -0
- package/dist/vector/useVectorEditor.d.ts +40 -0
- package/dist/video-editor/ClipInspector.d.cts +14 -0
- package/dist/video-editor/ClipInspector.d.ts +14 -0
- package/dist/video-editor/MediaBin.d.cts +18 -0
- package/dist/video-editor/MediaBin.d.ts +18 -0
- package/dist/video-editor/TranscriptPanel.d.cts +17 -0
- package/dist/video-editor/TranscriptPanel.d.ts +17 -0
- package/dist/video-editor/VideoEditor.d.cts +41 -0
- package/dist/video-editor/VideoEditor.d.ts +41 -0
- package/dist/video-editor/VideoEffectsPanel.d.cts +13 -0
- package/dist/video-editor/VideoEffectsPanel.d.ts +13 -0
- package/dist/video-editor/VideoPreview.d.cts +17 -0
- package/dist/video-editor/VideoPreview.d.ts +17 -0
- package/dist/video-editor/VideoScopes.d.cts +17 -0
- package/dist/video-editor/VideoScopes.d.ts +17 -0
- package/dist/video-editor/VideoTimeline.d.cts +15 -0
- package/dist/video-editor/VideoTimeline.d.ts +15 -0
- package/dist/video-editor/VideoTransport.d.cts +14 -0
- package/dist/video-editor/VideoTransport.d.ts +14 -0
- package/dist/video-editor/index.cjs +0 -1
- package/dist/video-editor/index.d.cts +10 -203
- package/dist/video-editor/index.d.ts +10 -203
- package/dist/video-editor/index.js +2 -3
- package/dist/video-editor/useVideoEditor.d.cts +42 -0
- package/dist/video-editor/useVideoEditor.d.ts +42 -0
- package/package.json +124 -49
- package/dist/PaintGradientEditorView-CCPCY5Ib.d.cts +0 -14
- package/dist/PaintGradientEditorView-CCPCY5Ib.d.ts +0 -14
- package/dist/animation-editor/index.cjs.map +0 -1
- package/dist/animation-editor/index.js.map +0 -1
- package/dist/canvas/index.cjs.map +0 -1
- package/dist/canvas/index.js.map +0 -1
- package/dist/chart/index.cjs.map +0 -1
- package/dist/chart/index.js.map +0 -1
- package/dist/chunk-34HEZX7J.js.map +0 -1
- package/dist/chunk-4FQXRPBN.js.map +0 -1
- package/dist/chunk-4ZC2WCUO.js.map +0 -1
- package/dist/chunk-I3E4KSA2.js.map +0 -1
- package/dist/chunk-MO354USR.js.map +0 -1
- package/dist/chunk-SIEOYRHX.js.map +0 -1
- package/dist/chunk-WOQ3H7KA.js.map +0 -1
- package/dist/chunk-XWFU2CSG.js.map +0 -1
- package/dist/chunk-ZQZAKUUM.js.map +0 -1
- package/dist/commands/index.cjs.map +0 -1
- package/dist/commands/index.js.map +0 -1
- package/dist/effects/index.cjs.map +0 -1
- package/dist/effects/index.js.map +0 -1
- package/dist/generation/index.cjs.map +0 -1
- package/dist/generation/index.js.map +0 -1
- package/dist/image-editor/index.cjs.map +0 -1
- package/dist/image-editor/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/paint-editor/index.cjs.map +0 -1
- package/dist/paint-editor/index.js.map +0 -1
- package/dist/parameters/index.cjs.map +0 -1
- package/dist/parameters/index.js.map +0 -1
- package/dist/persistence/index.cjs.map +0 -1
- package/dist/persistence/index.js.map +0 -1
- package/dist/spreadsheet/index.cjs.map +0 -1
- package/dist/spreadsheet/index.js.map +0 -1
- package/dist/tokens/index.cjs.map +0 -1
- package/dist/tokens/index.js.map +0 -1
- package/dist/vector/index.cjs.map +0 -1
- package/dist/vector/index.js.map +0 -1
- package/dist/video-editor/index.cjs.map +0 -1
- package/dist/video-editor/index.js.map +0 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type ArrangeHistoryTarget, type CanvasComponentSyncOptions, type CanvasNode } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasComponentsOptions<TNode extends CanvasNode = CanvasNode> extends CanvasComponentSyncOptions {
|
|
3
|
+
nodes: TNode[];
|
|
4
|
+
setNodes: (updater: TNode[] | ((prev: TNode[]) => TNode[])) => void;
|
|
5
|
+
/** When set, every component action is one undoable step. */
|
|
6
|
+
history?: ArrangeHistoryTarget;
|
|
7
|
+
/** The selection (default: nodes with `selected`). */
|
|
8
|
+
getSelectedIds?: () => string[];
|
|
9
|
+
/** Called by `goToMainComponent` with the main (e.g. to pan the viewport to it). */
|
|
10
|
+
onReveal?: (node: TNode) => void;
|
|
11
|
+
/** Sync instances with their mains after every node change (default `true`). */
|
|
12
|
+
autoSync?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* React hook for Figma-style components and instances on a React Flow canvas. After every
|
|
16
|
+
* node change it records edits inside instances as overrides and rebuilds the instances of
|
|
17
|
+
* edited main components (keeping overrides). Its actions (`createComponent`,
|
|
18
|
+
* `createInstance`, `combineAsVariants`, `detachInstance`, `resetOverrides`, `pushOverrides`,
|
|
19
|
+
* `swapInstance`, `setInstanceProperties`, `restoreMainComponent`, …) are undoable steps
|
|
20
|
+
* with a `history`, and each has a `can…` check returning `true` or the reason it can't run.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useCanvasComponents<TNode extends CanvasNode = CanvasNode>(options: UseCanvasComponentsOptions<TNode>): {
|
|
23
|
+
sync: () => TNode[];
|
|
24
|
+
syncAll(): TNode[];
|
|
25
|
+
createComponent(ids?: Iterable<string>, createOptions?: Omit<import("@pixerate/editor/canvas").CreateCanvasComponentOptions, keyof CanvasComponentSyncOptions>): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
26
|
+
canCreateComponent: (ids?: Iterable<string>) => string | true;
|
|
27
|
+
combineAsVariants(ids?: Iterable<string>, combineOptions?: {
|
|
28
|
+
id?: string;
|
|
29
|
+
name?: string;
|
|
30
|
+
padding?: number;
|
|
31
|
+
}): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
32
|
+
canCombineAsVariants: (ids?: Iterable<string>) => string | true;
|
|
33
|
+
createInstance(componentId: string, createOptions?: Omit<import("@pixerate/editor/canvas").CreateCanvasInstanceOptions, keyof CanvasComponentSyncOptions>): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
34
|
+
canCreateInstance(componentId?: string, parentId?: string): true | string;
|
|
35
|
+
detachInstance(ids?: Iterable<string>): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
36
|
+
canDetachInstance(ids?: Iterable<string>): true | string;
|
|
37
|
+
resetOverrides(id?: string, group?: string): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
38
|
+
canResetOverrides(id?: string): true | string;
|
|
39
|
+
pushOverrides(id?: string): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
40
|
+
canPushOverrides(id?: string): true | string;
|
|
41
|
+
swapInstance(componentId: string, ids?: Iterable<string>, swapOptions?: {
|
|
42
|
+
keepTextOverridesOnly?: boolean;
|
|
43
|
+
}): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
44
|
+
canSwapInstance(componentId?: string, ids?: Iterable<string>): true | string;
|
|
45
|
+
setInstanceProperties(properties: Record<string, unknown>, ids?: Iterable<string>): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
46
|
+
canSetInstanceProperties(ids?: Iterable<string>): true | string;
|
|
47
|
+
restoreMainComponent(id?: string): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
48
|
+
canRestoreMainComponent(id?: string): true | string;
|
|
49
|
+
setComponentProperty(componentId: string, name: string, def: import("@pixerate/editor/canvas").CanvasComponentPropertyDef | null, propertyOptions?: {
|
|
50
|
+
newName?: string;
|
|
51
|
+
}): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
52
|
+
addVariant(setId?: string, variantOptions?: Omit<import("@pixerate/editor/canvas").AddCanvasVariantOptions, keyof CanvasComponentSyncOptions>): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
53
|
+
canAddVariant(setId?: string, variantOptions?: Omit<import("@pixerate/editor/canvas").AddCanvasVariantOptions, keyof CanvasComponentSyncOptions>): true | string;
|
|
54
|
+
removeVariant(variantId?: string): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
55
|
+
canRemoveVariant(variantId?: string): true | string;
|
|
56
|
+
setVariantProperties(values: Record<string, string>, variantId?: string, variantOptions?: {
|
|
57
|
+
defaultValue?: string;
|
|
58
|
+
}): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
59
|
+
canSetVariantProperties(values?: Record<string, string>, variantId?: string): true | string;
|
|
60
|
+
renameVariantProperty(name: string, newName: string, setId?: string): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
61
|
+
canRenameVariantProperty(name?: string, newName?: string, setId?: string): true | string;
|
|
62
|
+
renameVariantValue(property: string, value: string, newValue: string, setId?: string): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
63
|
+
canRenameVariantValue(property?: string, value?: string, newValue?: string, setId?: string): true | string;
|
|
64
|
+
bindComponentProperty(layerId: string, field: import("@pixerate/editor/canvas").CanvasComponentPropertyField, name: string | null): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
65
|
+
goToMainComponent(id?: string): string | undefined;
|
|
66
|
+
canGoToMainComponent(id?: string): true | string;
|
|
67
|
+
list: () => {
|
|
68
|
+
components: import("@pixerate/editor/canvas").CanvasComponentInfo[];
|
|
69
|
+
sets: import("@pixerate/editor/canvas").CanvasComponentSetInfo[];
|
|
70
|
+
};
|
|
71
|
+
inspect: (id?: string) => import("@pixerate/editor/canvas").CanvasInstanceInfo | undefined;
|
|
72
|
+
rootInstanceOf: (id: string) => string | undefined;
|
|
73
|
+
};
|
|
74
|
+
export type CanvasComponents<TNode extends CanvasNode = CanvasNode> = ReturnType<typeof useCanvasComponents<TNode>>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type ArrangeHistoryTarget, type CanvasComponentSyncOptions, type CanvasNode } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasComponentsOptions<TNode extends CanvasNode = CanvasNode> extends CanvasComponentSyncOptions {
|
|
3
|
+
nodes: TNode[];
|
|
4
|
+
setNodes: (updater: TNode[] | ((prev: TNode[]) => TNode[])) => void;
|
|
5
|
+
/** When set, every component action is one undoable step. */
|
|
6
|
+
history?: ArrangeHistoryTarget;
|
|
7
|
+
/** The selection (default: nodes with `selected`). */
|
|
8
|
+
getSelectedIds?: () => string[];
|
|
9
|
+
/** Called by `goToMainComponent` with the main (e.g. to pan the viewport to it). */
|
|
10
|
+
onReveal?: (node: TNode) => void;
|
|
11
|
+
/** Sync instances with their mains after every node change (default `true`). */
|
|
12
|
+
autoSync?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* React hook for Figma-style components and instances on a React Flow canvas. After every
|
|
16
|
+
* node change it records edits inside instances as overrides and rebuilds the instances of
|
|
17
|
+
* edited main components (keeping overrides). Its actions (`createComponent`,
|
|
18
|
+
* `createInstance`, `combineAsVariants`, `detachInstance`, `resetOverrides`, `pushOverrides`,
|
|
19
|
+
* `swapInstance`, `setInstanceProperties`, `restoreMainComponent`, …) are undoable steps
|
|
20
|
+
* with a `history`, and each has a `can…` check returning `true` or the reason it can't run.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useCanvasComponents<TNode extends CanvasNode = CanvasNode>(options: UseCanvasComponentsOptions<TNode>): {
|
|
23
|
+
sync: () => TNode[];
|
|
24
|
+
syncAll(): TNode[];
|
|
25
|
+
createComponent(ids?: Iterable<string>, createOptions?: Omit<import("@pixerate/editor/canvas").CreateCanvasComponentOptions, keyof CanvasComponentSyncOptions>): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
26
|
+
canCreateComponent: (ids?: Iterable<string>) => string | true;
|
|
27
|
+
combineAsVariants(ids?: Iterable<string>, combineOptions?: {
|
|
28
|
+
id?: string;
|
|
29
|
+
name?: string;
|
|
30
|
+
padding?: number;
|
|
31
|
+
}): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
32
|
+
canCombineAsVariants: (ids?: Iterable<string>) => string | true;
|
|
33
|
+
createInstance(componentId: string, createOptions?: Omit<import("@pixerate/editor/canvas").CreateCanvasInstanceOptions, keyof CanvasComponentSyncOptions>): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
34
|
+
canCreateInstance(componentId?: string, parentId?: string): true | string;
|
|
35
|
+
detachInstance(ids?: Iterable<string>): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
36
|
+
canDetachInstance(ids?: Iterable<string>): true | string;
|
|
37
|
+
resetOverrides(id?: string, group?: string): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
38
|
+
canResetOverrides(id?: string): true | string;
|
|
39
|
+
pushOverrides(id?: string): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
40
|
+
canPushOverrides(id?: string): true | string;
|
|
41
|
+
swapInstance(componentId: string, ids?: Iterable<string>, swapOptions?: {
|
|
42
|
+
keepTextOverridesOnly?: boolean;
|
|
43
|
+
}): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
44
|
+
canSwapInstance(componentId?: string, ids?: Iterable<string>): true | string;
|
|
45
|
+
setInstanceProperties(properties: Record<string, unknown>, ids?: Iterable<string>): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
46
|
+
canSetInstanceProperties(ids?: Iterable<string>): true | string;
|
|
47
|
+
restoreMainComponent(id?: string): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
48
|
+
canRestoreMainComponent(id?: string): true | string;
|
|
49
|
+
setComponentProperty(componentId: string, name: string, def: import("@pixerate/editor/canvas").CanvasComponentPropertyDef | null, propertyOptions?: {
|
|
50
|
+
newName?: string;
|
|
51
|
+
}): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
52
|
+
addVariant(setId?: string, variantOptions?: Omit<import("@pixerate/editor/canvas").AddCanvasVariantOptions, keyof CanvasComponentSyncOptions>): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
53
|
+
canAddVariant(setId?: string, variantOptions?: Omit<import("@pixerate/editor/canvas").AddCanvasVariantOptions, keyof CanvasComponentSyncOptions>): true | string;
|
|
54
|
+
removeVariant(variantId?: string): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
55
|
+
canRemoveVariant(variantId?: string): true | string;
|
|
56
|
+
setVariantProperties(values: Record<string, string>, variantId?: string, variantOptions?: {
|
|
57
|
+
defaultValue?: string;
|
|
58
|
+
}): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
59
|
+
canSetVariantProperties(values?: Record<string, string>, variantId?: string): true | string;
|
|
60
|
+
renameVariantProperty(name: string, newName: string, setId?: string): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
61
|
+
canRenameVariantProperty(name?: string, newName?: string, setId?: string): true | string;
|
|
62
|
+
renameVariantValue(property: string, value: string, newValue: string, setId?: string): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
63
|
+
canRenameVariantValue(property?: string, value?: string, newValue?: string, setId?: string): true | string;
|
|
64
|
+
bindComponentProperty(layerId: string, field: import("@pixerate/editor/canvas").CanvasComponentPropertyField, name: string | null): import("@pixerate/editor/canvas").CanvasComponentResult<TNode>;
|
|
65
|
+
goToMainComponent(id?: string): string | undefined;
|
|
66
|
+
canGoToMainComponent(id?: string): true | string;
|
|
67
|
+
list: () => {
|
|
68
|
+
components: import("@pixerate/editor/canvas").CanvasComponentInfo[];
|
|
69
|
+
sets: import("@pixerate/editor/canvas").CanvasComponentSetInfo[];
|
|
70
|
+
};
|
|
71
|
+
inspect: (id?: string) => import("@pixerate/editor/canvas").CanvasInstanceInfo | undefined;
|
|
72
|
+
rootInstanceOf: (id: string) => string | undefined;
|
|
73
|
+
};
|
|
74
|
+
export type CanvasComponents<TNode extends CanvasNode = CanvasNode> = ReturnType<typeof useCanvasComponents<TNode>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CanvasDockingCallbacks, CanvasNode, DockStrategy, XYPosition } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasDockingOptions<TNode extends CanvasNode = CanvasNode> extends CanvasDockingCallbacks<TNode> {
|
|
3
|
+
strategy?: DockStrategy;
|
|
4
|
+
dockableTypes?: string[];
|
|
5
|
+
targetTypes?: string[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* React hook resolving docking targets and intersections when dragging nodes across the canvas.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useCanvasDocking<TNode extends CanvasNode = CanvasNode>(options?: UseCanvasDockingOptions<TNode>): {
|
|
11
|
+
findDockTarget: (draggedNode: TNode, candidates: TNode[], cursorPos?: XYPosition) => TNode | null;
|
|
12
|
+
updateDragOver: (draggedNode: TNode, candidates: TNode[], cursorPos?: XYPosition) => void;
|
|
13
|
+
finalizeDock: (draggedNode: TNode) => void;
|
|
14
|
+
getActiveDockTarget: () => TNode | null;
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CanvasDockingCallbacks, CanvasNode, DockStrategy, XYPosition } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasDockingOptions<TNode extends CanvasNode = CanvasNode> extends CanvasDockingCallbacks<TNode> {
|
|
3
|
+
strategy?: DockStrategy;
|
|
4
|
+
dockableTypes?: string[];
|
|
5
|
+
targetTypes?: string[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* React hook resolving docking targets and intersections when dragging nodes across the canvas.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useCanvasDocking<TNode extends CanvasNode = CanvasNode>(options?: UseCanvasDockingOptions<TNode>): {
|
|
11
|
+
findDockTarget: (draggedNode: TNode, candidates: TNode[], cursorPos?: XYPosition) => TNode | null;
|
|
12
|
+
updateDragOver: (draggedNode: TNode, candidates: TNode[], cursorPos?: XYPosition) => void;
|
|
13
|
+
finalizeDock: (draggedNode: TNode) => void;
|
|
14
|
+
getActiveDockTarget: () => TNode | null;
|
|
15
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ArrangeHistoryTarget, type CanvasBrushPreset, type CanvasNode, type DrawStrokeInput, type DrawStrokeResult, type FreehandDrawOptions, type FreehandPenSample, type FreehandStroke, type FreehandStrokeStyle, type FreehandTool } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasDrawOptions<TNode extends CanvasNode = CanvasNode> {
|
|
3
|
+
nodes: TNode[];
|
|
4
|
+
setNodes: (updater: TNode[] | ((prev: TNode[]) => TNode[])) => void;
|
|
5
|
+
history?: ArrangeHistoryTarget;
|
|
6
|
+
initialTool?: FreehandTool;
|
|
7
|
+
initialStyle?: Partial<FreehandStrokeStyle>;
|
|
8
|
+
drawOptions?: FreehandDrawOptions;
|
|
9
|
+
generateNodeId?: () => string;
|
|
10
|
+
onStrokeComplete?: (node: TNode) => void;
|
|
11
|
+
onNodesErase?: (erasedNodes: TNode[]) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface CanvasDrawState {
|
|
14
|
+
tool: FreehandTool;
|
|
15
|
+
style: FreehandStrokeStyle;
|
|
16
|
+
activeStroke: FreehandStroke | null;
|
|
17
|
+
isDrawing: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface CanvasDrawActions<TNode extends CanvasNode = CanvasNode> {
|
|
20
|
+
setTool: (tool: FreehandTool) => void;
|
|
21
|
+
setStyle: (style: Partial<FreehandStrokeStyle>) => void;
|
|
22
|
+
/** Starts a stroke; `pen` carries pressure and tilt (`pointerPenSample(event)`), used by brushed strokes. */
|
|
23
|
+
startStroke: (point: [number, number], pen?: FreehandPenSample) => void;
|
|
24
|
+
continueStroke: (point: [number, number], pen?: FreehandPenSample) => void;
|
|
25
|
+
endStroke: () => TNode | null;
|
|
26
|
+
cancelStroke: () => void;
|
|
27
|
+
eraseAt: (point: [number, number], radius?: number) => TNode[];
|
|
28
|
+
/** Draws a whole stroke at once (agents, code); validates the brush first. One undo step. */
|
|
29
|
+
drawStroke: (input: DrawStrokeInput) => Promise<DrawStrokeResult<TNode>>;
|
|
30
|
+
/** The dry paint presets `style.brush` accepts (loads the paint engine). */
|
|
31
|
+
listBrushes: () => Promise<CanvasBrushPreset[]>;
|
|
32
|
+
}
|
|
33
|
+
export type CanvasDraw<TNode extends CanvasNode = CanvasNode> = CanvasDrawState & CanvasDrawActions<TNode>;
|
|
34
|
+
/**
|
|
35
|
+
* React hook managing freehand drawing tools (pen, highlighter, eraser) on a canvas.
|
|
36
|
+
*/
|
|
37
|
+
export declare function useCanvasDraw<TNode extends CanvasNode = CanvasNode>(options: UseCanvasDrawOptions<TNode>): CanvasDraw<TNode>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ArrangeHistoryTarget, type CanvasBrushPreset, type CanvasNode, type DrawStrokeInput, type DrawStrokeResult, type FreehandDrawOptions, type FreehandPenSample, type FreehandStroke, type FreehandStrokeStyle, type FreehandTool } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasDrawOptions<TNode extends CanvasNode = CanvasNode> {
|
|
3
|
+
nodes: TNode[];
|
|
4
|
+
setNodes: (updater: TNode[] | ((prev: TNode[]) => TNode[])) => void;
|
|
5
|
+
history?: ArrangeHistoryTarget;
|
|
6
|
+
initialTool?: FreehandTool;
|
|
7
|
+
initialStyle?: Partial<FreehandStrokeStyle>;
|
|
8
|
+
drawOptions?: FreehandDrawOptions;
|
|
9
|
+
generateNodeId?: () => string;
|
|
10
|
+
onStrokeComplete?: (node: TNode) => void;
|
|
11
|
+
onNodesErase?: (erasedNodes: TNode[]) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface CanvasDrawState {
|
|
14
|
+
tool: FreehandTool;
|
|
15
|
+
style: FreehandStrokeStyle;
|
|
16
|
+
activeStroke: FreehandStroke | null;
|
|
17
|
+
isDrawing: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface CanvasDrawActions<TNode extends CanvasNode = CanvasNode> {
|
|
20
|
+
setTool: (tool: FreehandTool) => void;
|
|
21
|
+
setStyle: (style: Partial<FreehandStrokeStyle>) => void;
|
|
22
|
+
/** Starts a stroke; `pen` carries pressure and tilt (`pointerPenSample(event)`), used by brushed strokes. */
|
|
23
|
+
startStroke: (point: [number, number], pen?: FreehandPenSample) => void;
|
|
24
|
+
continueStroke: (point: [number, number], pen?: FreehandPenSample) => void;
|
|
25
|
+
endStroke: () => TNode | null;
|
|
26
|
+
cancelStroke: () => void;
|
|
27
|
+
eraseAt: (point: [number, number], radius?: number) => TNode[];
|
|
28
|
+
/** Draws a whole stroke at once (agents, code); validates the brush first. One undo step. */
|
|
29
|
+
drawStroke: (input: DrawStrokeInput) => Promise<DrawStrokeResult<TNode>>;
|
|
30
|
+
/** The dry paint presets `style.brush` accepts (loads the paint engine). */
|
|
31
|
+
listBrushes: () => Promise<CanvasBrushPreset[]>;
|
|
32
|
+
}
|
|
33
|
+
export type CanvasDraw<TNode extends CanvasNode = CanvasNode> = CanvasDrawState & CanvasDrawActions<TNode>;
|
|
34
|
+
/**
|
|
35
|
+
* React hook managing freehand drawing tools (pen, highlighter, eraser) on a canvas.
|
|
36
|
+
*/
|
|
37
|
+
export declare function useCanvasDraw<TNode extends CanvasNode = CanvasNode>(options: UseCanvasDrawOptions<TNode>): CanvasDraw<TNode>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type CanvasEdge, type CanvasNode, type CollapseNodeOptions, type ExplodeNodeOptions, type ExplosionSnapshot } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface CanvasGraphTarget<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge> {
|
|
3
|
+
nodes: TNode[];
|
|
4
|
+
edges: TEdge[];
|
|
5
|
+
setNodes: (updater: TNode[] | ((prev: TNode[]) => TNode[])) => void;
|
|
6
|
+
setEdges: (updater: TEdge[] | ((prev: TEdge[]) => TEdge[])) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* React hook managing node explosion and collapse transitions with exact reversibility.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useCanvasExplosion<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge>(target: CanvasGraphTarget<TNode, TEdge>): {
|
|
12
|
+
explodeNode: (parentNodeId: string, options: ExplodeNodeOptions<TNode, TEdge>) => void;
|
|
13
|
+
collapseNode: (parentNodeId: string, options?: CollapseNodeOptions) => void;
|
|
14
|
+
isExploded: (parentNodeId: string) => boolean;
|
|
15
|
+
getSnapshot: (parentNodeId: string) => ExplosionSnapshot<TNode, TEdge> | undefined;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type CanvasEdge, type CanvasNode, type CollapseNodeOptions, type ExplodeNodeOptions, type ExplosionSnapshot } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface CanvasGraphTarget<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge> {
|
|
3
|
+
nodes: TNode[];
|
|
4
|
+
edges: TEdge[];
|
|
5
|
+
setNodes: (updater: TNode[] | ((prev: TNode[]) => TNode[])) => void;
|
|
6
|
+
setEdges: (updater: TEdge[] | ((prev: TEdge[]) => TEdge[])) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* React hook managing node explosion and collapse transitions with exact reversibility.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useCanvasExplosion<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge>(target: CanvasGraphTarget<TNode, TEdge>): {
|
|
12
|
+
explodeNode: (parentNodeId: string, options: ExplodeNodeOptions<TNode, TEdge>) => void;
|
|
13
|
+
collapseNode: (parentNodeId: string, options?: CollapseNodeOptions) => void;
|
|
14
|
+
isExploded: (parentNodeId: string) => boolean;
|
|
15
|
+
getSnapshot: (parentNodeId: string) => ExplosionSnapshot<TNode, TEdge> | undefined;
|
|
16
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CanvasNode, CanvasEdge, GraphDifferences } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasGraphOptions<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge> {
|
|
3
|
+
initialNodes?: TNode[];
|
|
4
|
+
initialEdges?: TEdge[];
|
|
5
|
+
onNodesChange?: (nodes: TNode[]) => void;
|
|
6
|
+
onEdgesChange?: (edges: TEdge[]) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* React hook managing canvas graph state (nodes, edges, selection, and structural differences).
|
|
10
|
+
*/
|
|
11
|
+
export declare function useCanvasGraph<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge>(options?: UseCanvasGraphOptions<TNode, TEdge>): {
|
|
12
|
+
nodes: TNode[];
|
|
13
|
+
edges: TEdge[];
|
|
14
|
+
setNodes: (updater: TNode[] | ((prev: TNode[]) => TNode[])) => void;
|
|
15
|
+
setEdges: (updater: TEdge[] | ((prev: TEdge[]) => TEdge[])) => void;
|
|
16
|
+
addNode: (node: TNode) => void;
|
|
17
|
+
removeNodes: (ids: string[]) => void;
|
|
18
|
+
updateNodeData: (id: string, patch: Partial<TNode["data"]>) => void;
|
|
19
|
+
updateNodePosition: (id: string, position: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
}) => void;
|
|
23
|
+
addEdge: (edge: TEdge) => void;
|
|
24
|
+
removeEdges: (ids: string[]) => void;
|
|
25
|
+
resetBaseline: () => void;
|
|
26
|
+
getDifferences: () => GraphDifferences<TNode, TEdge>;
|
|
27
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CanvasNode, CanvasEdge, GraphDifferences } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasGraphOptions<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge> {
|
|
3
|
+
initialNodes?: TNode[];
|
|
4
|
+
initialEdges?: TEdge[];
|
|
5
|
+
onNodesChange?: (nodes: TNode[]) => void;
|
|
6
|
+
onEdgesChange?: (edges: TEdge[]) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* React hook managing canvas graph state (nodes, edges, selection, and structural differences).
|
|
10
|
+
*/
|
|
11
|
+
export declare function useCanvasGraph<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge>(options?: UseCanvasGraphOptions<TNode, TEdge>): {
|
|
12
|
+
nodes: TNode[];
|
|
13
|
+
edges: TEdge[];
|
|
14
|
+
setNodes: (updater: TNode[] | ((prev: TNode[]) => TNode[])) => void;
|
|
15
|
+
setEdges: (updater: TEdge[] | ((prev: TEdge[]) => TEdge[])) => void;
|
|
16
|
+
addNode: (node: TNode) => void;
|
|
17
|
+
removeNodes: (ids: string[]) => void;
|
|
18
|
+
updateNodeData: (id: string, patch: Partial<TNode["data"]>) => void;
|
|
19
|
+
updateNodePosition: (id: string, position: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
}) => void;
|
|
23
|
+
addEdge: (edge: TEdge) => void;
|
|
24
|
+
removeEdges: (ids: string[]) => void;
|
|
25
|
+
resetBaseline: () => void;
|
|
26
|
+
getDifferences: () => GraphDifferences<TNode, TEdge>;
|
|
27
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getCenteredNodePosition, type CanvasEdge, type CanvasLayoutOptions, type CanvasNode, type IncrementalLayoutOptions, type PlaceBesideOptions, type Rect, type Side, type XYPosition } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasLayoutOptions<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge> {
|
|
3
|
+
nodes: TNode[];
|
|
4
|
+
edges: TEdge[];
|
|
5
|
+
setNodes: (updater: TNode[] | ((prev: TNode[]) => TNode[])) => void;
|
|
6
|
+
getNodesBounds?: (nodes: TNode[]) => Rect;
|
|
7
|
+
screenToFlowPosition?: (position: XYPosition) => XYPosition;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* React hook providing layout automation: Dagre hierarchy, incremental layout blending,
|
|
11
|
+
* collision-aware directional placement, and viewport centering.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useCanvasLayout<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge>(options: UseCanvasLayoutOptions<TNode, TEdge>): {
|
|
14
|
+
applyLayout: (layoutOptions?: CanvasLayoutOptions) => TNode[];
|
|
15
|
+
applyIncrementalLayout: (incrementalOptions?: IncrementalLayoutOptions) => TNode[];
|
|
16
|
+
center: (screenDimensions?: {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
}) => void;
|
|
20
|
+
getPlacementPosition: (size: {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
}, side?: Side, nearNodeId?: string, placementOptions?: PlaceBesideOptions) => XYPosition;
|
|
24
|
+
getCenteredNodePosition: typeof getCenteredNodePosition;
|
|
25
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getCenteredNodePosition, type CanvasEdge, type CanvasLayoutOptions, type CanvasNode, type IncrementalLayoutOptions, type PlaceBesideOptions, type Rect, type Side, type XYPosition } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasLayoutOptions<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge> {
|
|
3
|
+
nodes: TNode[];
|
|
4
|
+
edges: TEdge[];
|
|
5
|
+
setNodes: (updater: TNode[] | ((prev: TNode[]) => TNode[])) => void;
|
|
6
|
+
getNodesBounds?: (nodes: TNode[]) => Rect;
|
|
7
|
+
screenToFlowPosition?: (position: XYPosition) => XYPosition;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* React hook providing layout automation: Dagre hierarchy, incremental layout blending,
|
|
11
|
+
* collision-aware directional placement, and viewport centering.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useCanvasLayout<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge>(options: UseCanvasLayoutOptions<TNode, TEdge>): {
|
|
14
|
+
applyLayout: (layoutOptions?: CanvasLayoutOptions) => TNode[];
|
|
15
|
+
applyIncrementalLayout: (incrementalOptions?: IncrementalLayoutOptions) => TNode[];
|
|
16
|
+
center: (screenDimensions?: {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
}) => void;
|
|
20
|
+
getPlacementPosition: (size: {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
}, side?: Side, nearNodeId?: string, placementOptions?: PlaceBesideOptions) => XYPosition;
|
|
24
|
+
getCenteredNodePosition: typeof getCenteredNodePosition;
|
|
25
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type CanvasNode, type NodeRectOptions } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasMeasureOptions<TNode extends CanvasNode = CanvasNode> {
|
|
3
|
+
nodes: TNode[];
|
|
4
|
+
/** Ids measured from (default: nodes with `selected: true`). */
|
|
5
|
+
getSelectedIds?: () => string[];
|
|
6
|
+
/** Turns measuring off (default `true`). */
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
/** Measure only while Alt / Option is held (default `true`); `false` always measures. */
|
|
9
|
+
requireModifier?: boolean;
|
|
10
|
+
/** Element receiving the Alt key events (default `window`). */
|
|
11
|
+
targetElement?: HTMLElement | Window | null;
|
|
12
|
+
rectOptions?: NodeRectOptions;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Alt-hover distance measuring for React Flow: hold Alt / Option and hover a node to see
|
|
16
|
+
* red distance lines with labels from the selection to it (or to the selection's parent
|
|
17
|
+
* when hovering the selection or empty space). Wire `onNodeMouseEnter` / `onNodeMouseLeave`
|
|
18
|
+
* to `<ReactFlow>` and render `guides` with `<CanvasGuidesLayer>` (concatenate them with
|
|
19
|
+
* `arrange.guides` to share one layer).
|
|
20
|
+
*/
|
|
21
|
+
export declare function useCanvasMeasure<TNode extends CanvasNode = CanvasNode>(options: UseCanvasMeasureOptions<TNode>): {
|
|
22
|
+
/** Measuring lines (flow coordinates) to pass to `<CanvasGuidesLayer>`. */
|
|
23
|
+
guides: import("@pixerate/editor/canvas").MeasureGuide[];
|
|
24
|
+
/** The box measured to (outline it), or `null`. */
|
|
25
|
+
target: import("@pixerate/editor/canvas").Rect | null;
|
|
26
|
+
/** Whether measuring is showing (enabled and Alt held, unless `requireModifier: false`). */
|
|
27
|
+
active: boolean;
|
|
28
|
+
hoveredId: string | null;
|
|
29
|
+
setHoveredId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
30
|
+
/** Sets the modifier state by hand (e.g. from a toolbar toggle). */
|
|
31
|
+
setModifier: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
32
|
+
onNodeMouseEnter: (event: {
|
|
33
|
+
altKey?: boolean;
|
|
34
|
+
} | null, node: {
|
|
35
|
+
id: string;
|
|
36
|
+
}) => void;
|
|
37
|
+
onNodeMouseLeave: (_event: unknown, node: {
|
|
38
|
+
id: string;
|
|
39
|
+
}) => void;
|
|
40
|
+
};
|
|
41
|
+
export type CanvasMeasure = ReturnType<typeof useCanvasMeasure>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type CanvasNode, type NodeRectOptions } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasMeasureOptions<TNode extends CanvasNode = CanvasNode> {
|
|
3
|
+
nodes: TNode[];
|
|
4
|
+
/** Ids measured from (default: nodes with `selected: true`). */
|
|
5
|
+
getSelectedIds?: () => string[];
|
|
6
|
+
/** Turns measuring off (default `true`). */
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
/** Measure only while Alt / Option is held (default `true`); `false` always measures. */
|
|
9
|
+
requireModifier?: boolean;
|
|
10
|
+
/** Element receiving the Alt key events (default `window`). */
|
|
11
|
+
targetElement?: HTMLElement | Window | null;
|
|
12
|
+
rectOptions?: NodeRectOptions;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Alt-hover distance measuring for React Flow: hold Alt / Option and hover a node to see
|
|
16
|
+
* red distance lines with labels from the selection to it (or to the selection's parent
|
|
17
|
+
* when hovering the selection or empty space). Wire `onNodeMouseEnter` / `onNodeMouseLeave`
|
|
18
|
+
* to `<ReactFlow>` and render `guides` with `<CanvasGuidesLayer>` (concatenate them with
|
|
19
|
+
* `arrange.guides` to share one layer).
|
|
20
|
+
*/
|
|
21
|
+
export declare function useCanvasMeasure<TNode extends CanvasNode = CanvasNode>(options: UseCanvasMeasureOptions<TNode>): {
|
|
22
|
+
/** Measuring lines (flow coordinates) to pass to `<CanvasGuidesLayer>`. */
|
|
23
|
+
guides: import("@pixerate/editor/canvas").MeasureGuide[];
|
|
24
|
+
/** The box measured to (outline it), or `null`. */
|
|
25
|
+
target: import("@pixerate/editor/canvas").Rect | null;
|
|
26
|
+
/** Whether measuring is showing (enabled and Alt held, unless `requireModifier: false`). */
|
|
27
|
+
active: boolean;
|
|
28
|
+
hoveredId: string | null;
|
|
29
|
+
setHoveredId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
30
|
+
/** Sets the modifier state by hand (e.g. from a toolbar toggle). */
|
|
31
|
+
setModifier: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
32
|
+
onNodeMouseEnter: (event: {
|
|
33
|
+
altKey?: boolean;
|
|
34
|
+
} | null, node: {
|
|
35
|
+
id: string;
|
|
36
|
+
}) => void;
|
|
37
|
+
onNodeMouseLeave: (_event: unknown, node: {
|
|
38
|
+
id: string;
|
|
39
|
+
}) => void;
|
|
40
|
+
};
|
|
41
|
+
export type CanvasMeasure = ReturnType<typeof useCanvasMeasure>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { CanvasScenesStore, type CanvasNode, type CanvasScene, type CanvasScenesOptions, type CanvasViewport, type FitViewportOptions } from '@pixerate/editor/canvas';
|
|
2
|
+
import type { EffectProvider } from '@pixerate/editor/effects';
|
|
3
|
+
export interface UseCanvasScenesOptions extends CanvasScenesOptions {
|
|
4
|
+
/** Reads the live viewport, used by `capture` / `recapture` (e.g. `useReactFlow().getViewport`). */
|
|
5
|
+
getViewport?: () => CanvasViewport;
|
|
6
|
+
/** Moves the canvas to a scene (e.g. `useReactFlow().setViewport`). */
|
|
7
|
+
setViewport?: (viewport: CanvasViewport, options?: {
|
|
8
|
+
duration?: number;
|
|
9
|
+
}) => void;
|
|
10
|
+
/** Transition duration passed to `setViewport` when showing a scene (default 300ms). */
|
|
11
|
+
duration?: number;
|
|
12
|
+
/** Use an existing store (e.g. one shared with non-React code) instead of creating one. */
|
|
13
|
+
store?: CanvasScenesStore;
|
|
14
|
+
/**
|
|
15
|
+
* Plays a scene's provider transition (`scene.transition`) when showing it: `element` is the
|
|
16
|
+
* canvas view to capture and cover (e.g. the React Flow wrapper). Without a provider or an
|
|
17
|
+
* element, scenes are shown with the plain viewport move.
|
|
18
|
+
*/
|
|
19
|
+
transitions?: {
|
|
20
|
+
provider: EffectProvider | null | undefined;
|
|
21
|
+
element: () => HTMLElement | null;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* React hook for Freeform-style Scenes: named saved viewports with show next / previous,
|
|
26
|
+
* reorder, rename and JSON persistence. Backed by the framework-agnostic
|
|
27
|
+
* `CanvasScenesStore` through `useSyncExternalStore`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useCanvasScenes(options?: UseCanvasScenesOptions): {
|
|
30
|
+
scenes: readonly CanvasScene[];
|
|
31
|
+
currentId: string | null;
|
|
32
|
+
currentIndex: number;
|
|
33
|
+
current: CanvasScene | null;
|
|
34
|
+
store: CanvasScenesStore;
|
|
35
|
+
/** Saves the current viewport (or `viewport`) as a new scene. */
|
|
36
|
+
capture(name?: string, extra?: {
|
|
37
|
+
viewport?: CanvasViewport;
|
|
38
|
+
nodeIds?: string[];
|
|
39
|
+
index?: number;
|
|
40
|
+
}): CanvasScene;
|
|
41
|
+
/** Saves a scene framing the given nodes in a container of `size`. */
|
|
42
|
+
captureNodes(nodes: CanvasNode[], ids: string[], size: {
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
}, name?: string, fit?: FitViewportOptions): CanvasScene | undefined;
|
|
46
|
+
/** Replaces a scene's viewport with the live one. */
|
|
47
|
+
recapture(id: string): CanvasScene | undefined;
|
|
48
|
+
update: (id: string, patch: Partial<Omit<CanvasScene, "id">>) => CanvasScene | undefined;
|
|
49
|
+
rename: (id: string, name: string) => CanvasScene | undefined;
|
|
50
|
+
move: (id: string, toIndex: number) => void;
|
|
51
|
+
reorder: (ids: string[]) => void;
|
|
52
|
+
remove: (id: string) => void;
|
|
53
|
+
clear: () => void;
|
|
54
|
+
goTo: (id: string) => CanvasScene | undefined;
|
|
55
|
+
next: () => CanvasScene | undefined;
|
|
56
|
+
previous: () => CanvasScene | undefined;
|
|
57
|
+
toJSON: () => import("@pixerate/editor/canvas").SerializedCanvasScenes;
|
|
58
|
+
serialize: () => string;
|
|
59
|
+
load: (input: string | unknown) => void;
|
|
60
|
+
};
|
|
61
|
+
export type CanvasScenes = ReturnType<typeof useCanvasScenes>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { CanvasScenesStore, type CanvasNode, type CanvasScene, type CanvasScenesOptions, type CanvasViewport, type FitViewportOptions } from '@pixerate/editor/canvas';
|
|
2
|
+
import type { EffectProvider } from '@pixerate/editor/effects';
|
|
3
|
+
export interface UseCanvasScenesOptions extends CanvasScenesOptions {
|
|
4
|
+
/** Reads the live viewport, used by `capture` / `recapture` (e.g. `useReactFlow().getViewport`). */
|
|
5
|
+
getViewport?: () => CanvasViewport;
|
|
6
|
+
/** Moves the canvas to a scene (e.g. `useReactFlow().setViewport`). */
|
|
7
|
+
setViewport?: (viewport: CanvasViewport, options?: {
|
|
8
|
+
duration?: number;
|
|
9
|
+
}) => void;
|
|
10
|
+
/** Transition duration passed to `setViewport` when showing a scene (default 300ms). */
|
|
11
|
+
duration?: number;
|
|
12
|
+
/** Use an existing store (e.g. one shared with non-React code) instead of creating one. */
|
|
13
|
+
store?: CanvasScenesStore;
|
|
14
|
+
/**
|
|
15
|
+
* Plays a scene's provider transition (`scene.transition`) when showing it: `element` is the
|
|
16
|
+
* canvas view to capture and cover (e.g. the React Flow wrapper). Without a provider or an
|
|
17
|
+
* element, scenes are shown with the plain viewport move.
|
|
18
|
+
*/
|
|
19
|
+
transitions?: {
|
|
20
|
+
provider: EffectProvider | null | undefined;
|
|
21
|
+
element: () => HTMLElement | null;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* React hook for Freeform-style Scenes: named saved viewports with show next / previous,
|
|
26
|
+
* reorder, rename and JSON persistence. Backed by the framework-agnostic
|
|
27
|
+
* `CanvasScenesStore` through `useSyncExternalStore`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useCanvasScenes(options?: UseCanvasScenesOptions): {
|
|
30
|
+
scenes: readonly CanvasScene[];
|
|
31
|
+
currentId: string | null;
|
|
32
|
+
currentIndex: number;
|
|
33
|
+
current: CanvasScene | null;
|
|
34
|
+
store: CanvasScenesStore;
|
|
35
|
+
/** Saves the current viewport (or `viewport`) as a new scene. */
|
|
36
|
+
capture(name?: string, extra?: {
|
|
37
|
+
viewport?: CanvasViewport;
|
|
38
|
+
nodeIds?: string[];
|
|
39
|
+
index?: number;
|
|
40
|
+
}): CanvasScene;
|
|
41
|
+
/** Saves a scene framing the given nodes in a container of `size`. */
|
|
42
|
+
captureNodes(nodes: CanvasNode[], ids: string[], size: {
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
}, name?: string, fit?: FitViewportOptions): CanvasScene | undefined;
|
|
46
|
+
/** Replaces a scene's viewport with the live one. */
|
|
47
|
+
recapture(id: string): CanvasScene | undefined;
|
|
48
|
+
update: (id: string, patch: Partial<Omit<CanvasScene, "id">>) => CanvasScene | undefined;
|
|
49
|
+
rename: (id: string, name: string) => CanvasScene | undefined;
|
|
50
|
+
move: (id: string, toIndex: number) => void;
|
|
51
|
+
reorder: (ids: string[]) => void;
|
|
52
|
+
remove: (id: string) => void;
|
|
53
|
+
clear: () => void;
|
|
54
|
+
goTo: (id: string) => CanvasScene | undefined;
|
|
55
|
+
next: () => CanvasScene | undefined;
|
|
56
|
+
previous: () => CanvasScene | undefined;
|
|
57
|
+
toJSON: () => import("@pixerate/editor/canvas").SerializedCanvasScenes;
|
|
58
|
+
serialize: () => string;
|
|
59
|
+
load: (input: string | unknown) => void;
|
|
60
|
+
};
|
|
61
|
+
export type CanvasScenes = ReturnType<typeof useCanvasScenes>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type CanvasNode } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasShortcutsOptions<TNode extends CanvasNode = CanvasNode> {
|
|
3
|
+
targetElement?: HTMLElement | Window | null;
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
onCopy?: (selectedNodes: TNode[]) => void;
|
|
6
|
+
onCut?: (selectedNodes: TNode[]) => void;
|
|
7
|
+
onPaste?: (event: ClipboardEvent) => void;
|
|
8
|
+
onDelete?: (selectedNodes: TNode[]) => void;
|
|
9
|
+
onDuplicate?: (selectedNodes: TNode[]) => void;
|
|
10
|
+
onSelectAll?: () => void;
|
|
11
|
+
onGroup?: (selectedNodes: TNode[]) => void;
|
|
12
|
+
onUngroup?: (selectedNodes: TNode[]) => void;
|
|
13
|
+
onZoomIn?: () => void;
|
|
14
|
+
onZoomOut?: () => void;
|
|
15
|
+
onFitView?: () => void;
|
|
16
|
+
getSelectedNodes?: () => TNode[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* React hook registering canvas keyboard shortcuts while rigorously guarding against
|
|
20
|
+
* hijacking typing inside text inputs, textareas, and rich-text ProseMirror elements.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useCanvasShortcuts<TNode extends CanvasNode = CanvasNode>(options?: UseCanvasShortcutsOptions<TNode>): void;
|