@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,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for auto-export behavior
|
|
3
|
+
*/
|
|
4
|
+
export interface AutoExportConfig {
|
|
5
|
+
/** Enable/disable auto-export */
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
/** Debounce delay - wait this long after last change before exporting (ms) */
|
|
8
|
+
debounceMs: number;
|
|
9
|
+
/** Maximum wait time - force export after this duration even if changes keep coming (ms) */
|
|
10
|
+
maxWaitMs: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Default configuration values
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEFAULT_AUTO_EXPORT_CONFIG: AutoExportConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Statistics about auto-export behavior
|
|
18
|
+
*/
|
|
19
|
+
export interface AutoExportStats {
|
|
20
|
+
/** Total number of exports triggered */
|
|
21
|
+
totalExports: number;
|
|
22
|
+
/** Number of exports skipped due to no changes */
|
|
23
|
+
skippedExports: number;
|
|
24
|
+
/** Last export timestamp */
|
|
25
|
+
lastExportTime: number | null;
|
|
26
|
+
/** Average time between exports (ms) */
|
|
27
|
+
avgExportInterval: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Manages automatic export triggered by editor state changes.
|
|
31
|
+
*
|
|
32
|
+
* Uses lodash debounce with `maxWait` to batch rapid changes (drag operations,
|
|
33
|
+
* continuous typing) into a single export while guaranteeing a maximum latency.
|
|
34
|
+
* Performs deep state comparison to skip no-op exports.
|
|
35
|
+
*
|
|
36
|
+
* Typically used via the `useAutoExport` hook rather than directly.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const manager = new AutoExportManager({ enabled: true, debounceMs: 100, maxWaitMs: 1000 });
|
|
41
|
+
* manager.onExport(async () => { await exportAllArtboards(); });
|
|
42
|
+
* manager.scheduleExport(); // debounced
|
|
43
|
+
* manager.destroy(); // cleanup
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare class AutoExportManager {
|
|
47
|
+
private config;
|
|
48
|
+
private debouncedExport;
|
|
49
|
+
private onExportCallback;
|
|
50
|
+
private onExportScheduledCallback;
|
|
51
|
+
private revision;
|
|
52
|
+
private lastExportedRevision;
|
|
53
|
+
private stats;
|
|
54
|
+
private exportTimestamps;
|
|
55
|
+
constructor(config?: Partial<AutoExportConfig>);
|
|
56
|
+
/**
|
|
57
|
+
* Schedule an export (will be debounced)
|
|
58
|
+
* Call this whenever any change happens in the editor
|
|
59
|
+
*/
|
|
60
|
+
scheduleExport(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Force an immediate export (bypassing debounce)
|
|
63
|
+
*/
|
|
64
|
+
forceExport(): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Internal: Perform the actual export
|
|
67
|
+
*
|
|
68
|
+
* PERF: Uses a revision counter instead of JSON.stringify for change detection.
|
|
69
|
+
* scheduleExport() bumps `this.revision`; we compare it to `lastExportedRevision`.
|
|
70
|
+
* This eliminates the expensive JSON.stringify of all elements+artboards that was
|
|
71
|
+
* causing ~50-200ms of main-thread work every time the debounce fired (~1s).
|
|
72
|
+
*
|
|
73
|
+
* The export callback itself (element serialization + worker postMessage) is
|
|
74
|
+
* deferred via setTimeout(0) so it doesn't block the current animation frame.
|
|
75
|
+
*/
|
|
76
|
+
private performExport;
|
|
77
|
+
/**
|
|
78
|
+
* Register callback to be called when export should happen
|
|
79
|
+
*/
|
|
80
|
+
onExport(callback: () => void | Promise<void>): void;
|
|
81
|
+
/**
|
|
82
|
+
* Register callback to be notified when an export is scheduled (before debounce)
|
|
83
|
+
* This is called immediately when a change is detected, allowing consumers
|
|
84
|
+
* to show loading indicators before the actual export completes.
|
|
85
|
+
*/
|
|
86
|
+
onExportScheduled(callback: () => void): void;
|
|
87
|
+
/**
|
|
88
|
+
* Update configuration (can be called while running)
|
|
89
|
+
*/
|
|
90
|
+
updateConfig(newConfig: Partial<AutoExportConfig>): void;
|
|
91
|
+
/**
|
|
92
|
+
* Get current statistics
|
|
93
|
+
*/
|
|
94
|
+
getStats(): AutoExportStats;
|
|
95
|
+
/**
|
|
96
|
+
* Reset statistics
|
|
97
|
+
*/
|
|
98
|
+
resetStats(): void;
|
|
99
|
+
/**
|
|
100
|
+
* Reset change detection (next export will always trigger)
|
|
101
|
+
*/
|
|
102
|
+
resetChangeDetection(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Cleanup resources
|
|
105
|
+
*/
|
|
106
|
+
destroy(): void;
|
|
107
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fal.ai API Service - Background Removal
|
|
3
|
+
*
|
|
4
|
+
* Uses the fal.ai/bria/background/remove API (Bria RMBG 2.0) to remove backgrounds from images.
|
|
5
|
+
* This model is trained exclusively on licensed data for commercial use.
|
|
6
|
+
*
|
|
7
|
+
* API Key: Set VITE_FAL_API_KEY in your .env file
|
|
8
|
+
* Get your API key from: https://fal.ai/dashboard/keys
|
|
9
|
+
*
|
|
10
|
+
* Documentation: https://fal.ai/models/fal-ai/bria/background/remove/api
|
|
11
|
+
*/
|
|
12
|
+
export interface RemoveBackgroundRequest {
|
|
13
|
+
image_url: string;
|
|
14
|
+
sync_mode?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface RemoveBackgroundResponse {
|
|
17
|
+
image: {
|
|
18
|
+
url: string;
|
|
19
|
+
content_type: string;
|
|
20
|
+
file_name: string;
|
|
21
|
+
file_size: number;
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Check if fal.ai API is configured
|
|
28
|
+
*/
|
|
29
|
+
export declare function isFalConfigured(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Remove background from an image using fal.ai Bria RMBG 2.0 API
|
|
32
|
+
* This model is trained on licensed data and suitable for commercial use.
|
|
33
|
+
*
|
|
34
|
+
* @param imageUrl - URL of the image to process
|
|
35
|
+
* @param options - Optional parameters (sync_mode)
|
|
36
|
+
* @returns Promise with the processed image data
|
|
37
|
+
*/
|
|
38
|
+
export declare function removeBackground(imageUrl: string, options?: {
|
|
39
|
+
syncMode?: boolean;
|
|
40
|
+
}): Promise<RemoveBackgroundResponse>;
|
|
41
|
+
/**
|
|
42
|
+
* Convert the fal.ai response image to a data URL
|
|
43
|
+
* Useful for immediate preview without external dependencies
|
|
44
|
+
*
|
|
45
|
+
* @param imageUrl - URL from fal.ai response
|
|
46
|
+
* @returns Promise with data URL
|
|
47
|
+
*/
|
|
48
|
+
export declare function convertToDataUrl(imageUrl: string): Promise<string>;
|
|
49
|
+
/**
|
|
50
|
+
* Check if a URL or data URL points to an SVG image
|
|
51
|
+
*
|
|
52
|
+
* @param url - Image URL or data URL
|
|
53
|
+
* @returns true if the image is SVG
|
|
54
|
+
*/
|
|
55
|
+
export declare function isSvgImage(url: string): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Convert an SVG image to PNG using canvas
|
|
58
|
+
*
|
|
59
|
+
* @param svgUrl - URL or data URL of the SVG image
|
|
60
|
+
* @param maxWidth - Maximum width for the output PNG (default: 2048)
|
|
61
|
+
* @returns Promise with PNG data URL
|
|
62
|
+
*/
|
|
63
|
+
export declare function convertSvgToPng(svgUrl: string, maxWidth?: number): Promise<string>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Noun Project API Service
|
|
3
|
+
*
|
|
4
|
+
* Provides access to The Noun Project's icon/vector graphics API
|
|
5
|
+
* API Documentation: https://api.thenounproject.com/documentation.html
|
|
6
|
+
*
|
|
7
|
+
* Authentication: OAuth 1.0
|
|
8
|
+
* - API Key and Secret required (set via environment variables)
|
|
9
|
+
* - VITE_NOUN_PROJECT_API_KEY
|
|
10
|
+
* - VITE_NOUN_PROJECT_API_SECRET
|
|
11
|
+
*
|
|
12
|
+
* Note: For production, OAuth 1.0 authentication should be handled server-side
|
|
13
|
+
* to protect the API secret. This client-side implementation is for development only.
|
|
14
|
+
*/
|
|
15
|
+
export interface NounProjectIcon {
|
|
16
|
+
id: string;
|
|
17
|
+
term: string;
|
|
18
|
+
thumbnail_url: string;
|
|
19
|
+
permalink: string;
|
|
20
|
+
attribution: string;
|
|
21
|
+
license_description: string;
|
|
22
|
+
creator: {
|
|
23
|
+
name: string;
|
|
24
|
+
username: string;
|
|
25
|
+
permalink: string;
|
|
26
|
+
};
|
|
27
|
+
collections?: Array<{
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}>;
|
|
31
|
+
tags?: string[];
|
|
32
|
+
styles?: Array<{
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
}>;
|
|
36
|
+
icon_url?: string;
|
|
37
|
+
preview_url?: string;
|
|
38
|
+
preview_url_42?: string;
|
|
39
|
+
preview_url_84?: string;
|
|
40
|
+
preview_url_200?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface VectorResult {
|
|
43
|
+
id: string;
|
|
44
|
+
urls: {
|
|
45
|
+
svg?: string;
|
|
46
|
+
png: string;
|
|
47
|
+
preview: string;
|
|
48
|
+
thumbnail: string;
|
|
49
|
+
};
|
|
50
|
+
term: string;
|
|
51
|
+
attribution: string | null;
|
|
52
|
+
uploader: {
|
|
53
|
+
name: string;
|
|
54
|
+
username: string;
|
|
55
|
+
};
|
|
56
|
+
source: 'noun-project';
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Check if API keys are configured
|
|
60
|
+
* When using proxy, we assume the proxy has the keys configured
|
|
61
|
+
*/
|
|
62
|
+
export declare const isNounProjectConfigured: () => boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Search for icons/vectors
|
|
65
|
+
*/
|
|
66
|
+
export declare const searchIcons: (query: string, options?: {
|
|
67
|
+
limit?: number;
|
|
68
|
+
includeSvg?: boolean;
|
|
69
|
+
limitToPublicDomain?: boolean;
|
|
70
|
+
nextPage?: string;
|
|
71
|
+
}) => Promise<{
|
|
72
|
+
results: VectorResult[];
|
|
73
|
+
nextPage: string | null;
|
|
74
|
+
}>;
|
|
75
|
+
/**
|
|
76
|
+
* Get popular/featured icons
|
|
77
|
+
*/
|
|
78
|
+
export declare const getFeaturedIcons: (options: {
|
|
79
|
+
limit?: number;
|
|
80
|
+
includeSvg?: boolean;
|
|
81
|
+
}) => Promise<VectorResult[]>;
|
|
82
|
+
/**
|
|
83
|
+
* Get SVG download URL for a specific icon
|
|
84
|
+
* Uses the /v2/icon/{id}/download endpoint
|
|
85
|
+
*
|
|
86
|
+
* @param iconId - The icon ID (without 'noun-' prefix)
|
|
87
|
+
* @param color - Optional hex color (without #)
|
|
88
|
+
* @returns Download URL for the SVG file
|
|
89
|
+
*/
|
|
90
|
+
export declare const getIconSvgUrl: (iconId: string, color?: string) => string;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recraft V3 API Service
|
|
3
|
+
*
|
|
4
|
+
* Provides AI-powered image generation capabilities using Recraft's API.
|
|
5
|
+
* Supports both photo-realistic and vector (SVG) digital illustration styles.
|
|
6
|
+
*
|
|
7
|
+
* API Documentation: https://www.recraft.ai/docs/api-reference/getting-started
|
|
8
|
+
*
|
|
9
|
+
* Environment Variable:
|
|
10
|
+
* - VITE_RECRAFT_API_TOKEN - Get from https://www.recraft.ai/
|
|
11
|
+
*/
|
|
12
|
+
interface RecraftGenerationRequest {
|
|
13
|
+
prompt: string;
|
|
14
|
+
style: string;
|
|
15
|
+
model?: 'recraftv3';
|
|
16
|
+
size?: '1024x1024' | '1365x1024' | '1024x1365' | '1536x1024' | '1024x1536' | '1820x1024' | '1024x1820' | '1024x2048' | '2048x1024' | '1434x1024' | '1024x1434' | '1024x1280' | '1280x1024' | '1024x1707' | '1707x1024';
|
|
17
|
+
n?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface RecraftResult {
|
|
20
|
+
id: string;
|
|
21
|
+
url: string;
|
|
22
|
+
prompt: string;
|
|
23
|
+
style: string;
|
|
24
|
+
format: 'png' | 'svg';
|
|
25
|
+
created: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Recraft V3 Styles and Substyles
|
|
29
|
+
* Based on official API documentation
|
|
30
|
+
*/
|
|
31
|
+
export type RecraftStyleType = 'realistic_image' | 'digital_illustration' | 'vector_illustration';
|
|
32
|
+
export interface RecraftStyleOption {
|
|
33
|
+
value: RecraftStyleType;
|
|
34
|
+
label: string;
|
|
35
|
+
substyles: string[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Available styles with their substyles (Recraft V3 only)
|
|
39
|
+
*/
|
|
40
|
+
export declare const RECRAFT_STYLES: RecraftStyleOption[];
|
|
41
|
+
/**
|
|
42
|
+
* Check if Recraft API is configured
|
|
43
|
+
*/
|
|
44
|
+
export declare function isRecraftConfigured(): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Generate an image using Recraft V3 API
|
|
47
|
+
*
|
|
48
|
+
* @param prompt - Text description of the image to generate
|
|
49
|
+
* @param style - Style type ('realistic_image', 'digital_illustration', 'vector_illustration')
|
|
50
|
+
* @param substyle - Optional substyle name for the selected style
|
|
51
|
+
* @param options - Additional generation options (size, n)
|
|
52
|
+
* @returns Promise resolving to generated image result
|
|
53
|
+
*/
|
|
54
|
+
export declare function generateImage(prompt: string, style: RecraftStyleType, substyle?: string, options?: {
|
|
55
|
+
size?: RecraftGenerationRequest['size'];
|
|
56
|
+
n?: number;
|
|
57
|
+
}): Promise<RecraftResult>;
|
|
58
|
+
/**
|
|
59
|
+
* Download image data from Recraft URL
|
|
60
|
+
*
|
|
61
|
+
* @param url - Image URL from Recraft API
|
|
62
|
+
* @returns Promise resolving to data URL (for SVG) or blob URL (for PNG)
|
|
63
|
+
*/
|
|
64
|
+
export declare function downloadRecraftImage(url: string): Promise<string>;
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runware API Service - AI Image Generation
|
|
3
|
+
*
|
|
4
|
+
* Uses the Runware AI SDK for high-performance image generation via WebSocket.
|
|
5
|
+
*
|
|
6
|
+
* API Key: Set VITE_RUNWARE_API_KEY in your .env file
|
|
7
|
+
* Get your API key from: https://runware.ai/
|
|
8
|
+
*
|
|
9
|
+
* Documentation: https://runware.ai/docs/en/libraries/javascript
|
|
10
|
+
* SDK: @runware/sdk-js
|
|
11
|
+
*/
|
|
12
|
+
export declare const RUNWARE_MODELS: readonly [{
|
|
13
|
+
readonly id: "runware:101@1";
|
|
14
|
+
readonly name: "Flux Dev";
|
|
15
|
+
readonly description: "High-quality generation with excellent detail and composition";
|
|
16
|
+
readonly supportsSteps: true;
|
|
17
|
+
readonly supportsCFGScale: true;
|
|
18
|
+
readonly supportsNegativePrompt: true;
|
|
19
|
+
}, {
|
|
20
|
+
readonly id: "google:4@2";
|
|
21
|
+
readonly name: "Nano Banana 2 Pro";
|
|
22
|
+
readonly description: "Advanced Google model for controlled visual creation";
|
|
23
|
+
readonly supportsSteps: false;
|
|
24
|
+
readonly supportsCFGScale: false;
|
|
25
|
+
readonly supportsNegativePrompt: false;
|
|
26
|
+
}];
|
|
27
|
+
export type RunwareModelId = (typeof RUNWARE_MODELS)[number]['id'];
|
|
28
|
+
export interface GenerateImageRequest {
|
|
29
|
+
prompt: string;
|
|
30
|
+
model: RunwareModelId;
|
|
31
|
+
width?: number;
|
|
32
|
+
height?: number;
|
|
33
|
+
steps?: number;
|
|
34
|
+
cfgScale?: number;
|
|
35
|
+
negativePrompt?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface GeneratedImage {
|
|
38
|
+
imageURL: string;
|
|
39
|
+
imageUUID: string;
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
}
|
|
43
|
+
export interface GenerateImageResponse {
|
|
44
|
+
images: GeneratedImage[];
|
|
45
|
+
taskUUID: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Check if Runware API is configured
|
|
49
|
+
*/
|
|
50
|
+
export declare function isRunwareConfigured(): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Generate images using Runware AI
|
|
53
|
+
*
|
|
54
|
+
* @param request - Image generation parameters
|
|
55
|
+
* @returns Promise with generated images
|
|
56
|
+
*/
|
|
57
|
+
export declare function generateImages(request: GenerateImageRequest): Promise<GenerateImageResponse>;
|
|
58
|
+
/**
|
|
59
|
+
* Convert image URL to data URL for immediate use
|
|
60
|
+
*
|
|
61
|
+
* @param imageUrl - URL from Runware response
|
|
62
|
+
* @returns Promise with data URL
|
|
63
|
+
*/
|
|
64
|
+
export declare function convertImageToDataUrl(imageUrl: string): Promise<string>;
|
|
65
|
+
/**
|
|
66
|
+
* Disconnect the Runware SDK instance
|
|
67
|
+
* Call this when the app is closing or you want to clean up the connection
|
|
68
|
+
*/
|
|
69
|
+
export declare function disconnectRunware(): Promise<void>;
|