@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,152 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import { CANVAS_ITEM_NAME } from '@ggraphic/editor/utils/deepSelect';
|
|
3
|
+
/** Konva node name of what the editor shows but no export contains. */
|
|
4
|
+
export const EXPORT_HIDDEN_NAME = 'export-hidden';
|
|
5
|
+
/**
|
|
6
|
+
* Runs `capture` with all selection chrome on the stage hidden — Konva
|
|
7
|
+
* Transformers plus the dashed selection Rects primitives render alongside
|
|
8
|
+
* them (tagged `name="selection-chrome"`). Callers don't have to mutate the
|
|
9
|
+
* user's selection (or wait for a deselect re-render) to get a clean shot;
|
|
10
|
+
* exactly the nodes that were hidden are restored.
|
|
11
|
+
*
|
|
12
|
+
* Nodes named `export-hidden` (the placeholder of an empty photo slot) are
|
|
13
|
+
* hidden too: every capture is an export unless it says it is a preview with
|
|
14
|
+
* `keepPlaceholders`.
|
|
15
|
+
*/
|
|
16
|
+
export function withSelectionChromeHidden(stage, capture, { keepPlaceholders = false } = {}) {
|
|
17
|
+
const hidden = stage
|
|
18
|
+
? [
|
|
19
|
+
...stage.find('Transformer'),
|
|
20
|
+
...stage.find('.selection-chrome'),
|
|
21
|
+
...(keepPlaceholders ? [] : stage.find(`.${EXPORT_HIDDEN_NAME}`)),
|
|
22
|
+
].filter((node) => node.visible())
|
|
23
|
+
: [];
|
|
24
|
+
if (hidden.length === 0 || !stage)
|
|
25
|
+
return capture();
|
|
26
|
+
hidden.forEach((node) => node.hide());
|
|
27
|
+
stage.draw();
|
|
28
|
+
try {
|
|
29
|
+
return capture();
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
hidden.forEach((node) => node.show());
|
|
33
|
+
stage.draw();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The one stage-image capture used by auto-save (debounced and unmount
|
|
38
|
+
* flush), the imperative captureCanvas/captureCanvasForAi handles, and any
|
|
39
|
+
* future export path. Never throws; returns null when the stage is gone
|
|
40
|
+
* (e.g. capture during teardown).
|
|
41
|
+
*
|
|
42
|
+
* Hiding the selection chrome is CanvasStage.toDataURL's job — every export
|
|
43
|
+
* goes through it, so wrapping again here would only be a no-op.
|
|
44
|
+
*/
|
|
45
|
+
export function captureStageImage(stageApi, options = {}) {
|
|
46
|
+
if (!stageApi)
|
|
47
|
+
return null;
|
|
48
|
+
try {
|
|
49
|
+
return stageApi.toDataURL({ format: 'png', pixelRatio: 2, ...options }) ?? null;
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* captureStageImage without the synchronous encode: the scene is rendered on
|
|
57
|
+
* the spot, the PNG is encoded off the main thread. For captures that nobody
|
|
58
|
+
* waits on frame-by-frame (gallery snapshots, share, multi-page export).
|
|
59
|
+
*/
|
|
60
|
+
export async function captureStageImageAsync(stageApi, options = {}) {
|
|
61
|
+
if (!stageApi)
|
|
62
|
+
return null;
|
|
63
|
+
try {
|
|
64
|
+
return await stageApi.toDataURLAsync({ format: 'png', pixelRatio: 2, ...options });
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* One element alone as PNG, for the PPTX export: the `canvas-item` group
|
|
72
|
+
* `CanvasRenderLayer` wraps around it, rendered over its axis-aligned box.
|
|
73
|
+
* Rotation, opacity and shadow are in the picture; the box comes back in
|
|
74
|
+
* page px (the stage is shown scaled). Null when no group carries the id
|
|
75
|
+
* or the canvas cannot be read (cross-origin image).
|
|
76
|
+
*/
|
|
77
|
+
export function rasterizeStageElement(stage, elementId, pixelRatio = 2) {
|
|
78
|
+
if (!stage)
|
|
79
|
+
return null;
|
|
80
|
+
const node = stage
|
|
81
|
+
.find(`.${CANVAS_ITEM_NAME}`)
|
|
82
|
+
.find((candidate) => candidate.getAttr('canvasItemId') === elementId);
|
|
83
|
+
if (!node || !node.isVisible())
|
|
84
|
+
return null;
|
|
85
|
+
// Absolut (inkl. Zoom und Verschiebung des Stage) für toDataURL, das in
|
|
86
|
+
// diesen Koordinaten schneidet; relativ zum Stage = Seiten-px für die Box.
|
|
87
|
+
const rect = node.getClientRect();
|
|
88
|
+
const box = node.getClientRect({ relativeTo: stage });
|
|
89
|
+
if (rect.width <= 0 || rect.height <= 0 || box.width <= 0)
|
|
90
|
+
return null;
|
|
91
|
+
const scale = rect.width / box.width;
|
|
92
|
+
let dataUrl;
|
|
93
|
+
try {
|
|
94
|
+
dataUrl = withSelectionChromeHidden(stage, () => node.toDataURL({ ...rect, pixelRatio: pixelRatio / scale, mimeType: 'image/png' }));
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
// Ein fremdes Bild ohne CORS macht die Leinwand „tainted“: toDataURL wirft
|
|
98
|
+
// SecurityError. Das Element fehlt dann im Export (der Writer meldet es),
|
|
99
|
+
// statt ihn abzubrechen.
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
dataUrl,
|
|
104
|
+
box: { x: box.x, y: box.y, width: box.width, height: box.height },
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/** A bullet or arrow glyph alone carries nothing a reader needs. */
|
|
108
|
+
const BULLET_ONLY = /^[•·●○▪■◦‣–—\-→➜➔►▶▸]+$/;
|
|
109
|
+
/**
|
|
110
|
+
* The texts a page shows, one entry per text element, roughly in reading
|
|
111
|
+
* order (top to bottom, then left to right). A rich text block draws one node
|
|
112
|
+
* per run; its runs are joined back into the block's text (the runs keep
|
|
113
|
+
* their spaces, so they join without a separator). Selection chrome
|
|
114
|
+
* and hidden nodes are skipped — the same view an export shows.
|
|
115
|
+
*/
|
|
116
|
+
export function visibleStageTexts(stage) {
|
|
117
|
+
if (!stage)
|
|
118
|
+
return [];
|
|
119
|
+
const blocks = new Map();
|
|
120
|
+
for (const node of stage.find('Text, TextPath')) {
|
|
121
|
+
if (!node.isVisible() || node.getAbsoluteOpacity() === 0)
|
|
122
|
+
continue;
|
|
123
|
+
if (node.findAncestor('Transformer') || node.findAncestor('.selection-chrome'))
|
|
124
|
+
continue;
|
|
125
|
+
const text = node.text().trim();
|
|
126
|
+
if (!text || BULLET_ONLY.test(text))
|
|
127
|
+
continue;
|
|
128
|
+
// A text element carries its own id; the runs of a rich text block, the
|
|
129
|
+
// lines of a host kind's group and a badge's label do not — their group does.
|
|
130
|
+
const parent = node.getParent();
|
|
131
|
+
const key = !node.id() && parent?.id() ? parent : node;
|
|
132
|
+
const runs = blocks.get(key) ?? [];
|
|
133
|
+
runs.push(node);
|
|
134
|
+
blocks.set(key, runs);
|
|
135
|
+
}
|
|
136
|
+
const byPosition = (a, b) => Math.abs(a.y - b.y) > 1 ? a.y - b.y : a.x - b.x;
|
|
137
|
+
return [...blocks.entries()]
|
|
138
|
+
.map(([block, runs]) => {
|
|
139
|
+
const text = runs
|
|
140
|
+
.map((run) => ({ ...run.position(), text: run.text() }))
|
|
141
|
+
.sort(byPosition)
|
|
142
|
+
.reduce((acc, run, i, all) => {
|
|
143
|
+
const sameLine = i > 0 && Math.abs(all[i - 1].y - run.y) <= 1;
|
|
144
|
+
return i === 0 ? run.text : acc + (sameLine ? '' : ' ') + run.text;
|
|
145
|
+
}, '')
|
|
146
|
+
.replace(/\s+/g, ' ')
|
|
147
|
+
.trim();
|
|
148
|
+
return { ...block.getClientRect({ relativeTo: stage }), text };
|
|
149
|
+
})
|
|
150
|
+
.sort(byPosition)
|
|
151
|
+
.map((block) => block.text);
|
|
152
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chart element's data shape. It lives in `@ggraphic/core`; this module hands it out under
|
|
3
|
+
* its old path, so types that name a chart (base state, layer list, lifted blocks) need not
|
|
4
|
+
* import `chartUtils.ts`, which reads the brand theme for its palettes.
|
|
5
|
+
*/
|
|
6
|
+
export { type ChartDataPoint, type ChartInstance, type ChartLegendPosition, type ChartSeries, type ChartType, } from '@ggraphic/core';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chart element — a first-class, editable canvas element.
|
|
3
|
+
*
|
|
4
|
+
* The `ChartInstance` (type + data + styling) is the serialized source of
|
|
5
|
+
* truth; ChartPrimitive renders it via Recharts into a Konva.Image, re-rendered
|
|
6
|
+
* whenever the instance changes. So the chart stays fully editable (through the
|
|
7
|
+
* ChartSettingsSection) while still exporting/collab-syncing like any element.
|
|
8
|
+
*/
|
|
9
|
+
import type { ChartInstance, ChartLegendPosition, ChartSeries, ChartType } from '@ggraphic/editor/utils/chartTypes';
|
|
10
|
+
export type { ChartDataPoint, ChartInstance, ChartLegendPosition, ChartSeries, ChartType, } from '@ggraphic/editor/utils/chartTypes';
|
|
11
|
+
export type ChartGroup = 'balken' | 'linien' | 'kreis';
|
|
12
|
+
export interface ChartTypeDef {
|
|
13
|
+
id: ChartType;
|
|
14
|
+
name: string;
|
|
15
|
+
tags: readonly string[];
|
|
16
|
+
group: ChartGroup;
|
|
17
|
+
}
|
|
18
|
+
export declare const CHART_GROUP_LABELS: Record<ChartGroup, string>;
|
|
19
|
+
export declare const CHART_GROUP_ORDER: readonly ChartGroup[];
|
|
20
|
+
export declare const CHART_TYPE_DEFS: readonly ChartTypeDef[];
|
|
21
|
+
/** The series a cartesian chart draws when it has several, else null. */
|
|
22
|
+
export declare function chartSeries(chart: Pick<ChartInstance, 'chartType' | 'series'>): ChartSeries[] | null;
|
|
23
|
+
export declare function chartLegendPosition(chart: Pick<ChartInstance, 'chartType' | 'legendPosition'>): ChartLegendPosition;
|
|
24
|
+
export declare function setChartValue(chart: Pick<ChartInstance, 'data' | 'series'>, row: number, seriesIndex: number, value: number): Pick<ChartInstance, 'data' | 'series'>;
|
|
25
|
+
export declare function addChartRow(chart: Pick<ChartInstance, 'data' | 'series'>, name: string): Pick<ChartInstance, 'data' | 'series'>;
|
|
26
|
+
export declare function removeChartRow(chart: Pick<ChartInstance, 'data' | 'series'>, row: number): Pick<ChartInstance, 'data' | 'series'>;
|
|
27
|
+
export declare function addChartSeries(chart: Pick<ChartInstance, 'data' | 'series'>): Pick<ChartInstance, 'data' | 'series'>;
|
|
28
|
+
export declare function removeChartSeries(chart: Pick<ChartInstance, 'data' | 'series'>, seriesIndex: number): Pick<ChartInstance, 'data' | 'series'>;
|
|
29
|
+
export declare function renameChartSeries(chart: Pick<ChartInstance, 'data' | 'series'>, seriesIndex: number, name: string): Pick<ChartInstance, 'data' | 'series'>;
|
|
30
|
+
/**
|
|
31
|
+
* Per series colour: an outline where the fill alone stays under 3:1 against
|
|
32
|
+
* the chart's background, else null. The outline is the chart's own colour
|
|
33
|
+
* that stands out most from the background, so it stays in the brand.
|
|
34
|
+
*/
|
|
35
|
+
export declare function chartSeriesOutlines(chart: Pick<ChartInstance, 'colors' | 'background'>): (string | null)[];
|
|
36
|
+
/** Labels, ticks and legend on a light or unknown ground. */
|
|
37
|
+
export declare const CHART_INK_DARK = "#40403f";
|
|
38
|
+
/**
|
|
39
|
+
* The colour of a chart's own text: white where the chart sits on a dark
|
|
40
|
+
* colour (`background`), else dark grey — the default when the ground is unknown.
|
|
41
|
+
*/
|
|
42
|
+
export declare function chartInk(chart: Pick<ChartInstance, 'background'>): string;
|
|
43
|
+
export declare const CHART_DEFAULT_WIDTH = 480;
|
|
44
|
+
export declare const CHART_DEFAULT_HEIGHT = 320;
|
|
45
|
+
/** The chart series of the active brand: what a new chart starts with. */
|
|
46
|
+
export declare const chartColors: () => readonly string[];
|
|
47
|
+
/** Round charts default to legend-on/grid-off; cartesian charts the inverse. */
|
|
48
|
+
export declare const isRoundChartType: (chartType: ChartType) => boolean;
|
|
49
|
+
export declare function createChartInstance(chartType: ChartType, canvasWidth: number, canvasHeight: number, colors?: readonly string[]): ChartInstance;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Chart element — a first-class, editable canvas element.
|
|
4
|
+
*
|
|
5
|
+
* The `ChartInstance` (type + data + styling) is the serialized source of
|
|
6
|
+
* truth; ChartPrimitive renders it via Recharts into a Konva.Image, re-rendered
|
|
7
|
+
* whenever the instance changes. So the chart stays fully editable (through the
|
|
8
|
+
* ChartSettingsSection) while still exporting/collab-syncing like any element.
|
|
9
|
+
*/
|
|
10
|
+
import { activeBrand } from '@ggraphic/editor/brand/brandRegistry';
|
|
11
|
+
import { messages } from '@ggraphic/editor/i18n/messages';
|
|
12
|
+
import { contrastRatio, luminance } from '@ggraphic/editor/utils/colorLuminance';
|
|
13
|
+
export const CHART_GROUP_LABELS = {
|
|
14
|
+
get balken() {
|
|
15
|
+
return messages().charts.groupBars;
|
|
16
|
+
},
|
|
17
|
+
get linien() {
|
|
18
|
+
return messages().charts.groupLines;
|
|
19
|
+
},
|
|
20
|
+
get kreis() {
|
|
21
|
+
return messages().charts.groupRound;
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export const CHART_GROUP_ORDER = ['balken', 'linien', 'kreis'];
|
|
25
|
+
export const CHART_TYPE_DEFS = [
|
|
26
|
+
{
|
|
27
|
+
id: 'bar',
|
|
28
|
+
get name() {
|
|
29
|
+
return messages().charts['bar'];
|
|
30
|
+
},
|
|
31
|
+
tags: ['diagramm', 'chart', 'säulen', 'saeulen', 'bar', 'balken', 'statistik'],
|
|
32
|
+
group: 'balken',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: 'bar-horizontal',
|
|
36
|
+
get name() {
|
|
37
|
+
return messages().charts['bar-horizontal'];
|
|
38
|
+
},
|
|
39
|
+
tags: ['diagramm', 'chart', 'balken', 'bar', 'horizontal', 'statistik'],
|
|
40
|
+
group: 'balken',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: 'line',
|
|
44
|
+
get name() {
|
|
45
|
+
return messages().charts['line'];
|
|
46
|
+
},
|
|
47
|
+
tags: ['diagramm', 'chart', 'linie', 'line', 'graph', 'verlauf', 'trend'],
|
|
48
|
+
group: 'linien',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 'area',
|
|
52
|
+
get name() {
|
|
53
|
+
return messages().charts['area'];
|
|
54
|
+
},
|
|
55
|
+
tags: ['diagramm', 'chart', 'fläche', 'flaeche', 'area', 'verlauf', 'trend'],
|
|
56
|
+
group: 'linien',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 'pie',
|
|
60
|
+
get name() {
|
|
61
|
+
return messages().charts['pie'];
|
|
62
|
+
},
|
|
63
|
+
tags: ['diagramm', 'chart', 'torte', 'kreis', 'pie', 'kuchen', 'anteil'],
|
|
64
|
+
group: 'kreis',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 'donut',
|
|
68
|
+
get name() {
|
|
69
|
+
return messages().charts['donut'];
|
|
70
|
+
},
|
|
71
|
+
tags: ['diagramm', 'chart', 'donut', 'ring', 'kreis', 'anteil'],
|
|
72
|
+
group: 'kreis',
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
/** The series a cartesian chart draws when it has several, else null. */
|
|
76
|
+
export function chartSeries(chart) {
|
|
77
|
+
if (isRoundChartType(chart.chartType))
|
|
78
|
+
return null;
|
|
79
|
+
return chart.series && chart.series.length > 1 ? chart.series : null;
|
|
80
|
+
}
|
|
81
|
+
export function chartLegendPosition(chart) {
|
|
82
|
+
return chart.legendPosition ?? (isRoundChartType(chart.chartType) ? 'right' : 'bottom');
|
|
83
|
+
}
|
|
84
|
+
/** The series the table edits: the stored ones, or the data as the only series. */
|
|
85
|
+
function seriesOf(chart) {
|
|
86
|
+
return chart.series && chart.series.length > 1
|
|
87
|
+
? chart.series
|
|
88
|
+
: [{ name: messages().defaults.series(1), values: chart.data.map((d) => d.value) }];
|
|
89
|
+
}
|
|
90
|
+
/** Stores the series and keeps `data[i].value` on the first one; one series is stored as none. */
|
|
91
|
+
function withSeries(names, series) {
|
|
92
|
+
return {
|
|
93
|
+
data: names.map((name, i) => ({ name, value: series[0]?.values[i] ?? 0 })),
|
|
94
|
+
series: series.length > 1 ? series : [],
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export function setChartValue(chart, row, seriesIndex, value) {
|
|
98
|
+
const series = seriesOf(chart).map((s, si) => si === seriesIndex ? { ...s, values: s.values.map((v, i) => (i === row ? value : v)) } : s);
|
|
99
|
+
return withSeries(chart.data.map((d) => d.name), series);
|
|
100
|
+
}
|
|
101
|
+
export function addChartRow(chart, name) {
|
|
102
|
+
return withSeries([...chart.data.map((d) => d.name), name], seriesOf(chart).map((s) => ({ ...s, values: [...s.values, 0] })));
|
|
103
|
+
}
|
|
104
|
+
export function removeChartRow(chart, row) {
|
|
105
|
+
return withSeries(chart.data.map((d) => d.name).filter((_, i) => i !== row), seriesOf(chart).map((s) => ({ ...s, values: s.values.filter((_, i) => i !== row) })));
|
|
106
|
+
}
|
|
107
|
+
export function addChartSeries(chart) {
|
|
108
|
+
const series = seriesOf(chart);
|
|
109
|
+
return withSeries(chart.data.map((d) => d.name), [
|
|
110
|
+
...series,
|
|
111
|
+
{ name: messages().defaults.series(series.length + 1), values: chart.data.map(() => 0) },
|
|
112
|
+
]);
|
|
113
|
+
}
|
|
114
|
+
export function removeChartSeries(chart, seriesIndex) {
|
|
115
|
+
return withSeries(chart.data.map((d) => d.name), seriesOf(chart).filter((_, si) => si !== seriesIndex));
|
|
116
|
+
}
|
|
117
|
+
export function renameChartSeries(chart, seriesIndex, name) {
|
|
118
|
+
return withSeries(chart.data.map((d) => d.name), seriesOf(chart).map((s, si) => (si === seriesIndex ? { ...s, name } : s)));
|
|
119
|
+
}
|
|
120
|
+
/** WCAG 1.4.11: a graphical object against its adjacent colour. */
|
|
121
|
+
const MIN_GRAPHIC_CONTRAST = 3;
|
|
122
|
+
/**
|
|
123
|
+
* Per series colour: an outline where the fill alone stays under 3:1 against
|
|
124
|
+
* the chart's background, else null. The outline is the chart's own colour
|
|
125
|
+
* that stands out most from the background, so it stays in the brand.
|
|
126
|
+
*/
|
|
127
|
+
export function chartSeriesOutlines(chart) {
|
|
128
|
+
const ground = chart.background ? luminance(chart.background) : null;
|
|
129
|
+
if (ground === null)
|
|
130
|
+
return chart.colors.map(() => null);
|
|
131
|
+
const ratios = chart.colors.map((color) => {
|
|
132
|
+
const lum = luminance(color);
|
|
133
|
+
return lum === null ? null : contrastRatio(lum, ground);
|
|
134
|
+
});
|
|
135
|
+
let outline = contrastRatio(0, ground) >= contrastRatio(1, ground) ? '#000000' : '#FFFFFF';
|
|
136
|
+
let best = MIN_GRAPHIC_CONTRAST;
|
|
137
|
+
ratios.forEach((ratio, i) => {
|
|
138
|
+
if (ratio !== null && ratio >= best) {
|
|
139
|
+
best = ratio;
|
|
140
|
+
outline = chart.colors[i];
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
return ratios.map((ratio) => (ratio !== null && ratio < MIN_GRAPHIC_CONTRAST ? outline : null));
|
|
144
|
+
}
|
|
145
|
+
/** Labels, ticks and legend on a light or unknown ground. */
|
|
146
|
+
export const CHART_INK_DARK = '#40403f';
|
|
147
|
+
/**
|
|
148
|
+
* The colour of a chart's own text: white where the chart sits on a dark
|
|
149
|
+
* colour (`background`), else dark grey — the default when the ground is unknown.
|
|
150
|
+
*/
|
|
151
|
+
export function chartInk(chart) {
|
|
152
|
+
const ground = chart.background ? luminance(chart.background) : null;
|
|
153
|
+
if (ground === null)
|
|
154
|
+
return CHART_INK_DARK;
|
|
155
|
+
return contrastRatio(1, ground) > contrastRatio(0, ground) ? '#FFFFFF' : CHART_INK_DARK;
|
|
156
|
+
}
|
|
157
|
+
export const CHART_DEFAULT_WIDTH = 480;
|
|
158
|
+
export const CHART_DEFAULT_HEIGHT = 320;
|
|
159
|
+
/** The chart series of the active brand: what a new chart starts with. */
|
|
160
|
+
export const chartColors = () => activeBrand().chart;
|
|
161
|
+
const DEFAULT_DATA = [
|
|
162
|
+
{ name: 'A', value: 40 },
|
|
163
|
+
{ name: 'B', value: 65 },
|
|
164
|
+
{ name: 'C', value: 30 },
|
|
165
|
+
{ name: 'D', value: 80 },
|
|
166
|
+
];
|
|
167
|
+
function makeId() {
|
|
168
|
+
return `chart-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
169
|
+
}
|
|
170
|
+
/** Round charts default to legend-on/grid-off; cartesian charts the inverse. */
|
|
171
|
+
export const isRoundChartType = (chartType) => chartType === 'pie' || chartType === 'donut';
|
|
172
|
+
export function createChartInstance(chartType, canvasWidth, canvasHeight, colors = chartColors()) {
|
|
173
|
+
const isRound = isRoundChartType(chartType);
|
|
174
|
+
return {
|
|
175
|
+
id: makeId(),
|
|
176
|
+
x: canvasWidth / 2 - CHART_DEFAULT_WIDTH / 2,
|
|
177
|
+
y: canvasHeight / 2 - CHART_DEFAULT_HEIGHT / 2,
|
|
178
|
+
width: CHART_DEFAULT_WIDTH,
|
|
179
|
+
height: CHART_DEFAULT_HEIGHT,
|
|
180
|
+
scale: 1,
|
|
181
|
+
rotation: 0,
|
|
182
|
+
opacity: 1,
|
|
183
|
+
chartType,
|
|
184
|
+
data: DEFAULT_DATA.map((d) => ({ ...d })),
|
|
185
|
+
colors: [...colors],
|
|
186
|
+
title: '',
|
|
187
|
+
showLegend: isRound,
|
|
188
|
+
showGrid: !isRound,
|
|
189
|
+
showValues: false,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Circle Badge Utilities
|
|
3
|
+
*
|
|
4
|
+
* Presets, types, and helper functions for the reusable circle badge element.
|
|
5
|
+
* A circle badge is a colored circle with multiple centered text lines,
|
|
6
|
+
* commonly used for date displays in event templates.
|
|
7
|
+
*/
|
|
8
|
+
import type { CircleBadgeInstance, CircleBadgeTextLine } from '../primitives/CircleBadge.js';
|
|
9
|
+
export type { CircleBadgeInstance, CircleBadgeTextLine };
|
|
10
|
+
export interface CircleBadgePreset {
|
|
11
|
+
radius: number;
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
textColor: string;
|
|
14
|
+
textLines: CircleBadgeTextLine[];
|
|
15
|
+
defaultX: number;
|
|
16
|
+
defaultY: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Generate a unique ID for circle badge instances
|
|
20
|
+
*/
|
|
21
|
+
export declare function generateCircleBadgeId(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Create a new circle badge instance from a preset
|
|
24
|
+
*
|
|
25
|
+
* @param presetId - The preset to use (e.g., 'default', 'default-inverted')
|
|
26
|
+
* @param overrides - Optional overrides for specific properties
|
|
27
|
+
*/
|
|
28
|
+
export declare function createCircleBadgeInstance(presetId?: string, overrides?: Partial<CircleBadgeInstance>): CircleBadgeInstance;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Circle Badge Utilities
|
|
4
|
+
*
|
|
5
|
+
* Presets, types, and helper functions for the reusable circle badge element.
|
|
6
|
+
* A circle badge is a colored circle with multiple centered text lines,
|
|
7
|
+
* commonly used for date displays in event templates.
|
|
8
|
+
*/
|
|
9
|
+
import { activeBrand } from '@ggraphic/editor/brand/brandRegistry';
|
|
10
|
+
import { messages } from '@ggraphic/editor/i18n/messages';
|
|
11
|
+
// ============================================================================
|
|
12
|
+
// PRESETS
|
|
13
|
+
// ============================================================================
|
|
14
|
+
/** The presets in the active brand's colours and headline font. */
|
|
15
|
+
function circleBadgePresets() {
|
|
16
|
+
const { colors, fonts } = activeBrand();
|
|
17
|
+
return {
|
|
18
|
+
default: {
|
|
19
|
+
radius: 80,
|
|
20
|
+
backgroundColor: colors.primary,
|
|
21
|
+
textColor: '#FFFFFF',
|
|
22
|
+
textLines: [
|
|
23
|
+
{
|
|
24
|
+
text: messages().common.text,
|
|
25
|
+
yOffset: 0,
|
|
26
|
+
fontFamily: fonts.headline,
|
|
27
|
+
fontSize: 32,
|
|
28
|
+
fontWeight: 'bold',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
defaultX: 200,
|
|
32
|
+
defaultY: 200,
|
|
33
|
+
},
|
|
34
|
+
'default-inverted': {
|
|
35
|
+
radius: 80,
|
|
36
|
+
backgroundColor: colors.surface,
|
|
37
|
+
textColor: colors.primary,
|
|
38
|
+
textLines: [
|
|
39
|
+
{
|
|
40
|
+
text: messages().common.text,
|
|
41
|
+
yOffset: 0,
|
|
42
|
+
fontFamily: fonts.headline,
|
|
43
|
+
fontSize: 32,
|
|
44
|
+
fontWeight: 'bold',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
defaultX: 200,
|
|
48
|
+
defaultY: 200,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
// ============================================================================
|
|
53
|
+
// UTILITY FUNCTIONS
|
|
54
|
+
// ============================================================================
|
|
55
|
+
let instanceCounter = 0;
|
|
56
|
+
/**
|
|
57
|
+
* Generate a unique ID for circle badge instances
|
|
58
|
+
*/
|
|
59
|
+
export function generateCircleBadgeId() {
|
|
60
|
+
instanceCounter += 1;
|
|
61
|
+
return `circle-badge-${Date.now()}-${instanceCounter}`;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Create a new circle badge instance from a preset
|
|
65
|
+
*
|
|
66
|
+
* @param presetId - The preset to use (e.g., 'default', 'default-inverted')
|
|
67
|
+
* @param overrides - Optional overrides for specific properties
|
|
68
|
+
*/
|
|
69
|
+
export function createCircleBadgeInstance(presetId = 'default', overrides = {}) {
|
|
70
|
+
const presets = circleBadgePresets();
|
|
71
|
+
const preset = presets[presetId] ?? presets.default;
|
|
72
|
+
return {
|
|
73
|
+
id: generateCircleBadgeId(),
|
|
74
|
+
x: preset.defaultX,
|
|
75
|
+
y: preset.defaultY,
|
|
76
|
+
radius: preset.radius,
|
|
77
|
+
backgroundColor: preset.backgroundColor,
|
|
78
|
+
textColor: preset.textColor,
|
|
79
|
+
rotation: 0,
|
|
80
|
+
scale: 1,
|
|
81
|
+
opacity: 1,
|
|
82
|
+
textLines: preset.textLines.map((line) => ({ ...line })),
|
|
83
|
+
...overrides,
|
|
84
|
+
};
|
|
85
|
+
}
|
package/dist/utils/cn.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { extendTailwindMerge } from 'tailwind-merge';
|
|
4
|
+
const customTwMerge = extendTailwindMerge({
|
|
5
|
+
extend: {
|
|
6
|
+
classGroups: {
|
|
7
|
+
'font-size': [{ text: ['xs', 'sm', 'base', 'lg', 'xl', '2xl'] }],
|
|
8
|
+
},
|
|
9
|
+
theme: {
|
|
10
|
+
spacing: [
|
|
11
|
+
'xxs',
|
|
12
|
+
'xs',
|
|
13
|
+
'sm',
|
|
14
|
+
'md',
|
|
15
|
+
'lg',
|
|
16
|
+
'xl',
|
|
17
|
+
'2xl',
|
|
18
|
+
'header',
|
|
19
|
+
'titlebar',
|
|
20
|
+
'sidebar-collapsed',
|
|
21
|
+
'sidebar-expanded',
|
|
22
|
+
],
|
|
23
|
+
color: [
|
|
24
|
+
'primary',
|
|
25
|
+
'secondary',
|
|
26
|
+
'grey',
|
|
27
|
+
'neutral',
|
|
28
|
+
'background',
|
|
29
|
+
'background-pure',
|
|
30
|
+
'background-alt',
|
|
31
|
+
'background-sand',
|
|
32
|
+
'foreground',
|
|
33
|
+
'foreground-heading',
|
|
34
|
+
'link',
|
|
35
|
+
'error',
|
|
36
|
+
'accent',
|
|
37
|
+
'disabled',
|
|
38
|
+
'button-bg',
|
|
39
|
+
'button-text',
|
|
40
|
+
'button-hover',
|
|
41
|
+
'input-bg',
|
|
42
|
+
'input-text',
|
|
43
|
+
'input-placeholder',
|
|
44
|
+
'text-green',
|
|
45
|
+
'overlay-sm',
|
|
46
|
+
'overlay-md',
|
|
47
|
+
'overlay-lg',
|
|
48
|
+
'hover-alt',
|
|
49
|
+
],
|
|
50
|
+
radius: ['sm', 'md', 'lg'],
|
|
51
|
+
shadow: [
|
|
52
|
+
'sm',
|
|
53
|
+
'md',
|
|
54
|
+
'lg',
|
|
55
|
+
'xl',
|
|
56
|
+
'card-subtle',
|
|
57
|
+
'card-elevated',
|
|
58
|
+
'card-floating',
|
|
59
|
+
'card-dramatic',
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
export function cn(...inputs) {
|
|
65
|
+
return customTwMerge(clsx(inputs));
|
|
66
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type AltTextPage } from '@ggraphic/editor/CanvasEditorProvider';
|
|
2
|
+
import { type GenericCanvasRef } from '@ggraphic/editor/components/GenericCanvas';
|
|
3
|
+
/** Check every requested page before reporting capture failures, as for multi-page export. */
|
|
4
|
+
export declare function collectAltTextPages(refs: ReadonlyArray<{
|
|
5
|
+
current: Pick<GenericCanvasRef, 'captureCanvasForAi' | 'getVisibleTexts'> | null;
|
|
6
|
+
}>, indices: readonly number[]): Promise<AltTextPage[]>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import { messages } from '@ggraphic/editor/i18n/messages';
|
|
3
|
+
/** Check every requested page before reporting capture failures, as for multi-page export. */
|
|
4
|
+
export async function collectAltTextPages(refs, indices) {
|
|
5
|
+
const pages = [];
|
|
6
|
+
const failedPages = [];
|
|
7
|
+
for (const index of indices) {
|
|
8
|
+
const ref = refs[index]?.current;
|
|
9
|
+
const image = ref ? await ref.captureCanvasForAi() : null;
|
|
10
|
+
if (!ref || !image) {
|
|
11
|
+
failedPages.push(index + 1);
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
pages.push({ pageNumber: index + 1, image, texts: ref.getVisibleTexts() });
|
|
15
|
+
}
|
|
16
|
+
if (failedPages.length > 0) {
|
|
17
|
+
throw new Error(messages().errors.pagesCapture(failedPages.join(', ')));
|
|
18
|
+
}
|
|
19
|
+
return pages;
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/** WCAG relative luminance of a `#rgb`/`#rrggbb` colour; null for anything else. */
|
|
3
|
+
export function luminance(color) {
|
|
4
|
+
const hex = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(color.trim())?.[1];
|
|
5
|
+
if (!hex)
|
|
6
|
+
return null;
|
|
7
|
+
const full = hex.length === 3 ? [...hex].map((c) => c + c).join('') : hex;
|
|
8
|
+
const [r, g, b] = [0, 2, 4].map((i) => {
|
|
9
|
+
const c = parseInt(full.slice(i, i + 2), 16) / 255;
|
|
10
|
+
return c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
11
|
+
});
|
|
12
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
13
|
+
}
|
|
14
|
+
export const contrastRatio = (a, b) => (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import { messages } from '@ggraphic/editor/i18n/messages';
|
|
3
|
+
import { brandColors } from '@ggraphic/editor/utils/colorOptions';
|
|
4
|
+
/** Name of a brand colour, otherwise "Farbe #RRGGBB" (catalogue) — for swatch `aria-label`s. */
|
|
5
|
+
export function colorName(hex) {
|
|
6
|
+
const brand = brandColors().find((c) => c.value.toLowerCase() === hex.toLowerCase());
|
|
7
|
+
return brand ? brand.name : messages().common.colorHex(hex.toUpperCase());
|
|
8
|
+
}
|