@snowcone-app/canvas 0.1.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/LICENSE.txt +70 -0
- package/README.md +357 -0
- package/dist/CanvasStateV1-D5GzvmnY.cjs +65 -0
- package/dist/CanvasStateV1-D5GzvmnY.cjs.map +1 -0
- package/dist/CanvasStateV1-ejb4d_LM.js +3692 -0
- package/dist/CanvasStateV1-ejb4d_LM.js.map +1 -0
- package/dist/ElementFactory-B7UOaJSD.cjs +23865 -0
- package/dist/ElementFactory-B7UOaJSD.cjs.map +1 -0
- package/dist/ElementFactory-uJTXU-nP.js +29615 -0
- package/dist/ElementFactory-uJTXU-nP.js.map +1 -0
- package/dist/HybridHistoryManager-BV6XV0nD.js +8048 -0
- package/dist/HybridHistoryManager-BV6XV0nD.js.map +1 -0
- package/dist/HybridHistoryManager-BXD93pp8.cjs +8 -0
- package/dist/HybridHistoryManager-BXD93pp8.cjs.map +1 -0
- package/dist/ImportManager-BYwuK6n4.cjs +2 -0
- package/dist/ImportManager-BYwuK6n4.cjs.map +1 -0
- package/dist/ImportManager-CxiaRg1N.js +222 -0
- package/dist/ImportManager-CxiaRg1N.js.map +1 -0
- package/dist/ThemeContext-4mJ_y0Me.cjs +2 -0
- package/dist/ThemeContext-4mJ_y0Me.cjs.map +1 -0
- package/dist/ThemeContext-H0Z-MqqR.js +1077 -0
- package/dist/ThemeContext-H0Z-MqqR.js.map +1 -0
- package/dist/advanced.d.ts +2 -0
- package/dist/advanced.js +48 -0
- package/dist/advanced.js.map +1 -0
- package/dist/advanced.mjs +15679 -0
- package/dist/advanced.mjs.map +1 -0
- package/dist/api/advanced.d.ts +110 -0
- package/dist/api/internals.d.ts +39 -0
- package/dist/api/stable.d.ts +44 -0
- package/dist/api/testing.d.ts +25 -0
- package/dist/browser-module-D0gHY9rY.cjs +9 -0
- package/dist/browser-module-D0gHY9rY.cjs.map +1 -0
- package/dist/browser-module-DFvKXBUE.js +15474 -0
- package/dist/browser-module-DFvKXBUE.js.map +1 -0
- package/dist/components/ArtboardDistressPanel.d.ts +7 -0
- package/dist/components/ArtboardImageMaskPanel.d.ts +7 -0
- package/dist/components/ArtboardPropertiesToolbar.d.ts +19 -0
- package/dist/components/ArtboardToolbar.d.ts +10 -0
- package/dist/components/BackButton.d.ts +7 -0
- package/dist/components/BackgroundPickerDropdown.d.ts +11 -0
- package/dist/components/BackgroundSwitcher.d.ts +7 -0
- package/dist/components/CanvasA11yFallback.d.ts +62 -0
- package/dist/components/CanvasEditor/CanvasRendererComponent.d.ts +51 -0
- package/dist/components/CanvasEditor/handlers/cropModeHandlers.d.ts +114 -0
- package/dist/components/CanvasEditor/handlers/groupChildHandlers.d.ts +65 -0
- package/dist/components/CanvasEditor/handlers/index.d.ts +10 -0
- package/dist/components/CanvasEditor/handlers/multiSelectionHandlers.d.ts +86 -0
- package/dist/components/CanvasEditor/hooks/buildSpreadClipShape.d.ts +20 -0
- package/dist/components/CanvasEditor/hooks/index.d.ts +24 -0
- package/dist/components/CanvasEditor/hooks/useActiveChild.d.ts +23 -0
- package/dist/components/CanvasEditor/hooks/useAnimatedFocusRect.d.ts +17 -0
- package/dist/components/CanvasEditor/hooks/useCanvasInteraction.d.ts +284 -0
- package/dist/components/CanvasEditor/hooks/useCanvasLayout.d.ts +50 -0
- package/dist/components/CanvasEditor/hooks/useCanvasRenderLoop.d.ts +140 -0
- package/dist/components/CanvasEditor/hooks/useCropMode.d.ts +4 -0
- package/dist/components/CanvasEditor/hooks/useHoverState.d.ts +9 -0
- package/dist/components/CanvasEditor/hooks/useInteractionState.d.ts +23 -0
- package/dist/components/CanvasEditor/hooks/useKeyboardHandlers.d.ts +16 -0
- package/dist/components/CanvasEditor/hooks/useMarqueeSelection.d.ts +22 -0
- package/dist/components/CanvasEditor/hooks/useMultiSelection.d.ts +5 -0
- package/dist/components/CanvasEditor/hooks/usePenTool.d.ts +10 -0
- package/dist/components/CanvasEditor/hooks/useRenderState.d.ts +31 -0
- package/dist/components/CanvasEditor/hooks/useSnapAndSpacing.d.ts +42 -0
- package/dist/components/CanvasEditor/hooks/useTextEditing.d.ts +56 -0
- package/dist/components/CanvasEditor/hooks/useTextEditingHandlers.d.ts +75 -0
- package/dist/components/CanvasEditor/renderers/hoverRenderer.d.ts +12 -0
- package/dist/components/CanvasEditor/renderers/index.d.ts +10 -0
- package/dist/components/CanvasEditor/renderers/marqueeRenderer.d.ts +21 -0
- package/dist/components/CanvasEditor/renderers/multiSelectionRenderer.d.ts +52 -0
- package/dist/components/CanvasEditor/renderers/renderingConstants.d.ts +59 -0
- package/dist/components/CanvasEditor/types/index.d.ts +11 -0
- package/dist/components/CanvasEditor.d.ts +102 -0
- package/dist/components/ColorPickerDropdown.d.ts +29 -0
- package/dist/components/CompositingPanel.d.ts +8 -0
- package/dist/components/ContextualToolbars.d.ts +150 -0
- package/dist/components/CropPanel.d.ts +20 -0
- package/dist/components/DistressPanel.d.ts +7 -0
- package/dist/components/DocsPage.d.ts +6 -0
- package/dist/components/Drawer.d.ts +39 -0
- package/dist/components/EffectsPanel.d.ts +14 -0
- package/dist/components/ExportTestPanel.d.ts +16 -0
- package/dist/components/FontBrowserDrawer.d.ts +20 -0
- package/dist/components/FontSizeDropdown.d.ts +12 -0
- package/dist/components/GlyphBrowserDrawer.d.ts +13 -0
- package/dist/components/GlyphPicker.d.ts +14 -0
- package/dist/components/IconMatchTest.d.ts +3 -0
- package/dist/components/IconSizeTest.d.ts +3 -0
- package/dist/components/ImageBrowserDrawer.d.ts +27 -0
- package/dist/components/ImageToolbar.d.ts +47 -0
- package/dist/components/LayerEffects.d.ts +11 -0
- package/dist/components/LayerLeadingChip.d.ts +9 -0
- package/dist/components/LayersPanel.d.ts +30 -0
- package/dist/components/MaskItem.d.ts +12 -0
- package/dist/components/MasksPanel.d.ts +7 -0
- package/dist/components/MonotypeDemoPage.d.ts +2 -0
- package/dist/components/MoreMenu.d.ts +15 -0
- package/dist/components/OpenTypeFeaturesPanel.d.ts +12 -0
- package/dist/components/PathToolbar.d.ts +10 -0
- package/dist/components/PenToolDemo.d.ts +3 -0
- package/dist/components/ProgressiveBlur.d.ts +25 -0
- package/dist/components/RotationHandle.d.ts +47 -0
- package/dist/components/SaveLoadMenu.d.ts +15 -0
- package/dist/components/ShapeToolbar.d.ts +71 -0
- package/dist/components/ShapeTypeDrawer.d.ts +10 -0
- package/dist/components/StrokePanel.d.ts +7 -0
- package/dist/components/TailwindDemo.d.ts +3 -0
- package/dist/components/TextEffectsDropdown.d.ts +14 -0
- package/dist/components/TextToolbar.d.ts +47 -0
- package/dist/components/TextTypeDrawer.d.ts +8 -0
- package/dist/components/ThemeToggle.d.ts +2 -0
- package/dist/components/TransformControlPanel.d.ts +12 -0
- package/dist/components/VisualGuideOverlay.d.ts +156 -0
- package/dist/components/embed/ArtboardTabs.d.ts +74 -0
- package/dist/components/embed/Canvas.d.ts +72 -0
- package/dist/components/embed/EffectsPanel.d.ts +76 -0
- package/dist/components/embed/ErrorBoundary.d.ts +34 -0
- package/dist/components/embed/ExportPanel.d.ts +51 -0
- package/dist/components/embed/GlyphPanel.d.ts +70 -0
- package/dist/components/embed/ImagePanel.d.ts +58 -0
- package/dist/components/embed/LayersPanel.d.ts +13 -0
- package/dist/components/embed/LoadingStates.d.ts +32 -0
- package/dist/components/embed/MenuButton.d.ts +47 -0
- package/dist/components/embed/SnowconeCanvas.d.ts +844 -0
- package/dist/components/embed/ZoomControls.d.ts +16 -0
- package/dist/components/embed/index.d.ts +129 -0
- package/dist/components/embed/primitives/index.d.ts +42 -0
- package/dist/components/embed/ui/index.d.ts +52 -0
- package/dist/components/embed/utils/index.d.ts +31 -0
- package/dist/components/embedded/ArtboardEmbed.d.ts +70 -0
- package/dist/components/embedded/MerchifyThemeWrapper.d.ts +30 -0
- package/dist/components/embedded/ProductPreviewCard.d.ts +8 -0
- package/dist/components/embedded/index.d.ts +7 -0
- package/dist/components/primitives/ButtonGroup.d.ts +27 -0
- package/dist/components/primitives/ControlGroup.d.ts +15 -0
- package/dist/components/primitives/Dropdown.d.ts +27 -0
- package/dist/components/primitives/DropdownMenu.d.ts +9 -0
- package/dist/components/primitives/MenuItem.d.ts +13 -0
- package/dist/components/primitives/Panel.d.ts +25 -0
- package/dist/components/primitives/SecondaryToolbar.d.ts +9 -0
- package/dist/components/primitives/Switch.d.ts +10 -0
- package/dist/components/primitives/Toggle.d.ts +17 -0
- package/dist/components/primitives/index.d.ts +22 -0
- package/dist/components/stories/utils/MockEditorProvider.d.ts +32 -0
- package/dist/components/stories/utils/QACanvasCard.d.ts +41 -0
- package/dist/components/stories/utils/VisualQACard.d.ts +24 -0
- package/dist/components/stories/utils/element-factories.d.ts +188 -0
- package/dist/components/stories/utils/spec-to-elements.d.ts +74 -0
- package/dist/components/stories/utils/themeDecorator.d.ts +45 -0
- package/dist/components/stories/utils/unified-test-cases.d.ts +27 -0
- package/dist/components/text-toolbar/BoldButton.d.ts +5 -0
- package/dist/components/text-toolbar/FontColorButton.d.ts +6 -0
- package/dist/components/text-toolbar/FontSizeGroup.d.ts +5 -0
- package/dist/components/text-toolbar/ItalicButton.d.ts +5 -0
- package/dist/components/text-toolbar/TextAlignButton.d.ts +5 -0
- package/dist/components/text-toolbar/TextMoreMenu.d.ts +7 -0
- package/dist/components/text-toolbar/UnderlineButton.d.ts +5 -0
- package/dist/components/text-toolbar/UppercaseButton.d.ts +5 -0
- package/dist/components/text-toolbar/index.d.ts +25 -0
- package/dist/components/toolbars/EmbeddedToolbarLayout.d.ts +49 -0
- package/dist/components/toolbars/ExpandedPanelIcon.d.ts +13 -0
- package/dist/components/toolbars/FloatingPanels.d.ts +23 -0
- package/dist/components/toolbars/GroupElementToolbar.d.ts +35 -0
- package/dist/components/toolbars/SecondaryPanels.d.ts +125 -0
- package/dist/components/toolbars/index.d.ts +18 -0
- package/dist/components/toolbars/shared/ColorPanelWrapper.d.ts +9 -0
- package/dist/components/toolbars/shared/SecondaryPanelWrapper.d.ts +9 -0
- package/dist/components/ui/PresetCarousel.d.ts +21 -0
- package/dist/components/ui/SecondaryPanel.d.ts +28 -0
- package/dist/components/ui/SliderRow.d.ts +30 -0
- package/dist/components/ui/collapsed-toolbar-header.d.ts +14 -0
- package/dist/components/ui/custom-icons.d.ts +25 -0
- package/dist/components/ui/icons.d.ts +100 -0
- package/dist/components/ui/index.d.ts +48 -0
- package/dist/components/ui/normalized-icon.d.ts +63 -0
- package/dist/components/ui/toolbar-button.d.ts +24 -0
- package/dist/compose-Bo108juW.cjs +33 -0
- package/dist/compose-Bo108juW.cjs.map +1 -0
- package/dist/compose-DQ1FZS3O.js +7690 -0
- package/dist/compose-DQ1FZS3O.js.map +1 -0
- package/dist/constants.d.ts +121 -0
- package/dist/contexts/CommandContext.d.ts +87 -0
- package/dist/contexts/EditorContext.d.ts +190 -0
- package/dist/contexts/ElementsContext.d.ts +104 -0
- package/dist/contexts/HistoryContext.d.ts +60 -0
- package/dist/contexts/KitContext.d.ts +50 -0
- package/dist/contexts/SelectionContext.d.ts +51 -0
- package/dist/contexts/ThemeContext.d.ts +55 -0
- package/dist/contexts/ToolStateContext.d.ts +60 -0
- package/dist/contexts/ViewportContext.d.ts +87 -0
- package/dist/core/AlignmentSnapSystem.d.ts +270 -0
- package/dist/core/ArtboardElement.d.ts +106 -0
- package/dist/core/ArtboardManager.d.ts +130 -0
- package/dist/core/ArtboardRenderer.d.ts +97 -0
- package/dist/core/BaseElement.d.ts +94 -0
- package/dist/core/CanvasRenderer.d.ts +237 -0
- package/dist/core/CommandHistory.d.ts +173 -0
- package/dist/core/CoordinateTransform.d.ts +69 -0
- package/dist/core/CropModeController.d.ts +90 -0
- package/dist/core/EditModeRenderer.d.ts +51 -0
- package/dist/core/ElementFactory.d.ts +73 -0
- package/dist/core/ElementStore.d.ts +69 -0
- package/dist/core/EventBus.d.ts +163 -0
- package/dist/core/GeometryUtils.d.ts +247 -0
- package/dist/core/GroupElement.d.ts +134 -0
- package/dist/core/HoverRenderer.d.ts +103 -0
- package/dist/core/HybridHistoryManager.d.ts +137 -0
- package/dist/core/ImageCache.d.ts +63 -0
- package/dist/core/ImageElement.d.ts +226 -0
- package/dist/core/ImageLoadEvents.d.ts +23 -0
- package/dist/core/InteractionFeedbackRenderer.d.ts +15 -0
- package/dist/core/InteractionStateMachine.d.ts +199 -0
- package/dist/core/PathElement.d.ts +84 -0
- package/dist/core/PenToolManager.d.ts +112 -0
- package/dist/core/PinchHandler.d.ts +32 -0
- package/dist/core/ResizeHandler.d.ts +51 -0
- package/dist/core/ResizePipeline.d.ts +83 -0
- package/dist/core/ResizeUtils.d.ts +17 -0
- package/dist/core/RotationAnchorResolver.d.ts +60 -0
- package/dist/core/RotationUtils.d.ts +28 -0
- package/dist/core/SelectionRenderer.d.ts +24 -0
- package/dist/core/ShapeElement.d.ts +121 -0
- package/dist/core/SpacingSystem.d.ts +73 -0
- package/dist/core/SpatialGrid.d.ts +53 -0
- package/dist/core/TextElement.d.ts +80 -0
- package/dist/core/TextMetrics.d.ts +117 -0
- package/dist/core/Transform.d.ts +158 -0
- package/dist/core/TransformConverter.d.ts +16 -0
- package/dist/core/TransformHandles.d.ts +55 -0
- package/dist/core/artboardReducer.d.ts +46 -0
- package/dist/effects/DistressGenerator.d.ts +26 -0
- package/dist/effects/DistressTextureCache.d.ts +49 -0
- package/dist/effects/distress-presets.d.ts +86 -0
- package/dist/effects/distress-textures.d.ts +34 -0
- package/dist/effects/distress-utils.d.ts +39 -0
- package/dist/effects/mask-presets.d.ts +36 -0
- package/dist/fonts/google-fonts.d.ts +48 -0
- package/dist/google-fonts.json +1 -0
- package/dist/hooks/index.d.ts +42 -0
- package/dist/hooks/useArtboards.d.ts +71 -0
- package/dist/hooks/useAutoExport.d.ts +66 -0
- package/dist/hooks/useBreakpoint.d.ts +53 -0
- package/dist/hooks/useCanvasEvents.d.ts +8 -0
- package/dist/hooks/useCanvasReady.d.ts +22 -0
- package/dist/hooks/useClickOutside.d.ts +3 -0
- package/dist/hooks/useCommandHistory.d.ts +39 -0
- package/dist/hooks/useCommands.d.ts +47 -0
- package/dist/hooks/useContentReady.d.ts +18 -0
- package/dist/hooks/useElementById.d.ts +20 -0
- package/dist/hooks/useElementByName.d.ts +10 -0
- package/dist/hooks/useElementProperties.d.ts +29 -0
- package/dist/hooks/useExport.d.ts +89 -0
- package/dist/hooks/useImageBinding.d.ts +34 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts +13 -0
- package/dist/hooks/useLayerDndKit.d.ts +24 -0
- package/dist/hooks/useLayerDragDrop.d.ts +58 -0
- package/dist/hooks/useLayerPreview.d.ts +31 -0
- package/dist/hooks/useLayerSelection.d.ts +76 -0
- package/dist/hooks/useLayers.d.ts +91 -0
- package/dist/hooks/usePerformance.d.ts +48 -0
- package/dist/hooks/useProjectLoader.d.ts +64 -0
- package/dist/hooks/useSelectedElement.d.ts +17 -0
- package/dist/hooks/useTextBinding.d.ts +26 -0
- package/dist/hooks/useTextToolbar.d.ts +61 -0
- package/dist/hooks/useViewport.d.ts +46 -0
- package/dist/icons/icon-data.d.ts +2 -0
- package/dist/icons/registry.d.ts +28 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1138 -0
- package/dist/index.mjs.map +1 -0
- package/dist/internals.d.ts +2 -0
- package/dist/internals.js +2 -0
- package/dist/internals.js.map +1 -0
- package/dist/internals.mjs +219 -0
- package/dist/internals.mjs.map +1 -0
- package/dist/kits/compose.d.ts +69 -0
- package/dist/kits/index.d.ts +21 -0
- package/dist/kits/presets.d.ts +40 -0
- package/dist/kits/registry.d.ts +33 -0
- package/dist/kits/sections.d.ts +119 -0
- package/dist/kits/serialization.d.ts +78 -0
- package/dist/kits/types.d.ts +129 -0
- package/dist/kits/validation.d.ts +36 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/plugins/ElementTypePlugin.d.ts +90 -0
- package/dist/presets/artboard-color-presets.d.ts +22 -0
- package/dist/presets/tshirt-presets.d.ts +60 -0
- package/dist/rendering/CompositingRenderer.d.ts +33 -0
- package/dist/rendering/DistressTextureRenderer.d.ts +39 -0
- package/dist/rendering/ElementRenderUtils.d.ts +17 -0
- package/dist/rendering/MaskRenderer.d.ts +41 -0
- package/dist/rendering/PieceGuideRenderer.d.ts +177 -0
- package/dist/rendering/StrokeRenderer.d.ts +24 -0
- package/dist/rendering/canvas-renderer.d.ts +18 -0
- package/dist/rendering/element-serializer.d.ts +143 -0
- package/dist/rendering/image-renderer.d.ts +6 -0
- package/dist/rendering/knockout-utils.d.ts +48 -0
- package/dist/rendering/mask-utils.d.ts +65 -0
- package/dist/rendering/renderer-types.d.ts +79 -0
- package/dist/rendering/rich-text-renderer.d.ts +43 -0
- package/dist/rendering/serialize-for-server.d.ts +45 -0
- package/dist/rendering/shape-renderer.d.ts +6 -0
- package/dist/rendering/stroke-utils.d.ts +18 -0
- package/dist/rendering/text-renderer.d.ts +71 -0
- package/dist/rendering/transform-renderer.d.ts +33 -0
- package/dist/services/AutoExportManager.d.ts +107 -0
- package/dist/services/falApi.d.ts +63 -0
- package/dist/services/nounProjectApi.d.ts +90 -0
- package/dist/services/recraftApi.d.ts +65 -0
- package/dist/services/runwareApi.d.ts +69 -0
- package/dist/state/CanvasStateV1.d.ts +373 -0
- package/dist/state/index.d.ts +10 -0
- package/dist/style.css +1 -0
- package/dist/taco-reference-cropped.jpg +0 -0
- package/dist/testing/MockEditorProvider.d.ts +49 -0
- package/dist/testing/index.d.ts +25 -0
- package/dist/testing/utils.d.ts +128 -0
- package/dist/testing.d.ts +2 -0
- package/dist/testing.js +2 -0
- package/dist/testing.js.map +1 -0
- package/dist/testing.mjs +140 -0
- package/dist/testing.mjs.map +1 -0
- package/dist/textures/glass-frame.svg +32 -0
- package/dist/theme.d.ts +99 -0
- package/dist/themes/index.d.ts +23 -0
- package/dist/transforms/ArchTransform.d.ts +14 -0
- package/dist/transforms/AscendTransform.d.ts +14 -0
- package/dist/transforms/CircleTransform.d.ts +51 -0
- package/dist/transforms/CustomTransform.d.ts +81 -0
- package/dist/transforms/FlagTransform.d.ts +14 -0
- package/dist/transforms/LeanTransform.d.ts +14 -0
- package/dist/transforms/WaveTransform.d.ts +16 -0
- package/dist/transforms/defaults.d.ts +33 -0
- package/dist/transforms/index.d.ts +10 -0
- package/dist/transforms/registry.d.ts +51 -0
- package/dist/types/capabilities.d.ts +50 -0
- package/dist/types/guards.d.ts +31 -0
- package/dist/types/index.d.ts +765 -0
- package/dist/types/public.d.ts +31 -0
- package/dist/types/react.d.ts +132 -0
- package/dist/utils/ArtworkPlacement.d.ts +97 -0
- package/dist/utils/ElementPreviewRenderer.d.ts +19 -0
- package/dist/utils/ExportManager.d.ts +208 -0
- package/dist/utils/FontAnalyzer.d.ts +137 -0
- package/dist/utils/GlyphRenderer.d.ts +55 -0
- package/dist/utils/GoogleFontsService.d.ts +37 -0
- package/dist/utils/ImageLoader.d.ts +124 -0
- package/dist/utils/ImportManager.d.ts +72 -0
- package/dist/utils/MonotypeCategoryMapping.d.ts +36 -0
- package/dist/utils/MonotypeService.d.ts +148 -0
- package/dist/utils/PerformanceMonitor.d.ts +54 -0
- package/dist/utils/TextureManager.d.ts +60 -0
- package/dist/utils/UnifiedFontService.d.ts +117 -0
- package/dist/utils/WorkerExportManager.d.ts +185 -0
- package/dist/utils/clickProtection.d.ts +39 -0
- package/dist/utils/cn.d.ts +4 -0
- package/dist/utils/colorConversion.d.ts +101 -0
- package/dist/utils/documentColors.d.ts +108 -0
- package/dist/utils/featureApplied.d.ts +14 -0
- package/dist/utils/google-fonts-loader.d.ts +67 -0
- package/dist/utils/logger.d.ts +66 -0
- package/dist/utils/selectionPreservation.d.ts +42 -0
- package/dist/utils/textCursorUtils.d.ts +39 -0
- package/dist/utils/textUtils.d.ts +11 -0
- package/dist/workers/export-protocol.d.ts +119 -0
- package/dist/workers/export-worker.bundle.string.d.ts +2 -0
- package/dist/workers/export-worker.d.ts +5 -0
- package/package.json +201 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ArtboardManager } from '../core/ArtboardManager.js';
|
|
3
|
+
import { ArtboardElement } from '../core/ArtboardElement.js';
|
|
4
|
+
import { BaseElement } from '../core/BaseElement.js';
|
|
5
|
+
declare const StrokeConfigSchema: z.ZodObject<{
|
|
6
|
+
enabled: z.ZodBoolean;
|
|
7
|
+
color: z.ZodString;
|
|
8
|
+
width: z.ZodNumber;
|
|
9
|
+
dashArray: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
10
|
+
lineCap: z.ZodOptional<z.ZodEnum<{
|
|
11
|
+
butt: "butt";
|
|
12
|
+
round: "round";
|
|
13
|
+
square: "square";
|
|
14
|
+
}>>;
|
|
15
|
+
lineJoin: z.ZodOptional<z.ZodEnum<{
|
|
16
|
+
round: "round";
|
|
17
|
+
miter: "miter";
|
|
18
|
+
bevel: "bevel";
|
|
19
|
+
}>>;
|
|
20
|
+
miterLimit: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
feather: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
declare const KnockoutConfigSchema: z.ZodObject<{
|
|
25
|
+
fill: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
stroke: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
scope: z.ZodOptional<z.ZodEnum<{
|
|
28
|
+
group: "group";
|
|
29
|
+
artboard: "artboard";
|
|
30
|
+
}>>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
declare const DistressEffectSchema: z.ZodObject<{
|
|
33
|
+
enabled: z.ZodBoolean;
|
|
34
|
+
style: z.ZodEnum<{
|
|
35
|
+
custom: "custom";
|
|
36
|
+
worn: "worn";
|
|
37
|
+
cracked: "cracked";
|
|
38
|
+
grunge: "grunge";
|
|
39
|
+
retro: "retro";
|
|
40
|
+
}>;
|
|
41
|
+
intensity: z.ZodNumber;
|
|
42
|
+
fadeAmount: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
grainAmount: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
scratchAmount: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
edgeWear: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
textureUrl: z.ZodOptional<z.ZodString>;
|
|
47
|
+
textureOpacity: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
textureBlendMode: z.ZodOptional<z.ZodEnum<{
|
|
49
|
+
multiply: "multiply";
|
|
50
|
+
screen: "screen";
|
|
51
|
+
overlay: "overlay";
|
|
52
|
+
}>>;
|
|
53
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
declare const MaskDefinitionSchema: z.ZodObject<{
|
|
56
|
+
id: z.ZodString;
|
|
57
|
+
type: z.ZodEnum<{
|
|
58
|
+
clip: "clip";
|
|
59
|
+
alpha: "alpha";
|
|
60
|
+
luma: "luma";
|
|
61
|
+
distress: "distress";
|
|
62
|
+
}>;
|
|
63
|
+
maskElement: z.ZodLazy<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
64
|
+
inverted: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
+
feather: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
blendMode: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
declare const CharacterStyleSchema: z.ZodObject<{
|
|
70
|
+
color: z.ZodOptional<z.ZodString>;
|
|
71
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
72
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
strikethrough: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
declare const TextSpanSchema: z.ZodObject<{
|
|
79
|
+
text: z.ZodString;
|
|
80
|
+
style: z.ZodObject<{
|
|
81
|
+
color: z.ZodOptional<z.ZodString>;
|
|
82
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
83
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
86
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
87
|
+
strikethrough: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
declare const RichTextSchema: z.ZodObject<{
|
|
91
|
+
spans: z.ZodArray<z.ZodObject<{
|
|
92
|
+
text: z.ZodString;
|
|
93
|
+
style: z.ZodObject<{
|
|
94
|
+
color: z.ZodOptional<z.ZodString>;
|
|
95
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
96
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
98
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
99
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
100
|
+
strikethrough: z.ZodOptional<z.ZodBoolean>;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
}, z.core.$strip>>;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
declare const AnyTransformDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
105
|
+
type: z.ZodLiteral<"custom">;
|
|
106
|
+
controlPoints: z.ZodArray<z.ZodObject<{
|
|
107
|
+
x: z.ZodNumber;
|
|
108
|
+
y: z.ZodNumber;
|
|
109
|
+
}, z.core.$strip>>;
|
|
110
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
111
|
+
type: z.ZodLiteral<"distort">;
|
|
112
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
113
|
+
type: z.ZodLiteral<"circle">;
|
|
114
|
+
radius: z.ZodNumber;
|
|
115
|
+
scale: z.ZodNumber;
|
|
116
|
+
reverse: z.ZodBoolean;
|
|
117
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
118
|
+
type: z.ZodLiteral<"lean">;
|
|
119
|
+
leanAmount: z.ZodNumber;
|
|
120
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
121
|
+
type: z.ZodLiteral<"arch">;
|
|
122
|
+
archHeight: z.ZodNumber;
|
|
123
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
124
|
+
type: z.ZodLiteral<"ascend">;
|
|
125
|
+
ascendAngle: z.ZodNumber;
|
|
126
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
127
|
+
type: z.ZodLiteral<"wave">;
|
|
128
|
+
amplitude: z.ZodNumber;
|
|
129
|
+
frequency: z.ZodNumber;
|
|
130
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
131
|
+
type: z.ZodLiteral<"flag">;
|
|
132
|
+
amplitude: z.ZodNumber;
|
|
133
|
+
frequency: z.ZodNumber;
|
|
134
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
135
|
+
type: z.ZodLiteral<"image">;
|
|
136
|
+
width: z.ZodNumber;
|
|
137
|
+
height: z.ZodNumber;
|
|
138
|
+
cropX: z.ZodNumber;
|
|
139
|
+
cropY: z.ZodNumber;
|
|
140
|
+
cropWidth: z.ZodNumber;
|
|
141
|
+
cropHeight: z.ZodNumber;
|
|
142
|
+
flipHorizontal: z.ZodBoolean;
|
|
143
|
+
flipVertical: z.ZodBoolean;
|
|
144
|
+
borderRadius: z.ZodNumber;
|
|
145
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
146
|
+
type: z.ZodLiteral<"group">;
|
|
147
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
148
|
+
type: z.ZodLiteral<"shape">;
|
|
149
|
+
shapeType: z.ZodEnum<{
|
|
150
|
+
circle: "circle";
|
|
151
|
+
rectangle: "rectangle";
|
|
152
|
+
ellipse: "ellipse";
|
|
153
|
+
triangle: "triangle";
|
|
154
|
+
polygon: "polygon";
|
|
155
|
+
star: "star";
|
|
156
|
+
line: "line";
|
|
157
|
+
}>;
|
|
158
|
+
width: z.ZodNumber;
|
|
159
|
+
height: z.ZodNumber;
|
|
160
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
radiusX: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
radiusY: z.ZodOptional<z.ZodNumber>;
|
|
163
|
+
sides: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
points: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
innerRadius: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
fillColor: z.ZodOptional<z.ZodString>;
|
|
167
|
+
fillOpacity: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
169
|
+
type: z.ZodLiteral<"path">;
|
|
170
|
+
points: z.ZodArray<z.ZodObject<{
|
|
171
|
+
id: z.ZodString;
|
|
172
|
+
x: z.ZodNumber;
|
|
173
|
+
y: z.ZodNumber;
|
|
174
|
+
type: z.ZodEnum<{
|
|
175
|
+
corner: "corner";
|
|
176
|
+
smooth: "smooth";
|
|
177
|
+
bezier: "bezier";
|
|
178
|
+
}>;
|
|
179
|
+
handleIn: z.ZodOptional<z.ZodObject<{
|
|
180
|
+
x: z.ZodNumber;
|
|
181
|
+
y: z.ZodNumber;
|
|
182
|
+
}, z.core.$strip>>;
|
|
183
|
+
handleOut: z.ZodOptional<z.ZodObject<{
|
|
184
|
+
x: z.ZodNumber;
|
|
185
|
+
y: z.ZodNumber;
|
|
186
|
+
}, z.core.$strip>>;
|
|
187
|
+
}, z.core.$strip>>;
|
|
188
|
+
closed: z.ZodBoolean;
|
|
189
|
+
width: z.ZodNumber;
|
|
190
|
+
height: z.ZodNumber;
|
|
191
|
+
fillEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
192
|
+
fillColor: z.ZodOptional<z.ZodString>;
|
|
193
|
+
fillOpacity: z.ZodOptional<z.ZodNumber>;
|
|
194
|
+
strokeEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
195
|
+
strokeColor: z.ZodOptional<z.ZodString>;
|
|
196
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
197
|
+
}, z.core.$strip>], "type">;
|
|
198
|
+
/**
|
|
199
|
+
* Discriminated union of all element config schemas.
|
|
200
|
+
* Discriminant field: `transformType`.
|
|
201
|
+
*/
|
|
202
|
+
declare const AnyElementConfigSchema: z.ZodType;
|
|
203
|
+
declare const ClipShapeSchema: z.ZodUnion<readonly [z.ZodLiteral<"rectangle">, z.ZodLiteral<"circle">, z.ZodObject<{
|
|
204
|
+
type: z.ZodLiteral<"rounded">;
|
|
205
|
+
radius: z.ZodNumber;
|
|
206
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
207
|
+
type: z.ZodLiteral<"path">;
|
|
208
|
+
d: z.ZodString;
|
|
209
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
210
|
+
type: z.ZodLiteral<"composite-path">;
|
|
211
|
+
pieces: z.ZodArray<z.ZodObject<{
|
|
212
|
+
d: z.ZodString;
|
|
213
|
+
x: z.ZodNumber;
|
|
214
|
+
y: z.ZodNumber;
|
|
215
|
+
rotation: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<90>, z.ZodLiteral<180>, z.ZodLiteral<270>]>>;
|
|
216
|
+
baseWidth: z.ZodOptional<z.ZodNumber>;
|
|
217
|
+
baseHeight: z.ZodOptional<z.ZodNumber>;
|
|
218
|
+
}, z.core.$strip>>;
|
|
219
|
+
}, z.core.$strip>]>;
|
|
220
|
+
declare const SerializedArtboardSchema: z.ZodObject<{
|
|
221
|
+
id: z.ZodString;
|
|
222
|
+
name: z.ZodString;
|
|
223
|
+
x: z.ZodNumber;
|
|
224
|
+
y: z.ZodNumber;
|
|
225
|
+
width: z.ZodNumber;
|
|
226
|
+
height: z.ZodNumber;
|
|
227
|
+
backgroundColor: z.ZodString;
|
|
228
|
+
backgroundType: z.ZodOptional<z.ZodEnum<{
|
|
229
|
+
color: "color";
|
|
230
|
+
transparent: "transparent";
|
|
231
|
+
texture: "texture";
|
|
232
|
+
}>>;
|
|
233
|
+
backgroundTexture: z.ZodOptional<z.ZodString>;
|
|
234
|
+
exportBackground: z.ZodOptional<z.ZodBoolean>;
|
|
235
|
+
clipShape: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"rectangle">, z.ZodLiteral<"circle">, z.ZodObject<{
|
|
236
|
+
type: z.ZodLiteral<"rounded">;
|
|
237
|
+
radius: z.ZodNumber;
|
|
238
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
239
|
+
type: z.ZodLiteral<"path">;
|
|
240
|
+
d: z.ZodString;
|
|
241
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
242
|
+
type: z.ZodLiteral<"composite-path">;
|
|
243
|
+
pieces: z.ZodArray<z.ZodObject<{
|
|
244
|
+
d: z.ZodString;
|
|
245
|
+
x: z.ZodNumber;
|
|
246
|
+
y: z.ZodNumber;
|
|
247
|
+
rotation: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<90>, z.ZodLiteral<180>, z.ZodLiteral<270>]>>;
|
|
248
|
+
baseWidth: z.ZodOptional<z.ZodNumber>;
|
|
249
|
+
baseHeight: z.ZodOptional<z.ZodNumber>;
|
|
250
|
+
}, z.core.$strip>>;
|
|
251
|
+
}, z.core.$strip>]>>;
|
|
252
|
+
previewBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
253
|
+
distressTexture: z.ZodOptional<z.ZodObject<{
|
|
254
|
+
enabled: z.ZodBoolean;
|
|
255
|
+
textureUrl: z.ZodString;
|
|
256
|
+
intensity: z.ZodNumber;
|
|
257
|
+
}, z.core.$strip>>;
|
|
258
|
+
elementIds: z.ZodArray<z.ZodString>;
|
|
259
|
+
}, z.core.$strip>;
|
|
260
|
+
/**
|
|
261
|
+
* Top-level CanvasStateV1 schema.
|
|
262
|
+
*
|
|
263
|
+
* - `version` is always `1` (literal).
|
|
264
|
+
* - `artboards` contains serialized artboard configs with `elementIds`.
|
|
265
|
+
* - `elements` is a flat array of all elements across all artboards.
|
|
266
|
+
* - `activeArtboardId` identifies which artboard is currently active.
|
|
267
|
+
*/
|
|
268
|
+
declare const CanvasStateV1Schema: z.ZodObject<{
|
|
269
|
+
version: z.ZodLiteral<1>;
|
|
270
|
+
artboards: z.ZodArray<z.ZodObject<{
|
|
271
|
+
id: z.ZodString;
|
|
272
|
+
name: z.ZodString;
|
|
273
|
+
x: z.ZodNumber;
|
|
274
|
+
y: z.ZodNumber;
|
|
275
|
+
width: z.ZodNumber;
|
|
276
|
+
height: z.ZodNumber;
|
|
277
|
+
backgroundColor: z.ZodString;
|
|
278
|
+
backgroundType: z.ZodOptional<z.ZodEnum<{
|
|
279
|
+
color: "color";
|
|
280
|
+
transparent: "transparent";
|
|
281
|
+
texture: "texture";
|
|
282
|
+
}>>;
|
|
283
|
+
backgroundTexture: z.ZodOptional<z.ZodString>;
|
|
284
|
+
exportBackground: z.ZodOptional<z.ZodBoolean>;
|
|
285
|
+
clipShape: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"rectangle">, z.ZodLiteral<"circle">, z.ZodObject<{
|
|
286
|
+
type: z.ZodLiteral<"rounded">;
|
|
287
|
+
radius: z.ZodNumber;
|
|
288
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
289
|
+
type: z.ZodLiteral<"path">;
|
|
290
|
+
d: z.ZodString;
|
|
291
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
292
|
+
type: z.ZodLiteral<"composite-path">;
|
|
293
|
+
pieces: z.ZodArray<z.ZodObject<{
|
|
294
|
+
d: z.ZodString;
|
|
295
|
+
x: z.ZodNumber;
|
|
296
|
+
y: z.ZodNumber;
|
|
297
|
+
rotation: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<90>, z.ZodLiteral<180>, z.ZodLiteral<270>]>>;
|
|
298
|
+
baseWidth: z.ZodOptional<z.ZodNumber>;
|
|
299
|
+
baseHeight: z.ZodOptional<z.ZodNumber>;
|
|
300
|
+
}, z.core.$strip>>;
|
|
301
|
+
}, z.core.$strip>]>>;
|
|
302
|
+
previewBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
303
|
+
distressTexture: z.ZodOptional<z.ZodObject<{
|
|
304
|
+
enabled: z.ZodBoolean;
|
|
305
|
+
textureUrl: z.ZodString;
|
|
306
|
+
intensity: z.ZodNumber;
|
|
307
|
+
}, z.core.$strip>>;
|
|
308
|
+
elementIds: z.ZodArray<z.ZodString>;
|
|
309
|
+
}, z.core.$strip>>;
|
|
310
|
+
elements: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
311
|
+
activeArtboardId: z.ZodString;
|
|
312
|
+
}, z.core.$strip>;
|
|
313
|
+
/** A serialized artboard (artboard config + elementIds, no nested elements). */
|
|
314
|
+
type SerializedArtboard = z.infer<typeof SerializedArtboardSchema>;
|
|
315
|
+
/** A serialized element (discriminated union on `transformType`). */
|
|
316
|
+
type SerializedElement = z.infer<typeof AnyElementConfigSchema>;
|
|
317
|
+
/** The full versioned state document. */
|
|
318
|
+
type CanvasStateV1 = z.infer<typeof CanvasStateV1Schema>;
|
|
319
|
+
/**
|
|
320
|
+
* Serialize the current editor state into a `CanvasStateV1` document.
|
|
321
|
+
*
|
|
322
|
+
* @param artboardManager - The ArtboardManager instance (provides artboard list + active ID).
|
|
323
|
+
* @param elements - All elements currently in the editor (across all artboards).
|
|
324
|
+
* @returns A validated CanvasStateV1 object ready for JSON.stringify().
|
|
325
|
+
*/
|
|
326
|
+
declare function serializeState(artboardManager: ArtboardManager, elements: BaseElement[]): CanvasStateV1;
|
|
327
|
+
/** Result of deserializing a CanvasStateV1 document. */
|
|
328
|
+
interface DeserializeResult {
|
|
329
|
+
artboards: ArtboardElement[];
|
|
330
|
+
elements: BaseElement[];
|
|
331
|
+
activeArtboardId: string;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Deserialize a validated `CanvasStateV1` document back into runtime objects.
|
|
335
|
+
*
|
|
336
|
+
* Uses `ArtboardElement.fromJSON()` for artboards and `ElementFactory.createFromJSON()`
|
|
337
|
+
* for elements (preserving the existing factory pattern).
|
|
338
|
+
*
|
|
339
|
+
* @param state - A CanvasStateV1 object (should have been validated already).
|
|
340
|
+
* @returns Deserialized artboards, elements, and active artboard ID.
|
|
341
|
+
*/
|
|
342
|
+
declare function deserializeState(state: CanvasStateV1): DeserializeResult;
|
|
343
|
+
/** Validation result with typed error details. */
|
|
344
|
+
type ValidationResult = {
|
|
345
|
+
success: true;
|
|
346
|
+
data: CanvasStateV1;
|
|
347
|
+
} | {
|
|
348
|
+
success: false;
|
|
349
|
+
errors: Array<{
|
|
350
|
+
path: string;
|
|
351
|
+
message: string;
|
|
352
|
+
}>;
|
|
353
|
+
};
|
|
354
|
+
/**
|
|
355
|
+
* Validate an unknown value against the CanvasStateV1 schema.
|
|
356
|
+
*
|
|
357
|
+
* @param data - Unknown data to validate (e.g. parsed JSON).
|
|
358
|
+
* @returns A discriminated result: `{ success: true, data }` or `{ success: false, errors }`.
|
|
359
|
+
*/
|
|
360
|
+
declare function validateState(data: unknown): ValidationResult;
|
|
361
|
+
/**
|
|
362
|
+
* Migrate an unknown state payload to the latest version.
|
|
363
|
+
*
|
|
364
|
+
* Currently only version 1 exists. Future versions will add migration logic
|
|
365
|
+
* (e.g. v1 -> v2) here so that older documents can be loaded transparently.
|
|
366
|
+
*
|
|
367
|
+
* @param data - Unknown data (parsed JSON).
|
|
368
|
+
* @returns A validated CanvasStateV1 (or the latest version in the future).
|
|
369
|
+
* @throws Error if the data cannot be migrated.
|
|
370
|
+
*/
|
|
371
|
+
declare function migrateState(data: unknown): CanvasStateV1;
|
|
372
|
+
export { CanvasStateV1Schema, SerializedArtboardSchema, AnyElementConfigSchema, AnyTransformDataSchema, StrokeConfigSchema, KnockoutConfigSchema, DistressEffectSchema, MaskDefinitionSchema, CharacterStyleSchema, TextSpanSchema, RichTextSchema, ClipShapeSchema, serializeState, deserializeState, validateState, migrateState, };
|
|
373
|
+
export type { CanvasStateV1, SerializedArtboard, SerializedElement, DeserializeResult, ValidationResult, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State serialization module.
|
|
3
|
+
*
|
|
4
|
+
* Provides versioned, Zod-validated serialization/deserialization
|
|
5
|
+
* for the canvas editor state.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
export { CanvasStateV1Schema, SerializedArtboardSchema, AnyElementConfigSchema, AnyTransformDataSchema, StrokeConfigSchema, KnockoutConfigSchema, DistressEffectSchema, MaskDefinitionSchema, CharacterStyleSchema, TextSpanSchema, RichTextSchema, ClipShapeSchema, serializeState, deserializeState, validateState, migrateState, } from './CanvasStateV1.js';
|
|
10
|
+
export type { CanvasStateV1, SerializedArtboard, SerializedElement, DeserializeResult, ValidationResult, } from './CanvasStateV1.js';
|