@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.
Files changed (504) hide show
  1. package/README.md +4 -4
  2. package/THIRD_PARTY_NOTICES +12 -3
  3. package/dist/CanvasEditorProvider.d.ts +8 -8
  4. package/dist/ai/applyOperation.d.ts +6 -6
  5. package/dist/ai/applyOperation.js +4 -4
  6. package/dist/ai/describeCanvasElements.d.ts +2 -2
  7. package/dist/ai/describeCanvasElements.js +4 -4
  8. package/dist/ai/illustrationCapability.d.ts +1 -1
  9. package/dist/ai/illustrationCapability.js +1 -1
  10. package/dist/blocks/liftedBlock.d.ts +5 -5
  11. package/dist/blocks/liftedBlock.js +2 -2
  12. package/dist/collab/useSelectionAwareness.js +3 -3
  13. package/dist/collab/useYjsPageStateSync.js +1 -1
  14. package/dist/collab/useYjsPages.d.ts +2 -2
  15. package/dist/collab/useYjsPages.js +4 -4
  16. package/dist/collab/yjsBinding.js +1 -1
  17. package/dist/common/Lightbox.js +2 -2
  18. package/dist/components/AddPageButton.js +2 -2
  19. package/dist/components/CanvasContextMenu/CanvasActionSheet.d.ts +1 -1
  20. package/dist/components/CanvasContextMenu/CanvasActionSheet.js +4 -4
  21. package/dist/components/CanvasContextMenu/CanvasContextMenu.d.ts +2 -2
  22. package/dist/components/CanvasContextMenu/canvasMenuModel.d.ts +1 -1
  23. package/dist/components/CanvasContextMenu/canvasMenuModel.js +2 -2
  24. package/dist/components/CanvasEditor/CanvasEditorShell.d.ts +2 -2
  25. package/dist/components/CanvasEditor/CanvasEditorShell.js +99 -76
  26. package/dist/components/CanvasEditor/PageWrapper.d.ts +1 -1
  27. package/dist/components/CanvasEditor/PageWrapper.js +16 -16
  28. package/dist/components/CanvasEditor/blockInsertContext.d.ts +2 -2
  29. package/dist/components/CanvasEditor/editorShell.d.ts +5 -5
  30. package/dist/components/CanvasEditor/hooks/useCanvasContextMenu.d.ts +1 -1
  31. package/dist/components/CanvasEditor/hooks/useCanvasContextMenu.js +3 -3
  32. package/dist/components/CanvasEditor/hooks/useLoadedConfigs.d.ts +1 -1
  33. package/dist/components/CanvasEditor/hooks/usePageRefs.d.ts +1 -1
  34. package/dist/components/CanvasEditor/hooks/usePageUndoRedoShortcuts.d.ts +1 -1
  35. package/dist/components/CanvasEditor/hooks/usePageUndoRedoShortcuts.js +2 -2
  36. package/dist/components/CanvasEditor/hooks/usePrintImpressumGate.d.ts +1 -1
  37. package/dist/components/CanvasEditor/hooks/usePrintImpressumGate.js +5 -5
  38. package/dist/components/CanvasEditor/hooks/useToolbarHandlers.d.ts +9 -9
  39. package/dist/components/CanvasEditor/hooks/useToolbarHandlers.js +1 -1
  40. package/dist/components/CanvasEditor/hooks/useWorkAreaDeselect.js +1 -1
  41. package/dist/components/CanvasEditor/layersTab.js +1 -1
  42. package/dist/components/CanvasEditor/mobileSelectionArea.d.ts +1 -1
  43. package/dist/components/CanvasEditor/types.d.ts +15 -6
  44. package/dist/components/CanvasEditorSkeleton.js +3 -3
  45. package/dist/components/CanvasMetaBar.js +1 -1
  46. package/dist/components/CanvasRenderLayer.d.ts +3 -3
  47. package/dist/components/CanvasRenderLayer.js +5 -5
  48. package/dist/components/CanvasTextOverlay.js +5 -5
  49. package/dist/components/ConfigCanvas.js +1 -1
  50. package/dist/components/CropGhostOverlay.js +1 -1
  51. package/dist/components/CustomColorSwatch.js +3 -3
  52. package/dist/components/GenericCanvas.d.ts +10 -10
  53. package/dist/components/GenericCanvas.js +41 -30
  54. package/dist/components/GenericCanvasElement.d.ts +2 -2
  55. package/dist/components/GenericCanvasElement.js +7 -7
  56. package/dist/components/MultiSelectionTransformer.js +4 -4
  57. package/dist/components/PagePreview.js +2 -2
  58. package/dist/components/PageThumbnailStrip.d.ts +1 -1
  59. package/dist/components/PageThumbnailStrip.js +2 -2
  60. package/dist/components/PageToolbar.js +1 -1
  61. package/dist/components/RichTextField.js +4 -4
  62. package/dist/components/SelectionPill.d.ts +1 -1
  63. package/dist/components/SelectionPill.js +5 -5
  64. package/dist/components/SlideNotesPanel.js +1 -1
  65. package/dist/components/StandaloneCanvas.d.ts +3 -3
  66. package/dist/components/StandaloneCanvas.js +3 -3
  67. package/dist/components/TextFormatButtons.js +4 -4
  68. package/dist/components/TextFormatControls.js +1 -1
  69. package/dist/components/Toolbar.js +5 -5
  70. package/dist/components/ToolbarStateBridge.d.ts +4 -4
  71. package/dist/components/ToolbarStateBridge.js +4 -4
  72. package/dist/components/TopBar/AutoSaveIndicator.js +3 -3
  73. package/dist/components/TopBar/ContextControls.d.ts +8 -8
  74. package/dist/components/TopBar/ContextControls.js +18 -18
  75. package/dist/components/TopBar/ContextToolbar.d.ts +1 -1
  76. package/dist/components/TopBar/ContextToolbar.js +2 -2
  77. package/dist/components/TopBar/CropModeControls.d.ts +1 -1
  78. package/dist/components/TopBar/CropModeControls.js +4 -4
  79. package/dist/components/TopBar/DownloadSection.d.ts +3 -3
  80. package/dist/components/TopBar/DownloadSection.js +19 -19
  81. package/dist/components/TopBar/MobileSelectionBar.d.ts +1 -1
  82. package/dist/components/TopBar/MobileSelectionBar.js +7 -7
  83. package/dist/components/TopBar/MobileSelectionControls.d.ts +1 -1
  84. package/dist/components/TopBar/MobileSelectionControls.js +6 -6
  85. package/dist/components/TopBar/MultiSelectionToolbar.d.ts +1 -1
  86. package/dist/components/TopBar/MultiSelectionToolbar.js +4 -4
  87. package/dist/components/TopBar/ShareDropdown.js +11 -11
  88. package/dist/components/TopBar/barTiles.js +1 -1
  89. package/dist/components/TopBar/modules/FloatingAiSuggestionBanner.d.ts +1 -1
  90. package/dist/components/TopBar/modules/FloatingAiSuggestionBanner.js +4 -4
  91. package/dist/components/TopBar/modules/FloatingBackgroundControls.d.ts +2 -2
  92. package/dist/components/TopBar/modules/FloatingBackgroundControls.js +9 -9
  93. package/dist/components/TopBar/modules/FloatingColorPicker.d.ts +1 -1
  94. package/dist/components/TopBar/modules/FloatingColorPicker.js +6 -6
  95. package/dist/components/TopBar/modules/FloatingFontRoleControl.js +5 -5
  96. package/dist/components/TopBar/modules/FloatingFontSizeControl.js +2 -2
  97. package/dist/components/TopBar/modules/FloatingHistoryControls.js +1 -1
  98. package/dist/components/TopBar/modules/FloatingImageLookControl.d.ts +1 -1
  99. package/dist/components/TopBar/modules/FloatingImageLookControl.js +2 -2
  100. package/dist/components/TopBar/modules/FloatingLayerControls.js +1 -1
  101. package/dist/components/TopBar/modules/FloatingOpacityControl.js +3 -3
  102. package/dist/components/TopBar/modules/FloatingPositionControl.d.ts +1 -1
  103. package/dist/components/TopBar/modules/FloatingPositionControl.js +5 -5
  104. package/dist/components/TopBar/modules/FloatingTextAlignControl.d.ts +1 -1
  105. package/dist/components/TopBar/modules/FloatingTextAlignControl.js +3 -3
  106. package/dist/components/kindRenderers.d.ts +6 -6
  107. package/dist/components/kindRenderers.js +9 -9
  108. package/dist/components/markerMark.js +1 -1
  109. package/dist/composer/cardFollowsText.d.ts +2 -2
  110. package/dist/composer/cardFollowsText.js +1 -1
  111. package/dist/composer/steckbriefLayout.d.ts +1 -1
  112. package/dist/composer/steckbriefLayout.js +1 -1
  113. package/dist/configs/buildCanvasText.d.ts +5 -0
  114. package/dist/configs/buildCanvasText.js +58 -0
  115. package/dist/configs/buildSharepicText.d.ts +2 -5
  116. package/dist/configs/buildSharepicText.js +2 -57
  117. package/dist/configs/configLoader.d.ts +1 -1
  118. package/dist/configs/configLoader.js +2 -2
  119. package/dist/configs/factory/actionFactories.d.ts +11 -11
  120. package/dist/configs/factory/actionFactories.js +13 -13
  121. package/dist/configs/factory/baseTypes.d.ts +10 -10
  122. package/dist/configs/factory/carryInstanceState.d.ts +8 -8
  123. package/dist/configs/factory/carryInstanceState.js +2 -2
  124. package/dist/configs/factory/createTextElement.d.ts +1 -1
  125. package/dist/configs/factory/createTextElement.js +1 -1
  126. package/dist/configs/factory/defineSection.d.ts +1 -1
  127. package/dist/configs/factory/layoutAccessors.d.ts +1 -1
  128. package/dist/configs/featureInjector.d.ts +2 -2
  129. package/dist/configs/featureInjector.js +2 -2
  130. package/dist/configs/placeholders.js +1 -1
  131. package/dist/configs/shareSection.d.ts +3 -3
  132. package/dist/configs/shareSection.js +12 -8
  133. package/dist/configs/types.d.ts +5 -5
  134. package/dist/embed/EmbeddedEditor.d.ts +4 -0
  135. package/dist/embed/EmbeddedEditor.js +68 -0
  136. package/dist/embed/GgraphicEditor.d.ts +2 -0
  137. package/dist/embed/GgraphicEditor.js +16 -0
  138. package/dist/embed/index.d.ts +6 -0
  139. package/dist/embed/index.js +5 -0
  140. package/dist/embed/loadTemplatePack.d.ts +8 -0
  141. package/dist/embed/loadTemplatePack.js +9 -0
  142. package/dist/embed/types.d.ts +44 -0
  143. package/dist/embed/types.js +1 -0
  144. package/dist/entries/ai.d.ts +5 -0
  145. package/dist/entries/ai.js +5 -0
  146. package/dist/entries/brand.d.ts +4 -0
  147. package/dist/entries/brand.js +5 -0
  148. package/dist/entries/canvas.d.ts +5 -0
  149. package/dist/entries/canvas.js +6 -0
  150. package/dist/entries/collab.d.ts +6 -0
  151. package/dist/entries/collab.js +7 -0
  152. package/dist/entries/config.d.ts +12 -0
  153. package/dist/entries/config.js +9 -0
  154. package/dist/entries/elements.d.ts +21 -0
  155. package/dist/entries/elements.js +17 -0
  156. package/dist/entries/embed.d.ts +2 -0
  157. package/dist/entries/embed.js +7 -0
  158. package/dist/entries/export.d.ts +8 -0
  159. package/dist/entries/export.js +7 -0
  160. package/dist/entries/host.d.ts +30 -0
  161. package/dist/entries/host.js +10 -0
  162. package/dist/entries/hostReact.d.ts +9 -0
  163. package/dist/entries/hostReact.js +11 -0
  164. package/dist/entries/i18n.d.ts +2 -0
  165. package/dist/entries/i18n.js +3 -0
  166. package/dist/entries/illustrations/gophers.d.ts +2 -0
  167. package/dist/entries/illustrations/gophers.js +3 -0
  168. package/dist/entries/illustrations/humaaans.d.ts +2 -0
  169. package/dist/entries/illustrations/humaaans.js +3 -0
  170. package/dist/entries/illustrations/illlustrations.d.ts +2 -0
  171. package/dist/entries/illustrations/illlustrations.js +3 -0
  172. package/dist/entries/illustrations/kawaii.d.ts +2 -0
  173. package/dist/entries/illustrations/kawaii.js +3 -0
  174. package/dist/entries/illustrations/opendoodles.d.ts +2 -0
  175. package/dist/entries/illustrations/opendoodles.js +3 -0
  176. package/dist/entries/illustrations/openpeeps.d.ts +2 -0
  177. package/dist/entries/illustrations/openpeeps.js +3 -0
  178. package/dist/entries/illustrations/transhumans.d.ts +2 -0
  179. package/dist/entries/illustrations/transhumans.js +3 -0
  180. package/dist/entries/kinds.d.ts +101 -0
  181. package/dist/entries/kinds.js +100 -0
  182. package/dist/entries/page.d.ts +13 -0
  183. package/dist/entries/page.js +13 -0
  184. package/dist/entries/services.d.ts +6 -0
  185. package/dist/entries/services.js +4 -0
  186. package/dist/entries/shell.d.ts +13 -0
  187. package/dist/entries/shell.js +13 -0
  188. package/dist/entries/sidebar.d.ts +15 -0
  189. package/dist/entries/sidebar.js +13 -0
  190. package/dist/entries/store.d.ts +3 -0
  191. package/dist/entries/store.js +4 -0
  192. package/dist/entries/templates.d.ts +4 -0
  193. package/dist/entries/templates.js +5 -0
  194. package/dist/entries/text.d.ts +6 -0
  195. package/dist/entries/text.js +7 -0
  196. package/dist/export/pptx/buildPptxModel.d.ts +1 -1
  197. package/dist/export/pptx/buildPptxModel.js +9 -9
  198. package/dist/export/pptx/exportPptxDeck.d.ts +2 -2
  199. package/dist/export/pptx/exportPptxDeck.js +2 -2
  200. package/dist/export/pptx/textModel.d.ts +1 -1
  201. package/dist/export/pptx/textModel.js +1 -1
  202. package/dist/export/pptx/writePptx.d.ts +5 -2
  203. package/dist/export/pptx/writePptx.js +6 -3
  204. package/dist/export/pptx/writeText.d.ts +60 -6
  205. package/dist/export/pptx/writeText.js +2 -2
  206. package/dist/export/printExport.d.ts +1 -1
  207. package/dist/export/printExport.js +2 -2
  208. package/dist/export/slidesPdf.js +1 -1
  209. package/dist/formats/index.d.ts +37 -15
  210. package/dist/formats/index.js +51 -95
  211. package/dist/formats/legacyCatalog.d.ts +21 -0
  212. package/dist/formats/legacyCatalog.js +76 -0
  213. package/dist/hooks/editorBox.d.ts +20 -0
  214. package/dist/hooks/editorBox.js +65 -0
  215. package/dist/hooks/index.d.ts +13 -13
  216. package/dist/hooks/index.js +9 -9
  217. package/dist/hooks/stageFit.d.ts +24 -0
  218. package/dist/hooks/stageFit.js +76 -0
  219. package/dist/hooks/useAiImageGeneration.js +2 -2
  220. package/dist/hooks/useCanvasAutoSave.js +1 -1
  221. package/dist/hooks/useCanvasElementHandlers.d.ts +6 -6
  222. package/dist/hooks/useCanvasInteractions.d.ts +1 -1
  223. package/dist/hooks/useCanvasInteractions.js +1 -1
  224. package/dist/hooks/useCanvasKeyboardHandlers.d.ts +1 -1
  225. package/dist/hooks/useCanvasKeyboardHandlers.js +4 -4
  226. package/dist/hooks/useCanvasUndoRedo.js +3 -3
  227. package/dist/hooks/useContextPress.js +3 -3
  228. package/dist/hooks/useCropSession.js +1 -1
  229. package/dist/hooks/useDeckAutoSave.js +3 -3
  230. package/dist/hooks/useDeepSelect.js +2 -2
  231. package/dist/hooks/useFloatingModuleHandlers.d.ts +3 -3
  232. package/dist/hooks/useFloatingModuleHandlers.js +2 -2
  233. package/dist/hooks/useFloatingModuleState.d.ts +3 -3
  234. package/dist/hooks/useFloatingModuleState.js +1 -1
  235. package/dist/hooks/useFontGeneration.d.ts +1 -9
  236. package/dist/hooks/useFontGeneration.js +3 -48
  237. package/dist/hooks/useFontLoader.d.ts +1 -9
  238. package/dist/hooks/useFontLoader.js +2 -16
  239. package/dist/hooks/useIconSetsFor.js +1 -1
  240. package/dist/hooks/useIsCanvasMobile.d.ts +5 -1
  241. package/dist/hooks/useIsCanvasMobile.js +10 -2
  242. package/dist/hooks/useMarqueeSelection.js +2 -2
  243. package/dist/hooks/useMultiPageExport.d.ts +1 -1
  244. package/dist/hooks/useMultiPageExport.js +3 -3
  245. package/dist/hooks/usePageManager.d.ts +1 -1
  246. package/dist/hooks/usePageManager.js +4 -4
  247. package/dist/hooks/useSelectionAnnouncement.js +2 -2
  248. package/dist/hooks/useTrackUnsplashDownload.d.ts +1 -1
  249. package/dist/hooks/useTrackUnsplashDownload.js +1 -1
  250. package/dist/hostServices.d.ts +53 -31
  251. package/dist/hostServices.js +6 -4
  252. package/dist/i18n/catalogue.d.ts +21 -0
  253. package/dist/i18n/catalogue.js +58 -0
  254. package/dist/i18n/de.d.ts +14 -15
  255. package/dist/i18n/de.js +16 -32
  256. package/dist/i18n/en.js +16 -32
  257. package/dist/i18n/messages.d.ts +1 -13
  258. package/dist/i18n/messages.js +2 -52
  259. package/dist/layouts/CanvasEditorLayout.d.ts +1 -1
  260. package/dist/layouts/CanvasEditorLayout.js +11 -7
  261. package/dist/page/actions.d.ts +9 -9
  262. package/dist/page/actions.js +8 -8
  263. package/dist/page/config.d.ts +1 -1
  264. package/dist/page/config.js +52 -15
  265. package/dist/page/fitting.js +1 -1
  266. package/dist/page/hug.js +1 -1
  267. package/dist/page/instantiate.js +2 -2
  268. package/dist/page/pageState.d.ts +1 -1
  269. package/dist/page/pageState.js +2 -2
  270. package/dist/page/typography.js +1 -1
  271. package/dist/primitives/AssetPrimitive.d.ts +2 -2
  272. package/dist/primitives/AssetPrimitive.js +9 -9
  273. package/dist/primitives/CanvasIcons.js +1 -1
  274. package/dist/primitives/CanvasImage.d.ts +4 -4
  275. package/dist/primitives/CanvasImage.js +9 -9
  276. package/dist/primitives/CanvasRichText.js +13 -13
  277. package/dist/primitives/CanvasStage.d.ts +7 -1
  278. package/dist/primitives/CanvasStage.js +29 -16
  279. package/dist/primitives/CanvasText.d.ts +6 -6
  280. package/dist/primitives/CanvasText.js +11 -11
  281. package/dist/primitives/ChartPrimitive.d.ts +2 -2
  282. package/dist/primitives/ChartPrimitive.js +6 -6
  283. package/dist/primitives/CircleBadge.d.ts +1 -1
  284. package/dist/primitives/CircleBadge.js +9 -9
  285. package/dist/primitives/FramePrimitive.d.ts +2 -2
  286. package/dist/primitives/FramePrimitive.js +5 -5
  287. package/dist/primitives/IllustrationPrimitive.d.ts +2 -2
  288. package/dist/primitives/IllustrationPrimitive.js +6 -6
  289. package/dist/primitives/PillBadge.d.ts +1 -1
  290. package/dist/primitives/PillBadge.js +9 -9
  291. package/dist/primitives/ShapePrimitive.d.ts +2 -2
  292. package/dist/primitives/ShapePrimitive.js +9 -9
  293. package/dist/primitives/UserImagePrimitive.d.ts +2 -2
  294. package/dist/primitives/UserImagePrimitive.js +14 -14
  295. package/dist/primitives/index.d.ts +12 -12
  296. package/dist/primitives/index.js +7 -7
  297. package/dist/sidebar/SidebarPanel.d.ts +1 -1
  298. package/dist/sidebar/SidebarPanel.js +7 -7
  299. package/dist/sidebar/SidebarTabBar.d.ts +1 -1
  300. package/dist/sidebar/SidebarTabBar.js +5 -5
  301. package/dist/sidebar/SubsectionTabBar.js +5 -5
  302. package/dist/sidebar/UserUploadsProvider.js +2 -2
  303. package/dist/sidebar/components/AltTextField.js +3 -3
  304. package/dist/sidebar/components/SidebarHint.js +2 -2
  305. package/dist/sidebar/components/TextFieldPrimitives.d.ts +1 -1
  306. package/dist/sidebar/components/TextFieldPrimitives.js +1 -1
  307. package/dist/sidebar/coreSidebar.d.ts +23 -0
  308. package/dist/sidebar/coreSidebar.js +12 -0
  309. package/dist/sidebar/coreSidebarParts.d.ts +3 -0
  310. package/dist/sidebar/coreSidebarParts.js +20 -0
  311. package/dist/sidebar/sections/AssetGallery.d.ts +33 -0
  312. package/dist/sidebar/sections/AssetGallery.js +58 -0
  313. package/dist/sidebar/sections/ChartSettingsSection.d.ts +1 -1
  314. package/dist/sidebar/sections/ChartSettingsSection.js +6 -6
  315. package/dist/sidebar/sections/ChartsSection.d.ts +9 -0
  316. package/dist/sidebar/sections/ChartsSection.js +40 -0
  317. package/dist/sidebar/sections/CombinedTextSection.d.ts +2 -2
  318. package/dist/sidebar/sections/CombinedTextSection.js +7 -7
  319. package/dist/sidebar/sections/DiagrammeSection.d.ts +6 -9
  320. package/dist/sidebar/sections/DiagrammeSection.js +4 -39
  321. package/dist/sidebar/sections/EffectsSection.d.ts +3 -3
  322. package/dist/sidebar/sections/EffectsSection.js +5 -5
  323. package/dist/sidebar/sections/FormenSection.d.ts +6 -28
  324. package/dist/sidebar/sections/FormenSection.js +4 -439
  325. package/dist/sidebar/sections/FrameSettingsSection.d.ts +1 -1
  326. package/dist/sidebar/sections/FrameSettingsSection.js +3 -3
  327. package/dist/sidebar/sections/FramesSection.d.ts +7 -0
  328. package/dist/sidebar/sections/FramesSection.js +18 -0
  329. package/dist/sidebar/sections/GenericShareSection.js +8 -8
  330. package/dist/sidebar/sections/IconsSection.js +6 -4
  331. package/dist/sidebar/sections/IllustrationSettings.d.ts +1 -1
  332. package/dist/sidebar/sections/IllustrationSettings.js +5 -5
  333. package/dist/sidebar/sections/IllustrationThumb.d.ts +1 -1
  334. package/dist/sidebar/sections/IllustrationThumb.js +2 -2
  335. package/dist/sidebar/sections/ImageAdjustSection.d.ts +1 -1
  336. package/dist/sidebar/sections/ImageAdjustSection.js +8 -8
  337. package/dist/sidebar/sections/LayersSection.d.ts +2 -2
  338. package/dist/sidebar/sections/LayersSection.js +3 -3
  339. package/dist/sidebar/sections/RahmenSection.d.ts +2 -7
  340. package/dist/sidebar/sections/RahmenSection.js +2 -17
  341. package/dist/sidebar/sections/ShapesSection.d.ts +28 -0
  342. package/dist/sidebar/sections/ShapesSection.js +440 -0
  343. package/dist/sidebar/sections/StudioGallery.d.ts +4 -33
  344. package/dist/sidebar/sections/StudioGallery.js +4 -57
  345. package/dist/sidebar/sections/UploadsSection.js +11 -11
  346. package/dist/sidebar/sections/assets/AssetsSection.d.ts +8 -8
  347. package/dist/sidebar/sections/assets/AssetsSection.js +2 -2
  348. package/dist/sidebar/sections/assets/BackgroundCatalog.d.ts +1 -1
  349. package/dist/sidebar/sections/assets/BackgroundCatalog.js +7 -7
  350. package/dist/sidebar/sections/assets/CategoryCard.js +1 -1
  351. package/dist/sidebar/sections/assets/ElementThumb.js +10 -8
  352. package/dist/sidebar/sections/assets/ElementTile.js +4 -4
  353. package/dist/sidebar/sections/assets/ElementsPanel.js +12 -12
  354. package/dist/sidebar/sections/assets/EmojiTonePicker.js +2 -2
  355. package/dist/sidebar/sections/assets/FotosCatalog.js +5 -5
  356. package/dist/sidebar/sections/assets/IconifyCatalog.d.ts +1 -1
  357. package/dist/sidebar/sections/assets/IconifyCatalog.js +4 -4
  358. package/dist/sidebar/sections/assets/RecentCarousel.js +4 -4
  359. package/dist/sidebar/sections/assets/StickerCatalog.js +5 -5
  360. package/dist/sidebar/sections/assets/constants.d.ts +1 -1
  361. package/dist/sidebar/sections/assets/elementPanelHost.d.ts +2 -2
  362. package/dist/sidebar/sections/assets/elementSearch.js +1 -1
  363. package/dist/sidebar/sections/assets/elementTypes.d.ts +6 -6
  364. package/dist/sidebar/sections/assets/elementTypes.js +1 -1
  365. package/dist/sidebar/sections/assets/useElementCatalog.d.ts +4 -4
  366. package/dist/sidebar/sections/assets/useElementCatalog.js +14 -14
  367. package/dist/sidebar/sections/assets/useRecentElements.js +2 -2
  368. package/dist/sidebar/sections/assets/useStockPhotos.d.ts +2 -2
  369. package/dist/sidebar/sections/assets/useStockPhotos.js +3 -3
  370. package/dist/sidebar/sections/effects/EffectCard.js +2 -2
  371. package/dist/sidebar/sections/effects/GradientSettings.d.ts +1 -1
  372. package/dist/sidebar/sections/effects/GradientSettings.js +6 -6
  373. package/dist/sidebar/sections/effects/OutlineSettings.js +5 -5
  374. package/dist/sidebar/sections/effects/ShadowSettings.d.ts +1 -1
  375. package/dist/sidebar/sections/effects/ShadowSettings.js +5 -5
  376. package/dist/sidebar/sections/effects/effectsFor.d.ts +1 -1
  377. package/dist/sidebar/sections/effects/effectsFor.js +1 -1
  378. package/dist/sidebar/sections/index.d.ts +6 -2
  379. package/dist/sidebar/sections/index.js +5 -3
  380. package/dist/sidebar/sections/registerBundledIconSets.d.ts +6 -0
  381. package/dist/sidebar/sections/registerBundledIconSets.js +11 -0
  382. package/dist/sidebar/sections/tools/AiCreateTool.js +3 -3
  383. package/dist/sidebar/sections/tools/AiEditTool.js +5 -5
  384. package/dist/sidebar/sections/tools/AltTextTool.d.ts +1 -1
  385. package/dist/sidebar/sections/tools/AltTextTool.js +5 -5
  386. package/dist/sidebar/sections/tools/BlobCreatorTool.js +6 -6
  387. package/dist/sidebar/sections/tools/GradientTextTool.js +8 -8
  388. package/dist/sidebar/sections/tools/ImageInputPicker.js +6 -6
  389. package/dist/sidebar/sections/tools/QRCodeTool.js +5 -5
  390. package/dist/sidebar/sections/tools/RemoveBackgroundTool.js +4 -4
  391. package/dist/sidebar/sections/tools/TextPathCreatorTool.js +8 -8
  392. package/dist/sidebar/sections/tools/ToolPanel.js +2 -2
  393. package/dist/sidebar/sections/tools/ToolTiles.js +1 -1
  394. package/dist/sidebar/sections/tools/ToolsSection.d.ts +2 -2
  395. package/dist/sidebar/sections/tools/ToolsSection.js +17 -17
  396. package/dist/sidebar/sections/tools/UnsplashLimitNotice.js +2 -2
  397. package/dist/sidebar/sections/tools/UnsplashTool.d.ts +1 -1
  398. package/dist/sidebar/sections/tools/UnsplashTool.js +8 -8
  399. package/dist/sidebar/sections/usePreloadSections.d.ts +16 -0
  400. package/dist/sidebar/sections/usePreloadSections.js +29 -0
  401. package/dist/sidebar/tabTypes.d.ts +1 -1
  402. package/dist/sidebar/types.d.ts +4 -4
  403. package/dist/sidebar/useImagePlacement.d.ts +1 -1
  404. package/dist/sidebar/useImagePlacement.js +4 -4
  405. package/dist/stores/createCanvasEditorStore.d.ts +4 -4
  406. package/dist/stores/createCanvasEditorStore.js +2 -2
  407. package/dist/styles/compiled.css +1 -1
  408. package/dist/styles/editor.css +33 -41
  409. package/dist/styles/tailwind.css +20 -3
  410. package/dist/styles/tokens.css +3 -2
  411. package/dist/templates/templateGeometry.js +26 -1
  412. package/dist/templates/testKinds.d.ts +1 -1
  413. package/dist/templates/testKinds.js +1 -1
  414. package/dist/testing/fixtureTemplates.d.ts +1 -1
  415. package/dist/testing/fixtureTemplates.js +1 -1
  416. package/dist/ui/dialog.js +1 -1
  417. package/dist/utils/canvasAssets.d.ts +3 -3
  418. package/dist/utils/canvasCommandRegistry.js +1 -1
  419. package/dist/utils/canvasCommands.d.ts +3 -3
  420. package/dist/utils/canvasCommands.js +7 -7
  421. package/dist/utils/canvasIcons.d.ts +7 -0
  422. package/dist/utils/canvasIcons.js +16 -4
  423. package/dist/utils/canvasItem.d.ts +7 -7
  424. package/dist/utils/canvasLayerManager.d.ts +7 -7
  425. package/dist/utils/captureStage.d.ts +1 -1
  426. package/dist/utils/captureStage.js +1 -1
  427. package/dist/utils/chartUtils.d.ts +2 -2
  428. package/dist/utils/chartUtils.js +3 -3
  429. package/dist/utils/circleBadgeUtils.js +2 -2
  430. package/dist/utils/collectAltTextPages.d.ts +2 -2
  431. package/dist/utils/collectAltTextPages.js +1 -1
  432. package/dist/utils/colorNames.js +3 -3
  433. package/dist/utils/colorOptions.js +1 -1
  434. package/dist/utils/cropAspect.js +1 -1
  435. package/dist/utils/cropGhost.d.ts +1 -1
  436. package/dist/utils/cropSession.d.ts +1 -1
  437. package/dist/utils/cropSession.js +1 -1
  438. package/dist/utils/cropTarget.d.ts +1 -1
  439. package/dist/utils/downloadError.js +1 -1
  440. package/dist/utils/duplicateElement.d.ts +7 -7
  441. package/dist/utils/emoji/emojiCatalog.d.ts +1 -1
  442. package/dist/utils/emoji/emojiCatalog.js +2 -2
  443. package/dist/utils/expandImage.js +1 -1
  444. package/dist/utils/externalIcons.js +1 -1
  445. package/dist/utils/fontGeneration.d.ts +16 -0
  446. package/dist/utils/fontGeneration.js +56 -0
  447. package/dist/utils/fontMarkSupport.js +1 -1
  448. package/dist/utils/fontSpecs.d.ts +9 -0
  449. package/dist/utils/fontSpecs.js +17 -0
  450. package/dist/utils/framePresets.d.ts +19 -0
  451. package/dist/utils/framePresets.js +260 -0
  452. package/dist/utils/frameUtils.d.ts +3 -18
  453. package/dist/utils/frameUtils.js +2 -261
  454. package/dist/utils/iconInstances.d.ts +1 -1
  455. package/dist/utils/illustrations/gophers.d.ts +1 -1
  456. package/dist/utils/illustrations/humaaans.d.ts +1 -1
  457. package/dist/utils/illustrations/illlustrations.d.ts +1 -1
  458. package/dist/utils/illustrations/kawaii.d.ts +1 -1
  459. package/dist/utils/illustrations/opendoodles.d.ts +1 -1
  460. package/dist/utils/illustrations/openpeeps.d.ts +1 -1
  461. package/dist/utils/illustrations/registry.d.ts +3 -3
  462. package/dist/utils/illustrations/registry.js +2 -2
  463. package/dist/utils/illustrations/svgCache.d.ts +1 -1
  464. package/dist/utils/illustrations/transhumans.d.ts +1 -1
  465. package/dist/utils/illustrations/types.js +1 -1
  466. package/dist/utils/imageElementComparison.js +3 -3
  467. package/dist/utils/imageFilters.d.ts +1 -3
  468. package/dist/utils/imageFilters.js +7 -11
  469. package/dist/utils/keyboardCrop.d.ts +1 -1
  470. package/dist/utils/keyboardCrop.js +3 -3
  471. package/dist/utils/layerLabels.js +2 -2
  472. package/dist/utils/markerColors.js +2 -2
  473. package/dist/utils/mediaDrop.d.ts +13 -7
  474. package/dist/utils/mediaDrop.js +12 -6
  475. package/dist/utils/mediaPlacement.js +2 -2
  476. package/dist/utils/photoCredit.js +1 -1
  477. package/dist/utils/photoCredits.d.ts +1 -1
  478. package/dist/utils/photoCredits.js +2 -2
  479. package/dist/utils/photoPlaceholder.js +1 -1
  480. package/dist/utils/pillBadgeUtils.js +2 -2
  481. package/dist/utils/renderedBoxes.d.ts +5 -5
  482. package/dist/utils/renderedBoxes.js +2 -2
  483. package/dist/utils/resolveElementValue.js +1 -1
  484. package/dist/utils/shapes.d.ts +2 -2
  485. package/dist/utils/shapes.js +2 -2
  486. package/dist/utils/smartCrop.d.ts +2 -2
  487. package/dist/utils/smartCrop.js +4 -4
  488. package/dist/utils/surfaceGlow.js +1 -1
  489. package/dist/utils/templateElementInstance.js +1 -1
  490. package/dist/utils/templateRotation.js +1 -1
  491. package/dist/utils/textUtils.js +2 -2
  492. package/dist/utils/unsplashLinks.js +1 -1
  493. package/dist/utils/userImageCrop.d.ts +1 -1
  494. package/dist/utils/userImageCrop.js +2 -2
  495. package/dist/utils/userImageUtils.d.ts +2 -0
  496. package/dist/utils/userImageUtils.js +6 -1
  497. package/dist/utils/viewport.d.ts +12 -8
  498. package/dist/utils/viewport.js +17 -13
  499. package/dist/utils/zipPageImages.js +1 -1
  500. package/dist/vendor/pptxgen.LICENSES.txt +1023 -0
  501. package/dist/vendor/pptxgen.d.ts +2679 -0
  502. package/dist/vendor/pptxgen.js +8831 -0
  503. package/package.json +178 -23
  504. 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.1",
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
- "**/hooks/useFontGeneration.js",
14
- "**/hooks/useFontGeneration.ts"
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.0",
31
- "@hocuspocus/provider": "^4.7.1",
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.147",
187
+ "@iconify-json/lucide": "^1.2.149",
37
188
  "@iconify-json/ri": "1.2.10",
38
- "@iconify-json/tabler": "^1.2.42",
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.0",
43
- "@tiptap/extension-bold": "^3.32.0",
44
- "@tiptap/extension-document": "^3.32.0",
45
- "@tiptap/extension-hard-break": "^3.32.0",
46
- "@tiptap/extension-italic": "^3.32.0",
47
- "@tiptap/extension-list": "^3.32.0",
48
- "@tiptap/extension-paragraph": "^3.32.0",
49
- "@tiptap/extension-text": "^3.32.0",
50
- "@tiptap/extension-underline": "^3.32.0",
51
- "@tiptap/extensions": "^3.32.0",
52
- "@tiptap/react": "^3.32.0",
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.61.0",
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.0.0",
97
- "react-dom": "^19.0.0",
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, registering a brand pack, templates, messages or 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).
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
- ## What you are signing up for
10
+ ## The short path: `GgraphicEditor`
11
11
 
12
- ggraphic ships the editor, not a ready-made product. Before the first render a host supplies:
12
+ A host supplies data and services; the component does the rest.
13
13
 
14
- 1. **At least one brand pack** (`BrandPack` from `@ggraphic/core`): colours, palettes, fonts and font faces, markers, chart colours, logo. No neutral default pack is published yet (`@ggraphic/brand-default` is not started).
15
- 2. **At least one template**: a `FullCanvasConfig` (canvas size, sidebar tabs and sections, elements, page state, actions), registered with `defineTemplate`/`registerTemplates`. No starter config is published yet.
16
- 3. **Host services** through `CanvasEditorProvider`: uploads, media library, image URLs, file delivery and optional features (AI, background removal, icon search).
17
- 4. **Styles and fonts** (see below).
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
- ggraphic Studio (`apps/studio` in the ggraphic repository) is a complete working host to read. 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 and can be embedded in any app.
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
- npm install --save-exact @ggraphic/editor@0.1.0-alpha.0 @ggraphic/core@0.1.0-alpha.0 @ggraphic/schema@0.1.0-alpha.0
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@0.1.0-alpha.0
135
+ npm install --save-exact @ggraphic/collab@alpha
28
136
  ```
29
137
 
30
- - Keep `@ggraphic/*` on the **same exact version**; editor and collab must agree on the document schema.
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
- ## Imports
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
- ## Startup order
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
- ## Mounting
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 one of the editor's formats (`@ggraphic/editor/formats/index`), e.g. `post-portrait`, `post-portrait-tall`, `profile-square`, `slide-16-9`.
90
- - Pass `initialPages` to open a stored multi-page document; `exportApiRef` for programmatic export; `readOnly` to lock it; `chromeLeft` / `chromeCenter` / `chromeRight` for your own top bar items.
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
- - Konva needs `window`: in Next.js and other SSR frameworks render the editor client-only (`'use client'` plus a dynamic import with `ssr: false`).
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
- ## Per-document brand
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
- ## Styles
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.