@ggraphic/editor 0.0.0-stage → 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (847) 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 +18 -0
  22. package/dist/brand/brandRegistry.js +41 -0
  23. package/dist/brand/composerBrand.d.ts +146 -0
  24. package/dist/brand/composerBrand.js +6 -0
  25. package/dist/collab/documentVersion.d.ts +36 -0
  26. package/dist/collab/documentVersion.js +139 -0
  27. package/dist/collab/pageElementStateKeys.d.ts +33 -0
  28. package/dist/collab/pageElementStateKeys.js +148 -0
  29. package/dist/collab/pagesDoc.d.ts +152 -0
  30. package/dist/collab/pagesDoc.js +434 -0
  31. package/dist/collab/useAwarenessState.d.ts +12 -0
  32. package/dist/collab/useAwarenessState.js +47 -0
  33. package/dist/collab/useEmitHostStateChanges.d.ts +18 -0
  34. package/dist/collab/useEmitHostStateChanges.js +40 -0
  35. package/dist/collab/useSelectionAwareness.d.ts +22 -0
  36. package/dist/collab/useSelectionAwareness.js +60 -0
  37. package/dist/collab/useYjsCanvasBinding.d.ts +7 -0
  38. package/dist/collab/useYjsCanvasBinding.js +21 -0
  39. package/dist/collab/useYjsPageStateSync.d.ts +20 -0
  40. package/dist/collab/useYjsPageStateSync.js +49 -0
  41. package/dist/collab/useYjsPages.d.ts +73 -0
  42. package/dist/collab/useYjsPages.js +396 -0
  43. package/dist/collab/wrapCallbacksWithPageSync.d.ts +3 -0
  44. package/dist/collab/wrapCallbacksWithPageSync.js +62 -0
  45. package/dist/collab/ydocKeys.d.ts +50 -0
  46. package/dist/collab/ydocKeys.js +50 -0
  47. package/dist/collab/yjsBinding.d.ts +27 -0
  48. package/dist/collab/yjsBinding.js +105 -0
  49. package/dist/common/Lightbox.d.ts +8 -0
  50. package/dist/common/Lightbox.js +8 -0
  51. package/dist/common/imageSourceTypes.d.ts +1 -0
  52. package/dist/common/imageSourceTypes.js +1 -0
  53. package/dist/components/AddPageButton.d.ts +13 -0
  54. package/dist/components/AddPageButton.js +13 -0
  55. package/dist/components/CanvasAnnouncer.d.ts +8 -0
  56. package/dist/components/CanvasAnnouncer.js +10 -0
  57. package/dist/components/CanvasContextMenu/CanvasActionSheet.d.ts +12 -0
  58. package/dist/components/CanvasContextMenu/CanvasActionSheet.js +145 -0
  59. package/dist/components/CanvasContextMenu/CanvasContextMenu.d.ts +33 -0
  60. package/dist/components/CanvasContextMenu/CanvasContextMenu.js +107 -0
  61. package/dist/components/CanvasContextMenu/canvasMenuModel.d.ts +68 -0
  62. package/dist/components/CanvasContextMenu/canvasMenuModel.js +203 -0
  63. package/dist/components/CanvasEditor/CanvasEditorShell.d.ts +32 -0
  64. package/dist/components/CanvasEditor/CanvasEditorShell.js +1138 -0
  65. package/dist/components/CanvasEditor/PageWrapper.d.ts +7 -0
  66. package/dist/components/CanvasEditor/PageWrapper.js +103 -0
  67. package/dist/components/CanvasEditor/autoSwitchTab.d.ts +11 -0
  68. package/dist/components/CanvasEditor/autoSwitchTab.js +15 -0
  69. package/dist/components/CanvasEditor/blockInsertContext.d.ts +22 -0
  70. package/dist/components/CanvasEditor/blockInsertContext.js +5 -0
  71. package/dist/components/CanvasEditor/editorShell.d.ts +99 -0
  72. package/dist/components/CanvasEditor/editorShell.js +20 -0
  73. package/dist/components/CanvasEditor/hooks/useCanvasContextMenu.d.ts +32 -0
  74. package/dist/components/CanvasEditor/hooks/useCanvasContextMenu.js +140 -0
  75. package/dist/components/CanvasEditor/hooks/useLoadedConfigs.d.ts +13 -0
  76. package/dist/components/CanvasEditor/hooks/useLoadedConfigs.js +29 -0
  77. package/dist/components/CanvasEditor/hooks/useMobileSheetFit.d.ts +14 -0
  78. package/dist/components/CanvasEditor/hooks/useMobileSheetFit.js +56 -0
  79. package/dist/components/CanvasEditor/hooks/usePageRefs.d.ts +18 -0
  80. package/dist/components/CanvasEditor/hooks/usePageRefs.js +36 -0
  81. package/dist/components/CanvasEditor/hooks/usePageUndoRedoShortcuts.d.ts +25 -0
  82. package/dist/components/CanvasEditor/hooks/usePageUndoRedoShortcuts.js +49 -0
  83. package/dist/components/CanvasEditor/hooks/usePrintImpressumGate.d.ts +17 -0
  84. package/dist/components/CanvasEditor/hooks/usePrintImpressumGate.js +70 -0
  85. package/dist/components/CanvasEditor/hooks/useScrollToAddedPage.d.ts +17 -0
  86. package/dist/components/CanvasEditor/hooks/useScrollToAddedPage.js +31 -0
  87. package/dist/components/CanvasEditor/hooks/useToolbarHandlers.d.ts +75 -0
  88. package/dist/components/CanvasEditor/hooks/useToolbarHandlers.js +69 -0
  89. package/dist/components/CanvasEditor/hooks/useWorkAreaDeselect.d.ts +6 -0
  90. package/dist/components/CanvasEditor/hooks/useWorkAreaDeselect.js +56 -0
  91. package/dist/components/CanvasEditor/layersTab.d.ts +13 -0
  92. package/dist/components/CanvasEditor/layersTab.js +27 -0
  93. package/dist/components/CanvasEditor/mobileSelectionArea.d.ts +8 -0
  94. package/dist/components/CanvasEditor/mobileSelectionArea.js +27 -0
  95. package/dist/components/CanvasEditor/types.d.ts +202 -0
  96. package/dist/components/CanvasEditor/types.js +1 -0
  97. package/dist/components/CanvasEditorSkeleton.d.ts +16 -0
  98. package/dist/components/CanvasEditorSkeleton.js +24 -0
  99. package/dist/components/CanvasMetaBar.d.ts +16 -0
  100. package/dist/components/CanvasMetaBar.js +33 -0
  101. package/dist/components/CanvasRenderLayer.d.ts +37 -0
  102. package/dist/components/CanvasRenderLayer.js +54 -0
  103. package/dist/components/CanvasTextOverlay.d.ts +126 -0
  104. package/dist/components/CanvasTextOverlay.js +525 -0
  105. package/dist/components/ConfigCanvas.d.ts +35 -0
  106. package/dist/components/ConfigCanvas.js +30 -0
  107. package/dist/components/CropGhostOverlay.d.ts +13 -0
  108. package/dist/components/CropGhostOverlay.js +56 -0
  109. package/dist/components/CustomColorSwatch.d.ts +35 -0
  110. package/dist/components/CustomColorSwatch.js +80 -0
  111. package/dist/components/DownloadNotice.d.ts +7 -0
  112. package/dist/components/DownloadNotice.js +7 -0
  113. package/dist/components/GenericCanvas.d.ts +309 -0
  114. package/dist/components/GenericCanvas.js +780 -0
  115. package/dist/components/GenericCanvasElement.d.ts +34 -0
  116. package/dist/components/GenericCanvasElement.js +267 -0
  117. package/dist/components/MobileSelectionPill.d.ts +40 -0
  118. package/dist/components/MobileSelectionPill.js +85 -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 +212 -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 +123 -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 +319 -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 +87 -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/FloatingGradientControl.d.ts +9 -0
  182. package/dist/components/TopBar/modules/FloatingGradientControl.js +35 -0
  183. package/dist/components/TopBar/modules/FloatingHistoryControls.d.ts +11 -0
  184. package/dist/components/TopBar/modules/FloatingHistoryControls.js +19 -0
  185. package/dist/components/TopBar/modules/FloatingImageLookControl.d.ts +9 -0
  186. package/dist/components/TopBar/modules/FloatingImageLookControl.js +15 -0
  187. package/dist/components/TopBar/modules/FloatingLayerControls.d.ts +9 -0
  188. package/dist/components/TopBar/modules/FloatingLayerControls.js +9 -0
  189. package/dist/components/TopBar/modules/FloatingOpacityControl.d.ts +11 -0
  190. package/dist/components/TopBar/modules/FloatingOpacityControl.js +19 -0
  191. package/dist/components/TopBar/modules/FloatingOutlineControl.d.ts +11 -0
  192. package/dist/components/TopBar/modules/FloatingOutlineControl.js +31 -0
  193. package/dist/components/TopBar/modules/FloatingPositionControl.d.ts +38 -0
  194. package/dist/components/TopBar/modules/FloatingPositionControl.js +74 -0
  195. package/dist/components/TopBar/modules/FloatingShadowControl.d.ts +12 -0
  196. package/dist/components/TopBar/modules/FloatingShadowControl.js +40 -0
  197. package/dist/components/TopBar/modules/FloatingTextAlignControl.d.ts +12 -0
  198. package/dist/components/TopBar/modules/FloatingTextAlignControl.js +27 -0
  199. package/dist/components/TransformHud.d.ts +11 -0
  200. package/dist/components/TransformHud.js +121 -0
  201. package/dist/components/WholeTextFormatControls.d.ts +10 -0
  202. package/dist/components/WholeTextFormatControls.js +37 -0
  203. package/dist/components/ZoomableViewport.d.ts +6 -0
  204. package/dist/components/ZoomableViewport.js +4 -0
  205. package/dist/components/accentMark.d.ts +20 -0
  206. package/dist/components/accentMark.js +24 -0
  207. package/dist/components/canvasItemLock.d.ts +13 -0
  208. package/dist/components/canvasItemLock.js +12 -0
  209. package/dist/components/kindRenderers.d.ts +118 -0
  210. package/dist/components/kindRenderers.js +151 -0
  211. package/dist/components/markColor.d.ts +13 -0
  212. package/dist/components/markColor.js +21 -0
  213. package/dist/components/markerMark.d.ts +19 -0
  214. package/dist/components/markerMark.js +26 -0
  215. package/dist/composer/cardFollowsText.d.ts +17 -0
  216. package/dist/composer/cardFollowsText.js +34 -0
  217. package/dist/composer/marks.d.ts +4 -0
  218. package/dist/composer/marks.js +15 -0
  219. package/dist/composer/steckbriefLayout.d.ts +147 -0
  220. package/dist/composer/steckbriefLayout.js +468 -0
  221. package/dist/composer/textFit.d.ts +31 -0
  222. package/dist/composer/textFit.js +89 -0
  223. package/dist/configs/buildSharepicText.d.ts +5 -0
  224. package/dist/configs/buildSharepicText.js +58 -0
  225. package/dist/configs/configLoader.d.ts +34 -0
  226. package/dist/configs/configLoader.js +60 -0
  227. package/dist/configs/factory/actionFactories.d.ts +172 -0
  228. package/dist/configs/factory/actionFactories.js +611 -0
  229. package/dist/configs/factory/baseTypes.d.ts +150 -0
  230. package/dist/configs/factory/baseTypes.js +8 -0
  231. package/dist/configs/factory/carryInstanceState.d.ts +82 -0
  232. package/dist/configs/factory/carryInstanceState.js +121 -0
  233. package/dist/configs/factory/createTextElement.d.ts +63 -0
  234. package/dist/configs/factory/createTextElement.js +63 -0
  235. package/dist/configs/factory/defineSection.d.ts +45 -0
  236. package/dist/configs/factory/defineSection.js +45 -0
  237. package/dist/configs/factory/layoutAccessors.d.ts +15 -0
  238. package/dist/configs/factory/layoutAccessors.js +20 -0
  239. package/dist/configs/featureInjector.d.ts +40 -0
  240. package/dist/configs/featureInjector.js +184 -0
  241. package/dist/configs/pageInheritance.d.ts +8 -0
  242. package/dist/configs/pageInheritance.js +82 -0
  243. package/dist/configs/placeholders.d.ts +14 -0
  244. package/dist/configs/placeholders.js +33 -0
  245. package/dist/configs/shareSection.d.ts +11 -0
  246. package/dist/configs/shareSection.js +65 -0
  247. package/dist/configs/types.d.ts +420 -0
  248. package/dist/configs/types.js +1 -0
  249. package/dist/configs/unifiedTabs.d.ts +26 -0
  250. package/dist/configs/unifiedTabs.js +6 -0
  251. package/dist/editorSeamTypes.d.ts +41 -0
  252. package/dist/editorSeamTypes.js +1 -0
  253. package/dist/export/pptx/buildPptxModel.d.ts +44 -0
  254. package/dist/export/pptx/buildPptxModel.js +612 -0
  255. package/dist/export/pptx/exportPptxDeck.d.ts +23 -0
  256. package/dist/export/pptx/exportPptxDeck.js +77 -0
  257. package/dist/export/pptx/pptxFonts.d.ts +26 -0
  258. package/dist/export/pptx/pptxFonts.js +41 -0
  259. package/dist/export/pptx/pptxUnits.d.ts +27 -0
  260. package/dist/export/pptx/pptxUnits.js +54 -0
  261. package/dist/export/pptx/textModel.d.ts +13 -0
  262. package/dist/export/pptx/textModel.js +115 -0
  263. package/dist/export/pptx/types.d.ts +161 -0
  264. package/dist/export/pptx/types.js +11 -0
  265. package/dist/export/pptx/writePptx.d.ts +40 -0
  266. package/dist/export/pptx/writePptx.js +206 -0
  267. package/dist/export/pptx/writeText.d.ts +19 -0
  268. package/dist/export/pptx/writeText.js +120 -0
  269. package/dist/export/printExport.d.ts +42 -0
  270. package/dist/export/printExport.js +94 -0
  271. package/dist/export/printPdf.d.ts +103 -0
  272. package/dist/export/printPdf.js +144 -0
  273. package/dist/export/slidesPdf.d.ts +9 -0
  274. package/dist/export/slidesPdf.js +31 -0
  275. package/dist/formats/index.d.ts +115 -0
  276. package/dist/formats/index.js +287 -0
  277. package/dist/groups/pageGroups.d.ts +32 -0
  278. package/dist/groups/pageGroups.js +91 -0
  279. package/dist/hooks/index.d.ts +29 -0
  280. package/dist/hooks/index.js +19 -0
  281. package/dist/hooks/useAiImageGeneration.d.ts +15 -0
  282. package/dist/hooks/useAiImageGeneration.js +73 -0
  283. package/dist/hooks/useAnnounce.d.ts +27 -0
  284. package/dist/hooks/useAnnounce.js +47 -0
  285. package/dist/hooks/useBoxSnap.d.ts +37 -0
  286. package/dist/hooks/useBoxSnap.js +49 -0
  287. package/dist/hooks/useCanvasAutoSave.d.ts +33 -0
  288. package/dist/hooks/useCanvasAutoSave.js +259 -0
  289. package/dist/hooks/useCanvasElementHandlers.d.ts +182 -0
  290. package/dist/hooks/useCanvasElementHandlers.js +326 -0
  291. package/dist/hooks/useCanvasHistorySetup.d.ts +37 -0
  292. package/dist/hooks/useCanvasHistorySetup.js +113 -0
  293. package/dist/hooks/useCanvasInteractions.d.ts +31 -0
  294. package/dist/hooks/useCanvasInteractions.js +103 -0
  295. package/dist/hooks/useCanvasKeyboardHandlers.d.ts +37 -0
  296. package/dist/hooks/useCanvasKeyboardHandlers.js +280 -0
  297. package/dist/hooks/useCanvasStoreReset.d.ts +25 -0
  298. package/dist/hooks/useCanvasStoreReset.js +35 -0
  299. package/dist/hooks/useCanvasUndoRedo.d.ts +34 -0
  300. package/dist/hooks/useCanvasUndoRedo.js +213 -0
  301. package/dist/hooks/useContextPress.d.ts +14 -0
  302. package/dist/hooks/useContextPress.js +45 -0
  303. package/dist/hooks/useCropSession.d.ts +23 -0
  304. package/dist/hooks/useCropSession.js +69 -0
  305. package/dist/hooks/useDebounce.d.ts +1 -0
  306. package/dist/hooks/useDebounce.js +14 -0
  307. package/dist/hooks/useDeckAutoSave.d.ts +30 -0
  308. package/dist/hooks/useDeckAutoSave.js +234 -0
  309. package/dist/hooks/useDeepSelect.d.ts +18 -0
  310. package/dist/hooks/useDeepSelect.js +135 -0
  311. package/dist/hooks/useElementSnapping.d.ts +13 -0
  312. package/dist/hooks/useElementSnapping.js +26 -0
  313. package/dist/hooks/useEmojiCatalog.d.ts +3 -0
  314. package/dist/hooks/useEmojiCatalog.js +13 -0
  315. package/dist/hooks/useFloatingModuleHandlers.d.ts +52 -0
  316. package/dist/hooks/useFloatingModuleHandlers.js +285 -0
  317. package/dist/hooks/useFloatingModuleState.d.ts +83 -0
  318. package/dist/hooks/useFloatingModuleState.js +250 -0
  319. package/dist/hooks/useFontGeneration.d.ts +10 -0
  320. package/dist/hooks/useFontGeneration.js +77 -0
  321. package/dist/hooks/useFontLoader.d.ts +53 -0
  322. package/dist/hooks/useFontLoader.js +129 -0
  323. package/dist/hooks/useGeometryReporter.d.ts +19 -0
  324. package/dist/hooks/useGeometryReporter.js +41 -0
  325. package/dist/hooks/useHoverOutline.d.ts +8 -0
  326. package/dist/hooks/useHoverOutline.js +78 -0
  327. package/dist/hooks/useIconCatalog.d.ts +12 -0
  328. package/dist/hooks/useIconCatalog.js +30 -0
  329. package/dist/hooks/useIconSearch.d.ts +2 -0
  330. package/dist/hooks/useIconSearch.js +14 -0
  331. package/dist/hooks/useIconSetsFor.d.ts +8 -0
  332. package/dist/hooks/useIconSetsFor.js +30 -0
  333. package/dist/hooks/useImageCoverFit.d.ts +17 -0
  334. package/dist/hooks/useImageCoverFit.js +35 -0
  335. package/dist/hooks/useIsCanvasMobile.d.ts +3 -0
  336. package/dist/hooks/useIsCanvasMobile.js +19 -0
  337. package/dist/hooks/useMarqueeSelection.d.ts +27 -0
  338. package/dist/hooks/useMarqueeSelection.js +140 -0
  339. package/dist/hooks/useMobileSheet.d.ts +48 -0
  340. package/dist/hooks/useMobileSheet.js +282 -0
  341. package/dist/hooks/useMultiPageExport.d.ts +30 -0
  342. package/dist/hooks/useMultiPageExport.js +117 -0
  343. package/dist/hooks/usePageManager.d.ts +132 -0
  344. package/dist/hooks/usePageManager.js +399 -0
  345. package/dist/hooks/usePageThumbnails.d.ts +10 -0
  346. package/dist/hooks/usePageThumbnails.js +122 -0
  347. package/dist/hooks/usePaginatedIcons.d.ts +11 -0
  348. package/dist/hooks/usePaginatedIcons.js +46 -0
  349. package/dist/hooks/useRovingToolbar.d.ts +17 -0
  350. package/dist/hooks/useRovingToolbar.js +76 -0
  351. package/dist/hooks/useSelectionAnnouncement.d.ts +13 -0
  352. package/dist/hooks/useSelectionAnnouncement.js +68 -0
  353. package/dist/hooks/useSnapScheduler.d.ts +20 -0
  354. package/dist/hooks/useSnapScheduler.js +61 -0
  355. package/dist/hooks/useTrackUnsplashDownload.d.ts +6 -0
  356. package/dist/hooks/useTrackUnsplashDownload.js +19 -0
  357. package/dist/hooks/useZoomGestures.d.ts +35 -0
  358. package/dist/hooks/useZoomGestures.js +185 -0
  359. package/dist/hostServices.d.ts +308 -0
  360. package/dist/hostServices.js +107 -0
  361. package/dist/i18n/de.d.ts +895 -0
  362. package/dist/i18n/de.js +959 -0
  363. package/dist/i18n/en.d.ts +3 -0
  364. package/dist/i18n/en.js +948 -0
  365. package/dist/i18n/messages.d.ts +28 -0
  366. package/dist/i18n/messages.js +66 -0
  367. package/dist/layouts/CanvasEditorLayout.d.ts +28 -0
  368. package/dist/layouts/CanvasEditorLayout.js +56 -0
  369. package/dist/layouts/index.d.ts +2 -0
  370. package/dist/layouts/index.js +2 -0
  371. package/dist/primitives/AssetPrimitive.d.ts +24 -0
  372. package/dist/primitives/AssetPrimitive.js +158 -0
  373. package/dist/primitives/CanvasBackground.d.ts +33 -0
  374. package/dist/primitives/CanvasBackground.js +44 -0
  375. package/dist/primitives/CanvasIcons.d.ts +19 -0
  376. package/dist/primitives/CanvasIcons.js +46 -0
  377. package/dist/primitives/CanvasImage.d.ts +73 -0
  378. package/dist/primitives/CanvasImage.js +460 -0
  379. package/dist/primitives/CanvasRichText.d.ts +25 -0
  380. package/dist/primitives/CanvasRichText.js +281 -0
  381. package/dist/primitives/CanvasStage.d.ts +84 -0
  382. package/dist/primitives/CanvasStage.js +291 -0
  383. package/dist/primitives/CanvasText.d.ts +91 -0
  384. package/dist/primitives/CanvasText.js +293 -0
  385. package/dist/primitives/ChartPrimitive.d.ts +24 -0
  386. package/dist/primitives/ChartPrimitive.js +318 -0
  387. package/dist/primitives/CircleBadge.d.ts +43 -0
  388. package/dist/primitives/CircleBadge.js +233 -0
  389. package/dist/primitives/FramePrimitive.d.ts +14 -0
  390. package/dist/primitives/FramePrimitive.js +406 -0
  391. package/dist/primitives/IconPrimitive.d.ts +28 -0
  392. package/dist/primitives/IconPrimitive.js +119 -0
  393. package/dist/primitives/IllustrationPrimitive.d.ts +16 -0
  394. package/dist/primitives/IllustrationPrimitive.js +184 -0
  395. package/dist/primitives/PillBadge.d.ts +45 -0
  396. package/dist/primitives/PillBadge.js +237 -0
  397. package/dist/primitives/ShapePrimitive.d.ts +12 -0
  398. package/dist/primitives/ShapePrimitive.js +521 -0
  399. package/dist/primitives/SnapGuidelines.d.ts +19 -0
  400. package/dist/primitives/SnapGuidelines.js +34 -0
  401. package/dist/primitives/UserImagePrimitive.d.ts +30 -0
  402. package/dist/primitives/UserImagePrimitive.js +494 -0
  403. package/dist/primitives/index.d.ts +18 -0
  404. package/dist/primitives/index.js +11 -0
  405. package/dist/sidebar/SidebarPanel.d.ts +8 -0
  406. package/dist/sidebar/SidebarPanel.js +219 -0
  407. package/dist/sidebar/SidebarTabBar.d.ts +2 -0
  408. package/dist/sidebar/SidebarTabBar.js +31 -0
  409. package/dist/sidebar/SubsectionTabBar.d.ts +13 -0
  410. package/dist/sidebar/SubsectionTabBar.js +30 -0
  411. package/dist/sidebar/UserUploadsProvider.d.ts +31 -0
  412. package/dist/sidebar/UserUploadsProvider.js +139 -0
  413. package/dist/sidebar/components/AltTextField.d.ts +21 -0
  414. package/dist/sidebar/components/AltTextField.js +60 -0
  415. package/dist/sidebar/components/SidebarHint.d.ts +7 -0
  416. package/dist/sidebar/components/SidebarHint.js +38 -0
  417. package/dist/sidebar/components/SidebarSlider.d.ts +16 -0
  418. package/dist/sidebar/components/SidebarSlider.js +9 -0
  419. package/dist/sidebar/components/TextFieldPrimitives.d.ts +26 -0
  420. package/dist/sidebar/components/TextFieldPrimitives.js +56 -0
  421. package/dist/sidebar/sections/ChartSettingsSection.d.ts +9 -0
  422. package/dist/sidebar/sections/ChartSettingsSection.js +75 -0
  423. package/dist/sidebar/sections/CombinedTextSection.d.ts +16 -0
  424. package/dist/sidebar/sections/CombinedTextSection.js +42 -0
  425. package/dist/sidebar/sections/DiagrammeSection.d.ts +9 -0
  426. package/dist/sidebar/sections/DiagrammeSection.js +41 -0
  427. package/dist/sidebar/sections/EffectsSection.d.ts +20 -0
  428. package/dist/sidebar/sections/EffectsSection.js +23 -0
  429. package/dist/sidebar/sections/FormenSection.d.ts +26 -0
  430. package/dist/sidebar/sections/FormenSection.js +428 -0
  431. package/dist/sidebar/sections/FrameSettingsSection.d.ts +8 -0
  432. package/dist/sidebar/sections/FrameSettingsSection.js +26 -0
  433. package/dist/sidebar/sections/GenericShareSection.d.ts +26 -0
  434. package/dist/sidebar/sections/GenericShareSection.js +262 -0
  435. package/dist/sidebar/sections/IconsSection.d.ts +8 -0
  436. package/dist/sidebar/sections/IconsSection.js +55 -0
  437. package/dist/sidebar/sections/IllustrationSettings.d.ts +9 -0
  438. package/dist/sidebar/sections/IllustrationSettings.js +32 -0
  439. package/dist/sidebar/sections/IllustrationThumb.d.ts +7 -0
  440. package/dist/sidebar/sections/IllustrationThumb.js +15 -0
  441. package/dist/sidebar/sections/ImageAdjustSection.d.ts +13 -0
  442. package/dist/sidebar/sections/ImageAdjustSection.js +84 -0
  443. package/dist/sidebar/sections/LayersSection.d.ts +25 -0
  444. package/dist/sidebar/sections/LayersSection.js +155 -0
  445. package/dist/sidebar/sections/RahmenSection.d.ts +7 -0
  446. package/dist/sidebar/sections/RahmenSection.js +18 -0
  447. package/dist/sidebar/sections/StudioGallery.d.ts +33 -0
  448. package/dist/sidebar/sections/StudioGallery.js +58 -0
  449. package/dist/sidebar/sections/UploadsSection.d.ts +11 -0
  450. package/dist/sidebar/sections/UploadsSection.js +130 -0
  451. package/dist/sidebar/sections/assets/AssetsSection.d.ts +59 -0
  452. package/dist/sidebar/sections/assets/AssetsSection.js +27 -0
  453. package/dist/sidebar/sections/assets/BackgroundCatalog.d.ts +9 -0
  454. package/dist/sidebar/sections/assets/BackgroundCatalog.js +49 -0
  455. package/dist/sidebar/sections/assets/CategoryCard.d.ts +14 -0
  456. package/dist/sidebar/sections/assets/CategoryCard.js +15 -0
  457. package/dist/sidebar/sections/assets/ElementGrid.d.ts +14 -0
  458. package/dist/sidebar/sections/assets/ElementGrid.js +34 -0
  459. package/dist/sidebar/sections/assets/ElementThumb.d.ts +10 -0
  460. package/dist/sidebar/sections/assets/ElementThumb.js +59 -0
  461. package/dist/sidebar/sections/assets/ElementTile.d.ts +32 -0
  462. package/dist/sidebar/sections/assets/ElementTile.js +60 -0
  463. package/dist/sidebar/sections/assets/ElementsPanel.d.ts +7 -0
  464. package/dist/sidebar/sections/assets/ElementsPanel.js +249 -0
  465. package/dist/sidebar/sections/assets/EmojiTonePicker.d.ts +8 -0
  466. package/dist/sidebar/sections/assets/EmojiTonePicker.js +26 -0
  467. package/dist/sidebar/sections/assets/FotosCatalog.d.ts +12 -0
  468. package/dist/sidebar/sections/assets/FotosCatalog.js +41 -0
  469. package/dist/sidebar/sections/assets/IconifyCatalog.d.ts +14 -0
  470. package/dist/sidebar/sections/assets/IconifyCatalog.js +133 -0
  471. package/dist/sidebar/sections/assets/RecentCarousel.d.ts +7 -0
  472. package/dist/sidebar/sections/assets/RecentCarousel.js +42 -0
  473. package/dist/sidebar/sections/assets/StickerCatalog.d.ts +14 -0
  474. package/dist/sidebar/sections/assets/StickerCatalog.js +49 -0
  475. package/dist/sidebar/sections/assets/constants.d.ts +4 -0
  476. package/dist/sidebar/sections/assets/constants.js +15 -0
  477. package/dist/sidebar/sections/assets/elementPanelHost.d.ts +45 -0
  478. package/dist/sidebar/sections/assets/elementPanelHost.js +1 -0
  479. package/dist/sidebar/sections/assets/elementSearch.d.ts +10 -0
  480. package/dist/sidebar/sections/assets/elementSearch.js +38 -0
  481. package/dist/sidebar/sections/assets/elementTypes.d.ts +67 -0
  482. package/dist/sidebar/sections/assets/elementTypes.js +24 -0
  483. package/dist/sidebar/sections/assets/index.d.ts +3 -0
  484. package/dist/sidebar/sections/assets/index.js +3 -0
  485. package/dist/sidebar/sections/assets/useElementCatalog.d.ts +42 -0
  486. package/dist/sidebar/sections/assets/useElementCatalog.js +371 -0
  487. package/dist/sidebar/sections/assets/useRecentElements.d.ts +21 -0
  488. package/dist/sidebar/sections/assets/useRecentElements.js +67 -0
  489. package/dist/sidebar/sections/assets/useStockPhotos.d.ts +22 -0
  490. package/dist/sidebar/sections/assets/useStockPhotos.js +96 -0
  491. package/dist/sidebar/sections/effects/EffectCard.d.ts +11 -0
  492. package/dist/sidebar/sections/effects/EffectCard.js +14 -0
  493. package/dist/sidebar/sections/effects/GradientSettings.d.ts +10 -0
  494. package/dist/sidebar/sections/effects/GradientSettings.js +32 -0
  495. package/dist/sidebar/sections/effects/OutlineSettings.d.ts +12 -0
  496. package/dist/sidebar/sections/effects/OutlineSettings.js +28 -0
  497. package/dist/sidebar/sections/effects/ShadowSettings.d.ts +13 -0
  498. package/dist/sidebar/sections/effects/ShadowSettings.js +37 -0
  499. package/dist/sidebar/sections/effects/effectsFor.d.ts +16 -0
  500. package/dist/sidebar/sections/effects/effectsFor.js +24 -0
  501. package/dist/sidebar/sections/index.d.ts +28 -0
  502. package/dist/sidebar/sections/index.js +36 -0
  503. package/dist/sidebar/sections/lazyWithPreload.d.ts +11 -0
  504. package/dist/sidebar/sections/lazyWithPreload.js +29 -0
  505. package/dist/sidebar/sections/tools/AiCreateTool.d.ts +4 -0
  506. package/dist/sidebar/sections/tools/AiCreateTool.js +58 -0
  507. package/dist/sidebar/sections/tools/AiEditTool.d.ts +4 -0
  508. package/dist/sidebar/sections/tools/AiEditTool.js +57 -0
  509. package/dist/sidebar/sections/tools/AltTextTool.d.ts +11 -0
  510. package/dist/sidebar/sections/tools/AltTextTool.js +78 -0
  511. package/dist/sidebar/sections/tools/BlobCreatorTool.d.ts +5 -0
  512. package/dist/sidebar/sections/tools/BlobCreatorTool.js +85 -0
  513. package/dist/sidebar/sections/tools/GradientTextTool.d.ts +5 -0
  514. package/dist/sidebar/sections/tools/GradientTextTool.js +102 -0
  515. package/dist/sidebar/sections/tools/ImageInputPicker.d.ts +7 -0
  516. package/dist/sidebar/sections/tools/ImageInputPicker.js +68 -0
  517. package/dist/sidebar/sections/tools/QRCodeTool.d.ts +5 -0
  518. package/dist/sidebar/sections/tools/QRCodeTool.js +63 -0
  519. package/dist/sidebar/sections/tools/RemoveBackgroundTool.d.ts +4 -0
  520. package/dist/sidebar/sections/tools/RemoveBackgroundTool.js +52 -0
  521. package/dist/sidebar/sections/tools/TextPathCreatorTool.d.ts +5 -0
  522. package/dist/sidebar/sections/tools/TextPathCreatorTool.js +123 -0
  523. package/dist/sidebar/sections/tools/ToolPanel.d.ts +26 -0
  524. package/dist/sidebar/sections/tools/ToolPanel.js +13 -0
  525. package/dist/sidebar/sections/tools/ToolTiles.d.ts +5 -0
  526. package/dist/sidebar/sections/tools/ToolTiles.js +76 -0
  527. package/dist/sidebar/sections/tools/ToolsSection.d.ts +15 -0
  528. package/dist/sidebar/sections/tools/ToolsSection.js +149 -0
  529. package/dist/sidebar/sections/tools/UnsplashLimitNotice.d.ts +8 -0
  530. package/dist/sidebar/sections/tools/UnsplashLimitNotice.js +22 -0
  531. package/dist/sidebar/sections/tools/UnsplashTool.d.ts +10 -0
  532. package/dist/sidebar/sections/tools/UnsplashTool.js +47 -0
  533. package/dist/sidebar/sections/tools/index.d.ts +1 -0
  534. package/dist/sidebar/sections/tools/index.js +2 -0
  535. package/dist/sidebar/sections/tools/toolTiles.css +335 -0
  536. package/dist/sidebar/sections/tools/useToolImagePlacement.d.ts +19 -0
  537. package/dist/sidebar/sections/tools/useToolImagePlacement.js +23 -0
  538. package/dist/sidebar/sections/whenIdle.d.ts +2 -0
  539. package/dist/sidebar/sections/whenIdle.js +10 -0
  540. package/dist/sidebar/sidebarStyles.d.ts +60 -0
  541. package/dist/sidebar/sidebarStyles.js +61 -0
  542. package/dist/sidebar/tabTypes.d.ts +27 -0
  543. package/dist/sidebar/tabTypes.js +1 -0
  544. package/dist/sidebar/types.d.ts +43 -0
  545. package/dist/sidebar/types.js +1 -0
  546. package/dist/sidebar/useImagePlacement.d.ts +17 -0
  547. package/dist/sidebar/useImagePlacement.js +28 -0
  548. package/dist/stores/AutoSaveStoreProvider.d.ts +28 -0
  549. package/dist/stores/AutoSaveStoreProvider.js +45 -0
  550. package/dist/stores/CanvasStoreProvider.d.ts +43 -0
  551. package/dist/stores/CanvasStoreProvider.js +74 -0
  552. package/dist/stores/createAutoSaveStore.d.ts +50 -0
  553. package/dist/stores/createAutoSaveStore.js +42 -0
  554. package/dist/stores/createCanvasEditorStore.d.ts +126 -0
  555. package/dist/stores/createCanvasEditorStore.js +266 -0
  556. package/dist/stores/useAutoSaveStore.d.ts +12 -0
  557. package/dist/stores/useAutoSaveStore.js +12 -0
  558. package/dist/styles/editor.css +445 -0
  559. package/dist/styles/index.css +4 -0
  560. package/dist/styles/tailwind.css +239 -0
  561. package/dist/styles/tokens.css +199 -0
  562. package/dist/templates/fontWidths.generated.d.ts +1 -0
  563. package/dist/templates/fontWidths.generated.js +17 -0
  564. package/dist/templates/registry.d.ts +59 -0
  565. package/dist/templates/registry.js +40 -0
  566. package/dist/templates/templateGeometry.d.ts +32 -0
  567. package/dist/templates/templateGeometry.js +887 -0
  568. package/dist/templates/testKinds.d.ts +15 -0
  569. package/dist/templates/testKinds.js +151 -0
  570. package/dist/testing/fixtureTemplates.d.ts +13 -0
  571. package/dist/testing/fixtureTemplates.js +376 -0
  572. package/dist/testing/stampKind.d.ts +91 -0
  573. package/dist/testing/stampKind.js +56 -0
  574. package/dist/types/editorTypes.d.ts +65 -0
  575. package/dist/types/editorTypes.js +21 -0
  576. package/dist/ui/alert-dialog.d.ts +18 -0
  577. package/dist/ui/alert-dialog.js +42 -0
  578. package/dist/ui/button.d.ts +10 -0
  579. package/dist/ui/button.js +29 -0
  580. package/dist/ui/dialog.d.ts +15 -0
  581. package/dist/ui/dialog.js +53 -0
  582. package/dist/ui/icon-button.d.ts +18 -0
  583. package/dist/ui/icon-button.js +54 -0
  584. package/dist/ui/input.d.ts +3 -0
  585. package/dist/ui/input.js +6 -0
  586. package/dist/ui/label.d.ts +4 -0
  587. package/dist/ui/label.js +8 -0
  588. package/dist/ui/masonry-grid.d.ts +11 -0
  589. package/dist/ui/masonry-grid.js +43 -0
  590. package/dist/ui/popover.d.ts +10 -0
  591. package/dist/ui/popover.js +26 -0
  592. package/dist/ui/select.d.ts +15 -0
  593. package/dist/ui/select.js +38 -0
  594. package/dist/ui/skeleton.d.ts +2 -0
  595. package/dist/ui/skeleton.js +7 -0
  596. package/dist/ui/switch.d.ts +6 -0
  597. package/dist/ui/switch.js +8 -0
  598. package/dist/utils/__snapshots__/kindSelection.vitest.ts.snap +1086 -0
  599. package/dist/utils/alignment.d.ts +21 -0
  600. package/dist/utils/alignment.js +54 -0
  601. package/dist/utils/axisLock.d.ts +30 -0
  602. package/dist/utils/axisLock.js +78 -0
  603. package/dist/utils/backgroundPhotoCrop.d.ts +28 -0
  604. package/dist/utils/backgroundPhotoCrop.js +28 -0
  605. package/dist/utils/balkenUtils.d.ts +22 -0
  606. package/dist/utils/balkenUtils.js +8 -0
  607. package/dist/utils/canvasAssets.d.ts +134 -0
  608. package/dist/utils/canvasAssets.js +121 -0
  609. package/dist/utils/canvasClipboard.d.ts +51 -0
  610. package/dist/utils/canvasClipboard.js +37 -0
  611. package/dist/utils/canvasCommandRegistry.d.ts +207 -0
  612. package/dist/utils/canvasCommandRegistry.js +124 -0
  613. package/dist/utils/canvasCommands.d.ts +106 -0
  614. package/dist/utils/canvasCommands.js +564 -0
  615. package/dist/utils/canvasFontFamilies.d.ts +12 -0
  616. package/dist/utils/canvasFontFamilies.js +24 -0
  617. package/dist/utils/canvasIcons.d.ts +68 -0
  618. package/dist/utils/canvasIcons.js +293 -0
  619. package/dist/utils/canvasImageSource.d.ts +12 -0
  620. package/dist/utils/canvasImageSource.js +19 -0
  621. package/dist/utils/canvasItem.d.ts +102 -0
  622. package/dist/utils/canvasItem.js +1 -0
  623. package/dist/utils/canvasLayerManager.d.ts +51 -0
  624. package/dist/utils/canvasLayerManager.js +107 -0
  625. package/dist/utils/canvasValueResolver.d.ts +9 -0
  626. package/dist/utils/canvasValueResolver.js +13 -0
  627. package/dist/utils/captureStage.d.ts +59 -0
  628. package/dist/utils/captureStage.js +152 -0
  629. package/dist/utils/chartTypes.d.ts +6 -0
  630. package/dist/utils/chartTypes.js +2 -0
  631. package/dist/utils/chartUtils.d.ts +49 -0
  632. package/dist/utils/chartUtils.js +191 -0
  633. package/dist/utils/circleBadgeUtils.d.ts +28 -0
  634. package/dist/utils/circleBadgeUtils.js +85 -0
  635. package/dist/utils/cn.d.ts +2 -0
  636. package/dist/utils/cn.js +66 -0
  637. package/dist/utils/collectAltTextPages.d.ts +6 -0
  638. package/dist/utils/collectAltTextPages.js +20 -0
  639. package/dist/utils/colorLuminance.d.ts +3 -0
  640. package/dist/utils/colorLuminance.js +14 -0
  641. package/dist/utils/colorNames.d.ts +2 -0
  642. package/dist/utils/colorNames.js +8 -0
  643. package/dist/utils/colorOptions.d.ts +20 -0
  644. package/dist/utils/colorOptions.js +20 -0
  645. package/dist/utils/cornerRadius.d.ts +14 -0
  646. package/dist/utils/cornerRadius.js +27 -0
  647. package/dist/utils/cornerReservation.d.ts +19 -0
  648. package/dist/utils/cornerReservation.js +7 -0
  649. package/dist/utils/coverFit.d.ts +117 -0
  650. package/dist/utils/coverFit.js +207 -0
  651. package/dist/utils/cropAspect.d.ts +47 -0
  652. package/dist/utils/cropAspect.js +53 -0
  653. package/dist/utils/cropGhost.d.ts +63 -0
  654. package/dist/utils/cropGhost.js +216 -0
  655. package/dist/utils/cropSession.d.ts +23 -0
  656. package/dist/utils/cropSession.js +92 -0
  657. package/dist/utils/cropTarget.d.ts +22 -0
  658. package/dist/utils/cropTarget.js +33 -0
  659. package/dist/utils/deepSelect.d.ts +43 -0
  660. package/dist/utils/deepSelect.js +74 -0
  661. package/dist/utils/downloadError.d.ts +2 -0
  662. package/dist/utils/downloadError.js +13 -0
  663. package/dist/utils/duplicateElement.d.ts +127 -0
  664. package/dist/utils/duplicateElement.js +235 -0
  665. package/dist/utils/editorFocus.d.ts +36 -0
  666. package/dist/utils/editorFocus.js +67 -0
  667. package/dist/utils/editorToast.d.ts +21 -0
  668. package/dist/utils/editorToast.js +7 -0
  669. package/dist/utils/elementKinds.d.ts +212 -0
  670. package/dist/utils/elementKinds.js +137 -0
  671. package/dist/utils/emoji/emojiCatalog.d.ts +12 -0
  672. package/dist/utils/emoji/emojiCatalog.en.json +9997 -0
  673. package/dist/utils/emoji/emojiCatalog.js +53 -0
  674. package/dist/utils/emoji/emojiCatalog.json +9913 -0
  675. package/dist/utils/ensureFontsReady.d.ts +12 -0
  676. package/dist/utils/ensureFontsReady.js +23 -0
  677. package/dist/utils/expandImage.d.ts +17 -0
  678. package/dist/utils/expandImage.js +76 -0
  679. package/dist/utils/externalIcons.d.ts +67 -0
  680. package/dist/utils/externalIcons.js +168 -0
  681. package/dist/utils/filterCache.d.ts +16 -0
  682. package/dist/utils/filterCache.js +31 -0
  683. package/dist/utils/filterUtils.d.ts +2 -0
  684. package/dist/utils/filterUtils.js +89 -0
  685. package/dist/utils/followStage.d.ts +2 -0
  686. package/dist/utils/followStage.js +48 -0
  687. package/dist/utils/fontAliases.d.ts +14 -0
  688. package/dist/utils/fontAliases.js +32 -0
  689. package/dist/utils/fontMarkSupport.d.ts +25 -0
  690. package/dist/utils/fontMarkSupport.js +26 -0
  691. package/dist/utils/frameUtils.d.ts +19 -0
  692. package/dist/utils/frameUtils.js +282 -0
  693. package/dist/utils/gradientFill.d.ts +55 -0
  694. package/dist/utils/gradientFill.js +57 -0
  695. package/dist/utils/gradientHitArea.d.ts +22 -0
  696. package/dist/utils/gradientHitArea.js +94 -0
  697. package/dist/utils/grain.d.ts +29 -0
  698. package/dist/utils/grain.js +103 -0
  699. package/dist/utils/grainSpec.d.ts +2 -0
  700. package/dist/utils/grainSpec.js +3 -0
  701. package/dist/utils/groupSnap.d.ts +27 -0
  702. package/dist/utils/groupSnap.js +54 -0
  703. package/dist/utils/handDrawn.d.ts +92 -0
  704. package/dist/utils/handDrawn.js +523 -0
  705. package/dist/utils/historyStamp.d.ts +22 -0
  706. package/dist/utils/historyStamp.js +31 -0
  707. package/dist/utils/hostStorageKeys.d.ts +16 -0
  708. package/dist/utils/hostStorageKeys.js +27 -0
  709. package/dist/utils/iconInstances.d.ts +80 -0
  710. package/dist/utils/iconInstances.js +109 -0
  711. package/dist/utils/illustrations/gophers.d.ts +11 -0
  712. package/dist/utils/illustrations/gophers.js +1236 -0
  713. package/dist/utils/illustrations/humaaans.d.ts +8 -0
  714. package/dist/utils/illustrations/humaaans.js +265 -0
  715. package/dist/utils/illustrations/illlustrations.d.ts +11 -0
  716. package/dist/utils/illustrations/illlustrations.js +929 -0
  717. package/dist/utils/illustrations/kawaii.d.ts +6 -0
  718. package/dist/utils/illustrations/kawaii.js +73 -0
  719. package/dist/utils/illustrations/opendoodles.d.ts +6 -0
  720. package/dist/utils/illustrations/opendoodles.js +271 -0
  721. package/dist/utils/illustrations/openpeeps.d.ts +9 -0
  722. package/dist/utils/illustrations/openpeeps.js +1522 -0
  723. package/dist/utils/illustrations/prefetchAnalytics.d.ts +78 -0
  724. package/dist/utils/illustrations/prefetchAnalytics.js +162 -0
  725. package/dist/utils/illustrations/registry.d.ts +24 -0
  726. package/dist/utils/illustrations/registry.js +104 -0
  727. package/dist/utils/illustrations/svgCache.d.ts +60 -0
  728. package/dist/utils/illustrations/svgCache.js +342 -0
  729. package/dist/utils/illustrations/transhumans.d.ts +8 -0
  730. package/dist/utils/illustrations/transhumans.js +313 -0
  731. package/dist/utils/illustrations/types.d.ts +25 -0
  732. package/dist/utils/illustrations/types.js +45 -0
  733. package/dist/utils/imageElementComparison.d.ts +19 -0
  734. package/dist/utils/imageElementComparison.js +121 -0
  735. package/dist/utils/imageFilters.d.ts +92 -0
  736. package/dist/utils/imageFilters.js +303 -0
  737. package/dist/utils/imageLook.d.ts +16 -0
  738. package/dist/utils/imageLook.js +39 -0
  739. package/dist/utils/keyboardCrop.d.ts +25 -0
  740. package/dist/utils/keyboardCrop.js +98 -0
  741. package/dist/utils/keyboardOwnership.d.ts +30 -0
  742. package/dist/utils/keyboardOwnership.js +93 -0
  743. package/dist/utils/layerLabels.d.ts +39 -0
  744. package/dist/utils/layerLabels.js +181 -0
  745. package/dist/utils/layerLock.d.ts +24 -0
  746. package/dist/utils/layerLock.js +52 -0
  747. package/dist/utils/layerSelection.d.ts +24 -0
  748. package/dist/utils/layerSelection.js +16 -0
  749. package/dist/utils/markerBoxes.d.ts +23 -0
  750. package/dist/utils/markerBoxes.js +73 -0
  751. package/dist/utils/markerColors.d.ts +9 -0
  752. package/dist/utils/markerColors.js +39 -0
  753. package/dist/utils/mediaDrop.d.ts +76 -0
  754. package/dist/utils/mediaDrop.js +95 -0
  755. package/dist/utils/mediaPlacement.d.ts +6 -0
  756. package/dist/utils/mediaPlacement.js +17 -0
  757. package/dist/utils/motifSizes.d.ts +8 -0
  758. package/dist/utils/motifSizes.js +9 -0
  759. package/dist/utils/multiSelect.d.ts +44 -0
  760. package/dist/utils/multiSelect.js +139 -0
  761. package/dist/utils/notch.d.ts +17 -0
  762. package/dist/utils/notch.js +23 -0
  763. package/dist/utils/orientElement.d.ts +46 -0
  764. package/dist/utils/orientElement.js +108 -0
  765. package/dist/utils/orientation.d.ts +119 -0
  766. package/dist/utils/orientation.js +411 -0
  767. package/dist/utils/pageCounter.d.ts +15 -0
  768. package/dist/utils/pageCounter.js +17 -0
  769. package/dist/utils/pendingImages.d.ts +10 -0
  770. package/dist/utils/pendingImages.js +25 -0
  771. package/dist/utils/photoCredit.d.ts +9 -0
  772. package/dist/utils/photoCredit.js +29 -0
  773. package/dist/utils/photoCredits.d.ts +5 -0
  774. package/dist/utils/photoCredits.js +17 -0
  775. package/dist/utils/photoPlaceholder.d.ts +22 -0
  776. package/dist/utils/photoPlaceholder.js +36 -0
  777. package/dist/utils/pillBadgeUtils.d.ts +40 -0
  778. package/dist/utils/pillBadgeUtils.js +94 -0
  779. package/dist/utils/pixelHitArea.d.ts +13 -0
  780. package/dist/utils/pixelHitArea.js +33 -0
  781. package/dist/utils/plainTextLayout.d.ts +11 -0
  782. package/dist/utils/plainTextLayout.js +64 -0
  783. package/dist/utils/printImageInfo.d.ts +9 -0
  784. package/dist/utils/printImageInfo.js +14 -0
  785. package/dist/utils/recacheNextFrame.d.ts +6 -0
  786. package/dist/utils/recacheNextFrame.js +15 -0
  787. package/dist/utils/removeElement.d.ts +17 -0
  788. package/dist/utils/removeElement.js +47 -0
  789. package/dist/utils/renderedBoxes.d.ts +19 -0
  790. package/dist/utils/renderedBoxes.js +67 -0
  791. package/dist/utils/resolveElementValue.d.ts +44 -0
  792. package/dist/utils/resolveElementValue.js +72 -0
  793. package/dist/utils/scrollBehavior.d.ts +6 -0
  794. package/dist/utils/scrollBehavior.js +17 -0
  795. package/dist/utils/searchTranslations.d.ts +20 -0
  796. package/dist/utils/searchTranslations.js +366 -0
  797. package/dist/utils/selectionCapabilities.d.ts +53 -0
  798. package/dist/utils/selectionCapabilities.js +52 -0
  799. package/dist/utils/shade.d.ts +24 -0
  800. package/dist/utils/shade.js +55 -0
  801. package/dist/utils/shapeDevices.d.ts +72 -0
  802. package/dist/utils/shapeDevices.js +100 -0
  803. package/dist/utils/shapeTransform.d.ts +29 -0
  804. package/dist/utils/shapeTransform.js +69 -0
  805. package/dist/utils/shapes.d.ts +62 -0
  806. package/dist/utils/shapes.js +836 -0
  807. package/dist/utils/smartCrop.d.ts +30 -0
  808. package/dist/utils/smartCrop.js +163 -0
  809. package/dist/utils/snapping.d.ts +116 -0
  810. package/dist/utils/snapping.js +426 -0
  811. package/dist/utils/stageCssScale.d.ts +7 -0
  812. package/dist/utils/stageCssScale.js +11 -0
  813. package/dist/utils/stateTypeAssertions.d.ts +99 -0
  814. package/dist/utils/stateTypeAssertions.js +197 -0
  815. package/dist/utils/straighten.d.ts +51 -0
  816. package/dist/utils/straighten.js +254 -0
  817. package/dist/utils/surfaceGlow.d.ts +7 -0
  818. package/dist/utils/surfaceGlow.js +27 -0
  819. package/dist/utils/templateElementInstance.d.ts +43 -0
  820. package/dist/utils/templateElementInstance.js +100 -0
  821. package/dist/utils/templateRotation.d.ts +24 -0
  822. package/dist/utils/templateRotation.js +56 -0
  823. package/dist/utils/textAlign.d.ts +17 -0
  824. package/dist/utils/textAlign.js +30 -0
  825. package/dist/utils/textEditorOpeners.d.ts +12 -0
  826. package/dist/utils/textEditorOpeners.js +40 -0
  827. package/dist/utils/textRouting.d.ts +17 -0
  828. package/dist/utils/textRouting.js +22 -0
  829. package/dist/utils/textUtils.d.ts +102 -0
  830. package/dist/utils/textUtils.js +250 -0
  831. package/dist/utils/touchInput.d.ts +7 -0
  832. package/dist/utils/touchInput.js +19 -0
  833. package/dist/utils/transformHudLabel.d.ts +3 -0
  834. package/dist/utils/transformHudLabel.js +12 -0
  835. package/dist/utils/unsplashLinks.d.ts +2 -0
  836. package/dist/utils/unsplashLinks.js +7 -0
  837. package/dist/utils/userFacingError.d.ts +10 -0
  838. package/dist/utils/userFacingError.js +10 -0
  839. package/dist/utils/userImageCrop.d.ts +4 -0
  840. package/dist/utils/userImageCrop.js +26 -0
  841. package/dist/utils/userImageUtils.d.ts +44 -0
  842. package/dist/utils/userImageUtils.js +136 -0
  843. package/dist/utils/viewport.d.ts +16 -0
  844. package/dist/utils/viewport.js +30 -0
  845. package/dist/utils/zipPageImages.d.ts +8 -0
  846. package/dist/utils/zipPageImages.js +29 -0
  847. package/package.json +105 -3
@@ -0,0 +1,133 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MPL-2.0
3
+ import { Slider } from 'radix-ui';
4
+ import { useEffect, useId, useRef, useState } from 'react';
5
+ import { HiArrowUpTray, HiMagnifyingGlass, HiMagnifyingGlassPlus, HiOutlinePhoto, HiOutlineTrash, } from 'react-icons/hi2';
6
+ import { useCanvasEditorServices } from '@ggraphic/editor/CanvasEditorProvider';
7
+ import { TILE, TileCaption, useBarTiles } from '@ggraphic/editor/components/TopBar/barTiles';
8
+ import { plainImageUrls } from '@ggraphic/editor/hostServices';
9
+ import { useMessages } from '@ggraphic/editor/i18n/messages';
10
+ import { useUserUploads } from '@ggraphic/editor/sidebar/UserUploadsProvider';
11
+ import { Popover, PopoverContent, PopoverTrigger } from '@ggraphic/editor/ui/popover';
12
+ import { cn } from '@ggraphic/editor/utils/cn';
13
+ import { fetchShareImageFile } from '@ggraphic/editor/utils/mediaPlacement';
14
+ import { downscaleImageForUpload } from '@ggraphic/editor/utils/userImageUtils';
15
+ import { MOBILE_INPUT_TEXT } from '../../../sidebar/sidebarStyles.js';
16
+ const ICON_BTN = 'inline-flex items-center justify-center size-8 shrink-0 rounded-md border-none bg-transparent cursor-pointer text-[var(--editor-text)] transition-colors duration-150 hover:bg-[var(--editor-surface-hover)] hover:text-[var(--editor-active-fg)]';
17
+ const TEXT_BTN = 'inline-flex items-center gap-1.5 h-8 px-2 shrink-0 rounded-md border-none bg-transparent cursor-pointer text-[13px] font-medium text-[var(--editor-text)] transition-colors duration-150 hover:bg-[var(--editor-surface-hover)] hover:text-[var(--editor-active-fg)]';
18
+ /**
19
+ * Picks the background photo from the user's uploads, or uploads a new one into
20
+ * the library first so the background gets its durable URL.
21
+ */
22
+ export function BackgroundImagePicker({ label, currentImageSrc, onImageChange, openRequest = 0, }) {
23
+ const t = useMessages();
24
+ const tiles = useBarTiles();
25
+ const { imageUrls = plainImageUrls } = useCanvasEditorServices();
26
+ const [open, setOpen] = useState(false);
27
+ useEffect(() => {
28
+ if (openRequest > 0)
29
+ setOpen(true);
30
+ }, [openRequest]);
31
+ const { items, isLoading, error, search, setSearch, upload, hasMore, loadMore, MediaThumb } = useUserUploads();
32
+ const fileInputRef = useRef(null);
33
+ const [pendingId, setPendingId] = useState(null);
34
+ const [pickError, setPickError] = useState(null);
35
+ // Only the newest pick may change the background.
36
+ const seqRef = useRef(0);
37
+ const apply = async (id, load) => {
38
+ const seq = ++seqRef.current;
39
+ setPickError(null);
40
+ setPendingId(id);
41
+ try {
42
+ const picked = await load();
43
+ if (seq !== seqRef.current)
44
+ return;
45
+ if (!picked) {
46
+ setPickError(t.topBar.background.uploadFailed);
47
+ return;
48
+ }
49
+ onImageChange(picked.file, picked.url, null);
50
+ setOpen(false);
51
+ }
52
+ catch (err) {
53
+ if (seq !== seqRef.current)
54
+ return;
55
+ setPickError(err instanceof Error ? err.message : t.topBar.background.imageLoadError);
56
+ }
57
+ finally {
58
+ if (seq === seqRef.current)
59
+ setPendingId(null);
60
+ }
61
+ };
62
+ const pickUpload = (item) => {
63
+ const url = imageUrls.placementUrl(item);
64
+ if (!url)
65
+ return;
66
+ void apply(item.id, async () => ({
67
+ file: await fetchShareImageFile(url, item.originalFilename ?? item.title ?? 'hintergrund', imageUrls),
68
+ url,
69
+ }));
70
+ };
71
+ const handleFileChange = (e) => {
72
+ const raw = e.target.files?.[0];
73
+ e.target.value = '';
74
+ if (!raw)
75
+ return;
76
+ void apply('upload', async () => {
77
+ const file = await downscaleImageForUpload(raw);
78
+ const item = await upload(file);
79
+ const url = item ? imageUrls.placementUrl(item) : null;
80
+ return url ? { file, url } : null;
81
+ });
82
+ };
83
+ const displayedError = pickError ?? error;
84
+ return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", className: tiles ? TILE : TEXT_BTN, "aria-label": t.topBar.backgroundImageNamed(label), children: [_jsx(HiOutlinePhoto, { size: 17, "aria-hidden": "true" }), label] }) }), _jsxs(PopoverContent, { className: "z-[10001] w-80 flex flex-col gap-3 p-3", align: "start", "aria-label": t.topBar.background.pickBackground, children: [_jsxs("div", { className: "flex items-center gap-2 h-9 px-2.5 rounded-lg bg-[var(--editor-tile)]", children: [_jsx(HiMagnifyingGlass, { size: 16, className: "shrink-0 text-[var(--editor-text-muted)]", "aria-hidden": "true" }), _jsx("input", { type: "search", enterKeyHint: "search", value: search, onChange: (e) => setSearch(e.target.value), placeholder: t.topBar.background.searchOwn, "aria-label": t.topBar.background.searchOwn, className: `flex-1 min-w-0 border-none outline-none bg-transparent text-sm ${MOBILE_INPUT_TEXT} text-[var(--editor-text)] placeholder:text-[var(--editor-text-muted)]` })] }), _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", onChange: handleFileChange, className: "hidden" }), _jsxs("button", { type: "button", onClick: () => fileInputRef.current?.click(), disabled: pendingId === 'upload', "aria-busy": pendingId === 'upload', className: "flex w-full items-center justify-center gap-2 h-9 rounded-lg border-[1.5px] border-dashed border-[var(--editor-border-strong)] bg-transparent text-sm font-semibold text-[var(--editor-text-secondary)] cursor-pointer transition-colors duration-150 hover:border-[var(--editor-accent)] hover:text-[var(--editor-text)] disabled:opacity-60 disabled:cursor-not-allowed", children: [_jsx(HiArrowUpTray, { size: 16, "aria-hidden": "true" }), pendingId === 'upload' ? t.topBar.background.uploading : t.topBar.background.upload] }), displayedError && (_jsx("p", { role: "alert", className: "m-0 text-xs text-[var(--editor-danger-fg)]", children: displayedError })), _jsx("div", { className: "grid grid-cols-3 gap-2 max-h-72 overflow-y-auto", children: items.map((item) => {
85
+ const isActive = !!currentImageSrc && imageUrls.placementUrl(item) === currentImageSrc;
86
+ return (_jsx("button", { type: "button", onClick: () => pickUpload(item), "aria-pressed": isActive, "aria-busy": pendingId === item.id, title: item.title ?? item.originalFilename ?? '', className: cn('relative aspect-square overflow-hidden rounded-lg bg-[var(--editor-tile)] p-0 border-none cursor-pointer [&_picture]:size-full [&_img]:size-full [&_img]:object-cover', isActive &&
87
+ 'shadow-[0_0_0_2px_var(--editor-surface),0_0_0_4px_var(--editor-accent)]', pendingId === item.id && 'opacity-60'), children: _jsx(MediaThumb, { item: item, alt: item.altText ?? item.title ?? '', sizes: "96px" }) }, item.id));
88
+ }) }), 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.topBar.background.showMore })), !isLoading && items.length === 0 && !displayedError && (_jsx("p", { className: "m-0 text-xs text-[var(--editor-text-muted)]", children: search ? t.topBar.background.noMatch(search) : t.topBar.background.noOwn }))] })] }));
89
+ }
90
+ /** Zoom of the background photo. It has no on-canvas handles, so this is the only way. */
91
+ export function BackgroundZoomControl({ scale, onScaleChange, }) {
92
+ const t = useMessages();
93
+ const tiles = useBarTiles();
94
+ const titleId = useId();
95
+ return (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", className: tiles ? TILE : ICON_BTN, title: t.topBar.zoom, "aria-label": t.topBar.background.zoom, children: [_jsx(HiMagnifyingGlassPlus, { size: 17, "aria-hidden": "true" }), _jsx(TileCaption, { children: t.topBar.zoom })] }) }), _jsxs(PopoverContent, { className: "z-[10001] w-60 flex items-center gap-2 p-3", align: "center", "aria-labelledby": titleId, children: [_jsx("span", { id: titleId, className: "text-[11px] w-10 text-[var(--editor-text-muted)]", children: t.topBar.zoom }), _jsxs(Slider.Root, { className: "relative flex items-center select-none touch-none grow h-4 max-canvas-mobile:h-11", value: [scale], onValueChange: (v) => onScaleChange(v[0]), min: 1, max: 3, step: 0.01, children: [_jsx(Slider.Track, { className: "relative grow rounded-full h-1 bg-[var(--editor-border-soft)]", children: _jsx(Slider.Range, { className: "absolute rounded-full h-full bg-[var(--editor-accent)]" }) }), _jsx(Slider.Thumb, { className: "block size-3 max-canvas-mobile:size-5 bg-white rounded-full border-2 border-[var(--editor-accent)] shadow-[0_1px_3px_rgba(0,0,0,0.2)] cursor-grab focus:outline-none", "aria-label": t.topBar.zoom })] }), _jsxs("span", { className: "text-[11px] w-10 text-right tabular-nums text-[var(--editor-text-muted)]", children: [Math.round(scale * 100), "%"] })] })] }));
96
+ }
97
+ export function BackgroundRestoreImageButton({ onRestore }) {
98
+ const t = useMessages();
99
+ const tiles = useBarTiles();
100
+ return (_jsx("button", { type: "button", className: tiles ? TILE : TEXT_BTN, onClick: onRestore, title: t.topBar.background.restoreHint, children: t.topBar.background.restore }));
101
+ }
102
+ export function BackgroundRemoveImageButton({ onRemove }) {
103
+ const t = useMessages();
104
+ const tiles = useBarTiles();
105
+ return (_jsxs("button", { type: "button", className: tiles ? TILE : ICON_BTN, onClick: onRemove, title: t.topBar.background.remove, "aria-label": t.topBar.background.remove, children: [_jsx(HiOutlineTrash, { size: 17, "aria-hidden": "true" }), _jsx(TileCaption, { children: t.topBar.tiles.remove })] }));
106
+ }
107
+ /**
108
+ * Makes the selected own image the background photo and removes it as an
109
+ * element. Only for durable URLs: a `blob:` preview would die on reload.
110
+ */
111
+ export function SetAsBackgroundButton({ src, fileName, attribution, onImageChange, onRemoveElement, }) {
112
+ const t = useMessages();
113
+ const tiles = useBarTiles();
114
+ const [pending, setPending] = useState(false);
115
+ const [failed, setFailed] = useState(false);
116
+ const { imageUrls = plainImageUrls } = useCanvasEditorServices();
117
+ const handleClick = async () => {
118
+ setPending(true);
119
+ setFailed(false);
120
+ try {
121
+ const file = await fetchShareImageFile(src, fileName, imageUrls);
122
+ onImageChange(file, src, attribution ?? null);
123
+ onRemoveElement();
124
+ }
125
+ catch {
126
+ setFailed(true);
127
+ }
128
+ finally {
129
+ setPending(false);
130
+ }
131
+ };
132
+ return (_jsxs("button", { type: "button", className: tiles ? TILE : TEXT_BTN, onClick: () => void handleClick(), disabled: pending, "aria-busy": pending, title: failed ? t.topBar.background.loadFailed : t.topBar.background.use, children: [_jsx(HiOutlinePhoto, { size: 17, "aria-hidden": "true" }), t.topBar.background.asBackground] }));
133
+ }
@@ -0,0 +1,16 @@
1
+ import { type BindingRef } from '@ggraphic/core';
2
+ import { type ColorOption } from '@ggraphic/editor/utils/colorOptions';
3
+ import React from 'react';
4
+ interface FloatingColorPickerProps {
5
+ currentColor: string;
6
+ onColorSelect: (color: string, ref?: BindingRef) => void;
7
+ isExpanded?: boolean;
8
+ onExpandChange?: (expanded: boolean) => void;
9
+ colors?: ColorOption[];
10
+ /** 'font' renders an "A" glyph with a colored underline (text elements); 'swatch' a filled chip. */
11
+ variant?: 'font' | 'swatch';
12
+ /** False limits the choice to `colors`. */
13
+ allowCustom?: boolean;
14
+ }
15
+ export declare function FloatingColorPicker({ currentColor, onColorSelect, isExpanded: externalExpanded, onExpandChange, colors, variant, allowCustom, }: FloatingColorPickerProps): React.JSX.Element;
16
+ export {};
@@ -0,0 +1,87 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CustomColorSwatch } from '@ggraphic/editor/components/CustomColorSwatch';
3
+ import { TILE, useBarTiles } from '@ggraphic/editor/components/TopBar/barTiles';
4
+ import { useMessages } from '@ggraphic/editor/i18n/messages';
5
+ import { cn } from '@ggraphic/editor/utils/cn';
6
+ import { brandColors } from '@ggraphic/editor/utils/colorOptions';
7
+ import React from 'react';
8
+ /* ::after gehört schon dem Auswahlring, darum ein ::before als 44px-Trefferfläche.
9
+ 26px + 2 x 9px = 44px: die Reihe braucht mobil gap >= 18px, sonst liegt die Fläche
10
+ über dem Nachbarn und fängt dessen Tipper ab. */
11
+ const HIT_44 = "max-canvas-mobile:before:content-[''] max-canvas-mobile:before:absolute max-canvas-mobile:before:inset-[-9px]";
12
+ const colorBtn = `size-8 max-canvas-mobile:size-[26px] rounded-full border border-black/10 cursor-pointer p-0 relative transition-transform duration-150 shrink-0 hover:-translate-y-0.5 active:scale-90 ${HIT_44}`;
13
+ export function FloatingColorPicker({ currentColor, onColorSelect, isExpanded: externalExpanded, onExpandChange, colors, variant = 'swatch', allowCustom = true, }) {
14
+ const t = useMessages();
15
+ const tiles = useBarTiles();
16
+ const colorOptions = colors ?? brandColors();
17
+ const [internalExpanded, setInternalExpanded] = React.useState(false);
18
+ const isExpanded = externalExpanded !== undefined ? externalExpanded : internalExpanded;
19
+ const setIsExpanded = onExpandChange || setInternalExpanded;
20
+ const containerRef = React.useRef(null);
21
+ const wasExpanded = React.useRef(isExpanded);
22
+ // The trigger and the swatch row replace each other, so focus would be lost
23
+ // on every toggle: move it into the row on open, back to the trigger on close.
24
+ React.useEffect(() => {
25
+ if (wasExpanded.current === isExpanded)
26
+ return;
27
+ wasExpanded.current = isExpanded;
28
+ const container = containerRef.current;
29
+ if (!container)
30
+ return;
31
+ if (isExpanded) {
32
+ const target = container.querySelector('button[aria-pressed="true"]') ??
33
+ container.querySelector('button, input');
34
+ target?.focus();
35
+ }
36
+ else if (!document.activeElement || document.activeElement === document.body) {
37
+ container.querySelector('button')?.focus();
38
+ }
39
+ }, [isExpanded]);
40
+ React.useEffect(() => {
41
+ if (!isExpanded)
42
+ return;
43
+ const handleClickOutside = (event) => {
44
+ if (containerRef.current && !containerRef.current.contains(event.target)) {
45
+ setIsExpanded(false);
46
+ }
47
+ };
48
+ const handleEscape = (event) => {
49
+ if (event.key === 'Escape') {
50
+ setIsExpanded(false);
51
+ }
52
+ };
53
+ document.addEventListener('mousedown', handleClickOutside);
54
+ document.addEventListener('keydown', handleEscape);
55
+ return () => {
56
+ document.removeEventListener('mousedown', handleClickOutside);
57
+ document.removeEventListener('keydown', handleEscape);
58
+ };
59
+ }, [isExpanded]);
60
+ if (!isExpanded && tiles) {
61
+ // Als Kachel: Farbe oben, „Farbe“ darunter; der sichtbare Name ist der Name.
62
+ return (_jsx("div", { className: "flex items-center shrink-0", ref: containerRef, children: _jsxs("button", { className: TILE, onClick: (e) => {
63
+ e.stopPropagation();
64
+ setIsExpanded(true);
65
+ }, title: variant === 'font' ? t.topBar.changeTextColor : t.topBar.changeColor, type: "button", "aria-expanded": false, children: [variant === 'font' ? (_jsxs("span", { className: "flex flex-col items-center", "aria-hidden": true, children: [_jsx("span", { className: "text-[15px] font-bold leading-none", children: "A" }), _jsx("span", { className: "mt-[2px] h-[3px] w-[15px] rounded-[1px]", style: { backgroundColor: currentColor } })] })) : (_jsx("span", { className: "size-[18px] rounded-md border border-[var(--editor-border-strong)]", style: { backgroundColor: currentColor }, "aria-hidden": true })), t.topBar.tiles.color] }) }));
66
+ }
67
+ if (!isExpanded) {
68
+ return (_jsx("div", { className: "flex items-center shrink-0", ref: containerRef, children: variant === 'font' ? (_jsxs("button", { className: "inline-flex flex-col items-center justify-center size-8 max-canvas-mobile:size-11 shrink-0 rounded-md border-none bg-transparent cursor-pointer text-[var(--editor-text)] transition-colors duration-150 hover:bg-[var(--editor-surface-hover)]", onClick: (e) => {
69
+ e.stopPropagation();
70
+ setIsExpanded(true);
71
+ }, title: t.topBar.changeTextColor, type: "button", "aria-expanded": false, "aria-label": t.topBar.openPalette, children: [_jsx("span", { className: "text-[15px] font-bold leading-none", children: "A" }), _jsx("span", { className: "mt-[2px] h-[3px] w-[15px] rounded-[1px]", style: { backgroundColor: currentColor } })] })) : (_jsx("button", { className: `size-8 max-canvas-mobile:size-[26px] shrink-0 rounded-md border border-[var(--editor-border-strong)] cursor-pointer p-0 transition-transform duration-150 hover:-translate-y-0.5 active:scale-90 relative ${HIT_44}`, style: { backgroundColor: currentColor }, onClick: (e) => {
72
+ e.stopPropagation();
73
+ setIsExpanded(true);
74
+ }, title: t.topBar.changeColor, type: "button", "aria-expanded": false, "aria-label": t.topBar.openPalette })) }));
75
+ }
76
+ return (_jsxs("div", { className: "flex items-center gap-2 px-1 animate-canvas-expand-width max-canvas-mobile:gap-[18px] max-canvas-mobile:px-[9px]", ref: containerRef, role: "group", "aria-label": t.topBar.palette, onKeyDown: (e) => {
77
+ if (e.key !== 'Escape')
78
+ return;
79
+ // Close the row only; the canvas must not also deselect.
80
+ e.stopPropagation();
81
+ setIsExpanded(false);
82
+ }, children: [colorOptions.map((color) => (_jsx("button", { className: cn(colorBtn, currentColor === color.value &&
83
+ 'scale-110 border-primary-600 z-[1] after:content-[""] after:absolute after:-inset-1 after:border-2 after:border-primary-600 after:rounded-full after:animate-[scaleIn_0.2s_ease-out]'), style: { backgroundColor: color.value }, onClick: (e) => {
84
+ e.stopPropagation();
85
+ onColorSelect(color.value, color.ref);
86
+ }, title: color.name, "aria-label": color.name, "aria-pressed": currentColor === color.value, type: "button" }, color.id))), allowCustom && (_jsx(CustomColorSwatch, { value: currentColor, presets: colorOptions.map((color) => color.value), onPick: (picked) => onColorSelect(picked), className: `size-8 max-canvas-mobile:size-[26px] ${HIT_44}`, outlineOffset: 3 }))] }));
87
+ }
@@ -0,0 +1,17 @@
1
+ import { type Bindings, type FontRole } from '@ggraphic/core';
2
+ import React from 'react';
3
+ interface FloatingFontRoleControlProps {
4
+ text: {
5
+ fontFamily: string;
6
+ bind?: Bindings;
7
+ };
8
+ onChange: (role: FontRole) => void;
9
+ }
10
+ /**
11
+ * The font of a free text, picked by role (Headline, Text, Condensed, Accent) and never by name:
12
+ * only the brand's own fonts are offered, and a text picked this way stays bound to its role, so
13
+ * a brand change takes it along. Each role is shown in its own font. A native select: keyboard
14
+ * and screen reader for free (Safari draws the entries in the system font).
15
+ */
16
+ export declare function FloatingFontRoleControl({ text, onChange }: FloatingFontRoleControlProps): React.JSX.Element;
17
+ export {};
@@ -0,0 +1,37 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MPL-2.0
3
+ import { currentFontRole, fontRoleOptions } from '@ggraphic/core';
4
+ import { activeBrand } from '@ggraphic/editor/brand/brandRegistry';
5
+ import { TileCaption, useBarTiles } from '@ggraphic/editor/components/TopBar/barTiles';
6
+ import { useMessages } from '@ggraphic/editor/i18n/messages';
7
+ import { primaryFontFamily } from '@ggraphic/editor/utils/fontMarkSupport';
8
+ import { requestFontFace } from '@ggraphic/editor/utils/textUtils';
9
+ /** Value of the entry that stands for a family no role has. */
10
+ const CUSTOM = '';
11
+ const stackOf = (family) => `"${family}", sans-serif`;
12
+ /**
13
+ * The font of a free text, picked by role (Headline, Text, Condensed, Accent) and never by name:
14
+ * only the brand's own fonts are offered, and a text picked this way stays bound to its role, so
15
+ * a brand change takes it along. Each role is shown in its own font. A native select: keyboard
16
+ * and screen reader for free (Safari draws the entries in the system font).
17
+ */
18
+ export function FloatingFontRoleControl({ text, onChange }) {
19
+ const t = useMessages();
20
+ const tiles = useBarTiles();
21
+ const options = fontRoleOptions(activeBrand());
22
+ const role = currentFontRole(text, options);
23
+ const family = options.find((o) => o.role === role)?.family ?? primaryFontFamily(text.fontFamily);
24
+ const select = (_jsxs("select", { "aria-label": t.topBar.fontRole, title: t.topBar.fontRole, value: role ?? CUSTOM, onChange: (e) => {
25
+ const picked = options.find((o) => o.role === e.target.value);
26
+ if (!picked)
27
+ return;
28
+ // The face starts loading before the text is switched to it, not on the first draw.
29
+ requestFontFace(picked.family);
30
+ onChange(picked.role);
31
+ }, style: { fontFamily: stackOf(family) }, className: `${tiles ? 'h-11 -mb-3' : 'h-8 max-canvas-mobile:h-11'} max-w-36 shrink-0 rounded-md border-none bg-transparent px-1 cursor-pointer text-[13px] font-medium text-[var(--editor-text)] hover:bg-[var(--editor-surface-hover)]`, children: [role === null && (_jsx("option", { value: CUSTOM, disabled: true, children: t.topBar.fontRoleCustom(family) })), options.map((o) => (_jsx("option", { value: o.role, style: { fontFamily: stackOf(o.family) }, children: t.topBar.fontRoles[o.role] }, o.role)))] }));
32
+ if (!tiles)
33
+ return select;
34
+ // On the mobile tile bar the select keeps its full 44 px; the caption sits in its empty
35
+ // lower edge and lets taps through. The accessible name stays on the select.
36
+ return (_jsxs("div", { className: "flex flex-col items-center justify-end gap-1 h-14 pb-2 shrink-0", children: [select, _jsx(TileCaption, { decorative: true, children: t.topBar.tiles.fontRole })] }));
37
+ }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface FloatingFontSizeControlProps {
3
+ fontSize: number;
4
+ onFontSizeChange: (size: number) => void;
5
+ }
6
+ export declare function FloatingFontSizeControl({ fontSize, onFontSizeChange, }: FloatingFontSizeControlProps): React.JSX.Element;
7
+ export {};
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MPL-2.0
3
+ import { TileCaption, useBarTiles } from '@ggraphic/editor/components/TopBar/barTiles';
4
+ import { useMessages } from '@ggraphic/editor/i18n/messages';
5
+ import { PiPlus, PiMinus } from 'react-icons/pi';
6
+ const fontBtn = 'touch-target size-7 rounded-md border-none bg-transparent cursor-pointer flex items-center justify-center text-[var(--editor-text-secondary)] transition-colors duration-150 hover:enabled:bg-[var(--editor-surface-hover)] hover:enabled:text-[var(--editor-active-fg)] disabled:opacity-30 disabled:cursor-not-allowed';
7
+ export function FloatingFontSizeControl({ fontSize, onFontSizeChange, }) {
8
+ const t = useMessages();
9
+ const tiles = useBarTiles();
10
+ const handleIncrease = (e) => {
11
+ e.stopPropagation();
12
+ onFontSizeChange(fontSize + 2);
13
+ };
14
+ const handleDecrease = (e) => {
15
+ e.stopPropagation();
16
+ onFontSizeChange(Math.max(2, fontSize - 2));
17
+ };
18
+ const stepper = (_jsxs("div", { className: "flex items-center h-[34px] shrink-0 rounded-lg border border-[var(--editor-border-strong)] px-0.5", children: [_jsx("button", { className: fontBtn, onClick: handleDecrease, title: t.topBar.fontSmaller, "aria-label": t.topBar.fontSmaller, type: "button", children: _jsx(PiMinus, { size: 10 }) }), _jsx("span", { className: "text-[13px] font-semibold text-[var(--editor-text)] min-w-8 text-center tabular-nums", children: Math.round(fontSize) }), _jsx("button", { className: fontBtn, onClick: handleIncrease, title: t.topBar.fontLarger, "aria-label": t.topBar.fontLarger, type: "button", children: _jsx(PiPlus, { size: 10 }) })] }));
19
+ if (!tiles)
20
+ return stepper;
21
+ return (_jsxs("div", { className: "flex flex-col items-center justify-end gap-1 h-14 pb-2 shrink-0", children: [stepper, _jsx(TileCaption, { decorative: true, children: t.topBar.tiles.fontSize })] }));
22
+ }
@@ -0,0 +1,9 @@
1
+ import { type GradientFill } from '@ggraphic/editor/utils/gradientFill';
2
+ import React from 'react';
3
+ interface FloatingGradientControlProps {
4
+ currentColor: string;
5
+ gradient?: GradientFill | null;
6
+ onChange: (gradient: GradientFill | null) => void;
7
+ }
8
+ export declare function FloatingGradientControl({ currentColor, gradient, onChange, }: FloatingGradientControlProps): React.JSX.Element;
9
+ export {};
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MPL-2.0
3
+ import { CustomColorSwatch } from '@ggraphic/editor/components/CustomColorSwatch';
4
+ import { useMessages } from '@ggraphic/editor/i18n/messages';
5
+ import { Popover, PopoverContent, PopoverTrigger } from '@ggraphic/editor/ui/popover';
6
+ import { brandColors } from '@ggraphic/editor/utils/colorOptions';
7
+ import { createDefaultGradient } from '@ggraphic/editor/utils/gradientFill';
8
+ import { Slider } from 'radix-ui';
9
+ import { useId } from 'react';
10
+ import { PiPaintBucket } from 'react-icons/pi';
11
+ const ICON_BTN = 'inline-flex items-center justify-center size-8 shrink-0 rounded-md border-none bg-transparent cursor-pointer text-[var(--editor-text)] transition-colors duration-150 hover:bg-[var(--editor-surface-hover)]';
12
+ function StopSwatches({ selected, onSelect, }) {
13
+ return (_jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [brandColors().map((c) => (_jsx("button", { className: "size-6 rounded-full border border-black/10 hover:scale-110 transition-transform", style: {
14
+ backgroundColor: c.value,
15
+ outline: selected === c.value ? '2px solid var(--editor-accent)' : 'none',
16
+ outlineOffset: '1px',
17
+ }, onClick: () => onSelect(c.value), title: c.name, "aria-label": c.name, "aria-pressed": selected === c.value, type: "button" }, c.id))), _jsx(CustomColorSwatch, { value: selected, presets: brandColors().map((c) => c.value), onPick: onSelect, className: "size-5", outlineOffset: 1 })] }));
18
+ }
19
+ export function FloatingGradientControl({ currentColor, gradient, onChange, }) {
20
+ const t = useMessages();
21
+ const active = !!gradient;
22
+ const g = gradient ?? createDefaultGradient(currentColor);
23
+ const stop0 = g.stops[0]?.color ?? currentColor;
24
+ const stop1 = g.stops[1]?.color ?? '#ffffff';
25
+ const setStop = (index, color) => {
26
+ const stops = g.stops.map((s, i) => (i === index ? { ...s, color } : s));
27
+ onChange({ ...g, stops });
28
+ };
29
+ const titleId = useId();
30
+ return (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { className: ICON_BTN, title: t.topBar.gradient, type: "button", "aria-label": t.topBar.editGradient, children: _jsx(PiPaintBucket, { size: 17, className: active ? 'text-[var(--editor-accent)]' : 'text-[var(--editor-text-muted)]' }) }) }), _jsxs(PopoverContent, { className: "z-[10001] w-64 flex flex-col gap-3 p-3", align: "center", "aria-labelledby": titleId, children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { id: titleId, className: "text-xs font-medium text-[var(--editor-text)]", children: t.topBar.gradient }), active ? (_jsx("button", { className: "text-[11px] font-medium text-[var(--editor-accent)] hover:underline", onClick: () => onChange(null), type: "button", children: t.sidebar.imageAdjust.remove })) : (_jsx("button", { className: "text-[11px] font-medium text-[var(--editor-accent)] hover:underline", onClick: () => onChange(createDefaultGradient(currentColor)), type: "button", children: t.sidebar.imageAdjust.enable }))] }), active && (_jsxs(_Fragment, { children: [_jsx("div", { className: "h-6 w-full rounded-md border border-black/10", style: {
31
+ background: g.type === 'radial'
32
+ ? `radial-gradient(${stop0}, ${stop1})`
33
+ : `linear-gradient(${g.angle}deg, ${stop0}, ${stop1})`,
34
+ } }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("span", { className: "text-[11px] text-[var(--editor-text-muted)]", children: "Farbe 1" }), _jsx(StopSwatches, { selected: stop0, onSelect: (c) => setStop(0, c) })] }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("span", { className: "text-[11px] text-[var(--editor-text-muted)]", children: "Farbe 2" }), _jsx(StopSwatches, { selected: stop1, onSelect: (c) => setStop(1, c) })] }), g.type === 'linear' && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-[11px] w-12 text-[var(--editor-text-muted)]", children: t.topBar.angle }), _jsxs(Slider.Root, { className: "relative flex items-center select-none touch-none grow h-4 max-canvas-mobile:h-11", value: [g.angle], onValueChange: (v) => onChange({ ...g, angle: v[0] }), min: 0, max: 360, step: 5, children: [_jsx(Slider.Track, { className: "relative grow rounded-full h-1 bg-[var(--editor-border-soft)]", children: _jsx(Slider.Range, { className: "absolute rounded-full h-full bg-[var(--editor-accent)]" }) }), _jsx(Slider.Thumb, { className: "block size-3 max-canvas-mobile:size-5 bg-white rounded-full border-2 border-[var(--editor-accent)] shadow-[0_1px_3px_rgba(0,0,0,0.2)] cursor-grab outline-none kbd:focus-visible:outline-2 kbd:focus-visible:outline-solid kbd:focus-visible:outline-offset-2 kbd:focus-visible:outline-[var(--editor-accent)]", "aria-label": t.topBar.angle })] }), _jsxs("span", { className: "text-[11px] w-9 text-right tabular-nums text-[var(--editor-text-muted)]", children: [g.angle, "\u00B0"] })] }))] }))] })] }));
35
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface FloatingHistoryControlsProps {
3
+ onUndo: () => void;
4
+ onRedo: () => void;
5
+ canUndo: boolean;
6
+ canRedo: boolean;
7
+ /** Render for the green menu bar (white-on-green) instead of a light surface. */
8
+ onDark?: boolean;
9
+ }
10
+ export declare function FloatingHistoryControls({ onUndo, onRedo, canUndo, canRedo, onDark, }: FloatingHistoryControlsProps): React.JSX.Element;
11
+ export {};
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MPL-2.0
3
+ import { useMessages } from '@ggraphic/editor/i18n/messages';
4
+ import { PiArrowCounterClockwise, PiArrowClockwise } from 'react-icons/pi';
5
+ const iconBtnLight = 'size-8 max-canvas-mobile:size-11 rounded-full max-canvas-mobile:rounded-[10px] border-none bg-transparent cursor-pointer flex items-center justify-center text-foreground transition-[background-color,color] duration-200 hover:enabled:bg-hover-alt hover:enabled:text-primary-600 active:enabled:bg-editor-canvas-hover disabled:opacity-30 disabled:cursor-not-allowed disabled:text-grey-400';
6
+ // On the green menu bar: white glyphs, translucent-white hover.
7
+ const iconBtnDark = 'size-[34px] max-canvas-mobile:size-11 rounded-[10px] border-none bg-transparent cursor-pointer flex items-center justify-center text-white/90 transition-[background-color,color] duration-200 hover:enabled:bg-white/15 hover:enabled:text-white active:enabled:bg-white/25 disabled:opacity-40 disabled:cursor-not-allowed';
8
+ const isMac = typeof navigator !== 'undefined' && /Mac/i.test(navigator.platform);
9
+ export function FloatingHistoryControls({ onUndo, onRedo, canUndo, canRedo, onDark, }) {
10
+ const t = useMessages();
11
+ const iconBtn = onDark ? iconBtnDark : iconBtnLight;
12
+ return (_jsxs("div", { className: "flex items-center gap-1 max-canvas-mobile:gap-0.5", children: [_jsx("button", { className: iconBtn, onClick: (e) => {
13
+ e.stopPropagation();
14
+ onUndo();
15
+ }, disabled: !canUndo, title: isMac ? t.topBar.undoMac : t.topBar.undoWin, type: "button", children: _jsx(PiArrowCounterClockwise, { size: 20 }) }), _jsx("button", { className: iconBtn, onClick: (e) => {
16
+ e.stopPropagation();
17
+ onRedo();
18
+ }, disabled: !canRedo, title: isMac ? t.topBar.redoMac : t.topBar.redoWin, type: "button", children: _jsx(PiArrowClockwise, { size: 20 }) })] }));
19
+ }
@@ -0,0 +1,9 @@
1
+ import { type ImageLookId, type LookFields } from '@ggraphic/editor/utils/imageLook';
2
+ import React from 'react';
3
+ interface FloatingImageLookControlProps {
4
+ image: LookFields;
5
+ onChange: (look: ImageLookId) => void;
6
+ }
7
+ /** Look of the selected image: None, Black & white, Duotone, Darken. A native select: keyboard and screen reader for free. */
8
+ export declare function FloatingImageLookControl({ image, onChange }: FloatingImageLookControlProps): React.JSX.Element;
9
+ export {};
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MPL-2.0
3
+ import { useMessages } from '@ggraphic/editor/i18n/messages';
4
+ import { currentImageLook, IMAGE_LOOK_IDS, } from '@ggraphic/editor/utils/imageLook';
5
+ /** Look of the selected image: None, Black & white, Duotone, Darken. A native select: keyboard and screen reader for free. */
6
+ export function FloatingImageLookControl({ image, onChange }) {
7
+ const t = useMessages();
8
+ const labels = {
9
+ none: t.topBar.imageLookNone,
10
+ bw: t.topBar.imageLookBw,
11
+ duotone: t.topBar.imageLookDuotone,
12
+ darken: t.topBar.imageLookDarken,
13
+ };
14
+ return (_jsx("select", { "aria-label": t.topBar.imageLook, title: t.topBar.imageLook, value: currentImageLook(image), onChange: (e) => onChange(e.target.value), className: "h-8 max-canvas-mobile:h-11 shrink-0 rounded-md border-none bg-transparent px-1 cursor-pointer text-[13px] font-medium text-[var(--editor-text)] hover:bg-[var(--editor-surface-hover)]", children: IMAGE_LOOK_IDS.map((id) => (_jsx("option", { value: id, children: labels[id] }, id))) }));
15
+ }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface FloatingLayerControlsProps {
3
+ onMoveUp: () => void;
4
+ onMoveDown: () => void;
5
+ canMoveUp: boolean;
6
+ canMoveDown: boolean;
7
+ }
8
+ export declare const FloatingLayerControls: React.FC<FloatingLayerControlsProps>;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MPL-2.0
3
+ import { useMessages } from '@ggraphic/editor/i18n/messages';
4
+ import { PiStackPlus, PiStackMinus } from 'react-icons/pi';
5
+ const iconBtn = 'inline-flex items-center justify-center size-8 max-canvas-mobile:size-11 shrink-0 rounded-md border-none bg-transparent cursor-pointer text-[var(--editor-text)] transition-colors duration-150 hover:enabled:bg-[var(--editor-surface-hover)] hover:enabled:text-[var(--editor-active-fg)] disabled:opacity-30 disabled:cursor-not-allowed';
6
+ export const FloatingLayerControls = ({ onMoveUp, onMoveDown, canMoveUp, canMoveDown, }) => {
7
+ const t = useMessages();
8
+ return (_jsxs("div", { className: "flex items-center gap-0.5", children: [_jsx("button", { className: iconBtn, onClick: onMoveUp, disabled: !canMoveUp, title: t.topBar.layerUp, "aria-label": t.topBar.layerUp, children: _jsx(PiStackPlus, {}) }), _jsx("button", { className: iconBtn, onClick: onMoveDown, disabled: !canMoveDown, title: t.topBar.layerDownHint, "aria-label": t.topBar.layerDown, children: _jsx(PiStackMinus, {}) })] }));
9
+ };
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface FloatingOpacityControlProps {
3
+ opacity: number;
4
+ onOpacityChange: (opacity: number) => void;
5
+ }
6
+ /**
7
+ * Deckkraft — wie bei Canva ein Knopf, der Regler liegt im Popover. Offen in
8
+ * der Leiste war er ihr breitestes Stück.
9
+ */
10
+ export declare function FloatingOpacityControl({ opacity, onOpacityChange }: FloatingOpacityControlProps): React.JSX.Element;
11
+ export {};
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MPL-2.0
3
+ import { Slider } from 'radix-ui';
4
+ import { PiCheckerboard } from 'react-icons/pi';
5
+ import { TILE, TileCaption, useBarTiles } from '@ggraphic/editor/components/TopBar/barTiles';
6
+ import { useMessages } from '@ggraphic/editor/i18n/messages';
7
+ import { Popover, PopoverContent, PopoverTrigger } from '@ggraphic/editor/ui/popover';
8
+ const TRIGGER_BTN = 'inline-flex items-center justify-center size-8 max-canvas-mobile:size-11 shrink-0 rounded-md border-none bg-transparent cursor-pointer text-[var(--editor-text)] transition-colors duration-150 hover:bg-[var(--editor-surface-hover)] hover:text-[var(--editor-active-fg)] data-[state=open]:bg-[var(--editor-active-bg)] data-[state=open]:text-[var(--editor-active-fg)]';
9
+ /**
10
+ * Deckkraft — wie bei Canva ein Knopf, der Regler liegt im Popover. Offen in
11
+ * der Leiste war er ihr breitestes Stück.
12
+ */
13
+ export function FloatingOpacityControl({ opacity, onOpacityChange }) {
14
+ const t = useMessages();
15
+ const tiles = useBarTiles();
16
+ const label = t.sidebar.imageAdjust.opacity;
17
+ const percent = `${Math.round(opacity * 100)} %`;
18
+ return (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { className: tiles ? TILE : TRIGGER_BTN, title: label, "aria-label": label, type: "button", children: [_jsx(PiCheckerboard, { size: 18, "aria-hidden": "true" }), _jsx(TileCaption, { children: label })] }) }), _jsxs(PopoverContent, { className: "z-[10001] w-64 flex flex-col gap-2 p-3", align: "center", children: [_jsx("span", { className: "text-xs font-medium text-[var(--editor-text)]", children: label }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsxs(Slider.Root, { className: "relative flex grow items-center select-none touch-none h-5 max-canvas-mobile:h-11", value: [opacity], onValueChange: (values) => onOpacityChange(values[0]), min: 0, max: 1, step: 0.01, children: [_jsx(Slider.Track, { className: "relative grow rounded-full h-1 bg-[var(--editor-border-soft)]", children: _jsx(Slider.Range, { className: "absolute rounded-full h-full bg-[var(--editor-accent)]" }) }), _jsx(Slider.Thumb, { className: "block size-3.5 max-canvas-mobile:size-5 bg-white rounded-full border-2 border-[var(--editor-accent)] shadow-[0_1px_3px_rgba(0,0,0,0.2)] cursor-grab focus:outline-none focus:shadow-[0_0_0_3px_rgba(82,144,122,0.35)]", "aria-label": label, "aria-valuetext": percent })] }), _jsx("span", { className: "text-[12px] font-medium w-10 text-right tabular-nums text-[var(--editor-text-muted)]", children: percent })] })] })] }));
19
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface FloatingOutlineControlProps {
3
+ stroke?: string;
4
+ strokeWidth?: number;
5
+ onChange: (patch: {
6
+ stroke?: string;
7
+ strokeWidth?: number;
8
+ }) => void;
9
+ }
10
+ export declare function FloatingOutlineControl({ stroke, strokeWidth, onChange, }: FloatingOutlineControlProps): React.JSX.Element;
11
+ export {};
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MPL-2.0
3
+ import { activeBrand } from '@ggraphic/editor/brand/brandRegistry';
4
+ import { CustomColorSwatch } from '@ggraphic/editor/components/CustomColorSwatch';
5
+ import { useMessages } from '@ggraphic/editor/i18n/messages';
6
+ import { Popover, PopoverContent, PopoverTrigger } from '@ggraphic/editor/ui/popover';
7
+ import { Slider } from 'radix-ui';
8
+ import { useId } from 'react';
9
+ import { PiTextAa } from 'react-icons/pi';
10
+ import { colorName } from '@ggraphic/editor/utils/colorNames';
11
+ const DEFAULT_WIDTH = 2;
12
+ const ICON_BTN = 'inline-flex items-center justify-center size-8 shrink-0 rounded-md border-none bg-transparent cursor-pointer text-[var(--editor-text)] transition-colors duration-150 hover:bg-[var(--editor-surface-hover)]';
13
+ export function FloatingOutlineControl({ stroke, strokeWidth, onChange, }) {
14
+ const { outlines } = activeBrand().effects;
15
+ const t = useMessages();
16
+ const enabled = !!stroke && (strokeWidth ?? 0) > 0;
17
+ const toggle = () => {
18
+ if (enabled) {
19
+ onChange({ stroke: undefined, strokeWidth: 0 });
20
+ }
21
+ else {
22
+ onChange({ stroke: '#ffffff', strokeWidth: DEFAULT_WIDTH });
23
+ }
24
+ };
25
+ const titleId = useId();
26
+ return (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { className: ICON_BTN, title: t.topBar.outline, type: "button", "aria-label": t.topBar.editOutline, children: _jsx(PiTextAa, { size: 17, className: enabled ? 'text-[var(--editor-accent)]' : 'text-[var(--editor-text-muted)]' }) }) }), _jsxs(PopoverContent, { className: "z-[10001] w-56 flex flex-col gap-2.5 p-3", align: "center", "aria-labelledby": titleId, children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { id: titleId, className: "text-xs font-medium text-[var(--editor-text)]", children: t.topBar.outline }), _jsx("button", { className: "text-[11px] font-medium text-[var(--editor-accent)] hover:underline", onClick: toggle, type: "button", children: enabled ? 'Entfernen' : 'Aktivieren' })] }), enabled && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [outlines.map((c) => (_jsx("button", { className: "size-6 rounded-full border border-black/10 hover:scale-110 transition-transform", style: {
27
+ backgroundColor: c,
28
+ outline: stroke === c ? '2px solid var(--editor-accent)' : 'none',
29
+ outlineOffset: '2px',
30
+ }, onClick: () => onChange({ stroke: c }), title: colorName(c), "aria-label": colorName(c), "aria-pressed": stroke === c, type: "button" }, c))), _jsx(CustomColorSwatch, { value: stroke, presets: outlines, onPick: (color) => onChange({ stroke: color }), className: "size-6" })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-[11px] w-12 text-[var(--editor-text-muted)]", children: t.topBar.strength }), _jsxs(Slider.Root, { className: "relative flex items-center select-none touch-none grow h-4 max-canvas-mobile:h-11", value: [strokeWidth ?? DEFAULT_WIDTH], onValueChange: (v) => onChange({ strokeWidth: v[0] }), min: 0.5, max: 12, step: 0.5, children: [_jsx(Slider.Track, { className: "relative grow rounded-full h-1 bg-[var(--editor-border-soft)]", children: _jsx(Slider.Range, { className: "absolute rounded-full h-full bg-[var(--editor-accent)]" }) }), _jsx(Slider.Thumb, { className: "block size-3 max-canvas-mobile:size-5 bg-white rounded-full border-2 border-[var(--editor-accent)] shadow-[0_1px_3px_rgba(0,0,0,0.2)] cursor-grab focus:outline-none", "aria-label": t.topBar.outlineWidth })] }), _jsx("span", { className: "text-[11px] w-8 text-right tabular-nums text-[var(--editor-text-muted)]", children: strokeWidth ?? DEFAULT_WIDTH })] })] }))] })] }));
31
+ }
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import type { SelectionGeometry } from '@ggraphic/editor/utils/canvasCommands';
3
+ export type PositionCommandId = 'alignLeft' | 'alignCenterH' | 'alignRight' | 'alignTop' | 'alignMiddle' | 'alignBottom' | 'distributeHorizontal' | 'distributeVertical';
4
+ interface FloatingPositionControlProps {
5
+ /**
6
+ * Lässt sich die Auswahl verschieben (`selectionCapabilities`)? Ohne das
7
+ * bleiben nur die Ebenen — ein gesperrtes Element wechselt sie weiter.
8
+ */
9
+ canAlign?: boolean;
10
+ /** Mindestens drei bewegliche Elemente — nur in der Mehrfachauswahl gefragt. */
11
+ canDistribute: boolean;
12
+ onCommand: (id: PositionCommandId) => void;
13
+ /**
14
+ * Einzelauswahl: Lage und Größe, gelesen beim Öffnen und nach jeder
15
+ * Änderung. Ohne sie (Mehrfachauswahl) gibt es Verteilen statt der Felder.
16
+ */
17
+ getGeometry?: () => SelectionGeometry | null;
18
+ onPositionChange?: (patch: {
19
+ x?: number;
20
+ y?: number;
21
+ }) => void;
22
+ onSizeChange?: (patch: {
23
+ width?: number;
24
+ height?: number;
25
+ }) => void;
26
+ /** Einzelauswahl: Ebene nach oben/unten, wie bei Canva unter „Position“. */
27
+ layer?: {
28
+ canMoveUp: boolean;
29
+ canMoveDown: boolean;
30
+ onMove: (direction: 'up' | 'down') => void;
31
+ };
32
+ }
33
+ /**
34
+ * „Position“: Ausrichten, Verteilen und — einzeln — X, Y, B, H in logischen px
35
+ * sowie die Ebene. Ein Text-Knopf wie bei Canva: ein Icon sagte hier zu wenig.
36
+ */
37
+ export declare function FloatingPositionControl({ canAlign, canDistribute, onCommand, getGeometry, onPositionChange, onSizeChange, layer, }: FloatingPositionControlProps): React.JSX.Element;
38
+ export {};