@forgedevstack/ink 1.1.8 → 1.2.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 (306) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/dist/common-components/Box/Box.cjs +1 -1
  3. package/dist/common-components/Box/Box.js +7 -6
  4. package/dist/common-components/Button/Button.cjs +1 -1
  5. package/dist/common-components/Button/Button.js +9 -8
  6. package/dist/common-components/Canvas/Canvas.cjs +1 -1
  7. package/dist/common-components/Canvas/Canvas.js +3 -2
  8. package/dist/common-components/ContextMenu/ContextMenu.cjs +1 -1
  9. package/dist/common-components/ContextMenu/ContextMenu.js +3 -2
  10. package/dist/common-components/Field/Field.cjs +1 -1
  11. package/dist/common-components/Field/Field.js +11 -10
  12. package/dist/common-components/icons/GripIcon.cjs +1 -1
  13. package/dist/common-components/icons/GripIcon.js +3 -2
  14. package/dist/components/InkEditor/InkEditor.cjs +1 -1
  15. package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
  16. package/dist/components/InkEditor/InkEditor.js +1301 -1006
  17. package/dist/components/InkEditor/components/AiPanel/AiPanel.cjs +1 -1
  18. package/dist/components/InkEditor/components/AiPanel/AiPanel.js +13 -12
  19. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.cjs +1 -0
  20. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.cjs +1 -0
  21. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.d.ts +20 -0
  22. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.d.ts.map +1 -0
  23. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.js +25 -0
  24. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.d.ts +4 -0
  25. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.d.ts.map +1 -0
  26. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.js +61 -0
  27. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.types.d.ts +11 -0
  28. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.types.d.ts.map +1 -0
  29. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.cjs +1 -0
  30. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.d.ts +19 -0
  31. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.d.ts.map +1 -0
  32. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.js +30 -0
  33. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.test.d.ts +2 -0
  34. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.test.d.ts.map +1 -0
  35. package/dist/components/InkEditor/components/AiSelectionBubble/index.d.ts +4 -0
  36. package/dist/components/InkEditor/components/AiSelectionBubble/index.d.ts.map +1 -0
  37. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.cjs +1 -1
  38. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.js +7 -6
  39. package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.cjs +1 -1
  40. package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.d.ts +2 -0
  41. package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.d.ts.map +1 -1
  42. package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.js +16 -15
  43. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.cjs +1 -1
  44. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.js +14 -13
  45. package/dist/components/InkEditor/components/FindReplace/FindReplace.cjs +1 -1
  46. package/dist/components/InkEditor/components/FindReplace/FindReplace.js +21 -20
  47. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.cjs +1 -1
  48. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.js +17 -16
  49. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.cjs +1 -1
  50. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.js +3 -2
  51. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.cjs +1 -1
  52. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.js +7 -6
  53. package/dist/components/InkEditor/components/ImageFrame/ImageFrame.cjs +1 -0
  54. package/dist/components/InkEditor/components/ImageFrame/ImageFrame.d.ts +8 -0
  55. package/dist/components/InkEditor/components/ImageFrame/ImageFrame.d.ts.map +1 -0
  56. package/dist/components/InkEditor/components/ImageFrame/ImageFrame.js +54 -0
  57. package/dist/components/InkEditor/components/ImageFrame/index.d.ts +3 -0
  58. package/dist/components/InkEditor/components/ImageFrame/index.d.ts.map +1 -0
  59. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.cjs +1 -1
  60. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.js +11 -10
  61. package/dist/components/InkEditor/components/MentionMenu/MentionMenu.cjs +1 -0
  62. package/dist/components/InkEditor/components/MentionMenu/MentionMenu.d.ts +16 -0
  63. package/dist/components/InkEditor/components/MentionMenu/MentionMenu.d.ts.map +1 -0
  64. package/dist/components/InkEditor/components/MentionMenu/MentionMenu.js +21 -0
  65. package/dist/components/InkEditor/components/MentionMenu/index.d.ts +3 -0
  66. package/dist/components/InkEditor/components/MentionMenu/index.d.ts.map +1 -0
  67. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.cjs +1 -1
  68. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.js +11 -10
  69. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.cjs +1 -0
  70. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.cjs +1 -0
  71. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.d.ts +7 -0
  72. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.d.ts.map +1 -0
  73. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.js +9 -0
  74. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.d.ts +4 -0
  75. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.d.ts.map +1 -0
  76. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.js +83 -0
  77. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.types.d.ts +8 -0
  78. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.types.d.ts.map +1 -0
  79. package/dist/components/InkEditor/components/PresenceStack/index.d.ts +3 -0
  80. package/dist/components/InkEditor/components/PresenceStack/index.d.ts.map +1 -0
  81. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.cjs +1 -0
  82. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.cjs +1 -0
  83. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.d.ts +7 -0
  84. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.d.ts.map +1 -0
  85. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.js +10 -0
  86. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.d.ts +4 -0
  87. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.d.ts.map +1 -0
  88. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.js +66 -0
  89. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.types.d.ts +6 -0
  90. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.types.d.ts.map +1 -0
  91. package/dist/components/InkEditor/components/RemoteCursors/index.d.ts +3 -0
  92. package/dist/components/InkEditor/components/RemoteCursors/index.d.ts.map +1 -0
  93. package/dist/components/InkEditor/components/SignPad/SignPad.cjs +1 -1
  94. package/dist/components/InkEditor/components/SignPad/SignPad.js +7 -6
  95. package/dist/components/InkEditor/components/SlashMenu/SlashMenu.cjs +1 -1
  96. package/dist/components/InkEditor/components/SlashMenu/SlashMenu.js +7 -6
  97. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.cjs +1 -1
  98. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.cjs +1 -1
  99. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.js +8 -7
  100. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.js +7 -6
  101. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.cjs +1 -1
  102. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.js +7 -6
  103. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.cjs +1 -1
  104. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.js +3 -2
  105. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.cjs +1 -1
  106. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.js +13 -12
  107. package/dist/components/InkEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -1
  108. package/dist/components/InkEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +9 -8
  109. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.cjs +1 -1
  110. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.const.cjs +1 -1
  111. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.const.js +9 -8
  112. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.js +9 -8
  113. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
  114. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.js +19 -18
  115. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.cjs +1 -1
  116. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.js +6 -5
  117. package/dist/components/InkEditor/components/VersionHistory/VersionHistory.cjs +1 -0
  118. package/dist/components/InkEditor/components/VersionHistory/VersionHistory.d.ts +11 -0
  119. package/dist/components/InkEditor/components/VersionHistory/VersionHistory.d.ts.map +1 -0
  120. package/dist/components/InkEditor/components/VersionHistory/VersionHistory.js +22 -0
  121. package/dist/components/InkEditor/components/VersionHistory/index.d.ts +3 -0
  122. package/dist/components/InkEditor/components/VersionHistory/index.d.ts.map +1 -0
  123. package/dist/components/InkEditor/components/index.d.ts +11 -0
  124. package/dist/components/InkEditor/components/index.d.ts.map +1 -1
  125. package/dist/components/InkEditor/helpers/format.utils.cjs +3 -2
  126. package/dist/components/InkEditor/helpers/format.utils.d.ts +1 -0
  127. package/dist/components/InkEditor/helpers/format.utils.d.ts.map +1 -1
  128. package/dist/components/InkEditor/helpers/format.utils.js +106 -84
  129. package/dist/components/InkEditor/helpers/index.d.ts +1 -1
  130. package/dist/components/InkEditor/helpers/index.d.ts.map +1 -1
  131. package/dist/components/InkTabs/InkTabs.cjs +1 -0
  132. package/dist/components/InkTabs/InkTabs.d.ts +4 -0
  133. package/dist/components/InkTabs/InkTabs.d.ts.map +1 -0
  134. package/dist/components/InkTabs/InkTabs.js +104 -0
  135. package/dist/components/InkTabs/index.d.ts +2 -0
  136. package/dist/components/InkTabs/index.d.ts.map +1 -0
  137. package/dist/components/InkWorkspace/InkWorkspace.cjs +1 -0
  138. package/dist/components/InkWorkspace/InkWorkspace.d.ts +4 -0
  139. package/dist/components/InkWorkspace/InkWorkspace.d.ts.map +1 -0
  140. package/dist/components/InkWorkspace/InkWorkspace.js +309 -0
  141. package/dist/components/InkWorkspace/components/WorkspaceIcons.cjs +1 -0
  142. package/dist/components/InkWorkspace/components/WorkspaceIcons.d.ts +11 -0
  143. package/dist/components/InkWorkspace/components/WorkspaceIcons.d.ts.map +1 -0
  144. package/dist/components/InkWorkspace/components/WorkspaceIcons.js +39 -0
  145. package/dist/components/InkWorkspace/hooks/useInkWorkspace.cjs +1 -0
  146. package/dist/components/InkWorkspace/hooks/useInkWorkspace.d.ts +30 -0
  147. package/dist/components/InkWorkspace/hooks/useInkWorkspace.d.ts.map +1 -0
  148. package/dist/components/InkWorkspace/hooks/useInkWorkspace.js +73 -0
  149. package/dist/components/InkWorkspace/index.d.ts +4 -0
  150. package/dist/components/InkWorkspace/index.d.ts.map +1 -0
  151. package/dist/components/index.d.ts +2 -0
  152. package/dist/components/index.d.ts.map +1 -1
  153. package/dist/constants/collab.const.cjs +1 -0
  154. package/dist/constants/collab.const.d.ts +20 -0
  155. package/dist/constants/collab.const.d.ts.map +1 -0
  156. package/dist/constants/collab.const.js +54 -0
  157. package/dist/constants/contextMenu.const.cjs +1 -1
  158. package/dist/constants/contextMenu.const.d.ts +8 -0
  159. package/dist/constants/contextMenu.const.d.ts.map +1 -1
  160. package/dist/constants/contextMenu.const.js +30 -22
  161. package/dist/constants/defaultIcons.cjs +1 -1
  162. package/dist/constants/defaultIcons.js +6 -5
  163. package/dist/constants/defaults.const.cjs +1 -1
  164. package/dist/constants/defaults.const.d.ts.map +1 -1
  165. package/dist/constants/defaults.const.js +150 -138
  166. package/dist/constants/index.d.ts +2 -0
  167. package/dist/constants/index.d.ts.map +1 -1
  168. package/dist/constants/numbers.cjs +1 -1
  169. package/dist/constants/numbers.js +43 -37
  170. package/dist/constants/toolbar.const.cjs +1 -1
  171. package/dist/constants/toolbar.const.d.ts +7 -0
  172. package/dist/constants/toolbar.const.d.ts.map +1 -1
  173. package/dist/constants/toolbar.const.js +16 -9
  174. package/dist/constants/toolbarMenu.const.cjs +1 -1
  175. package/dist/constants/toolbarMenu.const.d.ts.map +1 -1
  176. package/dist/constants/toolbarMenu.const.js +25 -11
  177. package/dist/constants/workspace.const.cjs +1 -0
  178. package/dist/constants/workspace.const.d.ts +24 -0
  179. package/dist/constants/workspace.const.d.ts.map +1 -0
  180. package/dist/constants/workspace.const.js +23 -0
  181. package/dist/hooks/index.d.ts +2 -0
  182. package/dist/hooks/index.d.ts.map +1 -1
  183. package/dist/hooks/useInkCollaboration.cjs +1 -0
  184. package/dist/hooks/useInkCollaboration.d.ts +4 -0
  185. package/dist/hooks/useInkCollaboration.d.ts.map +1 -0
  186. package/dist/hooks/useInkCollaboration.js +87 -0
  187. package/dist/hooks/useToolbarOverflow.cjs +1 -1
  188. package/dist/hooks/useToolbarOverflow.js +12 -11
  189. package/dist/index.cjs +1 -1
  190. package/dist/index.d.ts +5 -3
  191. package/dist/index.d.ts.map +1 -1
  192. package/dist/index.js +151 -135
  193. package/dist/plugins/ai/demoProvider.cjs +1 -1
  194. package/dist/plugins/ai/demoProvider.js +3 -2
  195. package/dist/plugins/ai/index.cjs +1 -1
  196. package/dist/plugins/ai/index.js +25 -24
  197. package/dist/plugins/excel/excel.utils.cjs +1 -1
  198. package/dist/plugins/excel/excel.utils.js +17 -16
  199. package/dist/plugins/graph/graph.utils.cjs +1 -1
  200. package/dist/plugins/graph/graph.utils.js +7 -6
  201. package/dist/plugins/titles/titles.const.cjs +1 -1
  202. package/dist/plugins/titles/titles.const.js +9 -8
  203. package/dist/plugins/titles/titles.utils.cjs +1 -1
  204. package/dist/plugins/titles/titles.utils.js +3 -2
  205. package/dist/styles.css +1 -1
  206. package/dist/types/collab.types.d.ts +54 -0
  207. package/dist/types/collab.types.d.ts.map +1 -0
  208. package/dist/types/features.types.d.ts +1 -1
  209. package/dist/types/features.types.d.ts.map +1 -1
  210. package/dist/types/index.d.ts +2 -0
  211. package/dist/types/index.d.ts.map +1 -1
  212. package/dist/types/ink.types.d.ts +3 -1
  213. package/dist/types/ink.types.d.ts.map +1 -1
  214. package/dist/types/workspace.types.d.ts +54 -0
  215. package/dist/types/workspace.types.d.ts.map +1 -0
  216. package/dist/utils/blocks.utils.cjs +1 -1
  217. package/dist/utils/blocks.utils.js +19 -18
  218. package/dist/utils/collab.utils.cjs +1 -0
  219. package/dist/utils/collab.utils.d.ts +5 -0
  220. package/dist/utils/collab.utils.d.ts.map +1 -0
  221. package/dist/utils/collab.utils.js +33 -0
  222. package/dist/utils/collab.utils.test.d.ts +2 -0
  223. package/dist/utils/collab.utils.test.d.ts.map +1 -0
  224. package/dist/utils/comments.utils.cjs +1 -1
  225. package/dist/utils/comments.utils.d.ts +4 -0
  226. package/dist/utils/comments.utils.d.ts.map +1 -1
  227. package/dist/utils/comments.utils.js +26 -18
  228. package/dist/utils/comments.utils.test.d.ts +2 -0
  229. package/dist/utils/comments.utils.test.d.ts.map +1 -0
  230. package/dist/utils/exportDocument.utils.cjs +2 -0
  231. package/dist/utils/exportDocument.utils.d.ts +16 -0
  232. package/dist/utils/exportDocument.utils.d.ts.map +1 -0
  233. package/dist/utils/exportDocument.utils.js +85 -0
  234. package/dist/utils/exportDocument.utils.test.d.ts +2 -0
  235. package/dist/utils/exportDocument.utils.test.d.ts.map +1 -0
  236. package/dist/utils/formatPainter.utils.cjs +1 -0
  237. package/dist/utils/formatPainter.utils.d.ts +11 -0
  238. package/dist/utils/formatPainter.utils.d.ts.map +1 -0
  239. package/dist/utils/formatPainter.utils.js +20 -0
  240. package/dist/utils/formatPainter.utils.test.d.ts +2 -0
  241. package/dist/utils/formatPainter.utils.test.d.ts.map +1 -0
  242. package/dist/utils/history.utils.cjs +1 -1
  243. package/dist/utils/history.utils.js +3 -2
  244. package/dist/utils/image.utils.cjs +1 -0
  245. package/dist/utils/image.utils.d.ts +14 -0
  246. package/dist/utils/image.utils.d.ts.map +1 -0
  247. package/dist/utils/image.utils.js +33 -0
  248. package/dist/utils/image.utils.test.d.ts +2 -0
  249. package/dist/utils/image.utils.test.d.ts.map +1 -0
  250. package/dist/utils/index.d.ts +12 -3
  251. package/dist/utils/index.d.ts.map +1 -1
  252. package/dist/utils/ink.brand.test.d.ts +2 -0
  253. package/dist/utils/ink.brand.test.d.ts.map +1 -0
  254. package/dist/utils/license.utils.cjs +1 -1
  255. package/dist/utils/license.utils.js +8 -7
  256. package/dist/utils/markdown.utils.cjs +11 -0
  257. package/dist/utils/markdown.utils.d.ts +7 -0
  258. package/dist/utils/markdown.utils.d.ts.map +1 -0
  259. package/dist/utils/markdown.utils.js +87 -0
  260. package/dist/utils/markdown.utils.test.d.ts +2 -0
  261. package/dist/utils/markdown.utils.test.d.ts.map +1 -0
  262. package/dist/utils/mentions.utils.cjs +1 -0
  263. package/dist/utils/mentions.utils.d.ts +13 -0
  264. package/dist/utils/mentions.utils.d.ts.map +1 -0
  265. package/dist/utils/mentions.utils.js +23 -0
  266. package/dist/utils/mentions.utils.test.d.ts +2 -0
  267. package/dist/utils/mentions.utils.test.d.ts.map +1 -0
  268. package/dist/utils/outline.utils.cjs +1 -1
  269. package/dist/utils/outline.utils.js +9 -8
  270. package/dist/utils/paste.utils.cjs +1 -1
  271. package/dist/utils/paste.utils.d.ts +2 -0
  272. package/dist/utils/paste.utils.d.ts.map +1 -1
  273. package/dist/utils/paste.utils.js +53 -19
  274. package/dist/utils/paste.utils.test.d.ts +2 -0
  275. package/dist/utils/paste.utils.test.d.ts.map +1 -0
  276. package/dist/utils/premium.utils.cjs +1 -1
  277. package/dist/utils/premium.utils.js +12 -11
  278. package/dist/utils/selection.utils.cjs +1 -1
  279. package/dist/utils/selection.utils.js +3 -2
  280. package/dist/utils/slash.utils.cjs +1 -1
  281. package/dist/utils/slash.utils.js +10 -9
  282. package/dist/utils/table.utils.cjs +1 -1
  283. package/dist/utils/table.utils.d.ts +8 -0
  284. package/dist/utils/table.utils.d.ts.map +1 -1
  285. package/dist/utils/table.utils.js +78 -54
  286. package/dist/utils/toolbarStorage.utils.cjs +1 -1
  287. package/dist/utils/toolbarStorage.utils.js +15 -14
  288. package/dist/utils/trackChanges.utils.cjs +1 -1
  289. package/dist/utils/trackChanges.utils.js +9 -8
  290. package/dist/utils/typo.utils.cjs +1 -1
  291. package/dist/utils/typo.utils.js +8 -7
  292. package/dist/utils/versions.utils.cjs +1 -0
  293. package/dist/utils/versions.utils.d.ts +11 -0
  294. package/dist/utils/versions.utils.d.ts.map +1 -0
  295. package/dist/utils/versions.utils.js +36 -0
  296. package/dist/utils/versions.utils.test.d.ts +2 -0
  297. package/dist/utils/versions.utils.test.d.ts.map +1 -0
  298. package/dist/utils/words.utils.cjs +1 -1
  299. package/dist/utils/words.utils.js +3 -2
  300. package/dist/utils/workspace.utils.cjs +1 -0
  301. package/dist/utils/workspace.utils.d.ts +5 -0
  302. package/dist/utils/workspace.utils.d.ts.map +1 -0
  303. package/dist/utils/workspace.utils.js +26 -0
  304. package/dist/utils/workspace.utils.test.d.ts +2 -0
  305. package/dist/utils/workspace.utils.test.d.ts.map +1 -0
  306. package/package.json +1 -1
@@ -1 +1 @@
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
+ "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("../../../../utils/exportDocument.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:q,onClose:N,onBusyChange:h}=L,[a,H]=i.useState("chat"),[x,g]=i.useState(""),[c,m]=i.useState([]),[l,K]=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=>{K(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:()=>H(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:()=>{q(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;
@@ -6,36 +6,37 @@ import { INK_AI_DEMO_PROVIDER_ID as z } from "../../../../constants/aiModels.con
6
6
  import "../../../../constants/openai.const.js";
7
7
  import { createInkId as H } from "../../../../utils/id.utils.js";
8
8
  import "../../../../utils/paste.utils.js";
9
+ import "../../../../utils/exportDocument.utils.js";
9
10
  import "react-dom";
10
11
  import { inkAi as J } from "../../../../plugins/ai/aiPlugin.js";
11
- const re = (K) => {
12
+ const ce = (K) => {
12
13
  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) => {
14
+ const { config: i, documentHtml: p, selectionHtml: k, onApplyHtml: B, onClose: v, onBusyChange: u } = 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) => {
15
+ x(e), u == null || u(e);
16
+ }, _ = async (e, r, m) => {
16
17
  var S;
17
18
  g(!0);
18
19
  try {
19
- const w = e === "chat" && u ? [
20
+ const w = e === "chat" && m ? [
20
21
  ...c,
21
22
  {
22
23
  id: H("turn"),
23
24
  role: "user",
24
- content: u,
25
+ content: m,
25
26
  timestamp: Date.now(),
26
27
  capability: e
27
28
  }
28
29
  ] : c;
29
- e === "chat" && u && h(w);
30
+ e === "chat" && m && h(w);
30
31
  const s = await J.runProvider(M, {
31
32
  capability: e,
32
- html: k,
33
- selectionHtml: p || void 0,
34
- prompt: u,
33
+ html: p,
34
+ selectionHtml: k || void 0,
35
+ prompt: m,
35
36
  history: w,
36
37
  options: r,
37
38
  modelId: i.modelId,
38
- documentSnapshot: { html: k, selectionHtml: p || void 0 }
39
+ documentSnapshot: { html: p, selectionHtml: k || void 0 }
39
40
  });
40
41
  (S = s.turns) != null && S.length ? h((A) => [...A, ...s.turns]) : s.text && e !== "chat" && h((A) => [
41
42
  ...A,
@@ -185,5 +186,5 @@ const re = (K) => {
185
186
  );
186
187
  };
187
188
  export {
188
- re as AiPanel
189
+ ce as AiPanel
189
190
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),a=require("react-dom"),e=require("./AiSelectionBubble.const.cjs"),i=t=>{t.preventDefault(),t.stopPropagation()},u=t=>{const{open:s,top:r,left:A,busy:l,preview:_,onAction:S,onApply:c,onDismiss:I}=t;return!s||typeof document>"u"?null:a.createPortal(n.jsxs("div",{className:e.AI_SELECTION_BUBBLE_CLASS,style:{position:"fixed",top:r,left:A},role:"toolbar","aria-label":e.AI_SELECTION_BUBBLE_ARIA_LABEL,onPointerDown:o=>o.stopPropagation(),children:[e.AI_SELECTION_ACTIONS.map(o=>n.jsx("button",{type:"button",className:e.AI_SELECTION_ACTION_CLASS,disabled:l,onPointerDown:i,onClick:()=>S(o.id),children:o.label},o.id)),l?n.jsx("span",{className:"Ink-AiSelection__status",children:e.AI_SELECTION_BUSY_LABEL}):null,_?n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:`${e.AI_SELECTION_ACTION_CLASS} ${e.AI_SELECTION_ACTION_ACTIVE_CLASS}`,onPointerDown:i,onClick:c,children:e.AI_SELECTION_APPLY_LABEL}),n.jsx("button",{type:"button",className:e.AI_SELECTION_ACTION_CLASS,onPointerDown:i,onClick:I,children:e.AI_SELECTION_DISMISS_LABEL})]}):null]}),document.body)};exports.AiSelectionBubble=u;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../../../../constants/numbers.cjs"),E="Ink-AiSelection",I="Ink-AiSelection__action",A="Ink-AiSelection__action--active",S="Selection AI",L="Apply",T="Dismiss",t="Ink AI is writing…",i="Spanish",C=_.NUMBER_EIGHT,e=_.NUMBER_EIGHT,N=_.NUMBER_FORTY,n=448,O=28,o=[{id:"improve",label:"Improve",capability:"rewrite"},{id:"shorter",label:"Shorter",capability:"summarize"},{id:"longer",label:"Longer",capability:"expand"},{id:"fix",label:"Fix",capability:"review"},{id:"tone",label:"Tone",capability:"tone"},{id:"translate",label:"Translate",capability:"translate"}];exports.AI_SELECTION_ACTIONS=o;exports.AI_SELECTION_ACTION_ACTIVE_CLASS=A;exports.AI_SELECTION_ACTION_CLASS=I;exports.AI_SELECTION_APPLY_LABEL=L;exports.AI_SELECTION_BUBBLE_ARIA_LABEL=S;exports.AI_SELECTION_BUBBLE_CLASS=E;exports.AI_SELECTION_BUSY_LABEL=t;exports.AI_SELECTION_DISMISS_LABEL=T;exports.AI_SELECTION_EDGE_PX=e;exports.AI_SELECTION_ESTIMATED_HEIGHT_PX=N;exports.AI_SELECTION_ESTIMATED_WIDTH_PX=n;exports.AI_SELECTION_GAP_PX=C;exports.AI_SELECTION_LINE_CAP_PX=O;exports.AI_SELECTION_TRANSLATE_LANGUAGE=i;
@@ -0,0 +1,20 @@
1
+ import { InkAiCapability } from '../../../../types';
2
+ export declare const AI_SELECTION_BUBBLE_CLASS = "Ink-AiSelection";
3
+ export declare const AI_SELECTION_ACTION_CLASS = "Ink-AiSelection__action";
4
+ export declare const AI_SELECTION_ACTION_ACTIVE_CLASS = "Ink-AiSelection__action--active";
5
+ export declare const AI_SELECTION_BUBBLE_ARIA_LABEL = "Selection AI";
6
+ export declare const AI_SELECTION_APPLY_LABEL = "Apply";
7
+ export declare const AI_SELECTION_DISMISS_LABEL = "Dismiss";
8
+ export declare const AI_SELECTION_BUSY_LABEL = "Ink AI is writing\u2026";
9
+ export declare const AI_SELECTION_TRANSLATE_LANGUAGE = "Spanish";
10
+ export declare const AI_SELECTION_GAP_PX = 8;
11
+ export declare const AI_SELECTION_EDGE_PX = 8;
12
+ export declare const AI_SELECTION_ESTIMATED_HEIGHT_PX = 40;
13
+ export declare const AI_SELECTION_ESTIMATED_WIDTH_PX = 448;
14
+ export declare const AI_SELECTION_LINE_CAP_PX = 28;
15
+ export declare const AI_SELECTION_ACTIONS: ReadonlyArray<{
16
+ id: string;
17
+ label: string;
18
+ capability: InkAiCapability;
19
+ }>;
20
+ //# sourceMappingURL=AiSelectionBubble.const.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiSelectionBubble.const.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD,eAAO,MAAM,yBAAyB,oBAAoB,CAAC;AAC3D,eAAO,MAAM,yBAAyB,4BAA4B,CAAC;AACnE,eAAO,MAAM,gCAAgC,oCAAoC,CAAC;AAClF,eAAO,MAAM,8BAA8B,iBAAiB,CAAC;AAC7D,eAAO,MAAM,wBAAwB,UAAU,CAAC;AAChD,eAAO,MAAM,0BAA0B,YAAY,CAAC;AACpD,eAAO,MAAM,uBAAuB,4BAAuB,CAAC;AAC5D,eAAO,MAAM,+BAA+B,YAAY,CAAC;AACzD,eAAO,MAAM,mBAAmB,IAAe,CAAC;AAChD,eAAO,MAAM,oBAAoB,IAAe,CAAC;AACjD,eAAO,MAAM,gCAAgC,KAAe,CAAC;AAC7D,eAAO,MAAM,+BAA+B,MAAM,CAAC;AACnD,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,eAAO,MAAM,oBAAoB,EAAE,aAAa,CAAC;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,eAAe,CAAC;CAC7B,CAOA,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { NUMBER_EIGHT as _, NUMBER_FORTY as E } from "../../../../constants/numbers.js";
2
+ const A = "Ink-AiSelection", i = "Ink-AiSelection__action", t = "Ink-AiSelection__action--active", n = "Selection AI", e = "Apply", S = "Dismiss", o = "Ink AI is writing…", L = "Spanish", a = _, T = _, c = E, l = 448, s = 28, C = [
3
+ { id: "improve", label: "Improve", capability: "rewrite" },
4
+ { id: "shorter", label: "Shorter", capability: "summarize" },
5
+ { id: "longer", label: "Longer", capability: "expand" },
6
+ { id: "fix", label: "Fix", capability: "review" },
7
+ { id: "tone", label: "Tone", capability: "tone" },
8
+ { id: "translate", label: "Translate", capability: "translate" }
9
+ ];
10
+ export {
11
+ C as AI_SELECTION_ACTIONS,
12
+ t as AI_SELECTION_ACTION_ACTIVE_CLASS,
13
+ i as AI_SELECTION_ACTION_CLASS,
14
+ e as AI_SELECTION_APPLY_LABEL,
15
+ n as AI_SELECTION_BUBBLE_ARIA_LABEL,
16
+ A as AI_SELECTION_BUBBLE_CLASS,
17
+ o as AI_SELECTION_BUSY_LABEL,
18
+ S as AI_SELECTION_DISMISS_LABEL,
19
+ T as AI_SELECTION_EDGE_PX,
20
+ c as AI_SELECTION_ESTIMATED_HEIGHT_PX,
21
+ l as AI_SELECTION_ESTIMATED_WIDTH_PX,
22
+ a as AI_SELECTION_GAP_PX,
23
+ s as AI_SELECTION_LINE_CAP_PX,
24
+ L as AI_SELECTION_TRANSLATE_LANGUAGE
25
+ };
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { AiSelectionBubbleProps } from './AiSelectionBubble.types';
3
+ export declare const AiSelectionBubble: FC<AiSelectionBubbleProps>;
4
+ //# sourceMappingURL=AiSelectionBubble.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiSelectionBubble.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAgB,MAAM,OAAO,CAAC;AAY9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAOxE,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAgDxD,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { jsxs as r, jsx as e, Fragment as p } from "react/jsx-runtime";
2
+ import { createPortal as L } from "react-dom";
3
+ import { AI_SELECTION_BUBBLE_ARIA_LABEL as S, AI_SELECTION_BUBBLE_CLASS as u, AI_SELECTION_ACTIONS as C, AI_SELECTION_ACTION_CLASS as t, AI_SELECTION_BUSY_LABEL as d, AI_SELECTION_APPLY_LABEL as m, AI_SELECTION_ACTION_ACTIVE_CLASS as N, AI_SELECTION_DISMISS_LABEL as b } from "./AiSelectionBubble.const.js";
4
+ const l = (n) => {
5
+ n.preventDefault(), n.stopPropagation();
6
+ }, f = (n) => {
7
+ const { open: s, top: _, left: A, busy: i, preview: a, onAction: I, onApply: E, onDismiss: c } = n;
8
+ return !s || typeof document > "u" ? null : L(
9
+ /* @__PURE__ */ r(
10
+ "div",
11
+ {
12
+ className: u,
13
+ style: { position: "fixed", top: _, left: A },
14
+ role: "toolbar",
15
+ "aria-label": S,
16
+ onPointerDown: (o) => o.stopPropagation(),
17
+ children: [
18
+ C.map((o) => /* @__PURE__ */ e(
19
+ "button",
20
+ {
21
+ type: "button",
22
+ className: t,
23
+ disabled: i,
24
+ onPointerDown: l,
25
+ onClick: () => I(o.id),
26
+ children: o.label
27
+ },
28
+ o.id
29
+ )),
30
+ i ? /* @__PURE__ */ e("span", { className: "Ink-AiSelection__status", children: d }) : null,
31
+ a ? /* @__PURE__ */ r(p, { children: [
32
+ /* @__PURE__ */ e(
33
+ "button",
34
+ {
35
+ type: "button",
36
+ className: `${t} ${N}`,
37
+ onPointerDown: l,
38
+ onClick: E,
39
+ children: m
40
+ }
41
+ ),
42
+ /* @__PURE__ */ e(
43
+ "button",
44
+ {
45
+ type: "button",
46
+ className: t,
47
+ onPointerDown: l,
48
+ onClick: c,
49
+ children: b
50
+ }
51
+ )
52
+ ] }) : null
53
+ ]
54
+ }
55
+ ),
56
+ document.body
57
+ );
58
+ };
59
+ export {
60
+ f as AiSelectionBubble
61
+ };
@@ -0,0 +1,11 @@
1
+ export interface AiSelectionBubbleProps {
2
+ open: boolean;
3
+ top: number;
4
+ left: number;
5
+ busy: boolean;
6
+ preview: string;
7
+ onAction: (actionId: string) => void;
8
+ onApply: () => void;
9
+ onDismiss: () => void;
10
+ }
11
+ //# sourceMappingURL=AiSelectionBubble.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiSelectionBubble.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("../../../../constants/numbers.cjs"),e=require("./AiSelectionBubble.const.cjs"),c=(t,E)=>{const o=(t.bottom-t.top>e.AI_SELECTION_ESTIMATED_HEIGHT_PX?t.top+e.AI_SELECTION_LINE_CAP_PX:t.bottom)+e.AI_SELECTION_GAP_PX,r=t.top-e.AI_SELECTION_ESTIMATED_HEIGHT_PX-e.AI_SELECTION_GAP_PX,n=o+e.AI_SELECTION_ESTIMATED_HEIGHT_PX<=E.height-e.AI_SELECTION_EDGE_PX?o:Math.max(e.AI_SELECTION_EDGE_PX,r),T=Math.max(e.AI_SELECTION_EDGE_PX,E.width-e.AI_SELECTION_ESTIMATED_WIDTH_PX-e.AI_SELECTION_EDGE_PX),l=Math.min(Math.max(t.left,e.AI_SELECTION_EDGE_PX),T);return{top:Number.isFinite(n)?n:I.NUMBER_ZERO,left:Number.isFinite(l)?l:I.NUMBER_ZERO}},A=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),s=t=>{const E=e.AI_SELECTION_ACTIONS.find(i=>i.id===t);return(E==null?void 0:E.capability)??null},S=t=>{if(t==="translate")return{language:e.AI_SELECTION_TRANSLATE_LANGUAGE}},u=t=>{var i,_;if((i=t.diff)!=null&&i.suggestedHtml)return t.diff.suggestedHtml;if(t.html)return t.html;const E=(_=t.reviewSuggestions)==null?void 0:_.find(o=>o.suggestedText.trim());return E?`<p>${A(E.suggestedText)}</p>`:t.text?`<p>${A(t.text)}</p>`:""};exports.capabilityForSelectionAction=s;exports.htmlFromAiResponse=u;exports.optionsForSelectionAction=S;exports.placeAiSelectionBubble=c;
@@ -0,0 +1,19 @@
1
+ import { InkAiCapability, InkAiResponse } from '../../../../types';
2
+ export interface AiSelectionAnchor {
3
+ top: number;
4
+ left: number;
5
+ bottom: number;
6
+ width: number;
7
+ }
8
+ export interface AiSelectionViewport {
9
+ width: number;
10
+ height: number;
11
+ }
12
+ export declare const placeAiSelectionBubble: (selectionRect: AiSelectionAnchor, viewport: AiSelectionViewport) => {
13
+ top: number;
14
+ left: number;
15
+ };
16
+ export declare const capabilityForSelectionAction: (actionId: string) => InkAiCapability | null;
17
+ export declare const optionsForSelectionAction: (actionId: string) => Record<string, string> | undefined;
18
+ export declare const htmlFromAiResponse: (response: InkAiResponse) => string;
19
+ //# sourceMappingURL=AiSelectionBubble.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiSelectionBubble.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAWxE,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,sBAAsB,GACjC,eAAe,iBAAiB,EAChC,UAAU,mBAAmB,KAC5B;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAmB7B,CAAC;AAQF,eAAO,MAAM,4BAA4B,GAAI,UAAU,MAAM,KAAG,eAAe,GAAG,IAGjF,CAAC;AAEF,eAAO,MAAM,yBAAyB,GACpC,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAK3B,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,UAAU,aAAa,KAAG,MAO5D,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { NUMBER_ZERO as _ } from "../../../../constants/numbers.js";
2
+ import { AI_SELECTION_ACTIONS as A, AI_SELECTION_TRANSLATE_LANGUAGE as I, AI_SELECTION_ESTIMATED_HEIGHT_PX as l, AI_SELECTION_EDGE_PX as i, AI_SELECTION_ESTIMATED_WIDTH_PX as f, AI_SELECTION_GAP_PX as a, AI_SELECTION_LINE_CAP_PX as c } from "./AiSelectionBubble.const.js";
3
+ const N = (t, o) => {
4
+ const n = (t.bottom - t.top > l ? t.top + c : t.bottom) + a, s = t.top - l - a, E = n + l <= o.height - i ? n : Math.max(i, s), u = Math.max(
5
+ i,
6
+ o.width - f - i
7
+ ), m = Math.min(Math.max(t.left, i), u);
8
+ return {
9
+ top: Number.isFinite(E) ? E : _,
10
+ left: Number.isFinite(m) ? m : _
11
+ };
12
+ }, g = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), h = (t) => {
13
+ const o = A.find((e) => e.id === t);
14
+ return (o == null ? void 0 : o.capability) ?? null;
15
+ }, d = (t) => {
16
+ if (t === "translate")
17
+ return { language: I };
18
+ }, L = (t) => {
19
+ var e, r;
20
+ if ((e = t.diff) != null && e.suggestedHtml) return t.diff.suggestedHtml;
21
+ if (t.html) return t.html;
22
+ const o = (r = t.reviewSuggestions) == null ? void 0 : r.find((n) => n.suggestedText.trim());
23
+ return o ? `<p>${g(o.suggestedText)}</p>` : t.text ? `<p>${g(t.text)}</p>` : "";
24
+ };
25
+ export {
26
+ h as capabilityForSelectionAction,
27
+ L as htmlFromAiResponse,
28
+ d as optionsForSelectionAction,
29
+ N as placeAiSelectionBubble
30
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AiSelectionBubble.utils.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiSelectionBubble.utils.test.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export { AiSelectionBubble } from './AiSelectionBubble';
2
+ export { capabilityForSelectionAction, htmlFromAiResponse, optionsForSelectionAction, placeAiSelectionBubble, } from './AiSelectionBubble.utils';
3
+ export type { AiSelectionBubbleProps } from './AiSelectionBubble.types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiSelectionBubble/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,EAClB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const i=require("../../../../common-components/icons/GripIcon.cjs"),e=require("./BlockHandles.const.cjs"),l=n=>{const{visible:L,top:_,onMoveUp:r,onMoveDown:o,onDragStart:s}=n;return L?t.jsxs("div",{className:e.BLOCK_HANDLES_CLASS,style:{top:_},"aria-hidden":!L,children:[t.jsx("button",{type:"button",className:e.BLOCK_HANDLES_PLUS_CLASS,title:e.BLOCK_HANDLES_TITLE_PLUS,tabIndex:-1,children:e.BLOCK_HANDLES_PLUS_LABEL}),t.jsx("button",{type:"button",className:e.BLOCK_HANDLES_GRIP_CLASS,title:e.BLOCK_HANDLES_TITLE_GRIP,tabIndex:-1,draggable:!0,onDragStart:s,children:t.jsx(i.GripIcon,{})}),t.jsx("button",{type:"button",className:e.BLOCK_HANDLES_BTN_CLASS,title:e.BLOCK_HANDLES_TITLE_UP,onClick:r,children:e.BLOCK_HANDLES_UP_LABEL}),t.jsx("button",{type:"button",className:e.BLOCK_HANDLES_BTN_CLASS,title:e.BLOCK_HANDLES_TITLE_DOWN,onClick:o,children:e.BLOCK_HANDLES_DOWN_LABEL})]}):null};exports.BlockHandles=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");require("react");require("react-dom");const s=require("../../../../common-components/icons/GripIcon.cjs"),e=require("./BlockHandles.const.cjs"),l=n=>{const{visible:L,top:r,onMoveUp:_,onMoveDown:o,onDragStart:i}=n;return L?t.jsxs("div",{className:e.BLOCK_HANDLES_CLASS,style:{top:r},"aria-hidden":!L,children:[t.jsx("button",{type:"button",className:e.BLOCK_HANDLES_PLUS_CLASS,title:e.BLOCK_HANDLES_TITLE_PLUS,tabIndex:-1,children:e.BLOCK_HANDLES_PLUS_LABEL}),t.jsx("button",{type:"button",className:e.BLOCK_HANDLES_GRIP_CLASS,title:e.BLOCK_HANDLES_TITLE_GRIP,tabIndex:-1,draggable:!0,onDragStart:i,children:t.jsx(s.GripIcon,{})}),t.jsx("button",{type:"button",className:e.BLOCK_HANDLES_BTN_CLASS,title:e.BLOCK_HANDLES_TITLE_UP,onClick:_,children:e.BLOCK_HANDLES_UP_LABEL}),t.jsx("button",{type:"button",className:e.BLOCK_HANDLES_BTN_CLASS,title:e.BLOCK_HANDLES_TITLE_DOWN,onClick:o,children:e.BLOCK_HANDLES_DOWN_LABEL})]}):null};exports.BlockHandles=l;
@@ -1,11 +1,12 @@
1
1
  import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
2
  import "../../../../constants/openai.const.js";
3
3
  import "../../../../utils/paste.utils.js";
4
+ import "../../../../utils/exportDocument.utils.js";
4
5
  import "react";
5
6
  import "react-dom";
6
7
  import { GripIcon as S } from "../../../../common-components/icons/GripIcon.js";
7
- import { BLOCK_HANDLES_CLASS as a, BLOCK_HANDLES_PLUS_LABEL as N, BLOCK_HANDLES_TITLE_PLUS as s, BLOCK_HANDLES_PLUS_CLASS as A, BLOCK_HANDLES_TITLE_GRIP as E, BLOCK_HANDLES_GRIP_CLASS as C, BLOCK_HANDLES_UP_LABEL as c, BLOCK_HANDLES_TITLE_UP as B, BLOCK_HANDLES_BTN_CLASS as o, BLOCK_HANDLES_DOWN_LABEL as m, BLOCK_HANDLES_TITLE_DOWN as p } from "./BlockHandles.const.js";
8
- const I = (_) => {
8
+ import { BLOCK_HANDLES_CLASS as a, BLOCK_HANDLES_PLUS_LABEL as N, BLOCK_HANDLES_TITLE_PLUS as s, BLOCK_HANDLES_PLUS_CLASS as A, BLOCK_HANDLES_TITLE_GRIP as E, BLOCK_HANDLES_GRIP_CLASS as C, BLOCK_HANDLES_UP_LABEL as c, BLOCK_HANDLES_TITLE_UP as m, BLOCK_HANDLES_BTN_CLASS as o, BLOCK_HANDLES_DOWN_LABEL as p, BLOCK_HANDLES_TITLE_DOWN as B } from "./BlockHandles.const.js";
9
+ const T = (_) => {
9
10
  const { visible: L, top: e, onMoveUp: n, onMoveDown: r, onDragStart: i } = _;
10
11
  return L ? /* @__PURE__ */ l("div", { className: a, style: { top: e }, "aria-hidden": !L, children: [
11
12
  /* @__PURE__ */ t(
@@ -35,7 +36,7 @@ const I = (_) => {
35
36
  {
36
37
  type: "button",
37
38
  className: o,
38
- title: B,
39
+ title: m,
39
40
  onClick: n,
40
41
  children: c
41
42
  }
@@ -45,13 +46,13 @@ const I = (_) => {
45
46
  {
46
47
  type: "button",
47
48
  className: o,
48
- title: p,
49
+ title: B,
49
50
  onClick: r,
50
- children: m
51
+ children: p
51
52
  }
52
53
  )
53
54
  ] }) : null;
54
55
  };
55
56
  export {
56
- I as BlockHandles
57
+ T as BlockHandles
57
58
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),x=c=>{const{comments:o,author:r,onAddReply:d,onResolve:_,onClose:l}=c,[a,m]=j.useState({}),u=(s,n)=>{var i;s.preventDefault();const t=(i=a[n])==null?void 0:i.trim();t&&(d(n,t),m(h=>({...h,[n]:""})))};return e.jsxs("aside",{className:"Ink-Comments","aria-label":"Comments archive",children:[e.jsxs("div",{className:"Ink-Comments__header",children:[e.jsx("strong",{children:"Comments archive"}),l?e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:l,title:"Close",children:"×"}):null]}),e.jsx("div",{className:"Ink-Comments__list",children:o.length===0?e.jsx("p",{className:"Ink-Comments__empty",children:"Select text and add a comment to start a thread."}):o.map(s=>e.jsxs("article",{className:`Ink-Comments__thread${s.resolved?" Ink-Comments__thread--resolved":""}`,children:[e.jsxs("header",{className:"Ink-Comments__meta",children:[e.jsx("span",{children:s.author}),e.jsx("time",{children:new Date(s.timestamp).toLocaleString()})]}),e.jsx("p",{className:"Ink-Comments__body",children:s.body}),s.replies.map(n=>e.jsxs("div",{className:"Ink-Comments__reply",children:[e.jsxs("header",{className:"Ink-Comments__meta",children:[e.jsx("span",{children:n.author}),e.jsx("time",{children:new Date(n.timestamp).toLocaleString()})]}),e.jsx("p",{className:"Ink-Comments__body",children:n.body})]},n.id)),s.resolved?e.jsx("p",{className:"Ink-Comments__resolved",children:"Resolved"}):e.jsxs("form",{className:"Ink-Comments__form",onSubmit:n=>u(n,s.id),children:[e.jsx("input",{value:a[s.id]??"",onChange:n=>m(t=>({...t,[s.id]:n.target.value})),placeholder:`Reply as ${r}…`,"aria-label":`Reply to ${s.author}`}),e.jsx("button",{type:"submit",className:"Ink-Editor__button Ink-Editor__button--active",children:"Reply"}),e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:()=>_(s.id),children:"Resolve"})]})]},s.id))})]})};exports.CommentsPanel=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("react"),C=c=>{const{comments:o,author:r,onAddReply:d,onResolve:u,onReopen:_,onFocus:p,onClose:l}=c,[a,m]=x.useState({}),b=(n,s)=>{var i;n.preventDefault();const t=(i=a[s])==null?void 0:i.trim();t&&(d(s,t),m(j=>({...j,[s]:""})))};return e.jsxs("aside",{className:"Ink-Comments","aria-label":"Comments archive",children:[e.jsxs("div",{className:"Ink-Comments__header",children:[e.jsx("strong",{children:"Comments archive"}),l?e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:l,title:"Close",children:"×"}):null]}),e.jsx("div",{className:"Ink-Comments__list",children:o.length===0?e.jsx("p",{className:"Ink-Comments__empty",children:"Select text and add a comment to start a thread."}):o.map(n=>e.jsxs("article",{className:`Ink-Comments__thread${n.resolved?" Ink-Comments__thread--resolved":""}`,onClick:()=>p(n.id),children:[e.jsxs("header",{className:"Ink-Comments__meta",children:[e.jsx("span",{children:n.author}),e.jsx("time",{children:new Date(n.timestamp).toLocaleString()})]}),e.jsx("p",{className:"Ink-Comments__body",children:n.body}),n.replies.map(s=>e.jsxs("div",{className:"Ink-Comments__reply",children:[e.jsxs("header",{className:"Ink-Comments__meta",children:[e.jsx("span",{children:s.author}),e.jsx("time",{children:new Date(s.timestamp).toLocaleString()})]}),e.jsx("p",{className:"Ink-Comments__body",children:s.body})]},s.id)),n.resolved?e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:()=>_(n.id),children:"Reopen"}):e.jsxs("form",{className:"Ink-Comments__form",onSubmit:s=>b(s,n.id),children:[e.jsx("input",{value:a[n.id]??"",onChange:s=>m(t=>({...t,[n.id]:s.target.value})),placeholder:`Reply as ${r}…`,"aria-label":`Reply to ${n.author}`}),e.jsx("button",{type:"submit",className:"Ink-Editor__button Ink-Editor__button--active",children:"Reply"}),e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:()=>u(n.id),children:"Resolve"})]})]},n.id))})]})};exports.CommentsPanel=C;
@@ -5,6 +5,8 @@ export interface CommentsPanelProps {
5
5
  author: string;
6
6
  onAddReply: (threadId: string, body: string) => void;
7
7
  onResolve: (threadId: string) => void;
8
+ onReopen: (threadId: string) => void;
9
+ onFocus: (threadId: string) => void;
8
10
  onClose?: () => void;
9
11
  }
10
12
  export declare const CommentsPanel: FC<CommentsPanelProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"CommentsPanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/CommentsPanel/CommentsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA2EhD,CAAC"}
1
+ {"version":3,"file":"CommentsPanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/CommentsPanel/CommentsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA8EhD,CAAC"}
@@ -1,40 +1,41 @@
1
- import { jsxs as s, jsx as n } from "react/jsx-runtime";
2
- import { useState as C } from "react";
1
+ import { jsxs as o, jsx as n } from "react/jsx-runtime";
2
+ import { useState as k } from "react";
3
3
  const v = (r) => {
4
- const { comments: m, author: d, onAddReply: _, onResolve: p, onClose: l } = r, [a, i] = C({}), h = (e, t) => {
4
+ const { comments: l, author: d, onAddReply: _, onResolve: u, onReopen: p, onFocus: C, onClose: m } = r, [a, i] = k({}), b = (e, t) => {
5
5
  var c;
6
6
  e.preventDefault();
7
- const o = (c = a[t]) == null ? void 0 : c.trim();
8
- o && (_(t, o), i((u) => ({ ...u, [t]: "" })));
7
+ const s = (c = a[t]) == null ? void 0 : c.trim();
8
+ s && (_(t, s), i((h) => ({ ...h, [t]: "" })));
9
9
  };
10
- return /* @__PURE__ */ s("aside", { className: "Ink-Comments", "aria-label": "Comments archive", children: [
11
- /* @__PURE__ */ s("div", { className: "Ink-Comments__header", children: [
10
+ return /* @__PURE__ */ o("aside", { className: "Ink-Comments", "aria-label": "Comments archive", children: [
11
+ /* @__PURE__ */ o("div", { className: "Ink-Comments__header", children: [
12
12
  /* @__PURE__ */ n("strong", { children: "Comments archive" }),
13
- l ? /* @__PURE__ */ n("button", { type: "button", className: "Ink-Editor__button", onClick: l, title: "Close", children: "×" }) : null
13
+ m ? /* @__PURE__ */ n("button", { type: "button", className: "Ink-Editor__button", onClick: m, title: "Close", children: "×" }) : null
14
14
  ] }),
15
- /* @__PURE__ */ n("div", { className: "Ink-Comments__list", children: m.length === 0 ? /* @__PURE__ */ n("p", { className: "Ink-Comments__empty", children: "Select text and add a comment to start a thread." }) : m.map((e) => /* @__PURE__ */ s(
15
+ /* @__PURE__ */ n("div", { className: "Ink-Comments__list", children: l.length === 0 ? /* @__PURE__ */ n("p", { className: "Ink-Comments__empty", children: "Select text and add a comment to start a thread." }) : l.map((e) => /* @__PURE__ */ o(
16
16
  "article",
17
17
  {
18
18
  className: `Ink-Comments__thread${e.resolved ? " Ink-Comments__thread--resolved" : ""}`,
19
+ onClick: () => C(e.id),
19
20
  children: [
20
- /* @__PURE__ */ s("header", { className: "Ink-Comments__meta", children: [
21
+ /* @__PURE__ */ o("header", { className: "Ink-Comments__meta", children: [
21
22
  /* @__PURE__ */ n("span", { children: e.author }),
22
23
  /* @__PURE__ */ n("time", { children: new Date(e.timestamp).toLocaleString() })
23
24
  ] }),
24
25
  /* @__PURE__ */ n("p", { className: "Ink-Comments__body", children: e.body }),
25
- e.replies.map((t) => /* @__PURE__ */ s("div", { className: "Ink-Comments__reply", children: [
26
- /* @__PURE__ */ s("header", { className: "Ink-Comments__meta", children: [
26
+ e.replies.map((t) => /* @__PURE__ */ o("div", { className: "Ink-Comments__reply", children: [
27
+ /* @__PURE__ */ o("header", { className: "Ink-Comments__meta", children: [
27
28
  /* @__PURE__ */ n("span", { children: t.author }),
28
29
  /* @__PURE__ */ n("time", { children: new Date(t.timestamp).toLocaleString() })
29
30
  ] }),
30
31
  /* @__PURE__ */ n("p", { className: "Ink-Comments__body", children: t.body })
31
32
  ] }, t.id)),
32
- e.resolved ? /* @__PURE__ */ n("p", { className: "Ink-Comments__resolved", children: "Resolved" }) : /* @__PURE__ */ s("form", { className: "Ink-Comments__form", onSubmit: (t) => h(t, e.id), children: [
33
+ e.resolved ? /* @__PURE__ */ n("button", { type: "button", className: "Ink-Editor__button", onClick: () => p(e.id), children: "Reopen" }) : /* @__PURE__ */ o("form", { className: "Ink-Comments__form", onSubmit: (t) => b(t, e.id), children: [
33
34
  /* @__PURE__ */ n(
34
35
  "input",
35
36
  {
36
37
  value: a[e.id] ?? "",
37
- onChange: (t) => i((o) => ({ ...o, [e.id]: t.target.value })),
38
+ onChange: (t) => i((s) => ({ ...s, [e.id]: t.target.value })),
38
39
  placeholder: `Reply as ${d}…`,
39
40
  "aria-label": `Reply to ${e.author}`
40
41
  }
@@ -45,7 +46,7 @@ const v = (r) => {
45
46
  {
46
47
  type: "button",
47
48
  className: "Ink-Editor__button",
48
- onClick: () => p(e.id),
49
+ onClick: () => u(e.id),
49
50
  children: "Resolve"
50
51
  }
51
52
  )
@@ -1 +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"),a=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 l=require("../../../../plugins/excel/excel.utils.cjs"),V=require("../ToolbarDropdown/ToolbarDropdown.utils.cjs"),k=require("../ToolbarButton/ToolbarButton.cjs"),F=X=>{var h;const{icon:D,disabled:p=!1,hint:I,onHint:w,pluginColor:g,onInsert:x}=X,[S,L]=E.useState(!1),[r,i]=E.useState(l.createEmptyExcelGrid),[v,R]=E.useState(null),[O,m]=E.useState(null),[M,j]=E.useState({top:s.NUMBER_ZERO,left:s.NUMBER_ZERO}),T=E.useRef(null),A=E.useRef(null),f=E.useRef(null),K=E.useRef(null),N=((h=r[s.NUMBER_ZERO])==null?void 0:h.length)??s.NUMBER_ONE,y=r.length<s.INK_EXCEL_SHEET_MAX_ROWS,$=N<s.INK_EXCEL_SHEET_MAX_COLS,H=r.length>s.NUMBER_ONE,U=N>s.NUMBER_ONE;E.useEffect(()=>{if(!S)return;const e=()=>{var C;const c=(C=f.current)==null?void 0:C.getBoundingClientRect().height,d=V.getToolbarDropdownMenuPosition(A.current,c&&c>s.NUMBER_ZERO?c:s.INK_EXCEL_MENU_ESTIMATED_HEIGHT_PX);j({top:d.top,left:d.left})};e();const t=window.requestAnimationFrame(e),u=c=>{var C,b;const d=c.target;(C=T.current)!=null&&C.contains(d)||(b=f.current)!=null&&b.contains(d)||L(!1)},_=c=>{c.key===G.KEY_ESCAPE&&L(!1)};return document.addEventListener("mousedown",u),document.addEventListener("keydown",_),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.cancelAnimationFrame(t),document.removeEventListener("mousedown",u),document.removeEventListener("keydown",_),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[S,r.length,N]);const q=e=>{var _;const t=(_=e.target.files)==null?void 0:_[s.NUMBER_ZERO];if(!t)return;const u=new FileReader;u.onload=()=>{i(l.parseCsvText(String(u.result)))},u.readAsText(t)};return n.jsxs("div",{className:o.INK_CLASS_STYLE_DD,ref:T,children:[n.jsx("div",{ref:A,children:n.jsx(k.ToolbarButton,{icon:D,title:a.INK_EXCEL_TITLE,hint:I,onHint:w,pluginColor:g,disabled:p,onClick:()=>{p||(i(l.createEmptyExcelGrid()),L(e=>!e))}})}),S?B.createPortal(n.jsxs("div",{ref:f,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":a.INK_EXCEL_TITLE,style:{top:M.top,left:M.left},children:[n.jsx("div",{className:o.INK_CLASS_EXCEL_TITLE,children:a.INK_EXCEL_TITLE}),n.jsxs("div",{className:o.INK_CLASS_EXCEL_GRID,style:{gridTemplateColumns:`2rem repeat(${N}, minmax(0, 1fr))`},onMouseLeave:()=>{R(null),m(null)},children:[n.jsx("span",{className:o.INK_CLASS_EXCEL_CORNER}),(r[s.NUMBER_ZERO]??[]).map((e,t)=>n.jsx("span",{className:`${o.INK_CLASS_EXCEL_HEAD}${v===t?` ${o.INK_CLASS_EXCEL_COL_HOVER}`:""}`,onMouseEnter:()=>R(t),children:o.EXCEL_COL_LETTERS[t]??t+s.NUMBER_ONE},`h-${t}`)),r.map((e,t)=>n.jsxs(E.Fragment,{children:[n.jsx("span",{className:`${o.INK_CLASS_EXCEL_HEAD}${O===t?` ${o.INK_CLASS_EXCEL_ROW_HOVER}`:""}`,onMouseEnter:()=>m(t),children:t+s.NUMBER_ONE}),e.map((u,_)=>n.jsx("input",{className:`${o.INK_CLASS_EXCEL_CELL}${v===_?` ${o.INK_CLASS_EXCEL_COL_HOVER}`:""}${O===t?` ${o.INK_CLASS_EXCEL_ROW_HOVER}`:""}`,value:u,onMouseEnter:()=>{R(_),m(t)},onChange:c=>i(l.setExcelCell(r,t,_,c.target.value))},`${t}-${_}`))]},`row-${t}`))]}),n.jsxs("div",{className:o.INK_CLASS_EXCEL_ACTIONS,children:[n.jsx("button",{type:"button",disabled:!y,onMouseDown:e=>{e.preventDefault(),i(l.addExcelRow(r))},children:a.INK_EXCEL_ADD_ROW}),n.jsx("button",{type:"button",disabled:!$,onMouseDown:e=>{e.preventDefault(),i(l.addExcelCol(r))},children:a.INK_EXCEL_ADD_COL}),n.jsx("button",{type:"button",disabled:!H,onMouseDown:e=>{e.preventDefault(),i(l.removeExcelRow(r))},children:a.INK_EXCEL_REMOVE_ROW}),n.jsx("button",{type:"button",disabled:!U,onMouseDown:e=>{e.preventDefault(),i(l.removeExcelCol(r))},children:a.INK_EXCEL_REMOVE_COL}),n.jsx("button",{type:"button",onMouseDown:e=>{e.preventDefault(),i(l.clearExcelGrid(r))},children:a.INK_EXCEL_CLEAR}),n.jsx("button",{type:"button",onMouseDown:e=>{var t;e.preventDefault(),(t=K.current)==null||t.click()},children:a.INK_EXCEL_IMPORT}),n.jsx("button",{type:"button",className:o.INK_CLASS_EXCEL_INSERT,onMouseDown:e=>{e.preventDefault(),x(l.excelGridToTableHtml(r)),L(!1)},children:a.INK_EXCEL_INSERT})]}),n.jsx("input",{ref:K,type:"file",accept:l.CSV_ACCEPT,hidden:!0,onChange:q})]}),document.body):null]})};exports.ExcelSheetPanel=F;
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"),i=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");require("../../../../utils/exportDocument.utils.cjs");const l=require("../../../../plugins/excel/excel.utils.cjs"),V=require("../ToolbarDropdown/ToolbarDropdown.utils.cjs"),k=require("../ToolbarButton/ToolbarButton.cjs"),F=X=>{var h;const{icon:D,disabled:p=!1,hint:I,onHint:w,pluginColor:g,onInsert:x}=X,[S,L]=E.useState(!1),[r,c]=E.useState(l.createEmptyExcelGrid),[v,R]=E.useState(null),[O,m]=E.useState(null),[M,j]=E.useState({top:s.NUMBER_ZERO,left:s.NUMBER_ZERO}),T=E.useRef(null),A=E.useRef(null),f=E.useRef(null),K=E.useRef(null),N=((h=r[s.NUMBER_ZERO])==null?void 0:h.length)??s.NUMBER_ONE,y=r.length<s.INK_EXCEL_SHEET_MAX_ROWS,$=N<s.INK_EXCEL_SHEET_MAX_COLS,q=r.length>s.NUMBER_ONE,H=N>s.NUMBER_ONE;E.useEffect(()=>{if(!S)return;const e=()=>{var C;const a=(C=f.current)==null?void 0:C.getBoundingClientRect().height,d=V.getToolbarDropdownMenuPosition(A.current,a&&a>s.NUMBER_ZERO?a:s.INK_EXCEL_MENU_ESTIMATED_HEIGHT_PX);j({top:d.top,left:d.left})};e();const t=window.requestAnimationFrame(e),u=a=>{var C,b;const d=a.target;(C=T.current)!=null&&C.contains(d)||(b=f.current)!=null&&b.contains(d)||L(!1)},_=a=>{a.key===G.KEY_ESCAPE&&L(!1)};return document.addEventListener("mousedown",u),document.addEventListener("keydown",_),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.cancelAnimationFrame(t),document.removeEventListener("mousedown",u),document.removeEventListener("keydown",_),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[S,r.length,N]);const U=e=>{var _;const t=(_=e.target.files)==null?void 0:_[s.NUMBER_ZERO];if(!t)return;const u=new FileReader;u.onload=()=>{c(l.parseCsvText(String(u.result)))},u.readAsText(t)};return n.jsxs("div",{className:o.INK_CLASS_STYLE_DD,ref:T,children:[n.jsx("div",{ref:A,children:n.jsx(k.ToolbarButton,{icon:D,title:i.INK_EXCEL_TITLE,hint:I,onHint:w,pluginColor:g,disabled:p,onClick:()=>{p||(c(l.createEmptyExcelGrid()),L(e=>!e))}})}),S?B.createPortal(n.jsxs("div",{ref:f,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":i.INK_EXCEL_TITLE,style:{top:M.top,left:M.left},children:[n.jsx("div",{className:o.INK_CLASS_EXCEL_TITLE,children:i.INK_EXCEL_TITLE}),n.jsxs("div",{className:o.INK_CLASS_EXCEL_GRID,style:{gridTemplateColumns:`2rem repeat(${N}, minmax(0, 1fr))`},onMouseLeave:()=>{R(null),m(null)},children:[n.jsx("span",{className:o.INK_CLASS_EXCEL_CORNER}),(r[s.NUMBER_ZERO]??[]).map((e,t)=>n.jsx("span",{className:`${o.INK_CLASS_EXCEL_HEAD}${v===t?` ${o.INK_CLASS_EXCEL_COL_HOVER}`:""}`,onMouseEnter:()=>R(t),children:o.EXCEL_COL_LETTERS[t]??t+s.NUMBER_ONE},`h-${t}`)),r.map((e,t)=>n.jsxs(E.Fragment,{children:[n.jsx("span",{className:`${o.INK_CLASS_EXCEL_HEAD}${O===t?` ${o.INK_CLASS_EXCEL_ROW_HOVER}`:""}`,onMouseEnter:()=>m(t),children:t+s.NUMBER_ONE}),e.map((u,_)=>n.jsx("input",{className:`${o.INK_CLASS_EXCEL_CELL}${v===_?` ${o.INK_CLASS_EXCEL_COL_HOVER}`:""}${O===t?` ${o.INK_CLASS_EXCEL_ROW_HOVER}`:""}`,value:u,onMouseEnter:()=>{R(_),m(t)},onChange:a=>c(l.setExcelCell(r,t,_,a.target.value))},`${t}-${_}`))]},`row-${t}`))]}),n.jsxs("div",{className:o.INK_CLASS_EXCEL_ACTIONS,children:[n.jsx("button",{type:"button",disabled:!y,onMouseDown:e=>{e.preventDefault(),c(l.addExcelRow(r))},children:i.INK_EXCEL_ADD_ROW}),n.jsx("button",{type:"button",disabled:!$,onMouseDown:e=>{e.preventDefault(),c(l.addExcelCol(r))},children:i.INK_EXCEL_ADD_COL}),n.jsx("button",{type:"button",disabled:!q,onMouseDown:e=>{e.preventDefault(),c(l.removeExcelRow(r))},children:i.INK_EXCEL_REMOVE_ROW}),n.jsx("button",{type:"button",disabled:!H,onMouseDown:e=>{e.preventDefault(),c(l.removeExcelCol(r))},children:i.INK_EXCEL_REMOVE_COL}),n.jsx("button",{type:"button",onMouseDown:e=>{e.preventDefault(),c(l.clearExcelGrid(r))},children:i.INK_EXCEL_CLEAR}),n.jsx("button",{type:"button",onMouseDown:e=>{var t;e.preventDefault(),(t=K.current)==null||t.click()},children:i.INK_EXCEL_IMPORT}),n.jsx("button",{type:"button",className:o.INK_CLASS_EXCEL_INSERT,onMouseDown:e=>{e.preventDefault(),x(l.excelGridToTableHtml(r)),L(!1)},children:i.INK_EXCEL_INSERT})]}),n.jsx("input",{ref:K,type:"file",accept:l.CSV_ACCEPT,hidden:!0,onChange:U})]}),document.body):null]})};exports.ExcelSheetPanel=F;
@@ -1,19 +1,20 @@
1
1
  import { jsxs as _, jsx as n } from "react/jsx-runtime";
2
2
  import { useState as u, useRef as L, useEffect as j, Fragment as x } from "react";
3
3
  import { createPortal as z } from "react-dom";
4
- import { NUMBER_ZERO as i, NUMBER_ONE as d, INK_EXCEL_SHEET_MAX_ROWS as q, INK_EXCEL_SHEET_MAX_COLS as Z, INK_EXCEL_MENU_ESTIMATED_HEIGHT_PX as J } from "../../../../constants/numbers.js";
4
+ import { NUMBER_ZERO as i, NUMBER_ONE as m, INK_EXCEL_SHEET_MAX_ROWS as q, INK_EXCEL_SHEET_MAX_COLS as Z, INK_EXCEL_MENU_ESTIMATED_HEIGHT_PX as J } from "../../../../constants/numbers.js";
5
5
  import { INK_EXCEL_TITLE as v, INK_EXCEL_ADD_ROW as Q, 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
6
  import { COLOR_MODE_LIGHT as se } from "../../../../constants/colorMode.const.js";
7
7
  import { KEY_ESCAPE as Ee } from "../../../../constants/keyboard.const.js";
8
- import { INK_CLASS_STYLE_DD as ie, INK_CLASS_STYLE_MENU as ae, INK_CLASS_STYLE_MENU_PORTAL as ce, INK_CLASS_STYLE_MENU_FORCED as _e, INK_CLASS_EXCEL_PANEL as ue, INK_CLASS_EXCEL_TITLE as de, INK_CLASS_EXCEL_GRID as me, INK_CLASS_EXCEL_CORNER as Ce, 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";
8
+ import { INK_CLASS_STYLE_DD as ie, INK_CLASS_STYLE_MENU as ae, INK_CLASS_STYLE_MENU_PORTAL as ce, INK_CLASS_STYLE_MENU_FORCED as _e, INK_CLASS_EXCEL_PANEL as ue, INK_CLASS_EXCEL_TITLE as me, INK_CLASS_EXCEL_GRID as de, INK_CLASS_EXCEL_CORNER as Ce, 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
9
  import "../../../../constants/openai.const.js";
10
10
  import "../../../../utils/paste.utils.js";
11
+ import "../../../../utils/exportDocument.utils.js";
11
12
  import { createEmptyExcelGrid as I, setExcelCell as Se, addExcelRow as ve, addExcelCol as Re, removeExcelRow as Ae, removeExcelCol as he, clearExcelGrid as Te, excelGridToTableHtml as Ke, CSV_ACCEPT as De, parseCsvText as Me } from "../../../../plugins/excel/excel.utils.js";
12
13
  import { getToolbarDropdownMenuPosition as we } from "../ToolbarDropdown/ToolbarDropdown.utils.js";
13
14
  import { ToolbarButton as Xe } from "../ToolbarButton/ToolbarButton.js";
14
- const Ye = ($) => {
15
+ const Be = ($) => {
15
16
  var w;
16
- const { icon: y, disabled: R = !1, hint: H, onHint: P, pluginColor: G, onInsert: F } = $, [p, m] = u(!1), [o, s] = u(I), [A, f] = u(null), [h, N] = u(null), [T, U] = u({ top: i, left: i }), K = L(null), D = L(null), S = L(null), M = L(null), C = ((w = o[i]) == null ? void 0 : w.length) ?? d, k = o.length < q, V = C < Z, Y = o.length > d, B = C > d;
17
+ const { icon: y, disabled: R = !1, hint: H, onHint: P, pluginColor: G, onInsert: F } = $, [p, d] = u(!1), [o, s] = u(I), [A, f] = u(null), [h, N] = u(null), [T, U] = u({ top: i, left: i }), K = L(null), D = L(null), S = L(null), M = L(null), C = ((w = o[i]) == null ? void 0 : w.length) ?? m, k = o.length < q, V = C < Z, Y = o.length > m, B = C > m;
17
18
  j(() => {
18
19
  if (!p) return;
19
20
  const e = () => {
@@ -28,9 +29,9 @@ const Ye = ($) => {
28
29
  const t = window.requestAnimationFrame(e), E = (l) => {
29
30
  var c, X;
30
31
  const a = l.target;
31
- (c = K.current) != null && c.contains(a) || (X = S.current) != null && X.contains(a) || m(!1);
32
+ (c = K.current) != null && c.contains(a) || (X = S.current) != null && X.contains(a) || d(!1);
32
33
  }, r = (l) => {
33
- l.key === Ee && m(!1);
34
+ l.key === Ee && d(!1);
34
35
  };
35
36
  return document.addEventListener("mousedown", E), document.addEventListener("keydown", r), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
36
37
  window.cancelAnimationFrame(t), document.removeEventListener("mousedown", E), document.removeEventListener("keydown", r), window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
@@ -56,7 +57,7 @@ const Ye = ($) => {
56
57
  pluginColor: G,
57
58
  disabled: R,
58
59
  onClick: () => {
59
- R || (s(I()), m((e) => !e));
60
+ R || (s(I()), d((e) => !e));
60
61
  }
61
62
  }
62
63
  ) }),
@@ -71,11 +72,11 @@ const Ye = ($) => {
71
72
  "aria-label": v,
72
73
  style: { top: T.top, left: T.left },
73
74
  children: [
74
- /* @__PURE__ */ n("div", { className: de, children: v }),
75
+ /* @__PURE__ */ n("div", { className: me, children: v }),
75
76
  /* @__PURE__ */ _(
76
77
  "div",
77
78
  {
78
- className: me,
79
+ className: de,
79
80
  style: {
80
81
  gridTemplateColumns: `2rem repeat(${C}, minmax(0, 1fr))`
81
82
  },
@@ -89,7 +90,7 @@ const Ye = ($) => {
89
90
  {
90
91
  className: `${b}${A === t ? ` ${O}` : ""}`,
91
92
  onMouseEnter: () => f(t),
92
- children: Le[t] ?? t + d
93
+ children: Le[t] ?? t + m
93
94
  },
94
95
  `h-${t}`
95
96
  )),
@@ -99,7 +100,7 @@ const Ye = ($) => {
99
100
  {
100
101
  className: `${b}${h === t ? ` ${g}` : ""}`,
101
102
  onMouseEnter: () => N(t),
102
- children: t + d
103
+ children: t + m
103
104
  }
104
105
  ),
105
106
  e.map((E, r) => /* @__PURE__ */ n(
@@ -190,7 +191,7 @@ const Ye = ($) => {
190
191
  type: "button",
191
192
  className: Ne,
192
193
  onMouseDown: (e) => {
193
- e.preventDefault(), F(Ke(o)), m(!1);
194
+ e.preventDefault(), F(Ke(o)), d(!1);
194
195
  },
195
196
  children: le
196
197
  }
@@ -205,5 +206,5 @@ const Ye = ($) => {
205
206
  ] });
206
207
  };
207
208
  export {
208
- Ye as ExcelSheetPanel
209
+ Be as ExcelSheetPanel
209
210
  };