@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,318 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
/**
|
|
4
|
+
* ChartPrimitive — renders a ChartInstance as a Konva.Image.
|
|
5
|
+
*
|
|
6
|
+
* Recharts renders SVG/DOM, which the Konva canvas cannot host directly. So we
|
|
7
|
+
* render the chart into an off-screen DOM node (fixed size, literal colors →
|
|
8
|
+
* self-contained SVG), serialize its <svg>, and draw it as a Konva.Image. The
|
|
9
|
+
* ChartInstance stays the editable source of truth; this image is a re-rendered
|
|
10
|
+
* projection that refreshes whenever the instance changes. Recharts is imported
|
|
11
|
+
* lazily so it only enters the bundle when a chart is actually placed.
|
|
12
|
+
*/
|
|
13
|
+
import { memo, useEffect, useRef, useState } from 'react';
|
|
14
|
+
import { createRoot } from 'react-dom/client';
|
|
15
|
+
import { Image, Group, Rect, Transformer } from 'react-konva';
|
|
16
|
+
import { activeBrand } from '@ggraphic/editor/brand/brandRegistry';
|
|
17
|
+
import { LOCKED_TRANSFORMER, useIsItemLocked } from '@ggraphic/editor/components/canvasItemLock';
|
|
18
|
+
import { useBoxSnap } from '@ggraphic/editor/hooks/useBoxSnap';
|
|
19
|
+
import { CHART_INK_DARK, chartInk, chartLegendPosition, chartSeries, chartSeriesOutlines, } from '@ggraphic/editor/utils/chartUtils';
|
|
20
|
+
import { ELEMENT_TRANSFORMER } from '@ggraphic/editor/utils/orientation';
|
|
21
|
+
import { useTrackPendingImage } from '@ggraphic/editor/utils/pendingImages';
|
|
22
|
+
import { chartBox } from '../utils/renderedBoxes.js';
|
|
23
|
+
const AXIS_TICK = { fontSize: 13, fill: CHART_INK_DARK };
|
|
24
|
+
/** Value labels stay dark, because in a light series colour they would vanish on white. */
|
|
25
|
+
const VALUE_LABEL = { fill: AXIS_TICK.fill, fontSize: 14, fontWeight: 700 };
|
|
26
|
+
/** A light series' outline, in px on the canvas whatever the chart's scale. */
|
|
27
|
+
const OUTLINE_PX = 2;
|
|
28
|
+
let measureContext;
|
|
29
|
+
/**
|
|
30
|
+
* A label's width at tick size as the rasterised SVG draws it (`font-family:
|
|
31
|
+
* sans-serif`). A per-character estimate clipped wide labels: „Wünschen mehr"
|
|
32
|
+
* needs 95 px where 13 × 7.5 − 8 left 89.5. The estimate stays only where no
|
|
33
|
+
* canvas can measure.
|
|
34
|
+
*/
|
|
35
|
+
function tickTextWidth(text) {
|
|
36
|
+
if (measureContext === undefined) {
|
|
37
|
+
try {
|
|
38
|
+
measureContext = document.createElement('canvas').getContext('2d');
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
measureContext = null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (!measureContext)
|
|
45
|
+
return text.length * 7.5;
|
|
46
|
+
measureContext.font = `${AXIS_TICK.fontSize}px sans-serif`;
|
|
47
|
+
return measureContext.measureText(text).width;
|
|
48
|
+
}
|
|
49
|
+
const LEGEND_ROW = 24;
|
|
50
|
+
/** Swatch 14 px, the text 22 px in. */
|
|
51
|
+
const LEGEND_TEXT_X = 22;
|
|
52
|
+
/** Between two entries of a legend row below the chart. */
|
|
53
|
+
const LEGEND_GAP = 18;
|
|
54
|
+
/**
|
|
55
|
+
* Where each legend entry sits. Recharts' <Legend> is HTML beside the <svg>
|
|
56
|
+
* and never reaches the image, so the legend is drawn as SVG: a column right
|
|
57
|
+
* of the chart, or centred rows below it that wrap at the chart's width.
|
|
58
|
+
*/
|
|
59
|
+
function layoutLegend(entries, position, width, height) {
|
|
60
|
+
const widths = entries.map((e) => LEGEND_TEXT_X + Math.ceil(tickTextWidth(e.name)));
|
|
61
|
+
if (position === 'right') {
|
|
62
|
+
// 8 px gap to the chart, 4 px slack at the edge.
|
|
63
|
+
const column = Math.max(...widths) + 12;
|
|
64
|
+
const top = height / 2 - (entries.length * LEGEND_ROW) / 2;
|
|
65
|
+
return {
|
|
66
|
+
width: column,
|
|
67
|
+
height: 0,
|
|
68
|
+
at: () => entries.map((_, i) => ({ x: width - column + 8, y: top + i * LEGEND_ROW })),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const rows = [[]];
|
|
72
|
+
let used = 0;
|
|
73
|
+
widths.forEach((w, i) => {
|
|
74
|
+
const row = rows[rows.length - 1];
|
|
75
|
+
if (row.length > 0 && used + LEGEND_GAP + w > width) {
|
|
76
|
+
rows.push([i]);
|
|
77
|
+
used = w;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
used += (row.length > 0 ? LEGEND_GAP : 0) + w;
|
|
81
|
+
row.push(i);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
return {
|
|
85
|
+
width: 0,
|
|
86
|
+
height: rows.length * LEGEND_ROW,
|
|
87
|
+
at: (top) => {
|
|
88
|
+
const out = [];
|
|
89
|
+
rows.forEach((row, r) => {
|
|
90
|
+
const rowWidth = row.reduce((sum, i) => sum + widths[i], 0) + LEGEND_GAP * (row.length - 1);
|
|
91
|
+
let x = (width - rowWidth) / 2;
|
|
92
|
+
for (const i of row) {
|
|
93
|
+
out[i] = { x, y: top + r * LEGEND_ROW };
|
|
94
|
+
x += widths[i] + LEGEND_GAP;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
return out;
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
102
|
+
export function buildChartElement(recharts, chart) {
|
|
103
|
+
const { BarChart, Bar, LineChart, Line, AreaChart, Area, PieChart, Pie, Cell, XAxis, YAxis, CartesianGrid, LabelList, } = recharts;
|
|
104
|
+
const { width, height, data, colors, chartType, showGrid, showLegend, showValues } = chart;
|
|
105
|
+
const color = (i) => colors[i % colors.length];
|
|
106
|
+
// Auf dunklem Grund (dunkle Folie) stehen Achsen, Legende und Werte weiß.
|
|
107
|
+
const ink = chartInk(chart);
|
|
108
|
+
const tick = { ...AXIS_TICK, fill: ink };
|
|
109
|
+
const valueLabel = { ...VALUE_LABEL, fill: ink };
|
|
110
|
+
const outlines = chartSeriesOutlines(chart);
|
|
111
|
+
const outline = (i) => {
|
|
112
|
+
const stroke = outlines[i % colors.length];
|
|
113
|
+
return stroke ? { stroke, strokeWidth: OUTLINE_PX / chart.scale } : {};
|
|
114
|
+
};
|
|
115
|
+
const unit = chart.unit ? ` ${chart.unit}` : '';
|
|
116
|
+
const formatValue = (value) => `${String(value)}${unit}`;
|
|
117
|
+
const round = chartType === 'pie' || chartType === 'donut';
|
|
118
|
+
const series = chartSeries(chart);
|
|
119
|
+
// A single cartesian series needs no legend: its name is the chart's title.
|
|
120
|
+
const entries = !showLegend
|
|
121
|
+
? []
|
|
122
|
+
: round
|
|
123
|
+
? data.map((d, index) => ({ name: d.name, index }))
|
|
124
|
+
: (series ?? []).map((s, index) => ({ name: s.name, index }));
|
|
125
|
+
const legendPosition = chartLegendPosition(chart);
|
|
126
|
+
const legend = entries.length > 0 ? layoutLegend(entries, legendPosition, width, height) : null;
|
|
127
|
+
const legendTop = height - (legend?.height ?? 0);
|
|
128
|
+
const legendSvg = legend ? (_jsx("g", { children: legend.at(legendTop).map((pos, i) => (_jsxs("g", { transform: `translate(${pos.x}, ${pos.y})`, children: [_jsx("rect", { width: 14, height: 14, y: 3, rx: 3, fill: color(entries[i].index), ...outline(entries[i].index) }), _jsx("text", { x: LEGEND_TEXT_X, y: 10, dominantBaseline: "central", ...tick, children: entries[i].name })] }, i))) })) : null;
|
|
129
|
+
// Several series: one row per category, one key per series.
|
|
130
|
+
const rows = series
|
|
131
|
+
? data.map((d, i) => ({
|
|
132
|
+
name: d.name,
|
|
133
|
+
...Object.fromEntries(series.map((s, si) => [`s${si}`, s.values[i] ?? 0])),
|
|
134
|
+
}))
|
|
135
|
+
: data;
|
|
136
|
+
const keys = series ? series.map((_, si) => `s${si}`) : ['value'];
|
|
137
|
+
const allValues = series ? series.flatMap((s) => s.values) : data.map((d) => d.value);
|
|
138
|
+
const common = {
|
|
139
|
+
width,
|
|
140
|
+
height,
|
|
141
|
+
data: rows,
|
|
142
|
+
margin: {
|
|
143
|
+
top: 16,
|
|
144
|
+
right: 20 + (legend?.width ?? 0),
|
|
145
|
+
bottom: 8 + (legend?.height ? legend.height + 8 : 0),
|
|
146
|
+
left: 0,
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
if (round) {
|
|
150
|
+
const pieWidth = width - (legend?.width ?? 0);
|
|
151
|
+
const pieHeight = height - (legend?.height ? legend.height + 8 : 0);
|
|
152
|
+
// Outside labels sit 20 px past the slice: room for them above, below and,
|
|
153
|
+
// as wide as the longest one (~8 px a bold character), to the sides.
|
|
154
|
+
const labelWidth = showValues
|
|
155
|
+
? Math.max(...data.map((d) => (showLegend ? formatValue(d.value) : `${d.name} ${formatValue(d.value)}`).length)) * 8
|
|
156
|
+
: 0;
|
|
157
|
+
const radius = Math.max(20, Math.min(pieWidth / 2 - 24 - labelWidth, pieHeight / 2 - 30));
|
|
158
|
+
return (_jsxs(PieChart, { width: width, height: height, children: [_jsx(Pie, { data: data, dataKey: "value", nameKey: "name", cx: pieWidth / 2, cy: pieHeight / 2, outerRadius: radius, innerRadius: chartType === 'donut' ? radius * 0.55 : 0, isAnimationActive: false, label: showValues
|
|
159
|
+
? (p) => (_jsx("text", { x: p.x, y: p.y, textAnchor: p.textAnchor, dominantBaseline: "central", ...valueLabel, children: showLegend ? formatValue(p.value) : `${p.name} ${formatValue(p.value)}` }))
|
|
160
|
+
: false, children: data.map((_, i) => (_jsx(Cell, { fill: color(i), ...outline(i) }, i))) }), legendSvg] }));
|
|
161
|
+
}
|
|
162
|
+
if (chartType === 'line' || chartType === 'area') {
|
|
163
|
+
const lines = keys.map((key, si) => {
|
|
164
|
+
const labels = showValues ? (_jsx(LabelList, { dataKey: key, formatter: formatValue, ...valueLabel, position: "top" })) : null;
|
|
165
|
+
return chartType === 'area' ? (_jsx(Area, { dataKey: key, type: "monotone", stroke: color(si), strokeWidth: 3, fill: color(si), fillOpacity: 0.25, dot: { r: 4, fill: color(si) }, isAnimationActive: false, children: labels }, key)) : (_jsx(Line, { dataKey: key, type: "monotone", stroke: color(si), strokeWidth: 3, dot: { r: 4, fill: color(si) }, isAnimationActive: false, children: labels }, key));
|
|
166
|
+
});
|
|
167
|
+
const Wrapper = chartType === 'area' ? AreaChart : LineChart;
|
|
168
|
+
return (_jsxs(Wrapper, { ...common, children: [showGrid ? _jsx(CartesianGrid, { strokeDasharray: "3 3", stroke: "#e0e0df" }) : null, _jsx(XAxis, { dataKey: "name", tick: tick, tickLine: false, axisLine: { stroke: '#c8c8c7' }, padding: { left: 28, right: 28 } }), _jsx(YAxis, { tick: tick, tickLine: false, axisLine: { stroke: '#c8c8c7' }, width: 40 }), lines, legendSvg] }));
|
|
169
|
+
}
|
|
170
|
+
// bar / bar-horizontal
|
|
171
|
+
const horizontal = chartType === 'bar-horizontal';
|
|
172
|
+
// Room for the longest category name on the left and the longest value label
|
|
173
|
+
// past the bar's end (~8.5 px a bold character).
|
|
174
|
+
const nameWidth = Math.min(width * 0.4, Math.max(64, Math.ceil(Math.max(...data.map((d) => tickTextWidth(d.name)))) + 12));
|
|
175
|
+
const valueRoom = showValues
|
|
176
|
+
? Math.max(...allValues.map((v) => formatValue(v).length)) * 8.5 + 12
|
|
177
|
+
: 0;
|
|
178
|
+
return (_jsxs(BarChart, { ...common, ...(horizontal && {
|
|
179
|
+
margin: { ...common.margin, right: (legend?.width ?? 0) + Math.max(20, valueRoom) },
|
|
180
|
+
}), layout: horizontal ? 'vertical' : 'horizontal', children: [showGrid ? (_jsx(CartesianGrid, { strokeDasharray: "3 3", stroke: "#e0e0df", vertical: horizontal, horizontal: !horizontal })) : null, horizontal ? (_jsxs(_Fragment, { children: [_jsx(XAxis, { type: "number", tick: tick, tickLine: false, axisLine: { stroke: '#c8c8c7' } }), _jsx(YAxis, { type: "category", dataKey: "name", tick: tick, tickLine: false, axisLine: { stroke: '#c8c8c7' }, width: nameWidth,
|
|
181
|
+
// Recharts' default `preserveEnd` drops names it measures as colliding.
|
|
182
|
+
interval: 0 })] })) : (_jsxs(_Fragment, { children: [_jsx(XAxis, { dataKey: "name", tick: tick, tickLine: false, axisLine: { stroke: '#c8c8c7' } }), _jsx(YAxis, { tick: tick, tickLine: false, axisLine: { stroke: '#c8c8c7' }, width: 40 })] })), keys.map((key, si) => (_jsxs(Bar, { dataKey: key, isAnimationActive: false, radius: horizontal ? [0, 4, 4, 0] : [4, 4, 0, 0], ...(series ? { fill: color(si), ...outline(si) } : {}), children: [series ? null : data.map((_, i) => _jsx(Cell, { fill: color(i), ...outline(i) }, i)), showValues ? (_jsx(LabelList, { dataKey: key, formatter: formatValue, ...valueLabel, position: horizontal ? 'right' : 'top' })) : null] }, key))), legendSvg] }));
|
|
183
|
+
}
|
|
184
|
+
async function renderChartImage(chart) {
|
|
185
|
+
const container = document.createElement('div');
|
|
186
|
+
container.style.cssText = `position:absolute;left:-99999px;top:0;width:${chart.width}px;height:${chart.height}px;font-family:sans-serif;`;
|
|
187
|
+
document.body.appendChild(container);
|
|
188
|
+
const recharts = await import('recharts');
|
|
189
|
+
const root = createRoot(container);
|
|
190
|
+
root.render(buildChartElement(recharts, chart));
|
|
191
|
+
// Recharts paints after a couple of frames; poll for a populated <svg>.
|
|
192
|
+
const raf = () => new Promise((r) => requestAnimationFrame(() => r()));
|
|
193
|
+
let svg = null;
|
|
194
|
+
for (let i = 0; i < 8; i++) {
|
|
195
|
+
await raf();
|
|
196
|
+
// The chart's own surface — a legend brings icon <svg>s of its own, ahead of it.
|
|
197
|
+
svg = container.querySelector('.recharts-wrapper > svg');
|
|
198
|
+
if (svg && svg.querySelector('path, rect, line, circle, text'))
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
let image = null;
|
|
202
|
+
if (svg) {
|
|
203
|
+
svg.setAttribute('width', String(chart.width));
|
|
204
|
+
svg.setAttribute('height', String(chart.height));
|
|
205
|
+
svg.setAttribute('font-family', 'sans-serif');
|
|
206
|
+
const xml = new XMLSerializer().serializeToString(svg);
|
|
207
|
+
const url = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(xml)}`;
|
|
208
|
+
image = await new Promise((resolve) => {
|
|
209
|
+
const img = new window.Image();
|
|
210
|
+
img.onload = () => resolve(img);
|
|
211
|
+
img.onerror = () => resolve(null);
|
|
212
|
+
img.src = url;
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
root.unmount();
|
|
216
|
+
container.remove();
|
|
217
|
+
return image;
|
|
218
|
+
}
|
|
219
|
+
function ChartPrimitiveInner({ chart, isSelected, onSelect, onDragEnd, onTransformEnd, draggable = true, ...snapProps }) {
|
|
220
|
+
const locked = useIsItemLocked();
|
|
221
|
+
const snap = useBoxSnap({ id: chart.id, ...snapProps }, chartBox(chart));
|
|
222
|
+
const groupRef = useRef(null);
|
|
223
|
+
const transformerRef = useRef(null);
|
|
224
|
+
// The image with the visual state it was drawn from: while they differ, a
|
|
225
|
+
// render is in flight and an offscreen capture has to wait for it.
|
|
226
|
+
const visualKey = JSON.stringify([
|
|
227
|
+
chart.chartType,
|
|
228
|
+
chart.data,
|
|
229
|
+
chart.series ?? [],
|
|
230
|
+
chart.colors,
|
|
231
|
+
chart.width,
|
|
232
|
+
chart.height,
|
|
233
|
+
chart.showLegend,
|
|
234
|
+
chart.legendPosition ?? '',
|
|
235
|
+
chart.showGrid,
|
|
236
|
+
chart.showValues,
|
|
237
|
+
chart.unit ?? '',
|
|
238
|
+
chart.background ?? '',
|
|
239
|
+
chart.scale,
|
|
240
|
+
]);
|
|
241
|
+
const [rendered, setRendered] = useState({
|
|
242
|
+
image: null,
|
|
243
|
+
key: '',
|
|
244
|
+
});
|
|
245
|
+
const image = rendered.image;
|
|
246
|
+
useTrackPendingImage(chart.id, visualKey, rendered.key === visualKey ? 'loaded' : 'loading');
|
|
247
|
+
useEffect(() => {
|
|
248
|
+
if (isSelected && transformerRef.current && groupRef.current) {
|
|
249
|
+
transformerRef.current.nodes([groupRef.current]);
|
|
250
|
+
transformerRef.current.getLayer()?.batchDraw();
|
|
251
|
+
}
|
|
252
|
+
}, [isSelected, image]);
|
|
253
|
+
// Re-render the chart image whenever the instance's visual data changes.
|
|
254
|
+
useEffect(() => {
|
|
255
|
+
let cancelled = false;
|
|
256
|
+
const timer = setTimeout(() => {
|
|
257
|
+
void renderChartImage(chart)
|
|
258
|
+
.catch(() => null)
|
|
259
|
+
.then((img) => {
|
|
260
|
+
// A failed render keeps the last image but stops the wait.
|
|
261
|
+
if (!cancelled)
|
|
262
|
+
setRendered((prev) => ({ image: img ?? prev.image, key: visualKey }));
|
|
263
|
+
});
|
|
264
|
+
}, 120);
|
|
265
|
+
return () => {
|
|
266
|
+
cancelled = true;
|
|
267
|
+
clearTimeout(timer);
|
|
268
|
+
};
|
|
269
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- `visualKey` covers what the image shows
|
|
270
|
+
}, [visualKey]);
|
|
271
|
+
const { width, height } = chart;
|
|
272
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Group, { ref: groupRef, x: chart.x, y: chart.y, scaleX: chart.scale, scaleY: chart.scale, rotation: chart.rotation, opacity: chart.opacity, draggable: draggable && !locked, onMouseDown: (e) => {
|
|
273
|
+
e.cancelBubble = true;
|
|
274
|
+
onSelect(chart.id);
|
|
275
|
+
}, onTouchStart: (e) => {
|
|
276
|
+
e.cancelBubble = true;
|
|
277
|
+
onSelect(chart.id);
|
|
278
|
+
}, onDragStart: snap.onDragStart, onDragMove: snap.onDragMove, onDragEnd: (e) => {
|
|
279
|
+
snap.onDragEnd();
|
|
280
|
+
onDragEnd(e.target.x(), e.target.y());
|
|
281
|
+
}, onTransformEnd: () => {
|
|
282
|
+
const node = groupRef.current;
|
|
283
|
+
if (!node)
|
|
284
|
+
return;
|
|
285
|
+
const scale = node.scaleX();
|
|
286
|
+
const rotation = node.rotation();
|
|
287
|
+
onTransformEnd(node.x(), node.y(), scale, rotation);
|
|
288
|
+
}, children: [image ? (_jsx(Image, { image: image, width: width, height: height })) : (_jsx(Rect, { width: width, height: height, fill: "#f4f4f3", cornerRadius: 8 })), isSelected && (_jsx(Rect, { name: "selection-chrome", width: width, height: height, stroke: activeBrand().colors.primary, strokeWidth: 2 / chart.scale, dash: [6, 6], listening: false }))] }), isSelected && (_jsx(Transformer, { ref: transformerRef, keepRatio: true, enabledAnchors: ['top-left', 'top-right', 'bottom-left', 'bottom-right'], rotateEnabled: true, ...ELEMENT_TRANSFORMER, ...(locked ? LOCKED_TRANSFORMER : {}) }))] }));
|
|
289
|
+
}
|
|
290
|
+
export const ChartPrimitive = memo(ChartPrimitiveInner, (prev, next) => {
|
|
291
|
+
const a = prev.chart;
|
|
292
|
+
const b = next.chart;
|
|
293
|
+
if (prev.isSelected !== next.isSelected)
|
|
294
|
+
return false;
|
|
295
|
+
if (prev.draggable !== next.draggable)
|
|
296
|
+
return false;
|
|
297
|
+
if (prev.stageWidth !== next.stageWidth || prev.stageHeight !== next.stageHeight)
|
|
298
|
+
return false;
|
|
299
|
+
return (a.id === b.id &&
|
|
300
|
+
a.x === b.x &&
|
|
301
|
+
a.y === b.y &&
|
|
302
|
+
a.width === b.width &&
|
|
303
|
+
a.height === b.height &&
|
|
304
|
+
a.scale === b.scale &&
|
|
305
|
+
a.rotation === b.rotation &&
|
|
306
|
+
a.opacity === b.opacity &&
|
|
307
|
+
a.chartType === b.chartType &&
|
|
308
|
+
a.data === b.data &&
|
|
309
|
+
a.series === b.series &&
|
|
310
|
+
a.colors === b.colors &&
|
|
311
|
+
a.showLegend === b.showLegend &&
|
|
312
|
+
a.legendPosition === b.legendPosition &&
|
|
313
|
+
a.showGrid === b.showGrid &&
|
|
314
|
+
a.showValues === b.showValues &&
|
|
315
|
+
a.unit === b.unit &&
|
|
316
|
+
a.background === b.background);
|
|
317
|
+
});
|
|
318
|
+
ChartPrimitive.displayName = 'ChartPrimitive';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CircleBadge - Reusable Konva component for rendering a colored circle with text lines
|
|
3
|
+
*
|
|
4
|
+
* Renders a circle with multiple text lines inside (e.g., weekday, date, time).
|
|
5
|
+
* Designed for the Veranstaltung date circle but reusable across layouts.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Draggable with snapping support
|
|
9
|
+
* - Transform handles (scale, rotate)
|
|
10
|
+
* - Inline text editing on double-click per text line
|
|
11
|
+
*/
|
|
12
|
+
import { type CircleBadgeInstance, type CircleBadgeTextLine } from '@ggraphic/core';
|
|
13
|
+
import type { SnapTarget } from '@ggraphic/editor/utils/snapping';
|
|
14
|
+
export { type CircleBadgeInstance, type CircleBadgeTextLine } from '@ggraphic/core';
|
|
15
|
+
export interface CircleBadgeProps {
|
|
16
|
+
id: string;
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
radius: number;
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
textColor: string;
|
|
22
|
+
rotation: number;
|
|
23
|
+
scale: number;
|
|
24
|
+
opacity?: number;
|
|
25
|
+
textLines: CircleBadgeTextLine[];
|
|
26
|
+
outline?: CircleBadgeInstance['outline'];
|
|
27
|
+
selected: boolean;
|
|
28
|
+
onSelect: () => void;
|
|
29
|
+
onDragEnd: (x: number, y: number) => void;
|
|
30
|
+
onTransformEnd: (x: number, y: number, scale: number, rotation: number) => void;
|
|
31
|
+
onTextLineChange?: (lineIndex: number, text: string) => void;
|
|
32
|
+
onSnapChange: (snapH: boolean, snapV: boolean) => void;
|
|
33
|
+
onSnapLinesChange: (lines: unknown[]) => void;
|
|
34
|
+
getSnapTargets: (excludeId: string) => SnapTarget[];
|
|
35
|
+
stageWidth: number;
|
|
36
|
+
stageHeight: number;
|
|
37
|
+
}
|
|
38
|
+
declare function CircleBadgeInner({ id, x, y, radius, backgroundColor, textColor, rotation, scale, opacity, textLines, outline, selected, onSelect, onDragEnd, onTransformEnd, onTextLineChange, onSnapChange, onSnapLinesChange, getSnapTargets, stageWidth, stageHeight, }: CircleBadgeProps): import("react").JSX.Element;
|
|
39
|
+
/**
|
|
40
|
+
* Memoized CircleBadge - Prevents re-renders when only callbacks change
|
|
41
|
+
*/
|
|
42
|
+
export declare const CircleBadge: import("react").MemoExoticComponent<typeof CircleBadgeInner>;
|
|
43
|
+
export default CircleBadge;
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useCallback, useEffect, useState, memo } from 'react';
|
|
3
|
+
import { Group, Circle, Ellipse, Star, Text, Rect, Transformer } from 'react-konva';
|
|
4
|
+
import { LOCKED_TRANSFORMER, useIsItemLocked } from '@ggraphic/editor/components/canvasItemLock';
|
|
5
|
+
import { useSnapScheduler } from '@ggraphic/editor/hooks/useSnapScheduler';
|
|
6
|
+
import { messages } from '@ggraphic/editor/i18n/messages';
|
|
7
|
+
import { captureFocusOrigin, returnFocus } from '@ggraphic/editor/utils/editorFocus';
|
|
8
|
+
import { followStage } from '@ggraphic/editor/utils/followStage';
|
|
9
|
+
import { isGroupDrag } from '@ggraphic/editor/utils/multiSelect';
|
|
10
|
+
import { ELEMENT_TRANSFORMER, normalizeRotation } from '@ggraphic/editor/utils/orientation';
|
|
11
|
+
import { boxFrame, createBoxFrame, snapByBounds } from '@ggraphic/editor/utils/snapping';
|
|
12
|
+
import { stageCssScale } from '@ggraphic/editor/utils/stageCssScale';
|
|
13
|
+
import { resolveFontFamily } from '../utils/fontAliases.js';
|
|
14
|
+
import { useTextEditorOpener } from '../utils/textEditorOpeners.js';
|
|
15
|
+
// Rahmen für Snap und Geometrie-Meldung, pro Aufruf neu beschrieben (synchron, ohne Allokation).
|
|
16
|
+
const dragFrame = createBoxFrame();
|
|
17
|
+
/** A burst's points and the share of the radius its valleys reach. */
|
|
18
|
+
const BURST = { points: 16, inner: 0.8 };
|
|
19
|
+
/** An ellipse's half-axes as shares of the radius. */
|
|
20
|
+
const ELLIPSE = { x: 1.3, y: 0.78 };
|
|
21
|
+
function CircleBadgeInner({ id, x, y, radius, backgroundColor, textColor, rotation, scale, opacity = 1, textLines, outline = 'circle', selected, onSelect, onDragEnd, onTransformEnd, onTextLineChange, onSnapChange, onSnapLinesChange, getSnapTargets, stageWidth, stageHeight, }) {
|
|
22
|
+
const locked = useIsItemLocked();
|
|
23
|
+
const groupRef = useRef(null);
|
|
24
|
+
const transformerRef = useRef(null);
|
|
25
|
+
const inputRef = useRef(null);
|
|
26
|
+
const stopFollowingRef = useRef(null);
|
|
27
|
+
const textNodesRef = useRef([]);
|
|
28
|
+
const [editingIndex, setEditingIndex] = useState(null);
|
|
29
|
+
const snap = useSnapScheduler({ onSnapChange, onSnapLinesChange });
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (selected && editingIndex === null && groupRef.current && transformerRef.current) {
|
|
32
|
+
transformerRef.current.nodes([groupRef.current]);
|
|
33
|
+
transformerRef.current.getLayer()?.batchDraw();
|
|
34
|
+
}
|
|
35
|
+
}, [selected, editingIndex]);
|
|
36
|
+
// Cleanup input on unmount
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
return () => {
|
|
39
|
+
stopFollowingRef.current?.();
|
|
40
|
+
stopFollowingRef.current = null;
|
|
41
|
+
if (inputRef.current && document.body.contains(inputRef.current)) {
|
|
42
|
+
document.body.removeChild(inputRef.current);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}, []);
|
|
46
|
+
const handleDragMove = useCallback((e) => {
|
|
47
|
+
const node = e.currentTarget;
|
|
48
|
+
if (isGroupDrag(node))
|
|
49
|
+
return;
|
|
50
|
+
const scaleX = node.scaleX();
|
|
51
|
+
const scaleY = node.scaleY();
|
|
52
|
+
const contentWidth = radius * 2 * scaleX;
|
|
53
|
+
const contentHeight = radius * 2 * scaleY;
|
|
54
|
+
const result = snapByBounds(boxFrame(dragFrame, node.x(), node.y(), contentWidth, contentHeight, node.rotation(), 'centre'), getSnapTargets(id), stageWidth, stageHeight, snap.hysteresis);
|
|
55
|
+
node.position({ x: result.x, y: result.y });
|
|
56
|
+
snap.scheduleSnap(result.snapH, result.snapV, result.snapLines);
|
|
57
|
+
}, [id, radius, getSnapTargets, stageWidth, stageHeight, snap]);
|
|
58
|
+
const handleDragEnd = useCallback((e) => {
|
|
59
|
+
snap.onDragEnd();
|
|
60
|
+
onDragEnd(e.target.x(), e.target.y());
|
|
61
|
+
}, [onDragEnd, snap]);
|
|
62
|
+
const handleTransformEnd = useCallback(() => {
|
|
63
|
+
const node = groupRef.current;
|
|
64
|
+
if (!node)
|
|
65
|
+
return;
|
|
66
|
+
const scaleX = node.scaleX();
|
|
67
|
+
const scaleY = node.scaleY();
|
|
68
|
+
const newScale = Math.max(scaleX, scaleY);
|
|
69
|
+
const newRotation = node.rotation();
|
|
70
|
+
node.scaleX(scale);
|
|
71
|
+
node.scaleY(scale);
|
|
72
|
+
node.rotation(rotation);
|
|
73
|
+
onTransformEnd(node.x(), node.y(), newScale, newRotation);
|
|
74
|
+
}, [onTransformEnd, scale, rotation]);
|
|
75
|
+
const handleDblClick = useCallback((index) => {
|
|
76
|
+
if (!onTextLineChange)
|
|
77
|
+
return;
|
|
78
|
+
const textNode = textNodesRef.current[index];
|
|
79
|
+
const stage = textNode?.getStage();
|
|
80
|
+
if (!textNode || !stage)
|
|
81
|
+
return;
|
|
82
|
+
// Woher die Bearbeitung kam (Ebenen-Eintrag oder Seite) — dorthin geht der Fokus danach.
|
|
83
|
+
const origin = captureFocusOrigin(stage.container());
|
|
84
|
+
setEditingIndex(index);
|
|
85
|
+
let input = inputRef.current;
|
|
86
|
+
if (!input) {
|
|
87
|
+
input = document.createElement('input');
|
|
88
|
+
document.body.appendChild(input);
|
|
89
|
+
inputRef.current = input;
|
|
90
|
+
}
|
|
91
|
+
const line = textLines[index];
|
|
92
|
+
const lineHeight = 1.2;
|
|
93
|
+
const textH = line.fontSize * lineHeight;
|
|
94
|
+
input.value = line.text;
|
|
95
|
+
input.setAttribute('aria-label', messages().common.editText);
|
|
96
|
+
input.style.position = 'absolute';
|
|
97
|
+
input.style.fontFamily = `${resolveFontFamily(line.fontFamily)}, Arial, sans-serif`;
|
|
98
|
+
input.style.fontWeight = line.fontWeight === 'bold' ? 'bold' : 'normal';
|
|
99
|
+
input.style.color = textColor;
|
|
100
|
+
input.style.textAlign = 'center';
|
|
101
|
+
input.style.lineHeight = String(lineHeight);
|
|
102
|
+
input.style.border = 'none';
|
|
103
|
+
input.style.padding = '0px';
|
|
104
|
+
input.style.margin = '0';
|
|
105
|
+
input.style.background = 'none';
|
|
106
|
+
input.style.outline = '2px solid #0088cc';
|
|
107
|
+
input.style.outlineOffset = '2px';
|
|
108
|
+
input.style.zIndex = '10000';
|
|
109
|
+
input.style.transformOrigin = 'left top';
|
|
110
|
+
// Lage und Mass aus der Bühne, wie sie jetzt liegt — beim Öffnen und bei jeder Verschiebung.
|
|
111
|
+
const place = () => {
|
|
112
|
+
const stageBox = stage.container().getBoundingClientRect();
|
|
113
|
+
const cssScale = stageCssScale(stage, stageBox);
|
|
114
|
+
const textPosition = textNode.getAbsolutePosition();
|
|
115
|
+
const absScale = textNode.getAbsoluteScale();
|
|
116
|
+
const scaleX = absScale.x * cssScale;
|
|
117
|
+
const scaleY = absScale.y * cssScale;
|
|
118
|
+
const scrollX = window.scrollX || window.pageXOffset;
|
|
119
|
+
const scrollY = window.scrollY || window.pageYOffset;
|
|
120
|
+
input.style.top = `${stageBox.top + scrollY + textPosition.y * cssScale}px`;
|
|
121
|
+
input.style.left = `${stageBox.left + scrollX + textPosition.x * cssScale}px`;
|
|
122
|
+
input.style.width = `${radius * 2 * scaleX}px`;
|
|
123
|
+
input.style.height = `${textH * scaleY}px`;
|
|
124
|
+
input.style.fontSize = `${line.fontSize * scaleY}px`;
|
|
125
|
+
// Der Textknoten trägt die Drehung der Gruppe; seine linke obere Ecke ist sein Ursprung.
|
|
126
|
+
input.style.transform = `rotate(${normalizeRotation(textNode.getAbsoluteRotation())}deg)`;
|
|
127
|
+
};
|
|
128
|
+
place();
|
|
129
|
+
stopFollowingRef.current?.();
|
|
130
|
+
stopFollowingRef.current = followStage(stage, place);
|
|
131
|
+
input.focus();
|
|
132
|
+
input.select();
|
|
133
|
+
const removeInput = () => {
|
|
134
|
+
stopFollowingRef.current?.();
|
|
135
|
+
stopFollowingRef.current = null;
|
|
136
|
+
if (!inputRef.current)
|
|
137
|
+
return;
|
|
138
|
+
const newText = inputRef.current.value.trim();
|
|
139
|
+
if (newText && newText !== line.text) {
|
|
140
|
+
onTextLineChange(index, newText);
|
|
141
|
+
}
|
|
142
|
+
setEditingIndex(null);
|
|
143
|
+
if (document.body.contains(inputRef.current)) {
|
|
144
|
+
document.body.removeChild(inputRef.current);
|
|
145
|
+
}
|
|
146
|
+
inputRef.current = null;
|
|
147
|
+
returnFocus(origin);
|
|
148
|
+
};
|
|
149
|
+
input.addEventListener('blur', removeInput);
|
|
150
|
+
input.addEventListener('keydown', (ev) => {
|
|
151
|
+
if (ev.key === 'Escape') {
|
|
152
|
+
input?.blur();
|
|
153
|
+
}
|
|
154
|
+
if (ev.key === 'Enter' && !ev.shiftKey) {
|
|
155
|
+
ev.preventDefault();
|
|
156
|
+
input?.blur();
|
|
157
|
+
}
|
|
158
|
+
// Das Feld hängt am Ende von <body>: Tab führte von dort ins Nirgendwo.
|
|
159
|
+
if (ev.key === 'Tab') {
|
|
160
|
+
ev.preventDefault();
|
|
161
|
+
input?.blur();
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}, [onTextLineChange, textLines, textColor, radius]);
|
|
165
|
+
// „Text bearbeiten“ (F2, Enter in der Ebenen-Liste, Kontextmenü) beginnt mit der ersten Zeile.
|
|
166
|
+
useTextEditorOpener(id, () => handleDblClick(0));
|
|
167
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Group, { ref: groupRef, x: x, y: y, scaleX: scale, scaleY: scale, rotation: rotation, opacity: opacity, draggable: editingIndex === null && !locked, onDragStart: snap.onDragStart, onDragMove: handleDragMove, onDragEnd: handleDragEnd, onTransformEnd: handleTransformEnd, onMouseDown: onSelect, onTouchStart: onSelect, children: [outline === 'burst' ? (_jsx(Star, { x: 0, y: 0, numPoints: BURST.points, innerRadius: radius * BURST.inner, outerRadius: radius, fill: backgroundColor })) : outline === 'ellipse' ? (_jsx(Ellipse, { x: 0, y: 0, radiusX: radius * ELLIPSE.x, radiusY: radius * ELLIPSE.y, fill: backgroundColor })) : (_jsx(Circle, { x: 0, y: 0, radius: radius, fill: backgroundColor })), textLines.map((line, index) => {
|
|
168
|
+
const isEditingThis = editingIndex === index;
|
|
169
|
+
return (_jsx(Text
|
|
170
|
+
// eslint-disable-next-line react/no-array-index-key -- text lines are fixed slots edited by index; order is the identity
|
|
171
|
+
, { text: line.text, x: -radius, y: line.yOffset - line.fontSize / 2, width: radius * 2, fontSize: line.fontSize, fontFamily: `${resolveFontFamily(line.fontFamily)}, Arial, sans-serif`, fontStyle: line.fontWeight === 'bold' ? 'bold' : 'normal', fill: textColor, align: "center", listening: !!onTextLineChange, visible: !isEditingThis, ref: (node) => {
|
|
172
|
+
textNodesRef.current[index] = node;
|
|
173
|
+
}, onDblClick: () => handleDblClick(index), onDblTap: () => handleDblClick(index) }, index));
|
|
174
|
+
}), selected && (_jsx(Rect, { name: "selection-chrome", x: -radius - 4, y: -radius - 4, width: radius * 2 + 8, height: radius * 2 + 8, stroke: "#0066ff", strokeWidth: 2, dash: [5, 5], listening: false }))] }), selected && editingIndex === null && (_jsx(Transformer, { ref: transformerRef, keepRatio: true, enabledAnchors: ['top-left', 'top-right', 'bottom-left', 'bottom-right'], boundBoxFunc: (oldBox, newBox) => {
|
|
175
|
+
const minSize = 50;
|
|
176
|
+
const maxSize = 2000;
|
|
177
|
+
if (newBox.width < minSize || newBox.height < minSize)
|
|
178
|
+
return oldBox;
|
|
179
|
+
if (newBox.width > maxSize || newBox.height > maxSize)
|
|
180
|
+
return oldBox;
|
|
181
|
+
return newBox;
|
|
182
|
+
}, rotateEnabled: true, ...ELEMENT_TRANSFORMER, ...(locked ? LOCKED_TRANSFORMER : {}) }))] }));
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Memoized CircleBadge - Prevents re-renders when only callbacks change
|
|
186
|
+
*/
|
|
187
|
+
export const CircleBadge = memo(CircleBadgeInner, (prevProps, nextProps) => {
|
|
188
|
+
if (prevProps.id !== nextProps.id)
|
|
189
|
+
return false;
|
|
190
|
+
if (prevProps.x !== nextProps.x)
|
|
191
|
+
return false;
|
|
192
|
+
if (prevProps.y !== nextProps.y)
|
|
193
|
+
return false;
|
|
194
|
+
if (prevProps.radius !== nextProps.radius)
|
|
195
|
+
return false;
|
|
196
|
+
if (prevProps.backgroundColor !== nextProps.backgroundColor)
|
|
197
|
+
return false;
|
|
198
|
+
if (prevProps.textColor !== nextProps.textColor)
|
|
199
|
+
return false;
|
|
200
|
+
if (prevProps.rotation !== nextProps.rotation)
|
|
201
|
+
return false;
|
|
202
|
+
if (prevProps.scale !== nextProps.scale)
|
|
203
|
+
return false;
|
|
204
|
+
if (prevProps.opacity !== nextProps.opacity)
|
|
205
|
+
return false;
|
|
206
|
+
if (prevProps.outline !== nextProps.outline)
|
|
207
|
+
return false;
|
|
208
|
+
if (prevProps.selected !== nextProps.selected)
|
|
209
|
+
return false;
|
|
210
|
+
if (prevProps.stageWidth !== nextProps.stageWidth)
|
|
211
|
+
return false;
|
|
212
|
+
if (prevProps.stageHeight !== nextProps.stageHeight)
|
|
213
|
+
return false;
|
|
214
|
+
if (prevProps.textLines.length !== nextProps.textLines.length)
|
|
215
|
+
return false;
|
|
216
|
+
for (let i = 0; i < prevProps.textLines.length; i++) {
|
|
217
|
+
const prev = prevProps.textLines[i];
|
|
218
|
+
const next = nextProps.textLines[i];
|
|
219
|
+
if (prev.text !== next.text)
|
|
220
|
+
return false;
|
|
221
|
+
if (prev.yOffset !== next.yOffset)
|
|
222
|
+
return false;
|
|
223
|
+
if (prev.fontSize !== next.fontSize)
|
|
224
|
+
return false;
|
|
225
|
+
if (prev.fontFamily !== next.fontFamily)
|
|
226
|
+
return false;
|
|
227
|
+
if (prev.fontWeight !== next.fontWeight)
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
return true;
|
|
231
|
+
});
|
|
232
|
+
CircleBadge.displayName = 'CircleBadge';
|
|
233
|
+
export default CircleBadge;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type SnapProps } from '@ggraphic/editor/hooks/useBoxSnap';
|
|
3
|
+
import type { FrameInstance } from '@ggraphic/editor/utils/frameUtils';
|
|
4
|
+
export interface FramePrimitiveProps extends SnapProps {
|
|
5
|
+
frame: FrameInstance;
|
|
6
|
+
isSelected: boolean;
|
|
7
|
+
onSelect: (id: string) => void;
|
|
8
|
+
onChange: (newAttrs: Partial<FrameInstance>) => void;
|
|
9
|
+
onImageUpload: (id: string, file: File, objectUrl: string) => void;
|
|
10
|
+
draggable?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare function FramePrimitiveInner({ frame, isSelected, onSelect, onChange, draggable, ...snapProps }: FramePrimitiveProps): React.JSX.Element;
|
|
13
|
+
export declare const FramePrimitive: React.MemoExoticComponent<typeof FramePrimitiveInner>;
|
|
14
|
+
export {};
|