@r2digisolutions/components 0.1.6 → 0.2.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/README.md +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.svelte +10 -3
- package/dist/components/atoms/Checkbox/Checkbox.svelte.d.ts +3 -0
- package/dist/components/atoms/IconButton/IconButton.svelte +1 -1
- package/dist/components/atoms/Input/Input.svelte +17 -2
- package/dist/components/atoms/Input/Input.svelte.d.ts +6 -1
- package/dist/components/atoms/MarqueeRect/MarqueeRect.svelte +21 -0
- package/dist/components/atoms/MarqueeRect/MarqueeRect.svelte.d.ts +8 -0
- package/dist/components/atoms/MediaKindIcon/MediaKindIcon.stories.js +8 -0
- package/dist/components/atoms/MediaKindIcon/MediaKindIcon.svelte +122 -0
- package/dist/components/atoms/MediaKindIcon/MediaKindIcon.svelte.d.ts +11 -0
- package/dist/components/atoms/MediaKindIcon/MediaKindIconStory.svelte +12 -0
- package/dist/components/atoms/MediaKindIcon/MediaKindIconStory.svelte.d.ts +18 -0
- package/dist/components/atoms/PanKnob/PanKnob.stories.d.ts +9 -0
- package/dist/components/atoms/PanKnob/PanKnob.stories.js +8 -0
- package/dist/components/atoms/PanKnob/PanKnob.svelte +218 -0
- package/dist/components/atoms/PanKnob/PanKnob.svelte.d.ts +19 -0
- package/dist/components/atoms/PanKnob/PanKnobStory.svelte +15 -0
- package/dist/components/atoms/PanKnob/PanKnobStory.svelte.d.ts +3 -0
- package/dist/components/atoms/Playhead/Playhead.stories.js +8 -0
- package/dist/components/atoms/Playhead/Playhead.svelte +59 -0
- package/dist/components/atoms/Playhead/Playhead.svelte.d.ts +13 -0
- package/dist/components/atoms/Playhead/PlayheadStory.svelte +9 -0
- package/dist/components/atoms/Playhead/PlayheadStory.svelte.d.ts +18 -0
- package/dist/components/atoms/Textarea/Textarea.svelte +4 -1
- package/dist/components/atoms/Textarea/Textarea.svelte.d.ts +1 -0
- package/dist/components/atoms/TimeRuler/TimeRuler.stories.js +8 -0
- package/dist/components/atoms/TimeRuler/TimeRuler.svelte +58 -0
- package/dist/components/atoms/TimeRuler/TimeRuler.svelte.d.ts +10 -0
- package/dist/components/atoms/TimeRuler/TimeRulerStory.svelte +7 -0
- package/dist/components/atoms/TimeRuler/TimeRulerStory.svelte.d.ts +18 -0
- package/dist/components/atoms/Toggle/Toggle.svelte +1 -1
- package/dist/components/atoms/Tooltip/Tooltip.svelte +1 -1
- package/dist/components/atoms/TrimHandle/TrimHandle.stories.js +8 -0
- package/dist/components/atoms/TrimHandle/TrimHandle.svelte +63 -0
- package/dist/components/atoms/TrimHandle/TrimHandle.svelte.d.ts +12 -0
- package/dist/components/atoms/TrimHandle/TrimHandleStory.svelte +11 -0
- package/dist/components/atoms/TrimHandle/TrimHandleStory.svelte.d.ts +18 -0
- package/dist/components/molecules/AiAssistPanel/AiAssistPanel.stories.d.ts +9 -0
- package/dist/components/molecules/AiAssistPanel/AiAssistPanel.stories.js +8 -0
- package/dist/components/molecules/AiAssistPanel/AiAssistPanel.svelte +102 -0
- package/dist/components/molecules/AiAssistPanel/AiAssistPanel.svelte.d.ts +20 -0
- package/dist/components/molecules/AiAssistPanel/AiAssistPanelStory.svelte +34 -0
- package/dist/components/molecules/AiAssistPanel/AiAssistPanelStory.svelte.d.ts +3 -0
- package/dist/components/molecules/BulkActionBar/BulkActionBar.svelte +112 -62
- package/dist/components/molecules/BulkActionBar/BulkActionBar.svelte.d.ts +2 -0
- package/dist/components/molecules/BulkEditPanel/BulkEditPanel.stories.js +8 -0
- package/dist/components/molecules/BulkEditPanel/BulkEditPanel.svelte +117 -0
- package/dist/components/molecules/BulkEditPanel/BulkEditPanel.svelte.d.ts +23 -0
- package/dist/components/molecules/BulkEditPanel/BulkEditPanelStory.svelte +18 -0
- package/dist/components/molecules/BulkEditPanel/BulkEditPanelStory.svelte.d.ts +18 -0
- package/dist/components/molecules/CanvasElementsPanel/CanvasElementsPanel.stories.js +8 -0
- package/dist/components/molecules/CanvasElementsPanel/CanvasElementsPanel.svelte +858 -0
- package/dist/components/molecules/CanvasElementsPanel/CanvasElementsPanel.svelte.d.ts +43 -0
- package/dist/components/molecules/CanvasElementsPanel/CanvasElementsPanelStory.svelte +7 -0
- package/dist/components/molecules/CanvasElementsPanel/CanvasElementsPanelStory.svelte.d.ts +18 -0
- package/dist/components/molecules/CanvasInspector/CanvasInspector.stories.d.ts +9 -0
- package/dist/components/molecules/CanvasInspector/CanvasInspector.stories.js +8 -0
- package/dist/components/molecules/CanvasInspector/CanvasInspector.svelte +1140 -0
- package/dist/components/molecules/CanvasInspector/CanvasInspector.svelte.d.ts +28 -0
- package/dist/components/molecules/CanvasInspector/CanvasInspectorStory.svelte +20 -0
- package/dist/components/molecules/CanvasInspector/CanvasInspectorStory.svelte.d.ts +3 -0
- package/dist/components/molecules/CodeEditor/CodeEditor.svelte +13 -10
- package/dist/components/molecules/ColorPicker/ColorPicker.svelte +167 -97
- package/dist/components/molecules/ColumnVisibilityMenu/ColumnVisibilityMenu.stories.d.ts +9 -0
- package/dist/components/molecules/ColumnVisibilityMenu/ColumnVisibilityMenu.stories.js +8 -0
- package/dist/components/molecules/ColumnVisibilityMenu/ColumnVisibilityMenu.svelte +108 -0
- package/dist/components/molecules/ColumnVisibilityMenu/ColumnVisibilityMenu.svelte.d.ts +18 -0
- package/dist/components/molecules/ColumnVisibilityMenu/ColumnVisibilityMenuStory.svelte +15 -0
- package/dist/components/molecules/ColumnVisibilityMenu/ColumnVisibilityMenuStory.svelte.d.ts +3 -0
- package/dist/components/molecules/ConditionalFormatPanel/ConditionalFormatPanel.stories.d.ts +9 -0
- package/dist/components/molecules/ConditionalFormatPanel/ConditionalFormatPanel.stories.js +8 -0
- package/dist/components/molecules/ConditionalFormatPanel/ConditionalFormatPanel.svelte +412 -0
- package/dist/components/molecules/ConditionalFormatPanel/ConditionalFormatPanel.svelte.d.ts +14 -0
- package/dist/components/molecules/ConditionalFormatPanel/ConditionalFormatPanelStory.svelte +27 -0
- package/dist/components/molecules/ConditionalFormatPanel/ConditionalFormatPanelStory.svelte.d.ts +3 -0
- package/dist/components/molecules/ConflictResolver/ConflictResolver.stories.js +8 -0
- package/dist/components/molecules/ConflictResolver/ConflictResolver.svelte +73 -0
- package/dist/components/molecules/ConflictResolver/ConflictResolver.svelte.d.ts +16 -0
- package/dist/components/molecules/ConflictResolver/ConflictResolverStory.svelte +11 -0
- package/dist/components/molecules/ConflictResolver/ConflictResolverStory.svelte.d.ts +18 -0
- package/dist/components/molecules/ContextMenu/ContextMenu.svelte +237 -41
- package/dist/components/molecules/ContextMenu/ContextMenu.svelte.d.ts +17 -1
- package/dist/components/molecules/DateTimePicker/DateTimePicker.svelte.d.ts +1 -1
- package/dist/components/molecules/ExpressionEditor/ExpressionEditor.stories.d.ts +9 -0
- package/dist/components/molecules/ExpressionEditor/ExpressionEditor.stories.js +8 -0
- package/dist/components/molecules/ExpressionEditor/ExpressionEditor.svelte +56 -0
- package/dist/components/molecules/ExpressionEditor/ExpressionEditor.svelte.d.ts +12 -0
- package/dist/components/molecules/ExpressionEditor/ExpressionEditorStory.svelte +12 -0
- package/dist/components/molecules/ExpressionEditor/ExpressionEditorStory.svelte.d.ts +3 -0
- package/dist/components/molecules/FilterList/FilterList.stories.d.ts +9 -0
- package/dist/components/molecules/FilterList/FilterList.stories.js +8 -0
- package/dist/components/molecules/FilterList/FilterList.svelte +101 -0
- package/dist/components/molecules/FilterList/FilterList.svelte.d.ts +18 -0
- package/dist/components/molecules/FilterList/FilterListStory.svelte +31 -0
- package/dist/components/molecules/FilterList/FilterListStory.svelte.d.ts +3 -0
- package/dist/components/molecules/FormDateTimePicker/FormDateTimePicker.svelte.d.ts +1 -1
- package/dist/components/molecules/Gauge/Gauge.stories.d.ts +1 -1
- package/dist/components/molecules/InfiniteScroll/InfiniteScroll.stories.d.ts +1 -1
- package/dist/components/molecules/MediaAssetBrowser/MediaAssetBrowser.stories.d.ts +9 -0
- package/dist/components/molecules/MediaAssetBrowser/MediaAssetBrowser.stories.js +8 -0
- package/dist/components/molecules/MediaAssetBrowser/MediaAssetBrowser.svelte +94 -0
- package/dist/components/molecules/MediaAssetBrowser/MediaAssetBrowser.svelte.d.ts +15 -0
- package/dist/components/molecules/MediaAssetBrowser/MediaAssetBrowserStory.svelte +18 -0
- package/dist/components/molecules/MediaAssetBrowser/MediaAssetBrowserStory.svelte.d.ts +3 -0
- package/dist/components/molecules/MediaAssetCard/MediaAssetCard.stories.js +8 -0
- package/dist/components/molecules/MediaAssetCard/MediaAssetCard.svelte +50 -0
- package/dist/components/molecules/MediaAssetCard/MediaAssetCard.svelte.d.ts +11 -0
- package/dist/components/molecules/MediaAssetCard/MediaAssetCardStory.svelte +13 -0
- package/dist/components/molecules/MediaAssetCard/MediaAssetCardStory.svelte.d.ts +18 -0
- package/dist/components/molecules/MediaLayerItem/MediaLayerItem.stories.js +8 -0
- package/dist/components/molecules/MediaLayerItem/MediaLayerItem.svelte +380 -0
- package/dist/components/molecules/MediaLayerItem/MediaLayerItem.svelte.d.ts +33 -0
- package/dist/components/molecules/MediaLayerItem/MediaLayerItemStory.svelte +14 -0
- package/dist/components/molecules/MediaLayerItem/MediaLayerItemStory.svelte.d.ts +18 -0
- package/dist/components/molecules/MediaLayerList/MediaLayerList.stories.d.ts +9 -0
- package/dist/components/molecules/MediaLayerList/MediaLayerList.stories.js +8 -0
- package/dist/components/molecules/MediaLayerList/MediaLayerList.svelte +399 -0
- package/dist/components/molecules/MediaLayerList/MediaLayerList.svelte.d.ts +37 -0
- package/dist/components/molecules/MediaLayerList/MediaLayerListStory.svelte +24 -0
- package/dist/components/molecules/MediaLayerList/MediaLayerListStory.svelte.d.ts +3 -0
- package/dist/components/molecules/MediaStage/MediaStage.stories.d.ts +9 -0
- package/dist/components/molecules/MediaStage/MediaStage.stories.js +8 -0
- package/dist/components/molecules/MediaStage/MediaStage.svelte +1498 -0
- package/dist/components/molecules/MediaStage/MediaStage.svelte.d.ts +45 -0
- package/dist/components/molecules/MediaStage/MediaStageStory.svelte +35 -0
- package/dist/components/molecules/MediaStage/MediaStageStory.svelte.d.ts +3 -0
- package/dist/components/molecules/MediaTimeline/MediaTimeline.stories.d.ts +9 -0
- package/dist/components/molecules/MediaTimeline/MediaTimeline.stories.js +8 -0
- package/dist/components/molecules/MediaTimeline/MediaTimeline.svelte +131 -0
- package/dist/components/molecules/MediaTimeline/MediaTimeline.svelte.d.ts +19 -0
- package/dist/components/molecules/MediaTimeline/MediaTimelineStory.svelte +20 -0
- package/dist/components/molecules/MediaTimeline/MediaTimelineStory.svelte.d.ts +3 -0
- package/dist/components/molecules/MixerChannel/MixerChannel.stories.d.ts +9 -0
- package/dist/components/molecules/MixerChannel/MixerChannel.stories.js +8 -0
- package/dist/components/molecules/MixerChannel/MixerChannel.svelte +92 -0
- package/dist/components/molecules/MixerChannel/MixerChannel.svelte.d.ts +11 -0
- package/dist/components/molecules/MixerChannel/MixerChannelStory.svelte +13 -0
- package/dist/components/molecules/MixerChannel/MixerChannelStory.svelte.d.ts +3 -0
- package/dist/components/molecules/NodeGraph/GraphBlueprintNode.svelte +454 -0
- package/dist/components/molecules/NodeGraph/GraphBlueprintNode.svelte.d.ts +8 -0
- package/dist/components/molecules/NodeGraph/GraphFlowBridge.svelte +26 -0
- package/dist/components/molecules/NodeGraph/GraphFlowBridge.svelte.d.ts +22 -0
- package/dist/components/molecules/NodeGraph/NodeGraph.stories.d.ts +12 -0
- package/dist/components/molecules/NodeGraph/NodeGraph.stories.js +9 -0
- package/dist/components/molecules/NodeGraph/NodeGraph.svelte +1409 -0
- package/dist/components/molecules/NodeGraph/NodeGraph.svelte.d.ts +33 -0
- package/dist/components/molecules/NodeGraph/NodeGraphStory.svelte +90 -0
- package/dist/components/molecules/NodeGraph/NodeGraphStory.svelte.d.ts +3 -0
- package/dist/components/molecules/NodePalette/NodePalette.stories.js +8 -0
- package/dist/components/molecules/NodePalette/NodePalette.svelte +86 -0
- package/dist/components/molecules/NodePalette/NodePalette.svelte.d.ts +11 -0
- package/dist/components/molecules/NodePalette/NodePaletteStory.svelte +11 -0
- package/dist/components/molecules/NodePalette/NodePaletteStory.svelte.d.ts +18 -0
- package/dist/components/molecules/Poll/Poll.stories.d.ts +1 -1
- package/dist/components/molecules/ProgramMonitor/ProgramMonitor.stories.js +8 -0
- package/dist/components/molecules/ProgramMonitor/ProgramMonitor.svelte +72 -0
- package/dist/components/molecules/ProgramMonitor/ProgramMonitor.svelte.d.ts +12 -0
- package/dist/components/molecules/ProgramMonitor/ProgramMonitorStory.svelte +16 -0
- package/dist/components/molecules/ProgramMonitor/ProgramMonitorStory.svelte.d.ts +18 -0
- package/dist/components/molecules/PropertyField/PropertyField.svelte +57 -3
- package/dist/components/molecules/PropertyField/PropertyField.svelte.d.ts +10 -0
- package/dist/components/molecules/PropertyField/PropertyFieldStory.svelte +21 -0
- package/dist/components/molecules/PropertyGroup/PropertyGroup.svelte +1 -1
- package/dist/components/molecules/QueryBuilder/QueryBuilder.stories.d.ts +9 -0
- package/dist/components/molecules/QueryBuilder/QueryBuilder.stories.js +8 -0
- package/dist/components/molecules/QueryBuilder/QueryBuilder.svelte +52 -0
- package/dist/components/molecules/QueryBuilder/QueryBuilder.svelte.d.ts +18 -0
- package/dist/components/molecules/QueryBuilder/QueryBuilderStory.svelte +62 -0
- package/dist/components/molecules/QueryBuilder/QueryBuilderStory.svelte.d.ts +3 -0
- package/dist/components/molecules/RelationPicker/RelationPicker.stories.d.ts +9 -0
- package/dist/components/molecules/RelationPicker/RelationPicker.stories.js +8 -0
- package/dist/components/molecules/RelationPicker/RelationPicker.svelte +180 -0
- package/dist/components/molecules/RelationPicker/RelationPicker.svelte.d.ts +24 -0
- package/dist/components/molecules/RelationPicker/RelationPickerStory.svelte +16 -0
- package/dist/components/molecules/RelationPicker/RelationPickerStory.svelte.d.ts +3 -0
- package/dist/components/molecules/SchemaFieldBuilder/SchemaFieldBuilder.stories.d.ts +9 -0
- package/dist/components/molecules/SchemaFieldBuilder/SchemaFieldBuilder.stories.js +8 -0
- package/dist/components/molecules/SchemaFieldBuilder/SchemaFieldBuilder.svelte +154 -0
- package/dist/components/molecules/SchemaFieldBuilder/SchemaFieldBuilder.svelte.d.ts +12 -0
- package/dist/components/molecules/SchemaFieldBuilder/SchemaFieldBuilderStory.svelte +16 -0
- package/dist/components/molecules/SchemaFieldBuilder/SchemaFieldBuilderStory.svelte.d.ts +3 -0
- package/dist/components/molecules/SecretField/SecretField.stories.d.ts +9 -0
- package/dist/components/molecules/SecretField/SecretField.stories.js +8 -0
- package/dist/components/molecules/SecretField/SecretField.svelte +58 -0
- package/dist/components/molecules/SecretField/SecretField.svelte.d.ts +15 -0
- package/dist/components/molecules/SecretField/SecretFieldStory.svelte +8 -0
- package/dist/components/molecules/SecretField/SecretFieldStory.svelte.d.ts +3 -0
- package/dist/components/molecules/SplitPane/SplitPane.svelte +96 -37
- package/dist/components/molecules/SplitPane/SplitPane.svelte.d.ts +10 -2
- package/dist/components/molecules/TableToolbar/TableToolbar.svelte.d.ts +1 -1
- package/dist/components/molecules/Terminal/Terminal.stories.js +20 -0
- package/dist/components/molecules/Terminal/Terminal.svelte +238 -0
- package/dist/components/molecules/Terminal/Terminal.svelte.d.ts +19 -0
- package/dist/components/molecules/Terminal/TerminalStory.svelte +47 -0
- package/dist/components/molecules/Terminal/TerminalStory.svelte.d.ts +6 -0
- package/dist/components/molecules/TimelineClip/TimelineClip.stories.js +8 -0
- package/dist/components/molecules/TimelineClip/TimelineClip.svelte +116 -0
- package/dist/components/molecules/TimelineClip/TimelineClip.svelte.d.ts +15 -0
- package/dist/components/molecules/TimelineClip/TimelineClipStory.svelte +18 -0
- package/dist/components/molecules/TimelineClip/TimelineClipStory.svelte.d.ts +18 -0
- package/dist/components/molecules/TimelineTrack/TimelineTrack.stories.js +8 -0
- package/dist/components/molecules/TimelineTrack/TimelineTrack.svelte +56 -0
- package/dist/components/molecules/TimelineTrack/TimelineTrack.svelte.d.ts +16 -0
- package/dist/components/molecules/TimelineTrack/TimelineTrackStory.svelte +35 -0
- package/dist/components/molecules/TimelineTrack/TimelineTrackStory.svelte.d.ts +18 -0
- package/dist/components/molecules/TraceWaterfall/TraceWaterfall.stories.js +8 -0
- package/dist/components/molecules/TraceWaterfall/TraceWaterfall.svelte +158 -0
- package/dist/components/molecules/TraceWaterfall/TraceWaterfall.svelte.d.ts +18 -0
- package/dist/components/molecules/TraceWaterfall/TraceWaterfallStory.svelte +55 -0
- package/dist/components/molecules/TraceWaterfall/TraceWaterfallStory.svelte.d.ts +18 -0
- package/dist/components/molecules/TrackHeader/TrackHeader.stories.d.ts +9 -0
- package/dist/components/molecules/TrackHeader/TrackHeader.stories.js +8 -0
- package/dist/components/molecules/TrackHeader/TrackHeader.svelte +54 -0
- package/dist/components/molecules/TrackHeader/TrackHeader.svelte.d.ts +9 -0
- package/dist/components/molecules/TrackHeader/TrackHeaderStory.svelte +10 -0
- package/dist/components/molecules/TrackHeader/TrackHeaderStory.svelte.d.ts +3 -0
- package/dist/components/molecules/TransportControls/TransportControls.stories.d.ts +9 -0
- package/dist/components/molecules/TransportControls/TransportControls.stories.js +8 -0
- package/dist/components/molecules/TransportControls/TransportControls.svelte +53 -0
- package/dist/components/molecules/TransportControls/TransportControls.svelte.d.ts +12 -0
- package/dist/components/molecules/TransportControls/TransportControlsStory.svelte +18 -0
- package/dist/components/molecules/TransportControls/TransportControlsStory.svelte.d.ts +3 -0
- package/dist/components/molecules/VersionHistoryPanel/VersionHistoryPanel.stories.js +8 -0
- package/dist/components/molecules/VersionHistoryPanel/VersionHistoryPanel.svelte +117 -0
- package/dist/components/molecules/VersionHistoryPanel/VersionHistoryPanel.svelte.d.ts +20 -0
- package/dist/components/molecules/VersionHistoryPanel/VersionHistoryPanelStory.svelte +36 -0
- package/dist/components/molecules/VersionHistoryPanel/VersionHistoryPanelStory.svelte.d.ts +18 -0
- package/dist/components/molecules/VideoPlayer/VideoPlayer.stories.d.ts +1 -1
- package/dist/components/molecules/VideoTrackHeader/VideoTrackHeader.stories.d.ts +9 -0
- package/dist/components/molecules/VideoTrackHeader/VideoTrackHeader.stories.js +8 -0
- package/dist/components/molecules/VideoTrackHeader/VideoTrackHeader.svelte +59 -0
- package/dist/components/molecules/VideoTrackHeader/VideoTrackHeader.svelte.d.ts +9 -0
- package/dist/components/molecules/VideoTrackHeader/VideoTrackHeaderStory.svelte +10 -0
- package/dist/components/molecules/VideoTrackHeader/VideoTrackHeaderStory.svelte.d.ts +3 -0
- package/dist/components/molecules/WaveformRegion/WaveformRegion.stories.js +8 -0
- package/dist/components/molecules/WaveformRegion/WaveformRegion.svelte +82 -0
- package/dist/components/molecules/WaveformRegion/WaveformRegion.svelte.d.ts +13 -0
- package/dist/components/molecules/WaveformRegion/WaveformRegionStory.svelte +17 -0
- package/dist/components/molecules/WaveformRegion/WaveformRegionStory.svelte.d.ts +18 -0
- package/dist/components/molecules/WidgetCanvas/WidgetCanvas.svelte +13 -4
- package/dist/components/molecules/WidgetCanvas/WidgetCanvas.svelte.d.ts +3 -1
- package/dist/components/molecules/WidgetCanvas/widgetCanvasContext.d.ts +2 -0
- package/dist/components/molecules/WidgetFrame/WidgetFrame.svelte +206 -37
- package/dist/components/molecules/WidgetFrame/WidgetFrame.svelte.d.ts +31 -0
- package/dist/components/organisms/AssetPickerPage/AssetPickerPage.svelte.d.ts +1 -1
- package/dist/components/organisms/AudioEditor/AudioEditor.stories.d.ts +12 -0
- package/dist/components/organisms/AudioEditor/AudioEditor.stories.js +9 -0
- package/dist/components/organisms/AudioEditor/AudioEditor.svelte +273 -0
- package/dist/components/organisms/AudioEditor/AudioEditor.svelte.d.ts +13 -0
- package/dist/components/organisms/AudioEditor/AudioEditorStory.svelte +10 -0
- package/dist/components/organisms/AudioEditor/AudioEditorStory.svelte.d.ts +3 -0
- package/dist/components/organisms/BacklogPage/BacklogPage.svelte.d.ts +1 -1
- package/dist/components/organisms/BlogEditor/BlogEditor.stories.d.ts +12 -0
- package/dist/components/organisms/BlogEditor/BlogEditor.stories.js +9 -0
- package/dist/components/organisms/BlogEditor/BlogEditor.svelte +1208 -0
- package/dist/components/organisms/BlogEditor/BlogEditor.svelte.d.ts +16 -0
- package/dist/components/organisms/BlogEditor/BlogEditorStory.svelte +144 -0
- package/dist/components/organisms/BlogEditor/BlogEditorStory.svelte.d.ts +3 -0
- package/dist/components/organisms/BlogEditor/DemoBlogCard.svelte +28 -0
- package/dist/components/organisms/BlogEditor/DemoBlogCard.svelte.d.ts +10 -0
- package/dist/components/organisms/BlogEditor/DemoBlogStats.svelte +34 -0
- package/dist/components/organisms/BlogEditor/DemoBlogStats.svelte.d.ts +11 -0
- package/dist/components/organisms/BlogEditor/DemoBlogWidget.svelte +13 -0
- package/dist/components/organisms/BlogEditor/DemoBlogWidget.svelte.d.ts +8 -0
- package/dist/components/organisms/BlogRenderer/BlogRenderer.stories.js +8 -0
- package/dist/components/organisms/BlogRenderer/BlogRenderer.svelte +469 -0
- package/dist/components/organisms/BlogRenderer/BlogRenderer.svelte.d.ts +14 -0
- package/dist/components/organisms/BlogRenderer/BlogRendererStory.svelte +20 -0
- package/dist/components/organisms/BlogRenderer/BlogRendererStory.svelte.d.ts +18 -0
- package/dist/components/organisms/BlueprintEditor/BlueprintEditor.stories.d.ts +12 -0
- package/dist/components/organisms/BlueprintEditor/BlueprintEditor.stories.js +9 -0
- package/dist/components/organisms/BlueprintEditor/BlueprintEditor.svelte +1012 -0
- package/dist/components/organisms/BlueprintEditor/BlueprintEditor.svelte.d.ts +16 -0
- package/dist/components/organisms/BlueprintEditor/BlueprintEditorStory.svelte +76 -0
- package/dist/components/organisms/BlueprintEditor/BlueprintEditorStory.svelte.d.ts +3 -0
- package/dist/components/organisms/CalendarApp/CalendarApp.svelte.d.ts +1 -1
- package/dist/components/organisms/CanvasEditor/CanvasEditor.stories.d.ts +12 -0
- package/dist/components/organisms/CanvasEditor/CanvasEditor.stories.js +9 -0
- package/dist/components/organisms/CanvasEditor/CanvasEditor.svelte +1680 -0
- package/dist/components/organisms/CanvasEditor/CanvasEditor.svelte.d.ts +18 -0
- package/dist/components/organisms/CanvasEditor/CanvasEditorStory.svelte +329 -0
- package/dist/components/organisms/CanvasEditor/CanvasEditorStory.svelte.d.ts +3 -0
- package/dist/components/organisms/DashboardBuilderPage/DashboardBuilderPage.svelte.d.ts +1 -1
- package/dist/components/organisms/DataGrid/DataGrid.stories.d.ts +65 -0
- package/dist/components/organisms/DataGrid/DataGrid.stories.js +95 -0
- package/dist/components/organisms/DataGrid/DataGrid.svelte +2264 -0
- package/dist/components/organisms/DataGrid/DataGrid.svelte.d.ts +99 -0
- package/dist/components/organisms/DataGrid/DataGridStory.svelte +659 -0
- package/dist/components/organisms/DataGrid/DataGridStory.svelte.d.ts +11 -0
- package/dist/components/organisms/DataGrid/breakpoints.d.ts +10 -0
- package/dist/components/organisms/DataGrid/breakpoints.js +20 -0
- package/dist/components/organisms/DataGrid/cellEditors.d.ts +8 -0
- package/dist/components/organisms/DataGrid/cellEditors.js +59 -0
- package/dist/components/organisms/DataGrid/conditionalFormat.d.ts +11 -0
- package/dist/components/organisms/DataGrid/conditionalFormat.js +98 -0
- package/dist/components/organisms/DataGrid/filterRows.d.ts +5 -0
- package/dist/components/organisms/DataGrid/filterRows.js +60 -0
- package/dist/components/organisms/DataGrid/marks.d.ts +9 -0
- package/dist/components/organisms/DataGrid/marks.js +91 -0
- package/dist/components/organisms/DataGrid/types.d.ts +126 -0
- package/dist/components/organisms/DataGrid/types.js +21 -0
- package/dist/components/organisms/DesktopShell/DesktopShell.svelte.d.ts +1 -1
- package/dist/components/organisms/EditorShell/EditorShell.svelte +123 -28
- package/dist/components/organisms/EditorShell/EditorShell.svelte.d.ts +21 -1
- package/dist/components/organisms/FileUploader/FileUploader.svelte +77 -15
- package/dist/components/organisms/FileUploader/FileUploader.svelte.d.ts +11 -0
- package/dist/components/organisms/ImportWizard/ImportWizard.stories.js +8 -0
- package/dist/components/organisms/ImportWizard/ImportWizard.svelte +209 -0
- package/dist/components/organisms/ImportWizard/ImportWizard.svelte.d.ts +22 -0
- package/dist/components/organisms/ImportWizard/ImportWizardStory.svelte +16 -0
- package/dist/components/organisms/ImportWizard/ImportWizardStory.svelte.d.ts +18 -0
- package/dist/components/organisms/ResourceStudio/ResourceStudio.stories.d.ts +33 -0
- package/dist/components/organisms/ResourceStudio/ResourceStudio.stories.js +56 -0
- package/dist/components/organisms/ResourceStudio/ResourceStudio.svelte +830 -0
- package/dist/components/organisms/ResourceStudio/ResourceStudio.svelte.d.ts +68 -0
- package/dist/components/organisms/ResourceStudio/ResourceStudioStory.svelte +600 -0
- package/dist/components/organisms/ResourceStudio/ResourceStudioStory.svelte.d.ts +7 -0
- package/dist/components/organisms/ResourceStudio/fieldsToColumns.d.ts +4 -0
- package/dist/components/organisms/ResourceStudio/fieldsToColumns.js +20 -0
- package/dist/components/organisms/ResourceStudio/fieldsToSchema.d.ts +6 -0
- package/dist/components/organisms/ResourceStudio/fieldsToSchema.js +53 -0
- package/dist/components/organisms/ResourceStudio/types.d.ts +69 -0
- package/dist/components/organisms/ResourceStudio/types.js +15 -0
- package/dist/components/organisms/Scheduler/Scheduler.svelte.d.ts +1 -1
- package/dist/components/organisms/SchemaForm/SchemaForm.svelte +10 -3
- package/dist/components/organisms/SchemaForm/SchemaForm.svelte.d.ts +1 -0
- package/dist/components/organisms/VideoEditor/VideoEditor.stories.d.ts +12 -0
- package/dist/components/organisms/VideoEditor/VideoEditor.stories.js +9 -0
- package/dist/components/organisms/VideoEditor/VideoEditor.svelte +308 -0
- package/dist/components/organisms/VideoEditor/VideoEditor.svelte.d.ts +13 -0
- package/dist/components/organisms/VideoEditor/VideoEditorStory.svelte +10 -0
- package/dist/components/organisms/VideoEditor/VideoEditorStory.svelte.d.ts +3 -0
- package/dist/components/templates/AudioEditorTemplate/AudioEditorTemplate.stories.d.ts +12 -0
- package/dist/components/templates/AudioEditorTemplate/AudioEditorTemplate.stories.js +9 -0
- package/dist/components/templates/AudioEditorTemplate/AudioEditorTemplate.svelte +22 -0
- package/dist/components/templates/AudioEditorTemplate/AudioEditorTemplate.svelte.d.ts +13 -0
- package/dist/components/templates/AudioEditorTemplate/AudioEditorTemplateStory.svelte +8 -0
- package/dist/components/templates/AudioEditorTemplate/AudioEditorTemplateStory.svelte.d.ts +3 -0
- package/dist/components/templates/CanvasEditorTemplate/CanvasEditorTemplate.stories.d.ts +12 -0
- package/dist/components/templates/CanvasEditorTemplate/CanvasEditorTemplate.stories.js +9 -0
- package/dist/components/templates/CanvasEditorTemplate/CanvasEditorTemplate.svelte +32 -0
- package/dist/components/templates/CanvasEditorTemplate/CanvasEditorTemplate.svelte.d.ts +17 -0
- package/dist/components/templates/CanvasEditorTemplate/CanvasEditorTemplateStory.svelte +21 -0
- package/dist/components/templates/CanvasEditorTemplate/CanvasEditorTemplateStory.svelte.d.ts +3 -0
- package/dist/components/templates/ResourceStudioTemplate/ResourceStudioTemplate.stories.d.ts +25 -0
- package/dist/components/templates/ResourceStudioTemplate/ResourceStudioTemplate.stories.js +18 -0
- package/dist/components/templates/ResourceStudioTemplate/ResourceStudioTemplate.svelte +192 -0
- package/dist/components/templates/ResourceStudioTemplate/ResourceStudioTemplate.svelte.d.ts +62 -0
- package/dist/components/templates/ResourceStudioTemplate/ResourceStudioTemplateStory.svelte +129 -0
- package/dist/components/templates/ResourceStudioTemplate/ResourceStudioTemplateStory.svelte.d.ts +7 -0
- package/dist/components/templates/VideoEditorTemplate/VideoEditorTemplate.stories.d.ts +12 -0
- package/dist/components/templates/VideoEditorTemplate/VideoEditorTemplate.stories.js +9 -0
- package/dist/components/templates/VideoEditorTemplate/VideoEditorTemplate.svelte +22 -0
- package/dist/components/templates/VideoEditorTemplate/VideoEditorTemplate.svelte.d.ts +13 -0
- package/dist/components/templates/VideoEditorTemplate/VideoEditorTemplateStory.svelte +8 -0
- package/dist/components/templates/VideoEditorTemplate/VideoEditorTemplateStory.svelte.d.ts +3 -0
- package/dist/index.d.ts +94 -1
- package/dist/index.js +68 -0
- package/dist/types/xyflow-svelte.d.ts +62 -0
- package/dist/utils/audioProject.d.ts +19 -0
- package/dist/utils/audioProject.js +70 -0
- package/dist/utils/blogDocument.d.ts +175 -0
- package/dist/utils/blogDocument.js +220 -0
- package/dist/utils/blueprintRuntime.d.ts +34 -0
- package/dist/utils/blueprintRuntime.js +289 -0
- package/dist/utils/canvasDocument.d.ts +239 -0
- package/dist/utils/canvasDocument.js +443 -0
- package/dist/utils/canvasExport.d.ts +10 -0
- package/dist/utils/canvasExport.js +469 -0
- package/dist/utils/canvasHierarchy.d.ts +189 -0
- package/dist/utils/canvasHierarchy.js +674 -0
- package/dist/utils/canvasHistory.d.ts +19 -0
- package/dist/utils/canvasHistory.js +48 -0
- package/dist/utils/canvasWidget.d.ts +81 -0
- package/dist/utils/canvasWidget.js +597 -0
- package/dist/utils/marqueeSelect.d.ts +48 -0
- package/dist/utils/marqueeSelect.js +189 -0
- package/dist/utils/mediaTime.d.ts +16 -0
- package/dist/utils/mediaTime.js +57 -0
- package/dist/utils/mediaTracks.d.ts +61 -0
- package/dist/utils/mediaTracks.js +102 -0
- package/dist/utils/nodeGraph.d.ts +354 -0
- package/dist/utils/nodeGraph.js +1453 -0
- package/dist/utils/queryBridge.d.ts +18 -0
- package/dist/utils/queryBridge.js +118 -0
- package/dist/utils/videoSequence.d.ts +13 -0
- package/dist/utils/videoSequence.js +63 -0
- package/package.json +5 -2
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
import { computeAbsoluteRects, isEffectivelyVisible } from './canvasHierarchy.js';
|
|
2
|
+
import { flattenLayersWithWidgets } from './canvasWidget.js';
|
|
3
|
+
function loadImage(src) {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
const img = new Image();
|
|
6
|
+
img.crossOrigin = 'anonymous';
|
|
7
|
+
img.onload = () => resolve(img);
|
|
8
|
+
img.onerror = () => reject(new Error(`Failed to load ${src}`));
|
|
9
|
+
img.src = src;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function applyLayerTransform(ctx, layer, cx, cy) {
|
|
13
|
+
ctx.translate(cx, cy);
|
|
14
|
+
if (layer.rotation)
|
|
15
|
+
ctx.rotate((layer.rotation * Math.PI) / 180);
|
|
16
|
+
ctx.scale(layer.flipX ? -1 : 1, layer.flipY ? -1 : 1);
|
|
17
|
+
ctx.translate(-cx, -cy);
|
|
18
|
+
}
|
|
19
|
+
/** Rotate around each ancestor center so flat export matches stage paint. */
|
|
20
|
+
function applyAncestorRotations(ctx, layer, byId, absMap) {
|
|
21
|
+
const ancestors = [];
|
|
22
|
+
let cur = layer.parentId ? byId.get(layer.parentId) : undefined;
|
|
23
|
+
while (cur) {
|
|
24
|
+
ancestors.unshift(cur);
|
|
25
|
+
cur = cur.parentId ? byId.get(cur.parentId) : undefined;
|
|
26
|
+
}
|
|
27
|
+
for (const anc of ancestors) {
|
|
28
|
+
const deg = anc.rotation ?? 0;
|
|
29
|
+
if (!deg)
|
|
30
|
+
continue;
|
|
31
|
+
const a = absMap.get(anc.id) ?? anc.rect;
|
|
32
|
+
const cx = a.x + a.w / 2;
|
|
33
|
+
const cy = a.y + a.h / 2;
|
|
34
|
+
ctx.translate(cx, cy);
|
|
35
|
+
ctx.rotate((deg * Math.PI) / 180);
|
|
36
|
+
ctx.translate(-cx, -cy);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function drawShapePath(ctx, layer) {
|
|
40
|
+
const { x, y, w, h } = layer.rect;
|
|
41
|
+
const fill = layer.fill ?? '#3b82f6';
|
|
42
|
+
ctx.beginPath();
|
|
43
|
+
switch (layer.kind) {
|
|
44
|
+
case 'rect':
|
|
45
|
+
case 'roundRect':
|
|
46
|
+
case 'sticky': {
|
|
47
|
+
const r = Math.min(layer.borderRadius ?? (layer.kind === 'roundRect' ? 24 : 0), w / 2, h / 2);
|
|
48
|
+
if (r > 0 && typeof ctx.roundRect === 'function') {
|
|
49
|
+
ctx.roundRect(x, y, w, h, r);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
ctx.rect(x, y, w, h);
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
case 'ellipse':
|
|
57
|
+
ctx.ellipse(x + w / 2, y + h / 2, w / 2, h / 2, 0, 0, Math.PI * 2);
|
|
58
|
+
break;
|
|
59
|
+
case 'triangle':
|
|
60
|
+
ctx.moveTo(x + w / 2, y);
|
|
61
|
+
ctx.lineTo(x + w, y + h);
|
|
62
|
+
ctx.lineTo(x, y + h);
|
|
63
|
+
ctx.closePath();
|
|
64
|
+
break;
|
|
65
|
+
case 'diamond':
|
|
66
|
+
ctx.moveTo(x + w / 2, y);
|
|
67
|
+
ctx.lineTo(x + w, y + h / 2);
|
|
68
|
+
ctx.lineTo(x + w / 2, y + h);
|
|
69
|
+
ctx.lineTo(x, y + h / 2);
|
|
70
|
+
ctx.closePath();
|
|
71
|
+
break;
|
|
72
|
+
case 'star': {
|
|
73
|
+
const cx = x + w / 2;
|
|
74
|
+
const cy = y + h / 2;
|
|
75
|
+
const spikes = 5;
|
|
76
|
+
const outer = Math.min(w, h) / 2;
|
|
77
|
+
const inner = outer * 0.4;
|
|
78
|
+
for (let i = 0; i < spikes * 2; i++) {
|
|
79
|
+
const radius = i % 2 === 0 ? outer : inner;
|
|
80
|
+
const angle = (i * Math.PI) / spikes - Math.PI / 2;
|
|
81
|
+
const px = cx + Math.cos(angle) * radius;
|
|
82
|
+
const py = cy + Math.sin(angle) * radius;
|
|
83
|
+
if (i === 0)
|
|
84
|
+
ctx.moveTo(px, py);
|
|
85
|
+
else
|
|
86
|
+
ctx.lineTo(px, py);
|
|
87
|
+
}
|
|
88
|
+
ctx.closePath();
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
case 'hexagon': {
|
|
92
|
+
const cx = x + w / 2;
|
|
93
|
+
const cy = y + h / 2;
|
|
94
|
+
for (let i = 0; i < 6; i++) {
|
|
95
|
+
const angle = (Math.PI / 3) * i - Math.PI / 6;
|
|
96
|
+
const px = cx + (w / 2) * Math.cos(angle);
|
|
97
|
+
const py = cy + (h / 2) * Math.sin(angle);
|
|
98
|
+
if (i === 0)
|
|
99
|
+
ctx.moveTo(px, py);
|
|
100
|
+
else
|
|
101
|
+
ctx.lineTo(px, py);
|
|
102
|
+
}
|
|
103
|
+
ctx.closePath();
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
case 'pentagon': {
|
|
107
|
+
const cx = x + w / 2;
|
|
108
|
+
const cy = y + h / 2;
|
|
109
|
+
const r = Math.min(w, h) / 2;
|
|
110
|
+
for (let i = 0; i < 5; i++) {
|
|
111
|
+
const angle = (i * 2 * Math.PI) / 5 - Math.PI / 2;
|
|
112
|
+
const px = cx + r * Math.cos(angle);
|
|
113
|
+
const py = cy + r * Math.sin(angle);
|
|
114
|
+
if (i === 0)
|
|
115
|
+
ctx.moveTo(px, py);
|
|
116
|
+
else
|
|
117
|
+
ctx.lineTo(px, py);
|
|
118
|
+
}
|
|
119
|
+
ctx.closePath();
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
case 'heart': {
|
|
123
|
+
const cx = x + w / 2;
|
|
124
|
+
const top = y + h * 0.3;
|
|
125
|
+
ctx.moveTo(cx, y + h * 0.9);
|
|
126
|
+
ctx.bezierCurveTo(x, y + h * 0.6, x, top, cx, y + h * 0.35);
|
|
127
|
+
ctx.bezierCurveTo(x + w, top, x + w, y + h * 0.6, cx, y + h * 0.9);
|
|
128
|
+
ctx.closePath();
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
case 'line': {
|
|
132
|
+
const vertical = h > w;
|
|
133
|
+
const sw = Math.max(2, layer.strokeWidth ?? 4);
|
|
134
|
+
ctx.strokeStyle = fill;
|
|
135
|
+
ctx.lineWidth = sw;
|
|
136
|
+
ctx.lineCap = 'round';
|
|
137
|
+
if (vertical) {
|
|
138
|
+
ctx.moveTo(x + w / 2, y);
|
|
139
|
+
ctx.lineTo(x + w / 2, y + h);
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
ctx.moveTo(x, y + h / 2);
|
|
143
|
+
ctx.lineTo(x + w, y + h / 2);
|
|
144
|
+
}
|
|
145
|
+
ctx.stroke();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
case 'arrow': {
|
|
149
|
+
const vertical = h > w;
|
|
150
|
+
const sw = Math.max(2, layer.strokeWidth ?? 4);
|
|
151
|
+
const len = vertical ? h : w;
|
|
152
|
+
const thick = vertical ? w : h;
|
|
153
|
+
const head = Math.min(Math.max(14, thick * 0.9), len * 0.35, 40);
|
|
154
|
+
ctx.strokeStyle = fill;
|
|
155
|
+
ctx.fillStyle = fill;
|
|
156
|
+
ctx.lineWidth = sw;
|
|
157
|
+
ctx.lineCap = 'round';
|
|
158
|
+
ctx.lineJoin = 'round';
|
|
159
|
+
if (vertical) {
|
|
160
|
+
const cx = x + w / 2;
|
|
161
|
+
ctx.moveTo(cx, y + sw);
|
|
162
|
+
ctx.lineTo(cx, y + h - head);
|
|
163
|
+
ctx.stroke();
|
|
164
|
+
ctx.beginPath();
|
|
165
|
+
ctx.moveTo(cx, y + h - sw);
|
|
166
|
+
ctx.lineTo(cx - head * 0.45, y + h - head);
|
|
167
|
+
ctx.lineTo(cx + head * 0.45, y + h - head);
|
|
168
|
+
ctx.closePath();
|
|
169
|
+
ctx.fill();
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
const cy = y + h / 2;
|
|
173
|
+
ctx.moveTo(x + sw, cy);
|
|
174
|
+
ctx.lineTo(x + w - head, cy);
|
|
175
|
+
ctx.stroke();
|
|
176
|
+
ctx.beginPath();
|
|
177
|
+
ctx.moveTo(x + w - sw, cy);
|
|
178
|
+
ctx.lineTo(x + w - head, cy - head * 0.45);
|
|
179
|
+
ctx.lineTo(x + w - head, cy + head * 0.45);
|
|
180
|
+
ctx.closePath();
|
|
181
|
+
ctx.fill();
|
|
182
|
+
}
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
case 'path': {
|
|
186
|
+
const pts = layer.points ?? [];
|
|
187
|
+
if (pts.length < 2)
|
|
188
|
+
return;
|
|
189
|
+
ctx.beginPath();
|
|
190
|
+
pts.forEach((p, i) => {
|
|
191
|
+
const px = x + p.x * w;
|
|
192
|
+
const py = y + p.y * h;
|
|
193
|
+
if (i === 0)
|
|
194
|
+
ctx.moveTo(px, py);
|
|
195
|
+
else
|
|
196
|
+
ctx.lineTo(px, py);
|
|
197
|
+
});
|
|
198
|
+
if (layer.closed) {
|
|
199
|
+
ctx.closePath();
|
|
200
|
+
ctx.fillStyle = fill;
|
|
201
|
+
ctx.globalAlpha = (layer.opacity ?? 1) * 0.15;
|
|
202
|
+
ctx.fill();
|
|
203
|
+
ctx.globalAlpha = layer.opacity ?? 1;
|
|
204
|
+
}
|
|
205
|
+
ctx.strokeStyle = layer.stroke ?? fill;
|
|
206
|
+
ctx.lineWidth = Math.max(2, layer.strokeWidth ?? 3);
|
|
207
|
+
ctx.lineCap = 'round';
|
|
208
|
+
ctx.lineJoin = 'round';
|
|
209
|
+
ctx.stroke();
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
case 'group':
|
|
213
|
+
case 'overlay':
|
|
214
|
+
case 'canvasPanel':
|
|
215
|
+
case 'hBox':
|
|
216
|
+
case 'vBox':
|
|
217
|
+
case 'sizeBox':
|
|
218
|
+
case 'scaleBox':
|
|
219
|
+
case 'wrapBox':
|
|
220
|
+
case 'uniformGrid':
|
|
221
|
+
case 'scrollBox':
|
|
222
|
+
case 'namedSlot':
|
|
223
|
+
case 'widget': {
|
|
224
|
+
// Transparent / structural containers — only paint if they have a real fill/stroke.
|
|
225
|
+
const alpha = backgroundAlpha(layer.fill);
|
|
226
|
+
if (alpha < 0.001 && !layer.stroke)
|
|
227
|
+
return;
|
|
228
|
+
ctx.rect(x, y, w, h);
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
case 'border': {
|
|
232
|
+
const r = Math.min(layer.borderRadius ?? 12, w / 2, h / 2);
|
|
233
|
+
if (r > 0 && typeof ctx.roundRect === 'function')
|
|
234
|
+
ctx.roundRect(x, y, w, h, r);
|
|
235
|
+
else
|
|
236
|
+
ctx.rect(x, y, w, h);
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
default:
|
|
240
|
+
ctx.rect(x, y, w, h);
|
|
241
|
+
}
|
|
242
|
+
const fillAlpha = backgroundAlpha(layer.fill ?? fill);
|
|
243
|
+
if (fillAlpha >= 0.001) {
|
|
244
|
+
ctx.fillStyle = layer.fill ?? fill;
|
|
245
|
+
ctx.fill();
|
|
246
|
+
}
|
|
247
|
+
if (layer.stroke) {
|
|
248
|
+
ctx.strokeStyle = layer.stroke;
|
|
249
|
+
ctx.lineWidth = layer.strokeWidth ?? 2;
|
|
250
|
+
ctx.stroke();
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
function drawText(ctx, layer) {
|
|
254
|
+
const { x, y, w, h } = layer.rect;
|
|
255
|
+
if (layer.kind === 'sticky' || layer.textBackground) {
|
|
256
|
+
ctx.fillStyle = layer.kind === 'sticky' ? (layer.fill ?? '#fef08a') : layer.textBackground;
|
|
257
|
+
const r = layer.borderRadius ?? (layer.kind === 'sticky' ? 4 : 0);
|
|
258
|
+
ctx.beginPath();
|
|
259
|
+
if (r > 0 && typeof ctx.roundRect === 'function')
|
|
260
|
+
ctx.roundRect(x, y, w, h, r);
|
|
261
|
+
else
|
|
262
|
+
ctx.rect(x, y, w, h);
|
|
263
|
+
ctx.fill();
|
|
264
|
+
}
|
|
265
|
+
const size = layer.fontSize ?? 32;
|
|
266
|
+
const weight = layer.fontWeight ?? 600;
|
|
267
|
+
const style = layer.fontStyle ?? 'normal';
|
|
268
|
+
const family = layer.fontFamily ?? 'system-ui, sans-serif';
|
|
269
|
+
ctx.font = `${style} ${weight} ${size}px ${family}`;
|
|
270
|
+
ctx.fillStyle = layer.color ?? (layer.kind === 'sticky' ? '#713f12' : '#0f172a');
|
|
271
|
+
ctx.textBaseline = 'middle';
|
|
272
|
+
ctx.textAlign = layer.textAlign === 'center' ? 'center' : layer.textAlign === 'right' ? 'right' : 'left';
|
|
273
|
+
const pad = 8;
|
|
274
|
+
const tx = layer.textAlign === 'center' ? x + w / 2 : layer.textAlign === 'right' ? x + w - pad : x + pad;
|
|
275
|
+
const text = layer.text ?? (layer.kind === 'sticky' ? 'Note' : 'Text');
|
|
276
|
+
const lines = text.split('\n');
|
|
277
|
+
const lineHeight = size * (typeof layer.lineHeight === 'number' ? layer.lineHeight : 1.25);
|
|
278
|
+
const maxWidth = Math.max(16, w - pad * 2);
|
|
279
|
+
function wrapLine(line) {
|
|
280
|
+
if (!line)
|
|
281
|
+
return [''];
|
|
282
|
+
const words = line.split(/(\s+)/);
|
|
283
|
+
const out = [];
|
|
284
|
+
let cur = '';
|
|
285
|
+
for (const word of words) {
|
|
286
|
+
const trial = cur + word;
|
|
287
|
+
if (cur && ctx.measureText(trial).width > maxWidth) {
|
|
288
|
+
out.push(cur);
|
|
289
|
+
cur = word.trimStart();
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
cur = trial;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
if (cur)
|
|
296
|
+
out.push(cur);
|
|
297
|
+
return out.length ? out : [''];
|
|
298
|
+
}
|
|
299
|
+
const wrapped = lines.flatMap(wrapLine);
|
|
300
|
+
const blockH = wrapped.length * lineHeight;
|
|
301
|
+
let startY = layer.kind === 'sticky'
|
|
302
|
+
? y + pad + size / 2
|
|
303
|
+
: y + Math.max(size / 2, (h - blockH) / 2 + size / 2);
|
|
304
|
+
for (const line of wrapped) {
|
|
305
|
+
ctx.fillText(line, tx, startY);
|
|
306
|
+
if (layer.textDecoration === 'underline' || layer.textDecoration === 'line-through') {
|
|
307
|
+
const metrics = ctx.measureText(line);
|
|
308
|
+
const tw = metrics.width;
|
|
309
|
+
const left = layer.textAlign === 'center' ? tx - tw / 2 : layer.textAlign === 'right' ? tx - tw : tx;
|
|
310
|
+
ctx.beginPath();
|
|
311
|
+
ctx.strokeStyle = ctx.fillStyle;
|
|
312
|
+
ctx.lineWidth = Math.max(1, size / 16);
|
|
313
|
+
const lineY = layer.textDecoration === 'line-through' ? startY : startY + size * 0.4;
|
|
314
|
+
ctx.moveTo(left, lineY);
|
|
315
|
+
ctx.lineTo(left + tw, lineY);
|
|
316
|
+
ctx.stroke();
|
|
317
|
+
}
|
|
318
|
+
startY += lineHeight;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
async function drawLayer(ctx, layer, byId, absMap) {
|
|
322
|
+
if (!layer.visible || layer.opacity <= 0)
|
|
323
|
+
return;
|
|
324
|
+
ctx.save();
|
|
325
|
+
ctx.globalAlpha = layer.opacity;
|
|
326
|
+
const { x, y, w, h } = layer.rect;
|
|
327
|
+
const cx = x + w / 2;
|
|
328
|
+
const cy = y + h / 2;
|
|
329
|
+
applyAncestorRotations(ctx, layer, byId, absMap);
|
|
330
|
+
applyLayerTransform(ctx, layer, cx, cy);
|
|
331
|
+
if (layer.shadowBlur) {
|
|
332
|
+
ctx.shadowBlur = layer.shadowBlur;
|
|
333
|
+
ctx.shadowColor = layer.shadowColor ?? 'rgba(0,0,0,0.35)';
|
|
334
|
+
ctx.shadowOffsetY = Math.round(layer.shadowBlur / 3);
|
|
335
|
+
}
|
|
336
|
+
if (layer.blur) {
|
|
337
|
+
ctx.filter = `blur(${layer.blur}px)`;
|
|
338
|
+
}
|
|
339
|
+
if ((layer.kind === 'image' || layer.kind === 'video') && layer.src) {
|
|
340
|
+
try {
|
|
341
|
+
const img = await loadImage(layer.src);
|
|
342
|
+
const fit = layer.objectFit ?? 'cover';
|
|
343
|
+
if (layer.borderRadius) {
|
|
344
|
+
ctx.beginPath();
|
|
345
|
+
if (typeof ctx.roundRect === 'function') {
|
|
346
|
+
ctx.roundRect(x, y, w, h, layer.borderRadius);
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
ctx.rect(x, y, w, h);
|
|
350
|
+
}
|
|
351
|
+
ctx.clip();
|
|
352
|
+
}
|
|
353
|
+
if (fit === 'fill') {
|
|
354
|
+
ctx.drawImage(img, x, y, w, h);
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
const scale = fit === 'contain'
|
|
358
|
+
? Math.min(w / img.naturalWidth, h / img.naturalHeight)
|
|
359
|
+
: Math.max(w / img.naturalWidth, h / img.naturalHeight);
|
|
360
|
+
const dw = img.naturalWidth * scale;
|
|
361
|
+
const dh = img.naturalHeight * scale;
|
|
362
|
+
const dx = x + (w - dw) / 2;
|
|
363
|
+
const dy = y + (h - dh) / 2;
|
|
364
|
+
ctx.drawImage(img, dx, dy, dw, dh);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
catch {
|
|
368
|
+
ctx.fillStyle = '#e2e8f0';
|
|
369
|
+
ctx.fillRect(x, y, w, h);
|
|
370
|
+
ctx.fillStyle = '#64748b';
|
|
371
|
+
ctx.font = '14px system-ui';
|
|
372
|
+
ctx.textAlign = 'center';
|
|
373
|
+
ctx.textBaseline = 'middle';
|
|
374
|
+
ctx.fillText(layer.name || 'Media', x + w / 2, y + h / 2);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
else if (layer.kind === 'text' || layer.kind === 'sticky') {
|
|
378
|
+
drawText(ctx, layer);
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
drawShapePath(ctx, layer);
|
|
382
|
+
}
|
|
383
|
+
ctx.restore();
|
|
384
|
+
}
|
|
385
|
+
/** Parse CSS color alpha; `transparent` / missing → 0. */
|
|
386
|
+
export function backgroundAlpha(color) {
|
|
387
|
+
const raw = (color ?? '').trim().toLowerCase();
|
|
388
|
+
if (!raw || raw === 'transparent')
|
|
389
|
+
return 0;
|
|
390
|
+
if (raw.startsWith('#')) {
|
|
391
|
+
const hex = raw.slice(1);
|
|
392
|
+
if (hex.length === 4)
|
|
393
|
+
return parseInt(hex[3] + hex[3], 16) / 255;
|
|
394
|
+
if (hex.length === 8)
|
|
395
|
+
return parseInt(hex.slice(6, 8), 16) / 255;
|
|
396
|
+
return 1;
|
|
397
|
+
}
|
|
398
|
+
const m = raw.match(/^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+(?:\s*,\s*([\d.]+))?\s*\)$/);
|
|
399
|
+
if (m)
|
|
400
|
+
return m[1] !== undefined ? Number(m[1]) : 1;
|
|
401
|
+
const h = raw.match(/^hsla?\(\s*[\d.]+\s*,\s*[\d.]+%\s*,\s*[\d.]+%(?:\s*,\s*([\d.]+))?\s*\)$/);
|
|
402
|
+
if (h)
|
|
403
|
+
return h[1] !== undefined ? Number(h[1]) : 1;
|
|
404
|
+
return 1;
|
|
405
|
+
}
|
|
406
|
+
/** Renders the artboard at 1:1 document pixels into an offscreen canvas. */
|
|
407
|
+
export async function renderCanvasDocument(doc, opts) {
|
|
408
|
+
const canvas = document.createElement('canvas');
|
|
409
|
+
canvas.width = Math.max(1, Math.round(doc.width));
|
|
410
|
+
canvas.height = Math.max(1, Math.round(doc.height));
|
|
411
|
+
const ctx = canvas.getContext('2d');
|
|
412
|
+
if (!ctx)
|
|
413
|
+
throw new Error('Canvas 2D unavailable');
|
|
414
|
+
const bg = doc.background?.trim() || '#ffffff';
|
|
415
|
+
const alpha = backgroundAlpha(bg);
|
|
416
|
+
if (opts?.opaqueBackground || alpha > 0.001) {
|
|
417
|
+
ctx.fillStyle = opts?.opaqueBackground && alpha < 0.001 ? '#ffffff' : bg;
|
|
418
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
419
|
+
}
|
|
420
|
+
const flat = flattenLayersWithWidgets(doc.layers, doc.widgets ?? []);
|
|
421
|
+
const absMap = computeAbsoluteRects(flat, { width: doc.width, height: doc.height });
|
|
422
|
+
const byId = new Map(flat.map((l) => [l.id, l]));
|
|
423
|
+
const paintOrder = [];
|
|
424
|
+
const walk = (parentId) => {
|
|
425
|
+
const kids = flat
|
|
426
|
+
.filter((l) => (l.parentId ?? null) === parentId)
|
|
427
|
+
.sort((a, b) => a.zIndex - b.zIndex);
|
|
428
|
+
for (const k of kids) {
|
|
429
|
+
paintOrder.push(k);
|
|
430
|
+
walk(k.id);
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
walk(null);
|
|
434
|
+
for (const layer of paintOrder) {
|
|
435
|
+
if (!isEffectivelyVisible(flat, layer.id, byId))
|
|
436
|
+
continue;
|
|
437
|
+
const abs = absMap.get(layer.id) ?? layer.rect;
|
|
438
|
+
ctx.save();
|
|
439
|
+
if (layer.clipChildren) {
|
|
440
|
+
ctx.beginPath();
|
|
441
|
+
if (layer.borderRadius && typeof ctx.roundRect === 'function') {
|
|
442
|
+
ctx.roundRect(abs.x, abs.y, abs.w, abs.h, layer.borderRadius);
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
ctx.rect(abs.x, abs.y, abs.w, abs.h);
|
|
446
|
+
}
|
|
447
|
+
ctx.clip();
|
|
448
|
+
}
|
|
449
|
+
await drawLayer(ctx, { ...layer, rect: abs }, byId, absMap);
|
|
450
|
+
ctx.restore();
|
|
451
|
+
}
|
|
452
|
+
return canvas;
|
|
453
|
+
}
|
|
454
|
+
export async function exportCanvasBlob(doc, format = 'png', quality = 0.92) {
|
|
455
|
+
// JPEG has no alpha — force an opaque fill when the artboard is transparent.
|
|
456
|
+
const canvas = await renderCanvasDocument(doc, { opaqueBackground: format === 'jpeg' });
|
|
457
|
+
const mime = format === 'jpeg' ? 'image/jpeg' : 'image/png';
|
|
458
|
+
return new Promise((resolve, reject) => {
|
|
459
|
+
canvas.toBlob((blob) => (blob ? resolve(blob) : reject(new Error('Export failed'))), mime, quality);
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
export function downloadBlob(blob, filename) {
|
|
463
|
+
const url = URL.createObjectURL(blob);
|
|
464
|
+
const a = document.createElement('a');
|
|
465
|
+
a.href = url;
|
|
466
|
+
a.download = filename;
|
|
467
|
+
a.click();
|
|
468
|
+
URL.revokeObjectURL(url);
|
|
469
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { CanvasAnchors, CanvasDocument, CanvasLayer, CanvasLayerKind, CanvasLayerRect, CanvasSlot } from './canvasDocument.js';
|
|
2
|
+
export declare const CONTAINER_KINDS: ReadonlySet<CanvasLayerKind>;
|
|
3
|
+
export declare const LAYOUT_BOX_KINDS: ReadonlySet<CanvasLayerKind>;
|
|
4
|
+
/**
|
|
5
|
+
* Structural shells whose empty area should start a marquee (not a layer drag),
|
|
6
|
+
* matching Figma-style select-drag on the canvas / inside frames.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MARQUEE_PASS_KINDS: ReadonlySet<CanvasLayerKind>;
|
|
9
|
+
export declare function isContainerKind(kind: CanvasLayerKind): boolean;
|
|
10
|
+
export declare function isMarqueePassThroughKind(kind: CanvasLayerKind): boolean;
|
|
11
|
+
export declare function canHaveChildren(layer: CanvasLayer): boolean;
|
|
12
|
+
export declare function getChildren(layers: CanvasLayer[], parentId: string | null): CanvasLayer[];
|
|
13
|
+
export declare function getDescendantIds(layers: CanvasLayer[], rootId: string): string[];
|
|
14
|
+
export declare function getSubtreeIds(layers: CanvasLayer[], rootId: string): string[];
|
|
15
|
+
export declare function getAncestors(layers: CanvasLayer[], layerId: string): CanvasLayer[];
|
|
16
|
+
/** True when the layer and every ancestor is visible (flat stage paint must check this). */
|
|
17
|
+
export declare function isEffectivelyVisible(layers: CanvasLayer[], layerId: string, map?: Map<string, CanvasLayer>): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* CSS transform for a flat-stage layer so ancestor rotations orbit children
|
|
20
|
+
* around each ancestor's center (DOM is not nested).
|
|
21
|
+
* Uses transform-origin top-left (0 0) of the layer box.
|
|
22
|
+
*/
|
|
23
|
+
export declare function paintTransformForLayer(layers: CanvasLayer[], layerId: string, absMap: Map<string, CanvasLayerRect>, map?: Map<string, CanvasLayer>): string | undefined;
|
|
24
|
+
export declare function isDescendant(layers: CanvasLayer[], maybeChildId: string, ancestorId: string): boolean;
|
|
25
|
+
export declare function canReparent(layers: CanvasLayer[], layerId: string, newParentId: string | null): boolean;
|
|
26
|
+
export declare const ANCHOR_PRESETS: {
|
|
27
|
+
readonly topLeft: {
|
|
28
|
+
readonly minX: 0;
|
|
29
|
+
readonly minY: 0;
|
|
30
|
+
readonly maxX: 0;
|
|
31
|
+
readonly maxY: 0;
|
|
32
|
+
};
|
|
33
|
+
readonly topCenter: {
|
|
34
|
+
readonly minX: 0.5;
|
|
35
|
+
readonly minY: 0;
|
|
36
|
+
readonly maxX: 0.5;
|
|
37
|
+
readonly maxY: 0;
|
|
38
|
+
};
|
|
39
|
+
readonly topRight: {
|
|
40
|
+
readonly minX: 1;
|
|
41
|
+
readonly minY: 0;
|
|
42
|
+
readonly maxX: 1;
|
|
43
|
+
readonly maxY: 0;
|
|
44
|
+
};
|
|
45
|
+
readonly centerLeft: {
|
|
46
|
+
readonly minX: 0;
|
|
47
|
+
readonly minY: 0.5;
|
|
48
|
+
readonly maxX: 0;
|
|
49
|
+
readonly maxY: 0.5;
|
|
50
|
+
};
|
|
51
|
+
readonly center: {
|
|
52
|
+
readonly minX: 0.5;
|
|
53
|
+
readonly minY: 0.5;
|
|
54
|
+
readonly maxX: 0.5;
|
|
55
|
+
readonly maxY: 0.5;
|
|
56
|
+
};
|
|
57
|
+
readonly centerRight: {
|
|
58
|
+
readonly minX: 1;
|
|
59
|
+
readonly minY: 0.5;
|
|
60
|
+
readonly maxX: 1;
|
|
61
|
+
readonly maxY: 0.5;
|
|
62
|
+
};
|
|
63
|
+
readonly bottomLeft: {
|
|
64
|
+
readonly minX: 0;
|
|
65
|
+
readonly minY: 1;
|
|
66
|
+
readonly maxX: 0;
|
|
67
|
+
readonly maxY: 1;
|
|
68
|
+
};
|
|
69
|
+
readonly bottomCenter: {
|
|
70
|
+
readonly minX: 0.5;
|
|
71
|
+
readonly minY: 1;
|
|
72
|
+
readonly maxX: 0.5;
|
|
73
|
+
readonly maxY: 1;
|
|
74
|
+
};
|
|
75
|
+
readonly bottomRight: {
|
|
76
|
+
readonly minX: 1;
|
|
77
|
+
readonly minY: 1;
|
|
78
|
+
readonly maxX: 1;
|
|
79
|
+
readonly maxY: 1;
|
|
80
|
+
};
|
|
81
|
+
readonly stretch: {
|
|
82
|
+
readonly minX: 0;
|
|
83
|
+
readonly minY: 0;
|
|
84
|
+
readonly maxX: 1;
|
|
85
|
+
readonly maxY: 1;
|
|
86
|
+
};
|
|
87
|
+
readonly stretchHorizontal: {
|
|
88
|
+
readonly minX: 0;
|
|
89
|
+
readonly minY: 0;
|
|
90
|
+
readonly maxX: 1;
|
|
91
|
+
readonly maxY: 0;
|
|
92
|
+
};
|
|
93
|
+
readonly stretchVertical: {
|
|
94
|
+
readonly minX: 0;
|
|
95
|
+
readonly minY: 0;
|
|
96
|
+
readonly maxX: 0;
|
|
97
|
+
readonly maxY: 1;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
/** Resolve UMG slot against parent content size → local rect. */
|
|
101
|
+
export declare function resolveSlotRect(parentSize: {
|
|
102
|
+
width: number;
|
|
103
|
+
height: number;
|
|
104
|
+
}, slot: CanvasSlot): CanvasLayerRect;
|
|
105
|
+
/** Build slot offsets from a local rect + anchors (keeps anchors, recomputes offsets). */
|
|
106
|
+
export declare function slotFromLocalRect(parentSize: {
|
|
107
|
+
width: number;
|
|
108
|
+
height: number;
|
|
109
|
+
}, rect: CanvasLayerRect, anchors?: CanvasAnchors): CanvasSlot;
|
|
110
|
+
export declare function contentPadding(layer: CanvasLayer): {
|
|
111
|
+
left: number;
|
|
112
|
+
top: number;
|
|
113
|
+
right: number;
|
|
114
|
+
bottom: number;
|
|
115
|
+
};
|
|
116
|
+
export declare function contentSize(layerRect: CanvasLayerRect, layer: CanvasLayer): {
|
|
117
|
+
width: number;
|
|
118
|
+
height: number;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Compute absolute (document) rect for every layer via parent walk + layout boxes.
|
|
122
|
+
* Returns map layerId → absolute rect.
|
|
123
|
+
*/
|
|
124
|
+
export declare function computeAbsoluteRects(layers: CanvasLayer[], rootSize: {
|
|
125
|
+
width: number;
|
|
126
|
+
height: number;
|
|
127
|
+
}): Map<string, CanvasLayerRect>;
|
|
128
|
+
export declare function absoluteRectFor(layerId: string, layers: CanvasLayer[], rootSize: {
|
|
129
|
+
width: number;
|
|
130
|
+
height: number;
|
|
131
|
+
}): CanvasLayerRect | null;
|
|
132
|
+
/**
|
|
133
|
+
* CSS clip-path inset for a child absolute rect clipped by ancestors with clipChildren.
|
|
134
|
+
* Values are relative to the child's own box.
|
|
135
|
+
* `scrollBox` always clips (UMG-style viewport).
|
|
136
|
+
*/
|
|
137
|
+
export declare function clipPathForLayer(layerId: string, layers: CanvasLayer[], absMap: Map<string, CanvasLayerRect>): string | undefined;
|
|
138
|
+
/** Scrollbar thumb size/position for a scrollBox viewport (preview chrome). */
|
|
139
|
+
export declare function scrollBarMetrics(viewport: number, maxScroll: number, offset: number): {
|
|
140
|
+
thumb: number;
|
|
141
|
+
offset: number;
|
|
142
|
+
track: number;
|
|
143
|
+
} | null;
|
|
144
|
+
/** Max scrollable overflow of a scrollBox (content extent beyond the viewport). */
|
|
145
|
+
export declare function scrollBoxOverflow(scrollBoxId: string, layers: CanvasLayer[], absMap: Map<string, CanvasLayerRect>): {
|
|
146
|
+
maxX: number;
|
|
147
|
+
maxY: number;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Shift descendants of scrollBoxes by ephemeral scroll offsets (preview only).
|
|
151
|
+
* ScrollBox frames themselves stay put.
|
|
152
|
+
*/
|
|
153
|
+
export declare function applyScrollBoxOffsets(layers: CanvasLayer[], absMap: Map<string, CanvasLayerRect>, offsets: ReadonlyMap<string, {
|
|
154
|
+
x: number;
|
|
155
|
+
y: number;
|
|
156
|
+
}>): Map<string, CanvasLayerRect>;
|
|
157
|
+
export declare function reparentLayer(layers: CanvasLayer[], layerId: string, newParentId: string | null, rootSize: {
|
|
158
|
+
width: number;
|
|
159
|
+
height: number;
|
|
160
|
+
}): CanvasLayer[];
|
|
161
|
+
export declare function wrapSelection(doc: CanvasDocument, selectedIds: string[], wrapKind?: CanvasLayerKind): {
|
|
162
|
+
doc: CanvasDocument;
|
|
163
|
+
wrapperId: string;
|
|
164
|
+
} | null;
|
|
165
|
+
export declare function groupLayers(doc: CanvasDocument, selectedIds: string[]): {
|
|
166
|
+
doc: CanvasDocument;
|
|
167
|
+
wrapperId: string;
|
|
168
|
+
} | null;
|
|
169
|
+
export declare function ungroupLayers(doc: CanvasDocument, groupId: string): CanvasDocument;
|
|
170
|
+
/** Delete layer and all descendants. */
|
|
171
|
+
export declare function deleteSubtree(doc: CanvasDocument, ids: string[]): CanvasDocument;
|
|
172
|
+
/** Duplicate subtree with new ids; keeps relative hierarchy. */
|
|
173
|
+
export declare function duplicateSubtree(doc: CanvasDocument, rootIds: string[], offset?: {
|
|
174
|
+
x: number;
|
|
175
|
+
y: number;
|
|
176
|
+
}): {
|
|
177
|
+
doc: CanvasDocument;
|
|
178
|
+
newIds: string[];
|
|
179
|
+
};
|
|
180
|
+
export declare function reorderSiblings(layers: CanvasLayer[], parentId: string | null, orderedChildIds: string[]): CanvasLayer[];
|
|
181
|
+
/** Sync layer.rect from its slot given parent size (for editors that edit rect). */
|
|
182
|
+
export declare function syncRectFromSlot(layer: CanvasLayer, parentSize: {
|
|
183
|
+
width: number;
|
|
184
|
+
height: number;
|
|
185
|
+
}): CanvasLayer;
|
|
186
|
+
export declare function syncSlotFromRect(layer: CanvasLayer, parentSize: {
|
|
187
|
+
width: number;
|
|
188
|
+
height: number;
|
|
189
|
+
}): CanvasLayer;
|