@pixerate/editor-react 0.90.0 → 0.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/hooks/useToolRegistryView.d.cts +9 -0
- package/dist/hooks/useToolRegistryView.d.ts +9 -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 +533 -514
- package/dist/index.d.cts +36 -802
- package/dist/index.d.ts +36 -802
- package/dist/index.js +59 -41
- 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
package/dist/canvas/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
EffectParameters,
|
|
3
3
|
EffectsBrowser,
|
|
4
4
|
useEffectDescription
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-5R67YSSD.js";
|
|
6
|
+
import "../chunk-OTGJEYHV.js";
|
|
7
7
|
|
|
8
8
|
// src/canvas/AgentPresenceLayer.tsx
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -3536,4 +3536,3 @@ export {
|
|
|
3536
3536
|
xToTime2 as xToTime,
|
|
3537
3537
|
xorPolygons
|
|
3538
3538
|
};
|
|
3539
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { type AnimatableProperty, type AnimationHistoryTarget, type AnimationLoopMode, type CanvasNode, type Clock } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasAnimationOptions<TNode extends CanvasNode = CanvasNode> {
|
|
3
|
+
nodes: TNode[];
|
|
4
|
+
setNodes: (updater: TNode[] | ((prev: TNode[]) => TNode[])) => void;
|
|
5
|
+
/** When set, keyframe edits are undoable steps. */
|
|
6
|
+
history?: AnimationHistoryTarget;
|
|
7
|
+
/** Ids acted on without explicit ids (default: nodes with `selected: true`). */
|
|
8
|
+
getSelectedIds?: () => string[];
|
|
9
|
+
/** Playback time source (default `realClock`); pass a `ManualClock` for tests or rendering. Read once. */
|
|
10
|
+
clock?: Clock;
|
|
11
|
+
/** Fixed timeline length (ms); omitted = the last keyframe, at least `minDuration`. Read once. */
|
|
12
|
+
duration?: number;
|
|
13
|
+
minDuration?: number;
|
|
14
|
+
loop?: AnimationLoopMode;
|
|
15
|
+
playbackRate?: number;
|
|
16
|
+
fps?: number;
|
|
17
|
+
recording?: boolean;
|
|
18
|
+
properties?: readonly AnimatableProperty[];
|
|
19
|
+
onTime?: (time: number) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* React hook for keyframe animation on the canvas: a playhead player (play / pause / seek /
|
|
23
|
+
* scrub, loop, ping-pong, rate), record mode, undoable keyframe edits, multi-keyframe drags
|
|
24
|
+
* with snapping, copy / paste and CSS / Web Animations export.
|
|
25
|
+
*
|
|
26
|
+
* Render `displayNodes` (the nodes evaluated at the playhead) in React Flow and pass its edits
|
|
27
|
+
* back through `applyDisplayChanges`:
|
|
28
|
+
* `onNodesChange={(c) => animation.applyDisplayChanges(applyNodeChanges(c, animation.displayNodes))}`.
|
|
29
|
+
* Animated properties are then keyed at the playhead instead of being overwritten.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useCanvasAnimation<TNode extends CanvasNode = CanvasNode>(options: UseCanvasAnimationOptions<TNode>): {
|
|
32
|
+
state: import("@pixerate/editor/canvas").CanvasAnimationState;
|
|
33
|
+
time: number;
|
|
34
|
+
playing: boolean;
|
|
35
|
+
recording: boolean;
|
|
36
|
+
duration: number;
|
|
37
|
+
selection: readonly import("@pixerate/editor/canvas").KeyframeRef[];
|
|
38
|
+
drag: import("@pixerate/editor/canvas").KeyframeDragState | null;
|
|
39
|
+
/** The nodes evaluated at the playhead; render these. */
|
|
40
|
+
displayNodes: TNode[];
|
|
41
|
+
clipboard: import("@pixerate/editor/canvas").AnimationKeyframeClipboard | null;
|
|
42
|
+
player: import("@pixerate/editor/canvas").AnimationPlayer;
|
|
43
|
+
getState: () => import("@pixerate/editor/canvas").CanvasAnimationState;
|
|
44
|
+
subscribe(listener: (state: import("@pixerate/editor/canvas").CanvasAnimationState) => void): () => void;
|
|
45
|
+
refresh(): void;
|
|
46
|
+
play: () => void;
|
|
47
|
+
pause: () => void;
|
|
48
|
+
toggle: () => void;
|
|
49
|
+
stop: () => void;
|
|
50
|
+
seek: (time: number) => void;
|
|
51
|
+
scrub: (time: number) => void;
|
|
52
|
+
endScrub: () => void;
|
|
53
|
+
setLoop: (loop: AnimationLoopMode) => void;
|
|
54
|
+
setPlaybackRate: (rate: number) => void;
|
|
55
|
+
setDuration(ms: number | null): void;
|
|
56
|
+
setFps(value: number): void;
|
|
57
|
+
setRecording(on: boolean): void;
|
|
58
|
+
toggleRecording(): void;
|
|
59
|
+
nextKeyframe(ids?: Iterable<string>): number | null;
|
|
60
|
+
previousKeyframe(ids?: Iterable<string>): number | null;
|
|
61
|
+
display: (nodes?: readonly TNode[] | undefined) => TNode[];
|
|
62
|
+
applyDisplayChanges(next: TNode[]): import("@pixerate/editor/canvas").KeyframeRef[];
|
|
63
|
+
addKeyframe(ids?: Iterable<string>, keys?: readonly string[], time?: number): import("@pixerate/editor/canvas").KeyframeRef[];
|
|
64
|
+
setKeyframe(nodeId: string, property: string, value: import("@pixerate/editor/canvas").AnimationValue, time?: number, easing?: import("@pixerate/editor/canvas").AnimationEasing | string): void;
|
|
65
|
+
updateKeyframe(ref: import("@pixerate/editor/canvas").KeyframeRef, patch: import("@pixerate/editor/canvas").KeyframePatch): void;
|
|
66
|
+
deleteKeyframes(refs?: readonly import("@pixerate/editor/canvas").KeyframeRef[]): boolean;
|
|
67
|
+
setEasing(easing: import("@pixerate/editor/canvas").AnimationEasing | string | null, refs?: readonly import("@pixerate/editor/canvas").KeyframeRef[]): boolean;
|
|
68
|
+
setTrackEnabled(nodeId: string, property: string, enabled: boolean): void;
|
|
69
|
+
removeTrack(nodeId: string, property: string): void;
|
|
70
|
+
setMotionPath(nodeId: string, motionPath: {
|
|
71
|
+
d: string;
|
|
72
|
+
autoRotate?: boolean;
|
|
73
|
+
} | null): void;
|
|
74
|
+
animateNode(nodeId: string, opts: Omit<import("@pixerate/editor/canvas").AnimateNodeOptions, "properties">): import("@pixerate/editor/canvas").KeyframeRef[];
|
|
75
|
+
moveKeyframes(delta: number, refs?: readonly import("@pixerate/editor/canvas").KeyframeRef[]): number;
|
|
76
|
+
scaleKeyframes(factor: number, refs?: readonly import("@pixerate/editor/canvas").KeyframeRef[], pivot?: number): number;
|
|
77
|
+
copyKeyframes(refs?: readonly import("@pixerate/editor/canvas").KeyframeRef[]): import("@pixerate/editor/canvas").AnimationKeyframeClipboard | null;
|
|
78
|
+
pasteKeyframes(data?: import("@pixerate/editor/canvas").AnimationKeyframeClipboard | null, nodeIds?: readonly string[], time?: number): import("@pixerate/editor/canvas").KeyframeRef[];
|
|
79
|
+
selectKeyframes(refs: readonly import("@pixerate/editor/canvas").KeyframeRef[], mode?: "replace" | "add" | "toggle"): void;
|
|
80
|
+
clearSelection(): void;
|
|
81
|
+
beginKeyframeDrag(refs?: readonly import("@pixerate/editor/canvas").KeyframeRef[]): void;
|
|
82
|
+
updateKeyframeDrag(delta: number, opts?: {
|
|
83
|
+
snap?: boolean;
|
|
84
|
+
thresholdMs?: number;
|
|
85
|
+
}): import("@pixerate/editor/canvas").KeyframeDragState | null;
|
|
86
|
+
endKeyframeDrag(): number;
|
|
87
|
+
cancelKeyframeDrag(): void;
|
|
88
|
+
timelineRows(ids?: Iterable<string>, opts?: Omit<import("@pixerate/editor/canvas").TimelineRowsOptions, "selection" | "dragDelta">): import("@pixerate/editor/canvas").TimelineRow[];
|
|
89
|
+
sampleFrames(opts?: import("@pixerate/editor/canvas").SampleAnimationOptions): import("@pixerate/editor/canvas").AnimationFrame[];
|
|
90
|
+
exportCss(nodeId: string, opts?: import("@pixerate/editor/canvas").CssExportOptions & {
|
|
91
|
+
name?: string;
|
|
92
|
+
selector?: string;
|
|
93
|
+
}): import("@pixerate/editor/canvas").CssAnimationExport;
|
|
94
|
+
toWebAnimations(nodeId: string, opts?: import("@pixerate/editor/canvas").CssExportOptions): import("@pixerate/editor/canvas").WebAnimationSpec[];
|
|
95
|
+
destroy(): void;
|
|
96
|
+
};
|
|
97
|
+
export type CanvasAnimation<TNode extends CanvasNode = CanvasNode> = ReturnType<typeof useCanvasAnimation<TNode>>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { type AnimatableProperty, type AnimationHistoryTarget, type AnimationLoopMode, type CanvasNode, type Clock } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasAnimationOptions<TNode extends CanvasNode = CanvasNode> {
|
|
3
|
+
nodes: TNode[];
|
|
4
|
+
setNodes: (updater: TNode[] | ((prev: TNode[]) => TNode[])) => void;
|
|
5
|
+
/** When set, keyframe edits are undoable steps. */
|
|
6
|
+
history?: AnimationHistoryTarget;
|
|
7
|
+
/** Ids acted on without explicit ids (default: nodes with `selected: true`). */
|
|
8
|
+
getSelectedIds?: () => string[];
|
|
9
|
+
/** Playback time source (default `realClock`); pass a `ManualClock` for tests or rendering. Read once. */
|
|
10
|
+
clock?: Clock;
|
|
11
|
+
/** Fixed timeline length (ms); omitted = the last keyframe, at least `minDuration`. Read once. */
|
|
12
|
+
duration?: number;
|
|
13
|
+
minDuration?: number;
|
|
14
|
+
loop?: AnimationLoopMode;
|
|
15
|
+
playbackRate?: number;
|
|
16
|
+
fps?: number;
|
|
17
|
+
recording?: boolean;
|
|
18
|
+
properties?: readonly AnimatableProperty[];
|
|
19
|
+
onTime?: (time: number) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* React hook for keyframe animation on the canvas: a playhead player (play / pause / seek /
|
|
23
|
+
* scrub, loop, ping-pong, rate), record mode, undoable keyframe edits, multi-keyframe drags
|
|
24
|
+
* with snapping, copy / paste and CSS / Web Animations export.
|
|
25
|
+
*
|
|
26
|
+
* Render `displayNodes` (the nodes evaluated at the playhead) in React Flow and pass its edits
|
|
27
|
+
* back through `applyDisplayChanges`:
|
|
28
|
+
* `onNodesChange={(c) => animation.applyDisplayChanges(applyNodeChanges(c, animation.displayNodes))}`.
|
|
29
|
+
* Animated properties are then keyed at the playhead instead of being overwritten.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useCanvasAnimation<TNode extends CanvasNode = CanvasNode>(options: UseCanvasAnimationOptions<TNode>): {
|
|
32
|
+
state: import("@pixerate/editor/canvas").CanvasAnimationState;
|
|
33
|
+
time: number;
|
|
34
|
+
playing: boolean;
|
|
35
|
+
recording: boolean;
|
|
36
|
+
duration: number;
|
|
37
|
+
selection: readonly import("@pixerate/editor/canvas").KeyframeRef[];
|
|
38
|
+
drag: import("@pixerate/editor/canvas").KeyframeDragState | null;
|
|
39
|
+
/** The nodes evaluated at the playhead; render these. */
|
|
40
|
+
displayNodes: TNode[];
|
|
41
|
+
clipboard: import("@pixerate/editor/canvas").AnimationKeyframeClipboard | null;
|
|
42
|
+
player: import("@pixerate/editor/canvas").AnimationPlayer;
|
|
43
|
+
getState: () => import("@pixerate/editor/canvas").CanvasAnimationState;
|
|
44
|
+
subscribe(listener: (state: import("@pixerate/editor/canvas").CanvasAnimationState) => void): () => void;
|
|
45
|
+
refresh(): void;
|
|
46
|
+
play: () => void;
|
|
47
|
+
pause: () => void;
|
|
48
|
+
toggle: () => void;
|
|
49
|
+
stop: () => void;
|
|
50
|
+
seek: (time: number) => void;
|
|
51
|
+
scrub: (time: number) => void;
|
|
52
|
+
endScrub: () => void;
|
|
53
|
+
setLoop: (loop: AnimationLoopMode) => void;
|
|
54
|
+
setPlaybackRate: (rate: number) => void;
|
|
55
|
+
setDuration(ms: number | null): void;
|
|
56
|
+
setFps(value: number): void;
|
|
57
|
+
setRecording(on: boolean): void;
|
|
58
|
+
toggleRecording(): void;
|
|
59
|
+
nextKeyframe(ids?: Iterable<string>): number | null;
|
|
60
|
+
previousKeyframe(ids?: Iterable<string>): number | null;
|
|
61
|
+
display: (nodes?: readonly TNode[] | undefined) => TNode[];
|
|
62
|
+
applyDisplayChanges(next: TNode[]): import("@pixerate/editor/canvas").KeyframeRef[];
|
|
63
|
+
addKeyframe(ids?: Iterable<string>, keys?: readonly string[], time?: number): import("@pixerate/editor/canvas").KeyframeRef[];
|
|
64
|
+
setKeyframe(nodeId: string, property: string, value: import("@pixerate/editor/canvas").AnimationValue, time?: number, easing?: import("@pixerate/editor/canvas").AnimationEasing | string): void;
|
|
65
|
+
updateKeyframe(ref: import("@pixerate/editor/canvas").KeyframeRef, patch: import("@pixerate/editor/canvas").KeyframePatch): void;
|
|
66
|
+
deleteKeyframes(refs?: readonly import("@pixerate/editor/canvas").KeyframeRef[]): boolean;
|
|
67
|
+
setEasing(easing: import("@pixerate/editor/canvas").AnimationEasing | string | null, refs?: readonly import("@pixerate/editor/canvas").KeyframeRef[]): boolean;
|
|
68
|
+
setTrackEnabled(nodeId: string, property: string, enabled: boolean): void;
|
|
69
|
+
removeTrack(nodeId: string, property: string): void;
|
|
70
|
+
setMotionPath(nodeId: string, motionPath: {
|
|
71
|
+
d: string;
|
|
72
|
+
autoRotate?: boolean;
|
|
73
|
+
} | null): void;
|
|
74
|
+
animateNode(nodeId: string, opts: Omit<import("@pixerate/editor/canvas").AnimateNodeOptions, "properties">): import("@pixerate/editor/canvas").KeyframeRef[];
|
|
75
|
+
moveKeyframes(delta: number, refs?: readonly import("@pixerate/editor/canvas").KeyframeRef[]): number;
|
|
76
|
+
scaleKeyframes(factor: number, refs?: readonly import("@pixerate/editor/canvas").KeyframeRef[], pivot?: number): number;
|
|
77
|
+
copyKeyframes(refs?: readonly import("@pixerate/editor/canvas").KeyframeRef[]): import("@pixerate/editor/canvas").AnimationKeyframeClipboard | null;
|
|
78
|
+
pasteKeyframes(data?: import("@pixerate/editor/canvas").AnimationKeyframeClipboard | null, nodeIds?: readonly string[], time?: number): import("@pixerate/editor/canvas").KeyframeRef[];
|
|
79
|
+
selectKeyframes(refs: readonly import("@pixerate/editor/canvas").KeyframeRef[], mode?: "replace" | "add" | "toggle"): void;
|
|
80
|
+
clearSelection(): void;
|
|
81
|
+
beginKeyframeDrag(refs?: readonly import("@pixerate/editor/canvas").KeyframeRef[]): void;
|
|
82
|
+
updateKeyframeDrag(delta: number, opts?: {
|
|
83
|
+
snap?: boolean;
|
|
84
|
+
thresholdMs?: number;
|
|
85
|
+
}): import("@pixerate/editor/canvas").KeyframeDragState | null;
|
|
86
|
+
endKeyframeDrag(): number;
|
|
87
|
+
cancelKeyframeDrag(): void;
|
|
88
|
+
timelineRows(ids?: Iterable<string>, opts?: Omit<import("@pixerate/editor/canvas").TimelineRowsOptions, "selection" | "dragDelta">): import("@pixerate/editor/canvas").TimelineRow[];
|
|
89
|
+
sampleFrames(opts?: import("@pixerate/editor/canvas").SampleAnimationOptions): import("@pixerate/editor/canvas").AnimationFrame[];
|
|
90
|
+
exportCss(nodeId: string, opts?: import("@pixerate/editor/canvas").CssExportOptions & {
|
|
91
|
+
name?: string;
|
|
92
|
+
selector?: string;
|
|
93
|
+
}): import("@pixerate/editor/canvas").CssAnimationExport;
|
|
94
|
+
toWebAnimations(nodeId: string, opts?: import("@pixerate/editor/canvas").CssExportOptions): import("@pixerate/editor/canvas").WebAnimationSpec[];
|
|
95
|
+
destroy(): void;
|
|
96
|
+
};
|
|
97
|
+
export type CanvasAnimation<TNode extends CanvasNode = CanvasNode> = ReturnType<typeof useCanvasAnimation<TNode>>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type ArrangeHistoryTarget, type AutoLayoutOptions, type ArrangeShortcutBinding, type CanvasArrangeAction, type CanvasNode, type GuideLine, type NodeRectOptions, type SnapGuidesOptions } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasArrangeOptions<TNode extends CanvasNode = CanvasNode> {
|
|
3
|
+
nodes: TNode[];
|
|
4
|
+
setNodes: (updater: TNode[] | ((prev: TNode[]) => TNode[])) => void;
|
|
5
|
+
/** Ids acted on when a method is called without ids (default: nodes with `selected: true`). */
|
|
6
|
+
getSelectedIds?: () => string[];
|
|
7
|
+
/** When set, every arrange action is recorded as one undoable command. */
|
|
8
|
+
history?: ArrangeHistoryTarget;
|
|
9
|
+
/** Current zoom (e.g. `useViewport().zoom`) for the screen-pixel guide threshold. */
|
|
10
|
+
zoom?: number;
|
|
11
|
+
guides?: Omit<SnapGuidesOptions, 'zoom'>;
|
|
12
|
+
/** Turns drag snapping off (default `true`). */
|
|
13
|
+
snapping?: boolean;
|
|
14
|
+
rectOptions?: NodeRectOptions;
|
|
15
|
+
/** Re-run auto layout around arranged nodes in the same undo step (see `useCanvasAutoLayout`). */
|
|
16
|
+
autoLayout?: boolean | AutoLayoutOptions;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* React hook for Freeform-style arrangement on React Flow: align, distribute, make same size,
|
|
20
|
+
* lock / unlock, layer order and smart guides with snap-to-shape while dragging.
|
|
21
|
+
*
|
|
22
|
+
* Snapping: pass node changes through `snapPositionChanges` in `onNodesChange`
|
|
23
|
+
* (`onNodesChange={(c) => setNodes((n) => applyNodeChanges(arrange.snapPositionChanges(c), n))}`)
|
|
24
|
+
* and render `guides` with `<CanvasGuidesLayer>`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useCanvasArrange<TNode extends CanvasNode = CanvasNode>(options: UseCanvasArrangeOptions<TNode>): {
|
|
27
|
+
guides: GuideLine[];
|
|
28
|
+
apply: (name: string, updates: import("@pixerate/editor/canvas").CanvasNodeUpdate[]) => import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
29
|
+
align(edge: import("@pixerate/editor/canvas").AlignEdge, ids?: Iterable<string>, alignOptions?: import("@pixerate/editor/canvas").AlignNodesOptions): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
30
|
+
distribute(axis: import("@pixerate/editor/canvas").DistributeAxis, mode?: import("@pixerate/editor/canvas").DistributeMode, ids?: Iterable<string>, distributeOptions?: import("@pixerate/editor/canvas").DistributeNodesOptions): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
31
|
+
matchSize(dimension: import("@pixerate/editor/canvas").SizeDimension, ids?: Iterable<string>, sizeOptions?: import("@pixerate/editor/canvas").MatchSizeOptions): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
32
|
+
reorder(operation: import("@pixerate/editor/canvas").ZOrderOperation, ids?: Iterable<string>): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
33
|
+
bringForward: (ids?: Iterable<string>) => import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
34
|
+
sendBackward: (ids?: Iterable<string>) => import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
35
|
+
bringToFront: (ids?: Iterable<string>) => import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
36
|
+
sendToBack: (ids?: Iterable<string>) => import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
37
|
+
lock: (ids?: Iterable<string>) => string[];
|
|
38
|
+
unlock: (ids?: Iterable<string>) => string[];
|
|
39
|
+
toggleLock(ids?: Iterable<string>): string[];
|
|
40
|
+
isLocked: (id: string) => boolean;
|
|
41
|
+
combineShapes(operation: import("@pixerate/editor/canvas").ShapeOperation, ids?: Iterable<string>, combineOptions?: import("@pixerate/editor/canvas").CombineShapeNodesOptions): import("@pixerate/editor/canvas").CombineShapeNodesResult<TNode>;
|
|
42
|
+
unite: (ids?: Iterable<string>, o?: import("@pixerate/editor/canvas").CombineShapeNodesOptions) => import("@pixerate/editor/canvas").CombineShapeNodesResult<TNode>;
|
|
43
|
+
intersect: (ids?: Iterable<string>, o?: import("@pixerate/editor/canvas").CombineShapeNodesOptions) => import("@pixerate/editor/canvas").CombineShapeNodesResult<TNode>;
|
|
44
|
+
subtract: (ids?: Iterable<string>, o?: import("@pixerate/editor/canvas").CombineShapeNodesOptions) => import("@pixerate/editor/canvas").CombineShapeNodesResult<TNode>;
|
|
45
|
+
exclude: (ids?: Iterable<string>, o?: import("@pixerate/editor/canvas").CombineShapeNodesOptions) => import("@pixerate/editor/canvas").CombineShapeNodesResult<TNode>;
|
|
46
|
+
divide: (ids?: Iterable<string>, o?: import("@pixerate/editor/canvas").CombineShapeNodesOptions) => import("@pixerate/editor/canvas").CombineShapeNodesResult<TNode>;
|
|
47
|
+
canCombineShapes: (ids?: Iterable<string>) => boolean;
|
|
48
|
+
offsetShapes(distance: number, ids?: Iterable<string>, offsetOptions?: import("@pixerate/editor/canvas").OffsetShapeNodesOptions): import("@pixerate/editor/canvas").ShapePathEditResult<TNode>;
|
|
49
|
+
canOffsetShapes: (ids?: Iterable<string>) => boolean;
|
|
50
|
+
outlineStroke(ids?: Iterable<string>, outlineOptions?: import("@pixerate/editor/canvas").OutlineShapeStrokesOptions): import("@pixerate/editor/canvas").ShapePathEditResult<TNode>;
|
|
51
|
+
canOutlineStroke: (ids?: Iterable<string>) => boolean;
|
|
52
|
+
runAction(action: CanvasArrangeAction): boolean;
|
|
53
|
+
beginDrag(ids?: Iterable<string>): void;
|
|
54
|
+
drag(ids?: Iterable<string>): import("@pixerate/editor/canvas").SnapNodeDragResult | null;
|
|
55
|
+
snapPositionChanges<TChange extends import("@pixerate/editor/canvas").PositionChangeLike>(changes: TChange[]): TChange[];
|
|
56
|
+
beginResize(id: string): void;
|
|
57
|
+
resize(id: string, handle?: import("@pixerate/editor/canvas").ResizeHandle): import("@pixerate/editor/canvas").SnapNodeResizeResult | null;
|
|
58
|
+
endResize(): void;
|
|
59
|
+
snapResizeChanges<TChange extends import("@pixerate/editor/canvas").PositionChangeLike>(changes: TChange[]): TChange[];
|
|
60
|
+
endDrag(): void;
|
|
61
|
+
};
|
|
62
|
+
export type CanvasArrange = ReturnType<typeof useCanvasArrange>;
|
|
63
|
+
export interface UseCanvasArrangeShortcutsOptions {
|
|
64
|
+
arrange: {
|
|
65
|
+
runAction: (action: CanvasArrangeAction) => boolean;
|
|
66
|
+
};
|
|
67
|
+
/** Scenes controller for PageDown / PageUp (next / previous scene). */
|
|
68
|
+
scenes?: {
|
|
69
|
+
next: () => unknown;
|
|
70
|
+
previous: () => unknown;
|
|
71
|
+
};
|
|
72
|
+
targetElement?: HTMLElement | Window | null;
|
|
73
|
+
enabled?: boolean;
|
|
74
|
+
bindings?: readonly ArrangeShortcutBinding[];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Registers the arrange keyboard shortcuts (see `DEFAULT_ARRANGE_SHORTCUTS`), ignoring
|
|
78
|
+
* events from inputs, textareas, contenteditable and ProseMirror editors.
|
|
79
|
+
*/
|
|
80
|
+
export declare function useCanvasArrangeShortcuts(options: UseCanvasArrangeShortcutsOptions): void;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type ArrangeHistoryTarget, type AutoLayoutOptions, type ArrangeShortcutBinding, type CanvasArrangeAction, type CanvasNode, type GuideLine, type NodeRectOptions, type SnapGuidesOptions } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasArrangeOptions<TNode extends CanvasNode = CanvasNode> {
|
|
3
|
+
nodes: TNode[];
|
|
4
|
+
setNodes: (updater: TNode[] | ((prev: TNode[]) => TNode[])) => void;
|
|
5
|
+
/** Ids acted on when a method is called without ids (default: nodes with `selected: true`). */
|
|
6
|
+
getSelectedIds?: () => string[];
|
|
7
|
+
/** When set, every arrange action is recorded as one undoable command. */
|
|
8
|
+
history?: ArrangeHistoryTarget;
|
|
9
|
+
/** Current zoom (e.g. `useViewport().zoom`) for the screen-pixel guide threshold. */
|
|
10
|
+
zoom?: number;
|
|
11
|
+
guides?: Omit<SnapGuidesOptions, 'zoom'>;
|
|
12
|
+
/** Turns drag snapping off (default `true`). */
|
|
13
|
+
snapping?: boolean;
|
|
14
|
+
rectOptions?: NodeRectOptions;
|
|
15
|
+
/** Re-run auto layout around arranged nodes in the same undo step (see `useCanvasAutoLayout`). */
|
|
16
|
+
autoLayout?: boolean | AutoLayoutOptions;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* React hook for Freeform-style arrangement on React Flow: align, distribute, make same size,
|
|
20
|
+
* lock / unlock, layer order and smart guides with snap-to-shape while dragging.
|
|
21
|
+
*
|
|
22
|
+
* Snapping: pass node changes through `snapPositionChanges` in `onNodesChange`
|
|
23
|
+
* (`onNodesChange={(c) => setNodes((n) => applyNodeChanges(arrange.snapPositionChanges(c), n))}`)
|
|
24
|
+
* and render `guides` with `<CanvasGuidesLayer>`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useCanvasArrange<TNode extends CanvasNode = CanvasNode>(options: UseCanvasArrangeOptions<TNode>): {
|
|
27
|
+
guides: GuideLine[];
|
|
28
|
+
apply: (name: string, updates: import("@pixerate/editor/canvas").CanvasNodeUpdate[]) => import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
29
|
+
align(edge: import("@pixerate/editor/canvas").AlignEdge, ids?: Iterable<string>, alignOptions?: import("@pixerate/editor/canvas").AlignNodesOptions): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
30
|
+
distribute(axis: import("@pixerate/editor/canvas").DistributeAxis, mode?: import("@pixerate/editor/canvas").DistributeMode, ids?: Iterable<string>, distributeOptions?: import("@pixerate/editor/canvas").DistributeNodesOptions): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
31
|
+
matchSize(dimension: import("@pixerate/editor/canvas").SizeDimension, ids?: Iterable<string>, sizeOptions?: import("@pixerate/editor/canvas").MatchSizeOptions): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
32
|
+
reorder(operation: import("@pixerate/editor/canvas").ZOrderOperation, ids?: Iterable<string>): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
33
|
+
bringForward: (ids?: Iterable<string>) => import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
34
|
+
sendBackward: (ids?: Iterable<string>) => import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
35
|
+
bringToFront: (ids?: Iterable<string>) => import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
36
|
+
sendToBack: (ids?: Iterable<string>) => import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
37
|
+
lock: (ids?: Iterable<string>) => string[];
|
|
38
|
+
unlock: (ids?: Iterable<string>) => string[];
|
|
39
|
+
toggleLock(ids?: Iterable<string>): string[];
|
|
40
|
+
isLocked: (id: string) => boolean;
|
|
41
|
+
combineShapes(operation: import("@pixerate/editor/canvas").ShapeOperation, ids?: Iterable<string>, combineOptions?: import("@pixerate/editor/canvas").CombineShapeNodesOptions): import("@pixerate/editor/canvas").CombineShapeNodesResult<TNode>;
|
|
42
|
+
unite: (ids?: Iterable<string>, o?: import("@pixerate/editor/canvas").CombineShapeNodesOptions) => import("@pixerate/editor/canvas").CombineShapeNodesResult<TNode>;
|
|
43
|
+
intersect: (ids?: Iterable<string>, o?: import("@pixerate/editor/canvas").CombineShapeNodesOptions) => import("@pixerate/editor/canvas").CombineShapeNodesResult<TNode>;
|
|
44
|
+
subtract: (ids?: Iterable<string>, o?: import("@pixerate/editor/canvas").CombineShapeNodesOptions) => import("@pixerate/editor/canvas").CombineShapeNodesResult<TNode>;
|
|
45
|
+
exclude: (ids?: Iterable<string>, o?: import("@pixerate/editor/canvas").CombineShapeNodesOptions) => import("@pixerate/editor/canvas").CombineShapeNodesResult<TNode>;
|
|
46
|
+
divide: (ids?: Iterable<string>, o?: import("@pixerate/editor/canvas").CombineShapeNodesOptions) => import("@pixerate/editor/canvas").CombineShapeNodesResult<TNode>;
|
|
47
|
+
canCombineShapes: (ids?: Iterable<string>) => boolean;
|
|
48
|
+
offsetShapes(distance: number, ids?: Iterable<string>, offsetOptions?: import("@pixerate/editor/canvas").OffsetShapeNodesOptions): import("@pixerate/editor/canvas").ShapePathEditResult<TNode>;
|
|
49
|
+
canOffsetShapes: (ids?: Iterable<string>) => boolean;
|
|
50
|
+
outlineStroke(ids?: Iterable<string>, outlineOptions?: import("@pixerate/editor/canvas").OutlineShapeStrokesOptions): import("@pixerate/editor/canvas").ShapePathEditResult<TNode>;
|
|
51
|
+
canOutlineStroke: (ids?: Iterable<string>) => boolean;
|
|
52
|
+
runAction(action: CanvasArrangeAction): boolean;
|
|
53
|
+
beginDrag(ids?: Iterable<string>): void;
|
|
54
|
+
drag(ids?: Iterable<string>): import("@pixerate/editor/canvas").SnapNodeDragResult | null;
|
|
55
|
+
snapPositionChanges<TChange extends import("@pixerate/editor/canvas").PositionChangeLike>(changes: TChange[]): TChange[];
|
|
56
|
+
beginResize(id: string): void;
|
|
57
|
+
resize(id: string, handle?: import("@pixerate/editor/canvas").ResizeHandle): import("@pixerate/editor/canvas").SnapNodeResizeResult | null;
|
|
58
|
+
endResize(): void;
|
|
59
|
+
snapResizeChanges<TChange extends import("@pixerate/editor/canvas").PositionChangeLike>(changes: TChange[]): TChange[];
|
|
60
|
+
endDrag(): void;
|
|
61
|
+
};
|
|
62
|
+
export type CanvasArrange = ReturnType<typeof useCanvasArrange>;
|
|
63
|
+
export interface UseCanvasArrangeShortcutsOptions {
|
|
64
|
+
arrange: {
|
|
65
|
+
runAction: (action: CanvasArrangeAction) => boolean;
|
|
66
|
+
};
|
|
67
|
+
/** Scenes controller for PageDown / PageUp (next / previous scene). */
|
|
68
|
+
scenes?: {
|
|
69
|
+
next: () => unknown;
|
|
70
|
+
previous: () => unknown;
|
|
71
|
+
};
|
|
72
|
+
targetElement?: HTMLElement | Window | null;
|
|
73
|
+
enabled?: boolean;
|
|
74
|
+
bindings?: readonly ArrangeShortcutBinding[];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Registers the arrange keyboard shortcuts (see `DEFAULT_ARRANGE_SHORTCUTS`), ignoring
|
|
78
|
+
* events from inputs, textareas, contenteditable and ProseMirror editors.
|
|
79
|
+
*/
|
|
80
|
+
export declare function useCanvasArrangeShortcuts(options: UseCanvasArrangeShortcutsOptions): void;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type ArrangeHistoryTarget, type AutoLayoutMeasure, type CanvasNode, type GuideLine, type NodeRectOptions } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasAutoLayoutOptions<TNode extends CanvasNode = CanvasNode> {
|
|
3
|
+
nodes: TNode[];
|
|
4
|
+
setNodes: (updater: TNode[] | ((prev: TNode[]) => TNode[])) => void;
|
|
5
|
+
/** When set, the hook's actions (add / remove / resize / reorder / apply) are undoable steps. */
|
|
6
|
+
history?: ArrangeHistoryTarget;
|
|
7
|
+
/** Turns automatic relayout off (`applyAutoLayout` still works). Default `true`. */
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
/** Reorder flow children by dragging them within their frame (default `true`). */
|
|
10
|
+
dragReorder?: boolean;
|
|
11
|
+
/** Text measuring and size hooks (default: xyflow `measured` sizes). */
|
|
12
|
+
measure?: AutoLayoutMeasure;
|
|
13
|
+
rectOptions?: NodeRectOptions;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* React hook for Figma-style auto layout on React Flow sub-flows. Frames are nodes with
|
|
17
|
+
* `data.layout`; their children (`parentId`) are stacked, wrapped or placed on a grid, with
|
|
18
|
+
* hug / fill / fixed sizing, min / max, padding, alignment and constraints.
|
|
19
|
+
*
|
|
20
|
+
* Pass every `onNodesChange` batch through `noteChanges` before applying it
|
|
21
|
+
* (`onNodesChange={(c) => setNodes((n) => applyNodeChanges(autoLayout.noteChanges(c), n))}`):
|
|
22
|
+
* after the nodes update the hook relayouts frames whose children were measured, resized,
|
|
23
|
+
* added or removed, and turns drags of a flow child inside its frame into a reorder (one
|
|
24
|
+
* undoable step). Render `guides` (the drop marker) with `<CanvasGuidesLayer>`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useCanvasAutoLayout<TNode extends CanvasNode = CanvasNode>(options: UseCanvasAutoLayoutOptions<TNode>): {
|
|
27
|
+
/** Drop marker of the active reorder drag (flow coordinates). */
|
|
28
|
+
guides: GuideLine[];
|
|
29
|
+
hasPending: boolean;
|
|
30
|
+
applyAutoLayout(frameId?: string): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
31
|
+
layoutUpdates(ids: Iterable<string>): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
32
|
+
relayout(ids: Iterable<string>): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
33
|
+
addNode(node: TNode, addOptions?: {
|
|
34
|
+
index?: number;
|
|
35
|
+
}): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
36
|
+
removeNodes(ids: Iterable<string>): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
37
|
+
resizeNode(id: string, size: {
|
|
38
|
+
width?: number;
|
|
39
|
+
height?: number;
|
|
40
|
+
}): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
41
|
+
moveChild(childId: string, index: number): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
42
|
+
getInsertTarget(id: string, point?: import("@pixerate/editor/canvas").XYPosition): import("@pixerate/editor/canvas").AutoLayoutInsertTarget | undefined;
|
|
43
|
+
beginReorderDrag(id: string): void;
|
|
44
|
+
dragReorder(id: string, point?: import("@pixerate/editor/canvas").XYPosition): import("@pixerate/editor/canvas").AutoLayoutInsertTarget | undefined;
|
|
45
|
+
endReorderDrag(id: string, point?: import("@pixerate/editor/canvas").XYPosition): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
46
|
+
noteChanges<TChange extends import("@pixerate/editor/canvas").PositionChangeLike>(changes: TChange[]): TChange[];
|
|
47
|
+
noteRemoved(removed: Iterable<{
|
|
48
|
+
id: string;
|
|
49
|
+
parentId?: string;
|
|
50
|
+
}>): void;
|
|
51
|
+
flush(): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
52
|
+
isFrame: (id: string) => boolean;
|
|
53
|
+
};
|
|
54
|
+
export type CanvasAutoLayout = ReturnType<typeof useCanvasAutoLayout>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type ArrangeHistoryTarget, type AutoLayoutMeasure, type CanvasNode, type GuideLine, type NodeRectOptions } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasAutoLayoutOptions<TNode extends CanvasNode = CanvasNode> {
|
|
3
|
+
nodes: TNode[];
|
|
4
|
+
setNodes: (updater: TNode[] | ((prev: TNode[]) => TNode[])) => void;
|
|
5
|
+
/** When set, the hook's actions (add / remove / resize / reorder / apply) are undoable steps. */
|
|
6
|
+
history?: ArrangeHistoryTarget;
|
|
7
|
+
/** Turns automatic relayout off (`applyAutoLayout` still works). Default `true`. */
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
/** Reorder flow children by dragging them within their frame (default `true`). */
|
|
10
|
+
dragReorder?: boolean;
|
|
11
|
+
/** Text measuring and size hooks (default: xyflow `measured` sizes). */
|
|
12
|
+
measure?: AutoLayoutMeasure;
|
|
13
|
+
rectOptions?: NodeRectOptions;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* React hook for Figma-style auto layout on React Flow sub-flows. Frames are nodes with
|
|
17
|
+
* `data.layout`; their children (`parentId`) are stacked, wrapped or placed on a grid, with
|
|
18
|
+
* hug / fill / fixed sizing, min / max, padding, alignment and constraints.
|
|
19
|
+
*
|
|
20
|
+
* Pass every `onNodesChange` batch through `noteChanges` before applying it
|
|
21
|
+
* (`onNodesChange={(c) => setNodes((n) => applyNodeChanges(autoLayout.noteChanges(c), n))}`):
|
|
22
|
+
* after the nodes update the hook relayouts frames whose children were measured, resized,
|
|
23
|
+
* added or removed, and turns drags of a flow child inside its frame into a reorder (one
|
|
24
|
+
* undoable step). Render `guides` (the drop marker) with `<CanvasGuidesLayer>`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useCanvasAutoLayout<TNode extends CanvasNode = CanvasNode>(options: UseCanvasAutoLayoutOptions<TNode>): {
|
|
27
|
+
/** Drop marker of the active reorder drag (flow coordinates). */
|
|
28
|
+
guides: GuideLine[];
|
|
29
|
+
hasPending: boolean;
|
|
30
|
+
applyAutoLayout(frameId?: string): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
31
|
+
layoutUpdates(ids: Iterable<string>): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
32
|
+
relayout(ids: Iterable<string>): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
33
|
+
addNode(node: TNode, addOptions?: {
|
|
34
|
+
index?: number;
|
|
35
|
+
}): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
36
|
+
removeNodes(ids: Iterable<string>): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
37
|
+
resizeNode(id: string, size: {
|
|
38
|
+
width?: number;
|
|
39
|
+
height?: number;
|
|
40
|
+
}): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
41
|
+
moveChild(childId: string, index: number): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
42
|
+
getInsertTarget(id: string, point?: import("@pixerate/editor/canvas").XYPosition): import("@pixerate/editor/canvas").AutoLayoutInsertTarget | undefined;
|
|
43
|
+
beginReorderDrag(id: string): void;
|
|
44
|
+
dragReorder(id: string, point?: import("@pixerate/editor/canvas").XYPosition): import("@pixerate/editor/canvas").AutoLayoutInsertTarget | undefined;
|
|
45
|
+
endReorderDrag(id: string, point?: import("@pixerate/editor/canvas").XYPosition): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
46
|
+
noteChanges<TChange extends import("@pixerate/editor/canvas").PositionChangeLike>(changes: TChange[]): TChange[];
|
|
47
|
+
noteRemoved(removed: Iterable<{
|
|
48
|
+
id: string;
|
|
49
|
+
parentId?: string;
|
|
50
|
+
}>): void;
|
|
51
|
+
flush(): import("@pixerate/editor/canvas").CanvasNodeUpdate[];
|
|
52
|
+
isFrame: (id: string) => boolean;
|
|
53
|
+
};
|
|
54
|
+
export type CanvasAutoLayout = ReturnType<typeof useCanvasAutoLayout>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import { type CanvasCaptureToolProviderOptions, type CanvasNode } from '@pixerate/editor/canvas';
|
|
3
|
+
import { type AgentToolProvider } from '@pixerate/editor/tools';
|
|
4
|
+
export interface UseCanvasCaptureOptions<TNode extends CanvasNode = CanvasNode> extends Omit<CanvasCaptureToolProviderOptions<TNode>, 'element'> {
|
|
5
|
+
/** The flow's root element (`.react-flow`): a ref, the element, or a getter. */
|
|
6
|
+
element: RefObject<HTMLElement | null> | HTMLElement | null | undefined | (() => HTMLElement | null | undefined);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The `capture_view` agent tool for a React Flow canvas: screenshots of the viewport, all
|
|
10
|
+
* content, the selection, nodes by id or a rect in canvas units. Register the result with
|
|
11
|
+
* `useAgentToolProvider`. The provider stays the same object across renders (it reads the
|
|
12
|
+
* latest options on each call) and changes only with `id` / `namespace`.
|
|
13
|
+
*
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const flow = useReactFlow();
|
|
16
|
+
* const capture = useCanvasCapture({ element: paneRef, getViewport: flow.getViewport, getNodes: flow.getNodes, namespace: 'canvas' });
|
|
17
|
+
* useAgentToolProvider(registry, capture);
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function useCanvasCapture<TNode extends CanvasNode = CanvasNode>(options: UseCanvasCaptureOptions<TNode>): AgentToolProvider;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import { type CanvasCaptureToolProviderOptions, type CanvasNode } from '@pixerate/editor/canvas';
|
|
3
|
+
import { type AgentToolProvider } from '@pixerate/editor/tools';
|
|
4
|
+
export interface UseCanvasCaptureOptions<TNode extends CanvasNode = CanvasNode> extends Omit<CanvasCaptureToolProviderOptions<TNode>, 'element'> {
|
|
5
|
+
/** The flow's root element (`.react-flow`): a ref, the element, or a getter. */
|
|
6
|
+
element: RefObject<HTMLElement | null> | HTMLElement | null | undefined | (() => HTMLElement | null | undefined);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The `capture_view` agent tool for a React Flow canvas: screenshots of the viewport, all
|
|
10
|
+
* content, the selection, nodes by id or a rect in canvas units. Register the result with
|
|
11
|
+
* `useAgentToolProvider`. The provider stays the same object across renders (it reads the
|
|
12
|
+
* latest options on each call) and changes only with `id` / `namespace`.
|
|
13
|
+
*
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const flow = useReactFlow();
|
|
16
|
+
* const capture = useCanvasCapture({ element: paneRef, getViewport: flow.getViewport, getNodes: flow.getNodes, namespace: 'canvas' });
|
|
17
|
+
* useAgentToolProvider(registry, capture);
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function useCanvasCapture<TNode extends CanvasNode = CanvasNode>(options: UseCanvasCaptureOptions<TNode>): AgentToolProvider;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type CanvasEdge, type CanvasNode, type XYPosition } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasClipboardOptions<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge> {
|
|
3
|
+
onPasteNodes?: (nodes: TNode[], edges?: TEdge[]) => void | Promise<void>;
|
|
4
|
+
onPasteUrl?: (url: string, position?: XYPosition) => void;
|
|
5
|
+
onPasteText?: (text: string, position?: XYPosition) => void;
|
|
6
|
+
screenToFlowPosition?: (position: XYPosition) => XYPosition;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* React hook managing canvas clipboard copy and paste operations.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useCanvasClipboard<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge>(options?: UseCanvasClipboardOptions<TNode, TEdge>): {
|
|
12
|
+
copySelectedNodes: (selectedNodes: TNode[], connectedEdges?: TEdge[], event?: ClipboardEvent | React.ClipboardEvent) => boolean;
|
|
13
|
+
handlePasteEvent: (event: ClipboardEvent | React.ClipboardEvent) => Promise<boolean>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type CanvasEdge, type CanvasNode, type XYPosition } from '@pixerate/editor/canvas';
|
|
2
|
+
export interface UseCanvasClipboardOptions<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge> {
|
|
3
|
+
onPasteNodes?: (nodes: TNode[], edges?: TEdge[]) => void | Promise<void>;
|
|
4
|
+
onPasteUrl?: (url: string, position?: XYPosition) => void;
|
|
5
|
+
onPasteText?: (text: string, position?: XYPosition) => void;
|
|
6
|
+
screenToFlowPosition?: (position: XYPosition) => XYPosition;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* React hook managing canvas clipboard copy and paste operations.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useCanvasClipboard<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge>(options?: UseCanvasClipboardOptions<TNode, TEdge>): {
|
|
12
|
+
copySelectedNodes: (selectedNodes: TNode[], connectedEdges?: TEdge[], event?: ClipboardEvent | React.ClipboardEvent) => boolean;
|
|
13
|
+
handlePasteEvent: (event: ClipboardEvent | React.ClipboardEvent) => Promise<boolean>;
|
|
14
|
+
};
|