@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,262 @@
|
|
|
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 { browserFileDelivery } from '@ggraphic/editor/hostServices';
|
|
5
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
6
|
+
import { useAutoSaveStore, useAutoSaveStoreApi } from '@ggraphic/editor/stores/useAutoSaveStore';
|
|
7
|
+
import { Skeleton } from '@ggraphic/editor/ui/skeleton';
|
|
8
|
+
import { downloadErrorMessage } from '@ggraphic/editor/utils/downloadError';
|
|
9
|
+
import { useCallback, useState, useMemo, useRef, useEffect } from 'react';
|
|
10
|
+
import { createPortal } from 'react-dom';
|
|
11
|
+
import { PiDownloadSimple, PiImages, PiFloppyDisk, PiCheck, PiFileZip, PiFileImage, } from 'react-icons/pi';
|
|
12
|
+
import { IoCheckmarkOutline, IoShareOutline } from 'react-icons/io5';
|
|
13
|
+
import { DownloadNotice } from '@ggraphic/editor/components/DownloadNotice';
|
|
14
|
+
import { AltTextField, useCaptionAltText, useShareAltText, withAltText, } from '@ggraphic/editor/sidebar/components/AltTextField';
|
|
15
|
+
import { SubsectionTabBar } from '../SubsectionTabBar.js';
|
|
16
|
+
const iconBtn = 'size-10 rounded-xl border-none bg-editor-tile cursor-pointer flex items-center justify-center text-foreground text-lg transition-[background-color,color,transform] duration-200 hover:bg-editor-active-bg hover:text-editor-active-fg active:scale-95 disabled:opacity-40 disabled:cursor-not-allowed';
|
|
17
|
+
const primaryBtn = 'w-full py-2.5 px-4 rounded-lg border-none bg-primary-600 text-white font-medium text-sm cursor-pointer flex items-center justify-center gap-2 transition-[background-color,transform] duration-200 hover:bg-primary-700 active:scale-[0.98] disabled:opacity-40 disabled:cursor-not-allowed';
|
|
18
|
+
const secondaryBtn = 'w-full py-2 px-4 rounded-lg border border-editor-border bg-transparent text-foreground font-medium text-sm cursor-pointer flex items-center justify-center gap-2 transition-[background-color,border-color] duration-200 hover:bg-editor-surface-hover';
|
|
19
|
+
const dropdownMenu = 'bg-background-pure border border-editor-border rounded-xl shadow-lg p-1 min-w-[200px]';
|
|
20
|
+
const dropdownOption = 'w-full py-2 px-3 rounded-lg border-none bg-transparent text-foreground text-sm cursor-pointer flex items-center gap-2 transition-[background-color] duration-150 hover:bg-editor-surface-hover disabled:opacity-40 disabled:cursor-not-allowed';
|
|
21
|
+
function usePortalDropdown() {
|
|
22
|
+
const [open, setOpen] = useState(false);
|
|
23
|
+
const [style, setStyle] = useState({});
|
|
24
|
+
const triggerRef = useRef(null);
|
|
25
|
+
const menuRef = useRef(null);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (!open)
|
|
28
|
+
return;
|
|
29
|
+
const position = () => {
|
|
30
|
+
if (!triggerRef.current || !menuRef.current)
|
|
31
|
+
return;
|
|
32
|
+
const rect = triggerRef.current.getBoundingClientRect();
|
|
33
|
+
const menuRect = menuRef.current.getBoundingClientRect();
|
|
34
|
+
const spaceAbove = rect.top;
|
|
35
|
+
const spaceBelow = window.innerHeight - rect.bottom;
|
|
36
|
+
const openAbove = spaceBelow < menuRect.height + 8 && spaceAbove > spaceBelow;
|
|
37
|
+
setStyle({
|
|
38
|
+
position: 'fixed',
|
|
39
|
+
left: `${Math.max(8, Math.min(rect.left + rect.width / 2 - menuRect.width / 2, window.innerWidth - menuRect.width - 8))}px`,
|
|
40
|
+
...(openAbove
|
|
41
|
+
? { bottom: `${window.innerHeight - rect.top + 6}px`, top: 'auto' }
|
|
42
|
+
: { top: `${rect.bottom + 6}px`, bottom: 'auto' }),
|
|
43
|
+
zIndex: 10000,
|
|
44
|
+
opacity: 1,
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
const handleClickOutside = (e) => {
|
|
48
|
+
if (triggerRef.current &&
|
|
49
|
+
!triggerRef.current.contains(e.target) &&
|
|
50
|
+
menuRef.current &&
|
|
51
|
+
!menuRef.current.contains(e.target)) {
|
|
52
|
+
setOpen(false);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
56
|
+
const frame = requestAnimationFrame(position);
|
|
57
|
+
return () => {
|
|
58
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
59
|
+
cancelAnimationFrame(frame);
|
|
60
|
+
};
|
|
61
|
+
}, [open]);
|
|
62
|
+
return { open, setOpen, style, triggerRef, menuRef };
|
|
63
|
+
}
|
|
64
|
+
function DownloadShareSubsection({ exportedImage, shareToken, onCaptureCanvas, captureCanvasImage, onDownload, onNavigateToGallery, canvasText, imageText = '', pageCount = 1, onDownloadAllZip, onShareAllPages, isMultiExporting = false, exportProgress, exportError, exportNotice, }) {
|
|
65
|
+
const t = useMessages();
|
|
66
|
+
const [altText, setAltText] = useShareAltText(imageText);
|
|
67
|
+
const captionAltText = useCaptionAltText(altText);
|
|
68
|
+
const [downloadState, setDownloadState] = useState('idle');
|
|
69
|
+
const [downloadError, setDownloadError] = useState(null);
|
|
70
|
+
const [isSharing, setIsSharing] = useState(false);
|
|
71
|
+
const [shareSuccess, setShareSuccess] = useState(false);
|
|
72
|
+
const dlDropdown = usePortalDropdown();
|
|
73
|
+
const shareDropdown = usePortalDropdown();
|
|
74
|
+
const autoSaveStoreApi = useAutoSaveStoreApi();
|
|
75
|
+
const autoSaveStatus = useAutoSaveStore((s) => s.autoSaveStatus);
|
|
76
|
+
const { fileDelivery = browserFileDelivery, imageShares } = useCanvasEditorServices();
|
|
77
|
+
const shareRoute = fileDelivery.pickShareRoute();
|
|
78
|
+
const isMultiPage = pageCount > 1 && onDownloadAllZip;
|
|
79
|
+
const publishDraftIfNeeded = useCallback(async () => {
|
|
80
|
+
const token = shareToken || autoSaveStoreApi.getState().autoSavedShareToken;
|
|
81
|
+
if (token && imageShares) {
|
|
82
|
+
try {
|
|
83
|
+
await imageShares.publishShare(token);
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
console.warn('[DownloadShareSubsection] Failed to publish draft:', err);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}, [shareToken, autoSaveStoreApi, imageShares]);
|
|
90
|
+
// Remembers the last export attempt so a failed export can be retried
|
|
91
|
+
const lastExportOpRef = useRef(null);
|
|
92
|
+
const handleSingleDownload = async () => {
|
|
93
|
+
dlDropdown.setOpen(false);
|
|
94
|
+
lastExportOpRef.current = handleSingleDownload;
|
|
95
|
+
setDownloadError(null);
|
|
96
|
+
setDownloadState('capturing');
|
|
97
|
+
try {
|
|
98
|
+
onCaptureCanvas();
|
|
99
|
+
await new Promise((resolve) => setTimeout(resolve, 150));
|
|
100
|
+
await onDownload();
|
|
101
|
+
void publishDraftIfNeeded();
|
|
102
|
+
setDownloadState('success');
|
|
103
|
+
setTimeout(() => setDownloadState('idle'), 1500);
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
console.error('[DownloadShareSubsection] Download failed:', error);
|
|
107
|
+
setDownloadState('idle');
|
|
108
|
+
setDownloadError(downloadErrorMessage(error));
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
const handleDownloadAllZip = async () => {
|
|
112
|
+
dlDropdown.setOpen(false);
|
|
113
|
+
lastExportOpRef.current = handleDownloadAllZip;
|
|
114
|
+
if (onDownloadAllZip) {
|
|
115
|
+
await onDownloadAllZip();
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const handleDownloadClick = async () => {
|
|
119
|
+
if (isMultiPage) {
|
|
120
|
+
dlDropdown.setOpen((prev) => !prev);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
await handleSingleDownload();
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const handleNativeShare = useCallback(async () => {
|
|
127
|
+
shareDropdown.setOpen(false);
|
|
128
|
+
const imageToShare = exportedImage || (await captureCanvasImage?.()) || null;
|
|
129
|
+
if (!imageToShare)
|
|
130
|
+
return;
|
|
131
|
+
setIsSharing(true);
|
|
132
|
+
const fileName = `${fileDelivery.filenamePrefix ?? 'ggraphic'}.png`;
|
|
133
|
+
const title = fileDelivery.shareTitle ?? 'ggraphic';
|
|
134
|
+
try {
|
|
135
|
+
if (shareRoute === 'native-host') {
|
|
136
|
+
fileDelivery.shareDataUrlViaNativeHost(imageToShare, fileName, {
|
|
137
|
+
title,
|
|
138
|
+
text: withAltText(canvasText, captionAltText),
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
const blob = await (await fetch(imageToShare)).blob();
|
|
143
|
+
const file = new File([blob], fileName, { type: 'image/png' });
|
|
144
|
+
if (navigator.canShare?.({ files: [file] })) {
|
|
145
|
+
await navigator.share({
|
|
146
|
+
files: [file],
|
|
147
|
+
text: withAltText(canvasText, captionAltText),
|
|
148
|
+
title,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
await navigator.share({
|
|
153
|
+
text: withAltText(canvasText, captionAltText),
|
|
154
|
+
title,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
void publishDraftIfNeeded();
|
|
159
|
+
setShareSuccess(true);
|
|
160
|
+
setTimeout(() => setShareSuccess(false), 2000);
|
|
161
|
+
}
|
|
162
|
+
catch (err) {
|
|
163
|
+
if (err.name !== 'AbortError') {
|
|
164
|
+
console.error('Share failed:', err);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
finally {
|
|
168
|
+
setIsSharing(false);
|
|
169
|
+
}
|
|
170
|
+
}, [
|
|
171
|
+
exportedImage,
|
|
172
|
+
canvasText,
|
|
173
|
+
captionAltText,
|
|
174
|
+
captureCanvasImage,
|
|
175
|
+
shareDropdown,
|
|
176
|
+
publishDraftIfNeeded,
|
|
177
|
+
shareRoute,
|
|
178
|
+
fileDelivery,
|
|
179
|
+
]);
|
|
180
|
+
const handleShareAllPages = useCallback(async () => {
|
|
181
|
+
shareDropdown.setOpen(false);
|
|
182
|
+
if (!onShareAllPages)
|
|
183
|
+
return;
|
|
184
|
+
setIsSharing(true);
|
|
185
|
+
try {
|
|
186
|
+
await onShareAllPages();
|
|
187
|
+
setShareSuccess(true);
|
|
188
|
+
setTimeout(() => setShareSuccess(false), 2000);
|
|
189
|
+
}
|
|
190
|
+
catch (err) {
|
|
191
|
+
if (err.name !== 'AbortError') {
|
|
192
|
+
console.error('Share all pages failed:', err);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
finally {
|
|
196
|
+
setIsSharing(false);
|
|
197
|
+
}
|
|
198
|
+
}, [onShareAllPages, shareDropdown]);
|
|
199
|
+
const handleShareClick = useCallback(async () => {
|
|
200
|
+
if (isMultiPage && onShareAllPages) {
|
|
201
|
+
shareDropdown.setOpen((prev) => !prev);
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
await handleNativeShare();
|
|
205
|
+
}
|
|
206
|
+
}, [isMultiPage, onShareAllPages, shareDropdown, handleNativeShare]);
|
|
207
|
+
return (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsx("h3", { className: "text-sm font-semibold text-foreground m-0", children: t.shell.downloadAndShare }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("div", { className: "relative", children: [_jsx("button", { ref: dlDropdown.triggerRef, className: iconBtn, onClick: handleDownloadClick, disabled: downloadState !== 'idle' && !isMultiPage, title: t.shell.download, "aria-label": t.shell.downloadImage, "aria-haspopup": isMultiPage ? 'menu' : undefined, "aria-expanded": isMultiPage ? dlDropdown.open : undefined, type: "button", children: downloadState === 'capturing' ? (_jsx(Skeleton, { className: "size-4 rounded-full" })) : downloadState === 'success' ? (_jsx(PiCheck, {})) : (_jsx(PiDownloadSimple, {})) }), dlDropdown.open &&
|
|
208
|
+
isMultiPage &&
|
|
209
|
+
createPortal(_jsxs("div", { ref: dlDropdown.menuRef, className: dropdownMenu, style: dlDropdown.style, role: "menu", children: [_jsxs("button", { className: dropdownOption, onClick: handleSingleDownload, role: "menuitem", type: "button", children: [_jsx(PiFileImage, {}), _jsx("span", { children: t.shell.thisPagePng })] }), _jsx("button", { className: dropdownOption, onClick: handleDownloadAllZip, disabled: isMultiExporting, role: "menuitem", type: "button", children: isMultiExporting ? (_jsxs(_Fragment, { children: [_jsx(Skeleton, { className: "size-4 rounded-full" }), _jsx("span", { children: t.shell.exporting })] })) : (_jsxs(_Fragment, { children: [_jsx(PiFileZip, {}), _jsx("span", { children: t.shell.allPagesZip(pageCount) })] })) })] }), document.body)] }), shareRoute !== null && (_jsxs("div", { className: "relative", children: [_jsx("button", { ref: shareDropdown.triggerRef, className: iconBtn, onClick: handleShareClick, disabled: isSharing, title: t.shell.share, "aria-label": t.shell.shareImage, "aria-haspopup": isMultiPage && onShareAllPages ? 'menu' : undefined, "aria-expanded": isMultiPage && onShareAllPages ? shareDropdown.open : undefined, type: "button", children: isSharing ? (_jsx(Skeleton, { className: "size-4 rounded-full" })) : shareSuccess ? (_jsx(PiCheck, {})) : (_jsx(IoShareOutline, {})) }), shareDropdown.open &&
|
|
210
|
+
isMultiPage &&
|
|
211
|
+
onShareAllPages &&
|
|
212
|
+
createPortal(_jsxs("div", { ref: shareDropdown.menuRef, className: dropdownMenu, style: shareDropdown.style, role: "menu", children: [_jsxs("button", { className: dropdownOption, onClick: handleNativeShare, role: "menuitem", type: "button", children: [_jsx(IoShareOutline, {}), _jsx("span", { children: t.shell.shareThisPage })] }), _jsxs("button", { className: dropdownOption, onClick: handleShareAllPages, disabled: isSharing, role: "menuitem", type: "button", children: [_jsx(PiImages, {}), _jsx("span", { children: t.shell.shareAllPages })] })] }), document.body)] }))] }), _jsx(AltTextField, { value: altText, onChange: setAltText }), isMultiExporting && exportProgress && exportProgress.total > 0 && (_jsxs("div", { className: "relative w-full h-6 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: `${(exportProgress.current / exportProgress.total) * 100}%` } }), _jsx("span", { className: "absolute inset-0 flex items-center justify-center text-xs font-medium text-foreground", children: t.shell.pagesProgress(exportProgress.current, exportProgress.total) })] })), downloadError && _jsx(DownloadNotice, { children: downloadError }), exportNotice && _jsx(DownloadNotice, { tone: "info", children: exportNotice }), exportError && !isMultiExporting && (_jsxs(DownloadNotice, { children: [_jsx("span", { children: exportError }), lastExportOpRef.current && (_jsx("button", { className: "bg-transparent border-none p-0 cursor-pointer text-sm font-medium text-primary-600 hover:underline", onClick: () => void lastExportOpRef.current?.(), type: "button", children: t.shell.retry }))] })), downloadState === 'success' && autoSaveStatus === 'saving' && (_jsxs("div", { className: "flex items-center gap-2 text-sm text-foreground-muted", children: [_jsx(Skeleton, { className: "size-3 rounded-full" }), _jsx("span", { children: t.shell.syncing })] })), downloadState === 'success' && autoSaveStatus === 'saved' && shareToken && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center gap-2 text-sm text-primary-600", children: [_jsx(IoCheckmarkOutline, {}), _jsx("span", { children: t.shell.savedToGallery })] }), _jsxs("button", { className: secondaryBtn, onClick: onNavigateToGallery, type: "button", children: [_jsx(PiImages, {}), t.shell.toGallery] })] })), autoSaveStatus === 'error' && (_jsxs("div", { className: "flex items-center gap-2 text-sm text-red-600", children: [_jsx("span", { children: t.shell.saveError }), _jsx("button", { className: "bg-transparent border-none p-0 cursor-pointer text-sm font-medium text-primary-600 hover:underline", onClick: () => autoSaveStoreApi.getState().retryAutoSave?.(), type: "button", children: t.shell.retry })] }))] }));
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* The template flow itself belongs to the host — it knows the document
|
|
216
|
+
* identity (canvas id) a template is snapshotted from, which this package
|
|
217
|
+
* deliberately does not. Rendered only when the host supplies the callback.
|
|
218
|
+
*/
|
|
219
|
+
function TemplateSubsection({ onSaveAsTemplate }) {
|
|
220
|
+
const t = useMessages();
|
|
221
|
+
return (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsx("h3", { className: "text-sm font-semibold text-foreground m-0", children: t.shell.template }), _jsx("p", { className: "m-0 text-xs text-foreground-muted", children: t.shell.templateHint }), _jsxs("button", { className: primaryBtn, onClick: onSaveAsTemplate, type: "button", children: [_jsx(PiFloppyDisk, {}), " ", t.shell.saveAsTemplate] })] }));
|
|
222
|
+
}
|
|
223
|
+
export function GenericShareSection({ exportedImage, shareToken, onCaptureCanvas, captureCanvasImage, onDownload, onNavigateToGallery, canvasText, imageText, pageCount, onDownloadAllZip, onShareAllPages, isMultiExporting, exportProgress, exportError, exportNotice, onSaveAsTemplate, }) {
|
|
224
|
+
const t = useMessages();
|
|
225
|
+
const subsections = useMemo(() => [
|
|
226
|
+
{
|
|
227
|
+
id: 'download',
|
|
228
|
+
icon: PiDownloadSimple,
|
|
229
|
+
label: t.shell.downloadTab,
|
|
230
|
+
content: (_jsx(DownloadShareSubsection, { exportedImage: exportedImage, shareToken: shareToken, onCaptureCanvas: onCaptureCanvas, captureCanvasImage: captureCanvasImage, onDownload: onDownload, onNavigateToGallery: onNavigateToGallery, canvasText: canvasText, imageText: imageText, pageCount: pageCount, onDownloadAllZip: onDownloadAllZip, onShareAllPages: onShareAllPages, isMultiExporting: isMultiExporting, exportProgress: exportProgress, exportError: exportError, exportNotice: exportNotice })),
|
|
231
|
+
},
|
|
232
|
+
...(onSaveAsTemplate
|
|
233
|
+
? [
|
|
234
|
+
{
|
|
235
|
+
id: 'template',
|
|
236
|
+
icon: PiFloppyDisk,
|
|
237
|
+
label: t.shell.template,
|
|
238
|
+
content: _jsx(TemplateSubsection, { onSaveAsTemplate: onSaveAsTemplate }),
|
|
239
|
+
},
|
|
240
|
+
]
|
|
241
|
+
: []),
|
|
242
|
+
], [
|
|
243
|
+
exportedImage,
|
|
244
|
+
shareToken,
|
|
245
|
+
onCaptureCanvas,
|
|
246
|
+
captureCanvasImage,
|
|
247
|
+
onDownload,
|
|
248
|
+
onNavigateToGallery,
|
|
249
|
+
canvasText,
|
|
250
|
+
imageText,
|
|
251
|
+
pageCount,
|
|
252
|
+
onDownloadAllZip,
|
|
253
|
+
onShareAllPages,
|
|
254
|
+
isMultiExporting,
|
|
255
|
+
exportProgress,
|
|
256
|
+
exportError,
|
|
257
|
+
exportNotice,
|
|
258
|
+
onSaveAsTemplate,
|
|
259
|
+
t,
|
|
260
|
+
]);
|
|
261
|
+
return _jsx(SubsectionTabBar, { subsections: subsections, defaultSubsection: "download" });
|
|
262
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface IconsSectionProps {
|
|
2
|
+
selectedIcons: string[];
|
|
3
|
+
onIconToggle: (iconId: string, selected: boolean) => void;
|
|
4
|
+
maxSelections?: number;
|
|
5
|
+
isExpanded?: boolean;
|
|
6
|
+
searchQuery?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function IconsSection({ selectedIcons, onIconToggle, maxSelections, isExpanded, searchQuery, }: IconsSectionProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { useIconCatalog } from '@ggraphic/editor/hooks/useIconCatalog';
|
|
4
|
+
import { usePaginatedIcons } from '@ggraphic/editor/hooks/usePaginatedIcons';
|
|
5
|
+
import { Skeleton } from '@ggraphic/editor/ui/skeleton';
|
|
6
|
+
import { cn } from '@ggraphic/editor/utils/cn';
|
|
7
|
+
import { Icon } from '@iconify/react';
|
|
8
|
+
import { useCallback, useMemo, useRef, useEffect } from 'react';
|
|
9
|
+
import { PiCheck } from 'react-icons/pi';
|
|
10
|
+
import { CARD_GRID, CARD_CHECK_SMALL, CARD_PREVIEW, SELECTABLE_CARD, SELECTABLE_CARD_DISABLED, SIDEBAR_SECTION, } from '../sidebarStyles.js';
|
|
11
|
+
const RECOMMENDED_ICON_IDS = [
|
|
12
|
+
'tabler:flower',
|
|
13
|
+
'tabler:heart-filled',
|
|
14
|
+
'tabler:sparkles',
|
|
15
|
+
'tabler:star-filled',
|
|
16
|
+
];
|
|
17
|
+
export function IconsSection({ selectedIcons, onIconToggle, maxSelections = 3, isExpanded = false, searchQuery = '', }) {
|
|
18
|
+
const sentinelRef = useRef(null);
|
|
19
|
+
// Browsing shows the default set; search spans all bundled sets.
|
|
20
|
+
const { data: allIcons = [], isLoading: iconsLoading } = useIconCatalog();
|
|
21
|
+
const recommendedIcons = useMemo(() => RECOMMENDED_ICON_IDS.map((id) => allIcons.find((icon) => icon.id === id)).filter(Boolean), [allIcons]);
|
|
22
|
+
const { visibleIcons, hasMore, loadMore, isLoading: paginationLoading, } = usePaginatedIcons(isExpanded, searchQuery);
|
|
23
|
+
const hasSearch = searchQuery.trim().length > 0;
|
|
24
|
+
const icons = hasSearch ? visibleIcons : isExpanded ? visibleIcons : recommendedIcons;
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!isExpanded || !hasMore)
|
|
27
|
+
return;
|
|
28
|
+
const scrollRoot = sentinelRef.current?.closest('.sidebar-panel__content');
|
|
29
|
+
const observer = new IntersectionObserver((entries) => {
|
|
30
|
+
if (entries[0].isIntersecting) {
|
|
31
|
+
loadMore();
|
|
32
|
+
}
|
|
33
|
+
}, { root: scrollRoot ?? null, rootMargin: '300px', threshold: 0 });
|
|
34
|
+
if (sentinelRef.current) {
|
|
35
|
+
observer.observe(sentinelRef.current);
|
|
36
|
+
}
|
|
37
|
+
return () => observer.disconnect();
|
|
38
|
+
}, [isExpanded, hasMore, loadMore]);
|
|
39
|
+
const handleIconClick = useCallback((iconId) => {
|
|
40
|
+
const isSelected = selectedIcons.includes(iconId);
|
|
41
|
+
if (isSelected) {
|
|
42
|
+
onIconToggle(iconId, false);
|
|
43
|
+
}
|
|
44
|
+
else if (selectedIcons.length < maxSelections) {
|
|
45
|
+
onIconToggle(iconId, true);
|
|
46
|
+
}
|
|
47
|
+
}, [selectedIcons, onIconToggle, maxSelections]);
|
|
48
|
+
return (_jsxs("div", { className: cn(SIDEBAR_SECTION, 'w-full max-canvas-mobile:!p-0 max-canvas-mobile:!m-0'), children: [iconsLoading ? (_jsx("div", { className: cn(CARD_GRID, 'grid-cols-[repeat(auto-fill,minmax(56px,1fr))]'), children: Array.from({ length: 12 }).map((_, i) => (_jsx(Skeleton, { className: "aspect-square rounded-lg" }, i))) })) : (_jsx("div", { className: cn(CARD_GRID, 'grid-cols-[repeat(auto-fill,minmax(56px,1fr))]'), children: icons.map((icon) => {
|
|
49
|
+
if (!icon)
|
|
50
|
+
return null;
|
|
51
|
+
const isSelected = selectedIcons.includes(icon.id);
|
|
52
|
+
const isDisabled = !isSelected && selectedIcons.length >= maxSelections;
|
|
53
|
+
return (_jsx("button", { type: "button", className: cn(SELECTABLE_CARD, isDisabled && SELECTABLE_CARD_DISABLED), onClick: () => handleIconClick(icon.id), title: icon.name, disabled: isDisabled, children: _jsxs("div", { className: cn(CARD_PREVIEW, 'text-[var(--font-color)]'), children: [_jsx(Icon, { icon: icon.id, width: 30, height: 30 }), isSelected && (_jsx("span", { className: CARD_CHECK_SMALL, children: _jsx(PiCheck, { size: 8 }) }))] }) }, icon.id));
|
|
54
|
+
}) })), (isExpanded || hasSearch) && paginationLoading && (_jsx("div", { className: cn(CARD_GRID, 'grid-cols-[repeat(auto-fill,minmax(56px,1fr))]', 'mt-2'), children: Array.from({ length: 6 }).map((_, i) => (_jsx(Skeleton, { className: "aspect-square rounded-lg" }, i))) })), isExpanded && !hasSearch && (_jsxs(_Fragment, { children: [_jsx("div", { ref: sentinelRef, className: "h-px w-full" }), hasMore && !paginationLoading && (_jsx("div", { className: cn(CARD_GRID, 'grid-cols-[repeat(auto-fill,minmax(56px,1fr))]', 'mt-2'), children: Array.from({ length: 6 }).map((_, i) => (_jsx(Skeleton, { className: "aspect-square rounded-lg" }, i))) }))] }))] }));
|
|
55
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IllustrationInstance } from '@ggraphic/editor/utils/illustrations/types';
|
|
2
|
+
export interface IllustrationSettingsProps {
|
|
3
|
+
selectedIllustration: IllustrationInstance;
|
|
4
|
+
onUpdateIllustration: (id: string, partial: Partial<IllustrationInstance>) => void;
|
|
5
|
+
onRemoveIllustration: (id: string) => void;
|
|
6
|
+
onDuplicateIllustration?: (id: string) => void;
|
|
7
|
+
}
|
|
8
|
+
/** Mood, colour and opacity of the illustration selected on the canvas. */
|
|
9
|
+
export declare function IllustrationSettings({ selectedIllustration, onUpdateIllustration, onRemoveIllustration, onDuplicateIllustration, }: IllustrationSettingsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { bindPatch } from '../../brand/bindPick.js';
|
|
4
|
+
import { activeBrand } from '@ggraphic/editor/brand/brandRegistry';
|
|
5
|
+
import { CustomColorSwatch } from '@ggraphic/editor/components/CustomColorSwatch';
|
|
6
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
7
|
+
import { cn } from '@ggraphic/editor/utils/cn';
|
|
8
|
+
import { PiTrash, PiCopy } from 'react-icons/pi';
|
|
9
|
+
import { SidebarSlider } from '../components/SidebarSlider.js';
|
|
10
|
+
import { ACTION_BTN, ACTION_BTN_DANGER, SECTION_HEADER, SECTION_TITLE, } from '@ggraphic/editor/sidebar/sidebarStyles';
|
|
11
|
+
const MOOD_OPTIONS = [
|
|
12
|
+
{ id: 'happy', label: '😊' },
|
|
13
|
+
{ id: 'blissful', label: '😌' },
|
|
14
|
+
{ id: 'lovestruck', label: '😍' },
|
|
15
|
+
{ id: 'shocked', label: '😲' },
|
|
16
|
+
{ id: 'sad', label: '😢' },
|
|
17
|
+
];
|
|
18
|
+
/** Mood, colour and opacity of the illustration selected on the canvas. */
|
|
19
|
+
export function IllustrationSettings({ selectedIllustration, onUpdateIllustration, onRemoveIllustration, onDuplicateIllustration, }) {
|
|
20
|
+
const t = useMessages();
|
|
21
|
+
const isKawaiiSelected = selectedIllustration.source === 'kawaii';
|
|
22
|
+
const kawaiiInstance = isKawaiiSelected ? selectedIllustration : null;
|
|
23
|
+
return (_jsxs("div", { className: "flex flex-col gap-[var(--spacing-small)] p-[var(--spacing-small)] bg-background-alt rounded-[var(--border-radius-md)] mt-auto", children: [_jsxs("div", { className: SECTION_HEADER, children: [_jsx("span", { className: SECTION_TITLE, children: isKawaiiSelected ? t.sidebar.illustration.editCharacter : t.sidebar.illustration.edit }), onDuplicateIllustration && (_jsx("button", { className: ACTION_BTN, onClick: () => onDuplicateIllustration(selectedIllustration.id), title: t.commands.duplicate, children: _jsx(PiCopy, { size: 12 }) })), _jsx("button", { className: ACTION_BTN_DANGER, onClick: () => onRemoveIllustration(selectedIllustration.id), title: t.sidebar.imageAdjust.remove, children: _jsx(PiTrash, { size: 12 }) })] }), kawaiiInstance && (_jsxs("div", { className: "flex flex-col gap-xs", children: [_jsx("span", { className: "text-[length:var(--font-size-sm)] text-foreground-muted mb-xs", children: t.sidebar.illustration.mood }), _jsx("div", { className: "flex gap-xs flex-wrap", children: MOOD_OPTIONS.map((mood) => (_jsx("button", { className: cn('w-8 h-8 rounded-[var(--border-radius-md)] border border-[var(--border-default,rgba(0,0,0,0.1))] bg-background cursor-pointer text-lg flex items-center justify-center transition-all duration-150 p-0 hover:border-primary-600', kawaiiInstance.mood === mood.id &&
|
|
24
|
+
'border-primary-600 bg-[var(--primary-50,#e8f5e9)]'), onClick: () => onUpdateIllustration(kawaiiInstance.id, { mood: mood.id }), title: mood.id, children: mood.label }, mood.id))) })] })), selectedIllustration && (_jsxs("div", { className: "flex flex-col gap-xs", children: [_jsx("span", { className: "text-[length:var(--font-size-sm)] text-foreground-muted mb-xs", children: t.sidebar.chart.color }), _jsxs("div", { className: "flex gap-[var(--spacing-small)] flex-wrap", children: [activeBrand().palette.map((color) => (_jsx("button", { className: cn('w-7 h-7 rounded-full border border-black/10 cursor-pointer transition-transform duration-150 relative p-0 hover:border-[var(--border-default,rgba(0,0,0,0.2))]', selectedIllustration.color === color.color &&
|
|
25
|
+
'after:content-[""] after:absolute after:-top-1 after:-left-1 after:-right-1 after:-bottom-1 after:border-2 after:border-primary-600 after:rounded-full'), style: { backgroundColor: color.color }, onClick: () => onUpdateIllustration(selectedIllustration.id, {
|
|
26
|
+
color: color.color,
|
|
27
|
+
...bindPatch(selectedIllustration.bind, 'color', color.color, color.ref),
|
|
28
|
+
}), title: color.label }, color.id))), _jsx(CustomColorSwatch, { value: selectedIllustration.color, presets: activeBrand().palette.map((color) => color.color), onPick: (color) => onUpdateIllustration(selectedIllustration.id, {
|
|
29
|
+
color,
|
|
30
|
+
...bindPatch(selectedIllustration.bind, 'color', color),
|
|
31
|
+
}), className: "size-7", outlineOffset: 3 })] })] })), _jsx("div", { className: "flex flex-col gap-xs", children: _jsx(SidebarSlider, { value: selectedIllustration.opacity, onValueChange: (opacity) => onUpdateIllustration(selectedIllustration.id, { opacity }), min: 0.1, max: 1, step: 0.05, label: t.sidebar.illustration.transparency, unit: "%" }) })] }));
|
|
32
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SvgDef } from '@ggraphic/editor/utils/illustrations/types';
|
|
2
|
+
/** Illustration thumbnail that falls back to the full SVG when no pre-rendered thumb exists. */
|
|
3
|
+
export declare function IllustrationThumb({ def, alt, className, }: {
|
|
4
|
+
def: SvgDef;
|
|
5
|
+
alt?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { useCanvasEditorServices } from '@ggraphic/editor/CanvasEditorProvider';
|
|
4
|
+
import { getIllustrationPath, getIllustrationThumbPath, } from '@ggraphic/editor/utils/illustrations/registry';
|
|
5
|
+
/** Illustration thumbnail that falls back to the full SVG when no pre-rendered thumb exists. */
|
|
6
|
+
export function IllustrationThumb({ def, alt, className, }) {
|
|
7
|
+
const { assetBaseUrl = '' } = useCanvasEditorServices();
|
|
8
|
+
return (_jsx("img", { src: getIllustrationThumbPath(def, assetBaseUrl), alt: alt ?? def.name, className: className, loading: "lazy", onError: (e) => {
|
|
9
|
+
const img = e.currentTarget;
|
|
10
|
+
if (!img.dataset.fallback) {
|
|
11
|
+
img.dataset.fallback = '1';
|
|
12
|
+
img.src = getIllustrationPath(def, assetBaseUrl);
|
|
13
|
+
}
|
|
14
|
+
} }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ImageAdjustments, type UserImageInstance } from '@ggraphic/editor/utils/userImageUtils';
|
|
2
|
+
export interface ImageAdjustSectionProps {
|
|
3
|
+
selectedImage: UserImageInstance | null;
|
|
4
|
+
onUpdateImage: (id: string, partial: Partial<UserImageInstance>) => void;
|
|
5
|
+
/** The template's background photo, when it is the selection: the look only, no crop or shadow. */
|
|
6
|
+
backgroundPhoto?: {
|
|
7
|
+
adjustments: ImageAdjustments;
|
|
8
|
+
onUpdate: (partial: Partial<ImageAdjustments>) => void;
|
|
9
|
+
} | null;
|
|
10
|
+
/** The page's colour world (`brandScheme` of its state); the Duotone look takes its colours from it. */
|
|
11
|
+
brandScheme?: string | null;
|
|
12
|
+
}
|
|
13
|
+
export declare function ImageAdjustSection({ selectedImage, onUpdateImage, backgroundPhoto, brandScheme, }: ImageAdjustSectionProps): import("react").JSX.Element | null;
|
|
@@ -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 { activeBrand } from '@ggraphic/editor/brand/brandRegistry';
|
|
4
|
+
import { CustomColorSwatch } from '@ggraphic/editor/components/CustomColorSwatch';
|
|
5
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
6
|
+
import { Switch } from '@ggraphic/editor/ui/switch';
|
|
7
|
+
import { defaultTint, duotoneLook, EMPTY_ADJUSTMENTS, IMAGE_PRESETS, withoutDuotone, } from '@ggraphic/editor/utils/imageFilters';
|
|
8
|
+
import { CROP_PRESETS, cropPresetUpdate, } from '@ggraphic/editor/utils/userImageUtils';
|
|
9
|
+
import { colorName } from '@ggraphic/editor/utils/colorNames';
|
|
10
|
+
import { SidebarSlider } from '@ggraphic/editor/sidebar/components/SidebarSlider';
|
|
11
|
+
function naturalSize(src) {
|
|
12
|
+
return new Promise((resolve, reject) => {
|
|
13
|
+
const image = new Image();
|
|
14
|
+
image.crossOrigin = 'anonymous';
|
|
15
|
+
image.onload = () => resolve({ width: image.naturalWidth, height: image.naturalHeight });
|
|
16
|
+
image.onerror = reject;
|
|
17
|
+
image.src = src;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
const GROUP_LABEL = 'text-[11px] font-semibold uppercase tracking-wide text-foreground-muted';
|
|
21
|
+
export function ImageAdjustSection({ selectedImage, onUpdateImage, backgroundPhoto = null, brandScheme = null, }) {
|
|
22
|
+
const { tints, shadows } = activeBrand().effects;
|
|
23
|
+
const t = useMessages();
|
|
24
|
+
const img = selectedImage;
|
|
25
|
+
const adj = img ?? backgroundPhoto?.adjustments ?? null;
|
|
26
|
+
if (!adj)
|
|
27
|
+
return null;
|
|
28
|
+
const set = (partial) => img ? onUpdateImage(img.id, partial) : backgroundPhoto?.onUpdate(partial);
|
|
29
|
+
// A look other than Duotone ends the duotone and the bindings of its two colours.
|
|
30
|
+
const applyPreset = (preset) => {
|
|
31
|
+
if (preset.id === 'duotone') {
|
|
32
|
+
const look = duotoneLook(img ?? undefined, brandScheme);
|
|
33
|
+
// The page background photo has no bindings to carry: it takes the colours only.
|
|
34
|
+
if (!look)
|
|
35
|
+
return;
|
|
36
|
+
if (img)
|
|
37
|
+
onUpdateImage(img.id, look);
|
|
38
|
+
else {
|
|
39
|
+
const { bind: _bind, ...colours } = look;
|
|
40
|
+
backgroundPhoto?.onUpdate(colours);
|
|
41
|
+
}
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
set({ ...preset.values, ...(img ? withoutDuotone(img) : {}) });
|
|
45
|
+
};
|
|
46
|
+
// Picking a tint colour replaces a duotone.
|
|
47
|
+
const setTint = (partial) => set({ ...partial, ...(img ? withoutDuotone(img) : { duotoneLow: null, duotoneHigh: null }) });
|
|
48
|
+
const setShadow = (partial) => img && onUpdateImage(img.id, partial);
|
|
49
|
+
const shadowOn = !!img?.shadowColor;
|
|
50
|
+
const applyCrop = (preset) => {
|
|
51
|
+
if (!img)
|
|
52
|
+
return;
|
|
53
|
+
void naturalSize(img.src)
|
|
54
|
+
.then((natural) => onUpdateImage(img.id, cropPresetUpdate(img, preset, natural)))
|
|
55
|
+
.catch(() => { });
|
|
56
|
+
};
|
|
57
|
+
const toggleShadow = () => shadowOn
|
|
58
|
+
? setShadow({ shadowColor: undefined, shadowBlur: 0, shadowOpacity: 0 })
|
|
59
|
+
: setShadow({
|
|
60
|
+
shadowColor: '#000000',
|
|
61
|
+
shadowBlur: 8,
|
|
62
|
+
shadowOffsetX: 4,
|
|
63
|
+
shadowOffsetY: 4,
|
|
64
|
+
shadowOpacity: 0.5,
|
|
65
|
+
});
|
|
66
|
+
return (_jsxs("div", { className: "flex flex-col gap-4 p-md w-full min-w-0", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-sm font-semibold text-foreground", children: t.sidebar.imageAdjust.title }), _jsx("button", { type: "button", onClick: () => set({ ...EMPTY_ADJUSTMENTS, ...(img ? withoutDuotone(img) : {}) }), className: "rounded-md px-2 py-1 text-xs text-foreground-muted hover:text-foreground", children: t.sidebar.imageAdjust.reset })] }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("span", { className: GROUP_LABEL, children: "Presets" }), _jsx("div", { className: "grid grid-cols-3 gap-1.5", children: IMAGE_PRESETS.map((preset) => (_jsx("button", { type: "button", onClick: () => applyPreset(preset), className: "rounded-md border border-editor-border-strong px-2 py-1.5 text-xs text-foreground-muted transition-colors hover:border-primary-500 hover:text-foreground", children: preset.label }, preset.id))) })] }), img && (_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("span", { className: GROUP_LABEL, children: t.topBar.crop }), _jsx("div", { className: "grid grid-cols-4 gap-1.5", children: CROP_PRESETS.map((preset) => (_jsx("button", { type: "button", onClick: () => applyCrop(preset), className: "rounded-md border border-editor-border-strong px-2 py-1.5 text-xs text-foreground-muted transition-colors hover:border-primary-500 hover:text-foreground", children: preset.label }, preset.id))) })] })), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("span", { className: GROUP_LABEL, children: t.sidebar.imageAdjust.flip }), _jsx("div", { className: "grid grid-cols-2 gap-1.5", children: [
|
|
67
|
+
['flipX', t.sidebar.imageAdjust.horizontal],
|
|
68
|
+
['flipY', t.sidebar.imageAdjust.vertical],
|
|
69
|
+
].map(([key, label]) => (_jsx("button", { type: "button", "aria-pressed": !!adj[key], onClick: () => set({ [key]: !adj[key] }), className: "rounded-md border border-editor-border-strong px-2 py-1.5 text-xs text-foreground-muted transition-colors hover:border-primary-500 hover:text-foreground aria-pressed:border-primary-500 aria-pressed:text-foreground", children: label }, key))) })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("span", { className: GROUP_LABEL, children: t.sidebar.imageAdjust.tint }), _jsxs("div", { className: "flex items-center gap-1.5", children: [tints.map((c) => (_jsx("button", { type: "button", onClick: () => setTint({ tint: c, tintStrength: adj.tintStrength || 1 }), title: colorName(c), "aria-label": t.sidebar.imageAdjust.tintIn(colorName(c)), "aria-pressed": (adj.tint ?? defaultTint()) === c && !!adj.tintStrength, className: "size-6 rounded-full border border-black/10 transition-transform hover:scale-110", style: {
|
|
70
|
+
backgroundColor: c,
|
|
71
|
+
outline: (adj.tint ?? defaultTint()) === c && adj.tintStrength
|
|
72
|
+
? '2px solid var(--editor-accent)'
|
|
73
|
+
: 'none',
|
|
74
|
+
outlineOffset: '2px',
|
|
75
|
+
} }, c))), _jsx(CustomColorSwatch, { value: adj.tintStrength ? adj.tint : null, presets: tints, onPick: (color) => setTint({ tint: color, tintStrength: adj.tintStrength || 1 }), className: "size-6" })] }), _jsx(SidebarSlider, { label: t.sidebar.imageAdjust.intensity, value: adj.tintStrength ?? 0, onValueChange: (v) => set({ tintStrength: v }), min: 0, max: 1, step: 0.05, unit: "%" })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("span", { className: GROUP_LABEL, children: t.sidebar.imageAdjust.whiteBalance }), _jsx(SidebarSlider, { label: t.sidebar.imageAdjust.colorTemperature, value: adj.temperature ?? 0, onValueChange: (v) => set({ temperature: v }), min: -100, max: 100, step: 1 }), _jsx(SidebarSlider, { label: t.sidebar.imageAdjust.hue, value: adj.hue ?? 0, onValueChange: (v) => set({ hue: v }), min: 0, max: 360, step: 1 })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("span", { className: GROUP_LABEL, children: t.sidebar.imageAdjust.light }), _jsx(SidebarSlider, { label: t.sidebar.imageAdjust.brightness, value: adj.brightness ?? 0, onValueChange: (v) => set({ brightness: v }), min: -1, max: 1, step: 0.05 }), _jsx(SidebarSlider, { label: t.sidebar.imageAdjust.contrast, value: adj.contrast ?? 0, onValueChange: (v) => set({ contrast: v }), min: -100, max: 100, step: 1 })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("span", { className: GROUP_LABEL, children: t.sidebar.imageAdjust.colorAndSharpness }), _jsx(SidebarSlider, { label: t.sidebar.imageAdjust.saturation, value: adj.saturation ?? 0, onValueChange: (v) => set({ saturation: v }), min: -2, max: 10, step: 0.1 }), _jsx(SidebarSlider, { label: t.sidebar.imageAdjust.blur, value: adj.blur ?? 0, onValueChange: (v) => set({ blur: v }), min: 0, max: 40, step: 1 }), _jsx(SidebarSlider, { label: t.sidebar.imageAdjust.vignette, value: adj.vignette ?? 0, onValueChange: (v) => set({ vignette: v }), min: 0, max: 1, step: 0.05, unit: "%" })] }), img && (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: GROUP_LABEL, children: t.topBar.shadow }), _jsx("button", { type: "button", onClick: toggleShadow, className: "text-[11px] font-medium text-primary-600 hover:underline", children: shadowOn ? t.sidebar.imageAdjust.remove : t.sidebar.imageAdjust.enable })] }), shadowOn && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [shadows.map((c) => (_jsx("button", { type: "button", onClick: () => setShadow({ shadowColor: c }), title: colorName(c), "aria-label": colorName(c), "aria-pressed": img.shadowColor === c, className: "size-6 rounded-full border border-black/10 transition-transform hover:scale-110", style: {
|
|
76
|
+
backgroundColor: c,
|
|
77
|
+
outline: img.shadowColor === c ? '2px solid var(--editor-accent)' : 'none',
|
|
78
|
+
outlineOffset: '2px',
|
|
79
|
+
} }, c))), _jsx(CustomColorSwatch, { value: img.shadowColor, presets: shadows, onPick: (color) => setShadow({ shadowColor: color }), className: "size-6" })] }), _jsx(SidebarSlider, { label: t.sidebar.imageAdjust.softness, value: img.shadowBlur ?? 0, onValueChange: (v) => setShadow({ shadowBlur: v }), min: 0, max: 40, step: 1 }), _jsx(SidebarSlider, { label: t.sidebar.imageAdjust.offsetX, value: img.shadowOffsetX ?? 0, onValueChange: (v) => setShadow({ shadowOffsetX: v }), min: -40, max: 40, step: 1 }), _jsx(SidebarSlider, { label: t.sidebar.imageAdjust.offsetY, value: img.shadowOffsetY ?? 0, onValueChange: (v) => setShadow({ shadowOffsetY: v }), min: -40, max: 40, step: 1 }), _jsx(SidebarSlider, { label: t.sidebar.imageAdjust.opacity, value: img.shadowOpacity ?? 0, onValueChange: (v) => setShadow({ shadowOpacity: v }), min: 0, max: 1, step: 0.05, unit: "%" })] }))] })), _jsx("div", { className: "flex flex-col gap-2", children: [
|
|
80
|
+
['grayscale', t.sidebar.imageAdjust.grayscale],
|
|
81
|
+
['sepia', t.sidebar.imageAdjust.sepia],
|
|
82
|
+
['invert', t.sidebar.imageAdjust.invert],
|
|
83
|
+
].map(([key, label]) => (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-xs text-foreground", children: label }), _jsx(Switch, { checked: !!adj[key], onCheckedChange: (v) => set({ [key]: v }), "aria-label": label })] }, key))) })] }));
|
|
84
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* „Ebenen": jedes Element der aktiven Seite als Eintrag, vorderstes zuerst —
|
|
3
|
+
* der Weg zu allem auf der Fläche ohne Maus und für Screenreader (#4953).
|
|
4
|
+
*
|
|
5
|
+
* Eine Listbox mit Mehrfachauswahl und rovingem Tabindex. Die Auswahl folgt
|
|
6
|
+
* dem Fokus: Pfeil hoch/runter, Pos1 und Ende wählen den Eintrag allein aus;
|
|
7
|
+
* Umschalt+Pfeil nimmt dazu, Strg/⌘+Pfeil bewegt nur den Fokus, Leertaste
|
|
8
|
+
* (oder Strg/⌘-Klick) schaltet um, Umschalt+Leertaste wählt bis dorthin.
|
|
9
|
+
* Enter und F2 bearbeiten einen Text bzw. setzen ein Bild in einen Rahmen.
|
|
10
|
+
* Entf, Strg+C/X/V/D/A und Alt+Pfeil laufen weiter über die Tastatur der
|
|
11
|
+
* Seite (`hooks/useCanvasKeyboardHandlers.ts`, Regel R1).
|
|
12
|
+
*/
|
|
13
|
+
import type { LayerEntry } from '@ggraphic/editor/utils/layerLabels';
|
|
14
|
+
import type { LayerSelectionChange } from '@ggraphic/editor/utils/layerSelection';
|
|
15
|
+
export interface LayersSectionProps {
|
|
16
|
+
layers: readonly LayerEntry[];
|
|
17
|
+
selectedIds: readonly string[];
|
|
18
|
+
onSelect: (change: LayerSelectionChange) => void;
|
|
19
|
+
/** Enter oder F2 auf einem Eintrag. */
|
|
20
|
+
onActivate: (id: string) => void;
|
|
21
|
+
/** Der Sprunglink will den Fokus in der Liste: auf die Auswahl, sonst den ersten Eintrag. */
|
|
22
|
+
focusRequested?: boolean;
|
|
23
|
+
onFocusHandled?: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function LayersSection({ layers, selectedIds, onSelect, onActivate, focusRequested, onFocusHandled, }: LayersSectionProps): import("react").JSX.Element;
|