@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,133 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { useCanvasEditorServices } from '@ggraphic/editor/CanvasEditorProvider';
|
|
4
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
5
|
+
import { cn } from '@ggraphic/editor/utils/cn';
|
|
6
|
+
import { attributionLine, cleanIconSvg, externalIconId, } from '@ggraphic/editor/utils/externalIcons';
|
|
7
|
+
import { useQuery } from '@tanstack/react-query';
|
|
8
|
+
import { useEffect, useState } from 'react';
|
|
9
|
+
const SEARCH_STALE_MS = 5 * 60 * 1000;
|
|
10
|
+
function sourceOf(hit) {
|
|
11
|
+
return {
|
|
12
|
+
kind: 'iconify',
|
|
13
|
+
prefix: hit.prefix,
|
|
14
|
+
name: hit.name,
|
|
15
|
+
setTitle: hit.setTitle,
|
|
16
|
+
licence: hit.licence,
|
|
17
|
+
author: hit.author,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Icons from the host's icon search under a search query: a grid of hits, and
|
|
22
|
+
* for the selected one its set, author and licence with an insert button. The
|
|
23
|
+
* SVG is fetched on insert and handed to `onAdd`, which stores a copy in the
|
|
24
|
+
* design. Renders nothing when the host has no `iconSearch`.
|
|
25
|
+
*
|
|
26
|
+
* `full` is the per-page icon limit when it is reached; inserting is then off.
|
|
27
|
+
*/
|
|
28
|
+
export function IconifyCatalog({ query, onAdd, full = null, }) {
|
|
29
|
+
const t = useMessages().sidebar.elements.iconify;
|
|
30
|
+
const { iconSearch } = useCanvasEditorServices();
|
|
31
|
+
const term = query.trim();
|
|
32
|
+
const enabled = iconSearch !== undefined && term.length > 0;
|
|
33
|
+
const { data, isLoading, isError } = useQuery({
|
|
34
|
+
queryKey: ['canvas', 'iconify-search', term],
|
|
35
|
+
queryFn: ({ signal }) => (iconSearch ? iconSearch.search(term, signal) : Promise.resolve([])),
|
|
36
|
+
enabled,
|
|
37
|
+
staleTime: SEARCH_STALE_MS,
|
|
38
|
+
});
|
|
39
|
+
const [selected, setSelected] = useState(null);
|
|
40
|
+
const [placing, setPlacing] = useState(false);
|
|
41
|
+
const [placeFailed, setPlaceFailed] = useState(false);
|
|
42
|
+
// Tiles are CSS masks, which cannot report a failed load; each tile probes its own image.
|
|
43
|
+
const [failedTiles, setFailedTiles] = useState(new Set());
|
|
44
|
+
const [attempt, setAttempt] = useState(0);
|
|
45
|
+
// The wait the host asked for before another attempt, as an end time, and a ticking clock.
|
|
46
|
+
const [waitUntil, setWaitUntil] = useState(null);
|
|
47
|
+
const [now, setNow] = useState(() => Date.now());
|
|
48
|
+
const [refreshing, setRefreshing] = useState(false);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (waitUntil === null)
|
|
51
|
+
return undefined;
|
|
52
|
+
const id = window.setInterval(() => {
|
|
53
|
+
setNow(Date.now());
|
|
54
|
+
if (Date.now() >= waitUntil)
|
|
55
|
+
setWaitUntil(null);
|
|
56
|
+
}, 500);
|
|
57
|
+
return () => window.clearInterval(id);
|
|
58
|
+
}, [waitUntil]);
|
|
59
|
+
if (!iconSearch || !enabled)
|
|
60
|
+
return null;
|
|
61
|
+
const waitSeconds = waitUntil === null ? 0 : Math.max(0, Math.ceil((waitUntil - now) / 1000));
|
|
62
|
+
const retry = async () => {
|
|
63
|
+
setRefreshing(true);
|
|
64
|
+
let wait = null;
|
|
65
|
+
try {
|
|
66
|
+
wait = iconSearch.refresh ? (await iconSearch.refresh(term)).retryAfterSeconds : null;
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
wait = null;
|
|
70
|
+
}
|
|
71
|
+
setRefreshing(false);
|
|
72
|
+
if (wait !== null && wait > 0) {
|
|
73
|
+
// One reading of the clock: two would put the end a little past the wait, shown as 8 s for 7.
|
|
74
|
+
const start = Date.now();
|
|
75
|
+
setNow(start);
|
|
76
|
+
setWaitUntil(start + wait * 1000);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
setFailedTiles(new Set());
|
|
80
|
+
setAttempt((n) => n + 1);
|
|
81
|
+
};
|
|
82
|
+
const hits = data ?? [];
|
|
83
|
+
const current = selected && hits.some((h) => same(h, selected)) ? selected : null;
|
|
84
|
+
const insert = async () => {
|
|
85
|
+
if (!current || placing || full !== null)
|
|
86
|
+
return;
|
|
87
|
+
setPlacing(true);
|
|
88
|
+
setPlaceFailed(false);
|
|
89
|
+
try {
|
|
90
|
+
// The design keeps a copy; it is rebuilt from an allowlist first, whatever the host sent.
|
|
91
|
+
const svg = cleanIconSvg(await iconSearch.svg(current.prefix, current.name));
|
|
92
|
+
if (svg === null)
|
|
93
|
+
throw new Error('unsafe svg');
|
|
94
|
+
onAdd(externalIconId(current.prefix, current.name), { svg, source: sourceOf(current) });
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
setPlaceFailed(true);
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
setPlacing(false);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
return (_jsxs("section", { "aria-label": t.heading, className: "flex flex-col gap-2.5 w-full", children: [_jsx("h4", { className: "m-0 text-sm font-bold text-[var(--editor-text)]", children: t.heading }), isLoading && (_jsx("p", { role: "status", className: "m-0 text-xs text-[var(--editor-text-muted)]", children: t.searching })), isError && (_jsx("p", { role: "alert", className: "m-0 text-xs text-editor-danger-fg", children: t.error })), !isLoading && !isError && hits.length === 0 && (_jsx("p", { role: "status", className: "m-0 text-xs text-[var(--editor-text-muted)]", children: t.none })), hits.some((h) => failedTiles.has(`${h.prefix}:${h.name}`)) && (_jsxs("div", { role: "alert", className: "flex items-center gap-2 text-xs text-editor-danger-fg", children: [_jsx("span", { children: waitSeconds > 0 ? t.busy(waitSeconds) : t.tilesFailed }), _jsx("button", { type: "button", disabled: waitSeconds > 0 || refreshing, onClick: () => void retry(), className: "h-7 px-2 rounded-md border border-[var(--editor-border-strong)] bg-transparent text-xs text-[var(--editor-text)] cursor-pointer hover:bg-[var(--editor-surface-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--editor-accent)]", children: t.retry })] })), hits.length > 0 && (_jsx("div", { className: "grid grid-cols-[repeat(auto-fill,minmax(56px,1fr))] gap-2", children: hits.map((hit) => {
|
|
104
|
+
const isOn = current !== null && same(hit, current);
|
|
105
|
+
return (_jsxs("button", { type: "button", "aria-pressed": isOn, title: `${hit.name} (${hit.setTitle})`, onClick: () => {
|
|
106
|
+
setSelected(hit);
|
|
107
|
+
setPlaceFailed(false);
|
|
108
|
+
}, className: cn('aspect-square grid place-items-center rounded-lg border-[1.5px] cursor-pointer bg-[var(--editor-tile)] text-[var(--editor-text)]', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--editor-accent)]', isOn ? 'border-[var(--editor-accent)]' : 'border-transparent'), children: [_jsx("span", { className: "sr-only", children: `${hit.name} ${hit.setTitle}` }), _jsx(IconPreview, { url: iconSearch.previewUrl(hit.prefix, hit.name), onFail: () => setFailedTiles((prev) => new Set(prev).add(`${hit.prefix}:${hit.name}`)) }, attempt)] }, `${hit.prefix}:${hit.name}`));
|
|
109
|
+
}) })), current && (_jsxs("div", { className: "sticky bottom-0 flex flex-col gap-2 py-2 bg-[var(--editor-surface)]", children: [_jsx("p", { className: "m-0 text-[11px] text-[var(--editor-text-muted)]", children: attributionLine(sourceOf(current)) }), full !== null && (_jsx("p", { className: "m-0 text-[11px] text-[var(--editor-text-muted)]", children: t.full(full) })), placeFailed && (_jsx("p", { role: "alert", className: "m-0 text-xs text-editor-danger-fg", children: t.insertError })), _jsx("button", { type: "button", disabled: placing || full !== null, onClick: () => void insert(), className: "h-9 rounded-md border border-[var(--editor-border-strong)] bg-transparent text-sm text-[var(--editor-text)] cursor-pointer hover:bg-[var(--editor-surface-hover)] disabled:opacity-60 disabled:cursor-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--editor-accent)]", children: placing ? t.inserting : t.insert })] }))] }));
|
|
110
|
+
}
|
|
111
|
+
const same = (a, b) => a.prefix === b.prefix && a.name === b.name;
|
|
112
|
+
/** One tile image: loaded once to learn whether it can be served, then masked from the cache. */
|
|
113
|
+
function IconPreview({ url, onFail }) {
|
|
114
|
+
const [loaded, setLoaded] = useState(false);
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
const probe = new Image();
|
|
117
|
+
probe.onload = () => setLoaded(true);
|
|
118
|
+
probe.onerror = onFail;
|
|
119
|
+
probe.src = url;
|
|
120
|
+
return () => {
|
|
121
|
+
probe.onload = null;
|
|
122
|
+
probe.onerror = null;
|
|
123
|
+
};
|
|
124
|
+
// `onFail` is a fresh closure per render; the probe belongs to the url alone.
|
|
125
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
126
|
+
}, [url]);
|
|
127
|
+
return (_jsx("span", { "aria-hidden": true, className: cn('block size-[30px]', loaded ? 'bg-current' : 'bg-[var(--editor-border)]'), style: loaded ? maskStyle(url) : undefined }));
|
|
128
|
+
}
|
|
129
|
+
/** The icon as a mask over `currentColor`, so it follows the editor's text colour. */
|
|
130
|
+
function maskStyle(url) {
|
|
131
|
+
const mask = `url("${url}") center / contain no-repeat`;
|
|
132
|
+
return { mask, WebkitMask: mask };
|
|
133
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ElementItem } from './elementTypes.js';
|
|
2
|
+
export declare function RecentCarousel({ items, onActivate, enterIndexOf, canDrag, }: {
|
|
3
|
+
items: readonly ElementItem[];
|
|
4
|
+
onActivate: (item: ElementItem) => void;
|
|
5
|
+
enterIndexOf: (index: number) => number | null;
|
|
6
|
+
canDrag: boolean;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
4
|
+
import { cn } from '@ggraphic/editor/utils/cn';
|
|
5
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
6
|
+
import { PiCaretRightBold } from 'react-icons/pi';
|
|
7
|
+
import { scrollBehavior } from '@ggraphic/editor/utils/scrollBehavior';
|
|
8
|
+
import { HIDDEN_SCROLLBAR } from '@ggraphic/editor/sidebar/sidebarStyles';
|
|
9
|
+
import { ElementTile } from './ElementTile.js';
|
|
10
|
+
/** One "page" of the carousel: two 88px tiles and their gaps. */
|
|
11
|
+
const SCROLL_STEP = 192;
|
|
12
|
+
export function RecentCarousel({ items, onActivate, enterIndexOf, canDrag, }) {
|
|
13
|
+
const t = useMessages();
|
|
14
|
+
const rowRef = useRef(null);
|
|
15
|
+
const frame = useRef(0);
|
|
16
|
+
const [canScroll, setCanScroll] = useState(false);
|
|
17
|
+
// Measured at most once per frame; the arrow hides when the row ends.
|
|
18
|
+
const measure = useCallback(() => {
|
|
19
|
+
if (frame.current)
|
|
20
|
+
return;
|
|
21
|
+
frame.current = requestAnimationFrame(() => {
|
|
22
|
+
frame.current = 0;
|
|
23
|
+
const row = rowRef.current;
|
|
24
|
+
if (row)
|
|
25
|
+
setCanScroll(row.scrollLeft + row.clientWidth < row.scrollWidth - 2);
|
|
26
|
+
});
|
|
27
|
+
}, []);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
measure();
|
|
30
|
+
const row = rowRef.current;
|
|
31
|
+
if (!row)
|
|
32
|
+
return;
|
|
33
|
+
const observer = new ResizeObserver(measure);
|
|
34
|
+
observer.observe(row);
|
|
35
|
+
return () => {
|
|
36
|
+
observer.disconnect();
|
|
37
|
+
cancelAnimationFrame(frame.current);
|
|
38
|
+
frame.current = 0;
|
|
39
|
+
};
|
|
40
|
+
}, [measure, items.length]);
|
|
41
|
+
return (_jsxs("div", { className: "relative", children: [_jsx("div", { ref: rowRef, onScroll: measure, className: cn('flex gap-2 overflow-x-auto scroll-smooth motion-reduce:scroll-auto', HIDDEN_SCROLLBAR), children: items.map((item, i) => (_jsx(ElementTile, { item: item, variant: "recent", onActivate: onActivate, enterIndex: enterIndexOf(i), canDrag: canDrag, eager: true }, item.key))) }), _jsx("div", { className: cn('absolute right-0 inset-y-0 w-[52px] flex items-center justify-end pointer-events-none', 'bg-[linear-gradient(90deg,transparent,var(--editor-surface)_70%)]', 'transition-opacity duration-200', canScroll ? 'opacity-100' : 'opacity-0'), children: _jsx("button", { type: "button", "aria-label": t.sidebar.elements.moreRecent, tabIndex: canScroll ? 0 : -1, onClick: () => rowRef.current?.scrollBy({ left: SCROLL_STEP, behavior: scrollBehavior() }), className: cn('size-8 rounded-full grid place-items-center border-none cursor-pointer', 'bg-[var(--editor-surface)] text-[var(--editor-text)] shadow-md', 'transition-transform duration-150 hover:scale-[1.08]', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--editor-accent)]', canScroll && 'pointer-events-auto'), children: _jsx(PiCaretRightBold, { size: 16 }) }) })] }));
|
|
42
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type StickerRef } from '@ggraphic/schema';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* The Sticker category: the catalogue's stickers (`children`) under the host's
|
|
5
|
+
* label (`elementPanel.stickerListLabel`), the shared gallery under Entdecken / Meine / Gemerkt. Without
|
|
6
|
+
* `onAddStickerAsset` only the system set.
|
|
7
|
+
*/
|
|
8
|
+
export declare function StickerCatalog({ onAddStickerAsset, searchQuery, canDrag, children, }: {
|
|
9
|
+
onAddStickerAsset?: (ref: StickerRef) => void;
|
|
10
|
+
searchQuery?: string;
|
|
11
|
+
/** Mouse drag onto a page; off on touch layouts. */
|
|
12
|
+
canDrag: boolean;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
import { useCanvasEditorServices } from '@ggraphic/editor/CanvasEditorProvider';
|
|
4
|
+
import { useMessages } from '@ggraphic/editor/i18n/messages';
|
|
5
|
+
import { registeredAssetCatalog, studioStickerId } from '@ggraphic/editor/utils/canvasAssets';
|
|
6
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
7
|
+
import { HiPlus } from 'react-icons/hi2';
|
|
8
|
+
import { GalleryTabs, StudioGalleryGrid, useGalleryScopes, } from '../StudioGallery.js';
|
|
9
|
+
import { elementDragProps } from './ElementTile.js';
|
|
10
|
+
import { galleryStickerItem } from './elementTypes.js';
|
|
11
|
+
const galleryRef = (item) => ({
|
|
12
|
+
id: studioStickerId(item.id),
|
|
13
|
+
src: item.src,
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* The Sticker category: the catalogue's stickers (`children`) under the host's
|
|
17
|
+
* label (`elementPanel.stickerListLabel`), the shared gallery under Entdecken / Meine / Gemerkt. Without
|
|
18
|
+
* `onAddStickerAsset` only the system set.
|
|
19
|
+
*/
|
|
20
|
+
export function StickerCatalog({ onAddStickerAsset, searchQuery = '', canDrag, children, }) {
|
|
21
|
+
const t = useMessages();
|
|
22
|
+
const { openStickerCreator } = useCanvasEditorServices();
|
|
23
|
+
const scopes = useGalleryScopes();
|
|
24
|
+
const listLabel = registeredAssetCatalog().elementPanel?.stickerListLabel ?? t.sidebar.elements.defaultList;
|
|
25
|
+
const tabs = useMemo(() => [{ id: 'catalog', label: listLabel }, ...scopes], [listLabel, scopes]);
|
|
26
|
+
const [tab, setTab] = useState('catalog');
|
|
27
|
+
const creatorOpened = useRef(false);
|
|
28
|
+
const [refreshToken, setRefreshToken] = useState(0);
|
|
29
|
+
// The creator runs in another tab; back here, "Meine" must show what was made there.
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
const onFocus = () => {
|
|
32
|
+
if (!creatorOpened.current)
|
|
33
|
+
return;
|
|
34
|
+
creatorOpened.current = false;
|
|
35
|
+
setRefreshToken((n) => n + 1);
|
|
36
|
+
};
|
|
37
|
+
window.addEventListener('focus', onFocus);
|
|
38
|
+
return () => window.removeEventListener('focus', onFocus);
|
|
39
|
+
}, []);
|
|
40
|
+
if (!onAddStickerAsset)
|
|
41
|
+
return children;
|
|
42
|
+
return (_jsxs("div", { className: "flex flex-col gap-3 w-full", children: [_jsx(GalleryTabs, { label: t.sidebar.elements.stickerPicker, tabs: tabs, value: tab, onChange: setTab }), openStickerCreator && (_jsxs("button", { type: "button", onClick: () => {
|
|
43
|
+
creatorOpened.current = true;
|
|
44
|
+
setTab('mine');
|
|
45
|
+
openStickerCreator();
|
|
46
|
+
}, className: "flex w-full items-center justify-center gap-2 h-10 rounded-lg border-[1.5px] border-dashed border-[var(--editor-border-strong)] bg-transparent text-sm font-semibold text-[var(--editor-text-secondary)] cursor-pointer transition-colors duration-150 hover:border-[var(--editor-accent)] hover:text-[var(--editor-text)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--editor-accent)]", children: [_jsx(HiPlus, { size: 18, "aria-hidden": "true" }), t.sidebar.elements.createSticker] })), tab === 'catalog' ? (children) : (_jsx(StudioGalleryGrid, { kind: "sticker", scope: tab, query: searchQuery, refreshToken: refreshToken, onPick: (item) => onAddStickerAsset(galleryRef(item)), ...(canDrag
|
|
47
|
+
? { dragProps: (item) => elementDragProps(galleryStickerItem(galleryRef(item))) }
|
|
48
|
+
: {}) }))] }));
|
|
49
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type KawaiiProps } from 'react-kawaii';
|
|
2
|
+
import type { KawaiiIllustrationType } from '@ggraphic/editor/utils/illustrations/types';
|
|
3
|
+
export type AssetView = 'browse' | 'marke' | 'bloecke' | 'sticker' | 'fotos' | 'hintergruende' | 'formen' | 'diagramme' | 'rahmen' | 'illustrationen' | 'icons' | 'emoji';
|
|
4
|
+
export declare const PREVIEW_COMPONENTS: Record<KawaiiIllustrationType, React.FunctionComponent<KawaiiProps>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import { Planet, Cat, Ghost, IceCream, Browser, Mug, SpeechBubble, Backpack, CreditCard, File, Folder, } from 'react-kawaii';
|
|
3
|
+
export const PREVIEW_COMPONENTS = {
|
|
4
|
+
planet: Planet,
|
|
5
|
+
cat: Cat,
|
|
6
|
+
ghost: Ghost,
|
|
7
|
+
iceCream: IceCream,
|
|
8
|
+
browser: Browser,
|
|
9
|
+
mug: Mug,
|
|
10
|
+
speechBubble: SpeechBubble,
|
|
11
|
+
backpack: Backpack,
|
|
12
|
+
creditCard: CreditCard,
|
|
13
|
+
file: File,
|
|
14
|
+
folder: Folder,
|
|
15
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ElementItem, HostElementThumb } from './elementTypes.js';
|
|
2
|
+
import type { HostElementKindName } from '@ggraphic/editor/utils/canvasItem';
|
|
3
|
+
import type { AssetAudience } from '@ggraphic/editor/utils/canvasAssets';
|
|
4
|
+
import type { ComponentType } from 'react';
|
|
5
|
+
/** A host's block catalogue as the Elemente panel reads it. */
|
|
6
|
+
export interface ElementBlocks {
|
|
7
|
+
/** Name of the category. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** One tile per block the active page can take, in catalogue order. */
|
|
10
|
+
items: ElementItem[];
|
|
11
|
+
/** The headings the tiles are listed under, in display order; `keys` are `ElementItem.key`s. */
|
|
12
|
+
groups: readonly {
|
|
13
|
+
label: string;
|
|
14
|
+
keys: readonly string[];
|
|
15
|
+
}[];
|
|
16
|
+
isLoading: boolean;
|
|
17
|
+
has: (blockId: string) => boolean;
|
|
18
|
+
insert: (blockId: string) => Promise<unknown>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* What a host adds to the Elemente panel beyond the generic categories
|
|
22
|
+
* (`CanvasAssetCatalog.elementPanel`). Everything is optional: without it the
|
|
23
|
+
* panel shows only the generic categories and their tiles.
|
|
24
|
+
*/
|
|
25
|
+
export interface ElementPanelHost {
|
|
26
|
+
/** Label of the sticker chip that lists the catalogue's own stickers. */
|
|
27
|
+
stickerListLabel?: string;
|
|
28
|
+
/** The line under an empty search result. */
|
|
29
|
+
noResultsHint?: (locale: AssetAudience) => string;
|
|
30
|
+
/**
|
|
31
|
+
* Tiles for the brand category, between the logos and the marks; `canAdd`:
|
|
32
|
+
* whether this editor can add a host kind (`registerElementKind` with `add`).
|
|
33
|
+
*/
|
|
34
|
+
brandItems?: (context: {
|
|
35
|
+
locale: AssetAudience;
|
|
36
|
+
canAdd: (kind: HostElementKindName) => boolean;
|
|
37
|
+
}) => ElementItem[];
|
|
38
|
+
/** Hook: the block catalogue, or null while there is none. Called once per render. */
|
|
39
|
+
useBlocks?: () => ElementBlocks | null;
|
|
40
|
+
/** Preview of a host kind's tile. */
|
|
41
|
+
HostThumb?: ComponentType<{
|
|
42
|
+
thumb: HostElementThumb;
|
|
43
|
+
size: number;
|
|
44
|
+
}>;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ElementItem } from './elementTypes.js';
|
|
2
|
+
import type { CatalogCategory } from './useElementCatalog.js';
|
|
3
|
+
type SearchableCategory = Pick<CatalogCategory, 'id' | 'searchable' | 'items'>;
|
|
4
|
+
/**
|
|
5
|
+
* Search one category, or all searchable ones in catalogue order. Each group is
|
|
6
|
+
* ranked BEFORE it is capped — otherwise the first matches in catalogue order
|
|
7
|
+
* fill the cap and the best match never shows.
|
|
8
|
+
*/
|
|
9
|
+
export declare function searchElements(catalog: readonly SearchableCategory[], query: string, category: SearchableCategory | null): ElementItem[];
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import { rankByQuery } from '@ggraphic/editor/utils/filterUtils';
|
|
3
|
+
/** Caps per kind in the search across all categories; a category's own search pages instead. */
|
|
4
|
+
const GLOBAL_CAP = {
|
|
5
|
+
illustrationen: 30,
|
|
6
|
+
icons: 20,
|
|
7
|
+
emoji: 30,
|
|
8
|
+
};
|
|
9
|
+
const rank = (items, query) => rankByQuery(items, query, (item) => [item.label, item.keywords]);
|
|
10
|
+
/**
|
|
11
|
+
* Search one category, or all searchable ones in catalogue order. Each group is
|
|
12
|
+
* ranked BEFORE it is capped — otherwise the first matches in catalogue order
|
|
13
|
+
* fill the cap and the best match never shows.
|
|
14
|
+
*/
|
|
15
|
+
export function searchElements(catalog, query, category) {
|
|
16
|
+
if (category)
|
|
17
|
+
return rank(category.items, query);
|
|
18
|
+
const seen = new Set();
|
|
19
|
+
const out = [];
|
|
20
|
+
for (const c of catalog) {
|
|
21
|
+
if (!c.searchable)
|
|
22
|
+
continue;
|
|
23
|
+
let n = 0;
|
|
24
|
+
const cap = GLOBAL_CAP[c.id] ?? Infinity;
|
|
25
|
+
for (const item of rank(c.items, query)) {
|
|
26
|
+
if (n >= cap)
|
|
27
|
+
break;
|
|
28
|
+
// A sticker can share its file with a brand graphic; show it once.
|
|
29
|
+
const dedupe = item.thumb.t === 'img' ? item.thumb.src : item.key;
|
|
30
|
+
if (seen.has(dedupe))
|
|
31
|
+
continue;
|
|
32
|
+
seen.add(dedupe);
|
|
33
|
+
out.push(item);
|
|
34
|
+
n++;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type ElementDragPayload, type MediaDragPayload } from '@ggraphic/editor/utils/mediaDrop';
|
|
2
|
+
import type { HostElementKindName, HostElementPayload } from '@ggraphic/editor/utils/canvasItem';
|
|
3
|
+
import type { ChartType } from '@ggraphic/editor/utils/chartUtils';
|
|
4
|
+
import type { FrameClipType } from '@ggraphic/editor/utils/frameUtils';
|
|
5
|
+
import type { KawaiiIllustrationType, SvgDef } from '@ggraphic/editor/utils/illustrations/types';
|
|
6
|
+
import type { ShapeType } from '@ggraphic/editor/utils/shapes';
|
|
7
|
+
import type { StickerRef } from '@ggraphic/schema';
|
|
8
|
+
/** What a tile does: an element add (icons toggle) or a photo placed as image. */
|
|
9
|
+
export type ElementAction = ElementDragPayload | ({
|
|
10
|
+
kind: 'media';
|
|
11
|
+
} & MediaDragPayload);
|
|
12
|
+
/**
|
|
13
|
+
* How a tile previews its element. Plain data, so a recent tile can be stored
|
|
14
|
+
* and drawn again without the catalogue that produced it.
|
|
15
|
+
*/
|
|
16
|
+
export type ElementThumbSpec = {
|
|
17
|
+
t: 'img';
|
|
18
|
+
src: string;
|
|
19
|
+
inverse?: boolean;
|
|
20
|
+
} | {
|
|
21
|
+
t: 'share';
|
|
22
|
+
src: string;
|
|
23
|
+
} | {
|
|
24
|
+
t: 'photo';
|
|
25
|
+
src: string;
|
|
26
|
+
} | {
|
|
27
|
+
t: 'shape';
|
|
28
|
+
shapeType: ShapeType;
|
|
29
|
+
} | {
|
|
30
|
+
t: 'chart';
|
|
31
|
+
chartType: ChartType;
|
|
32
|
+
} | {
|
|
33
|
+
t: 'frame';
|
|
34
|
+
clipType: FrameClipType;
|
|
35
|
+
} | {
|
|
36
|
+
t: 'kawaii';
|
|
37
|
+
id: KawaiiIllustrationType;
|
|
38
|
+
} | {
|
|
39
|
+
t: 'svg';
|
|
40
|
+
def: SvgDef;
|
|
41
|
+
} | {
|
|
42
|
+
t: 'icon';
|
|
43
|
+
iconId: string;
|
|
44
|
+
}
|
|
45
|
+
/** A host kind's tile, drawn by the host (`ElementPanelHost.HostThumb`). */
|
|
46
|
+
| HostElementThumb;
|
|
47
|
+
/** The preview of a host kind's tile: its `kind` as `t`, and its payload. */
|
|
48
|
+
export type HostElementThumb = {
|
|
49
|
+
[K in HostElementKindName]: {
|
|
50
|
+
t: K;
|
|
51
|
+
} & HostElementPayload<K>;
|
|
52
|
+
}[HostElementKindName];
|
|
53
|
+
export interface ElementItem {
|
|
54
|
+
/** Stable across sessions: the recent list and React keys use it. */
|
|
55
|
+
key: string;
|
|
56
|
+
label: string;
|
|
57
|
+
keywords: readonly string[];
|
|
58
|
+
action: ElementAction;
|
|
59
|
+
thumb: ElementThumbSpec;
|
|
60
|
+
}
|
|
61
|
+
/** Drag type and JSON for a tile. */
|
|
62
|
+
export declare function dragDataFor(action: ElementAction): {
|
|
63
|
+
type: string;
|
|
64
|
+
data: string;
|
|
65
|
+
};
|
|
66
|
+
/** A shared-gallery sticker as a tile, for the recent list and its drag. */
|
|
67
|
+
export declare function galleryStickerItem(ref: StickerRef): ElementItem;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import { ELEMENT_DRAG_TYPE, MEDIA_DRAG_TYPE, } from '@ggraphic/editor/utils/mediaDrop';
|
|
3
|
+
/** Drag type and JSON for a tile. */
|
|
4
|
+
export function dragDataFor(action) {
|
|
5
|
+
if (action.kind === 'media') {
|
|
6
|
+
const payload = {
|
|
7
|
+
url: action.url,
|
|
8
|
+
name: action.name,
|
|
9
|
+
...(action.attribution ? { attribution: action.attribution } : {}),
|
|
10
|
+
};
|
|
11
|
+
return { type: MEDIA_DRAG_TYPE, data: JSON.stringify(payload) };
|
|
12
|
+
}
|
|
13
|
+
return { type: ELEMENT_DRAG_TYPE, data: JSON.stringify(action) };
|
|
14
|
+
}
|
|
15
|
+
/** A shared-gallery sticker as a tile, for the recent list and its drag. */
|
|
16
|
+
export function galleryStickerItem(ref) {
|
|
17
|
+
return {
|
|
18
|
+
key: `sticker:${ref.id}`,
|
|
19
|
+
label: 'Sticker',
|
|
20
|
+
keywords: ['sticker'],
|
|
21
|
+
action: { kind: 'sticker', ref },
|
|
22
|
+
thumb: { t: 'share', src: ref.src },
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type UniversalAsset } from '@ggraphic/editor/utils/canvasAssets';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import type { ElementBlocks } from './elementPanelHost.js';
|
|
4
|
+
import type { ExtendedAssetsSectionProps } from './AssetsSection.js';
|
|
5
|
+
import type { AssetView } from '@ggraphic/editor/sidebar/sections/assets/constants';
|
|
6
|
+
import type { ElementAction, ElementItem } from './elementTypes.js';
|
|
7
|
+
import type { IconDef } from '@ggraphic/editor/utils/canvasIcons';
|
|
8
|
+
import type { IllustrationDef } from '@ggraphic/editor/utils/illustrations/types';
|
|
9
|
+
export type CategoryId = Exclude<AssetView, 'browse'>;
|
|
10
|
+
export interface CatalogCategory {
|
|
11
|
+
id: CategoryId;
|
|
12
|
+
label: string;
|
|
13
|
+
tint: 'primary' | 'secondary';
|
|
14
|
+
cover: ReactNode;
|
|
15
|
+
/** Null when the size is unknown up front (galleries). */
|
|
16
|
+
count: number | null;
|
|
17
|
+
items: ElementItem[];
|
|
18
|
+
isLoading: boolean;
|
|
19
|
+
/** Galleries search server-side in their own grid, not in the shared one. */
|
|
20
|
+
searchable: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function assetItem(asset: UniversalAsset): ElementItem;
|
|
23
|
+
export declare const SHAPE_ITEMS: ElementItem[];
|
|
24
|
+
export declare const CHART_ITEMS: ElementItem[];
|
|
25
|
+
export declare const FRAME_ITEMS: ElementItem[];
|
|
26
|
+
export declare function illustrationItem(def: IllustrationDef): ElementItem;
|
|
27
|
+
export declare function iconItem(icon: IconDef): ElementItem;
|
|
28
|
+
/** Whether this editor can perform the action — a config without shapes hides shape tiles. */
|
|
29
|
+
export declare function canRun(action: ElementAction, props: ExtendedAssetsSectionProps, blocks?: ElementBlocks | null): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Every Elemente category this editor offers, in display order, with its tiles.
|
|
32
|
+
* The big sets (all illustrations, all icon sets) load only once `needFull`
|
|
33
|
+
* asks for them — a search, or that category being open.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useElementCatalog(props: ExtendedAssetsSectionProps, needFull: {
|
|
36
|
+
illustrations: boolean;
|
|
37
|
+
icons: boolean;
|
|
38
|
+
photos: boolean;
|
|
39
|
+
emoji: boolean;
|
|
40
|
+
},
|
|
41
|
+
/** Skin tone of the emoji tiles: 0 default, 1–5 light → dark. */
|
|
42
|
+
emojiTone?: number): CatalogCategory[];
|