@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,7 @@
|
|
|
1
|
+
import { ArtboardDistressTexture } from '../types/index.js';
|
|
2
|
+
interface ArtboardDistressPanelProps {
|
|
3
|
+
distressTexture?: ArtboardDistressTexture;
|
|
4
|
+
onChange: (distressTexture: ArtboardDistressTexture | undefined) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const ArtboardDistressPanel: ({ distressTexture, onChange }: ArtboardDistressPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ArtboardDistressPanel;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ArtboardImageMask } from '../types/index.js';
|
|
2
|
+
interface ArtboardImageMaskPanelProps {
|
|
3
|
+
imageMask?: ArtboardImageMask;
|
|
4
|
+
onChange: (imageMask: ArtboardImageMask | undefined) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const ArtboardImageMaskPanel: ({ imageMask, onChange }: ArtboardImageMaskPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ArtboardImageMaskPanel;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ArtboardElement } from '../core/ArtboardElement';
|
|
3
|
+
interface ArtboardPropertiesToolbarProps {
|
|
4
|
+
artboard: ArtboardElement;
|
|
5
|
+
artboards: ArtboardElement[];
|
|
6
|
+
onArtboardUpdate: (artboard: ArtboardElement) => void;
|
|
7
|
+
onRenameArtboard: (artboardId: string, newName: string) => void;
|
|
8
|
+
onDeleteArtboard: (artboardId: string) => void;
|
|
9
|
+
artboardScreenBounds?: {
|
|
10
|
+
left: number;
|
|
11
|
+
top: number;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
bottom: number;
|
|
15
|
+
centerX: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
declare const ArtboardPropertiesToolbar: React.FC<ArtboardPropertiesToolbarProps>;
|
|
19
|
+
export default ArtboardPropertiesToolbar;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ArtboardElement } from '../core/ArtboardElement';
|
|
3
|
+
interface ArtboardToolbarProps {
|
|
4
|
+
artboards: ArtboardElement[];
|
|
5
|
+
activeArtboardId: string | null;
|
|
6
|
+
onCreateArtboard: (width?: number, height?: number) => void;
|
|
7
|
+
onSelectArtboard: (artboardId: string) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const ArtboardToolbar: React.FC<ArtboardToolbarProps>;
|
|
10
|
+
export default ArtboardToolbar;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ArtboardBackgroundType } from '../types/index';
|
|
2
|
+
export interface BackgroundPickerDropdownProps {
|
|
3
|
+
backgroundType: ArtboardBackgroundType;
|
|
4
|
+
backgroundColor: string;
|
|
5
|
+
backgroundTexture?: string;
|
|
6
|
+
onBackgroundTypeChange: (type: ArtboardBackgroundType) => void;
|
|
7
|
+
onColorChange: (color: string) => void;
|
|
8
|
+
onTextureChange: (textureId: string) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const BackgroundPickerDropdown: import('react').MemoExoticComponent<({ backgroundType, backgroundColor, backgroundTexture, onBackgroundTypeChange, onColorChange, onTextureChange, }: BackgroundPickerDropdownProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
|
+
export default BackgroundPickerDropdown;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TShirtColor } from '../presets/tshirt-presets.js';
|
|
2
|
+
interface BackgroundSwitcherProps {
|
|
3
|
+
selectedColorId: string | null;
|
|
4
|
+
onColorChange: (color: TShirtColor | null) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const BackgroundSwitcher: ({ selectedColorId, onColorChange }: BackgroundSwitcherProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default BackgroundSwitcher;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR-0064 §7 — canvas accessibility fallback DOM (v1 stub).
|
|
3
|
+
*
|
|
4
|
+
* A `<canvas>` element is opaque to assistive technology. The WAI's
|
|
5
|
+
* "Accessibility of <canvas>" guidance has three patterns: fallback
|
|
6
|
+
* DOM, keyboard model, live region. v1 ships the **fallback DOM** and
|
|
7
|
+
* **live region** patterns; the keyboard manipulation model is deferred
|
|
8
|
+
* to a P2 follow-up (per ADR §6 + §7 deferral note).
|
|
9
|
+
*
|
|
10
|
+
* Usage — mount alongside or inside the canvas region:
|
|
11
|
+
*
|
|
12
|
+
* <CanvasA11yFallback
|
|
13
|
+
* artworks={artworks.map(a => ({
|
|
14
|
+
* id: a.id,
|
|
15
|
+
* label: `${a.title} design`,
|
|
16
|
+
* position: a.position,
|
|
17
|
+
* rotation: a.rotation,
|
|
18
|
+
* width: a.width,
|
|
19
|
+
* }))}
|
|
20
|
+
* announcement={lastChange}
|
|
21
|
+
* />
|
|
22
|
+
*
|
|
23
|
+
* The component renders a visually-hidden DOM so AT users perceive
|
|
24
|
+
* what's on the canvas. `prefers-reduced-motion` is honored by hiding
|
|
25
|
+
* the live region during high-frequency interactions (caller decides
|
|
26
|
+
* when to update `announcement`).
|
|
27
|
+
*
|
|
28
|
+
* Why this is a stub: AT users can *perceive* the canvas state but
|
|
29
|
+
* cannot *manipulate* it. The customer who can browse the marketplace
|
|
30
|
+
* and reorder a pre-made design has a viable path through the product;
|
|
31
|
+
* the customer who needs to manipulate the canvas itself is served in
|
|
32
|
+
* the P2 follow-up. The accessibility statement (ADR-0065 §6.5) is
|
|
33
|
+
* required to disclose this gap honestly.
|
|
34
|
+
*/
|
|
35
|
+
export interface CanvasA11yArtwork {
|
|
36
|
+
id: string;
|
|
37
|
+
/** Short human description: "Sun design", "Custom photo", etc. */
|
|
38
|
+
label: string;
|
|
39
|
+
/** "upper-left" | "centered" | { x, y } in canvas coords. */
|
|
40
|
+
position?: string | {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
};
|
|
44
|
+
/** Degrees, clockwise positive. */
|
|
45
|
+
rotation?: number;
|
|
46
|
+
/** Canvas pixels. */
|
|
47
|
+
width?: number;
|
|
48
|
+
}
|
|
49
|
+
export interface CanvasA11yFallbackProps {
|
|
50
|
+
artworks: CanvasA11yArtwork[];
|
|
51
|
+
/**
|
|
52
|
+
* Most-recent state change to announce. Caller debounces; the
|
|
53
|
+
* component throttles further to prevent screen-reader flooding
|
|
54
|
+
* (1 announcement per 1.5s).
|
|
55
|
+
*/
|
|
56
|
+
announcement?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Optional landmark heading. Default = "Design canvas".
|
|
59
|
+
*/
|
|
60
|
+
heading?: string;
|
|
61
|
+
}
|
|
62
|
+
export declare function CanvasA11yFallback({ artworks, announcement, heading, }: CanvasA11yFallbackProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TextElement } from '../../core/TextElement.js';
|
|
3
|
+
import { ImageElement } from '../../core/ImageElement.js';
|
|
4
|
+
import { GroupElement } from '../../core/GroupElement.js';
|
|
5
|
+
import { ArtboardElement } from '../../core/ArtboardElement.js';
|
|
6
|
+
import { ArtboardManager } from '../../core/ArtboardManager.js';
|
|
7
|
+
export interface CanvasRendererComponentProps {
|
|
8
|
+
/** Elements to render */
|
|
9
|
+
elements: (TextElement | ImageElement | GroupElement)[];
|
|
10
|
+
/** Artboards in the canvas */
|
|
11
|
+
artboards: ArtboardElement[];
|
|
12
|
+
/** Artboard manager instance */
|
|
13
|
+
artboardManager: ArtboardManager;
|
|
14
|
+
/** Canvas width (defaults to artboard width or 1000) */
|
|
15
|
+
width?: number;
|
|
16
|
+
/** Canvas height (defaults to artboard height or 1000) */
|
|
17
|
+
height?: number;
|
|
18
|
+
/** Zoom level (defaults to 1.0) */
|
|
19
|
+
zoom?: number;
|
|
20
|
+
/** X offset for canvas positioning (defaults to 0) */
|
|
21
|
+
offsetX?: number;
|
|
22
|
+
/** Y offset for canvas positioning (defaults to 0) */
|
|
23
|
+
offsetY?: number;
|
|
24
|
+
/** Canvas background color (CSS custom property, defaults to --color-canvas-bg) */
|
|
25
|
+
canvasBgColor?: string;
|
|
26
|
+
/** Whether to show the canvas background or render transparent (defaults to true) */
|
|
27
|
+
showBackground?: boolean;
|
|
28
|
+
/** Optional callback when render completes */
|
|
29
|
+
onRender?: () => void;
|
|
30
|
+
/** Optional ref to the canvas element */
|
|
31
|
+
canvasRef?: React.RefObject<HTMLCanvasElement | null>;
|
|
32
|
+
}
|
|
33
|
+
export interface CanvasRendererComponentHandle {
|
|
34
|
+
/** Get the canvas element */
|
|
35
|
+
getCanvas: () => HTMLCanvasElement | null;
|
|
36
|
+
/** Force a re-render */
|
|
37
|
+
forceRender: () => void;
|
|
38
|
+
/** Get current zoom level */
|
|
39
|
+
getZoom: () => number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* CanvasRendererComponent - Pure rendering component
|
|
43
|
+
*
|
|
44
|
+
* Renders artboards and elements to a canvas with no interaction or UI chrome.
|
|
45
|
+
* Perfect for:
|
|
46
|
+
* - Embedded views
|
|
47
|
+
* - Read-only previews
|
|
48
|
+
* - Export rendering
|
|
49
|
+
* - Custom layouts
|
|
50
|
+
*/
|
|
51
|
+
export declare const CanvasRendererComponent: React.ForwardRefExoticComponent<CanvasRendererComponentProps & React.RefAttributes<CanvasRendererComponentHandle>>;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { TextElement } from '../../../core/TextElement.js';
|
|
2
|
+
import { ImageElement } from '../../../core/ImageElement.js';
|
|
3
|
+
import { GroupElement } from '../../../core/GroupElement.js';
|
|
4
|
+
import { ShapeElement } from '../../../core/ShapeElement.js';
|
|
5
|
+
import { PathElement } from '../../../core/PathElement.js';
|
|
6
|
+
import { InteractionStateMachine } from '../../../core/InteractionStateMachine.js';
|
|
7
|
+
import { TransformHandles } from '../../../core/TransformHandles.js';
|
|
8
|
+
import { HandleInfo } from '../../../types/index.js';
|
|
9
|
+
/** Return type from ImageElement.hitTestCropHandle() */
|
|
10
|
+
interface CropHandleHitResult {
|
|
11
|
+
type: 'corner' | 'edge';
|
|
12
|
+
anchor: string;
|
|
13
|
+
worldX: number;
|
|
14
|
+
worldY: number;
|
|
15
|
+
}
|
|
16
|
+
/** Elements that can be on the canvas */
|
|
17
|
+
type CanvasElement = TextElement | ImageElement | GroupElement | ShapeElement | PathElement;
|
|
18
|
+
/** Elements that can be children of a group (including nested groups) */
|
|
19
|
+
type ChildElement = TextElement | ImageElement | ShapeElement | PathElement | GroupElement;
|
|
20
|
+
export interface CropModeContext {
|
|
21
|
+
croppingImage: ImageElement;
|
|
22
|
+
croppingChild: ImageElement | null;
|
|
23
|
+
croppingChildIndex: number;
|
|
24
|
+
isChildInGroup: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface FindCroppingImageParams {
|
|
27
|
+
selectedElement: CanvasElement | null;
|
|
28
|
+
activeChildElement: ChildElement | null;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Finds the image currently in crop mode (either standalone or child in group)
|
|
32
|
+
*/
|
|
33
|
+
export declare function findCroppingImage(params: FindCroppingImageParams): CropModeContext | null;
|
|
34
|
+
export type CropModeHitResult = {
|
|
35
|
+
type: 'crop-handle';
|
|
36
|
+
handle: CropHandleHitResult;
|
|
37
|
+
} | {
|
|
38
|
+
type: 'image-handle';
|
|
39
|
+
handle: HandleInfo;
|
|
40
|
+
} | {
|
|
41
|
+
type: 'image-drag';
|
|
42
|
+
} | {
|
|
43
|
+
type: 'exit-crop';
|
|
44
|
+
} | {
|
|
45
|
+
type: 'none';
|
|
46
|
+
};
|
|
47
|
+
export interface CropModeHitTestParams {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
cropContext: CropModeContext;
|
|
51
|
+
transformHandles: TransformHandles;
|
|
52
|
+
zoom?: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Hit test for crop mode interactions
|
|
56
|
+
* Priority: crop handles > image handles > image drag > exit crop mode
|
|
57
|
+
*/
|
|
58
|
+
export declare function hitTestCropMode(params: CropModeHitTestParams): CropModeHitResult;
|
|
59
|
+
export interface HandleCropHandleClickParams {
|
|
60
|
+
cropContext: CropModeContext;
|
|
61
|
+
cropHandle: CropHandleHitResult;
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
selectedElement: CanvasElement | null;
|
|
65
|
+
activeChildElement: ChildElement | null;
|
|
66
|
+
stateMachine: InteractionStateMachine;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Handles clicking on a crop box handle (resize crop area)
|
|
70
|
+
*/
|
|
71
|
+
export declare function handleCropHandleClick(params: HandleCropHandleClickParams): void;
|
|
72
|
+
export interface HandleImageHandleClickParams {
|
|
73
|
+
cropContext: CropModeContext;
|
|
74
|
+
imageHandle: HandleInfo;
|
|
75
|
+
x: number;
|
|
76
|
+
y: number;
|
|
77
|
+
selectedElement: CanvasElement | null;
|
|
78
|
+
activeChildElement: ChildElement | null;
|
|
79
|
+
stateMachine: InteractionStateMachine;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Handles clicking on an image corner handle (scale image)
|
|
83
|
+
*/
|
|
84
|
+
export declare function handleImageHandleClick(params: HandleImageHandleClickParams): void;
|
|
85
|
+
export interface HandleImageDragClickParams {
|
|
86
|
+
cropContext: CropModeContext;
|
|
87
|
+
x: number;
|
|
88
|
+
y: number;
|
|
89
|
+
selectedElement: CanvasElement | null;
|
|
90
|
+
activeChildElement: ChildElement | null;
|
|
91
|
+
stateMachine: InteractionStateMachine;
|
|
92
|
+
dragOriginalElementsRef: React.MutableRefObject<Map<string, CanvasElement> | null>;
|
|
93
|
+
setHoverState: (state: {
|
|
94
|
+
type: null;
|
|
95
|
+
data: null;
|
|
96
|
+
}) => void;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Handles clicking inside the image (drag image within crop)
|
|
100
|
+
*/
|
|
101
|
+
export declare function handleImageDragClick(params: HandleImageDragClickParams): void;
|
|
102
|
+
export interface ExitCropModeParams {
|
|
103
|
+
cropContext: CropModeContext;
|
|
104
|
+
selectedElement: CanvasElement | null;
|
|
105
|
+
onElementUpdate: (element: CanvasElement) => void;
|
|
106
|
+
transformHandles: TransformHandles;
|
|
107
|
+
updateActiveChild: (child: ChildElement | null) => void;
|
|
108
|
+
zoom: number;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Exits crop mode when clicking outside the image
|
|
112
|
+
*/
|
|
113
|
+
export declare function exitCropMode(params: ExitCropModeParams): void;
|
|
114
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { TextElement } from '../../../core/TextElement.js';
|
|
2
|
+
import { ImageElement } from '../../../core/ImageElement.js';
|
|
3
|
+
import { GroupElement } from '../../../core/GroupElement.js';
|
|
4
|
+
import { ShapeElement } from '../../../core/ShapeElement.js';
|
|
5
|
+
import { PathElement } from '../../../core/PathElement.js';
|
|
6
|
+
import { InteractionStateMachine } from '../../../core/InteractionStateMachine.js';
|
|
7
|
+
import { TransformHandles } from '../../../core/TransformHandles.js';
|
|
8
|
+
import { LocalHoverState } from '../types/index.js';
|
|
9
|
+
/** Elements that can be on the canvas */
|
|
10
|
+
type CanvasElement = TextElement | ImageElement | GroupElement | ShapeElement | PathElement;
|
|
11
|
+
/** Elements that can be children of a group (including nested groups) */
|
|
12
|
+
type ChildElement = TextElement | ImageElement | ShapeElement | PathElement | GroupElement;
|
|
13
|
+
export interface HandleSiblingClickParams {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
activeChildElement: ChildElement;
|
|
17
|
+
selectedElement: GroupElement;
|
|
18
|
+
updateActiveChild: (child: ChildElement | null) => void;
|
|
19
|
+
transformHandles: TransformHandles;
|
|
20
|
+
setHandlesVersion: React.Dispatch<React.SetStateAction<number>>;
|
|
21
|
+
stateMachine: InteractionStateMachine;
|
|
22
|
+
dragOriginalElementsRef: React.MutableRefObject<Map<string, CanvasElement> | null>;
|
|
23
|
+
setHoverState: (state: Omit<LocalHoverState, 'startTime'>) => void;
|
|
24
|
+
forceUpdate: (value: Record<string, unknown>) => void;
|
|
25
|
+
zoom: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Handles clicking on a sibling element when in active child mode
|
|
29
|
+
* Selects the sibling and starts drag if clicked
|
|
30
|
+
* Returns true if a sibling was clicked, false otherwise
|
|
31
|
+
*/
|
|
32
|
+
export declare function handleSiblingClick(params: HandleSiblingClickParams): boolean;
|
|
33
|
+
export interface ExitActiveChildModeParams {
|
|
34
|
+
updateActiveChild: (child: ChildElement | null) => void;
|
|
35
|
+
selectedElement: CanvasElement | null;
|
|
36
|
+
transformHandles: TransformHandles;
|
|
37
|
+
setHandlesVersion: React.Dispatch<React.SetStateAction<number>>;
|
|
38
|
+
zoom: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Exits active child editing mode
|
|
42
|
+
* Called when clicking outside all children in a group
|
|
43
|
+
*/
|
|
44
|
+
export declare function exitActiveChildMode(params: ExitActiveChildModeParams): void;
|
|
45
|
+
export interface HandleElementSelectionParams {
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
shiftKey: boolean;
|
|
49
|
+
activeArtboardElements: CanvasElement[];
|
|
50
|
+
selectedElement: CanvasElement | null;
|
|
51
|
+
multiSelection: string[];
|
|
52
|
+
onSelectionChange: (id: string | null) => void;
|
|
53
|
+
onMultiSelectionChange: (ids: string[]) => void;
|
|
54
|
+
stateMachine: InteractionStateMachine;
|
|
55
|
+
dragOriginalElementsRef: React.MutableRefObject<Map<string, CanvasElement> | null>;
|
|
56
|
+
setHoverState: (state: Omit<LocalHoverState, 'startTime'>) => void;
|
|
57
|
+
forceUpdate: (value: Record<string, unknown>) => void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Handles clicking on elements in the canvas for selection
|
|
61
|
+
* Supports shift-click multi-selection and normal selection
|
|
62
|
+
* Returns true if an element was clicked, false otherwise
|
|
63
|
+
*/
|
|
64
|
+
export declare function handleElementSelection(params: HandleElementSelectionParams): boolean;
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CanvasEditor Interaction Handlers
|
|
3
|
+
* Barrel export for all handler utilities
|
|
4
|
+
*/
|
|
5
|
+
export { hitTestMultiSelection, startMultiSelectionResize, startMultiSelectionRotate, startMultiSelectionDrag, } from './multiSelectionHandlers.js';
|
|
6
|
+
export type { MultiSelectionHitResult, MultiSelectionHitTestParams, StartMultiSelectionResizeParams, StartMultiSelectionRotateParams, StartMultiSelectionDragParams, } from './multiSelectionHandlers.js';
|
|
7
|
+
export { findCroppingImage, hitTestCropMode, handleCropHandleClick, handleImageHandleClick, handleImageDragClick, exitCropMode, } from './cropModeHandlers.js';
|
|
8
|
+
export type { CropModeContext, CropModeHitResult, FindCroppingImageParams, CropModeHitTestParams, HandleCropHandleClickParams, HandleImageHandleClickParams, HandleImageDragClickParams, ExitCropModeParams, } from './cropModeHandlers.js';
|
|
9
|
+
export { handleSiblingClick, exitActiveChildMode, handleElementSelection, } from './groupChildHandlers.js';
|
|
10
|
+
export type { HandleSiblingClickParams, ExitActiveChildModeParams, HandleElementSelectionParams, } from './groupChildHandlers.js';
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { TextElement } from '../../../core/TextElement.js';
|
|
2
|
+
import { ImageElement } from '../../../core/ImageElement.js';
|
|
3
|
+
import { GroupElement } from '../../../core/GroupElement.js';
|
|
4
|
+
import { ShapeElement } from '../../../core/ShapeElement.js';
|
|
5
|
+
import { PathElement } from '../../../core/PathElement.js';
|
|
6
|
+
import { InteractionStateMachine } from '../../../core/InteractionStateMachine.js';
|
|
7
|
+
import { MultiSelectionGroupBounds } from '../renderers/index.js';
|
|
8
|
+
import { LocalHoverState } from '../types/index.js';
|
|
9
|
+
/** Elements that can be on the canvas */
|
|
10
|
+
type CanvasElement = TextElement | ImageElement | GroupElement | ShapeElement | PathElement;
|
|
11
|
+
export type MultiSelectionHitResult = {
|
|
12
|
+
type: 'corner-handle';
|
|
13
|
+
anchor: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
14
|
+
corner: {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
};
|
|
18
|
+
} | {
|
|
19
|
+
type: 'rotation-handle';
|
|
20
|
+
} | {
|
|
21
|
+
type: 'bounds-drag';
|
|
22
|
+
} | {
|
|
23
|
+
type: 'none';
|
|
24
|
+
};
|
|
25
|
+
export interface MultiSelectionHitTestParams {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
bounds: MultiSelectionGroupBounds;
|
|
29
|
+
multiSelection: string[];
|
|
30
|
+
elements: CanvasElement[];
|
|
31
|
+
zoom?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Hit test for multi-selection interactions
|
|
35
|
+
* Returns what was clicked: corner handle, rotation handle, bounds drag area, or nothing
|
|
36
|
+
*/
|
|
37
|
+
export declare function hitTestMultiSelection(params: MultiSelectionHitTestParams): MultiSelectionHitResult;
|
|
38
|
+
export interface StartMultiSelectionResizeParams {
|
|
39
|
+
multiSelection: string[];
|
|
40
|
+
elements: CanvasElement[];
|
|
41
|
+
bounds: MultiSelectionGroupBounds;
|
|
42
|
+
anchor: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
43
|
+
corner: {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
};
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
stateMachine: InteractionStateMachine;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Starts a resize operation on multi-selection
|
|
53
|
+
* Sets up state machine context for multi-selection resize
|
|
54
|
+
*/
|
|
55
|
+
export declare function startMultiSelectionResize(params: StartMultiSelectionResizeParams): boolean;
|
|
56
|
+
export interface StartMultiSelectionRotateParams {
|
|
57
|
+
multiSelection: string[];
|
|
58
|
+
elements: CanvasElement[];
|
|
59
|
+
bounds: MultiSelectionGroupBounds;
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
stateMachine: InteractionStateMachine;
|
|
63
|
+
setIsRotating: (value: boolean) => void;
|
|
64
|
+
setRotationStartAngle: (angle: number) => void;
|
|
65
|
+
setCurrentRotation: (rotation: number) => void;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Starts a rotation operation on multi-selection
|
|
69
|
+
* Sets up state machine context for multi-selection rotation
|
|
70
|
+
*/
|
|
71
|
+
export declare function startMultiSelectionRotate(params: StartMultiSelectionRotateParams): boolean;
|
|
72
|
+
export interface StartMultiSelectionDragParams {
|
|
73
|
+
multiSelection: string[];
|
|
74
|
+
elements: CanvasElement[];
|
|
75
|
+
x: number;
|
|
76
|
+
y: number;
|
|
77
|
+
stateMachine: InteractionStateMachine;
|
|
78
|
+
dragOriginalElementsRef: React.MutableRefObject<Map<string, CanvasElement> | null>;
|
|
79
|
+
setHoverState: (state: Omit<LocalHoverState, 'startTime'>) => void;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Starts a drag operation on multi-selection
|
|
83
|
+
* Sets up state machine context for multi-selection group drag
|
|
84
|
+
*/
|
|
85
|
+
export declare function startMultiSelectionDrag(params: StartMultiSelectionDragParams): boolean;
|
|
86
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ClipShape } from '../../../types/index.js';
|
|
2
|
+
import { OverlayPiece, PieceGuide } from '../../VisualGuideOverlay.js';
|
|
3
|
+
/**
|
|
4
|
+
* Build the artboard's `composite-path` clip shape from a piece-guide
|
|
5
|
+
* bundle. Returns `undefined` when the bundle isn't fully path-kind —
|
|
6
|
+
* the renderer falls back to its rectangular / rounded-rect path then.
|
|
7
|
+
*
|
|
8
|
+
* - When `focusedPieceId` is set and matches one of the pieces, the clip
|
|
9
|
+
* narrows to just that piece's silhouette. Other pieces are excluded
|
|
10
|
+
* so element rendering, the Pass-1 overflow-dim cutout, and Pass-2
|
|
11
|
+
* per-element clipping all align on the same shape — only the focused
|
|
12
|
+
* piece gets artwork painted into it. (Companion behaviour in
|
|
13
|
+
* `PieceGuideRenderer` skips non-focused pieces' chrome too.)
|
|
14
|
+
* - When `focusedPieceId` is null, the clip is the union of every
|
|
15
|
+
* piece (spread mode).
|
|
16
|
+
*
|
|
17
|
+
* Pure function — extracted from `useCanvasRenderLoop.ts` to make the
|
|
18
|
+
* filtering + rotation/swap math directly unit-testable.
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildSpreadClipShape(pieces: OverlayPiece[], guides: Record<string, PieceGuide> | undefined, focusedPieceId: string | null | undefined): ClipShape | undefined;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barrel export for CanvasEditor hooks
|
|
3
|
+
*/
|
|
4
|
+
export { useKeyboardHandlers } from './useKeyboardHandlers.js';
|
|
5
|
+
export { useMarqueeSelection } from './useMarqueeSelection.js';
|
|
6
|
+
export { useSnapAndSpacing } from './useSnapAndSpacing.js';
|
|
7
|
+
export { usePenTool } from './usePenTool.jsx';
|
|
8
|
+
export { useActiveChild } from './useActiveChild.js';
|
|
9
|
+
export { useHoverState } from './useHoverState.js';
|
|
10
|
+
export { useCropMode } from './useCropMode.js';
|
|
11
|
+
export { useMultiSelection } from './useMultiSelection.js';
|
|
12
|
+
export { useTextEditing, type TextEditingHandle } from './useTextEditing.js';
|
|
13
|
+
export { useCanvasLayout } from './useCanvasLayout.js';
|
|
14
|
+
export type { UseCanvasLayoutParams, UseCanvasLayoutReturn } from './useCanvasLayout.js';
|
|
15
|
+
export { useInteractionState } from './useInteractionState.js';
|
|
16
|
+
export type { UseInteractionStateReturn } from './useInteractionState.js';
|
|
17
|
+
export { useRenderState } from './useRenderState.js';
|
|
18
|
+
export type { UseRenderStateParams, UseRenderStateReturn } from './useRenderState.js';
|
|
19
|
+
export { useCanvasRenderLoop } from './useCanvasRenderLoop.js';
|
|
20
|
+
export type { UseCanvasRenderLoopParams } from './useCanvasRenderLoop.js';
|
|
21
|
+
export { useCanvasInteraction } from './useCanvasInteraction.js';
|
|
22
|
+
export type { UseCanvasInteractionParams, CanvasInteractionResult } from './useCanvasInteraction.js';
|
|
23
|
+
export { useTextEditingHandlers } from './useTextEditingHandlers.js';
|
|
24
|
+
export type { UseTextEditingHandlersParams, TextEditingHandlersResult } from './useTextEditingHandlers.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GroupElement } from '../../../core/GroupElement.js';
|
|
2
|
+
import { TextElement } from '../../../core/TextElement.js';
|
|
3
|
+
import { ImageElement } from '../../../core/ImageElement.js';
|
|
4
|
+
import { ShapeElement } from '../../../core/ShapeElement.js';
|
|
5
|
+
import { PathElement } from '../../../core/PathElement.js';
|
|
6
|
+
import { TransformHandles } from '../../../core/TransformHandles.js';
|
|
7
|
+
/** Elements that can be on the canvas */
|
|
8
|
+
type CanvasElement = TextElement | ImageElement | GroupElement | ShapeElement | PathElement;
|
|
9
|
+
/** Elements that can be children of a group (including nested groups) */
|
|
10
|
+
type ChildElement = TextElement | ImageElement | ShapeElement | PathElement | GroupElement;
|
|
11
|
+
interface UseActiveChildProps {
|
|
12
|
+
elements: CanvasElement[];
|
|
13
|
+
selectedElement: CanvasElement | null | undefined;
|
|
14
|
+
transformHandles: TransformHandles;
|
|
15
|
+
onActiveChildChange?: (child: CanvasElement | null) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function useActiveChild({ elements, selectedElement, transformHandles, onActiveChildChange, }: UseActiveChildProps): {
|
|
18
|
+
activeChildElement: ChildElement | null;
|
|
19
|
+
setActiveChildElement: import('react').Dispatch<import('react').SetStateAction<ChildElement | null>>;
|
|
20
|
+
updateActiveChild: (child: ChildElement | null) => void;
|
|
21
|
+
editingChildIdRef: import('react').RefObject<string | null>;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useAnimatedFocusRect — smoothly interpolates a focus rect when the
|
|
3
|
+
* target changes. Used by ADR-0060 multi-piece focus to "dolly"
|
|
4
|
+
* between pieces (Back ↔ Spine ↔ Front) instead of snapping.
|
|
5
|
+
*
|
|
6
|
+
* Snaps (no animation) on first mount and when target becomes null,
|
|
7
|
+
* since there's no meaningful "from" value in those cases. Cancels
|
|
8
|
+
* the in-flight tween on every target change so rapid switches feel
|
|
9
|
+
* responsive instead of queueing.
|
|
10
|
+
*/
|
|
11
|
+
export interface FocusRect {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function useAnimatedFocusRect(target: FocusRect | null, durationMs?: number): FocusRect | null;
|