@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
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# [YourCompany] Community License
|
|
2
|
+
*(Based on the MIT License — modified for fulfillment-linked use)*
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2025 [Your Name or Company]
|
|
5
|
+
All rights reserved.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Permission Grant
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the “Software”), to use,
|
|
12
|
+
copy, modify, merge, publish, and distribute the Software, subject to the
|
|
13
|
+
following conditions.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 2. Intended Use
|
|
18
|
+
This Software is intended to power design tools and applications where end users
|
|
19
|
+
can create, customize, or visualize designs (for example, graphics or apparel designs).
|
|
20
|
+
Such use is unrestricted for digital-only or non-commercial purposes.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 3. Fulfillment Integration Requirement
|
|
25
|
+
If the Software, or any derivative work or service built using the Software,
|
|
26
|
+
includes functionality that enables users to order, print, or fulfill products
|
|
27
|
+
bearing those designs (such as t-shirts, posters, or merchandise), that
|
|
28
|
+
fulfillment functionality **must use [YourCompany] as the fulfillment provider**.
|
|
29
|
+
|
|
30
|
+
You may not modify, substitute, or reroute such fulfillment integrations
|
|
31
|
+
to use another fulfillment provider (including, but not limited to,
|
|
32
|
+
Printful, Gelato, Printify, etc.) without obtaining a **commercial license**
|
|
33
|
+
from [YourCompany].
|
|
34
|
+
|
|
35
|
+
Use of this Software by or for the benefit of any company or entity that
|
|
36
|
+
offers product printing or fulfillment services in competition with
|
|
37
|
+
[YourCompany] is strictly prohibited.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 4. Attribution
|
|
42
|
+
All copies or substantial portions of the Software must include this license
|
|
43
|
+
text and appropriate attribution to [YourCompany] as the original author.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 5. Warranty Disclaimer
|
|
48
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
49
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
50
|
+
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
51
|
+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
|
|
52
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING
|
|
53
|
+
FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
54
|
+
DEALINGS IN THE SOFTWARE.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 6. Summary (Plain Language)
|
|
59
|
+
- ✅ You can use, modify, and self-host this design tool for digital design use.
|
|
60
|
+
- ✅ Free use is allowed if fulfillment (printing, shipping, etc.) goes through [YourCompany].
|
|
61
|
+
- 💰 If you connect the tool to another fulfillment provider, you need a commercial license.
|
|
62
|
+
- 🚫 Competing fulfillment or print-on-demand companies may not use this code.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 🧩 Usage Tip
|
|
67
|
+
Include this note in your `README.md`:
|
|
68
|
+
> This project is licensed under the [YourCompany] Community License.
|
|
69
|
+
> It’s free to use and customize for digital design or with [YourCompany] fulfillment.
|
|
70
|
+
> Integrations with other fulfillment services require a commercial license — contact [your-email@example.com].
|
package/README.md
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
# Custom Canvas Text Transformation System
|
|
2
|
+
|
|
3
|
+
A professional text transformation and image manipulation system for creating apparel/merchandise designs using HTML Canvas API. Features a clean, maintainable, and extensible architecture.
|
|
4
|
+
|
|
5
|
+
## Key Features
|
|
6
|
+
|
|
7
|
+
- ✅ **Direct Canvas Control** - Precise rendering with full control over transformations
|
|
8
|
+
- ✅ **Multiple Transform Types** - 8+ text effects (straight, circle, arch, wave, etc.)
|
|
9
|
+
- ✅ **Advanced Layer Effects** - Strokes, masks, distress, knockout compositing
|
|
10
|
+
- ✅ **Multi-Artboard Workflow** - Manage multiple designs in one session
|
|
11
|
+
- ✅ **Professional Export** - Transparent PNG export with Web Worker performance
|
|
12
|
+
- ✅ **Maintainable** - Clear separation of concerns, modular architecture
|
|
13
|
+
- ✅ **Extensible** - Adding new transforms and effects is straightforward
|
|
14
|
+
|
|
15
|
+
## Development Workflow
|
|
16
|
+
|
|
17
|
+
This repo uses a **hybrid worktree workflow** for parallel feature development:
|
|
18
|
+
|
|
19
|
+
### Hybrid Approach
|
|
20
|
+
- **Generic directory names**: `worktree-1`, `worktree-2`, `worktree-3`, `worktree-4`
|
|
21
|
+
- **Descriptive git branches**: `feature/shadows`, `bug/export-crash`, etc.
|
|
22
|
+
- **Auto-sync on commit**: Every commit automatically rebases on main to prevent drift
|
|
23
|
+
- **Fast context switching**: Reuse the same worktree for multiple features
|
|
24
|
+
|
|
25
|
+
### Quick Start
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# 1. Initial setup (once) - creates 4 worktrees
|
|
29
|
+
/worktree-setup 4
|
|
30
|
+
|
|
31
|
+
# 2. Navigate to any worktree and start a feature
|
|
32
|
+
cd ../snowcone-canvas-worktree-1
|
|
33
|
+
/feature-start shadows
|
|
34
|
+
|
|
35
|
+
# 3. Work and commit (auto-syncs with main after every commit!)
|
|
36
|
+
/commit Add shadow rendering to text elements
|
|
37
|
+
|
|
38
|
+
# 4. Merge to main when stable
|
|
39
|
+
/feature-merge
|
|
40
|
+
|
|
41
|
+
# 5. Start next feature (same worktree, new branch)
|
|
42
|
+
/feature-start export-formats
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Available Commands
|
|
46
|
+
|
|
47
|
+
#### Core Workflow Commands
|
|
48
|
+
|
|
49
|
+
| Command | Description |
|
|
50
|
+
|---------|-------------|
|
|
51
|
+
| `/worktree-setup <count>` | Create N generic worktrees for parallel work |
|
|
52
|
+
| `/feature-start <name>` | Start new feature/bug branch in current worktree |
|
|
53
|
+
| `/commit <message>` | Commit all changes and auto-sync with main |
|
|
54
|
+
| `/feature-merge` | Merge current feature to main and push |
|
|
55
|
+
| `/feature-sync` | Manually sync with main (rarely needed) |
|
|
56
|
+
| `/worktree-list` | List all worktrees with branch mapping |
|
|
57
|
+
|
|
58
|
+
#### Additional Worktree Commands
|
|
59
|
+
|
|
60
|
+
| Command | Description |
|
|
61
|
+
|---------|-------------|
|
|
62
|
+
| `/worktree-create <feature-name>` | Create dedicated worktree for a feature (alt. to reusing) |
|
|
63
|
+
| `/worktree-goto <feature-name>` | Get the path to a worktree directory |
|
|
64
|
+
| `/worktree-remove <feature-name>` | Remove a specific worktree and optionally delete branch |
|
|
65
|
+
| `/worktree-cleanup` | Clean up all worktrees for merged branches |
|
|
66
|
+
|
|
67
|
+
### Key Benefits
|
|
68
|
+
|
|
69
|
+
- ✅ **Merge early, merge often** - Auto-sync on every commit prevents conflicts
|
|
70
|
+
- ✅ **Parallel development** - 4 worktrees = 4 features in progress
|
|
71
|
+
- ✅ **Fast switching** - Reuse worktrees instead of creating new ones
|
|
72
|
+
- ✅ **Clean git history** - Descriptive branch names, generic directories
|
|
73
|
+
- ✅ **Conflict prevention** - Handle conflicts immediately, not at merge time
|
|
74
|
+
|
|
75
|
+
## Architecture
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
custom-canvas/
|
|
79
|
+
├── src/
|
|
80
|
+
│ ├── core/
|
|
81
|
+
│ │ ├── TextShape.js - Base class for all text shapes
|
|
82
|
+
│ │ ├── TransformHandles.js - Resize & rotation handle system
|
|
83
|
+
│ │ └── GeometryUtils.js - Transform math (rotation matrices, etc.)
|
|
84
|
+
│ │
|
|
85
|
+
│ ├── transforms/
|
|
86
|
+
│ │ ├── CustomTransform.js - ✅ Straight text
|
|
87
|
+
│ │ ├── CircleTransform.js - ✅ Circular text path
|
|
88
|
+
│ │ ├── ArchTransform.js - ✅ Curved arch text
|
|
89
|
+
│ │ ├── WaveTransform.js - 🚧 TODO
|
|
90
|
+
│ │ ├── RiseTransform.js - 🚧 TODO
|
|
91
|
+
│ │ ├── FlagTransform.js - 🚧 TODO
|
|
92
|
+
│ │ ├── AngleTransform.js - 🚧 TODO
|
|
93
|
+
│ │ └── DistortTransform.js - 🚧 TODO
|
|
94
|
+
│ │
|
|
95
|
+
│ ├── components/
|
|
96
|
+
│ │ └── CanvasEditor.jsx - Main canvas component
|
|
97
|
+
│ │
|
|
98
|
+
│ ├── App.jsx - Demo app with transform picker
|
|
99
|
+
│ └── main.jsx - Entry point
|
|
100
|
+
│
|
|
101
|
+
└── DESIGN.md - Detailed architecture documentation
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Core Design Principles
|
|
105
|
+
|
|
106
|
+
### 1. Fixed-Corner Resize
|
|
107
|
+
|
|
108
|
+
When dragging a corner handle, the **diagonally opposite corner stays fixed** in world space:
|
|
109
|
+
|
|
110
|
+
- Drag top-left → bottom-right stays put
|
|
111
|
+
- Drag top-right → bottom-left stays put
|
|
112
|
+
- Works correctly even when rotated
|
|
113
|
+
|
|
114
|
+
**Implementation:** `GeometryUtils.js:calculateFixedCornerPosition()`
|
|
115
|
+
|
|
116
|
+
- Uses rotation matrix math to keep opposite corner stationary
|
|
117
|
+
- Transform pipeline: local coords → rotate → translate to world coords
|
|
118
|
+
|
|
119
|
+
### 2. Rotation Handle Position
|
|
120
|
+
|
|
121
|
+
- **Distance**: 50px below the bottom edge (world coordinates)
|
|
122
|
+
- **Alignment**: Centered horizontally on bounding box
|
|
123
|
+
- **Visual consistency**: Distance compensated for scale
|
|
124
|
+
|
|
125
|
+
**Implementation:** `GeometryUtils.js:calculateRotationHandlePosition()`
|
|
126
|
+
|
|
127
|
+
### 3. Uniform Scaling
|
|
128
|
+
|
|
129
|
+
- Corner handles apply uniform scale (no skewing)
|
|
130
|
+
- Side handles (only on straight text) change width only
|
|
131
|
+
- Scale immediately baked into dimensions (no accumulated transforms)
|
|
132
|
+
|
|
133
|
+
## Transform Types
|
|
134
|
+
|
|
135
|
+
### Implemented ✅
|
|
136
|
+
|
|
137
|
+
1. **CustomTransform** (`CustomTransform.js`)
|
|
138
|
+
|
|
139
|
+
- Straight text in a rectangular container
|
|
140
|
+
- Supports both corner handles (uniform scale) and side handles (width only)
|
|
141
|
+
- Word wrapping
|
|
142
|
+
|
|
143
|
+
2. **CircleTransform** (`CircleTransform.js`)
|
|
144
|
+
|
|
145
|
+
- Text follows a circular path
|
|
146
|
+
- Characters positioned along the circle arc
|
|
147
|
+
- Centered at top of circle
|
|
148
|
+
- Ported from existing `EditableTextPath.jsx` circle mode
|
|
149
|
+
|
|
150
|
+
3. **ArchTransform** (`ArchTransform.js`)
|
|
151
|
+
- Text curves upward in an arc
|
|
152
|
+
- Parabolic curve shape
|
|
153
|
+
- Uniform scaling
|
|
154
|
+
|
|
155
|
+
### To Be Implemented 🚧
|
|
156
|
+
|
|
157
|
+
4. **WaveTransform** - Sine wave pattern
|
|
158
|
+
5. **RiseTransform** - Rising curve effect
|
|
159
|
+
6. **FlagTransform** - Wavy flag effect
|
|
160
|
+
7. **AngleTransform** - Diagonal/angled text
|
|
161
|
+
8. **DistortTransform** - Perspective distortion
|
|
162
|
+
|
|
163
|
+
## Getting Started
|
|
164
|
+
|
|
165
|
+
### Installation
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
cd custom-canvas
|
|
169
|
+
npm install
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Development
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
npm run dev
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Open [http://localhost:5173](http://localhost:5173) in your browser.
|
|
179
|
+
|
|
180
|
+
### Build
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
npm run build
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Usage Example
|
|
187
|
+
|
|
188
|
+
```javascript
|
|
189
|
+
import { CustomTransform, CircleTransform } from "./transforms";
|
|
190
|
+
|
|
191
|
+
// Create a straight text shape
|
|
192
|
+
const straightText = new CustomTransform({
|
|
193
|
+
text: "Hello World",
|
|
194
|
+
x: 100,
|
|
195
|
+
y: 100,
|
|
196
|
+
fontSize: 24,
|
|
197
|
+
color: "#333",
|
|
198
|
+
transformData: { width: 200 },
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
// Create a circular text shape
|
|
202
|
+
const circularText = new CircleTransform({
|
|
203
|
+
text: "Circular Text",
|
|
204
|
+
x: 300,
|
|
205
|
+
y: 200,
|
|
206
|
+
fontSize: 20,
|
|
207
|
+
color: "#0066cc",
|
|
208
|
+
transformData: { radius: 80, scale: 1 },
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
// Render on canvas
|
|
212
|
+
const ctx = canvas.getContext("2d");
|
|
213
|
+
straightText.render(ctx);
|
|
214
|
+
circularText.render(ctx);
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Creating a New Transform Type
|
|
218
|
+
|
|
219
|
+
1. Create a new file in `src/transforms/` (e.g., `WaveTransform.js`)
|
|
220
|
+
|
|
221
|
+
2. Extend `TextShape` base class:
|
|
222
|
+
|
|
223
|
+
```javascript
|
|
224
|
+
import { TextShape } from "../core/TextShape.js";
|
|
225
|
+
|
|
226
|
+
export class WaveTransform extends TextShape {
|
|
227
|
+
constructor(config = {}) {
|
|
228
|
+
super(config);
|
|
229
|
+
this.transformType = "wave";
|
|
230
|
+
|
|
231
|
+
// Transform-specific data
|
|
232
|
+
this.transformData.amplitude = config.transformData?.amplitude || 20;
|
|
233
|
+
this.transformData.frequency = config.transformData?.frequency || 2;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
getBoundingBox() {
|
|
237
|
+
// Return {x, y, width, height} in world coordinates
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
render(ctx, isSelected = false) {
|
|
241
|
+
// Draw the transformed text on canvas
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
resize(anchor, newWidth, newHeight, startData) {
|
|
245
|
+
// Handle resize transformation
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
getEnabledAnchors() {
|
|
249
|
+
// Return array of enabled anchor names
|
|
250
|
+
return ["top-left", "top-right", "bottom-left", "bottom-right"];
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
3. Export from `src/transforms/index.js`
|
|
256
|
+
4. Add to `TRANSFORM_TYPES` array in `App.jsx`
|
|
257
|
+
|
|
258
|
+
## Key Components
|
|
259
|
+
|
|
260
|
+
### TextShape (Base Class)
|
|
261
|
+
|
|
262
|
+
- Common interface for all text shapes
|
|
263
|
+
- Properties: text, position, rotation, fontSize, color
|
|
264
|
+
- Methods: getBoundingBox(), hitTest(), render(), resize()
|
|
265
|
+
|
|
266
|
+
### TransformHandles
|
|
267
|
+
|
|
268
|
+
- Manages 8 resize handles (4 corners + 4 sides)
|
|
269
|
+
- Manages rotation handle
|
|
270
|
+
- Hit detection
|
|
271
|
+
- Rendering with consistent style
|
|
272
|
+
|
|
273
|
+
### CanvasEditor
|
|
274
|
+
|
|
275
|
+
- Main React component
|
|
276
|
+
- Canvas rendering loop
|
|
277
|
+
- Mouse interaction (drag, resize, rotate)
|
|
278
|
+
- Selection management
|
|
279
|
+
|
|
280
|
+
### GeometryUtils
|
|
281
|
+
|
|
282
|
+
- `calculateFixedCornerPosition()` - Keep opposite corner fixed during resize
|
|
283
|
+
- `calculateRotationHandlePosition()` - Position rotation handle
|
|
284
|
+
- `calculateResizeHandles()` - Calculate all 8 handle positions
|
|
285
|
+
- `hitTestRect()` - Hit test for rotated rectangles
|
|
286
|
+
- `hitTestCircle()` - Hit test for circles
|
|
287
|
+
- `measureTextWidth()` - Measure text using canvas API
|
|
288
|
+
|
|
289
|
+
## Transform Handle Behavior
|
|
290
|
+
|
|
291
|
+
### Corner Handles
|
|
292
|
+
|
|
293
|
+
- **What they do**: Uniform scale (fontSize and dimensions both change)
|
|
294
|
+
- **Fixed point**: Diagonally opposite corner stays in place
|
|
295
|
+
- **Enabled on**: All transform types
|
|
296
|
+
|
|
297
|
+
### Side Handles
|
|
298
|
+
|
|
299
|
+
- **What they do**: Width only (fontSize stays constant)
|
|
300
|
+
- **Fixed point**: Opposite side edge
|
|
301
|
+
- **Enabled on**: Straight text only (CustomTransform)
|
|
302
|
+
|
|
303
|
+
### Rotation Handle
|
|
304
|
+
|
|
305
|
+
- **What it does**: Rotates around center of bounding box
|
|
306
|
+
- **Position**: 50px below bottom edge, centered
|
|
307
|
+
- **Visual feedback**: Shows angle tooltip while rotating
|
|
308
|
+
|
|
309
|
+
## Architecture Highlights
|
|
310
|
+
|
|
311
|
+
| Aspect | Implementation |
|
|
312
|
+
| --------------------- | --------------------------------------------------- |
|
|
313
|
+
| **Code Organization** | ~200 lines per file, modular components |
|
|
314
|
+
| **Transform System** | Direct Canvas API control with rotation matrix math |
|
|
315
|
+
| **Maintainability** | Clean separation of concerns, type-safe |
|
|
316
|
+
| **Extensibility** | Easy to add transforms (extend base class) |
|
|
317
|
+
| **Performance** | Direct canvas API + Web Worker exports |
|
|
318
|
+
| **Effects Pipeline** | Strokes, masks, distress, knockout compositing |
|
|
319
|
+
|
|
320
|
+
## Next Steps
|
|
321
|
+
|
|
322
|
+
1. **Implement Remaining Transforms**
|
|
323
|
+
|
|
324
|
+
- WaveTransform (sine wave pattern)
|
|
325
|
+
- RiseTransform (rising curve)
|
|
326
|
+
- FlagTransform (wavy flag)
|
|
327
|
+
- AngleTransform (diagonal)
|
|
328
|
+
- DistortTransform (perspective)
|
|
329
|
+
|
|
330
|
+
2. **Add Text Editing**
|
|
331
|
+
|
|
332
|
+
- Double-click to edit text
|
|
333
|
+
- Text editor overlay
|
|
334
|
+
- Support for font family selection
|
|
335
|
+
|
|
336
|
+
3. **Keyboard Shortcuts**
|
|
337
|
+
|
|
338
|
+
- Delete selected shape
|
|
339
|
+
- Duplicate shape
|
|
340
|
+
- Undo/redo
|
|
341
|
+
|
|
342
|
+
4. **Export/Import**
|
|
343
|
+
- Save shapes to JSON
|
|
344
|
+
- Load shapes from JSON
|
|
345
|
+
- Export as image
|
|
346
|
+
|
|
347
|
+
## Contributing
|
|
348
|
+
|
|
349
|
+
To add a new transform type:
|
|
350
|
+
|
|
351
|
+
1. See "Creating a New Transform Type" section above
|
|
352
|
+
2. Follow the existing patterns in `CustomTransform.js` and `CircleTransform.js`
|
|
353
|
+
3. Test resize and rotation behavior match existing transforms
|
|
354
|
+
|
|
355
|
+
## License
|
|
356
|
+
|
|
357
|
+
MIT
|