@ggraphic/editor 0.0.0-stage → 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +373 -0
- package/NOTICE +2 -0
- package/README.md +8 -2
- package/THIRD_PARTY_NOTICES +7 -0
- package/dist/CanvasEditorProvider.d.ts +214 -0
- package/dist/CanvasEditorProvider.js +10 -0
- package/dist/ai/applyOperation.d.ts +75 -0
- package/dist/ai/applyOperation.js +354 -0
- package/dist/ai/describeCanvasElements.d.ts +17 -0
- package/dist/ai/describeCanvasElements.js +148 -0
- package/dist/ai/illustrationCapability.d.ts +6 -0
- package/dist/ai/illustrationCapability.js +20 -0
- package/dist/ai/types.d.ts +91 -0
- package/dist/ai/types.js +1 -0
- package/dist/blocks/liftedBlock.d.ts +61 -0
- package/dist/blocks/liftedBlock.js +117 -0
- package/dist/brand/bindPick.d.ts +18 -0
- package/dist/brand/bindPick.js +28 -0
- package/dist/brand/bindableFields.d.ts +9 -0
- package/dist/brand/bindableFields.js +61 -0
- package/dist/brand/brandRegistry.d.ts +26 -0
- package/dist/brand/brandRegistry.js +56 -0
- package/dist/brand/composerBrand.d.ts +146 -0
- package/dist/brand/composerBrand.js +6 -0
- package/dist/brand/documentBrand.d.ts +16 -0
- package/dist/brand/documentBrand.js +6 -0
- package/dist/collab/documentVersion.d.ts +36 -0
- package/dist/collab/documentVersion.js +139 -0
- package/dist/collab/pageElementStateKeys.d.ts +33 -0
- package/dist/collab/pageElementStateKeys.js +148 -0
- package/dist/collab/pagesDoc.d.ts +152 -0
- package/dist/collab/pagesDoc.js +434 -0
- package/dist/collab/useAwarenessState.d.ts +12 -0
- package/dist/collab/useAwarenessState.js +47 -0
- package/dist/collab/useEmitHostStateChanges.d.ts +18 -0
- package/dist/collab/useEmitHostStateChanges.js +40 -0
- package/dist/collab/useSelectionAwareness.d.ts +22 -0
- package/dist/collab/useSelectionAwareness.js +60 -0
- package/dist/collab/useYjsCanvasBinding.d.ts +7 -0
- package/dist/collab/useYjsCanvasBinding.js +21 -0
- package/dist/collab/useYjsPageStateSync.d.ts +20 -0
- package/dist/collab/useYjsPageStateSync.js +49 -0
- package/dist/collab/useYjsPages.d.ts +73 -0
- package/dist/collab/useYjsPages.js +396 -0
- package/dist/collab/wrapCallbacksWithPageSync.d.ts +3 -0
- package/dist/collab/wrapCallbacksWithPageSync.js +62 -0
- package/dist/collab/ydocKeys.d.ts +50 -0
- package/dist/collab/ydocKeys.js +50 -0
- package/dist/collab/yjsBinding.d.ts +27 -0
- package/dist/collab/yjsBinding.js +105 -0
- package/dist/common/Lightbox.d.ts +8 -0
- package/dist/common/Lightbox.js +8 -0
- package/dist/common/imageSourceTypes.d.ts +1 -0
- package/dist/common/imageSourceTypes.js +1 -0
- package/dist/components/AddPageButton.d.ts +13 -0
- package/dist/components/AddPageButton.js +13 -0
- package/dist/components/CanvasAnnouncer.d.ts +8 -0
- package/dist/components/CanvasAnnouncer.js +10 -0
- package/dist/components/CanvasContextMenu/CanvasActionSheet.d.ts +12 -0
- package/dist/components/CanvasContextMenu/CanvasActionSheet.js +145 -0
- package/dist/components/CanvasContextMenu/CanvasContextMenu.d.ts +33 -0
- package/dist/components/CanvasContextMenu/CanvasContextMenu.js +107 -0
- package/dist/components/CanvasContextMenu/canvasMenuModel.d.ts +68 -0
- package/dist/components/CanvasContextMenu/canvasMenuModel.js +203 -0
- package/dist/components/CanvasEditor/CanvasEditorShell.d.ts +32 -0
- package/dist/components/CanvasEditor/CanvasEditorShell.js +1144 -0
- package/dist/components/CanvasEditor/PageWrapper.d.ts +7 -0
- package/dist/components/CanvasEditor/PageWrapper.js +103 -0
- package/dist/components/CanvasEditor/autoSwitchTab.d.ts +11 -0
- package/dist/components/CanvasEditor/autoSwitchTab.js +15 -0
- package/dist/components/CanvasEditor/blockInsertContext.d.ts +22 -0
- package/dist/components/CanvasEditor/blockInsertContext.js +5 -0
- package/dist/components/CanvasEditor/editorShell.d.ts +99 -0
- package/dist/components/CanvasEditor/editorShell.js +20 -0
- package/dist/components/CanvasEditor/hooks/useCanvasContextMenu.d.ts +32 -0
- package/dist/components/CanvasEditor/hooks/useCanvasContextMenu.js +140 -0
- package/dist/components/CanvasEditor/hooks/useLoadedConfigs.d.ts +13 -0
- package/dist/components/CanvasEditor/hooks/useLoadedConfigs.js +29 -0
- package/dist/components/CanvasEditor/hooks/useMobileSheetFit.d.ts +14 -0
- package/dist/components/CanvasEditor/hooks/useMobileSheetFit.js +56 -0
- package/dist/components/CanvasEditor/hooks/usePageRefs.d.ts +18 -0
- package/dist/components/CanvasEditor/hooks/usePageRefs.js +36 -0
- package/dist/components/CanvasEditor/hooks/usePageUndoRedoShortcuts.d.ts +25 -0
- package/dist/components/CanvasEditor/hooks/usePageUndoRedoShortcuts.js +49 -0
- package/dist/components/CanvasEditor/hooks/usePrintImpressumGate.d.ts +17 -0
- package/dist/components/CanvasEditor/hooks/usePrintImpressumGate.js +70 -0
- package/dist/components/CanvasEditor/hooks/useScrollToAddedPage.d.ts +17 -0
- package/dist/components/CanvasEditor/hooks/useScrollToAddedPage.js +31 -0
- package/dist/components/CanvasEditor/hooks/useToolbarHandlers.d.ts +75 -0
- package/dist/components/CanvasEditor/hooks/useToolbarHandlers.js +69 -0
- package/dist/components/CanvasEditor/hooks/useWorkAreaDeselect.d.ts +6 -0
- package/dist/components/CanvasEditor/hooks/useWorkAreaDeselect.js +56 -0
- package/dist/components/CanvasEditor/layersTab.d.ts +13 -0
- package/dist/components/CanvasEditor/layersTab.js +27 -0
- package/dist/components/CanvasEditor/mobileSelectionArea.d.ts +8 -0
- package/dist/components/CanvasEditor/mobileSelectionArea.js +27 -0
- package/dist/components/CanvasEditor/types.d.ts +202 -0
- package/dist/components/CanvasEditor/types.js +1 -0
- package/dist/components/CanvasEditorSkeleton.d.ts +16 -0
- package/dist/components/CanvasEditorSkeleton.js +24 -0
- package/dist/components/CanvasMetaBar.d.ts +16 -0
- package/dist/components/CanvasMetaBar.js +33 -0
- package/dist/components/CanvasRenderLayer.d.ts +37 -0
- package/dist/components/CanvasRenderLayer.js +54 -0
- package/dist/components/CanvasTextOverlay.d.ts +126 -0
- package/dist/components/CanvasTextOverlay.js +527 -0
- package/dist/components/ConfigCanvas.d.ts +35 -0
- package/dist/components/ConfigCanvas.js +30 -0
- package/dist/components/CropGhostOverlay.d.ts +13 -0
- package/dist/components/CropGhostOverlay.js +56 -0
- package/dist/components/CustomColorSwatch.d.ts +35 -0
- package/dist/components/CustomColorSwatch.js +81 -0
- package/dist/components/DownloadNotice.d.ts +7 -0
- package/dist/components/DownloadNotice.js +7 -0
- package/dist/components/GenericCanvas.d.ts +309 -0
- package/dist/components/GenericCanvas.js +787 -0
- package/dist/components/GenericCanvasElement.d.ts +34 -0
- package/dist/components/GenericCanvasElement.js +267 -0
- package/dist/components/MultiSelectionTransformer.d.ts +39 -0
- package/dist/components/MultiSelectionTransformer.js +107 -0
- package/dist/components/PagePreview.d.ts +14 -0
- package/dist/components/PagePreview.js +63 -0
- package/dist/components/PageThumbnailStrip.d.ts +25 -0
- package/dist/components/PageThumbnailStrip.js +46 -0
- package/dist/components/PageToolbar.d.ts +12 -0
- package/dist/components/PageToolbar.js +20 -0
- package/dist/components/PrintGuides.d.ts +13 -0
- package/dist/components/PrintGuides.js +28 -0
- package/dist/components/RemoteSelectionOverlay.d.ts +15 -0
- package/dist/components/RemoteSelectionOverlay.js +29 -0
- package/dist/components/RichTextField.d.ts +34 -0
- package/dist/components/RichTextField.js +216 -0
- package/dist/components/SelectionPill.d.ts +56 -0
- package/dist/components/SelectionPill.js +123 -0
- package/dist/components/SlideNotesPanel.d.ts +13 -0
- package/dist/components/SlideNotesPanel.js +28 -0
- package/dist/components/SlotBudgetStatus.d.ts +12 -0
- package/dist/components/SlotBudgetStatus.js +64 -0
- package/dist/components/StandaloneCanvas.d.ts +33 -0
- package/dist/components/StandaloneCanvas.js +61 -0
- package/dist/components/TextFormatButtons.d.ts +61 -0
- package/dist/components/TextFormatButtons.js +107 -0
- package/dist/components/TextFormatControls.d.ts +26 -0
- package/dist/components/TextFormatControls.js +73 -0
- package/dist/components/Toolbar.d.ts +40 -0
- package/dist/components/Toolbar.js +26 -0
- package/dist/components/ToolbarStateBridge.d.ts +72 -0
- package/dist/components/ToolbarStateBridge.js +298 -0
- package/dist/components/TopBar/AutoSaveIndicator.d.ts +8 -0
- package/dist/components/TopBar/AutoSaveIndicator.js +44 -0
- package/dist/components/TopBar/ContextControls.d.ts +107 -0
- package/dist/components/TopBar/ContextControls.js +321 -0
- package/dist/components/TopBar/ContextToolbar.d.ts +14 -0
- package/dist/components/TopBar/ContextToolbar.js +20 -0
- package/dist/components/TopBar/CropModeControls.d.ts +35 -0
- package/dist/components/TopBar/CropModeControls.js +84 -0
- package/dist/components/TopBar/DownloadSection.d.ts +47 -0
- package/dist/components/TopBar/DownloadSection.js +102 -0
- package/dist/components/TopBar/MobileSelectionBar.d.ts +16 -0
- package/dist/components/TopBar/MobileSelectionBar.js +26 -0
- package/dist/components/TopBar/MobileSelectionControls.d.ts +10 -0
- package/dist/components/TopBar/MobileSelectionControls.js +43 -0
- package/dist/components/TopBar/MultiSelectionToolbar.d.ts +19 -0
- package/dist/components/TopBar/MultiSelectionToolbar.js +30 -0
- package/dist/components/TopBar/ShareDropdown.d.ts +54 -0
- package/dist/components/TopBar/ShareDropdown.js +110 -0
- package/dist/components/TopBar/TopBar.d.ts +6 -0
- package/dist/components/TopBar/TopBar.js +6 -0
- package/dist/components/TopBar/barTiles.d.ts +15 -0
- package/dist/components/TopBar/barTiles.js +34 -0
- package/dist/components/TopBar/modules/FloatingAiSuggestionBanner.d.ts +28 -0
- package/dist/components/TopBar/modules/FloatingAiSuggestionBanner.js +26 -0
- package/dist/components/TopBar/modules/FloatingBackgroundControls.d.ts +38 -0
- package/dist/components/TopBar/modules/FloatingBackgroundControls.js +133 -0
- package/dist/components/TopBar/modules/FloatingColorPicker.d.ts +16 -0
- package/dist/components/TopBar/modules/FloatingColorPicker.js +89 -0
- package/dist/components/TopBar/modules/FloatingFontRoleControl.d.ts +17 -0
- package/dist/components/TopBar/modules/FloatingFontRoleControl.js +37 -0
- package/dist/components/TopBar/modules/FloatingFontSizeControl.d.ts +7 -0
- package/dist/components/TopBar/modules/FloatingFontSizeControl.js +22 -0
- package/dist/components/TopBar/modules/FloatingHistoryControls.d.ts +11 -0
- package/dist/components/TopBar/modules/FloatingHistoryControls.js +19 -0
- package/dist/components/TopBar/modules/FloatingImageLookControl.d.ts +9 -0
- package/dist/components/TopBar/modules/FloatingImageLookControl.js +15 -0
- package/dist/components/TopBar/modules/FloatingLayerControls.d.ts +9 -0
- package/dist/components/TopBar/modules/FloatingLayerControls.js +9 -0
- package/dist/components/TopBar/modules/FloatingOpacityControl.d.ts +11 -0
- package/dist/components/TopBar/modules/FloatingOpacityControl.js +19 -0
- package/dist/components/TopBar/modules/FloatingPositionControl.d.ts +38 -0
- package/dist/components/TopBar/modules/FloatingPositionControl.js +74 -0
- package/dist/components/TopBar/modules/FloatingTextAlignControl.d.ts +12 -0
- package/dist/components/TopBar/modules/FloatingTextAlignControl.js +27 -0
- package/dist/components/TransformHud.d.ts +11 -0
- package/dist/components/TransformHud.js +121 -0
- package/dist/components/WholeTextFormatControls.d.ts +10 -0
- package/dist/components/WholeTextFormatControls.js +37 -0
- package/dist/components/ZoomableViewport.d.ts +6 -0
- package/dist/components/ZoomableViewport.js +4 -0
- package/dist/components/accentMark.d.ts +20 -0
- package/dist/components/accentMark.js +24 -0
- package/dist/components/canvasItemLock.d.ts +13 -0
- package/dist/components/canvasItemLock.js +12 -0
- package/dist/components/kindRenderers.d.ts +118 -0
- package/dist/components/kindRenderers.js +151 -0
- package/dist/components/markColor.d.ts +13 -0
- package/dist/components/markColor.js +21 -0
- package/dist/components/markerMark.d.ts +24 -0
- package/dist/components/markerMark.js +22 -0
- package/dist/composer/cardFollowsText.d.ts +17 -0
- package/dist/composer/cardFollowsText.js +34 -0
- package/dist/composer/marks.d.ts +4 -0
- package/dist/composer/marks.js +15 -0
- package/dist/composer/steckbriefLayout.d.ts +147 -0
- package/dist/composer/steckbriefLayout.js +468 -0
- package/dist/composer/textFit.d.ts +31 -0
- package/dist/composer/textFit.js +89 -0
- package/dist/configs/buildSharepicText.d.ts +5 -0
- package/dist/configs/buildSharepicText.js +58 -0
- package/dist/configs/configLoader.d.ts +34 -0
- package/dist/configs/configLoader.js +60 -0
- package/dist/configs/factory/actionFactories.d.ts +201 -0
- package/dist/configs/factory/actionFactories.js +628 -0
- package/dist/configs/factory/baseTypes.d.ts +150 -0
- package/dist/configs/factory/baseTypes.js +8 -0
- package/dist/configs/factory/carryInstanceState.d.ts +82 -0
- package/dist/configs/factory/carryInstanceState.js +121 -0
- package/dist/configs/factory/createTextElement.d.ts +63 -0
- package/dist/configs/factory/createTextElement.js +63 -0
- package/dist/configs/factory/defineSection.d.ts +45 -0
- package/dist/configs/factory/defineSection.js +45 -0
- package/dist/configs/factory/layoutAccessors.d.ts +15 -0
- package/dist/configs/factory/layoutAccessors.js +20 -0
- package/dist/configs/featureInjector.d.ts +40 -0
- package/dist/configs/featureInjector.js +184 -0
- package/dist/configs/pageInheritance.d.ts +8 -0
- package/dist/configs/pageInheritance.js +82 -0
- package/dist/configs/placeholders.d.ts +14 -0
- package/dist/configs/placeholders.js +33 -0
- package/dist/configs/shareSection.d.ts +11 -0
- package/dist/configs/shareSection.js +65 -0
- package/dist/configs/types.d.ts +431 -0
- package/dist/configs/types.js +1 -0
- package/dist/configs/unifiedTabs.d.ts +26 -0
- package/dist/configs/unifiedTabs.js +6 -0
- package/dist/editorSeamTypes.d.ts +41 -0
- package/dist/editorSeamTypes.js +1 -0
- package/dist/export/pptx/buildPptxModel.d.ts +47 -0
- package/dist/export/pptx/buildPptxModel.js +612 -0
- package/dist/export/pptx/exportPptxDeck.d.ts +26 -0
- package/dist/export/pptx/exportPptxDeck.js +80 -0
- package/dist/export/pptx/pptxFonts.d.ts +26 -0
- package/dist/export/pptx/pptxFonts.js +41 -0
- package/dist/export/pptx/pptxUnits.d.ts +27 -0
- package/dist/export/pptx/pptxUnits.js +54 -0
- package/dist/export/pptx/textModel.d.ts +17 -0
- package/dist/export/pptx/textModel.js +118 -0
- package/dist/export/pptx/types.d.ts +161 -0
- package/dist/export/pptx/types.js +11 -0
- package/dist/export/pptx/writePptx.d.ts +40 -0
- package/dist/export/pptx/writePptx.js +206 -0
- package/dist/export/pptx/writeText.d.ts +19 -0
- package/dist/export/pptx/writeText.js +120 -0
- package/dist/export/printExport.d.ts +42 -0
- package/dist/export/printExport.js +94 -0
- package/dist/export/printPdf.d.ts +103 -0
- package/dist/export/printPdf.js +144 -0
- package/dist/export/slidesPdf.d.ts +9 -0
- package/dist/export/slidesPdf.js +31 -0
- package/dist/formats/index.d.ts +115 -0
- package/dist/formats/index.js +287 -0
- package/dist/groups/pageGroups.d.ts +32 -0
- package/dist/groups/pageGroups.js +91 -0
- package/dist/hooks/index.d.ts +29 -0
- package/dist/hooks/index.js +19 -0
- package/dist/hooks/useAiImageGeneration.d.ts +15 -0
- package/dist/hooks/useAiImageGeneration.js +73 -0
- package/dist/hooks/useAnnounce.d.ts +27 -0
- package/dist/hooks/useAnnounce.js +47 -0
- package/dist/hooks/useBoxSnap.d.ts +37 -0
- package/dist/hooks/useBoxSnap.js +49 -0
- package/dist/hooks/useCanvasAutoSave.d.ts +33 -0
- package/dist/hooks/useCanvasAutoSave.js +259 -0
- package/dist/hooks/useCanvasElementHandlers.d.ts +182 -0
- package/dist/hooks/useCanvasElementHandlers.js +326 -0
- package/dist/hooks/useCanvasHistorySetup.d.ts +37 -0
- package/dist/hooks/useCanvasHistorySetup.js +113 -0
- package/dist/hooks/useCanvasInteractions.d.ts +31 -0
- package/dist/hooks/useCanvasInteractions.js +103 -0
- package/dist/hooks/useCanvasKeyboardHandlers.d.ts +37 -0
- package/dist/hooks/useCanvasKeyboardHandlers.js +280 -0
- package/dist/hooks/useCanvasStoreReset.d.ts +25 -0
- package/dist/hooks/useCanvasStoreReset.js +35 -0
- package/dist/hooks/useCanvasUndoRedo.d.ts +34 -0
- package/dist/hooks/useCanvasUndoRedo.js +213 -0
- package/dist/hooks/useContextPress.d.ts +14 -0
- package/dist/hooks/useContextPress.js +45 -0
- package/dist/hooks/useCropSession.d.ts +23 -0
- package/dist/hooks/useCropSession.js +69 -0
- package/dist/hooks/useDebounce.d.ts +1 -0
- package/dist/hooks/useDebounce.js +14 -0
- package/dist/hooks/useDeckAutoSave.d.ts +30 -0
- package/dist/hooks/useDeckAutoSave.js +234 -0
- package/dist/hooks/useDeepSelect.d.ts +18 -0
- package/dist/hooks/useDeepSelect.js +135 -0
- package/dist/hooks/useElementSnapping.d.ts +13 -0
- package/dist/hooks/useElementSnapping.js +26 -0
- package/dist/hooks/useEmojiCatalog.d.ts +3 -0
- package/dist/hooks/useEmojiCatalog.js +13 -0
- package/dist/hooks/useFloatingModuleHandlers.d.ts +52 -0
- package/dist/hooks/useFloatingModuleHandlers.js +285 -0
- package/dist/hooks/useFloatingModuleState.d.ts +83 -0
- package/dist/hooks/useFloatingModuleState.js +250 -0
- package/dist/hooks/useFontGeneration.d.ts +10 -0
- package/dist/hooks/useFontGeneration.js +77 -0
- package/dist/hooks/useFontLoader.d.ts +53 -0
- package/dist/hooks/useFontLoader.js +129 -0
- package/dist/hooks/useGeometryReporter.d.ts +19 -0
- package/dist/hooks/useGeometryReporter.js +41 -0
- package/dist/hooks/useHoverOutline.d.ts +8 -0
- package/dist/hooks/useHoverOutline.js +78 -0
- package/dist/hooks/useIconCatalog.d.ts +12 -0
- package/dist/hooks/useIconCatalog.js +30 -0
- package/dist/hooks/useIconSearch.d.ts +2 -0
- package/dist/hooks/useIconSearch.js +14 -0
- package/dist/hooks/useIconSetsFor.d.ts +8 -0
- package/dist/hooks/useIconSetsFor.js +30 -0
- package/dist/hooks/useImageCoverFit.d.ts +17 -0
- package/dist/hooks/useImageCoverFit.js +35 -0
- package/dist/hooks/useIsCanvasMobile.d.ts +3 -0
- package/dist/hooks/useIsCanvasMobile.js +19 -0
- package/dist/hooks/useMarqueeSelection.d.ts +27 -0
- package/dist/hooks/useMarqueeSelection.js +140 -0
- package/dist/hooks/useMobileSheet.d.ts +48 -0
- package/dist/hooks/useMobileSheet.js +282 -0
- package/dist/hooks/useMultiPageExport.d.ts +30 -0
- package/dist/hooks/useMultiPageExport.js +117 -0
- package/dist/hooks/usePageManager.d.ts +132 -0
- package/dist/hooks/usePageManager.js +399 -0
- package/dist/hooks/usePageThumbnails.d.ts +10 -0
- package/dist/hooks/usePageThumbnails.js +122 -0
- package/dist/hooks/usePaginatedIcons.d.ts +11 -0
- package/dist/hooks/usePaginatedIcons.js +46 -0
- package/dist/hooks/useRovingToolbar.d.ts +17 -0
- package/dist/hooks/useRovingToolbar.js +76 -0
- package/dist/hooks/useSelectionAnnouncement.d.ts +13 -0
- package/dist/hooks/useSelectionAnnouncement.js +68 -0
- package/dist/hooks/useSnapScheduler.d.ts +20 -0
- package/dist/hooks/useSnapScheduler.js +61 -0
- package/dist/hooks/useTrackUnsplashDownload.d.ts +6 -0
- package/dist/hooks/useTrackUnsplashDownload.js +19 -0
- package/dist/hooks/useZoomGestures.d.ts +35 -0
- package/dist/hooks/useZoomGestures.js +185 -0
- package/dist/hostServices.d.ts +308 -0
- package/dist/hostServices.js +107 -0
- package/dist/i18n/de.d.ts +897 -0
- package/dist/i18n/de.js +961 -0
- package/dist/i18n/en.d.ts +3 -0
- package/dist/i18n/en.js +949 -0
- package/dist/i18n/messages.d.ts +28 -0
- package/dist/i18n/messages.js +66 -0
- package/dist/layouts/CanvasEditorLayout.d.ts +28 -0
- package/dist/layouts/CanvasEditorLayout.js +56 -0
- package/dist/layouts/index.d.ts +2 -0
- package/dist/layouts/index.js +2 -0
- package/dist/primitives/AssetPrimitive.d.ts +24 -0
- package/dist/primitives/AssetPrimitive.js +158 -0
- package/dist/primitives/CanvasBackground.d.ts +33 -0
- package/dist/primitives/CanvasBackground.js +44 -0
- package/dist/primitives/CanvasIcons.d.ts +19 -0
- package/dist/primitives/CanvasIcons.js +46 -0
- package/dist/primitives/CanvasImage.d.ts +73 -0
- package/dist/primitives/CanvasImage.js +460 -0
- package/dist/primitives/CanvasRichText.d.ts +25 -0
- package/dist/primitives/CanvasRichText.js +284 -0
- package/dist/primitives/CanvasStage.d.ts +84 -0
- package/dist/primitives/CanvasStage.js +292 -0
- package/dist/primitives/CanvasText.d.ts +91 -0
- package/dist/primitives/CanvasText.js +293 -0
- package/dist/primitives/ChartPrimitive.d.ts +24 -0
- package/dist/primitives/ChartPrimitive.js +318 -0
- package/dist/primitives/CircleBadge.d.ts +43 -0
- package/dist/primitives/CircleBadge.js +233 -0
- package/dist/primitives/FramePrimitive.d.ts +14 -0
- package/dist/primitives/FramePrimitive.js +406 -0
- package/dist/primitives/IconPrimitive.d.ts +28 -0
- package/dist/primitives/IconPrimitive.js +119 -0
- package/dist/primitives/IllustrationPrimitive.d.ts +16 -0
- package/dist/primitives/IllustrationPrimitive.js +184 -0
- package/dist/primitives/PillBadge.d.ts +45 -0
- package/dist/primitives/PillBadge.js +237 -0
- package/dist/primitives/ShapePrimitive.d.ts +12 -0
- package/dist/primitives/ShapePrimitive.js +521 -0
- package/dist/primitives/SnapGuidelines.d.ts +19 -0
- package/dist/primitives/SnapGuidelines.js +34 -0
- package/dist/primitives/UserImagePrimitive.d.ts +30 -0
- package/dist/primitives/UserImagePrimitive.js +496 -0
- package/dist/primitives/index.d.ts +18 -0
- package/dist/primitives/index.js +11 -0
- package/dist/sidebar/SidebarPanel.d.ts +8 -0
- package/dist/sidebar/SidebarPanel.js +219 -0
- package/dist/sidebar/SidebarTabBar.d.ts +2 -0
- package/dist/sidebar/SidebarTabBar.js +31 -0
- package/dist/sidebar/SubsectionTabBar.d.ts +13 -0
- package/dist/sidebar/SubsectionTabBar.js +30 -0
- package/dist/sidebar/UserUploadsProvider.d.ts +31 -0
- package/dist/sidebar/UserUploadsProvider.js +139 -0
- package/dist/sidebar/components/AltTextField.d.ts +21 -0
- package/dist/sidebar/components/AltTextField.js +60 -0
- package/dist/sidebar/components/SidebarHint.d.ts +7 -0
- package/dist/sidebar/components/SidebarHint.js +38 -0
- package/dist/sidebar/components/SidebarSlider.d.ts +16 -0
- package/dist/sidebar/components/SidebarSlider.js +9 -0
- package/dist/sidebar/components/TextFieldPrimitives.d.ts +26 -0
- package/dist/sidebar/components/TextFieldPrimitives.js +56 -0
- package/dist/sidebar/sections/ChartSettingsSection.d.ts +9 -0
- package/dist/sidebar/sections/ChartSettingsSection.js +78 -0
- package/dist/sidebar/sections/CombinedTextSection.d.ts +16 -0
- package/dist/sidebar/sections/CombinedTextSection.js +43 -0
- package/dist/sidebar/sections/DiagrammeSection.d.ts +9 -0
- package/dist/sidebar/sections/DiagrammeSection.js +40 -0
- package/dist/sidebar/sections/EffectsSection.d.ts +20 -0
- package/dist/sidebar/sections/EffectsSection.js +23 -0
- package/dist/sidebar/sections/FormenSection.d.ts +28 -0
- package/dist/sidebar/sections/FormenSection.js +440 -0
- package/dist/sidebar/sections/FrameSettingsSection.d.ts +8 -0
- package/dist/sidebar/sections/FrameSettingsSection.js +26 -0
- package/dist/sidebar/sections/GenericShareSection.d.ts +26 -0
- package/dist/sidebar/sections/GenericShareSection.js +262 -0
- package/dist/sidebar/sections/IconsSection.d.ts +8 -0
- package/dist/sidebar/sections/IconsSection.js +55 -0
- package/dist/sidebar/sections/IllustrationSettings.d.ts +9 -0
- package/dist/sidebar/sections/IllustrationSettings.js +33 -0
- package/dist/sidebar/sections/IllustrationThumb.d.ts +7 -0
- package/dist/sidebar/sections/IllustrationThumb.js +15 -0
- package/dist/sidebar/sections/ImageAdjustSection.d.ts +13 -0
- package/dist/sidebar/sections/ImageAdjustSection.js +85 -0
- package/dist/sidebar/sections/LayersSection.d.ts +25 -0
- package/dist/sidebar/sections/LayersSection.js +155 -0
- package/dist/sidebar/sections/RahmenSection.d.ts +7 -0
- package/dist/sidebar/sections/RahmenSection.js +18 -0
- package/dist/sidebar/sections/StudioGallery.d.ts +33 -0
- package/dist/sidebar/sections/StudioGallery.js +58 -0
- package/dist/sidebar/sections/UploadsSection.d.ts +11 -0
- package/dist/sidebar/sections/UploadsSection.js +130 -0
- package/dist/sidebar/sections/assets/AssetsSection.d.ts +59 -0
- package/dist/sidebar/sections/assets/AssetsSection.js +27 -0
- package/dist/sidebar/sections/assets/BackgroundCatalog.d.ts +9 -0
- package/dist/sidebar/sections/assets/BackgroundCatalog.js +49 -0
- package/dist/sidebar/sections/assets/CategoryCard.d.ts +14 -0
- package/dist/sidebar/sections/assets/CategoryCard.js +15 -0
- package/dist/sidebar/sections/assets/ElementGrid.d.ts +14 -0
- package/dist/sidebar/sections/assets/ElementGrid.js +34 -0
- package/dist/sidebar/sections/assets/ElementThumb.d.ts +10 -0
- package/dist/sidebar/sections/assets/ElementThumb.js +61 -0
- package/dist/sidebar/sections/assets/ElementTile.d.ts +32 -0
- package/dist/sidebar/sections/assets/ElementTile.js +60 -0
- package/dist/sidebar/sections/assets/ElementsPanel.d.ts +7 -0
- package/dist/sidebar/sections/assets/ElementsPanel.js +249 -0
- package/dist/sidebar/sections/assets/EmojiTonePicker.d.ts +8 -0
- package/dist/sidebar/sections/assets/EmojiTonePicker.js +26 -0
- package/dist/sidebar/sections/assets/FotosCatalog.d.ts +12 -0
- package/dist/sidebar/sections/assets/FotosCatalog.js +41 -0
- package/dist/sidebar/sections/assets/IconifyCatalog.d.ts +14 -0
- package/dist/sidebar/sections/assets/IconifyCatalog.js +133 -0
- package/dist/sidebar/sections/assets/RecentCarousel.d.ts +7 -0
- package/dist/sidebar/sections/assets/RecentCarousel.js +42 -0
- package/dist/sidebar/sections/assets/StickerCatalog.d.ts +14 -0
- package/dist/sidebar/sections/assets/StickerCatalog.js +49 -0
- package/dist/sidebar/sections/assets/constants.d.ts +4 -0
- package/dist/sidebar/sections/assets/constants.js +15 -0
- package/dist/sidebar/sections/assets/elementPanelHost.d.ts +45 -0
- package/dist/sidebar/sections/assets/elementPanelHost.js +1 -0
- package/dist/sidebar/sections/assets/elementSearch.d.ts +10 -0
- package/dist/sidebar/sections/assets/elementSearch.js +38 -0
- package/dist/sidebar/sections/assets/elementTypes.d.ts +67 -0
- package/dist/sidebar/sections/assets/elementTypes.js +24 -0
- package/dist/sidebar/sections/assets/index.d.ts +3 -0
- package/dist/sidebar/sections/assets/index.js +3 -0
- package/dist/sidebar/sections/assets/useElementCatalog.d.ts +43 -0
- package/dist/sidebar/sections/assets/useElementCatalog.js +386 -0
- package/dist/sidebar/sections/assets/useRecentElements.d.ts +21 -0
- package/dist/sidebar/sections/assets/useRecentElements.js +67 -0
- package/dist/sidebar/sections/assets/useStockPhotos.d.ts +22 -0
- package/dist/sidebar/sections/assets/useStockPhotos.js +96 -0
- package/dist/sidebar/sections/effects/EffectCard.d.ts +11 -0
- package/dist/sidebar/sections/effects/EffectCard.js +14 -0
- package/dist/sidebar/sections/effects/GradientSettings.d.ts +10 -0
- package/dist/sidebar/sections/effects/GradientSettings.js +34 -0
- package/dist/sidebar/sections/effects/OutlineSettings.d.ts +12 -0
- package/dist/sidebar/sections/effects/OutlineSettings.js +29 -0
- package/dist/sidebar/sections/effects/ShadowSettings.d.ts +13 -0
- package/dist/sidebar/sections/effects/ShadowSettings.js +38 -0
- package/dist/sidebar/sections/effects/effectsFor.d.ts +16 -0
- package/dist/sidebar/sections/effects/effectsFor.js +24 -0
- package/dist/sidebar/sections/index.d.ts +28 -0
- package/dist/sidebar/sections/index.js +36 -0
- package/dist/sidebar/sections/lazyWithPreload.d.ts +11 -0
- package/dist/sidebar/sections/lazyWithPreload.js +29 -0
- package/dist/sidebar/sections/tools/AiCreateTool.d.ts +4 -0
- package/dist/sidebar/sections/tools/AiCreateTool.js +58 -0
- package/dist/sidebar/sections/tools/AiEditTool.d.ts +4 -0
- package/dist/sidebar/sections/tools/AiEditTool.js +57 -0
- package/dist/sidebar/sections/tools/AltTextTool.d.ts +11 -0
- package/dist/sidebar/sections/tools/AltTextTool.js +78 -0
- package/dist/sidebar/sections/tools/BlobCreatorTool.d.ts +5 -0
- package/dist/sidebar/sections/tools/BlobCreatorTool.js +90 -0
- package/dist/sidebar/sections/tools/GradientTextTool.d.ts +5 -0
- package/dist/sidebar/sections/tools/GradientTextTool.js +104 -0
- package/dist/sidebar/sections/tools/ImageInputPicker.d.ts +7 -0
- package/dist/sidebar/sections/tools/ImageInputPicker.js +68 -0
- package/dist/sidebar/sections/tools/QRCodeTool.d.ts +5 -0
- package/dist/sidebar/sections/tools/QRCodeTool.js +63 -0
- package/dist/sidebar/sections/tools/RemoveBackgroundTool.d.ts +4 -0
- package/dist/sidebar/sections/tools/RemoveBackgroundTool.js +52 -0
- package/dist/sidebar/sections/tools/TextPathCreatorTool.d.ts +5 -0
- package/dist/sidebar/sections/tools/TextPathCreatorTool.js +125 -0
- package/dist/sidebar/sections/tools/ToolPanel.d.ts +26 -0
- package/dist/sidebar/sections/tools/ToolPanel.js +13 -0
- package/dist/sidebar/sections/tools/ToolTiles.d.ts +5 -0
- package/dist/sidebar/sections/tools/ToolTiles.js +76 -0
- package/dist/sidebar/sections/tools/ToolsSection.d.ts +15 -0
- package/dist/sidebar/sections/tools/ToolsSection.js +151 -0
- package/dist/sidebar/sections/tools/UnsplashLimitNotice.d.ts +8 -0
- package/dist/sidebar/sections/tools/UnsplashLimitNotice.js +22 -0
- package/dist/sidebar/sections/tools/UnsplashTool.d.ts +10 -0
- package/dist/sidebar/sections/tools/UnsplashTool.js +47 -0
- package/dist/sidebar/sections/tools/index.d.ts +1 -0
- package/dist/sidebar/sections/tools/index.js +2 -0
- package/dist/sidebar/sections/tools/toolTiles.css +335 -0
- package/dist/sidebar/sections/tools/useToolImagePlacement.d.ts +19 -0
- package/dist/sidebar/sections/tools/useToolImagePlacement.js +23 -0
- package/dist/sidebar/sections/whenIdle.d.ts +2 -0
- package/dist/sidebar/sections/whenIdle.js +10 -0
- package/dist/sidebar/sidebarStyles.d.ts +60 -0
- package/dist/sidebar/sidebarStyles.js +61 -0
- package/dist/sidebar/tabTypes.d.ts +27 -0
- package/dist/sidebar/tabTypes.js +1 -0
- package/dist/sidebar/types.d.ts +43 -0
- package/dist/sidebar/types.js +1 -0
- package/dist/sidebar/useImagePlacement.d.ts +17 -0
- package/dist/sidebar/useImagePlacement.js +28 -0
- package/dist/stores/AutoSaveStoreProvider.d.ts +28 -0
- package/dist/stores/AutoSaveStoreProvider.js +45 -0
- package/dist/stores/CanvasStoreProvider.d.ts +43 -0
- package/dist/stores/CanvasStoreProvider.js +74 -0
- package/dist/stores/createAutoSaveStore.d.ts +50 -0
- package/dist/stores/createAutoSaveStore.js +42 -0
- package/dist/stores/createCanvasEditorStore.d.ts +126 -0
- package/dist/stores/createCanvasEditorStore.js +266 -0
- package/dist/stores/useAutoSaveStore.d.ts +12 -0
- package/dist/stores/useAutoSaveStore.js +12 -0
- package/dist/styles/editor.css +445 -0
- package/dist/styles/index.css +4 -0
- package/dist/styles/tailwind.css +239 -0
- package/dist/styles/tokens.css +199 -0
- package/dist/templates/fontWidths.generated.d.ts +1 -0
- package/dist/templates/fontWidths.generated.js +17 -0
- package/dist/templates/registry.d.ts +59 -0
- package/dist/templates/registry.js +40 -0
- package/dist/templates/templateGeometry.d.ts +32 -0
- package/dist/templates/templateGeometry.js +887 -0
- package/dist/templates/testKinds.d.ts +15 -0
- package/dist/templates/testKinds.js +151 -0
- package/dist/testing/documentBrandConfig.d.ts +14 -0
- package/dist/testing/documentBrandConfig.js +60 -0
- package/dist/testing/documentBrandPacks.d.ts +10 -0
- package/dist/testing/documentBrandPacks.js +45 -0
- package/dist/testing/fixtureTemplates.d.ts +13 -0
- package/dist/testing/fixtureTemplates.js +376 -0
- package/dist/testing/stampKind.d.ts +91 -0
- package/dist/testing/stampKind.js +56 -0
- package/dist/types/editorTypes.d.ts +65 -0
- package/dist/types/editorTypes.js +21 -0
- package/dist/ui/alert-dialog.d.ts +18 -0
- package/dist/ui/alert-dialog.js +42 -0
- package/dist/ui/button.d.ts +10 -0
- package/dist/ui/button.js +29 -0
- package/dist/ui/dialog.d.ts +15 -0
- package/dist/ui/dialog.js +53 -0
- package/dist/ui/icon-button.d.ts +18 -0
- package/dist/ui/icon-button.js +54 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +6 -0
- package/dist/ui/label.d.ts +4 -0
- package/dist/ui/label.js +8 -0
- package/dist/ui/masonry-grid.d.ts +11 -0
- package/dist/ui/masonry-grid.js +43 -0
- package/dist/ui/popover.d.ts +10 -0
- package/dist/ui/popover.js +26 -0
- package/dist/ui/select.d.ts +15 -0
- package/dist/ui/select.js +38 -0
- package/dist/ui/skeleton.d.ts +2 -0
- package/dist/ui/skeleton.js +7 -0
- package/dist/ui/switch.d.ts +6 -0
- package/dist/ui/switch.js +8 -0
- package/dist/utils/__snapshots__/kindSelection.vitest.ts.snap +1086 -0
- package/dist/utils/alignment.d.ts +21 -0
- package/dist/utils/alignment.js +54 -0
- package/dist/utils/axisLock.d.ts +30 -0
- package/dist/utils/axisLock.js +78 -0
- package/dist/utils/backgroundPhotoCrop.d.ts +28 -0
- package/dist/utils/backgroundPhotoCrop.js +28 -0
- package/dist/utils/canvasAssets.d.ts +140 -0
- package/dist/utils/canvasAssets.js +121 -0
- package/dist/utils/canvasClipboard.d.ts +51 -0
- package/dist/utils/canvasClipboard.js +37 -0
- package/dist/utils/canvasCommandRegistry.d.ts +207 -0
- package/dist/utils/canvasCommandRegistry.js +124 -0
- package/dist/utils/canvasCommands.d.ts +106 -0
- package/dist/utils/canvasCommands.js +564 -0
- package/dist/utils/canvasFontFamilies.d.ts +12 -0
- package/dist/utils/canvasFontFamilies.js +24 -0
- package/dist/utils/canvasIcons.d.ts +68 -0
- package/dist/utils/canvasIcons.js +293 -0
- package/dist/utils/canvasImageSource.d.ts +12 -0
- package/dist/utils/canvasImageSource.js +19 -0
- package/dist/utils/canvasItem.d.ts +102 -0
- package/dist/utils/canvasItem.js +1 -0
- package/dist/utils/canvasLayerManager.d.ts +51 -0
- package/dist/utils/canvasLayerManager.js +107 -0
- package/dist/utils/canvasValueResolver.d.ts +9 -0
- package/dist/utils/canvasValueResolver.js +13 -0
- package/dist/utils/captureStage.d.ts +59 -0
- package/dist/utils/captureStage.js +152 -0
- package/dist/utils/chartTypes.d.ts +6 -0
- package/dist/utils/chartTypes.js +2 -0
- package/dist/utils/chartUtils.d.ts +49 -0
- package/dist/utils/chartUtils.js +191 -0
- package/dist/utils/circleBadgeUtils.d.ts +30 -0
- package/dist/utils/circleBadgeUtils.js +85 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.js +66 -0
- package/dist/utils/collectAltTextPages.d.ts +6 -0
- package/dist/utils/collectAltTextPages.js +20 -0
- package/dist/utils/colorLuminance.d.ts +3 -0
- package/dist/utils/colorLuminance.js +14 -0
- package/dist/utils/colorNames.d.ts +7 -0
- package/dist/utils/colorNames.js +17 -0
- package/dist/utils/colorOptions.d.ts +20 -0
- package/dist/utils/colorOptions.js +20 -0
- package/dist/utils/cornerRadius.d.ts +14 -0
- package/dist/utils/cornerRadius.js +27 -0
- package/dist/utils/cornerReservation.d.ts +19 -0
- package/dist/utils/cornerReservation.js +7 -0
- package/dist/utils/coverFit.d.ts +117 -0
- package/dist/utils/coverFit.js +207 -0
- package/dist/utils/cropAspect.d.ts +47 -0
- package/dist/utils/cropAspect.js +53 -0
- package/dist/utils/cropGhost.d.ts +63 -0
- package/dist/utils/cropGhost.js +216 -0
- package/dist/utils/cropSession.d.ts +23 -0
- package/dist/utils/cropSession.js +92 -0
- package/dist/utils/cropTarget.d.ts +22 -0
- package/dist/utils/cropTarget.js +33 -0
- package/dist/utils/deepSelect.d.ts +43 -0
- package/dist/utils/deepSelect.js +74 -0
- package/dist/utils/downloadError.d.ts +2 -0
- package/dist/utils/downloadError.js +13 -0
- package/dist/utils/duplicateElement.d.ts +127 -0
- package/dist/utils/duplicateElement.js +235 -0
- package/dist/utils/editorFocus.d.ts +36 -0
- package/dist/utils/editorFocus.js +67 -0
- package/dist/utils/editorToast.d.ts +21 -0
- package/dist/utils/editorToast.js +7 -0
- package/dist/utils/elementKinds.d.ts +212 -0
- package/dist/utils/elementKinds.js +137 -0
- package/dist/utils/emoji/emojiCatalog.d.ts +12 -0
- package/dist/utils/emoji/emojiCatalog.en.json +9997 -0
- package/dist/utils/emoji/emojiCatalog.js +53 -0
- package/dist/utils/emoji/emojiCatalog.json +9913 -0
- package/dist/utils/ensureFontsReady.d.ts +12 -0
- package/dist/utils/ensureFontsReady.js +23 -0
- package/dist/utils/expandImage.d.ts +17 -0
- package/dist/utils/expandImage.js +76 -0
- package/dist/utils/externalIcons.d.ts +67 -0
- package/dist/utils/externalIcons.js +168 -0
- package/dist/utils/filterCache.d.ts +16 -0
- package/dist/utils/filterCache.js +31 -0
- package/dist/utils/filterUtils.d.ts +2 -0
- package/dist/utils/filterUtils.js +89 -0
- package/dist/utils/followStage.d.ts +2 -0
- package/dist/utils/followStage.js +48 -0
- package/dist/utils/fontAliases.d.ts +14 -0
- package/dist/utils/fontAliases.js +32 -0
- package/dist/utils/fontMarkSupport.d.ts +26 -0
- package/dist/utils/fontMarkSupport.js +32 -0
- package/dist/utils/frameUtils.d.ts +20 -0
- package/dist/utils/frameUtils.js +283 -0
- package/dist/utils/gradientFill.d.ts +55 -0
- package/dist/utils/gradientFill.js +57 -0
- package/dist/utils/gradientHitArea.d.ts +22 -0
- package/dist/utils/gradientHitArea.js +94 -0
- package/dist/utils/grain.d.ts +29 -0
- package/dist/utils/grain.js +103 -0
- package/dist/utils/grainSpec.d.ts +2 -0
- package/dist/utils/grainSpec.js +3 -0
- package/dist/utils/groupSnap.d.ts +27 -0
- package/dist/utils/groupSnap.js +54 -0
- package/dist/utils/handDrawn.d.ts +92 -0
- package/dist/utils/handDrawn.js +523 -0
- package/dist/utils/historyStamp.d.ts +22 -0
- package/dist/utils/historyStamp.js +31 -0
- package/dist/utils/hostStorageKeys.d.ts +16 -0
- package/dist/utils/hostStorageKeys.js +27 -0
- package/dist/utils/iconInstances.d.ts +80 -0
- package/dist/utils/iconInstances.js +109 -0
- package/dist/utils/illustrations/gophers.d.ts +11 -0
- package/dist/utils/illustrations/gophers.js +1236 -0
- package/dist/utils/illustrations/humaaans.d.ts +8 -0
- package/dist/utils/illustrations/humaaans.js +265 -0
- package/dist/utils/illustrations/illlustrations.d.ts +11 -0
- package/dist/utils/illustrations/illlustrations.js +929 -0
- package/dist/utils/illustrations/kawaii.d.ts +6 -0
- package/dist/utils/illustrations/kawaii.js +73 -0
- package/dist/utils/illustrations/opendoodles.d.ts +6 -0
- package/dist/utils/illustrations/opendoodles.js +271 -0
- package/dist/utils/illustrations/openpeeps.d.ts +9 -0
- package/dist/utils/illustrations/openpeeps.js +1522 -0
- package/dist/utils/illustrations/prefetchAnalytics.d.ts +78 -0
- package/dist/utils/illustrations/prefetchAnalytics.js +162 -0
- package/dist/utils/illustrations/registry.d.ts +27 -0
- package/dist/utils/illustrations/registry.js +106 -0
- package/dist/utils/illustrations/svgCache.d.ts +60 -0
- package/dist/utils/illustrations/svgCache.js +349 -0
- package/dist/utils/illustrations/transhumans.d.ts +8 -0
- package/dist/utils/illustrations/transhumans.js +313 -0
- package/dist/utils/illustrations/types.d.ts +25 -0
- package/dist/utils/illustrations/types.js +45 -0
- package/dist/utils/imageElementComparison.d.ts +19 -0
- package/dist/utils/imageElementComparison.js +121 -0
- package/dist/utils/imageFilters.d.ts +94 -0
- package/dist/utils/imageFilters.js +304 -0
- package/dist/utils/imageLook.d.ts +18 -0
- package/dist/utils/imageLook.js +41 -0
- package/dist/utils/keyboardCrop.d.ts +25 -0
- package/dist/utils/keyboardCrop.js +98 -0
- package/dist/utils/keyboardOwnership.d.ts +30 -0
- package/dist/utils/keyboardOwnership.js +93 -0
- package/dist/utils/layerLabels.d.ts +39 -0
- package/dist/utils/layerLabels.js +181 -0
- package/dist/utils/layerLock.d.ts +24 -0
- package/dist/utils/layerLock.js +52 -0
- package/dist/utils/layerSelection.d.ts +24 -0
- package/dist/utils/layerSelection.js +16 -0
- package/dist/utils/markerBoxes.d.ts +38 -0
- package/dist/utils/markerBoxes.js +60 -0
- package/dist/utils/markerColors.d.ts +16 -0
- package/dist/utils/markerColors.js +32 -0
- package/dist/utils/mediaDrop.d.ts +76 -0
- package/dist/utils/mediaDrop.js +95 -0
- package/dist/utils/mediaPlacement.d.ts +6 -0
- package/dist/utils/mediaPlacement.js +17 -0
- package/dist/utils/motifSizes.d.ts +8 -0
- package/dist/utils/motifSizes.js +9 -0
- package/dist/utils/multiSelect.d.ts +44 -0
- package/dist/utils/multiSelect.js +139 -0
- package/dist/utils/notch.d.ts +17 -0
- package/dist/utils/notch.js +23 -0
- package/dist/utils/orientElement.d.ts +46 -0
- package/dist/utils/orientElement.js +108 -0
- package/dist/utils/orientation.d.ts +119 -0
- package/dist/utils/orientation.js +411 -0
- package/dist/utils/pageCounter.d.ts +15 -0
- package/dist/utils/pageCounter.js +17 -0
- package/dist/utils/pendingImages.d.ts +10 -0
- package/dist/utils/pendingImages.js +25 -0
- package/dist/utils/photoCredit.d.ts +9 -0
- package/dist/utils/photoCredit.js +29 -0
- package/dist/utils/photoCredits.d.ts +5 -0
- package/dist/utils/photoCredits.js +17 -0
- package/dist/utils/photoPlaceholder.d.ts +25 -0
- package/dist/utils/photoPlaceholder.js +38 -0
- package/dist/utils/pillBadgeUtils.d.ts +41 -0
- package/dist/utils/pillBadgeUtils.js +94 -0
- package/dist/utils/pixelHitArea.d.ts +13 -0
- package/dist/utils/pixelHitArea.js +33 -0
- package/dist/utils/plainTextLayout.d.ts +11 -0
- package/dist/utils/plainTextLayout.js +64 -0
- package/dist/utils/printImageInfo.d.ts +9 -0
- package/dist/utils/printImageInfo.js +14 -0
- package/dist/utils/recacheNextFrame.d.ts +6 -0
- package/dist/utils/recacheNextFrame.js +15 -0
- package/dist/utils/removeElement.d.ts +17 -0
- package/dist/utils/removeElement.js +47 -0
- package/dist/utils/renderedBoxes.d.ts +19 -0
- package/dist/utils/renderedBoxes.js +67 -0
- package/dist/utils/resolveElementValue.d.ts +44 -0
- package/dist/utils/resolveElementValue.js +72 -0
- package/dist/utils/scrollBehavior.d.ts +6 -0
- package/dist/utils/scrollBehavior.js +17 -0
- package/dist/utils/searchTranslations.d.ts +20 -0
- package/dist/utils/searchTranslations.js +366 -0
- package/dist/utils/selectionCapabilities.d.ts +53 -0
- package/dist/utils/selectionCapabilities.js +52 -0
- package/dist/utils/shade.d.ts +24 -0
- package/dist/utils/shade.js +55 -0
- package/dist/utils/shapeDevices.d.ts +72 -0
- package/dist/utils/shapeDevices.js +100 -0
- package/dist/utils/shapeTransform.d.ts +29 -0
- package/dist/utils/shapeTransform.js +69 -0
- package/dist/utils/shapes.d.ts +64 -0
- package/dist/utils/shapes.js +838 -0
- package/dist/utils/smartCrop.d.ts +30 -0
- package/dist/utils/smartCrop.js +163 -0
- package/dist/utils/snapping.d.ts +116 -0
- package/dist/utils/snapping.js +426 -0
- package/dist/utils/stageCssScale.d.ts +7 -0
- package/dist/utils/stageCssScale.js +11 -0
- package/dist/utils/stateTypeAssertions.d.ts +99 -0
- package/dist/utils/stateTypeAssertions.js +197 -0
- package/dist/utils/straighten.d.ts +51 -0
- package/dist/utils/straighten.js +254 -0
- package/dist/utils/surfaceGlow.d.ts +7 -0
- package/dist/utils/surfaceGlow.js +27 -0
- package/dist/utils/templateElementInstance.d.ts +43 -0
- package/dist/utils/templateElementInstance.js +100 -0
- package/dist/utils/templateRotation.d.ts +24 -0
- package/dist/utils/templateRotation.js +56 -0
- package/dist/utils/textAlign.d.ts +17 -0
- package/dist/utils/textAlign.js +30 -0
- package/dist/utils/textEditorOpeners.d.ts +12 -0
- package/dist/utils/textEditorOpeners.js +40 -0
- package/dist/utils/textRouting.d.ts +17 -0
- package/dist/utils/textRouting.js +22 -0
- package/dist/utils/textUtils.d.ts +102 -0
- package/dist/utils/textUtils.js +254 -0
- package/dist/utils/touchInput.d.ts +7 -0
- package/dist/utils/touchInput.js +19 -0
- package/dist/utils/transformHudLabel.d.ts +3 -0
- package/dist/utils/transformHudLabel.js +12 -0
- package/dist/utils/unsplashLinks.d.ts +2 -0
- package/dist/utils/unsplashLinks.js +7 -0
- package/dist/utils/userFacingError.d.ts +10 -0
- package/dist/utils/userFacingError.js +10 -0
- package/dist/utils/userImageCrop.d.ts +4 -0
- package/dist/utils/userImageCrop.js +26 -0
- package/dist/utils/userImageUtils.d.ts +44 -0
- package/dist/utils/userImageUtils.js +136 -0
- package/dist/utils/viewport.d.ts +16 -0
- package/dist/utils/viewport.js +30 -0
- package/dist/utils/zipPageImages.d.ts +9 -0
- package/dist/utils/zipPageImages.js +30 -0
- package/package.json +105 -3
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useCanvasEditorServices } from '@ggraphic/editor/CanvasEditorProvider';
|
|
3
|
+
import { useDocumentBrand } from '@ggraphic/editor/brand/documentBrand';
|
|
4
|
+
import { useCanvasTextFormatting, useIsCanvasTextEditing, } from '@ggraphic/editor/components/CanvasTextOverlay';
|
|
5
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
6
|
+
import { hasEffects } from '@ggraphic/editor/sidebar/sections/effects/effectsFor';
|
|
7
|
+
import { useOptionalUserUploads } from '@ggraphic/editor/sidebar/UserUploadsProvider';
|
|
8
|
+
import { brandColors, fontColors } from '@ggraphic/editor/utils/colorOptions';
|
|
9
|
+
import { focusPage, isKeyboardModality } from '@ggraphic/editor/utils/editorFocus';
|
|
10
|
+
import { useUnsplashHome } from '@ggraphic/editor/utils/unsplashLinks';
|
|
11
|
+
import React, { useState } from 'react';
|
|
12
|
+
import { PiCopy, PiLockSimple, PiLockSimpleOpen, PiSparkle } from 'react-icons/pi';
|
|
13
|
+
import { fontMarkSupport } from '../../utils/fontMarkSupport.js';
|
|
14
|
+
import { WholeTextFormatControls } from '../WholeTextFormatControls.js';
|
|
15
|
+
import { TILE, TileCaption, useBarTiles } from '@ggraphic/editor/components/TopBar/barTiles';
|
|
16
|
+
import { CropModeControls } from '@ggraphic/editor/components/TopBar/CropModeControls';
|
|
17
|
+
import { BackgroundImagePicker, BackgroundRemoveImageButton, BackgroundRestoreImageButton, BackgroundZoomControl, SetAsBackgroundButton, } from '@ggraphic/editor/components/TopBar/modules/FloatingBackgroundControls';
|
|
18
|
+
import { FloatingColorPicker } from '@ggraphic/editor/components/TopBar/modules/FloatingColorPicker';
|
|
19
|
+
import { FloatingFontRoleControl } from '@ggraphic/editor/components/TopBar/modules/FloatingFontRoleControl';
|
|
20
|
+
import { FloatingFontSizeControl } from '@ggraphic/editor/components/TopBar/modules/FloatingFontSizeControl';
|
|
21
|
+
import { FloatingOpacityControl } from '@ggraphic/editor/components/TopBar/modules/FloatingOpacityControl';
|
|
22
|
+
import { FloatingPositionControl, } from '@ggraphic/editor/components/TopBar/modules/FloatingPositionControl';
|
|
23
|
+
import { FloatingImageLookControl } from './modules/FloatingImageLookControl.js';
|
|
24
|
+
import { FloatingTextAlignControl } from '@ggraphic/editor/components/TopBar/modules/FloatingTextAlignControl';
|
|
25
|
+
/**
|
|
26
|
+
* Ist die Auswahl ein Objekt auf der Seite? Fläche und Hintergrundfoto sind es
|
|
27
|
+
* nicht: kein Duplizieren, keine Ebene, keine Pille.
|
|
28
|
+
*/
|
|
29
|
+
export function hasObjectActions(module) {
|
|
30
|
+
if (module?.type === 'background')
|
|
31
|
+
return false;
|
|
32
|
+
return !(module?.type === 'image' && !!module.data.isPhoto);
|
|
33
|
+
}
|
|
34
|
+
/** Läuft ein Zuschneide-Modus, zeigt die Leiste nur ihn (`CropModeControls`). */
|
|
35
|
+
export function showsCropModeBar({ isCropping, handlers, }) {
|
|
36
|
+
return !!isCropping && !!handlers.handleCancelCrop && !!handlers.handleFinishCrop;
|
|
37
|
+
}
|
|
38
|
+
const ICON_BTN = 'inline-flex items-center justify-center size-8 max-canvas-mobile:size-11 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';
|
|
39
|
+
const CROP_BTN = 'inline-flex items-center gap-1.5 h-8 max-canvas-mobile:h-11 shrink-0 rounded-md border-none bg-transparent px-2 cursor-pointer text-[13px] font-medium text-[var(--editor-text)] transition-colors duration-150 hover:bg-[var(--editor-surface-hover)] hover:text-[var(--editor-active-fg)] aria-pressed:bg-[var(--editor-active-bg)] aria-pressed:text-[var(--editor-active-fg)]';
|
|
40
|
+
const EDIT_BTN = 'inline-flex items-center gap-1.5 h-8 max-canvas-mobile:h-11 shrink-0 rounded-md border-none bg-transparent px-2 cursor-pointer text-[13px] font-medium text-[var(--editor-text)] transition-colors duration-150 hover:bg-[var(--editor-surface-hover)] hover:text-[var(--editor-active-fg)]';
|
|
41
|
+
const TEXT_BTN = 'inline-flex items-center h-8 max-canvas-mobile:h-11 shrink-0 rounded-md border-none bg-transparent px-2 cursor-pointer whitespace-nowrap text-[13px] font-medium text-[var(--editor-text)] transition-colors duration-150 hover:bg-[var(--editor-surface-hover)] hover:text-[var(--editor-active-fg)]';
|
|
42
|
+
const SEP = 'w-px h-[22px] bg-[var(--editor-border-soft)] mx-1 shrink-0';
|
|
43
|
+
/**
|
|
44
|
+
* ContextControls — the selection-driven formatting controls (color, font size,
|
|
45
|
+
* alignment, opacity, layer order, duplicate, lock, delete; delete page in the
|
|
46
|
+
* mobile sheet). Shared between the desktop
|
|
47
|
+
* floating ContextToolbar and the mobile bottom context row; owns its own
|
|
48
|
+
* color-picker expansion state. Renders nothing when there is no active module.
|
|
49
|
+
*/
|
|
50
|
+
export function ContextControls({ selectedElement, activeFloatingModule, canMoveUp, canMoveDown, canDuplicate, isCropping = false, cropAspect = 'free', cropRotation = 0, isExpanding = false, lockState = 'none', canLock = false, canAlign = false, canChangeFontRole = false, backgroundPickerRequest = 0, handlers, background, onRemoveUserImage, onDeletePage, onDeselect, hideObjectActions = false, cropLayout = 'inline', }) {
|
|
51
|
+
const brand = useDocumentBrand();
|
|
52
|
+
const t = useMessages();
|
|
53
|
+
const tiles = useBarTiles();
|
|
54
|
+
const unsplashHome = useUnsplashHome();
|
|
55
|
+
const [isColorPickerExpanded, setIsColorPickerExpanded] = useState(false);
|
|
56
|
+
// Fett/Kursiv/… bedienen im Editor die Auswahl IM Text; ohne offenen Editor
|
|
57
|
+
// gibt es keine, und die Knöpfe gelten für den ganzen Text.
|
|
58
|
+
const formatting = useCanvasTextFormatting();
|
|
59
|
+
// Solange irgendein Text bearbeitet wird, gehören die Knöpfe dem Editor — auch in dem
|
|
60
|
+
// Augenblick, in dem er noch nachlädt und `formatting` noch leer ist.
|
|
61
|
+
const editingText = useIsCanvasTextEditing();
|
|
62
|
+
// Ohne Dienst des Hosts oder ohne Uploads (das Ergebnis wird hochgeladen) kein „Erweitern".
|
|
63
|
+
const uploads = useOptionalUserUploads();
|
|
64
|
+
const canExpand = !!useCanvasEditorServices().expandImage && !!uploads;
|
|
65
|
+
if (showsCropModeBar({ isCropping, handlers })) {
|
|
66
|
+
const handleCropAspect = handlers.handleCropAspect;
|
|
67
|
+
const handleCropRotation = handlers.handleCropRotation;
|
|
68
|
+
return (_jsx(CropModeControls, { layout: cropLayout, onCancel: () => handlers.handleCancelCrop?.(), onDone: () => handlers.handleFinishCrop?.(), aspect: activeFloatingModule?.type === 'user-image' && handleCropAspect
|
|
69
|
+
? { value: cropAspect, onChange: handleCropAspect }
|
|
70
|
+
: null, straighten: handleCropRotation ? { value: cropRotation, onChange: handleCropRotation } : null, onAuto: handlers.handleSmartCrop ?? null, expand: canExpand && handlers.handleExpandImage
|
|
71
|
+
? { onExpand: handlers.handleExpandImage, busy: isExpanding }
|
|
72
|
+
: null }));
|
|
73
|
+
}
|
|
74
|
+
const showColorFor = (type) => {
|
|
75
|
+
if (type === 'text') {
|
|
76
|
+
return { color: activeFloatingModule?.data.fill || '#000000', variant: 'font' };
|
|
77
|
+
}
|
|
78
|
+
// The colour plane takes the template's palette, below.
|
|
79
|
+
if (type === 'background')
|
|
80
|
+
return null;
|
|
81
|
+
if (type === 'image') {
|
|
82
|
+
return activeFloatingModule?.data.fill !== undefined
|
|
83
|
+
? { color: activeFloatingModule?.data.fill || '#FFFFFF', variant: 'swatch' }
|
|
84
|
+
: null;
|
|
85
|
+
}
|
|
86
|
+
if (type === 'shape' || type === 'pill-badge' || type === 'circle-badge') {
|
|
87
|
+
return { color: activeFloatingModule?.data.fill ?? '#000000', variant: 'swatch' };
|
|
88
|
+
}
|
|
89
|
+
// Assets are fixed-color brand graphics (PNG/SVG files) — AssetPrimitive
|
|
90
|
+
// has no color to set, so a swatch there would be a dead control.
|
|
91
|
+
if (type === 'icon' || type === 'illustration') {
|
|
92
|
+
return { color: activeFloatingModule?.data.color ?? '#000000', variant: 'swatch' };
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
};
|
|
96
|
+
const colorConfig = activeFloatingModule ? showColorFor(activeFloatingModule.type) : null;
|
|
97
|
+
const isPlane = activeFloatingModule?.type === 'background';
|
|
98
|
+
const isPhoto = activeFloatingModule?.type === 'image' && !!activeFloatingModule.data.isPhoto;
|
|
99
|
+
// The background is not an object on the page: no opacity, layer order or copy.
|
|
100
|
+
// Frame elements expose no formatting controls (matches prior Toolbar behavior).
|
|
101
|
+
const showOpacity = activeFloatingModule && activeFloatingModule.type !== 'frame' && !isPlane;
|
|
102
|
+
const showObjectActions = hasObjectActions(activeFloatingModule);
|
|
103
|
+
const isText = activeFloatingModule?.type === 'text';
|
|
104
|
+
const isLocked = lockState === 'all';
|
|
105
|
+
// Build the present control groups, then interleave separators — this keeps
|
|
106
|
+
// dividers strictly between groups (no dangling leading/trailing divider
|
|
107
|
+
// regardless of which groups are visible).
|
|
108
|
+
const groups = [];
|
|
109
|
+
if (colorConfig) {
|
|
110
|
+
groups.push(_jsx(FloatingColorPicker, { currentColor: colorConfig.color, onColorSelect: handlers.handleColorSelect, isExpanded: isColorPickerExpanded, onExpandChange: setIsColorPickerExpanded, variant: colorConfig.variant, ...(isText ? { colors: fontColors(brand) } : {}) }, "color"));
|
|
111
|
+
}
|
|
112
|
+
// On the photo too: the photo covers the plane, so this is the only way to a colour.
|
|
113
|
+
if ((isPlane || isPhoto) && background?.colors?.length && background.onColorChange) {
|
|
114
|
+
const { onColorChange, onImageChange, colorReplacesImage, paletteOnly } = background;
|
|
115
|
+
const own = background.colors.map((c) => ({
|
|
116
|
+
id: c.id,
|
|
117
|
+
name: c.label,
|
|
118
|
+
value: c.color,
|
|
119
|
+
...(c.ref && { ref: c.ref }),
|
|
120
|
+
}));
|
|
121
|
+
const known = new Set(own.map((c) => c.value.toLowerCase()));
|
|
122
|
+
const palette = paletteOnly
|
|
123
|
+
? own
|
|
124
|
+
: [...own, ...brandColors(brand).filter((c) => !known.has(c.value.toLowerCase()))];
|
|
125
|
+
const pickColor = isPhoto && !colorReplacesImage && onImageChange
|
|
126
|
+
? (color, ref) => {
|
|
127
|
+
onImageChange(null, undefined, null);
|
|
128
|
+
onColorChange(color, ref);
|
|
129
|
+
onDeselect?.();
|
|
130
|
+
}
|
|
131
|
+
: isPhoto
|
|
132
|
+
? (color, ref) => {
|
|
133
|
+
onColorChange(color, ref);
|
|
134
|
+
onDeselect?.();
|
|
135
|
+
}
|
|
136
|
+
: onColorChange;
|
|
137
|
+
groups.push(_jsx(FloatingColorPicker, { currentColor: (isPhoto ? '' : background.currentColor) || '#FFFFFF', onColorSelect: pickColor, isExpanded: isColorPickerExpanded, onExpandChange: setIsColorPickerExpanded, colors: palette, allowCustom: !paletteOnly }, "background-color"));
|
|
138
|
+
}
|
|
139
|
+
if ((isPlane || isPhoto) && background?.onImageChange) {
|
|
140
|
+
const onImageChange = background.onImageChange;
|
|
141
|
+
groups.push(_jsx(BackgroundImagePicker, { label: background.currentImageSrc ? t.topBar.replace : t.common.image, currentImageSrc: background.currentImageSrc, onImageChange: onImageChange, openRequest: backgroundPickerRequest }, "background-image"));
|
|
142
|
+
}
|
|
143
|
+
if (isPlane && background?.onRestoreImage) {
|
|
144
|
+
groups.push(_jsx(BackgroundRestoreImageButton, { onRestore: background.onRestoreImage }, "restore-image"));
|
|
145
|
+
}
|
|
146
|
+
if (isPhoto && background) {
|
|
147
|
+
const photoControls = [];
|
|
148
|
+
if (background.scale !== undefined && background.onScaleChange) {
|
|
149
|
+
photoControls.push(_jsx(BackgroundZoomControl, { scale: background.scale, onScaleChange: background.onScaleChange }, "zoom"));
|
|
150
|
+
}
|
|
151
|
+
if (activeFloatingModule?.data.canCrop && handlers.handleCropImage) {
|
|
152
|
+
const handleCropImage = handlers.handleCropImage;
|
|
153
|
+
photoControls.push(_jsxs("button", { type: "button", className: tiles ? TILE : CROP_BTN, onClick: (e) => {
|
|
154
|
+
handleCropImage();
|
|
155
|
+
// Wie beim Zuschneiden eigener Bilder: per Tastatur gehören die Pfeile danach der Seite.
|
|
156
|
+
if (!isCropping && isKeyboardModality())
|
|
157
|
+
focusPage(e.currentTarget);
|
|
158
|
+
}, title: t.topBar.adjustCropPhoto, "aria-label": t.topBar.adjustCrop, "aria-pressed": isCropping, children: [_jsx(CropIcon, {}), t.topBar.crop] }, "crop"));
|
|
159
|
+
}
|
|
160
|
+
if (background.onImageChange) {
|
|
161
|
+
const onImageChange = background.onImageChange;
|
|
162
|
+
photoControls.push(_jsx(BackgroundRemoveImageButton, { onRemove: () => {
|
|
163
|
+
onImageChange(null, undefined, null);
|
|
164
|
+
// The photo element is gone; a selection on it would keep these controls up.
|
|
165
|
+
onDeselect?.();
|
|
166
|
+
} }, "remove"));
|
|
167
|
+
}
|
|
168
|
+
if (background.currentImageSrc && handlers.onEditImage) {
|
|
169
|
+
groups.push(_jsx(EditImageButton, { onClick: handlers.onEditImage }, "edit-image"));
|
|
170
|
+
}
|
|
171
|
+
if (photoControls.length) {
|
|
172
|
+
groups.push(_jsx("div", { className: "flex items-center gap-0.5", children: photoControls }, "photo"));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const userImageSrc = activeFloatingModule?.type === 'user-image' ? activeFloatingModule.data.src : undefined;
|
|
176
|
+
if (typeof userImageSrc === 'string' &&
|
|
177
|
+
!userImageSrc.startsWith('blob:') &&
|
|
178
|
+
background?.onImageChange &&
|
|
179
|
+
onRemoveUserImage &&
|
|
180
|
+
activeFloatingModule) {
|
|
181
|
+
const fileName = activeFloatingModule.data.fileName;
|
|
182
|
+
// Captured now: the fetch is async and the selection may move before it lands.
|
|
183
|
+
const imageId = activeFloatingModule.data.id;
|
|
184
|
+
groups.push(_jsx(SetAsBackgroundButton, { src: userImageSrc, fileName: typeof fileName === 'string' && fileName ? fileName : 'hintergrund', attribution: activeFloatingModule.data.attribution, onImageChange: background.onImageChange, onRemoveElement: () => {
|
|
185
|
+
onRemoveUserImage(imageId);
|
|
186
|
+
onDeselect?.();
|
|
187
|
+
} }, "as-background"));
|
|
188
|
+
}
|
|
189
|
+
if (isText &&
|
|
190
|
+
activeFloatingModule?.data.isInstanceText &&
|
|
191
|
+
canChangeFontRole &&
|
|
192
|
+
handlers.handleFontRoleChange) {
|
|
193
|
+
const { handleFontRoleChange } = handlers;
|
|
194
|
+
groups.push(_jsx(FloatingFontRoleControl, { text: {
|
|
195
|
+
fontFamily: activeFloatingModule.data.fontFamily ?? '',
|
|
196
|
+
bind: activeFloatingModule.data.bind,
|
|
197
|
+
}, onChange: (role) => handleFontRoleChange(activeFloatingModule.data.id, role) }, "fontrole"));
|
|
198
|
+
}
|
|
199
|
+
if (isText && activeFloatingModule) {
|
|
200
|
+
groups.push(_jsx(FloatingFontSizeControl, { fontSize: activeFloatingModule.data.fontSize ?? 16, onFontSizeChange: (size) => handlers.handleFontSizeChange(activeFloatingModule.data.id, size) }, "fontsize"));
|
|
201
|
+
}
|
|
202
|
+
// Die Schnitt-Gruppe steht bei der Schrift, nicht bei der Ausrichtung — wie
|
|
203
|
+
// in Canva, wo alles Typografische beieinanderliegt. Der Id-Vergleich hält
|
|
204
|
+
// die Knöpfe vom falschen Element fern, falls Auswahl und Sitzung je
|
|
205
|
+
// auseinanderlaufen.
|
|
206
|
+
if (isText && formatting && formatting.editingId === activeFloatingModule?.data.id) {
|
|
207
|
+
groups.push(_jsx(FormatTile, { children: _jsx(formatting.TextFormatControls, { editor: formatting.editor, marks: formatting.marks, variant: "contextBar" }) }, "format"));
|
|
208
|
+
}
|
|
209
|
+
else if (isText &&
|
|
210
|
+
!editingText &&
|
|
211
|
+
typeof activeFloatingModule?.data.text === 'string' &&
|
|
212
|
+
handlers.handleTextFormatChange) {
|
|
213
|
+
// Ein Klick genügt: ohne Sitzung dieselben Knöpfe für den ganzen Text.
|
|
214
|
+
const { id, text, fontFamily, hasAccent, hasMarker } = activeFloatingModule.data;
|
|
215
|
+
const { handleTextFormatChange } = handlers;
|
|
216
|
+
groups.push(_jsx(FormatTile, { children: _jsx(WholeTextFormatControls, { text: text, marks: { ...fontMarkSupport(fontFamily ?? ''), accent: !!hasAccent, marker: !!hasMarker }, onChange: (next) => handleTextFormatChange(id, next), variant: "contextBar" }) }, "format"));
|
|
217
|
+
}
|
|
218
|
+
if (isText && activeFloatingModule && handlers.handleTextAlignChange) {
|
|
219
|
+
const { handleTextAlignChange } = handlers;
|
|
220
|
+
groups.push(_jsx(FloatingTextAlignControl, { align: activeFloatingModule.data.align ?? 'left', onAlignChange: (align) => handleTextAlignChange(activeFloatingModule.data.id, align) }, "text-align"));
|
|
221
|
+
}
|
|
222
|
+
const type = activeFloatingModule?.type;
|
|
223
|
+
if (type === 'user-image' && handlers.onEditImage) {
|
|
224
|
+
groups.push(_jsx(EditImageButton, { onClick: handlers.onEditImage }, "edit-image"));
|
|
225
|
+
}
|
|
226
|
+
if (type === 'user-image' && activeFloatingModule && handlers.handleImageLookChange) {
|
|
227
|
+
groups.push(_jsx(FloatingImageLookControl, {
|
|
228
|
+
// Boundary: the module data is the whole instance, an index-signature record.
|
|
229
|
+
image: activeFloatingModule.data, onChange: (look) => handlers.handleImageLookChange(activeFloatingModule.data.id, look) }, "image-look"
|
|
230
|
+
// Boundary: the module data is the whole instance, an index-signature record.
|
|
231
|
+
));
|
|
232
|
+
}
|
|
233
|
+
if (type === 'user-image' && handlers.handleCropImage) {
|
|
234
|
+
groups.push(_jsxs("button", { disabled: isLocked, className: tiles ? TILE : CROP_BTN, onClick: (e) => {
|
|
235
|
+
handlers.handleCropImage();
|
|
236
|
+
// Per Tastatur begonnen: der Fokus geht auf die Seite, damit die
|
|
237
|
+
// Pfeile den Ausschnitt schieben — in der mobilen Werkzeugleiste
|
|
238
|
+
// gehören sie sonst dem Wechsel zwischen den Knöpfen. Enter auf der
|
|
239
|
+
// Seite beendet den Ausschnitt (useCanvasKeyboardHandlers).
|
|
240
|
+
if (!isCropping && isKeyboardModality())
|
|
241
|
+
focusPage(e.currentTarget);
|
|
242
|
+
}, title: t.topBar.cropImage, "aria-pressed": isCropping, type: "button", children: [_jsx(CropIcon, {}), isCropping ? t.topBar.done : t.topBar.cropAction] }, "crop-image"));
|
|
243
|
+
}
|
|
244
|
+
const credit = type === 'user-image'
|
|
245
|
+
? activeFloatingModule?.data.attribution
|
|
246
|
+
: isPhoto
|
|
247
|
+
? background?.imageAttribution
|
|
248
|
+
: undefined;
|
|
249
|
+
if (credit) {
|
|
250
|
+
groups.push(_jsxs("span", { className: "inline-flex items-center gap-1 h-8 shrink-0 px-1 text-[12px] text-[var(--editor-text-muted)] whitespace-nowrap", children: [t.credit.photoBy, _jsx("a", { href: credit.profileUrl, target: "_blank", rel: "noopener noreferrer", className: "text-[var(--editor-text)] underline", children: credit.photographer }), t.credit.on, _jsx("a", { href: unsplashHome, target: "_blank", rel: "noopener noreferrer", className: "text-[var(--editor-text)] underline", children: "Unsplash" })] }, "credit"));
|
|
251
|
+
}
|
|
252
|
+
if (showOpacity && activeFloatingModule) {
|
|
253
|
+
groups.push(_jsx(FloatingOpacityControl, { opacity: activeFloatingModule.data.opacity ?? 1, onOpacityChange: (val) => handlers.handleOpacityChange(activeFloatingModule.data.id, val, activeFloatingModule.type) }, "opacity"));
|
|
254
|
+
}
|
|
255
|
+
// Die Text-Knöpfe stehen rechts beieinander, wie bei Canva — zwischen
|
|
256
|
+
// Icons verstreut wirkte die Leiste unruhig. „Effekte“ öffnet den Bereich
|
|
257
|
+
// mit Verlauf, Kontur und Schatten; „Position“ trägt Ausrichten, Lage und
|
|
258
|
+
// Ebene. Gesperrt bleibt dort nur die Ebene: umschichten geht weiter.
|
|
259
|
+
const textActions = [];
|
|
260
|
+
if (handlers.onOpenEffects && hasEffects(activeFloatingModule)) {
|
|
261
|
+
textActions.push(_jsxs("button", { type: "button", className: tiles ? TILE : TEXT_BTN, onClick: handlers.onOpenEffects, children: [tiles && _jsx(PiSparkle, { size: 18, "aria-hidden": true }), t.topBar.effects] }, "effects"));
|
|
262
|
+
}
|
|
263
|
+
if (selectedElement && showObjectActions) {
|
|
264
|
+
const runCommand = canAlign ? handlers.runCommand : undefined;
|
|
265
|
+
textActions.push(_jsx(FloatingPositionControl
|
|
266
|
+
// Neu je Element: offene Felder zeigen nie die Lage des vorigen.
|
|
267
|
+
, { canAlign: !!runCommand, canDistribute: false, onCommand: runCommand ?? (() => { }), getGeometry: handlers.getGeometry ?? (() => null), onPositionChange: handlers.handlePositionChange, onSizeChange: handlers.handleSizeChange, layer: { canMoveUp, canMoveDown, onMove: handlers.handleMoveLayer } }, `position-${selectedElement}`));
|
|
268
|
+
}
|
|
269
|
+
if (textActions.length) {
|
|
270
|
+
groups.push(_jsx("div", { className: "flex items-center gap-0.5", children: textActions }, "text-actions"));
|
|
271
|
+
}
|
|
272
|
+
// Direkt nach „Position“: beides betrifft das Element als Ganzes,
|
|
273
|
+
// nicht sein Aussehen. Der Knopf bleibt bei Vorlagen-Elementen und Icons
|
|
274
|
+
// sichtbar, aber deaktiviert — verschwände er, wäre unklar, ob die Aktion
|
|
275
|
+
// fehlt oder nur hier nicht geht.
|
|
276
|
+
if (selectedElement && showObjectActions && !hideObjectActions) {
|
|
277
|
+
groups.push(_jsx("button", { className: ICON_BTN, onClick: handlers.handleDuplicate, disabled: !canDuplicate, title: canDuplicate ? t.topBar.duplicate : t.topBar.templateNoDuplicate, "aria-label": t.topBar.duplicate, type: "button", children: _jsx(PiCopy, { size: 18 }) }, "duplicate"));
|
|
278
|
+
}
|
|
279
|
+
if (selectedElement &&
|
|
280
|
+
showObjectActions &&
|
|
281
|
+
!hideObjectActions &&
|
|
282
|
+
canLock &&
|
|
283
|
+
handlers.handleToggleLock) {
|
|
284
|
+
const label = isLocked ? t.contextMenu.unlock : t.commands.toggleLock;
|
|
285
|
+
groups.push(_jsx("button", { className: `${ICON_BTN} aria-pressed:bg-[var(--editor-active-bg)] aria-pressed:text-[var(--editor-active-fg)]`, onClick: handlers.handleToggleLock, "aria-pressed": isLocked, title: isLocked ? t.topBar.unlockHint : t.topBar.lockHint, "aria-label": label, type: "button", children: isLocked ? _jsx(PiLockSimple, { size: 18 }) : _jsx(PiLockSimpleOpen, { size: 18 }) }, "lock"));
|
|
286
|
+
}
|
|
287
|
+
if (onDeletePage && !hideObjectActions) {
|
|
288
|
+
groups.push(_jsx("button", { className: "inline-flex items-center justify-center size-8 max-canvas-mobile:size-11 shrink-0 rounded-md border-none bg-transparent cursor-pointer text-[var(--editor-text-secondary)] transition-colors duration-150 hover:text-[var(--editor-danger-fg)] hover:bg-[var(--editor-danger-bg)]", onClick: () => {
|
|
289
|
+
if (window.confirm(t.topBar.confirmDeletePage)) {
|
|
290
|
+
onDeletePage();
|
|
291
|
+
}
|
|
292
|
+
}, title: t.topBar.deletePage, "aria-label": t.topBar.deletePage, type: "button", children: _jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("polyline", { points: "3 6 5 6 21 6" }), _jsx("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })] }) }, "delete"));
|
|
293
|
+
}
|
|
294
|
+
// Last group: the only visible way out of a selection. Escape is bound in
|
|
295
|
+
// useCanvasKeyboardHandlers but nothing in the UI ever said so, and the
|
|
296
|
+
// artboard is fully covered — clicking "somewhere empty" selects the
|
|
297
|
+
// background instead of deselecting.
|
|
298
|
+
if (onDeselect && selectedElement && !hideObjectActions) {
|
|
299
|
+
groups.push(_jsx("button", { className: ICON_BTN, onClick: onDeselect, title: t.topBar.clearSelection, "aria-label": t.topBar.clearSelection, children: _jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M18 6 6 18" }), _jsx("path", { d: "m6 6 12 12" })] }) }, "deselect"));
|
|
300
|
+
}
|
|
301
|
+
return (_jsx(_Fragment, { children: groups.map((group, i) => (_jsxs(React.Fragment, { children: [i > 0 && !tiles && _jsx("div", { className: SEP }), group] }, i))) }));
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* The format buttons (bold, italic, lists …) keep their own names; on the mobile
|
|
305
|
+
* tile bar they sit as one group above a decorative caption, like the font-size stepper.
|
|
306
|
+
*/
|
|
307
|
+
function FormatTile({ children }) {
|
|
308
|
+
const t = useMessages();
|
|
309
|
+
if (!useBarTiles())
|
|
310
|
+
return _jsx(_Fragment, { children: children });
|
|
311
|
+
return (_jsxs("div", { className: "flex flex-col items-center justify-end gap-1 h-14 pb-2 shrink-0", children: [children, _jsx(TileCaption, { decorative: true, children: t.topBar.tiles.textFormat })] }));
|
|
312
|
+
}
|
|
313
|
+
/** Opens the t.topBar.edit panel: filters, presets, flip — for a free image or the background photo. */
|
|
314
|
+
function EditImageButton({ onClick }) {
|
|
315
|
+
const t = useMessages();
|
|
316
|
+
const tiles = useBarTiles();
|
|
317
|
+
return (_jsxs("button", { className: tiles ? TILE : EDIT_BTN, onClick: onClick, title: t.topBar.adjustImage, type: "button", children: [_jsxs("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("circle", { cx: "12", cy: "12", r: "3" }), _jsx("path", { d: "M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6l1.4 1.4M17 17l1.4 1.4M18.4 5.6L17 7M7 17l-1.4 1.4" })] }), t.topBar.edit] }));
|
|
318
|
+
}
|
|
319
|
+
function CropIcon() {
|
|
320
|
+
return (_jsxs("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M6 2v14a2 2 0 0 0 2 2h14" }), _jsx("path", { d: "M18 22V8a2 2 0 0 0-2-2H2" })] }));
|
|
321
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ContextControlsProps } from '@ggraphic/editor/components/TopBar/ContextControls';
|
|
3
|
+
/**
|
|
4
|
+
* ContextToolbar — desktop floating formatting card, centered over the canvas
|
|
5
|
+
* work area. Wraps the shared ContextControls in the Canva-style surface card.
|
|
6
|
+
* Hidden while an AI suggestion is pending (the menu bar shows the banner then).
|
|
7
|
+
* It only shapes the selection: what acts on an object as a whole sits in the
|
|
8
|
+
* pill on the object (`SelectionPill`).
|
|
9
|
+
*/
|
|
10
|
+
export declare function ContextToolbar(props: ContextControlsProps): React.JSX.Element | null;
|
|
11
|
+
/** The Canva-style surface card the desktop selection bars sit in. */
|
|
12
|
+
export declare function ContextCard({ children }: {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ContextControls, hasObjectActions, } from '@ggraphic/editor/components/TopBar/ContextControls';
|
|
3
|
+
import { useCanvasStoreSelector } from '@ggraphic/editor/stores/CanvasStoreProvider';
|
|
4
|
+
/**
|
|
5
|
+
* ContextToolbar — desktop floating formatting card, centered over the canvas
|
|
6
|
+
* work area. Wraps the shared ContextControls in the Canva-style surface card.
|
|
7
|
+
* Hidden while an AI suggestion is pending (the menu bar shows the banner then).
|
|
8
|
+
* It only shapes the selection: what acts on an object as a whole sits in the
|
|
9
|
+
* pill on the object (`SelectionPill`).
|
|
10
|
+
*/
|
|
11
|
+
export function ContextToolbar(props) {
|
|
12
|
+
const hasPendingAiSuggestion = useCanvasStoreSelector((s) => s.pendingAiSuggestion !== null);
|
|
13
|
+
if (hasPendingAiSuggestion)
|
|
14
|
+
return null;
|
|
15
|
+
return (_jsx(ContextCard, { children: _jsx(ContextControls, { ...props, hideObjectActions: hasObjectActions(props.activeFloatingModule) }) }));
|
|
16
|
+
}
|
|
17
|
+
/** The Canva-style surface card the desktop selection bars sit in. */
|
|
18
|
+
export function ContextCard({ children }) {
|
|
19
|
+
return (_jsx("div", { className: "inline-flex items-center gap-1 max-w-full overflow-x-auto rounded-xl border border-[var(--editor-border-soft)] bg-[var(--editor-surface)] px-2 py-1.5 shadow-[0_2px_8px_rgba(0,0,0,0.06)] animate-canvas-slide-down-fade", children: children }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type CropAspectId } from '@ggraphic/editor/utils/cropAspect';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* CropModeControls — die Kontextleiste, solange ein Zuschneide-Modus läuft
|
|
5
|
+
* (Hintergrundfoto oder eigenes Bild), auf dem Desktop wie in der mobilen
|
|
6
|
+
* Auswahl-Leiste. Sie ersetzt die normalen Werkzeuge; was der Modus an
|
|
7
|
+
* Werkzeugen braucht, gehört hierher.
|
|
8
|
+
*/
|
|
9
|
+
export declare function CropModeControls({ onCancel, onDone, aspect, straighten, onAuto, expand, layout, }: {
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
onDone: () => void;
|
|
12
|
+
/** Seitenverhältnis-Auswahl; nur eigene Bilder haben sie. */
|
|
13
|
+
aspect?: {
|
|
14
|
+
value: CropAspectId;
|
|
15
|
+
onChange: (id: CropAspectId) => void;
|
|
16
|
+
} | null;
|
|
17
|
+
/** Begradigen (Grad, −45 … 45): Hintergrundfoto und eigene Bilder. */
|
|
18
|
+
straighten?: {
|
|
19
|
+
value: number;
|
|
20
|
+
onChange: (deg: number) => void;
|
|
21
|
+
} | null;
|
|
22
|
+
/** „Automatisch": Hintergrundfoto und eigene Bilder. */
|
|
23
|
+
onAuto?: (() => void) | null;
|
|
24
|
+
/** „Erweitern" (KI): Hintergrundfoto und eigene Bilder, nur mit Dienst des Hosts. */
|
|
25
|
+
expand?: {
|
|
26
|
+
onExpand: () => void;
|
|
27
|
+
busy: boolean;
|
|
28
|
+
} | null;
|
|
29
|
+
/**
|
|
30
|
+
* `mobile`: Begradigen in eigener Zeile, Abbrechen/Fertig außerhalb des
|
|
31
|
+
* Scrollbereichs — sonst schöbe man sie aus dem Bild und wischte auf dem Weg
|
|
32
|
+
* dorthin über den Regler (auf Android begradigt das).
|
|
33
|
+
*/
|
|
34
|
+
layout?: 'inline' | 'mobile';
|
|
35
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
4
|
+
import { cn } from '@ggraphic/editor/utils/cn';
|
|
5
|
+
import { CROP_ASPECT_PRESETS, isCropAspectId, } from '@ggraphic/editor/utils/cropAspect';
|
|
6
|
+
import { clampStraighten, STRAIGHTEN_LIMIT } from '@ggraphic/editor/utils/straighten';
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
import { HIDDEN_SCROLLBAR } from '../../sidebar/sidebarStyles.js';
|
|
9
|
+
const TEXT_BTN = 'inline-flex items-center h-8 max-canvas-mobile:h-11 shrink-0 rounded-md border-none px-3 cursor-pointer text-[13px] font-medium transition-colors duration-150';
|
|
10
|
+
// 16 px auf Mobil: iOS zoomt sonst beim Antippen in die Seite.
|
|
11
|
+
const ASPECT_SELECT = 'h-8 max-canvas-mobile:h-11 shrink-0 rounded-md border border-[var(--editor-border-soft)] bg-[var(--editor-surface)] px-2 cursor-pointer text-[13px] max-canvas-mobile:text-[16px] font-medium text-[var(--editor-text)] hover:bg-[var(--editor-surface-hover)]';
|
|
12
|
+
const STRAIGHTEN_NUMBER = 'h-8 max-canvas-mobile:h-11 w-14 shrink-0 rounded-md border border-[var(--editor-border-soft)] bg-[var(--editor-surface)] px-1.5 text-right text-[13px] max-canvas-mobile:text-[16px] tabular-nums text-[var(--editor-text)]';
|
|
13
|
+
const STRAIGHTEN_MIN = -STRAIGHTEN_LIMIT;
|
|
14
|
+
/**
|
|
15
|
+
* Zahlenfeld zum Regler: getippt wird in einen Entwurf, übernommen erst mit
|
|
16
|
+
* Enter oder beim Verlassen — sonst ersetzte jeder Tastendruck die Eingabe
|
|
17
|
+
* („12" würde 2, „-" ginge gar nicht). Escape verwirft den Entwurf.
|
|
18
|
+
*/
|
|
19
|
+
function StraightenField({ value, onCommit }) {
|
|
20
|
+
const t = useMessages();
|
|
21
|
+
const [draft, setDraft] = useState(null);
|
|
22
|
+
const commit = (text) => {
|
|
23
|
+
const parsed = Number(text.replace(',', '.'));
|
|
24
|
+
if (text.trim() === '' || !Number.isFinite(parsed))
|
|
25
|
+
return null;
|
|
26
|
+
const deg = clampStraighten(parsed);
|
|
27
|
+
if (deg !== value)
|
|
28
|
+
onCommit(deg);
|
|
29
|
+
return deg;
|
|
30
|
+
};
|
|
31
|
+
const step = (by) => {
|
|
32
|
+
const base = draft !== null ? Number(draft.replace(',', '.')) : value;
|
|
33
|
+
const deg = clampStraighten((Number.isFinite(base) ? base : value) + by);
|
|
34
|
+
if (deg !== value)
|
|
35
|
+
onCommit(deg);
|
|
36
|
+
setDraft(String(deg));
|
|
37
|
+
};
|
|
38
|
+
return (_jsx("input", { type: "text",
|
|
39
|
+
// Nicht `numeric`: die iOS-Zifferntastatur hat kein Minus.
|
|
40
|
+
inputMode: "text", role: "spinbutton", "aria-label": t.topBar.straighten, "aria-valuemin": STRAIGHTEN_MIN, "aria-valuemax": STRAIGHTEN_LIMIT, "aria-valuenow": value, value: draft ?? String(value), onFocus: (e) => {
|
|
41
|
+
setDraft(String(value));
|
|
42
|
+
e.currentTarget.select();
|
|
43
|
+
}, onChange: (e) => setDraft(e.currentTarget.value), onBlur: () => {
|
|
44
|
+
if (draft !== null)
|
|
45
|
+
commit(draft);
|
|
46
|
+
setDraft(null);
|
|
47
|
+
}, onKeyDown: (e) => {
|
|
48
|
+
if (e.key === 'Enter') {
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
const deg = draft !== null ? commit(draft) : null;
|
|
51
|
+
setDraft(String(deg ?? value));
|
|
52
|
+
}
|
|
53
|
+
else if (e.key === 'Escape') {
|
|
54
|
+
// preventDefault: die Editor-Tastatur beendet sonst den Zuschneide-Modus.
|
|
55
|
+
e.preventDefault();
|
|
56
|
+
setDraft(String(value));
|
|
57
|
+
}
|
|
58
|
+
else if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
|
|
59
|
+
e.preventDefault();
|
|
60
|
+
step(e.key === 'ArrowUp' ? 1 : -1);
|
|
61
|
+
}
|
|
62
|
+
}, className: STRAIGHTEN_NUMBER }));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* CropModeControls — die Kontextleiste, solange ein Zuschneide-Modus läuft
|
|
66
|
+
* (Hintergrundfoto oder eigenes Bild), auf dem Desktop wie in der mobilen
|
|
67
|
+
* Auswahl-Leiste. Sie ersetzt die normalen Werkzeuge; was der Modus an
|
|
68
|
+
* Werkzeugen braucht, gehört hierher.
|
|
69
|
+
*/
|
|
70
|
+
export function CropModeControls({ onCancel, onDone, aspect = null, straighten = null, onAuto = null, expand = null, layout = 'inline', }) {
|
|
71
|
+
const t = useMessages();
|
|
72
|
+
const expandButton = expand && (_jsxs("button", { type: "button", className: `${TEXT_BTN} bg-transparent text-[var(--editor-text)] hover:bg-[var(--editor-surface-hover)] disabled:opacity-60 disabled:cursor-wait`, onClick: () => expand.onExpand(), disabled: expand.busy, "aria-busy": expand.busy, title: t.topBar.expandWithAi, children: [expand.busy && (_jsx("span", { "aria-hidden": "true", className: "mr-1.5 size-3.5 rounded-full border-2 border-current border-t-transparent motion-safe:animate-spin" })), t.topBar.expand] }));
|
|
73
|
+
const autoButton = onAuto && (_jsx("button", { type: "button", className: `${TEXT_BTN} bg-transparent text-[var(--editor-text)] hover:bg-[var(--editor-surface-hover)]`, onClick: () => onAuto(), "aria-label": t.topBar.autoCrop, title: t.topBar.autoCrop, children: t.topBar.auto }));
|
|
74
|
+
const straightenControls = straighten && (_jsxs("div", { "data-crop-straighten": "", className: cn('flex items-center gap-1', layout === 'mobile' && 'w-full gap-2'), children: [_jsx("input", { type: "range", "aria-label": t.topBar.straightenShort, title: t.topBar.straightenShort, min: -STRAIGHTEN_LIMIT, max: STRAIGHTEN_LIMIT, step: 1, value: straighten.value, onChange: (e) => straighten.onChange(clampStraighten(Number(e.currentTarget.value))), onDoubleClick: () => straighten.onChange(0), className: "w-28 max-canvas-mobile:w-auto max-canvas-mobile:flex-1 min-w-0 h-8 max-canvas-mobile:h-11 shrink-0 accent-[var(--editor-accent)] cursor-pointer" }), _jsx(StraightenField, { value: straighten.value, onCommit: straighten.onChange }), _jsx("span", { "aria-hidden": "true", className: "text-[13px] text-[var(--editor-text-secondary)]", children: "\u00B0" })] }));
|
|
75
|
+
const aspectSelect = aspect && (_jsx("select", { "aria-label": t.topBar.aspectRatio, title: t.topBar.aspectRatio, className: ASPECT_SELECT, value: aspect.value, onChange: (e) => {
|
|
76
|
+
if (isCropAspectId(e.target.value))
|
|
77
|
+
aspect.onChange(e.target.value);
|
|
78
|
+
}, children: CROP_ASPECT_PRESETS.map((preset) => (_jsx("option", { value: preset.id, children: preset.label }, preset.id))) }));
|
|
79
|
+
const exits = (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: `${TEXT_BTN} bg-transparent text-[var(--editor-text)] hover:bg-[var(--editor-surface-hover)]`, onClick: onCancel, title: t.topBar.cancelCrop, children: t.topBar.cancel }), _jsx("button", { type: "button", className: `${TEXT_BTN} bg-[var(--editor-active-bg)] text-[var(--editor-active-fg)]`, onClick: onDone, title: t.topBar.doneCrop, children: t.topBar.done })] }));
|
|
80
|
+
if (layout === 'mobile') {
|
|
81
|
+
return (_jsxs("div", { className: "flex w-full min-w-0 flex-col gap-1", children: [straightenControls, _jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [_jsxs("div", { "data-crop-tools": "", className: cn('canvas-scroll-fade-x flex flex-1 min-w-0 items-center gap-1.5 overflow-x-auto', HIDDEN_SCROLLBAR), children: [expandButton, autoButton, aspectSelect] }), _jsx("div", { "data-crop-exits": "", className: "flex flex-none items-center gap-1", children: exits })] })] }));
|
|
82
|
+
}
|
|
83
|
+
return (_jsxs("div", { className: "flex items-center gap-1", children: [expandButton, autoButton, straightenControls, aspectSelect, exits] }));
|
|
84
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { CanvasImpressumLocale, CanvasImpressumParts } from '@ggraphic/editor/hostServices';
|
|
2
|
+
export type CanvasDownloadChoice = 'png' | 'jpeg' | 'webp';
|
|
3
|
+
/** Print formats: PDF with bleed and crop marks is the default download. */
|
|
4
|
+
export interface PrintExportProps {
|
|
5
|
+
onDownloadPdf: () => Promise<void>;
|
|
6
|
+
/** Notices for photos too small to print well. */
|
|
7
|
+
getWarnings: () => string[];
|
|
8
|
+
/** Posters only: warns (without blocking) while this is missing or a placeholder. */
|
|
9
|
+
impressum?: PrintImpressumGate | null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Digitale Folien-Decks: „PowerPoint (.pptx)“ ist die Vorgabe, „PDF“ ein PDF
|
|
13
|
+
* mit allen Seiten, ohne Druckmarken.
|
|
14
|
+
*/
|
|
15
|
+
export interface SlideDeckExportProps {
|
|
16
|
+
onDownloadPdf: () => Promise<void>;
|
|
17
|
+
/** Meldet nach jeder geschriebenen Folie den Fortschritt. */
|
|
18
|
+
onDownloadPptx: (onProgress: (done: number, total: number) => void) => Promise<void>;
|
|
19
|
+
/** Welche Hausschriften das Deck trägt: deutsche oder österreichische Marke. */
|
|
20
|
+
locale: DeckLocale;
|
|
21
|
+
}
|
|
22
|
+
type DeckLocale = 'de-DE' | 'de-AT';
|
|
23
|
+
export interface PrintImpressumGate {
|
|
24
|
+
/** False until every poster page has reported its state; no warning until then. */
|
|
25
|
+
ready: boolean;
|
|
26
|
+
locale: CanvasImpressumLocale;
|
|
27
|
+
/** The impressum line on the canvas; null when the element is gone. */
|
|
28
|
+
text: string | null;
|
|
29
|
+
/** Writes the line to the canvas (updates the element, or re-adds it). */
|
|
30
|
+
onSubmit: (parts: CanvasImpressumParts) => void;
|
|
31
|
+
}
|
|
32
|
+
export interface DownloadSectionProps {
|
|
33
|
+
onDownload: (format: CanvasDownloadChoice, pixelRatio: number, transparent: boolean) => void | Promise<void>;
|
|
34
|
+
onDownloadAllZip?: (format: CanvasDownloadChoice) => Promise<void>;
|
|
35
|
+
pageCount: number;
|
|
36
|
+
isMultiExporting?: boolean;
|
|
37
|
+
exportProgress?: {
|
|
38
|
+
current: number;
|
|
39
|
+
total: number;
|
|
40
|
+
};
|
|
41
|
+
exportError?: string | null;
|
|
42
|
+
exportNotice?: string | null;
|
|
43
|
+
printExport?: PrintExportProps | null;
|
|
44
|
+
slideDeck?: SlideDeckExportProps | null;
|
|
45
|
+
}
|
|
46
|
+
export declare function DownloadSection({ onDownload, onDownloadAllZip, pageCount, isMultiExporting, exportProgress, exportError, exportNotice, printExport, slideDeck, }: DownloadSectionProps): import("react").JSX.Element;
|
|
47
|
+
export {};
|