@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,235 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Duplizieren von Canvas-Elementen — die eine Stelle.
|
|
4
|
+
*
|
|
5
|
+
* Vorher lag dieselbe Logik vierfach im Paket: im Strg+D-Zweig und im
|
|
6
|
+
* Einfügen-Zweig von `useCanvasKeyboardHandlers`, und zweimal als `duplicate…`-Aktion
|
|
7
|
+
* in `actionFactories`. Jede Fassung deckte eine andere
|
|
8
|
+
* Teilmenge der Elementarten ab, und keine pflegte `layerOrder`.
|
|
9
|
+
*
|
|
10
|
+
* Drei Dinge, die hier zusammengehalten werden und einzeln leicht verloren gehen:
|
|
11
|
+
*
|
|
12
|
+
* 1. **`layerOrder`.** Eine ID, die dort nicht steht, hängt `buildSortedRenderList`
|
|
13
|
+
* ganz nach oben — und `moveLayer` gibt die Liste unverändert zurück, die
|
|
14
|
+
* Ebenen-Knöpfe sind für so eine Kopie also tot. Darum setzt `insertInstance`
|
|
15
|
+
* die neue ID direkt über das Original, wenn das Original geführt wird.
|
|
16
|
+
* 2. **Tiefe Kopien.** `chart.data`, `circleBadge.textLines`,
|
|
17
|
+
* `shape.dash` und die Verlaufs-Stops sind Arrays. Ein flacher Spread teilt
|
|
18
|
+
* sie zwischen Original und Kopie: das Bearbeiten des einen ändert das andere.
|
|
19
|
+
* 3. **Eine Host-Art kopiert sich selbst** (`duplicate` ihrer Registrierung,
|
|
20
|
+
* `registerElementKind`) — etwa mit einem Versatz statt `x`/`y`.
|
|
21
|
+
*
|
|
22
|
+
* Nicht jede Art liegt in einer Liste von Objekten: ein Icon steht als ID in
|
|
23
|
+
* `selectedIcons` und mit seinem Zustand in `iconStates`. Darum besteht ein
|
|
24
|
+
* Registry-Eintrag aus `find` und `insert` statt aus einem Feldnamen — `listSpec`
|
|
25
|
+
* baut das Paar für die neun Listen-Arten, das Icon bringt sein eigenes mit.
|
|
26
|
+
*
|
|
27
|
+
* Vorlagen-Elemente stehen fest in der Vorlage, nicht im Zustand. Sie kommen als
|
|
28
|
+
* `template`-Nachschlag herein (`findTemplateEntry`), der aus der aufgelösten
|
|
29
|
+
* Geometrie eine Instanz macht — ohne ihn liefert `duplicateElementInState` für
|
|
30
|
+
* sie `null`.
|
|
31
|
+
*/
|
|
32
|
+
import { ELEMENT_KINDS, hostElementKind, hostElementKinds, isCoreElementKind, } from './elementKinds.js';
|
|
33
|
+
import { catalogIconId } from './iconInstances.js';
|
|
34
|
+
/** Standardversatz einer Kopie gegenüber dem Original, in Canvas-Pixeln. */
|
|
35
|
+
export const DUPLICATE_OFFSET = 20;
|
|
36
|
+
const toOffset = (offset) => typeof offset === 'number' ? { x: offset, y: offset } : offset;
|
|
37
|
+
/** Einheitliche Instanz-ID. Der Zufallsanteil ist nicht Zierde: im Kollaborations-
|
|
38
|
+
* betrieb erzeugen zwei Nutzer*innen in derselben Millisekunde sonst dieselbe ID. */
|
|
39
|
+
export function createInstanceId(prefix) {
|
|
40
|
+
return `${prefix}-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
|
|
41
|
+
}
|
|
42
|
+
const cloneGradient = (g) => g ? { ...g, stops: g.stops.map((s) => ({ ...s })) } : g;
|
|
43
|
+
/** Liest ein Instanz-Array aus dem Zustand. Grenze zwischen Registry-Schlüssel
|
|
44
|
+
* (String) und getyptem Zustand — der Aufrufer kennt die Art über `DUPLICABLE`. */
|
|
45
|
+
function readList(state, field) {
|
|
46
|
+
const value = state[field];
|
|
47
|
+
return Array.isArray(value) ? value : [];
|
|
48
|
+
}
|
|
49
|
+
/** Der Normalfall: eine Art, die als Liste von `{ id, … }` unter ihrem `stateKey` liegt. */
|
|
50
|
+
function listSpec(kind, clone) {
|
|
51
|
+
return fieldSpec(ELEMENT_KINDS.find((k) => k.kind === kind).stateKey, clone);
|
|
52
|
+
}
|
|
53
|
+
function fieldSpec(field, clone) {
|
|
54
|
+
return {
|
|
55
|
+
find: (state, id) => readList(state, field).find((i) => i.id === id) ?? null,
|
|
56
|
+
insert: (state, data, newId, offset) => ({
|
|
57
|
+
[field]: [...readList(state, field), clone(data, newId, offset)],
|
|
58
|
+
}),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Registry: je Art, wie man sie im Zustand findet und wie eine versetzte Kopie
|
|
63
|
+
* hineinkommt. Eine neue Elementart in `ELEMENT_KINDS` bricht den Typcheck,
|
|
64
|
+
* bis sie hier steht — der Rest dieser Datei und alle vier Aufrufer ziehen
|
|
65
|
+
* dann automatisch nach.
|
|
66
|
+
*/
|
|
67
|
+
const DUPLICABLE = {
|
|
68
|
+
shape: listSpec('shape', (d, id, o) => ({
|
|
69
|
+
...d,
|
|
70
|
+
id,
|
|
71
|
+
x: d.x + o.x,
|
|
72
|
+
y: d.y + o.y,
|
|
73
|
+
...(d.dash ? { dash: [...d.dash] } : {}),
|
|
74
|
+
...(d.fillGradient !== undefined ? { fillGradient: cloneGradient(d.fillGradient) } : {}),
|
|
75
|
+
})),
|
|
76
|
+
'additional-text': listSpec('additional-text', (d, id, o) => ({
|
|
77
|
+
...d,
|
|
78
|
+
id,
|
|
79
|
+
x: d.x + o.x,
|
|
80
|
+
y: d.y + o.y,
|
|
81
|
+
...(d.fillGradient !== undefined ? { fillGradient: cloneGradient(d.fillGradient) } : {}),
|
|
82
|
+
})),
|
|
83
|
+
illustration: listSpec('illustration', (d, id, o) => ({
|
|
84
|
+
...d,
|
|
85
|
+
id,
|
|
86
|
+
x: d.x + o.x,
|
|
87
|
+
y: d.y + o.y,
|
|
88
|
+
})),
|
|
89
|
+
asset: listSpec('asset', (d, id, o) => ({ ...d, id, x: d.x + o.x, y: d.y + o.y })),
|
|
90
|
+
'pill-badge': listSpec('pill-badge', (d, id, o) => ({
|
|
91
|
+
...d,
|
|
92
|
+
id,
|
|
93
|
+
x: d.x + o.x,
|
|
94
|
+
y: d.y + o.y,
|
|
95
|
+
})),
|
|
96
|
+
'circle-badge': listSpec('circle-badge', (d, id, o) => ({
|
|
97
|
+
...d,
|
|
98
|
+
id,
|
|
99
|
+
x: d.x + o.x,
|
|
100
|
+
y: d.y + o.y,
|
|
101
|
+
textLines: d.textLines.map((l) => ({ ...l })),
|
|
102
|
+
})),
|
|
103
|
+
// `imageSrc` wird bewusst mitgenommen: ein Rahmen ohne sein Bild ist keine
|
|
104
|
+
// Kopie. Dass das Löschen des Originals die geteilte Blob-URL freigibt,
|
|
105
|
+
// verhindern die Zählungen in `removeFrame`/`removeUserImage`.
|
|
106
|
+
frame: listSpec('frame', (d, id, o) => ({ ...d, id, x: d.x + o.x, y: d.y + o.y })),
|
|
107
|
+
'user-image': listSpec('user-image', (d, id, o) => ({
|
|
108
|
+
...d,
|
|
109
|
+
id,
|
|
110
|
+
x: d.x + o.x,
|
|
111
|
+
y: d.y + o.y,
|
|
112
|
+
})),
|
|
113
|
+
chart: listSpec('chart', (d, id, o) => ({
|
|
114
|
+
...d,
|
|
115
|
+
id,
|
|
116
|
+
x: d.x + o.x,
|
|
117
|
+
y: d.y + o.y,
|
|
118
|
+
data: d.data.map((p) => ({ ...p })),
|
|
119
|
+
colors: [...d.colors],
|
|
120
|
+
})),
|
|
121
|
+
/**
|
|
122
|
+
* Ein Icon liegt nicht in einer Liste: seine ID steht in `selectedIcons`,
|
|
123
|
+
* sein Zustand unter derselben ID in `iconStates`. Ohne gespeicherten Zustand
|
|
124
|
+
* gibt es nichts zu kopieren — Lage und Größe des Originals stünden dann erst
|
|
125
|
+
* im Renderer fest (Mitte der Fläche), die Kopie käme also nicht versetzt
|
|
126
|
+
* heraus. Solche Icons melden sich als nicht duplizierbar.
|
|
127
|
+
*/
|
|
128
|
+
icon: {
|
|
129
|
+
find: (state, id) => {
|
|
130
|
+
const s = state;
|
|
131
|
+
if (!s.selectedIcons?.includes(id))
|
|
132
|
+
return null;
|
|
133
|
+
const base = s.iconStates?.[id];
|
|
134
|
+
if (!base)
|
|
135
|
+
return null;
|
|
136
|
+
return { ...base, iconId: catalogIconId(id, s.iconStates) };
|
|
137
|
+
},
|
|
138
|
+
insert: (state, data, newId, offset) => {
|
|
139
|
+
const s = state;
|
|
140
|
+
return {
|
|
141
|
+
selectedIcons: [...(s.selectedIcons ?? []), newId],
|
|
142
|
+
iconStates: {
|
|
143
|
+
...s.iconStates,
|
|
144
|
+
[newId]: { ...data, x: data.x + offset.x, y: data.y + offset.y },
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
/** Die duplizierbaren Arten des Kerns; dazu kommen die des Hosts mit `duplicate`. */
|
|
151
|
+
export const DUPLICABLE_TYPES = Object.keys(DUPLICABLE);
|
|
152
|
+
/** Eine Art des Hosts: Liste unter ihrem `stateKey`, Kopie über ihr `duplicate`. */
|
|
153
|
+
function hostSpec(kind) {
|
|
154
|
+
const duplicate = kind.duplicate?.bind(kind);
|
|
155
|
+
if (!duplicate)
|
|
156
|
+
return null;
|
|
157
|
+
// Boundary: the registration copies its own instances; the list holds only those.
|
|
158
|
+
return fieldSpec(kind.stateKey, (data, id, offset) => duplicate(data, id, offset));
|
|
159
|
+
}
|
|
160
|
+
/** Die Registry-Zeile einer Art, Kern oder Host; `null` für eine Host-Art ohne `duplicate`. */
|
|
161
|
+
function specOf(type) {
|
|
162
|
+
if (isCoreElementKind(type))
|
|
163
|
+
return DUPLICABLE[type];
|
|
164
|
+
const host = hostElementKind(type);
|
|
165
|
+
return host ? hostSpec(host) : null;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Setzt `newId` direkt hinter `afterId` (= eine Ebene darüber, die Liste ist
|
|
169
|
+
* von hinten nach vorn gezeichnet). Ist keine Reihenfolge gespeichert oder das
|
|
170
|
+
* Original nicht geführt, bleibt die Liste unangetastet: unbekannte IDs zeichnet
|
|
171
|
+
* `buildSortedRenderList` ohnehin obenauf, was für eine frische Kopie richtig ist.
|
|
172
|
+
*/
|
|
173
|
+
function withDuplicateInLayerOrder(order, afterId, newId) {
|
|
174
|
+
if (!order || order.length === 0 || !afterId)
|
|
175
|
+
return null;
|
|
176
|
+
const index = order.indexOf(afterId);
|
|
177
|
+
if (index === -1)
|
|
178
|
+
return null;
|
|
179
|
+
const next = [...order];
|
|
180
|
+
next.splice(index + 1, 0, newId);
|
|
181
|
+
return next;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Fügt eine Instanz als neue Kopie in den Zustand ein. `afterId` ist die ID,
|
|
185
|
+
* über der die Kopie in der Ebenenfolge landen soll — beim Duplizieren das
|
|
186
|
+
* Original, beim Einfügen aus der Zwischenablage `null`.
|
|
187
|
+
*/
|
|
188
|
+
export function insertInstance(state, entry, options = {}) {
|
|
189
|
+
const { afterId = null, offset = DUPLICATE_OFFSET } = options;
|
|
190
|
+
const newId = createInstanceId(entry.type);
|
|
191
|
+
// Eine Art pro Zweig: `entry.type` und `entry.data` bleiben korreliert, solange
|
|
192
|
+
// sie nicht destrukturiert werden. Der Zugriff über den Registry-Schlüssel ist
|
|
193
|
+
// die Grenze, an der der String-Schlüssel auf den getypten Zustand trifft.
|
|
194
|
+
const spec = specOf(entry.type);
|
|
195
|
+
if (!spec)
|
|
196
|
+
return { state, newId };
|
|
197
|
+
const nextState = {
|
|
198
|
+
...state,
|
|
199
|
+
...spec.insert(state, entry.data, newId, toOffset(offset)),
|
|
200
|
+
};
|
|
201
|
+
const nextOrder = withDuplicateInLayerOrder(state.layerOrder, afterId, newId);
|
|
202
|
+
if (nextOrder)
|
|
203
|
+
nextState.layerOrder = nextOrder;
|
|
204
|
+
return { state: nextState, newId };
|
|
205
|
+
}
|
|
206
|
+
/** Findet das Element mit dieser ID und benennt seine Art. */
|
|
207
|
+
export function findDuplicableEntry(state, elementId, template) {
|
|
208
|
+
for (const type of DUPLICABLE_TYPES) {
|
|
209
|
+
const found = DUPLICABLE[type].find(state, elementId);
|
|
210
|
+
if (found)
|
|
211
|
+
return { type, data: found };
|
|
212
|
+
}
|
|
213
|
+
for (const host of hostElementKinds()) {
|
|
214
|
+
const found = hostSpec(host)?.find(state, elementId);
|
|
215
|
+
if (found)
|
|
216
|
+
return { type: host.kind, data: found };
|
|
217
|
+
}
|
|
218
|
+
return template?.(elementId) ?? null;
|
|
219
|
+
}
|
|
220
|
+
/** Ist dieses Element duplizierbar? Speist den Aktiv-Zustand des Knopfes. */
|
|
221
|
+
export function canDuplicateElement(state, elementId, template) {
|
|
222
|
+
return elementId !== null && findDuplicableEntry(state, elementId, template) !== null;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Dupliziert das ausgewählte Element. Gibt `null` zurück, wenn die ID zu nichts
|
|
226
|
+
* Duplizierbarem gehört — der Aufrufer lässt den Zustand dann unberührt und
|
|
227
|
+
* schreibt insbesondere keinen Verlaufseintrag.
|
|
228
|
+
*/
|
|
229
|
+
export function duplicateElementInState(state, elementId, options = {}) {
|
|
230
|
+
const { offset = DUPLICATE_OFFSET, template } = options;
|
|
231
|
+
const entry = findDuplicableEntry(state, elementId, template);
|
|
232
|
+
if (!entry)
|
|
233
|
+
return null;
|
|
234
|
+
return insertInstance(state, entry, { afterId: elementId, offset });
|
|
235
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wohin der Fokus geht, wenn das, was ihn hatte, verschwindet — ein
|
|
3
|
+
* geschlossener Text-Editor, ein gelöschtes Element, ein Knopf, der sich
|
|
4
|
+
* selbst abräumt. Nie auf `<body>`: von dort beginnt die Tab-Reihenfolge
|
|
5
|
+
* wieder oben auf der Seite.
|
|
6
|
+
*
|
|
7
|
+
* Zurückgegeben wird nur, wenn der Fokus wirklich verloren ist. Wer
|
|
8
|
+
* woanders hingeklickt hat, behält, was er angeklickt hat.
|
|
9
|
+
*/
|
|
10
|
+
/** Kam die letzte Fokusbewegung von der Tastatur? (`data-focus-modality` am `<html>`, siehe `kbd:`) */
|
|
11
|
+
export declare function isKeyboardModality(): boolean;
|
|
12
|
+
export declare function isFocusLost(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Der Knopf „Seite N bearbeiten" der Seite, in der `anchor` liegt (etwa der
|
|
15
|
+
* Container der Bühne); sonst der der aktiven Seite im selben Editor.
|
|
16
|
+
*/
|
|
17
|
+
export declare function pageFocusTarget(anchor: Element | null): HTMLElement | null;
|
|
18
|
+
/** Woher eine Bearbeitung kam: ein Eintrag der Ebenen-Liste oder die Seite um `anchor`. */
|
|
19
|
+
export interface FocusOrigin {
|
|
20
|
+
option: HTMLElement | null;
|
|
21
|
+
anchor: Element | null;
|
|
22
|
+
}
|
|
23
|
+
/** Beim Start einer Bearbeitung aufrufen, solange der Fokus noch dort ist, wo sie begann. */
|
|
24
|
+
export declare function captureFocusOrigin(anchor: Element | null): FocusOrigin;
|
|
25
|
+
/**
|
|
26
|
+
* Gibt den Fokus an den Ursprung zurück, sobald der Browser ihn fertig
|
|
27
|
+
* verschoben hat — ein Klick auf ein anderes Bedienelement fokussiert es
|
|
28
|
+
* erst nach dem Blur, der die Bearbeitung beendet.
|
|
29
|
+
*/
|
|
30
|
+
export declare function returnFocus(origin: FocusOrigin, onlyIf?: () => boolean): void;
|
|
31
|
+
/** Wie `returnFocus`, aber immer auf die Seite. */
|
|
32
|
+
export declare function returnFocusToPage(anchor: Element | null, onlyIf?: () => boolean): void;
|
|
33
|
+
/** Fokus sofort auf die Seite um `anchor` (siehe `pageFocusTarget`), ohne zu scrollen. */
|
|
34
|
+
export declare function focusPage(anchor: Element | null): void;
|
|
35
|
+
/** Ist `target` der Knopf „Seite N bearbeiten"? */
|
|
36
|
+
export declare function isPageFocusTarget(target: EventTarget | null): boolean;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Wohin der Fokus geht, wenn das, was ihn hatte, verschwindet — ein
|
|
4
|
+
* geschlossener Text-Editor, ein gelöschtes Element, ein Knopf, der sich
|
|
5
|
+
* selbst abräumt. Nie auf `<body>`: von dort beginnt die Tab-Reihenfolge
|
|
6
|
+
* wieder oben auf der Seite.
|
|
7
|
+
*
|
|
8
|
+
* Zurückgegeben wird nur, wenn der Fokus wirklich verloren ist. Wer
|
|
9
|
+
* woanders hingeklickt hat, behält, was er angeklickt hat.
|
|
10
|
+
*/
|
|
11
|
+
const PAGE_WRAPPER = '.heterogeneous-multipage__page-wrapper';
|
|
12
|
+
const PAGE_TARGET = '[data-page-focus-target]';
|
|
13
|
+
const EDITOR_ROOT = '.canvas-editor-layout';
|
|
14
|
+
const LAYER_OPTION = '[role="option"][data-layer-id]';
|
|
15
|
+
/** Kam die letzte Fokusbewegung von der Tastatur? (`data-focus-modality` am `<html>`, siehe `kbd:`) */
|
|
16
|
+
export function isKeyboardModality() {
|
|
17
|
+
return document.documentElement.dataset.focusModality === 'keyboard';
|
|
18
|
+
}
|
|
19
|
+
export function isFocusLost() {
|
|
20
|
+
const active = document.activeElement;
|
|
21
|
+
return active === null || active === document.body;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Der Knopf „Seite N bearbeiten" der Seite, in der `anchor` liegt (etwa der
|
|
25
|
+
* Container der Bühne); sonst der der aktiven Seite im selben Editor.
|
|
26
|
+
*/
|
|
27
|
+
export function pageFocusTarget(anchor) {
|
|
28
|
+
const own = anchor?.closest(PAGE_WRAPPER)?.querySelector(PAGE_TARGET);
|
|
29
|
+
if (own)
|
|
30
|
+
return own;
|
|
31
|
+
const scope = anchor?.closest(EDITOR_ROOT) ?? document;
|
|
32
|
+
return (scope.querySelector(`[aria-current="page"] ${PAGE_TARGET}`) ??
|
|
33
|
+
scope.querySelector(PAGE_TARGET));
|
|
34
|
+
}
|
|
35
|
+
/** Beim Start einer Bearbeitung aufrufen, solange der Fokus noch dort ist, wo sie begann. */
|
|
36
|
+
export function captureFocusOrigin(anchor) {
|
|
37
|
+
const active = document.activeElement;
|
|
38
|
+
const option = active instanceof HTMLElement ? active.closest(LAYER_OPTION) : null;
|
|
39
|
+
return { option, anchor };
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Gibt den Fokus an den Ursprung zurück, sobald der Browser ihn fertig
|
|
43
|
+
* verschoben hat — ein Klick auf ein anderes Bedienelement fokussiert es
|
|
44
|
+
* erst nach dem Blur, der die Bearbeitung beendet.
|
|
45
|
+
*/
|
|
46
|
+
export function returnFocus(origin, onlyIf = () => true) {
|
|
47
|
+
window.setTimeout(() => {
|
|
48
|
+
if (!isFocusLost() || !onlyIf())
|
|
49
|
+
return;
|
|
50
|
+
const target = origin.option?.isConnected ? origin.option : pageFocusTarget(origin.anchor);
|
|
51
|
+
// Kein Scrollen: auf einer hohen, mehrseitigen Fläche spränge die Ansicht
|
|
52
|
+
// sonst an den Kopf der Seite.
|
|
53
|
+
target?.focus({ preventScroll: true });
|
|
54
|
+
}, 0);
|
|
55
|
+
}
|
|
56
|
+
/** Wie `returnFocus`, aber immer auf die Seite. */
|
|
57
|
+
export function returnFocusToPage(anchor, onlyIf) {
|
|
58
|
+
returnFocus({ option: null, anchor }, onlyIf);
|
|
59
|
+
}
|
|
60
|
+
/** Fokus sofort auf die Seite um `anchor` (siehe `pageFocusTarget`), ohne zu scrollen. */
|
|
61
|
+
export function focusPage(anchor) {
|
|
62
|
+
pageFocusTarget(anchor)?.focus({ preventScroll: true });
|
|
63
|
+
}
|
|
64
|
+
/** Ist `target` der Knopf „Seite N bearbeiten"? */
|
|
65
|
+
export function isPageFocusTarget(target) {
|
|
66
|
+
return target instanceof Element && target.matches(PAGE_TARGET);
|
|
67
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toast seam. The editor reports failures and offers undo through a toast, but
|
|
3
|
+
* ships no toast library: the host registers one. A module-level register
|
|
4
|
+
* (like `registerBrandPacks`) because the callers sit in providers and
|
|
5
|
+
* bridges that have no shared React context. Unregistered, every call is a
|
|
6
|
+
* no-op.
|
|
7
|
+
*/
|
|
8
|
+
export interface EditorToastAction {
|
|
9
|
+
label: string;
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
}
|
|
12
|
+
export interface EditorToastOptions {
|
|
13
|
+
duration?: number;
|
|
14
|
+
action?: EditorToastAction;
|
|
15
|
+
}
|
|
16
|
+
export interface EditorToast {
|
|
17
|
+
(message: string, options?: EditorToastOptions): unknown;
|
|
18
|
+
error: (message: string, options?: EditorToastOptions) => unknown;
|
|
19
|
+
}
|
|
20
|
+
export declare function registerToast(impl: EditorToast): void;
|
|
21
|
+
export declare const toast: EditorToast;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const noop = () => { };
|
|
2
|
+
const NOOP_TOAST = Object.assign(noop, { error: noop });
|
|
3
|
+
let registered = NOOP_TOAST;
|
|
4
|
+
export function registerToast(impl) {
|
|
5
|
+
registered = impl;
|
|
6
|
+
}
|
|
7
|
+
export const toast = Object.assign((...args) => registered(...args), { error: (...args) => registered.error(...args) });
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { type StateKeyMigration } from '@ggraphic/schema';
|
|
2
|
+
import type { CanvasItem, HostElementData, HostElementKindName, HostElementPayload, HostElementStateKey } from './canvasItem.js';
|
|
3
|
+
import type { InsertOffset } from './duplicateElement.js';
|
|
4
|
+
import type { OrientationPatch } from './orientElement.js';
|
|
5
|
+
import type { CanvasAiCleanPatch } from '../ai/applyOperation.js';
|
|
6
|
+
import type { PptxBox, PptxItem } from '../export/pptx/types.js';
|
|
7
|
+
import type { HostCanvasActions, OptionalCanvasActions } from '../hooks/useCanvasElementHandlers.js';
|
|
8
|
+
import type { FloatingModuleState } from '../hooks/useFloatingModuleState.js';
|
|
9
|
+
/** The element kinds a canvas holds beside the config's own elements, the host's included. */
|
|
10
|
+
export type ElementKindName = Exclude<CanvasItem['type'], 'element'>;
|
|
11
|
+
type KindName = ElementKindName;
|
|
12
|
+
/** One placed instance of a kind, as the render list carries it. */
|
|
13
|
+
export type KindItem = Exclude<CanvasItem, {
|
|
14
|
+
type: 'element';
|
|
15
|
+
}>;
|
|
16
|
+
export interface ElementKindDef {
|
|
17
|
+
kind: KindName;
|
|
18
|
+
/** Where the kind lives in the canvas state; F0, stored in canvases and templates. */
|
|
19
|
+
stateKey: string;
|
|
20
|
+
/**
|
|
21
|
+
* The action that deletes one by id. `null` for icons: their ids are listed
|
|
22
|
+
* in `selectedIcons`, and deleting one switches it off (`toggleIcon`).
|
|
23
|
+
*/
|
|
24
|
+
remove: Extract<keyof OptionalCanvasActions, `remove${string}`> | null;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The core's element kinds, in the order they stack after the config's own
|
|
28
|
+
* elements and the host's kinds (`registerElementKind`). A new kind is added here: `buildCanvasItems`,
|
|
29
|
+
* `findElementRemover` and `findKindItem` follow, the per-kind tables
|
|
30
|
+
* (`KIND_RENDERERS`, the floating modules, the orientation doors, the
|
|
31
|
+
* duplicate specs) fail to compile until they name it, and a test holds
|
|
32
|
+
* `CARRIED_INSTANCE_KEYS` to it, so a re-seed cannot drop the kind's state.
|
|
33
|
+
*/
|
|
34
|
+
export declare const ELEMENT_KINDS: readonly [{
|
|
35
|
+
readonly kind: "icon";
|
|
36
|
+
readonly stateKey: "selectedIcons";
|
|
37
|
+
readonly remove: null;
|
|
38
|
+
}, {
|
|
39
|
+
readonly kind: "shape";
|
|
40
|
+
readonly stateKey: "shapeInstances";
|
|
41
|
+
readonly remove: "removeShape";
|
|
42
|
+
}, {
|
|
43
|
+
readonly kind: "frame";
|
|
44
|
+
readonly stateKey: "frameInstances";
|
|
45
|
+
readonly remove: "removeFrame";
|
|
46
|
+
}, {
|
|
47
|
+
readonly kind: "additional-text";
|
|
48
|
+
readonly stateKey: "additionalTexts";
|
|
49
|
+
readonly remove: "removeAdditionalText";
|
|
50
|
+
}, {
|
|
51
|
+
readonly kind: "illustration";
|
|
52
|
+
readonly stateKey: "illustrationInstances";
|
|
53
|
+
readonly remove: "removeIllustration";
|
|
54
|
+
}, {
|
|
55
|
+
readonly kind: "asset";
|
|
56
|
+
readonly stateKey: "assetInstances";
|
|
57
|
+
readonly remove: "removeAsset";
|
|
58
|
+
}, {
|
|
59
|
+
readonly kind: "circle-badge";
|
|
60
|
+
readonly stateKey: "circleBadgeInstances";
|
|
61
|
+
readonly remove: "removeCircleBadge";
|
|
62
|
+
}, {
|
|
63
|
+
readonly kind: "pill-badge";
|
|
64
|
+
readonly stateKey: "pillBadgeInstances";
|
|
65
|
+
readonly remove: "removePillBadge";
|
|
66
|
+
}, {
|
|
67
|
+
readonly kind: "user-image";
|
|
68
|
+
readonly stateKey: "userImageInstances";
|
|
69
|
+
readonly remove: "removeUserImage";
|
|
70
|
+
}, {
|
|
71
|
+
readonly kind: "chart";
|
|
72
|
+
readonly stateKey: "chartInstances";
|
|
73
|
+
readonly remove: "removeChart";
|
|
74
|
+
}];
|
|
75
|
+
/** The core's own kinds: every per-kind table of the core is keyed by these. */
|
|
76
|
+
export type CoreElementKindName = (typeof ELEMENT_KINDS)[number]['kind'];
|
|
77
|
+
/** Is `kind` one of the core's own kinds? */
|
|
78
|
+
export declare function isCoreElementKind(kind: string): kind is CoreElementKindName;
|
|
79
|
+
/**
|
|
80
|
+
* The name of one of the host's actions (`HostCanvasActions`): a registration
|
|
81
|
+
* names only actions the host declared, so a misspelt one does not compile.
|
|
82
|
+
*/
|
|
83
|
+
export type HostActionName = Extract<keyof HostCanvasActions, string>;
|
|
84
|
+
/** A host kind's patch to its own instance, written through its update action. */
|
|
85
|
+
type KindPatch = Record<string, unknown>;
|
|
86
|
+
/**
|
|
87
|
+
* What the editor does with one host element kind — its one registration.
|
|
88
|
+
* The kind's type side (`stateKey`, `data`, `payload`) is the host's entry in
|
|
89
|
+
* `HostElementKinds` (`canvasItem.ts`); its renderer comes through
|
|
90
|
+
* `registerKindRenderers`, because drawing pulls Konva and this registration
|
|
91
|
+
* must not.
|
|
92
|
+
*
|
|
93
|
+
* A host kind lives as a list of `{ id, … }` under `stateKey`. It stacks
|
|
94
|
+
* after the config's own elements and before the core's kinds, in the order
|
|
95
|
+
* the host registered it. Every hook is optional except the ones that make a
|
|
96
|
+
* kind a kind; a missing hook means the editor does not offer that (no copy,
|
|
97
|
+
* no rotation, no arrow-key move, no toolbar, no AI line, no PPTX item).
|
|
98
|
+
* Methods, not function properties: one registry holds every host kind.
|
|
99
|
+
*/
|
|
100
|
+
export interface ElementKindRegistration<K extends HostElementKindName = HostElementKindName> {
|
|
101
|
+
kind: K;
|
|
102
|
+
/** Where the list lives in the canvas state; stored in canvases and templates. */
|
|
103
|
+
stateKey: HostElementStateKey<K>;
|
|
104
|
+
/**
|
|
105
|
+
* The config's actions the kind changes through, by name: `update(id, patch)`
|
|
106
|
+
* and `remove(id)`. A config without them cannot change the kind.
|
|
107
|
+
*/
|
|
108
|
+
actions: {
|
|
109
|
+
update: HostActionName;
|
|
110
|
+
remove: HostActionName;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* The config's action an Elemente tile or a drop adds the kind with, and its
|
|
114
|
+
* arguments for the tile's `payload`; the drop appends its placement.
|
|
115
|
+
*/
|
|
116
|
+
add?: {
|
|
117
|
+
action: HostActionName;
|
|
118
|
+
args(payload: HostElementPayload<K>): readonly unknown[];
|
|
119
|
+
};
|
|
120
|
+
/** The kind's name in the layer list and the selection label. */
|
|
121
|
+
name(): string;
|
|
122
|
+
/** The content its layer-list name shows after the kind name (`Text: …`). */
|
|
123
|
+
layerContent?(data: HostElementData<K>): string;
|
|
124
|
+
/** A copy with `id`, moved by `offset` (Duplizieren, Einfügen). */
|
|
125
|
+
duplicate?(data: HostElementData<K>, id: string, offset: InsertOffset): HostElementData<K>;
|
|
126
|
+
/** The update patch for a rotation (around its centre) or a move by `translate`. */
|
|
127
|
+
orient?(patch: OrientationPatch, data: HostElementData<K>): KindPatch;
|
|
128
|
+
/** The update patch for an arrow-key move by `delta`. */
|
|
129
|
+
nudge?(data: HostElementData<K>, delta: {
|
|
130
|
+
x: number;
|
|
131
|
+
y: number;
|
|
132
|
+
}): KindPatch;
|
|
133
|
+
/**
|
|
134
|
+
* The floating toolbar's values; its module is named after the kind. Only
|
|
135
|
+
* the opacity control writes back, through `actions.update`.
|
|
136
|
+
*/
|
|
137
|
+
floating?(data: HostElementData<K>): Omit<FloatingModuleState['data'], 'id'>;
|
|
138
|
+
/** „Text bearbeiten“ (F2) opens the kind's own text editor (`textEditorOpeners`). */
|
|
139
|
+
editableText?: true;
|
|
140
|
+
/** The kind's line in the AI's element list, before the layer position. */
|
|
141
|
+
describe?(data: HostElementData<K>): string;
|
|
142
|
+
/** Which AI `update-element` fields the kind takes, and its update patch for them. */
|
|
143
|
+
aiUpdate?: {
|
|
144
|
+
fields: readonly (keyof CanvasAiCleanPatch)[];
|
|
145
|
+
patch(patch: Partial<CanvasAiCleanPatch>, data: HostElementData<K>): KindPatch;
|
|
146
|
+
};
|
|
147
|
+
/** The kind on a PPTX slide; without it the list counts as an unknown key. */
|
|
148
|
+
pptx?(data: HostElementData<K>, page: PptxBox): PptxItem | PptxItem[];
|
|
149
|
+
/** Page-state keys the kind's templates keep beside the list; the page persists them. */
|
|
150
|
+
pageStateKeys?: readonly string[];
|
|
151
|
+
/** Page-state keys the layout of the kind's templates reads; a change recomputes it. */
|
|
152
|
+
layoutStateKeys?: readonly string[];
|
|
153
|
+
/**
|
|
154
|
+
* The list's stored-format steps, `from: 1` onwards: each lifts the list
|
|
155
|
+
* under `stateKey` one version on load (`migrateDocument`). Pure,
|
|
156
|
+
* deterministic and idempotent. Without steps the list is at version 1,
|
|
157
|
+
* and a document carrying a newer one opens read-only.
|
|
158
|
+
*/
|
|
159
|
+
migrations?: readonly StateKeyMigration[];
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Registers a host element kind, once at startup before the first render,
|
|
163
|
+
* next to the asset catalogue. Registering the same kind again replaces it.
|
|
164
|
+
*
|
|
165
|
+
* Also registers the kind's document migrations, so it must run before the
|
|
166
|
+
* first document load (`migrateDocument`, `readInitialDocument`, a Y.Doc's
|
|
167
|
+
* open): a load before it treats the kind's list as opaque data — neither
|
|
168
|
+
* lifted nor refused when newer.
|
|
169
|
+
*/
|
|
170
|
+
export declare function registerElementKind<K extends HostElementKindName>(registration: ElementKindRegistration<K>): void;
|
|
171
|
+
/** The host kinds, in the order they were registered. */
|
|
172
|
+
export declare function hostElementKinds(): readonly ElementKindRegistration[];
|
|
173
|
+
/** The host kind named `kind`, or `null` (a core kind or none at all). */
|
|
174
|
+
export declare function hostElementKind(kind: string): ElementKindRegistration | null;
|
|
175
|
+
/**
|
|
176
|
+
* A value derived from the host kinds, recomputed only after a registration:
|
|
177
|
+
* the key lists hand out the same array until then (hook dependencies).
|
|
178
|
+
*/
|
|
179
|
+
export declare function fromHostKinds<T>(derive: (kinds: readonly ElementKindRegistration[]) => T): () => T;
|
|
180
|
+
/** A host instance of `id` with its registration, or `null`. */
|
|
181
|
+
export declare function findHostInstance(state: object, id: string): {
|
|
182
|
+
kind: ElementKindRegistration;
|
|
183
|
+
data: {
|
|
184
|
+
id: string;
|
|
185
|
+
};
|
|
186
|
+
} | null;
|
|
187
|
+
/** The config's action `name`, if it has one. */
|
|
188
|
+
export declare function kindAction(actions: object | null, name: string): ((...args: never[]) => unknown) | null;
|
|
189
|
+
/** Writes `patch` through the kind's update action; `false` without one. */
|
|
190
|
+
export declare function updateHostInstance(actions: object, kind: ElementKindRegistration, id: string, patch: KindPatch): boolean;
|
|
191
|
+
/** A tile or drop of a host kind: its `kind` and its payload. */
|
|
192
|
+
export type HostElementAction = {
|
|
193
|
+
[K in HostElementKindName]: {
|
|
194
|
+
kind: K;
|
|
195
|
+
} & HostElementPayload<K>;
|
|
196
|
+
}[HostElementKindName];
|
|
197
|
+
/** Can this config add a host kind (state list and add action present)? */
|
|
198
|
+
export declare function canAddHostElement(kind: string, state: object | null, actions: object | null): boolean;
|
|
199
|
+
/** Adds a host kind for a tile or drop; `false` when the config cannot. */
|
|
200
|
+
export declare function addHostElement(payload: {
|
|
201
|
+
kind: string;
|
|
202
|
+
}, actions: object | null, placement?: object): boolean;
|
|
203
|
+
/** A kind's list in a state, or nothing when the state has none. */
|
|
204
|
+
export declare function kindList(state: object, stateKey: string): readonly unknown[];
|
|
205
|
+
/**
|
|
206
|
+
* A list entry of a kind as a render-list item. Icons are the exception: their
|
|
207
|
+
* list holds bare ids, and their state lives apart in `iconStates`.
|
|
208
|
+
*/
|
|
209
|
+
export declare function kindItem(kind: KindName, entry: unknown): KindItem;
|
|
210
|
+
/** Which kind `id` is and its instance — host kinds first, then `ELEMENT_KINDS`; `null` if none. */
|
|
211
|
+
export declare function findKindItem(state: object, id: string): KindItem | null;
|
|
212
|
+
export {};
|