@ggraphic/editor 0.1.0-alpha.1 → 0.1.0-alpha.2
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/README.md +4 -4
- package/THIRD_PARTY_NOTICES +12 -3
- package/dist/CanvasEditorProvider.d.ts +8 -8
- package/dist/ai/applyOperation.d.ts +6 -6
- package/dist/ai/applyOperation.js +4 -4
- package/dist/ai/describeCanvasElements.d.ts +2 -2
- package/dist/ai/describeCanvasElements.js +4 -4
- package/dist/ai/illustrationCapability.d.ts +1 -1
- package/dist/ai/illustrationCapability.js +1 -1
- package/dist/blocks/liftedBlock.d.ts +5 -5
- package/dist/blocks/liftedBlock.js +2 -2
- package/dist/collab/useSelectionAwareness.js +3 -3
- package/dist/collab/useYjsPageStateSync.js +1 -1
- package/dist/collab/useYjsPages.d.ts +2 -2
- package/dist/collab/useYjsPages.js +4 -4
- package/dist/collab/yjsBinding.js +1 -1
- package/dist/common/Lightbox.js +2 -2
- package/dist/components/AddPageButton.js +2 -2
- package/dist/components/CanvasContextMenu/CanvasActionSheet.d.ts +1 -1
- package/dist/components/CanvasContextMenu/CanvasActionSheet.js +4 -4
- package/dist/components/CanvasContextMenu/CanvasContextMenu.d.ts +2 -2
- package/dist/components/CanvasContextMenu/canvasMenuModel.d.ts +1 -1
- package/dist/components/CanvasContextMenu/canvasMenuModel.js +2 -2
- package/dist/components/CanvasEditor/CanvasEditorShell.d.ts +2 -2
- package/dist/components/CanvasEditor/CanvasEditorShell.js +99 -76
- package/dist/components/CanvasEditor/PageWrapper.d.ts +1 -1
- package/dist/components/CanvasEditor/PageWrapper.js +16 -16
- package/dist/components/CanvasEditor/blockInsertContext.d.ts +2 -2
- package/dist/components/CanvasEditor/editorShell.d.ts +5 -5
- package/dist/components/CanvasEditor/hooks/useCanvasContextMenu.d.ts +1 -1
- package/dist/components/CanvasEditor/hooks/useCanvasContextMenu.js +3 -3
- package/dist/components/CanvasEditor/hooks/useLoadedConfigs.d.ts +1 -1
- package/dist/components/CanvasEditor/hooks/usePageRefs.d.ts +1 -1
- package/dist/components/CanvasEditor/hooks/usePageUndoRedoShortcuts.d.ts +1 -1
- package/dist/components/CanvasEditor/hooks/usePageUndoRedoShortcuts.js +2 -2
- package/dist/components/CanvasEditor/hooks/usePrintImpressumGate.d.ts +1 -1
- package/dist/components/CanvasEditor/hooks/usePrintImpressumGate.js +5 -5
- package/dist/components/CanvasEditor/hooks/useToolbarHandlers.d.ts +9 -9
- package/dist/components/CanvasEditor/hooks/useToolbarHandlers.js +1 -1
- package/dist/components/CanvasEditor/hooks/useWorkAreaDeselect.js +1 -1
- package/dist/components/CanvasEditor/layersTab.js +1 -1
- package/dist/components/CanvasEditor/mobileSelectionArea.d.ts +1 -1
- package/dist/components/CanvasEditor/types.d.ts +15 -6
- package/dist/components/CanvasEditorSkeleton.js +3 -3
- package/dist/components/CanvasMetaBar.js +1 -1
- package/dist/components/CanvasRenderLayer.d.ts +3 -3
- package/dist/components/CanvasRenderLayer.js +5 -5
- package/dist/components/CanvasTextOverlay.js +5 -5
- package/dist/components/ConfigCanvas.js +1 -1
- package/dist/components/CropGhostOverlay.js +1 -1
- package/dist/components/CustomColorSwatch.js +3 -3
- package/dist/components/GenericCanvas.d.ts +10 -10
- package/dist/components/GenericCanvas.js +41 -30
- package/dist/components/GenericCanvasElement.d.ts +2 -2
- package/dist/components/GenericCanvasElement.js +7 -7
- package/dist/components/MultiSelectionTransformer.js +4 -4
- package/dist/components/PagePreview.js +2 -2
- package/dist/components/PageThumbnailStrip.d.ts +1 -1
- package/dist/components/PageThumbnailStrip.js +2 -2
- package/dist/components/PageToolbar.js +1 -1
- package/dist/components/RichTextField.js +4 -4
- package/dist/components/SelectionPill.d.ts +1 -1
- package/dist/components/SelectionPill.js +5 -5
- package/dist/components/SlideNotesPanel.js +1 -1
- package/dist/components/StandaloneCanvas.d.ts +3 -3
- package/dist/components/StandaloneCanvas.js +3 -3
- package/dist/components/TextFormatButtons.js +4 -4
- package/dist/components/TextFormatControls.js +1 -1
- package/dist/components/Toolbar.js +5 -5
- package/dist/components/ToolbarStateBridge.d.ts +4 -4
- package/dist/components/ToolbarStateBridge.js +4 -4
- package/dist/components/TopBar/AutoSaveIndicator.js +3 -3
- package/dist/components/TopBar/ContextControls.d.ts +8 -8
- package/dist/components/TopBar/ContextControls.js +18 -18
- package/dist/components/TopBar/ContextToolbar.d.ts +1 -1
- package/dist/components/TopBar/ContextToolbar.js +2 -2
- package/dist/components/TopBar/CropModeControls.d.ts +1 -1
- package/dist/components/TopBar/CropModeControls.js +4 -4
- package/dist/components/TopBar/DownloadSection.d.ts +3 -3
- package/dist/components/TopBar/DownloadSection.js +19 -19
- package/dist/components/TopBar/MobileSelectionBar.d.ts +1 -1
- package/dist/components/TopBar/MobileSelectionBar.js +7 -7
- package/dist/components/TopBar/MobileSelectionControls.d.ts +1 -1
- package/dist/components/TopBar/MobileSelectionControls.js +6 -6
- package/dist/components/TopBar/MultiSelectionToolbar.d.ts +1 -1
- package/dist/components/TopBar/MultiSelectionToolbar.js +4 -4
- package/dist/components/TopBar/ShareDropdown.js +11 -11
- package/dist/components/TopBar/barTiles.js +1 -1
- package/dist/components/TopBar/modules/FloatingAiSuggestionBanner.d.ts +1 -1
- package/dist/components/TopBar/modules/FloatingAiSuggestionBanner.js +4 -4
- package/dist/components/TopBar/modules/FloatingBackgroundControls.d.ts +2 -2
- package/dist/components/TopBar/modules/FloatingBackgroundControls.js +9 -9
- package/dist/components/TopBar/modules/FloatingColorPicker.d.ts +1 -1
- package/dist/components/TopBar/modules/FloatingColorPicker.js +6 -6
- package/dist/components/TopBar/modules/FloatingFontRoleControl.js +5 -5
- package/dist/components/TopBar/modules/FloatingFontSizeControl.js +2 -2
- package/dist/components/TopBar/modules/FloatingHistoryControls.js +1 -1
- package/dist/components/TopBar/modules/FloatingImageLookControl.d.ts +1 -1
- package/dist/components/TopBar/modules/FloatingImageLookControl.js +2 -2
- package/dist/components/TopBar/modules/FloatingLayerControls.js +1 -1
- package/dist/components/TopBar/modules/FloatingOpacityControl.js +3 -3
- package/dist/components/TopBar/modules/FloatingPositionControl.d.ts +1 -1
- package/dist/components/TopBar/modules/FloatingPositionControl.js +5 -5
- package/dist/components/TopBar/modules/FloatingTextAlignControl.d.ts +1 -1
- package/dist/components/TopBar/modules/FloatingTextAlignControl.js +3 -3
- package/dist/components/kindRenderers.d.ts +6 -6
- package/dist/components/kindRenderers.js +9 -9
- package/dist/components/markerMark.js +1 -1
- package/dist/composer/cardFollowsText.d.ts +2 -2
- package/dist/composer/cardFollowsText.js +1 -1
- package/dist/composer/steckbriefLayout.d.ts +1 -1
- package/dist/composer/steckbriefLayout.js +1 -1
- package/dist/configs/buildCanvasText.d.ts +5 -0
- package/dist/configs/buildCanvasText.js +58 -0
- package/dist/configs/buildSharepicText.d.ts +2 -5
- package/dist/configs/buildSharepicText.js +2 -57
- package/dist/configs/configLoader.d.ts +1 -1
- package/dist/configs/configLoader.js +2 -2
- package/dist/configs/factory/actionFactories.d.ts +11 -11
- package/dist/configs/factory/actionFactories.js +13 -13
- package/dist/configs/factory/baseTypes.d.ts +10 -10
- package/dist/configs/factory/carryInstanceState.d.ts +8 -8
- package/dist/configs/factory/carryInstanceState.js +2 -2
- package/dist/configs/factory/createTextElement.d.ts +1 -1
- package/dist/configs/factory/createTextElement.js +1 -1
- package/dist/configs/factory/defineSection.d.ts +1 -1
- package/dist/configs/factory/layoutAccessors.d.ts +1 -1
- package/dist/configs/featureInjector.d.ts +2 -2
- package/dist/configs/featureInjector.js +2 -2
- package/dist/configs/placeholders.js +1 -1
- package/dist/configs/shareSection.d.ts +3 -3
- package/dist/configs/shareSection.js +12 -8
- package/dist/configs/types.d.ts +5 -5
- package/dist/embed/EmbeddedEditor.d.ts +4 -0
- package/dist/embed/EmbeddedEditor.js +68 -0
- package/dist/embed/GgraphicEditor.d.ts +2 -0
- package/dist/embed/GgraphicEditor.js +16 -0
- package/dist/embed/index.d.ts +6 -0
- package/dist/embed/index.js +5 -0
- package/dist/embed/loadTemplatePack.d.ts +8 -0
- package/dist/embed/loadTemplatePack.js +9 -0
- package/dist/embed/types.d.ts +44 -0
- package/dist/embed/types.js +1 -0
- package/dist/entries/ai.d.ts +5 -0
- package/dist/entries/ai.js +5 -0
- package/dist/entries/brand.d.ts +4 -0
- package/dist/entries/brand.js +5 -0
- package/dist/entries/canvas.d.ts +5 -0
- package/dist/entries/canvas.js +6 -0
- package/dist/entries/collab.d.ts +6 -0
- package/dist/entries/collab.js +7 -0
- package/dist/entries/config.d.ts +12 -0
- package/dist/entries/config.js +9 -0
- package/dist/entries/elements.d.ts +21 -0
- package/dist/entries/elements.js +17 -0
- package/dist/entries/embed.d.ts +2 -0
- package/dist/entries/embed.js +7 -0
- package/dist/entries/export.d.ts +8 -0
- package/dist/entries/export.js +7 -0
- package/dist/entries/host.d.ts +30 -0
- package/dist/entries/host.js +10 -0
- package/dist/entries/hostReact.d.ts +9 -0
- package/dist/entries/hostReact.js +11 -0
- package/dist/entries/i18n.d.ts +2 -0
- package/dist/entries/i18n.js +3 -0
- package/dist/entries/illustrations/gophers.d.ts +2 -0
- package/dist/entries/illustrations/gophers.js +3 -0
- package/dist/entries/illustrations/humaaans.d.ts +2 -0
- package/dist/entries/illustrations/humaaans.js +3 -0
- package/dist/entries/illustrations/illlustrations.d.ts +2 -0
- package/dist/entries/illustrations/illlustrations.js +3 -0
- package/dist/entries/illustrations/kawaii.d.ts +2 -0
- package/dist/entries/illustrations/kawaii.js +3 -0
- package/dist/entries/illustrations/opendoodles.d.ts +2 -0
- package/dist/entries/illustrations/opendoodles.js +3 -0
- package/dist/entries/illustrations/openpeeps.d.ts +2 -0
- package/dist/entries/illustrations/openpeeps.js +3 -0
- package/dist/entries/illustrations/transhumans.d.ts +2 -0
- package/dist/entries/illustrations/transhumans.js +3 -0
- package/dist/entries/kinds.d.ts +101 -0
- package/dist/entries/kinds.js +100 -0
- package/dist/entries/page.d.ts +13 -0
- package/dist/entries/page.js +13 -0
- package/dist/entries/services.d.ts +6 -0
- package/dist/entries/services.js +4 -0
- package/dist/entries/shell.d.ts +13 -0
- package/dist/entries/shell.js +13 -0
- package/dist/entries/sidebar.d.ts +15 -0
- package/dist/entries/sidebar.js +13 -0
- package/dist/entries/store.d.ts +3 -0
- package/dist/entries/store.js +4 -0
- package/dist/entries/templates.d.ts +4 -0
- package/dist/entries/templates.js +5 -0
- package/dist/entries/text.d.ts +6 -0
- package/dist/entries/text.js +7 -0
- package/dist/export/pptx/buildPptxModel.d.ts +1 -1
- package/dist/export/pptx/buildPptxModel.js +9 -9
- package/dist/export/pptx/exportPptxDeck.d.ts +2 -2
- package/dist/export/pptx/exportPptxDeck.js +2 -2
- package/dist/export/pptx/textModel.d.ts +1 -1
- package/dist/export/pptx/textModel.js +1 -1
- package/dist/export/pptx/writePptx.d.ts +5 -2
- package/dist/export/pptx/writePptx.js +6 -3
- package/dist/export/pptx/writeText.d.ts +60 -6
- package/dist/export/pptx/writeText.js +2 -2
- package/dist/export/printExport.d.ts +1 -1
- package/dist/export/printExport.js +2 -2
- package/dist/export/slidesPdf.js +1 -1
- package/dist/formats/index.d.ts +37 -15
- package/dist/formats/index.js +51 -95
- package/dist/formats/legacyCatalog.d.ts +21 -0
- package/dist/formats/legacyCatalog.js +76 -0
- package/dist/hooks/editorBox.d.ts +20 -0
- package/dist/hooks/editorBox.js +65 -0
- package/dist/hooks/index.d.ts +13 -13
- package/dist/hooks/index.js +9 -9
- package/dist/hooks/stageFit.d.ts +24 -0
- package/dist/hooks/stageFit.js +76 -0
- package/dist/hooks/useAiImageGeneration.js +2 -2
- package/dist/hooks/useCanvasAutoSave.js +1 -1
- package/dist/hooks/useCanvasElementHandlers.d.ts +6 -6
- package/dist/hooks/useCanvasInteractions.d.ts +1 -1
- package/dist/hooks/useCanvasInteractions.js +1 -1
- package/dist/hooks/useCanvasKeyboardHandlers.d.ts +1 -1
- package/dist/hooks/useCanvasKeyboardHandlers.js +4 -4
- package/dist/hooks/useCanvasUndoRedo.js +3 -3
- package/dist/hooks/useContextPress.js +3 -3
- package/dist/hooks/useCropSession.js +1 -1
- package/dist/hooks/useDeckAutoSave.js +3 -3
- package/dist/hooks/useDeepSelect.js +2 -2
- package/dist/hooks/useFloatingModuleHandlers.d.ts +3 -3
- package/dist/hooks/useFloatingModuleHandlers.js +2 -2
- package/dist/hooks/useFloatingModuleState.d.ts +3 -3
- package/dist/hooks/useFloatingModuleState.js +1 -1
- package/dist/hooks/useFontGeneration.d.ts +1 -9
- package/dist/hooks/useFontGeneration.js +3 -48
- package/dist/hooks/useFontLoader.d.ts +1 -9
- package/dist/hooks/useFontLoader.js +2 -16
- package/dist/hooks/useIconSetsFor.js +1 -1
- package/dist/hooks/useIsCanvasMobile.d.ts +5 -1
- package/dist/hooks/useIsCanvasMobile.js +10 -2
- package/dist/hooks/useMarqueeSelection.js +2 -2
- package/dist/hooks/useMultiPageExport.d.ts +1 -1
- package/dist/hooks/useMultiPageExport.js +3 -3
- package/dist/hooks/usePageManager.d.ts +1 -1
- package/dist/hooks/usePageManager.js +4 -4
- package/dist/hooks/useSelectionAnnouncement.js +2 -2
- package/dist/hooks/useTrackUnsplashDownload.d.ts +1 -1
- package/dist/hooks/useTrackUnsplashDownload.js +1 -1
- package/dist/hostServices.d.ts +53 -31
- package/dist/hostServices.js +6 -4
- package/dist/i18n/catalogue.d.ts +21 -0
- package/dist/i18n/catalogue.js +58 -0
- package/dist/i18n/de.d.ts +14 -15
- package/dist/i18n/de.js +16 -32
- package/dist/i18n/en.js +16 -32
- package/dist/i18n/messages.d.ts +1 -13
- package/dist/i18n/messages.js +2 -52
- package/dist/layouts/CanvasEditorLayout.d.ts +1 -1
- package/dist/layouts/CanvasEditorLayout.js +11 -7
- package/dist/page/actions.d.ts +9 -9
- package/dist/page/actions.js +8 -8
- package/dist/page/config.d.ts +1 -1
- package/dist/page/config.js +52 -15
- package/dist/page/fitting.js +1 -1
- package/dist/page/hug.js +1 -1
- package/dist/page/instantiate.js +2 -2
- package/dist/page/pageState.d.ts +1 -1
- package/dist/page/pageState.js +2 -2
- package/dist/page/typography.js +1 -1
- package/dist/primitives/AssetPrimitive.d.ts +2 -2
- package/dist/primitives/AssetPrimitive.js +9 -9
- package/dist/primitives/CanvasIcons.js +1 -1
- package/dist/primitives/CanvasImage.d.ts +4 -4
- package/dist/primitives/CanvasImage.js +9 -9
- package/dist/primitives/CanvasRichText.js +13 -13
- package/dist/primitives/CanvasStage.d.ts +7 -1
- package/dist/primitives/CanvasStage.js +29 -16
- package/dist/primitives/CanvasText.d.ts +6 -6
- package/dist/primitives/CanvasText.js +11 -11
- package/dist/primitives/ChartPrimitive.d.ts +2 -2
- package/dist/primitives/ChartPrimitive.js +6 -6
- package/dist/primitives/CircleBadge.d.ts +1 -1
- package/dist/primitives/CircleBadge.js +9 -9
- package/dist/primitives/FramePrimitive.d.ts +2 -2
- package/dist/primitives/FramePrimitive.js +5 -5
- package/dist/primitives/IllustrationPrimitive.d.ts +2 -2
- package/dist/primitives/IllustrationPrimitive.js +6 -6
- package/dist/primitives/PillBadge.d.ts +1 -1
- package/dist/primitives/PillBadge.js +9 -9
- package/dist/primitives/ShapePrimitive.d.ts +2 -2
- package/dist/primitives/ShapePrimitive.js +9 -9
- package/dist/primitives/UserImagePrimitive.d.ts +2 -2
- package/dist/primitives/UserImagePrimitive.js +14 -14
- package/dist/primitives/index.d.ts +12 -12
- package/dist/primitives/index.js +7 -7
- package/dist/sidebar/SidebarPanel.d.ts +1 -1
- package/dist/sidebar/SidebarPanel.js +7 -7
- package/dist/sidebar/SidebarTabBar.d.ts +1 -1
- package/dist/sidebar/SidebarTabBar.js +5 -5
- package/dist/sidebar/SubsectionTabBar.js +5 -5
- package/dist/sidebar/UserUploadsProvider.js +2 -2
- package/dist/sidebar/components/AltTextField.js +3 -3
- package/dist/sidebar/components/SidebarHint.js +2 -2
- package/dist/sidebar/components/TextFieldPrimitives.d.ts +1 -1
- package/dist/sidebar/components/TextFieldPrimitives.js +1 -1
- package/dist/sidebar/coreSidebar.d.ts +23 -0
- package/dist/sidebar/coreSidebar.js +12 -0
- package/dist/sidebar/coreSidebarParts.d.ts +3 -0
- package/dist/sidebar/coreSidebarParts.js +20 -0
- package/dist/sidebar/sections/AssetGallery.d.ts +33 -0
- package/dist/sidebar/sections/AssetGallery.js +58 -0
- package/dist/sidebar/sections/ChartSettingsSection.d.ts +1 -1
- package/dist/sidebar/sections/ChartSettingsSection.js +6 -6
- package/dist/sidebar/sections/ChartsSection.d.ts +9 -0
- package/dist/sidebar/sections/ChartsSection.js +40 -0
- package/dist/sidebar/sections/CombinedTextSection.d.ts +2 -2
- package/dist/sidebar/sections/CombinedTextSection.js +7 -7
- package/dist/sidebar/sections/DiagrammeSection.d.ts +6 -9
- package/dist/sidebar/sections/DiagrammeSection.js +4 -39
- package/dist/sidebar/sections/EffectsSection.d.ts +3 -3
- package/dist/sidebar/sections/EffectsSection.js +5 -5
- package/dist/sidebar/sections/FormenSection.d.ts +6 -28
- package/dist/sidebar/sections/FormenSection.js +4 -439
- package/dist/sidebar/sections/FrameSettingsSection.d.ts +1 -1
- package/dist/sidebar/sections/FrameSettingsSection.js +3 -3
- package/dist/sidebar/sections/FramesSection.d.ts +7 -0
- package/dist/sidebar/sections/FramesSection.js +18 -0
- package/dist/sidebar/sections/GenericShareSection.js +8 -8
- package/dist/sidebar/sections/IconsSection.js +6 -4
- package/dist/sidebar/sections/IllustrationSettings.d.ts +1 -1
- package/dist/sidebar/sections/IllustrationSettings.js +5 -5
- package/dist/sidebar/sections/IllustrationThumb.d.ts +1 -1
- package/dist/sidebar/sections/IllustrationThumb.js +2 -2
- package/dist/sidebar/sections/ImageAdjustSection.d.ts +1 -1
- package/dist/sidebar/sections/ImageAdjustSection.js +8 -8
- package/dist/sidebar/sections/LayersSection.d.ts +2 -2
- package/dist/sidebar/sections/LayersSection.js +3 -3
- package/dist/sidebar/sections/RahmenSection.d.ts +2 -7
- package/dist/sidebar/sections/RahmenSection.js +2 -17
- package/dist/sidebar/sections/ShapesSection.d.ts +28 -0
- package/dist/sidebar/sections/ShapesSection.js +440 -0
- package/dist/sidebar/sections/StudioGallery.d.ts +4 -33
- package/dist/sidebar/sections/StudioGallery.js +4 -57
- package/dist/sidebar/sections/UploadsSection.js +11 -11
- package/dist/sidebar/sections/assets/AssetsSection.d.ts +8 -8
- package/dist/sidebar/sections/assets/AssetsSection.js +2 -2
- package/dist/sidebar/sections/assets/BackgroundCatalog.d.ts +1 -1
- package/dist/sidebar/sections/assets/BackgroundCatalog.js +7 -7
- package/dist/sidebar/sections/assets/CategoryCard.js +1 -1
- package/dist/sidebar/sections/assets/ElementThumb.js +10 -8
- package/dist/sidebar/sections/assets/ElementTile.js +4 -4
- package/dist/sidebar/sections/assets/ElementsPanel.js +12 -12
- package/dist/sidebar/sections/assets/EmojiTonePicker.js +2 -2
- package/dist/sidebar/sections/assets/FotosCatalog.js +5 -5
- package/dist/sidebar/sections/assets/IconifyCatalog.d.ts +1 -1
- package/dist/sidebar/sections/assets/IconifyCatalog.js +4 -4
- package/dist/sidebar/sections/assets/RecentCarousel.js +4 -4
- package/dist/sidebar/sections/assets/StickerCatalog.js +5 -5
- package/dist/sidebar/sections/assets/constants.d.ts +1 -1
- package/dist/sidebar/sections/assets/elementPanelHost.d.ts +2 -2
- package/dist/sidebar/sections/assets/elementSearch.js +1 -1
- package/dist/sidebar/sections/assets/elementTypes.d.ts +6 -6
- package/dist/sidebar/sections/assets/elementTypes.js +1 -1
- package/dist/sidebar/sections/assets/useElementCatalog.d.ts +4 -4
- package/dist/sidebar/sections/assets/useElementCatalog.js +14 -14
- package/dist/sidebar/sections/assets/useRecentElements.js +2 -2
- package/dist/sidebar/sections/assets/useStockPhotos.d.ts +2 -2
- package/dist/sidebar/sections/assets/useStockPhotos.js +3 -3
- package/dist/sidebar/sections/effects/EffectCard.js +2 -2
- package/dist/sidebar/sections/effects/GradientSettings.d.ts +1 -1
- package/dist/sidebar/sections/effects/GradientSettings.js +6 -6
- package/dist/sidebar/sections/effects/OutlineSettings.js +5 -5
- package/dist/sidebar/sections/effects/ShadowSettings.d.ts +1 -1
- package/dist/sidebar/sections/effects/ShadowSettings.js +5 -5
- package/dist/sidebar/sections/effects/effectsFor.d.ts +1 -1
- package/dist/sidebar/sections/effects/effectsFor.js +1 -1
- package/dist/sidebar/sections/index.d.ts +6 -2
- package/dist/sidebar/sections/index.js +5 -3
- package/dist/sidebar/sections/registerBundledIconSets.d.ts +6 -0
- package/dist/sidebar/sections/registerBundledIconSets.js +11 -0
- package/dist/sidebar/sections/tools/AiCreateTool.js +3 -3
- package/dist/sidebar/sections/tools/AiEditTool.js +5 -5
- package/dist/sidebar/sections/tools/AltTextTool.d.ts +1 -1
- package/dist/sidebar/sections/tools/AltTextTool.js +5 -5
- package/dist/sidebar/sections/tools/BlobCreatorTool.js +6 -6
- package/dist/sidebar/sections/tools/GradientTextTool.js +8 -8
- package/dist/sidebar/sections/tools/ImageInputPicker.js +6 -6
- package/dist/sidebar/sections/tools/QRCodeTool.js +5 -5
- package/dist/sidebar/sections/tools/RemoveBackgroundTool.js +4 -4
- package/dist/sidebar/sections/tools/TextPathCreatorTool.js +8 -8
- package/dist/sidebar/sections/tools/ToolPanel.js +2 -2
- package/dist/sidebar/sections/tools/ToolTiles.js +1 -1
- package/dist/sidebar/sections/tools/ToolsSection.d.ts +2 -2
- package/dist/sidebar/sections/tools/ToolsSection.js +17 -17
- package/dist/sidebar/sections/tools/UnsplashLimitNotice.js +2 -2
- package/dist/sidebar/sections/tools/UnsplashTool.d.ts +1 -1
- package/dist/sidebar/sections/tools/UnsplashTool.js +8 -8
- package/dist/sidebar/sections/usePreloadSections.d.ts +16 -0
- package/dist/sidebar/sections/usePreloadSections.js +29 -0
- package/dist/sidebar/tabTypes.d.ts +1 -1
- package/dist/sidebar/types.d.ts +4 -4
- package/dist/sidebar/useImagePlacement.d.ts +1 -1
- package/dist/sidebar/useImagePlacement.js +4 -4
- package/dist/stores/createCanvasEditorStore.d.ts +4 -4
- package/dist/stores/createCanvasEditorStore.js +2 -2
- package/dist/styles/compiled.css +1 -1
- package/dist/styles/editor.css +33 -41
- package/dist/styles/tailwind.css +20 -3
- package/dist/styles/tokens.css +3 -2
- package/dist/templates/templateGeometry.js +26 -1
- package/dist/templates/testKinds.d.ts +1 -1
- package/dist/templates/testKinds.js +1 -1
- package/dist/testing/fixtureTemplates.d.ts +1 -1
- package/dist/testing/fixtureTemplates.js +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/utils/canvasAssets.d.ts +3 -3
- package/dist/utils/canvasCommandRegistry.js +1 -1
- package/dist/utils/canvasCommands.d.ts +3 -3
- package/dist/utils/canvasCommands.js +7 -7
- package/dist/utils/canvasIcons.d.ts +7 -0
- package/dist/utils/canvasIcons.js +16 -4
- package/dist/utils/canvasItem.d.ts +7 -7
- package/dist/utils/canvasLayerManager.d.ts +7 -7
- package/dist/utils/captureStage.d.ts +1 -1
- package/dist/utils/captureStage.js +1 -1
- package/dist/utils/chartUtils.d.ts +2 -2
- package/dist/utils/chartUtils.js +3 -3
- package/dist/utils/circleBadgeUtils.js +2 -2
- package/dist/utils/collectAltTextPages.d.ts +2 -2
- package/dist/utils/collectAltTextPages.js +1 -1
- package/dist/utils/colorNames.js +3 -3
- package/dist/utils/colorOptions.js +1 -1
- package/dist/utils/cropAspect.js +1 -1
- package/dist/utils/cropGhost.d.ts +1 -1
- package/dist/utils/cropSession.d.ts +1 -1
- package/dist/utils/cropSession.js +1 -1
- package/dist/utils/cropTarget.d.ts +1 -1
- package/dist/utils/downloadError.js +1 -1
- package/dist/utils/duplicateElement.d.ts +7 -7
- package/dist/utils/emoji/emojiCatalog.d.ts +1 -1
- package/dist/utils/emoji/emojiCatalog.js +2 -2
- package/dist/utils/expandImage.js +1 -1
- package/dist/utils/externalIcons.js +1 -1
- package/dist/utils/fontGeneration.d.ts +16 -0
- package/dist/utils/fontGeneration.js +56 -0
- package/dist/utils/fontMarkSupport.js +1 -1
- package/dist/utils/fontSpecs.d.ts +9 -0
- package/dist/utils/fontSpecs.js +17 -0
- package/dist/utils/framePresets.d.ts +19 -0
- package/dist/utils/framePresets.js +260 -0
- package/dist/utils/frameUtils.d.ts +3 -18
- package/dist/utils/frameUtils.js +2 -261
- package/dist/utils/iconInstances.d.ts +1 -1
- package/dist/utils/illustrations/gophers.d.ts +1 -1
- package/dist/utils/illustrations/humaaans.d.ts +1 -1
- package/dist/utils/illustrations/illlustrations.d.ts +1 -1
- package/dist/utils/illustrations/kawaii.d.ts +1 -1
- package/dist/utils/illustrations/opendoodles.d.ts +1 -1
- package/dist/utils/illustrations/openpeeps.d.ts +1 -1
- package/dist/utils/illustrations/registry.d.ts +3 -3
- package/dist/utils/illustrations/registry.js +2 -2
- package/dist/utils/illustrations/svgCache.d.ts +1 -1
- package/dist/utils/illustrations/transhumans.d.ts +1 -1
- package/dist/utils/illustrations/types.js +1 -1
- package/dist/utils/imageElementComparison.js +3 -3
- package/dist/utils/imageFilters.d.ts +1 -3
- package/dist/utils/imageFilters.js +7 -11
- package/dist/utils/keyboardCrop.d.ts +1 -1
- package/dist/utils/keyboardCrop.js +3 -3
- package/dist/utils/layerLabels.js +2 -2
- package/dist/utils/markerColors.js +2 -2
- package/dist/utils/mediaDrop.d.ts +13 -7
- package/dist/utils/mediaDrop.js +12 -6
- package/dist/utils/mediaPlacement.js +2 -2
- package/dist/utils/photoCredit.js +1 -1
- package/dist/utils/photoCredits.d.ts +1 -1
- package/dist/utils/photoCredits.js +2 -2
- package/dist/utils/photoPlaceholder.js +1 -1
- package/dist/utils/pillBadgeUtils.js +2 -2
- package/dist/utils/renderedBoxes.d.ts +5 -5
- package/dist/utils/renderedBoxes.js +2 -2
- package/dist/utils/resolveElementValue.js +1 -1
- package/dist/utils/shapes.d.ts +2 -2
- package/dist/utils/shapes.js +2 -2
- package/dist/utils/smartCrop.d.ts +2 -2
- package/dist/utils/smartCrop.js +4 -4
- package/dist/utils/surfaceGlow.js +1 -1
- package/dist/utils/templateElementInstance.js +1 -1
- package/dist/utils/templateRotation.js +1 -1
- package/dist/utils/textUtils.js +2 -2
- package/dist/utils/unsplashLinks.js +1 -1
- package/dist/utils/userImageCrop.d.ts +1 -1
- package/dist/utils/userImageCrop.js +2 -2
- package/dist/utils/userImageUtils.d.ts +2 -0
- package/dist/utils/userImageUtils.js +6 -1
- package/dist/utils/viewport.d.ts +12 -8
- package/dist/utils/viewport.js +17 -13
- package/dist/utils/zipPageImages.js +1 -1
- package/dist/vendor/pptxgen.LICENSES.txt +1023 -0
- package/dist/vendor/pptxgen.d.ts +2679 -0
- package/dist/vendor/pptxgen.js +8831 -0
- package/package.json +178 -23
- package/skills/ggraphic-embed/SKILL.md +174 -53
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ggraphic/editor",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,62 +10,215 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"sideEffects": [
|
|
12
12
|
"**/*.css",
|
|
13
|
-
"**/
|
|
14
|
-
"**/
|
|
13
|
+
"**/utils/fontGeneration.js",
|
|
14
|
+
"**/utils/fontGeneration.ts"
|
|
15
15
|
],
|
|
16
16
|
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/entries/embed.d.ts",
|
|
19
|
+
"import": "./dist/entries/embed.js",
|
|
20
|
+
"default": "./dist/entries/embed.js"
|
|
21
|
+
},
|
|
17
22
|
"./styles": "./dist/styles/index.css",
|
|
23
|
+
"./styles/index.css": "./dist/styles/index.css",
|
|
18
24
|
"./styles/editor": "./dist/styles/editor.css",
|
|
25
|
+
"./styles/editor.css": "./dist/styles/editor.css",
|
|
19
26
|
"./styles/tokens": "./dist/styles/tokens.css",
|
|
27
|
+
"./styles/tokens.css": "./dist/styles/tokens.css",
|
|
20
28
|
"./styles/tailwind": "./dist/styles/tailwind.css",
|
|
29
|
+
"./styles/tailwind.css": "./dist/styles/tailwind.css",
|
|
21
30
|
"./styles/compiled": "./dist/styles/compiled.css",
|
|
31
|
+
"./styles/compiled.css": "./dist/styles/compiled.css",
|
|
32
|
+
"./embed": {
|
|
33
|
+
"types": "./dist/entries/embed.d.ts",
|
|
34
|
+
"import": "./dist/entries/embed.js",
|
|
35
|
+
"default": "./dist/entries/embed.js"
|
|
36
|
+
},
|
|
37
|
+
"./page": {
|
|
38
|
+
"types": "./dist/entries/page.d.ts",
|
|
39
|
+
"import": "./dist/entries/page.js",
|
|
40
|
+
"default": "./dist/entries/page.js"
|
|
41
|
+
},
|
|
42
|
+
"./config": {
|
|
43
|
+
"types": "./dist/entries/config.d.ts",
|
|
44
|
+
"import": "./dist/entries/config.js",
|
|
45
|
+
"default": "./dist/entries/config.js"
|
|
46
|
+
},
|
|
47
|
+
"./shell": {
|
|
48
|
+
"types": "./dist/entries/shell.d.ts",
|
|
49
|
+
"import": "./dist/entries/shell.js",
|
|
50
|
+
"default": "./dist/entries/shell.js"
|
|
51
|
+
},
|
|
52
|
+
"./canvas": {
|
|
53
|
+
"types": "./dist/entries/canvas.d.ts",
|
|
54
|
+
"import": "./dist/entries/canvas.js",
|
|
55
|
+
"default": "./dist/entries/canvas.js"
|
|
56
|
+
},
|
|
57
|
+
"./kinds": {
|
|
58
|
+
"types": "./dist/entries/kinds.d.ts",
|
|
59
|
+
"import": "./dist/entries/kinds.js",
|
|
60
|
+
"default": "./dist/entries/kinds.js"
|
|
61
|
+
},
|
|
62
|
+
"./store": {
|
|
63
|
+
"types": "./dist/entries/store.d.ts",
|
|
64
|
+
"import": "./dist/entries/store.js",
|
|
65
|
+
"default": "./dist/entries/store.js"
|
|
66
|
+
},
|
|
67
|
+
"./services": {
|
|
68
|
+
"types": "./dist/entries/services.d.ts",
|
|
69
|
+
"import": "./dist/entries/services.js",
|
|
70
|
+
"default": "./dist/entries/services.js"
|
|
71
|
+
},
|
|
72
|
+
"./host": {
|
|
73
|
+
"types": "./dist/entries/host.d.ts",
|
|
74
|
+
"import": "./dist/entries/host.js",
|
|
75
|
+
"default": "./dist/entries/host.js"
|
|
76
|
+
},
|
|
77
|
+
"./host-react": {
|
|
78
|
+
"types": "./dist/entries/hostReact.d.ts",
|
|
79
|
+
"import": "./dist/entries/hostReact.js",
|
|
80
|
+
"default": "./dist/entries/hostReact.js"
|
|
81
|
+
},
|
|
82
|
+
"./brand": {
|
|
83
|
+
"types": "./dist/entries/brand.d.ts",
|
|
84
|
+
"import": "./dist/entries/brand.js",
|
|
85
|
+
"default": "./dist/entries/brand.js"
|
|
86
|
+
},
|
|
87
|
+
"./templates": {
|
|
88
|
+
"types": "./dist/entries/templates.d.ts",
|
|
89
|
+
"import": "./dist/entries/templates.js",
|
|
90
|
+
"default": "./dist/entries/templates.js"
|
|
91
|
+
},
|
|
92
|
+
"./elements": {
|
|
93
|
+
"types": "./dist/entries/elements.d.ts",
|
|
94
|
+
"import": "./dist/entries/elements.js",
|
|
95
|
+
"default": "./dist/entries/elements.js"
|
|
96
|
+
},
|
|
97
|
+
"./text": {
|
|
98
|
+
"types": "./dist/entries/text.d.ts",
|
|
99
|
+
"import": "./dist/entries/text.js",
|
|
100
|
+
"default": "./dist/entries/text.js"
|
|
101
|
+
},
|
|
102
|
+
"./sidebar": {
|
|
103
|
+
"types": "./dist/entries/sidebar.d.ts",
|
|
104
|
+
"import": "./dist/entries/sidebar.js",
|
|
105
|
+
"default": "./dist/entries/sidebar.js"
|
|
106
|
+
},
|
|
107
|
+
"./collab": {
|
|
108
|
+
"types": "./dist/entries/collab.d.ts",
|
|
109
|
+
"import": "./dist/entries/collab.js",
|
|
110
|
+
"default": "./dist/entries/collab.js"
|
|
111
|
+
},
|
|
112
|
+
"./ai": {
|
|
113
|
+
"types": "./dist/entries/ai.d.ts",
|
|
114
|
+
"import": "./dist/entries/ai.js",
|
|
115
|
+
"default": "./dist/entries/ai.js"
|
|
116
|
+
},
|
|
117
|
+
"./export": {
|
|
118
|
+
"types": "./dist/entries/export.d.ts",
|
|
119
|
+
"import": "./dist/entries/export.js",
|
|
120
|
+
"default": "./dist/entries/export.js"
|
|
121
|
+
},
|
|
122
|
+
"./i18n": {
|
|
123
|
+
"types": "./dist/entries/i18n.d.ts",
|
|
124
|
+
"import": "./dist/entries/i18n.js",
|
|
125
|
+
"default": "./dist/entries/i18n.js"
|
|
126
|
+
},
|
|
127
|
+
"./illustrations/gophers": {
|
|
128
|
+
"types": "./dist/entries/illustrations/gophers.d.ts",
|
|
129
|
+
"import": "./dist/entries/illustrations/gophers.js",
|
|
130
|
+
"default": "./dist/entries/illustrations/gophers.js"
|
|
131
|
+
},
|
|
132
|
+
"./illustrations/humaaans": {
|
|
133
|
+
"types": "./dist/entries/illustrations/humaaans.d.ts",
|
|
134
|
+
"import": "./dist/entries/illustrations/humaaans.js",
|
|
135
|
+
"default": "./dist/entries/illustrations/humaaans.js"
|
|
136
|
+
},
|
|
137
|
+
"./illustrations/illlustrations": {
|
|
138
|
+
"types": "./dist/entries/illustrations/illlustrations.d.ts",
|
|
139
|
+
"import": "./dist/entries/illustrations/illlustrations.js",
|
|
140
|
+
"default": "./dist/entries/illustrations/illlustrations.js"
|
|
141
|
+
},
|
|
142
|
+
"./illustrations/kawaii": {
|
|
143
|
+
"types": "./dist/entries/illustrations/kawaii.d.ts",
|
|
144
|
+
"import": "./dist/entries/illustrations/kawaii.js",
|
|
145
|
+
"default": "./dist/entries/illustrations/kawaii.js"
|
|
146
|
+
},
|
|
147
|
+
"./illustrations/opendoodles": {
|
|
148
|
+
"types": "./dist/entries/illustrations/opendoodles.d.ts",
|
|
149
|
+
"import": "./dist/entries/illustrations/opendoodles.js",
|
|
150
|
+
"default": "./dist/entries/illustrations/opendoodles.js"
|
|
151
|
+
},
|
|
152
|
+
"./illustrations/openpeeps": {
|
|
153
|
+
"types": "./dist/entries/illustrations/openpeeps.d.ts",
|
|
154
|
+
"import": "./dist/entries/illustrations/openpeeps.js",
|
|
155
|
+
"default": "./dist/entries/illustrations/openpeeps.js"
|
|
156
|
+
},
|
|
157
|
+
"./illustrations/transhumans": {
|
|
158
|
+
"types": "./dist/entries/illustrations/transhumans.d.ts",
|
|
159
|
+
"import": "./dist/entries/illustrations/transhumans.js",
|
|
160
|
+
"default": "./dist/entries/illustrations/transhumans.js"
|
|
161
|
+
},
|
|
162
|
+
"./internal/*": {
|
|
163
|
+
"types": "./dist/*.d.ts",
|
|
164
|
+
"import": "./dist/*.js",
|
|
165
|
+
"default": "./dist/*.js"
|
|
166
|
+
},
|
|
22
167
|
"./*": {
|
|
23
168
|
"types": "./dist/*.d.ts",
|
|
24
169
|
"import": "./dist/*.js",
|
|
25
170
|
"default": "./dist/*.js"
|
|
26
171
|
}
|
|
27
172
|
},
|
|
173
|
+
"imports": {
|
|
174
|
+
"#pptxgenjs": {
|
|
175
|
+
"types": "./dist/vendor/pptxgen.d.ts",
|
|
176
|
+
"default": "./dist/vendor/pptxgen.js"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
28
179
|
"dependencies": {
|
|
29
180
|
"@ggraphic/core": "0.1.0-alpha.1",
|
|
30
|
-
"@ggraphic/schema": "0.1.0-alpha.
|
|
31
|
-
"@hocuspocus/provider": "^4.
|
|
181
|
+
"@ggraphic/schema": "0.1.0-alpha.1",
|
|
182
|
+
"@hocuspocus/provider": "^4.8.0",
|
|
32
183
|
"@iconify-json/bi": "^1.2.7",
|
|
33
184
|
"@iconify-json/flowbite": "^1.2.7",
|
|
34
185
|
"@iconify-json/heroicons": "^1.2.3",
|
|
35
186
|
"@iconify-json/iconoir": "^1.2.12",
|
|
36
|
-
"@iconify-json/lucide": "^1.2.
|
|
187
|
+
"@iconify-json/lucide": "^1.2.149",
|
|
37
188
|
"@iconify-json/ri": "1.2.10",
|
|
38
|
-
"@iconify-json/tabler": "^1.2.
|
|
189
|
+
"@iconify-json/tabler": "^1.2.43",
|
|
39
190
|
"@iconify/react": "^6.0.3",
|
|
40
191
|
"@iconify/utils": "^3.1.7",
|
|
41
192
|
"@tanstack/react-query": "^5.104.1",
|
|
42
|
-
"@tiptap/core": "^3.32.
|
|
43
|
-
"@tiptap/extension-bold": "^3.32.
|
|
44
|
-
"@tiptap/extension-document": "^3.32.
|
|
45
|
-
"@tiptap/extension-hard-break": "^3.32.
|
|
46
|
-
"@tiptap/extension-italic": "^3.32.
|
|
47
|
-
"@tiptap/extension-list": "^3.32.
|
|
48
|
-
"@tiptap/extension-paragraph": "^3.32.
|
|
49
|
-
"@tiptap/extension-text": "^3.32.
|
|
50
|
-
"@tiptap/extension-underline": "^3.32.
|
|
51
|
-
"@tiptap/extensions": "^3.32.
|
|
52
|
-
"@tiptap/
|
|
193
|
+
"@tiptap/core": "^3.32.1",
|
|
194
|
+
"@tiptap/extension-bold": "^3.32.1",
|
|
195
|
+
"@tiptap/extension-document": "^3.32.1",
|
|
196
|
+
"@tiptap/extension-hard-break": "^3.32.1",
|
|
197
|
+
"@tiptap/extension-italic": "^3.32.1",
|
|
198
|
+
"@tiptap/extension-list": "^3.32.1",
|
|
199
|
+
"@tiptap/extension-paragraph": "^3.32.1",
|
|
200
|
+
"@tiptap/extension-text": "^3.32.1",
|
|
201
|
+
"@tiptap/extension-underline": "^3.32.1",
|
|
202
|
+
"@tiptap/extensions": "^3.32.1",
|
|
203
|
+
"@tiptap/pm": "^3.32.1",
|
|
204
|
+
"@tiptap/react": "^3.32.1",
|
|
53
205
|
"class-variance-authority": "^0.7.1",
|
|
54
206
|
"clsx": "^2.1.1",
|
|
55
207
|
"fflate": "^0.8.3",
|
|
56
208
|
"immer": "^11.2.9",
|
|
57
|
-
"lucide-react": "^1.
|
|
209
|
+
"lucide-react": "^1.64.0",
|
|
58
210
|
"pdf-lib": "^1.17.1",
|
|
59
|
-
"pptxgenjs": "~4.0.1",
|
|
60
211
|
"qrcode.react": "^4.2.0",
|
|
61
212
|
"radix-ui": "^1.8.1",
|
|
62
213
|
"react-icons": "^5.7.0",
|
|
214
|
+
"react-is": "^19.0.0",
|
|
63
215
|
"react-kawaii": "^1.6.0",
|
|
64
216
|
"recharts": "3.10.1",
|
|
65
217
|
"smartcrop": "2.0.5",
|
|
66
218
|
"tailwind-merge": "^3.7.0",
|
|
67
219
|
"use-image": "^1.1.4",
|
|
68
220
|
"uuid": "^14.0.3",
|
|
221
|
+
"y-protocols": "^1.0.6",
|
|
69
222
|
"yjs": "^13.6.33",
|
|
70
223
|
"zustand": "5.0.16"
|
|
71
224
|
},
|
|
@@ -85,7 +238,9 @@
|
|
|
85
238
|
"jsdom": "30.1.3",
|
|
86
239
|
"konva": "^10.9.0",
|
|
87
240
|
"lightningcss": "1.33.0",
|
|
241
|
+
"pptxgenjs": "4.0.1",
|
|
88
242
|
"react-konva": "^19.3.2",
|
|
243
|
+
"rolldown": "1.2.15",
|
|
89
244
|
"tailwindcss": "4.3.3",
|
|
90
245
|
"typescript": "^6.0.3",
|
|
91
246
|
"vitest": "^5.0.5",
|
|
@@ -93,8 +248,8 @@
|
|
|
93
248
|
},
|
|
94
249
|
"peerDependencies": {
|
|
95
250
|
"konva": "^10.9.0",
|
|
96
|
-
"react": "^19.
|
|
97
|
-
"react-dom": "^19.
|
|
251
|
+
"react": "^19.3.0",
|
|
252
|
+
"react-dom": "^19.3.0",
|
|
98
253
|
"react-konva": "^19.3.2"
|
|
99
254
|
},
|
|
100
255
|
"files": [
|
|
@@ -106,7 +261,7 @@
|
|
|
106
261
|
"THIRD_PARTY_NOTICES"
|
|
107
262
|
],
|
|
108
263
|
"scripts": {
|
|
109
|
-
"build": "tsc --project tsconfig.build.json && node -e \"require('node:fs').cpSync('src', 'dist', { recursive: true, filter: (f) => !/\\.tsx?$/.test(f) })\" && node scripts/build-css.mjs",
|
|
264
|
+
"build": "tsc --project tsconfig.build.json && node -e \"require('node:fs').cpSync('src', 'dist', { recursive: true, filter: (f) => !/\\.tsx?$/.test(f) })\" && node scripts/build-css.mjs && node scripts/bundle-pptxgen.mjs",
|
|
110
265
|
"build:css": "node scripts/build-css.mjs",
|
|
111
266
|
"lint": "eslint .",
|
|
112
267
|
"test": "vitest run",
|
|
@@ -1,38 +1,187 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ggraphic-embed
|
|
3
|
-
description: Embed the ggraphic canvas editor (@ggraphic/editor, @ggraphic/core, @ggraphic/schema, optionally @ggraphic/collab) in a React app. Use when installing ggraphic, mounting CanvasEditorShell,
|
|
3
|
+
description: Embed the ggraphic canvas editor (@ggraphic/editor, @ggraphic/core, @ggraphic/schema, optionally @ggraphic/brand-default and @ggraphic/collab) in a React app. Use when installing ggraphic, mounting GgraphicEditor or CanvasEditorShell, defining a brand pack, loading templates, passing host services, wiring styles and fonts, or when a host build or test breaks on ggraphic (ESM-only, Tailwind classes, mocks not applying, fonts falling back).
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Embedding the ggraphic editor
|
|
7
7
|
|
|
8
8
|
ggraphic is alpha (`0.1.0-alpha.x`, npm dist-tag `alpha`). APIs and the document format can change between alphas, so pin exact versions.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## The short path: `GgraphicEditor`
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
A host supplies data and services; the component does the rest.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
```tsx
|
|
15
|
+
import { defaultBrand } from '@ggraphic/brand-default';
|
|
16
|
+
import '@ggraphic/brand-default/fonts';
|
|
17
|
+
import '@ggraphic/editor/styles/compiled.css';
|
|
18
|
+
import { GgraphicEditor, loadTemplatePack, type GgraphicDocument } from '@ggraphic/editor/embed';
|
|
19
|
+
|
|
20
|
+
import templateFiles from './templates.json'; // template files (`@ggraphic/schema` format)
|
|
21
|
+
|
|
22
|
+
const templates = loadTemplatePack(templateFiles); // once, at module level
|
|
23
|
+
|
|
24
|
+
export function DesignEditor({
|
|
25
|
+
doc,
|
|
26
|
+
save,
|
|
27
|
+
}: {
|
|
28
|
+
doc?: GgraphicDocument;
|
|
29
|
+
save: (d: GgraphicDocument) => void;
|
|
30
|
+
}) {
|
|
31
|
+
return (
|
|
32
|
+
<div style={{ height: '100dvh' }}>
|
|
33
|
+
<GgraphicEditor brand={defaultBrand} templates={templates} document={doc} onChange={save} />
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
What it does for you:
|
|
40
|
+
|
|
41
|
+
- Fills the editor's registers from the props: brand pack, messages, the pack's templates and a blank page (`ggraphic-blank`).
|
|
42
|
+
- Wraps the editor in a `QueryClientProvider` (its own client unless you pass `queryClient`), a `CanvasEditorProvider` with your `services`, and `CanvasEditorShell`.
|
|
43
|
+
- Feeds the pack's slot budgets to the editor's status line.
|
|
44
|
+
|
|
45
|
+
Props:
|
|
46
|
+
|
|
47
|
+
| Prop | Default | Notes |
|
|
48
|
+
| -------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
49
|
+
| `brand` | required | `defaultBrand` from `@ggraphic/brand-default`, or your own from `defineBrand` (below). |
|
|
50
|
+
| `templates` | required | `loadTemplatePack(files)`, a promise the editor resolves while it loads. Create it once, not per render. Await it to read `problems` (files that were skipped). A pack from `templatePackFromJson` works too. |
|
|
51
|
+
| `document` | one page of the pack's first template on `post-portrait` | `{ formatId, pages: [{ configId, state }] }`. Read when the editor mounts; give the component a new `key` to open another document. |
|
|
52
|
+
| `onChange` | none | The whole document after every change (edits, added or moved pages, undo). Store it as it comes; debounce on your side if saving is expensive. |
|
|
53
|
+
| `services` | downloads through the browser, uploads as object URLs, no AI | `CanvasEditorServices` from `@ggraphic/editor/CanvasEditorProvider`. Pass only what you have: a `mediaLibrary` for durable uploads, `aiDraft`, `iconSearch`, `fileDelivery` … |
|
|
54
|
+
| `locale` | `'en'` | `'en'` or `'de'`. |
|
|
55
|
+
| `queryClient` | own client | Pass yours to share a cache with the rest of the app. |
|
|
56
|
+
| `title` | none | The design's name, used for the PDF and slide-deck downloads. |
|
|
57
|
+
| `exportApiRef` | none | A ref that receives `CanvasEditorExportApi` once the editor has loaded (see Export). |
|
|
58
|
+
|
|
59
|
+
Things to know:
|
|
60
|
+
|
|
61
|
+
- **Client only, SSR-safe import.** Importing `@ggraphic/editor/embed` touches no browser global, so a server-rendered page (Next.js app router, Remix …) can import it. It renders nothing on the server and loads the editor in the browser after hydration. No `dynamic(..., { ssr: false })` needed.
|
|
62
|
+
- **React Server Components.** The entry (and the package root) is marked `'use client'`, so importing it from a server component gives a client reference instead of failing on `createContext`. Render the editor from your own `'use client'` component that builds the brand and the template pack: props passed from a server component must be serialisable, and a template pack holds functions. Rendering `<GgraphicEditor>` straight from a server component therefore only works if every prop you pass is plain data.
|
|
63
|
+
- **Give it a box with a height.** The editor fills exactly the container it is rendered in (`height: 100%`): top bar, sidebar, panel and bottom bar sit inside it, and the pages scroll inside it, so your own header or sidebar can sit next to it. The container needs a definite height (`height: calc(100dvh - 56px)`, or a flex item that is stretched to one); a container that only has a `min-height` gives the editor nothing to fill. Layout and canvas follow that box, not the window: below 900 px wide the editor uses its phone layout (tabs at the bottom, panels as sheets) also in a wide window, and the pages are sized to fit the box. Dialogs and menus, which open over the whole page, still follow the window.
|
|
64
|
+
- **One brand and locale per page.** The registers are module-level: two `GgraphicEditor`s on one page share the brand and locale of the one rendered last. Template ids are stored in documents and never re-registered: a second pack that reuses an id keeps the first one's template.
|
|
65
|
+
- **No collaboration** unless you use the low-level path below.
|
|
66
|
+
|
|
67
|
+
### Export
|
|
68
|
+
|
|
69
|
+
The editor's own Share menu downloads PNG, PDF and slide decks. To export from your own UI (a "Save PNG" button, a thumbnail on save), pass `exportApiRef`:
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
import { type CanvasEditorExportApi } from '@ggraphic/editor/embed';
|
|
73
|
+
|
|
74
|
+
const [api, setApi] = useState<CanvasEditorExportApi | null>(null);
|
|
75
|
+
|
|
76
|
+
<GgraphicEditor brand={defaultBrand} templates={templates} exportApiRef={setApi} />;
|
|
77
|
+
|
|
78
|
+
<button
|
|
79
|
+
disabled={!api}
|
|
80
|
+
onClick={async () => {
|
|
81
|
+
const png = await api?.captureActivePage({ pixelRatio: 2 });
|
|
82
|
+
if (png) download(png, 'design.png'); // a data URL
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
Save PNG
|
|
86
|
+
</button>;
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
- The api arrives after the editor has loaded in the browser, and goes back to `null` when it unmounts. A callback ref (`setApi` above) tells you when; a `useRef` works too if you only read it on click.
|
|
90
|
+
- `captureActivePage({ pixelRatio, transparent })`: the active page as a PNG data URL, or `null` while its canvas is not mounted.
|
|
91
|
+
- `capturePages({ pixelRatio })`: every page as a PNG data URL, in order.
|
|
92
|
+
- `exportPptx()`: the deck as an editable .pptx `Blob`.
|
|
93
|
+
- `getPages()`: the document's pages as `onChange` reports them.
|
|
94
|
+
- `undo()` / `redo()`.
|
|
95
|
+
|
|
96
|
+
To hide the editor's own Share menu, use the low-level path (`showShare={false}` on `CanvasEditorShell`).
|
|
97
|
+
|
|
98
|
+
### A brand of your own: `defineBrand`
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import { defineBrand } from '@ggraphic/core';
|
|
102
|
+
|
|
103
|
+
export const brand = defineBrand({
|
|
104
|
+
id: 'riverside', // stored with documents: never rename one that has shipped
|
|
105
|
+
name: 'Riverside',
|
|
106
|
+
colors: { primary: '#0f2352', secondary: '#1b3fae', accent: '#f5822a' },
|
|
107
|
+
fonts: {
|
|
108
|
+
headline: 'Anton',
|
|
109
|
+
body: 'Instrument Sans',
|
|
110
|
+
cuts: {
|
|
111
|
+
Anton: { bold: false, italic: false },
|
|
112
|
+
'Instrument Sans': { bold: true, italic: true, boldItalic: true },
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
logo: { src: '/logo.svg', label: 'Riverside' },
|
|
116
|
+
});
|
|
117
|
+
```
|
|
18
118
|
|
|
19
|
-
|
|
119
|
+
The other five colour roles, the grounds and every picker are derived with WCAG contrast checks. It throws when a colour is not a colour. Load the fonts you name yourself (see Fonts).
|
|
120
|
+
|
|
121
|
+
### Templates as data: `loadTemplatePack`
|
|
122
|
+
|
|
123
|
+
`loadTemplatePack(files)` returns a promise of the pack and loads the parser (the schema validators and the page config, several hundred kB) in a chunk of its own, next to the editor. `templatePackFromJson(files)` does the same work synchronously, but whatever imports it carries that code: called at module level, it more than doubles a host's entry chunk. Use it where you need the pack before rendering. Neither is a server API: both are exported from the `'use client'` entry, so a server component that imports them gets a client reference, not the function, and the pack they return holds functions that cannot cross to the client.
|
|
124
|
+
|
|
125
|
+
Both take an array of template files (or one file) in the `@ggraphic/schema` format. `@ggraphic/templates-open` is a CC0 pack to start from; its root entry ships no images, and its sample photos for previews (`SAMPLE_PHOTOS`) load only from `@ggraphic/templates-open/photos`. Every template becomes a page the editor opens under the template's id. A file that does not read, was written by a newer version or repeats an id is skipped and listed in `problems`; blocks are left out (they are not pages).
|
|
20
126
|
|
|
21
127
|
## Install
|
|
22
128
|
|
|
23
129
|
```bash
|
|
24
|
-
|
|
130
|
+
# --save-exact pins each package to the version its `alpha` tag points to
|
|
131
|
+
npm install --save-exact @ggraphic/editor@alpha @ggraphic/core@alpha @ggraphic/schema@alpha
|
|
132
|
+
npm install --save-exact @ggraphic/brand-default@alpha # the neutral brand and its OFL fonts
|
|
25
133
|
npm install react react-dom konva react-konva @tanstack/react-query
|
|
26
134
|
# real-time collaboration (Yjs + Hocuspocus) only:
|
|
27
|
-
npm install --save-exact @ggraphic/collab@
|
|
135
|
+
npm install --save-exact @ggraphic/collab@alpha
|
|
28
136
|
```
|
|
29
137
|
|
|
30
|
-
-
|
|
138
|
+
- The packages have **independent versions** (editor and core can be on `0.1.0-alpha.1` while schema is on `0.1.0-alpha.0`). Pin each one exactly to the version npm lists under the `alpha` tag (`npm view @ggraphic/<pkg> dist-tags.alpha`). The editor's own dependencies (`npm view @ggraphic/editor@<version> dependencies`) show which `@ggraphic/core` and `@ggraphic/schema` it expects; install exactly those, so editor and collab agree on the document schema.
|
|
31
139
|
- The packages are **ESM-only** and need Node ≥ 22 for anything that imports them on the server.
|
|
32
|
-
- `konva`, `react`, `react-dom` and `react-konva` are peers. Make sure the host resolves **one** React copy (Vite: `resolve.dedupe: ['react', 'react-dom']`), or hooks fail with "Cannot read properties of null (reading 'useContext')".
|
|
140
|
+
- `konva`, `react`, `react-dom` and `react-konva` are peers. React and React DOM must be **19.3 or later** (`^19.3.0`): react-konva 19.3 requires it, and npm stops with `ERESOLVE` on an older React. Make sure the host resolves **one** React copy (Vite: `resolve.dedupe: ['react', 'react-dom']`), or hooks fail with "Cannot read properties of null (reading 'useContext')".
|
|
33
141
|
- pnpm with `minimumReleaseAge`: a freshly published alpha is refused for that window. Add exact `@ggraphic/<pkg>@<version>` entries to `minimumReleaseAgeExclude` (and remove them once the version is old enough).
|
|
142
|
+
- pnpm 12 and later print "Agent skills awaiting approval: @ggraphic/editor" on every install: the package ships this skill, and pnpm links it into `.claude/skills/` only once the host approves it (`pnpm approve`). Without approval nothing is linked and the editor works the same.
|
|
143
|
+
- A host that type-checks Node-facing files (`vite.config.ts`, `playwright.config.ts`) declares `@types/node` itself. Without it, a strict pnpm host (`hoist: false`) fails tsc with `TS2688: Cannot find type definition file for 'node'` in `undici-types`; with hoisting, the copy one of the editor's dependencies brings in hides the gap.
|
|
144
|
+
|
|
145
|
+
## Styles
|
|
146
|
+
|
|
147
|
+
The components carry Tailwind v4 utility classes. Pick one of two ways to style them:
|
|
148
|
+
|
|
149
|
+
- **Any host (no Tailwind needed):** one import, everything compiled.
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
import '@ggraphic/editor/styles/compiled.css';
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
- Import the stylesheets from JavaScript with the `.css` key (`styles/compiled.css`, `styles/index.css`, `styles/editor.css`, `styles/tokens.css`, `styles/tailwind.css`). The bundler's `declare module '*.css'` matches only those; the keys without the extension fail TypeScript 6 with TS2882. Both resolve to the same file, and CSS `@import`s can use either.
|
|
156
|
+
|
|
157
|
+
- Every rule sits in `@layer ggraphic`, so any unlayered host rule wins without `!important`. If your own CSS is layered, declare `ggraphic` first (`@layer ggraphic, base, …;`) to keep the same order.
|
|
158
|
+
- The rules apply only inside `[data-ggraphic]`, Tailwind's reset included, so your page keeps its own reset and theme. `CanvasEditorShell` (and so `GgraphicEditor`) renders that root, and every dialog, menu and popover the editor portals onto `<body>` carries the attribute too. If you mount editor components outside the shell, wrap them in an element with `data-ggraphic` (`EDITOR_SCOPE` from `@ggraphic/editor/ui/editorScope`).
|
|
159
|
+
- Do not combine it with `styles` or `styles/tailwind`.
|
|
160
|
+
|
|
161
|
+
- **Tailwind v4 host:** in your CSS, `@import 'tailwindcss'; @import '@ggraphic/editor/styles'; @import '@ggraphic/editor/styles/tailwind';`. This scans the package and maps the theme names onto the tokens. The classes then live in your Tailwind build and follow your layers.
|
|
162
|
+
|
|
163
|
+
Either way, theme the editor through the `--editor-*` custom properties. Set them on `:root` (light), on `[data-theme='dark']`, or inside `@media (prefers-color-scheme: dark)`. The defaults have zero specificity, so your values win. Dark mode follows `data-theme="dark"` on `<html>` or the system setting unless `data-theme="light"` is set.
|
|
164
|
+
|
|
165
|
+
## Fonts
|
|
34
166
|
|
|
35
|
-
|
|
167
|
+
Every family a brand pack names in `fonts` / `fontFaces` must actually load in the page (`@font-face` with the real files), including each cut you declare. With `defaultBrand`, `import '@ggraphic/brand-default/fonts'` does that. Declare which cuts exist in `fonts.cuts` (`{ bold, italic, boldItalic }` per family): a missing declaration makes the editor fake a cut or hide the bold/italic buttons. Families no pack declares fall back to ggraphic's open aliases.
|
|
168
|
+
|
|
169
|
+
## Testing a host
|
|
170
|
+
|
|
171
|
+
- **Jest** (e.g. jest-expo): the dist is ESM-only. Extend the preset's `transformIgnorePatterns` allowlist with `@ggraphic/` instead of writing your own pattern.
|
|
172
|
+
- **Vitest**: add `server.deps.inline: [/@ggraphic\//]`. Without it, `vi.mock()` of a module that ggraphic imports (`yjs`, `y-indexeddb`, `@hocuspocus/provider`, ...) does not reach the package, and module-level registries keep state across test files when `isolate: false`.
|
|
173
|
+
- jsdom has no canvas fonts, `matchMedia` or `scrollIntoView`: stub `document.fonts`, `matchMedia` and `Element.prototype.scrollIntoView`, and `Konva.Stage.prototype.toDataURL`. `packages/editor/src/embed/GgraphicEditor.vitest.tsx` in the ggraphic repository mounts the component this way.
|
|
174
|
+
- Tools that used to read editor source files from your repo (label extractors, tour-anchor checks) now have to read `node_modules/@ggraphic/editor/dist` or list what they need.
|
|
175
|
+
|
|
176
|
+
## Stored documents
|
|
177
|
+
|
|
178
|
+
Documents carry a schema version (`meta.schemaVersion`). A newer editor upgrades old documents on open; an older editor opens a newer document read-only. When you upgrade ggraphic across a schema version, ship a release that can **read** the new version before the one that **writes** it, so a rollback keeps working.
|
|
179
|
+
|
|
180
|
+
## Advanced: low-level setup
|
|
181
|
+
|
|
182
|
+
Use this when `GgraphicEditor` is not enough: your own page logic (a `FullCanvasConfig` per template), collaboration, your own page picker or document tabs, several brands per document. ggraphic Studio (`apps/studio` in the ggraphic repository) is a complete host on this path. It is **AGPL-3.0**: read it to understand, but do not copy its code into a host that is not AGPL. The packages themselves are MPL-2.0.
|
|
183
|
+
|
|
184
|
+
### Imports
|
|
36
185
|
|
|
37
186
|
Every source file is its own entry point; there is no barrel. Import the file you mean:
|
|
38
187
|
|
|
@@ -40,6 +189,7 @@ Every source file is its own entry point; there is no barrel. Import the file yo
|
|
|
40
189
|
import { registerBrandPacks } from '@ggraphic/editor/brand/brandRegistry';
|
|
41
190
|
import { registerMessages } from '@ggraphic/editor/i18n/messages';
|
|
42
191
|
import { defineTemplate, registerTemplates } from '@ggraphic/editor/templates/registry';
|
|
192
|
+
import { createPageConfig } from '@ggraphic/editor/page/config';
|
|
43
193
|
import { makeSectionDefiner } from '@ggraphic/editor/configs/factory/defineSection';
|
|
44
194
|
import {
|
|
45
195
|
CanvasEditorProvider,
|
|
@@ -51,7 +201,7 @@ import { registerAssetCatalog } from '@ggraphic/editor/utils/canvasAssets';
|
|
|
51
201
|
import { registerToast } from '@ggraphic/editor/utils/editorToast';
|
|
52
202
|
```
|
|
53
203
|
|
|
54
|
-
|
|
204
|
+
### Startup order
|
|
55
205
|
|
|
56
206
|
Fill the module-level registers once, before the first render (for example in `main.tsx`):
|
|
57
207
|
|
|
@@ -65,7 +215,9 @@ registerAssetCatalog(myAssetCatalog); // optional; illustrations, emoji, blocks
|
|
|
65
215
|
|
|
66
216
|
Registering brand packs is not optional decoration: the packs carry the default colours, the bold families and the font cuts every render reads. A test harness or server renderer that skips it draws something no user sees (for example a synthetic bold of a regular cut).
|
|
67
217
|
|
|
68
|
-
|
|
218
|
+
A template is a `FullCanvasConfig` (canvas size, sidebar tabs and sections, elements, page state, actions). `createPageConfig` from `@ggraphic/editor/page/config` builds the free page `GgraphicEditor` uses (colour ground, Text/Elements/Uploads/Tools tabs, the free elements) from a seed; write your own config only for page logic of your own.
|
|
219
|
+
|
|
220
|
+
### Mounting
|
|
69
221
|
|
|
70
222
|
```tsx
|
|
71
223
|
<QueryClientProvider client={queryClient}>
|
|
@@ -74,6 +226,7 @@ Registering brand packs is not optional decoration: the packs carry the default
|
|
|
74
226
|
initialConfigId="my-template"
|
|
75
227
|
initialProps={{}}
|
|
76
228
|
formatId="post-portrait"
|
|
229
|
+
onPagesChange={(pages) => save(pages)}
|
|
77
230
|
onExport={(base64) => {
|
|
78
231
|
/* host decides */
|
|
79
232
|
}}
|
|
@@ -86,38 +239,17 @@ Registering brand packs is not optional decoration: the packs carry the default
|
|
|
86
239
|
```
|
|
87
240
|
|
|
88
241
|
- The editor uses TanStack Query internally, so a `QueryClientProvider` must wrap it.
|
|
89
|
-
- `formatId` is
|
|
90
|
-
- Pass `initialPages` to open a stored multi-page document; `exportApiRef` for programmatic export
|
|
242
|
+
- `formatId` is a built-in format (`post-portrait`, `profile-square`, `slide-16-9`) or one the host added with `registerCanvasFormatGroups` / `registerCanvasFormats` from `@ggraphic/editor/templates`. A format joins the `slides` group to become a slide deck; print formats go in `print`.
|
|
243
|
+
- Pass `initialPages` to open a stored multi-page document; `onPagesChange` to hear every change; `exportApiRef` for programmatic export and `getPages()`; `readOnly` to lock it; `chromeLeft` / `chromeCenter` / `chromeRight` for your own top bar items.
|
|
91
244
|
- `collaborative` connects a page to a Yjs room (`@ggraphic/collab`); without it the host saves the document itself.
|
|
92
|
-
-
|
|
245
|
+
- `CanvasEditorShell` is as tall as the viewport (`--editor-height: 100dvh`), as a full-screen host expects. To make it fill a container of yours instead, set `--editor-height: 100%` on an element around it; the chrome is positioned inside the editor either way.
|
|
246
|
+
- Konva needs `window`: in Next.js and other SSR frameworks render the shell client-only (`'use client'` plus a dynamic import with `ssr: false`).
|
|
93
247
|
|
|
94
|
-
|
|
248
|
+
### Per-document brand
|
|
95
249
|
|
|
96
250
|
A document can carry its own brand: set `brand` on the template's `FullCanvasConfig` (or resolve it per page). React code inside the editor reads it through `useDocumentBrand()`; `activeBrand()` is the app-wide default. Do not re-register packs to switch brands while editors are open: it flips every open editor.
|
|
97
251
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
The components carry Tailwind v4 utility classes. Pick one of two ways to style them:
|
|
101
|
-
|
|
102
|
-
- **Any host (no Tailwind needed):** one import, everything compiled.
|
|
103
|
-
|
|
104
|
-
```ts
|
|
105
|
-
import '@ggraphic/editor/styles/compiled';
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
- Every rule sits in `@layer ggraphic`, so any unlayered host rule wins without `!important`. If your own CSS is layered, declare `ggraphic` first (`@layer ggraphic, base, …;`) to keep the same order.
|
|
109
|
-
- The rules apply only inside `[data-ggraphic]`, Tailwind's reset included, so your page keeps its own reset and theme. `CanvasEditorShell` renders that root, and every dialog, menu and popover the editor portals onto `<body>` carries the attribute too. If you mount editor components outside the shell, wrap them in an element with `data-ggraphic` (`EDITOR_SCOPE` from `@ggraphic/editor/ui/editorScope`).
|
|
110
|
-
- Do not combine it with `styles` or `styles/tailwind`.
|
|
111
|
-
|
|
112
|
-
- **Tailwind v4 host:** in your CSS, `@import 'tailwindcss'; @import '@ggraphic/editor/styles'; @import '@ggraphic/editor/styles/tailwind';`. This scans the package and maps the theme names onto the tokens. The classes then live in your Tailwind build and follow your layers.
|
|
113
|
-
|
|
114
|
-
Either way, theme the editor through the `--editor-*` custom properties. Set them on `:root` (light), on `[data-theme='dark']`, or inside `@media (prefers-color-scheme: dark)`. The defaults have zero specificity, so your values win. Dark mode follows `data-theme="dark"` on `<html>` or the system setting unless `data-theme="light"` is set.
|
|
115
|
-
|
|
116
|
-
## Fonts
|
|
117
|
-
|
|
118
|
-
Every family a brand pack names in `fonts` / `fontFaces` must actually load in the page (`@font-face` with the real files), including each cut you declare. Declare which cuts exist in `fonts.cuts` (`{ bold, italic, boldItalic }` per family): a missing declaration makes the editor fake a cut or hide the bold/italic buttons. Families no pack declares fall back to ggraphic's open aliases.
|
|
119
|
-
|
|
120
|
-
## Extending
|
|
252
|
+
### Extending
|
|
121
253
|
|
|
122
254
|
- Your own SVG sources (an illustration library the host owns): augment the interface and register the source.
|
|
123
255
|
|
|
@@ -132,14 +264,3 @@ Every family a brand pack names in `fonts` / `fontFaces` must actually load in t
|
|
|
132
264
|
Recolour hints go into `illustrations.recolor` of the asset catalogue you pass to `registerAssetCatalog` (`IllustrationSources` in `@ggraphic/editor/utils/canvasAssets`).
|
|
133
265
|
|
|
134
266
|
- Extra host services: augment `CanvasEditorHostServices` from `@ggraphic/editor/CanvasEditorProvider`.
|
|
135
|
-
|
|
136
|
-
## Testing a host
|
|
137
|
-
|
|
138
|
-
- **Jest** (e.g. jest-expo): the dist is ESM-only. Extend the preset's `transformIgnorePatterns` allowlist with `@ggraphic/` instead of writing your own pattern.
|
|
139
|
-
- **Vitest**: add `server.deps.inline: [/@ggraphic\//]`. Without it, `vi.mock()` of a module that ggraphic imports (`yjs`, `y-indexeddb`, `@hocuspocus/provider`, ...) does not reach the package, and module-level registries keep state across test files when `isolate: false`.
|
|
140
|
-
- Render tests and harnesses call the same startup registration as the app.
|
|
141
|
-
- Tools that used to read editor source files from your repo (label extractors, tour-anchor checks) now have to read `node_modules/@ggraphic/editor/dist` or list what they need.
|
|
142
|
-
|
|
143
|
-
## Stored documents
|
|
144
|
-
|
|
145
|
-
Documents carry a schema version (`meta.schemaVersion`). A newer editor upgrades old documents on open; an older editor opens a newer document read-only. When you upgrade ggraphic across a schema version, ship a release that can **read** the new version before the one that **writes** it, so a rollback keeps working.
|