@ggraphic/editor 0.0.0-stage → 0.1.0-alpha.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 +26 -0
- package/dist/brand/brandRegistry.js +56 -0
- package/dist/brand/composerBrand.d.ts +146 -0
- package/dist/brand/composerBrand.js +6 -0
- package/dist/brand/documentBrand.d.ts +16 -0
- package/dist/brand/documentBrand.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 +1144 -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 +527 -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 +81 -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 +787 -0
- package/dist/components/GenericCanvasElement.d.ts +34 -0
- package/dist/components/GenericCanvasElement.js +267 -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 +216 -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 +107 -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 +321 -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 +89 -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/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/FloatingPositionControl.d.ts +38 -0
- package/dist/components/TopBar/modules/FloatingPositionControl.js +74 -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 +24 -0
- package/dist/components/markerMark.js +22 -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 +201 -0
- package/dist/configs/factory/actionFactories.js +628 -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 +431 -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 +47 -0
- package/dist/export/pptx/buildPptxModel.js +612 -0
- package/dist/export/pptx/exportPptxDeck.d.ts +26 -0
- package/dist/export/pptx/exportPptxDeck.js +80 -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 +17 -0
- package/dist/export/pptx/textModel.js +118 -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 +897 -0
- package/dist/i18n/de.js +961 -0
- package/dist/i18n/en.d.ts +3 -0
- package/dist/i18n/en.js +949 -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 +284 -0
- package/dist/primitives/CanvasStage.d.ts +84 -0
- package/dist/primitives/CanvasStage.js +292 -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 +496 -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 +78 -0
- package/dist/sidebar/sections/CombinedTextSection.d.ts +16 -0
- package/dist/sidebar/sections/CombinedTextSection.js +43 -0
- package/dist/sidebar/sections/DiagrammeSection.d.ts +9 -0
- package/dist/sidebar/sections/DiagrammeSection.js +40 -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 +28 -0
- package/dist/sidebar/sections/FormenSection.js +440 -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 +33 -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 +85 -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 +61 -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 +43 -0
- package/dist/sidebar/sections/assets/useElementCatalog.js +386 -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 +34 -0
- package/dist/sidebar/sections/effects/OutlineSettings.d.ts +12 -0
- package/dist/sidebar/sections/effects/OutlineSettings.js +29 -0
- package/dist/sidebar/sections/effects/ShadowSettings.d.ts +13 -0
- package/dist/sidebar/sections/effects/ShadowSettings.js +38 -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 +90 -0
- package/dist/sidebar/sections/tools/GradientTextTool.d.ts +5 -0
- package/dist/sidebar/sections/tools/GradientTextTool.js +104 -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 +125 -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 +151 -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/documentBrandConfig.d.ts +14 -0
- package/dist/testing/documentBrandConfig.js +60 -0
- package/dist/testing/documentBrandPacks.d.ts +10 -0
- package/dist/testing/documentBrandPacks.js +45 -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/canvasAssets.d.ts +140 -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 +30 -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 +7 -0
- package/dist/utils/colorNames.js +17 -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 +26 -0
- package/dist/utils/fontMarkSupport.js +32 -0
- package/dist/utils/frameUtils.d.ts +20 -0
- package/dist/utils/frameUtils.js +283 -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 +27 -0
- package/dist/utils/illustrations/registry.js +106 -0
- package/dist/utils/illustrations/svgCache.d.ts +60 -0
- package/dist/utils/illustrations/svgCache.js +349 -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 +94 -0
- package/dist/utils/imageFilters.js +304 -0
- package/dist/utils/imageLook.d.ts +18 -0
- package/dist/utils/imageLook.js +41 -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 +38 -0
- package/dist/utils/markerBoxes.js +60 -0
- package/dist/utils/markerColors.d.ts +16 -0
- package/dist/utils/markerColors.js +32 -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 +25 -0
- package/dist/utils/photoPlaceholder.js +38 -0
- package/dist/utils/pillBadgeUtils.d.ts +41 -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 +64 -0
- package/dist/utils/shapes.js +838 -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 +254 -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 +9 -0
- package/dist/utils/zipPageImages.js +30 -0
- package/package.json +105 -3
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import type { SidebarTabId } from '@ggraphic/editor/sidebar/types';
|
|
2
|
+
import type { GenericCanvasRef, ToolbarStateReport } from '@ggraphic/editor/components/GenericCanvas';
|
|
3
|
+
import type { FullCanvasConfig } from '@ggraphic/editor/configs/types';
|
|
4
|
+
import type { InitialPageDef } from '@ggraphic/editor/hooks/usePageManager';
|
|
5
|
+
import type { HocuspocusProvider } from '@hocuspocus/provider';
|
|
6
|
+
import type React from 'react';
|
|
7
|
+
import type * as Y from 'yjs';
|
|
8
|
+
/** `TConfigId`: the host's template ids (`registerTemplates`). */
|
|
9
|
+
export interface CanvasEditorProps<TConfigId extends string = string> {
|
|
10
|
+
initialConfigId: TConfigId;
|
|
11
|
+
/** The canvas document's format id. Absent: the default format. */
|
|
12
|
+
formatId?: string;
|
|
13
|
+
/** Document title; names the print PDF (`<title>.pdf`). */
|
|
14
|
+
documentTitle?: string;
|
|
15
|
+
initialProps: Record<string, unknown>;
|
|
16
|
+
onExport: (base64: string) => void;
|
|
17
|
+
onCancel: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Fired with the rendered image whenever the user downloads the current
|
|
20
|
+
* page. Unlike onExport (a flow-level "done" callback with host side
|
|
21
|
+
* effects), this is a pure observation hook — e.g. collab hosts reuse the
|
|
22
|
+
* download image as a fresh document thumbnail.
|
|
23
|
+
*/
|
|
24
|
+
onDownload?: (base64: string) => void;
|
|
25
|
+
callbacks?: Record<string, (val: unknown) => void>;
|
|
26
|
+
maxPages?: number;
|
|
27
|
+
/** Pre-populated pages — overrides single-page initialization when provided */
|
|
28
|
+
initialPages?: InitialPageDef[];
|
|
29
|
+
/**
|
|
30
|
+
* Collaborative mode — fed into usePageManager to back the pages list with
|
|
31
|
+
* a Yjs doc, and used to derive each page's Y.Map for config sync.
|
|
32
|
+
*/
|
|
33
|
+
collaborative?: {
|
|
34
|
+
ydoc: Y.Doc;
|
|
35
|
+
isSynced: boolean;
|
|
36
|
+
/** Hocuspocus provider — enables awareness features (remote selections). */
|
|
37
|
+
provider?: HocuspocusProvider | null;
|
|
38
|
+
/** Show the initial pages, read-only, until the doc has synced (fresh canvas only). */
|
|
39
|
+
previewBeforeSync?: boolean;
|
|
40
|
+
/** The doc holds the local cache: show its pages, read-only, until the sync. */
|
|
41
|
+
isLocalLoaded?: boolean;
|
|
42
|
+
};
|
|
43
|
+
/** Host-supplied content rendered at the very left of the toolbar (in-flow). */
|
|
44
|
+
chromeLeft?: React.ReactNode;
|
|
45
|
+
/** Host-supplied content rendered absolute-centered in the toolbar (e.g. doc title, sync badge). */
|
|
46
|
+
chromeCenter?: React.ReactNode;
|
|
47
|
+
/** Host-supplied content rendered in the toolbar's right cluster (e.g. presence avatars). */
|
|
48
|
+
chromeRight?: React.ReactNode;
|
|
49
|
+
/**
|
|
50
|
+
* When provided, the share popover shows a "Personen" entry that triggers
|
|
51
|
+
* this callback. Used by collab hosts to open their invite/permissions dialog.
|
|
52
|
+
*/
|
|
53
|
+
onInvitePeople?: () => void;
|
|
54
|
+
/**
|
|
55
|
+
* When provided, the share surfaces show a "Vorlage" entry that triggers
|
|
56
|
+
* this callback. The host owns the template flow — it knows the document
|
|
57
|
+
* identity (canvas id, collab doc) this package deliberately doesn't.
|
|
58
|
+
* Without it the entry is hidden.
|
|
59
|
+
*/
|
|
60
|
+
onSaveAsTemplate?: () => void;
|
|
61
|
+
/**
|
|
62
|
+
* Collab mode only: fired with a fresh stage render after local edits
|
|
63
|
+
* settle (debounced) and when the tab is hidden. Hosts use it to keep the
|
|
64
|
+
* document thumbnail current — without it the gallery/recents preview only
|
|
65
|
+
* refreshes on download.
|
|
66
|
+
*/
|
|
67
|
+
onCollabSnapshot?: (base64: string) => void;
|
|
68
|
+
/**
|
|
69
|
+
* Seeds the per-instance AutoSaveStore with a known share token, e.g. when
|
|
70
|
+
* the editor is opened against an existing share via URL. Without this seed,
|
|
71
|
+
* the first save after a page reload creates a new draft instead of updating.
|
|
72
|
+
*/
|
|
73
|
+
initialShareToken?: string | null;
|
|
74
|
+
/**
|
|
75
|
+
* Called when the auto-save creates or adopts a share token. Hosts use this
|
|
76
|
+
* to remember the token across editor remounts (and to keep their own save
|
|
77
|
+
* paths updating the same share instead of creating duplicate drafts).
|
|
78
|
+
*/
|
|
79
|
+
onAutoSaveShareToken?: (token: string) => void;
|
|
80
|
+
/**
|
|
81
|
+
* Sidebar tab open on the first render. Hosts that remember the tab per
|
|
82
|
+
* document (e.g. the chat after a reload) seed it here; read once.
|
|
83
|
+
* Ignored on mobile, where an open tab covers the canvas as a sheet.
|
|
84
|
+
*/
|
|
85
|
+
initialTab?: SidebarTabId | null;
|
|
86
|
+
/** Fired whenever the open sidebar tab changes, including on mount. Desktop only. */
|
|
87
|
+
onActiveTabChange?: (tab: SidebarTabId | null) => void;
|
|
88
|
+
/**
|
|
89
|
+
* Local mode only: false keeps the editor out of the gallery — a host that
|
|
90
|
+
* saves the result itself (the sticker creator) would otherwise leave a
|
|
91
|
+
* draft behind for every attempt. Default true.
|
|
92
|
+
*/
|
|
93
|
+
galleryAutoSave?: boolean;
|
|
94
|
+
/** False hides the toolbar's share/download menu, for a host with its own way out. Default true. */
|
|
95
|
+
showShare?: boolean;
|
|
96
|
+
/** Lets the host render the active page itself, e.g. to save it somewhere else. */
|
|
97
|
+
exportApiRef?: React.Ref<CanvasEditorExportApi>;
|
|
98
|
+
/**
|
|
99
|
+
* The host draws the menu bar itself (the mobile app's native header). The
|
|
100
|
+
* editor then renders no bar of its own: undo/redo run through
|
|
101
|
+
* `exportApiRef`, and the share menu opens on the host's request.
|
|
102
|
+
*/
|
|
103
|
+
hostChrome?: CanvasEditorHostChrome;
|
|
104
|
+
/** A viewer's session: view, page, download and present, but nothing offers a write the server would drop. */
|
|
105
|
+
readOnly?: boolean;
|
|
106
|
+
}
|
|
107
|
+
/** See `CanvasEditorProps.hostChrome`. */
|
|
108
|
+
export interface CanvasEditorHostChrome {
|
|
109
|
+
/** Fired whenever undo or redo becomes (un)available; both false while an AI suggestion waits. */
|
|
110
|
+
onHistoryChange: (history: {
|
|
111
|
+
canUndo: boolean;
|
|
112
|
+
canRedo: boolean;
|
|
113
|
+
}) => void;
|
|
114
|
+
/** The share menu, opened from the host's bar and anchored at the top right. */
|
|
115
|
+
shareOpen: boolean;
|
|
116
|
+
onShareOpenChange: (open: boolean) => void;
|
|
117
|
+
}
|
|
118
|
+
/** What `exportApiRef` exposes to the host. */
|
|
119
|
+
export interface CanvasEditorExportApi {
|
|
120
|
+
/** The active page as a PNG data URL; null when it is not mounted. */
|
|
121
|
+
captureActivePage: (options?: {
|
|
122
|
+
pixelRatio?: number;
|
|
123
|
+
transparent?: boolean;
|
|
124
|
+
}) => Promise<string | null>;
|
|
125
|
+
/** Every page as a PNG data URL, in page order; throws when a page cannot be rendered. */
|
|
126
|
+
capturePages: (options?: {
|
|
127
|
+
pixelRatio?: number;
|
|
128
|
+
}) => Promise<string[]>;
|
|
129
|
+
/** The deck as an editable .pptx; throws when a page cannot be rendered. */
|
|
130
|
+
exportPptx: () => Promise<Blob>;
|
|
131
|
+
/** The deck as a Vorlage stores it: config and state per page. */
|
|
132
|
+
getPages: () => {
|
|
133
|
+
configId: string;
|
|
134
|
+
state: Record<string, unknown>;
|
|
135
|
+
}[];
|
|
136
|
+
/** The menu bar's undo/redo, for a host that draws the bar itself. */
|
|
137
|
+
undo: () => void;
|
|
138
|
+
redo: () => void;
|
|
139
|
+
}
|
|
140
|
+
export interface PageWrapperProps {
|
|
141
|
+
page: {
|
|
142
|
+
id: string;
|
|
143
|
+
configId: string;
|
|
144
|
+
state: Record<string, unknown>;
|
|
145
|
+
};
|
|
146
|
+
index: number;
|
|
147
|
+
pageCount: number;
|
|
148
|
+
config: FullCanvasConfig;
|
|
149
|
+
formatId?: string;
|
|
150
|
+
isActive: boolean;
|
|
151
|
+
canDelete: boolean;
|
|
152
|
+
canvasRef: React.RefObject<GenericCanvasRef | null>;
|
|
153
|
+
onSelect: (index: number) => void;
|
|
154
|
+
onDelete: (id: string) => void;
|
|
155
|
+
onMovePage: (id: string, direction: 'up' | 'down') => void;
|
|
156
|
+
onDuplicatePage: (id: string) => void;
|
|
157
|
+
/** Opens the template picker in replace mode for this page ("Vorlage ändern"). */
|
|
158
|
+
onChangeTemplate?: (id: string) => void;
|
|
159
|
+
/** A Vorlagen tile dropped on this page; unset where the design has no Vorlagen tab. */
|
|
160
|
+
onDropVorlage?: (id: string, pageId: string) => void;
|
|
161
|
+
onExport: (base64: string) => void;
|
|
162
|
+
onCancel: () => void;
|
|
163
|
+
callbacks: Record<string, (val: unknown) => void>;
|
|
164
|
+
multiPageExport?: {
|
|
165
|
+
pageCount: number;
|
|
166
|
+
onDownloadAllZip: () => Promise<void>;
|
|
167
|
+
isExporting: boolean;
|
|
168
|
+
exportProgress: {
|
|
169
|
+
current: number;
|
|
170
|
+
total: number;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
onStateChange: (pageId: string, state: Record<string, unknown>, actions: Record<string, unknown>, selectedElement: string | null) => void;
|
|
174
|
+
/** Reports this page's live state even while it is not the active page (print impressum gate). */
|
|
175
|
+
onObservedState?: (pageId: string, state: Record<string, unknown>, actions: Record<string, unknown>) => void;
|
|
176
|
+
onToolbarStateChange?: (state: ToolbarStateReport) => void;
|
|
177
|
+
/** See CanvasEditorProps.onAutoSaveShareToken. */
|
|
178
|
+
onAutoSaveShareToken?: (token: string) => void;
|
|
179
|
+
/**
|
|
180
|
+
* Per-page (single-page) gallery autosave. Explicit because the page always
|
|
181
|
+
* has a Y.Map binding now — presence of the binding no longer implies collab.
|
|
182
|
+
*/
|
|
183
|
+
autoSave?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Per-page Y.Map binding for config/state. Set on every page in both
|
|
186
|
+
* modes; `provider` is only present in collab mode.
|
|
187
|
+
*/
|
|
188
|
+
pageBinding?: {
|
|
189
|
+
pageYMap: Y.Map<unknown>;
|
|
190
|
+
isSynced: boolean;
|
|
191
|
+
/** Hocuspocus provider — enables awareness features (remote selections). */
|
|
192
|
+
provider?: HocuspocusProvider | null;
|
|
193
|
+
/** Id of this page, published to awareness so peers can filter selections per page. */
|
|
194
|
+
pageId?: string | null;
|
|
195
|
+
/** Only the active page publishes its selection to awareness. */
|
|
196
|
+
publishSelection?: boolean;
|
|
197
|
+
};
|
|
198
|
+
/** Forwarded ref to the wrapper div — used for scroll-into-view */
|
|
199
|
+
pageRef?: React.Ref<HTMLDivElement>;
|
|
200
|
+
/** See CanvasEditorProps.readOnly. */
|
|
201
|
+
readOnly?: boolean;
|
|
202
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export declare function CanvasTabRailSkeleton(): import("react").JSX.Element;
|
|
3
|
+
interface CanvasPageSkeletonProps {
|
|
4
|
+
/** Seitenverhältnis Breite/Höhe der Vorlage; ohne Angabe das Standardformat. */
|
|
5
|
+
aspectRatio?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function CanvasPageSkeleton({ aspectRatio, }: CanvasPageSkeletonProps): import("react").JSX.Element;
|
|
8
|
+
interface CanvasEditorSkeletonProps {
|
|
9
|
+
/** Echter Zurück-Button des Hosts, damit man schon während des Ladens raus kann. */
|
|
10
|
+
chromeLeft?: ReactNode;
|
|
11
|
+
aspectRatio?: number;
|
|
12
|
+
/** False when the host draws the menu bar itself (the app's native header). */
|
|
13
|
+
topBar?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function CanvasEditorSkeleton({ chromeLeft, aspectRatio, topBar, }: CanvasEditorSkeletonProps): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { getCanvasFormatOrDefault } from '@ggraphic/editor/formats/index';
|
|
5
|
+
// Nur leichte Importe (kein Editor-Barrel): die Datei ist als eigener Subpath
|
|
6
|
+
// (`./skeleton` des Pakets) der Suspense-Fallback der Route und
|
|
7
|
+
// darf Konva & Co. nicht ins Entry-Bundle ziehen.
|
|
8
|
+
const pulse = 'animate-pulse bg-[var(--editor-tile)]';
|
|
9
|
+
// Solange das Format unbekannt ist (Route-Fallback, Dokument lädt noch), das
|
|
10
|
+
// Standardformat zeigen — die meisten Vorlagen sind 4:5, nicht quadratisch.
|
|
11
|
+
const defaultFormat = getCanvasFormatOrDefault(null);
|
|
12
|
+
const DEFAULT_ASPECT_RATIO = defaultFormat.width / defaultFormat.height;
|
|
13
|
+
const RAIL_TABS = 7;
|
|
14
|
+
const MOBILE_TABS = 6;
|
|
15
|
+
export function CanvasTabRailSkeleton() {
|
|
16
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { "aria-hidden": "true", className: "flex flex-col items-center gap-1 pt-2 shrink-0 w-[76px] h-full bg-[var(--editor-surface)] border-r border-[var(--editor-border)] max-canvas-mobile:hidden", children: Array.from({ length: RAIL_TABS }, (_, i) => (_jsxs("div", { className: "w-[62px] py-[9px] flex flex-col items-center gap-1.5", children: [_jsx("div", { className: `size-[21px] rounded-md ${pulse}` }), _jsx("div", { className: `h-2 w-9 rounded ${pulse}` })] }, i))) }), _jsx("div", { "aria-hidden": "true", className: "order-2 hidden flex-none h-[calc(64px+env(safe-area-inset-bottom))] pt-2 px-1 pb-[env(safe-area-inset-bottom)] bg-[var(--editor-surface)] border-t border-[var(--editor-border)] max-canvas-mobile:flex", children: Array.from({ length: MOBILE_TABS }, (_, i) => (_jsxs("div", { className: "flex-1 flex flex-col items-center gap-1", children: [_jsx("div", { className: `w-[52px] h-8 rounded-2xl ${pulse}` }), _jsx("div", { className: `h-2 w-8 rounded ${pulse}` })] }, i))) })] }));
|
|
17
|
+
}
|
|
18
|
+
export function CanvasPageSkeleton({ aspectRatio = DEFAULT_ASPECT_RATIO, }) {
|
|
19
|
+
return (_jsx("div", { "aria-hidden": "true", className: "flex flex-1 min-h-0 w-full items-center justify-center p-lg", children: _jsx("div", { className: `max-h-full w-full max-w-[560px] rounded-sm shadow-sm ${pulse}`, style: { aspectRatio } }) }));
|
|
20
|
+
}
|
|
21
|
+
export function CanvasEditorSkeleton({ chromeLeft, aspectRatio, topBar = true, }) {
|
|
22
|
+
const t = useMessages();
|
|
23
|
+
return (_jsxs("div", { role: "status", "aria-live": "polite", "aria-busy": "true", "aria-label": t.shell.loadingEditor, className: "flex flex-col h-dvh min-h-[500px] bg-[var(--editor-bg)]", children: [topBar && (_jsxs("div", { className: "relative w-full h-[var(--editor-topbar-height)] shrink-0 bg-[image:var(--editor-menubar-gradient)] px-4 flex items-center gap-1 max-canvas-mobile:h-[52px] max-canvas-mobile:px-2.5", children: [chromeLeft ?? _jsx("div", { className: "size-[34px] rounded-[10px] bg-white/15" }), _jsx("div", { className: "absolute left-1/2 -translate-x-1/2 h-3.5 w-40 rounded animate-pulse bg-white/25" }), _jsx("div", { className: "ml-auto h-8 w-24 rounded-[10px] animate-pulse bg-white/15" })] })), _jsxs("div", { className: "flex flex-1 min-h-0 max-canvas-mobile:flex-col", children: [_jsx(CanvasTabRailSkeleton, {}), _jsxs("div", { className: "flex flex-1 min-h-0 flex-col bg-[var(--editor-canvas-bg)]", children: [_jsx("div", { className: "h-14 shrink-0 max-canvas-mobile:hidden" }), _jsx(CanvasPageSkeleton, { aspectRatio: aspectRatio }), _jsx("div", { className: "flex shrink-0 justify-end p-sm max-canvas-mobile:hidden", children: _jsx("div", { className: "h-9 w-48 rounded-xl border border-[var(--editor-border)] bg-[var(--editor-surface)]/80" }) })] })] })] }));
|
|
24
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface CanvasMetaBarProps {
|
|
2
|
+
pageCount: number;
|
|
3
|
+
currentPageIndex: number;
|
|
4
|
+
zoom: number;
|
|
5
|
+
onZoomChange: (value: number) => void;
|
|
6
|
+
fullscreenTargetRef?: React.RefObject<HTMLElement | null>;
|
|
7
|
+
minZoom?: number;
|
|
8
|
+
maxZoom?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const CanvasMetaBar: import("react").MemoExoticComponent<({ pageCount, currentPageIndex, zoom, onZoomChange, fullscreenTargetRef, minZoom, maxZoom, }: CanvasMetaBarProps) => import("react").JSX.Element>;
|
|
11
|
+
/** Mobile: the zoom level, shown only while zoomed; tapping resets to 100 %. */
|
|
12
|
+
export declare function CanvasZoomIndicator({ zoom, onZoomChange, }: {
|
|
13
|
+
zoom: number;
|
|
14
|
+
onZoomChange: (value: number) => void;
|
|
15
|
+
}): import("react").JSX.Element | null;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { memo, useCallback, useEffect, useState } from 'react';
|
|
4
|
+
import { PiArrowCounterClockwise, PiArrowsOut, PiFile, PiMagnifyingGlassMinus, PiMagnifyingGlassPlus, } from 'react-icons/pi';
|
|
5
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
6
|
+
export const CanvasMetaBar = memo(function CanvasMetaBar({ pageCount, currentPageIndex, zoom, onZoomChange, fullscreenTargetRef, minZoom = 0.25, maxZoom = 1.5, }) {
|
|
7
|
+
const t = useMessages();
|
|
8
|
+
const [isFullscreen, setIsFullscreen] = useState(false);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const handler = () => setIsFullscreen(Boolean(document.fullscreenElement));
|
|
11
|
+
document.addEventListener('fullscreenchange', handler);
|
|
12
|
+
return () => document.removeEventListener('fullscreenchange', handler);
|
|
13
|
+
}, []);
|
|
14
|
+
const handleFullscreen = useCallback(() => {
|
|
15
|
+
if (document.fullscreenElement) {
|
|
16
|
+
document.exitFullscreen().catch(() => { });
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const target = fullscreenTargetRef?.current ?? document.documentElement;
|
|
20
|
+
target.requestFullscreen?.().catch(() => { });
|
|
21
|
+
}, [fullscreenTargetRef]);
|
|
22
|
+
const zoomPercent = Math.round(zoom * 100);
|
|
23
|
+
const zoomBtn = 'size-6 rounded-md flex items-center justify-center text-[var(--editor-text-secondary)] hover:bg-[var(--editor-surface-hover)] hover:text-[var(--editor-active-fg)] transition-colors';
|
|
24
|
+
return (_jsxs("div", { className: "canvas-meta-bar flex items-center gap-2 px-2 py-1", children: [_jsx("button", { className: zoomBtn, onClick: () => onZoomChange(Math.max(minZoom, zoom - 0.1)), title: t.shell.zoomOut, "aria-label": t.shell.zoomOut, type: "button", children: _jsx(PiMagnifyingGlassMinus, { size: 14 }) }), _jsx("input", { type: "range", min: Math.round(minZoom * 100), max: Math.round(maxZoom * 100), step: 5, value: zoomPercent, onChange: (e) => onZoomChange(Number(e.currentTarget.value) / 100), className: "w-28 accent-[var(--editor-accent)] cursor-pointer", "aria-label": "Zoom" }), _jsx("button", { className: zoomBtn, onClick: () => onZoomChange(Math.min(maxZoom, zoom + 0.1)), title: t.shell.zoomIn, "aria-label": t.shell.zoomIn, type: "button", children: _jsx(PiMagnifyingGlassPlus, { size: 14 }) }), _jsxs("span", { className: "text-[11px] font-medium text-[var(--editor-text)] tabular-nums w-9 text-center select-none", children: [zoomPercent, "%"] }), _jsxs("span", { className: "flex items-center gap-1 px-1.5 py-0.5 rounded-md bg-[var(--editor-inset)] text-[11px] text-[var(--editor-text-secondary)] select-none", title: t.shell.pageOf(currentPageIndex + 1, pageCount), "aria-label": t.shell.pageOf(currentPageIndex + 1, pageCount), children: [_jsx(PiFile, { size: 11 }), currentPageIndex + 1, "/", pageCount] }), _jsx("button", { className: zoomBtn, onClick: handleFullscreen, title: isFullscreen ? t.shell.exitFullscreen : t.shell.fullscreen, "aria-label": t.shell.fullscreen, "aria-pressed": isFullscreen, type: "button", children: _jsx(PiArrowsOut, { size: 14 }) })] }));
|
|
25
|
+
});
|
|
26
|
+
/** Mobile: the zoom level, shown only while zoomed; tapping resets to 100 %. */
|
|
27
|
+
export function CanvasZoomIndicator({ zoom, onZoomChange, }) {
|
|
28
|
+
const t = useMessages();
|
|
29
|
+
const percent = Math.round(zoom * 100);
|
|
30
|
+
if (percent === 100)
|
|
31
|
+
return null;
|
|
32
|
+
return (_jsxs("button", { type: "button", onClick: () => onZoomChange(1), "aria-label": t.shell.zoomReset, className: "relative flex h-9 items-center gap-1.5 rounded-full border border-[var(--editor-border-soft)] bg-[var(--editor-surface)] px-3 text-xs font-medium tabular-nums text-[var(--editor-text)] shadow-[0_2px_8px_rgba(0,0,0,0.12)] active:bg-[var(--editor-surface-hover)] after:absolute after:-inset-1 after:content-['']", children: [percent, "%", _jsx(PiArrowCounterClockwise, { size: 14, "aria-hidden": true })] }));
|
|
33
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type RemoteSelector } from '@ggraphic/editor/components/RemoteSelectionOverlay';
|
|
3
|
+
import { type GeometryReporter } from '@ggraphic/editor/hooks/useGeometryReporter';
|
|
4
|
+
import { type CanvasRenderHandlers } from './kindRenderers.js';
|
|
5
|
+
import type { FullCanvasConfig, LayoutResult } from '../configs/types.js';
|
|
6
|
+
import type { CanvasItem } from '../utils/canvasLayerManager.js';
|
|
7
|
+
import type { SnapLine, SnapTarget } from '@ggraphic/editor/utils/snapping';
|
|
8
|
+
/**
|
|
9
|
+
* CanvasRenderLayer - Renders all canvas elements in layer order
|
|
10
|
+
*
|
|
11
|
+
* Maps over sortedRenderList and renders the appropriate component
|
|
12
|
+
* for each item type (element, icon, shape, illustration, text, host kinds).
|
|
13
|
+
*/
|
|
14
|
+
interface CanvasRenderLayerProps<TState extends Record<string, unknown> = Record<string, unknown>, TActions = Record<string, unknown>> {
|
|
15
|
+
sortedRenderList: CanvasItem[];
|
|
16
|
+
/** Lässt sich die ganze Auswahl drehen? Siehe `MultiSelectionTransformer`. */
|
|
17
|
+
canRotateSelection: () => boolean;
|
|
18
|
+
config: FullCanvasConfig<TState, TActions>;
|
|
19
|
+
state: TState;
|
|
20
|
+
layout: LayoutResult;
|
|
21
|
+
handlers: CanvasRenderHandlers;
|
|
22
|
+
getSnapTargets: (id: string) => SnapTarget[];
|
|
23
|
+
/** Traegt gerenderte Geometrie in die Snap-Ziel-Liste ein. */
|
|
24
|
+
registerGeometry: GeometryReporter;
|
|
25
|
+
handleSnapChange: (h: boolean, v: boolean) => void;
|
|
26
|
+
setSnapLines: (lines: SnapLine[]) => void;
|
|
27
|
+
stageWidth: number;
|
|
28
|
+
stageHeight: number;
|
|
29
|
+
isFontAvailable?: boolean;
|
|
30
|
+
/** elementId → remote collaborator currently selecting it (collab mode only). */
|
|
31
|
+
remoteSelections?: ReadonlyMap<string, RemoteSelector>;
|
|
32
|
+
/** The page being drawn, from 1; see `RenderCtx.pageNumber`. */
|
|
33
|
+
pageNumber?: number;
|
|
34
|
+
}
|
|
35
|
+
declare function CanvasRenderLayerInner<TState extends Record<string, unknown> = Record<string, unknown>, TActions = Record<string, unknown>>({ sortedRenderList, canRotateSelection, config: _config, state, layout, handlers, getSnapTargets, registerGeometry, handleSnapChange, setSnapLines, stageWidth, stageHeight, isFontAvailable, remoteSelections, pageNumber, }: CanvasRenderLayerProps<TState, TActions>): React.JSX.Element;
|
|
36
|
+
export declare const CanvasRenderLayer: typeof CanvasRenderLayerInner;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { Group } from 'react-konva';
|
|
5
|
+
import { CanvasItemLockContext } from '@ggraphic/editor/components/canvasItemLock';
|
|
6
|
+
import { MultiSelectionTransformer } from '@ggraphic/editor/components/MultiSelectionTransformer';
|
|
7
|
+
import { RemoteSelectionOverlay, } from '@ggraphic/editor/components/RemoteSelectionOverlay';
|
|
8
|
+
import { useCanvasStoreSelector } from '@ggraphic/editor/stores/CanvasStoreProvider';
|
|
9
|
+
import { CANVAS_ITEM_NAME } from '@ggraphic/editor/utils/deepSelect';
|
|
10
|
+
import { useIconSetsFor } from '../hooks/useIconSetsFor.js';
|
|
11
|
+
import { lockedIdsOf } from '../utils/layerLock.js';
|
|
12
|
+
import { GenericCanvasElement } from './GenericCanvasElement.js';
|
|
13
|
+
import { renderKindItem, } from './kindRenderers.js';
|
|
14
|
+
function CanvasRenderLayerInner({ sortedRenderList, canRotateSelection, config: _config, state, layout, handlers, getSnapTargets, registerGeometry, handleSnapChange, setSnapLines, stageWidth, stageHeight, isFontAvailable, remoteSelections, pageNumber, }) {
|
|
15
|
+
const croppingElement = useCanvasStoreSelector((s) => s.croppingElement);
|
|
16
|
+
const setCroppingElement = useCanvasStoreSelector((s) => s.setCroppingElement);
|
|
17
|
+
const cropAspect = useCanvasStoreSelector((s) => s.cropAspect);
|
|
18
|
+
const iconCarrier = state;
|
|
19
|
+
useIconSetsFor(iconCarrier.selectedIcons, iconCarrier.iconStates);
|
|
20
|
+
const renderCanvasItem = (item) => {
|
|
21
|
+
// Render Config Element
|
|
22
|
+
if (item.type === 'element') {
|
|
23
|
+
const elementConfig = item.data;
|
|
24
|
+
return (_jsx(GenericCanvasElement, { config: elementConfig, state: state, layout: layout, onSelect: handlers.handleElementSelect, onTextChange: handlers.handleTextChange, onFontSizeChange: handlers.handleFontSizeChange, onPositionChange: handlers.handleElementPositionChange, onGeometryChange: registerGeometry, onImageDragEnd: handlers.handleImageDragEnd, onImageTransformEnd: handlers.handleImageTransformEnd, onTemplateTransformEnd: handlers.handleTemplateTransformEnd, onSnapChange: handleSnapChange, onSnapLinesChange: setSnapLines, stageWidth: stageWidth, stageHeight: stageHeight, getSnapTargets: getSnapTargets }, elementConfig.id));
|
|
25
|
+
}
|
|
26
|
+
return renderKindItem(item, {
|
|
27
|
+
state,
|
|
28
|
+
handlers,
|
|
29
|
+
getSnapTargets,
|
|
30
|
+
registerGeometry,
|
|
31
|
+
handleSnapChange,
|
|
32
|
+
setSnapLines,
|
|
33
|
+
stageWidth,
|
|
34
|
+
stageHeight,
|
|
35
|
+
isFontAvailable,
|
|
36
|
+
croppingElement,
|
|
37
|
+
setCroppingElement,
|
|
38
|
+
cropAspect,
|
|
39
|
+
...(pageNumber === undefined ? {} : { pageNumber }),
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
const lockedIds = new Set(lockedIdsOf(state));
|
|
43
|
+
return (_jsxs(_Fragment, { children: [sortedRenderList.map((item) => {
|
|
44
|
+
const remote = remoteSelections?.get(item.id) ?? null;
|
|
45
|
+
const rendered = renderCanvasItem(item);
|
|
46
|
+
if (!rendered)
|
|
47
|
+
return null;
|
|
48
|
+
// Names the item for a ctrl/⌘-click that picks what lies beneath (useDeepSelect).
|
|
49
|
+
return (_jsx(Group, { name: CANVAS_ITEM_NAME, canvasItemId: item.id, children: _jsx(CanvasItemLockContext.Provider, { value: lockedIds.has(item.id), children: remote ? (_jsx(RemoteSelectionOverlay, { selector: remote, children: rendered })) : (rendered) }) }, item.id));
|
|
50
|
+
}), _jsx(MultiSelectionTransformer, { renderKey: sortedRenderList, canRotate: canRotateSelection, stageWidth: stageWidth, stageHeight: stageHeight })] }));
|
|
51
|
+
}
|
|
52
|
+
const MemoizedCanvasRenderLayer = memo(CanvasRenderLayerInner);
|
|
53
|
+
MemoizedCanvasRenderLayer.displayName = 'CanvasRenderLayer';
|
|
54
|
+
export const CanvasRenderLayer = MemoizedCanvasRenderLayer;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
import { type TextAccent, type TextMarker } from '../utils/textUtils.js';
|
|
3
|
+
import type { RichTextField } from './RichTextField.js';
|
|
4
|
+
import type { OfferedMarks, TextFormatControls } from './TextFormatControls.js';
|
|
5
|
+
import type { Editor } from '@tiptap/react';
|
|
6
|
+
import type Konva from 'konva';
|
|
7
|
+
export interface OverlayBox {
|
|
8
|
+
top: number;
|
|
9
|
+
left: number;
|
|
10
|
+
width: number;
|
|
11
|
+
minHeight: number;
|
|
12
|
+
scale: number;
|
|
13
|
+
/** Absolute Drehung des Knotens in Grad; der Editor dreht um seine linke obere Ecke mit. */
|
|
14
|
+
rotation: number;
|
|
15
|
+
}
|
|
16
|
+
export interface OverlayAnchor {
|
|
17
|
+
node: Konva.Node;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
}
|
|
21
|
+
/** Was ein Knoten mitgibt, wenn er bearbeitet werden will. */
|
|
22
|
+
export interface TextEditSession {
|
|
23
|
+
/** Element-Id — der Knoten blendet sich aus, solange er bearbeitet wird. */
|
|
24
|
+
id: string;
|
|
25
|
+
box: OverlayBox;
|
|
26
|
+
/** Knoten und Entwurfsmaße, aus denen `box` neu vermessen wird, sobald sich die Leinwand bewegt. */
|
|
27
|
+
anchor?: OverlayAnchor;
|
|
28
|
+
text: string;
|
|
29
|
+
/** CSS-Stapel des Feldes; entscheidet, welche Schnitte angeboten werden. */
|
|
30
|
+
fontFamily: string;
|
|
31
|
+
fontSize: number;
|
|
32
|
+
fontStyle: string;
|
|
33
|
+
fill: string;
|
|
34
|
+
align: CSSProperties['textAlign'];
|
|
35
|
+
lineHeight: number;
|
|
36
|
+
/** Laufweite in em, wie am Textfeld; fehlt sie, setzt der Editor keine. */
|
|
37
|
+
letterSpacing?: number;
|
|
38
|
+
/** Deckkraft des Feldes — die Kopfleiste stellt sie, also zeigt der Editor sie. */
|
|
39
|
+
opacity: number;
|
|
40
|
+
/** Stil der `==Akzent==`-Läufe; ohne ihn bietet der Editor keinen Akzent an. */
|
|
41
|
+
accent?: TextAccent | null;
|
|
42
|
+
/** Stil der `++Marker++`-Läufe; ohne ihn bietet der Editor keinen Marker an. */
|
|
43
|
+
marker?: TextMarker | null;
|
|
44
|
+
onTextChange?: (value: string) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Meldet den Entwurf bei jedem Tastendruck an den Wirt, der ihn vorab einpassen darf (Schrift,
|
|
47
|
+
* anliegende Platten), ohne etwas festzuhalten, und gibt die Schriftgröße zurück, die der
|
|
48
|
+
* Text beim Übernehmen bekommt (`null`: unverändert). `null` als Entwurf nimmt die Vorschau
|
|
49
|
+
* zurück — der Entwurf wurde ohne Änderung abgeschlossen.
|
|
50
|
+
*/
|
|
51
|
+
onTextPreview?: (draft: string | null) => number | null;
|
|
52
|
+
}
|
|
53
|
+
interface RichTextModules {
|
|
54
|
+
RichTextField: typeof RichTextField;
|
|
55
|
+
TextFormatControls: typeof TextFormatControls;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* tiptap samt ProseMirror (~360 KB) gehört nicht in den ersten Ladevorgang
|
|
59
|
+
* der Leinwand — gebraucht wird es erst beim Bearbeiten. Geladen wird es,
|
|
60
|
+
* sobald ein bearbeitbarer Text auf der Bühne steht: der Editor muss im
|
|
61
|
+
* Normalfall schon bereitliegen, wenn der Doppeltipp kommt. Erscheint er erst
|
|
62
|
+
* danach, liegt sein Fokus außerhalb der Geste, und iOS zeigt keine Tastatur.
|
|
63
|
+
*/
|
|
64
|
+
export declare function preloadRichText(): Promise<RichTextModules>;
|
|
65
|
+
/**
|
|
66
|
+
* Geometrie eines Knotens in Fensterkoordinaten — dieselbe Rechnung, die
|
|
67
|
+
* beide Renderer vorher je für sich anstellten.
|
|
68
|
+
*/
|
|
69
|
+
export declare function overlayBoxForNode(node: Konva.Node, width: number, height: number): OverlayBox | null;
|
|
70
|
+
/**
|
|
71
|
+
* Ruft ein Knoten auf, um den Editor zu öffnen. Ohne Provider passiert
|
|
72
|
+
* nichts — eine Bühne ohne Editor-Schicht ist eine reine Anzeige (die
|
|
73
|
+
* Vorschaubilder etwa), kein Fehler.
|
|
74
|
+
*/
|
|
75
|
+
export declare function useCanvasTextEditor(id: string | undefined, editable?: boolean): {
|
|
76
|
+
open: (session: TextEditSession | null) => void;
|
|
77
|
+
isEditing: boolean;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Für den Wirt der Formatierungsknöpfe (die Kontextleiste). Der Aufruf IST
|
|
81
|
+
* die Anmeldung: solange dieser Hook irgendwo im Baum hängt, lässt das
|
|
82
|
+
* Overlay seine eigene Karte weg — zwei Leisten für dieselbe Handlung wären
|
|
83
|
+
* eine zu viel, keine wäre eine zu wenig.
|
|
84
|
+
*
|
|
85
|
+
* Angemeldet wird unabhängig davon, ob gerade etwas bearbeitet wird. Sonst
|
|
86
|
+
* fiele die Anmeldung mit dem Öffnen der Sitzung zusammen und die Karte
|
|
87
|
+
* blitzte für einen Durchlauf auf. Die Kontextleiste steht ohnehin schon,
|
|
88
|
+
* wenn ein Element ausgewählt ist — und ausgewählt ist es, bevor der
|
|
89
|
+
* Doppelklick den Editor öffnet.
|
|
90
|
+
*
|
|
91
|
+
* Liefert `null`, solange nichts bearbeitet wird — und solange der Editor
|
|
92
|
+
* noch nachgeladen wird. Die Knöpfe kommen deshalb mit: `TextFormatControls`
|
|
93
|
+
* gehört zum nachgeladenen Teil und ist nur zusammen mit `editor` da.
|
|
94
|
+
*/
|
|
95
|
+
export declare function useCanvasTextFormatting(): {
|
|
96
|
+
editor: Editor;
|
|
97
|
+
marks: OfferedMarks;
|
|
98
|
+
editingId: string;
|
|
99
|
+
TextFormatControls: typeof TextFormatControls;
|
|
100
|
+
} | null;
|
|
101
|
+
/**
|
|
102
|
+
* Wird gerade ein Text bearbeitet? Meldet sich — anders als
|
|
103
|
+
* `useCanvasTextFormatting` — NICHT als Wirt an, die Karte bleibt also, wo sie ist.
|
|
104
|
+
*/
|
|
105
|
+
export declare function useIsCanvasTextEditing(): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Übernimmt einen offenen Textentwurf sofort — für Hosts, die gleich
|
|
108
|
+
* schließen (eingebettet: `CLOSE` an die App, #4397). Dort kommt kein Blur
|
|
109
|
+
* mehr: ein Tipp auf einen Knopf nimmt dem Text auf iOS den Fokus nicht.
|
|
110
|
+
*
|
|
111
|
+
* `flushSync`, weil freie Elemente erst aus einem Effekt im Dokument landen
|
|
112
|
+
* (`useEmitHostStateChanges`); bei einem synchronen Render laufen die Effekte
|
|
113
|
+
* noch vor der Rückkehr, das Update liegt danach also schon beim Provider.
|
|
114
|
+
* Deshalb nur aus Event-Handlern aufrufen, nicht aus Render oder Effekten.
|
|
115
|
+
*/
|
|
116
|
+
export declare function commitOpenTextEdit(): void;
|
|
117
|
+
/**
|
|
118
|
+
* Nestfest: liegt schon ein Provider darüber, reicht dieser seine Kinder
|
|
119
|
+
* unverändert durch. Die Prüfung MUSS hier stehen und nicht im Rumpf von
|
|
120
|
+
* `TextEditorRoot` — ein vorzeitiges `return` nach den Zustands-Hooks wäre
|
|
121
|
+
* ein bedingter Hook-Aufruf.
|
|
122
|
+
*/
|
|
123
|
+
export declare function CanvasTextEditorProvider({ children }: {
|
|
124
|
+
children: ReactNode;
|
|
125
|
+
}): import("react").JSX.Element;
|
|
126
|
+
export {};
|