@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,74 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { useId, useState } from 'react';
|
|
4
|
+
import { PiAlignBottom, PiAlignCenterHorizontal, PiAlignCenterVertical, PiAlignLeft, PiAlignRight, PiAlignTop, PiArrowsOutCardinal, PiColumns, PiRows, } from 'react-icons/pi';
|
|
5
|
+
import { TILE, useBarTiles } from '@ggraphic/editor/components/TopBar/barTiles';
|
|
6
|
+
import { FloatingLayerControls } from '@ggraphic/editor/components/TopBar/modules/FloatingLayerControls';
|
|
7
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
8
|
+
import { Popover, PopoverContent, PopoverTrigger } from '@ggraphic/editor/ui/popover';
|
|
9
|
+
import { CANVAS_COMMANDS } from '@ggraphic/editor/utils/canvasCommandRegistry';
|
|
10
|
+
const ALIGN = [
|
|
11
|
+
{ id: 'alignLeft', icon: PiAlignLeft },
|
|
12
|
+
{ id: 'alignCenterH', icon: PiAlignCenterHorizontal },
|
|
13
|
+
{ id: 'alignRight', icon: PiAlignRight },
|
|
14
|
+
{ id: 'alignTop', icon: PiAlignTop },
|
|
15
|
+
{ id: 'alignMiddle', icon: PiAlignCenterVertical },
|
|
16
|
+
{ id: 'alignBottom', icon: PiAlignBottom },
|
|
17
|
+
];
|
|
18
|
+
const DISTRIBUTE = [
|
|
19
|
+
{ id: 'distributeHorizontal', icon: PiColumns },
|
|
20
|
+
{ id: 'distributeVertical', icon: PiRows },
|
|
21
|
+
];
|
|
22
|
+
const TRIGGER_BTN = 'inline-flex items-center h-8 max-canvas-mobile:h-11 shrink-0 rounded-md border-none bg-transparent px-2 cursor-pointer whitespace-nowrap text-[13px] font-medium text-[var(--editor-text)] transition-colors duration-150 hover:bg-[var(--editor-surface-hover)] hover:text-[var(--editor-active-fg)] data-[state=open]:bg-[var(--editor-active-bg)] data-[state=open]:text-[var(--editor-active-fg)]';
|
|
23
|
+
const GRID_BTN = 'inline-flex items-center gap-1.5 h-8 max-canvas-mobile:h-11 rounded-md border-none bg-transparent px-2 cursor-pointer whitespace-nowrap text-[12px] text-[var(--editor-text)] transition-colors duration-150 hover:bg-[var(--editor-surface-hover)] hover:text-[var(--editor-active-fg)] disabled:opacity-30 disabled:cursor-not-allowed';
|
|
24
|
+
const show = (n) => String(Math.round(n));
|
|
25
|
+
/**
|
|
26
|
+
* Ein Zahlenfeld, das erst beim Enter oder Verlassen schreibt: Tippen ändert
|
|
27
|
+
* nur den Entwurf hier, nicht die Seite. Unverändertes und Unsinn verwirft es.
|
|
28
|
+
*/
|
|
29
|
+
function NumberField({ label, value, disabled, onCommit, }) {
|
|
30
|
+
const [draft, setDraft] = useState(null);
|
|
31
|
+
const commit = () => {
|
|
32
|
+
if (draft === null)
|
|
33
|
+
return;
|
|
34
|
+
setDraft(null);
|
|
35
|
+
const n = Number(draft.trim().replace(',', '.'));
|
|
36
|
+
if (draft.trim() !== '' && Number.isFinite(n) && draft.trim() !== show(value))
|
|
37
|
+
onCommit(n);
|
|
38
|
+
};
|
|
39
|
+
return (_jsxs("label", { className: "flex items-center gap-1.5 text-[11px] text-[var(--editor-text-muted)]", children: [_jsx("span", { className: "w-3", children: label }), _jsx("input", { type: "text", inputMode: "decimal", "aria-label": label, disabled: disabled, value: draft ?? show(value), onChange: (e) => setDraft(e.target.value), onBlur: commit, onKeyDown: (e) => {
|
|
40
|
+
if (e.key === 'Enter')
|
|
41
|
+
commit();
|
|
42
|
+
}, className: "w-full min-w-0 h-7 max-canvas-mobile:h-11 rounded-md border border-[var(--editor-border-soft)] bg-[var(--editor-surface)] px-2 text-[12px] tabular-nums text-[var(--editor-text)] disabled:opacity-40" })] }));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* „Position“: Ausrichten, Verteilen und — einzeln — X, Y, B, H in logischen px
|
|
46
|
+
* sowie die Ebene. Ein Text-Knopf wie bei Canva: ein Icon sagte hier zu wenig.
|
|
47
|
+
*/
|
|
48
|
+
export function FloatingPositionControl({ canAlign = true, canDistribute, onCommand, getGeometry, onPositionChange, onSizeChange, layer, }) {
|
|
49
|
+
const t = useMessages();
|
|
50
|
+
const tiles = useBarTiles();
|
|
51
|
+
const [geometry, setGeometry] = useState(null);
|
|
52
|
+
const read = () => setGeometry(getGeometry?.() ?? null);
|
|
53
|
+
// Die Seite zeichnet die Änderung erst im nächsten Bild; danach neu lesen.
|
|
54
|
+
const reread = () => requestAnimationFrame(read);
|
|
55
|
+
const multi = !getGeometry;
|
|
56
|
+
const titleId = useId();
|
|
57
|
+
const button = ({ id, icon: Icon }, disabled = false) => (_jsxs("button", { type: "button", className: GRID_BTN, disabled: disabled, onClick: () => {
|
|
58
|
+
onCommand(id);
|
|
59
|
+
reread();
|
|
60
|
+
}, children: [_jsx(Icon, { size: 16, "aria-hidden": "true" }), CANVAS_COMMANDS[id].label] }, id));
|
|
61
|
+
return (_jsxs(Popover, { onOpenChange: (open) => open && read(), children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { className: tiles ? TILE : TRIGGER_BTN, type: "button", children: [tiles && _jsx(PiArrowsOutCardinal, { size: 18, "aria-hidden": true }), t.topBar.position] }) }), _jsxs(PopoverContent, { className: "z-[10001] w-80 max-w-[calc(100vw-32px)] flex flex-col gap-2.5 p-3", align: "center", "aria-labelledby": titleId, children: [_jsx("span", { id: titleId, className: "text-xs font-medium text-[var(--editor-text)]", children: t.topBar.position }), canAlign && _jsx("div", { className: "grid grid-cols-3 gap-0.5", children: ALIGN.map((a) => button(a)) }), canAlign && multi && (_jsx("div", { className: "grid grid-cols-2 gap-0.5", children: DISTRIBUTE.map((d) => button(d, !canDistribute)) })), canAlign && geometry && (_jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsx(NumberField, { label: "X", value: geometry.x, disabled: !onPositionChange, onCommit: (x) => {
|
|
62
|
+
onPositionChange?.({ x });
|
|
63
|
+
reread();
|
|
64
|
+
} }), _jsx(NumberField, { label: "Y", value: geometry.y, disabled: !onPositionChange, onCommit: (y) => {
|
|
65
|
+
onPositionChange?.({ y });
|
|
66
|
+
reread();
|
|
67
|
+
} }), _jsx(NumberField, { label: "B", value: geometry.width, disabled: !onSizeChange || geometry.resize === null, onCommit: (width) => {
|
|
68
|
+
onSizeChange?.({ width });
|
|
69
|
+
reread();
|
|
70
|
+
} }), _jsx(NumberField, { label: "H", value: geometry.height, disabled: !onSizeChange || geometry.resize === null || geometry.resize === 'width', onCommit: (height) => {
|
|
71
|
+
onSizeChange?.({ height });
|
|
72
|
+
reread();
|
|
73
|
+
} })] })), layer && (_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-xs text-[var(--editor-text-secondary)]", children: t.sidebar.layers.title }), _jsx(FloatingLayerControls, { canMoveUp: layer.canMoveUp, canMoveDown: layer.canMoveDown, onMoveUp: () => layer.onMove('up'), onMoveDown: () => layer.onMove('down') })] }))] })] }));
|
|
74
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ShadowPatch } from '@ggraphic/editor/hooks/useFloatingModuleHandlers';
|
|
3
|
+
interface FloatingShadowControlProps {
|
|
4
|
+
shadowColor?: string;
|
|
5
|
+
shadowBlur?: number;
|
|
6
|
+
shadowOffsetX?: number;
|
|
7
|
+
shadowOffsetY?: number;
|
|
8
|
+
shadowOpacity?: number;
|
|
9
|
+
onChange: (patch: ShadowPatch) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function FloatingShadowControl({ shadowColor, shadowBlur, shadowOffsetX, shadowOffsetY, shadowOpacity, onChange, }: FloatingShadowControlProps): React.JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { activeBrand } from '@ggraphic/editor/brand/brandRegistry';
|
|
4
|
+
import { CustomColorSwatch } from '@ggraphic/editor/components/CustomColorSwatch';
|
|
5
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger } from '@ggraphic/editor/ui/popover';
|
|
7
|
+
import { Slider } from 'radix-ui';
|
|
8
|
+
import { useId } from 'react';
|
|
9
|
+
import { PiDropHalfBottom } from 'react-icons/pi';
|
|
10
|
+
import { colorName } from '@ggraphic/editor/utils/colorNames';
|
|
11
|
+
const SHADOW_DEFAULTS = {
|
|
12
|
+
shadowColor: '#000000',
|
|
13
|
+
shadowBlur: 8,
|
|
14
|
+
shadowOffsetX: 4,
|
|
15
|
+
shadowOffsetY: 4,
|
|
16
|
+
shadowOpacity: 0.5,
|
|
17
|
+
};
|
|
18
|
+
const ICON_BTN = 'inline-flex items-center justify-center size-8 shrink-0 rounded-md border-none bg-transparent cursor-pointer text-[var(--editor-text)] transition-colors duration-150 hover:bg-[var(--editor-surface-hover)]';
|
|
19
|
+
function LabeledSlider({ label, value, min, max, step, suffix, onValueChange, }) {
|
|
20
|
+
return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-[11px] w-14 text-[var(--editor-text-muted)]", children: label }), _jsxs(Slider.Root, { className: "relative flex items-center select-none touch-none grow h-4 max-canvas-mobile:h-11", value: [value], onValueChange: (v) => onValueChange(v[0]), min: min, max: max, step: step, children: [_jsx(Slider.Track, { className: "relative grow rounded-full h-1 bg-[var(--editor-border-soft)]", children: _jsx(Slider.Range, { className: "absolute rounded-full h-full bg-[var(--editor-accent)]" }) }), _jsx(Slider.Thumb, { className: "block size-3 max-canvas-mobile:size-5 bg-white rounded-full border-2 border-[var(--editor-accent)] shadow-[0_1px_3px_rgba(0,0,0,0.2)] cursor-grab focus:outline-none", "aria-label": label })] }), _jsxs("span", { className: "text-[11px] w-9 text-right tabular-nums text-[var(--editor-text-muted)]", children: [Math.round(value), suffix] })] }));
|
|
21
|
+
}
|
|
22
|
+
export function FloatingShadowControl({ shadowColor, shadowBlur, shadowOffsetX, shadowOffsetY, shadowOpacity, onChange, }) {
|
|
23
|
+
const { shadows } = activeBrand().effects;
|
|
24
|
+
const t = useMessages();
|
|
25
|
+
const enabled = !!shadowColor;
|
|
26
|
+
const toggle = () => {
|
|
27
|
+
if (enabled) {
|
|
28
|
+
onChange({ shadowColor: undefined, shadowBlur: 0, shadowOpacity: 0 });
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
onChange(SHADOW_DEFAULTS);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const titleId = useId();
|
|
35
|
+
return (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { className: ICON_BTN, title: t.topBar.shadow, type: "button", "aria-label": t.topBar.editShadow, children: _jsx(PiDropHalfBottom, { size: 17, className: enabled ? 'text-[var(--editor-accent)]' : 'text-[var(--editor-text-muted)]' }) }) }), _jsxs(PopoverContent, { className: "z-[10001] w-64 flex flex-col gap-2.5 p-3", align: "center", "aria-labelledby": titleId, children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { id: titleId, className: "text-xs font-medium text-[var(--editor-text)]", children: t.topBar.shadow }), _jsx("button", { className: "text-[11px] font-medium text-[var(--editor-accent)] hover:underline", onClick: toggle, type: "button", children: enabled ? 'Entfernen' : 'Aktivieren' })] }), enabled && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [shadows.map((c) => (_jsx("button", { className: "size-6 rounded-full border border-black/10 hover:scale-110 transition-transform", style: {
|
|
36
|
+
backgroundColor: c,
|
|
37
|
+
outline: shadowColor === c ? '2px solid var(--editor-accent)' : 'none',
|
|
38
|
+
outlineOffset: '2px',
|
|
39
|
+
}, onClick: () => onChange({ shadowColor: c }), title: colorName(c), "aria-label": colorName(c), "aria-pressed": shadowColor === c, type: "button" }, c))), _jsx(CustomColorSwatch, { value: shadowColor, presets: shadows, onPick: (color) => onChange({ shadowColor: color }), className: "size-6" })] }), _jsx(LabeledSlider, { label: t.sidebar.imageAdjust.softness, value: shadowBlur ?? 0, min: 0, max: 40, step: 1, onValueChange: (v) => onChange({ shadowBlur: v }) }), _jsx(LabeledSlider, { label: t.sidebar.imageAdjust.offsetX, value: shadowOffsetX ?? 0, min: -40, max: 40, step: 1, onValueChange: (v) => onChange({ shadowOffsetX: v }) }), _jsx(LabeledSlider, { label: t.sidebar.imageAdjust.offsetY, value: shadowOffsetY ?? 0, min: -40, max: 40, step: 1, onValueChange: (v) => onChange({ shadowOffsetY: v }) }), _jsx(LabeledSlider, { label: t.sidebar.imageAdjust.opacity, value: (shadowOpacity ?? 0) * 100, min: 0, max: 100, step: 1, suffix: "%", onValueChange: (v) => onChange({ shadowOpacity: v / 100 }) })] }))] })] }));
|
|
40
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type TextAlign } from '@ggraphic/editor/utils/textAlign';
|
|
2
|
+
interface FloatingTextAlignControlProps {
|
|
3
|
+
align: TextAlign;
|
|
4
|
+
onAlignChange: (align: TextAlign) => void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Richtet den Text in seiner Box aus — ein Knopf, der wie in Canva
|
|
8
|
+
* weiterschaltet: links → zentriert → rechts. „Position“ daneben richtet
|
|
9
|
+
* dagegen die Box auf der Seite aus.
|
|
10
|
+
*/
|
|
11
|
+
export declare function FloatingTextAlignControl({ align, onAlignChange }: FloatingTextAlignControlProps): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { PiTextAlignCenter, PiTextAlignLeft, PiTextAlignRight } from 'react-icons/pi';
|
|
4
|
+
import { TILE, TileCaption, useBarTiles } from '@ggraphic/editor/components/TopBar/barTiles';
|
|
5
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
6
|
+
import { TEXT_ALIGNS } from '@ggraphic/editor/utils/textAlign';
|
|
7
|
+
const ICON_BTN = 'inline-flex items-center justify-center size-8 max-canvas-mobile:size-11 shrink-0 rounded-md border-none bg-transparent cursor-pointer text-[var(--editor-text)] transition-colors duration-150 hover:bg-[var(--editor-surface-hover)] hover:text-[var(--editor-active-fg)]';
|
|
8
|
+
const ICONS = {
|
|
9
|
+
left: PiTextAlignLeft,
|
|
10
|
+
center: PiTextAlignCenter,
|
|
11
|
+
right: PiTextAlignRight,
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Richtet den Text in seiner Box aus — ein Knopf, der wie in Canva
|
|
15
|
+
* weiterschaltet: links → zentriert → rechts. „Position“ daneben richtet
|
|
16
|
+
* dagegen die Box auf der Seite aus.
|
|
17
|
+
*/
|
|
18
|
+
export function FloatingTextAlignControl({ align, onAlignChange }) {
|
|
19
|
+
const next = TEXT_ALIGNS[(TEXT_ALIGNS.indexOf(align) + 1) % TEXT_ALIGNS.length];
|
|
20
|
+
const t = useMessages();
|
|
21
|
+
const tiles = useBarTiles();
|
|
22
|
+
const label = t.topBar.textAlign[align];
|
|
23
|
+
const Icon = ICONS[align];
|
|
24
|
+
// Als Kachel steht „Ausrichtung“ darunter; der Name beginnt mit dem Wort.
|
|
25
|
+
const name = tiles ? `${t.topBar.tiles.textAlign}: ${label}` : t.topBar.textAlignLabel(label);
|
|
26
|
+
return (_jsxs("button", { type: "button", className: tiles ? TILE : ICON_BTN, onClick: () => onAlignChange(next), title: name, "aria-label": name, children: [_jsx(Icon, { size: 18, "aria-hidden": true }), _jsx(TileCaption, { children: t.topBar.tiles.textAlign })] }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type Konva from 'konva';
|
|
2
|
+
/**
|
|
3
|
+
* Angle / size badge while a Transformer is dragged. Sits in the DOM beside
|
|
4
|
+
* the stage, so no export ever captures it. Updated imperatively from a
|
|
5
|
+
* rAF-coalesced stage listener: no React state, no store writes per frame.
|
|
6
|
+
* Node frames are read inside the logical group, i.e. already in logical px.
|
|
7
|
+
*/
|
|
8
|
+
export declare function TransformHud({ stageRef, enabled, }: {
|
|
9
|
+
stageRef: React.RefObject<Konva.Stage | null>;
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { readNodeFrame } from '../utils/orientation.js';
|
|
5
|
+
import { transformHudLabel } from '../utils/transformHudLabel.js';
|
|
6
|
+
const GAP = 12;
|
|
7
|
+
/**
|
|
8
|
+
* Angle / size badge while a Transformer is dragged. Sits in the DOM beside
|
|
9
|
+
* the stage, so no export ever captures it. Updated imperatively from a
|
|
10
|
+
* rAF-coalesced stage listener: no React state, no store writes per frame.
|
|
11
|
+
* Node frames are read inside the logical group, i.e. already in logical px.
|
|
12
|
+
*/
|
|
13
|
+
export function TransformHud({ stageRef, enabled, }) {
|
|
14
|
+
const badgeRef = useRef(null);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
const stage = stageRef.current;
|
|
17
|
+
const badge = badgeRef.current;
|
|
18
|
+
if (!stage || !badge || !enabled)
|
|
19
|
+
return;
|
|
20
|
+
let raf = 0;
|
|
21
|
+
let active = null;
|
|
22
|
+
const attached = new Set();
|
|
23
|
+
const hide = () => {
|
|
24
|
+
if (raf)
|
|
25
|
+
cancelAnimationFrame(raf);
|
|
26
|
+
raf = 0;
|
|
27
|
+
active = null;
|
|
28
|
+
badge.style.display = 'none';
|
|
29
|
+
};
|
|
30
|
+
const paint = () => {
|
|
31
|
+
raf = 0;
|
|
32
|
+
const tr = active;
|
|
33
|
+
const anchor = tr?.getActiveAnchor() ?? null;
|
|
34
|
+
const nodes = tr?.nodes() ?? [];
|
|
35
|
+
if (!tr || nodes.length === 0)
|
|
36
|
+
return;
|
|
37
|
+
let frame;
|
|
38
|
+
if (nodes.length === 1) {
|
|
39
|
+
frame = readNodeFrame(nodes[0]);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
// The transformer box is in absolute px; the nodes live in the logical
|
|
43
|
+
// group, so divide by that group's absolute scale to get logical px.
|
|
44
|
+
const abs = nodes[0].getParent()?.getAbsoluteScale() ?? { x: 1, y: 1 };
|
|
45
|
+
frame = {
|
|
46
|
+
x: 0,
|
|
47
|
+
y: 0,
|
|
48
|
+
rotation: tr.rotation(),
|
|
49
|
+
scaleX: 1,
|
|
50
|
+
scaleY: 1,
|
|
51
|
+
offsetX: 0,
|
|
52
|
+
offsetY: 0,
|
|
53
|
+
local: { x: 0, y: 0, width: tr.width() / abs.x, height: tr.height() / abs.y },
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const label = transformHudLabel(anchor, frame, 1);
|
|
57
|
+
if (!label) {
|
|
58
|
+
badge.style.display = 'none';
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const rect = tr.getClientRect();
|
|
62
|
+
const host = badge.parentElement;
|
|
63
|
+
const hostWidth = host?.getBoundingClientRect().width ?? 0;
|
|
64
|
+
const css = stage.width() && hostWidth ? hostWidth / stage.width() : 1;
|
|
65
|
+
badge.textContent = label;
|
|
66
|
+
badge.style.display = 'block';
|
|
67
|
+
// Konva px -> container px; the badge itself is counter-scaled so it
|
|
68
|
+
// keeps its size under the page zoom.
|
|
69
|
+
const w = badge.offsetWidth;
|
|
70
|
+
const h = badge.offsetHeight;
|
|
71
|
+
// Rotating: the angle sits at the pointer (Canva pattern); resizing: below the box.
|
|
72
|
+
const pointer = anchor === 'rotater' ? stage.getPointerPosition() : null;
|
|
73
|
+
if (pointer) {
|
|
74
|
+
const x = Math.min(pointer.x + GAP / css, stage.width() - w / css);
|
|
75
|
+
const y = Math.min(pointer.y + GAP / css, stage.height() - h / css);
|
|
76
|
+
badge.style.transform = `translate(${Math.max(0, x)}px, ${Math.max(0, y)}px) scale(${1 / css})`;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const left = Math.min(Math.max(rect.x + rect.width / 2, w / (2 * css)), stage.width() - w / (2 * css));
|
|
80
|
+
const below = rect.y + rect.height + GAP / css;
|
|
81
|
+
const top = below + h / css > stage.height() ? rect.y - GAP / css - h / css : below;
|
|
82
|
+
badge.style.transform =
|
|
83
|
+
`translate(${left}px, ${Math.max(0, top)}px) ` + `scale(${1 / css}) translate(-50%, 0)`;
|
|
84
|
+
};
|
|
85
|
+
const onTransform = (tr) => {
|
|
86
|
+
active = tr;
|
|
87
|
+
if (!raf)
|
|
88
|
+
raf = requestAnimationFrame(paint);
|
|
89
|
+
};
|
|
90
|
+
// Konva fires transform / transformend on the Transformer and its nodes
|
|
91
|
+
// without bubbling, so the stage never sees them. Transformers come and go
|
|
92
|
+
// with the selection, so (re)attach to all of them on each press, which
|
|
93
|
+
// always precedes a transform.
|
|
94
|
+
const attach = () => {
|
|
95
|
+
for (const tr of attached)
|
|
96
|
+
if (!tr.getStage())
|
|
97
|
+
attached.delete(tr);
|
|
98
|
+
for (const tr of stage.find('Transformer')) {
|
|
99
|
+
if (attached.has(tr))
|
|
100
|
+
continue;
|
|
101
|
+
attached.add(tr);
|
|
102
|
+
tr.on('transform.hud', () => onTransform(tr));
|
|
103
|
+
tr.on('transformend.hud', hide);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
const container = stage.container();
|
|
107
|
+
attach();
|
|
108
|
+
container.addEventListener('pointerdown', attach, true);
|
|
109
|
+
container.addEventListener('touchstart', attach, true);
|
|
110
|
+
return () => {
|
|
111
|
+
container.removeEventListener('pointerdown', attach, true);
|
|
112
|
+
container.removeEventListener('touchstart', attach, true);
|
|
113
|
+
attached.forEach((tr) => {
|
|
114
|
+
tr.off('transform.hud');
|
|
115
|
+
tr.off('transformend.hud');
|
|
116
|
+
});
|
|
117
|
+
hide();
|
|
118
|
+
};
|
|
119
|
+
}, [stageRef, enabled]);
|
|
120
|
+
return (_jsx("div", { ref: badgeRef, "aria-hidden": "true", className: "pointer-events-none absolute left-0 top-0 z-10 whitespace-nowrap rounded-md bg-[var(--editor-text)] px-2 py-1 text-[11px] font-medium tabular-nums text-[var(--editor-surface)] shadow-[0_2px_8px_rgba(0,0,0,0.12)]", style: { display: 'none', transformOrigin: '0 0' } }));
|
|
121
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type OfferedMarks, type TextFormatVariant } from './TextFormatButtons.js';
|
|
2
|
+
export interface WholeTextFormatControlsProps {
|
|
3
|
+
/** Der gespeicherte Text des Feldes. */
|
|
4
|
+
text: string;
|
|
5
|
+
marks: OfferedMarks;
|
|
6
|
+
/** Nimmt den ganzen neuen Text; wird nicht gerufen, wenn der Klick nichts ändert. */
|
|
7
|
+
onChange: (text: string) => void;
|
|
8
|
+
variant?: TextFormatVariant;
|
|
9
|
+
}
|
|
10
|
+
export declare function WholeTextFormatControls({ text, marks, onChange, variant, }: WholeTextFormatControlsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
/**
|
|
4
|
+
* WholeTextFormatControls — dieselben Knöpfe wie im Editor (`TextFormatButtons`),
|
|
5
|
+
* für einen Text, der nur ausgewählt ist. Es gibt keine Auswahl IM Text, also
|
|
6
|
+
* gilt jeder Klick für den ganzen Text: ein Knopf steht, wenn der ganze Text die
|
|
7
|
+
* Auszeichnung trägt, und der nächste Klick nimmt sie ihm wieder.
|
|
8
|
+
*
|
|
9
|
+
* Gelesen und geschrieben wird der gespeicherte Feldtext
|
|
10
|
+
* (`@ggraphic/schema`, `wholeTextFormat.ts`); es braucht keinen Editor und kein
|
|
11
|
+
* tiptap. Der Wirt schreibt das Ergebnis in einem Schritt zurück.
|
|
12
|
+
*/
|
|
13
|
+
import { setWholeTextList, setWholeTextMark, wholeTextCanOrderedList, wholeTextFormat, } from '@ggraphic/schema';
|
|
14
|
+
import { useMemo } from 'react';
|
|
15
|
+
import { TextFormatButtons, } from './TextFormatButtons.js';
|
|
16
|
+
export function WholeTextFormatControls({ text, marks, onChange, variant = 'contextBar', }) {
|
|
17
|
+
const state = useMemo(() => wholeTextFormat(text), [text]);
|
|
18
|
+
const commands = useMemo(() => {
|
|
19
|
+
const write = (next) => {
|
|
20
|
+
if (next !== text)
|
|
21
|
+
onChange(next);
|
|
22
|
+
};
|
|
23
|
+
const toggle = (mark, on) => write(setWholeTextMark(text, mark, !on));
|
|
24
|
+
return {
|
|
25
|
+
toggleBold: () => toggle('bold', state.bold),
|
|
26
|
+
toggleItalic: () => toggle('italic', state.italic),
|
|
27
|
+
toggleUnderline: () => toggle('underline', state.underline),
|
|
28
|
+
setAccent: (color) => write(setWholeTextMark(text, 'accent', true, color)),
|
|
29
|
+
removeAccent: () => write(setWholeTextMark(text, 'accent', false)),
|
|
30
|
+
setMarker: (color) => write(setWholeTextMark(text, 'marker', true, color)),
|
|
31
|
+
removeMarker: () => write(setWholeTextMark(text, 'marker', false)),
|
|
32
|
+
toggleBulletList: () => write(setWholeTextList(text, state.bulletList ? null : 'bullet')),
|
|
33
|
+
toggleOrderedList: () => write(setWholeTextList(text, state.orderedList ? null : 'ordered')),
|
|
34
|
+
};
|
|
35
|
+
}, [text, state, onChange]);
|
|
36
|
+
return (_jsx(TextFormatButtons, { state: state, commands: commands, marks: marks, variant: variant, orderedListDisabled: !state.orderedList && !wholeTextCanOrderedList(text) }));
|
|
37
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function ZoomableViewport({ children }) {
|
|
3
|
+
return (_jsx("div", { className: "zoomable-viewport-wrapper flex flex-col w-full flex-1 min-h-0", children: _jsx("div", { className: "zoomable-viewport-container flex-1 min-h-0 flex items-center justify-center overflow-hidden p-1 max-canvas-mobile:items-start", children: _jsx("div", { className: "select-none block w-fit relative", children: children }) }) }));
|
|
4
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Die tiptap-Mark zu `==Akzent==`. Sie steht in JEDEM Feld im Schema — ein
|
|
3
|
+
* Dokument mit einer unbekannten Mark lässt ProseMirror werfen, und tiptap
|
|
4
|
+
* setzt dann ein leeres Dokument (siehe `markExtension` in `RichTextField`).
|
|
5
|
+
* Ohne eigene Farbe entscheidet der Text, wie der Akzent aussieht
|
|
6
|
+
* (`TextAccent`); im Editor zeigen ihn die CSS-Variablen, die das Overlay setzt.
|
|
7
|
+
* Mit Farbe (`=={#E6007E}…==`) trägt die Mark sie selbst als `--mark-color`.
|
|
8
|
+
*/
|
|
9
|
+
import { Mark } from '@tiptap/core';
|
|
10
|
+
declare module '@tiptap/core' {
|
|
11
|
+
interface Commands<ReturnType> {
|
|
12
|
+
accent: {
|
|
13
|
+
toggleAccent: () => ReturnType;
|
|
14
|
+
/** Setzt den Akzent; `null` = Farbe der Vorlage. */
|
|
15
|
+
setAccent: (color: string | null) => ReturnType;
|
|
16
|
+
unsetAccent: () => ReturnType;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export declare const Accent: Mark<any, any>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Die tiptap-Mark zu `==Akzent==`. Sie steht in JEDEM Feld im Schema — ein
|
|
4
|
+
* Dokument mit einer unbekannten Mark lässt ProseMirror werfen, und tiptap
|
|
5
|
+
* setzt dann ein leeres Dokument (siehe `markExtension` in `RichTextField`).
|
|
6
|
+
* Ohne eigene Farbe entscheidet der Text, wie der Akzent aussieht
|
|
7
|
+
* (`TextAccent`); im Editor zeigen ihn die CSS-Variablen, die das Overlay setzt.
|
|
8
|
+
* Mit Farbe (`=={#E6007E}…==`) trägt die Mark sie selbst als `--mark-color`.
|
|
9
|
+
*/
|
|
10
|
+
import { Mark } from '@tiptap/core';
|
|
11
|
+
import { colorAttribute } from './markColor.js';
|
|
12
|
+
export const Accent = Mark.create({
|
|
13
|
+
name: 'accent',
|
|
14
|
+
addAttributes: () => ({ color: colorAttribute('--mark-color') }),
|
|
15
|
+
parseHTML: () => [{ tag: 'mark[data-accent]' }],
|
|
16
|
+
renderHTML: ({ HTMLAttributes }) => ['mark', { 'data-accent': '', ...HTMLAttributes }, 0],
|
|
17
|
+
addCommands() {
|
|
18
|
+
return {
|
|
19
|
+
toggleAccent: () => ({ commands }) => commands.toggleMark(this.name),
|
|
20
|
+
setAccent: (color) => ({ commands }) => commands.setMark(this.name, { color }),
|
|
21
|
+
unsetAccent: () => ({ commands }) => commands.unsetMark(this.name),
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ob das Element, in dem ein Primitiv steckt, gesperrt ist. `CanvasRenderLayer`
|
|
3
|
+
* setzt den Wert je Element; ein Context statt einer Eigenschaft, weil die
|
|
4
|
+
* Primitive eigene `memo`-Vergleiche haben und eine neue Eigenschaft in jedem
|
|
5
|
+
* nachgezogen werden müsste. Umschalten rendert nur das betroffene Element neu.
|
|
6
|
+
*/
|
|
7
|
+
export declare const CanvasItemLockContext: import("react").Context<boolean>;
|
|
8
|
+
export declare const useIsItemLocked: () => boolean;
|
|
9
|
+
/** Über die Transformer-Eigenschaften eines gesperrten Elements gelegt: keine Griffe. */
|
|
10
|
+
export declare const LOCKED_TRANSFORMER: {
|
|
11
|
+
readonly resizeEnabled: false;
|
|
12
|
+
readonly rotateEnabled: false;
|
|
13
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Ob das Element, in dem ein Primitiv steckt, gesperrt ist. `CanvasRenderLayer`
|
|
5
|
+
* setzt den Wert je Element; ein Context statt einer Eigenschaft, weil die
|
|
6
|
+
* Primitive eigene `memo`-Vergleiche haben und eine neue Eigenschaft in jedem
|
|
7
|
+
* nachgezogen werden müsste. Umschalten rendert nur das betroffene Element neu.
|
|
8
|
+
*/
|
|
9
|
+
export const CanvasItemLockContext = createContext(false);
|
|
10
|
+
export const useIsItemLocked = () => useContext(CanvasItemLockContext);
|
|
11
|
+
/** Über die Transformer-Eigenschaften eines gesperrten Elements gelegt: keine Griffe. */
|
|
12
|
+
export const LOCKED_TRANSFORMER = { resizeEnabled: false, rotateEnabled: false };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type GeometryReporter } from '@ggraphic/editor/hooks/useGeometryReporter';
|
|
3
|
+
import type { OptionalCanvasActions } from '../hooks/useCanvasElementHandlers.js';
|
|
4
|
+
import type { CanvasItem } from '../utils/canvasLayerManager.js';
|
|
5
|
+
import type { HostElementKindName } from '../utils/canvasItem.js';
|
|
6
|
+
import type { CropAspectId } from '@ggraphic/editor/utils/cropAspect';
|
|
7
|
+
import type { FrameInstance } from '@ggraphic/editor/utils/frameUtils';
|
|
8
|
+
import type { ShapeInstance } from '@ggraphic/editor/utils/shapes';
|
|
9
|
+
import type { SnapLine, SnapTarget } from '@ggraphic/editor/utils/snapping';
|
|
10
|
+
import type { UserImageInstance } from '@ggraphic/editor/utils/userImageUtils';
|
|
11
|
+
type KindName = Exclude<CanvasItem['type'], 'element'>;
|
|
12
|
+
/**
|
|
13
|
+
* Optional properties that may exist on canvas state for different element types
|
|
14
|
+
*/
|
|
15
|
+
export interface OptionalCanvasStateProperties {
|
|
16
|
+
selectedIcons?: string[];
|
|
17
|
+
iconStates?: Record<string, {
|
|
18
|
+
x?: number;
|
|
19
|
+
y?: number;
|
|
20
|
+
scale?: number;
|
|
21
|
+
rotation?: number;
|
|
22
|
+
color?: string;
|
|
23
|
+
opacity?: number;
|
|
24
|
+
iconId?: string;
|
|
25
|
+
svg?: string;
|
|
26
|
+
flipX?: boolean;
|
|
27
|
+
flipY?: boolean;
|
|
28
|
+
}>;
|
|
29
|
+
}
|
|
30
|
+
/** Additional text element attributes */
|
|
31
|
+
interface AdditionalTextAttrs {
|
|
32
|
+
text?: string;
|
|
33
|
+
x?: number;
|
|
34
|
+
y?: number;
|
|
35
|
+
width?: number;
|
|
36
|
+
scale?: number;
|
|
37
|
+
rotation?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface CanvasRenderHandlers {
|
|
40
|
+
/** The config's actions, for the renderers of the host's kinds (`registerKindRenderers`). */
|
|
41
|
+
actions: OptionalCanvasActions;
|
|
42
|
+
handleElementSelect: (id: string) => void;
|
|
43
|
+
handleTextChange: (id: string, text: string) => void;
|
|
44
|
+
handleFontSizeChange: (id: string, size: number) => void;
|
|
45
|
+
handleElementPositionChange: (id: string, x: number, y: number, w: number, h: number) => void;
|
|
46
|
+
handleImageDragEnd: (id: string, x: number, y: number) => void;
|
|
47
|
+
handleImageTransformEnd: (id: string, x: number, y: number, w: number, h: number, rotation: number) => void;
|
|
48
|
+
handleTemplateTransformEnd: (id: string, x: number, y: number, rotation: number) => void;
|
|
49
|
+
handleIconDragEnd: (id: string, x: number, y: number) => void;
|
|
50
|
+
handleIconTransformEnd: (id: string, x: number, y: number, scale: number, rotation: number) => void;
|
|
51
|
+
handleShapeChange: (id: string, newAttrs: Partial<ShapeInstance>) => void;
|
|
52
|
+
handleAdditionalTextChange: (id: string, newAttrs: AdditionalTextAttrs) => void;
|
|
53
|
+
/** The size a text edit in progress fits at, shown on the page; see `UseCanvasElementHandlersResult`. */
|
|
54
|
+
handleAdditionalTextPreview?: (id: string, draft: string | null) => number | null;
|
|
55
|
+
handleCircleBadgeSelect: (id: string) => void;
|
|
56
|
+
handleCircleBadgeDragEnd: (id: string, x: number, y: number) => void;
|
|
57
|
+
handleCircleBadgeTransformEnd: (id: string, x: number, y: number, scale: number, rotation: number) => void;
|
|
58
|
+
handleCircleBadgeTextLineChange: (id: string, lineIndex: number, text: string) => void;
|
|
59
|
+
handlePillBadgeSelect: (id: string) => void;
|
|
60
|
+
handlePillBadgeTextChange: (id: string, text: string) => void;
|
|
61
|
+
handlePillBadgeDragEnd: (id: string, x: number, y: number) => void;
|
|
62
|
+
handlePillBadgeTransformEnd: (id: string, x: number, y: number, scale: number, rotation: number) => void;
|
|
63
|
+
handleAssetDragEnd: (id: string, x: number, y: number) => void;
|
|
64
|
+
handleAssetTransformEnd: (id: string, x: number, y: number, scale: number, rotation: number) => void;
|
|
65
|
+
handleIllustrationDragEnd: (id: string, x: number, y: number) => void;
|
|
66
|
+
handleIllustrationTransformEnd: (id: string, x: number, y: number, scale: number, rotation: number) => void;
|
|
67
|
+
handleFrameChange: (id: string, newAttrs: Partial<FrameInstance>) => void;
|
|
68
|
+
handleFrameImageUpload: (id: string, file: File, objectUrl: string) => void;
|
|
69
|
+
handleUserImageDragEnd: (id: string, x: number, y: number) => void;
|
|
70
|
+
handleUserImageCropEnd: (id: string, patch: Partial<UserImageInstance>) => void;
|
|
71
|
+
handleUserImageTransformEnd: (id: string, x: number, y: number, width: number, height: number, rotation: number) => void;
|
|
72
|
+
handleChartDragEnd: (id: string, x: number, y: number) => void;
|
|
73
|
+
handleChartTransformEnd: (id: string, x: number, y: number, scale: number, rotation: number) => void;
|
|
74
|
+
}
|
|
75
|
+
/** What a kind's renderer reads from the layer: its props plus the crop state of the store. */
|
|
76
|
+
export interface RenderCtx {
|
|
77
|
+
state: Record<string, unknown>;
|
|
78
|
+
handlers: CanvasRenderHandlers;
|
|
79
|
+
getSnapTargets: (id: string) => SnapTarget[];
|
|
80
|
+
registerGeometry: GeometryReporter;
|
|
81
|
+
handleSnapChange: (h: boolean, v: boolean) => void;
|
|
82
|
+
setSnapLines: (lines: SnapLine[]) => void;
|
|
83
|
+
stageWidth: number;
|
|
84
|
+
stageHeight: number;
|
|
85
|
+
isFontAvailable?: boolean;
|
|
86
|
+
croppingElement: string | null;
|
|
87
|
+
setCroppingElement: (id: string | null) => void;
|
|
88
|
+
cropAspect: CropAspectId;
|
|
89
|
+
/** The page this item is drawn on, from 1; absent for a canvas that is no page of a deck. */
|
|
90
|
+
pageNumber?: number;
|
|
91
|
+
}
|
|
92
|
+
export declare function createSelectableWrapper<P extends object>(Component: React.ComponentType<P>, propName?: 'selected' | 'isSelected'): React.MemoExoticComponent<({ elementId, ...rest }: Omit<P, "isSelected" | "selected"> & {
|
|
93
|
+
elementId: string;
|
|
94
|
+
}) => React.JSX.Element>;
|
|
95
|
+
/** How one kind is drawn: its item from the layer list, and the layer's context. */
|
|
96
|
+
export type KindRenderer<K extends KindName> = (item: Extract<CanvasItem, {
|
|
97
|
+
type: K;
|
|
98
|
+
}>, ctx: RenderCtx) => React.ReactNode;
|
|
99
|
+
type KindRenderers = {
|
|
100
|
+
[K in Exclude<KindName, HostElementKindName>]: KindRenderer<K>;
|
|
101
|
+
};
|
|
102
|
+
/** The renderers a host supplies for its own kinds (`HostElementKinds`, `registerElementKind`). */
|
|
103
|
+
export type HostKindRenderers = {
|
|
104
|
+
[K in HostElementKindName]?: KindRenderer<K>;
|
|
105
|
+
};
|
|
106
|
+
/** The host's renderers, installed once at startup; replaces the ones before. */
|
|
107
|
+
export declare function registerKindRenderers(renderers: HostKindRenderers): void;
|
|
108
|
+
/**
|
|
109
|
+
* How each core element kind is drawn. Keyed by kind, so a kind added to
|
|
110
|
+
* `ELEMENT_KINDS` does not compile until it has a renderer here; a host's
|
|
111
|
+
* kinds are drawn by `registerKindRenderers`.
|
|
112
|
+
*/
|
|
113
|
+
export declare const KIND_RENDERERS: KindRenderers;
|
|
114
|
+
/** Draws one item of a kind through its table entry, or the host's renderer. */
|
|
115
|
+
export declare function renderKindItem(item: Exclude<CanvasItem, {
|
|
116
|
+
type: 'element';
|
|
117
|
+
}>, ctx: RenderCtx): React.ReactNode;
|
|
118
|
+
export {};
|