@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,612 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Seitenzustand einer Präsentation → PPTX-Modell (`types.ts`). Rein: kein
|
|
4
|
+
* pptxgenjs, kein Konva, kein React. Was nativ in PowerPoint geht (Farbe,
|
|
5
|
+
* Text, einfache Formen, Bilder ohne Bearbeitung, Diagramme), wird nativ;
|
|
6
|
+
* alles andere wird eine Raster-Anfrage, die der Writer vom Stage holt — nie
|
|
7
|
+
* still weggelassen.
|
|
8
|
+
*
|
|
9
|
+
* Gezeichnet wird wie `buildCanvasItems` + `buildSortedRenderList`: erst die
|
|
10
|
+
* Ids in `layerOrder`, dann der Rest in der Standardreihenfolge der Arten.
|
|
11
|
+
*/
|
|
12
|
+
import { carryInstanceState } from '@ggraphic/editor/configs/factory/carryInstanceState';
|
|
13
|
+
import { ASSET_TARGET_SIZE } from '@ggraphic/editor/utils/canvasAssets';
|
|
14
|
+
import { fromHostKinds, hostElementKinds, kindList } from '@ggraphic/editor/utils/elementKinds';
|
|
15
|
+
import { chartInk, chartLegendPosition, chartSeries, isRoundChartType, } from '@ggraphic/editor/utils/chartUtils';
|
|
16
|
+
import { ICON_TARGET_SIZE, ILLUSTRATION_TARGET_SIZE } from '@ggraphic/editor/utils/motifSizes';
|
|
17
|
+
import { shownText } from '../../utils/pageCounter.js';
|
|
18
|
+
import { photoStripBeside } from '@ggraphic/editor/utils/shapes';
|
|
19
|
+
import { hasCorners } from '@ggraphic/editor/utils/cornerRadius';
|
|
20
|
+
import { bubbleExtent, tailOf } from '../../utils/shapeDevices.js';
|
|
21
|
+
import { backgroundStraighten } from '@ggraphic/editor/utils/straighten';
|
|
22
|
+
import { konvaFontStyle } from '@ggraphic/editor/utils/textUtils';
|
|
23
|
+
import { estimateMeasure, textParagraphs, wrappedLineCount, } from './textModel.js';
|
|
24
|
+
/** Schlüssel, die `buildPptxModel` liest. */
|
|
25
|
+
export const PPTX_MAPPED_PAGE_KEYS = [
|
|
26
|
+
'backgroundMode',
|
|
27
|
+
'backgroundColor',
|
|
28
|
+
'currentImageSrc',
|
|
29
|
+
'hasBackgroundImage',
|
|
30
|
+
'imageOffset',
|
|
31
|
+
'imageScale',
|
|
32
|
+
'backgroundImageOpacity',
|
|
33
|
+
'backgroundImageAdjustments',
|
|
34
|
+
'backgroundImageRotation',
|
|
35
|
+
'additionalTexts',
|
|
36
|
+
'shapeInstances',
|
|
37
|
+
'pillBadgeInstances',
|
|
38
|
+
'circleBadgeInstances',
|
|
39
|
+
'chartInstances',
|
|
40
|
+
'userImageInstances',
|
|
41
|
+
'assetInstances',
|
|
42
|
+
'illustrationInstances',
|
|
43
|
+
'frameInstances',
|
|
44
|
+
'selectedIcons',
|
|
45
|
+
'iconStates',
|
|
46
|
+
'layerOrder',
|
|
47
|
+
'notes',
|
|
48
|
+
];
|
|
49
|
+
/**
|
|
50
|
+
* Schlüssel, die bewusst nicht in die Folie gehen. Ein Schlüssel, der in
|
|
51
|
+
* keiner der beiden Listen steht, landet in `unknownKeys` der Folie — eine
|
|
52
|
+
* neue Elementart ist so eine sichtbare Lücke, kein stiller Verlust.
|
|
53
|
+
*/
|
|
54
|
+
export const PPTX_UNMAPPED_PAGE_KEYS = {
|
|
55
|
+
isDesktop: 'Editor-Zustand',
|
|
56
|
+
backgroundImageFile: 'Blob des Hintergrundbilds; gezeichnet wird `currentImageSrc`',
|
|
57
|
+
imageAttribution: 'Bildnachweis; steht nicht auf der Fläche',
|
|
58
|
+
stashedComposerPlanes: 'abgelegte Composer-Flächen; nicht gezeichnet',
|
|
59
|
+
lockedLayerIds: 'Sperre im Editor',
|
|
60
|
+
templateRotations: 'Drehung der Vorlagen-Elemente; die gehen nicht in die Folie',
|
|
61
|
+
templateTextAligns: 'Ausrichtung der Vorlagen-Texte; die gehen nicht in die Folie',
|
|
62
|
+
// Markenbindung (F0): die Werte stehen schon in den Elementen, die Bindung nur im Editor.
|
|
63
|
+
bind: 'Markenbindung der Felder; die Werte sind schon aufgelöst',
|
|
64
|
+
brandScheme: 'Farbwelt der Marke; die Farben sind schon aufgelöst',
|
|
65
|
+
brandStamp: 'Stempel der Markenbindung; nur für den Abgleich im Editor',
|
|
66
|
+
// Vorlagen-Herkunft und Gruppen (F0).
|
|
67
|
+
templateRef: 'origin of the page; nothing to draw',
|
|
68
|
+
groups: 'element groups; members are exported one by one',
|
|
69
|
+
};
|
|
70
|
+
const KNOWN_KEYS = new Set([
|
|
71
|
+
...PPTX_MAPPED_PAGE_KEYS,
|
|
72
|
+
...Object.keys(PPTX_UNMAPPED_PAGE_KEYS),
|
|
73
|
+
]);
|
|
74
|
+
/** The lists of the host kinds that go onto the slide (`registerElementKind` with `pptx`). */
|
|
75
|
+
const hostPptxKeys = fromHostKinds((kinds) => new Set(kinds.filter((kind) => kind.pptx).map((kind) => kind.stateKey)));
|
|
76
|
+
/** The mapped page keys, the host kinds' lists included. */
|
|
77
|
+
export function pptxMappedPageKeys() {
|
|
78
|
+
return [...PPTX_MAPPED_PAGE_KEYS, ...hostPptxKeys()];
|
|
79
|
+
}
|
|
80
|
+
/** Formen, die PowerPoint selbst zeichnet; alle anderen werden gerastert. */
|
|
81
|
+
const NATIVE_SHAPES = {
|
|
82
|
+
rect: 'rect',
|
|
83
|
+
'rounded-rect': 'roundRect',
|
|
84
|
+
circle: 'ellipse',
|
|
85
|
+
ellipse: 'ellipse',
|
|
86
|
+
triangle: 'triangle',
|
|
87
|
+
star: 'star5',
|
|
88
|
+
};
|
|
89
|
+
const NATIVE_CHARTS = {
|
|
90
|
+
bar: { chartType: 'bar', barDir: 'col' },
|
|
91
|
+
'bar-horizontal': { chartType: 'bar', barDir: 'bar' },
|
|
92
|
+
line: { chartType: 'line', barDir: null },
|
|
93
|
+
area: { chartType: 'area', barDir: null },
|
|
94
|
+
pie: { chartType: 'pie', barDir: null },
|
|
95
|
+
donut: { chartType: 'doughnut', barDir: null },
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Eine Box im lokalen Raum eines Konva-Knotens (Ursprung `origin`, gedreht um
|
|
99
|
+
* den Ursprung, skaliert) → ungedrehte Seitenbox, die um ihre Mitte gedreht
|
|
100
|
+
* genau dort liegt.
|
|
101
|
+
*/
|
|
102
|
+
function place(origin, rotation, scaleX, scaleY, local) {
|
|
103
|
+
const cx = (local.x + local.width / 2) * scaleX;
|
|
104
|
+
const cy = (local.y + local.height / 2) * scaleY;
|
|
105
|
+
const rad = (rotation * Math.PI) / 180;
|
|
106
|
+
const centerX = origin.x + cx * Math.cos(rad) - cy * Math.sin(rad);
|
|
107
|
+
const centerY = origin.y + cx * Math.sin(rad) + cy * Math.cos(rad);
|
|
108
|
+
const width = local.width * scaleX;
|
|
109
|
+
const height = local.height * scaleY;
|
|
110
|
+
return {
|
|
111
|
+
box: { x: centerX - width / 2, y: centerY - height / 2, width, height },
|
|
112
|
+
rotation,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function raster(elementId, placement, reason, boxExact = true) {
|
|
116
|
+
return { kind: 'raster', elementId, ...placement, reason, boxExact };
|
|
117
|
+
}
|
|
118
|
+
function shadowOf(source) {
|
|
119
|
+
if (!source.shadowColor)
|
|
120
|
+
return null;
|
|
121
|
+
return {
|
|
122
|
+
color: source.shadowColor,
|
|
123
|
+
blur: source.shadowBlur ?? 0,
|
|
124
|
+
offsetX: source.shadowOffsetX ?? 0,
|
|
125
|
+
offsetY: source.shadowOffsetY ?? 0,
|
|
126
|
+
opacity: source.shadowOpacity ?? 1,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
// ============================================================================
|
|
130
|
+
// ELEMENT MAPPERS
|
|
131
|
+
// ============================================================================
|
|
132
|
+
/** Lokale Box einer Form um ihren Ankerpunkt (Konva zentriert alle Formen). */
|
|
133
|
+
function shapeLocalBox(shape) {
|
|
134
|
+
const r = shape.width / 2;
|
|
135
|
+
switch (shape.type) {
|
|
136
|
+
case 'circle':
|
|
137
|
+
return { x: -r, y: -r, width: 2 * r, height: 2 * r };
|
|
138
|
+
case 'triangle': {
|
|
139
|
+
// RegularPolygon: Umkreis r, Spitze oben.
|
|
140
|
+
const half = (r * Math.sqrt(3)) / 2;
|
|
141
|
+
return { x: -half, y: -r, width: 2 * half, height: 1.5 * r };
|
|
142
|
+
}
|
|
143
|
+
case 'star': {
|
|
144
|
+
const half = r * Math.sin((72 * Math.PI) / 180);
|
|
145
|
+
return { x: -half, y: -r, width: 2 * half, height: r + r * Math.cos((36 * Math.PI) / 180) };
|
|
146
|
+
}
|
|
147
|
+
default: {
|
|
148
|
+
const flat = {
|
|
149
|
+
x: -shape.width / 2,
|
|
150
|
+
y: -shape.height / 2,
|
|
151
|
+
width: shape.width,
|
|
152
|
+
height: shape.height,
|
|
153
|
+
};
|
|
154
|
+
// A speech bubble's tail lies outside width × height; a bent arrow's curve off its flat box.
|
|
155
|
+
const tail = tailOf(shape);
|
|
156
|
+
if (tail) {
|
|
157
|
+
const out = bubbleExtent(shape.width, shape.height, tail);
|
|
158
|
+
return { x: flat.x + out.x, y: flat.y + out.y, width: out.width, height: out.height };
|
|
159
|
+
}
|
|
160
|
+
if (shape.type === 'line-arrow' && shape.bend) {
|
|
161
|
+
const stroke = shape.strokeWidth ?? 6;
|
|
162
|
+
const sag = shape.bend * shape.width * 1.1;
|
|
163
|
+
const pad = Math.max(16, stroke * 2.5) / 2 + stroke / 2;
|
|
164
|
+
const top = Math.min(flat.y, Math.min(0, sag) - pad);
|
|
165
|
+
const bottom = Math.max(flat.y + flat.height, Math.max(0, sag) + pad);
|
|
166
|
+
return { ...flat, y: top, height: bottom - top };
|
|
167
|
+
}
|
|
168
|
+
return flat;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function mapShape(shape) {
|
|
173
|
+
const placement = place(shape, shape.rotation ?? 0, shape.scaleX ?? 1, shape.scaleY ?? 1, shapeLocalBox(shape));
|
|
174
|
+
const native = NATIVE_SHAPES[shape.type];
|
|
175
|
+
if (!native)
|
|
176
|
+
return raster(shape.id, placement, 'shape-path');
|
|
177
|
+
// A native pptx shape can't carry the mirror the stage draws; the raster does.
|
|
178
|
+
if (shape.flipX || shape.flipY)
|
|
179
|
+
return raster(shape.id, placement, 'shape-flipped');
|
|
180
|
+
if (shape.fillGradient ||
|
|
181
|
+
shape.shade ||
|
|
182
|
+
shape.blendMode ||
|
|
183
|
+
shape.notch ||
|
|
184
|
+
shape.glow ||
|
|
185
|
+
(shape.grain ?? 0) > 0 ||
|
|
186
|
+
shape.pattern ||
|
|
187
|
+
// The tail is part of the outline, which a native roundRect cannot carry.
|
|
188
|
+
tailOf(shape) ||
|
|
189
|
+
// pptx rounds every corner of a roundRect the same.
|
|
190
|
+
Array.isArray(shape.cornerRadius)) {
|
|
191
|
+
return raster(shape.id, placement, 'shape-styled');
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
kind: 'shape',
|
|
195
|
+
id: shape.id,
|
|
196
|
+
...placement,
|
|
197
|
+
opacity: shape.opacity ?? 1,
|
|
198
|
+
shape: native,
|
|
199
|
+
fill: shape.fill,
|
|
200
|
+
rectRadius: native === 'roundRect'
|
|
201
|
+
? Math.min(typeof shape.cornerRadius === 'number' ? shape.cornerRadius : 32, placement.box.width / 2, placement.box.height / 2)
|
|
202
|
+
: null,
|
|
203
|
+
shadow: shadowOf(shape),
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
function mapText(authored, measure, pageNumber) {
|
|
207
|
+
// A page counter is the number of its slide.
|
|
208
|
+
const text = { ...authored, text: shownText(authored, pageNumber) };
|
|
209
|
+
const scale = text.scale || 1;
|
|
210
|
+
const lineHeight = text.lineHeight ?? 1.2;
|
|
211
|
+
const paragraphs = textParagraphs(text);
|
|
212
|
+
const style = text.fontStyle ?? 'normal';
|
|
213
|
+
const bold = text.fontWeight !== undefined ? text.fontWeight >= 600 : style.includes('bold');
|
|
214
|
+
const lines = wrappedLineCount(paragraphs, text.width, text.fontSize, text.fontFamily, konvaFontStyle(style, text.fontWeight), measure);
|
|
215
|
+
const local = { x: 0, y: 0, width: text.width, height: lines * text.fontSize * lineHeight };
|
|
216
|
+
const placement = place(text, text.rotation || 0, scale, scale, local);
|
|
217
|
+
if (text.fillGradient)
|
|
218
|
+
return raster(text.id, placement, 'text-gradient');
|
|
219
|
+
return {
|
|
220
|
+
kind: 'text',
|
|
221
|
+
id: text.id,
|
|
222
|
+
...placement,
|
|
223
|
+
opacity: text.opacity ?? 1,
|
|
224
|
+
paragraphs,
|
|
225
|
+
fontFace: text.fontFamily,
|
|
226
|
+
fontSize: text.fontSize * scale,
|
|
227
|
+
color: text.fill,
|
|
228
|
+
bold,
|
|
229
|
+
italic: style.includes('italic'),
|
|
230
|
+
letterSpacing: text.letterSpacing ?? 0,
|
|
231
|
+
strikethrough: text.strikethrough === true,
|
|
232
|
+
align: text.align ?? 'left',
|
|
233
|
+
valign: 'top',
|
|
234
|
+
lineHeight,
|
|
235
|
+
outline: text.stroke && (text.strokeWidth ?? 0) > 0
|
|
236
|
+
? { color: text.stroke, width: text.strokeWidth * scale }
|
|
237
|
+
: null,
|
|
238
|
+
shadow: shadowOf(text),
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
/** Pille: abgerundetes Rechteck plus zentrierter Text, beide in der Pillenbox. */
|
|
242
|
+
function mapPill(pill, measure) {
|
|
243
|
+
const textWidth = measure(pill.text, pill.fontSize, pill.fontFamily, pill.fontStyle);
|
|
244
|
+
const local = {
|
|
245
|
+
x: 0,
|
|
246
|
+
y: 0,
|
|
247
|
+
width: textWidth + pill.paddingX * 2,
|
|
248
|
+
height: pill.fontSize + pill.paddingY * 2,
|
|
249
|
+
};
|
|
250
|
+
const scale = pill.scale || 1;
|
|
251
|
+
const placement = place(pill, pill.rotation || 0, scale, scale, local);
|
|
252
|
+
const opacity = pill.opacity ?? 1;
|
|
253
|
+
const style = pill.fontStyle ?? 'normal';
|
|
254
|
+
return [
|
|
255
|
+
{
|
|
256
|
+
kind: 'shape',
|
|
257
|
+
id: pill.id,
|
|
258
|
+
...placement,
|
|
259
|
+
opacity,
|
|
260
|
+
shape: 'roundRect',
|
|
261
|
+
fill: pill.backgroundColor,
|
|
262
|
+
rectRadius: Math.min(pill.cornerRadius * scale, placement.box.width / 2, placement.box.height / 2),
|
|
263
|
+
shadow: null,
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
kind: 'text',
|
|
267
|
+
id: `${pill.id}#text`,
|
|
268
|
+
...placement,
|
|
269
|
+
opacity,
|
|
270
|
+
paragraphs: [
|
|
271
|
+
{
|
|
272
|
+
runs: [
|
|
273
|
+
{
|
|
274
|
+
text: pill.text,
|
|
275
|
+
bold: false,
|
|
276
|
+
italic: false,
|
|
277
|
+
underline: false,
|
|
278
|
+
color: pill.textColor,
|
|
279
|
+
highlight: null,
|
|
280
|
+
fontFace: null,
|
|
281
|
+
},
|
|
282
|
+
],
|
|
283
|
+
bullet: null,
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
fontFace: pill.fontFamily,
|
|
287
|
+
fontSize: pill.fontSize * scale,
|
|
288
|
+
color: pill.textColor,
|
|
289
|
+
bold: style.includes('bold'),
|
|
290
|
+
italic: style.includes('italic'),
|
|
291
|
+
letterSpacing: 0,
|
|
292
|
+
strikethrough: false,
|
|
293
|
+
align: 'center',
|
|
294
|
+
valign: 'middle',
|
|
295
|
+
lineHeight: 1,
|
|
296
|
+
outline: null,
|
|
297
|
+
shadow: null,
|
|
298
|
+
},
|
|
299
|
+
];
|
|
300
|
+
}
|
|
301
|
+
/** Kreis-Badge: Kreis plus eine Textbox je Zeile, wie `CircleBadge` sie setzt. */
|
|
302
|
+
function mapCircleBadge(badge) {
|
|
303
|
+
const scale = badge.scale || 1;
|
|
304
|
+
const rotation = badge.rotation || 0;
|
|
305
|
+
const opacity = badge.opacity ?? 1;
|
|
306
|
+
const r = badge.radius;
|
|
307
|
+
const items = [
|
|
308
|
+
{
|
|
309
|
+
kind: 'shape',
|
|
310
|
+
id: badge.id,
|
|
311
|
+
...place(badge, rotation, scale, scale, { x: -r, y: -r, width: 2 * r, height: 2 * r }),
|
|
312
|
+
opacity,
|
|
313
|
+
shape: 'ellipse',
|
|
314
|
+
fill: badge.backgroundColor,
|
|
315
|
+
rectRadius: null,
|
|
316
|
+
shadow: null,
|
|
317
|
+
},
|
|
318
|
+
];
|
|
319
|
+
badge.textLines.forEach((line, index) => {
|
|
320
|
+
const local = {
|
|
321
|
+
x: -r,
|
|
322
|
+
y: line.yOffset - line.fontSize / 2,
|
|
323
|
+
width: 2 * r,
|
|
324
|
+
height: line.fontSize,
|
|
325
|
+
};
|
|
326
|
+
items.push({
|
|
327
|
+
kind: 'text',
|
|
328
|
+
id: `${badge.id}#line-${index}`,
|
|
329
|
+
...place(badge, rotation, scale, scale, local),
|
|
330
|
+
opacity,
|
|
331
|
+
paragraphs: [
|
|
332
|
+
{
|
|
333
|
+
runs: [
|
|
334
|
+
{
|
|
335
|
+
text: line.text,
|
|
336
|
+
bold: false,
|
|
337
|
+
italic: false,
|
|
338
|
+
underline: false,
|
|
339
|
+
color: badge.textColor,
|
|
340
|
+
highlight: null,
|
|
341
|
+
fontFace: null,
|
|
342
|
+
},
|
|
343
|
+
],
|
|
344
|
+
bullet: null,
|
|
345
|
+
},
|
|
346
|
+
],
|
|
347
|
+
fontFace: line.fontFamily,
|
|
348
|
+
fontSize: line.fontSize * scale,
|
|
349
|
+
color: badge.textColor,
|
|
350
|
+
bold: line.fontWeight === 'bold',
|
|
351
|
+
italic: false,
|
|
352
|
+
letterSpacing: 0,
|
|
353
|
+
strikethrough: false,
|
|
354
|
+
align: 'center',
|
|
355
|
+
valign: 'top',
|
|
356
|
+
lineHeight: 1,
|
|
357
|
+
outline: null,
|
|
358
|
+
shadow: null,
|
|
359
|
+
});
|
|
360
|
+
});
|
|
361
|
+
return items;
|
|
362
|
+
}
|
|
363
|
+
/** Eine Bildbearbeitung, die PowerPoint nicht nachbauen kann. */
|
|
364
|
+
function isAdjusted(image) {
|
|
365
|
+
return (!!image.blur ||
|
|
366
|
+
!!image.brightness ||
|
|
367
|
+
!!image.contrast ||
|
|
368
|
+
!!image.saturation ||
|
|
369
|
+
!!image.hue ||
|
|
370
|
+
!!image.temperature ||
|
|
371
|
+
!!image.grayscale ||
|
|
372
|
+
!!image.sepia ||
|
|
373
|
+
!!image.invert ||
|
|
374
|
+
!!image.tint ||
|
|
375
|
+
(!!image.duotoneLow && !!image.duotoneHigh) ||
|
|
376
|
+
!!image.vignette ||
|
|
377
|
+
!!image.flipX ||
|
|
378
|
+
!!image.flipY);
|
|
379
|
+
}
|
|
380
|
+
function mapUserImage(image) {
|
|
381
|
+
const scale = image.scale || 1;
|
|
382
|
+
const placement = place(image, image.rotation || 0, scale, scale, {
|
|
383
|
+
x: 0,
|
|
384
|
+
y: 0,
|
|
385
|
+
width: image.width,
|
|
386
|
+
height: image.height,
|
|
387
|
+
});
|
|
388
|
+
// PPTX kann ein im Rahmen gedrehtes Foto nicht ausdrücken: begradigt wird gerastert.
|
|
389
|
+
const movedCrop = image.fit === 'cover' &&
|
|
390
|
+
((image.cropZoom ?? 1) !== 1 || !!image.panX || !!image.panY || !!image.cropRotation);
|
|
391
|
+
const ovalMask = image.mask === 'kreis' && Math.abs(image.width - image.height) > 0.5;
|
|
392
|
+
if (isAdjusted(image) ||
|
|
393
|
+
image.shadowColor ||
|
|
394
|
+
movedCrop ||
|
|
395
|
+
ovalMask ||
|
|
396
|
+
image.notch ||
|
|
397
|
+
hasCorners(image.cornerRadius)) {
|
|
398
|
+
return raster(image.id, placement, 'image-adjusted');
|
|
399
|
+
}
|
|
400
|
+
return {
|
|
401
|
+
kind: 'image',
|
|
402
|
+
id: image.id,
|
|
403
|
+
...placement,
|
|
404
|
+
opacity: image.opacity ?? 1,
|
|
405
|
+
src: image.src,
|
|
406
|
+
fit: image.fit === 'cover' ? 'cover' : 'stretch',
|
|
407
|
+
rounding: image.mask === 'kreis',
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
function mapChart(chart) {
|
|
411
|
+
const scale = chart.scale || 1;
|
|
412
|
+
const placement = place(chart, chart.rotation || 0, scale, scale, {
|
|
413
|
+
x: 0,
|
|
414
|
+
y: 0,
|
|
415
|
+
width: chart.width,
|
|
416
|
+
height: chart.height,
|
|
417
|
+
});
|
|
418
|
+
// Ein Diagrammtyp aus einem neueren Dokument steht nicht in der Tabelle.
|
|
419
|
+
const native = NATIVE_CHARTS[chart.chartType];
|
|
420
|
+
if (!native)
|
|
421
|
+
return raster(chart.id, placement, 'chart-unmapped');
|
|
422
|
+
const series = chartSeries(chart);
|
|
423
|
+
return {
|
|
424
|
+
kind: 'chart',
|
|
425
|
+
id: chart.id,
|
|
426
|
+
...placement,
|
|
427
|
+
opacity: chart.opacity ?? 1,
|
|
428
|
+
chartType: native.chartType,
|
|
429
|
+
barDir: native.barDir,
|
|
430
|
+
labels: chart.data.map((point) => point.name),
|
|
431
|
+
series: series ?? [{ name: chart.title || 'Werte', values: chart.data.map((p) => p.value) }],
|
|
432
|
+
colors: chart.colors,
|
|
433
|
+
title: chart.title || null,
|
|
434
|
+
unit: chart.unit || null,
|
|
435
|
+
// Wie auf der Folie: eine einzelne Reihe eines Säulen- oder Liniendiagramms hat keine Legende.
|
|
436
|
+
showLegend: chart.showLegend && (series !== null || isRoundChartType(chart.chartType)),
|
|
437
|
+
legendPosition: chartLegendPosition(chart) === 'right' ? 'r' : 'b',
|
|
438
|
+
showGrid: chart.showGrid,
|
|
439
|
+
showValues: chart.showValues,
|
|
440
|
+
textColor: chartInk(chart),
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
/** Ein mittig verankertes Motiv mit quadratischer Grundgröße. */
|
|
444
|
+
function centeredSquare(element, size) {
|
|
445
|
+
const scale = element.scale || 1;
|
|
446
|
+
return place(element, element.rotation || 0, scale, scale, {
|
|
447
|
+
x: -size / 2,
|
|
448
|
+
y: -size / 2,
|
|
449
|
+
width: size,
|
|
450
|
+
height: size,
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
// ============================================================================
|
|
454
|
+
// PAGE
|
|
455
|
+
// ============================================================================
|
|
456
|
+
function list(value) {
|
|
457
|
+
return Array.isArray(value) ? value : [];
|
|
458
|
+
}
|
|
459
|
+
function isIdList(value) {
|
|
460
|
+
return (Array.isArray(value) &&
|
|
461
|
+
value.length > 0 &&
|
|
462
|
+
value.every((entry) => !!entry && typeof entry === 'object' && typeof entry.id === 'string'));
|
|
463
|
+
}
|
|
464
|
+
/** Ids der Hintergrund-Elemente der Freeform-Config (`freeform_full.config.tsx`). */
|
|
465
|
+
const BACKGROUND_COLOR_ID = 'background-color';
|
|
466
|
+
const BACKGROUND_IMAGE_ID = 'background-image';
|
|
467
|
+
/** Das Hintergrundfoto: nativ nur unbearbeitet, mittig, ganzflächig — sonst gerastert. */
|
|
468
|
+
function mapBackgroundPhoto(state, page) {
|
|
469
|
+
const src = state.currentImageSrc;
|
|
470
|
+
if (state.backgroundMode !== 'image' || !state.hasBackgroundImage || typeof src !== 'string') {
|
|
471
|
+
return null;
|
|
472
|
+
}
|
|
473
|
+
const offset = state.imageOffset;
|
|
474
|
+
const scale = typeof state.imageScale === 'number' ? state.imageScale : 1;
|
|
475
|
+
const opacity = typeof state.backgroundImageOpacity === 'number' ? state.backgroundImageOpacity : 1;
|
|
476
|
+
const adjustments = state.backgroundImageAdjustments;
|
|
477
|
+
const strip = photoStripBeside(list(state.shapeInstances), page);
|
|
478
|
+
// Ein im Rahmen gedrehtes Foto hat in PPTX keine Entsprechung: es wird gerastert.
|
|
479
|
+
const straightened = backgroundStraighten(state) !== null;
|
|
480
|
+
const plain = !offset?.x &&
|
|
481
|
+
!offset?.y &&
|
|
482
|
+
!straightened &&
|
|
483
|
+
scale === 1 &&
|
|
484
|
+
opacity === 1 &&
|
|
485
|
+
!strip &&
|
|
486
|
+
!(adjustments && isAdjusted(adjustments));
|
|
487
|
+
if (!plain)
|
|
488
|
+
return raster(BACKGROUND_IMAGE_ID, { box: page, rotation: 0 }, 'background-adjusted');
|
|
489
|
+
return {
|
|
490
|
+
kind: 'image',
|
|
491
|
+
id: BACKGROUND_IMAGE_ID,
|
|
492
|
+
box: page,
|
|
493
|
+
rotation: 0,
|
|
494
|
+
opacity: 1,
|
|
495
|
+
src,
|
|
496
|
+
fit: 'cover',
|
|
497
|
+
rounding: false,
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
function buildSlide(state, format, measure, pageNumber) {
|
|
501
|
+
const page = { x: 0, y: 0, width: format.width, height: format.height };
|
|
502
|
+
const carried = carryInstanceState(state);
|
|
503
|
+
// In der Standardreihenfolge von `buildCanvasItems`.
|
|
504
|
+
const entries = [];
|
|
505
|
+
const add = (id, map) => entries.push([id, () => [map()].flat()]);
|
|
506
|
+
for (const kind of hostElementKinds()) {
|
|
507
|
+
const pptx = kind.pptx?.bind(kind);
|
|
508
|
+
if (!pptx)
|
|
509
|
+
continue;
|
|
510
|
+
for (const data of kindList(state, kind.stateKey)) {
|
|
511
|
+
// Boundary: the list under this registration's own key holds its instances.
|
|
512
|
+
add(data.id, () => pptx(data, page));
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
for (const iconId of carried.selectedIcons) {
|
|
516
|
+
const icon = carried.iconStates[iconId];
|
|
517
|
+
const at = icon ?? { x: format.width / 2, y: format.height / 2, scale: 1, rotation: 0 };
|
|
518
|
+
add(iconId, () => raster(iconId, centeredSquare(at, ICON_TARGET_SIZE), 'icon'));
|
|
519
|
+
}
|
|
520
|
+
for (const shape of carried.shapeInstances)
|
|
521
|
+
add(shape.id, () => mapShape(shape));
|
|
522
|
+
for (const frame of carried.frameInstances) {
|
|
523
|
+
add(frame.id, () => raster(frame.id, place(frame, frame.rotation || 0, frame.scaleX ?? 1, frame.scaleY ?? 1, {
|
|
524
|
+
x: -frame.width / 2,
|
|
525
|
+
y: -frame.height / 2,
|
|
526
|
+
width: frame.width,
|
|
527
|
+
height: frame.height,
|
|
528
|
+
}), 'frame'));
|
|
529
|
+
}
|
|
530
|
+
for (const text of carried.additionalTexts)
|
|
531
|
+
add(text.id, () => mapText(text, measure, pageNumber));
|
|
532
|
+
for (const illustration of carried.illustrationInstances) {
|
|
533
|
+
add(illustration.id, () => raster(illustration.id, centeredSquare(illustration, ILLUSTRATION_TARGET_SIZE), 'illustration'));
|
|
534
|
+
}
|
|
535
|
+
for (const asset of carried.assetInstances) {
|
|
536
|
+
// Die Bildmaße stehen nicht im Zustand: ASSET_TARGET_SIZE ist die längere Kante.
|
|
537
|
+
add(asset.id, () => raster(asset.id, centeredSquare(asset, ASSET_TARGET_SIZE), 'asset', false));
|
|
538
|
+
}
|
|
539
|
+
for (const badge of carried.circleBadgeInstances)
|
|
540
|
+
add(badge.id, () => mapCircleBadge(badge));
|
|
541
|
+
for (const pill of carried.pillBadgeInstances)
|
|
542
|
+
add(pill.id, () => mapPill(pill, measure));
|
|
543
|
+
for (const image of carried.userImageInstances) {
|
|
544
|
+
// An empty photo slot shows a placeholder in the editor only.
|
|
545
|
+
if (image.src)
|
|
546
|
+
add(image.id, () => mapUserImage(image));
|
|
547
|
+
}
|
|
548
|
+
for (const chart of carried.chartInstances)
|
|
549
|
+
add(chart.id, () => mapChart(chart));
|
|
550
|
+
// Unbekannte Sammlungen von Elementen mit Id: gerastert statt verloren.
|
|
551
|
+
const hostKeys = hostPptxKeys();
|
|
552
|
+
const unknownKeys = Object.keys(state).filter((key) => !KNOWN_KEYS.has(key) && !hostKeys.has(key));
|
|
553
|
+
for (const key of unknownKeys) {
|
|
554
|
+
const value = state[key];
|
|
555
|
+
if (!isIdList(value))
|
|
556
|
+
continue;
|
|
557
|
+
for (const element of value) {
|
|
558
|
+
add(element.id, () => raster(element.id, { box: page, rotation: 0 }, 'unknown', false));
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
const byId = new Map(entries);
|
|
562
|
+
const ordered = [];
|
|
563
|
+
for (const id of carried.layerOrder) {
|
|
564
|
+
if (ordered.includes(id))
|
|
565
|
+
continue;
|
|
566
|
+
ordered.push(id);
|
|
567
|
+
}
|
|
568
|
+
for (const [id] of entries)
|
|
569
|
+
if (!ordered.includes(id))
|
|
570
|
+
ordered.push(id);
|
|
571
|
+
// Die Hintergrund-Ebenen der Freeform-Config. Stehen sie nicht in
|
|
572
|
+
// `layerOrder`, liegen sie zuunterst (`buildSortedRenderList`); `moveLayerTo`
|
|
573
|
+
// schreibt sie aber mit hinein, dann gilt ihre Stelle dort.
|
|
574
|
+
const background = mapBackgroundPhoto(state, page);
|
|
575
|
+
const items = [];
|
|
576
|
+
if (background && !ordered.includes(BACKGROUND_IMAGE_ID))
|
|
577
|
+
items.push(background);
|
|
578
|
+
for (const id of ordered) {
|
|
579
|
+
// Die Farbfläche trägt der Folienhintergrund.
|
|
580
|
+
if (id === BACKGROUND_COLOR_ID)
|
|
581
|
+
continue;
|
|
582
|
+
if (id === BACKGROUND_IMAGE_ID) {
|
|
583
|
+
if (background)
|
|
584
|
+
items.push(background);
|
|
585
|
+
continue;
|
|
586
|
+
}
|
|
587
|
+
const map = byId.get(id);
|
|
588
|
+
// Eine Id in `layerOrder` ohne bekannte Sammlung: eine Elementart, die
|
|
589
|
+
// dieses Modul nicht kennt. Der Writer findet den Knoten trotzdem.
|
|
590
|
+
items.push(...(map ? map() : [raster(id, { box: page, rotation: 0 }, 'unknown', false)]));
|
|
591
|
+
}
|
|
592
|
+
return {
|
|
593
|
+
background: {
|
|
594
|
+
// Konva zeichnet die Farbfläche nur im Farbmodus; im Fotomodus liegt
|
|
595
|
+
// unter dem Foto nichts — auch nicht hinter einem halbtransparenten.
|
|
596
|
+
color: state.backgroundMode !== 'image' && typeof state.backgroundColor === 'string'
|
|
597
|
+
? state.backgroundColor
|
|
598
|
+
: null,
|
|
599
|
+
},
|
|
600
|
+
items,
|
|
601
|
+
notes: typeof state.notes === 'string' && state.notes.trim() ? state.notes : null,
|
|
602
|
+
unknownKeys,
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
/** Alle Seiten eines Dokuments → PPTX-Modell, eine Folie je Seite. */
|
|
606
|
+
export function buildPptxModel(pages, format, options = {}) {
|
|
607
|
+
const measure = options.measure ?? estimateMeasure;
|
|
608
|
+
return {
|
|
609
|
+
page: { width: format.width, height: format.height },
|
|
610
|
+
slides: pages.map((state, index) => buildSlide(state, format, measure, index + 1)),
|
|
611
|
+
};
|
|
612
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-Seite des PPTX-Exports: Seitenzustände → Modell → Datei. Texte
|
|
3
|
+
* werden mit derselben Messung wie auf dem Canvas vermessen, Raster-Anfragen
|
|
4
|
+
* gehen an das Stage der jeweiligen Seite, Bilder werden als PNG/JPEG geladen.
|
|
5
|
+
*/
|
|
6
|
+
import { type PptxPageState } from '@ggraphic/editor/export/pptx/buildPptxModel';
|
|
7
|
+
import { type PptxLoadedImage, type PptxRasterImage } from './writePptx.js';
|
|
8
|
+
import type { CanvasFormat } from '@ggraphic/editor/formats/index';
|
|
9
|
+
/**
|
|
10
|
+
* Ein Bild als PNG/JPEG-Data-URL mit Eigenmaßen. WebP, GIF und SVG kennt
|
|
11
|
+
* nicht jedes Präsentationsprogramm, sie werden zu PNG. `null`, wenn die
|
|
12
|
+
* Quelle nicht lädt (z. B. CORS) — der Writer rastert das Element dann.
|
|
13
|
+
*/
|
|
14
|
+
export declare function loadPptxImage(src: string): Promise<PptxLoadedImage | null>;
|
|
15
|
+
export interface ExportPptxDeckOptions {
|
|
16
|
+
pages: readonly PptxPageState[];
|
|
17
|
+
format: CanvasFormat;
|
|
18
|
+
/** Rastert ein Element der Seite `slideIndex`; null ohne Knoten. */
|
|
19
|
+
rasterizeElement: (slideIndex: number, elementId: string) => Promise<PptxRasterImage | null>;
|
|
20
|
+
title?: string;
|
|
21
|
+
onProgress?: (done: number, total: number) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare function exportPptxDeck({ pages, format, rasterizeElement, title, onProgress, }: ExportPptxDeckOptions): Promise<Blob>;
|