@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,102 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { useCanvasEditorServices } from '@ggraphic/editor/CanvasEditorProvider';
|
|
4
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
5
|
+
import { Button } from '@ggraphic/editor/ui/button';
|
|
6
|
+
import { Input } from '@ggraphic/editor/ui/input';
|
|
7
|
+
import { Label } from '@ggraphic/editor/ui/label';
|
|
8
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@ggraphic/editor/ui/select';
|
|
9
|
+
import { Skeleton } from '@ggraphic/editor/ui/skeleton';
|
|
10
|
+
import { Switch } from '@ggraphic/editor/ui/switch';
|
|
11
|
+
import { downloadErrorMessage } from '@ggraphic/editor/utils/downloadError';
|
|
12
|
+
import { useId, useState } from 'react';
|
|
13
|
+
import { PiDownloadSimple } from 'react-icons/pi';
|
|
14
|
+
import { MOBILE_INPUT_TEXT } from '@ggraphic/editor/sidebar/sidebarStyles';
|
|
15
|
+
import { DownloadNotice } from '@ggraphic/editor/components/DownloadNotice';
|
|
16
|
+
function ImpressumForm({ gate, impressum, }) {
|
|
17
|
+
const t = useMessages();
|
|
18
|
+
const { isFilled } = impressum;
|
|
19
|
+
const fieldId = useId();
|
|
20
|
+
const labels = impressum.labels[gate.locale];
|
|
21
|
+
const current = impressum.parse(gate.locale, gate.text ?? '');
|
|
22
|
+
const initial = (value) => (isFilled(value) ? value : '');
|
|
23
|
+
const [name, setName] = useState(initial(current.name));
|
|
24
|
+
const [anschrift, setAnschrift] = useState(initial(current.anschrift));
|
|
25
|
+
const [touched, setTouched] = useState(false);
|
|
26
|
+
const valid = impressum.isComplete({ name, anschrift });
|
|
27
|
+
const nameError = touched && !isFilled(name) ? t.shell.downloadPanel.impressumNameRequired(labels.name) : null;
|
|
28
|
+
const anschriftError = touched && !isFilled(anschrift) ? t.shell.downloadPanel.impressumAddressRequired : null;
|
|
29
|
+
const submit = (event) => {
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
setTouched(true);
|
|
32
|
+
if (valid)
|
|
33
|
+
gate.onSubmit({ name, anschrift });
|
|
34
|
+
};
|
|
35
|
+
return (_jsxs("form", { onSubmit: submit, className: "flex flex-col gap-2", noValidate: true, children: [_jsx("h4", { className: "m-0 text-sm font-semibold text-foreground", children: t.shell.downloadPanel.impressumHeading }), _jsx("p", { className: "m-0 text-xs text-foreground-muted", children: labels.hint }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx(Label, { htmlFor: `${fieldId}-name`, className: "text-xs font-medium text-foreground-muted", children: labels.name }), _jsx(Input, { id: `${fieldId}-name`, className: MOBILE_INPUT_TEXT, value: name, placeholder: labels.namePlaceholder, onChange: (e) => setName(e.target.value), "aria-invalid": nameError !== null, ...(nameError ? { 'aria-describedby': `${fieldId}-name-error` } : {}) }), nameError && (_jsx("p", { id: `${fieldId}-name-error`, role: "alert", className: "m-0 text-xs text-destructive", children: nameError }))] }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx(Label, { htmlFor: `${fieldId}-anschrift`, className: "text-xs font-medium text-foreground-muted", children: t.shell.downloadPanel.impressumAddress }), _jsx(Input, { id: `${fieldId}-anschrift`, className: MOBILE_INPUT_TEXT, value: anschrift, placeholder: t.shell.downloadPanel.impressumAddressPlaceholder, onChange: (e) => setAnschrift(e.target.value), "aria-invalid": anschriftError !== null, ...(anschriftError ? { 'aria-describedby': `${fieldId}-anschrift-error` } : {}) }), anschriftError && (_jsx("p", { id: `${fieldId}-anschrift-error`, role: "alert", className: "m-0 text-xs text-destructive", children: anschriftError }))] }), _jsx(Button, { type: "submit", variant: "brand", className: "w-full rounded-lg", children: t.shell.downloadPanel.impressumSubmit })] }));
|
|
36
|
+
}
|
|
37
|
+
function ProgressBar({ progress }) {
|
|
38
|
+
return (_jsxs("div", { className: "relative w-full h-5 bg-editor-tile rounded-full overflow-hidden", children: [_jsx("div", { className: "absolute inset-y-0 left-0 bg-primary-600 rounded-full transition-[width] duration-300", style: { width: `${(progress.current / progress.total) * 100}%` } }), _jsxs("span", { className: "absolute inset-0 flex items-center justify-center text-[10px] font-medium", children: [progress.current, "/", progress.total] })] }));
|
|
39
|
+
}
|
|
40
|
+
const DEFAULT_RASTER_PIXEL_RATIO = 1;
|
|
41
|
+
const SCALE_OPTIONS = [1, 2];
|
|
42
|
+
export function DownloadSection({ onDownload, onDownloadAllZip, pageCount, isMultiExporting = false, exportProgress, exportError, exportNotice, printExport = null, slideDeck = null, }) {
|
|
43
|
+
const t = useMessages();
|
|
44
|
+
const [choice, setChoice] = useState(printExport ? 'pdf' : slideDeck ? 'pptx' : 'png');
|
|
45
|
+
const [pptxProgress, setPptxProgress] = useState(null);
|
|
46
|
+
const [printWarnings] = useState(() => printExport?.getWarnings() ?? []);
|
|
47
|
+
const [scale, setScale] = useState(DEFAULT_RASTER_PIXEL_RATIO);
|
|
48
|
+
const [transparent, setTransparent] = useState(false);
|
|
49
|
+
const [pageSelection, setPageSelection] = useState('current');
|
|
50
|
+
const [isDownloading, setIsDownloading] = useState(false);
|
|
51
|
+
const [downloadError, setDownloadError] = useState(null);
|
|
52
|
+
const fieldId = useId();
|
|
53
|
+
// Without the host's print service no format carries an impressum.
|
|
54
|
+
const { print, carousel } = useCanvasEditorServices();
|
|
55
|
+
const impressum = print?.impressum ?? null;
|
|
56
|
+
const isPdf = choice === 'pdf' && printExport !== null;
|
|
57
|
+
const impressumGate = isPdf && impressum ? (printExport?.impressum ?? null) : null;
|
|
58
|
+
const impressumMissing = impressum !== null &&
|
|
59
|
+
impressumGate?.ready === true &&
|
|
60
|
+
!impressum.isComplete(impressum.parse(impressumGate.locale, impressumGate.text ?? ''));
|
|
61
|
+
const isSlidesPdf = choice === 'pdf' && slideDeck !== null;
|
|
62
|
+
const isPptx = choice === 'pptx' && slideDeck !== null;
|
|
63
|
+
const isMultiPage = pageCount > 1 && onDownloadAllZip && !isPdf && !isSlidesPdf && !isPptx;
|
|
64
|
+
// JPEG has no alpha channel — the transparency toggle is only meaningful for
|
|
65
|
+
// PNG/WebP.
|
|
66
|
+
const supportsTransparency = choice !== 'jpeg';
|
|
67
|
+
const rasterFormat = choice === 'pdf' || choice === 'pptx' ? 'png' : choice;
|
|
68
|
+
const handleDownload = async () => {
|
|
69
|
+
setIsDownloading(true);
|
|
70
|
+
setDownloadError(null);
|
|
71
|
+
try {
|
|
72
|
+
if (choice === 'pdf' && printExport) {
|
|
73
|
+
await printExport.onDownloadPdf();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (isSlidesPdf && slideDeck) {
|
|
77
|
+
await slideDeck.onDownloadPdf();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (isPptx && slideDeck) {
|
|
81
|
+
setPptxProgress({ current: 0, total: pageCount });
|
|
82
|
+
await slideDeck.onDownloadPptx((current, total) => setPptxProgress({ current, total }));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (pageSelection === 'all' && onDownloadAllZip) {
|
|
86
|
+
await onDownloadAllZip(rasterFormat);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
await onDownload(rasterFormat, scale, supportsTransparency && transparent);
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
console.error('[DownloadSection] Download failed:', err);
|
|
93
|
+
setDownloadError(downloadErrorMessage(err));
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
setIsDownloading(false);
|
|
97
|
+
setPptxProgress(null);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
return (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx(Label, { htmlFor: `${fieldId}-format`, className: "text-xs font-medium text-foreground-muted", children: t.shell.downloadPanel.format }), _jsxs(Select, { value: choice, onValueChange: (v) => setChoice(v), children: [_jsx(SelectTrigger, { id: `${fieldId}-format`, size: "sm", className: "w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { position: "popper", className: "z-[10001]", children: [printExport && _jsx(SelectItem, { value: "pdf", children: t.shell.downloadPanel.pdfPrint }), slideDeck && _jsx(SelectItem, { value: "pptx", children: "PowerPoint (.pptx)" }), slideDeck && _jsx(SelectItem, { value: "pdf", children: "PDF" }), _jsx(SelectItem, { value: "png", children: "PNG" }), !printExport && _jsx(SelectItem, { value: "jpeg", children: "JPG" }), !printExport && _jsx(SelectItem, { value: "webp", children: "WebP" })] })] })] }), !isPdf && !isSlidesPdf && !isPptx && pageSelection === 'current' && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx(Label, { htmlFor: `${fieldId}-scale`, className: "text-xs font-medium text-foreground-muted", children: t.shell.downloadPanel.resolution }), _jsxs(Select, { value: String(scale), onValueChange: (v) => setScale(Number(v)), children: [_jsx(SelectTrigger, { id: `${fieldId}-scale`, size: "sm", className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { position: "popper", className: "z-[10001]", children: SCALE_OPTIONS.map((s) => (_jsxs(SelectItem, { value: String(s), children: [s, "\u00D7 ", s === DEFAULT_RASTER_PIXEL_RATIO ? t.shell.downloadPanel.defaultMark : ''] }, s))) })] })] }), supportsTransparency && (_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx(Label, { htmlFor: `${fieldId}-transparent`, className: "text-xs font-medium text-foreground-muted", children: t.shell.downloadPanel.transparentBackground }), _jsx(Switch, { id: `${fieldId}-transparent`, checked: transparent, onCheckedChange: setTransparent })] }))] })), isMultiPage && (_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx(Label, { htmlFor: `${fieldId}-pages`, className: "text-xs font-medium text-foreground-muted", children: t.shell.downloadPanel.selectPages }), _jsxs(Select, { value: pageSelection, onValueChange: (v) => setPageSelection(v), children: [_jsx(SelectTrigger, { id: `${fieldId}-pages`, size: "sm", className: "w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { position: "popper", className: "z-[10001]", children: [_jsx(SelectItem, { value: "current", children: t.shell.downloadPanel.currentPage }), _jsx(SelectItem, { value: "all", children: t.shell.allPagesZip(pageCount) })] })] })] })), isMultiExporting && exportProgress && exportProgress.total > 0 && (_jsx(ProgressBar, { progress: exportProgress })), pptxProgress && pptxProgress.total > 0 && _jsx(ProgressBar, { progress: pptxProgress }), impressumMissing && impressumGate && impressum && (_jsxs(_Fragment, { children: [_jsx(DownloadNotice, { tone: "info", children: t.shell.downloadPanel.impressumMissingNotice }), _jsx(ImpressumForm, { gate: impressumGate, impressum: impressum })] })), isPdf && print?.untestedNotice && (_jsx(DownloadNotice, { tone: "info", children: print.untestedNotice })), isPptx && slideDeck && carousel?.pptxFontHint && (_jsx(DownloadNotice, { tone: "info", children: carousel.pptxFontHint[slideDeck.locale] })), isPdf &&
|
|
101
|
+
printWarnings.map((warning) => (_jsx(DownloadNotice, { tone: "info", children: warning }, warning))), downloadError && _jsx(DownloadNotice, { children: downloadError }), exportError && !isMultiExporting && _jsx(DownloadNotice, { children: exportError }), exportNotice && _jsx(DownloadNotice, { tone: "info", children: exportNotice }), _jsxs(Button, { variant: "brand", className: "w-full rounded-lg", onClick: handleDownload, disabled: isDownloading || isMultiExporting, children: [isDownloading || isMultiExporting ? (_jsx(Skeleton, { className: "size-3.5 rounded-full" })) : (_jsx(PiDownloadSimple, { className: "size-3.5" })), isDownloading ? t.shell.downloading : t.shell.download] })] }));
|
|
102
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ContextControlsProps } from '@ggraphic/editor/components/TopBar/ContextControls';
|
|
3
|
+
interface MobileSelectionBarProps extends ContextControlsProps {
|
|
4
|
+
/** Öffnet den Bereich der Auswahl als Sheet; fehlt, wenn es keinen gibt. */
|
|
5
|
+
onOpenArea?: () => void;
|
|
6
|
+
onDone: () => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* MobileSelectionBar — mobil die untere Leiste, solange etwas ausgewählt ist
|
|
10
|
+
* und kein Sheet offen ist. Sie steht im Slot der Bereichs-Leiste (gleiche
|
|
11
|
+
* Höhe, `order-2`), die Fläche behält also ihre Größe. Formatierung liegt hier,
|
|
12
|
+
* Duplizieren, Löschen und das Menü „…“ in der Pille am Objekt (`SelectionPill`).
|
|
13
|
+
* Die Werkzeuge stehen als beschriftete Kacheln (`barTiles`).
|
|
14
|
+
*/
|
|
15
|
+
export declare function MobileSelectionBar({ onOpenArea, onDone, ...controls }: MobileSelectionBarProps): React.JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PiCheckBold, PiSlidersHorizontal } from 'react-icons/pi';
|
|
3
|
+
import { BarTilesProvider } from '@ggraphic/editor/components/TopBar/barTiles';
|
|
4
|
+
import { ContextControls, showsCropModeBar, } from '@ggraphic/editor/components/TopBar/ContextControls';
|
|
5
|
+
import { TOOLBAR_ITEMS_WITH_INPUTS, useRovingToolbar, } from '@ggraphic/editor/hooks/useRovingToolbar';
|
|
6
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
7
|
+
import { HIDDEN_SCROLLBAR } from '@ggraphic/editor/sidebar/sidebarStyles';
|
|
8
|
+
import { useCanvasStoreSelector } from '@ggraphic/editor/stores/CanvasStoreProvider';
|
|
9
|
+
import { cn } from '@ggraphic/editor/utils/cn';
|
|
10
|
+
/**
|
|
11
|
+
* MobileSelectionBar — mobil die untere Leiste, solange etwas ausgewählt ist
|
|
12
|
+
* und kein Sheet offen ist. Sie steht im Slot der Bereichs-Leiste (gleiche
|
|
13
|
+
* Höhe, `order-2`), die Fläche behält also ihre Größe. Formatierung liegt hier,
|
|
14
|
+
* Duplizieren, Löschen und das Menü „…“ in der Pille am Objekt (`SelectionPill`).
|
|
15
|
+
* Die Werkzeuge stehen als beschriftete Kacheln (`barTiles`).
|
|
16
|
+
*/
|
|
17
|
+
export function MobileSelectionBar({ onOpenArea, onDone, ...controls }) {
|
|
18
|
+
const t = useMessages();
|
|
19
|
+
const hasPendingAiSuggestion = useCanvasStoreSelector((s) => s.pendingAiSuggestion !== null);
|
|
20
|
+
// Im Zuschneide-Modus hat die Leiste ihre eigenen Ausgänge (Abbrechen, Fertig).
|
|
21
|
+
const cropping = showsCropModeBar(controls) && !hasPendingAiSuggestion;
|
|
22
|
+
const roving = useRovingToolbar(TOOLBAR_ITEMS_WITH_INPUTS);
|
|
23
|
+
return (_jsxs("div", { ...roving, role: "toolbar", "aria-label": t.topBar.editSelection, "data-suppress-feedback-launcher": "", className: cn('order-2 flex-none flex gap-1 pl-3 pr-2 bg-[var(--editor-surface)] border-t border-[var(--editor-border)]', cropping
|
|
24
|
+
? 'flex-col py-2 pb-[calc(8px+env(safe-area-inset-bottom))]'
|
|
25
|
+
: 'items-center h-[calc(64px+env(safe-area-inset-bottom))] pb-[env(safe-area-inset-bottom)]'), children: [cropping ? (_jsx(ContextControls, { ...controls, hideObjectActions: true, cropLayout: "mobile" })) : (_jsx("div", { className: cn('canvas-scroll-fade-x flex flex-1 min-w-0 items-center gap-1.5 overflow-x-auto', HIDDEN_SCROLLBAR), children: !hasPendingAiSuggestion && (_jsx(BarTilesProvider, { children: _jsx(ContextControls, { ...controls, hideObjectActions: true }) })) })), onOpenArea && !cropping && (_jsxs("button", { type: "button", onClick: onOpenArea, className: "flex-none inline-flex flex-col items-center justify-center gap-0.5 min-w-11 h-11 px-1 rounded-lg border-none bg-transparent cursor-pointer text-[var(--editor-text-secondary)] hover:bg-[var(--editor-surface-hover)]", children: [_jsx(PiSlidersHorizontal, { size: 20, "aria-hidden": true }), _jsx("span", { className: "text-[11px] font-bold", children: t.shell.more })] })), !cropping && (_jsx("button", { type: "button", onClick: onDone, "aria-label": t.topBar.done, title: t.topBar.done, className: "flex-none inline-flex items-center justify-center size-11 rounded-full border-none cursor-pointer bg-[var(--editor-active-bg)] text-[var(--editor-active-fg)]", children: _jsx(PiCheckBold, { size: 20, "aria-hidden": true }) }))] }));
|
|
26
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ContextControlsProps } from '@ggraphic/editor/components/TopBar/ContextControls';
|
|
3
|
+
/**
|
|
4
|
+
* MobileSelectionControls — the "Auswahl" block at the top of the mobile area
|
|
5
|
+
* sheet, shown when the user opens a selection's area via "Mehr". It carries
|
|
6
|
+
* the selection's formatting controls (the desktop ContextToolbar's content);
|
|
7
|
+
* without an open sheet they live in `MobileSelectionBar`. Hidden while an AI
|
|
8
|
+
* suggestion is pending.
|
|
9
|
+
*/
|
|
10
|
+
export declare function MobileSelectionControls(props: ContextControlsProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
4
|
+
import { useCanvasStoreSelector } from '@ggraphic/editor/stores/CanvasStoreProvider';
|
|
5
|
+
import { cn } from '@ggraphic/editor/utils/cn';
|
|
6
|
+
import { HIDDEN_SCROLLBAR } from '@ggraphic/editor/sidebar/sidebarStyles';
|
|
7
|
+
import { ContextControls, } from '@ggraphic/editor/components/TopBar/ContextControls';
|
|
8
|
+
import { hostElementKind } from '@ggraphic/editor/utils/elementKinds';
|
|
9
|
+
const selectionLabels = (t) => ({
|
|
10
|
+
text: t.common.text,
|
|
11
|
+
image: t.common.image,
|
|
12
|
+
'user-image': t.common.image,
|
|
13
|
+
shape: t.topBar.shape,
|
|
14
|
+
icon: t.layers.icon,
|
|
15
|
+
illustration: t.layers.illustration,
|
|
16
|
+
asset: t.layers.graphic,
|
|
17
|
+
background: t.layers.background,
|
|
18
|
+
frame: t.layers.frame,
|
|
19
|
+
chart: t.layers.chart,
|
|
20
|
+
'pill-badge': t.layers.badgePill,
|
|
21
|
+
'circle-badge': t.layers.badgePill,
|
|
22
|
+
});
|
|
23
|
+
/** The selection's kind for the label: a core module's, or a host kind's name. */
|
|
24
|
+
function selectionLabel(t, type) {
|
|
25
|
+
const host = hostElementKind(type);
|
|
26
|
+
// Not a host kind: one of the core's modules.
|
|
27
|
+
return host ? host.name() : selectionLabels(t)[type];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* MobileSelectionControls — the "Auswahl" block at the top of the mobile area
|
|
31
|
+
* sheet, shown when the user opens a selection's area via "Mehr". It carries
|
|
32
|
+
* the selection's formatting controls (the desktop ContextToolbar's content);
|
|
33
|
+
* without an open sheet they live in `MobileSelectionBar`. Hidden while an AI
|
|
34
|
+
* suggestion is pending.
|
|
35
|
+
*/
|
|
36
|
+
export function MobileSelectionControls(props) {
|
|
37
|
+
const t = useMessages();
|
|
38
|
+
const hasPendingAiSuggestion = useCanvasStoreSelector((s) => s.pendingAiSuggestion !== null);
|
|
39
|
+
if (hasPendingAiSuggestion)
|
|
40
|
+
return null;
|
|
41
|
+
const type = props.activeFloatingModule?.type;
|
|
42
|
+
return (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs("span", { className: "text-[13px] font-bold text-[var(--editor-text-muted)]", children: [t.topBar.selection, type ? ` · ${selectionLabel(t, type)}` : ''] }), _jsx("div", { className: cn('canvas-scroll-fade-x flex items-center gap-1.5 overflow-x-auto -mx-5 px-5 py-1', HIDDEN_SCROLLBAR), children: _jsx(ContextControls, { ...props }) })] }));
|
|
43
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type PositionCommandId } from '@ggraphic/editor/components/TopBar/modules/FloatingPositionControl';
|
|
3
|
+
export interface MultiSelectionToolbarProps {
|
|
4
|
+
count: number;
|
|
5
|
+
/** Mindestens ein Element lässt sich verschieben; gesperrte bleiben beim Ausrichten stehen. */
|
|
6
|
+
canAlign: boolean;
|
|
7
|
+
canDistribute: boolean;
|
|
8
|
+
/** Jedes Element lässt sich drehen; die Auswahl spiegelt an ihrer Mitte. */
|
|
9
|
+
canFlip: boolean;
|
|
10
|
+
onFlip: (axis: 'x' | 'y') => void;
|
|
11
|
+
onCommand: (id: PositionCommandId) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Die Desktop-Leiste einer Mehrfachauswahl. Formatieren gibt es hier nicht —
|
|
15
|
+
* jede Elementart deutet Farbe und Größe anders —, nur Spiegeln und Position.
|
|
16
|
+
* Kopieren, Duplizieren, Sperren und Löschen stehen wie bei einem einzelnen
|
|
17
|
+
* Element in der Pille über der Auswahl (`SelectionPill`).
|
|
18
|
+
*/
|
|
19
|
+
export declare function MultiSelectionToolbar({ count, canAlign, canDistribute, canFlip, onFlip, onCommand, }: MultiSelectionToolbarProps): React.JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PiFlipHorizontal, PiFlipVertical } from 'react-icons/pi';
|
|
3
|
+
import { FloatingPositionControl, } from '@ggraphic/editor/components/TopBar/modules/FloatingPositionControl';
|
|
4
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
5
|
+
import { useRovingToolbar } from '@ggraphic/editor/hooks/useRovingToolbar';
|
|
6
|
+
import { CANVAS_COMMANDS, ariaShortcut, formatShortcut, isMacPlatform, shortcutOf, } from '@ggraphic/editor/utils/canvasCommandRegistry';
|
|
7
|
+
import { ContextCard } from './ContextToolbar.js';
|
|
8
|
+
const ICON_BTN = 'inline-flex items-center justify-center size-8 shrink-0 rounded-md border-none bg-transparent cursor-pointer text-[var(--editor-text)] transition-colors duration-150 hover:bg-[var(--editor-surface-hover)] hover:text-[var(--editor-active-fg)] disabled:opacity-30 disabled:cursor-not-allowed aria-pressed:bg-[var(--editor-active-bg)] aria-pressed:text-[var(--editor-active-fg)]';
|
|
9
|
+
const SEP = 'w-px h-[22px] bg-[var(--editor-border-soft)] mx-1 shrink-0';
|
|
10
|
+
/** „Kopieren (⌘C)“ — Name und Kürzel aus dem Befehlsregister. */
|
|
11
|
+
function withShortcut(id) {
|
|
12
|
+
const shortcut = shortcutOf(id);
|
|
13
|
+
const label = CANVAS_COMMANDS[id].label;
|
|
14
|
+
return shortcut ? `${label} (${formatShortcut(shortcut, isMacPlatform())})` : label;
|
|
15
|
+
}
|
|
16
|
+
/** `Shift+H` für `aria-keyshortcuts`. */
|
|
17
|
+
function ariaOf(id) {
|
|
18
|
+
return ariaShortcut(shortcutOf(id), isMacPlatform());
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Die Desktop-Leiste einer Mehrfachauswahl. Formatieren gibt es hier nicht —
|
|
22
|
+
* jede Elementart deutet Farbe und Größe anders —, nur Spiegeln und Position.
|
|
23
|
+
* Kopieren, Duplizieren, Sperren und Löschen stehen wie bei einem einzelnen
|
|
24
|
+
* Element in der Pille über der Auswahl (`SelectionPill`).
|
|
25
|
+
*/
|
|
26
|
+
export function MultiSelectionToolbar({ count, canAlign, canDistribute, canFlip, onFlip, onCommand, }) {
|
|
27
|
+
const t = useMessages();
|
|
28
|
+
const roving = useRovingToolbar();
|
|
29
|
+
return (_jsx(ContextCard, { children: _jsxs("div", { ...roving, role: "toolbar", "aria-label": t.common.elements(count), className: "flex items-center gap-0.5", children: [_jsx("span", { className: "px-2 text-[13px] font-medium text-[var(--editor-text-secondary)] whitespace-nowrap", children: t.common.elements(count) }), (canFlip || canAlign) && _jsx("div", { className: SEP }), canFlip && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: ICON_BTN, onClick: () => onFlip('x'), title: withShortcut('flipHorizontal'), "aria-label": withShortcut('flipHorizontal'), "aria-keyshortcuts": ariaOf('flipHorizontal'), children: _jsx(PiFlipHorizontal, { size: 18 }) }), _jsx("button", { type: "button", className: ICON_BTN, onClick: () => onFlip('y'), title: withShortcut('flipVertical'), "aria-label": withShortcut('flipVertical'), "aria-keyshortcuts": ariaOf('flipVertical'), children: _jsx(PiFlipVertical, { size: 18 }) })] })), canAlign && (_jsx(FloatingPositionControl, { canDistribute: canDistribute, onCommand: onCommand }))] }) }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type CanvasDownloadChoice, type PrintExportProps, type SlideDeckExportProps } from './DownloadSection.js';
|
|
2
|
+
export interface ShareDropdownProps {
|
|
3
|
+
onCaptureCanvas: () => Promise<string | null>;
|
|
4
|
+
onDownload: (format: CanvasDownloadChoice, pixelRatio: number, transparent: boolean) => void | Promise<void>;
|
|
5
|
+
onNavigateToGallery: () => void;
|
|
6
|
+
canvasText: string;
|
|
7
|
+
canvasType: string;
|
|
8
|
+
canvasWidth: number;
|
|
9
|
+
canvasHeight: number;
|
|
10
|
+
shareToken: string | null;
|
|
11
|
+
pageCount?: number;
|
|
12
|
+
onDownloadAllZip?: (format?: CanvasDownloadChoice) => Promise<void>;
|
|
13
|
+
onShareAllPages?: () => Promise<void>;
|
|
14
|
+
isMultiExporting?: boolean;
|
|
15
|
+
exportProgress?: {
|
|
16
|
+
current: number;
|
|
17
|
+
total: number;
|
|
18
|
+
};
|
|
19
|
+
exportError?: string | null;
|
|
20
|
+
exportNotice?: string | null;
|
|
21
|
+
/** Set for print formats: the download section offers the print PDF. */
|
|
22
|
+
printExport?: PrintExportProps | null;
|
|
23
|
+
/** Set for slide formats: the download section offers PowerPoint and a PDF of all pages. */
|
|
24
|
+
slideDeck?: SlideDeckExportProps | null;
|
|
25
|
+
/**
|
|
26
|
+
* Optional host-supplied "invite people" action. When provided, the share
|
|
27
|
+
* popover shows a "Personen" icon button that opens the host's collaborator
|
|
28
|
+
* dialog. Kept opaque so the canvas-editor package stays unaware of who
|
|
29
|
+
* resolves people/permissions.
|
|
30
|
+
*/
|
|
31
|
+
onInvitePeople?: () => void;
|
|
32
|
+
/**
|
|
33
|
+
* Optional host-supplied "save as template" action, same contract as
|
|
34
|
+
* {@link onInvitePeople}: the host owns the document identity a template is
|
|
35
|
+
* built from, so it also owns the dialog. Hidden when absent.
|
|
36
|
+
*/
|
|
37
|
+
onSaveAsTemplate?: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Opened by a host-drawn bar instead of the "Teilen" button: the menu is
|
|
40
|
+
* controlled from outside and hangs from the top right of the editor.
|
|
41
|
+
*/
|
|
42
|
+
hostControl?: {
|
|
43
|
+
open: boolean;
|
|
44
|
+
onOpenChange: (open: boolean) => void;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Bildnachweis aller Seiten („Foto: … auf Unsplash"), gelesen beim Öffnen.
|
|
48
|
+
* Unsplash verlangt ihn im Beitragstext: er wird an den geteilten Text
|
|
49
|
+
* gehängt und zum Kopieren angezeigt, weil Instagram & Co. den Text eines
|
|
50
|
+
* geteilten Bilds verwerfen.
|
|
51
|
+
*/
|
|
52
|
+
getPhotoCredit?: () => string;
|
|
53
|
+
}
|
|
54
|
+
export declare function ShareDropdown({ onCaptureCanvas, onDownload, onNavigateToGallery, canvasText, canvasWidth, canvasHeight, shareToken, pageCount, onDownloadAllZip, onShareAllPages, isMultiExporting, exportProgress, exportError, exportNotice, printExport, slideDeck, onInvitePeople, onSaveAsTemplate, hostControl, getPhotoCredit, }: ShareDropdownProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { useCanvasEditorServices } from '@ggraphic/editor/CanvasEditorProvider';
|
|
4
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
5
|
+
import { browserFileDelivery } from '@ggraphic/editor/hostServices';
|
|
6
|
+
import { useAutoSaveStoreApi } from '@ggraphic/editor/stores/useAutoSaveStore';
|
|
7
|
+
import { Button } from '@ggraphic/editor/ui/button';
|
|
8
|
+
import { IconButton, IconButtonRow } from '@ggraphic/editor/ui/icon-button';
|
|
9
|
+
import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger, } from '@ggraphic/editor/ui/popover';
|
|
10
|
+
import { Skeleton } from '@ggraphic/editor/ui/skeleton';
|
|
11
|
+
import { stripInlineMarks } from '@ggraphic/schema';
|
|
12
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
13
|
+
import { IoShareOutline } from 'react-icons/io5';
|
|
14
|
+
import { PiArrowLeft, PiMegaphone, PiCheck, PiDownloadSimple, PiFloppyDisk, PiUserPlus, } from 'react-icons/pi';
|
|
15
|
+
import { useIsCanvasMobile } from '@ggraphic/editor/hooks/useIsCanvasMobile';
|
|
16
|
+
import { AltTextField, useCaptionAltText, useShareAltText, withAltText, } from '@ggraphic/editor/sidebar/components/AltTextField';
|
|
17
|
+
import { withPhotoCredit } from '@ggraphic/editor/utils/photoCredit';
|
|
18
|
+
import { DownloadSection, } from './DownloadSection.js';
|
|
19
|
+
export function ShareDropdown({ onCaptureCanvas, onDownload, onNavigateToGallery, canvasText, canvasWidth, canvasHeight, shareToken, pageCount = 1, onDownloadAllZip, onShareAllPages, isMultiExporting = false, exportProgress, exportError, exportNotice, printExport, slideDeck, onInvitePeople, onSaveAsTemplate, hostControl, getPhotoCredit, }) {
|
|
20
|
+
const t = useMessages();
|
|
21
|
+
const isMobile = useIsCanvasMobile();
|
|
22
|
+
const [ownOpen, setOwnOpen] = useState(false);
|
|
23
|
+
const open = hostControl ? hostControl.open : ownOpen;
|
|
24
|
+
const setOpen = hostControl ? hostControl.onOpenChange : setOwnOpen;
|
|
25
|
+
const [view, setView] = useState('main');
|
|
26
|
+
const [isSharing, setIsSharing] = useState(false);
|
|
27
|
+
const [shareSuccess, setShareSuccess] = useState(false);
|
|
28
|
+
const [creditCopied, setCreditCopied] = useState(false);
|
|
29
|
+
const photoCredit = useMemo(() => (open && getPhotoCredit ? getPhotoCredit() : ''), [open, getPhotoCredit]);
|
|
30
|
+
const [altText, setAltText] = useShareAltText(stripInlineMarks(canvasText));
|
|
31
|
+
const captionAltText = useCaptionAltText(altText);
|
|
32
|
+
const shareText = withAltText(withPhotoCredit(canvasText, photoCredit), captionAltText);
|
|
33
|
+
const autoSaveStoreApi = useAutoSaveStoreApi();
|
|
34
|
+
const { fileDelivery = browserFileDelivery, imageShares, feedback } = useCanvasEditorServices();
|
|
35
|
+
const shareRoute = fileDelivery.pickShareRoute();
|
|
36
|
+
const shareFileName = `${fileDelivery.filenamePrefix ?? 'ggraphic'}.png`;
|
|
37
|
+
const shareTitle = fileDelivery.shareTitle ?? 'ggraphic';
|
|
38
|
+
const publishDraftIfNeeded = useCallback(async () => {
|
|
39
|
+
const token = shareToken || autoSaveStoreApi.getState().autoSavedShareToken;
|
|
40
|
+
if (token && imageShares) {
|
|
41
|
+
try {
|
|
42
|
+
await imageShares.publishShare(token);
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
console.warn('[ShareDropdown] Failed to publish draft:', err);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, [shareToken, autoSaveStoreApi, imageShares]);
|
|
49
|
+
const handleNativeShare = useCallback(async () => {
|
|
50
|
+
setIsSharing(true);
|
|
51
|
+
try {
|
|
52
|
+
const dataUrl = await onCaptureCanvas();
|
|
53
|
+
if (!dataUrl)
|
|
54
|
+
return;
|
|
55
|
+
if (shareRoute === 'native-host') {
|
|
56
|
+
fileDelivery.shareDataUrlViaNativeHost(dataUrl, shareFileName, {
|
|
57
|
+
title: shareTitle,
|
|
58
|
+
text: shareText,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const blob = await (await fetch(dataUrl)).blob();
|
|
63
|
+
const file = new File([blob], shareFileName, { type: 'image/png' });
|
|
64
|
+
if (navigator.canShare?.({ files: [file] })) {
|
|
65
|
+
await navigator.share({ files: [file], text: shareText, title: shareTitle });
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
await navigator.share({ text: shareText, title: shareTitle });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
void publishDraftIfNeeded();
|
|
72
|
+
setShareSuccess(true);
|
|
73
|
+
setTimeout(() => setShareSuccess(false), 2000);
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
if (err.name !== 'AbortError')
|
|
77
|
+
console.error('Share failed:', err);
|
|
78
|
+
}
|
|
79
|
+
finally {
|
|
80
|
+
setIsSharing(false);
|
|
81
|
+
}
|
|
82
|
+
}, [
|
|
83
|
+
onCaptureCanvas,
|
|
84
|
+
shareText,
|
|
85
|
+
publishDraftIfNeeded,
|
|
86
|
+
shareRoute,
|
|
87
|
+
fileDelivery,
|
|
88
|
+
shareFileName,
|
|
89
|
+
shareTitle,
|
|
90
|
+
]);
|
|
91
|
+
return (_jsxs(Popover, { open: open, onOpenChange: (v) => {
|
|
92
|
+
setOpen(v);
|
|
93
|
+
if (!v)
|
|
94
|
+
setView('main');
|
|
95
|
+
}, children: [hostControl ? (_jsx(PopoverAnchor, { className: "absolute right-3 top-0 size-0" })) : (_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { size: "sm", className: "ml-auto h-9 rounded-full bg-white px-4 font-extrabold text-[var(--editor-green-deep)] hover:bg-white/90 max-canvas-mobile:h-8 max-canvas-mobile:px-3", children: [_jsx(IoShareOutline, { className: "size-4" }), _jsx("span", { children: t.shell.share })] }) })), _jsxs(PopoverContent, { align: "end", sideOffset: 8, className: "w-80 p-0 overflow-hidden", children: [view === 'download' ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "px-4 pt-3 pb-1", children: _jsxs("button", { type: "button", onClick: () => setView('main'), className: "flex items-center gap-2 bg-transparent border-none cursor-pointer p-0 text-sm font-semibold text-foreground transition-colors duration-150 hover:text-primary-600", children: [_jsx(PiArrowLeft, { size: 16 }), "Download"] }) }), _jsx("div", { className: "px-4 pt-2 pb-4", children: _jsx(DownloadSection, { onDownload: onDownload, onDownloadAllZip: onDownloadAllZip, pageCount: pageCount, isMultiExporting: isMultiExporting, exportProgress: exportProgress, exportError: exportError, exportNotice: exportNotice, printExport: printExport, slideDeck: slideDeck }) })] })) : (_jsxs(_Fragment, { children: [_jsx("div", { className: "px-4 pt-4 pb-2", children: _jsx("h3", { className: "text-base font-semibold text-foreground m-0", children: t.shell.share }) }), _jsxs(IconButtonRow, { gap: "lg", padding: "md", className: "justify-center py-3", children: [_jsx(IconButton, { size: "sm", icon: _jsx(PiDownloadSimple, {}), label: t.shell.downloadTab, onClick: () => setView('download') }), shareRoute !== null && (_jsx(IconButton, { size: "sm", icon: isSharing ? (_jsx(Skeleton, { className: "size-4 rounded-full" })) : shareSuccess ? (_jsx(PiCheck, {})) : (_jsx(IoShareOutline, {})), label: shareSuccess ? t.shell.shared : t.shell.share, onClick: handleNativeShare, disabled: isSharing })), onSaveAsTemplate && (_jsx(IconButton, { size: "sm", icon: _jsx(PiFloppyDisk, {}), label: t.shell.template, onClick: () => {
|
|
96
|
+
setOpen(false);
|
|
97
|
+
onSaveAsTemplate();
|
|
98
|
+
} })), onInvitePeople && (_jsx(IconButton, { size: "sm", icon: _jsx(PiUserPlus, {}), label: t.shell.people, onClick: () => {
|
|
99
|
+
setOpen(false);
|
|
100
|
+
onInvitePeople();
|
|
101
|
+
} })), isMobile && feedback?.canRequest() && (_jsx(IconButton, { size: "sm", icon: _jsx(PiMegaphone, {}), label: t.shell.feedback, onClick: () => {
|
|
102
|
+
setOpen(false);
|
|
103
|
+
feedback?.request();
|
|
104
|
+
} }))] }), _jsx("div", { className: "px-4 pb-4", children: _jsx(AltTextField, { value: altText, onChange: setAltText }) })] })), photoCredit && (_jsxs("div", { className: "mx-4 mb-4 flex flex-col gap-2 rounded-md border border-[var(--editor-border-soft)] p-3", children: [_jsx("p", { className: "m-0 text-xs font-semibold text-foreground", children: t.credit.heading }), _jsx("p", { className: "m-0 text-xs text-muted-foreground", children: t.credit.notYours }), _jsx("p", { className: "m-0 select-all text-sm text-foreground", children: photoCredit }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => {
|
|
105
|
+
void navigator.clipboard.writeText(photoCredit).then(() => {
|
|
106
|
+
setCreditCopied(true);
|
|
107
|
+
setTimeout(() => setCreditCopied(false), 2000);
|
|
108
|
+
});
|
|
109
|
+
}, children: [creditCopied ? _jsx(PiCheck, { className: "size-3" }) : null, creditCopied ? t.shell.copied : t.shell.copyPhotoCredit] })] }))] })] }));
|
|
110
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function TopBar({ visible, children }) {
|
|
3
|
+
if (!visible)
|
|
4
|
+
return null;
|
|
5
|
+
return (_jsx("div", { "data-tour": "canvas-topbar", className: "sticky top-0 z-[110] w-full h-[var(--editor-topbar-height)] shrink-0 bg-[image:var(--editor-menubar-gradient)] text-white px-4 flex items-center gap-1 animate-canvas-slide-down-fade transition-all duration-300 max-canvas-mobile:h-[52px] max-canvas-mobile:px-2.5 max-canvas-mobile:gap-1", children: children }));
|
|
6
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function BarTilesProvider({ children }: {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}): React.JSX.Element;
|
|
5
|
+
export declare function useBarTiles(): boolean;
|
|
6
|
+
/** Eine Kachel: Icon oben, Wort darunter, 56 px hoch; die Wörter stehen unten auf einer Linie. */
|
|
7
|
+
export declare const TILE = "inline-flex flex-col items-center justify-end gap-1 min-w-14 h-14 px-1.5 pb-2 shrink-0 rounded-lg border-none bg-transparent cursor-pointer whitespace-nowrap text-[11px] font-medium leading-none text-[var(--editor-text)] transition-colors duration-150 hover:bg-[var(--editor-surface-hover)] data-[state=open]:bg-[var(--editor-active-bg)] data-[state=open]:text-[var(--editor-active-fg)] aria-pressed:bg-[var(--editor-active-bg)] aria-pressed:text-[var(--editor-active-fg)] disabled:opacity-30 disabled:cursor-not-allowed";
|
|
8
|
+
/**
|
|
9
|
+
* Das Wort unter der Kachel, nur im Kachel-Modus. `decorative`, wo das Wort
|
|
10
|
+
* eine Gruppe beschriftet, deren Knöpfe eigene Namen tragen (Schriftgröße).
|
|
11
|
+
*/
|
|
12
|
+
export declare function TileCaption({ children, decorative, }: {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
decorative?: boolean;
|
|
15
|
+
}): React.JSX.Element | null;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { createContext, useContext } from 'react';
|
|
4
|
+
import { cn } from '@ggraphic/editor/utils/cn';
|
|
5
|
+
/**
|
|
6
|
+
* Kacheln statt Knöpfe: mobil steht unter jedem Werkzeug der Auswahl-Leiste
|
|
7
|
+
* sein Name, wie in der Bereichs-Leiste und bei Canva — eine Reihe nackter
|
|
8
|
+
* Icons neben dem Wort „Position“ wirkte unruhig und sagte nicht, was ein
|
|
9
|
+
* Knopf tut. Die Bausteine bleiben dieselben; `MobileSelectionBar` setzt den
|
|
10
|
+
* Kontext, die Desktop-Leiste und das mobile Sheet nicht.
|
|
11
|
+
*
|
|
12
|
+
* Wo die Kachel ein Wort zeigt, muss der Name des Knopfs damit beginnen
|
|
13
|
+
* (WCAG 2.5.3): Sprachsteuerung tippt, was sie sieht.
|
|
14
|
+
*/
|
|
15
|
+
const BarTilesContext = createContext(false);
|
|
16
|
+
export function BarTilesProvider({ children }) {
|
|
17
|
+
return _jsx(BarTilesContext.Provider, { value: true, children: children });
|
|
18
|
+
}
|
|
19
|
+
export function useBarTiles() {
|
|
20
|
+
return useContext(BarTilesContext);
|
|
21
|
+
}
|
|
22
|
+
/** Eine Kachel: Icon oben, Wort darunter, 56 px hoch; die Wörter stehen unten auf einer Linie. */
|
|
23
|
+
export const TILE = 'inline-flex flex-col items-center justify-end gap-1 min-w-14 h-14 px-1.5 pb-2 shrink-0 rounded-lg border-none bg-transparent cursor-pointer whitespace-nowrap text-[11px] font-medium leading-none text-[var(--editor-text)] transition-colors duration-150 hover:bg-[var(--editor-surface-hover)] data-[state=open]:bg-[var(--editor-active-bg)] data-[state=open]:text-[var(--editor-active-fg)] aria-pressed:bg-[var(--editor-active-bg)] aria-pressed:text-[var(--editor-active-fg)] disabled:opacity-30 disabled:cursor-not-allowed';
|
|
24
|
+
/**
|
|
25
|
+
* Das Wort unter der Kachel, nur im Kachel-Modus. `decorative`, wo das Wort
|
|
26
|
+
* eine Gruppe beschriftet, deren Knöpfe eigene Namen tragen (Schriftgröße).
|
|
27
|
+
*/
|
|
28
|
+
export function TileCaption({ children, decorative = false, }) {
|
|
29
|
+
if (!useBarTiles())
|
|
30
|
+
return null;
|
|
31
|
+
return (_jsx("span", { className: cn('text-[11px] font-medium leading-none text-[var(--editor-text-secondary)]',
|
|
32
|
+
// A label only: taps go to the control underneath.
|
|
33
|
+
decorative && 'pointer-events-none'), "aria-hidden": decorative || undefined, children: children }));
|
|
34
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Banner shown in the canvas top bar after the AI auto-applies a suggestion.
|
|
3
|
+
* Two actions:
|
|
4
|
+
* - ✓ Behalten: clears the pending flag.
|
|
5
|
+
* - ↶ Verwerfen: invokes the canvas's standard undo (passed in by Toolbar
|
|
6
|
+
* from `toolbarHandlers.undo` in CanvasEditor — same path as the existing
|
|
7
|
+
* toolbar undo button and Cmd+Z, which hits the per-page inner store).
|
|
8
|
+
*
|
|
9
|
+
* `onUndo` MUST be the per-page canvas undo (via GenericCanvas's imperative
|
|
10
|
+
* handle), NOT `useCanvasStoreSelector(s => s.undo)` — the banner renders
|
|
11
|
+
* outside the per-page CanvasStoreProvider, so the selector falls through to
|
|
12
|
+
* the singleton store which has no history.
|
|
13
|
+
*
|
|
14
|
+
* A suggestion flagged `undo: 'pages'` (spec path: the deck was replaced in one
|
|
15
|
+
* Yjs step) reverts through `onUndoPages`, which discards that replacement for
|
|
16
|
+
* good (`discardReplaceDeck`: Redo does not bring it back). The „Vorlagen"
|
|
17
|
+
* tab uses the same banner after replacing a design (`source: 'vorlage'`).
|
|
18
|
+
*
|
|
19
|
+
* `variant="card"` is the same decision over the locked canvas, in the slot of
|
|
20
|
+
* the selection bar: while a suggestion is open the pages take no input.
|
|
21
|
+
*/
|
|
22
|
+
interface FloatingAiSuggestionBannerProps {
|
|
23
|
+
onUndo: () => void;
|
|
24
|
+
onUndoPages: () => void;
|
|
25
|
+
variant?: 'bar' | 'card';
|
|
26
|
+
}
|
|
27
|
+
export declare function FloatingAiSuggestionBanner({ onUndo, onUndoPages, variant, }: FloatingAiSuggestionBannerProps): import("react").JSX.Element | null;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
4
|
+
import { useCanvasStoreSelector } from '@ggraphic/editor/stores/CanvasStoreProvider';
|
|
5
|
+
import { Check, LayoutTemplate, RotateCcw, Sparkles } from 'lucide-react';
|
|
6
|
+
export function FloatingAiSuggestionBanner({ onUndo, onUndoPages, variant = 'bar', }) {
|
|
7
|
+
const t = useMessages();
|
|
8
|
+
const pending = useCanvasStoreSelector((s) => s.pendingAiSuggestion);
|
|
9
|
+
const setPending = useCanvasStoreSelector((s) => s.setPendingAiSuggestion);
|
|
10
|
+
if (!pending)
|
|
11
|
+
return null;
|
|
12
|
+
const noun = pending.source === 'vorlage' ? t.topBar.aiTemplate : t.topBar.aiSuggestionNoun;
|
|
13
|
+
const Icon = pending.source === 'vorlage' ? LayoutTemplate : Sparkles;
|
|
14
|
+
const handleAccept = () => setPending(null);
|
|
15
|
+
const handleReject = () => {
|
|
16
|
+
if (pending.undo === 'pages')
|
|
17
|
+
onUndoPages();
|
|
18
|
+
else
|
|
19
|
+
onUndo();
|
|
20
|
+
setPending(null);
|
|
21
|
+
};
|
|
22
|
+
if (variant === 'card') {
|
|
23
|
+
return (_jsxs("div", { role: "status", className: "inline-flex items-center gap-3 max-w-full rounded-xl border border-[var(--editor-border-soft)] bg-[var(--editor-surface)] py-1.5 pl-3 pr-1.5 shadow-[0_2px_8px_rgba(0,0,0,0.06)] animate-canvas-slide-down-fade", children: [_jsx(Icon, { className: "size-4 shrink-0 text-[var(--editor-text-secondary)]", "aria-hidden": "true" }), _jsxs("span", { className: "min-w-0 truncate text-[13px] text-[var(--editor-text)]", children: [_jsxs("strong", { className: "font-medium", children: [noun, " \u201E", pending.title, "\u201C"] }), ' ', t.topBar.aiPendingTail] }), _jsxs("button", { type: "button", onClick: handleReject, className: "inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border-none bg-transparent px-2 text-[13px] font-medium text-[var(--editor-text)] cursor-pointer transition-colors duration-150 hover:bg-[var(--editor-surface-hover)]", children: [_jsx(RotateCcw, { className: "size-4", "aria-hidden": "true" }), t.topBar.discard] }), _jsxs("button", { type: "button", onClick: handleAccept, className: "inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border-none bg-primary px-3 text-[13px] font-medium text-white cursor-pointer transition-opacity duration-200 hover:opacity-90", children: [_jsx(Check, { className: "size-4", "aria-hidden": "true" }), t.topBar.keep] })] }));
|
|
24
|
+
}
|
|
25
|
+
return (_jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { className: "size-4 shrink-0 text-white/90", "aria-hidden": "true" }), _jsxs("span", { className: "flex-1 truncate text-xs font-medium text-white", children: [noun, ": ", pending.title] }), _jsx("button", { type: "button", onClick: handleReject, className: "size-8 max-canvas-mobile:size-10 rounded-full border-none bg-transparent flex items-center justify-center text-white/90 transition-[background-color,color] duration-200 hover:bg-white/15 hover:text-white cursor-pointer", title: t.topBar.aiDiscardUndo(noun), "aria-label": t.topBar.aiDiscard(noun), children: _jsx(RotateCcw, { className: "size-4" }) }), _jsx("button", { type: "button", onClick: handleAccept, className: "size-8 max-canvas-mobile:size-10 rounded-full border-none bg-primary flex items-center justify-center text-white transition-opacity duration-200 hover:opacity-90 cursor-pointer", title: t.topBar.aiKeep(noun), "aria-label": t.topBar.aiKeep(noun), children: _jsx(Check, { className: "size-4" }) })] }));
|
|
26
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { StockImageAttribution } from '@ggraphic/editor/common/imageSourceTypes';
|
|
2
|
+
import type { BackgroundControls } from '@ggraphic/editor/configs/types';
|
|
3
|
+
type ImageChange = NonNullable<BackgroundControls['onImageChange']>;
|
|
4
|
+
/**
|
|
5
|
+
* Picks the background photo from the user's uploads, or uploads a new one into
|
|
6
|
+
* the library first so the background gets its durable URL.
|
|
7
|
+
*/
|
|
8
|
+
export declare function BackgroundImagePicker({ label, currentImageSrc, onImageChange, openRequest, }: {
|
|
9
|
+
label: string;
|
|
10
|
+
currentImageSrc?: string;
|
|
11
|
+
onImageChange: ImageChange;
|
|
12
|
+
/** Each new value opens the picker — the context menu's "Bild ersetzen …". */
|
|
13
|
+
openRequest?: number;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
/** Zoom of the background photo. It has no on-canvas handles, so this is the only way. */
|
|
16
|
+
export declare function BackgroundZoomControl({ scale, onScaleChange, }: {
|
|
17
|
+
scale: number;
|
|
18
|
+
onScaleChange: (scale: number) => void;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
20
|
+
export declare function BackgroundRestoreImageButton({ onRestore }: {
|
|
21
|
+
onRestore: () => void;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
export declare function BackgroundRemoveImageButton({ onRemove }: {
|
|
24
|
+
onRemove: () => void;
|
|
25
|
+
}): import("react").JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* Makes the selected own image the background photo and removes it as an
|
|
28
|
+
* element. Only for durable URLs: a `blob:` preview would die on reload.
|
|
29
|
+
*/
|
|
30
|
+
export declare function SetAsBackgroundButton({ src, fileName, attribution, onImageChange, onRemoveElement, }: {
|
|
31
|
+
src: string;
|
|
32
|
+
fileName: string;
|
|
33
|
+
/** Stock credit of the photo; the background keeps it. */
|
|
34
|
+
attribution?: StockImageAttribution;
|
|
35
|
+
onImageChange: ImageChange;
|
|
36
|
+
onRemoveElement: () => void;
|
|
37
|
+
}): import("react").JSX.Element;
|
|
38
|
+
export {};
|