@ggraphic/editor 0.0.0-stage → 0.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (843) hide show
  1. package/LICENSE +373 -0
  2. package/NOTICE +2 -0
  3. package/README.md +8 -2
  4. package/THIRD_PARTY_NOTICES +7 -0
  5. package/dist/CanvasEditorProvider.d.ts +214 -0
  6. package/dist/CanvasEditorProvider.js +10 -0
  7. package/dist/ai/applyOperation.d.ts +75 -0
  8. package/dist/ai/applyOperation.js +354 -0
  9. package/dist/ai/describeCanvasElements.d.ts +17 -0
  10. package/dist/ai/describeCanvasElements.js +148 -0
  11. package/dist/ai/illustrationCapability.d.ts +6 -0
  12. package/dist/ai/illustrationCapability.js +20 -0
  13. package/dist/ai/types.d.ts +91 -0
  14. package/dist/ai/types.js +1 -0
  15. package/dist/blocks/liftedBlock.d.ts +61 -0
  16. package/dist/blocks/liftedBlock.js +117 -0
  17. package/dist/brand/bindPick.d.ts +18 -0
  18. package/dist/brand/bindPick.js +28 -0
  19. package/dist/brand/bindableFields.d.ts +9 -0
  20. package/dist/brand/bindableFields.js +61 -0
  21. package/dist/brand/brandRegistry.d.ts +26 -0
  22. package/dist/brand/brandRegistry.js +56 -0
  23. package/dist/brand/composerBrand.d.ts +146 -0
  24. package/dist/brand/composerBrand.js +6 -0
  25. package/dist/brand/documentBrand.d.ts +16 -0
  26. package/dist/brand/documentBrand.js +6 -0
  27. package/dist/collab/documentVersion.d.ts +36 -0
  28. package/dist/collab/documentVersion.js +139 -0
  29. package/dist/collab/pageElementStateKeys.d.ts +33 -0
  30. package/dist/collab/pageElementStateKeys.js +148 -0
  31. package/dist/collab/pagesDoc.d.ts +152 -0
  32. package/dist/collab/pagesDoc.js +434 -0
  33. package/dist/collab/useAwarenessState.d.ts +12 -0
  34. package/dist/collab/useAwarenessState.js +47 -0
  35. package/dist/collab/useEmitHostStateChanges.d.ts +18 -0
  36. package/dist/collab/useEmitHostStateChanges.js +40 -0
  37. package/dist/collab/useSelectionAwareness.d.ts +22 -0
  38. package/dist/collab/useSelectionAwareness.js +60 -0
  39. package/dist/collab/useYjsCanvasBinding.d.ts +7 -0
  40. package/dist/collab/useYjsCanvasBinding.js +21 -0
  41. package/dist/collab/useYjsPageStateSync.d.ts +20 -0
  42. package/dist/collab/useYjsPageStateSync.js +49 -0
  43. package/dist/collab/useYjsPages.d.ts +73 -0
  44. package/dist/collab/useYjsPages.js +396 -0
  45. package/dist/collab/wrapCallbacksWithPageSync.d.ts +3 -0
  46. package/dist/collab/wrapCallbacksWithPageSync.js +62 -0
  47. package/dist/collab/ydocKeys.d.ts +50 -0
  48. package/dist/collab/ydocKeys.js +50 -0
  49. package/dist/collab/yjsBinding.d.ts +27 -0
  50. package/dist/collab/yjsBinding.js +105 -0
  51. package/dist/common/Lightbox.d.ts +8 -0
  52. package/dist/common/Lightbox.js +8 -0
  53. package/dist/common/imageSourceTypes.d.ts +1 -0
  54. package/dist/common/imageSourceTypes.js +1 -0
  55. package/dist/components/AddPageButton.d.ts +13 -0
  56. package/dist/components/AddPageButton.js +13 -0
  57. package/dist/components/CanvasAnnouncer.d.ts +8 -0
  58. package/dist/components/CanvasAnnouncer.js +10 -0
  59. package/dist/components/CanvasContextMenu/CanvasActionSheet.d.ts +12 -0
  60. package/dist/components/CanvasContextMenu/CanvasActionSheet.js +145 -0
  61. package/dist/components/CanvasContextMenu/CanvasContextMenu.d.ts +33 -0
  62. package/dist/components/CanvasContextMenu/CanvasContextMenu.js +107 -0
  63. package/dist/components/CanvasContextMenu/canvasMenuModel.d.ts +68 -0
  64. package/dist/components/CanvasContextMenu/canvasMenuModel.js +203 -0
  65. package/dist/components/CanvasEditor/CanvasEditorShell.d.ts +32 -0
  66. package/dist/components/CanvasEditor/CanvasEditorShell.js +1144 -0
  67. package/dist/components/CanvasEditor/PageWrapper.d.ts +7 -0
  68. package/dist/components/CanvasEditor/PageWrapper.js +103 -0
  69. package/dist/components/CanvasEditor/autoSwitchTab.d.ts +11 -0
  70. package/dist/components/CanvasEditor/autoSwitchTab.js +15 -0
  71. package/dist/components/CanvasEditor/blockInsertContext.d.ts +22 -0
  72. package/dist/components/CanvasEditor/blockInsertContext.js +5 -0
  73. package/dist/components/CanvasEditor/editorShell.d.ts +99 -0
  74. package/dist/components/CanvasEditor/editorShell.js +20 -0
  75. package/dist/components/CanvasEditor/hooks/useCanvasContextMenu.d.ts +32 -0
  76. package/dist/components/CanvasEditor/hooks/useCanvasContextMenu.js +140 -0
  77. package/dist/components/CanvasEditor/hooks/useLoadedConfigs.d.ts +13 -0
  78. package/dist/components/CanvasEditor/hooks/useLoadedConfigs.js +29 -0
  79. package/dist/components/CanvasEditor/hooks/useMobileSheetFit.d.ts +14 -0
  80. package/dist/components/CanvasEditor/hooks/useMobileSheetFit.js +56 -0
  81. package/dist/components/CanvasEditor/hooks/usePageRefs.d.ts +18 -0
  82. package/dist/components/CanvasEditor/hooks/usePageRefs.js +36 -0
  83. package/dist/components/CanvasEditor/hooks/usePageUndoRedoShortcuts.d.ts +25 -0
  84. package/dist/components/CanvasEditor/hooks/usePageUndoRedoShortcuts.js +49 -0
  85. package/dist/components/CanvasEditor/hooks/usePrintImpressumGate.d.ts +17 -0
  86. package/dist/components/CanvasEditor/hooks/usePrintImpressumGate.js +70 -0
  87. package/dist/components/CanvasEditor/hooks/useScrollToAddedPage.d.ts +17 -0
  88. package/dist/components/CanvasEditor/hooks/useScrollToAddedPage.js +31 -0
  89. package/dist/components/CanvasEditor/hooks/useToolbarHandlers.d.ts +75 -0
  90. package/dist/components/CanvasEditor/hooks/useToolbarHandlers.js +69 -0
  91. package/dist/components/CanvasEditor/hooks/useWorkAreaDeselect.d.ts +6 -0
  92. package/dist/components/CanvasEditor/hooks/useWorkAreaDeselect.js +56 -0
  93. package/dist/components/CanvasEditor/layersTab.d.ts +13 -0
  94. package/dist/components/CanvasEditor/layersTab.js +27 -0
  95. package/dist/components/CanvasEditor/mobileSelectionArea.d.ts +8 -0
  96. package/dist/components/CanvasEditor/mobileSelectionArea.js +27 -0
  97. package/dist/components/CanvasEditor/types.d.ts +202 -0
  98. package/dist/components/CanvasEditor/types.js +1 -0
  99. package/dist/components/CanvasEditorSkeleton.d.ts +16 -0
  100. package/dist/components/CanvasEditorSkeleton.js +24 -0
  101. package/dist/components/CanvasMetaBar.d.ts +16 -0
  102. package/dist/components/CanvasMetaBar.js +33 -0
  103. package/dist/components/CanvasRenderLayer.d.ts +37 -0
  104. package/dist/components/CanvasRenderLayer.js +54 -0
  105. package/dist/components/CanvasTextOverlay.d.ts +126 -0
  106. package/dist/components/CanvasTextOverlay.js +527 -0
  107. package/dist/components/ConfigCanvas.d.ts +35 -0
  108. package/dist/components/ConfigCanvas.js +30 -0
  109. package/dist/components/CropGhostOverlay.d.ts +13 -0
  110. package/dist/components/CropGhostOverlay.js +56 -0
  111. package/dist/components/CustomColorSwatch.d.ts +35 -0
  112. package/dist/components/CustomColorSwatch.js +81 -0
  113. package/dist/components/DownloadNotice.d.ts +7 -0
  114. package/dist/components/DownloadNotice.js +7 -0
  115. package/dist/components/GenericCanvas.d.ts +309 -0
  116. package/dist/components/GenericCanvas.js +787 -0
  117. package/dist/components/GenericCanvasElement.d.ts +34 -0
  118. package/dist/components/GenericCanvasElement.js +267 -0
  119. package/dist/components/MultiSelectionTransformer.d.ts +39 -0
  120. package/dist/components/MultiSelectionTransformer.js +107 -0
  121. package/dist/components/PagePreview.d.ts +14 -0
  122. package/dist/components/PagePreview.js +63 -0
  123. package/dist/components/PageThumbnailStrip.d.ts +25 -0
  124. package/dist/components/PageThumbnailStrip.js +46 -0
  125. package/dist/components/PageToolbar.d.ts +12 -0
  126. package/dist/components/PageToolbar.js +20 -0
  127. package/dist/components/PrintGuides.d.ts +13 -0
  128. package/dist/components/PrintGuides.js +28 -0
  129. package/dist/components/RemoteSelectionOverlay.d.ts +15 -0
  130. package/dist/components/RemoteSelectionOverlay.js +29 -0
  131. package/dist/components/RichTextField.d.ts +34 -0
  132. package/dist/components/RichTextField.js +216 -0
  133. package/dist/components/SelectionPill.d.ts +56 -0
  134. package/dist/components/SelectionPill.js +123 -0
  135. package/dist/components/SlideNotesPanel.d.ts +13 -0
  136. package/dist/components/SlideNotesPanel.js +28 -0
  137. package/dist/components/SlotBudgetStatus.d.ts +12 -0
  138. package/dist/components/SlotBudgetStatus.js +64 -0
  139. package/dist/components/StandaloneCanvas.d.ts +33 -0
  140. package/dist/components/StandaloneCanvas.js +61 -0
  141. package/dist/components/TextFormatButtons.d.ts +61 -0
  142. package/dist/components/TextFormatButtons.js +107 -0
  143. package/dist/components/TextFormatControls.d.ts +26 -0
  144. package/dist/components/TextFormatControls.js +73 -0
  145. package/dist/components/Toolbar.d.ts +40 -0
  146. package/dist/components/Toolbar.js +26 -0
  147. package/dist/components/ToolbarStateBridge.d.ts +72 -0
  148. package/dist/components/ToolbarStateBridge.js +298 -0
  149. package/dist/components/TopBar/AutoSaveIndicator.d.ts +8 -0
  150. package/dist/components/TopBar/AutoSaveIndicator.js +44 -0
  151. package/dist/components/TopBar/ContextControls.d.ts +107 -0
  152. package/dist/components/TopBar/ContextControls.js +321 -0
  153. package/dist/components/TopBar/ContextToolbar.d.ts +14 -0
  154. package/dist/components/TopBar/ContextToolbar.js +20 -0
  155. package/dist/components/TopBar/CropModeControls.d.ts +35 -0
  156. package/dist/components/TopBar/CropModeControls.js +84 -0
  157. package/dist/components/TopBar/DownloadSection.d.ts +47 -0
  158. package/dist/components/TopBar/DownloadSection.js +102 -0
  159. package/dist/components/TopBar/MobileSelectionBar.d.ts +16 -0
  160. package/dist/components/TopBar/MobileSelectionBar.js +26 -0
  161. package/dist/components/TopBar/MobileSelectionControls.d.ts +10 -0
  162. package/dist/components/TopBar/MobileSelectionControls.js +43 -0
  163. package/dist/components/TopBar/MultiSelectionToolbar.d.ts +19 -0
  164. package/dist/components/TopBar/MultiSelectionToolbar.js +30 -0
  165. package/dist/components/TopBar/ShareDropdown.d.ts +54 -0
  166. package/dist/components/TopBar/ShareDropdown.js +110 -0
  167. package/dist/components/TopBar/TopBar.d.ts +6 -0
  168. package/dist/components/TopBar/TopBar.js +6 -0
  169. package/dist/components/TopBar/barTiles.d.ts +15 -0
  170. package/dist/components/TopBar/barTiles.js +34 -0
  171. package/dist/components/TopBar/modules/FloatingAiSuggestionBanner.d.ts +28 -0
  172. package/dist/components/TopBar/modules/FloatingAiSuggestionBanner.js +26 -0
  173. package/dist/components/TopBar/modules/FloatingBackgroundControls.d.ts +38 -0
  174. package/dist/components/TopBar/modules/FloatingBackgroundControls.js +133 -0
  175. package/dist/components/TopBar/modules/FloatingColorPicker.d.ts +16 -0
  176. package/dist/components/TopBar/modules/FloatingColorPicker.js +89 -0
  177. package/dist/components/TopBar/modules/FloatingFontRoleControl.d.ts +17 -0
  178. package/dist/components/TopBar/modules/FloatingFontRoleControl.js +37 -0
  179. package/dist/components/TopBar/modules/FloatingFontSizeControl.d.ts +7 -0
  180. package/dist/components/TopBar/modules/FloatingFontSizeControl.js +22 -0
  181. package/dist/components/TopBar/modules/FloatingHistoryControls.d.ts +11 -0
  182. package/dist/components/TopBar/modules/FloatingHistoryControls.js +19 -0
  183. package/dist/components/TopBar/modules/FloatingImageLookControl.d.ts +9 -0
  184. package/dist/components/TopBar/modules/FloatingImageLookControl.js +15 -0
  185. package/dist/components/TopBar/modules/FloatingLayerControls.d.ts +9 -0
  186. package/dist/components/TopBar/modules/FloatingLayerControls.js +9 -0
  187. package/dist/components/TopBar/modules/FloatingOpacityControl.d.ts +11 -0
  188. package/dist/components/TopBar/modules/FloatingOpacityControl.js +19 -0
  189. package/dist/components/TopBar/modules/FloatingPositionControl.d.ts +38 -0
  190. package/dist/components/TopBar/modules/FloatingPositionControl.js +74 -0
  191. package/dist/components/TopBar/modules/FloatingTextAlignControl.d.ts +12 -0
  192. package/dist/components/TopBar/modules/FloatingTextAlignControl.js +27 -0
  193. package/dist/components/TransformHud.d.ts +11 -0
  194. package/dist/components/TransformHud.js +121 -0
  195. package/dist/components/WholeTextFormatControls.d.ts +10 -0
  196. package/dist/components/WholeTextFormatControls.js +37 -0
  197. package/dist/components/ZoomableViewport.d.ts +6 -0
  198. package/dist/components/ZoomableViewport.js +4 -0
  199. package/dist/components/accentMark.d.ts +20 -0
  200. package/dist/components/accentMark.js +24 -0
  201. package/dist/components/canvasItemLock.d.ts +13 -0
  202. package/dist/components/canvasItemLock.js +12 -0
  203. package/dist/components/kindRenderers.d.ts +118 -0
  204. package/dist/components/kindRenderers.js +151 -0
  205. package/dist/components/markColor.d.ts +13 -0
  206. package/dist/components/markColor.js +21 -0
  207. package/dist/components/markerMark.d.ts +24 -0
  208. package/dist/components/markerMark.js +22 -0
  209. package/dist/composer/cardFollowsText.d.ts +17 -0
  210. package/dist/composer/cardFollowsText.js +34 -0
  211. package/dist/composer/marks.d.ts +4 -0
  212. package/dist/composer/marks.js +15 -0
  213. package/dist/composer/steckbriefLayout.d.ts +147 -0
  214. package/dist/composer/steckbriefLayout.js +468 -0
  215. package/dist/composer/textFit.d.ts +31 -0
  216. package/dist/composer/textFit.js +89 -0
  217. package/dist/configs/buildSharepicText.d.ts +5 -0
  218. package/dist/configs/buildSharepicText.js +58 -0
  219. package/dist/configs/configLoader.d.ts +34 -0
  220. package/dist/configs/configLoader.js +60 -0
  221. package/dist/configs/factory/actionFactories.d.ts +201 -0
  222. package/dist/configs/factory/actionFactories.js +628 -0
  223. package/dist/configs/factory/baseTypes.d.ts +150 -0
  224. package/dist/configs/factory/baseTypes.js +8 -0
  225. package/dist/configs/factory/carryInstanceState.d.ts +82 -0
  226. package/dist/configs/factory/carryInstanceState.js +121 -0
  227. package/dist/configs/factory/createTextElement.d.ts +63 -0
  228. package/dist/configs/factory/createTextElement.js +63 -0
  229. package/dist/configs/factory/defineSection.d.ts +45 -0
  230. package/dist/configs/factory/defineSection.js +45 -0
  231. package/dist/configs/factory/layoutAccessors.d.ts +15 -0
  232. package/dist/configs/factory/layoutAccessors.js +20 -0
  233. package/dist/configs/featureInjector.d.ts +40 -0
  234. package/dist/configs/featureInjector.js +184 -0
  235. package/dist/configs/pageInheritance.d.ts +8 -0
  236. package/dist/configs/pageInheritance.js +82 -0
  237. package/dist/configs/placeholders.d.ts +14 -0
  238. package/dist/configs/placeholders.js +33 -0
  239. package/dist/configs/shareSection.d.ts +11 -0
  240. package/dist/configs/shareSection.js +65 -0
  241. package/dist/configs/types.d.ts +431 -0
  242. package/dist/configs/types.js +1 -0
  243. package/dist/configs/unifiedTabs.d.ts +26 -0
  244. package/dist/configs/unifiedTabs.js +6 -0
  245. package/dist/editorSeamTypes.d.ts +41 -0
  246. package/dist/editorSeamTypes.js +1 -0
  247. package/dist/export/pptx/buildPptxModel.d.ts +47 -0
  248. package/dist/export/pptx/buildPptxModel.js +612 -0
  249. package/dist/export/pptx/exportPptxDeck.d.ts +26 -0
  250. package/dist/export/pptx/exportPptxDeck.js +80 -0
  251. package/dist/export/pptx/pptxFonts.d.ts +26 -0
  252. package/dist/export/pptx/pptxFonts.js +41 -0
  253. package/dist/export/pptx/pptxUnits.d.ts +27 -0
  254. package/dist/export/pptx/pptxUnits.js +54 -0
  255. package/dist/export/pptx/textModel.d.ts +17 -0
  256. package/dist/export/pptx/textModel.js +118 -0
  257. package/dist/export/pptx/types.d.ts +161 -0
  258. package/dist/export/pptx/types.js +11 -0
  259. package/dist/export/pptx/writePptx.d.ts +40 -0
  260. package/dist/export/pptx/writePptx.js +206 -0
  261. package/dist/export/pptx/writeText.d.ts +19 -0
  262. package/dist/export/pptx/writeText.js +120 -0
  263. package/dist/export/printExport.d.ts +42 -0
  264. package/dist/export/printExport.js +94 -0
  265. package/dist/export/printPdf.d.ts +103 -0
  266. package/dist/export/printPdf.js +144 -0
  267. package/dist/export/slidesPdf.d.ts +9 -0
  268. package/dist/export/slidesPdf.js +31 -0
  269. package/dist/formats/index.d.ts +115 -0
  270. package/dist/formats/index.js +287 -0
  271. package/dist/groups/pageGroups.d.ts +32 -0
  272. package/dist/groups/pageGroups.js +91 -0
  273. package/dist/hooks/index.d.ts +29 -0
  274. package/dist/hooks/index.js +19 -0
  275. package/dist/hooks/useAiImageGeneration.d.ts +15 -0
  276. package/dist/hooks/useAiImageGeneration.js +73 -0
  277. package/dist/hooks/useAnnounce.d.ts +27 -0
  278. package/dist/hooks/useAnnounce.js +47 -0
  279. package/dist/hooks/useBoxSnap.d.ts +37 -0
  280. package/dist/hooks/useBoxSnap.js +49 -0
  281. package/dist/hooks/useCanvasAutoSave.d.ts +33 -0
  282. package/dist/hooks/useCanvasAutoSave.js +259 -0
  283. package/dist/hooks/useCanvasElementHandlers.d.ts +182 -0
  284. package/dist/hooks/useCanvasElementHandlers.js +326 -0
  285. package/dist/hooks/useCanvasHistorySetup.d.ts +37 -0
  286. package/dist/hooks/useCanvasHistorySetup.js +113 -0
  287. package/dist/hooks/useCanvasInteractions.d.ts +31 -0
  288. package/dist/hooks/useCanvasInteractions.js +103 -0
  289. package/dist/hooks/useCanvasKeyboardHandlers.d.ts +37 -0
  290. package/dist/hooks/useCanvasKeyboardHandlers.js +280 -0
  291. package/dist/hooks/useCanvasStoreReset.d.ts +25 -0
  292. package/dist/hooks/useCanvasStoreReset.js +35 -0
  293. package/dist/hooks/useCanvasUndoRedo.d.ts +34 -0
  294. package/dist/hooks/useCanvasUndoRedo.js +213 -0
  295. package/dist/hooks/useContextPress.d.ts +14 -0
  296. package/dist/hooks/useContextPress.js +45 -0
  297. package/dist/hooks/useCropSession.d.ts +23 -0
  298. package/dist/hooks/useCropSession.js +69 -0
  299. package/dist/hooks/useDebounce.d.ts +1 -0
  300. package/dist/hooks/useDebounce.js +14 -0
  301. package/dist/hooks/useDeckAutoSave.d.ts +30 -0
  302. package/dist/hooks/useDeckAutoSave.js +234 -0
  303. package/dist/hooks/useDeepSelect.d.ts +18 -0
  304. package/dist/hooks/useDeepSelect.js +135 -0
  305. package/dist/hooks/useElementSnapping.d.ts +13 -0
  306. package/dist/hooks/useElementSnapping.js +26 -0
  307. package/dist/hooks/useEmojiCatalog.d.ts +3 -0
  308. package/dist/hooks/useEmojiCatalog.js +13 -0
  309. package/dist/hooks/useFloatingModuleHandlers.d.ts +52 -0
  310. package/dist/hooks/useFloatingModuleHandlers.js +285 -0
  311. package/dist/hooks/useFloatingModuleState.d.ts +83 -0
  312. package/dist/hooks/useFloatingModuleState.js +250 -0
  313. package/dist/hooks/useFontGeneration.d.ts +10 -0
  314. package/dist/hooks/useFontGeneration.js +77 -0
  315. package/dist/hooks/useFontLoader.d.ts +53 -0
  316. package/dist/hooks/useFontLoader.js +129 -0
  317. package/dist/hooks/useGeometryReporter.d.ts +19 -0
  318. package/dist/hooks/useGeometryReporter.js +41 -0
  319. package/dist/hooks/useHoverOutline.d.ts +8 -0
  320. package/dist/hooks/useHoverOutline.js +78 -0
  321. package/dist/hooks/useIconCatalog.d.ts +12 -0
  322. package/dist/hooks/useIconCatalog.js +30 -0
  323. package/dist/hooks/useIconSearch.d.ts +2 -0
  324. package/dist/hooks/useIconSearch.js +14 -0
  325. package/dist/hooks/useIconSetsFor.d.ts +8 -0
  326. package/dist/hooks/useIconSetsFor.js +30 -0
  327. package/dist/hooks/useImageCoverFit.d.ts +17 -0
  328. package/dist/hooks/useImageCoverFit.js +35 -0
  329. package/dist/hooks/useIsCanvasMobile.d.ts +3 -0
  330. package/dist/hooks/useIsCanvasMobile.js +19 -0
  331. package/dist/hooks/useMarqueeSelection.d.ts +27 -0
  332. package/dist/hooks/useMarqueeSelection.js +140 -0
  333. package/dist/hooks/useMobileSheet.d.ts +48 -0
  334. package/dist/hooks/useMobileSheet.js +282 -0
  335. package/dist/hooks/useMultiPageExport.d.ts +30 -0
  336. package/dist/hooks/useMultiPageExport.js +117 -0
  337. package/dist/hooks/usePageManager.d.ts +132 -0
  338. package/dist/hooks/usePageManager.js +399 -0
  339. package/dist/hooks/usePageThumbnails.d.ts +10 -0
  340. package/dist/hooks/usePageThumbnails.js +122 -0
  341. package/dist/hooks/usePaginatedIcons.d.ts +11 -0
  342. package/dist/hooks/usePaginatedIcons.js +46 -0
  343. package/dist/hooks/useRovingToolbar.d.ts +17 -0
  344. package/dist/hooks/useRovingToolbar.js +76 -0
  345. package/dist/hooks/useSelectionAnnouncement.d.ts +13 -0
  346. package/dist/hooks/useSelectionAnnouncement.js +68 -0
  347. package/dist/hooks/useSnapScheduler.d.ts +20 -0
  348. package/dist/hooks/useSnapScheduler.js +61 -0
  349. package/dist/hooks/useTrackUnsplashDownload.d.ts +6 -0
  350. package/dist/hooks/useTrackUnsplashDownload.js +19 -0
  351. package/dist/hooks/useZoomGestures.d.ts +35 -0
  352. package/dist/hooks/useZoomGestures.js +185 -0
  353. package/dist/hostServices.d.ts +308 -0
  354. package/dist/hostServices.js +107 -0
  355. package/dist/i18n/de.d.ts +897 -0
  356. package/dist/i18n/de.js +961 -0
  357. package/dist/i18n/en.d.ts +3 -0
  358. package/dist/i18n/en.js +949 -0
  359. package/dist/i18n/messages.d.ts +28 -0
  360. package/dist/i18n/messages.js +66 -0
  361. package/dist/layouts/CanvasEditorLayout.d.ts +28 -0
  362. package/dist/layouts/CanvasEditorLayout.js +56 -0
  363. package/dist/layouts/index.d.ts +2 -0
  364. package/dist/layouts/index.js +2 -0
  365. package/dist/primitives/AssetPrimitive.d.ts +24 -0
  366. package/dist/primitives/AssetPrimitive.js +158 -0
  367. package/dist/primitives/CanvasBackground.d.ts +33 -0
  368. package/dist/primitives/CanvasBackground.js +44 -0
  369. package/dist/primitives/CanvasIcons.d.ts +19 -0
  370. package/dist/primitives/CanvasIcons.js +46 -0
  371. package/dist/primitives/CanvasImage.d.ts +73 -0
  372. package/dist/primitives/CanvasImage.js +460 -0
  373. package/dist/primitives/CanvasRichText.d.ts +25 -0
  374. package/dist/primitives/CanvasRichText.js +284 -0
  375. package/dist/primitives/CanvasStage.d.ts +84 -0
  376. package/dist/primitives/CanvasStage.js +292 -0
  377. package/dist/primitives/CanvasText.d.ts +91 -0
  378. package/dist/primitives/CanvasText.js +293 -0
  379. package/dist/primitives/ChartPrimitive.d.ts +24 -0
  380. package/dist/primitives/ChartPrimitive.js +318 -0
  381. package/dist/primitives/CircleBadge.d.ts +43 -0
  382. package/dist/primitives/CircleBadge.js +233 -0
  383. package/dist/primitives/FramePrimitive.d.ts +14 -0
  384. package/dist/primitives/FramePrimitive.js +406 -0
  385. package/dist/primitives/IconPrimitive.d.ts +28 -0
  386. package/dist/primitives/IconPrimitive.js +119 -0
  387. package/dist/primitives/IllustrationPrimitive.d.ts +16 -0
  388. package/dist/primitives/IllustrationPrimitive.js +184 -0
  389. package/dist/primitives/PillBadge.d.ts +45 -0
  390. package/dist/primitives/PillBadge.js +237 -0
  391. package/dist/primitives/ShapePrimitive.d.ts +12 -0
  392. package/dist/primitives/ShapePrimitive.js +521 -0
  393. package/dist/primitives/SnapGuidelines.d.ts +19 -0
  394. package/dist/primitives/SnapGuidelines.js +34 -0
  395. package/dist/primitives/UserImagePrimitive.d.ts +30 -0
  396. package/dist/primitives/UserImagePrimitive.js +496 -0
  397. package/dist/primitives/index.d.ts +18 -0
  398. package/dist/primitives/index.js +11 -0
  399. package/dist/sidebar/SidebarPanel.d.ts +8 -0
  400. package/dist/sidebar/SidebarPanel.js +219 -0
  401. package/dist/sidebar/SidebarTabBar.d.ts +2 -0
  402. package/dist/sidebar/SidebarTabBar.js +31 -0
  403. package/dist/sidebar/SubsectionTabBar.d.ts +13 -0
  404. package/dist/sidebar/SubsectionTabBar.js +30 -0
  405. package/dist/sidebar/UserUploadsProvider.d.ts +31 -0
  406. package/dist/sidebar/UserUploadsProvider.js +139 -0
  407. package/dist/sidebar/components/AltTextField.d.ts +21 -0
  408. package/dist/sidebar/components/AltTextField.js +60 -0
  409. package/dist/sidebar/components/SidebarHint.d.ts +7 -0
  410. package/dist/sidebar/components/SidebarHint.js +38 -0
  411. package/dist/sidebar/components/SidebarSlider.d.ts +16 -0
  412. package/dist/sidebar/components/SidebarSlider.js +9 -0
  413. package/dist/sidebar/components/TextFieldPrimitives.d.ts +26 -0
  414. package/dist/sidebar/components/TextFieldPrimitives.js +56 -0
  415. package/dist/sidebar/sections/ChartSettingsSection.d.ts +9 -0
  416. package/dist/sidebar/sections/ChartSettingsSection.js +78 -0
  417. package/dist/sidebar/sections/CombinedTextSection.d.ts +16 -0
  418. package/dist/sidebar/sections/CombinedTextSection.js +43 -0
  419. package/dist/sidebar/sections/DiagrammeSection.d.ts +9 -0
  420. package/dist/sidebar/sections/DiagrammeSection.js +40 -0
  421. package/dist/sidebar/sections/EffectsSection.d.ts +20 -0
  422. package/dist/sidebar/sections/EffectsSection.js +23 -0
  423. package/dist/sidebar/sections/FormenSection.d.ts +28 -0
  424. package/dist/sidebar/sections/FormenSection.js +440 -0
  425. package/dist/sidebar/sections/FrameSettingsSection.d.ts +8 -0
  426. package/dist/sidebar/sections/FrameSettingsSection.js +26 -0
  427. package/dist/sidebar/sections/GenericShareSection.d.ts +26 -0
  428. package/dist/sidebar/sections/GenericShareSection.js +262 -0
  429. package/dist/sidebar/sections/IconsSection.d.ts +8 -0
  430. package/dist/sidebar/sections/IconsSection.js +55 -0
  431. package/dist/sidebar/sections/IllustrationSettings.d.ts +9 -0
  432. package/dist/sidebar/sections/IllustrationSettings.js +33 -0
  433. package/dist/sidebar/sections/IllustrationThumb.d.ts +7 -0
  434. package/dist/sidebar/sections/IllustrationThumb.js +15 -0
  435. package/dist/sidebar/sections/ImageAdjustSection.d.ts +13 -0
  436. package/dist/sidebar/sections/ImageAdjustSection.js +85 -0
  437. package/dist/sidebar/sections/LayersSection.d.ts +25 -0
  438. package/dist/sidebar/sections/LayersSection.js +155 -0
  439. package/dist/sidebar/sections/RahmenSection.d.ts +7 -0
  440. package/dist/sidebar/sections/RahmenSection.js +18 -0
  441. package/dist/sidebar/sections/StudioGallery.d.ts +33 -0
  442. package/dist/sidebar/sections/StudioGallery.js +58 -0
  443. package/dist/sidebar/sections/UploadsSection.d.ts +11 -0
  444. package/dist/sidebar/sections/UploadsSection.js +130 -0
  445. package/dist/sidebar/sections/assets/AssetsSection.d.ts +59 -0
  446. package/dist/sidebar/sections/assets/AssetsSection.js +27 -0
  447. package/dist/sidebar/sections/assets/BackgroundCatalog.d.ts +9 -0
  448. package/dist/sidebar/sections/assets/BackgroundCatalog.js +49 -0
  449. package/dist/sidebar/sections/assets/CategoryCard.d.ts +14 -0
  450. package/dist/sidebar/sections/assets/CategoryCard.js +15 -0
  451. package/dist/sidebar/sections/assets/ElementGrid.d.ts +14 -0
  452. package/dist/sidebar/sections/assets/ElementGrid.js +34 -0
  453. package/dist/sidebar/sections/assets/ElementThumb.d.ts +10 -0
  454. package/dist/sidebar/sections/assets/ElementThumb.js +61 -0
  455. package/dist/sidebar/sections/assets/ElementTile.d.ts +32 -0
  456. package/dist/sidebar/sections/assets/ElementTile.js +60 -0
  457. package/dist/sidebar/sections/assets/ElementsPanel.d.ts +7 -0
  458. package/dist/sidebar/sections/assets/ElementsPanel.js +249 -0
  459. package/dist/sidebar/sections/assets/EmojiTonePicker.d.ts +8 -0
  460. package/dist/sidebar/sections/assets/EmojiTonePicker.js +26 -0
  461. package/dist/sidebar/sections/assets/FotosCatalog.d.ts +12 -0
  462. package/dist/sidebar/sections/assets/FotosCatalog.js +41 -0
  463. package/dist/sidebar/sections/assets/IconifyCatalog.d.ts +14 -0
  464. package/dist/sidebar/sections/assets/IconifyCatalog.js +133 -0
  465. package/dist/sidebar/sections/assets/RecentCarousel.d.ts +7 -0
  466. package/dist/sidebar/sections/assets/RecentCarousel.js +42 -0
  467. package/dist/sidebar/sections/assets/StickerCatalog.d.ts +14 -0
  468. package/dist/sidebar/sections/assets/StickerCatalog.js +49 -0
  469. package/dist/sidebar/sections/assets/constants.d.ts +4 -0
  470. package/dist/sidebar/sections/assets/constants.js +15 -0
  471. package/dist/sidebar/sections/assets/elementPanelHost.d.ts +45 -0
  472. package/dist/sidebar/sections/assets/elementPanelHost.js +1 -0
  473. package/dist/sidebar/sections/assets/elementSearch.d.ts +10 -0
  474. package/dist/sidebar/sections/assets/elementSearch.js +38 -0
  475. package/dist/sidebar/sections/assets/elementTypes.d.ts +67 -0
  476. package/dist/sidebar/sections/assets/elementTypes.js +24 -0
  477. package/dist/sidebar/sections/assets/index.d.ts +3 -0
  478. package/dist/sidebar/sections/assets/index.js +3 -0
  479. package/dist/sidebar/sections/assets/useElementCatalog.d.ts +43 -0
  480. package/dist/sidebar/sections/assets/useElementCatalog.js +386 -0
  481. package/dist/sidebar/sections/assets/useRecentElements.d.ts +21 -0
  482. package/dist/sidebar/sections/assets/useRecentElements.js +67 -0
  483. package/dist/sidebar/sections/assets/useStockPhotos.d.ts +22 -0
  484. package/dist/sidebar/sections/assets/useStockPhotos.js +96 -0
  485. package/dist/sidebar/sections/effects/EffectCard.d.ts +11 -0
  486. package/dist/sidebar/sections/effects/EffectCard.js +14 -0
  487. package/dist/sidebar/sections/effects/GradientSettings.d.ts +10 -0
  488. package/dist/sidebar/sections/effects/GradientSettings.js +34 -0
  489. package/dist/sidebar/sections/effects/OutlineSettings.d.ts +12 -0
  490. package/dist/sidebar/sections/effects/OutlineSettings.js +29 -0
  491. package/dist/sidebar/sections/effects/ShadowSettings.d.ts +13 -0
  492. package/dist/sidebar/sections/effects/ShadowSettings.js +38 -0
  493. package/dist/sidebar/sections/effects/effectsFor.d.ts +16 -0
  494. package/dist/sidebar/sections/effects/effectsFor.js +24 -0
  495. package/dist/sidebar/sections/index.d.ts +28 -0
  496. package/dist/sidebar/sections/index.js +36 -0
  497. package/dist/sidebar/sections/lazyWithPreload.d.ts +11 -0
  498. package/dist/sidebar/sections/lazyWithPreload.js +29 -0
  499. package/dist/sidebar/sections/tools/AiCreateTool.d.ts +4 -0
  500. package/dist/sidebar/sections/tools/AiCreateTool.js +58 -0
  501. package/dist/sidebar/sections/tools/AiEditTool.d.ts +4 -0
  502. package/dist/sidebar/sections/tools/AiEditTool.js +57 -0
  503. package/dist/sidebar/sections/tools/AltTextTool.d.ts +11 -0
  504. package/dist/sidebar/sections/tools/AltTextTool.js +78 -0
  505. package/dist/sidebar/sections/tools/BlobCreatorTool.d.ts +5 -0
  506. package/dist/sidebar/sections/tools/BlobCreatorTool.js +90 -0
  507. package/dist/sidebar/sections/tools/GradientTextTool.d.ts +5 -0
  508. package/dist/sidebar/sections/tools/GradientTextTool.js +104 -0
  509. package/dist/sidebar/sections/tools/ImageInputPicker.d.ts +7 -0
  510. package/dist/sidebar/sections/tools/ImageInputPicker.js +68 -0
  511. package/dist/sidebar/sections/tools/QRCodeTool.d.ts +5 -0
  512. package/dist/sidebar/sections/tools/QRCodeTool.js +63 -0
  513. package/dist/sidebar/sections/tools/RemoveBackgroundTool.d.ts +4 -0
  514. package/dist/sidebar/sections/tools/RemoveBackgroundTool.js +52 -0
  515. package/dist/sidebar/sections/tools/TextPathCreatorTool.d.ts +5 -0
  516. package/dist/sidebar/sections/tools/TextPathCreatorTool.js +125 -0
  517. package/dist/sidebar/sections/tools/ToolPanel.d.ts +26 -0
  518. package/dist/sidebar/sections/tools/ToolPanel.js +13 -0
  519. package/dist/sidebar/sections/tools/ToolTiles.d.ts +5 -0
  520. package/dist/sidebar/sections/tools/ToolTiles.js +76 -0
  521. package/dist/sidebar/sections/tools/ToolsSection.d.ts +15 -0
  522. package/dist/sidebar/sections/tools/ToolsSection.js +151 -0
  523. package/dist/sidebar/sections/tools/UnsplashLimitNotice.d.ts +8 -0
  524. package/dist/sidebar/sections/tools/UnsplashLimitNotice.js +22 -0
  525. package/dist/sidebar/sections/tools/UnsplashTool.d.ts +10 -0
  526. package/dist/sidebar/sections/tools/UnsplashTool.js +47 -0
  527. package/dist/sidebar/sections/tools/index.d.ts +1 -0
  528. package/dist/sidebar/sections/tools/index.js +2 -0
  529. package/dist/sidebar/sections/tools/toolTiles.css +335 -0
  530. package/dist/sidebar/sections/tools/useToolImagePlacement.d.ts +19 -0
  531. package/dist/sidebar/sections/tools/useToolImagePlacement.js +23 -0
  532. package/dist/sidebar/sections/whenIdle.d.ts +2 -0
  533. package/dist/sidebar/sections/whenIdle.js +10 -0
  534. package/dist/sidebar/sidebarStyles.d.ts +60 -0
  535. package/dist/sidebar/sidebarStyles.js +61 -0
  536. package/dist/sidebar/tabTypes.d.ts +27 -0
  537. package/dist/sidebar/tabTypes.js +1 -0
  538. package/dist/sidebar/types.d.ts +43 -0
  539. package/dist/sidebar/types.js +1 -0
  540. package/dist/sidebar/useImagePlacement.d.ts +17 -0
  541. package/dist/sidebar/useImagePlacement.js +28 -0
  542. package/dist/stores/AutoSaveStoreProvider.d.ts +28 -0
  543. package/dist/stores/AutoSaveStoreProvider.js +45 -0
  544. package/dist/stores/CanvasStoreProvider.d.ts +43 -0
  545. package/dist/stores/CanvasStoreProvider.js +74 -0
  546. package/dist/stores/createAutoSaveStore.d.ts +50 -0
  547. package/dist/stores/createAutoSaveStore.js +42 -0
  548. package/dist/stores/createCanvasEditorStore.d.ts +126 -0
  549. package/dist/stores/createCanvasEditorStore.js +266 -0
  550. package/dist/stores/useAutoSaveStore.d.ts +12 -0
  551. package/dist/stores/useAutoSaveStore.js +12 -0
  552. package/dist/styles/editor.css +445 -0
  553. package/dist/styles/index.css +4 -0
  554. package/dist/styles/tailwind.css +239 -0
  555. package/dist/styles/tokens.css +199 -0
  556. package/dist/templates/fontWidths.generated.d.ts +1 -0
  557. package/dist/templates/fontWidths.generated.js +17 -0
  558. package/dist/templates/registry.d.ts +59 -0
  559. package/dist/templates/registry.js +40 -0
  560. package/dist/templates/templateGeometry.d.ts +32 -0
  561. package/dist/templates/templateGeometry.js +887 -0
  562. package/dist/templates/testKinds.d.ts +15 -0
  563. package/dist/templates/testKinds.js +151 -0
  564. package/dist/testing/documentBrandConfig.d.ts +14 -0
  565. package/dist/testing/documentBrandConfig.js +60 -0
  566. package/dist/testing/documentBrandPacks.d.ts +10 -0
  567. package/dist/testing/documentBrandPacks.js +45 -0
  568. package/dist/testing/fixtureTemplates.d.ts +13 -0
  569. package/dist/testing/fixtureTemplates.js +376 -0
  570. package/dist/testing/stampKind.d.ts +91 -0
  571. package/dist/testing/stampKind.js +56 -0
  572. package/dist/types/editorTypes.d.ts +65 -0
  573. package/dist/types/editorTypes.js +21 -0
  574. package/dist/ui/alert-dialog.d.ts +18 -0
  575. package/dist/ui/alert-dialog.js +42 -0
  576. package/dist/ui/button.d.ts +10 -0
  577. package/dist/ui/button.js +29 -0
  578. package/dist/ui/dialog.d.ts +15 -0
  579. package/dist/ui/dialog.js +53 -0
  580. package/dist/ui/icon-button.d.ts +18 -0
  581. package/dist/ui/icon-button.js +54 -0
  582. package/dist/ui/input.d.ts +3 -0
  583. package/dist/ui/input.js +6 -0
  584. package/dist/ui/label.d.ts +4 -0
  585. package/dist/ui/label.js +8 -0
  586. package/dist/ui/masonry-grid.d.ts +11 -0
  587. package/dist/ui/masonry-grid.js +43 -0
  588. package/dist/ui/popover.d.ts +10 -0
  589. package/dist/ui/popover.js +26 -0
  590. package/dist/ui/select.d.ts +15 -0
  591. package/dist/ui/select.js +38 -0
  592. package/dist/ui/skeleton.d.ts +2 -0
  593. package/dist/ui/skeleton.js +7 -0
  594. package/dist/ui/switch.d.ts +6 -0
  595. package/dist/ui/switch.js +8 -0
  596. package/dist/utils/__snapshots__/kindSelection.vitest.ts.snap +1086 -0
  597. package/dist/utils/alignment.d.ts +21 -0
  598. package/dist/utils/alignment.js +54 -0
  599. package/dist/utils/axisLock.d.ts +30 -0
  600. package/dist/utils/axisLock.js +78 -0
  601. package/dist/utils/backgroundPhotoCrop.d.ts +28 -0
  602. package/dist/utils/backgroundPhotoCrop.js +28 -0
  603. package/dist/utils/canvasAssets.d.ts +140 -0
  604. package/dist/utils/canvasAssets.js +121 -0
  605. package/dist/utils/canvasClipboard.d.ts +51 -0
  606. package/dist/utils/canvasClipboard.js +37 -0
  607. package/dist/utils/canvasCommandRegistry.d.ts +207 -0
  608. package/dist/utils/canvasCommandRegistry.js +124 -0
  609. package/dist/utils/canvasCommands.d.ts +106 -0
  610. package/dist/utils/canvasCommands.js +564 -0
  611. package/dist/utils/canvasFontFamilies.d.ts +12 -0
  612. package/dist/utils/canvasFontFamilies.js +24 -0
  613. package/dist/utils/canvasIcons.d.ts +68 -0
  614. package/dist/utils/canvasIcons.js +293 -0
  615. package/dist/utils/canvasImageSource.d.ts +12 -0
  616. package/dist/utils/canvasImageSource.js +19 -0
  617. package/dist/utils/canvasItem.d.ts +102 -0
  618. package/dist/utils/canvasItem.js +1 -0
  619. package/dist/utils/canvasLayerManager.d.ts +51 -0
  620. package/dist/utils/canvasLayerManager.js +107 -0
  621. package/dist/utils/canvasValueResolver.d.ts +9 -0
  622. package/dist/utils/canvasValueResolver.js +13 -0
  623. package/dist/utils/captureStage.d.ts +59 -0
  624. package/dist/utils/captureStage.js +152 -0
  625. package/dist/utils/chartTypes.d.ts +6 -0
  626. package/dist/utils/chartTypes.js +2 -0
  627. package/dist/utils/chartUtils.d.ts +49 -0
  628. package/dist/utils/chartUtils.js +191 -0
  629. package/dist/utils/circleBadgeUtils.d.ts +30 -0
  630. package/dist/utils/circleBadgeUtils.js +85 -0
  631. package/dist/utils/cn.d.ts +2 -0
  632. package/dist/utils/cn.js +66 -0
  633. package/dist/utils/collectAltTextPages.d.ts +6 -0
  634. package/dist/utils/collectAltTextPages.js +20 -0
  635. package/dist/utils/colorLuminance.d.ts +3 -0
  636. package/dist/utils/colorLuminance.js +14 -0
  637. package/dist/utils/colorNames.d.ts +7 -0
  638. package/dist/utils/colorNames.js +17 -0
  639. package/dist/utils/colorOptions.d.ts +20 -0
  640. package/dist/utils/colorOptions.js +20 -0
  641. package/dist/utils/cornerRadius.d.ts +14 -0
  642. package/dist/utils/cornerRadius.js +27 -0
  643. package/dist/utils/cornerReservation.d.ts +19 -0
  644. package/dist/utils/cornerReservation.js +7 -0
  645. package/dist/utils/coverFit.d.ts +117 -0
  646. package/dist/utils/coverFit.js +207 -0
  647. package/dist/utils/cropAspect.d.ts +47 -0
  648. package/dist/utils/cropAspect.js +53 -0
  649. package/dist/utils/cropGhost.d.ts +63 -0
  650. package/dist/utils/cropGhost.js +216 -0
  651. package/dist/utils/cropSession.d.ts +23 -0
  652. package/dist/utils/cropSession.js +92 -0
  653. package/dist/utils/cropTarget.d.ts +22 -0
  654. package/dist/utils/cropTarget.js +33 -0
  655. package/dist/utils/deepSelect.d.ts +43 -0
  656. package/dist/utils/deepSelect.js +74 -0
  657. package/dist/utils/downloadError.d.ts +2 -0
  658. package/dist/utils/downloadError.js +13 -0
  659. package/dist/utils/duplicateElement.d.ts +127 -0
  660. package/dist/utils/duplicateElement.js +235 -0
  661. package/dist/utils/editorFocus.d.ts +36 -0
  662. package/dist/utils/editorFocus.js +67 -0
  663. package/dist/utils/editorToast.d.ts +21 -0
  664. package/dist/utils/editorToast.js +7 -0
  665. package/dist/utils/elementKinds.d.ts +212 -0
  666. package/dist/utils/elementKinds.js +137 -0
  667. package/dist/utils/emoji/emojiCatalog.d.ts +12 -0
  668. package/dist/utils/emoji/emojiCatalog.en.json +9997 -0
  669. package/dist/utils/emoji/emojiCatalog.js +53 -0
  670. package/dist/utils/emoji/emojiCatalog.json +9913 -0
  671. package/dist/utils/ensureFontsReady.d.ts +12 -0
  672. package/dist/utils/ensureFontsReady.js +23 -0
  673. package/dist/utils/expandImage.d.ts +17 -0
  674. package/dist/utils/expandImage.js +76 -0
  675. package/dist/utils/externalIcons.d.ts +67 -0
  676. package/dist/utils/externalIcons.js +168 -0
  677. package/dist/utils/filterCache.d.ts +16 -0
  678. package/dist/utils/filterCache.js +31 -0
  679. package/dist/utils/filterUtils.d.ts +2 -0
  680. package/dist/utils/filterUtils.js +89 -0
  681. package/dist/utils/followStage.d.ts +2 -0
  682. package/dist/utils/followStage.js +48 -0
  683. package/dist/utils/fontAliases.d.ts +14 -0
  684. package/dist/utils/fontAliases.js +32 -0
  685. package/dist/utils/fontMarkSupport.d.ts +26 -0
  686. package/dist/utils/fontMarkSupport.js +32 -0
  687. package/dist/utils/frameUtils.d.ts +20 -0
  688. package/dist/utils/frameUtils.js +283 -0
  689. package/dist/utils/gradientFill.d.ts +55 -0
  690. package/dist/utils/gradientFill.js +57 -0
  691. package/dist/utils/gradientHitArea.d.ts +22 -0
  692. package/dist/utils/gradientHitArea.js +94 -0
  693. package/dist/utils/grain.d.ts +29 -0
  694. package/dist/utils/grain.js +103 -0
  695. package/dist/utils/grainSpec.d.ts +2 -0
  696. package/dist/utils/grainSpec.js +3 -0
  697. package/dist/utils/groupSnap.d.ts +27 -0
  698. package/dist/utils/groupSnap.js +54 -0
  699. package/dist/utils/handDrawn.d.ts +92 -0
  700. package/dist/utils/handDrawn.js +523 -0
  701. package/dist/utils/historyStamp.d.ts +22 -0
  702. package/dist/utils/historyStamp.js +31 -0
  703. package/dist/utils/hostStorageKeys.d.ts +16 -0
  704. package/dist/utils/hostStorageKeys.js +27 -0
  705. package/dist/utils/iconInstances.d.ts +80 -0
  706. package/dist/utils/iconInstances.js +109 -0
  707. package/dist/utils/illustrations/gophers.d.ts +11 -0
  708. package/dist/utils/illustrations/gophers.js +1236 -0
  709. package/dist/utils/illustrations/humaaans.d.ts +8 -0
  710. package/dist/utils/illustrations/humaaans.js +265 -0
  711. package/dist/utils/illustrations/illlustrations.d.ts +11 -0
  712. package/dist/utils/illustrations/illlustrations.js +929 -0
  713. package/dist/utils/illustrations/kawaii.d.ts +6 -0
  714. package/dist/utils/illustrations/kawaii.js +73 -0
  715. package/dist/utils/illustrations/opendoodles.d.ts +6 -0
  716. package/dist/utils/illustrations/opendoodles.js +271 -0
  717. package/dist/utils/illustrations/openpeeps.d.ts +9 -0
  718. package/dist/utils/illustrations/openpeeps.js +1522 -0
  719. package/dist/utils/illustrations/prefetchAnalytics.d.ts +78 -0
  720. package/dist/utils/illustrations/prefetchAnalytics.js +162 -0
  721. package/dist/utils/illustrations/registry.d.ts +27 -0
  722. package/dist/utils/illustrations/registry.js +106 -0
  723. package/dist/utils/illustrations/svgCache.d.ts +60 -0
  724. package/dist/utils/illustrations/svgCache.js +349 -0
  725. package/dist/utils/illustrations/transhumans.d.ts +8 -0
  726. package/dist/utils/illustrations/transhumans.js +313 -0
  727. package/dist/utils/illustrations/types.d.ts +25 -0
  728. package/dist/utils/illustrations/types.js +45 -0
  729. package/dist/utils/imageElementComparison.d.ts +19 -0
  730. package/dist/utils/imageElementComparison.js +121 -0
  731. package/dist/utils/imageFilters.d.ts +94 -0
  732. package/dist/utils/imageFilters.js +304 -0
  733. package/dist/utils/imageLook.d.ts +18 -0
  734. package/dist/utils/imageLook.js +41 -0
  735. package/dist/utils/keyboardCrop.d.ts +25 -0
  736. package/dist/utils/keyboardCrop.js +98 -0
  737. package/dist/utils/keyboardOwnership.d.ts +30 -0
  738. package/dist/utils/keyboardOwnership.js +93 -0
  739. package/dist/utils/layerLabels.d.ts +39 -0
  740. package/dist/utils/layerLabels.js +181 -0
  741. package/dist/utils/layerLock.d.ts +24 -0
  742. package/dist/utils/layerLock.js +52 -0
  743. package/dist/utils/layerSelection.d.ts +24 -0
  744. package/dist/utils/layerSelection.js +16 -0
  745. package/dist/utils/markerBoxes.d.ts +38 -0
  746. package/dist/utils/markerBoxes.js +60 -0
  747. package/dist/utils/markerColors.d.ts +16 -0
  748. package/dist/utils/markerColors.js +32 -0
  749. package/dist/utils/mediaDrop.d.ts +76 -0
  750. package/dist/utils/mediaDrop.js +95 -0
  751. package/dist/utils/mediaPlacement.d.ts +6 -0
  752. package/dist/utils/mediaPlacement.js +17 -0
  753. package/dist/utils/motifSizes.d.ts +8 -0
  754. package/dist/utils/motifSizes.js +9 -0
  755. package/dist/utils/multiSelect.d.ts +44 -0
  756. package/dist/utils/multiSelect.js +139 -0
  757. package/dist/utils/notch.d.ts +17 -0
  758. package/dist/utils/notch.js +23 -0
  759. package/dist/utils/orientElement.d.ts +46 -0
  760. package/dist/utils/orientElement.js +108 -0
  761. package/dist/utils/orientation.d.ts +119 -0
  762. package/dist/utils/orientation.js +411 -0
  763. package/dist/utils/pageCounter.d.ts +15 -0
  764. package/dist/utils/pageCounter.js +17 -0
  765. package/dist/utils/pendingImages.d.ts +10 -0
  766. package/dist/utils/pendingImages.js +25 -0
  767. package/dist/utils/photoCredit.d.ts +9 -0
  768. package/dist/utils/photoCredit.js +29 -0
  769. package/dist/utils/photoCredits.d.ts +5 -0
  770. package/dist/utils/photoCredits.js +17 -0
  771. package/dist/utils/photoPlaceholder.d.ts +25 -0
  772. package/dist/utils/photoPlaceholder.js +38 -0
  773. package/dist/utils/pillBadgeUtils.d.ts +41 -0
  774. package/dist/utils/pillBadgeUtils.js +94 -0
  775. package/dist/utils/pixelHitArea.d.ts +13 -0
  776. package/dist/utils/pixelHitArea.js +33 -0
  777. package/dist/utils/plainTextLayout.d.ts +11 -0
  778. package/dist/utils/plainTextLayout.js +64 -0
  779. package/dist/utils/printImageInfo.d.ts +9 -0
  780. package/dist/utils/printImageInfo.js +14 -0
  781. package/dist/utils/recacheNextFrame.d.ts +6 -0
  782. package/dist/utils/recacheNextFrame.js +15 -0
  783. package/dist/utils/removeElement.d.ts +17 -0
  784. package/dist/utils/removeElement.js +47 -0
  785. package/dist/utils/renderedBoxes.d.ts +19 -0
  786. package/dist/utils/renderedBoxes.js +67 -0
  787. package/dist/utils/resolveElementValue.d.ts +44 -0
  788. package/dist/utils/resolveElementValue.js +72 -0
  789. package/dist/utils/scrollBehavior.d.ts +6 -0
  790. package/dist/utils/scrollBehavior.js +17 -0
  791. package/dist/utils/searchTranslations.d.ts +20 -0
  792. package/dist/utils/searchTranslations.js +366 -0
  793. package/dist/utils/selectionCapabilities.d.ts +53 -0
  794. package/dist/utils/selectionCapabilities.js +52 -0
  795. package/dist/utils/shade.d.ts +24 -0
  796. package/dist/utils/shade.js +55 -0
  797. package/dist/utils/shapeDevices.d.ts +72 -0
  798. package/dist/utils/shapeDevices.js +100 -0
  799. package/dist/utils/shapeTransform.d.ts +29 -0
  800. package/dist/utils/shapeTransform.js +69 -0
  801. package/dist/utils/shapes.d.ts +64 -0
  802. package/dist/utils/shapes.js +838 -0
  803. package/dist/utils/smartCrop.d.ts +30 -0
  804. package/dist/utils/smartCrop.js +163 -0
  805. package/dist/utils/snapping.d.ts +116 -0
  806. package/dist/utils/snapping.js +426 -0
  807. package/dist/utils/stageCssScale.d.ts +7 -0
  808. package/dist/utils/stageCssScale.js +11 -0
  809. package/dist/utils/stateTypeAssertions.d.ts +99 -0
  810. package/dist/utils/stateTypeAssertions.js +197 -0
  811. package/dist/utils/straighten.d.ts +51 -0
  812. package/dist/utils/straighten.js +254 -0
  813. package/dist/utils/surfaceGlow.d.ts +7 -0
  814. package/dist/utils/surfaceGlow.js +27 -0
  815. package/dist/utils/templateElementInstance.d.ts +43 -0
  816. package/dist/utils/templateElementInstance.js +100 -0
  817. package/dist/utils/templateRotation.d.ts +24 -0
  818. package/dist/utils/templateRotation.js +56 -0
  819. package/dist/utils/textAlign.d.ts +17 -0
  820. package/dist/utils/textAlign.js +30 -0
  821. package/dist/utils/textEditorOpeners.d.ts +12 -0
  822. package/dist/utils/textEditorOpeners.js +40 -0
  823. package/dist/utils/textRouting.d.ts +17 -0
  824. package/dist/utils/textRouting.js +22 -0
  825. package/dist/utils/textUtils.d.ts +102 -0
  826. package/dist/utils/textUtils.js +254 -0
  827. package/dist/utils/touchInput.d.ts +7 -0
  828. package/dist/utils/touchInput.js +19 -0
  829. package/dist/utils/transformHudLabel.d.ts +3 -0
  830. package/dist/utils/transformHudLabel.js +12 -0
  831. package/dist/utils/unsplashLinks.d.ts +2 -0
  832. package/dist/utils/unsplashLinks.js +7 -0
  833. package/dist/utils/userFacingError.d.ts +10 -0
  834. package/dist/utils/userFacingError.js +10 -0
  835. package/dist/utils/userImageCrop.d.ts +4 -0
  836. package/dist/utils/userImageCrop.js +26 -0
  837. package/dist/utils/userImageUtils.d.ts +44 -0
  838. package/dist/utils/userImageUtils.js +136 -0
  839. package/dist/utils/viewport.d.ts +16 -0
  840. package/dist/utils/viewport.js +30 -0
  841. package/dist/utils/zipPageImages.d.ts +9 -0
  842. package/dist/utils/zipPageImages.js +30 -0
  843. package/package.json +105 -3
@@ -0,0 +1,155 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MPL-2.0
3
+ /**
4
+ * „Ebenen": jedes Element der aktiven Seite als Eintrag, vorderstes zuerst —
5
+ * der Weg zu allem auf der Fläche ohne Maus und für Screenreader (#4953).
6
+ *
7
+ * Eine Listbox mit Mehrfachauswahl und rovingem Tabindex. Die Auswahl folgt
8
+ * dem Fokus: Pfeil hoch/runter, Pos1 und Ende wählen den Eintrag allein aus;
9
+ * Umschalt+Pfeil nimmt dazu, Strg/⌘+Pfeil bewegt nur den Fokus, Leertaste
10
+ * (oder Strg/⌘-Klick) schaltet um, Umschalt+Leertaste wählt bis dorthin.
11
+ * Enter und F2 bearbeiten einen Text bzw. setzen ein Bild in einen Rahmen.
12
+ * Entf, Strg+C/X/V/D/A und Alt+Pfeil laufen weiter über die Tastatur der
13
+ * Seite (`hooks/useCanvasKeyboardHandlers.ts`, Regel R1).
14
+ */
15
+ import { useMessages } from '@ggraphic/editor/i18n/messages';
16
+ import { cn } from '@ggraphic/editor/utils/cn';
17
+ import { isFocusLost } from '@ggraphic/editor/utils/editorFocus';
18
+ import { useEffect, useLayoutEffect, useRef, useState, } from 'react';
19
+ const isMod = (e) => e.ctrlKey || e.metaKey;
20
+ export function LayersSection({ layers, selectedIds, onSelect, onActivate, focusRequested = false, onFocusHandled, }) {
21
+ const t = useMessages();
22
+ const optionRefs = useRef(new Map());
23
+ const emptyRef = useRef(null);
24
+ // Woher Umschalt+Leertaste und Umschalt-Klick einen Bereich aufziehen.
25
+ const anchorRef = useRef(null);
26
+ const [focusId, setFocusId] = useState(null);
27
+ const [hasFocus, setHasFocus] = useState(false);
28
+ const isListed = (id) => id !== null && layers.some((l) => l.id === id);
29
+ // Der eine Tab-Halt: solange die Liste den Fokus hat, der fokussierte Eintrag;
30
+ // sonst folgt er der Auswahl, auch wenn sie auf der Fläche entstand.
31
+ const stopId = (hasFocus && isListed(focusId) ? focusId : null) ??
32
+ layers.find((l) => selectedIds.includes(l.id))?.id ??
33
+ (isListed(focusId) ? focusId : null) ??
34
+ layers[0]?.id ??
35
+ null;
36
+ useEffect(() => {
37
+ if (!focusRequested)
38
+ return;
39
+ const target = stopId ? optionRefs.current.get(stopId) : emptyRef.current;
40
+ target?.focus();
41
+ onFocusHandled?.();
42
+ }, [focusRequested, stopId, onFocusHandled]);
43
+ const focusAt = (index) => {
44
+ const entry = layers[index];
45
+ if (!entry)
46
+ return null;
47
+ setFocusId(entry.id);
48
+ optionRefs.current.get(entry.id)?.focus();
49
+ return entry.id;
50
+ };
51
+ // Verschwindet der fokussierte Eintrag (Entf, Ausschneiden), nimmt der
52
+ // nächste den Fokus, sonst der vorige, sonst die leere Liste — nie <body>.
53
+ const prevLayersRef = useRef(layers);
54
+ useLayoutEffect(() => {
55
+ const prev = prevLayersRef.current;
56
+ prevLayersRef.current = layers;
57
+ if (prev === layers || !hasFocus || focusId === null || isListed(focusId))
58
+ return;
59
+ if (!isFocusLost())
60
+ return;
61
+ const gone = prev.findIndex((l) => l.id === focusId);
62
+ if (gone === -1)
63
+ return;
64
+ const stays = (l) => layers.some((x) => x.id === l.id);
65
+ const neighbour = prev.slice(gone + 1).find(stays) ?? prev.slice(0, gone).reverse().find(stays) ?? null;
66
+ if (neighbour) {
67
+ setFocusId(neighbour.id);
68
+ optionRefs.current.get(neighbour.id)?.focus();
69
+ }
70
+ else {
71
+ emptyRef.current?.focus();
72
+ }
73
+ // Nur der Wechsel der Liste zählt; Fokus und Auswahl sind der Stand davor.
74
+ // eslint-disable-next-line react-hooks/exhaustive-deps
75
+ }, [layers]);
76
+ const select = (change) => {
77
+ if (change.kind !== 'set')
78
+ anchorRef.current = change.id;
79
+ onSelect(change);
80
+ };
81
+ const rangeTo = (id) => {
82
+ const anchor = anchorRef.current;
83
+ const to = layers.findIndex((l) => l.id === id);
84
+ const from = anchor ? layers.findIndex((l) => l.id === anchor) : -1;
85
+ if (from === -1)
86
+ return [id];
87
+ const [lo, hi] = from < to ? [from, to] : [to, from];
88
+ return layers.slice(lo, hi + 1).map((l) => l.id);
89
+ };
90
+ const handleKeyDown = (e, index) => {
91
+ const id = layers[index].id;
92
+ const last = layers.length - 1;
93
+ const target = e.key === 'ArrowDown'
94
+ ? Math.min(index + 1, last)
95
+ : e.key === 'ArrowUp'
96
+ ? Math.max(index - 1, 0)
97
+ : e.key === 'Home'
98
+ ? 0
99
+ : e.key === 'End'
100
+ ? last
101
+ : null;
102
+ if (target !== null) {
103
+ // Alt+Pfeil schiebt das Element (Tastatur der Seite), nicht den Fokus.
104
+ if (e.altKey)
105
+ return;
106
+ e.preventDefault();
107
+ const next = focusAt(target);
108
+ if (!next || isMod(e))
109
+ return;
110
+ if (e.shiftKey) {
111
+ onSelect({ kind: 'set', ids: [...new Set([...selectedIds, next])] });
112
+ }
113
+ else {
114
+ select({ kind: 'only', id: next });
115
+ }
116
+ return;
117
+ }
118
+ if (e.key === ' ') {
119
+ e.preventDefault();
120
+ if (e.shiftKey)
121
+ onSelect({ kind: 'set', ids: rangeTo(id) });
122
+ else
123
+ select({ kind: 'toggle', id });
124
+ return;
125
+ }
126
+ if (e.key === 'Enter' || e.key === 'F2') {
127
+ // Die Seite hört auf F2 selbst; hier soll es genau einmal laufen.
128
+ e.preventDefault();
129
+ e.stopPropagation();
130
+ onActivate(id);
131
+ }
132
+ };
133
+ const handleClick = (e, id) => {
134
+ setFocusId(id);
135
+ if (isMod(e))
136
+ select({ kind: 'toggle', id });
137
+ else if (e.shiftKey)
138
+ onSelect({ kind: 'set', ids: rangeTo(id) });
139
+ else
140
+ select({ kind: 'only', id });
141
+ };
142
+ return (_jsxs("div", { className: "flex flex-col gap-2 p-sm", children: [_jsx("p", { className: "m-0 text-[length:var(--font-size-small)] text-[var(--editor-text-secondary)]", children: t.sidebar.layers.hint }), layers.length === 0 ? (_jsx("p", { ref: emptyRef, tabIndex: -1, className: "m-0 text-[length:var(--font-size-small)] text-[var(--editor-text-muted)] outline-none", children: t.sidebar.layers.empty })) : (_jsx("div", { role: "listbox", "aria-label": t.sidebar.layers.title, "aria-multiselectable": "true", className: "flex flex-col gap-0.5", onFocus: () => setHasFocus(true), onBlur: (e) => {
143
+ if (!e.currentTarget.contains(e.relatedTarget))
144
+ setHasFocus(false);
145
+ }, children: layers.map((layer, index) => {
146
+ const selected = selectedIds.includes(layer.id);
147
+ return (_jsx("div", { ref: (node) => {
148
+ if (node)
149
+ optionRefs.current.set(layer.id, node);
150
+ else
151
+ optionRefs.current.delete(layer.id);
152
+ }, role: "option", "aria-selected": selected, tabIndex: layer.id === stopId ? 0 : -1, "data-layer-id": layer.id, onKeyDown: (e) => handleKeyDown(e, index), onFocus: () => setFocusId(layer.id), onClick: (e) => handleClick(e, layer.id), className: cn('flex min-h-8 cursor-pointer select-none items-center rounded-md px-2 text-[length:var(--font-size-small)] text-[var(--editor-text)] outline-none hover:bg-[var(--editor-surface-hover)] kbd:focus-visible:outline-2 kbd:focus-visible:outline-solid kbd:focus-visible:-outline-offset-2 kbd:focus-visible:outline-[var(--editor-accent)]', selected &&
153
+ 'bg-[var(--editor-active-bg)] font-semibold text-[var(--editor-active-fg)] hover:bg-[var(--editor-active-bg)]'), children: _jsx("span", { className: "truncate", children: layer.label }) }, layer.id));
154
+ }) }))] }));
155
+ }
@@ -0,0 +1,7 @@
1
+ import { type FrameClipType } from '@ggraphic/editor/utils/frameUtils';
2
+ /** The gradient every `FramePresetPreview` fills with; render once per document. */
3
+ export declare function FramePreviewDefs(): import("react").JSX.Element;
4
+ export declare function FramePresetPreview({ clipType, className, }: {
5
+ clipType: FrameClipType;
6
+ className?: string;
7
+ }): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MPL-2.0
3
+ import { FRAME_PRESET_PATHS } from '@ggraphic/editor/utils/frameUtils';
4
+ const PREVIEW_GRADIENT_ID = 'rahmen-preset-preview-gradient';
5
+ /** The gradient every `FramePresetPreview` fills with; render once per document. */
6
+ export function FramePreviewDefs() {
7
+ return (_jsx("svg", { width: "0", height: "0", className: "absolute", "aria-hidden": true, children: _jsx("defs", { children: _jsxs("linearGradient", { id: PREVIEW_GRADIENT_ID, x1: "0", y1: "0", x2: "0", y2: "1", children: [_jsx("stop", { offset: "0%", stopColor: "#7dd3fc" }), _jsx("stop", { offset: "55%", stopColor: "#bbf7d0" }), _jsx("stop", { offset: "100%", stopColor: "#15803d" })] }) }) }));
8
+ }
9
+ export function FramePresetPreview({ clipType, className = 'size-11', }) {
10
+ const path = FRAME_PRESET_PATHS[clipType];
11
+ const clipId = `frame-preset-clip-${clipType}`;
12
+ // Ring is the only annular preset; render its two subpaths with even-odd
13
+ // fill so the hole shows through the gradient miniature.
14
+ const isAnnular = clipType === 'ring';
15
+ const evenOddProps = isAnnular ? { clipRule: 'evenodd' } : {};
16
+ const fillRuleProps = isAnnular ? { fillRule: 'evenodd' } : {};
17
+ return (_jsxs("svg", { viewBox: "0 0 44 44", className: className, children: [_jsx("defs", { children: _jsx("clipPath", { id: clipId, ...evenOddProps, children: _jsx("path", { d: path }) }) }), _jsxs("g", { clipPath: `url(#${clipId})`, children: [_jsx("rect", { width: "44", height: "44", fill: `url(#${PREVIEW_GRADIENT_ID})` }), _jsx("path", { d: "M0 36 L12 22 L20 30 L28 18 L36 28 L44 24 L44 44 L0 44 z", fill: "#15803d", opacity: 0.55 }), _jsx("circle", { cx: "33", cy: "13", r: "3", fill: "#fde68a" })] }), _jsx("path", { d: path, fill: "none", stroke: "currentColor", strokeOpacity: 0.3, strokeWidth: 1.25, ...fillRuleProps })] }));
18
+ }
@@ -0,0 +1,33 @@
1
+ import { type CanvasStudioAssetItem, type CanvasStudioAssetKind, type CanvasStudioAssetScope } from '@ggraphic/editor/hostServices';
2
+ import { type ButtonHTMLAttributes } from 'react';
3
+ /** The lists every gallery picker offers, in tab order. */
4
+ export declare function useGalleryScopes(): readonly GalleryTab<CanvasStudioAssetScope>[];
5
+ export interface GalleryTab<T extends string> {
6
+ id: T;
7
+ label: string;
8
+ }
9
+ /**
10
+ * Chip row that switches between a card's lists (Grüne, Entdecken, Meine, Gemerkt).
11
+ * Toggle buttons rather than tabs: the list below is no tabpanel and arrow keys add nothing.
12
+ */
13
+ export declare function GalleryTabs<T extends string>({ label, tabs, value, onChange, }: {
14
+ label: string;
15
+ tabs: readonly GalleryTab<T>[];
16
+ value: T;
17
+ onChange: (id: T) => void;
18
+ }): import("react").JSX.Element;
19
+ /** One gallery list (Entdecken, Meine or Gemerkt) of stickers or backgrounds as tiles. */
20
+ export declare function StudioGalleryGrid({ kind, scope, query, pendingId, selectedSrc, refreshToken, onPick, dragProps, }: {
21
+ kind: CanvasStudioAssetKind;
22
+ scope: CanvasStudioAssetScope;
23
+ query?: string;
24
+ /** The item whose pick is still loading; its tile shows as busy. */
25
+ pendingId?: string | null;
26
+ /** The src in use, marked pressed; null when the tiles only add. */
27
+ selectedSrc?: string | null;
28
+ /** Bumping it refetches the list (the query cache would otherwise keep it for minutes). */
29
+ refreshToken?: number;
30
+ onPick: (item: CanvasStudioAssetItem) => void;
31
+ /** Lets a tile be dragged onto a page; unset leaves the tiles click-only. */
32
+ dragProps?: (item: CanvasStudioAssetItem) => Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'draggable' | 'onDragStart' | 'onDragEnd'>;
33
+ }): import("react").JSX.Element;
@@ -0,0 +1,58 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MPL-2.0
3
+ import { useCanvasEditorServices } from '@ggraphic/editor/CanvasEditorProvider';
4
+ import { useNoStudioAssets, } from '@ggraphic/editor/hostServices';
5
+ import { useMessages } from '@ggraphic/editor/i18n/messages';
6
+ import { plainAssetImageUrls, registeredAssetCatalog } from '@ggraphic/editor/utils/canvasAssets';
7
+ import { cn } from '@ggraphic/editor/utils/cn';
8
+ import { useEffect, useMemo, useRef } from 'react';
9
+ /** The lists every gallery picker offers, in tab order. */
10
+ export function useGalleryScopes() {
11
+ const t = useMessages();
12
+ return useMemo(() => [
13
+ { id: 'shop', label: t.sidebar.studio.scope.shop },
14
+ { id: 'mine', label: t.sidebar.studio.scope.mine },
15
+ { id: 'saved', label: t.sidebar.studio.scope.saved },
16
+ ], [t]);
17
+ }
18
+ /** The API caps the search text at 80 characters. */
19
+ const MAX_QUERY = 80;
20
+ const HINT = 'm-0 py-4 text-center text-[13px] text-[var(--editor-text-muted)]';
21
+ const SECONDARY_BUTTON = 'h-9 px-3.5 rounded-lg border-none cursor-pointer bg-[var(--editor-tile)] text-[13px] font-semibold text-[var(--editor-text)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--editor-accent)] disabled:opacity-60 disabled:cursor-not-allowed';
22
+ /**
23
+ * Chip row that switches between a card's lists (Grüne, Entdecken, Meine, Gemerkt).
24
+ * Toggle buttons rather than tabs: the list below is no tabpanel and arrow keys add nothing.
25
+ */
26
+ export function GalleryTabs({ label, tabs, value, onChange, }) {
27
+ return (_jsx("div", { role: "group", "aria-label": label, className: "flex flex-wrap gap-1.5", children: tabs.map((tab) => {
28
+ const isActive = tab.id === value;
29
+ return (_jsx("button", { type: "button", "aria-pressed": isActive, onClick: () => onChange(tab.id), className: cn('h-8 px-3 rounded-2xl border-none cursor-pointer text-[13px] whitespace-nowrap transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--editor-accent)]', isActive
30
+ ? 'bg-[var(--editor-active-bg)] text-[var(--editor-active-fg)] font-bold'
31
+ : 'bg-[var(--editor-tile)] text-[var(--editor-text-secondary)] font-semibold'), children: tab.label }, tab.id));
32
+ }) }));
33
+ }
34
+ /** One gallery list (Entdecken, Meine or Gemerkt) of stickers or backgrounds as tiles. */
35
+ export function StudioGalleryGrid({ kind, scope, query = '', pendingId = null, selectedSrc = null, refreshToken = 0, onPick, dragProps, }) {
36
+ const t = useMessages();
37
+ const q = query.trim().slice(0, MAX_QUERY);
38
+ // Host hook, fixed for the lifetime of the editor (see hostServices.ts).
39
+ const { useStudioAssets = useNoStudioAssets } = useCanvasEditorServices();
40
+ const { items, isLoading, isError, hasNextPage, isFetchingNextPage, fetchNextPage, refetch } = useStudioAssets({ kind, scope, q, sort: 'new' });
41
+ const noun = t.sidebar.studio.plural[kind];
42
+ const urls = registeredAssetCatalog().imageUrls ?? plainAssetImageUrls;
43
+ const seenToken = useRef(refreshToken);
44
+ useEffect(() => {
45
+ if (seenToken.current === refreshToken)
46
+ return;
47
+ seenToken.current = refreshToken;
48
+ void refetch();
49
+ }, [refreshToken, refetch]);
50
+ if (isLoading)
51
+ return _jsx("p", { className: HINT, children: t.sidebar.studio.loading });
52
+ if (isError && items.length === 0)
53
+ return (_jsxs("div", { role: "alert", className: "flex flex-col items-center gap-2 py-2", children: [_jsx("p", { className: HINT, children: t.sidebar.studio.loadFailed(noun) }), _jsx("button", { type: "button", className: SECONDARY_BUTTON, onClick: () => void refetch(), children: t.ui.retry })] }));
54
+ if (items.length === 0)
55
+ return (_jsx("p", { className: HINT, children: q ? t.sidebar.studio.noMatch(noun, q) : t.sidebar.studio.empty(noun, scope) }));
56
+ return (_jsxs("div", { className: "flex flex-col gap-2.5 w-full", children: [_jsx("div", { className: cn('grid gap-2 w-full', kind === 'sticker' ? 'grid-cols-3' : 'grid-cols-2'), children: items.map((item) => (_jsxs("button", { type: "button", title: item.title, "aria-label": t.sidebar.studio.itemLabel(item.title, kind === 'sticker'), "aria-busy": pendingId === item.id, ...(selectedSrc === null ? {} : { 'aria-pressed': selectedSrc === item.src }), onClick: () => onPick(item), ...dragProps?.(item), className: cn('relative flex items-center justify-center overflow-hidden rounded-lg border-none cursor-pointer bg-[var(--editor-tile)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--editor-accent)]', dragProps && 'active:cursor-grabbing', kind === 'sticker' ? 'aspect-square p-2' : 'aspect-[4/3] p-0', selectedSrc === item.src &&
57
+ 'shadow-[0_0_0_2px_var(--editor-surface),0_0_0_4px_var(--editor-accent)]'), children: [_jsx("img", { src: item.thumbUrl ?? urls.thumbnail(item.src, 200), alt: "", loading: "lazy", className: kind === 'sticker' ? 'size-full object-contain' : 'size-full object-cover' }), pendingId === item.id && (_jsx("span", { className: "absolute inset-0 flex items-center justify-center bg-black/30", children: _jsx("span", { className: "size-5 rounded-full border-2 border-white border-t-transparent animate-spin" }) }))] }, item.id))) }), hasNextPage ? (_jsx("button", { type: "button", className: cn(SECONDARY_BUTTON, 'self-center'), disabled: isFetchingNextPage, onClick: () => void fetchNextPage(), children: isFetchingNextPage ? t.sidebar.studio.loading : t.sidebar.studio.loadMore })) : null] }));
58
+ }
@@ -0,0 +1,11 @@
1
+ export interface UploadsSectionProps {
2
+ /** Place an already-durable URL (used when clicking a prior upload). */
3
+ onPlaceFromUrl?: (url: string, fileName: string) => void;
4
+ /** Place a freshly-picked file instantly (local blob), returning its id. */
5
+ onPlaceLocalFile?: (file: File) => Promise<string>;
6
+ /** Swap an optimistically-placed instance's src to the durable URL. */
7
+ onSwapPlacedUrl?: (id: string, url: string) => void;
8
+ /** Remove an optimistically-placed instance if its upload fails. */
9
+ onRemovePlaced?: (id: string) => void;
10
+ }
11
+ export declare function UploadsSection({ onPlaceFromUrl, onPlaceLocalFile, onSwapPlacedUrl, onRemovePlaced, }: UploadsSectionProps): import("react").JSX.Element;
@@ -0,0 +1,130 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MPL-2.0
3
+ import { useCanvasEditorServices } from '@ggraphic/editor/CanvasEditorProvider';
4
+ import { plainImageUrls } from '@ggraphic/editor/hostServices';
5
+ import { useMessages } from '@ggraphic/editor/i18n/messages';
6
+ import { useUserUploads } from '@ggraphic/editor/sidebar/UserUploadsProvider';
7
+ import { MasonryGrid, MasonryItem } from '@ggraphic/editor/ui/masonry-grid';
8
+ import { cn } from '@ggraphic/editor/utils/cn';
9
+ import { MEDIA_DRAG_TYPE } from '@ggraphic/editor/utils/mediaDrop';
10
+ import { downscaleImageForUpload } from '@ggraphic/editor/utils/userImageUtils';
11
+ import { useRef, useState } from 'react';
12
+ import { PiTrash } from 'react-icons/pi';
13
+ import { HiArrowUpTray, HiMagnifyingGlass } from 'react-icons/hi2';
14
+ import { useIsCanvasMobile } from '@ggraphic/editor/hooks/useIsCanvasMobile';
15
+ import { SidebarHint } from '@ggraphic/editor/sidebar/components/SidebarHint';
16
+ import { MOBILE_INPUT_TEXT, SIDEBAR_SECTION } from '@ggraphic/editor/sidebar/sidebarStyles';
17
+ export function UploadsSection({ onPlaceFromUrl, onPlaceLocalFile, onSwapPlacedUrl, onRemovePlaced, }) {
18
+ const t = useMessages();
19
+ const fileInputRef = useRef(null);
20
+ const isMobile = useIsCanvasMobile();
21
+ const { imageUrls = plainImageUrls } = useCanvasEditorServices();
22
+ const { items, isLoading, error, search, setSearch, upload, deleteFromLibrary, uploadError, hasMore, loadMore, MediaThumb, } = useUserUploads();
23
+ const [isDragOver, setIsDragOver] = useState(false);
24
+ // Track in-flight uploads locally: uploads run in parallel but share one
25
+ // useMediaUpload mutation, so its `isUploading` flips false after the first
26
+ // completes. This counter reflects the whole batch.
27
+ const [activeUploads, setActiveUploads] = useState(0);
28
+ // One file: place a local blob preview on the canvas instantly, then upload
29
+ // (downscaled) in the background and swap the blob for the durable URL. If the
30
+ // upload fails (unsupported type, network, quota) the optimistic instance is
31
+ // rolled back so no unbacked blob: image is left on the canvas.
32
+ const handleOneFile = async (file) => {
33
+ const placedId = onPlaceLocalFile ? await onPlaceLocalFile(file).catch(() => null) : null;
34
+ setActiveUploads((n) => n + 1);
35
+ try {
36
+ const toUpload = await downscaleImageForUpload(file);
37
+ const result = await upload(toUpload);
38
+ const url = result ? imageUrls.placementUrl(result) : null;
39
+ if (!url) {
40
+ if (placedId && onRemovePlaced)
41
+ onRemovePlaced(placedId);
42
+ return;
43
+ }
44
+ if (placedId && onSwapPlacedUrl) {
45
+ onSwapPlacedUrl(placedId, url);
46
+ }
47
+ else if (!placedId && onPlaceFromUrl) {
48
+ onPlaceFromUrl(url, result?.originalFilename ?? result?.title ?? file.name);
49
+ }
50
+ }
51
+ finally {
52
+ setActiveUploads((n) => n - 1);
53
+ }
54
+ };
55
+ const acceptFiles = (files) => {
56
+ // Fire all uploads in parallel; each places optimistically on its own.
57
+ Array.from(files)
58
+ .filter((file) => file.type.startsWith('image/'))
59
+ .forEach((file) => void handleOneFile(file));
60
+ };
61
+ const handleFileChange = (e) => {
62
+ const files = e.target.files;
63
+ if (!files)
64
+ return;
65
+ acceptFiles(files);
66
+ if (fileInputRef.current)
67
+ fileInputRef.current.value = '';
68
+ };
69
+ const handlePlace = (item) => {
70
+ if (!onPlaceFromUrl)
71
+ return;
72
+ const url = imageUrls.placementUrl(item);
73
+ if (!url)
74
+ return;
75
+ onPlaceFromUrl(url, item.originalFilename ?? item.title ?? 'image');
76
+ };
77
+ // A tile dragged onto a page lands where it is dropped (PageWrapper).
78
+ const tileDragProps = (item) => {
79
+ const url = imageUrls.placementUrl(item);
80
+ if (!url || !onPlaceFromUrl)
81
+ return {};
82
+ const payload = {
83
+ url,
84
+ name: item.originalFilename ?? item.title ?? 'image',
85
+ };
86
+ return {
87
+ draggable: true,
88
+ onDragStart: (e) => {
89
+ e.dataTransfer.setData(MEDIA_DRAG_TYPE, JSON.stringify(payload));
90
+ e.dataTransfer.effectAllowed = 'copy';
91
+ },
92
+ };
93
+ };
94
+ const handleDrop = (e) => {
95
+ e.preventDefault();
96
+ setIsDragOver(false);
97
+ if (!e.dataTransfer.files.length)
98
+ return;
99
+ acceptFiles(e.dataTransfer.files);
100
+ };
101
+ const isBusy = activeUploads > 0;
102
+ const showEmpty = !isLoading && items.length === 0 && !isBusy;
103
+ const displayedError = uploadError ?? error;
104
+ const fileInput = (_jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", multiple: true, onChange: handleFileChange, className: "hidden" }));
105
+ const dragProps = {
106
+ onDragOver: (e) => {
107
+ // Files from the desktop only; a tile dragged out to the canvas is no upload.
108
+ if (!e.dataTransfer.types.includes('Files'))
109
+ return;
110
+ e.preventDefault();
111
+ setIsDragOver(true);
112
+ },
113
+ onDragLeave: () => setIsDragOver(false),
114
+ onDrop: handleDrop,
115
+ };
116
+ if (isMobile) {
117
+ // Mobiles Sheet: Suchfeld, dann ein 3er-Raster, dessen erste Kachel der
118
+ // Upload ist. Das Sheet stellt den Seitenabstand, daher kein Padding hier.
119
+ return (_jsxs("div", { className: cn('flex flex-col gap-4 rounded-xl', isDragOver && 'ring-2 ring-[var(--editor-accent)] ring-offset-2'), ...dragProps, children: [_jsxs("div", { className: "relative", children: [_jsx(HiMagnifyingGlass, { size: 18, className: "absolute left-3.5 top-1/2 -translate-y-1/2 text-[var(--editor-text-muted)] pointer-events-none" }), _jsx("input", { type: "search", enterKeyHint: "search", value: search, onChange: (e) => setSearch(e.target.value), placeholder: t.sidebar.uploads.searchOwnImages, className: `w-full h-11 pl-10 pr-3 rounded-xl border-none bg-[var(--editor-tile)] text-sm ${MOBILE_INPUT_TEXT} text-[var(--editor-text)] placeholder:text-[var(--editor-text-muted)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--editor-accent)]` })] }), fileInput, _jsxs("div", { className: "grid grid-cols-3 gap-2.5", children: [_jsxs("button", { type: "button", onClick: () => fileInputRef.current?.click(), disabled: isBusy, className: "aspect-square rounded-xl border-[1.5px] border-dashed border-[var(--editor-border-strong)] bg-transparent text-[var(--editor-text-secondary)] flex flex-col items-center justify-center gap-1.5 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed", children: [_jsx(HiArrowUpTray, { size: 22 }), _jsx("span", { className: "text-xs font-semibold", children: isBusy
120
+ ? activeUploads > 1
121
+ ? t.sidebar.uploads.loadingN(activeUploads)
122
+ : t.sidebar.uploads.loading
123
+ : t.sidebar.uploads.upload })] }), Array.from({ length: activeUploads }).map((_, i) => (_jsx("div", { className: "aspect-square rounded-xl bg-[var(--editor-tile)] animate-pulse", "aria-label": t.sidebar.uploads.uploading }, `uploading-${i}`))), items.map((item) => (_jsxs("div", { className: "group relative aspect-square overflow-hidden rounded-xl bg-[var(--editor-tile)]", children: [_jsx("button", { type: "button", onClick: () => handlePlace(item), ...tileDragProps(item), className: "block size-full p-0 bg-transparent border-none cursor-pointer [&_picture]:size-full [&_img]:size-full [&_img]:object-cover", title: item.title ?? item.originalFilename ?? '', children: item.shareToken ? (_jsx(MediaThumb, { item: item, alt: item.altText ?? item.title ?? '', sizes: "140px" })) : item.thumbnailUrl ? (_jsx("img", { src: item.thumbnailUrl, alt: item.altText ?? item.title ?? '', className: "size-full object-cover", draggable: false })) : null }), _jsx("button", { type: "button", onClick: () => void deleteFromLibrary(item.id), "aria-label": t.sidebar.uploads.removeFromLibrary, className: "absolute top-1 right-1 size-6 flex items-center justify-center bg-black/60 text-white border-none rounded-md cursor-pointer opacity-0 transition-opacity duration-150 group-hover:opacity-100 focus:opacity-100 max-canvas-mobile:top-0 max-canvas-mobile:right-0 max-canvas-mobile:size-11 max-canvas-mobile:bg-transparent max-canvas-mobile:opacity-100", children: _jsx("span", { className: "flex items-center justify-center max-canvas-mobile:size-6 max-canvas-mobile:rounded-md max-canvas-mobile:bg-black/60", children: _jsx(PiTrash, { size: 10 }) }) })] }, item.id)))] }), displayedError ? (_jsx("p", { role: "alert", className: "m-0 text-xs text-[var(--editor-text-muted)]", children: displayedError })) : null, hasMore && !isLoading ? (_jsx("button", { type: "button", onClick: () => void loadMore(), className: "self-center text-xs font-semibold text-[var(--editor-active-fg)] bg-transparent border-none cursor-pointer", children: t.sidebar.uploads.showMore })) : null, showEmpty ? (_jsx("p", { className: "m-0 text-xs text-[var(--editor-text-muted)]", children: t.sidebar.uploads.emptyHint })) : null] }));
124
+ }
125
+ return (_jsxs("div", { className: cn(SIDEBAR_SECTION, 'gap-md p-md', isDragOver && 'ring-2 ring-primary-500 ring-offset-2'), ...dragProps, children: [_jsxs("div", { className: "relative", children: [_jsx(HiMagnifyingGlass, { size: 16, className: "absolute left-3 top-1/2 -translate-y-1/2 text-foreground/50 pointer-events-none" }), _jsx("input", { type: "search", enterKeyHint: "search", value: search, onChange: (e) => setSearch(e.target.value), placeholder: t.sidebar.uploads.searchImages, className: `w-full pl-9 pr-3 py-2 rounded-lg bg-[var(--card-background)] border border-[var(--card-border)] text-sm ${MOBILE_INPUT_TEXT} focus:outline-none focus:border-primary-500` })] }), _jsxs("button", { type: "button", onClick: () => fileInputRef.current?.click(), disabled: isBusy, className: "flex items-center justify-center gap-xs py-sm px-md bg-primary-600 text-white border-none rounded-lg cursor-pointer text-sm font-semibold transition-colors duration-150 hover:bg-primary-700 disabled:opacity-60 disabled:cursor-not-allowed", children: [_jsx(HiArrowUpTray, { size: 16 }), isBusy
126
+ ? activeUploads > 1
127
+ ? t.sidebar.uploads.uploadingN(activeUploads)
128
+ : t.sidebar.uploads.uploading
129
+ : t.sidebar.uploads.uploadFiles] }), fileInput, displayedError ? (_jsx("div", { role: "alert", className: "text-xs text-red-600 bg-red-50 border border-red-200 rounded-md px-2 py-1", children: displayedError })) : null, (items.length > 0 || isBusy) && (_jsxs(MasonryGrid, { columns: "2", gap: "sm", children: [Array.from({ length: activeUploads }).map((_, i) => (_jsx(MasonryItem, { className: "relative aspect-square overflow-hidden rounded-lg border border-[var(--card-border)] bg-[var(--card-background)] flex items-center justify-center animate-pulse", children: _jsx("span", { className: "text-[10px] text-foreground/60", children: t.sidebar.uploads.uploading }) }, `uploading-${i}`))), items.map((item) => (_jsxs(MasonryItem, { className: "group relative overflow-hidden rounded-lg border border-[var(--card-border)] bg-[var(--card-background)] transition-colors duration-150 hover:border-primary-500", children: [_jsx("button", { type: "button", onClick: () => handlePlace(item), ...tileDragProps(item), className: "relative block w-full p-0 bg-transparent border-none cursor-pointer", title: item.title ?? item.originalFilename ?? '', children: item.shareToken ? (_jsx(MediaThumb, { item: item, alt: item.altText ?? item.title ?? '' })) : item.thumbnailUrl ? (_jsx("img", { src: item.thumbnailUrl, alt: item.altText ?? item.title ?? '', className: "w-full h-auto", draggable: false })) : null }), _jsx("button", { type: "button", onClick: () => void deleteFromLibrary(item.id), "aria-label": t.sidebar.uploads.removeFromLibrary, className: "absolute top-1 right-1 size-6 flex items-center justify-center bg-black/60 text-white border-none rounded-md cursor-pointer opacity-0 transition-opacity duration-150 group-hover:opacity-100 focus:opacity-100 max-canvas-mobile:top-0 max-canvas-mobile:right-0 max-canvas-mobile:size-11 max-canvas-mobile:bg-transparent max-canvas-mobile:opacity-100", children: _jsx("span", { className: "flex items-center justify-center max-canvas-mobile:size-6 max-canvas-mobile:rounded-md max-canvas-mobile:bg-black/60", children: _jsx(PiTrash, { size: 10 }) }) })] }, item.id)))] })), hasMore && !isLoading ? (_jsx("button", { type: "button", onClick: () => void loadMore(), className: "text-xs text-primary-600 hover:underline self-center cursor-pointer bg-transparent border-none", children: t.sidebar.uploads.showMore })) : null, showEmpty ? _jsx(SidebarHint, { children: t.sidebar.uploads.emptyHintDrop }) : null] }));
130
+ }
@@ -0,0 +1,59 @@
1
+ import { type AssetInstance } from '@ggraphic/editor/utils/canvasAssets';
2
+ import { type ShapeInstance, type ShapeType } from '@ggraphic/editor/utils/shapes';
3
+ import { type UserImagePlacement } from '@ggraphic/editor/utils/userImageUtils';
4
+ import type { BackgroundControls } from '@ggraphic/editor/configs/types';
5
+ import type { ChartInstance, ChartType } from '@ggraphic/editor/utils/chartUtils';
6
+ import type { FrameClipType, FrameInstance } from '@ggraphic/editor/utils/frameUtils';
7
+ import type { IllustrationInstance } from '@ggraphic/editor/utils/illustrations/types';
8
+ import type { StickerRef } from '@ggraphic/schema';
9
+ import type { ExternalIconPayload } from '@ggraphic/editor/utils/externalIcons';
10
+ export interface ExtendedAssetsSectionProps {
11
+ recommendedAssetIds?: string[];
12
+ assetInstances?: AssetInstance[];
13
+ selectedAssetId?: string | null;
14
+ onAddAsset?: (assetId: string) => void;
15
+ /** Adds a gallery sticker by ref; enables the Entdecken / Meine / Gemerkt lists. */
16
+ onAddStickerAsset?: (ref: StickerRef) => void;
17
+ /** Sets the page's background photo; enables the gallery's Hintergründe. */
18
+ onSetBackgroundImage?: NonNullable<BackgroundControls['onImageChange']>;
19
+ currentBackgroundSrc?: string;
20
+ /** Places a stock photo as an image element; enables the Fotos category. */
21
+ onAddImageFromUrl?: (url: string, name: string, options?: UserImagePlacement) => void;
22
+ onUpdateAsset?: (id: string, partial: Partial<AssetInstance>) => void;
23
+ onRemoveAsset?: (id: string) => void;
24
+ onAddPillBadge?: (preset?: string) => void;
25
+ onUpdatePillBadge?: (id: string, partial: unknown) => void;
26
+ onRemovePillBadge?: (id: string) => void;
27
+ onAddCircleBadge?: (preset?: string) => void;
28
+ onUpdateCircleBadge?: (id: string, partial: unknown) => void;
29
+ onRemoveCircleBadge?: (id: string) => void;
30
+ selectedIcons?: string[];
31
+ onIconToggle?: (iconId: string, selected: boolean) => void;
32
+ /** Places an icon from the host's icon search, with a copy of its SVG (`iconSearch` service). */
33
+ onAddExternalIcon?: (iconId: string, payload: ExternalIconPayload) => void;
34
+ maxIconSelections?: number;
35
+ /** The host kinds this editor can add (`registerElementKind` with `add`). */
36
+ addableHostKinds?: readonly string[];
37
+ /** The config's actions the host kinds' tiles add through. */
38
+ hostElementActions?: object;
39
+ shapeInstances?: ShapeInstance[];
40
+ selectedShapeId?: string | null;
41
+ onAddShape?: (type: ShapeType, color?: string) => void;
42
+ onUpdateShape?: (id: string, partial: Partial<ShapeInstance>) => void;
43
+ onRemoveShape?: (id: string) => void;
44
+ chartInstances?: ChartInstance[];
45
+ onAddChart?: (chartType: ChartType) => void;
46
+ illustrationInstances?: IllustrationInstance[];
47
+ selectedIllustrationId?: string | null;
48
+ onAddIllustration?: (id: string) => void;
49
+ onUpdateIllustration?: (id: string, partial: Partial<IllustrationInstance>) => void;
50
+ onRemoveIllustration?: (id: string) => void;
51
+ onDuplicateIllustration?: (id: string) => void;
52
+ frameInstances?: FrameInstance[];
53
+ selectedFrameId?: string | null;
54
+ onAddFrame?: (clipType: FrameClipType) => void;
55
+ onUpdateFrame?: (id: string, partial: Partial<FrameInstance>) => void;
56
+ onRemoveFrame?: (id: string) => void;
57
+ onSetFrameImage?: (id: string, file: File, objectUrl: string) => void;
58
+ }
59
+ export declare function AssetsSection(props: ExtendedAssetsSectionProps): import("react").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MPL-2.0
3
+ import { registeredAssetCatalog } from '@ggraphic/editor/utils/canvasAssets';
4
+ import { prefetchBackground } from '@ggraphic/editor/utils/illustrations/svgCache';
5
+ import { useEffect } from 'react';
6
+ import { ElementsPanel } from './ElementsPanel.js';
7
+ export function AssetsSection(props) {
8
+ const hasIllustrationsFeature = props.onAddIllustration !== undefined;
9
+ // Background prefetch only featured/curated SVGs (not all 1,600+)
10
+ useEffect(() => {
11
+ if (!hasIllustrationsFeature)
12
+ return;
13
+ const featured = (registeredAssetCatalog().illustrations?.featured ?? []).map((ill) => ({
14
+ id: ill.id,
15
+ def: ill,
16
+ }));
17
+ if (featured.length === 0)
18
+ return;
19
+ if (typeof requestIdleCallback === 'function') {
20
+ const handle = requestIdleCallback(() => prefetchBackground(featured), { timeout: 5000 });
21
+ return () => cancelIdleCallback(handle);
22
+ }
23
+ const timer = setTimeout(() => prefetchBackground(featured), 1000);
24
+ return () => clearTimeout(timer);
25
+ }, [hasIllustrationsFeature]);
26
+ return _jsx(ElementsPanel, { ...props });
27
+ }
@@ -0,0 +1,9 @@
1
+ import type { BackgroundControls } from '@ggraphic/editor/configs/types';
2
+ type ImageChange = NonNullable<BackgroundControls['onImageChange']>;
3
+ /** The shared gallery's backgrounds (Entdecken / Meine / Gemerkt). */
4
+ export declare function BackgroundCatalog({ currentImageSrc, onImageChange, searchQuery, }: {
5
+ currentImageSrc?: string;
6
+ onImageChange: ImageChange;
7
+ searchQuery?: string;
8
+ }): import("react").JSX.Element;
9
+ export {};
@@ -0,0 +1,49 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MPL-2.0
3
+ import { useCanvasEditorServices } from '@ggraphic/editor/CanvasEditorProvider';
4
+ import { plainImageUrls, } from '@ggraphic/editor/hostServices';
5
+ import { useMessages } from '@ggraphic/editor/i18n/messages';
6
+ import { registeredAssetCatalog } from '@ggraphic/editor/utils/canvasAssets';
7
+ import { fetchShareImageFile } from '@ggraphic/editor/utils/mediaPlacement';
8
+ import { useRef, useState } from 'react';
9
+ import { GalleryTabs, StudioGalleryGrid, useGalleryScopes } from '../StudioGallery.js';
10
+ /**
11
+ * A gallery pick becomes the template's background photo with the gallery's own
12
+ * durable URL, so nothing is uploaded again. Only the newest pick may land.
13
+ */
14
+ function useBackgroundPick(onImageChange) {
15
+ const t = useMessages();
16
+ const seqRef = useRef(0);
17
+ const { imageUrls = plainImageUrls } = useCanvasEditorServices();
18
+ const [pendingId, setPendingId] = useState(null);
19
+ const [error, setError] = useState(null);
20
+ const pick = async (item) => {
21
+ if (!registeredAssetCatalog().isInstanceSrc(item.src))
22
+ return;
23
+ const seq = ++seqRef.current;
24
+ setError(null);
25
+ setPendingId(item.id);
26
+ try {
27
+ const file = await fetchShareImageFile(item.src, item.title, imageUrls);
28
+ if (seq === seqRef.current)
29
+ onImageChange(file, item.src, null);
30
+ }
31
+ catch {
32
+ if (seq === seqRef.current)
33
+ setError(t.sidebar.elements.backgroundLoadFailed);
34
+ }
35
+ finally {
36
+ if (seq === seqRef.current)
37
+ setPendingId(null);
38
+ }
39
+ };
40
+ return { pick, pendingId, error };
41
+ }
42
+ /** The shared gallery's backgrounds (Entdecken / Meine / Gemerkt). */
43
+ export function BackgroundCatalog({ currentImageSrc, onImageChange, searchQuery = '', }) {
44
+ const t = useMessages();
45
+ const [scope, setScope] = useState('shop');
46
+ const scopes = useGalleryScopes();
47
+ const { pick, pendingId, error } = useBackgroundPick(onImageChange);
48
+ return (_jsxs("div", { className: "flex flex-col gap-3 w-full", children: [_jsx(GalleryTabs, { label: t.sidebar.elements.backgroundPicker, tabs: scopes, value: scope, onChange: setScope }), error && (_jsx("div", { role: "alert", className: "text-xs text-[var(--editor-danger-fg)] bg-[var(--editor-danger-bg)] rounded-md px-2 py-1", children: error })), _jsx(StudioGalleryGrid, { kind: "background", scope: scope, query: searchQuery, pendingId: pendingId, selectedSrc: currentImageSrc ?? '', onPick: (item) => void pick(item) })] }));
49
+ }
@@ -0,0 +1,14 @@
1
+ import { type ReactNode } from 'react';
2
+ /**
3
+ * A category as a card stack: two cards behind the front one fan out on hover
4
+ * while the cover tilts. Transform and opacity only — the deeper shadow is an
5
+ * `::after` that fades in, not an animated `box-shadow`.
6
+ */
7
+ export declare const CategoryCard: import("react").MemoExoticComponent<({ label, countLabel, tint, cover, enterIndex, onOpen, }: {
8
+ label: string;
9
+ countLabel: string | null;
10
+ tint: "primary" | "secondary";
11
+ cover: ReactNode;
12
+ enterIndex: number | null;
13
+ onOpen: () => void;
14
+ }) => import("react").JSX.Element>;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MPL-2.0
3
+ import { cn } from '@ggraphic/editor/utils/cn';
4
+ import { memo } from 'react';
5
+ const FAN = 'transition-transform duration-[400ms] ease-[cubic-bezier(.2,.8,.2,1)] motion-reduce:transition-none';
6
+ /**
7
+ * A category as a card stack: two cards behind the front one fan out on hover
8
+ * while the cover tilts. Transform and opacity only — the deeper shadow is an
9
+ * `::after` that fades in, not an animated `box-shadow`.
10
+ */
11
+ export const CategoryCard = memo(function CategoryCard({ label, countLabel, tint, cover, enterIndex, onOpen, }) {
12
+ return (_jsxs("button", { type: "button", onClick: onOpen, className: cn('group/cat flex flex-col items-center gap-2.5 min-w-0 p-0 bg-transparent border-none cursor-pointer rounded-2xl', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--editor-accent)] focus-visible:ring-offset-4 focus-visible:ring-offset-[var(--editor-surface)]', enterIndex !== null && 'element-enter [--enter-from:translateY(18px)]'), ...(enterIndex !== null
13
+ ? { style: { '--i': Math.min(enterIndex, 7) } }
14
+ : {}), children: [_jsxs("span", { className: "relative block w-full aspect-square", children: [_jsx("span", { "aria-hidden": true, className: cn('absolute inset-2 rounded-[14px] bg-[var(--editor-stack-back)] [transform:rotate(-4deg)]', 'group-hover/cat:[transform:rotate(-13deg)_translate(-10px,2px)] group-focus-visible/cat:[transform:rotate(-13deg)_translate(-10px,2px)]', FAN) }), _jsx("span", { "aria-hidden": true, className: cn('absolute inset-2 rounded-[14px] bg-[var(--editor-stack-mid)] [transform:rotate(5deg)]', 'group-hover/cat:[transform:rotate(13deg)_translate(10px,2px)] group-focus-visible/cat:[transform:rotate(13deg)_translate(10px,2px)]', FAN) }), _jsxs("span", { className: cn('absolute inset-1 rounded-[14px] bg-[var(--editor-surface)] grid place-items-center shadow-sm', "after:content-[''] after:absolute after:inset-0 after:rounded-[inherit] after:shadow-lg after:opacity-0", 'after:transition-opacity after:duration-[400ms] group-hover/cat:after:opacity-100', 'group-hover/cat:[transform:translateY(-5px)_scale(1.03)] group-focus-visible/cat:[transform:translateY(-5px)_scale(1.03)]', FAN), children: [_jsx("span", { "aria-hidden": true, className: cn('absolute inset-0 rounded-[inherit]', tint === 'primary' ? 'bg-[var(--editor-active-soft)]' : 'bg-[var(--editor-tile)]') }), _jsx("span", { "aria-hidden": true, className: cn('relative grid place-items-center size-14', 'transition-transform duration-500 ease-[cubic-bezier(.3,1.5,.5,1)] motion-reduce:transition-none', 'group-hover/cat:[transform:scale(1.12)_rotate(-6deg)]'), children: cover })] })] }), _jsxs("span", { className: "flex flex-col items-center gap-px min-w-0 max-w-full", children: [_jsx("span", { className: "text-sm font-semibold text-[var(--editor-text)] truncate max-w-full transition-colors duration-200 group-hover/cat:text-[var(--editor-active-fg)]", children: label }), countLabel && (_jsx("span", { className: "text-[11px] text-[var(--editor-text-muted)]", children: countLabel }))] })] }));
15
+ });
@@ -0,0 +1,14 @@
1
+ import type { ElementItem } from './elementTypes.js';
2
+ /**
3
+ * The three-column tile grid of a category or a search. Long sets (illustrations,
4
+ * icons, emoji) grow page by page as the sentinel nears the viewport; tiles off
5
+ * screen skip layout and paint through `content-visibility`.
6
+ */
7
+ export declare function ElementGrid({ items, onActivate, enterIndexOf, canDrag, isSelected, isDisabled, }: {
8
+ items: readonly ElementItem[];
9
+ onActivate: (item: ElementItem) => void;
10
+ enterIndexOf: (index: number) => number | null;
11
+ canDrag: boolean;
12
+ isSelected?: (item: ElementItem) => boolean;
13
+ isDisabled?: (item: ElementItem) => boolean;
14
+ }): import("react").JSX.Element;