@forgedevstack/ink 1.1.7 → 1.1.9

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 (295) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +9 -1
  3. package/bin/ink.const.mjs +26 -0
  4. package/bin/ink.mjs +58 -0
  5. package/dist/components/InkEditor/InkEditor.cjs +1 -1
  6. package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
  7. package/dist/components/InkEditor/InkEditor.js +1193 -834
  8. package/dist/components/InkEditor/components/AiPanel/AiPanel.cjs +1 -1
  9. package/dist/components/InkEditor/components/AiPanel/AiPanel.d.ts.map +1 -1
  10. package/dist/components/InkEditor/components/AiPanel/AiPanel.js +58 -52
  11. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.cjs +1 -0
  12. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts +4 -0
  13. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts.map +1 -0
  14. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.js +223 -0
  15. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.types.d.ts +10 -0
  16. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.types.d.ts.map +1 -0
  17. package/dist/components/InkEditor/components/ExcelSheetPanel/index.d.ts +3 -0
  18. package/dist/components/InkEditor/components/ExcelSheetPanel/index.d.ts.map +1 -0
  19. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.cjs +1 -0
  20. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.d.ts +4 -0
  21. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.d.ts.map +1 -0
  22. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.js +91 -0
  23. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.types.d.ts +11 -0
  24. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.types.d.ts.map +1 -0
  25. package/dist/components/InkEditor/components/GraphEditModal/index.d.ts +3 -0
  26. package/dist/components/InkEditor/components/GraphEditModal/index.d.ts.map +1 -0
  27. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.cjs +1 -0
  28. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.d.ts +4 -0
  29. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.d.ts.map +1 -0
  30. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.js +98 -0
  31. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.types.d.ts +10 -0
  32. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.types.d.ts.map +1 -0
  33. package/dist/components/InkEditor/components/GraphPicker/index.d.ts +3 -0
  34. package/dist/components/InkEditor/components/GraphPicker/index.d.ts.map +1 -0
  35. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.cjs +1 -0
  36. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.d.ts +4 -0
  37. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.d.ts.map +1 -0
  38. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.js +27 -0
  39. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.types.d.ts +7 -0
  40. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.types.d.ts.map +1 -0
  41. package/dist/components/InkEditor/components/HtmlSourcePanel/index.d.ts +3 -0
  42. package/dist/components/InkEditor/components/HtmlSourcePanel/index.d.ts.map +1 -0
  43. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.cjs +1 -1
  44. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.d.ts.map +1 -1
  45. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.js +17 -12
  46. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.types.d.ts +1 -0
  47. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.types.d.ts.map +1 -1
  48. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.cjs +1 -0
  49. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.cjs +1 -0
  50. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.d.ts +7 -0
  51. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.d.ts.map +1 -0
  52. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.js +9 -0
  53. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.d.ts +4 -0
  54. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.d.ts.map +1 -0
  55. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.js +82 -0
  56. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.types.d.ts +8 -0
  57. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.types.d.ts.map +1 -0
  58. package/dist/components/InkEditor/components/PresenceStack/index.d.ts +3 -0
  59. package/dist/components/InkEditor/components/PresenceStack/index.d.ts.map +1 -0
  60. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.cjs +1 -0
  61. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.cjs +1 -0
  62. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.d.ts +7 -0
  63. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.d.ts.map +1 -0
  64. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.js +10 -0
  65. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.d.ts +4 -0
  66. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.d.ts.map +1 -0
  67. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.js +65 -0
  68. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.types.d.ts +6 -0
  69. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.types.d.ts.map +1 -0
  70. package/dist/components/InkEditor/components/RemoteCursors/index.d.ts +3 -0
  71. package/dist/components/InkEditor/components/RemoteCursors/index.d.ts.map +1 -0
  72. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.cjs +1 -0
  73. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.cjs +1 -0
  74. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.d.ts +10 -0
  75. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.d.ts.map +1 -0
  76. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.js +18 -0
  77. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.d.ts +4 -0
  78. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.d.ts.map +1 -0
  79. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.js +96 -0
  80. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.types.d.ts +11 -0
  81. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.types.d.ts.map +1 -0
  82. package/dist/components/InkEditor/components/TableSizePicker/index.d.ts +3 -0
  83. package/dist/components/InkEditor/components/TableSizePicker/index.d.ts.map +1 -0
  84. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.cjs +1 -0
  85. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts +4 -0
  86. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts.map +1 -0
  87. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.js +65 -0
  88. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.types.d.ts +12 -0
  89. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.types.d.ts.map +1 -0
  90. package/dist/components/InkEditor/components/ThemePicker/hooks/index.d.ts +3 -0
  91. package/dist/components/InkEditor/components/ThemePicker/hooks/index.d.ts.map +1 -0
  92. package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.cjs +1 -0
  93. package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.d.ts +13 -0
  94. package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.d.ts.map +1 -0
  95. package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.js +39 -0
  96. package/dist/components/InkEditor/components/ThemePicker/index.d.ts +3 -0
  97. package/dist/components/InkEditor/components/ThemePicker/index.d.ts.map +1 -0
  98. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.cjs +1 -0
  99. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.d.ts +4 -0
  100. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.d.ts.map +1 -0
  101. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.js +79 -0
  102. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.types.d.ts +10 -0
  103. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.types.d.ts.map +1 -0
  104. package/dist/components/InkEditor/components/TitleGallery/index.d.ts +3 -0
  105. package/dist/components/InkEditor/components/TitleGallery/index.d.ts.map +1 -0
  106. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.cjs +1 -1
  107. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.d.ts.map +1 -1
  108. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.js +41 -18
  109. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
  110. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.d.ts.map +1 -1
  111. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.js +25 -23
  112. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.cjs +1 -1
  113. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts +1 -1
  114. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts.map +1 -1
  115. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.js +7 -7
  116. package/dist/components/InkEditor/components/index.d.ts +18 -0
  117. package/dist/components/InkEditor/components/index.d.ts.map +1 -1
  118. package/dist/components/InkEditor/helpers/format.utils.cjs +2 -2
  119. package/dist/components/InkEditor/helpers/format.utils.d.ts +1 -1
  120. package/dist/components/InkEditor/helpers/format.utils.d.ts.map +1 -1
  121. package/dist/components/InkEditor/helpers/format.utils.js +72 -72
  122. package/dist/components/InkTabs/InkTabs.cjs +1 -0
  123. package/dist/components/InkTabs/InkTabs.d.ts +4 -0
  124. package/dist/components/InkTabs/InkTabs.d.ts.map +1 -0
  125. package/dist/components/InkTabs/InkTabs.js +104 -0
  126. package/dist/components/InkTabs/index.d.ts +2 -0
  127. package/dist/components/InkTabs/index.d.ts.map +1 -0
  128. package/dist/components/InkWorkspace/InkWorkspace.cjs +1 -0
  129. package/dist/components/InkWorkspace/InkWorkspace.d.ts +4 -0
  130. package/dist/components/InkWorkspace/InkWorkspace.d.ts.map +1 -0
  131. package/dist/components/InkWorkspace/InkWorkspace.js +317 -0
  132. package/dist/components/InkWorkspace/components/WorkspaceIcons.cjs +1 -0
  133. package/dist/components/InkWorkspace/components/WorkspaceIcons.d.ts +11 -0
  134. package/dist/components/InkWorkspace/components/WorkspaceIcons.d.ts.map +1 -0
  135. package/dist/components/InkWorkspace/components/WorkspaceIcons.js +39 -0
  136. package/dist/components/InkWorkspace/hooks/useInkWorkspace.cjs +1 -0
  137. package/dist/components/InkWorkspace/hooks/useInkWorkspace.d.ts +30 -0
  138. package/dist/components/InkWorkspace/hooks/useInkWorkspace.d.ts.map +1 -0
  139. package/dist/components/InkWorkspace/hooks/useInkWorkspace.js +72 -0
  140. package/dist/components/InkWorkspace/index.d.ts +4 -0
  141. package/dist/components/InkWorkspace/index.d.ts.map +1 -0
  142. package/dist/components/index.d.ts +2 -0
  143. package/dist/components/index.d.ts.map +1 -1
  144. package/dist/constants/collab.const.cjs +1 -0
  145. package/dist/constants/collab.const.d.ts +20 -0
  146. package/dist/constants/collab.const.d.ts.map +1 -0
  147. package/dist/constants/collab.const.js +54 -0
  148. package/dist/constants/colorMode.const.cjs +1 -1
  149. package/dist/constants/colorMode.const.d.ts +1 -1
  150. package/dist/constants/colorMode.const.d.ts.map +1 -1
  151. package/dist/constants/colorMode.const.js +4 -4
  152. package/dist/constants/contextMenu.const.cjs +1 -1
  153. package/dist/constants/contextMenu.const.d.ts +2 -0
  154. package/dist/constants/contextMenu.const.d.ts.map +1 -1
  155. package/dist/constants/contextMenu.const.js +17 -15
  156. package/dist/constants/defaultIcons.cjs +1 -1
  157. package/dist/constants/defaultIcons.d.ts.map +1 -1
  158. package/dist/constants/defaultIcons.js +20 -13
  159. package/dist/constants/defaults.const.cjs +1 -1
  160. package/dist/constants/defaults.const.d.ts +48 -0
  161. package/dist/constants/defaults.const.d.ts.map +1 -1
  162. package/dist/constants/defaults.const.js +201 -102
  163. package/dist/constants/generals.const.cjs +1 -1
  164. package/dist/constants/generals.const.d.ts +48 -0
  165. package/dist/constants/generals.const.d.ts.map +1 -1
  166. package/dist/constants/generals.const.js +71 -28
  167. package/dist/constants/index.d.ts +3 -0
  168. package/dist/constants/index.d.ts.map +1 -1
  169. package/dist/constants/numbers.cjs +1 -1
  170. package/dist/constants/numbers.d.ts +14 -0
  171. package/dist/constants/numbers.d.ts.map +1 -1
  172. package/dist/constants/numbers.js +47 -28
  173. package/dist/constants/plugins.const.cjs +1 -0
  174. package/dist/constants/plugins.const.d.ts +13 -0
  175. package/dist/constants/plugins.const.d.ts.map +1 -0
  176. package/dist/constants/plugins.const.js +45 -0
  177. package/dist/constants/table.const.cjs +1 -1
  178. package/dist/constants/table.const.d.ts +4 -0
  179. package/dist/constants/table.const.d.ts.map +1 -1
  180. package/dist/constants/table.const.js +10 -6
  181. package/dist/constants/toolbar.const.cjs +1 -1
  182. package/dist/constants/toolbar.const.d.ts +7 -0
  183. package/dist/constants/toolbar.const.d.ts.map +1 -1
  184. package/dist/constants/toolbar.const.js +16 -9
  185. package/dist/constants/toolbarMenu.const.cjs +1 -1
  186. package/dist/constants/toolbarMenu.const.d.ts +2 -0
  187. package/dist/constants/toolbarMenu.const.d.ts.map +1 -1
  188. package/dist/constants/toolbarMenu.const.js +80 -19
  189. package/dist/constants/workspace.const.cjs +1 -0
  190. package/dist/constants/workspace.const.d.ts +24 -0
  191. package/dist/constants/workspace.const.d.ts.map +1 -0
  192. package/dist/constants/workspace.const.js +23 -0
  193. package/dist/hooks/index.d.ts +4 -0
  194. package/dist/hooks/index.d.ts.map +1 -0
  195. package/dist/hooks/useInkCollaboration.cjs +1 -0
  196. package/dist/hooks/useInkCollaboration.d.ts +4 -0
  197. package/dist/hooks/useInkCollaboration.d.ts.map +1 -0
  198. package/dist/hooks/useInkCollaboration.js +86 -0
  199. package/dist/hooks/useToolbarOverflow.cjs +1 -0
  200. package/dist/hooks/useToolbarOverflow.d.ts +8 -0
  201. package/dist/hooks/useToolbarOverflow.d.ts.map +1 -0
  202. package/dist/hooks/useToolbarOverflow.js +29 -0
  203. package/dist/index.cjs +1 -1
  204. package/dist/index.d.ts +8 -3
  205. package/dist/index.d.ts.map +1 -1
  206. package/dist/index.js +150 -104
  207. package/dist/plugins/excel/excel.utils.cjs +1 -0
  208. package/dist/plugins/excel/excel.utils.d.ts +13 -0
  209. package/dist/plugins/excel/excel.utils.d.ts.map +1 -0
  210. package/dist/plugins/excel/excel.utils.js +40 -0
  211. package/dist/plugins/excel/index.d.ts +3 -0
  212. package/dist/plugins/excel/index.d.ts.map +1 -0
  213. package/dist/plugins/graph/graph.const.cjs +1 -0
  214. package/dist/plugins/graph/graph.const.d.ts +14 -0
  215. package/dist/plugins/graph/graph.const.d.ts.map +1 -0
  216. package/dist/plugins/graph/graph.const.js +24 -0
  217. package/dist/plugins/graph/graph.types.d.ts +7 -0
  218. package/dist/plugins/graph/graph.types.d.ts.map +1 -0
  219. package/dist/plugins/graph/graph.utils.cjs +1 -0
  220. package/dist/plugins/graph/graph.utils.d.ts +11 -0
  221. package/dist/plugins/graph/graph.utils.d.ts.map +1 -0
  222. package/dist/plugins/graph/graph.utils.js +76 -0
  223. package/dist/plugins/graph/index.d.ts +4 -0
  224. package/dist/plugins/graph/index.d.ts.map +1 -0
  225. package/dist/plugins/host/index.d.ts +2 -0
  226. package/dist/plugins/host/index.d.ts.map +1 -0
  227. package/dist/plugins/host/inkPlugins.cjs +1 -0
  228. package/dist/plugins/host/inkPlugins.d.ts +16 -0
  229. package/dist/plugins/host/inkPlugins.d.ts.map +1 -0
  230. package/dist/plugins/host/inkPlugins.js +20 -0
  231. package/dist/plugins/index.d.ts +5 -0
  232. package/dist/plugins/index.d.ts.map +1 -0
  233. package/dist/plugins/theme/index.d.ts +4 -0
  234. package/dist/plugins/theme/index.d.ts.map +1 -0
  235. package/dist/plugins/theme/inkTheme.cjs +1 -0
  236. package/dist/plugins/theme/inkTheme.d.ts +5 -0
  237. package/dist/plugins/theme/inkTheme.d.ts.map +1 -0
  238. package/dist/plugins/theme/inkTheme.js +27 -0
  239. package/dist/plugins/theme/theme.const.cjs +1 -0
  240. package/dist/plugins/theme/theme.const.d.ts +9 -0
  241. package/dist/plugins/theme/theme.const.d.ts.map +1 -0
  242. package/dist/plugins/theme/theme.const.js +15 -0
  243. package/dist/plugins/theme/theme.types.d.ts +12 -0
  244. package/dist/plugins/theme/theme.types.d.ts.map +1 -0
  245. package/dist/plugins/titles/index.d.ts +4 -0
  246. package/dist/plugins/titles/index.d.ts.map +1 -0
  247. package/dist/plugins/titles/titles.const.cjs +1 -0
  248. package/dist/plugins/titles/titles.const.d.ts +4 -0
  249. package/dist/plugins/titles/titles.const.d.ts.map +1 -0
  250. package/dist/plugins/titles/titles.const.js +15 -0
  251. package/dist/plugins/titles/titles.types.d.ts +2 -0
  252. package/dist/plugins/titles/titles.types.d.ts.map +1 -0
  253. package/dist/plugins/titles/titles.utils.cjs +1 -0
  254. package/dist/plugins/titles/titles.utils.d.ts +3 -0
  255. package/dist/plugins/titles/titles.utils.d.ts.map +1 -0
  256. package/dist/plugins/titles/titles.utils.js +14 -0
  257. package/dist/styles.css +1 -1
  258. package/dist/types/collab.types.d.ts +55 -0
  259. package/dist/types/collab.types.d.ts.map +1 -0
  260. package/dist/types/features.types.d.ts +1 -1
  261. package/dist/types/features.types.d.ts.map +1 -1
  262. package/dist/types/index.d.ts +3 -0
  263. package/dist/types/index.d.ts.map +1 -1
  264. package/dist/types/ink.types.d.ts +10 -2
  265. package/dist/types/ink.types.d.ts.map +1 -1
  266. package/dist/types/plugin.types.d.ts +8 -0
  267. package/dist/types/plugin.types.d.ts.map +1 -0
  268. package/dist/types/premium.types.d.ts +1 -1
  269. package/dist/types/premium.types.d.ts.map +1 -1
  270. package/dist/types/workspace.types.d.ts +54 -0
  271. package/dist/types/workspace.types.d.ts.map +1 -0
  272. package/dist/utils/collab.utils.cjs +1 -0
  273. package/dist/utils/collab.utils.d.ts +5 -0
  274. package/dist/utils/collab.utils.d.ts.map +1 -0
  275. package/dist/utils/collab.utils.js +32 -0
  276. package/dist/utils/collab.utils.test.d.ts +2 -0
  277. package/dist/utils/collab.utils.test.d.ts.map +1 -0
  278. package/dist/utils/index.d.ts +3 -1
  279. package/dist/utils/index.d.ts.map +1 -1
  280. package/dist/utils/ink.brand.test.d.ts +2 -0
  281. package/dist/utils/ink.brand.test.d.ts.map +1 -0
  282. package/dist/utils/outline.utils.cjs +1 -1
  283. package/dist/utils/outline.utils.d.ts.map +1 -1
  284. package/dist/utils/outline.utils.js +32 -32
  285. package/dist/utils/table.utils.cjs +1 -1
  286. package/dist/utils/table.utils.d.ts +4 -0
  287. package/dist/utils/table.utils.d.ts.map +1 -1
  288. package/dist/utils/table.utils.js +84 -45
  289. package/dist/utils/workspace.utils.cjs +1 -0
  290. package/dist/utils/workspace.utils.d.ts +5 -0
  291. package/dist/utils/workspace.utils.d.ts.map +1 -0
  292. package/dist/utils/workspace.utils.js +26 -0
  293. package/dist/utils/workspace.utils.test.d.ts +2 -0
  294. package/dist/utils/workspace.utils.test.d.ts.map +1 -0
  295. package/package.json +7 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),k=require("../../../../constants/defaults.const.cjs"),G=require("../../../../constants/aiModels.const.cjs");require("../../../../constants/openai.const.cjs");const C=require("../../../../utils/id.utils.cjs");require("../../../../utils/paste.utils.cjs");require("react-dom");const $=require("../../../../plugins/ai/aiPlugin.cjs"),B=T=>{var N,f,y,S;const{config:s,documentHtml:v,selectionHtml:b,onApplyHtml:L,onClose:x,onBusyChange:_}=T,[a,H]=i.useState("chat"),[g,j]=i.useState(""),[r,h]=i.useState([]),[l,q]=i.useState(!1),[o,m]=i.useState(null),[D,M]=i.useState([]),[A,R]=i.useState(k.INK_TRANSLATE_LANGUAGES[1]),K=s.providerId||G.INK_AI_DEMO_PROVIDER_ID,O=((N=s.uiTheme)==null?void 0:N.className)||s.className||"",p=e=>{q(e),_==null||_(e)},c=async(e,d,u)=>{var E;p(!0);try{const w=e==="chat"&&u?[...r,{id:C.createInkId("turn"),role:"user",content:u,timestamp:Date.now(),capability:e}]:r;e==="chat"&&u&&h(w);const n=await $.inkAi.runProvider(K,{capability:e,html:v,selectionHtml:b||void 0,prompt:u,history:w,options:d,modelId:s.modelId,documentSnapshot:{html:v,selectionHtml:b||void 0}});(E=n.turns)!=null&&E.length?h(I=>[...I,...n.turns]):n.text&&e!=="chat"&&h(I=>[...I,{id:C.createInkId("turn"),role:"assistant",content:n.text||"",timestamp:Date.now(),capability:e}]),n.diff&&m(n.diff),n.reviewSuggestions&&M(n.reviewSuggestions)}finally{p(!1)}},P=e=>{e.preventDefault();const d=g.trim();!d||l||(j(""),c("chat",void 0,d))};return t.jsxs("aside",{className:`Ink-Ai ${O}`.trim(),"data-placement":s.placement||"sidebar",style:{"--ink-ai-accent":(f=s.uiTheme)==null?void 0:f.accent,"--ink-ai-surface":(y=s.uiTheme)==null?void 0:y.surface,"--ink-ai-border":(S=s.uiTheme)==null?void 0:S.border},"aria-label":"Ink AI",children:[t.jsxs("div",{className:"Ink-Ai__header",children:[t.jsx("strong",{children:"Ink AI"}),x?t.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:x,title:"Close AI",children:"×"}):null]}),t.jsx("div",{className:"Ink-Ai__tabs",role:"tablist",children:["chat","actions","review","translate"].map(e=>t.jsx("button",{type:"button",role:"tab",className:`Ink-Editor__button${a===e?" Ink-Editor__button--active":""}`,"aria-selected":a===e,onClick:()=>H(e),children:e},e))}),t.jsxs("div",{className:"Ink-Ai__body",children:[a==="chat"?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"Ink-Ai__history",children:r.length===0?t.jsxs("p",{className:"Ink-Ai__empty",children:["Multi-turn chat with local demo provider. Bring your own LLM via"," ",t.jsx("code",{children:"inkAi.registerProvider"}),"."]}):r.map(e=>t.jsxs("div",{className:`Ink-Ai__turn Ink-Ai__turn--${e.role}`,children:[t.jsx("span",{children:e.role}),t.jsx("p",{children:e.content})]},e.id))}),t.jsxs("form",{className:"Ink-Ai__form",onSubmit:P,children:[t.jsx("input",{value:g,onChange:e=>j(e.target.value),placeholder:"Ask Ink AI…",disabled:l}),t.jsx("button",{type:"submit",className:"Ink-Editor__button Ink-Editor__button--active",disabled:l,children:"Send"})]})]}):null,a==="actions"?t.jsxs("div",{className:"Ink-Ai__actions",children:[t.jsx("p",{className:"Ink-Ai__hint",children:"Quick actions use the current selection (or full document)."}),k.INK_QUICK_ACTIONS.map(e=>t.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Ai__action",disabled:l,onClick:()=>void c(e.capability),children:e.label},e.id))]}):null,a==="review"?t.jsxs("div",{className:"Ink-Ai__review",children:[t.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Editor__button--active",disabled:l,onClick:()=>void c("review"),children:"Run grammar & style review"}),D.map(e=>t.jsxs("article",{className:`Ink-Ai__suggestion Ink-Ai__suggestion--${e.severity}`,children:[t.jsx("strong",{children:e.severity}),t.jsx("p",{children:e.message}),t.jsx("code",{children:e.suggestedText})]},e.id))]}):null,a==="translate"?t.jsxs("div",{className:"Ink-Ai__translate",children:[t.jsxs("label",{children:["Language",t.jsx("select",{value:A,onChange:e=>R(e.target.value),children:k.INK_TRANSLATE_LANGUAGES.map(e=>t.jsx("option",{value:e,children:e},e))})]}),t.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Editor__button--active",disabled:l,onClick:()=>void c("translate",{language:A}),children:"Translate"})]}):null,o?t.jsxs("div",{className:"Ink-Ai__diff",children:[t.jsx("strong",{children:"Suggested change"}),t.jsx("p",{children:o.summary}),t.jsx("div",{className:"Ink-Ai__diff-preview",dangerouslySetInnerHTML:{__html:o.suggestedHtml}}),t.jsxs("div",{className:"Ink-Ai__diff-actions",children:[t.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Editor__button--active",onClick:()=>{L(o.suggestedHtml),m(null)},children:"Apply"}),t.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:()=>m(null),children:"Dismiss"})]})]}):null]}),t.jsx("footer",{className:"Ink-Ai__footer",children:"Demo provider · BYO LLM"})]})};exports.AiPanel=B;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),I=require("../../../../constants/generals.const.cjs"),o=require("../../../../constants/defaults.const.cjs"),P=require("../../../../constants/aiModels.const.cjs");require("../../../../constants/openai.const.cjs");const w=require("../../../../utils/id.utils.cjs");require("../../../../utils/paste.utils.cjs");require("react-dom");const G=require("../../../../plugins/ai/aiPlugin.cjs"),U=L=>{var f,y,S,T;const{config:s,documentHtml:v,selectionHtml:b,onApplyHtml:H,onClose:N,onBusyChange:h}=L,[a,K]=i.useState("chat"),[x,g]=i.useState(""),[c,m]=i.useState([]),[l,q]=i.useState(!1),[d,A]=i.useState(null),[B,D]=i.useState([]),[j,R]=i.useState(o.INK_TRANSLATE_LANGUAGES[1]),M=s.providerId||P.INK_AI_DEMO_PROVIDER_ID,O=((f=s.uiTheme)==null?void 0:f.className)||s.className||"",p=t=>{q(t),h==null||h(t)},u=async(t,r,_)=>{var E;p(!0);try{const C=t==="chat"&&_?[...c,{id:w.createInkId("turn"),role:"user",content:_,timestamp:Date.now(),capability:t}]:c;t==="chat"&&_&&m(C);const n=await G.inkAi.runProvider(M,{capability:t,html:v,selectionHtml:b||void 0,prompt:_,history:C,options:r,modelId:s.modelId,documentSnapshot:{html:v,selectionHtml:b||void 0}});(E=n.turns)!=null&&E.length?m(k=>[...k,...n.turns]):n.text&&t!=="chat"&&m(k=>[...k,{id:w.createInkId("turn"),role:"assistant",content:n.text||"",timestamp:Date.now(),capability:t}]),n.diff&&A(n.diff),n.reviewSuggestions&&D(n.reviewSuggestions)}finally{p(!1)}},$=t=>{t.preventDefault();const r=x.trim();!r||l||(g(""),u("chat",void 0,r))};return e.jsxs("aside",{className:`Ink-Ai ${O}`.trim(),"data-placement":s.placement||"sidebar",style:{"--ink-ai-accent":(y=s.uiTheme)==null?void 0:y.accent,"--ink-ai-surface":(S=s.uiTheme)==null?void 0:S.surface,"--ink-ai-border":(T=s.uiTheme)==null?void 0:T.border},"aria-label":"Ink AI",children:[e.jsxs("div",{className:"Ink-Ai__header",children:[e.jsx("strong",{children:"Ink AI"}),N?e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:N,title:"Close AI",children:"×"}):null]}),e.jsx("div",{className:"Ink-Ai__tabs",role:"tablist",children:[["chat",I.INK_AI_TAB_CHAT],["actions",I.INK_AI_TAB_ACTIONS],["review",I.INK_AI_TAB_REVIEW],["translate",I.INK_AI_TAB_TRANSLATE]].map(([t,r])=>e.jsx("button",{type:"button",role:"tab",className:`${o.INK_CLASS_AI_TAB}${a===t?` ${o.INK_CLASS_AI_TAB_ON}`:""}`,"aria-selected":a===t,onClick:()=>K(t),children:r},t))}),e.jsxs("div",{className:"Ink-Ai__body",children:[a==="chat"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"Ink-Ai__history",children:c.length===0?e.jsxs("p",{className:"Ink-Ai__empty",children:["Multi-turn chat with local demo provider. Bring your own LLM via"," ",e.jsx("code",{children:"inkAi.registerProvider"}),"."]}):c.map(t=>e.jsxs("div",{className:`Ink-Ai__turn Ink-Ai__turn--${t.role}`,children:[e.jsx("span",{children:t.role}),e.jsx("p",{children:t.content})]},t.id))}),e.jsxs("form",{className:"Ink-Ai__form",onSubmit:$,children:[e.jsx("input",{value:x,onChange:t=>g(t.target.value),placeholder:"Ask Ink AI…",disabled:l}),e.jsx("button",{type:"submit",className:"Ink-Editor__button Ink-Editor__button--active",disabled:l,children:"Send"})]})]}):null,a==="actions"?e.jsxs("div",{className:"Ink-Ai__actions",children:[e.jsx("p",{className:"Ink-Ai__hint",children:"Quick actions use the current selection (or full document)."}),o.INK_QUICK_ACTIONS.map(t=>e.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Ai__action",disabled:l,onClick:()=>void u(t.capability),children:t.label},t.id))]}):null,a==="review"?e.jsxs("div",{className:"Ink-Ai__review",children:[e.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Editor__button--active",disabled:l,onClick:()=>void u("review"),children:"Run grammar & style review"}),B.map(t=>e.jsxs("article",{className:`Ink-Ai__suggestion Ink-Ai__suggestion--${t.severity}`,children:[e.jsx("strong",{children:t.severity}),e.jsx("p",{children:t.message}),e.jsx("code",{children:t.suggestedText})]},t.id))]}):null,a==="translate"?e.jsxs("div",{className:"Ink-Ai__translate",children:[e.jsxs("label",{children:["Language",e.jsx("select",{value:j,onChange:t=>R(t.target.value),children:o.INK_TRANSLATE_LANGUAGES.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Editor__button--active",disabled:l,onClick:()=>void u("translate",{language:j}),children:"Translate"})]}):null,d?e.jsxs("div",{className:"Ink-Ai__diff",children:[e.jsx("strong",{children:"Suggested change"}),e.jsx("p",{children:d.summary}),e.jsx("div",{className:"Ink-Ai__diff-preview",dangerouslySetInnerHTML:{__html:d.suggestedHtml}}),e.jsxs("div",{className:"Ink-Ai__diff-actions",children:[e.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Editor__button--active",onClick:()=>{H(d.suggestedHtml),A(null)},children:"Apply"}),e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:()=>A(null),children:"Dismiss"})]})]}):null]}),e.jsx("footer",{className:"Ink-Ai__footer",children:"Demo provider · BYO LLM"})]})};exports.AiPanel=U;
@@ -1 +1 @@
1
- {"version":3,"file":"AiPanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiPanel/AiPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAM1D,OAAO,KAAK,EAEV,WAAW,EAGZ,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,WAAW,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAID,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAkOpC,CAAC"}
1
+ {"version":3,"file":"AiPanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiPanel/AiPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAY1D,OAAO,KAAK,EAEV,WAAW,EAGZ,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,WAAW,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAID,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAyOpC,CAAC"}
@@ -1,45 +1,46 @@
1
1
  import { jsxs as n, jsx as t, Fragment as P } from "react/jsx-runtime";
2
2
  import { useState as l } from "react";
3
- import { INK_TRANSLATE_LANGUAGES as H, INK_QUICK_ACTIONS as Q } from "../../../../constants/defaults.const.js";
4
- import { INK_AI_DEMO_PROVIDER_ID as U } from "../../../../constants/aiModels.const.js";
3
+ import { INK_AI_TAB_CHAT as Q, INK_AI_TAB_ACTIONS as U, INK_AI_TAB_REVIEW as V, INK_AI_TAB_TRANSLATE as F } from "../../../../constants/generals.const.js";
4
+ import { INK_TRANSLATE_LANGUAGES as L, INK_CLASS_AI_TAB as W, INK_CLASS_AI_TAB_ON as Y, INK_QUICK_ACTIONS as q } from "../../../../constants/defaults.const.js";
5
+ import { INK_AI_DEMO_PROVIDER_ID as z } from "../../../../constants/aiModels.const.js";
5
6
  import "../../../../constants/openai.const.js";
6
- import { createInkId as D } from "../../../../utils/id.utils.js";
7
+ import { createInkId as H } from "../../../../utils/id.utils.js";
7
8
  import "../../../../utils/paste.utils.js";
8
9
  import "react-dom";
9
- import { inkAi as F } from "../../../../plugins/ai/aiPlugin.js";
10
- const te = (L) => {
11
- var y, E, w, C;
12
- const { config: i, documentHtml: p, selectionHtml: v, onApplyHtml: x, onClose: b, onBusyChange: _ } = L, [o, M] = l("chat"), [f, g] = l(""), [r, h] = l([]), [a, R] = l(!1), [c, I] = l(null), [K, O] = l([]), [A, $] = l(H[1]), B = i.providerId || U, j = ((y = i.uiTheme) == null ? void 0 : y.className) || i.className || "", N = (e) => {
13
- R(e), _ == null || _(e);
14
- }, d = async (e, u, m) => {
10
+ import { inkAi as J } from "../../../../plugins/ai/aiPlugin.js";
11
+ const re = (K) => {
12
+ var y, T, C, E;
13
+ const { config: i, documentHtml: k, selectionHtml: p, onApplyHtml: B, onClose: v, onBusyChange: m } = K, [o, D] = l("chat"), [b, N] = l(""), [c, h] = l([]), [a, x] = l(!1), [d, I] = l(null), [R, O] = l([]), [f, $] = l(L[1]), M = i.providerId || z, j = ((y = i.uiTheme) == null ? void 0 : y.className) || i.className || "", g = (e) => {
14
+ x(e), m == null || m(e);
15
+ }, _ = async (e, r, u) => {
15
16
  var S;
16
- N(!0);
17
+ g(!0);
17
18
  try {
18
- const T = e === "chat" && m ? [
19
- ...r,
19
+ const w = e === "chat" && u ? [
20
+ ...c,
20
21
  {
21
- id: D("turn"),
22
+ id: H("turn"),
22
23
  role: "user",
23
- content: m,
24
+ content: u,
24
25
  timestamp: Date.now(),
25
26
  capability: e
26
27
  }
27
- ] : r;
28
- e === "chat" && m && h(T);
29
- const s = await F.runProvider(B, {
28
+ ] : c;
29
+ e === "chat" && u && h(w);
30
+ const s = await J.runProvider(M, {
30
31
  capability: e,
31
- html: p,
32
- selectionHtml: v || void 0,
33
- prompt: m,
34
- history: T,
35
- options: u,
32
+ html: k,
33
+ selectionHtml: p || void 0,
34
+ prompt: u,
35
+ history: w,
36
+ options: r,
36
37
  modelId: i.modelId,
37
- documentSnapshot: { html: p, selectionHtml: v || void 0 }
38
+ documentSnapshot: { html: k, selectionHtml: p || void 0 }
38
39
  });
39
- (S = s.turns) != null && S.length ? h((k) => [...k, ...s.turns]) : s.text && e !== "chat" && h((k) => [
40
- ...k,
40
+ (S = s.turns) != null && S.length ? h((A) => [...A, ...s.turns]) : s.text && e !== "chat" && h((A) => [
41
+ ...A,
41
42
  {
42
- id: D("turn"),
43
+ id: H("turn"),
43
44
  role: "assistant",
44
45
  content: s.text || "",
45
46
  timestamp: Date.now(),
@@ -47,12 +48,12 @@ const te = (L) => {
47
48
  }
48
49
  ]), s.diff && I(s.diff), s.reviewSuggestions && O(s.reviewSuggestions);
49
50
  } finally {
50
- N(!1);
51
+ g(!1);
51
52
  }
52
53
  }, G = (e) => {
53
54
  e.preventDefault();
54
- const u = f.trim();
55
- !u || a || (g(""), d("chat", void 0, u));
55
+ const r = b.trim();
56
+ !r || a || (N(""), _("chat", void 0, r));
56
57
  };
57
58
  return /* @__PURE__ */ n(
58
59
  "aside",
@@ -60,36 +61,41 @@ const te = (L) => {
60
61
  className: `Ink-Ai ${j}`.trim(),
61
62
  "data-placement": i.placement || "sidebar",
62
63
  style: {
63
- "--ink-ai-accent": (E = i.uiTheme) == null ? void 0 : E.accent,
64
- "--ink-ai-surface": (w = i.uiTheme) == null ? void 0 : w.surface,
65
- "--ink-ai-border": (C = i.uiTheme) == null ? void 0 : C.border
64
+ "--ink-ai-accent": (T = i.uiTheme) == null ? void 0 : T.accent,
65
+ "--ink-ai-surface": (C = i.uiTheme) == null ? void 0 : C.surface,
66
+ "--ink-ai-border": (E = i.uiTheme) == null ? void 0 : E.border
66
67
  },
67
68
  "aria-label": "Ink AI",
68
69
  children: [
69
70
  /* @__PURE__ */ n("div", { className: "Ink-Ai__header", children: [
70
71
  /* @__PURE__ */ t("strong", { children: "Ink AI" }),
71
- b ? /* @__PURE__ */ t("button", { type: "button", className: "Ink-Editor__button", onClick: b, title: "Close AI", children: "×" }) : null
72
+ v ? /* @__PURE__ */ t("button", { type: "button", className: "Ink-Editor__button", onClick: v, title: "Close AI", children: "×" }) : null
72
73
  ] }),
73
- /* @__PURE__ */ t("div", { className: "Ink-Ai__tabs", role: "tablist", children: ["chat", "actions", "review", "translate"].map((e) => /* @__PURE__ */ t(
74
+ /* @__PURE__ */ t("div", { className: "Ink-Ai__tabs", role: "tablist", children: [
75
+ ["chat", Q],
76
+ ["actions", U],
77
+ ["review", V],
78
+ ["translate", F]
79
+ ].map(([e, r]) => /* @__PURE__ */ t(
74
80
  "button",
75
81
  {
76
82
  type: "button",
77
83
  role: "tab",
78
- className: `Ink-Editor__button${o === e ? " Ink-Editor__button--active" : ""}`,
84
+ className: `${W}${o === e ? ` ${Y}` : ""}`,
79
85
  "aria-selected": o === e,
80
- onClick: () => M(e),
81
- children: e
86
+ onClick: () => D(e),
87
+ children: r
82
88
  },
83
89
  e
84
90
  )) }),
85
91
  /* @__PURE__ */ n("div", { className: "Ink-Ai__body", children: [
86
92
  o === "chat" ? /* @__PURE__ */ n(P, { children: [
87
- /* @__PURE__ */ t("div", { className: "Ink-Ai__history", children: r.length === 0 ? /* @__PURE__ */ n("p", { className: "Ink-Ai__empty", children: [
93
+ /* @__PURE__ */ t("div", { className: "Ink-Ai__history", children: c.length === 0 ? /* @__PURE__ */ n("p", { className: "Ink-Ai__empty", children: [
88
94
  "Multi-turn chat with local demo provider. Bring your own LLM via",
89
95
  " ",
90
96
  /* @__PURE__ */ t("code", { children: "inkAi.registerProvider" }),
91
97
  "."
92
- ] }) : r.map((e) => /* @__PURE__ */ n("div", { className: `Ink-Ai__turn Ink-Ai__turn--${e.role}`, children: [
98
+ ] }) : c.map((e) => /* @__PURE__ */ n("div", { className: `Ink-Ai__turn Ink-Ai__turn--${e.role}`, children: [
93
99
  /* @__PURE__ */ t("span", { children: e.role }),
94
100
  /* @__PURE__ */ t("p", { children: e.content })
95
101
  ] }, e.id)) }),
@@ -97,8 +103,8 @@ const te = (L) => {
97
103
  /* @__PURE__ */ t(
98
104
  "input",
99
105
  {
100
- value: f,
101
- onChange: (e) => g(e.target.value),
106
+ value: b,
107
+ onChange: (e) => N(e.target.value),
102
108
  placeholder: "Ask Ink AI…",
103
109
  disabled: a
104
110
  }
@@ -108,13 +114,13 @@ const te = (L) => {
108
114
  ] }) : null,
109
115
  o === "actions" ? /* @__PURE__ */ n("div", { className: "Ink-Ai__actions", children: [
110
116
  /* @__PURE__ */ t("p", { className: "Ink-Ai__hint", children: "Quick actions use the current selection (or full document)." }),
111
- Q.map((e) => /* @__PURE__ */ t(
117
+ q.map((e) => /* @__PURE__ */ t(
112
118
  "button",
113
119
  {
114
120
  type: "button",
115
121
  className: "Ink-Editor__button Ink-Ai__action",
116
122
  disabled: a,
117
- onClick: () => void d(e.capability),
123
+ onClick: () => void _(e.capability),
118
124
  children: e.label
119
125
  },
120
126
  e.id
@@ -127,11 +133,11 @@ const te = (L) => {
127
133
  type: "button",
128
134
  className: "Ink-Editor__button Ink-Editor__button--active",
129
135
  disabled: a,
130
- onClick: () => void d("review"),
136
+ onClick: () => void _("review"),
131
137
  children: "Run grammar & style review"
132
138
  }
133
139
  ),
134
- K.map((e) => /* @__PURE__ */ n("article", { className: `Ink-Ai__suggestion Ink-Ai__suggestion--${e.severity}`, children: [
140
+ R.map((e) => /* @__PURE__ */ n("article", { className: `Ink-Ai__suggestion Ink-Ai__suggestion--${e.severity}`, children: [
135
141
  /* @__PURE__ */ t("strong", { children: e.severity }),
136
142
  /* @__PURE__ */ t("p", { children: e.message }),
137
143
  /* @__PURE__ */ t("code", { children: e.suggestedText })
@@ -140,7 +146,7 @@ const te = (L) => {
140
146
  o === "translate" ? /* @__PURE__ */ n("div", { className: "Ink-Ai__translate", children: [
141
147
  /* @__PURE__ */ n("label", { children: [
142
148
  "Language",
143
- /* @__PURE__ */ t("select", { value: A, onChange: (e) => $(e.target.value), children: H.map((e) => /* @__PURE__ */ t("option", { value: e, children: e }, e)) })
149
+ /* @__PURE__ */ t("select", { value: f, onChange: (e) => $(e.target.value), children: L.map((e) => /* @__PURE__ */ t("option", { value: e, children: e }, e)) })
144
150
  ] }),
145
151
  /* @__PURE__ */ t(
146
152
  "button",
@@ -148,15 +154,15 @@ const te = (L) => {
148
154
  type: "button",
149
155
  className: "Ink-Editor__button Ink-Editor__button--active",
150
156
  disabled: a,
151
- onClick: () => void d("translate", { language: A }),
157
+ onClick: () => void _("translate", { language: f }),
152
158
  children: "Translate"
153
159
  }
154
160
  )
155
161
  ] }) : null,
156
- c ? /* @__PURE__ */ n("div", { className: "Ink-Ai__diff", children: [
162
+ d ? /* @__PURE__ */ n("div", { className: "Ink-Ai__diff", children: [
157
163
  /* @__PURE__ */ t("strong", { children: "Suggested change" }),
158
- /* @__PURE__ */ t("p", { children: c.summary }),
159
- /* @__PURE__ */ t("div", { className: "Ink-Ai__diff-preview", dangerouslySetInnerHTML: { __html: c.suggestedHtml } }),
164
+ /* @__PURE__ */ t("p", { children: d.summary }),
165
+ /* @__PURE__ */ t("div", { className: "Ink-Ai__diff-preview", dangerouslySetInnerHTML: { __html: d.suggestedHtml } }),
160
166
  /* @__PURE__ */ n("div", { className: "Ink-Ai__diff-actions", children: [
161
167
  /* @__PURE__ */ t(
162
168
  "button",
@@ -164,7 +170,7 @@ const te = (L) => {
164
170
  type: "button",
165
171
  className: "Ink-Editor__button Ink-Editor__button--active",
166
172
  onClick: () => {
167
- x(c.suggestedHtml), I(null);
173
+ B(d.suggestedHtml), I(null);
168
174
  },
169
175
  children: "Apply"
170
176
  }
@@ -179,5 +185,5 @@ const te = (L) => {
179
185
  );
180
186
  };
181
187
  export {
182
- te as AiPanel
188
+ re as AiPanel
183
189
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),E=require("react"),B=require("react-dom"),s=require("../../../../constants/numbers.cjs"),c=require("../../../../constants/generals.const.cjs"),P=require("../../../../constants/colorMode.const.cjs"),G=require("../../../../constants/keyboard.const.cjs"),o=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const u=require("../../../../plugins/excel/excel.utils.cjs"),V=require("../ToolbarDropdown/ToolbarDropdown.utils.cjs"),k=require("../ToolbarButton/ToolbarButton.cjs"),F=X=>{var b;const{icon:D,disabled:O=!1,hint:w,onHint:g,pluginColor:I,onInsert:j}=X,[M,R]=E.useState(!1),[r,i]=E.useState(u.createEmptyExcelGrid),[S,d]=E.useState(null),[m,N]=E.useState(null),[T,y]=E.useState({top:s.NUMBER_ZERO,left:s.NUMBER_ZERO}),A=E.useRef(null),K=E.useRef(null),p=E.useRef(null),h=E.useRef(null),v=((b=r[s.NUMBER_ZERO])==null?void 0:b.length)??s.NUMBER_ONE,$=r.length<s.INK_EXCEL_SHEET_MAX_ROWS,x=v<s.INK_EXCEL_SHEET_MAX_COLS,H=r.length>s.NUMBER_ONE,U=v>s.NUMBER_ONE;E.useEffect(()=>{if(!M)return;const e=()=>{var L;const l=(L=p.current)==null?void 0:L.getBoundingClientRect().height,C=V.getToolbarDropdownMenuPosition(K.current,l&&l>s.NUMBER_ZERO?l:s.INK_EXCEL_MENU_ESTIMATED_HEIGHT_PX);y({top:C.top,left:C.left})};e();const t=window.requestAnimationFrame(e),_=l=>{var L,f;const C=l.target;(L=A.current)!=null&&L.contains(C)||(f=p.current)!=null&&f.contains(C)||R(!1)},a=l=>{l.key===G.KEY_ESCAPE&&R(!1)};return document.addEventListener("mousedown",_),document.addEventListener("keydown",a),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.cancelAnimationFrame(t),document.removeEventListener("mousedown",_),document.removeEventListener("keydown",a),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[M,r.length,v]);const q=e=>{var a;const t=(a=e.target.files)==null?void 0:a[s.NUMBER_ZERO];if(!t)return;const _=new FileReader;_.onload=()=>{i(u.parseCsvText(String(_.result)))},_.readAsText(t)};return n.jsxs("div",{className:o.INK_CLASS_STYLE_DD,ref:A,children:[n.jsx("div",{ref:K,children:n.jsx(k.ToolbarButton,{icon:D,title:c.INK_EXCEL_TITLE,hint:w,onHint:g,pluginColor:I,disabled:O,onClick:()=>{O||(i(u.createEmptyExcelGrid()),R(e=>!e))}})}),M?B.createPortal(n.jsxs("div",{ref:p,className:`${o.INK_CLASS_STYLE_MENU} ${o.INK_CLASS_STYLE_MENU_PORTAL} ${o.INK_CLASS_STYLE_MENU_FORCED} ${o.INK_CLASS_EXCEL_PANEL}`,"data-color-mode":P.COLOR_MODE_LIGHT,role:"dialog","aria-label":c.INK_EXCEL_TITLE,style:{top:T.top,left:T.left},children:[n.jsx("div",{className:o.INK_CLASS_EXCEL_TITLE,children:c.INK_EXCEL_TITLE}),n.jsxs("div",{className:o.INK_CLASS_EXCEL_GRID,style:{gridTemplateColumns:`2rem repeat(${v}, minmax(0, 1fr))`},onMouseLeave:()=>{d(null),N(null)},children:[n.jsx("span",{className:o.INK_CLASS_EXCEL_CORNER}),(r[s.NUMBER_ZERO]??[]).map((e,t)=>{const _=S!==null&&t<=S;return n.jsx("span",{className:`${o.INK_CLASS_EXCEL_HEAD}${_?` ${o.INK_CLASS_EXCEL_COL_HOVER}`:""}`,onMouseEnter:()=>d(t),onMouseMove:()=>d(t),children:o.EXCEL_COL_LETTERS[t]??t+s.NUMBER_ONE},`h-${t}`)}),r.map((e,t)=>{const _=m!==null&&t<=m;return n.jsxs(E.Fragment,{children:[n.jsx("span",{className:`${o.INK_CLASS_EXCEL_HEAD}${_?` ${o.INK_CLASS_EXCEL_ROW_HOVER}`:""}`,onMouseEnter:()=>N(t),onMouseMove:()=>N(t),children:t+s.NUMBER_ONE}),e.map((a,l)=>{const C=S!==null&&l<=S,L=m!==null&&t<=m;return n.jsx("input",{className:`${o.INK_CLASS_EXCEL_CELL}${C?` ${o.INK_CLASS_EXCEL_COL_HOVER}`:""}${L?` ${o.INK_CLASS_EXCEL_ROW_HOVER}`:""}`,value:a,onMouseEnter:()=>{d(l),N(t)},onMouseMove:()=>{d(l),N(t)},onChange:f=>i(u.setExcelCell(r,t,l,f.target.value))},`${t}-${l}`)})]},`row-${t}`)})]}),n.jsxs("div",{className:o.INK_CLASS_EXCEL_ACTIONS,children:[n.jsx("button",{type:"button",disabled:!$,onMouseDown:e=>{e.preventDefault(),i(u.addExcelRow(r))},children:c.INK_EXCEL_ADD_ROW}),n.jsx("button",{type:"button",disabled:!x,onMouseDown:e=>{e.preventDefault(),i(u.addExcelCol(r))},children:c.INK_EXCEL_ADD_COL}),n.jsx("button",{type:"button",disabled:!H,onMouseDown:e=>{e.preventDefault(),i(u.removeExcelRow(r))},children:c.INK_EXCEL_REMOVE_ROW}),n.jsx("button",{type:"button",disabled:!U,onMouseDown:e=>{e.preventDefault(),i(u.removeExcelCol(r))},children:c.INK_EXCEL_REMOVE_COL}),n.jsx("button",{type:"button",onMouseDown:e=>{e.preventDefault(),i(u.clearExcelGrid(r))},children:c.INK_EXCEL_CLEAR}),n.jsx("button",{type:"button",onMouseDown:e=>{var t;e.preventDefault(),(t=h.current)==null||t.click()},children:c.INK_EXCEL_IMPORT}),n.jsx("button",{type:"button",className:o.INK_CLASS_EXCEL_INSERT,onMouseDown:e=>{e.preventDefault(),j(u.excelGridToTableHtml(r)),R(!1)},children:c.INK_EXCEL_INSERT})]}),n.jsx("input",{ref:h,type:"file",accept:u.CSV_ACCEPT,hidden:!0,onChange:q})]}),document.body):null]})};exports.ExcelSheetPanel=F;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { ExcelSheetPanelProps } from './ExcelSheetPanel.types';
3
+ export declare const ExcelSheetPanel: FC<ExcelSheetPanelProps>;
4
+ //# sourceMappingURL=ExcelSheetPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExcelSheetPanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2D,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAgDzF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEpE,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAmOpD,CAAC"}
@@ -0,0 +1,223 @@
1
+ import { jsxs as m, jsx as n } from "react/jsx-runtime";
2
+ import { useState as C, useRef as v, useEffect as j, Fragment as z } from "react";
3
+ import { createPortal as q } from "react-dom";
4
+ import { NUMBER_ZERO as c, NUMBER_ONE as d, INK_EXCEL_SHEET_MAX_ROWS as Z, INK_EXCEL_SHEET_MAX_COLS as J, INK_EXCEL_MENU_ESTIMATED_HEIGHT_PX as Q } from "../../../../constants/numbers.js";
5
+ import { INK_EXCEL_TITLE as A, INK_EXCEL_ADD_ROW as x, INK_EXCEL_ADD_COL as ee, INK_EXCEL_REMOVE_ROW as te, INK_EXCEL_REMOVE_COL as ne, INK_EXCEL_CLEAR as oe, INK_EXCEL_IMPORT as re, INK_EXCEL_INSERT as le } from "../../../../constants/generals.const.js";
6
+ import { COLOR_MODE_LIGHT as se } from "../../../../constants/colorMode.const.js";
7
+ import { KEY_ESCAPE as ie } from "../../../../constants/keyboard.const.js";
8
+ import { INK_CLASS_STYLE_DD as Ee, INK_CLASS_STYLE_MENU as ae, INK_CLASS_STYLE_MENU_PORTAL as ce, INK_CLASS_STYLE_MENU_FORCED as ue, INK_CLASS_EXCEL_PANEL as _e, INK_CLASS_EXCEL_TITLE as me, INK_CLASS_EXCEL_GRID as Ce, INK_CLASS_EXCEL_CORNER as de, EXCEL_COL_LETTERS as Le, INK_CLASS_EXCEL_HEAD as b, INK_CLASS_EXCEL_COL_HOVER as O, INK_CLASS_EXCEL_ROW_HOVER as g, INK_CLASS_EXCEL_CELL as pe, INK_CLASS_EXCEL_ACTIONS as fe, INK_CLASS_EXCEL_INSERT as Ne } from "../../../../constants/defaults.const.js";
9
+ import "../../../../constants/openai.const.js";
10
+ import "../../../../utils/paste.utils.js";
11
+ import { createEmptyExcelGrid as $, setExcelCell as Se, addExcelRow as ve, addExcelCol as Re, removeExcelRow as Me, removeExcelCol as Ae, clearExcelGrid as he, excelGridToTableHtml as Te, CSV_ACCEPT as Ke, parseCsvText as De } from "../../../../plugins/excel/excel.utils.js";
12
+ import { getToolbarDropdownMenuPosition as we } from "../ToolbarDropdown/ToolbarDropdown.utils.js";
13
+ import { ToolbarButton as Xe } from "../ToolbarButton/ToolbarButton.js";
14
+ const Ye = (I) => {
15
+ var X;
16
+ const { icon: y, disabled: h = !1, hint: H, onHint: P, pluginColor: G, onInsert: F } = I, [R, L] = C(!1), [o, s] = C($), [p, u] = C(null), [f, _] = C(null), [T, U] = C({ top: c, left: c }), K = v(null), D = v(null), M = v(null), w = v(null), N = ((X = o[c]) == null ? void 0 : X.length) ?? d, k = o.length < Z, V = N < J, Y = o.length > d, B = N > d;
17
+ j(() => {
18
+ if (!R) return;
19
+ const e = () => {
20
+ var a;
21
+ const r = (a = M.current) == null ? void 0 : a.getBoundingClientRect().height, E = we(
22
+ D.current,
23
+ r && r > c ? r : Q
24
+ );
25
+ U({ top: E.top, left: E.left });
26
+ };
27
+ e();
28
+ const t = window.requestAnimationFrame(e), l = (r) => {
29
+ var a, S;
30
+ const E = r.target;
31
+ (a = K.current) != null && a.contains(E) || (S = M.current) != null && S.contains(E) || L(!1);
32
+ }, i = (r) => {
33
+ r.key === ie && L(!1);
34
+ };
35
+ return document.addEventListener("mousedown", l), document.addEventListener("keydown", i), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
36
+ window.cancelAnimationFrame(t), document.removeEventListener("mousedown", l), document.removeEventListener("keydown", i), window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
37
+ };
38
+ }, [R, o.length, N]);
39
+ const W = (e) => {
40
+ var i;
41
+ const t = (i = e.target.files) == null ? void 0 : i[c];
42
+ if (!t) return;
43
+ const l = new FileReader();
44
+ l.onload = () => {
45
+ s(De(String(l.result)));
46
+ }, l.readAsText(t);
47
+ };
48
+ return /* @__PURE__ */ m("div", { className: Ee, ref: K, children: [
49
+ /* @__PURE__ */ n("div", { ref: D, children: /* @__PURE__ */ n(
50
+ Xe,
51
+ {
52
+ icon: y,
53
+ title: A,
54
+ hint: H,
55
+ onHint: P,
56
+ pluginColor: G,
57
+ disabled: h,
58
+ onClick: () => {
59
+ h || (s($()), L((e) => !e));
60
+ }
61
+ }
62
+ ) }),
63
+ R ? q(
64
+ /* @__PURE__ */ m(
65
+ "div",
66
+ {
67
+ ref: M,
68
+ className: `${ae} ${ce} ${ue} ${_e}`,
69
+ "data-color-mode": se,
70
+ role: "dialog",
71
+ "aria-label": A,
72
+ style: { top: T.top, left: T.left },
73
+ children: [
74
+ /* @__PURE__ */ n("div", { className: me, children: A }),
75
+ /* @__PURE__ */ m(
76
+ "div",
77
+ {
78
+ className: Ce,
79
+ style: {
80
+ gridTemplateColumns: `2rem repeat(${N}, minmax(0, 1fr))`
81
+ },
82
+ onMouseLeave: () => {
83
+ u(null), _(null);
84
+ },
85
+ children: [
86
+ /* @__PURE__ */ n("span", { className: de }),
87
+ (o[c] ?? []).map((e, t) => {
88
+ const l = p !== null && t <= p;
89
+ return /* @__PURE__ */ n(
90
+ "span",
91
+ {
92
+ className: `${b}${l ? ` ${O}` : ""}`,
93
+ onMouseEnter: () => u(t),
94
+ onMouseMove: () => u(t),
95
+ children: Le[t] ?? t + d
96
+ },
97
+ `h-${t}`
98
+ );
99
+ }),
100
+ o.map((e, t) => {
101
+ const l = f !== null && t <= f;
102
+ return /* @__PURE__ */ m(z, { children: [
103
+ /* @__PURE__ */ n(
104
+ "span",
105
+ {
106
+ className: `${b}${l ? ` ${g}` : ""}`,
107
+ onMouseEnter: () => _(t),
108
+ onMouseMove: () => _(t),
109
+ children: t + d
110
+ }
111
+ ),
112
+ e.map((i, r) => {
113
+ const E = p !== null && r <= p, a = f !== null && t <= f;
114
+ return /* @__PURE__ */ n(
115
+ "input",
116
+ {
117
+ className: `${pe}${E ? ` ${O}` : ""}${a ? ` ${g}` : ""}`,
118
+ value: i,
119
+ onMouseEnter: () => {
120
+ u(r), _(t);
121
+ },
122
+ onMouseMove: () => {
123
+ u(r), _(t);
124
+ },
125
+ onChange: (S) => s(Se(o, t, r, S.target.value))
126
+ },
127
+ `${t}-${r}`
128
+ );
129
+ })
130
+ ] }, `row-${t}`);
131
+ })
132
+ ]
133
+ }
134
+ ),
135
+ /* @__PURE__ */ m("div", { className: fe, children: [
136
+ /* @__PURE__ */ n(
137
+ "button",
138
+ {
139
+ type: "button",
140
+ disabled: !k,
141
+ onMouseDown: (e) => {
142
+ e.preventDefault(), s(ve(o));
143
+ },
144
+ children: x
145
+ }
146
+ ),
147
+ /* @__PURE__ */ n(
148
+ "button",
149
+ {
150
+ type: "button",
151
+ disabled: !V,
152
+ onMouseDown: (e) => {
153
+ e.preventDefault(), s(Re(o));
154
+ },
155
+ children: ee
156
+ }
157
+ ),
158
+ /* @__PURE__ */ n(
159
+ "button",
160
+ {
161
+ type: "button",
162
+ disabled: !Y,
163
+ onMouseDown: (e) => {
164
+ e.preventDefault(), s(Me(o));
165
+ },
166
+ children: te
167
+ }
168
+ ),
169
+ /* @__PURE__ */ n(
170
+ "button",
171
+ {
172
+ type: "button",
173
+ disabled: !B,
174
+ onMouseDown: (e) => {
175
+ e.preventDefault(), s(Ae(o));
176
+ },
177
+ children: ne
178
+ }
179
+ ),
180
+ /* @__PURE__ */ n(
181
+ "button",
182
+ {
183
+ type: "button",
184
+ onMouseDown: (e) => {
185
+ e.preventDefault(), s(he(o));
186
+ },
187
+ children: oe
188
+ }
189
+ ),
190
+ /* @__PURE__ */ n(
191
+ "button",
192
+ {
193
+ type: "button",
194
+ onMouseDown: (e) => {
195
+ var t;
196
+ e.preventDefault(), (t = w.current) == null || t.click();
197
+ },
198
+ children: re
199
+ }
200
+ ),
201
+ /* @__PURE__ */ n(
202
+ "button",
203
+ {
204
+ type: "button",
205
+ className: Ne,
206
+ onMouseDown: (e) => {
207
+ e.preventDefault(), F(Te(o)), L(!1);
208
+ },
209
+ children: le
210
+ }
211
+ )
212
+ ] }),
213
+ /* @__PURE__ */ n("input", { ref: w, type: "file", accept: Ke, hidden: !0, onChange: W })
214
+ ]
215
+ }
216
+ ),
217
+ document.body
218
+ ) : null
219
+ ] });
220
+ };
221
+ export {
222
+ Ye as ExcelSheetPanel
223
+ };
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ export type ExcelSheetPanelProps = {
3
+ icon: ReactNode;
4
+ disabled?: boolean;
5
+ hint?: string;
6
+ onHint?: (hint: string) => void;
7
+ pluginColor?: string;
8
+ onInsert: (html: string) => void;
9
+ };
10
+ //# sourceMappingURL=ExcelSheetPanel.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExcelSheetPanel.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { ExcelSheetPanel } from './ExcelSheetPanel';
2
+ export type { ExcelSheetPanelProps } from './ExcelSheetPanel.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ExcelSheetPanel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("react"),N=require("@forgedevstack/bear"),s=require("../../../../constants/numbers.cjs"),l=require("../../../../constants/generals.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("react-dom");const O=require("../../../../plugins/graph/graph.const.cjs"),C=()=>({label:"•",value:s.NUMBER_ONE}),G=j=>{const{open:p,mode:E,points:d,colors:n,onClose:R,onApply:P}=j,[m,_]=h.useState(d),[v,M]=h.useState(n.length>s.NUMBER_ZERO?n:[...O.GRAPH_COLORS]);h.useEffect(()=>{p&&(_(d),M(n.length>s.NUMBER_ZERO?n:[...O.GRAPH_COLORS]))},[p,d,n]);const b=E==="colors"?l.INK_GRAPH_COLORS_TITLE:l.INK_GRAPH_VALUES_TITLE;return e.jsx(N.Modal,{isOpen:p,onClose:R,title:b,size:"md",footer:e.jsxs(e.Fragment,{children:[e.jsx(N.Button,{variant:"outline",onClick:R,children:l.INK_GRAPH_CANCEL}),e.jsx(N.Button,{variant:"primary",onClick:()=>P(m,v),children:l.INK_GRAPH_APPLY})]}),children:E==="values"?e.jsxs("div",{className:"Ink-GraphModal",children:[m.map((r,a)=>e.jsxs("div",{className:"Ink-GraphModal__row",children:[e.jsx("input",{value:r.label,"aria-label":`Label ${a+s.NUMBER_ONE}`,onChange:o=>{const i=o.target.value;_(c=>c.map((t,u)=>u===a?{...t,label:i}:t))}}),e.jsx("input",{type:"number",value:r.value,"aria-label":`Value ${a+s.NUMBER_ONE}`,onChange:o=>{const i=Number(o.target.value)||s.NUMBER_ZERO;_(c=>c.map((t,u)=>u===a?{...t,value:i}:t))}})]},`${r.label}-${a}`)),e.jsx(N.Button,{variant:"outline",size:"sm",onClick:()=>_(r=>[...r,C()]),children:l.INK_GRAPH_ADD_POINT})]}):e.jsx("div",{className:"Ink-GraphModal",children:v.map((r,a)=>e.jsxs("label",{className:"Ink-GraphModal__row",children:[e.jsx("span",{children:a+s.NUMBER_ONE}),e.jsx("input",{type:"color",value:r,onChange:o=>{const i=o.target.value||l.EMPTY_STRING;M(c=>c.map((t,u)=>u===a?i:t))}})]},`${r}-${a}`))})})};exports.GraphEditModal=G;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { GraphEditModalProps } from './GraphEditModal.types';
3
+ export declare const GraphEditModal: FC<GraphEditModalProps>;
4
+ //# sourceMappingURL=GraphEditModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphEditModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/GraphEditModal/GraphEditModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAcrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAIlE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CA4FlD,CAAC"}