@ggraphic/editor 0.0.0-stage → 0.0.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 +373 -0
- package/NOTICE +2 -0
- package/README.md +8 -2
- package/THIRD_PARTY_NOTICES +7 -0
- package/dist/CanvasEditorProvider.d.ts +214 -0
- package/dist/CanvasEditorProvider.js +10 -0
- package/dist/ai/applyOperation.d.ts +75 -0
- package/dist/ai/applyOperation.js +354 -0
- package/dist/ai/describeCanvasElements.d.ts +17 -0
- package/dist/ai/describeCanvasElements.js +148 -0
- package/dist/ai/illustrationCapability.d.ts +6 -0
- package/dist/ai/illustrationCapability.js +20 -0
- package/dist/ai/types.d.ts +91 -0
- package/dist/ai/types.js +1 -0
- package/dist/blocks/liftedBlock.d.ts +61 -0
- package/dist/blocks/liftedBlock.js +117 -0
- package/dist/brand/bindPick.d.ts +18 -0
- package/dist/brand/bindPick.js +28 -0
- package/dist/brand/bindableFields.d.ts +9 -0
- package/dist/brand/bindableFields.js +61 -0
- package/dist/brand/brandRegistry.d.ts +18 -0
- package/dist/brand/brandRegistry.js +41 -0
- package/dist/brand/composerBrand.d.ts +146 -0
- package/dist/brand/composerBrand.js +6 -0
- package/dist/collab/documentVersion.d.ts +36 -0
- package/dist/collab/documentVersion.js +139 -0
- package/dist/collab/pageElementStateKeys.d.ts +33 -0
- package/dist/collab/pageElementStateKeys.js +148 -0
- package/dist/collab/pagesDoc.d.ts +152 -0
- package/dist/collab/pagesDoc.js +434 -0
- package/dist/collab/useAwarenessState.d.ts +12 -0
- package/dist/collab/useAwarenessState.js +47 -0
- package/dist/collab/useEmitHostStateChanges.d.ts +18 -0
- package/dist/collab/useEmitHostStateChanges.js +40 -0
- package/dist/collab/useSelectionAwareness.d.ts +22 -0
- package/dist/collab/useSelectionAwareness.js +60 -0
- package/dist/collab/useYjsCanvasBinding.d.ts +7 -0
- package/dist/collab/useYjsCanvasBinding.js +21 -0
- package/dist/collab/useYjsPageStateSync.d.ts +20 -0
- package/dist/collab/useYjsPageStateSync.js +49 -0
- package/dist/collab/useYjsPages.d.ts +73 -0
- package/dist/collab/useYjsPages.js +396 -0
- package/dist/collab/wrapCallbacksWithPageSync.d.ts +3 -0
- package/dist/collab/wrapCallbacksWithPageSync.js +62 -0
- package/dist/collab/ydocKeys.d.ts +50 -0
- package/dist/collab/ydocKeys.js +50 -0
- package/dist/collab/yjsBinding.d.ts +27 -0
- package/dist/collab/yjsBinding.js +105 -0
- package/dist/common/Lightbox.d.ts +8 -0
- package/dist/common/Lightbox.js +8 -0
- package/dist/common/imageSourceTypes.d.ts +1 -0
- package/dist/common/imageSourceTypes.js +1 -0
- package/dist/components/AddPageButton.d.ts +13 -0
- package/dist/components/AddPageButton.js +13 -0
- package/dist/components/CanvasAnnouncer.d.ts +8 -0
- package/dist/components/CanvasAnnouncer.js +10 -0
- package/dist/components/CanvasContextMenu/CanvasActionSheet.d.ts +12 -0
- package/dist/components/CanvasContextMenu/CanvasActionSheet.js +145 -0
- package/dist/components/CanvasContextMenu/CanvasContextMenu.d.ts +33 -0
- package/dist/components/CanvasContextMenu/CanvasContextMenu.js +107 -0
- package/dist/components/CanvasContextMenu/canvasMenuModel.d.ts +68 -0
- package/dist/components/CanvasContextMenu/canvasMenuModel.js +203 -0
- package/dist/components/CanvasEditor/CanvasEditorShell.d.ts +32 -0
- package/dist/components/CanvasEditor/CanvasEditorShell.js +1138 -0
- package/dist/components/CanvasEditor/PageWrapper.d.ts +7 -0
- package/dist/components/CanvasEditor/PageWrapper.js +103 -0
- package/dist/components/CanvasEditor/autoSwitchTab.d.ts +11 -0
- package/dist/components/CanvasEditor/autoSwitchTab.js +15 -0
- package/dist/components/CanvasEditor/blockInsertContext.d.ts +22 -0
- package/dist/components/CanvasEditor/blockInsertContext.js +5 -0
- package/dist/components/CanvasEditor/editorShell.d.ts +99 -0
- package/dist/components/CanvasEditor/editorShell.js +20 -0
- package/dist/components/CanvasEditor/hooks/useCanvasContextMenu.d.ts +32 -0
- package/dist/components/CanvasEditor/hooks/useCanvasContextMenu.js +140 -0
- package/dist/components/CanvasEditor/hooks/useLoadedConfigs.d.ts +13 -0
- package/dist/components/CanvasEditor/hooks/useLoadedConfigs.js +29 -0
- package/dist/components/CanvasEditor/hooks/useMobileSheetFit.d.ts +14 -0
- package/dist/components/CanvasEditor/hooks/useMobileSheetFit.js +56 -0
- package/dist/components/CanvasEditor/hooks/usePageRefs.d.ts +18 -0
- package/dist/components/CanvasEditor/hooks/usePageRefs.js +36 -0
- package/dist/components/CanvasEditor/hooks/usePageUndoRedoShortcuts.d.ts +25 -0
- package/dist/components/CanvasEditor/hooks/usePageUndoRedoShortcuts.js +49 -0
- package/dist/components/CanvasEditor/hooks/usePrintImpressumGate.d.ts +17 -0
- package/dist/components/CanvasEditor/hooks/usePrintImpressumGate.js +70 -0
- package/dist/components/CanvasEditor/hooks/useScrollToAddedPage.d.ts +17 -0
- package/dist/components/CanvasEditor/hooks/useScrollToAddedPage.js +31 -0
- package/dist/components/CanvasEditor/hooks/useToolbarHandlers.d.ts +75 -0
- package/dist/components/CanvasEditor/hooks/useToolbarHandlers.js +69 -0
- package/dist/components/CanvasEditor/hooks/useWorkAreaDeselect.d.ts +6 -0
- package/dist/components/CanvasEditor/hooks/useWorkAreaDeselect.js +56 -0
- package/dist/components/CanvasEditor/layersTab.d.ts +13 -0
- package/dist/components/CanvasEditor/layersTab.js +27 -0
- package/dist/components/CanvasEditor/mobileSelectionArea.d.ts +8 -0
- package/dist/components/CanvasEditor/mobileSelectionArea.js +27 -0
- package/dist/components/CanvasEditor/types.d.ts +202 -0
- package/dist/components/CanvasEditor/types.js +1 -0
- package/dist/components/CanvasEditorSkeleton.d.ts +16 -0
- package/dist/components/CanvasEditorSkeleton.js +24 -0
- package/dist/components/CanvasMetaBar.d.ts +16 -0
- package/dist/components/CanvasMetaBar.js +33 -0
- package/dist/components/CanvasRenderLayer.d.ts +37 -0
- package/dist/components/CanvasRenderLayer.js +54 -0
- package/dist/components/CanvasTextOverlay.d.ts +126 -0
- package/dist/components/CanvasTextOverlay.js +525 -0
- package/dist/components/ConfigCanvas.d.ts +35 -0
- package/dist/components/ConfigCanvas.js +30 -0
- package/dist/components/CropGhostOverlay.d.ts +13 -0
- package/dist/components/CropGhostOverlay.js +56 -0
- package/dist/components/CustomColorSwatch.d.ts +35 -0
- package/dist/components/CustomColorSwatch.js +80 -0
- package/dist/components/DownloadNotice.d.ts +7 -0
- package/dist/components/DownloadNotice.js +7 -0
- package/dist/components/GenericCanvas.d.ts +309 -0
- package/dist/components/GenericCanvas.js +780 -0
- package/dist/components/GenericCanvasElement.d.ts +34 -0
- package/dist/components/GenericCanvasElement.js +267 -0
- package/dist/components/MobileSelectionPill.d.ts +40 -0
- package/dist/components/MobileSelectionPill.js +85 -0
- package/dist/components/MultiSelectionTransformer.d.ts +39 -0
- package/dist/components/MultiSelectionTransformer.js +107 -0
- package/dist/components/PagePreview.d.ts +14 -0
- package/dist/components/PagePreview.js +63 -0
- package/dist/components/PageThumbnailStrip.d.ts +25 -0
- package/dist/components/PageThumbnailStrip.js +46 -0
- package/dist/components/PageToolbar.d.ts +12 -0
- package/dist/components/PageToolbar.js +20 -0
- package/dist/components/PrintGuides.d.ts +13 -0
- package/dist/components/PrintGuides.js +28 -0
- package/dist/components/RemoteSelectionOverlay.d.ts +15 -0
- package/dist/components/RemoteSelectionOverlay.js +29 -0
- package/dist/components/RichTextField.d.ts +34 -0
- package/dist/components/RichTextField.js +212 -0
- package/dist/components/SelectionPill.d.ts +56 -0
- package/dist/components/SelectionPill.js +123 -0
- package/dist/components/SlideNotesPanel.d.ts +13 -0
- package/dist/components/SlideNotesPanel.js +28 -0
- package/dist/components/SlotBudgetStatus.d.ts +12 -0
- package/dist/components/SlotBudgetStatus.js +64 -0
- package/dist/components/StandaloneCanvas.d.ts +33 -0
- package/dist/components/StandaloneCanvas.js +61 -0
- package/dist/components/TextFormatButtons.d.ts +61 -0
- package/dist/components/TextFormatButtons.js +123 -0
- package/dist/components/TextFormatControls.d.ts +26 -0
- package/dist/components/TextFormatControls.js +73 -0
- package/dist/components/Toolbar.d.ts +40 -0
- package/dist/components/Toolbar.js +26 -0
- package/dist/components/ToolbarStateBridge.d.ts +72 -0
- package/dist/components/ToolbarStateBridge.js +298 -0
- package/dist/components/TopBar/AutoSaveIndicator.d.ts +8 -0
- package/dist/components/TopBar/AutoSaveIndicator.js +44 -0
- package/dist/components/TopBar/ContextControls.d.ts +107 -0
- package/dist/components/TopBar/ContextControls.js +319 -0
- package/dist/components/TopBar/ContextToolbar.d.ts +14 -0
- package/dist/components/TopBar/ContextToolbar.js +20 -0
- package/dist/components/TopBar/CropModeControls.d.ts +35 -0
- package/dist/components/TopBar/CropModeControls.js +84 -0
- package/dist/components/TopBar/DownloadSection.d.ts +47 -0
- package/dist/components/TopBar/DownloadSection.js +102 -0
- package/dist/components/TopBar/MobileSelectionBar.d.ts +16 -0
- package/dist/components/TopBar/MobileSelectionBar.js +26 -0
- package/dist/components/TopBar/MobileSelectionControls.d.ts +10 -0
- package/dist/components/TopBar/MobileSelectionControls.js +43 -0
- package/dist/components/TopBar/MultiSelectionToolbar.d.ts +19 -0
- package/dist/components/TopBar/MultiSelectionToolbar.js +30 -0
- package/dist/components/TopBar/ShareDropdown.d.ts +54 -0
- package/dist/components/TopBar/ShareDropdown.js +110 -0
- package/dist/components/TopBar/TopBar.d.ts +6 -0
- package/dist/components/TopBar/TopBar.js +6 -0
- package/dist/components/TopBar/barTiles.d.ts +15 -0
- package/dist/components/TopBar/barTiles.js +34 -0
- package/dist/components/TopBar/modules/FloatingAiSuggestionBanner.d.ts +28 -0
- package/dist/components/TopBar/modules/FloatingAiSuggestionBanner.js +26 -0
- package/dist/components/TopBar/modules/FloatingBackgroundControls.d.ts +38 -0
- package/dist/components/TopBar/modules/FloatingBackgroundControls.js +133 -0
- package/dist/components/TopBar/modules/FloatingColorPicker.d.ts +16 -0
- package/dist/components/TopBar/modules/FloatingColorPicker.js +87 -0
- package/dist/components/TopBar/modules/FloatingFontRoleControl.d.ts +17 -0
- package/dist/components/TopBar/modules/FloatingFontRoleControl.js +37 -0
- package/dist/components/TopBar/modules/FloatingFontSizeControl.d.ts +7 -0
- package/dist/components/TopBar/modules/FloatingFontSizeControl.js +22 -0
- package/dist/components/TopBar/modules/FloatingGradientControl.d.ts +9 -0
- package/dist/components/TopBar/modules/FloatingGradientControl.js +35 -0
- package/dist/components/TopBar/modules/FloatingHistoryControls.d.ts +11 -0
- package/dist/components/TopBar/modules/FloatingHistoryControls.js +19 -0
- package/dist/components/TopBar/modules/FloatingImageLookControl.d.ts +9 -0
- package/dist/components/TopBar/modules/FloatingImageLookControl.js +15 -0
- package/dist/components/TopBar/modules/FloatingLayerControls.d.ts +9 -0
- package/dist/components/TopBar/modules/FloatingLayerControls.js +9 -0
- package/dist/components/TopBar/modules/FloatingOpacityControl.d.ts +11 -0
- package/dist/components/TopBar/modules/FloatingOpacityControl.js +19 -0
- package/dist/components/TopBar/modules/FloatingOutlineControl.d.ts +11 -0
- package/dist/components/TopBar/modules/FloatingOutlineControl.js +31 -0
- package/dist/components/TopBar/modules/FloatingPositionControl.d.ts +38 -0
- package/dist/components/TopBar/modules/FloatingPositionControl.js +74 -0
- package/dist/components/TopBar/modules/FloatingShadowControl.d.ts +12 -0
- package/dist/components/TopBar/modules/FloatingShadowControl.js +40 -0
- package/dist/components/TopBar/modules/FloatingTextAlignControl.d.ts +12 -0
- package/dist/components/TopBar/modules/FloatingTextAlignControl.js +27 -0
- package/dist/components/TransformHud.d.ts +11 -0
- package/dist/components/TransformHud.js +121 -0
- package/dist/components/WholeTextFormatControls.d.ts +10 -0
- package/dist/components/WholeTextFormatControls.js +37 -0
- package/dist/components/ZoomableViewport.d.ts +6 -0
- package/dist/components/ZoomableViewport.js +4 -0
- package/dist/components/accentMark.d.ts +20 -0
- package/dist/components/accentMark.js +24 -0
- package/dist/components/canvasItemLock.d.ts +13 -0
- package/dist/components/canvasItemLock.js +12 -0
- package/dist/components/kindRenderers.d.ts +118 -0
- package/dist/components/kindRenderers.js +151 -0
- package/dist/components/markColor.d.ts +13 -0
- package/dist/components/markColor.js +21 -0
- package/dist/components/markerMark.d.ts +19 -0
- package/dist/components/markerMark.js +26 -0
- package/dist/composer/cardFollowsText.d.ts +17 -0
- package/dist/composer/cardFollowsText.js +34 -0
- package/dist/composer/marks.d.ts +4 -0
- package/dist/composer/marks.js +15 -0
- package/dist/composer/steckbriefLayout.d.ts +147 -0
- package/dist/composer/steckbriefLayout.js +468 -0
- package/dist/composer/textFit.d.ts +31 -0
- package/dist/composer/textFit.js +89 -0
- package/dist/configs/buildSharepicText.d.ts +5 -0
- package/dist/configs/buildSharepicText.js +58 -0
- package/dist/configs/configLoader.d.ts +34 -0
- package/dist/configs/configLoader.js +60 -0
- package/dist/configs/factory/actionFactories.d.ts +172 -0
- package/dist/configs/factory/actionFactories.js +611 -0
- package/dist/configs/factory/baseTypes.d.ts +150 -0
- package/dist/configs/factory/baseTypes.js +8 -0
- package/dist/configs/factory/carryInstanceState.d.ts +82 -0
- package/dist/configs/factory/carryInstanceState.js +121 -0
- package/dist/configs/factory/createTextElement.d.ts +63 -0
- package/dist/configs/factory/createTextElement.js +63 -0
- package/dist/configs/factory/defineSection.d.ts +45 -0
- package/dist/configs/factory/defineSection.js +45 -0
- package/dist/configs/factory/layoutAccessors.d.ts +15 -0
- package/dist/configs/factory/layoutAccessors.js +20 -0
- package/dist/configs/featureInjector.d.ts +40 -0
- package/dist/configs/featureInjector.js +184 -0
- package/dist/configs/pageInheritance.d.ts +8 -0
- package/dist/configs/pageInheritance.js +82 -0
- package/dist/configs/placeholders.d.ts +14 -0
- package/dist/configs/placeholders.js +33 -0
- package/dist/configs/shareSection.d.ts +11 -0
- package/dist/configs/shareSection.js +65 -0
- package/dist/configs/types.d.ts +420 -0
- package/dist/configs/types.js +1 -0
- package/dist/configs/unifiedTabs.d.ts +26 -0
- package/dist/configs/unifiedTabs.js +6 -0
- package/dist/editorSeamTypes.d.ts +41 -0
- package/dist/editorSeamTypes.js +1 -0
- package/dist/export/pptx/buildPptxModel.d.ts +44 -0
- package/dist/export/pptx/buildPptxModel.js +612 -0
- package/dist/export/pptx/exportPptxDeck.d.ts +23 -0
- package/dist/export/pptx/exportPptxDeck.js +77 -0
- package/dist/export/pptx/pptxFonts.d.ts +26 -0
- package/dist/export/pptx/pptxFonts.js +41 -0
- package/dist/export/pptx/pptxUnits.d.ts +27 -0
- package/dist/export/pptx/pptxUnits.js +54 -0
- package/dist/export/pptx/textModel.d.ts +13 -0
- package/dist/export/pptx/textModel.js +115 -0
- package/dist/export/pptx/types.d.ts +161 -0
- package/dist/export/pptx/types.js +11 -0
- package/dist/export/pptx/writePptx.d.ts +40 -0
- package/dist/export/pptx/writePptx.js +206 -0
- package/dist/export/pptx/writeText.d.ts +19 -0
- package/dist/export/pptx/writeText.js +120 -0
- package/dist/export/printExport.d.ts +42 -0
- package/dist/export/printExport.js +94 -0
- package/dist/export/printPdf.d.ts +103 -0
- package/dist/export/printPdf.js +144 -0
- package/dist/export/slidesPdf.d.ts +9 -0
- package/dist/export/slidesPdf.js +31 -0
- package/dist/formats/index.d.ts +115 -0
- package/dist/formats/index.js +287 -0
- package/dist/groups/pageGroups.d.ts +32 -0
- package/dist/groups/pageGroups.js +91 -0
- package/dist/hooks/index.d.ts +29 -0
- package/dist/hooks/index.js +19 -0
- package/dist/hooks/useAiImageGeneration.d.ts +15 -0
- package/dist/hooks/useAiImageGeneration.js +73 -0
- package/dist/hooks/useAnnounce.d.ts +27 -0
- package/dist/hooks/useAnnounce.js +47 -0
- package/dist/hooks/useBoxSnap.d.ts +37 -0
- package/dist/hooks/useBoxSnap.js +49 -0
- package/dist/hooks/useCanvasAutoSave.d.ts +33 -0
- package/dist/hooks/useCanvasAutoSave.js +259 -0
- package/dist/hooks/useCanvasElementHandlers.d.ts +182 -0
- package/dist/hooks/useCanvasElementHandlers.js +326 -0
- package/dist/hooks/useCanvasHistorySetup.d.ts +37 -0
- package/dist/hooks/useCanvasHistorySetup.js +113 -0
- package/dist/hooks/useCanvasInteractions.d.ts +31 -0
- package/dist/hooks/useCanvasInteractions.js +103 -0
- package/dist/hooks/useCanvasKeyboardHandlers.d.ts +37 -0
- package/dist/hooks/useCanvasKeyboardHandlers.js +280 -0
- package/dist/hooks/useCanvasStoreReset.d.ts +25 -0
- package/dist/hooks/useCanvasStoreReset.js +35 -0
- package/dist/hooks/useCanvasUndoRedo.d.ts +34 -0
- package/dist/hooks/useCanvasUndoRedo.js +213 -0
- package/dist/hooks/useContextPress.d.ts +14 -0
- package/dist/hooks/useContextPress.js +45 -0
- package/dist/hooks/useCropSession.d.ts +23 -0
- package/dist/hooks/useCropSession.js +69 -0
- package/dist/hooks/useDebounce.d.ts +1 -0
- package/dist/hooks/useDebounce.js +14 -0
- package/dist/hooks/useDeckAutoSave.d.ts +30 -0
- package/dist/hooks/useDeckAutoSave.js +234 -0
- package/dist/hooks/useDeepSelect.d.ts +18 -0
- package/dist/hooks/useDeepSelect.js +135 -0
- package/dist/hooks/useElementSnapping.d.ts +13 -0
- package/dist/hooks/useElementSnapping.js +26 -0
- package/dist/hooks/useEmojiCatalog.d.ts +3 -0
- package/dist/hooks/useEmojiCatalog.js +13 -0
- package/dist/hooks/useFloatingModuleHandlers.d.ts +52 -0
- package/dist/hooks/useFloatingModuleHandlers.js +285 -0
- package/dist/hooks/useFloatingModuleState.d.ts +83 -0
- package/dist/hooks/useFloatingModuleState.js +250 -0
- package/dist/hooks/useFontGeneration.d.ts +10 -0
- package/dist/hooks/useFontGeneration.js +77 -0
- package/dist/hooks/useFontLoader.d.ts +53 -0
- package/dist/hooks/useFontLoader.js +129 -0
- package/dist/hooks/useGeometryReporter.d.ts +19 -0
- package/dist/hooks/useGeometryReporter.js +41 -0
- package/dist/hooks/useHoverOutline.d.ts +8 -0
- package/dist/hooks/useHoverOutline.js +78 -0
- package/dist/hooks/useIconCatalog.d.ts +12 -0
- package/dist/hooks/useIconCatalog.js +30 -0
- package/dist/hooks/useIconSearch.d.ts +2 -0
- package/dist/hooks/useIconSearch.js +14 -0
- package/dist/hooks/useIconSetsFor.d.ts +8 -0
- package/dist/hooks/useIconSetsFor.js +30 -0
- package/dist/hooks/useImageCoverFit.d.ts +17 -0
- package/dist/hooks/useImageCoverFit.js +35 -0
- package/dist/hooks/useIsCanvasMobile.d.ts +3 -0
- package/dist/hooks/useIsCanvasMobile.js +19 -0
- package/dist/hooks/useMarqueeSelection.d.ts +27 -0
- package/dist/hooks/useMarqueeSelection.js +140 -0
- package/dist/hooks/useMobileSheet.d.ts +48 -0
- package/dist/hooks/useMobileSheet.js +282 -0
- package/dist/hooks/useMultiPageExport.d.ts +30 -0
- package/dist/hooks/useMultiPageExport.js +117 -0
- package/dist/hooks/usePageManager.d.ts +132 -0
- package/dist/hooks/usePageManager.js +399 -0
- package/dist/hooks/usePageThumbnails.d.ts +10 -0
- package/dist/hooks/usePageThumbnails.js +122 -0
- package/dist/hooks/usePaginatedIcons.d.ts +11 -0
- package/dist/hooks/usePaginatedIcons.js +46 -0
- package/dist/hooks/useRovingToolbar.d.ts +17 -0
- package/dist/hooks/useRovingToolbar.js +76 -0
- package/dist/hooks/useSelectionAnnouncement.d.ts +13 -0
- package/dist/hooks/useSelectionAnnouncement.js +68 -0
- package/dist/hooks/useSnapScheduler.d.ts +20 -0
- package/dist/hooks/useSnapScheduler.js +61 -0
- package/dist/hooks/useTrackUnsplashDownload.d.ts +6 -0
- package/dist/hooks/useTrackUnsplashDownload.js +19 -0
- package/dist/hooks/useZoomGestures.d.ts +35 -0
- package/dist/hooks/useZoomGestures.js +185 -0
- package/dist/hostServices.d.ts +308 -0
- package/dist/hostServices.js +107 -0
- package/dist/i18n/de.d.ts +895 -0
- package/dist/i18n/de.js +959 -0
- package/dist/i18n/en.d.ts +3 -0
- package/dist/i18n/en.js +948 -0
- package/dist/i18n/messages.d.ts +28 -0
- package/dist/i18n/messages.js +66 -0
- package/dist/layouts/CanvasEditorLayout.d.ts +28 -0
- package/dist/layouts/CanvasEditorLayout.js +56 -0
- package/dist/layouts/index.d.ts +2 -0
- package/dist/layouts/index.js +2 -0
- package/dist/primitives/AssetPrimitive.d.ts +24 -0
- package/dist/primitives/AssetPrimitive.js +158 -0
- package/dist/primitives/CanvasBackground.d.ts +33 -0
- package/dist/primitives/CanvasBackground.js +44 -0
- package/dist/primitives/CanvasIcons.d.ts +19 -0
- package/dist/primitives/CanvasIcons.js +46 -0
- package/dist/primitives/CanvasImage.d.ts +73 -0
- package/dist/primitives/CanvasImage.js +460 -0
- package/dist/primitives/CanvasRichText.d.ts +25 -0
- package/dist/primitives/CanvasRichText.js +281 -0
- package/dist/primitives/CanvasStage.d.ts +84 -0
- package/dist/primitives/CanvasStage.js +291 -0
- package/dist/primitives/CanvasText.d.ts +91 -0
- package/dist/primitives/CanvasText.js +293 -0
- package/dist/primitives/ChartPrimitive.d.ts +24 -0
- package/dist/primitives/ChartPrimitive.js +318 -0
- package/dist/primitives/CircleBadge.d.ts +43 -0
- package/dist/primitives/CircleBadge.js +233 -0
- package/dist/primitives/FramePrimitive.d.ts +14 -0
- package/dist/primitives/FramePrimitive.js +406 -0
- package/dist/primitives/IconPrimitive.d.ts +28 -0
- package/dist/primitives/IconPrimitive.js +119 -0
- package/dist/primitives/IllustrationPrimitive.d.ts +16 -0
- package/dist/primitives/IllustrationPrimitive.js +184 -0
- package/dist/primitives/PillBadge.d.ts +45 -0
- package/dist/primitives/PillBadge.js +237 -0
- package/dist/primitives/ShapePrimitive.d.ts +12 -0
- package/dist/primitives/ShapePrimitive.js +521 -0
- package/dist/primitives/SnapGuidelines.d.ts +19 -0
- package/dist/primitives/SnapGuidelines.js +34 -0
- package/dist/primitives/UserImagePrimitive.d.ts +30 -0
- package/dist/primitives/UserImagePrimitive.js +494 -0
- package/dist/primitives/index.d.ts +18 -0
- package/dist/primitives/index.js +11 -0
- package/dist/sidebar/SidebarPanel.d.ts +8 -0
- package/dist/sidebar/SidebarPanel.js +219 -0
- package/dist/sidebar/SidebarTabBar.d.ts +2 -0
- package/dist/sidebar/SidebarTabBar.js +31 -0
- package/dist/sidebar/SubsectionTabBar.d.ts +13 -0
- package/dist/sidebar/SubsectionTabBar.js +30 -0
- package/dist/sidebar/UserUploadsProvider.d.ts +31 -0
- package/dist/sidebar/UserUploadsProvider.js +139 -0
- package/dist/sidebar/components/AltTextField.d.ts +21 -0
- package/dist/sidebar/components/AltTextField.js +60 -0
- package/dist/sidebar/components/SidebarHint.d.ts +7 -0
- package/dist/sidebar/components/SidebarHint.js +38 -0
- package/dist/sidebar/components/SidebarSlider.d.ts +16 -0
- package/dist/sidebar/components/SidebarSlider.js +9 -0
- package/dist/sidebar/components/TextFieldPrimitives.d.ts +26 -0
- package/dist/sidebar/components/TextFieldPrimitives.js +56 -0
- package/dist/sidebar/sections/ChartSettingsSection.d.ts +9 -0
- package/dist/sidebar/sections/ChartSettingsSection.js +75 -0
- package/dist/sidebar/sections/CombinedTextSection.d.ts +16 -0
- package/dist/sidebar/sections/CombinedTextSection.js +42 -0
- package/dist/sidebar/sections/DiagrammeSection.d.ts +9 -0
- package/dist/sidebar/sections/DiagrammeSection.js +41 -0
- package/dist/sidebar/sections/EffectsSection.d.ts +20 -0
- package/dist/sidebar/sections/EffectsSection.js +23 -0
- package/dist/sidebar/sections/FormenSection.d.ts +26 -0
- package/dist/sidebar/sections/FormenSection.js +428 -0
- package/dist/sidebar/sections/FrameSettingsSection.d.ts +8 -0
- package/dist/sidebar/sections/FrameSettingsSection.js +26 -0
- package/dist/sidebar/sections/GenericShareSection.d.ts +26 -0
- package/dist/sidebar/sections/GenericShareSection.js +262 -0
- package/dist/sidebar/sections/IconsSection.d.ts +8 -0
- package/dist/sidebar/sections/IconsSection.js +55 -0
- package/dist/sidebar/sections/IllustrationSettings.d.ts +9 -0
- package/dist/sidebar/sections/IllustrationSettings.js +32 -0
- package/dist/sidebar/sections/IllustrationThumb.d.ts +7 -0
- package/dist/sidebar/sections/IllustrationThumb.js +15 -0
- package/dist/sidebar/sections/ImageAdjustSection.d.ts +13 -0
- package/dist/sidebar/sections/ImageAdjustSection.js +84 -0
- package/dist/sidebar/sections/LayersSection.d.ts +25 -0
- package/dist/sidebar/sections/LayersSection.js +155 -0
- package/dist/sidebar/sections/RahmenSection.d.ts +7 -0
- package/dist/sidebar/sections/RahmenSection.js +18 -0
- package/dist/sidebar/sections/StudioGallery.d.ts +33 -0
- package/dist/sidebar/sections/StudioGallery.js +58 -0
- package/dist/sidebar/sections/UploadsSection.d.ts +11 -0
- package/dist/sidebar/sections/UploadsSection.js +130 -0
- package/dist/sidebar/sections/assets/AssetsSection.d.ts +59 -0
- package/dist/sidebar/sections/assets/AssetsSection.js +27 -0
- package/dist/sidebar/sections/assets/BackgroundCatalog.d.ts +9 -0
- package/dist/sidebar/sections/assets/BackgroundCatalog.js +49 -0
- package/dist/sidebar/sections/assets/CategoryCard.d.ts +14 -0
- package/dist/sidebar/sections/assets/CategoryCard.js +15 -0
- package/dist/sidebar/sections/assets/ElementGrid.d.ts +14 -0
- package/dist/sidebar/sections/assets/ElementGrid.js +34 -0
- package/dist/sidebar/sections/assets/ElementThumb.d.ts +10 -0
- package/dist/sidebar/sections/assets/ElementThumb.js +59 -0
- package/dist/sidebar/sections/assets/ElementTile.d.ts +32 -0
- package/dist/sidebar/sections/assets/ElementTile.js +60 -0
- package/dist/sidebar/sections/assets/ElementsPanel.d.ts +7 -0
- package/dist/sidebar/sections/assets/ElementsPanel.js +249 -0
- package/dist/sidebar/sections/assets/EmojiTonePicker.d.ts +8 -0
- package/dist/sidebar/sections/assets/EmojiTonePicker.js +26 -0
- package/dist/sidebar/sections/assets/FotosCatalog.d.ts +12 -0
- package/dist/sidebar/sections/assets/FotosCatalog.js +41 -0
- package/dist/sidebar/sections/assets/IconifyCatalog.d.ts +14 -0
- package/dist/sidebar/sections/assets/IconifyCatalog.js +133 -0
- package/dist/sidebar/sections/assets/RecentCarousel.d.ts +7 -0
- package/dist/sidebar/sections/assets/RecentCarousel.js +42 -0
- package/dist/sidebar/sections/assets/StickerCatalog.d.ts +14 -0
- package/dist/sidebar/sections/assets/StickerCatalog.js +49 -0
- package/dist/sidebar/sections/assets/constants.d.ts +4 -0
- package/dist/sidebar/sections/assets/constants.js +15 -0
- package/dist/sidebar/sections/assets/elementPanelHost.d.ts +45 -0
- package/dist/sidebar/sections/assets/elementPanelHost.js +1 -0
- package/dist/sidebar/sections/assets/elementSearch.d.ts +10 -0
- package/dist/sidebar/sections/assets/elementSearch.js +38 -0
- package/dist/sidebar/sections/assets/elementTypes.d.ts +67 -0
- package/dist/sidebar/sections/assets/elementTypes.js +24 -0
- package/dist/sidebar/sections/assets/index.d.ts +3 -0
- package/dist/sidebar/sections/assets/index.js +3 -0
- package/dist/sidebar/sections/assets/useElementCatalog.d.ts +42 -0
- package/dist/sidebar/sections/assets/useElementCatalog.js +371 -0
- package/dist/sidebar/sections/assets/useRecentElements.d.ts +21 -0
- package/dist/sidebar/sections/assets/useRecentElements.js +67 -0
- package/dist/sidebar/sections/assets/useStockPhotos.d.ts +22 -0
- package/dist/sidebar/sections/assets/useStockPhotos.js +96 -0
- package/dist/sidebar/sections/effects/EffectCard.d.ts +11 -0
- package/dist/sidebar/sections/effects/EffectCard.js +14 -0
- package/dist/sidebar/sections/effects/GradientSettings.d.ts +10 -0
- package/dist/sidebar/sections/effects/GradientSettings.js +32 -0
- package/dist/sidebar/sections/effects/OutlineSettings.d.ts +12 -0
- package/dist/sidebar/sections/effects/OutlineSettings.js +28 -0
- package/dist/sidebar/sections/effects/ShadowSettings.d.ts +13 -0
- package/dist/sidebar/sections/effects/ShadowSettings.js +37 -0
- package/dist/sidebar/sections/effects/effectsFor.d.ts +16 -0
- package/dist/sidebar/sections/effects/effectsFor.js +24 -0
- package/dist/sidebar/sections/index.d.ts +28 -0
- package/dist/sidebar/sections/index.js +36 -0
- package/dist/sidebar/sections/lazyWithPreload.d.ts +11 -0
- package/dist/sidebar/sections/lazyWithPreload.js +29 -0
- package/dist/sidebar/sections/tools/AiCreateTool.d.ts +4 -0
- package/dist/sidebar/sections/tools/AiCreateTool.js +58 -0
- package/dist/sidebar/sections/tools/AiEditTool.d.ts +4 -0
- package/dist/sidebar/sections/tools/AiEditTool.js +57 -0
- package/dist/sidebar/sections/tools/AltTextTool.d.ts +11 -0
- package/dist/sidebar/sections/tools/AltTextTool.js +78 -0
- package/dist/sidebar/sections/tools/BlobCreatorTool.d.ts +5 -0
- package/dist/sidebar/sections/tools/BlobCreatorTool.js +85 -0
- package/dist/sidebar/sections/tools/GradientTextTool.d.ts +5 -0
- package/dist/sidebar/sections/tools/GradientTextTool.js +102 -0
- package/dist/sidebar/sections/tools/ImageInputPicker.d.ts +7 -0
- package/dist/sidebar/sections/tools/ImageInputPicker.js +68 -0
- package/dist/sidebar/sections/tools/QRCodeTool.d.ts +5 -0
- package/dist/sidebar/sections/tools/QRCodeTool.js +63 -0
- package/dist/sidebar/sections/tools/RemoveBackgroundTool.d.ts +4 -0
- package/dist/sidebar/sections/tools/RemoveBackgroundTool.js +52 -0
- package/dist/sidebar/sections/tools/TextPathCreatorTool.d.ts +5 -0
- package/dist/sidebar/sections/tools/TextPathCreatorTool.js +123 -0
- package/dist/sidebar/sections/tools/ToolPanel.d.ts +26 -0
- package/dist/sidebar/sections/tools/ToolPanel.js +13 -0
- package/dist/sidebar/sections/tools/ToolTiles.d.ts +5 -0
- package/dist/sidebar/sections/tools/ToolTiles.js +76 -0
- package/dist/sidebar/sections/tools/ToolsSection.d.ts +15 -0
- package/dist/sidebar/sections/tools/ToolsSection.js +149 -0
- package/dist/sidebar/sections/tools/UnsplashLimitNotice.d.ts +8 -0
- package/dist/sidebar/sections/tools/UnsplashLimitNotice.js +22 -0
- package/dist/sidebar/sections/tools/UnsplashTool.d.ts +10 -0
- package/dist/sidebar/sections/tools/UnsplashTool.js +47 -0
- package/dist/sidebar/sections/tools/index.d.ts +1 -0
- package/dist/sidebar/sections/tools/index.js +2 -0
- package/dist/sidebar/sections/tools/toolTiles.css +335 -0
- package/dist/sidebar/sections/tools/useToolImagePlacement.d.ts +19 -0
- package/dist/sidebar/sections/tools/useToolImagePlacement.js +23 -0
- package/dist/sidebar/sections/whenIdle.d.ts +2 -0
- package/dist/sidebar/sections/whenIdle.js +10 -0
- package/dist/sidebar/sidebarStyles.d.ts +60 -0
- package/dist/sidebar/sidebarStyles.js +61 -0
- package/dist/sidebar/tabTypes.d.ts +27 -0
- package/dist/sidebar/tabTypes.js +1 -0
- package/dist/sidebar/types.d.ts +43 -0
- package/dist/sidebar/types.js +1 -0
- package/dist/sidebar/useImagePlacement.d.ts +17 -0
- package/dist/sidebar/useImagePlacement.js +28 -0
- package/dist/stores/AutoSaveStoreProvider.d.ts +28 -0
- package/dist/stores/AutoSaveStoreProvider.js +45 -0
- package/dist/stores/CanvasStoreProvider.d.ts +43 -0
- package/dist/stores/CanvasStoreProvider.js +74 -0
- package/dist/stores/createAutoSaveStore.d.ts +50 -0
- package/dist/stores/createAutoSaveStore.js +42 -0
- package/dist/stores/createCanvasEditorStore.d.ts +126 -0
- package/dist/stores/createCanvasEditorStore.js +266 -0
- package/dist/stores/useAutoSaveStore.d.ts +12 -0
- package/dist/stores/useAutoSaveStore.js +12 -0
- package/dist/styles/editor.css +445 -0
- package/dist/styles/index.css +4 -0
- package/dist/styles/tailwind.css +239 -0
- package/dist/styles/tokens.css +199 -0
- package/dist/templates/fontWidths.generated.d.ts +1 -0
- package/dist/templates/fontWidths.generated.js +17 -0
- package/dist/templates/registry.d.ts +59 -0
- package/dist/templates/registry.js +40 -0
- package/dist/templates/templateGeometry.d.ts +32 -0
- package/dist/templates/templateGeometry.js +887 -0
- package/dist/templates/testKinds.d.ts +15 -0
- package/dist/templates/testKinds.js +151 -0
- package/dist/testing/fixtureTemplates.d.ts +13 -0
- package/dist/testing/fixtureTemplates.js +376 -0
- package/dist/testing/stampKind.d.ts +91 -0
- package/dist/testing/stampKind.js +56 -0
- package/dist/types/editorTypes.d.ts +65 -0
- package/dist/types/editorTypes.js +21 -0
- package/dist/ui/alert-dialog.d.ts +18 -0
- package/dist/ui/alert-dialog.js +42 -0
- package/dist/ui/button.d.ts +10 -0
- package/dist/ui/button.js +29 -0
- package/dist/ui/dialog.d.ts +15 -0
- package/dist/ui/dialog.js +53 -0
- package/dist/ui/icon-button.d.ts +18 -0
- package/dist/ui/icon-button.js +54 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +6 -0
- package/dist/ui/label.d.ts +4 -0
- package/dist/ui/label.js +8 -0
- package/dist/ui/masonry-grid.d.ts +11 -0
- package/dist/ui/masonry-grid.js +43 -0
- package/dist/ui/popover.d.ts +10 -0
- package/dist/ui/popover.js +26 -0
- package/dist/ui/select.d.ts +15 -0
- package/dist/ui/select.js +38 -0
- package/dist/ui/skeleton.d.ts +2 -0
- package/dist/ui/skeleton.js +7 -0
- package/dist/ui/switch.d.ts +6 -0
- package/dist/ui/switch.js +8 -0
- package/dist/utils/__snapshots__/kindSelection.vitest.ts.snap +1086 -0
- package/dist/utils/alignment.d.ts +21 -0
- package/dist/utils/alignment.js +54 -0
- package/dist/utils/axisLock.d.ts +30 -0
- package/dist/utils/axisLock.js +78 -0
- package/dist/utils/backgroundPhotoCrop.d.ts +28 -0
- package/dist/utils/backgroundPhotoCrop.js +28 -0
- package/dist/utils/balkenUtils.d.ts +22 -0
- package/dist/utils/balkenUtils.js +8 -0
- package/dist/utils/canvasAssets.d.ts +134 -0
- package/dist/utils/canvasAssets.js +121 -0
- package/dist/utils/canvasClipboard.d.ts +51 -0
- package/dist/utils/canvasClipboard.js +37 -0
- package/dist/utils/canvasCommandRegistry.d.ts +207 -0
- package/dist/utils/canvasCommandRegistry.js +124 -0
- package/dist/utils/canvasCommands.d.ts +106 -0
- package/dist/utils/canvasCommands.js +564 -0
- package/dist/utils/canvasFontFamilies.d.ts +12 -0
- package/dist/utils/canvasFontFamilies.js +24 -0
- package/dist/utils/canvasIcons.d.ts +68 -0
- package/dist/utils/canvasIcons.js +293 -0
- package/dist/utils/canvasImageSource.d.ts +12 -0
- package/dist/utils/canvasImageSource.js +19 -0
- package/dist/utils/canvasItem.d.ts +102 -0
- package/dist/utils/canvasItem.js +1 -0
- package/dist/utils/canvasLayerManager.d.ts +51 -0
- package/dist/utils/canvasLayerManager.js +107 -0
- package/dist/utils/canvasValueResolver.d.ts +9 -0
- package/dist/utils/canvasValueResolver.js +13 -0
- package/dist/utils/captureStage.d.ts +59 -0
- package/dist/utils/captureStage.js +152 -0
- package/dist/utils/chartTypes.d.ts +6 -0
- package/dist/utils/chartTypes.js +2 -0
- package/dist/utils/chartUtils.d.ts +49 -0
- package/dist/utils/chartUtils.js +191 -0
- package/dist/utils/circleBadgeUtils.d.ts +28 -0
- package/dist/utils/circleBadgeUtils.js +85 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.js +66 -0
- package/dist/utils/collectAltTextPages.d.ts +6 -0
- package/dist/utils/collectAltTextPages.js +20 -0
- package/dist/utils/colorLuminance.d.ts +3 -0
- package/dist/utils/colorLuminance.js +14 -0
- package/dist/utils/colorNames.d.ts +2 -0
- package/dist/utils/colorNames.js +8 -0
- package/dist/utils/colorOptions.d.ts +20 -0
- package/dist/utils/colorOptions.js +20 -0
- package/dist/utils/cornerRadius.d.ts +14 -0
- package/dist/utils/cornerRadius.js +27 -0
- package/dist/utils/cornerReservation.d.ts +19 -0
- package/dist/utils/cornerReservation.js +7 -0
- package/dist/utils/coverFit.d.ts +117 -0
- package/dist/utils/coverFit.js +207 -0
- package/dist/utils/cropAspect.d.ts +47 -0
- package/dist/utils/cropAspect.js +53 -0
- package/dist/utils/cropGhost.d.ts +63 -0
- package/dist/utils/cropGhost.js +216 -0
- package/dist/utils/cropSession.d.ts +23 -0
- package/dist/utils/cropSession.js +92 -0
- package/dist/utils/cropTarget.d.ts +22 -0
- package/dist/utils/cropTarget.js +33 -0
- package/dist/utils/deepSelect.d.ts +43 -0
- package/dist/utils/deepSelect.js +74 -0
- package/dist/utils/downloadError.d.ts +2 -0
- package/dist/utils/downloadError.js +13 -0
- package/dist/utils/duplicateElement.d.ts +127 -0
- package/dist/utils/duplicateElement.js +235 -0
- package/dist/utils/editorFocus.d.ts +36 -0
- package/dist/utils/editorFocus.js +67 -0
- package/dist/utils/editorToast.d.ts +21 -0
- package/dist/utils/editorToast.js +7 -0
- package/dist/utils/elementKinds.d.ts +212 -0
- package/dist/utils/elementKinds.js +137 -0
- package/dist/utils/emoji/emojiCatalog.d.ts +12 -0
- package/dist/utils/emoji/emojiCatalog.en.json +9997 -0
- package/dist/utils/emoji/emojiCatalog.js +53 -0
- package/dist/utils/emoji/emojiCatalog.json +9913 -0
- package/dist/utils/ensureFontsReady.d.ts +12 -0
- package/dist/utils/ensureFontsReady.js +23 -0
- package/dist/utils/expandImage.d.ts +17 -0
- package/dist/utils/expandImage.js +76 -0
- package/dist/utils/externalIcons.d.ts +67 -0
- package/dist/utils/externalIcons.js +168 -0
- package/dist/utils/filterCache.d.ts +16 -0
- package/dist/utils/filterCache.js +31 -0
- package/dist/utils/filterUtils.d.ts +2 -0
- package/dist/utils/filterUtils.js +89 -0
- package/dist/utils/followStage.d.ts +2 -0
- package/dist/utils/followStage.js +48 -0
- package/dist/utils/fontAliases.d.ts +14 -0
- package/dist/utils/fontAliases.js +32 -0
- package/dist/utils/fontMarkSupport.d.ts +25 -0
- package/dist/utils/fontMarkSupport.js +26 -0
- package/dist/utils/frameUtils.d.ts +19 -0
- package/dist/utils/frameUtils.js +282 -0
- package/dist/utils/gradientFill.d.ts +55 -0
- package/dist/utils/gradientFill.js +57 -0
- package/dist/utils/gradientHitArea.d.ts +22 -0
- package/dist/utils/gradientHitArea.js +94 -0
- package/dist/utils/grain.d.ts +29 -0
- package/dist/utils/grain.js +103 -0
- package/dist/utils/grainSpec.d.ts +2 -0
- package/dist/utils/grainSpec.js +3 -0
- package/dist/utils/groupSnap.d.ts +27 -0
- package/dist/utils/groupSnap.js +54 -0
- package/dist/utils/handDrawn.d.ts +92 -0
- package/dist/utils/handDrawn.js +523 -0
- package/dist/utils/historyStamp.d.ts +22 -0
- package/dist/utils/historyStamp.js +31 -0
- package/dist/utils/hostStorageKeys.d.ts +16 -0
- package/dist/utils/hostStorageKeys.js +27 -0
- package/dist/utils/iconInstances.d.ts +80 -0
- package/dist/utils/iconInstances.js +109 -0
- package/dist/utils/illustrations/gophers.d.ts +11 -0
- package/dist/utils/illustrations/gophers.js +1236 -0
- package/dist/utils/illustrations/humaaans.d.ts +8 -0
- package/dist/utils/illustrations/humaaans.js +265 -0
- package/dist/utils/illustrations/illlustrations.d.ts +11 -0
- package/dist/utils/illustrations/illlustrations.js +929 -0
- package/dist/utils/illustrations/kawaii.d.ts +6 -0
- package/dist/utils/illustrations/kawaii.js +73 -0
- package/dist/utils/illustrations/opendoodles.d.ts +6 -0
- package/dist/utils/illustrations/opendoodles.js +271 -0
- package/dist/utils/illustrations/openpeeps.d.ts +9 -0
- package/dist/utils/illustrations/openpeeps.js +1522 -0
- package/dist/utils/illustrations/prefetchAnalytics.d.ts +78 -0
- package/dist/utils/illustrations/prefetchAnalytics.js +162 -0
- package/dist/utils/illustrations/registry.d.ts +24 -0
- package/dist/utils/illustrations/registry.js +104 -0
- package/dist/utils/illustrations/svgCache.d.ts +60 -0
- package/dist/utils/illustrations/svgCache.js +342 -0
- package/dist/utils/illustrations/transhumans.d.ts +8 -0
- package/dist/utils/illustrations/transhumans.js +313 -0
- package/dist/utils/illustrations/types.d.ts +25 -0
- package/dist/utils/illustrations/types.js +45 -0
- package/dist/utils/imageElementComparison.d.ts +19 -0
- package/dist/utils/imageElementComparison.js +121 -0
- package/dist/utils/imageFilters.d.ts +92 -0
- package/dist/utils/imageFilters.js +303 -0
- package/dist/utils/imageLook.d.ts +16 -0
- package/dist/utils/imageLook.js +39 -0
- package/dist/utils/keyboardCrop.d.ts +25 -0
- package/dist/utils/keyboardCrop.js +98 -0
- package/dist/utils/keyboardOwnership.d.ts +30 -0
- package/dist/utils/keyboardOwnership.js +93 -0
- package/dist/utils/layerLabels.d.ts +39 -0
- package/dist/utils/layerLabels.js +181 -0
- package/dist/utils/layerLock.d.ts +24 -0
- package/dist/utils/layerLock.js +52 -0
- package/dist/utils/layerSelection.d.ts +24 -0
- package/dist/utils/layerSelection.js +16 -0
- package/dist/utils/markerBoxes.d.ts +23 -0
- package/dist/utils/markerBoxes.js +73 -0
- package/dist/utils/markerColors.d.ts +9 -0
- package/dist/utils/markerColors.js +39 -0
- package/dist/utils/mediaDrop.d.ts +76 -0
- package/dist/utils/mediaDrop.js +95 -0
- package/dist/utils/mediaPlacement.d.ts +6 -0
- package/dist/utils/mediaPlacement.js +17 -0
- package/dist/utils/motifSizes.d.ts +8 -0
- package/dist/utils/motifSizes.js +9 -0
- package/dist/utils/multiSelect.d.ts +44 -0
- package/dist/utils/multiSelect.js +139 -0
- package/dist/utils/notch.d.ts +17 -0
- package/dist/utils/notch.js +23 -0
- package/dist/utils/orientElement.d.ts +46 -0
- package/dist/utils/orientElement.js +108 -0
- package/dist/utils/orientation.d.ts +119 -0
- package/dist/utils/orientation.js +411 -0
- package/dist/utils/pageCounter.d.ts +15 -0
- package/dist/utils/pageCounter.js +17 -0
- package/dist/utils/pendingImages.d.ts +10 -0
- package/dist/utils/pendingImages.js +25 -0
- package/dist/utils/photoCredit.d.ts +9 -0
- package/dist/utils/photoCredit.js +29 -0
- package/dist/utils/photoCredits.d.ts +5 -0
- package/dist/utils/photoCredits.js +17 -0
- package/dist/utils/photoPlaceholder.d.ts +22 -0
- package/dist/utils/photoPlaceholder.js +36 -0
- package/dist/utils/pillBadgeUtils.d.ts +40 -0
- package/dist/utils/pillBadgeUtils.js +94 -0
- package/dist/utils/pixelHitArea.d.ts +13 -0
- package/dist/utils/pixelHitArea.js +33 -0
- package/dist/utils/plainTextLayout.d.ts +11 -0
- package/dist/utils/plainTextLayout.js +64 -0
- package/dist/utils/printImageInfo.d.ts +9 -0
- package/dist/utils/printImageInfo.js +14 -0
- package/dist/utils/recacheNextFrame.d.ts +6 -0
- package/dist/utils/recacheNextFrame.js +15 -0
- package/dist/utils/removeElement.d.ts +17 -0
- package/dist/utils/removeElement.js +47 -0
- package/dist/utils/renderedBoxes.d.ts +19 -0
- package/dist/utils/renderedBoxes.js +67 -0
- package/dist/utils/resolveElementValue.d.ts +44 -0
- package/dist/utils/resolveElementValue.js +72 -0
- package/dist/utils/scrollBehavior.d.ts +6 -0
- package/dist/utils/scrollBehavior.js +17 -0
- package/dist/utils/searchTranslations.d.ts +20 -0
- package/dist/utils/searchTranslations.js +366 -0
- package/dist/utils/selectionCapabilities.d.ts +53 -0
- package/dist/utils/selectionCapabilities.js +52 -0
- package/dist/utils/shade.d.ts +24 -0
- package/dist/utils/shade.js +55 -0
- package/dist/utils/shapeDevices.d.ts +72 -0
- package/dist/utils/shapeDevices.js +100 -0
- package/dist/utils/shapeTransform.d.ts +29 -0
- package/dist/utils/shapeTransform.js +69 -0
- package/dist/utils/shapes.d.ts +62 -0
- package/dist/utils/shapes.js +836 -0
- package/dist/utils/smartCrop.d.ts +30 -0
- package/dist/utils/smartCrop.js +163 -0
- package/dist/utils/snapping.d.ts +116 -0
- package/dist/utils/snapping.js +426 -0
- package/dist/utils/stageCssScale.d.ts +7 -0
- package/dist/utils/stageCssScale.js +11 -0
- package/dist/utils/stateTypeAssertions.d.ts +99 -0
- package/dist/utils/stateTypeAssertions.js +197 -0
- package/dist/utils/straighten.d.ts +51 -0
- package/dist/utils/straighten.js +254 -0
- package/dist/utils/surfaceGlow.d.ts +7 -0
- package/dist/utils/surfaceGlow.js +27 -0
- package/dist/utils/templateElementInstance.d.ts +43 -0
- package/dist/utils/templateElementInstance.js +100 -0
- package/dist/utils/templateRotation.d.ts +24 -0
- package/dist/utils/templateRotation.js +56 -0
- package/dist/utils/textAlign.d.ts +17 -0
- package/dist/utils/textAlign.js +30 -0
- package/dist/utils/textEditorOpeners.d.ts +12 -0
- package/dist/utils/textEditorOpeners.js +40 -0
- package/dist/utils/textRouting.d.ts +17 -0
- package/dist/utils/textRouting.js +22 -0
- package/dist/utils/textUtils.d.ts +102 -0
- package/dist/utils/textUtils.js +250 -0
- package/dist/utils/touchInput.d.ts +7 -0
- package/dist/utils/touchInput.js +19 -0
- package/dist/utils/transformHudLabel.d.ts +3 -0
- package/dist/utils/transformHudLabel.js +12 -0
- package/dist/utils/unsplashLinks.d.ts +2 -0
- package/dist/utils/unsplashLinks.js +7 -0
- package/dist/utils/userFacingError.d.ts +10 -0
- package/dist/utils/userFacingError.js +10 -0
- package/dist/utils/userImageCrop.d.ts +4 -0
- package/dist/utils/userImageCrop.js +26 -0
- package/dist/utils/userImageUtils.d.ts +44 -0
- package/dist/utils/userImageUtils.js +136 -0
- package/dist/utils/viewport.d.ts +16 -0
- package/dist/utils/viewport.js +30 -0
- package/dist/utils/zipPageImages.d.ts +8 -0
- package/dist/utils/zipPageImages.js +29 -0
- package/package.json +105 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared by the per-kind guard tests (`brand/bindableFields.vitest.ts`,
|
|
3
|
+
* `templates/templateGeometry.vitest.ts`): every kind built by its own factory,
|
|
4
|
+
* and a "populated" variant that also sets the optional numbers of its type.
|
|
5
|
+
*/
|
|
6
|
+
import { registerAssetCatalog, type CanvasAssetCatalog } from '@ggraphic/editor/utils/canvasAssets';
|
|
7
|
+
export { registerAssetCatalog };
|
|
8
|
+
export type Fields = Record<string, unknown>;
|
|
9
|
+
/** A catalogue with one Kawaii and one SVG graphic, so `createIllustration` runs without a host. */
|
|
10
|
+
export declare const CATALOG: CanvasAssetCatalog;
|
|
11
|
+
/** The instance a kind starts with, by its own factory, per kind (both illustration sources). */
|
|
12
|
+
export declare function defaults(): Promise<Record<string, Fields[]>>;
|
|
13
|
+
export declare function installFailingImage(): void;
|
|
14
|
+
/** `defaults()` with the optional numbers of each kind set (`POPULATED`). */
|
|
15
|
+
export declare function populated(): Promise<Record<string, Fields[]>>;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Shared by the per-kind guard tests (`brand/bindableFields.vitest.ts`,
|
|
4
|
+
* `templates/templateGeometry.vitest.ts`): every kind built by its own factory,
|
|
5
|
+
* and a "populated" variant that also sets the optional numbers of its type.
|
|
6
|
+
*/
|
|
7
|
+
import { registerAssetCatalog } from '@ggraphic/editor/utils/canvasAssets';
|
|
8
|
+
import { createAdditionalTextActions, createIconActions, } from '../configs/factory/actionFactories.js';
|
|
9
|
+
import { createCircleBadgeInstance } from '../utils/circleBadgeUtils.js';
|
|
10
|
+
import { createChartInstance } from '../utils/chartUtils.js';
|
|
11
|
+
import { createFrameInstance } from '../utils/frameUtils.js';
|
|
12
|
+
import { createIllustration } from '../utils/illustrations/registry.js';
|
|
13
|
+
import { createPillBadgeInstance } from '../utils/pillBadgeUtils.js';
|
|
14
|
+
import { createShape } from '../utils/shapes.js';
|
|
15
|
+
import { createUserImageInstanceFromUrl } from '../utils/userImageUtils.js';
|
|
16
|
+
export { registerAssetCatalog };
|
|
17
|
+
/** A catalogue with one Kawaii and one SVG graphic, so `createIllustration` runs without a host. */
|
|
18
|
+
export const CATALOG = {
|
|
19
|
+
assets: [],
|
|
20
|
+
isInstanceSrc: () => false,
|
|
21
|
+
illustrations: {
|
|
22
|
+
loadKawaii: () => Promise.resolve([{ id: 'cat', name: 'Cat', tags: [], source: 'kawaii' }]),
|
|
23
|
+
loadSvg: () => Promise.resolve([
|
|
24
|
+
{ id: 'svg-1', name: 'One', filename: 'one.svg', source: 'opendoodles', tags: [] },
|
|
25
|
+
]),
|
|
26
|
+
basePath: '/illustrations',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
// `Image` does not exist on the node lane; the factory then never resolves, so give it a failing one.
|
|
30
|
+
class FailingImage {
|
|
31
|
+
crossOrigin = '';
|
|
32
|
+
onload = null;
|
|
33
|
+
onerror = null;
|
|
34
|
+
set src(_url) {
|
|
35
|
+
queueMicrotask(() => this.onerror?.());
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** The instance a kind starts with, by its own factory, per kind (both illustration sources). */
|
|
39
|
+
export async function defaults() {
|
|
40
|
+
let icons = {};
|
|
41
|
+
createIconActions(() => ({ selectedIcons: [], iconStates: {} }), (update) => {
|
|
42
|
+
const next = typeof update === 'function' ? update({ selectedIcons: [], iconStates: {} }) : update;
|
|
43
|
+
icons = next.iconStates;
|
|
44
|
+
}, () => { }, () => { }, 1080, 1350, { defaultColor: '#005538' }).toggleIcon('tabler-sun', true);
|
|
45
|
+
let texts = [];
|
|
46
|
+
const textActions = createAdditionalTextActions(() => ({ additionalTexts: [] }), (update) => {
|
|
47
|
+
const next = typeof update === 'function' ? update({ additionalTexts: [] }) : update;
|
|
48
|
+
texts = next.additionalTexts;
|
|
49
|
+
}, () => { }, () => { }, 1080, 1350, '#ffffff');
|
|
50
|
+
textActions.addHeader();
|
|
51
|
+
installFailingImage();
|
|
52
|
+
return {
|
|
53
|
+
iconStates: Object.values(icons),
|
|
54
|
+
shapeInstances: [createShape('rect', 0, 0, '#005538')],
|
|
55
|
+
frameInstances: [createFrameInstance('circle', 0, 0)],
|
|
56
|
+
additionalTexts: texts,
|
|
57
|
+
illustrationInstances: [
|
|
58
|
+
(await createIllustration('cat', 1080, 1350)),
|
|
59
|
+
(await createIllustration('svg-1', 1080, 1350)),
|
|
60
|
+
],
|
|
61
|
+
circleBadgeInstances: [createCircleBadgeInstance()],
|
|
62
|
+
pillBadgeInstances: [createPillBadgeInstance()],
|
|
63
|
+
userImageInstances: [
|
|
64
|
+
{
|
|
65
|
+
...(await createUserImageInstanceFromUrl('blob:x', 'x.png', 1080, 1350)),
|
|
66
|
+
// Colour fields the inventory test must see listed as bindable.
|
|
67
|
+
duotoneLow: '#112233',
|
|
68
|
+
duotoneHigh: '#ddeeff',
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
chartInstances: [createChartInstance('bar', 1080, 1350)],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export function installFailingImage() {
|
|
75
|
+
globalThis.Image = FailingImage;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Every optional number (and number array) of the kinds that carry any, set to a
|
|
79
|
+
* value. A kind without optional numbers is left out.
|
|
80
|
+
*/
|
|
81
|
+
const POPULATED = {
|
|
82
|
+
additionalTexts: {
|
|
83
|
+
rotation: 1,
|
|
84
|
+
scale: 1,
|
|
85
|
+
opacity: 1,
|
|
86
|
+
lineHeight: 1.2,
|
|
87
|
+
letterSpacing: 0.05,
|
|
88
|
+
maxFontSize: 90,
|
|
89
|
+
strokeWidth: 2,
|
|
90
|
+
shadowBlur: 3,
|
|
91
|
+
shadowOffsetX: 4,
|
|
92
|
+
shadowOffsetY: 5,
|
|
93
|
+
shadowOpacity: 0.5,
|
|
94
|
+
},
|
|
95
|
+
shapeInstances: {
|
|
96
|
+
cornerRadius: 6,
|
|
97
|
+
textGrowth: 7,
|
|
98
|
+
strokeWidth: 2,
|
|
99
|
+
dash: [4, 2],
|
|
100
|
+
shadowBlur: 3,
|
|
101
|
+
shadowOffsetX: 4,
|
|
102
|
+
shadowOffsetY: 5,
|
|
103
|
+
shadowOpacity: 0.5,
|
|
104
|
+
notch: 0.05,
|
|
105
|
+
grain: 0.3,
|
|
106
|
+
patternSpacing: 0.04,
|
|
107
|
+
ringWidth: 8,
|
|
108
|
+
arc: 0.5,
|
|
109
|
+
bend: 0.2,
|
|
110
|
+
tailAt: 0.4,
|
|
111
|
+
tailSize: 30,
|
|
112
|
+
},
|
|
113
|
+
frameInstances: {
|
|
114
|
+
borderDash: [4, 2],
|
|
115
|
+
shadowBlur: 3,
|
|
116
|
+
shadowOffsetX: 4,
|
|
117
|
+
shadowOffsetY: 5,
|
|
118
|
+
tilt: 2,
|
|
119
|
+
aspectRatioLock: 1.5,
|
|
120
|
+
},
|
|
121
|
+
userImageInstances: {
|
|
122
|
+
cornerRadius: [6, 0, 0, 6],
|
|
123
|
+
blur: 2,
|
|
124
|
+
shadowBlur: 3,
|
|
125
|
+
shadowOffsetX: 4,
|
|
126
|
+
shadowOffsetY: 5,
|
|
127
|
+
shadowOpacity: 0.5,
|
|
128
|
+
brightness: 0.1,
|
|
129
|
+
contrast: 10,
|
|
130
|
+
saturation: 1,
|
|
131
|
+
hue: 10,
|
|
132
|
+
temperature: 10,
|
|
133
|
+
tintStrength: 0.5,
|
|
134
|
+
vignette: 0.3,
|
|
135
|
+
cropZoom: 1.2,
|
|
136
|
+
panX: 0.1,
|
|
137
|
+
panY: 0.1,
|
|
138
|
+
cropRotation: 3,
|
|
139
|
+
notch: 0.05,
|
|
140
|
+
},
|
|
141
|
+
iconStates: { opacity: 1 },
|
|
142
|
+
circleBadgeInstances: { opacity: 1 },
|
|
143
|
+
};
|
|
144
|
+
/** `defaults()` with the optional numbers of each kind set (`POPULATED`). */
|
|
145
|
+
export async function populated() {
|
|
146
|
+
const kinds = await defaults();
|
|
147
|
+
return Object.fromEntries(Object.entries(kinds).map(([key, list]) => [
|
|
148
|
+
key,
|
|
149
|
+
list.map((instance) => ({ ...instance, ...POPULATED[key] })),
|
|
150
|
+
]));
|
|
151
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CanvasAssetCatalog } from '../utils/canvasAssets.js';
|
|
2
|
+
import type { AnyCanvasConfig } from '../configs/types.js';
|
|
3
|
+
/** A one-pixel SVG: a decoration the canvas can draw without a file server. */
|
|
4
|
+
export declare const FIXTURE_ORNAMENT_SRC: string;
|
|
5
|
+
/**
|
|
6
|
+
* A one-entry asset catalogue for tests that place a catalogue graphic. Not
|
|
7
|
+
* registered on import: a test that needs it calls `registerFixtureAssets()`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const FIXTURE_INSTANCE_SRC_PREFIX = "https://example.org/share/";
|
|
10
|
+
export declare const FIXTURE_ASSET_ID = "fixture-badge";
|
|
11
|
+
export declare const FIXTURE_ASSET_CATALOG: CanvasAssetCatalog;
|
|
12
|
+
export declare function registerFixtureAssets(): void;
|
|
13
|
+
export declare const FIXTURE_TEMPLATES: readonly [import("@ggraphic/editor/templates/registry").TemplateDefinition<"fixture-poster", AnyCanvasConfig>, import("@ggraphic/editor/templates/registry").TemplateDefinition<"fixture-note", AnyCanvasConfig>];
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Neutral test templates for the core's own test lane.
|
|
4
|
+
*
|
|
5
|
+
* The editor ships no templates; a host registers its catalogue. Tests of
|
|
6
|
+
* generic editor behaviour (history, crop, undo, collab write-back, …) still
|
|
7
|
+
* need *a* template to mount a canvas on, so this module registers two
|
|
8
|
+
* invented ones. It is imported by the test files that need it and by nothing
|
|
9
|
+
* else: it is not an entry point of the package (`exports` does not list it),
|
|
10
|
+
* and importing it is what registers the templates.
|
|
11
|
+
*
|
|
12
|
+
* - `fixture-poster`: a colour plane, an optional background photo, one
|
|
13
|
+
* decoration image and three text lines (`line1`…`line3`).
|
|
14
|
+
* - `fixture-note`: a colour plane and two text fields (`primary`,
|
|
15
|
+
* `secondary`) — a template whose text lives under other keys.
|
|
16
|
+
*
|
|
17
|
+
* Both carry the full collection state of a canvas (shapes, assets, texts,
|
|
18
|
+
* user images, …) and generic add/update/remove actions for it, so user-placed
|
|
19
|
+
* elements behave as on a real template. Only `brandDefault` colours and
|
|
20
|
+
* invented copy are used.
|
|
21
|
+
*/
|
|
22
|
+
import { defineTemplate, registerTemplates } from '@ggraphic/editor/templates/registry';
|
|
23
|
+
import { carryBackgroundAdjustments, carryBackgroundRotation, } from '../configs/factory/carryInstanceState.js';
|
|
24
|
+
import { createAssetInstance, registerAssetCatalog, } from '../utils/canvasAssets.js';
|
|
25
|
+
import { createChartInstance } from '../utils/chartUtils.js';
|
|
26
|
+
import { createCircleBadgeInstance } from '../utils/circleBadgeUtils.js';
|
|
27
|
+
import { zoomBackground } from '../utils/coverFit.js';
|
|
28
|
+
import { createFrameInstance } from '../utils/frameUtils.js';
|
|
29
|
+
import { createPillBadgeInstance } from '../utils/pillBadgeUtils.js';
|
|
30
|
+
import { createShape } from '../utils/shapes.js';
|
|
31
|
+
import { straightenResetFor } from '../utils/straighten.js';
|
|
32
|
+
import { createUserImageInstanceFromUrl, } from '../utils/userImageUtils.js';
|
|
33
|
+
const WIDTH = 1080;
|
|
34
|
+
const HEIGHT = 1350;
|
|
35
|
+
/** A one-pixel SVG: a decoration the canvas can draw without a file server. */
|
|
36
|
+
export const FIXTURE_ORNAMENT_SRC = 'data:image/svg+xml;utf8,' +
|
|
37
|
+
encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10"><rect width="10" height="10" fill="#808080"/></svg>');
|
|
38
|
+
/**
|
|
39
|
+
* A one-entry asset catalogue for tests that place a catalogue graphic. Not
|
|
40
|
+
* registered on import: a test that needs it calls `registerFixtureAssets()`.
|
|
41
|
+
*/
|
|
42
|
+
export const FIXTURE_INSTANCE_SRC_PREFIX = 'https://example.org/share/';
|
|
43
|
+
export const FIXTURE_ASSET_ID = 'fixture-badge';
|
|
44
|
+
export const FIXTURE_ASSET_CATALOG = {
|
|
45
|
+
assets: [
|
|
46
|
+
{
|
|
47
|
+
id: FIXTURE_ASSET_ID,
|
|
48
|
+
src: `https://example.org/assets/${FIXTURE_ASSET_ID}.svg`,
|
|
49
|
+
label: 'Fixture badge',
|
|
50
|
+
category: 'decoration',
|
|
51
|
+
tags: ['fixture'],
|
|
52
|
+
audience: 'all',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 'quote-mark',
|
|
56
|
+
src: 'https://example.org/assets/quote-mark.svg',
|
|
57
|
+
label: 'Quote mark',
|
|
58
|
+
category: 'mark',
|
|
59
|
+
tags: ['fixture'],
|
|
60
|
+
audience: 'all',
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
/** A "shop sticker" is an image under this prefix, as a host would store it. */
|
|
64
|
+
isInstanceSrc: (src) => src.startsWith(FIXTURE_INSTANCE_SRC_PREFIX),
|
|
65
|
+
};
|
|
66
|
+
export function registerFixtureAssets() {
|
|
67
|
+
registerAssetCatalog(FIXTURE_ASSET_CATALOG);
|
|
68
|
+
}
|
|
69
|
+
const FIXTURE_FONT = 'Arial, sans-serif';
|
|
70
|
+
const FIXTURE_BACKGROUND = '#808080';
|
|
71
|
+
const FIXTURE_INK = '#ffffff';
|
|
72
|
+
/** The collections a canvas keeps next to its template elements, by action suffix. */
|
|
73
|
+
const COLLECTIONS = {
|
|
74
|
+
Asset: 'assetInstances',
|
|
75
|
+
Shape: 'shapeInstances',
|
|
76
|
+
Illustration: 'illustrationInstances',
|
|
77
|
+
AdditionalText: 'additionalTexts',
|
|
78
|
+
PillBadge: 'pillBadgeInstances',
|
|
79
|
+
CircleBadge: 'circleBadgeInstances',
|
|
80
|
+
Frame: 'frameInstances',
|
|
81
|
+
UserImage: 'userImageInstances',
|
|
82
|
+
Chart: 'chartInstances',
|
|
83
|
+
};
|
|
84
|
+
/** The state every fixture template starts from; `props` overrides any key. */
|
|
85
|
+
function baseState(props) {
|
|
86
|
+
const list = (key) => props[key] ?? [];
|
|
87
|
+
return {
|
|
88
|
+
assetInstances: list('assetInstances'),
|
|
89
|
+
shapeInstances: list('shapeInstances'),
|
|
90
|
+
illustrationInstances: list('illustrationInstances'),
|
|
91
|
+
additionalTexts: list('additionalTexts'),
|
|
92
|
+
pillBadgeInstances: list('pillBadgeInstances'),
|
|
93
|
+
circleBadgeInstances: list('circleBadgeInstances'),
|
|
94
|
+
frameInstances: list('frameInstances'),
|
|
95
|
+
userImageInstances: list('userImageInstances'),
|
|
96
|
+
chartInstances: list('chartInstances'),
|
|
97
|
+
selectedIcons: props.selectedIcons ?? [],
|
|
98
|
+
iconStates: props.iconStates ?? {},
|
|
99
|
+
layerOrder: props.layerOrder ?? [],
|
|
100
|
+
lockedLayerIds: props.lockedLayerIds ?? [],
|
|
101
|
+
templateRotations: props.templateRotations ?? {},
|
|
102
|
+
templateTextAligns: props.templateTextAligns ?? {},
|
|
103
|
+
backgroundColor: props.backgroundColor ?? FIXTURE_BACKGROUND,
|
|
104
|
+
isDesktop: props.isDesktop ?? true,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/** Add, update and remove for every collection, plus the few adders tests call. */
|
|
108
|
+
function collectionActions(getState, setState, saveToHistory, debouncedSaveToHistory) {
|
|
109
|
+
const actions = {};
|
|
110
|
+
for (const [suffix, key] of Object.entries(COLLECTIONS)) {
|
|
111
|
+
actions[`update${suffix}`] = (id, partial) => {
|
|
112
|
+
setState((prev) => ({
|
|
113
|
+
...prev,
|
|
114
|
+
[key]: prev[key].map((item) => item.id === id ? { ...item, ...partial } : item),
|
|
115
|
+
}));
|
|
116
|
+
debouncedSaveToHistory(getState());
|
|
117
|
+
};
|
|
118
|
+
actions[`remove${suffix}`] = (id) => {
|
|
119
|
+
setState((prev) => ({
|
|
120
|
+
...prev,
|
|
121
|
+
[key]: prev[key].filter((item) => item.id !== id),
|
|
122
|
+
}));
|
|
123
|
+
saveToHistory(getState());
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const append = (key, item) => {
|
|
127
|
+
setState((prev) => ({ ...prev, [key]: [...prev[key], item] }));
|
|
128
|
+
saveToHistory(getState());
|
|
129
|
+
};
|
|
130
|
+
actions.addAsset = (assetId) => append('assetInstances', createAssetInstance(assetId, WIDTH, HEIGHT));
|
|
131
|
+
actions.addShape = (type, color) => append('shapeInstances', createShape(type, WIDTH / 2, HEIGHT / 2, color ?? FIXTURE_INK));
|
|
132
|
+
actions.addText = () => append('additionalTexts', {
|
|
133
|
+
id: `text-${Date.now()}`,
|
|
134
|
+
text: 'Sample text',
|
|
135
|
+
type: 'body',
|
|
136
|
+
x: 100,
|
|
137
|
+
y: HEIGHT / 2,
|
|
138
|
+
width: 600,
|
|
139
|
+
fontSize: 48,
|
|
140
|
+
fontFamily: FIXTURE_FONT,
|
|
141
|
+
fill: FIXTURE_INK,
|
|
142
|
+
});
|
|
143
|
+
actions.addPillBadge = (preset) => append('pillBadgeInstances', createPillBadgeInstance(preset));
|
|
144
|
+
actions.addCircleBadge = (preset) => append('circleBadgeInstances', createCircleBadgeInstance(preset));
|
|
145
|
+
actions.addChart = (chartType) => append('chartInstances', createChartInstance(chartType, WIDTH, HEIGHT));
|
|
146
|
+
actions.addFrame = (clipType) => append('frameInstances', createFrameInstance(clipType, WIDTH / 2, HEIGHT / 2));
|
|
147
|
+
actions.addUserImageFromUrl = (url, fileName, options) => {
|
|
148
|
+
void createUserImageInstanceFromUrl(url, fileName, WIDTH, HEIGHT, options).then((instance) => {
|
|
149
|
+
setState((prev) => ({ ...prev, userImageInstances: [...prev.userImageInstances, instance] }));
|
|
150
|
+
saveToHistory(getState());
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
actions.toggleIcon = (id, selected, _options) => {
|
|
154
|
+
setState((prev) => {
|
|
155
|
+
const icons = prev.selectedIcons.filter((i) => i !== id);
|
|
156
|
+
const iconStates = selected
|
|
157
|
+
? {
|
|
158
|
+
...prev.iconStates,
|
|
159
|
+
[id]: { x: WIDTH / 2, y: HEIGHT / 2, scale: 1, rotation: 0 },
|
|
160
|
+
}
|
|
161
|
+
: prev.iconStates;
|
|
162
|
+
return { ...prev, selectedIcons: selected ? [...icons, id] : icons, iconStates };
|
|
163
|
+
});
|
|
164
|
+
saveToHistory(getState());
|
|
165
|
+
};
|
|
166
|
+
actions.setBackgroundColor = (color) => {
|
|
167
|
+
setState((prev) => ({ ...prev, backgroundColor: color }));
|
|
168
|
+
saveToHistory(getState());
|
|
169
|
+
};
|
|
170
|
+
return actions;
|
|
171
|
+
}
|
|
172
|
+
// ── fixture-poster ──────────────────────────────────────────────────────────
|
|
173
|
+
const LINE_KEYS = ['line1', 'line2', 'line3'];
|
|
174
|
+
const posterConfig = {
|
|
175
|
+
id: 'fixture-poster',
|
|
176
|
+
canvas: { width: WIDTH, height: HEIGHT },
|
|
177
|
+
tabs: [],
|
|
178
|
+
sections: {},
|
|
179
|
+
features: { icons: true, shapes: true, illustrations: true },
|
|
180
|
+
fonts: { primary: 'Arial', fontSize: 60, requireFontLoad: true },
|
|
181
|
+
background: (state, actions) => ({
|
|
182
|
+
currentImageSrc: state.currentImageSrc || undefined,
|
|
183
|
+
imageAttribution: state.imageAttribution ?? null,
|
|
184
|
+
onImageChange: (file, url, attribution) => actions.setCurrentImageSrc(file, url, attribution),
|
|
185
|
+
scale: state.imageScale,
|
|
186
|
+
onScaleChange: actions.setImageScale,
|
|
187
|
+
currentColor: state.backgroundColor,
|
|
188
|
+
onColorChange: actions.setBackgroundColor,
|
|
189
|
+
}),
|
|
190
|
+
elements: [
|
|
191
|
+
{
|
|
192
|
+
id: 'background-color',
|
|
193
|
+
type: 'background',
|
|
194
|
+
order: -1,
|
|
195
|
+
x: 0,
|
|
196
|
+
y: 0,
|
|
197
|
+
width: WIDTH,
|
|
198
|
+
height: HEIGHT,
|
|
199
|
+
colorKey: 'backgroundColor',
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
id: 'background-image',
|
|
203
|
+
type: 'image',
|
|
204
|
+
order: 0,
|
|
205
|
+
x: 0,
|
|
206
|
+
y: 0,
|
|
207
|
+
width: WIDTH,
|
|
208
|
+
height: HEIGHT,
|
|
209
|
+
srcKey: 'currentImageSrc',
|
|
210
|
+
offsetKey: 'imageOffset',
|
|
211
|
+
scaleKey: 'imageScale',
|
|
212
|
+
draggable: true,
|
|
213
|
+
transformable: true,
|
|
214
|
+
coverFit: true,
|
|
215
|
+
visible: (state) => !!state.currentImageSrc,
|
|
216
|
+
opacity: (state) => state.backgroundImageOpacity ?? 1,
|
|
217
|
+
opacityStateKey: 'backgroundImageOpacity',
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: 'ornament',
|
|
221
|
+
type: 'image',
|
|
222
|
+
order: 1,
|
|
223
|
+
x: (state) => state.ornamentPos?.x ?? WIDTH - 250,
|
|
224
|
+
y: (state) => state.ornamentPos?.y ?? HEIGHT - 250,
|
|
225
|
+
width: 200,
|
|
226
|
+
height: 200,
|
|
227
|
+
src: FIXTURE_ORNAMENT_SRC,
|
|
228
|
+
draggable: true,
|
|
229
|
+
transformable: true,
|
|
230
|
+
listening: true,
|
|
231
|
+
positionStateKey: 'ornamentPos',
|
|
232
|
+
},
|
|
233
|
+
...LINE_KEYS.map((key, index) => ({
|
|
234
|
+
id: `${key}-text`,
|
|
235
|
+
type: 'text',
|
|
236
|
+
order: 2 + index,
|
|
237
|
+
x: 80,
|
|
238
|
+
y: 200 + index * 160,
|
|
239
|
+
width: 920,
|
|
240
|
+
fontSize: 80,
|
|
241
|
+
fontFamily: FIXTURE_FONT,
|
|
242
|
+
fontStyle: 'bold',
|
|
243
|
+
fill: FIXTURE_INK,
|
|
244
|
+
textKey: key,
|
|
245
|
+
editable: true,
|
|
246
|
+
draggable: true,
|
|
247
|
+
transformable: true,
|
|
248
|
+
})),
|
|
249
|
+
],
|
|
250
|
+
calculateLayout: () => ({}),
|
|
251
|
+
createInitialState: (props) => {
|
|
252
|
+
const lines = Object.fromEntries(LINE_KEYS.map((key) => [key, props[key] ?? '']));
|
|
253
|
+
return {
|
|
254
|
+
...baseState(props),
|
|
255
|
+
...lines,
|
|
256
|
+
...carryBackgroundAdjustments(props),
|
|
257
|
+
...carryBackgroundRotation(props),
|
|
258
|
+
ornamentPos: props.ornamentPos ?? null,
|
|
259
|
+
currentImageSrc: props.currentImageSrc,
|
|
260
|
+
backgroundImageFile: props.backgroundImageFile ?? null,
|
|
261
|
+
imageOffset: props.imageOffset ?? { x: 0, y: 0 },
|
|
262
|
+
imageScale: props.imageScale ?? 1,
|
|
263
|
+
imageAttribution: props.imageAttribution ?? null,
|
|
264
|
+
hasBackgroundImage: !!props.currentImageSrc,
|
|
265
|
+
backgroundImageOpacity: props.backgroundImageOpacity ?? 1,
|
|
266
|
+
};
|
|
267
|
+
},
|
|
268
|
+
createActions: (getState, setState, saveToHistory, debouncedSaveToHistory, callbacks) => {
|
|
269
|
+
const lineActions = Object.fromEntries(LINE_KEYS.map((key, index) => [
|
|
270
|
+
`setLine${index + 1}`,
|
|
271
|
+
(text) => {
|
|
272
|
+
setState((prev) => ({ ...prev, [key]: text }));
|
|
273
|
+
callbacks[`onLine${index + 1}Change`]?.(text);
|
|
274
|
+
debouncedSaveToHistory(getState());
|
|
275
|
+
},
|
|
276
|
+
]));
|
|
277
|
+
return {
|
|
278
|
+
...collectionActions(getState, setState, saveToHistory, debouncedSaveToHistory),
|
|
279
|
+
...lineActions,
|
|
280
|
+
setCurrentImageSrc: (file, objectUrl, attribution) => {
|
|
281
|
+
const src = file ? objectUrl : undefined;
|
|
282
|
+
const reset = straightenResetFor(getState());
|
|
283
|
+
setState((prev) => ({
|
|
284
|
+
...prev,
|
|
285
|
+
currentImageSrc: src,
|
|
286
|
+
backgroundImageFile: file,
|
|
287
|
+
imageAttribution: attribution ?? null,
|
|
288
|
+
hasBackgroundImage: !!src,
|
|
289
|
+
...reset,
|
|
290
|
+
}));
|
|
291
|
+
callbacks.onImageChange?.(file);
|
|
292
|
+
saveToHistory({ ...getState(), currentImageSrc: src, ...reset });
|
|
293
|
+
},
|
|
294
|
+
setImageScale: (scale) => {
|
|
295
|
+
const zoom = zoomBackground(getState(), scale, { width: WIDTH, height: HEIGHT });
|
|
296
|
+
setState((prev) => ({ ...prev, ...zoom }));
|
|
297
|
+
debouncedSaveToHistory({ ...getState(), ...zoom });
|
|
298
|
+
},
|
|
299
|
+
};
|
|
300
|
+
},
|
|
301
|
+
};
|
|
302
|
+
// ── fixture-note ────────────────────────────────────────────────────────────
|
|
303
|
+
const noteConfig = {
|
|
304
|
+
id: 'fixture-note',
|
|
305
|
+
canvas: { width: WIDTH, height: HEIGHT },
|
|
306
|
+
tabs: [],
|
|
307
|
+
sections: {},
|
|
308
|
+
features: { icons: true, shapes: true, illustrations: true },
|
|
309
|
+
fonts: { primary: 'Arial', fontSize: 60, requireFontLoad: true },
|
|
310
|
+
elements: [
|
|
311
|
+
{
|
|
312
|
+
id: 'background-color',
|
|
313
|
+
type: 'background',
|
|
314
|
+
order: -1,
|
|
315
|
+
x: 0,
|
|
316
|
+
y: 0,
|
|
317
|
+
width: WIDTH,
|
|
318
|
+
height: HEIGHT,
|
|
319
|
+
colorKey: 'backgroundColor',
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
id: 'primary-text',
|
|
323
|
+
type: 'text',
|
|
324
|
+
order: 1,
|
|
325
|
+
x: 80,
|
|
326
|
+
y: 300,
|
|
327
|
+
width: 920,
|
|
328
|
+
fontSize: 72,
|
|
329
|
+
fontFamily: FIXTURE_FONT,
|
|
330
|
+
fill: FIXTURE_INK,
|
|
331
|
+
textKey: 'primary',
|
|
332
|
+
editable: true,
|
|
333
|
+
draggable: true,
|
|
334
|
+
transformable: true,
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
id: 'secondary-text',
|
|
338
|
+
type: 'text',
|
|
339
|
+
order: 2,
|
|
340
|
+
x: 80,
|
|
341
|
+
y: 900,
|
|
342
|
+
width: 920,
|
|
343
|
+
fontSize: 40,
|
|
344
|
+
fontFamily: FIXTURE_FONT,
|
|
345
|
+
fill: FIXTURE_INK,
|
|
346
|
+
textKey: 'secondary',
|
|
347
|
+
editable: true,
|
|
348
|
+
draggable: true,
|
|
349
|
+
transformable: true,
|
|
350
|
+
},
|
|
351
|
+
],
|
|
352
|
+
calculateLayout: () => ({}),
|
|
353
|
+
createInitialState: (props) => ({
|
|
354
|
+
...baseState(props),
|
|
355
|
+
primary: props.primary ?? '',
|
|
356
|
+
secondary: props.secondary ?? '',
|
|
357
|
+
}),
|
|
358
|
+
createActions: (getState, setState, saveToHistory, debouncedSaveToHistory, callbacks) => ({
|
|
359
|
+
...collectionActions(getState, setState, saveToHistory, debouncedSaveToHistory),
|
|
360
|
+
setPrimary: (text) => {
|
|
361
|
+
setState((prev) => ({ ...prev, primary: text }));
|
|
362
|
+
callbacks.onPrimaryChange?.(text);
|
|
363
|
+
debouncedSaveToHistory(getState());
|
|
364
|
+
},
|
|
365
|
+
setSecondary: (text) => {
|
|
366
|
+
setState((prev) => ({ ...prev, secondary: text }));
|
|
367
|
+
callbacks.onSecondaryChange?.(text);
|
|
368
|
+
debouncedSaveToHistory(getState());
|
|
369
|
+
},
|
|
370
|
+
}),
|
|
371
|
+
};
|
|
372
|
+
export const FIXTURE_TEMPLATES = [
|
|
373
|
+
defineTemplate({ id: 'fixture-poster', load: async () => posterConfig }),
|
|
374
|
+
defineTemplate({ id: 'fixture-note', load: async () => noteConfig }),
|
|
375
|
+
];
|
|
376
|
+
registerTemplates(...FIXTURE_TEMPLATES);
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { OrientationPatch } from '../utils/orientElement.js';
|
|
2
|
+
export interface Stamp {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
offset: {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
};
|
|
9
|
+
rotation?: number;
|
|
10
|
+
opacity?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const STAMP_KIND: {
|
|
13
|
+
readonly kind: "stamp";
|
|
14
|
+
readonly stateKey: "stampInstances";
|
|
15
|
+
readonly actions: {
|
|
16
|
+
readonly update: "updateStamp";
|
|
17
|
+
readonly remove: "removeStamp";
|
|
18
|
+
};
|
|
19
|
+
readonly add: {
|
|
20
|
+
readonly action: "addStamp";
|
|
21
|
+
readonly args: (payload: {
|
|
22
|
+
label: string;
|
|
23
|
+
}) => string[];
|
|
24
|
+
};
|
|
25
|
+
readonly name: () => string;
|
|
26
|
+
readonly layerContent: (d: Stamp) => string;
|
|
27
|
+
readonly duplicate: (d: Stamp, id: string, o: {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
}) => {
|
|
31
|
+
id: string;
|
|
32
|
+
offset: {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
};
|
|
36
|
+
label: string;
|
|
37
|
+
rotation?: number;
|
|
38
|
+
opacity?: number;
|
|
39
|
+
};
|
|
40
|
+
readonly orient: (patch: OrientationPatch, d: Stamp) => {
|
|
41
|
+
offset?: {
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
} | undefined;
|
|
45
|
+
rotation?: number | undefined;
|
|
46
|
+
};
|
|
47
|
+
readonly nudge: (d: Stamp, delta: {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
}) => {
|
|
51
|
+
offset: {
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
readonly floating: (d: Stamp) => {
|
|
57
|
+
opacity: number;
|
|
58
|
+
};
|
|
59
|
+
readonly editableText: true;
|
|
60
|
+
readonly describe: (d: Stamp) => string;
|
|
61
|
+
readonly aiUpdate: {
|
|
62
|
+
readonly fields: readonly ["x", "y", "opacity"];
|
|
63
|
+
readonly patch: ({ x, y, ...rest }: Record<string, unknown>, d: Stamp) => {
|
|
64
|
+
offset?: {
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
} | undefined;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
readonly pptx: (d: Stamp, page: {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
width: number;
|
|
74
|
+
height: number;
|
|
75
|
+
}) => {
|
|
76
|
+
kind: string;
|
|
77
|
+
elementId: string;
|
|
78
|
+
box: {
|
|
79
|
+
x: number;
|
|
80
|
+
y: number;
|
|
81
|
+
width: number;
|
|
82
|
+
height: number;
|
|
83
|
+
};
|
|
84
|
+
rotation: number;
|
|
85
|
+
reason: string;
|
|
86
|
+
boxExact: boolean;
|
|
87
|
+
};
|
|
88
|
+
readonly pageStateKeys: readonly ["stampColour"];
|
|
89
|
+
readonly layoutStateKeys: readonly ["stampColour"];
|
|
90
|
+
};
|
|
91
|
+
export declare function registerStampKind(): void;
|