@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,50 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Centralized Y.Doc key strings. A typo in any of these is a silent
|
|
4
|
+
* data-loss bug — keep all references through this module so a rename
|
|
5
|
+
* stays synchronized.
|
|
6
|
+
*
|
|
7
|
+
* The Hocuspocus service (services/hocuspocus/src/internalApi.ts) has zero
|
|
8
|
+
* cross-package deps and re-declares these literals inline — keep both in
|
|
9
|
+
* sync when changing anything here.
|
|
10
|
+
*/
|
|
11
|
+
export const YDOC_KEYS = {
|
|
12
|
+
/** Current multi-page container: Y.Map<pageId, page Y.Map>. */
|
|
13
|
+
pagesById: 'pagesById',
|
|
14
|
+
/** Doc-level markers: seed watermark, one-shot migration flags. */
|
|
15
|
+
meta: 'meta',
|
|
16
|
+
/** Fractional order key on each page Y.Map (lexicographic sort). */
|
|
17
|
+
pos: 'pos',
|
|
18
|
+
/** Set in `meta` once pages were seeded (server-authoritative or client). */
|
|
19
|
+
pagesSeeded: 'pagesSeeded',
|
|
20
|
+
/** Set in `meta` after the legacy pages-array/root migration ran. */
|
|
21
|
+
legacyMigrated: 'legacyMigrated',
|
|
22
|
+
/** Set in `meta` after root formState was folded into the single page. */
|
|
23
|
+
formStateFolded: 'formStateFolded',
|
|
24
|
+
/**
|
|
25
|
+
* Core document format version in `meta` (`@ggraphic/schema`
|
|
26
|
+
* `CANVAS_DOCUMENT_VERSION`); absent = 1. Only ever raised.
|
|
27
|
+
*/
|
|
28
|
+
schemaVersion: 'schemaVersion',
|
|
29
|
+
/** Prefix of a host kind's version in `meta`: `kindVersion:<stateKey>`; absent = 1. */
|
|
30
|
+
kindVersionPrefix: 'kindVersion:',
|
|
31
|
+
/**
|
|
32
|
+
* Top-level Y.Map<clientID, counter> each deck replacement bumps under its
|
|
33
|
+
* own client's key, so its page-level undo always reverts something.
|
|
34
|
+
*/
|
|
35
|
+
deckReplaceMark: 'deckReplaceMark',
|
|
36
|
+
/** Legacy multi-page container (Y.Array) — migrated into pagesById on open. */
|
|
37
|
+
pages: 'pages',
|
|
38
|
+
/** Legacy root form-state bucket — folded into pages[0].state on open. */
|
|
39
|
+
formState: 'formState',
|
|
40
|
+
legacyRoot: 'legacy_root',
|
|
41
|
+
config: 'config',
|
|
42
|
+
state: 'state',
|
|
43
|
+
id: 'id',
|
|
44
|
+
configId: 'configId',
|
|
45
|
+
/**
|
|
46
|
+
* Legacy watermark set inside `formState` by an authoritative server-side
|
|
47
|
+
* seed (mint-on-open) so the client never seeds template defaults over it.
|
|
48
|
+
*/
|
|
49
|
+
seeded: '_seeded',
|
|
50
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as Y from 'yjs';
|
|
2
|
+
import type { CanvasEditorStoreApi } from '../stores/createCanvasEditorStore.js';
|
|
3
|
+
interface BindOptions {
|
|
4
|
+
store: CanvasEditorStoreApi;
|
|
5
|
+
/**
|
|
6
|
+
* Parent Y.Map under which `config` (Y.Map) lives. For single-page topology
|
|
7
|
+
* this is just `ydoc.getMap('root')`; for multi-page it is one of `pages[i]`.
|
|
8
|
+
*/
|
|
9
|
+
parent: Y.Map<unknown>;
|
|
10
|
+
}
|
|
11
|
+
export interface CanvasBinding {
|
|
12
|
+
destroy: () => void;
|
|
13
|
+
}
|
|
14
|
+
/** Copies the page's stored config into the store once — never writes to the doc. */
|
|
15
|
+
export declare function seedCanvasStoreFromYMap(store: CanvasEditorStoreApi, parent: Y.Map<unknown>): void;
|
|
16
|
+
export declare function bindCanvasStoreToYMap({ store, parent }: BindOptions): CanvasBinding;
|
|
17
|
+
/**
|
|
18
|
+
* Backwards-compat: old callers used to bind directly off the Y.Doc root.
|
|
19
|
+
* Now we synthesize a single root Y.Map at `legacy_root` so single-page
|
|
20
|
+
* collab continues to work without refactoring its host. Multi-page hosts
|
|
21
|
+
* should call `bindCanvasStoreToYMap` directly.
|
|
22
|
+
*/
|
|
23
|
+
export declare function bindCanvasStoreToYDoc({ store, ydoc, }: {
|
|
24
|
+
store: CanvasEditorStoreApi;
|
|
25
|
+
ydoc: Y.Doc;
|
|
26
|
+
}): CanvasBinding;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import * as Y from 'yjs';
|
|
3
|
+
import { YDOC_KEYS } from '@ggraphic/editor/collab/ydocKeys';
|
|
4
|
+
const LOCAL_ORIGIN = Symbol('canvas-editor-local');
|
|
5
|
+
const ensureConfig = (parent) => {
|
|
6
|
+
const existing = parent.get(YDOC_KEYS.config);
|
|
7
|
+
if (existing instanceof Y.Map)
|
|
8
|
+
return existing;
|
|
9
|
+
const map = new Y.Map();
|
|
10
|
+
parent.set(YDOC_KEYS.config, map);
|
|
11
|
+
return map;
|
|
12
|
+
};
|
|
13
|
+
/** Copies the page's stored config into the store once — never writes to the doc. */
|
|
14
|
+
export function seedCanvasStoreFromYMap(store, parent) {
|
|
15
|
+
const yConfig = parent.get(YDOC_KEYS.config);
|
|
16
|
+
if (!(yConfig instanceof Y.Map))
|
|
17
|
+
return;
|
|
18
|
+
const cfg = Object.fromEntries(yConfig.entries());
|
|
19
|
+
if (Object.keys(cfg).length > 0) {
|
|
20
|
+
store.getState().setConfig(cfg);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function bindCanvasStoreToYMap({ store, parent }) {
|
|
24
|
+
const ydoc = parent.doc;
|
|
25
|
+
if (!ydoc) {
|
|
26
|
+
throw new Error('bindCanvasStoreToYMap: parent Y.Map is not attached to a Y.Doc');
|
|
27
|
+
}
|
|
28
|
+
// Ensure structural Y types exist before observers attach.
|
|
29
|
+
ydoc.transact(() => {
|
|
30
|
+
ensureConfig(parent);
|
|
31
|
+
}, LOCAL_ORIGIN);
|
|
32
|
+
const yConfig = parent.get(YDOC_KEYS.config);
|
|
33
|
+
let applyingRemote = false;
|
|
34
|
+
const seedFromYDoc = () => {
|
|
35
|
+
applyingRemote = true;
|
|
36
|
+
try {
|
|
37
|
+
const cfg = Object.fromEntries(yConfig.entries());
|
|
38
|
+
if (Object.keys(cfg).length > 0) {
|
|
39
|
+
store.getState().setConfig(cfg);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
applyingRemote = false;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const yConfigObserver = (event) => {
|
|
47
|
+
if (event.transaction.origin === LOCAL_ORIGIN)
|
|
48
|
+
return;
|
|
49
|
+
applyingRemote = true;
|
|
50
|
+
try {
|
|
51
|
+
store
|
|
52
|
+
.getState()
|
|
53
|
+
.setConfig(Object.fromEntries(yConfig.entries()));
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
applyingRemote = false;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
yConfig.observe(yConfigObserver);
|
|
60
|
+
const reconcileConfig = (cfg) => {
|
|
61
|
+
ydoc.transact(() => {
|
|
62
|
+
for (const [k, v] of Object.entries(cfg)) {
|
|
63
|
+
if (yConfig.get(k) !== v)
|
|
64
|
+
yConfig.set(k, v);
|
|
65
|
+
}
|
|
66
|
+
for (const k of Array.from(yConfig.keys())) {
|
|
67
|
+
if (!(k in cfg))
|
|
68
|
+
yConfig.delete(k);
|
|
69
|
+
}
|
|
70
|
+
}, LOCAL_ORIGIN);
|
|
71
|
+
};
|
|
72
|
+
let prevConfig = store.getState().config;
|
|
73
|
+
const unsub = store.subscribe((state) => {
|
|
74
|
+
if (applyingRemote) {
|
|
75
|
+
prevConfig = state.config;
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (state.config !== prevConfig) {
|
|
79
|
+
prevConfig = state.config;
|
|
80
|
+
reconcileConfig(state.config);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
if (yConfig.size > 0) {
|
|
84
|
+
seedFromYDoc();
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
reconcileConfig(store.getState().config);
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
destroy: () => {
|
|
91
|
+
unsub();
|
|
92
|
+
yConfig.unobserve(yConfigObserver);
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Backwards-compat: old callers used to bind directly off the Y.Doc root.
|
|
98
|
+
* Now we synthesize a single root Y.Map at `legacy_root` so single-page
|
|
99
|
+
* collab continues to work without refactoring its host. Multi-page hosts
|
|
100
|
+
* should call `bindCanvasStoreToYMap` directly.
|
|
101
|
+
*/
|
|
102
|
+
export function bindCanvasStoreToYDoc({ store, ydoc, }) {
|
|
103
|
+
const parent = ydoc.getMap(YDOC_KEYS.legacyRoot);
|
|
104
|
+
return bindCanvasStoreToYMap({ store, parent });
|
|
105
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
4
|
+
import { Dialog, DialogContent, DialogDescription, DialogTitle } from '@ggraphic/editor/ui/dialog';
|
|
5
|
+
export function Lightbox({ isOpen, onClose, imageSrc, altText }) {
|
|
6
|
+
const t = useMessages();
|
|
7
|
+
return (_jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-[95vw] sm:max-w-[95vw] w-auto max-h-[95vh] p-0 gap-0 border-none bg-transparent text-white shadow-none", overlayProps: { className: 'bg-black/90 cursor-zoom-out', onClick: onClose }, children: [_jsx(DialogTitle, { className: "sr-only", children: t.shell.imagePreview }), _jsx(DialogDescription, { className: "sr-only", children: altText || t.shell.enlargedImage }), _jsx("img", { src: imageSrc, alt: altText || t.shell.enlargedImage, className: "max-w-[95vw] max-h-[95vh] object-contain rounded-md" })] }) }));
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { StockImageAttribution, StockImage, FetchStockImagesResponse, UnsplashSearchResult, } from '@ggraphic/schema';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PagePickerSlot } from './PageThumbnailStrip.js';
|
|
2
|
+
interface AddPageButtonProps {
|
|
3
|
+
/** Without a host picker: adds a page like the active one. */
|
|
4
|
+
onAddPage: () => void;
|
|
5
|
+
/** Null without a host picker; the button then adds right away. */
|
|
6
|
+
renderPicker: PagePickerSlot | null;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** Flache Bauform für die untere Leiste; sonst der breite Knopf unter der Fläche. */
|
|
9
|
+
compact?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** „Seite hinzufügen": opens the host's page picker, or adds a page without one. */
|
|
12
|
+
export declare function AddPageButton({ onAddPage, renderPicker, disabled, compact, }: AddPageButtonProps): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
4
|
+
import { cn } from '@ggraphic/editor/utils/cn';
|
|
5
|
+
import { useRef, useState } from 'react';
|
|
6
|
+
import { HiPlus } from 'react-icons/hi';
|
|
7
|
+
/** „Seite hinzufügen": opens the host's page picker, or adds a page without one. */
|
|
8
|
+
export function AddPageButton({ onAddPage, renderPicker, disabled = false, compact = false, }) {
|
|
9
|
+
const t = useMessages();
|
|
10
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
11
|
+
const buttonRef = useRef(null);
|
|
12
|
+
return (_jsxs(_Fragment, { children: [_jsxs("button", { ref: buttonRef, className: cn('rounded-[10px] border border-[var(--editor-border-strong)] bg-[var(--editor-surface)] text-[var(--editor-text)] font-semibold cursor-pointer flex items-center justify-center gap-2 transition-[background-color,border-color] duration-200 hover:bg-[var(--editor-surface-hover)] hover:border-[var(--editor-accent)] active:scale-[0.99] disabled:opacity-40 disabled:cursor-not-allowed', compact ? 'h-8 px-3 text-xs' : 'w-full h-11 text-sm'), onClick: renderPicker ? () => setIsOpen(!isOpen) : onAddPage, disabled: disabled, type: "button", title: t.shell.addNewPage, children: [_jsx(HiPlus, {}), _jsx("span", { children: t.shell.addPage })] }), renderPicker?.({ isOpen, anchorRef: buttonRef, onClose: () => setIsOpen(false) })] }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Die eine Live-Region des Editors (WCAG 4.1.3): leer eingehängt, damit
|
|
3
|
+
* Screenreader sie vor der ersten Ansage kennen; unsichtbar, aber nicht
|
|
4
|
+
* `hidden`. Gefüllt wird sie über `useAnnounce()`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function CanvasAnnouncer({ message }: {
|
|
7
|
+
message: string;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
/**
|
|
4
|
+
* Die eine Live-Region des Editors (WCAG 4.1.3): leer eingehängt, damit
|
|
5
|
+
* Screenreader sie vor der ersten Ansage kennen; unsichtbar, aber nicht
|
|
6
|
+
* `hidden`. Gefüllt wird sie über `useAnnounce()`.
|
|
7
|
+
*/
|
|
8
|
+
export function CanvasAnnouncer({ message }) {
|
|
9
|
+
return (_jsx("div", { role: "status", "aria-live": "polite", "aria-atomic": "true", className: "sr-only", children: message }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type CanvasContextMenuHandle } from '@ggraphic/editor/components/CanvasContextMenu/CanvasContextMenu';
|
|
3
|
+
/**
|
|
4
|
+
* Das Kontextmenü am Handy — wie bei Canva ein Sheet vom unteren Rand, geöffnet
|
|
5
|
+
* über „…“ in der Pille. Inhalt und Befehle sind dieselben wie am Desktop
|
|
6
|
+
* (`buildCanvasMenu`, `useCanvasContextMenu`); nur die Form ist eine andere:
|
|
7
|
+
* Kacheln und Zeilen mit Icons statt Menüpunkte, Gruppen durch Linien
|
|
8
|
+
* getrennt, Untermenüs als eigene Ansicht mit „Zurück“, keine Tastenkürzel.
|
|
9
|
+
*/
|
|
10
|
+
export declare function CanvasActionSheet({ handleRef, }: {
|
|
11
|
+
handleRef: React.Ref<CanvasContextMenuHandle>;
|
|
12
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { Dialog } from 'radix-ui';
|
|
4
|
+
import { useImperativeHandle, useRef, useState } from 'react';
|
|
5
|
+
import { PiAlignBottom, PiAlignCenterHorizontal, PiAlignCenterVertical, PiAlignLeft, PiAlignRight, PiAlignTop, PiArrowCounterClockwise, PiArrowDown, PiArrowLineDown, PiArrowLineUp, PiArrowUp, PiArrowsClockwise, PiCaretLeft, PiCaretRight, PiClipboardText, PiColumns, PiCopy, PiFiles, PiFlipHorizontal, PiFlipVertical, PiFrameCorners, PiImage, PiImageSquare, PiLockSimple, PiLockSimpleOpen, PiRows, PiScissors, PiSelectionAll, PiSlidersHorizontal, PiStack, PiTextT, PiTrash, } from 'react-icons/pi';
|
|
6
|
+
import { AFTER_CLOSE, } from '@ggraphic/editor/components/CanvasContextMenu/CanvasContextMenu';
|
|
7
|
+
import { compact, } from '@ggraphic/editor/components/CanvasContextMenu/canvasMenuModel';
|
|
8
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
9
|
+
import { cn } from '@ggraphic/editor/utils/cn';
|
|
10
|
+
/** Die Zwischenablage steht oben als Kacheln, wie bei Canva: das, was man am häufigsten tippt. */
|
|
11
|
+
const QUICK = new Set([
|
|
12
|
+
'copy',
|
|
13
|
+
'cut',
|
|
14
|
+
'paste',
|
|
15
|
+
'pasteHere',
|
|
16
|
+
'duplicate',
|
|
17
|
+
]);
|
|
18
|
+
/** Duplizieren und Löschen wie in der Pille (`SelectionPill`), damit beide Orte gleich aussehen. */
|
|
19
|
+
const ICONS = {
|
|
20
|
+
copy: PiFiles,
|
|
21
|
+
cut: PiScissors,
|
|
22
|
+
paste: PiClipboardText,
|
|
23
|
+
pasteHere: PiClipboardText,
|
|
24
|
+
duplicate: PiCopy,
|
|
25
|
+
delete: PiTrash,
|
|
26
|
+
selectAll: PiSelectionAll,
|
|
27
|
+
toggleLock: PiLockSimple,
|
|
28
|
+
editText: PiTextT,
|
|
29
|
+
editImage: PiSlidersHorizontal,
|
|
30
|
+
insertFrameImage: PiImage,
|
|
31
|
+
bringToFront: PiArrowLineUp,
|
|
32
|
+
bringForward: PiArrowUp,
|
|
33
|
+
sendBackward: PiArrowDown,
|
|
34
|
+
sendToBack: PiArrowLineDown,
|
|
35
|
+
flipHorizontal: PiFlipHorizontal,
|
|
36
|
+
flipVertical: PiFlipVertical,
|
|
37
|
+
resetRotation: PiArrowCounterClockwise,
|
|
38
|
+
alignLeft: PiAlignLeft,
|
|
39
|
+
alignCenterH: PiAlignCenterHorizontal,
|
|
40
|
+
alignRight: PiAlignRight,
|
|
41
|
+
alignTop: PiAlignTop,
|
|
42
|
+
alignMiddle: PiAlignCenterVertical,
|
|
43
|
+
alignBottom: PiAlignBottom,
|
|
44
|
+
distributeHorizontal: PiColumns,
|
|
45
|
+
distributeVertical: PiRows,
|
|
46
|
+
replaceBackground: PiImageSquare,
|
|
47
|
+
cropBackground: PiFrameCorners,
|
|
48
|
+
removeBackground: PiTrash,
|
|
49
|
+
duplicatePage: PiCopy,
|
|
50
|
+
deletePage: PiTrash,
|
|
51
|
+
};
|
|
52
|
+
const SUB_ICONS = {
|
|
53
|
+
layer: PiStack,
|
|
54
|
+
orient: PiArrowsClockwise,
|
|
55
|
+
align: PiAlignLeft,
|
|
56
|
+
};
|
|
57
|
+
const ROW = 'flex w-full h-12 items-center gap-4 rounded-lg border-none bg-transparent px-3 text-left text-[15px] text-[var(--editor-text)] cursor-pointer active:bg-[var(--editor-active-bg)] disabled:opacity-40 disabled:cursor-not-allowed';
|
|
58
|
+
const TILE = 'flex flex-1 min-w-0 flex-col items-center gap-1.5 rounded-xl border-none bg-transparent px-1 py-2.5 text-[12px] font-medium text-[var(--editor-text)] cursor-pointer active:bg-[var(--editor-active-bg)] disabled:opacity-40 disabled:cursor-not-allowed';
|
|
59
|
+
const ICON = 'flex-none text-[var(--editor-text-secondary)]';
|
|
60
|
+
/**
|
|
61
|
+
* Die Ansicht eines Menüs im Sheet: oben die Zwischenablage als Kacheln, darunter
|
|
62
|
+
* die übrigen Befehle als Liste, Löschen zuletzt und für sich — wer weiter
|
|
63
|
+
* unten tippt, soll nicht versehentlich löschen. Untermenüs zeigen ihre
|
|
64
|
+
* Einträge unverändert.
|
|
65
|
+
*/
|
|
66
|
+
function arrange(entries, root) {
|
|
67
|
+
if (!root)
|
|
68
|
+
return { quick: [], list: entries };
|
|
69
|
+
const isQuick = (e) => e.kind === 'item' && QUICK.has(e.id);
|
|
70
|
+
const isDestructive = (e) => e.kind === 'item' && e.destructive;
|
|
71
|
+
const rest = entries.filter((e) => !isQuick(e));
|
|
72
|
+
return {
|
|
73
|
+
quick: entries.filter((e) => isQuick(e)),
|
|
74
|
+
list: compact([
|
|
75
|
+
...rest.filter((e) => !isDestructive(e)),
|
|
76
|
+
{ kind: 'separator' },
|
|
77
|
+
...rest.filter(isDestructive),
|
|
78
|
+
]),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Das Kontextmenü am Handy — wie bei Canva ein Sheet vom unteren Rand, geöffnet
|
|
83
|
+
* über „…“ in der Pille. Inhalt und Befehle sind dieselben wie am Desktop
|
|
84
|
+
* (`buildCanvasMenu`, `useCanvasContextMenu`); nur die Form ist eine andere:
|
|
85
|
+
* Kacheln und Zeilen mit Icons statt Menüpunkte, Gruppen durch Linien
|
|
86
|
+
* getrennt, Untermenüs als eigene Ansicht mit „Zurück“, keine Tastenkürzel.
|
|
87
|
+
*/
|
|
88
|
+
export function CanvasActionSheet({ handleRef, }) {
|
|
89
|
+
const t = useMessages();
|
|
90
|
+
const [request, setRequest] = useState(null);
|
|
91
|
+
const [open, setOpen] = useState(false);
|
|
92
|
+
/** Die geöffneten Untermenüs, innerstes zuletzt. */
|
|
93
|
+
const [trail, setTrail] = useState([]);
|
|
94
|
+
const keepFocusRef = useRef(false);
|
|
95
|
+
useImperativeHandle(handleRef, () => ({
|
|
96
|
+
open: (next) => {
|
|
97
|
+
setRequest(next);
|
|
98
|
+
setTrail([]);
|
|
99
|
+
setOpen(true);
|
|
100
|
+
},
|
|
101
|
+
}), []);
|
|
102
|
+
const select = (id) => {
|
|
103
|
+
if (!request)
|
|
104
|
+
return;
|
|
105
|
+
const { run } = request;
|
|
106
|
+
keepFocusRef.current = AFTER_CLOSE.has(id);
|
|
107
|
+
setOpen(false);
|
|
108
|
+
// Nach dem Schließen: der Befehl soll die Seite sehen, nicht das Sheet davor.
|
|
109
|
+
requestAnimationFrame(() => run(id));
|
|
110
|
+
};
|
|
111
|
+
const current = trail[trail.length - 1];
|
|
112
|
+
const title = current?.label ?? request?.menu.label ?? '';
|
|
113
|
+
const { quick, list } = arrange(current?.entries ?? request?.menu.entries ?? [], !current);
|
|
114
|
+
const itemIcon = (entry) => entry.id === 'toggleLock' && entry.label === t.contextMenu.unlock
|
|
115
|
+
? PiLockSimpleOpen
|
|
116
|
+
: ICONS[entry.id];
|
|
117
|
+
const renderEntry = (entry, index) => {
|
|
118
|
+
switch (entry.kind) {
|
|
119
|
+
case 'separator':
|
|
120
|
+
return (_jsx("li", { "aria-hidden": true, className: "-mx-2 my-1.5 h-px bg-[var(--editor-border-soft)]" }, `sep-${index}`));
|
|
121
|
+
// Der Name steht schon im Kopf des Sheets.
|
|
122
|
+
case 'label':
|
|
123
|
+
return null;
|
|
124
|
+
case 'sub': {
|
|
125
|
+
const Icon = SUB_ICONS[entry.key];
|
|
126
|
+
return (_jsx("li", { children: _jsxs("button", { type: "button", className: ROW, onClick: () => setTrail((prev) => [...prev, entry]), children: [_jsx(Icon, { size: 20, className: ICON, "aria-hidden": true }), entry.label, _jsx(PiCaretRight, { size: 16, className: "ml-auto text-[var(--editor-text-muted)]", "aria-hidden": true })] }) }, `sub-${entry.key}`));
|
|
127
|
+
}
|
|
128
|
+
case 'check':
|
|
129
|
+
return (_jsx("li", { children: _jsxs("button", { type: "button", className: ROW, "aria-pressed": entry.checked, onClick: () => select(entry.id), children: [_jsx("span", { className: "size-5 flex-none", "aria-hidden": true }), entry.label] }) }, entry.id));
|
|
130
|
+
case 'item': {
|
|
131
|
+
const Icon = itemIcon(entry);
|
|
132
|
+
return (_jsx("li", { children: _jsxs("button", { type: "button", className: cn(ROW, entry.destructive && 'text-[var(--editor-danger-fg)]'), disabled: entry.disabled, onClick: () => select(entry.id), children: [Icon ? (_jsx(Icon, { size: 20, className: cn(ICON, entry.destructive && 'text-[var(--editor-danger-fg)]'), "aria-hidden": true })) : (_jsx("span", { className: "size-5 flex-none", "aria-hidden": true })), entry.label] }) }, entry.id));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
return (_jsx(Dialog.Root, { open: open, onOpenChange: setOpen, children: _jsxs(Dialog.Portal, { children: [_jsx(Dialog.Overlay, { className: "fixed inset-0 z-[1010] bg-black/30" }), _jsxs(Dialog.Content, { "aria-describedby": undefined, className: "fixed inset-x-0 bottom-0 z-[1010] flex max-h-[75dvh] flex-col rounded-t-2xl bg-[var(--editor-surface)] pb-[env(safe-area-inset-bottom)] text-[var(--editor-text)] shadow-[0_-8px_24px_rgba(0,0,0,0.16)] outline-none", onCloseAutoFocus: (e) => {
|
|
137
|
+
if (!keepFocusRef.current)
|
|
138
|
+
return;
|
|
139
|
+
keepFocusRef.current = false;
|
|
140
|
+
e.preventDefault();
|
|
141
|
+
}, children: [_jsx("div", { className: "mx-auto mt-2 h-1 w-9 flex-none rounded-full bg-[var(--editor-border)]" }), _jsxs("div", { className: "relative flex h-12 flex-none items-center justify-center px-14", children: [current && (_jsx("button", { type: "button", className: "absolute left-2 inline-flex size-11 items-center justify-center rounded-lg border-none bg-transparent cursor-pointer text-[var(--editor-text)]", onClick: () => setTrail((prev) => prev.slice(0, -1)), "aria-label": t.contextMenu.back, children: _jsx(PiCaretLeft, { size: 20, "aria-hidden": true }) })), _jsx(Dialog.Title, { className: "m-0 truncate text-[15px] font-semibold", children: title })] }), _jsxs("div", { className: "overflow-y-auto", children: [quick.length > 0 && (_jsx("ul", { className: "m-0 flex list-none gap-1 border-b border-[var(--editor-border-soft)] px-2 pb-2", children: quick.map((entry) => {
|
|
142
|
+
const Icon = ICONS[entry.id] ?? PiCopy;
|
|
143
|
+
return (_jsx("li", { className: "flex flex-1 min-w-0", children: _jsxs("button", { type: "button", className: TILE, disabled: entry.disabled, onClick: () => select(entry.id), children: [_jsx(Icon, { size: 22, "aria-hidden": true }), _jsx("span", { className: "max-w-full truncate", children: entry.label })] }) }, entry.id));
|
|
144
|
+
}) })), _jsx("ul", { className: "m-0 list-none px-2 py-1.5", children: list.map(renderEntry) })] })] })] }) }));
|
|
145
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CanvasMenu } from '@ggraphic/editor/components/CanvasContextMenu/canvasMenuModel';
|
|
3
|
+
import type { CanvasCommandId } from '@ggraphic/editor/utils/canvasCommandRegistry';
|
|
4
|
+
export interface CanvasMenuRequest {
|
|
5
|
+
point: {
|
|
6
|
+
clientX: number;
|
|
7
|
+
clientY: number;
|
|
8
|
+
};
|
|
9
|
+
menu: CanvasMenu;
|
|
10
|
+
run: (id: CanvasCommandId) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface CanvasContextMenuHandle {
|
|
13
|
+
open: (request: CanvasMenuRequest) => void;
|
|
14
|
+
}
|
|
15
|
+
/** Befehle, die selbst den Fokus nehmen (Text-Editor, Bildauswahl): erst nach dem Schließen. */
|
|
16
|
+
export declare const AFTER_CLOSE: ReadonlySet<CanvasCommandId>;
|
|
17
|
+
/**
|
|
18
|
+
* Das Kontextmenü des Editors — genau eines, für alle Seiten. Jede gemountete
|
|
19
|
+
* Radix-Menü-Wurzel hängt einen Keydown-Listener an `document`; ein Menü je
|
|
20
|
+
* Element oder Seite kostete bei jedem Tastendruck im Canvas (siehe
|
|
21
|
+
* `docs/CLAUDE-canvas-eval.md`).
|
|
22
|
+
*
|
|
23
|
+
* Geöffnet wird es von außen (`open`): der Editor weiß, worauf geklickt wurde,
|
|
24
|
+
* und schickt das `contextmenu` an einen unsichtbaren Anker — Radix nimmt den
|
|
25
|
+
* Punkt daraus. Der Anker bekommt nie eine Berührung, darum gibt es keinen
|
|
26
|
+
* Long-Press. `modal={false}`, damit ein zweiter Rechtsklick wieder bei der
|
|
27
|
+
* Fläche ankommt und das Menü dort neu öffnet, statt im Browser-Menü zu landen.
|
|
28
|
+
*/
|
|
29
|
+
export declare function CanvasContextMenu({ handleRef, closeKey, }: {
|
|
30
|
+
handleRef: React.Ref<CanvasContextMenuHandle>;
|
|
31
|
+
/** Ändert sich der Wert (Zoom), schließt das Menü: es hinge sonst neben seinem Ziel. */
|
|
32
|
+
closeKey: unknown;
|
|
33
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { ContextMenu } from 'radix-ui';
|
|
4
|
+
import { useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
5
|
+
import { PiCaretRight, PiCheck } from 'react-icons/pi';
|
|
6
|
+
/** Befehle, die selbst den Fokus nehmen (Text-Editor, Bildauswahl): erst nach dem Schließen. */
|
|
7
|
+
export const AFTER_CLOSE = new Set(['editText', 'replaceBackground']);
|
|
8
|
+
const CONTENT = 'z-[10001] min-w-[14rem] max-h-(--radix-context-menu-content-available-height) overflow-y-auto rounded-lg border border-[var(--editor-border)] bg-[var(--editor-surface)] p-1 text-[var(--editor-text)] shadow-[0_8px_24px_rgba(0,0,0,0.16)]';
|
|
9
|
+
const ITEM = 'relative flex h-8 cursor-default select-none items-center gap-2 rounded-md px-2 text-[13px] outline-none data-[highlighted]:bg-[var(--editor-active-bg)] data-[highlighted]:text-[var(--editor-active-fg)] data-[state=open]:bg-[var(--editor-surface-hover)] data-[disabled]:pointer-events-none data-[disabled]:opacity-40 data-[destructive]:text-[var(--editor-danger-fg)] data-[destructive]:data-[highlighted]:bg-[var(--editor-danger-bg)] data-[destructive]:data-[highlighted]:text-[var(--editor-danger-fg)]';
|
|
10
|
+
/**
|
|
11
|
+
* Das Kontextmenü des Editors — genau eines, für alle Seiten. Jede gemountete
|
|
12
|
+
* Radix-Menü-Wurzel hängt einen Keydown-Listener an `document`; ein Menü je
|
|
13
|
+
* Element oder Seite kostete bei jedem Tastendruck im Canvas (siehe
|
|
14
|
+
* `docs/CLAUDE-canvas-eval.md`).
|
|
15
|
+
*
|
|
16
|
+
* Geöffnet wird es von außen (`open`): der Editor weiß, worauf geklickt wurde,
|
|
17
|
+
* und schickt das `contextmenu` an einen unsichtbaren Anker — Radix nimmt den
|
|
18
|
+
* Punkt daraus. Der Anker bekommt nie eine Berührung, darum gibt es keinen
|
|
19
|
+
* Long-Press. `modal={false}`, damit ein zweiter Rechtsklick wieder bei der
|
|
20
|
+
* Fläche ankommt und das Menü dort neu öffnet, statt im Browser-Menü zu landen.
|
|
21
|
+
*/
|
|
22
|
+
export function CanvasContextMenu({ handleRef, closeKey, }) {
|
|
23
|
+
const anchorRef = useRef(null);
|
|
24
|
+
const contentRef = useRef(null);
|
|
25
|
+
const [open, setOpen] = useState(false);
|
|
26
|
+
const openRef = useRef(false);
|
|
27
|
+
const [request, setRequest] = useState(null);
|
|
28
|
+
const keepFocusRef = useRef(false);
|
|
29
|
+
const changeOpen = (next) => {
|
|
30
|
+
openRef.current = next;
|
|
31
|
+
setOpen(next);
|
|
32
|
+
};
|
|
33
|
+
useImperativeHandle(handleRef, () => ({
|
|
34
|
+
open: (next) => {
|
|
35
|
+
const fire = () => anchorRef.current?.dispatchEvent(new MouseEvent('contextmenu', {
|
|
36
|
+
bubbles: true,
|
|
37
|
+
cancelable: true,
|
|
38
|
+
clientX: next.point.clientX,
|
|
39
|
+
clientY: next.point.clientY,
|
|
40
|
+
}));
|
|
41
|
+
setRequest(next);
|
|
42
|
+
// Ein offenes Menü springt nicht an den neuen Punkt; erst schließen.
|
|
43
|
+
if (openRef.current) {
|
|
44
|
+
changeOpen(false);
|
|
45
|
+
requestAnimationFrame(fire);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
fire();
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
}), []);
|
|
52
|
+
// Zoom moves the canvas under the menu: close it, during render, not in an effect.
|
|
53
|
+
const [seenCloseKey, setSeenCloseKey] = useState(closeKey);
|
|
54
|
+
if (seenCloseKey !== closeKey) {
|
|
55
|
+
setSeenCloseKey(closeKey);
|
|
56
|
+
setOpen(false);
|
|
57
|
+
}
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
openRef.current = open;
|
|
60
|
+
}, [open]);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (!open)
|
|
63
|
+
return undefined;
|
|
64
|
+
const close = (e) => {
|
|
65
|
+
if (e.target instanceof Node && contentRef.current?.contains(e.target))
|
|
66
|
+
return;
|
|
67
|
+
changeOpen(false);
|
|
68
|
+
};
|
|
69
|
+
window.addEventListener('scroll', close, true);
|
|
70
|
+
window.addEventListener('resize', close);
|
|
71
|
+
return () => {
|
|
72
|
+
window.removeEventListener('scroll', close, true);
|
|
73
|
+
window.removeEventListener('resize', close);
|
|
74
|
+
};
|
|
75
|
+
}, [open]);
|
|
76
|
+
const select = (id) => {
|
|
77
|
+
if (!request)
|
|
78
|
+
return;
|
|
79
|
+
if (AFTER_CLOSE.has(id)) {
|
|
80
|
+
keepFocusRef.current = true;
|
|
81
|
+
const { run } = request;
|
|
82
|
+
requestAnimationFrame(() => run(id));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
request.run(id);
|
|
86
|
+
};
|
|
87
|
+
const renderEntry = (entry, index) => {
|
|
88
|
+
switch (entry.kind) {
|
|
89
|
+
case 'separator':
|
|
90
|
+
return (_jsx(ContextMenu.Separator, { className: "-mx-1 my-1 h-px bg-[var(--editor-border-soft)]" }, `sep-${index}`));
|
|
91
|
+
case 'label':
|
|
92
|
+
return (_jsx(ContextMenu.Label, { className: "px-2 py-1 text-[12px] font-medium text-[var(--editor-text-muted)]", children: entry.label }, `label-${index}`));
|
|
93
|
+
case 'check':
|
|
94
|
+
return (_jsxs(ContextMenu.CheckboxItem, { className: `${ITEM} pl-7`, checked: entry.checked, onSelect: () => select(entry.id), children: [_jsx(ContextMenu.ItemIndicator, { className: "absolute left-2 inline-flex", children: _jsx(PiCheck, { size: 14, "aria-hidden": true }) }), entry.label] }, entry.id));
|
|
95
|
+
case 'sub':
|
|
96
|
+
return (_jsxs(ContextMenu.Sub, { children: [_jsxs(ContextMenu.SubTrigger, { className: ITEM, children: [entry.label, _jsx(PiCaretRight, { size: 14, className: "ml-auto", "aria-hidden": true })] }), _jsx(ContextMenu.Portal, { children: _jsx(ContextMenu.SubContent, { className: CONTENT, sideOffset: 4, children: entry.entries.map(renderEntry) }) })] }, `sub-${entry.label}`));
|
|
97
|
+
case 'item':
|
|
98
|
+
return (_jsxs(ContextMenu.Item, { className: ITEM, disabled: entry.disabled, onSelect: () => select(entry.id), ...(entry.destructive ? { 'data-destructive': '' } : {}), ...(entry.ariaShortcut ? { 'aria-keyshortcuts': entry.ariaShortcut } : {}), children: [entry.label, entry.shortcut && (_jsx("span", { className: "ml-auto pl-6 text-[12px] text-[var(--editor-text-muted)]", children: entry.shortcut }))] }, entry.id));
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
return (_jsxs(ContextMenu.Root, { open: open, onOpenChange: changeOpen, modal: false, children: [_jsx(ContextMenu.Trigger, { asChild: true, children: _jsx("span", { ref: anchorRef, "aria-hidden": true, className: "fixed left-0 top-0 size-0" }) }), _jsx(ContextMenu.Portal, { children: request && (_jsx(ContextMenu.Content, { ref: contentRef, className: CONTENT, "aria-label": request.menu.label, onContextMenu: (e) => e.preventDefault(), onCloseAutoFocus: (e) => {
|
|
102
|
+
if (!keepFocusRef.current)
|
|
103
|
+
return;
|
|
104
|
+
keepFocusRef.current = false;
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
}, children: request.menu.entries.map(renderEntry) })) })] }));
|
|
107
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Was das Kontextmenü zeigt, als reine Funktion des Ziels. Die Namen und
|
|
3
|
+
* Kürzel kommen aus dem Befehlsregister, die Fähigkeiten aus denselben Fragen,
|
|
4
|
+
* die die Leiste stellt (`selectionCapabilities`) — Menü und Leiste können
|
|
5
|
+
* nicht auseinanderlaufen.
|
|
6
|
+
*/
|
|
7
|
+
import { type CanvasCommandId } from '@ggraphic/editor/utils/canvasCommandRegistry';
|
|
8
|
+
import type { BackgroundControls } from '../../configs/types.js';
|
|
9
|
+
import type { FloatingModuleState } from '../../hooks/useFloatingModuleState.js';
|
|
10
|
+
import type { SelectionCapabilities } from '../../utils/selectionCapabilities.js';
|
|
11
|
+
/** Was eine Seite beim Öffnen des Menüs über sich sagt — gelesen, nicht aus einem Render. */
|
|
12
|
+
export interface CanvasMenuSnapshot {
|
|
13
|
+
selection: readonly string[];
|
|
14
|
+
module: FloatingModuleState | null;
|
|
15
|
+
caps: SelectionCapabilities;
|
|
16
|
+
canSelectAll: boolean;
|
|
17
|
+
isCropping: boolean;
|
|
18
|
+
/** Die Hintergrund-Steuerung dieser Seite, an ihren Zustand gebunden. */
|
|
19
|
+
background: BackgroundControls | null;
|
|
20
|
+
}
|
|
21
|
+
/** Fester Schlüssel eines Untermenüs — für Icons, unabhängig von der Sprache. */
|
|
22
|
+
export type CanvasSubmenuKey = 'layer' | 'orient' | 'align';
|
|
23
|
+
export type CanvasMenuKind = 'element' | 'multi' | 'background' | 'page';
|
|
24
|
+
export interface CanvasMenuEnv {
|
|
25
|
+
isMac: boolean;
|
|
26
|
+
/** Ob der Rechtsklick auf der Bühne lag — nur dann gibt es „Hier einfügen“. */
|
|
27
|
+
hasPoint: boolean;
|
|
28
|
+
hasClipboard: boolean;
|
|
29
|
+
pageIndex: number;
|
|
30
|
+
pageCount: number;
|
|
31
|
+
canAddPage: boolean;
|
|
32
|
+
/** Der Editor hat einen Bereich „Bild bearbeiten“. */
|
|
33
|
+
canEditImage: boolean;
|
|
34
|
+
}
|
|
35
|
+
export type CanvasMenuEntry = {
|
|
36
|
+
kind: 'item';
|
|
37
|
+
id: CanvasCommandId;
|
|
38
|
+
label: string;
|
|
39
|
+
shortcut: string | null;
|
|
40
|
+
ariaShortcut: string | null;
|
|
41
|
+
disabled: boolean;
|
|
42
|
+
destructive: boolean;
|
|
43
|
+
} | {
|
|
44
|
+
kind: 'check';
|
|
45
|
+
id: CanvasCommandId;
|
|
46
|
+
label: string;
|
|
47
|
+
checked: boolean;
|
|
48
|
+
} | {
|
|
49
|
+
kind: 'sub';
|
|
50
|
+
key: CanvasSubmenuKey;
|
|
51
|
+
label: string;
|
|
52
|
+
entries: CanvasMenuEntry[];
|
|
53
|
+
} | {
|
|
54
|
+
kind: 'label';
|
|
55
|
+
label: string;
|
|
56
|
+
} | {
|
|
57
|
+
kind: 'separator';
|
|
58
|
+
};
|
|
59
|
+
export interface CanvasMenu {
|
|
60
|
+
kind: CanvasMenuKind;
|
|
61
|
+
/** Der Name des Menüs für Screenreader („Element“, „3 Elemente“, „Seite 2“). */
|
|
62
|
+
label: string;
|
|
63
|
+
entries: CanvasMenuEntry[];
|
|
64
|
+
}
|
|
65
|
+
export declare function menuKindOf(snapshot: CanvasMenuSnapshot): CanvasMenuKind;
|
|
66
|
+
export declare function buildCanvasMenu(snapshot: CanvasMenuSnapshot, env: CanvasMenuEnv): CanvasMenu;
|
|
67
|
+
/** Keine Trennlinie am Rand und keine zwei hintereinander. */
|
|
68
|
+
export declare function compact(entries: CanvasMenuEntry[]): CanvasMenuEntry[];
|