@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,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ausrichten & Verteilen: reine Geometrie über achsenparallele Kästen.
|
|
3
|
+
* Die Befehle reichen die gedrehten Umrisse (`axisAlignedBounds`) herein und
|
|
4
|
+
* verschieben jedes Element um den zurückgegebenen Versatz.
|
|
5
|
+
*/
|
|
6
|
+
import type { Box } from './orientation.js';
|
|
7
|
+
export type AlignDirection = 'left' | 'center-h' | 'right' | 'top' | 'center-v' | 'bottom';
|
|
8
|
+
export interface Delta {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}
|
|
12
|
+
/** Versatz, der `box` an `target` ausrichtet. */
|
|
13
|
+
export declare function alignDelta(box: Box, target: Box, dir: AlignDirection): Delta;
|
|
14
|
+
/** Kleinster Kasten um alle. */
|
|
15
|
+
export declare function unionBox(boxes: readonly Box[]): Box;
|
|
16
|
+
/**
|
|
17
|
+
* Gleiche Abstände zwischen den Kästen entlang `axis`; der erste und der
|
|
18
|
+
* letzte bleiben stehen. Versätze in der Reihenfolge der Eingabe; unter drei
|
|
19
|
+
* Kästen gibt es nichts zu verteilen.
|
|
20
|
+
*/
|
|
21
|
+
export declare function distributeDeltas(boxes: readonly Box[], axis: 'x' | 'y'): Delta[];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Ausrichten & Verteilen: reine Geometrie über achsenparallele Kästen.
|
|
4
|
+
* Die Befehle reichen die gedrehten Umrisse (`axisAlignedBounds`) herein und
|
|
5
|
+
* verschieben jedes Element um den zurückgegebenen Versatz.
|
|
6
|
+
*/
|
|
7
|
+
/** Versatz, der `box` an `target` ausrichtet. */
|
|
8
|
+
export function alignDelta(box, target, dir) {
|
|
9
|
+
switch (dir) {
|
|
10
|
+
case 'left':
|
|
11
|
+
return { x: target.x - box.x, y: 0 };
|
|
12
|
+
case 'center-h':
|
|
13
|
+
return { x: target.x + (target.width - box.width) / 2 - box.x, y: 0 };
|
|
14
|
+
case 'right':
|
|
15
|
+
return { x: target.x + target.width - (box.x + box.width), y: 0 };
|
|
16
|
+
case 'top':
|
|
17
|
+
return { x: 0, y: target.y - box.y };
|
|
18
|
+
case 'center-v':
|
|
19
|
+
return { x: 0, y: target.y + (target.height - box.height) / 2 - box.y };
|
|
20
|
+
case 'bottom':
|
|
21
|
+
return { x: 0, y: target.y + target.height - (box.y + box.height) };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** Kleinster Kasten um alle. */
|
|
25
|
+
export function unionBox(boxes) {
|
|
26
|
+
const x = Math.min(...boxes.map((b) => b.x));
|
|
27
|
+
const y = Math.min(...boxes.map((b) => b.y));
|
|
28
|
+
const right = Math.max(...boxes.map((b) => b.x + b.width));
|
|
29
|
+
const bottom = Math.max(...boxes.map((b) => b.y + b.height));
|
|
30
|
+
return { x, y, width: right - x, height: bottom - y };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Gleiche Abstände zwischen den Kästen entlang `axis`; der erste und der
|
|
34
|
+
* letzte bleiben stehen. Versätze in der Reihenfolge der Eingabe; unter drei
|
|
35
|
+
* Kästen gibt es nichts zu verteilen.
|
|
36
|
+
*/
|
|
37
|
+
export function distributeDeltas(boxes, axis) {
|
|
38
|
+
const deltas = boxes.map(() => ({ x: 0, y: 0 }));
|
|
39
|
+
if (boxes.length < 3)
|
|
40
|
+
return deltas;
|
|
41
|
+
const start = (b) => (axis === 'x' ? b.x : b.y);
|
|
42
|
+
const size = (b) => (axis === 'x' ? b.width : b.height);
|
|
43
|
+
const order = boxes.map((_, i) => i).sort((a, b) => start(boxes[a]) - start(boxes[b]));
|
|
44
|
+
const first = boxes[order[0]];
|
|
45
|
+
const last = boxes[order[order.length - 1]];
|
|
46
|
+
const span = start(last) + size(last) - start(first);
|
|
47
|
+
const gap = (span - boxes.reduce((sum, b) => sum + size(b), 0)) / (boxes.length - 1);
|
|
48
|
+
let cursor = start(first);
|
|
49
|
+
for (const i of order) {
|
|
50
|
+
deltas[i][axis] = cursor - start(boxes[i]);
|
|
51
|
+
cursor += size(boxes[i]) + gap;
|
|
52
|
+
}
|
|
53
|
+
return deltas;
|
|
54
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Umschalt beim Ziehen sperrt die Bewegung auf eine Achse — die, auf der der
|
|
3
|
+
* Zeiger seit dem Zugbeginn weiter gewandert ist. Eine Stelle für jedes
|
|
4
|
+
* Element: die Bühne legt beim `dragstart` einen `dragBoundFunc` um den
|
|
5
|
+
* gezogenen Knoten (einen eigenen umhüllt er) und nimmt ihn beim `dragend` wieder ab.
|
|
6
|
+
*
|
|
7
|
+
* Die Achse folgt dem Zeigerweg seit dem Druck (nicht seit `dragstart`, das
|
|
8
|
+
* erst nach der Mindeststrecke kommt) und gilt für alle Knoten eines
|
|
9
|
+
* Gruppenzugs gleich. Festgehalten wird je Knoten seine Lage bei seinem eigenen
|
|
10
|
+
* `dragstart`: Konva startet die übrigen Knoten erst ein Bild später, nachdem
|
|
11
|
+
* es sie um den (schon gesperrten) Weg des ersten verschoben hat.
|
|
12
|
+
*
|
|
13
|
+
* Den Snap auf der gesperrten Achse unterdrückt `snapByBounds` (`activeAxisLock`).
|
|
14
|
+
*/
|
|
15
|
+
import type Konva from 'konva';
|
|
16
|
+
export type DragAxis = 'x' | 'y';
|
|
17
|
+
interface Point {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
}
|
|
21
|
+
/** Die Achse, auf der der laufende Zug gesperrt ist — `null` ohne Umschalt. */
|
|
22
|
+
export declare function activeAxisLock(): DragAxis | null;
|
|
23
|
+
/** Gesperrte Lage: auf der schwächeren Achse des Zeigerwegs bleibt der Knoten bei `start`. */
|
|
24
|
+
export declare function lockToAxis(pos: Point, start: Point, pointer: Point, origin: Point): {
|
|
25
|
+
pos: Point;
|
|
26
|
+
axis: DragAxis;
|
|
27
|
+
};
|
|
28
|
+
/** Hängt die Sperre an die Bühne; gibt das Abmelden zurück. */
|
|
29
|
+
export declare function installAxisLock(stage: Konva.Stage): () => void;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Umschalt beim Ziehen sperrt die Bewegung auf eine Achse — die, auf der der
|
|
4
|
+
* Zeiger seit dem Zugbeginn weiter gewandert ist. Eine Stelle für jedes
|
|
5
|
+
* Element: die Bühne legt beim `dragstart` einen `dragBoundFunc` um den
|
|
6
|
+
* gezogenen Knoten (einen eigenen umhüllt er) und nimmt ihn beim `dragend` wieder ab.
|
|
7
|
+
*
|
|
8
|
+
* Die Achse folgt dem Zeigerweg seit dem Druck (nicht seit `dragstart`, das
|
|
9
|
+
* erst nach der Mindeststrecke kommt) und gilt für alle Knoten eines
|
|
10
|
+
* Gruppenzugs gleich. Festgehalten wird je Knoten seine Lage bei seinem eigenen
|
|
11
|
+
* `dragstart`: Konva startet die übrigen Knoten erst ein Bild später, nachdem
|
|
12
|
+
* es sie um den (schon gesperrten) Weg des ersten verschoben hat.
|
|
13
|
+
*
|
|
14
|
+
* Den Snap auf der gesperrten Achse unterdrückt `snapByBounds` (`activeAxisLock`).
|
|
15
|
+
*/
|
|
16
|
+
let lockedAxis = null;
|
|
17
|
+
/** Die Achse, auf der der laufende Zug gesperrt ist — `null` ohne Umschalt. */
|
|
18
|
+
export function activeAxisLock() {
|
|
19
|
+
return lockedAxis;
|
|
20
|
+
}
|
|
21
|
+
/** Gesperrte Lage: auf der schwächeren Achse des Zeigerwegs bleibt der Knoten bei `start`. */
|
|
22
|
+
export function lockToAxis(pos, start, pointer, origin) {
|
|
23
|
+
return Math.abs(pointer.x - origin.x) >= Math.abs(pointer.y - origin.y)
|
|
24
|
+
? { pos: { x: pos.x, y: start.y }, axis: 'x' }
|
|
25
|
+
: { pos: { x: start.x, y: pos.y }, axis: 'y' };
|
|
26
|
+
}
|
|
27
|
+
const shiftHeld = (evt) => typeof evt === 'object' && evt !== null && evt.shiftKey === true;
|
|
28
|
+
/** Hängt die Sperre an die Bühne; gibt das Abmelden zurück. */
|
|
29
|
+
export function installAxisLock(stage) {
|
|
30
|
+
let origin = null;
|
|
31
|
+
let press = null;
|
|
32
|
+
const own = new Map();
|
|
33
|
+
// Im Capture: Elemente brechen das Blubbern ihres Drucks ab.
|
|
34
|
+
const onPress = (evt) => {
|
|
35
|
+
stage.setPointersPositions(evt);
|
|
36
|
+
press = stage.getPointerPosition();
|
|
37
|
+
};
|
|
38
|
+
stage.content.addEventListener('pointerdown', onPress, true);
|
|
39
|
+
stage.on('dragstart.axisLock', (e) => {
|
|
40
|
+
const node = e.target;
|
|
41
|
+
if (node === stage || own.has(node))
|
|
42
|
+
return;
|
|
43
|
+
if (own.size === 0)
|
|
44
|
+
origin = press ?? stage.getPointerPosition();
|
|
45
|
+
const previous = node.dragBoundFunc();
|
|
46
|
+
const start = node.getAbsolutePosition();
|
|
47
|
+
own.set(node, previous);
|
|
48
|
+
node.dragBoundFunc(function (pos, evt) {
|
|
49
|
+
const next = previous ? previous.call(this, pos, evt) : pos;
|
|
50
|
+
const pointer = stage.getPointerPosition();
|
|
51
|
+
if (!shiftHeld(evt) || !origin || !pointer) {
|
|
52
|
+
lockedAxis = null;
|
|
53
|
+
return next;
|
|
54
|
+
}
|
|
55
|
+
const locked = lockToAxis(next, start, pointer, origin);
|
|
56
|
+
lockedAxis = locked.axis;
|
|
57
|
+
return locked.pos;
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
stage.on('dragend.axisLock', (e) => {
|
|
61
|
+
const node = e.target;
|
|
62
|
+
if (!own.has(node))
|
|
63
|
+
return;
|
|
64
|
+
node.dragBoundFunc(own.get(node));
|
|
65
|
+
own.delete(node);
|
|
66
|
+
if (own.size === 0) {
|
|
67
|
+
origin = null;
|
|
68
|
+
lockedAxis = null;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
return () => {
|
|
72
|
+
stage.content.removeEventListener('pointerdown', onPress, true);
|
|
73
|
+
stage.off('.axisLock');
|
|
74
|
+
own.forEach((previous, node) => node.dragBoundFunc(previous));
|
|
75
|
+
own.clear();
|
|
76
|
+
lockedAxis = null;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface ImageElementInteraction {
|
|
2
|
+
draggable: boolean;
|
|
3
|
+
transformable: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Was ein Bild-Element auf der Fläche zulässt. Das Hintergrundfoto gehört wie
|
|
7
|
+
* in Canva zur Seite: ziehen und zoomen nur im Ausschnitt-Modus, und auch dann
|
|
8
|
+
* nur, soweit die Config es erlaubt.
|
|
9
|
+
*/
|
|
10
|
+
export declare function imageElementInteraction(config: {
|
|
11
|
+
id: string;
|
|
12
|
+
draggable?: boolean;
|
|
13
|
+
transformable?: boolean;
|
|
14
|
+
}, { cropping }: {
|
|
15
|
+
cropping: boolean;
|
|
16
|
+
}): ImageElementInteraction;
|
|
17
|
+
/**
|
|
18
|
+
* Ob das Element den Ausschnitt-Modus hat: nur das Hintergrundfoto, und nur,
|
|
19
|
+
* wenn der Modus dort Ziehen oder Zoomen freigibt (nicht das feste Fotoband in
|
|
20
|
+
* veranstaltung). Fläche, Leiste und Menü fragen dasselbe. Ohne coverFit gibt
|
|
21
|
+
* es keinen Ausschnitt zum Verschieben.
|
|
22
|
+
*/
|
|
23
|
+
export declare function canCropBackgroundPhoto(config: {
|
|
24
|
+
id: string;
|
|
25
|
+
draggable?: boolean;
|
|
26
|
+
transformable?: boolean;
|
|
27
|
+
coverFit?: boolean;
|
|
28
|
+
}): boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import { BACKGROUND_IMAGE_NODE_ID } from './printImageInfo.js';
|
|
3
|
+
/**
|
|
4
|
+
* Was ein Bild-Element auf der Fläche zulässt. Das Hintergrundfoto gehört wie
|
|
5
|
+
* in Canva zur Seite: ziehen und zoomen nur im Ausschnitt-Modus, und auch dann
|
|
6
|
+
* nur, soweit die Config es erlaubt.
|
|
7
|
+
*/
|
|
8
|
+
export function imageElementInteraction(config, { cropping }) {
|
|
9
|
+
// Ohne Angabe zieht CanvasImage (Vorgabe `draggable = true`).
|
|
10
|
+
const draggable = config.draggable ?? true;
|
|
11
|
+
const transformable = config.transformable === true;
|
|
12
|
+
if (config.id === BACKGROUND_IMAGE_NODE_ID) {
|
|
13
|
+
return { draggable: cropping && draggable, transformable: cropping && transformable };
|
|
14
|
+
}
|
|
15
|
+
return { draggable, transformable };
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Ob das Element den Ausschnitt-Modus hat: nur das Hintergrundfoto, und nur,
|
|
19
|
+
* wenn der Modus dort Ziehen oder Zoomen freigibt (nicht das feste Fotoband in
|
|
20
|
+
* veranstaltung). Fläche, Leiste und Menü fragen dasselbe. Ohne coverFit gibt
|
|
21
|
+
* es keinen Ausschnitt zum Verschieben.
|
|
22
|
+
*/
|
|
23
|
+
export function canCropBackgroundPhoto(config) {
|
|
24
|
+
if (config.id !== BACKGROUND_IMAGE_NODE_ID || config.coverFit !== true)
|
|
25
|
+
return false;
|
|
26
|
+
const crop = imageElementInteraction(config, { cropping: true });
|
|
27
|
+
return crop.draggable || crop.transformable;
|
|
28
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Balken — the data of a bar group on the canvas: one or three skewed bars
|
|
3
|
+
* with a text each. The kind's slot (`balkenInstances`, its actions) is the
|
|
4
|
+
* editor's; how a group looks is supplied by the host as a kind renderer
|
|
5
|
+
* (`registerKindRenderers`), and its presets live with the host's brand.
|
|
6
|
+
*/
|
|
7
|
+
export type BalkenMode = 'single' | 'triple';
|
|
8
|
+
export interface BalkenInstance {
|
|
9
|
+
id: string;
|
|
10
|
+
mode: BalkenMode;
|
|
11
|
+
colorSchemeId: string;
|
|
12
|
+
widthScale: number;
|
|
13
|
+
offset: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
scale: number;
|
|
18
|
+
texts: string[];
|
|
19
|
+
rotation: number;
|
|
20
|
+
opacity?: number;
|
|
21
|
+
barOffsets?: [number, number, number];
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Balken — the data of a bar group on the canvas: one or three skewed bars
|
|
4
|
+
* with a text each. The kind's slot (`balkenInstances`, its actions) is the
|
|
5
|
+
* editor's; how a group looks is supplied by the host as a kind renderer
|
|
6
|
+
* (`registerKindRenderers`), and its presets live with the host's brand.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canvas assets: placed graphics and the catalogue they resolve against.
|
|
3
|
+
* The graphics themselves are host data (`registerAssetCatalog`); the editor
|
|
4
|
+
* knows none of them by name.
|
|
5
|
+
*/
|
|
6
|
+
import { type AssetInstance } from '@ggraphic/core';
|
|
7
|
+
import type { CanvasAiNamedOption } from '@ggraphic/editor/ai/types';
|
|
8
|
+
import type { ElementPanelHost } from '@ggraphic/editor/sidebar/sections/assets/elementPanelHost';
|
|
9
|
+
import type { KawaiiDef, SvgDef } from '@ggraphic/editor/utils/illustrations/types';
|
|
10
|
+
import type { StickerRef } from '@ggraphic/schema';
|
|
11
|
+
export { ASSET_TARGET_SIZE, type AssetInstance } from '@ggraphic/core';
|
|
12
|
+
export type AssetAudience = 'de-DE' | 'de-AT' | 'all';
|
|
13
|
+
export interface UniversalAsset {
|
|
14
|
+
id: string;
|
|
15
|
+
src: string;
|
|
16
|
+
label: string;
|
|
17
|
+
category: 'decoration' | 'mark' | 'emoji' | 'sticker';
|
|
18
|
+
tags: string[];
|
|
19
|
+
/** Which brand locale the asset belongs to; 'all' is locale-independent. */
|
|
20
|
+
audience: AssetAudience;
|
|
21
|
+
/** Light artwork that needs a dark tile in the catalogue to stay visible. */
|
|
22
|
+
darkPreview?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Factory function to create a new asset instance centered on the canvas
|
|
26
|
+
*/
|
|
27
|
+
export declare const createAssetInstance: (assetId: string, canvasWidth: number, canvasHeight: number) => AssetInstance;
|
|
28
|
+
/**
|
|
29
|
+
* A sticker on the canvas: a catalogue sticker by id, a shop sticker with its
|
|
30
|
+
* share path. Null when the ref resolves to no image.
|
|
31
|
+
*/
|
|
32
|
+
export declare const createStickerInstance: (ref: StickerRef, canvasWidth: number, canvasHeight: number, catalog?: CanvasAssetCatalog) => AssetInstance | null;
|
|
33
|
+
/** Any emoji by its file code ("1f600", "1f9d1_1f3fb"). */
|
|
34
|
+
export declare const emojiCodeAssetId: (code: string) => string;
|
|
35
|
+
/**
|
|
36
|
+
* The graphics a placed asset instance can name, supplied by the host
|
|
37
|
+
* (`registerAssetCatalog`). Saved canvases reference them by id and src, so
|
|
38
|
+
* a host never renames an entry.
|
|
39
|
+
*/
|
|
40
|
+
export interface CanvasAssetCatalog {
|
|
41
|
+
/** Everything an instance may name, in lookup order: by id and by src, the first match wins. */
|
|
42
|
+
assets: readonly UniversalAsset[];
|
|
43
|
+
/**
|
|
44
|
+
* Is this an image the host stores for one instance (a shop sticker)? Such
|
|
45
|
+
* an instance draws from its own `src`; any other `src` is ignored.
|
|
46
|
+
*/
|
|
47
|
+
isInstanceSrc: (src: string) => boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Where the file of an emoji lives, by its code ("1f600", "1f9d1_1f3fb").
|
|
50
|
+
* Without it the editor knows no emoji file and a placed emoji draws nothing.
|
|
51
|
+
*/
|
|
52
|
+
emojiSrc?: (code: string) => string;
|
|
53
|
+
/**
|
|
54
|
+
* Does the host ship the file of this emoji (`group` is emojibase's group key, e.g. `flags`)? A host
|
|
55
|
+
* that bundles a subset lists only that; without it every emoji of the Noto set is offered.
|
|
56
|
+
* An emoji whose five skin-tone files are not all offered loses the tone picker.
|
|
57
|
+
*/
|
|
58
|
+
emojiOffered?: (code: string, group: string) => boolean;
|
|
59
|
+
/** The illustration catalogues; without them the editor offers none. */
|
|
60
|
+
illustrations?: IllustrationSources;
|
|
61
|
+
/**
|
|
62
|
+
* What the Elemente panel lists as graphics, logos, marks, stickers and
|
|
63
|
+
* emoji, by `category`. Without it, every entry of `assets` is offered;
|
|
64
|
+
* a host that keeps template variants in `assets` lists only the rest here.
|
|
65
|
+
*/
|
|
66
|
+
offered?: readonly UniversalAsset[];
|
|
67
|
+
/** Where the panels' image tiles load from; without it the URLs are used as they are. */
|
|
68
|
+
imageUrls?: AssetImageUrls;
|
|
69
|
+
/** German name of a bundled stock photo's `category`, or null; makes "Mobilität" find the group. */
|
|
70
|
+
stockCategoryName?: (category: string) => string | null;
|
|
71
|
+
/** The host's own tiles, categories and wording in the Elemente panel. */
|
|
72
|
+
elementPanel?: ElementPanelHost;
|
|
73
|
+
}
|
|
74
|
+
/** The image URLs the Elemente panel and the image pickers build tiles from. */
|
|
75
|
+
export interface AssetImageUrls {
|
|
76
|
+
/** Card-sized copy of a stored image. */
|
|
77
|
+
thumbnail: (src: string, width: 200 | 400 | 800) => string;
|
|
78
|
+
/** Working-size copy of a stored or bundled photo. */
|
|
79
|
+
preview: (src: string, width: number) => string;
|
|
80
|
+
/** Where a library item with only a share token is fetched from; null when the host has no such URL. */
|
|
81
|
+
shareDownload: (shareToken: string) => string | null;
|
|
82
|
+
/** The URL a bundled stock photo is placed from. */
|
|
83
|
+
stockPhoto: (filename: string) => string;
|
|
84
|
+
/** Whether a URL is one `stockPhoto` could have produced (persisted tiles are checked against it). */
|
|
85
|
+
isStockPhoto: (url: string) => boolean;
|
|
86
|
+
}
|
|
87
|
+
export declare const plainAssetImageUrls: AssetImageUrls;
|
|
88
|
+
/** The id of a Studio sticker of the viewer's gallery as an asset instance names it (`asset:<id>`). */
|
|
89
|
+
export declare const studioStickerId: (assetId: string) => string;
|
|
90
|
+
/** The illustration sets a host offers, loaded on the first lookup. */
|
|
91
|
+
export interface IllustrationSources {
|
|
92
|
+
loadKawaii: () => Promise<KawaiiDef[]>;
|
|
93
|
+
/** Every SVG set, in catalogue order. */
|
|
94
|
+
loadSvg: () => Promise<SvgDef[]>;
|
|
95
|
+
/** Where the SVG files and their `thumbs/` PNGs live, before `<source>/<filename>`. */
|
|
96
|
+
basePath: string;
|
|
97
|
+
/**
|
|
98
|
+
* The few ids the AI planner may reference with `add-illustration`: the full
|
|
99
|
+
* catalogue is far too large for a prompt. Every id must resolve in the sets.
|
|
100
|
+
*/
|
|
101
|
+
aiPicks?: readonly CanvasAiNamedOption[];
|
|
102
|
+
/** The curated few the panel shows before the full sets have loaded, after the Kawaii set. */
|
|
103
|
+
featured?: readonly SvgDef[];
|
|
104
|
+
/** Colour the Kawaii characters are drawn in on their tiles. */
|
|
105
|
+
kawaiiColor?: string;
|
|
106
|
+
}
|
|
107
|
+
/** The host's catalogue, installed once at startup; replaces the one before. */
|
|
108
|
+
export declare function registerAssetCatalog(catalog: CanvasAssetCatalog): void;
|
|
109
|
+
/** Calls `listener` after every `registerAssetCatalog`; returns the unsubscribe. */
|
|
110
|
+
export declare function onAssetCatalogChange(listener: () => void): () => void;
|
|
111
|
+
/** The catalogue lookups answer from (`utils/illustrations/registry`). */
|
|
112
|
+
export declare function registeredAssetCatalog(): CanvasAssetCatalog;
|
|
113
|
+
export declare function hasDarkPreview(asset: UniversalAsset): boolean;
|
|
114
|
+
export declare function assetMatchesLocale(asset: UniversalAsset, locale: AssetAudience): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Get asset by ID — aus dem Katalog des Hosts, dazu jedes Emoji, denn alle koennen als
|
|
117
|
+
* Asset-Instanz auf der Flaeche liegen.
|
|
118
|
+
*/
|
|
119
|
+
export declare function getAssetById(id: string, catalog?: CanvasAssetCatalog): UniversalAsset | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* The image an instance draws: its own share path (shop sticker), else the
|
|
122
|
+
* catalogue's. A foreign `src` is ignored so persisted state can't point the
|
|
123
|
+
* canvas at an arbitrary URL.
|
|
124
|
+
*/
|
|
125
|
+
export declare function resolveAssetInstanceSrc(instance: Pick<AssetInstance, 'assetId' | 'src'>, catalog?: CanvasAssetCatalog): string | null;
|
|
126
|
+
/** Sticker-like instances get a pixel-exact hit area: transparent pixels click through. */
|
|
127
|
+
export declare function isStickerLikeInstance(instance: Pick<AssetInstance, 'assetId' | 'src'>, catalog?: CanvasAssetCatalog): boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Welche Grafik steckt hinter dieser Quelle? Die Bruecke von einer Vorlage, die
|
|
130
|
+
* ihre Bilder als `src` deklariert, zum Katalog, der sie ueber eine ID fuehrt —
|
|
131
|
+
* die Vorlagen-Elemente und die Katalog-Eintraege sind dieselben Bilder, nur
|
|
132
|
+
* zweimal aufgeschrieben (#3403).
|
|
133
|
+
*/
|
|
134
|
+
export declare function getAssetBySrc(src: string, catalog?: CanvasAssetCatalog): UniversalAsset | undefined;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Canvas assets: placed graphics and the catalogue they resolve against.
|
|
4
|
+
* The graphics themselves are host data (`registerAssetCatalog`); the editor
|
|
5
|
+
* knows none of them by name.
|
|
6
|
+
*/
|
|
7
|
+
export { ASSET_TARGET_SIZE } from '@ggraphic/core';
|
|
8
|
+
/**
|
|
9
|
+
* Factory function to create a new asset instance centered on the canvas
|
|
10
|
+
*/
|
|
11
|
+
export const createAssetInstance = (assetId, canvasWidth, canvasHeight) => ({
|
|
12
|
+
id: `asset-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
13
|
+
assetId,
|
|
14
|
+
x: canvasWidth / 2,
|
|
15
|
+
y: canvasHeight / 2,
|
|
16
|
+
scale: 1,
|
|
17
|
+
rotation: 0,
|
|
18
|
+
opacity: 1,
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* A sticker on the canvas: a catalogue sticker by id, a shop sticker with its
|
|
22
|
+
* share path. Null when the ref resolves to no image.
|
|
23
|
+
*/
|
|
24
|
+
export const createStickerInstance = (ref, canvasWidth, canvasHeight, catalog = registered) => {
|
|
25
|
+
const base = createAssetInstance(ref.id, canvasWidth, canvasHeight);
|
|
26
|
+
const instance = catalog.isInstanceSrc(ref.src) ? { ...base, src: ref.src } : base;
|
|
27
|
+
return resolveAssetInstanceSrc(instance, catalog) ? instance : null;
|
|
28
|
+
};
|
|
29
|
+
/** Any emoji by its file code ("1f600", "1f9d1_1f3fb"). */
|
|
30
|
+
export const emojiCodeAssetId = (code) => `emoji-${code}`;
|
|
31
|
+
const EMOJI_ID = /^emoji-([0-9a-f]{4,6}(?:_[0-9a-f]{4,6})*)$/;
|
|
32
|
+
/**
|
|
33
|
+
* The full catalogue (`utils/emoji/emojiCatalog`) loads lazily, but a placed
|
|
34
|
+
* emoji must draw without it: its id alone names the file, through the host's
|
|
35
|
+
* `emojiSrc`. The pattern keeps persisted state from naming anything but an
|
|
36
|
+
* emoji code.
|
|
37
|
+
*/
|
|
38
|
+
function emojiAssetFromId(id, catalog) {
|
|
39
|
+
const code = EMOJI_ID.exec(id)?.[1];
|
|
40
|
+
if (!code || !catalog.emojiSrc)
|
|
41
|
+
return undefined;
|
|
42
|
+
return {
|
|
43
|
+
id,
|
|
44
|
+
src: catalog.emojiSrc(code),
|
|
45
|
+
label: String.fromCodePoint(...code.split('_').map((cp) => parseInt(cp, 16))),
|
|
46
|
+
category: 'emoji',
|
|
47
|
+
tags: ['emoji'],
|
|
48
|
+
audience: 'all',
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export const plainAssetImageUrls = {
|
|
52
|
+
thumbnail: (src) => src,
|
|
53
|
+
preview: (src) => src,
|
|
54
|
+
shareDownload: () => null,
|
|
55
|
+
stockPhoto: (filename) => encodeURIComponent(filename),
|
|
56
|
+
isStockPhoto: () => false,
|
|
57
|
+
};
|
|
58
|
+
/** The id of a Studio sticker of the viewer's gallery as an asset instance names it (`asset:<id>`). */
|
|
59
|
+
export const studioStickerId = (assetId) => `asset:${assetId}`;
|
|
60
|
+
/**
|
|
61
|
+
* A module-level registry, not a `CanvasEditorServices` field: the lookups run
|
|
62
|
+
* in commands, action factories and offscreen renders that have no React
|
|
63
|
+
* context. Without a host the editor knows no catalogue graphic, no emoji
|
|
64
|
+
* file and no illustration, and ignores every instance `src`.
|
|
65
|
+
*/
|
|
66
|
+
let registered = { assets: [], isInstanceSrc: () => false };
|
|
67
|
+
const catalogListeners = new Set();
|
|
68
|
+
/** The host's catalogue, installed once at startup; replaces the one before. */
|
|
69
|
+
export function registerAssetCatalog(catalog) {
|
|
70
|
+
registered = catalog;
|
|
71
|
+
catalogListeners.forEach((listener) => listener());
|
|
72
|
+
}
|
|
73
|
+
/** Calls `listener` after every `registerAssetCatalog`; returns the unsubscribe. */
|
|
74
|
+
export function onAssetCatalogChange(listener) {
|
|
75
|
+
catalogListeners.add(listener);
|
|
76
|
+
return () => {
|
|
77
|
+
catalogListeners.delete(listener);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/** The catalogue lookups answer from (`utils/illustrations/registry`). */
|
|
81
|
+
export function registeredAssetCatalog() {
|
|
82
|
+
return registered;
|
|
83
|
+
}
|
|
84
|
+
export function hasDarkPreview(asset) {
|
|
85
|
+
return asset.darkPreview === true || /weiss|white/.test(asset.id);
|
|
86
|
+
}
|
|
87
|
+
export function assetMatchesLocale(asset, locale) {
|
|
88
|
+
return asset.audience === 'all' || asset.audience === locale;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Get asset by ID — aus dem Katalog des Hosts, dazu jedes Emoji, denn alle koennen als
|
|
92
|
+
* Asset-Instanz auf der Flaeche liegen.
|
|
93
|
+
*/
|
|
94
|
+
export function getAssetById(id, catalog = registered) {
|
|
95
|
+
return catalog.assets.find((asset) => asset.id === id) ?? emojiAssetFromId(id, catalog);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The image an instance draws: its own share path (shop sticker), else the
|
|
99
|
+
* catalogue's. A foreign `src` is ignored so persisted state can't point the
|
|
100
|
+
* canvas at an arbitrary URL.
|
|
101
|
+
*/
|
|
102
|
+
export function resolveAssetInstanceSrc(instance, catalog = registered) {
|
|
103
|
+
if (instance.src && catalog.isInstanceSrc(instance.src))
|
|
104
|
+
return instance.src;
|
|
105
|
+
return getAssetById(instance.assetId, catalog)?.src ?? null;
|
|
106
|
+
}
|
|
107
|
+
/** Sticker-like instances get a pixel-exact hit area: transparent pixels click through. */
|
|
108
|
+
export function isStickerLikeInstance(instance, catalog = registered) {
|
|
109
|
+
if (instance.src && catalog.isInstanceSrc(instance.src))
|
|
110
|
+
return true;
|
|
111
|
+
return getAssetById(instance.assetId, catalog)?.category === 'sticker';
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Welche Grafik steckt hinter dieser Quelle? Die Bruecke von einer Vorlage, die
|
|
115
|
+
* ihre Bilder als `src` deklariert, zum Katalog, der sie ueber eine ID fuehrt —
|
|
116
|
+
* die Vorlagen-Elemente und die Katalog-Eintraege sind dieselben Bilder, nur
|
|
117
|
+
* zweimal aufgeschrieben (#3403).
|
|
118
|
+
*/
|
|
119
|
+
export function getAssetBySrc(src, catalog = registered) {
|
|
120
|
+
return catalog.assets.find((asset) => asset.src === src);
|
|
121
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canvas Clipboard - Singleton for copy/paste operations
|
|
3
|
+
*
|
|
4
|
+
* Manages a session-level clipboard for canvas elements (shapes, icons, host kinds, etc.)
|
|
5
|
+
* Enables copy (Ctrl+C) and paste (Ctrl+V) functionality across canvas instances.
|
|
6
|
+
*
|
|
7
|
+
* Die Typtabelle steht nicht hier, sondern in `duplicateElement.ts`: Kopieren,
|
|
8
|
+
* Einfügen und Duplizieren betreffen dieselben Elementarten, und zwei Listen
|
|
9
|
+
* gingen erwartbar auseinander — genau das war vorher der Fall, `chart` fehlte
|
|
10
|
+
* hier, während Strg+D es konnte.
|
|
11
|
+
*/
|
|
12
|
+
import { type PageGroup } from '../groups/pageGroups.js';
|
|
13
|
+
import { type DuplicableDataMap, type DuplicableEntry, type DuplicableType } from './duplicateElement.js';
|
|
14
|
+
export type ClipboardItemType = DuplicableType;
|
|
15
|
+
export type ClipboardDataMap = DuplicableDataMap;
|
|
16
|
+
export type ClipboardEntry = DuplicableEntry;
|
|
17
|
+
/**
|
|
18
|
+
* Eine kopierte Auswahl. `bounds` ist ihre Box in Vorlagen-Koordinaten, beim
|
|
19
|
+
* Kopieren gemessen — „Hier einfügen“ legt deren linke obere Ecke an den
|
|
20
|
+
* Zeiger. `null`, wenn sich nichts messen ließ; dann gilt der feste Versatz.
|
|
21
|
+
*/
|
|
22
|
+
export interface ClipboardContent {
|
|
23
|
+
readonly entries: readonly ClipboardEntry[];
|
|
24
|
+
/** The ids the entries had on the page they were copied from, one per entry. */
|
|
25
|
+
readonly sourceIds: readonly string[];
|
|
26
|
+
/** The groups that lay wholly within the copied elements, over their source ids. */
|
|
27
|
+
readonly groups: readonly PageGroup[];
|
|
28
|
+
readonly bounds: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
} | null;
|
|
34
|
+
}
|
|
35
|
+
export declare class CanvasClipboard {
|
|
36
|
+
private static content;
|
|
37
|
+
static copy(content: ClipboardContent): void;
|
|
38
|
+
/**
|
|
39
|
+
* Paste the clipboard contents (returns null if empty).
|
|
40
|
+
* Callers should narrow on `entry.type` to access `entry.data` safely.
|
|
41
|
+
*/
|
|
42
|
+
static paste(): ClipboardContent | null;
|
|
43
|
+
/**
|
|
44
|
+
* Clear the clipboard
|
|
45
|
+
*/
|
|
46
|
+
static clear(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Check if clipboard has content
|
|
49
|
+
*/
|
|
50
|
+
static hasContent(): boolean;
|
|
51
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Canvas Clipboard - Singleton for copy/paste operations
|
|
4
|
+
*
|
|
5
|
+
* Manages a session-level clipboard for canvas elements (shapes, icons, host kinds, etc.)
|
|
6
|
+
* Enables copy (Ctrl+C) and paste (Ctrl+V) functionality across canvas instances.
|
|
7
|
+
*
|
|
8
|
+
* Die Typtabelle steht nicht hier, sondern in `duplicateElement.ts`: Kopieren,
|
|
9
|
+
* Einfügen und Duplizieren betreffen dieselben Elementarten, und zwei Listen
|
|
10
|
+
* gingen erwartbar auseinander — genau das war vorher der Fall, `chart` fehlte
|
|
11
|
+
* hier, während Strg+D es konnte.
|
|
12
|
+
*/
|
|
13
|
+
export class CanvasClipboard {
|
|
14
|
+
static content = null;
|
|
15
|
+
static copy(content) {
|
|
16
|
+
CanvasClipboard.content = content.entries.length > 0 ? content : null;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Paste the clipboard contents (returns null if empty).
|
|
20
|
+
* Callers should narrow on `entry.type` to access `entry.data` safely.
|
|
21
|
+
*/
|
|
22
|
+
static paste() {
|
|
23
|
+
return CanvasClipboard.content;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Clear the clipboard
|
|
27
|
+
*/
|
|
28
|
+
static clear() {
|
|
29
|
+
CanvasClipboard.content = null;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Check if clipboard has content
|
|
33
|
+
*/
|
|
34
|
+
static hasContent() {
|
|
35
|
+
return CanvasClipboard.content !== null;
|
|
36
|
+
}
|
|
37
|
+
}
|