@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,216 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import Konva from 'konva';
|
|
3
|
+
import { getActiveImageFilters, imageFilterAttrs } from './imageFilters.js';
|
|
4
|
+
/**
|
|
5
|
+
* Konva-Name des abgedunkelten ganzen Fotos im Zuschneide-Modus (Hintergrund
|
|
6
|
+
* und eigene Bilder). Die Bühne endet an der Seite; was darüber hinausragt,
|
|
7
|
+
* zeichnet `CropGhostOverlay` im DOM nach.
|
|
8
|
+
*/
|
|
9
|
+
export const CROP_GHOST_NAME = 'crop-ghost';
|
|
10
|
+
export const CROP_GHOST_OPACITY = 0.35;
|
|
11
|
+
/**
|
|
12
|
+
* Lage eines Restbilds für `photo`; gespiegelt liegt der Ursprung an der
|
|
13
|
+
* fernen Kante. Begradigt (`rotation`, Grad) dreht es sich um seine Mitte wie
|
|
14
|
+
* das Foto im Rahmen.
|
|
15
|
+
*/
|
|
16
|
+
export function cropGhostAttrs(photo, mirror, rotation = 0) {
|
|
17
|
+
const scaleX = mirror?.x ? -1 : 1;
|
|
18
|
+
const scaleY = mirror?.y ? -1 : 1;
|
|
19
|
+
if (rotation !== 0) {
|
|
20
|
+
return {
|
|
21
|
+
x: photo.x + photo.width / 2,
|
|
22
|
+
y: photo.y + photo.height / 2,
|
|
23
|
+
width: photo.width,
|
|
24
|
+
height: photo.height,
|
|
25
|
+
offsetX: photo.width / 2,
|
|
26
|
+
offsetY: photo.height / 2,
|
|
27
|
+
rotation,
|
|
28
|
+
scaleX,
|
|
29
|
+
scaleY,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
x: photo.x + (mirror?.x ? photo.width : 0),
|
|
34
|
+
y: photo.y + (mirror?.y ? photo.height : 0),
|
|
35
|
+
width: photo.width,
|
|
36
|
+
height: photo.height,
|
|
37
|
+
offsetX: 0,
|
|
38
|
+
offsetY: 0,
|
|
39
|
+
rotation: 0,
|
|
40
|
+
scaleX,
|
|
41
|
+
scaleY,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** Setzt ein Restbild direkt am Knoten (während Ziehen und Zoomen, ohne React-Zustand). */
|
|
45
|
+
export function placeCropGhost(node, photo, mirror, rotation = 0) {
|
|
46
|
+
node?.setAttrs(cropGhostAttrs(photo, mirror, rotation));
|
|
47
|
+
}
|
|
48
|
+
// Grenzen der Overlay-Fläche in Gerätepixeln. iOS-WebKit verwirft Canvas über
|
|
49
|
+
// 16 777 216 px still; die Fläche bleibt mit Abstand darunter.
|
|
50
|
+
export const MAX_OVERLAY_SIDE = 8192;
|
|
51
|
+
export const MAX_OVERLAY_AREA = 8_388_608;
|
|
52
|
+
/**
|
|
53
|
+
* Welcher Teil von `bounds` (Container-Koordinaten) gezeichnet wird und mit
|
|
54
|
+
* welcher Auflösung: nur was in `visible` liegt (der sichtbare Ausschnitt;
|
|
55
|
+
* `null` = unbekannt, dann alles), höchstens `MAX_OVERLAY_SIDE` je Kante und
|
|
56
|
+
* `MAX_OVERLAY_AREA` insgesamt. `null`, wenn nichts davon sichtbar ist.
|
|
57
|
+
*/
|
|
58
|
+
export function overlayRegion(bounds, visible, devicePixelRatio) {
|
|
59
|
+
const x0 = Math.max(bounds.x, visible?.x ?? -Infinity);
|
|
60
|
+
const y0 = Math.max(bounds.y, visible?.y ?? -Infinity);
|
|
61
|
+
const x1 = Math.min(bounds.x + bounds.width, visible ? visible.x + visible.width : Infinity);
|
|
62
|
+
const y1 = Math.min(bounds.y + bounds.height, visible ? visible.y + visible.height : Infinity);
|
|
63
|
+
if (x1 <= x0 || y1 <= y0)
|
|
64
|
+
return null;
|
|
65
|
+
const left = Math.floor(x0);
|
|
66
|
+
const top = Math.floor(y0);
|
|
67
|
+
const width = Math.max(1, Math.ceil(x1) - left);
|
|
68
|
+
const height = Math.max(1, Math.ceil(y1) - top);
|
|
69
|
+
const ratio = Math.min(devicePixelRatio || 1, MAX_OVERLAY_SIDE / Math.max(width, height), Math.sqrt(MAX_OVERLAY_AREA / (width * height)));
|
|
70
|
+
return {
|
|
71
|
+
rect: { x: left, y: top, width, height },
|
|
72
|
+
ratio,
|
|
73
|
+
pixelWidth: Math.max(1, Math.floor(width * ratio)),
|
|
74
|
+
pixelHeight: Math.max(1, Math.floor(height * ratio)),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Der sichtbare Teil von `container` in seinen eigenen CSS-Koordinaten: das
|
|
79
|
+
* Browserfenster, zurückgerechnet durch die Zoom-Skalierung der Seiten.
|
|
80
|
+
* `null`, wenn der Container nicht vermessen ist (jsdom, nicht eingehängt).
|
|
81
|
+
*/
|
|
82
|
+
export function visibleContainerRect(container) {
|
|
83
|
+
const box = container.getBoundingClientRect();
|
|
84
|
+
if (!box.width || !container.offsetWidth)
|
|
85
|
+
return null;
|
|
86
|
+
const scale = box.width / container.offsetWidth;
|
|
87
|
+
return {
|
|
88
|
+
x: -box.left / scale,
|
|
89
|
+
y: -box.top / scale,
|
|
90
|
+
width: window.innerWidth / scale,
|
|
91
|
+
height: window.innerHeight / scale,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Zeichnet alle sichtbaren Restbilder der Bühne in `canvas`, das im selben
|
|
96
|
+
* Koordinatensystem wie der Bühnen-Container liegt, und spart die Seite aus:
|
|
97
|
+
* dort zeichnet Konva selbst. Gezeichnet wird nur, was in `visible` liegt.
|
|
98
|
+
* Ohne sichtbares Restbild wird `canvas` ausgeblendet.
|
|
99
|
+
*/
|
|
100
|
+
export function paintCropGhosts(stage, canvas, visible = null) {
|
|
101
|
+
const ghosts = stage
|
|
102
|
+
.find(`.${CROP_GHOST_NAME}`)
|
|
103
|
+
.filter((node) => node.isVisible() && node.image());
|
|
104
|
+
const placed = ghosts.map((node) => ({
|
|
105
|
+
node,
|
|
106
|
+
matrix: node.getAbsoluteTransform().getMatrix(),
|
|
107
|
+
width: node.width(),
|
|
108
|
+
height: node.height(),
|
|
109
|
+
}));
|
|
110
|
+
let minX = Infinity;
|
|
111
|
+
let minY = Infinity;
|
|
112
|
+
let maxX = -Infinity;
|
|
113
|
+
let maxY = -Infinity;
|
|
114
|
+
for (const { matrix: m, width, height } of placed) {
|
|
115
|
+
for (const [px, py] of [
|
|
116
|
+
[0, 0],
|
|
117
|
+
[width, 0],
|
|
118
|
+
[0, height],
|
|
119
|
+
[width, height],
|
|
120
|
+
]) {
|
|
121
|
+
const x = m[0] * px + m[2] * py + m[4];
|
|
122
|
+
const y = m[1] * px + m[3] * py + m[5];
|
|
123
|
+
minX = Math.min(minX, x);
|
|
124
|
+
minY = Math.min(minY, y);
|
|
125
|
+
maxX = Math.max(maxX, x);
|
|
126
|
+
maxY = Math.max(maxY, y);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
const region = placed.length > 0
|
|
130
|
+
? overlayRegion({ x: minX, y: minY, width: maxX - minX, height: maxY - minY }, visible, window.devicePixelRatio)
|
|
131
|
+
: null;
|
|
132
|
+
if (!region) {
|
|
133
|
+
canvas.style.display = 'none';
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const { rect, pixelWidth, pixelHeight } = region;
|
|
137
|
+
// Neu anlegen nur bei neuer Größe; sonst genügt das Leeren.
|
|
138
|
+
if (canvas.width !== pixelWidth || canvas.height !== pixelHeight) {
|
|
139
|
+
canvas.width = pixelWidth;
|
|
140
|
+
canvas.height = pixelHeight;
|
|
141
|
+
}
|
|
142
|
+
Object.assign(canvas.style, {
|
|
143
|
+
display: '',
|
|
144
|
+
left: `${rect.x}px`,
|
|
145
|
+
top: `${rect.y}px`,
|
|
146
|
+
width: `${rect.width}px`,
|
|
147
|
+
height: `${rect.height}px`,
|
|
148
|
+
});
|
|
149
|
+
const ctx = canvas.getContext('2d');
|
|
150
|
+
if (!ctx)
|
|
151
|
+
return;
|
|
152
|
+
const sx = pixelWidth / rect.width;
|
|
153
|
+
const sy = pixelHeight / rect.height;
|
|
154
|
+
const toOverlay = [sx, 0, 0, sy, -rect.x * sx, -rect.y * sy];
|
|
155
|
+
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
156
|
+
ctx.globalAlpha = 1;
|
|
157
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
158
|
+
for (const { node, matrix: m, width, height } of placed) {
|
|
159
|
+
ctx.setTransform(...toOverlay);
|
|
160
|
+
ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
|
|
161
|
+
ctx.globalAlpha = node.getAbsoluteOpacity();
|
|
162
|
+
ctx.drawImage(node.image(), 0, 0, width, height);
|
|
163
|
+
}
|
|
164
|
+
ctx.setTransform(...toOverlay);
|
|
165
|
+
ctx.globalAlpha = 1;
|
|
166
|
+
ctx.clearRect(0, 0, stage.width(), stage.height());
|
|
167
|
+
}
|
|
168
|
+
// Längste Kante der gefilterten Restbild-Vorlage; abgedunkelt braucht es keine volle Auflösung.
|
|
169
|
+
const GHOST_SOURCE_SIDE = 1024;
|
|
170
|
+
/**
|
|
171
|
+
* Die Bildquelle des Restbilds mit dem Look des Fotos („Bearbeiten"-Filter,
|
|
172
|
+
* Einfärbung), einmal auf eine verkleinerte Kopie gerechnet statt per Cache
|
|
173
|
+
* auf dem ganzen, oft vielfach gezoomten Restbild. Spiegeln bleibt außen vor:
|
|
174
|
+
* das Restbild spiegelt über seine Skalierung. `displayedWidth` ist die Breite
|
|
175
|
+
* des ganzen Fotos auf der Bühne; der Weichzeichner-Radius gilt dort.
|
|
176
|
+
*/
|
|
177
|
+
export function cropGhostSource(image, adjustments, displayedWidth, color = null) {
|
|
178
|
+
const look = adjustments ? { ...adjustments, flipX: false, flipY: false } : null;
|
|
179
|
+
const filters = [
|
|
180
|
+
...(color ? [Konva.Filters.RGB] : []),
|
|
181
|
+
...(look ? getActiveImageFilters(look) : []),
|
|
182
|
+
];
|
|
183
|
+
const natural = { width: image.naturalWidth, height: image.naturalHeight };
|
|
184
|
+
if (filters.length === 0 || !natural.width || !natural.height)
|
|
185
|
+
return image;
|
|
186
|
+
const scale = Math.min(1, GHOST_SOURCE_SIDE / Math.max(natural.width, natural.height));
|
|
187
|
+
const width = Math.max(1, Math.round(natural.width * scale));
|
|
188
|
+
const height = Math.max(1, Math.round(natural.height * scale));
|
|
189
|
+
const canvas = document.createElement('canvas');
|
|
190
|
+
canvas.width = width;
|
|
191
|
+
canvas.height = height;
|
|
192
|
+
const ctx = canvas.getContext('2d');
|
|
193
|
+
if (!ctx)
|
|
194
|
+
return image;
|
|
195
|
+
ctx.drawImage(image, 0, 0, width, height);
|
|
196
|
+
// Die Filter lesen ihre Werte vom Knoten (`this`), wie in Konvas Cache.
|
|
197
|
+
const attrs = new Konva.Image({
|
|
198
|
+
image,
|
|
199
|
+
...(look ? imageFilterAttrs(look) : {}),
|
|
200
|
+
blurRadius: ((look?.blur ?? 0) * width) / Math.max(1, displayedWidth),
|
|
201
|
+
...(color
|
|
202
|
+
? {
|
|
203
|
+
red: parseInt(color.slice(1, 3), 16),
|
|
204
|
+
green: parseInt(color.slice(3, 5), 16),
|
|
205
|
+
blue: parseInt(color.slice(5, 7), 16),
|
|
206
|
+
}
|
|
207
|
+
: {}),
|
|
208
|
+
});
|
|
209
|
+
const data = ctx.getImageData(0, 0, width, height);
|
|
210
|
+
for (const filter of filters)
|
|
211
|
+
if (typeof filter === 'function')
|
|
212
|
+
filter.call(attrs, data);
|
|
213
|
+
ctx.putImageData(data, 0, 0);
|
|
214
|
+
attrs.destroy();
|
|
215
|
+
return canvas;
|
|
216
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type UserImageInstance } from '@ggraphic/editor/utils/userImageUtils';
|
|
2
|
+
import { type CanvasElementConfig } from '../configs/types.js';
|
|
3
|
+
import { type CropUpdate } from './cropTarget.js';
|
|
4
|
+
/**
|
|
5
|
+
* Der Zuschnitt-Zustand eines Elements beim Betreten des Modus. Gemerkt wird
|
|
6
|
+
* nur, was der Modus schreibt — „Abbrechen" setzt sonst Fremdänderungen am
|
|
7
|
+
* übrigen Zustand (Mitarbeitende, KI) mit zurück.
|
|
8
|
+
*/
|
|
9
|
+
export type CropSnapshot = {
|
|
10
|
+
kind: 'template';
|
|
11
|
+
values: Record<string, unknown>;
|
|
12
|
+
} | {
|
|
13
|
+
kind: 'user-image';
|
|
14
|
+
id: string;
|
|
15
|
+
fields: Partial<UserImageInstance>;
|
|
16
|
+
};
|
|
17
|
+
export declare function takeCropSnapshot(state: Record<string, unknown>, elements: readonly CanvasElementConfig[], id: string): CropSnapshot | null;
|
|
18
|
+
/** Die Zustands-Teile, die den gemerkten Zuschnitt wiederherstellen; `null`, wenn das Element fehlt. */
|
|
19
|
+
export declare function restoreCropSnapshot(state: Record<string, unknown>, snapshot: CropSnapshot): Record<string, unknown> | null;
|
|
20
|
+
/** Der Begradigungs-Winkel des Elements im Zuschneide-Modus (Grad, 0 ohne). */
|
|
21
|
+
export declare function cropRotationOf(state: Record<string, unknown>, elements: readonly CanvasElementConfig[], id: string): number;
|
|
22
|
+
/** Ein gestrecktes eigenes Bild wird zum Begradigen `cover`; Pan und Zoom bleiben, die Bühne hält die Deckung. */
|
|
23
|
+
export declare function cropRotationUpdate(state: Record<string, unknown>, elements: readonly CanvasElementConfig[], id: string, deg: number): CropUpdate | null;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import { BACKGROUND_STRAIGHTEN_KEY, backgroundStraighten, clampStraighten, } from '@ggraphic/editor/utils/straighten';
|
|
3
|
+
import { cropTargetOf } from './cropTarget.js';
|
|
4
|
+
import { BACKGROUND_IMAGE_NODE_ID } from './printImageInfo.js';
|
|
5
|
+
/** Was ein Zuschnitt an einem eigenen Bild ändert: Rahmen und Lage des Fotos darin. */
|
|
6
|
+
const USER_IMAGE_CROP_FIELDS = [
|
|
7
|
+
'x',
|
|
8
|
+
'y',
|
|
9
|
+
'width',
|
|
10
|
+
'height',
|
|
11
|
+
'fit',
|
|
12
|
+
'panX',
|
|
13
|
+
'panY',
|
|
14
|
+
'cropZoom',
|
|
15
|
+
'cropRotation',
|
|
16
|
+
];
|
|
17
|
+
export function takeCropSnapshot(state, elements, id) {
|
|
18
|
+
const element = elements.find((e) => e.id === id);
|
|
19
|
+
if (element?.type === 'image') {
|
|
20
|
+
const keys = [
|
|
21
|
+
element.offsetKey,
|
|
22
|
+
element.scaleKey,
|
|
23
|
+
element.positionStateKey,
|
|
24
|
+
element.sizeStateKey,
|
|
25
|
+
// Der Winkel des Hintergrundfotos liegt auf der Seite, nicht in einem Config-Schlüssel.
|
|
26
|
+
element.id === BACKGROUND_IMAGE_NODE_ID ? BACKGROUND_STRAIGHTEN_KEY : null,
|
|
27
|
+
].filter((key) => typeof key === 'string');
|
|
28
|
+
const values = {};
|
|
29
|
+
for (const key of keys)
|
|
30
|
+
values[key] = state[key];
|
|
31
|
+
return { kind: 'template', values };
|
|
32
|
+
}
|
|
33
|
+
const images = state.userImageInstances;
|
|
34
|
+
const image = Array.isArray(images)
|
|
35
|
+
? images.find((u) => u.id === id)
|
|
36
|
+
: null;
|
|
37
|
+
if (!image)
|
|
38
|
+
return null;
|
|
39
|
+
const fields = {};
|
|
40
|
+
for (const field of USER_IMAGE_CROP_FIELDS) {
|
|
41
|
+
if (field in image)
|
|
42
|
+
Object.assign(fields, { [field]: image[field] });
|
|
43
|
+
}
|
|
44
|
+
return { kind: 'user-image', id, fields };
|
|
45
|
+
}
|
|
46
|
+
/** Die Zustands-Teile, die den gemerkten Zuschnitt wiederherstellen; `null`, wenn das Element fehlt. */
|
|
47
|
+
export function restoreCropSnapshot(state, snapshot) {
|
|
48
|
+
if (snapshot.kind === 'template')
|
|
49
|
+
return { ...snapshot.values };
|
|
50
|
+
const images = state.userImageInstances;
|
|
51
|
+
if (!Array.isArray(images))
|
|
52
|
+
return null;
|
|
53
|
+
const list = images;
|
|
54
|
+
if (!list.some((u) => u.id === snapshot.id))
|
|
55
|
+
return null;
|
|
56
|
+
return {
|
|
57
|
+
userImageInstances: list.map((u) => {
|
|
58
|
+
if (u.id !== snapshot.id)
|
|
59
|
+
return u;
|
|
60
|
+
const restored = { ...u };
|
|
61
|
+
for (const field of USER_IMAGE_CROP_FIELDS) {
|
|
62
|
+
if (field in snapshot.fields)
|
|
63
|
+
restored[field] = snapshot.fields[field];
|
|
64
|
+
else
|
|
65
|
+
delete restored[field];
|
|
66
|
+
}
|
|
67
|
+
return restored;
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Der Begradigungs-Winkel des Elements im Zuschneide-Modus (Grad, 0 ohne). */
|
|
72
|
+
export function cropRotationOf(state, elements, id) {
|
|
73
|
+
const target = cropTargetOf(state, elements, id);
|
|
74
|
+
if (!target)
|
|
75
|
+
return 0;
|
|
76
|
+
if (target.kind === 'background')
|
|
77
|
+
return backgroundStraighten(state) ?? 0;
|
|
78
|
+
return target.image.fit === 'cover' ? (target.image.cropRotation ?? 0) : 0;
|
|
79
|
+
}
|
|
80
|
+
/** Ein gestrecktes eigenes Bild wird zum Begradigen `cover`; Pan und Zoom bleiben, die Bühne hält die Deckung. */
|
|
81
|
+
export function cropRotationUpdate(state, elements, id, deg) {
|
|
82
|
+
const angle = clampStraighten(deg);
|
|
83
|
+
const target = cropTargetOf(state, elements, id);
|
|
84
|
+
if (!target)
|
|
85
|
+
return null;
|
|
86
|
+
if (target.kind === 'background') {
|
|
87
|
+
return { kind: 'template', patch: { [BACKGROUND_STRAIGHTEN_KEY]: angle } };
|
|
88
|
+
}
|
|
89
|
+
if (target.image.fit === 'cover')
|
|
90
|
+
return { kind: 'user-image', patch: { cropRotation: angle } };
|
|
91
|
+
return angle === 0 ? null : { kind: 'user-image', patch: { fit: 'cover', cropRotation: angle } };
|
|
92
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CanvasElementConfig, ImageElementConfig } from '../configs/types.js';
|
|
2
|
+
import type { UserImageInstance } from '@ggraphic/editor/utils/userImageUtils';
|
|
3
|
+
/** Was ein Zuschneide-Werkzeug schreibt: Seitenzustand der Vorlage oder ein Patch am eigenen Bild. */
|
|
4
|
+
export type CropUpdate = {
|
|
5
|
+
kind: 'template';
|
|
6
|
+
patch: Record<string, unknown>;
|
|
7
|
+
} | {
|
|
8
|
+
kind: 'user-image';
|
|
9
|
+
patch: Partial<UserImageInstance>;
|
|
10
|
+
};
|
|
11
|
+
export type CropTarget = {
|
|
12
|
+
kind: 'background';
|
|
13
|
+
config: ImageElementConfig;
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'user-image';
|
|
16
|
+
image: UserImageInstance;
|
|
17
|
+
};
|
|
18
|
+
export declare function userImageOf(state: Record<string, unknown>, id: string): UserImageInstance | null;
|
|
19
|
+
export declare function backgroundCropConfig(elements: readonly CanvasElementConfig[], id: string): ImageElementConfig | null;
|
|
20
|
+
export declare function cropTargetOf(state: Record<string, unknown>, elements: readonly CanvasElementConfig[], id: string): CropTarget | null;
|
|
21
|
+
/** Ob ein Zuschneide-Modus für das Element beginnen darf: dieselbe Regel wie Fläche, Leiste und Menü. */
|
|
22
|
+
export declare function canEnterCrop(state: Record<string, unknown>, elements: readonly CanvasElementConfig[], id: string): boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
// Worauf die Zuschneide-Werkzeuge (Begradigen, Automatisch, Erweitern) wirken: eine Tür für alle drei.
|
|
3
|
+
import { canCropBackgroundPhoto } from './backgroundPhotoCrop.js';
|
|
4
|
+
import { BACKGROUND_IMAGE_NODE_ID } from './printImageInfo.js';
|
|
5
|
+
export function userImageOf(state, id) {
|
|
6
|
+
const images = state.userImageInstances;
|
|
7
|
+
return Array.isArray(images)
|
|
8
|
+
? (images.find((u) => u.id === id) ?? null)
|
|
9
|
+
: null;
|
|
10
|
+
}
|
|
11
|
+
// Nur ein cover-gefittetes Hintergrundfoto hat einen Ausschnitt-Modus; ohne coverFit gibt es nichts zu verschieben.
|
|
12
|
+
export function backgroundCropConfig(elements, id) {
|
|
13
|
+
if (id !== BACKGROUND_IMAGE_NODE_ID)
|
|
14
|
+
return null;
|
|
15
|
+
const element = elements.find((e) => e.id === id);
|
|
16
|
+
return element?.type === 'image' && element.coverFit ? element : null;
|
|
17
|
+
}
|
|
18
|
+
export function cropTargetOf(state, elements, id) {
|
|
19
|
+
const config = backgroundCropConfig(elements, id);
|
|
20
|
+
if (config)
|
|
21
|
+
return { kind: 'background', config };
|
|
22
|
+
if (id === BACKGROUND_IMAGE_NODE_ID)
|
|
23
|
+
return null;
|
|
24
|
+
const image = userImageOf(state, id);
|
|
25
|
+
return image ? { kind: 'user-image', image } : null;
|
|
26
|
+
}
|
|
27
|
+
/** Ob ein Zuschneide-Modus für das Element beginnen darf: dieselbe Regel wie Fläche, Leiste und Menü. */
|
|
28
|
+
export function canEnterCrop(state, elements, id) {
|
|
29
|
+
const target = cropTargetOf(state, elements, id);
|
|
30
|
+
if (!target)
|
|
31
|
+
return false;
|
|
32
|
+
return target.kind === 'user-image' || canCropBackgroundPhoto(target.config);
|
|
33
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import Konva from 'konva';
|
|
2
|
+
/** Name and attribute (`canvasItemId`) of the Group `CanvasRenderLayer` wraps around every canvas item. */
|
|
3
|
+
export declare const CANVAS_ITEM_NAME = "canvas-item";
|
|
4
|
+
export declare const CANVAS_ITEM_ID_ATTR = "canvasItemId";
|
|
5
|
+
export interface ItemUnderPointer {
|
|
6
|
+
id: string;
|
|
7
|
+
/** The item's topmost shape at the point: firing a press on it is a press on the item. */
|
|
8
|
+
shape: Konva.Shape;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The box of an item's drawn body — its children other than the Transformer —
|
|
12
|
+
* relative to `relativeTo`, else in absolute stage pixels. Null when the item
|
|
13
|
+
* is not on the stage.
|
|
14
|
+
*/
|
|
15
|
+
export declare function itemBodyRect(root: Konva.Container, id: string, relativeTo?: Konva.Container): {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
} | null;
|
|
21
|
+
/**
|
|
22
|
+
* The canvas items under a stage point, topmost first, one entry per item.
|
|
23
|
+
* Hit testing is Konva's own, so non-listening nodes and the clear part of a
|
|
24
|
+
* scrim (its `hitFunc`) are left out as they are for a click.
|
|
25
|
+
*/
|
|
26
|
+
export declare function itemsUnderPointer(stage: Konva.Stage, pos: {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
}): ItemUnderPointer[];
|
|
30
|
+
/**
|
|
31
|
+
* The item a ctrl/⌘-click picks: the one below the selection, wrapping round
|
|
32
|
+
* to the top. Without a selection under the pointer, the one below the top.
|
|
33
|
+
*/
|
|
34
|
+
export declare function nextDeepTarget<T extends {
|
|
35
|
+
id: string;
|
|
36
|
+
}>(stack: readonly T[], selectedId: string | null): T | null;
|
|
37
|
+
/**
|
|
38
|
+
* What a right-press selects, given the items under the pointer (topmost
|
|
39
|
+
* first): null keeps the selection — the press hit something already
|
|
40
|
+
* selected, a member of a multi-selection or a deep-picked item under its
|
|
41
|
+
* cover. Otherwise the topmost item alone, or nothing on empty stage.
|
|
42
|
+
*/
|
|
43
|
+
export declare function contextPressSelection(stackIds: readonly string[], selectedIds: readonly string[]): string[] | null;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import Konva from 'konva';
|
|
3
|
+
/** Name and attribute (`canvasItemId`) of the Group `CanvasRenderLayer` wraps around every canvas item. */
|
|
4
|
+
export const CANVAS_ITEM_NAME = 'canvas-item';
|
|
5
|
+
export const CANVAS_ITEM_ID_ATTR = 'canvasItemId';
|
|
6
|
+
function itemIdOf(shape) {
|
|
7
|
+
let node = shape;
|
|
8
|
+
while (node) {
|
|
9
|
+
if (node instanceof Konva.Transformer)
|
|
10
|
+
return null;
|
|
11
|
+
const id = node.getAttr(CANVAS_ITEM_ID_ATTR);
|
|
12
|
+
if (typeof id === 'string')
|
|
13
|
+
return id;
|
|
14
|
+
node = node.getParent();
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The box of an item's drawn body — its children other than the Transformer —
|
|
20
|
+
* relative to `relativeTo`, else in absolute stage pixels. Null when the item
|
|
21
|
+
* is not on the stage.
|
|
22
|
+
*/
|
|
23
|
+
export function itemBodyRect(root, id, relativeTo) {
|
|
24
|
+
const item = root.findOne((node) => node.getAttr(CANVAS_ITEM_ID_ATTR) === id);
|
|
25
|
+
const rects = (item?.getChildren() ?? [])
|
|
26
|
+
.filter((child) => !(child instanceof Konva.Transformer))
|
|
27
|
+
.map((child) => child.getClientRect({ relativeTo }));
|
|
28
|
+
if (rects.length === 0)
|
|
29
|
+
return null;
|
|
30
|
+
const x = Math.min(...rects.map((r) => r.x));
|
|
31
|
+
const y = Math.min(...rects.map((r) => r.y));
|
|
32
|
+
const right = Math.max(...rects.map((r) => r.x + r.width));
|
|
33
|
+
const bottom = Math.max(...rects.map((r) => r.y + r.height));
|
|
34
|
+
return { x, y, width: right - x, height: bottom - y };
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The canvas items under a stage point, topmost first, one entry per item.
|
|
38
|
+
* Hit testing is Konva's own, so non-listening nodes and the clear part of a
|
|
39
|
+
* scrim (its `hitFunc`) are left out as they are for a click.
|
|
40
|
+
*/
|
|
41
|
+
export function itemsUnderPointer(stage, pos) {
|
|
42
|
+
const seen = new Set();
|
|
43
|
+
const items = [];
|
|
44
|
+
// Konva lists them in tree order, i.e. bottom first.
|
|
45
|
+
for (const shape of stage.getAllIntersections(pos).reverse()) {
|
|
46
|
+
const id = itemIdOf(shape);
|
|
47
|
+
if (id === null || seen.has(id))
|
|
48
|
+
continue;
|
|
49
|
+
seen.add(id);
|
|
50
|
+
items.push({ id, shape });
|
|
51
|
+
}
|
|
52
|
+
return items;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The item a ctrl/⌘-click picks: the one below the selection, wrapping round
|
|
56
|
+
* to the top. Without a selection under the pointer, the one below the top.
|
|
57
|
+
*/
|
|
58
|
+
export function nextDeepTarget(stack, selectedId) {
|
|
59
|
+
if (stack.length === 0)
|
|
60
|
+
return null;
|
|
61
|
+
const at = stack.findIndex((item) => item.id === selectedId);
|
|
62
|
+
return stack[(Math.max(at, 0) + 1) % stack.length];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* What a right-press selects, given the items under the pointer (topmost
|
|
66
|
+
* first): null keeps the selection — the press hit something already
|
|
67
|
+
* selected, a member of a multi-selection or a deep-picked item under its
|
|
68
|
+
* cover. Otherwise the topmost item alone, or nothing on empty stage.
|
|
69
|
+
*/
|
|
70
|
+
export function contextPressSelection(stackIds, selectedIds) {
|
|
71
|
+
if (stackIds.some((id) => selectedIds.includes(id)))
|
|
72
|
+
return null;
|
|
73
|
+
return stackIds.length > 0 ? [stackIds[0]] : [];
|
|
74
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import { messages } from '@ggraphic/editor/i18n/messages';
|
|
3
|
+
// The host's file delivery (`CanvasFileDeliveryService`) throws an error named
|
|
4
|
+
// 'NativeDownloadTooLargeError' when the WebView bridge refuses the payload
|
|
5
|
+
// (the host's `NativeDownloadTooLargeError` sets that name). Matched by
|
|
6
|
+
// name, not class, so the editor needs no import from the host.
|
|
7
|
+
export function isDownloadTooLarge(err) {
|
|
8
|
+
return err instanceof Error && err.name === 'NativeDownloadTooLargeError';
|
|
9
|
+
}
|
|
10
|
+
export function downloadErrorMessage(err) {
|
|
11
|
+
const m = messages().errors;
|
|
12
|
+
return isDownloadTooLarge(err) ? m.downloadTooLarge : m.downloadFailed;
|
|
13
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Duplizieren von Canvas-Elementen — die eine Stelle.
|
|
3
|
+
*
|
|
4
|
+
* Vorher lag dieselbe Logik vierfach im Paket: im Strg+D-Zweig und im
|
|
5
|
+
* Einfügen-Zweig von `useCanvasKeyboardHandlers`, und zweimal als `duplicate…`-Aktion
|
|
6
|
+
* in `actionFactories`. Jede Fassung deckte eine andere
|
|
7
|
+
* Teilmenge der Elementarten ab, und keine pflegte `layerOrder`.
|
|
8
|
+
*
|
|
9
|
+
* Drei Dinge, die hier zusammengehalten werden und einzeln leicht verloren gehen:
|
|
10
|
+
*
|
|
11
|
+
* 1. **`layerOrder`.** Eine ID, die dort nicht steht, hängt `buildSortedRenderList`
|
|
12
|
+
* ganz nach oben — und `moveLayer` gibt die Liste unverändert zurück, die
|
|
13
|
+
* Ebenen-Knöpfe sind für so eine Kopie also tot. Darum setzt `insertInstance`
|
|
14
|
+
* die neue ID direkt über das Original, wenn das Original geführt wird.
|
|
15
|
+
* 2. **Tiefe Kopien.** `chart.data`, `circleBadge.textLines`,
|
|
16
|
+
* `shape.dash` und die Verlaufs-Stops sind Arrays. Ein flacher Spread teilt
|
|
17
|
+
* sie zwischen Original und Kopie: das Bearbeiten des einen ändert das andere.
|
|
18
|
+
* 3. **Eine Host-Art kopiert sich selbst** (`duplicate` ihrer Registrierung,
|
|
19
|
+
* `registerElementKind`) — etwa mit einem Versatz statt `x`/`y`.
|
|
20
|
+
*
|
|
21
|
+
* Nicht jede Art liegt in einer Liste von Objekten: ein Icon steht als ID in
|
|
22
|
+
* `selectedIcons` und mit seinem Zustand in `iconStates`. Darum besteht ein
|
|
23
|
+
* Registry-Eintrag aus `find` und `insert` statt aus einem Feldnamen — `listSpec`
|
|
24
|
+
* baut das Paar für die neun Listen-Arten, das Icon bringt sein eigenes mit.
|
|
25
|
+
*
|
|
26
|
+
* Vorlagen-Elemente stehen fest in der Vorlage, nicht im Zustand. Sie kommen als
|
|
27
|
+
* `template`-Nachschlag herein (`findTemplateEntry`), der aus der aufgelösten
|
|
28
|
+
* Geometrie eine Instanz macht — ohne ihn liefert `duplicateElementInState` für
|
|
29
|
+
* sie `null`.
|
|
30
|
+
*/
|
|
31
|
+
import { type CoreElementKindName, type ElementKindName } from './elementKinds.js';
|
|
32
|
+
import type { AssetInstance } from './canvasAssets.js';
|
|
33
|
+
import type { HostElementData, HostElementKindName } from './canvasItem.js';
|
|
34
|
+
import type { BaseCanvasState, IconState } from '../configs/factory/baseTypes.js';
|
|
35
|
+
import type { AdditionalText } from '../configs/types.js';
|
|
36
|
+
import type { CircleBadgeInstance } from '@ggraphic/editor/primitives/CircleBadge';
|
|
37
|
+
import type { ChartInstance } from '@ggraphic/editor/utils/chartTypes';
|
|
38
|
+
import type { FrameInstance } from '@ggraphic/editor/utils/frameUtils';
|
|
39
|
+
import type { IllustrationInstance } from '@ggraphic/editor/utils/illustrations/types';
|
|
40
|
+
import type { PillBadgeInstance } from '@ggraphic/editor/utils/pillBadgeUtils';
|
|
41
|
+
import type { ShapeInstance } from '@ggraphic/editor/utils/shapes';
|
|
42
|
+
import type { UserImageInstance } from '@ggraphic/editor/utils/userImageUtils';
|
|
43
|
+
/** Standardversatz einer Kopie gegenüber dem Original, in Canvas-Pixeln. */
|
|
44
|
+
export declare const DUPLICATE_OFFSET = 20;
|
|
45
|
+
/** Versatz einer Kopie; eine Zahl gilt für beide Achsen. */
|
|
46
|
+
export interface InsertOffset {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
}
|
|
50
|
+
/** Jede Elementart aus `ELEMENT_KINDS` ist duplizierbar; die Registry unten nennt sie alle. */
|
|
51
|
+
export type DuplicableType = ElementKindName;
|
|
52
|
+
/**
|
|
53
|
+
* Die Nutzlast eines Icons: sein Zustand plus die Katalog-ID, aufgelöst. Anders
|
|
54
|
+
* als in `IconState` ist `iconId` hier Pflicht — wer ein Icon einfügt, muss
|
|
55
|
+
* sagen, welches.
|
|
56
|
+
*/
|
|
57
|
+
export interface IconInstanceData extends IconState {
|
|
58
|
+
iconId: string;
|
|
59
|
+
}
|
|
60
|
+
/** Nutzlast je Art der Kerns — spiegelt `ClipboardDataMap`, ergänzt um `chart` und `icon`. */
|
|
61
|
+
interface CoreDuplicableDataMap {
|
|
62
|
+
shape: ShapeInstance;
|
|
63
|
+
'additional-text': AdditionalText;
|
|
64
|
+
illustration: IllustrationInstance;
|
|
65
|
+
asset: AssetInstance;
|
|
66
|
+
'pill-badge': PillBadgeInstance;
|
|
67
|
+
'circle-badge': CircleBadgeInstance;
|
|
68
|
+
frame: FrameInstance;
|
|
69
|
+
'user-image': UserImageInstance;
|
|
70
|
+
chart: ChartInstance;
|
|
71
|
+
icon: IconInstanceData;
|
|
72
|
+
}
|
|
73
|
+
/** Nutzlast je Art, die Arten des Hosts eingeschlossen. */
|
|
74
|
+
export type DuplicableDataMap = CoreDuplicableDataMap & {
|
|
75
|
+
[K in HostElementKindName]: HostElementData<K>;
|
|
76
|
+
};
|
|
77
|
+
/** Diskriminierte Union: `entry.type` verengt `entry.data` automatisch. */
|
|
78
|
+
export type DuplicableEntry = {
|
|
79
|
+
[K in DuplicableType]: {
|
|
80
|
+
type: K;
|
|
81
|
+
data: DuplicableDataMap[K];
|
|
82
|
+
};
|
|
83
|
+
}[DuplicableType];
|
|
84
|
+
/** Einheitliche Instanz-ID. Der Zufallsanteil ist nicht Zierde: im Kollaborations-
|
|
85
|
+
* betrieb erzeugen zwei Nutzer*innen in derselben Millisekunde sonst dieselbe ID. */
|
|
86
|
+
export declare function createInstanceId(prefix: string): string;
|
|
87
|
+
/** Die duplizierbaren Arten des Kerns; dazu kommen die des Hosts mit `duplicate`. */
|
|
88
|
+
export declare const DUPLICABLE_TYPES: CoreElementKindName[];
|
|
89
|
+
export interface InsertResult<TState> {
|
|
90
|
+
state: TState;
|
|
91
|
+
newId: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Fügt eine Instanz als neue Kopie in den Zustand ein. `afterId` ist die ID,
|
|
95
|
+
* über der die Kopie in der Ebenenfolge landen soll — beim Duplizieren das
|
|
96
|
+
* Original, beim Einfügen aus der Zwischenablage `null`.
|
|
97
|
+
*/
|
|
98
|
+
export declare function insertInstance<TState extends Partial<BaseCanvasState>>(state: TState, entry: DuplicableEntry, options?: {
|
|
99
|
+
afterId?: string | null;
|
|
100
|
+
offset?: number | InsertOffset;
|
|
101
|
+
}): InsertResult<TState>;
|
|
102
|
+
/**
|
|
103
|
+
* Die Vorlagen-Tür. Ein Vorlagen-Element steht in keiner Sammlung des Zustands,
|
|
104
|
+
* sondern fest in der Vorlage — gefunden wird es nur mit `config.elements` und
|
|
105
|
+
* dem gerechneten Layout, die beide hier nicht vorliegen. Wer sie hat, reicht
|
|
106
|
+
* diese Funktion herein (`findTemplateEntry` aus `templateElementInstance.ts`);
|
|
107
|
+
* wer nicht, bekommt für Vorlagen-Elemente weiterhin `null`.
|
|
108
|
+
*
|
|
109
|
+
* Als Parameter statt als Import, weil `templateElementInstance` seinerseits den
|
|
110
|
+
* `DuplicableEntry` von hier braucht.
|
|
111
|
+
*/
|
|
112
|
+
export type TemplateEntryLookup = (elementId: string) => DuplicableEntry | null;
|
|
113
|
+
export interface DuplicateOptions {
|
|
114
|
+
offset?: number | InsertOffset;
|
|
115
|
+
template?: TemplateEntryLookup;
|
|
116
|
+
}
|
|
117
|
+
/** Findet das Element mit dieser ID und benennt seine Art. */
|
|
118
|
+
export declare function findDuplicableEntry<TState extends Partial<BaseCanvasState>>(state: TState, elementId: string, template?: TemplateEntryLookup): DuplicableEntry | null;
|
|
119
|
+
/** Ist dieses Element duplizierbar? Speist den Aktiv-Zustand des Knopfes. */
|
|
120
|
+
export declare function canDuplicateElement<TState extends Partial<BaseCanvasState>>(state: TState, elementId: string | null, template?: TemplateEntryLookup): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Dupliziert das ausgewählte Element. Gibt `null` zurück, wenn die ID zu nichts
|
|
123
|
+
* Duplizierbarem gehört — der Aufrufer lässt den Zustand dann unberührt und
|
|
124
|
+
* schreibt insbesondere keinen Verlaufseintrag.
|
|
125
|
+
*/
|
|
126
|
+
export declare function duplicateElementInState<TState extends Partial<BaseCanvasState>>(state: TState, elementId: string, options?: DuplicateOptions): InsertResult<TState> | null;
|
|
127
|
+
export {};
|