@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,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Awaits every declared @font-face load before a stage export rasterizes.
|
|
3
|
+
*
|
|
4
|
+
* Brand fonts load via `font-display: swap`, so a synchronous
|
|
5
|
+
* `stage.toDataURL()` fired before they finish bakes in the fallback face —
|
|
6
|
+
* the intermittent "some AT sharepics render in the wrong font" bug (the
|
|
7
|
+
* heaviest brand font sets are the most visible offenders). Gating the
|
|
8
|
+
* user-facing export paths on this makes the snapshot deterministic. Cheap and
|
|
9
|
+
* idempotent after the first call (faces are cached), and best-effort: an
|
|
10
|
+
* export must never hang or fail on font loading.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ensureFontsReady(): Promise<void>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Awaits every declared @font-face load before a stage export rasterizes.
|
|
4
|
+
*
|
|
5
|
+
* Brand fonts load via `font-display: swap`, so a synchronous
|
|
6
|
+
* `stage.toDataURL()` fired before they finish bakes in the fallback face —
|
|
7
|
+
* the intermittent "some AT sharepics render in the wrong font" bug (the
|
|
8
|
+
* heaviest brand font sets are the most visible offenders). Gating the
|
|
9
|
+
* user-facing export paths on this makes the snapshot deterministic. Cheap and
|
|
10
|
+
* idempotent after the first call (faces are cached), and best-effort: an
|
|
11
|
+
* export must never hang or fail on font loading.
|
|
12
|
+
*/
|
|
13
|
+
export async function ensureFontsReady() {
|
|
14
|
+
if (typeof document === 'undefined' || !document.fonts)
|
|
15
|
+
return;
|
|
16
|
+
try {
|
|
17
|
+
await Promise.all(Array.from(document.fonts, (face) => face.load().catch(() => undefined)));
|
|
18
|
+
await document.fonts.ready;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// best-effort — never block an export on font loading
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type CropUpdate } from './cropTarget.js';
|
|
2
|
+
import type { CanvasElementConfig, LayoutResult } from '../configs/types.js';
|
|
3
|
+
/** Die Bildquelle des Elements; `null`, wenn es fehlt oder kein Foto zeigt. */
|
|
4
|
+
export declare function cropImageSrc(state: Record<string, unknown>, elements: readonly CanvasElementConfig[], id: string): string | null;
|
|
5
|
+
/**
|
|
6
|
+
* Was erweitert wird: die Quelle und das Zielverhältnis (Breite/Höhe) —
|
|
7
|
+
* beim Hintergrund das Fenster bei Zoom 1 (Seitenformat), beim eigenen Bild der Rahmen.
|
|
8
|
+
*/
|
|
9
|
+
export declare function expandTarget(state: Record<string, unknown>, elements: readonly CanvasElementConfig[], layout: LayoutResult, id: string): {
|
|
10
|
+
src: string;
|
|
11
|
+
fileName: string;
|
|
12
|
+
aspect: number;
|
|
13
|
+
} | null;
|
|
14
|
+
/** Zuschnitt zurück auf den Stand eines frisch eingesetzten Fotos: mittig, Zoom 1, 0°. */
|
|
15
|
+
export declare function expandResetPatch(state: Record<string, unknown>, elements: readonly CanvasElementConfig[], id: string): CropUpdate | null;
|
|
16
|
+
/** „foto.png" → „foto-erweitert.jpg": der Name bleibt erkennbar, die Endung folgt dem gelieferten Format. */
|
|
17
|
+
export declare function expandedFileName(original: string, type: string): string;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
// „Erweitern": die KI ergänzt das Foto auf das Seitenverhältnis seines Rahmens; danach liegt es wie neu eingesetzt.
|
|
3
|
+
import { BACKGROUND_STRAIGHTEN_KEY, backgroundStraighten } from '@ggraphic/editor/utils/straighten';
|
|
4
|
+
import { cropTargetOf } from './cropTarget.js';
|
|
5
|
+
import { resolveValue } from './resolveElementValue.js';
|
|
6
|
+
/** Die Bildquelle des Elements; `null`, wenn es fehlt oder kein Foto zeigt. */
|
|
7
|
+
export function cropImageSrc(state, elements, id) {
|
|
8
|
+
const target = cropTargetOf(state, elements, id);
|
|
9
|
+
if (!target)
|
|
10
|
+
return null;
|
|
11
|
+
if (target.kind === 'user-image')
|
|
12
|
+
return target.image.src || null;
|
|
13
|
+
const src = target.config.srcKey ? state[target.config.srcKey] : null;
|
|
14
|
+
return typeof src === 'string' && src ? src : null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Was erweitert wird: die Quelle und das Zielverhältnis (Breite/Höhe) —
|
|
18
|
+
* beim Hintergrund das Fenster bei Zoom 1 (Seitenformat), beim eigenen Bild der Rahmen.
|
|
19
|
+
*/
|
|
20
|
+
export function expandTarget(state, elements, layout, id) {
|
|
21
|
+
const src = cropImageSrc(state, elements, id);
|
|
22
|
+
const target = cropTargetOf(state, elements, id);
|
|
23
|
+
if (!src || !target)
|
|
24
|
+
return null;
|
|
25
|
+
const size = target.kind === 'background'
|
|
26
|
+
? {
|
|
27
|
+
width: resolveValue(target.config.width, state, layout),
|
|
28
|
+
height: resolveValue(target.config.height, state, layout),
|
|
29
|
+
}
|
|
30
|
+
: target.image;
|
|
31
|
+
if (!(size.width > 0 && size.height > 0))
|
|
32
|
+
return null;
|
|
33
|
+
const fileName = target.kind === 'background' ? 'hintergrund' : target.image.fileName || 'bild';
|
|
34
|
+
return { src, fileName, aspect: size.width / size.height };
|
|
35
|
+
}
|
|
36
|
+
/** Zuschnitt zurück auf den Stand eines frisch eingesetzten Fotos: mittig, Zoom 1, 0°. */
|
|
37
|
+
export function expandResetPatch(state, elements, id) {
|
|
38
|
+
const target = cropTargetOf(state, elements, id);
|
|
39
|
+
if (!target)
|
|
40
|
+
return null;
|
|
41
|
+
if (target.kind === 'background') {
|
|
42
|
+
const background = target.config;
|
|
43
|
+
const patch = {};
|
|
44
|
+
if (background.offsetKey)
|
|
45
|
+
patch[background.offsetKey] = { x: 0, y: 0 };
|
|
46
|
+
if (background.scaleKey)
|
|
47
|
+
patch[background.scaleKey] = 1;
|
|
48
|
+
for (const key of [background.positionStateKey, background.sizeStateKey]) {
|
|
49
|
+
if (key && state[key] != null)
|
|
50
|
+
patch[key] = null;
|
|
51
|
+
}
|
|
52
|
+
if (backgroundStraighten(state) !== null)
|
|
53
|
+
patch[BACKGROUND_STRAIGHTEN_KEY] = 0;
|
|
54
|
+
return { kind: 'template', patch };
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
kind: 'user-image',
|
|
58
|
+
patch: {
|
|
59
|
+
fit: 'cover',
|
|
60
|
+
panX: 0,
|
|
61
|
+
panY: 0,
|
|
62
|
+
cropZoom: 1,
|
|
63
|
+
...(target.image.cropRotation ? { cropRotation: 0 } : {}),
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const EXTENSIONS = {
|
|
68
|
+
'image/jpeg': 'jpg',
|
|
69
|
+
'image/png': 'png',
|
|
70
|
+
'image/webp': 'webp',
|
|
71
|
+
};
|
|
72
|
+
/** „foto.png" → „foto-erweitert.jpg": der Name bleibt erkennbar, die Endung folgt dem gelieferten Format. */
|
|
73
|
+
export function expandedFileName(original, type) {
|
|
74
|
+
const stem = original.replace(/\.[a-z0-9]+$/i, '') || 'bild';
|
|
75
|
+
return `${stem}-erweitert.${EXTENSIONS[type] ?? 'png'}`;
|
|
76
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icons from a host's icon search (Iconify, say), as opposed to the sets the
|
|
3
|
+
* editor bundles. A placed one is stored in the design as a COPY of its SVG
|
|
4
|
+
* (`IconState.svg`) next to where it came from (`IconState.source`), so exports
|
|
5
|
+
* and reloads work offline and no link can rot.
|
|
6
|
+
*
|
|
7
|
+
* This module is the in-memory registry the renderer reads. It carries no
|
|
8
|
+
* `@iconify` import, so it works in the node lane like `iconInstances.ts`.
|
|
9
|
+
* Catalog ids are namespaced (`iconify:<prefix>:<name>`), so they never collide
|
|
10
|
+
* with the bundled sets.
|
|
11
|
+
*/
|
|
12
|
+
import { type IconSource } from '@ggraphic/core';
|
|
13
|
+
import type { IconDef } from './canvasIcons.js';
|
|
14
|
+
export { type IconSource } from '@ggraphic/core';
|
|
15
|
+
/** What a placed external icon adds to its `IconState`. */
|
|
16
|
+
export interface ExternalIconPayload {
|
|
17
|
+
svg: string;
|
|
18
|
+
source: IconSource;
|
|
19
|
+
}
|
|
20
|
+
interface Entry {
|
|
21
|
+
def: IconDef;
|
|
22
|
+
svg: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const externalIconId: (prefix: string, name: string) => string;
|
|
25
|
+
export declare const isExternalIconId: (id: string) => boolean;
|
|
26
|
+
/** Bumps whenever the registry changes; lets a cache of derived views know. */
|
|
27
|
+
export declare const externalIconsVersion: () => number;
|
|
28
|
+
/** Test seam: force a hash function, to provoke collisions. `null` restores the real one. */
|
|
29
|
+
export declare function setIconHashForTest(fn: ((text: string) => string) | null): void;
|
|
30
|
+
/** The sanitised markup, or null when it cannot be made safe. */
|
|
31
|
+
export declare function cleanIconSvg(svg: unknown): string | null;
|
|
32
|
+
/**
|
|
33
|
+
* The registry key of an icon: its catalog id plus a hash of its sanitised
|
|
34
|
+
* markup (`iconify:lets:tree@1abc…`), or null when the markup is not safe.
|
|
35
|
+
* Two documents can carry different markup for the same catalog id; the
|
|
36
|
+
* content decides which icon is drawn, so neither changes the other's.
|
|
37
|
+
*/
|
|
38
|
+
export declare function externalIconKey(id: string, svg: unknown): string | null;
|
|
39
|
+
/** Registers the (sanitised) icon and returns its key; null when it is not an external icon or not safe. */
|
|
40
|
+
export declare function registerExternalIcon(id: string, svg: string, source: IconSource | null): string | null;
|
|
41
|
+
export declare function getExternalIcon(key: string): Entry | null;
|
|
42
|
+
/** The registered icons by key, for the renderer's lookup map. */
|
|
43
|
+
export declare function externalIconDefs(): Record<string, IconDef>;
|
|
44
|
+
/** Test seam: forget every registered icon. */
|
|
45
|
+
export declare function resetExternalIcons(): void;
|
|
46
|
+
export interface StoredIcon {
|
|
47
|
+
iconId?: string;
|
|
48
|
+
svg?: string;
|
|
49
|
+
source?: IconSource;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Registers the SVG a document carries for each of its external icons, so the
|
|
53
|
+
* renderer can draw them after a reload or on a collaborator's screen.
|
|
54
|
+
*/
|
|
55
|
+
export declare function registerStoredExternalIcons(selectedIcons: readonly string[] | undefined, iconStates: Record<string, StoredIcon> | undefined): void;
|
|
56
|
+
/** The SVG as a data URL of `size` px, `currentColor` replaced by `color`, for the canvas. */
|
|
57
|
+
export declare function externalIconDataUrl(svg: string, size: number, color: string): string;
|
|
58
|
+
/** "Icon: <Set> von <Autor>, <Lizenz>" for the picker; the "von" follows the catalogue. */
|
|
59
|
+
export declare function attributionLine(source: IconSource): string;
|
|
60
|
+
/** The sources of the external icons on one page, one entry per placed instance. */
|
|
61
|
+
export declare function pageIconSources(state: Record<string, unknown>): IconSource[];
|
|
62
|
+
/**
|
|
63
|
+
* The credit line for the icons of a design, for the share text: every set
|
|
64
|
+
* once, with its licence and a link to the licence text. Empty when none needs
|
|
65
|
+
* one. German, like `photoCreditLine`.
|
|
66
|
+
*/
|
|
67
|
+
export declare function iconCreditLine(sources: readonly IconSource[]): string;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import { messages } from '@ggraphic/editor/i18n/messages';
|
|
3
|
+
import { sanitizeSvg } from '@ggraphic/schema';
|
|
4
|
+
const NAMESPACE = 'iconify:';
|
|
5
|
+
/** Keyed by id AND content (`externalIconKey`), so one id with two markups is two icons. */
|
|
6
|
+
const registry = new Map();
|
|
7
|
+
let version = 0;
|
|
8
|
+
export const externalIconId = (prefix, name) => `${NAMESPACE}${prefix}:${name}`;
|
|
9
|
+
export const isExternalIconId = (id) => id.startsWith(NAMESPACE);
|
|
10
|
+
/** Bumps whenever the registry changes; lets a cache of derived views know. */
|
|
11
|
+
export const externalIconsVersion = () => version;
|
|
12
|
+
let hashOverride = null;
|
|
13
|
+
/** Test seam: force a hash function, to provoke collisions. `null` restores the real one. */
|
|
14
|
+
export function setIconHashForTest(fn) {
|
|
15
|
+
hashOverride = fn;
|
|
16
|
+
}
|
|
17
|
+
/** A short non-cryptographic hash (cyrb53): enough to tell two markups apart. */
|
|
18
|
+
function shortHash(text) {
|
|
19
|
+
return hashOverride ? hashOverride(text) : cyrb53(text);
|
|
20
|
+
}
|
|
21
|
+
function cyrb53(text) {
|
|
22
|
+
let h1 = 0xdeadbeef;
|
|
23
|
+
let h2 = 0x41c6ce57;
|
|
24
|
+
for (let i = 0; i < text.length; i++) {
|
|
25
|
+
const ch = text.charCodeAt(i);
|
|
26
|
+
h1 = Math.imul(h1 ^ ch, 2654435761);
|
|
27
|
+
h2 = Math.imul(h2 ^ ch, 1597334677);
|
|
28
|
+
}
|
|
29
|
+
h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909);
|
|
30
|
+
h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);
|
|
31
|
+
return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(36);
|
|
32
|
+
}
|
|
33
|
+
/** Sanitising is the expensive part; a page redraws often, so remember the answers. */
|
|
34
|
+
const cleaned = new Map();
|
|
35
|
+
const MAX_CLEANED = 500;
|
|
36
|
+
/** The sanitised markup, or null when it cannot be made safe. */
|
|
37
|
+
export function cleanIconSvg(svg) {
|
|
38
|
+
if (typeof svg !== 'string')
|
|
39
|
+
return null;
|
|
40
|
+
if (cleaned.has(svg))
|
|
41
|
+
return cleaned.get(svg) ?? null;
|
|
42
|
+
const result = sanitizeSvg(svg);
|
|
43
|
+
if (cleaned.size >= MAX_CLEANED)
|
|
44
|
+
cleaned.clear();
|
|
45
|
+
cleaned.set(svg, result);
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The registry key of an icon: its catalog id plus a hash of its sanitised
|
|
50
|
+
* markup (`iconify:lets:tree@1abc…`), or null when the markup is not safe.
|
|
51
|
+
* Two documents can carry different markup for the same catalog id; the
|
|
52
|
+
* content decides which icon is drawn, so neither changes the other's.
|
|
53
|
+
*/
|
|
54
|
+
export function externalIconKey(id, svg) {
|
|
55
|
+
const clean = cleanIconSvg(svg);
|
|
56
|
+
return clean === null ? null : keyFor(id, clean);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* `id@hash`, unless that key already belongs to different markup: a collision. Then the
|
|
60
|
+
* full markup is the key, so neither icon can stand in for the other.
|
|
61
|
+
*/
|
|
62
|
+
function keyFor(id, clean) {
|
|
63
|
+
const key = `${id}@${shortHash(clean)}`;
|
|
64
|
+
const taken = registry.get(key);
|
|
65
|
+
return taken && taken.svg !== clean ? `${id}@${clean}` : key;
|
|
66
|
+
}
|
|
67
|
+
const formatName = (name) => name
|
|
68
|
+
.split('-')
|
|
69
|
+
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
|
|
70
|
+
.join(' ');
|
|
71
|
+
/** Registers the (sanitised) icon and returns its key; null when it is not an external icon or not safe. */
|
|
72
|
+
export function registerExternalIcon(id, svg, source) {
|
|
73
|
+
const clean = cleanIconSvg(svg);
|
|
74
|
+
if (!isExternalIconId(id) || clean === null)
|
|
75
|
+
return null;
|
|
76
|
+
const key = keyFor(id, clean);
|
|
77
|
+
if (registry.has(key))
|
|
78
|
+
return key;
|
|
79
|
+
const name = source?.name ?? id.slice(id.lastIndexOf(':') + 1);
|
|
80
|
+
registry.set(key, {
|
|
81
|
+
svg: clean,
|
|
82
|
+
def: { id: key, name: formatName(name), library: source?.setTitle ?? 'Iconify' },
|
|
83
|
+
});
|
|
84
|
+
version++;
|
|
85
|
+
return key;
|
|
86
|
+
}
|
|
87
|
+
export function getExternalIcon(key) {
|
|
88
|
+
return registry.get(key) ?? null;
|
|
89
|
+
}
|
|
90
|
+
/** The registered icons by key, for the renderer's lookup map. */
|
|
91
|
+
export function externalIconDefs() {
|
|
92
|
+
return Object.fromEntries([...registry].map(([id, entry]) => [id, entry.def]));
|
|
93
|
+
}
|
|
94
|
+
/** Test seam: forget every registered icon. */
|
|
95
|
+
export function resetExternalIcons() {
|
|
96
|
+
registry.clear();
|
|
97
|
+
cleaned.clear();
|
|
98
|
+
version++;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Registers the SVG a document carries for each of its external icons, so the
|
|
102
|
+
* renderer can draw them after a reload or on a collaborator's screen.
|
|
103
|
+
*/
|
|
104
|
+
export function registerStoredExternalIcons(selectedIcons, iconStates) {
|
|
105
|
+
for (const instanceId of selectedIcons ?? []) {
|
|
106
|
+
const state = iconStates?.[instanceId];
|
|
107
|
+
const catalogId = state?.iconId ?? instanceId;
|
|
108
|
+
if (state?.svg && isExternalIconId(catalogId)) {
|
|
109
|
+
registerExternalIcon(catalogId, state.svg, state.source ?? null);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/** UTF-8 safe base64: `btoa` alone throws on anything beyond Latin-1. */
|
|
114
|
+
function toBase64(text) {
|
|
115
|
+
const bytes = new TextEncoder().encode(text);
|
|
116
|
+
let binary = '';
|
|
117
|
+
for (const byte of bytes)
|
|
118
|
+
binary += String.fromCharCode(byte);
|
|
119
|
+
return btoa(binary);
|
|
120
|
+
}
|
|
121
|
+
const SAFE_COLOR = /^(?:#[0-9a-f]{3,8}|(?:rgb|hsl)a?\(\s*[\d.%\s,/-]+\)|[a-z]{3,30})$/i;
|
|
122
|
+
/** A colour that cannot break out of an attribute: hex, rgb(a), hsl(a) or a name. */
|
|
123
|
+
const isSafeColor = (color) => SAFE_COLOR.test(color);
|
|
124
|
+
/** The SVG as a data URL of `size` px, `currentColor` replaced by `color`, for the canvas. */
|
|
125
|
+
export function externalIconDataUrl(svg, size, color) {
|
|
126
|
+
const ink = isSafeColor(color) ? color : '#000000';
|
|
127
|
+
const sized = svg.replace(/<svg\b([^>]*?)(\/?)>/i, (_match, attrs, close) => {
|
|
128
|
+
const rest = attrs.replace(/\s(?:width|height)="[^"]*"/gi, '');
|
|
129
|
+
return `<svg${rest} width="${size}" height="${size}"${close}>`;
|
|
130
|
+
});
|
|
131
|
+
return `data:image/svg+xml;base64,${toBase64(sized.replace(/currentColor/g, () => ink))}`;
|
|
132
|
+
}
|
|
133
|
+
/** "Icon: <Set> von <Autor>, <Lizenz>" for the picker; the "von" follows the catalogue. */
|
|
134
|
+
export function attributionLine(source) {
|
|
135
|
+
const by = source.author ? messages().credit.by(source.author) : '';
|
|
136
|
+
return `Icon: ${source.setTitle}${by}, ${source.licence}`;
|
|
137
|
+
}
|
|
138
|
+
/** The sources of the external icons on one page, one entry per placed instance. */
|
|
139
|
+
export function pageIconSources(state) {
|
|
140
|
+
const selected = state['selectedIcons'] ?? [];
|
|
141
|
+
const states = state['iconStates'] ?? {};
|
|
142
|
+
return selected.flatMap((id) => {
|
|
143
|
+
const source = states[id]?.source;
|
|
144
|
+
return source ? [source] : [];
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
/** Public domain asks for no credit; every other licence (MIT, Apache, CC BY …) does. */
|
|
148
|
+
const NEEDS_NO_CREDIT = /^(CC0(-|$)|Unlicense$)/i;
|
|
149
|
+
/**
|
|
150
|
+
* The credit line for the icons of a design, for the share text: every set
|
|
151
|
+
* once, with its licence and a link to the licence text. Empty when none needs
|
|
152
|
+
* one. German, like `photoCreditLine`.
|
|
153
|
+
*/
|
|
154
|
+
export function iconCreditLine(sources) {
|
|
155
|
+
const seen = new Set();
|
|
156
|
+
const entries = [];
|
|
157
|
+
for (const source of sources) {
|
|
158
|
+
const key = `${source.prefix}\0${source.licence}`;
|
|
159
|
+
if (NEEDS_NO_CREDIT.test(source.licence) || seen.has(key))
|
|
160
|
+
continue;
|
|
161
|
+
seen.add(key);
|
|
162
|
+
const by = source.author ? messages().credit.by(source.author) : '';
|
|
163
|
+
entries.push(`${source.setTitle}${by} (${source.licence}, https://spdx.org/licenses/${encodeURIComponent(source.licence)}.html)`);
|
|
164
|
+
}
|
|
165
|
+
if (entries.length === 0)
|
|
166
|
+
return '';
|
|
167
|
+
return `${entries.length > 1 ? 'Icons' : 'Icon'}: ${entries.join(', ')}`;
|
|
168
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Konva from 'konva';
|
|
2
|
+
/**
|
|
3
|
+
* On a canvas drawn only to be captured once (a gallery or page preview): the output pixels per
|
|
4
|
+
* page pixel of that capture. Null in the editor.
|
|
5
|
+
*
|
|
6
|
+
* Konva runs an image's filters over its cache, and `cache()` without a ratio sizes that cache at
|
|
7
|
+
* page size times the device ratio: a portrait photo is filtered over 2160 × 2700 pixels for a
|
|
8
|
+
* preview drawn 400 px wide. Measured at 4x CPU throttling, 01.11.2026: a duotone photo held one
|
|
9
|
+
* frame for 308 ms. A preview caches at what it draws or what it captures, whichever is larger,
|
|
10
|
+
* so a full-size capture (the render gate) stays sharp. The editor keeps the full cache, so
|
|
11
|
+
* zooming in stays sharp.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PreviewRenderContext: import("react").Context<number | null>;
|
|
14
|
+
export declare function usePreviewCaptureRatio(): number | null;
|
|
15
|
+
/** Caches a filtered node; on a preview at the resolution it is drawn or captured at. */
|
|
16
|
+
export declare function cacheFiltered(node: Konva.Node, captureRatio: number | null): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import Konva from 'konva';
|
|
3
|
+
import { createContext, useContext } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* On a canvas drawn only to be captured once (a gallery or page preview): the output pixels per
|
|
6
|
+
* page pixel of that capture. Null in the editor.
|
|
7
|
+
*
|
|
8
|
+
* Konva runs an image's filters over its cache, and `cache()` without a ratio sizes that cache at
|
|
9
|
+
* page size times the device ratio: a portrait photo is filtered over 2160 × 2700 pixels for a
|
|
10
|
+
* preview drawn 400 px wide. Measured at 4x CPU throttling, 01.11.2026: a duotone photo held one
|
|
11
|
+
* frame for 308 ms. A preview caches at what it draws or what it captures, whichever is larger,
|
|
12
|
+
* so a full-size capture (the render gate) stays sharp. The editor keeps the full cache, so
|
|
13
|
+
* zooming in stays sharp.
|
|
14
|
+
*/
|
|
15
|
+
export const PreviewRenderContext = createContext(null);
|
|
16
|
+
export function usePreviewCaptureRatio() {
|
|
17
|
+
return useContext(PreviewRenderContext);
|
|
18
|
+
}
|
|
19
|
+
/** Caches a filtered node; on a preview at the resolution it is drawn or captured at. */
|
|
20
|
+
export function cacheFiltered(node, captureRatio) {
|
|
21
|
+
if (captureRatio === null) {
|
|
22
|
+
node.cache();
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const absolute = node.getAbsoluteScale().x;
|
|
26
|
+
// The stage carries the display scale; what remains is the node's scale within the page.
|
|
27
|
+
const withinPage = absolute / (node.getStage()?.scaleX() || 1);
|
|
28
|
+
node.cache({
|
|
29
|
+
pixelRatio: Math.max(absolute * Konva.pixelRatio, withinPage * captureRatio),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import { foldUmlauts, GERMAN_PLURAL_ENDINGS, translateWord } from './searchTranslations.js';
|
|
3
|
+
const TAG_WEIGHT = 0.85;
|
|
4
|
+
const INFLECTIONS = new Set(['s', 'es', 'ed', 'er', 'ing']);
|
|
5
|
+
const PLURALS = new Set(GERMAN_PLURAL_ENDINGS);
|
|
6
|
+
const VARIANT_WORDS = new Set(['filled', 'fill', 'solid', 'line', 'outline', 'off', 'alt']);
|
|
7
|
+
const toWords = (text) => foldUmlauts(text)
|
|
8
|
+
.split(/[^a-z0-9]+/)
|
|
9
|
+
.filter(Boolean);
|
|
10
|
+
function compileQuery(query) {
|
|
11
|
+
return toWords(query).map((word) => {
|
|
12
|
+
const { terms, exact } = translateWord(word);
|
|
13
|
+
const base = exact ? 0.95 : 0.6;
|
|
14
|
+
return [
|
|
15
|
+
{ text: word, weight: 1, literal: true },
|
|
16
|
+
...terms.map((text, i) => ({ text, weight: i === 0 ? base : base - 0.1, literal: false })),
|
|
17
|
+
];
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function termScore(term, words) {
|
|
21
|
+
let best = 0;
|
|
22
|
+
for (const word of words) {
|
|
23
|
+
if (word === term.text)
|
|
24
|
+
return term.weight;
|
|
25
|
+
if (term.literal) {
|
|
26
|
+
// German compounds: "sonne" finds "Sonnenblume", "blume" finds "Sonnenblume".
|
|
27
|
+
if (term.text.length >= 3 && word.startsWith(term.text))
|
|
28
|
+
best = Math.max(best, 0.7);
|
|
29
|
+
else if (term.text.length >= 4 && word.endsWith(term.text))
|
|
30
|
+
best = Math.max(best, 0.6);
|
|
31
|
+
// Short compound heads ("rad" in "Zahnrad") are noisier ("eis" in "Kreis"): rank them last.
|
|
32
|
+
else if (term.text.length === 3 && word.endsWith(term.text))
|
|
33
|
+
best = Math.max(best, 0.4);
|
|
34
|
+
// German plural typed, singular stored: "menschen" finds the tag "mensch".
|
|
35
|
+
else if (word.length >= 4 &&
|
|
36
|
+
term.text.startsWith(word) &&
|
|
37
|
+
PLURALS.has(term.text.slice(word.length)))
|
|
38
|
+
best = Math.max(best, 0.7);
|
|
39
|
+
}
|
|
40
|
+
else if (word.startsWith(term.text) && INFLECTIONS.has(word.slice(term.text.length))) {
|
|
41
|
+
// Inflections only ("tree" → "trees"), not other words ("car" → "cart", "star" → "stark").
|
|
42
|
+
best = Math.max(best, term.weight * 0.8);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return best;
|
|
46
|
+
}
|
|
47
|
+
function scoreMatch(query, name, tags = []) {
|
|
48
|
+
if (query.length === 0)
|
|
49
|
+
return 0;
|
|
50
|
+
const nameWords = toWords(name);
|
|
51
|
+
const tagWords = tags.flatMap(toWords);
|
|
52
|
+
let total = 0;
|
|
53
|
+
for (const terms of query) {
|
|
54
|
+
let best = 0;
|
|
55
|
+
let corroborating = 0;
|
|
56
|
+
for (const term of terms) {
|
|
57
|
+
const score = Math.max(termScore(term, nameWords), termScore(term, tagWords) * TAG_WEIGHT);
|
|
58
|
+
if (score > 0)
|
|
59
|
+
corroborating++;
|
|
60
|
+
best = Math.max(best, score);
|
|
61
|
+
}
|
|
62
|
+
if (best === 0)
|
|
63
|
+
return 0;
|
|
64
|
+
// Several terms of one word agreeing ("fahrrad", "bicycle", "bike") lift an item
|
|
65
|
+
// above one that shares only a broad keyword, e.g. a photo's category.
|
|
66
|
+
total += best + Math.min(corroborating - 1, 2) * 0.05;
|
|
67
|
+
}
|
|
68
|
+
// The whole name IS the query, as typed or in its main translation: "Car" for "auto".
|
|
69
|
+
const phrase = nameWords.join(' ');
|
|
70
|
+
const typed = query.map((terms) => terms[0].text).join(' ');
|
|
71
|
+
const translated = query.map((terms) => (terms[1] ?? terms[0]).text).join(' ');
|
|
72
|
+
if (phrase === typed || phrase === translated)
|
|
73
|
+
total += 0.5;
|
|
74
|
+
const variants = nameWords.filter((w) => VARIANT_WORDS.has(w) || /^\d+$/.test(w)).length;
|
|
75
|
+
return total - variants * 0.05 - nameWords.length * 0.01;
|
|
76
|
+
}
|
|
77
|
+
/** Items matching the query, best match first; ties keep catalogue order. */
|
|
78
|
+
export function rankByQuery(items, query, fields) {
|
|
79
|
+
const compiled = compileQuery(query);
|
|
80
|
+
if (compiled.length === 0)
|
|
81
|
+
return [];
|
|
82
|
+
const scored = [];
|
|
83
|
+
for (const item of items) {
|
|
84
|
+
const score = scoreMatch(compiled, ...fields(item));
|
|
85
|
+
if (score > 0)
|
|
86
|
+
scored.push({ item, score });
|
|
87
|
+
}
|
|
88
|
+
return scored.sort((a, b) => b.score - a.score).map((s) => s.item);
|
|
89
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hält ein an `document.body` gehängtes Eingabefeld über seinem Text, solange
|
|
3
|
+
* die Bühne wandert oder sich ändert: Scrollen eines Vorfahren, Fenstergröße,
|
|
4
|
+
* Zoom, ein aufklappendes Seitenpanel (WCAG 1.4.4 / 1.4.10).
|
|
5
|
+
*
|
|
6
|
+
* `ResizeObserver` meldet reine Lageverschiebungen nicht — das Panel schiebt
|
|
7
|
+
* den Container, ohne ihn zu vergrössern. Darum werden auch sein Elternelement
|
|
8
|
+
* und die Editor-Fläche beobachtet: deren Grösse ändert sich, wenn das Panel
|
|
9
|
+
* Platz nimmt. Mehrere Auslöser im selben Frame ergeben ein einziges
|
|
10
|
+
* `reposition`. Der Rückgabewert räumt alles ab.
|
|
11
|
+
*/
|
|
12
|
+
const EDITOR_ROOT = '.canvas-editor-layout';
|
|
13
|
+
export function followStage(stage, reposition) {
|
|
14
|
+
const container = stage.container();
|
|
15
|
+
let frame = 0;
|
|
16
|
+
const schedule = () => {
|
|
17
|
+
if (frame)
|
|
18
|
+
return;
|
|
19
|
+
frame = requestAnimationFrame(() => {
|
|
20
|
+
frame = 0;
|
|
21
|
+
reposition();
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);
|
|
25
|
+
if (observer) {
|
|
26
|
+
const watched = new Set([container]);
|
|
27
|
+
if (container.parentElement)
|
|
28
|
+
watched.add(container.parentElement);
|
|
29
|
+
const root = container.closest(EDITOR_ROOT);
|
|
30
|
+
if (root)
|
|
31
|
+
watched.add(root);
|
|
32
|
+
watched.forEach((element) => observer.observe(element));
|
|
33
|
+
}
|
|
34
|
+
// Capture-Phase: `scroll` blubbert nicht, so kommt das Scrollen jedes Vorfahren an.
|
|
35
|
+
window.addEventListener('scroll', schedule, { capture: true, passive: true });
|
|
36
|
+
window.addEventListener('resize', schedule);
|
|
37
|
+
window.visualViewport?.addEventListener('resize', schedule);
|
|
38
|
+
window.visualViewport?.addEventListener('scroll', schedule);
|
|
39
|
+
return () => {
|
|
40
|
+
cancelAnimationFrame(frame);
|
|
41
|
+
frame = 0;
|
|
42
|
+
observer?.disconnect();
|
|
43
|
+
window.removeEventListener('scroll', schedule, { capture: true });
|
|
44
|
+
window.removeEventListener('resize', schedule);
|
|
45
|
+
window.visualViewport?.removeEventListener('resize', schedule);
|
|
46
|
+
window.visualViewport?.removeEventListener('scroll', schedule);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FONT_FAMILY_ALIASES } from '@ggraphic/core';
|
|
2
|
+
export { FONT_FAMILY_ALIASES };
|
|
3
|
+
/**
|
|
4
|
+
* A single family mapped to its current family. A family a registered brand
|
|
5
|
+
* pack declares stays as it is: the host ships that font, so the alias would
|
|
6
|
+
* only swap it for one the host does not load.
|
|
7
|
+
*/
|
|
8
|
+
export declare function aliasFontFamily(family: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* A family name or CSS stack ("PT Sans, Arial, sans-serif") with every
|
|
11
|
+
* aliased entry replaced. Unknown families and the fallback entries pass
|
|
12
|
+
* through unchanged.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveFontFamily(fontFamily: string): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import { FONT_FAMILY_ALIASES, aliasFontFamily as aliasReplacedFamily } from '@ggraphic/core';
|
|
3
|
+
import { declaredFontFamilies } from '../brand/brandRegistry.js';
|
|
4
|
+
export { FONT_FAMILY_ALIASES };
|
|
5
|
+
/**
|
|
6
|
+
* A single family mapped to its current family. A family a registered brand
|
|
7
|
+
* pack declares stays as it is: the host ships that font, so the alias would
|
|
8
|
+
* only swap it for one the host does not load.
|
|
9
|
+
*/
|
|
10
|
+
export function aliasFontFamily(family) {
|
|
11
|
+
return declaredFontFamilies().has(family) ? family : aliasReplacedFamily(family);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A family name or CSS stack ("PT Sans, Arial, sans-serif") with every
|
|
15
|
+
* aliased entry replaced. Unknown families and the fallback entries pass
|
|
16
|
+
* through unchanged.
|
|
17
|
+
*/
|
|
18
|
+
export function resolveFontFamily(fontFamily) {
|
|
19
|
+
if (!fontFamily)
|
|
20
|
+
return fontFamily;
|
|
21
|
+
return fontFamily
|
|
22
|
+
.split(',')
|
|
23
|
+
.map((part) => {
|
|
24
|
+
const trimmed = part.trim();
|
|
25
|
+
const bare = trimmed.replace(/^['"]|['"]$/g, '');
|
|
26
|
+
const target = aliasFontFamily(bare);
|
|
27
|
+
if (target === bare)
|
|
28
|
+
return part;
|
|
29
|
+
return trimmed === bare ? target : `"${target}"`;
|
|
30
|
+
})
|
|
31
|
+
.join(',');
|
|
32
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Welche Auszeichnung eine Schrift tragen kann — abgeleitet aus den
|
|
3
|
+
* `@font-face`-Regeln in `styles/typography.css`, nicht je Vorlage gepflegt.
|
|
4
|
+
*
|
|
5
|
+
* Grund für die Ableitung: Fett und Kursiv brauchen einen ECHTEN Schnitt.
|
|
6
|
+
* Fehlt er, synthetisiert der Browser einen (schräggestellt bzw. verfettet),
|
|
7
|
+
* der Server-Renderer kennt diese Synthese nicht — Vorschau und Export liefen
|
|
8
|
+
* in Breite und Umbruch auseinander. Eine Liste je Vorlage hätte dieselbe
|
|
9
|
+
* Frage an 24 Stellen beantwortet und wäre beim nächsten Schriftwechsel
|
|
10
|
+
* stillschweigend falsch geworden.
|
|
11
|
+
*
|
|
12
|
+
* Unterstreichung steht NICHT hier: sie ist keine Schriftvariante, sondern
|
|
13
|
+
* wird gezeichnet (Konva `textDecoration`) und gilt deshalb für jede Schrift. Aufzählungen
|
|
14
|
+
* ebenso — sie sind Umbruch, kein Schnitt.
|
|
15
|
+
*
|
|
16
|
+
* `fontFamily` kommt als CSS-Stapel („Instrument Sans, Arial, sans-serif"); gewertet
|
|
17
|
+
* wird die erste Familie, denn die zeichnet, solange sie geladen ist.
|
|
18
|
+
*/
|
|
19
|
+
export interface FontMarkSupport {
|
|
20
|
+
bold: boolean;
|
|
21
|
+
italic: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** Erste Familie aus einem CSS-Stapel, ohne Anführungszeichen. */
|
|
24
|
+
export declare function primaryFontFamily(fontFamily: string): string;
|
|
25
|
+
export declare function fontMarkSupport(fontFamily: string): FontMarkSupport;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
import { aliasFontFamily } from './fontAliases.js';
|
|
3
|
+
/**
|
|
4
|
+
* Familien mit echten Schnitten. Alles, was hier fehlt, bekommt weder Fett
|
|
5
|
+
* noch Kursiv angeboten — der sichere Standard, wenn jemand eine Schrift
|
|
6
|
+
* hinzufügt und diese Tabelle vergisst.
|
|
7
|
+
*
|
|
8
|
+
* Ein Schnitt, der als eigene Familie deklariert ist, ist bewusst NICHT der
|
|
9
|
+
* Fettschnitt seiner Grundfamilie: `font-weight: bold` auf der Grundfamilie
|
|
10
|
+
* träfe keinen von ihnen.
|
|
11
|
+
*
|
|
12
|
+
* Ersetzte Familien laufen vorher durch `aliasFontFamily`.
|
|
13
|
+
*/
|
|
14
|
+
const FACES = {
|
|
15
|
+
'Instrument Sans': { bold: true, italic: true },
|
|
16
|
+
Fraunces: { bold: true, italic: true },
|
|
17
|
+
'Bricolage Grotesque': { bold: true, italic: false },
|
|
18
|
+
};
|
|
19
|
+
const NONE = { bold: false, italic: false };
|
|
20
|
+
/** Erste Familie aus einem CSS-Stapel, ohne Anführungszeichen. */
|
|
21
|
+
export function primaryFontFamily(fontFamily) {
|
|
22
|
+
return aliasFontFamily((fontFamily.split(',')[0] ?? '').trim().replace(/^['"]|['"]$/g, ''));
|
|
23
|
+
}
|
|
24
|
+
export function fontMarkSupport(fontFamily) {
|
|
25
|
+
return FACES[primaryFontFamily(fontFamily)] ?? NONE;
|
|
26
|
+
}
|