@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,26 @@
|
|
|
1
|
+
import type { TextFieldConfig } from '@ggraphic/editor/configs/unifiedTabs';
|
|
2
|
+
interface FontSizeStepperProps {
|
|
3
|
+
value: number;
|
|
4
|
+
onChange: (value: number) => void;
|
|
5
|
+
min?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function FontSizeStepper({ value, onChange, min, max }: FontSizeStepperProps): import("react").JSX.Element;
|
|
9
|
+
interface AutoExpandTextareaProps {
|
|
10
|
+
value: string;
|
|
11
|
+
onChange: (value: string) => void;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
maxLength?: number;
|
|
14
|
+
minRows?: number;
|
|
15
|
+
id: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function AutoExpandTextarea({ value, onChange, placeholder, maxLength, minRows, id, }: AutoExpandTextareaProps): import("react").JSX.Element;
|
|
18
|
+
interface TextFieldProps {
|
|
19
|
+
config: TextFieldConfig;
|
|
20
|
+
value: string;
|
|
21
|
+
onChange: (value: string) => void;
|
|
22
|
+
fontSize?: number;
|
|
23
|
+
onFontSizeChange?: (size: number) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function TextField({ config, value, onChange, fontSize, onFontSizeChange }: TextFieldProps): import("react").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
4
|
+
import { useCallback, useRef, useEffect } from 'react';
|
|
5
|
+
import { PiMinus, PiPlus } from 'react-icons/pi';
|
|
6
|
+
import { MOBILE_INPUT_TEXT } from '../sidebarStyles.js';
|
|
7
|
+
export function FontSizeStepper({ value, onChange, min = 12, max = 200 }) {
|
|
8
|
+
const t = useMessages();
|
|
9
|
+
const handleDecrement = () => {
|
|
10
|
+
if (value > min)
|
|
11
|
+
onChange(value - 1);
|
|
12
|
+
};
|
|
13
|
+
const handleIncrement = () => {
|
|
14
|
+
if (value < max)
|
|
15
|
+
onChange(value + 1);
|
|
16
|
+
};
|
|
17
|
+
const handleInputChange = (e) => {
|
|
18
|
+
const newValue = parseInt(e.target.value, 10);
|
|
19
|
+
if (!isNaN(newValue) && newValue >= min && newValue <= max) {
|
|
20
|
+
onChange(newValue);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return (_jsxs("div", { className: "flex items-center gap-0.5 bg-editor-tile rounded-full p-0.5 max-canvas-mobile:[&_button]:w-6 max-canvas-mobile:[&_button]:h-6", children: [_jsx("button", { type: "button", className: "touch-target w-6 h-6 rounded-full border-none bg-transparent cursor-pointer flex items-center justify-center text-foreground transition-[background-color,color] duration-200 hover:not-disabled:bg-hover-alt hover:not-disabled:text-primary-600 active:not-disabled:bg-editor-canvas-hover disabled:opacity-30 disabled:cursor-not-allowed disabled:text-grey-400", onClick: handleDecrement, disabled: value <= min, "aria-label": t.sidebar.fontSizeDecrease, children: _jsx(PiMinus, { size: 10 }) }), _jsx("input", { type: "number", className: `pointer-coarse:relative pointer-coarse:z-[1] w-9 h-6 border-none bg-transparent text-center text-[0.8125rem] font-semibold text-foreground tabular-nums p-0 [appearance:textfield] [-moz-appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none outline-none kbd:focus-visible:outline-2 kbd:focus-visible:outline-solid kbd:focus-visible:outline-offset-2 kbd:focus-visible:outline-[var(--editor-accent)] max-canvas-mobile:w-8 max-canvas-mobile:h-6 ${MOBILE_INPUT_TEXT}`, value: Math.round(value), onChange: handleInputChange, min: min, max: max, "aria-label": t.sidebar.fontSize }), _jsx("button", { type: "button", className: "touch-target w-6 h-6 rounded-full border-none bg-transparent cursor-pointer flex items-center justify-center text-foreground transition-[background-color,color] duration-200 hover:not-disabled:bg-hover-alt hover:not-disabled:text-primary-600 active:not-disabled:bg-editor-canvas-hover disabled:opacity-30 disabled:cursor-not-allowed disabled:text-grey-400", onClick: handleIncrement, disabled: value >= max, "aria-label": t.sidebar.fontSizeIncrease, children: _jsx(PiPlus, { size: 10 }) })] }));
|
|
24
|
+
}
|
|
25
|
+
export function AutoExpandTextarea({ value, onChange, placeholder, maxLength, minRows = 3, id, }) {
|
|
26
|
+
const textareaRef = useRef(null);
|
|
27
|
+
const adjustHeight = useCallback(() => {
|
|
28
|
+
const textarea = textareaRef.current;
|
|
29
|
+
if (textarea) {
|
|
30
|
+
textarea.style.height = 'auto';
|
|
31
|
+
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
32
|
+
}
|
|
33
|
+
}, []);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
adjustHeight();
|
|
36
|
+
}, [value, adjustHeight]);
|
|
37
|
+
const handleChange = (e) => {
|
|
38
|
+
const newValue = e.target.value;
|
|
39
|
+
if (maxLength && newValue.length > maxLength)
|
|
40
|
+
return;
|
|
41
|
+
onChange(newValue);
|
|
42
|
+
};
|
|
43
|
+
return (_jsxs("div", { className: "relative", children: [_jsx("textarea", { ref: textareaRef, id: id, className: `w-full py-[var(--spacing-small)] px-[var(--spacing-medium)] ${MOBILE_INPUT_TEXT} text-[0.9375rem] font-[inherit] text-foreground bg-background border border-editor-border-strong rounded-lg outline-none resize-none overflow-hidden leading-relaxed transition-[border-color,box-shadow] duration-200 focus:border-primary-600 focus:shadow-[0_0_0_3px_var(--primary-100)] placeholder:text-foreground-muted`, value: value, onChange: handleChange, placeholder: placeholder, rows: minRows, maxLength: maxLength }), maxLength && (_jsxs("div", { className: "absolute bottom-[var(--spacing-small)] right-[var(--spacing-small)] text-xs text-foreground-muted bg-background px-[var(--spacing-xxsmall)] rounded-[var(--border-radius-small)]", children: [value.length, " / ", maxLength] }))] }));
|
|
44
|
+
}
|
|
45
|
+
export function TextField({ config, value, onChange, fontSize, onFontSizeChange }) {
|
|
46
|
+
const t = useMessages();
|
|
47
|
+
const { key, label, placeholder, multiline = true, maxLength, minRows } = config;
|
|
48
|
+
const fieldId = `unified-text-field-${key}`;
|
|
49
|
+
const showFontSizeControl = fontSize !== undefined && onFontSizeChange !== undefined;
|
|
50
|
+
return (_jsxs("div", { className: "flex flex-col gap-[var(--spacing-small)]", children: [_jsxs("div", { className: "flex justify-between items-center min-h-7 max-canvas-mobile:flex-wrap max-canvas-mobile:gap-[var(--spacing-small)]", children: [_jsx("label", { htmlFor: fieldId, className: "text-sm font-semibold text-foreground", children: label }), showFontSizeControl && _jsx(FontSizeStepper, { value: fontSize, onChange: onFontSizeChange })] }), multiline ? (_jsx(AutoExpandTextarea, { id: fieldId, value: value, onChange: onChange, placeholder: placeholder || t.common.enterField(label), maxLength: maxLength, minRows: minRows })) : (_jsx("input", { id: fieldId, type: "text", className: `w-full py-[var(--spacing-small)] px-[var(--spacing-medium)] ${MOBILE_INPUT_TEXT} text-[0.9375rem] font-[inherit] text-foreground bg-background border border-editor-border-strong rounded-lg outline-none transition-[border-color,box-shadow] duration-200 focus:border-primary-600 focus:shadow-[0_0_0_3px_var(--primary-100)] placeholder:text-foreground-muted`, value: value, onChange: (e) => {
|
|
51
|
+
const newValue = e.target.value;
|
|
52
|
+
if (maxLength && newValue.length > maxLength)
|
|
53
|
+
return;
|
|
54
|
+
onChange(newValue);
|
|
55
|
+
}, placeholder: placeholder || t.common.enterField(label), maxLength: maxLength }))] }));
|
|
56
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ChartInstance } from '@ggraphic/editor/utils/chartUtils';
|
|
2
|
+
export interface ChartSettingsSectionProps {
|
|
3
|
+
selectedChart: ChartInstance | null;
|
|
4
|
+
onUpdateChart: (id: string, partial: Partial<ChartInstance>) => void;
|
|
5
|
+
onRemoveChart: (id: string) => void;
|
|
6
|
+
/** The swatches: the page's country palette. */
|
|
7
|
+
palette?: readonly string[];
|
|
8
|
+
}
|
|
9
|
+
export declare function ChartSettingsSection({ selectedChart, onUpdateChart, onRemoveChart, palette, }: ChartSettingsSectionProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { CustomColorSwatch } from '@ggraphic/editor/components/CustomColorSwatch';
|
|
4
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
5
|
+
import { Switch } from '@ggraphic/editor/ui/switch';
|
|
6
|
+
import { addChartRow, addChartSeries, chartColors, chartLegendPosition, chartSeries, isRoundChartType, removeChartRow, removeChartSeries, renameChartSeries, setChartValue, } from '@ggraphic/editor/utils/chartUtils';
|
|
7
|
+
import { PiChartBar, PiChartBarHorizontal, PiChartDonut, PiChartLine, PiChartLineUp, PiChartPie, PiTrash, PiPlus, } from 'react-icons/pi';
|
|
8
|
+
import { MOBILE_INPUT_TEXT } from '@ggraphic/editor/sidebar/sidebarStyles';
|
|
9
|
+
const typeOptions = (t) => [
|
|
10
|
+
{ id: 'bar', label: t.charts['bar'], icon: PiChartBar },
|
|
11
|
+
{ id: 'bar-horizontal', label: t.charts['bar-horizontal'], icon: PiChartBarHorizontal },
|
|
12
|
+
{ id: 'line', label: t.charts['line'], icon: PiChartLine },
|
|
13
|
+
{ id: 'area', label: t.charts['area'], icon: PiChartLineUp },
|
|
14
|
+
{ id: 'pie', label: t.charts['pie'], icon: PiChartPie },
|
|
15
|
+
{ id: 'donut', label: t.charts['donut'], icon: PiChartDonut },
|
|
16
|
+
];
|
|
17
|
+
const legendOptions = (t) => [
|
|
18
|
+
{ id: 'right', label: t.sidebar.chart.legendRight },
|
|
19
|
+
{ id: 'bottom', label: t.sidebar.chart.legendBottom },
|
|
20
|
+
];
|
|
21
|
+
/** More series than colours in a palette would repeat a colour. */
|
|
22
|
+
const MAX_SERIES = 5;
|
|
23
|
+
const CELL = `rounded-md border border-editor-border-strong bg-background px-2 py-1 text-sm ${MOBILE_INPUT_TEXT} text-foreground outline-none focus:border-primary-500`;
|
|
24
|
+
export function ChartSettingsSection({ selectedChart, onUpdateChart, onRemoveChart, palette = chartColors(), }) {
|
|
25
|
+
const t = useMessages();
|
|
26
|
+
const chart = selectedChart;
|
|
27
|
+
if (!chart)
|
|
28
|
+
return null;
|
|
29
|
+
const update = (partial) => onUpdateChart(chart.id, partial);
|
|
30
|
+
const round = isRoundChartType(chart.chartType);
|
|
31
|
+
// Pies show the first series only; the table shows what the chart draws.
|
|
32
|
+
const series = chartSeries(chart);
|
|
33
|
+
const columns = series ?? [{ name: '', values: chart.data.map((d) => d.value) }];
|
|
34
|
+
const setName = (index, name) => update({ data: chart.data.map((d, i) => (i === index ? { ...d, name } : d)) });
|
|
35
|
+
const addRow = () => {
|
|
36
|
+
const nextLabel = String.fromCharCode(65 + chart.data.length); // A, B, C…
|
|
37
|
+
update(addChartRow(chart, nextLabel));
|
|
38
|
+
};
|
|
39
|
+
const removeRow = (index) => {
|
|
40
|
+
if (chart.data.length <= 1)
|
|
41
|
+
return;
|
|
42
|
+
update(removeChartRow(chart, index));
|
|
43
|
+
};
|
|
44
|
+
const addSeries = () => update({ ...addChartSeries(chart), ...(series ? {} : { showLegend: true }) });
|
|
45
|
+
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.chart.heading }), _jsxs("button", { type: "button", onClick: () => onRemoveChart(chart.id), className: "inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs text-red-600 hover:bg-red-500/10", title: t.sidebar.chart.deleteChart, children: [_jsx(PiTrash, { size: 12 }), " ", t.commands.delete] })] }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("span", { className: "text-[11px] font-semibold uppercase tracking-wide text-foreground-muted", children: t.sidebar.chart.type }), _jsx("div", { className: "grid grid-cols-3 gap-1.5", children: typeOptions(t).map((opt) => {
|
|
46
|
+
const Icon = opt.icon;
|
|
47
|
+
const active = chart.chartType === opt.id;
|
|
48
|
+
return (_jsxs("button", { type: "button", onClick: () => {
|
|
49
|
+
const partial = { chartType: opt.id };
|
|
50
|
+
if (isRoundChartType(opt.id) !== isRoundChartType(chart.chartType)) {
|
|
51
|
+
partial.showLegend = isRoundChartType(opt.id);
|
|
52
|
+
partial.showGrid = !isRoundChartType(opt.id);
|
|
53
|
+
}
|
|
54
|
+
update(partial);
|
|
55
|
+
}, className: `flex flex-col items-center gap-1 rounded-md border px-2 py-2 text-xs transition-colors ${active
|
|
56
|
+
? 'border-[var(--editor-accent)] bg-[var(--editor-active-bg)] text-[var(--editor-active-fg)]'
|
|
57
|
+
: 'border-[var(--editor-border-strong)] text-[var(--editor-text-muted)] hover:border-[var(--editor-accent)]'}`, children: [_jsx(Icon, { size: 18 }), opt.label] }, opt.id));
|
|
58
|
+
}) })] }), _jsxs("label", { className: "flex flex-col gap-1.5 text-xs", children: [_jsx("span", { className: "text-[11px] font-semibold uppercase tracking-wide text-foreground-muted", children: t.sidebar.chart.title }), _jsx("input", { type: "text", value: chart.title ?? '', onChange: (e) => update({ title: e.target.value }), placeholder: t.sidebar.chart.optional, className: `rounded-md border border-editor-border-strong bg-background px-sm py-xs text-sm ${MOBILE_INPUT_TEXT} text-foreground outline-none focus:border-primary-500` })] }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("span", { className: "text-[11px] font-semibold uppercase tracking-wide text-foreground-muted", children: t.sidebar.chart.data }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [series ? (_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "min-w-0 flex-1" }), series.map((s, si) => (_jsx("div", { className: "flex w-16 shrink-0 items-center", children: _jsx("input", { type: "text", value: s.name, "aria-label": t.sidebar.chart.seriesName(si + 1), onChange: (e) => update(renameChartSeries(chart, si, e.target.value)), className: `min-w-0 flex-1 ${CELL} px-1 text-xs` }) }, si))), _jsx("span", { className: "w-[27px] shrink-0" })] })) : null, chart.data.map((point, i) => (_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("input", { type: "text", value: point.name, "aria-label": t.sidebar.chart.labelN(i + 1), onChange: (e) => setName(i, e.target.value), className: `min-w-0 flex-1 ${CELL}` }), columns.map((s, si) => (_jsx("input", { type: "number", value: s.values[i] ?? 0, "aria-label": series
|
|
59
|
+
? `${s.name || t.defaults.series(si + 1)}: ${point.name}`
|
|
60
|
+
: t.sidebar.chart.valueOf(point.name), onChange: (e) => update(setChartValue(chart, i, si, Number(e.target.value) || 0)), className: `w-16 shrink-0 ${CELL}` }, si))), _jsx("button", { type: "button", onClick: () => removeRow(i), disabled: chart.data.length <= 1, className: "shrink-0 rounded-md p-1.5 text-foreground-muted hover:text-red-600 disabled:opacity-30", title: t.sidebar.chart.removeRow, children: _jsx(PiTrash, { size: 11 }) })] }, i))), series ? (_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "min-w-0 flex-1" }), series.map((s, si) => (_jsx("button", { type: "button", onClick: () => update(removeChartSeries(chart, si)), className: "flex w-16 shrink-0 justify-center rounded-md p-1 text-foreground-muted hover:text-red-600", title: t.sidebar.chart.removeSeries(s.name || t.defaults.series(si + 1)), children: _jsx(PiTrash, { size: 11 }) }, si))), _jsx("span", { className: "w-[27px] shrink-0" })] })) : null] }), _jsxs("div", { className: "mt-1 flex gap-1.5", children: [_jsxs("button", { type: "button", onClick: addRow, className: "inline-flex flex-1 items-center justify-center gap-1.5 rounded-md border border-dashed border-editor-border-strong px-2 py-1.5 text-xs text-foreground-muted hover:border-primary-500 hover:text-foreground", children: [_jsx(PiPlus, { size: 10 }), " ", t.sidebar.chart.addRow] }), round ? null : (_jsxs("button", { type: "button", onClick: addSeries, disabled: columns.length >= MAX_SERIES, className: "inline-flex flex-1 items-center justify-center gap-1.5 rounded-md border border-dashed border-editor-border-strong px-2 py-1.5 text-xs text-foreground-muted hover:border-primary-500 hover:text-foreground disabled:opacity-40", children: [_jsx(PiPlus, { size: 10 }), " ", t.sidebar.chart.addSeries] }))] })] }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("span", { className: "text-[11px] font-semibold uppercase tracking-wide text-foreground-muted", children: t.sidebar.chart.color }), _jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [palette.map((c) => (_jsx("button", { type: "button", onClick: () => update({ colors: [c, ...palette.filter((x) => x !== c)] }), title: c, className: "size-6 rounded-full border border-black/10 transition-transform hover:scale-110", style: {
|
|
61
|
+
backgroundColor: c,
|
|
62
|
+
outline: chart.colors[0] === c ? '2px solid var(--editor-accent)' : 'none',
|
|
63
|
+
outlineOffset: '2px',
|
|
64
|
+
} }, c))), _jsx(CustomColorSwatch, { value: chart.colors[0], presets: palette, onPick: (color) => update({ colors: [color, ...palette] }), className: "size-6" })] })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [[
|
|
65
|
+
// A single series needs no legend; pies draw no grid.
|
|
66
|
+
...(round || series ? [['showLegend', t.sidebar.chart.legend]] : []),
|
|
67
|
+
...(round ? [] : [['showGrid', t.sidebar.chart.grid]]),
|
|
68
|
+
['showValues', t.sidebar.chart.showValues],
|
|
69
|
+
].map(([key, label]) => (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-xs text-foreground", children: label }), _jsx(Switch, { "aria-label": label, checked: !!chart[key], onCheckedChange: (v) => update({ [key]: v }) })] }, key))), (round || series) && chart.showLegend ? (_jsxs("div", { className: "flex items-center justify-between", role: "group", "aria-label": t.sidebar.chart.legendPosition, children: [_jsx("span", { className: "text-xs text-foreground", children: t.sidebar.chart.legendPosition }), _jsx("div", { className: "flex gap-1", children: legendOptions(t).map((opt) => {
|
|
70
|
+
const active = chartLegendPosition(chart) === opt.id;
|
|
71
|
+
return (_jsx("button", { type: "button", "aria-pressed": active, onClick: () => update({ legendPosition: opt.id }), className: `rounded-md border px-2 py-0.5 text-xs transition-colors ${active
|
|
72
|
+
? 'border-[var(--editor-accent)] bg-[var(--editor-active-bg)] text-[var(--editor-active-fg)]'
|
|
73
|
+
: 'border-[var(--editor-border-strong)] text-[var(--editor-text-muted)] hover:border-[var(--editor-accent)]'}`, children: opt.label }, opt.id));
|
|
74
|
+
}) })] })) : null] })] }));
|
|
75
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AdditionalText } from '@ggraphic/editor/configs/types';
|
|
2
|
+
import type { TextFieldConfig } from '@ggraphic/editor/configs/unifiedTabs';
|
|
3
|
+
export interface CombinedTextSectionProps {
|
|
4
|
+
onAddHeader?: () => void;
|
|
5
|
+
onAddSubheader?: () => void;
|
|
6
|
+
onAddText?: () => void;
|
|
7
|
+
additionalTexts?: AdditionalText[];
|
|
8
|
+
onUpdateText?: (id: string, partial: Partial<AdditionalText>) => void;
|
|
9
|
+
onRemoveText?: (id: string) => void;
|
|
10
|
+
textFields?: TextFieldConfig[];
|
|
11
|
+
values?: Record<string, string>;
|
|
12
|
+
onFieldChange?: (key: string, value: string) => void;
|
|
13
|
+
fontSizes?: Record<string, number>;
|
|
14
|
+
onFontSizeChange?: (key: string, size: number) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function CombinedTextSection({ onAddHeader, onAddSubheader, onAddText, additionalTexts, onUpdateText, onRemoveText, textFields, values, onFieldChange, fontSizes, onFontSizeChange, }: CombinedTextSectionProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { messages, useMessages } from '@ggraphic/editor/i18n/messages';
|
|
5
|
+
import { cn } from '@ggraphic/editor/utils/cn';
|
|
6
|
+
import { PiPlusBold, PiTextAa, PiTextHBold, PiTrash } from 'react-icons/pi';
|
|
7
|
+
import { useIsCanvasMobile } from '@ggraphic/editor/hooks/useIsCanvasMobile';
|
|
8
|
+
import { SidebarHint } from '@ggraphic/editor/sidebar/components/SidebarHint';
|
|
9
|
+
import { TextField } from '@ggraphic/editor/sidebar/components/TextFieldPrimitives';
|
|
10
|
+
import { MOBILE_INPUT_TEXT, SIDEBAR_SECTION } from '@ggraphic/editor/sidebar/sidebarStyles';
|
|
11
|
+
const MOBILE_ADD_TILE = 'flex items-center w-full px-3.5 bg-[var(--editor-tile)] text-[var(--editor-text)] border-none rounded-xl cursor-pointer text-left transition-colors duration-150 hover:bg-[var(--editor-surface-hover)]';
|
|
12
|
+
// Mobile: Eingabefelder der Vorlage als Kacheln statt mit Rahmen
|
|
13
|
+
const MOBILE_FIELD_TILES = 'max-canvas-mobile:gap-4 max-canvas-mobile:[&_label]:text-[13px] max-canvas-mobile:[&_label]:font-bold max-canvas-mobile:[&_label]:text-[var(--editor-text-muted)] max-canvas-mobile:[&_:is(input[type=text],textarea)]:rounded-xl max-canvas-mobile:[&_:is(input[type=text],textarea)]:border-transparent max-canvas-mobile:[&_:is(input[type=text],textarea)]:bg-[var(--editor-tile)] max-canvas-mobile:[&_:is(input[type=text],textarea)]:text-[var(--editor-text)] max-canvas-mobile:[&_:is(input[type=text],textarea)]:px-3.5 max-canvas-mobile:[&_:is(input[type=text],textarea)]:py-3 max-canvas-mobile:[&_:is(input[type=text],textarea)]:focus:border-[var(--editor-accent)] max-canvas-mobile:[&_textarea+div]:bg-[var(--editor-tile)]';
|
|
14
|
+
function getTextTypeIcon(type) {
|
|
15
|
+
if (type === 'header' || type === 'subheader')
|
|
16
|
+
return _jsx(PiTextHBold, { size: 14 });
|
|
17
|
+
return _jsx(PiTextAa, { size: 14 });
|
|
18
|
+
}
|
|
19
|
+
function getTextTypePlaceholder(type) {
|
|
20
|
+
const t = messages();
|
|
21
|
+
if (type === 'header')
|
|
22
|
+
return t.sidebar.text.placeholderHeader;
|
|
23
|
+
if (type === 'subheader')
|
|
24
|
+
return t.sidebar.text.placeholderSubheader;
|
|
25
|
+
return t.sidebar.text.placeholderText;
|
|
26
|
+
}
|
|
27
|
+
export function CombinedTextSection({ onAddHeader, onAddSubheader, onAddText, additionalTexts, onUpdateText, onRemoveText, textFields, values, onFieldChange, fontSizes, onFontSizeChange, }) {
|
|
28
|
+
const t = useMessages();
|
|
29
|
+
const isMobile = useIsCanvasMobile();
|
|
30
|
+
const hasFreeformText = onAddHeader !== undefined || onAddText !== undefined;
|
|
31
|
+
const hasTemplateFields = textFields !== undefined && textFields.length > 0;
|
|
32
|
+
const hasCanvasTexts = additionalTexts !== undefined && additionalTexts.length > 0;
|
|
33
|
+
return (_jsxs("div", { className: cn(SIDEBAR_SECTION, 'gap-md p-md max-canvas-mobile:gap-4 max-canvas-mobile:p-0'), children: [hasFreeformText && isMobile && (_jsxs("div", { className: "flex flex-col gap-2.5", children: [onAddHeader && (_jsx("button", { type: "button", onClick: onAddHeader, className: cn(MOBILE_ADD_TILE, 'h-12 text-[20px] font-black'), children: t.sidebar.text.addHeader })), onAddSubheader && (_jsx("button", { type: "button", onClick: onAddSubheader, className: cn(MOBILE_ADD_TILE, 'h-11 text-[17px] font-bold'), children: t.sidebar.text.addSubheader })), onAddText && (_jsx("button", { type: "button", onClick: onAddText, className: cn(MOBILE_ADD_TILE, 'h-11 text-[15px] font-normal'), children: t.sidebar.text.addBody }))] })), hasFreeformText && !isMobile && (_jsxs(_Fragment, { children: [onAddText && (_jsxs("button", { type: "button", onClick: onAddText, className: "flex items-center justify-center gap-xs w-full py-2.5 bg-primary-600 text-white border-none rounded-lg cursor-pointer text-sm font-semibold transition-colors duration-150 hover:bg-primary-700", children: [_jsx(PiPlusBold, { size: 14 }), t.sidebar.text.addTextField] })), _jsxs("div", { className: "flex flex-col gap-1.5", children: [onAddHeader && (_jsx("button", { type: "button", onClick: onAddHeader, className: "w-full text-left py-3 px-4 bg-[var(--card-background)] border border-[var(--card-border)] rounded-lg cursor-pointer transition-all duration-150 hover:bg-hover-alt hover:border-editor-border-strong", children: _jsx("span", { className: "text-xl font-bold text-foreground", style: { fontFamily: `${activeBrand().fonts.headline}, Arial, sans-serif` }, children: t.sidebar.text.labelTitle }) })), onAddSubheader && (_jsx("button", { type: "button", onClick: onAddSubheader, className: "w-full text-left py-2.5 px-4 bg-[var(--card-background)] border border-[var(--card-border)] rounded-lg cursor-pointer transition-all duration-150 hover:bg-hover-alt hover:border-editor-border-strong", children: _jsx("span", { className: "text-base font-bold text-foreground", style: { fontFamily: `${activeBrand().fonts.headline}, Arial, sans-serif` }, children: t.sidebar.text.labelSubtitle }) })), onAddText && (_jsx("button", { type: "button", onClick: onAddText, className: "w-full text-left py-2 px-4 bg-[var(--card-background)] border border-[var(--card-border)] rounded-lg cursor-pointer transition-all duration-150 hover:bg-hover-alt hover:border-editor-border-strong", children: _jsx("span", { className: "font-[PT_Sans,Arial,sans-serif] text-sm text-foreground", children: t.sidebar.text.labelText }) }))] })] })), hasTemplateFields && values && onFieldChange && (_jsx("div", { className: cn('flex flex-col gap-[var(--spacing-large)]', MOBILE_FIELD_TILES), children: textFields.map((fieldConfig) => {
|
|
34
|
+
const fontSize = fieldConfig.fontSizeStateKey
|
|
35
|
+
? fontSizes?.[fieldConfig.fontSizeStateKey]
|
|
36
|
+
: undefined;
|
|
37
|
+
const handleFontSizeChange = fieldConfig.fontSizeStateKey && onFontSizeChange
|
|
38
|
+
? (size) => onFontSizeChange(fieldConfig.fontSizeStateKey, size)
|
|
39
|
+
: undefined;
|
|
40
|
+
return (_jsx(TextField, { config: fieldConfig, value: values[fieldConfig.key] || '', onChange: (val) => onFieldChange(fieldConfig.key, val), fontSize: fontSize, onFontSizeChange: handleFontSizeChange }, fieldConfig.key));
|
|
41
|
+
}) })), hasCanvasTexts && onUpdateText && onRemoveText && (_jsxs("div", { className: "flex flex-col gap-xs max-canvas-mobile:gap-2.5", children: [_jsx("span", { className: "text-xs font-semibold text-foreground uppercase tracking-wide max-canvas-mobile:text-[13px] max-canvas-mobile:font-bold max-canvas-mobile:normal-case max-canvas-mobile:tracking-normal max-canvas-mobile:text-[var(--editor-text-muted)]", children: t.sidebar.text.onCanvas }), additionalTexts.map((text) => (_jsxs("div", { className: "flex items-center gap-sm p-sm bg-[var(--card-background)] border border-[var(--card-border)] rounded-lg max-canvas-mobile:min-h-11 max-canvas-mobile:py-1 max-canvas-mobile:pl-3.5 max-canvas-mobile:pr-1.5 max-canvas-mobile:bg-[var(--editor-tile)] max-canvas-mobile:border-transparent max-canvas-mobile:rounded-xl", children: [_jsx("span", { className: "text-xs text-foreground-muted shrink-0 w-5", children: getTextTypeIcon(text.type) }), _jsx("input", { type: "text", value: text.text, onChange: (e) => onUpdateText(text.id, { text: e.target.value }), className: `flex-1 min-w-0 bg-transparent border-none outline-none text-sm text-foreground placeholder:text-foreground-muted max-canvas-mobile:text-[var(--editor-text)] ${MOBILE_INPUT_TEXT}`, placeholder: getTextTypePlaceholder(text.type) }), _jsx("button", { type: "button", onClick: () => onRemoveText(text.id), className: "touch-target shrink-0 size-7 flex items-center justify-center bg-transparent border-none rounded-md cursor-pointer text-foreground-muted transition-colors duration-150 hover:bg-red-50 hover:text-red-600", "aria-label": t.sidebar.text.removeText, children: _jsx(PiTrash, { size: 11 }) })] }, text.id)))] })), !hasFreeformText && !hasTemplateFields && !hasCanvasTexts && (_jsx(SidebarHint, { children: t.sidebar.text.hintEdit })), hasFreeformText && !hasCanvasTexts && _jsx(SidebarHint, { children: t.sidebar.text.hintAdd })] }));
|
|
42
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ChartType } from '@ggraphic/editor/utils/chartUtils';
|
|
2
|
+
export interface DiagrammeSectionProps {
|
|
3
|
+
onAddChart: (chartType: ChartType) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function ChartTypePreview({ type, size }: {
|
|
6
|
+
type: ChartType;
|
|
7
|
+
size?: number;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
export declare function DiagrammeSection({ onAddChart }: DiagrammeSectionProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
4
|
+
import { chartColors, CHART_GROUP_LABELS, CHART_GROUP_ORDER, CHART_TYPE_DEFS, } from '@ggraphic/editor/utils/chartUtils';
|
|
5
|
+
import { cn } from '@ggraphic/editor/utils/cn';
|
|
6
|
+
// Read at render time, not module init: the chart series live in another chunk and
|
|
7
|
+
// indexing it here risks the documented prod chunk-order crash (see FormenSection).
|
|
8
|
+
const c = (index) => chartColors()[index];
|
|
9
|
+
/**
|
|
10
|
+
* Static mini-chart glyphs (literal brand colors, no live Recharts) — one per
|
|
11
|
+
* ChartType, exhaustively keyed so adding a type without a preview is a
|
|
12
|
+
* compile error.
|
|
13
|
+
*/
|
|
14
|
+
const CHART_PREVIEWS = {
|
|
15
|
+
bar: () => (_jsxs(_Fragment, { children: [_jsx("rect", { x: "8", y: "20", width: "9", height: "22", rx: "1.5", fill: c(0) }), _jsx("rect", { x: "21", y: "10", width: "9", height: "32", rx: "1.5", fill: c(1) }), _jsx("rect", { x: "34", y: "26", width: "9", height: "16", rx: "1.5", fill: c(2) }), _jsx("rect", { x: "47", y: "16", width: "9", height: "26", rx: "1.5", fill: c(0) })] })),
|
|
16
|
+
'bar-horizontal': () => (_jsxs(_Fragment, { children: [_jsx("rect", { x: "8", y: "8", width: "40", height: "7", rx: "1.5", fill: c(0) }), _jsx("rect", { x: "8", y: "18", width: "48", height: "7", rx: "1.5", fill: c(1) }), _jsx("rect", { x: "8", y: "28", width: "26", height: "7", rx: "1.5", fill: c(2) }), _jsx("rect", { x: "8", y: "38", width: "34", height: "7", rx: "1.5", fill: c(0) })] })),
|
|
17
|
+
line: () => (_jsxs(_Fragment, { children: [_jsx("polyline", { points: "8,38 22,26 36,30 56,10", fill: "none", stroke: c(0), strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round" }), [
|
|
18
|
+
[8, 38],
|
|
19
|
+
[22, 26],
|
|
20
|
+
[36, 30],
|
|
21
|
+
[56, 10],
|
|
22
|
+
].map(([cx, cy]) => (_jsx("circle", { cx: cx, cy: cy, r: "3", fill: c(0) }, `${cx}-${cy}`)))] })),
|
|
23
|
+
area: () => (_jsxs(_Fragment, { children: [_jsx("path", { d: "M8 38 L22 26 L36 30 L56 10 L56 44 L8 44 Z", fill: c(0), fillOpacity: "0.3" }), _jsx("polyline", { points: "8,38 22,26 36,30 56,10", fill: "none", stroke: c(0), strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round" })] })),
|
|
24
|
+
pie: () => (_jsxs(_Fragment, { children: [_jsx("circle", { cx: "32", cy: "24", r: "18", fill: c(0) }), _jsx("path", { d: "M32 24 L32 6 A18 18 0 0 1 47.6 33 Z", fill: c(1) }), _jsx("path", { d: "M32 24 L47.6 33 A18 18 0 0 1 25.8 40.9 Z", fill: c(2) })] })),
|
|
25
|
+
donut: () => (_jsxs("g", { transform: "rotate(-90 32 24)", children: [_jsx("circle", { cx: "32", cy: "24", r: "14", fill: "none", stroke: c(0), strokeWidth: "8" }), _jsx("circle", { cx: "32", cy: "24", r: "14", fill: "none", stroke: c(1), strokeWidth: "8", strokeDasharray: "35 53" }), _jsx("circle", { cx: "32", cy: "24", r: "14", fill: "none", stroke: c(2), strokeWidth: "8", strokeDasharray: "20 68", strokeDashoffset: "-35" })] })),
|
|
26
|
+
};
|
|
27
|
+
export function ChartTypePreview({ type, size = 48 }) {
|
|
28
|
+
return (_jsx("svg", { width: size, height: size * 0.75, viewBox: "0 0 64 48", fill: "none", "aria-hidden": true, children: CHART_PREVIEWS[type]() }));
|
|
29
|
+
}
|
|
30
|
+
function ChartCard({ type, name, onClick, }) {
|
|
31
|
+
const t = useMessages();
|
|
32
|
+
return (_jsxs("button", { type: "button", onClick: onClick, title: t.common.insertNamed(name), className: "group flex flex-col items-center gap-1.5 cursor-pointer bg-transparent border-none p-0 rounded-xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--editor-accent)]", children: [_jsx("span", { className: cn('flex items-center justify-center w-full aspect-[4/3] rounded-xl', 'bg-[var(--editor-tile)] border border-[var(--editor-border)]', 'transition-[background-color,border-color] duration-200 ease-out', 'group-hover:border-[var(--editor-accent)] group-hover:bg-[var(--editor-active-soft)]'), children: _jsx(ChartTypePreview, { type: type, size: 56 }) }), _jsx("span", { className: "text-xs text-[var(--editor-text)] text-center leading-tight truncate max-w-full", children: name })] }));
|
|
33
|
+
}
|
|
34
|
+
export function DiagrammeSection({ onAddChart }) {
|
|
35
|
+
return (_jsx("div", { className: "flex flex-col gap-4 w-full min-w-0", children: CHART_GROUP_ORDER.map((group) => {
|
|
36
|
+
const defs = CHART_TYPE_DEFS.filter((d) => d.group === group);
|
|
37
|
+
if (defs.length === 0)
|
|
38
|
+
return null;
|
|
39
|
+
return (_jsxs("div", { children: [_jsx("h5", { className: "text-sm font-bold text-[var(--editor-text)] m-0 mb-2", children: CHART_GROUP_LABELS[group] }), _jsx("div", { className: "grid grid-cols-2 gap-2 w-full", children: defs.map((def) => (_jsx(ChartCard, { type: def.id, name: def.name, onClick: () => onAddChart(def.id) }, def.id))) })] }, group));
|
|
40
|
+
}) }));
|
|
41
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ShadowPatch } from '@ggraphic/editor/hooks/useFloatingModuleHandlers';
|
|
3
|
+
import type { FloatingModuleState } from '@ggraphic/editor/hooks/useFloatingModuleState';
|
|
4
|
+
import type { GradientFill } from '@ggraphic/editor/utils/gradientFill';
|
|
5
|
+
export interface EffectsSectionProps {
|
|
6
|
+
module: FloatingModuleState | null;
|
|
7
|
+
onGradientChange?: (gradient: GradientFill | null) => void;
|
|
8
|
+
onOutlineChange?: (id: string, patch: {
|
|
9
|
+
stroke?: string;
|
|
10
|
+
strokeWidth?: number;
|
|
11
|
+
}) => void;
|
|
12
|
+
onShadowChange?: (id: string, patch: ShadowPatch, type: string) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* „Effekte“: Farbverlauf, Kontur und Schatten der Auswahl, geöffnet über den
|
|
16
|
+
* gleichnamigen Knopf der Kontextleiste. Wie die Ebenen hängt der Editor den
|
|
17
|
+
* Bereich selbst an — er liest die Auswahl aus dem Bericht der Seite, nicht
|
|
18
|
+
* aus `state`/`actions` einer Config-Section.
|
|
19
|
+
*/
|
|
20
|
+
export declare function EffectsSection({ module, onGradientChange, onOutlineChange, onShadowChange, }: EffectsSectionProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { effectsFor } from '@ggraphic/editor/sidebar/sections/effects/effectsFor';
|
|
3
|
+
import { GradientSettings } from '@ggraphic/editor/sidebar/sections/effects/GradientSettings';
|
|
4
|
+
import { OutlineSettings } from '@ggraphic/editor/sidebar/sections/effects/OutlineSettings';
|
|
5
|
+
import { ShadowSettings } from '@ggraphic/editor/sidebar/sections/effects/ShadowSettings';
|
|
6
|
+
import { SIDEBAR_SECTION } from '@ggraphic/editor/sidebar/sidebarStyles';
|
|
7
|
+
/**
|
|
8
|
+
* „Effekte“: Farbverlauf, Kontur und Schatten der Auswahl, geöffnet über den
|
|
9
|
+
* gleichnamigen Knopf der Kontextleiste. Wie die Ebenen hängt der Editor den
|
|
10
|
+
* Bereich selbst an — er liest die Auswahl aus dem Bericht der Seite, nicht
|
|
11
|
+
* aus `state`/`actions` einer Config-Section.
|
|
12
|
+
*/
|
|
13
|
+
export function EffectsSection({ module, onGradientChange, onOutlineChange, onShadowChange, }) {
|
|
14
|
+
const available = effectsFor(module);
|
|
15
|
+
const gradient = available.gradient && onGradientChange;
|
|
16
|
+
const outline = available.outline && onOutlineChange;
|
|
17
|
+
const shadow = available.shadow && onShadowChange;
|
|
18
|
+
// Ohne Effekte schließt der Editor den Bereich (`CanvasEditorShell`).
|
|
19
|
+
if (!module || (!gradient && !outline && !shadow))
|
|
20
|
+
return null;
|
|
21
|
+
const { data } = module;
|
|
22
|
+
return (_jsxs("div", { className: SIDEBAR_SECTION, children: [gradient && (_jsx(GradientSettings, { currentColor: data.fill ?? '#000000', gradient: data.fillGradient ?? null, onChange: onGradientChange })), outline && (_jsx(OutlineSettings, { stroke: data.stroke, strokeWidth: data.strokeWidth, onChange: (patch) => onOutlineChange(data.id, patch) })), shadow && (_jsx(ShadowSettings, { shadowColor: data.shadowColor, shadowBlur: data.shadowBlur, shadowOffsetX: data.shadowOffsetX, shadowOffsetY: data.shadowOffsetY, shadowOpacity: data.shadowOpacity, onChange: (patch) => onShadowChange(data.id, patch, module.type) }))] }));
|
|
23
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type HandShapeType } from '@ggraphic/editor/utils/handDrawn';
|
|
2
|
+
import { type ShapeType } from '@ggraphic/editor/utils/shapes';
|
|
3
|
+
export interface FormenSectionProps {
|
|
4
|
+
onAddShape: (type: ShapeType, color?: string) => void;
|
|
5
|
+
isExpanded?: boolean;
|
|
6
|
+
searchQuery?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ShapeDefinition<T extends ShapeType = ShapeType> {
|
|
9
|
+
id: T;
|
|
10
|
+
renderPreview: () => React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/** A hand-drawn shape at preview size, drawn by the same outline the canvas uses. */
|
|
13
|
+
export declare const HandShapePreview: ({ type, size }: {
|
|
14
|
+
type: HandShapeType;
|
|
15
|
+
size?: number;
|
|
16
|
+
}) => import("react").JSX.Element;
|
|
17
|
+
export declare const ALL_PALETTE_SHAPES: ReadonlyArray<ShapeDefinition>;
|
|
18
|
+
export interface ShapeVariant {
|
|
19
|
+
color: string;
|
|
20
|
+
/** The primary colour can be illegible on the dark editor surface; the preview uses a token
|
|
21
|
+
that flips to the standard dark tint (must out-specify the inline style color, hence the
|
|
22
|
+
important modifier) while the inserted fill stays the true brand color. */
|
|
23
|
+
darkPreviewClass: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function getShapeVariant(type: ShapeType): ShapeVariant;
|
|
26
|
+
export declare function FormenSection({ onAddShape, isExpanded, searchQuery, }: FormenSectionProps): import("react").JSX.Element;
|