@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,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The colours a picker offers come from the active brand pack. Pickers read
|
|
3
|
+
* them as `ColorOption`s; the mapping is cached per pack, so a picker gets the
|
|
4
|
+
* same array on every render.
|
|
5
|
+
*/
|
|
6
|
+
import { type BindingRef, type BrandPack, type BrandSwatch } from '@ggraphic/core';
|
|
7
|
+
/** One entry of a colour picker. */
|
|
8
|
+
export interface ColorOption {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
value: string;
|
|
12
|
+
/** The role the swatch stands for; picking it binds the field to the brand. */
|
|
13
|
+
ref?: BindingRef;
|
|
14
|
+
}
|
|
15
|
+
/** A pack's swatches as picker entries, the same array for the same pack. */
|
|
16
|
+
export declare function asColorOptions(swatches: readonly BrandSwatch[]): ColorOption[];
|
|
17
|
+
/** The active brand's colours, as every colour picker offers them. */
|
|
18
|
+
export declare const brandColors: (brand?: BrandPack) => ColorOption[];
|
|
19
|
+
/** The active brand's text colours. */
|
|
20
|
+
export declare const fontColors: (brand?: BrandPack) => ColorOption[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { activeBrand } from '@ggraphic/editor/brand/brandRegistry';
|
|
2
|
+
const pickerOptions = new WeakMap();
|
|
3
|
+
/** A pack's swatches as picker entries, the same array for the same pack. */
|
|
4
|
+
export function asColorOptions(swatches) {
|
|
5
|
+
let options = pickerOptions.get(swatches);
|
|
6
|
+
if (!options) {
|
|
7
|
+
options = swatches.map(({ id, label, color, ref }) => ({
|
|
8
|
+
id,
|
|
9
|
+
name: label,
|
|
10
|
+
value: color,
|
|
11
|
+
...(ref && { ref }),
|
|
12
|
+
}));
|
|
13
|
+
pickerOptions.set(swatches, options);
|
|
14
|
+
}
|
|
15
|
+
return options;
|
|
16
|
+
}
|
|
17
|
+
/** The active brand's colours, as every colour picker offers them. */
|
|
18
|
+
export const brandColors = (brand = activeBrand()) => asColorOptions(brand.palette);
|
|
19
|
+
/** The active brand's text colours. */
|
|
20
|
+
export const fontColors = (brand = activeBrand()) => asColorOptions(brand.textPalette);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Corners, type CornerRadius } from '@ggraphic/core';
|
|
2
|
+
export { type Corners, type CornerRadius } from '@ggraphic/core';
|
|
3
|
+
/** The four radii of `radius` on a `width` × `height` box, each clamped to half the short side. */
|
|
4
|
+
export declare function cornersOf(radius: CornerRadius | undefined, width: number, height: number): Corners;
|
|
5
|
+
/** Whether any corner is rounded. */
|
|
6
|
+
export declare function hasCorners(radius: CornerRadius | undefined): boolean;
|
|
7
|
+
/** Traces a rounded box from the origin, clockwise from the top-left corner's end. */
|
|
8
|
+
export declare function traceRoundedRect(ctx: {
|
|
9
|
+
moveTo(x: number, y: number): void;
|
|
10
|
+
arcTo(x1: number, y1: number, x2: number, y2: number, r: number): void;
|
|
11
|
+
closePath(): void;
|
|
12
|
+
}, width: number, height: number, [tl, tr, br, bl]: Corners): void;
|
|
13
|
+
/** Whether two radii describe the same corners (lists compare by value, for memo checks). */
|
|
14
|
+
export declare function sameCorners(a: CornerRadius | undefined, b: CornerRadius | undefined): boolean;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** The four radii of `radius` on a `width` × `height` box, each clamped to half the short side. */
|
|
2
|
+
export function cornersOf(radius, width, height) {
|
|
3
|
+
const limit = Math.min(width, height) / 2;
|
|
4
|
+
const fit = (r) => (typeof r === 'number' && r > 0 ? Math.min(r, limit) : 0);
|
|
5
|
+
return Array.isArray(radius)
|
|
6
|
+
? [fit(radius[0]), fit(radius[1]), fit(radius[2]), fit(radius[3])]
|
|
7
|
+
: [fit(radius), fit(radius), fit(radius), fit(radius)];
|
|
8
|
+
}
|
|
9
|
+
/** Whether any corner is rounded. */
|
|
10
|
+
export function hasCorners(radius) {
|
|
11
|
+
return Array.isArray(radius) ? radius.some((r) => r > 0) : (radius ?? 0) > 0;
|
|
12
|
+
}
|
|
13
|
+
/** Traces a rounded box from the origin, clockwise from the top-left corner's end. */
|
|
14
|
+
export function traceRoundedRect(ctx, width, height, [tl, tr, br, bl]) {
|
|
15
|
+
ctx.moveTo(tl, 0);
|
|
16
|
+
ctx.arcTo(width, 0, width, height, tr);
|
|
17
|
+
ctx.arcTo(width, height, 0, height, br);
|
|
18
|
+
ctx.arcTo(0, height, 0, 0, bl);
|
|
19
|
+
ctx.arcTo(0, 0, width, 0, tl);
|
|
20
|
+
ctx.closePath();
|
|
21
|
+
}
|
|
22
|
+
/** Whether two radii describe the same corners (lists compare by value, for memo checks). */
|
|
23
|
+
export function sameCorners(a, b) {
|
|
24
|
+
if (Array.isArray(a) && Array.isArray(b))
|
|
25
|
+
return a.every((r, i) => r === b[i]);
|
|
26
|
+
return a === b;
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Seam for "this bar occupies a screen corner" reporting. The editor measures
|
|
4
|
+
* its bottom bar, but who else wants to stay clear of it (floating buttons,
|
|
5
|
+
* feedback widgets) is the host's business: the host registers the hook that
|
|
6
|
+
* feeds its own corner registry. Unregistered, the call does nothing. A hook
|
|
7
|
+
* behind a module-level register is safe as long as it is registered once
|
|
8
|
+
* at start-up, before any render.
|
|
9
|
+
*/
|
|
10
|
+
export type ScreenCorner = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
11
|
+
export interface MeasuredCornerReservation {
|
|
12
|
+
corner: ScreenCorner | readonly ScreenCorner[];
|
|
13
|
+
axis: 'vertical' | 'horizontal';
|
|
14
|
+
blocked?: boolean;
|
|
15
|
+
active?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export type MeasuredCornerReservationHook = (ref: React.RefObject<HTMLElement | null>, options: MeasuredCornerReservation) => void;
|
|
18
|
+
export declare function registerMeasuredCornerReservation(impl: MeasuredCornerReservationHook): void;
|
|
19
|
+
export declare function useMeasuredCornerReservation(ref: React.RefObject<HTMLElement | null>, options: MeasuredCornerReservation): void;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cover-fitted photos (Canva model): the whole photo keeps its aspect, a frame
|
|
3
|
+
* shows part of it, and moving or zooming the photo never opens a gap in the
|
|
4
|
+
* frame. Every placement is expressed as the rectangle the *whole* photo
|
|
5
|
+
* occupies; the drawn node is that rectangle cut to the frame.
|
|
6
|
+
*/
|
|
7
|
+
export interface Rect {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}
|
|
13
|
+
export interface Size {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
}
|
|
17
|
+
/** A photo mirrored by the flip filter (`flipX` / `flipY`). */
|
|
18
|
+
export interface Mirror {
|
|
19
|
+
x?: boolean;
|
|
20
|
+
y?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The whole photo around `window`, a box with its own aspect that shows the
|
|
24
|
+
* photo's centred, aspect-matched part (the legacy background model): the
|
|
25
|
+
* window widened along the axis where the photo has more.
|
|
26
|
+
*/
|
|
27
|
+
export declare function photoRectAround(natural: Size, window: Rect): Rect;
|
|
28
|
+
/** Inverse of `photoRectAround`: the centred box of `aspect` (width / height) that fits in `photo`. */
|
|
29
|
+
export declare function windowInPhoto(photo: Rect, aspect: number): Rect;
|
|
30
|
+
/**
|
|
31
|
+
* The whole photo inside `frame` at `zoom` (1 = just covers), centred and then
|
|
32
|
+
* moved by `offset` — the model `FramePrimitive` uses.
|
|
33
|
+
*/
|
|
34
|
+
export declare function coverPhotoRect(natural: Size, frame: Size, zoom?: number, offset?: {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
}): Rect;
|
|
38
|
+
/**
|
|
39
|
+
* A `cover` photo in a frame (frame-local px), moved by `pan`: a share of its
|
|
40
|
+
* overhang on each axis, -1 … 1 from one edge to the other, 0 centred. Being a
|
|
41
|
+
* share, the chosen part survives a resize of the frame, and no pan in range
|
|
42
|
+
* can open a gap.
|
|
43
|
+
*/
|
|
44
|
+
export declare function framedPhotoRect(natural: Size, frame: Size, pan?: {
|
|
45
|
+
x: number;
|
|
46
|
+
y: number;
|
|
47
|
+
}, zoom?: number): Rect;
|
|
48
|
+
/** Inverse of `framedPhotoRect`: the pan that puts the photo at `photo.x` / `photo.y`. */
|
|
49
|
+
export declare function panOfFramedPhoto(photo: Rect, frame: Size): {
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* The drawn part: where `photo` overlaps `frame`, and which source pixels that
|
|
55
|
+
* is (Konva `crop`). Null when nothing overlaps.
|
|
56
|
+
*/
|
|
57
|
+
export declare function visiblePart(natural: Size, photo: Rect, frame: Rect, mirror?: Mirror | null): {
|
|
58
|
+
box: Rect;
|
|
59
|
+
crop: Rect;
|
|
60
|
+
} | null;
|
|
61
|
+
/**
|
|
62
|
+
* Keeps a moved photo covering `frame`. A photo that did not cover the frame
|
|
63
|
+
* to begin with (an old composer strip under a colour panel) may still move
|
|
64
|
+
* between where it was and the covering range — it is never yanked across.
|
|
65
|
+
*/
|
|
66
|
+
export declare function clampPan(from: Rect, dx: number, dy: number, frame: Rect): {
|
|
67
|
+
dx: number;
|
|
68
|
+
dy: number;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Where a window-placed photo may show. A photo that fills the frame shows
|
|
72
|
+
* across all of it. One that does not (an old composer strip pushed under a
|
|
73
|
+
* colour panel, a photo zoomed below 100 %) keeps drawing only inside its
|
|
74
|
+
* window, so saved designs look as they always did.
|
|
75
|
+
*/
|
|
76
|
+
export declare function shownArea(natural: Size, window: Rect, frame: Rect): Rect;
|
|
77
|
+
/**
|
|
78
|
+
* Moves a window-placed photo by (dx, dy) inside `slot` and returns the move
|
|
79
|
+
* it allows plus what to draw. A photo that covers the slot pans across its
|
|
80
|
+
* whole overhang. An old one that does not keeps its window over the area it
|
|
81
|
+
* shows, so no drag can open a gap there.
|
|
82
|
+
*/
|
|
83
|
+
export declare function panWindowPhoto(natural: Size, window: Rect, slot: Rect, dx: number, dy: number, mirror?: Mirror | null): {
|
|
84
|
+
dx: number;
|
|
85
|
+
dy: number;
|
|
86
|
+
part: {
|
|
87
|
+
box: Rect;
|
|
88
|
+
crop: Rect;
|
|
89
|
+
} | null;
|
|
90
|
+
};
|
|
91
|
+
/** Whether `photo` fills `frame` completely. */
|
|
92
|
+
export declare function covers(photo: Rect, frame: Rect, epsilon?: number): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* A window scaled by `factor` about the middle of the slot (what the viewer
|
|
95
|
+
* sees stays centred), never smaller than the slot (100 %), and held over the
|
|
96
|
+
* slot so the zoom cannot open a gap.
|
|
97
|
+
*/
|
|
98
|
+
export declare function zoomWindow(window: Rect, factor: number, slot: Rect): Rect;
|
|
99
|
+
/**
|
|
100
|
+
* `zoomWindow` for a background's `imageOffset` / `imageScale` over a slot at
|
|
101
|
+
* the origin. A `centerZoom` slot anchors its window on its own middle.
|
|
102
|
+
*/
|
|
103
|
+
export declare function zoomBackground(current: {
|
|
104
|
+
imageOffset?: {
|
|
105
|
+
x: number;
|
|
106
|
+
y: number;
|
|
107
|
+
} | null;
|
|
108
|
+
imageScale?: number | null;
|
|
109
|
+
}, nextScale: number, slot: Size, centerZoom?: boolean,
|
|
110
|
+
/** The part of the slot the photo fills, when not all of it (a composer strip). */
|
|
111
|
+
frame?: Rect | null): {
|
|
112
|
+
imageOffset: {
|
|
113
|
+
x: number;
|
|
114
|
+
y: number;
|
|
115
|
+
};
|
|
116
|
+
imageScale: number;
|
|
117
|
+
};
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Cover-fitted photos (Canva model): the whole photo keeps its aspect, a frame
|
|
4
|
+
* shows part of it, and moving or zooming the photo never opens a gap in the
|
|
5
|
+
* frame. Every placement is expressed as the rectangle the *whole* photo
|
|
6
|
+
* occupies; the drawn node is that rectangle cut to the frame.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The whole photo around `window`, a box with its own aspect that shows the
|
|
10
|
+
* photo's centred, aspect-matched part (the legacy background model): the
|
|
11
|
+
* window widened along the axis where the photo has more.
|
|
12
|
+
*/
|
|
13
|
+
export function photoRectAround(natural, window) {
|
|
14
|
+
const photoAspect = natural.width / natural.height;
|
|
15
|
+
const windowAspect = window.width / window.height;
|
|
16
|
+
if (photoAspect > windowAspect) {
|
|
17
|
+
const width = window.height * photoAspect;
|
|
18
|
+
return { x: window.x - (width - window.width) / 2, y: window.y, width, height: window.height };
|
|
19
|
+
}
|
|
20
|
+
const height = window.width / photoAspect;
|
|
21
|
+
return { x: window.x, y: window.y - (height - window.height) / 2, width: window.width, height };
|
|
22
|
+
}
|
|
23
|
+
/** Inverse of `photoRectAround`: the centred box of `aspect` (width / height) that fits in `photo`. */
|
|
24
|
+
export function windowInPhoto(photo, aspect) {
|
|
25
|
+
const width = Math.min(photo.width, photo.height * aspect);
|
|
26
|
+
const height = width / aspect;
|
|
27
|
+
return {
|
|
28
|
+
x: photo.x + (photo.width - width) / 2,
|
|
29
|
+
y: photo.y + (photo.height - height) / 2,
|
|
30
|
+
width,
|
|
31
|
+
height,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The whole photo inside `frame` at `zoom` (1 = just covers), centred and then
|
|
36
|
+
* moved by `offset` — the model `FramePrimitive` uses.
|
|
37
|
+
*/
|
|
38
|
+
export function coverPhotoRect(natural, frame, zoom = 1, offset = { x: 0, y: 0 }) {
|
|
39
|
+
const scale = Math.max(frame.width / natural.width, frame.height / natural.height) * zoom;
|
|
40
|
+
const width = natural.width * scale;
|
|
41
|
+
const height = natural.height * scale;
|
|
42
|
+
return {
|
|
43
|
+
x: (frame.width - width) / 2 + offset.x,
|
|
44
|
+
y: (frame.height - height) / 2 + offset.y,
|
|
45
|
+
width,
|
|
46
|
+
height,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A `cover` photo in a frame (frame-local px), moved by `pan`: a share of its
|
|
51
|
+
* overhang on each axis, -1 … 1 from one edge to the other, 0 centred. Being a
|
|
52
|
+
* share, the chosen part survives a resize of the frame, and no pan in range
|
|
53
|
+
* can open a gap.
|
|
54
|
+
*/
|
|
55
|
+
export function framedPhotoRect(natural, frame, pan = { x: 0, y: 0 }, zoom = 1) {
|
|
56
|
+
const photo = coverPhotoRect(natural, frame, Math.max(1, zoom));
|
|
57
|
+
const clamp = (v) => Math.max(-1, Math.min(1, v));
|
|
58
|
+
return {
|
|
59
|
+
...photo,
|
|
60
|
+
x: photo.x * (1 - clamp(pan.x)),
|
|
61
|
+
y: photo.y * (1 - clamp(pan.y)),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** Inverse of `framedPhotoRect`: the pan that puts the photo at `photo.x` / `photo.y`. */
|
|
65
|
+
export function panOfFramedPhoto(photo, frame) {
|
|
66
|
+
const share = (start, size, frameSize) => {
|
|
67
|
+
const half = (size - frameSize) / 2;
|
|
68
|
+
return half > 0 ? 1 + start / half : 0;
|
|
69
|
+
};
|
|
70
|
+
return {
|
|
71
|
+
x: share(photo.x, photo.width, frame.width),
|
|
72
|
+
y: share(photo.y, photo.height, frame.height),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The drawn part: where `photo` overlaps `frame`, and which source pixels that
|
|
77
|
+
* is (Konva `crop`). Null when nothing overlaps.
|
|
78
|
+
*/
|
|
79
|
+
export function visiblePart(natural, photo, frame, mirror = null) {
|
|
80
|
+
const left = Math.max(photo.x, frame.x);
|
|
81
|
+
const top = Math.max(photo.y, frame.y);
|
|
82
|
+
const right = Math.min(photo.x + photo.width, frame.x + frame.width);
|
|
83
|
+
const bottom = Math.min(photo.y + photo.height, frame.y + frame.height);
|
|
84
|
+
if (right <= left || bottom <= top)
|
|
85
|
+
return null;
|
|
86
|
+
const sx = natural.width / photo.width;
|
|
87
|
+
const sy = natural.height / photo.height;
|
|
88
|
+
const width = (right - left) * sx;
|
|
89
|
+
const height = (bottom - top) * sy;
|
|
90
|
+
const x = (left - photo.x) * sx;
|
|
91
|
+
const y = (top - photo.y) * sy;
|
|
92
|
+
return {
|
|
93
|
+
box: { x: left, y: top, width: right - left, height: bottom - top },
|
|
94
|
+
// A flip filter mirrors the drawn pixels; mirroring the crop as well makes
|
|
95
|
+
// the drawn part the mirror of the whole photo, not of its middle.
|
|
96
|
+
crop: {
|
|
97
|
+
x: mirror?.x ? natural.width - x - width : x,
|
|
98
|
+
y: mirror?.y ? natural.height - y - height : y,
|
|
99
|
+
width,
|
|
100
|
+
height,
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Keeps a moved photo covering `frame`. A photo that did not cover the frame
|
|
106
|
+
* to begin with (an old composer strip under a colour panel) may still move
|
|
107
|
+
* between where it was and the covering range — it is never yanked across.
|
|
108
|
+
*/
|
|
109
|
+
export function clampPan(from, dx, dy, frame) {
|
|
110
|
+
const range = (start, size, frameStart, frameSize) => {
|
|
111
|
+
const lo = frameStart + frameSize - (start + size);
|
|
112
|
+
const hi = frameStart - start;
|
|
113
|
+
return lo <= hi ? [Math.min(lo, 0), Math.max(hi, 0)] : [Math.min(hi, 0), Math.max(lo, 0)];
|
|
114
|
+
};
|
|
115
|
+
const [minX, maxX] = range(from.x, from.width, frame.x, frame.width);
|
|
116
|
+
const [minY, maxY] = range(from.y, from.height, frame.y, frame.height);
|
|
117
|
+
return {
|
|
118
|
+
dx: Math.min(maxX, Math.max(minX, dx)),
|
|
119
|
+
dy: Math.min(maxY, Math.max(minY, dy)),
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Where a window-placed photo may show. A photo that fills the frame shows
|
|
124
|
+
* across all of it. One that does not (an old composer strip pushed under a
|
|
125
|
+
* colour panel, a photo zoomed below 100 %) keeps drawing only inside its
|
|
126
|
+
* window, so saved designs look as they always did.
|
|
127
|
+
*/
|
|
128
|
+
export function shownArea(natural, window, frame) {
|
|
129
|
+
if (covers(photoRectAround(natural, window), frame))
|
|
130
|
+
return frame;
|
|
131
|
+
const x = Math.max(window.x, frame.x);
|
|
132
|
+
const y = Math.max(window.y, frame.y);
|
|
133
|
+
return {
|
|
134
|
+
x,
|
|
135
|
+
y,
|
|
136
|
+
width: Math.max(0, Math.min(window.x + window.width, frame.x + frame.width) - x),
|
|
137
|
+
height: Math.max(0, Math.min(window.y + window.height, frame.y + frame.height) - y),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Moves a window-placed photo by (dx, dy) inside `slot` and returns the move
|
|
142
|
+
* it allows plus what to draw. A photo that covers the slot pans across its
|
|
143
|
+
* whole overhang. An old one that does not keeps its window over the area it
|
|
144
|
+
* shows, so no drag can open a gap there.
|
|
145
|
+
*/
|
|
146
|
+
export function panWindowPhoto(natural, window, slot, dx, dy, mirror = null) {
|
|
147
|
+
const photo = photoRectAround(natural, window);
|
|
148
|
+
// An old window that does not fill the slot moves as it always did: inside
|
|
149
|
+
// the slot, or towards covering it — never so that its strip opens a gap.
|
|
150
|
+
const held = clampPan(covers(photo, slot) ? photo : window, dx, dy, slot);
|
|
151
|
+
const moved = { ...window, x: window.x + held.dx, y: window.y + held.dy };
|
|
152
|
+
return {
|
|
153
|
+
...held,
|
|
154
|
+
part: visiblePart(natural, photoRectAround(natural, moved), shownArea(natural, moved, slot), mirror),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/** Whether `photo` fills `frame` completely. */
|
|
158
|
+
export function covers(photo, frame, epsilon = 0.5) {
|
|
159
|
+
return (photo.x <= frame.x + epsilon &&
|
|
160
|
+
photo.y <= frame.y + epsilon &&
|
|
161
|
+
photo.x + photo.width >= frame.x + frame.width - epsilon &&
|
|
162
|
+
photo.y + photo.height >= frame.y + frame.height - epsilon);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* A window scaled by `factor` about the middle of the slot (what the viewer
|
|
166
|
+
* sees stays centred), never smaller than the slot (100 %), and held over the
|
|
167
|
+
* slot so the zoom cannot open a gap.
|
|
168
|
+
*/
|
|
169
|
+
export function zoomWindow(window, factor, slot) {
|
|
170
|
+
const f = Math.max(slot.width / window.width, slot.height / window.height, factor);
|
|
171
|
+
const width = window.width * f;
|
|
172
|
+
const height = window.height * f;
|
|
173
|
+
const about = (start, middle) => middle - (middle - start) * f;
|
|
174
|
+
const hold = (start, size, slotStart, slotSize) => Math.min(slotStart, Math.max(slotStart + slotSize - size, start));
|
|
175
|
+
return {
|
|
176
|
+
x: hold(about(window.x, slot.x + slot.width / 2), width, slot.x, slot.width),
|
|
177
|
+
y: hold(about(window.y, slot.y + slot.height / 2), height, slot.y, slot.height),
|
|
178
|
+
width,
|
|
179
|
+
height,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* `zoomWindow` for a background's `imageOffset` / `imageScale` over a slot at
|
|
184
|
+
* the origin. A `centerZoom` slot anchors its window on its own middle.
|
|
185
|
+
*/
|
|
186
|
+
export function zoomBackground(current, nextScale, slot, centerZoom = false,
|
|
187
|
+
/** The part of the slot the photo fills, when not all of it (a composer strip). */
|
|
188
|
+
frame = null) {
|
|
189
|
+
const from = current.imageScale ?? 1;
|
|
190
|
+
const offset = current.imageOffset ?? { x: 0, y: 0 };
|
|
191
|
+
const anchor = (s, size) => (centerZoom ? (size * (1 - s)) / 2 : 0);
|
|
192
|
+
const window = {
|
|
193
|
+
x: anchor(from, slot.width) + offset.x,
|
|
194
|
+
y: anchor(from, slot.height) + offset.y,
|
|
195
|
+
width: slot.width * from,
|
|
196
|
+
height: slot.height * from,
|
|
197
|
+
};
|
|
198
|
+
const zoomed = zoomWindow(window, Math.max(1, nextScale) / from, frame ?? { x: 0, y: 0, ...slot });
|
|
199
|
+
const imageScale = Math.max(1, zoomed.width / slot.width);
|
|
200
|
+
return {
|
|
201
|
+
imageScale,
|
|
202
|
+
imageOffset: {
|
|
203
|
+
x: zoomed.x - anchor(imageScale, slot.width),
|
|
204
|
+
y: zoomed.y - anchor(imageScale, slot.height),
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type Rect, type Size } from './coverFit.js';
|
|
2
|
+
/** Seitenverhältnis-Vorgaben im Zuschneide-Modus eigener Bilder, in Anzeige-Reihenfolge. */
|
|
3
|
+
export declare const CROP_ASPECT_PRESETS: readonly [{
|
|
4
|
+
readonly id: "free";
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly ratio: null;
|
|
7
|
+
}, {
|
|
8
|
+
readonly id: "original";
|
|
9
|
+
readonly label: string;
|
|
10
|
+
readonly ratio: null;
|
|
11
|
+
}, {
|
|
12
|
+
readonly id: "1:1";
|
|
13
|
+
readonly label: "1:1";
|
|
14
|
+
readonly ratio: 1;
|
|
15
|
+
}, {
|
|
16
|
+
readonly id: "4:5";
|
|
17
|
+
readonly label: "4:5";
|
|
18
|
+
readonly ratio: number;
|
|
19
|
+
}, {
|
|
20
|
+
readonly id: "9:16";
|
|
21
|
+
readonly label: "9:16";
|
|
22
|
+
readonly ratio: number;
|
|
23
|
+
}, {
|
|
24
|
+
readonly id: "16:9";
|
|
25
|
+
readonly label: "16:9";
|
|
26
|
+
readonly ratio: number;
|
|
27
|
+
}, {
|
|
28
|
+
readonly id: "4:3";
|
|
29
|
+
readonly label: "4:3";
|
|
30
|
+
readonly ratio: number;
|
|
31
|
+
}, {
|
|
32
|
+
readonly id: "3:4";
|
|
33
|
+
readonly label: "3:4";
|
|
34
|
+
readonly ratio: number;
|
|
35
|
+
}];
|
|
36
|
+
export type CropAspectId = (typeof CROP_ASPECT_PRESETS)[number]['id'];
|
|
37
|
+
export declare function isCropAspectId(value: string): value is CropAspectId;
|
|
38
|
+
/** Breite ÷ Höhe der Vorgabe; `null` bei „Freiform". „Original" ist das Verhältnis des Fotos. */
|
|
39
|
+
export declare function cropAspectRatio(id: CropAspectId, natural: Size): number | null;
|
|
40
|
+
/**
|
|
41
|
+
* Der Rahmen für eine Vorgabe: das größte Rechteck mit `ratio`, das ins Foto
|
|
42
|
+
* passt, um die Mitte des aktuellen Rahmens — und so weit verschoben, wie es
|
|
43
|
+
* nötig ist, damit es ganz auf dem Foto liegt. Gemessen am Foto statt am
|
|
44
|
+
* aktuellen Rahmen, damit ein Wechsel zwischen Vorgaben den Rahmen nicht
|
|
45
|
+
* Schritt für Schritt schrumpfen lässt.
|
|
46
|
+
*/
|
|
47
|
+
export declare function frameForAspect(frame: Rect, photo: Rect, ratio: number): Rect;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import { messages } from '@ggraphic/editor/i18n/messages';
|
|
3
|
+
/** Seitenverhältnis-Vorgaben im Zuschneide-Modus eigener Bilder, in Anzeige-Reihenfolge. */
|
|
4
|
+
export const CROP_ASPECT_PRESETS = [
|
|
5
|
+
{
|
|
6
|
+
id: 'free',
|
|
7
|
+
get label() {
|
|
8
|
+
return messages().crop.free;
|
|
9
|
+
},
|
|
10
|
+
ratio: null,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: 'original',
|
|
14
|
+
get label() {
|
|
15
|
+
return messages().crop.original;
|
|
16
|
+
},
|
|
17
|
+
ratio: null,
|
|
18
|
+
},
|
|
19
|
+
{ id: '1:1', label: '1:1', ratio: 1 },
|
|
20
|
+
{ id: '4:5', label: '4:5', ratio: 4 / 5 },
|
|
21
|
+
{ id: '9:16', label: '9:16', ratio: 9 / 16 },
|
|
22
|
+
{ id: '16:9', label: '16:9', ratio: 16 / 9 },
|
|
23
|
+
{ id: '4:3', label: '4:3', ratio: 4 / 3 },
|
|
24
|
+
{ id: '3:4', label: '3:4', ratio: 3 / 4 },
|
|
25
|
+
];
|
|
26
|
+
export function isCropAspectId(value) {
|
|
27
|
+
return CROP_ASPECT_PRESETS.some((preset) => preset.id === value);
|
|
28
|
+
}
|
|
29
|
+
/** Breite ÷ Höhe der Vorgabe; `null` bei „Freiform". „Original" ist das Verhältnis des Fotos. */
|
|
30
|
+
export function cropAspectRatio(id, natural) {
|
|
31
|
+
if (id === 'original')
|
|
32
|
+
return natural.width / natural.height;
|
|
33
|
+
return CROP_ASPECT_PRESETS.find((preset) => preset.id === id)?.ratio ?? null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Der Rahmen für eine Vorgabe: das größte Rechteck mit `ratio`, das ins Foto
|
|
37
|
+
* passt, um die Mitte des aktuellen Rahmens — und so weit verschoben, wie es
|
|
38
|
+
* nötig ist, damit es ganz auf dem Foto liegt. Gemessen am Foto statt am
|
|
39
|
+
* aktuellen Rahmen, damit ein Wechsel zwischen Vorgaben den Rahmen nicht
|
|
40
|
+
* Schritt für Schritt schrumpfen lässt.
|
|
41
|
+
*/
|
|
42
|
+
export function frameForAspect(frame, photo, ratio) {
|
|
43
|
+
const width = Math.min(photo.width, photo.height * ratio);
|
|
44
|
+
const height = width / ratio;
|
|
45
|
+
const centre = { x: frame.x + frame.width / 2, y: frame.y + frame.height / 2 };
|
|
46
|
+
const clamp = (v, min, max) => Math.max(min, Math.min(max, v));
|
|
47
|
+
return {
|
|
48
|
+
x: clamp(centre.x - width / 2, photo.x, photo.x + photo.width - width),
|
|
49
|
+
y: clamp(centre.y - height / 2, photo.y, photo.y + photo.height - height),
|
|
50
|
+
width,
|
|
51
|
+
height,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import Konva from 'konva';
|
|
2
|
+
import type { ImageAdjustments } from './userImageUtils.js';
|
|
3
|
+
import type { Mirror, Rect } from '@ggraphic/editor/utils/coverFit';
|
|
4
|
+
/**
|
|
5
|
+
* Konva-Name des abgedunkelten ganzen Fotos im Zuschneide-Modus (Hintergrund
|
|
6
|
+
* und eigene Bilder). Die Bühne endet an der Seite; was darüber hinausragt,
|
|
7
|
+
* zeichnet `CropGhostOverlay` im DOM nach.
|
|
8
|
+
*/
|
|
9
|
+
export declare const CROP_GHOST_NAME = "crop-ghost";
|
|
10
|
+
export declare const CROP_GHOST_OPACITY = 0.35;
|
|
11
|
+
/**
|
|
12
|
+
* Lage eines Restbilds für `photo`; gespiegelt liegt der Ursprung an der
|
|
13
|
+
* fernen Kante. Begradigt (`rotation`, Grad) dreht es sich um seine Mitte wie
|
|
14
|
+
* das Foto im Rahmen.
|
|
15
|
+
*/
|
|
16
|
+
export declare function cropGhostAttrs(photo: Rect, mirror: Mirror | null, rotation?: number): {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
offsetX: number;
|
|
22
|
+
offsetY: number;
|
|
23
|
+
rotation: number;
|
|
24
|
+
scaleX: number;
|
|
25
|
+
scaleY: number;
|
|
26
|
+
};
|
|
27
|
+
/** Setzt ein Restbild direkt am Knoten (während Ziehen und Zoomen, ohne React-Zustand). */
|
|
28
|
+
export declare function placeCropGhost(node: Konva.Node | null, photo: Rect, mirror: Mirror | null, rotation?: number): void;
|
|
29
|
+
export declare const MAX_OVERLAY_SIDE = 8192;
|
|
30
|
+
export declare const MAX_OVERLAY_AREA = 8388608;
|
|
31
|
+
/**
|
|
32
|
+
* Welcher Teil von `bounds` (Container-Koordinaten) gezeichnet wird und mit
|
|
33
|
+
* welcher Auflösung: nur was in `visible` liegt (der sichtbare Ausschnitt;
|
|
34
|
+
* `null` = unbekannt, dann alles), höchstens `MAX_OVERLAY_SIDE` je Kante und
|
|
35
|
+
* `MAX_OVERLAY_AREA` insgesamt. `null`, wenn nichts davon sichtbar ist.
|
|
36
|
+
*/
|
|
37
|
+
export declare function overlayRegion(bounds: Rect, visible: Rect | null, devicePixelRatio: number): {
|
|
38
|
+
rect: Rect;
|
|
39
|
+
ratio: number;
|
|
40
|
+
pixelWidth: number;
|
|
41
|
+
pixelHeight: number;
|
|
42
|
+
} | null;
|
|
43
|
+
/**
|
|
44
|
+
* Der sichtbare Teil von `container` in seinen eigenen CSS-Koordinaten: das
|
|
45
|
+
* Browserfenster, zurückgerechnet durch die Zoom-Skalierung der Seiten.
|
|
46
|
+
* `null`, wenn der Container nicht vermessen ist (jsdom, nicht eingehängt).
|
|
47
|
+
*/
|
|
48
|
+
export declare function visibleContainerRect(container: HTMLElement): Rect | null;
|
|
49
|
+
/**
|
|
50
|
+
* Zeichnet alle sichtbaren Restbilder der Bühne in `canvas`, das im selben
|
|
51
|
+
* Koordinatensystem wie der Bühnen-Container liegt, und spart die Seite aus:
|
|
52
|
+
* dort zeichnet Konva selbst. Gezeichnet wird nur, was in `visible` liegt.
|
|
53
|
+
* Ohne sichtbares Restbild wird `canvas` ausgeblendet.
|
|
54
|
+
*/
|
|
55
|
+
export declare function paintCropGhosts(stage: Konva.Stage, canvas: HTMLCanvasElement, visible?: Rect | null): void;
|
|
56
|
+
/**
|
|
57
|
+
* Die Bildquelle des Restbilds mit dem Look des Fotos („Bearbeiten"-Filter,
|
|
58
|
+
* Einfärbung), einmal auf eine verkleinerte Kopie gerechnet statt per Cache
|
|
59
|
+
* auf dem ganzen, oft vielfach gezoomten Restbild. Spiegeln bleibt außen vor:
|
|
60
|
+
* das Restbild spiegelt über seine Skalierung. `displayedWidth` ist die Breite
|
|
61
|
+
* des ganzen Fotos auf der Bühne; der Weichzeichner-Radius gilt dort.
|
|
62
|
+
*/
|
|
63
|
+
export declare function cropGhostSource(image: HTMLImageElement, adjustments: ImageAdjustments | null, displayedWidth: number, color?: string | null): CanvasImageSource;
|