@forgedevstack/ink 1.1.3 → 1.1.5

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 (316) hide show
  1. package/CHANGELOG.md +64 -1
  2. package/dist/common-components/Box/Box.cjs +1 -0
  3. package/dist/common-components/Box/Box.const.cjs +1 -0
  4. package/dist/common-components/Box/Box.const.d.ts +3 -0
  5. package/dist/common-components/Box/Box.const.d.ts.map +1 -0
  6. package/dist/common-components/Box/Box.const.js +5 -0
  7. package/dist/common-components/Box/Box.d.ts +4 -0
  8. package/dist/common-components/Box/Box.d.ts.map +1 -0
  9. package/dist/common-components/Box/Box.js +14 -0
  10. package/dist/common-components/Box/Box.types.d.ts +6 -0
  11. package/dist/common-components/Box/Box.types.d.ts.map +1 -0
  12. package/dist/common-components/Box/index.d.ts +3 -0
  13. package/dist/common-components/Box/index.d.ts.map +1 -0
  14. package/dist/common-components/Button/Button.cjs +1 -0
  15. package/dist/common-components/Button/Button.const.cjs +1 -0
  16. package/dist/common-components/Button/Button.const.d.ts +5 -0
  17. package/dist/common-components/Button/Button.const.d.ts.map +1 -0
  18. package/dist/common-components/Button/Button.const.js +7 -0
  19. package/dist/common-components/Button/Button.d.ts +4 -0
  20. package/dist/common-components/Button/Button.d.ts.map +1 -0
  21. package/dist/common-components/Button/Button.js +28 -0
  22. package/dist/common-components/Button/Button.types.d.ts +6 -0
  23. package/dist/common-components/Button/Button.types.d.ts.map +1 -0
  24. package/dist/common-components/Button/index.d.ts +3 -0
  25. package/dist/common-components/Button/index.d.ts.map +1 -0
  26. package/dist/common-components/Canvas/Canvas.cjs +1 -0
  27. package/dist/common-components/Canvas/Canvas.const.cjs +1 -0
  28. package/dist/common-components/Canvas/Canvas.const.d.ts +2 -0
  29. package/dist/common-components/Canvas/Canvas.const.d.ts.map +1 -0
  30. package/dist/common-components/Canvas/Canvas.const.js +4 -0
  31. package/dist/common-components/Canvas/Canvas.d.ts +4 -0
  32. package/dist/common-components/Canvas/Canvas.d.ts.map +1 -0
  33. package/dist/common-components/Canvas/Canvas.js +14 -0
  34. package/dist/common-components/Canvas/Canvas.types.d.ts +5 -0
  35. package/dist/common-components/Canvas/Canvas.types.d.ts.map +1 -0
  36. package/dist/common-components/Canvas/index.d.ts +3 -0
  37. package/dist/common-components/Canvas/index.d.ts.map +1 -0
  38. package/dist/common-components/ContextMenu/ContextMenu.cjs +1 -0
  39. package/dist/common-components/ContextMenu/ContextMenu.const.cjs +1 -0
  40. package/dist/common-components/ContextMenu/ContextMenu.const.d.ts +11 -0
  41. package/dist/common-components/ContextMenu/ContextMenu.const.d.ts.map +1 -0
  42. package/dist/common-components/ContextMenu/ContextMenu.const.js +14 -0
  43. package/dist/common-components/ContextMenu/ContextMenu.d.ts +4 -0
  44. package/dist/common-components/ContextMenu/ContextMenu.d.ts.map +1 -0
  45. package/dist/common-components/ContextMenu/ContextMenu.js +69 -0
  46. package/dist/common-components/ContextMenu/ContextMenu.types.d.ts +33 -0
  47. package/dist/common-components/ContextMenu/ContextMenu.types.d.ts.map +1 -0
  48. package/dist/common-components/ContextMenu/ContextMenu.utils.cjs +1 -0
  49. package/dist/common-components/ContextMenu/ContextMenu.utils.d.ts +3 -0
  50. package/dist/common-components/ContextMenu/ContextMenu.utils.d.ts.map +1 -0
  51. package/dist/common-components/ContextMenu/ContextMenu.utils.js +11 -0
  52. package/dist/common-components/ContextMenu/ContextMenu.utils.test.d.ts +2 -0
  53. package/dist/common-components/ContextMenu/ContextMenu.utils.test.d.ts.map +1 -0
  54. package/dist/common-components/ContextMenu/index.d.ts +5 -0
  55. package/dist/common-components/ContextMenu/index.d.ts.map +1 -0
  56. package/dist/common-components/Field/Field.cjs +1 -0
  57. package/dist/common-components/Field/Field.const.cjs +1 -0
  58. package/dist/common-components/Field/Field.const.d.ts +3 -0
  59. package/dist/common-components/Field/Field.const.d.ts.map +1 -0
  60. package/dist/common-components/Field/Field.const.js +5 -0
  61. package/dist/common-components/Field/Field.d.ts +4 -0
  62. package/dist/common-components/Field/Field.d.ts.map +1 -0
  63. package/dist/common-components/Field/Field.js +26 -0
  64. package/dist/common-components/Field/Field.types.d.ts +10 -0
  65. package/dist/common-components/Field/Field.types.d.ts.map +1 -0
  66. package/dist/common-components/Field/index.d.ts +3 -0
  67. package/dist/common-components/Field/index.d.ts.map +1 -0
  68. package/dist/common-components/icons/GripIcon.cjs +1 -0
  69. package/dist/common-components/icons/GripIcon.d.ts +3 -0
  70. package/dist/common-components/icons/GripIcon.d.ts.map +1 -0
  71. package/dist/common-components/icons/GripIcon.js +13 -0
  72. package/dist/common-components/icons/Icon.const.cjs +1 -0
  73. package/dist/common-components/icons/Icon.const.d.ts +7 -0
  74. package/dist/common-components/icons/Icon.const.d.ts.map +1 -0
  75. package/dist/common-components/icons/Icon.const.js +10 -0
  76. package/dist/common-components/icons/RedoIcon.cjs +1 -0
  77. package/dist/common-components/icons/RedoIcon.d.ts +3 -0
  78. package/dist/common-components/icons/RedoIcon.d.ts.map +1 -0
  79. package/dist/common-components/icons/RedoIcon.js +9 -0
  80. package/dist/common-components/icons/UndoIcon.cjs +1 -0
  81. package/dist/common-components/icons/UndoIcon.d.ts +3 -0
  82. package/dist/common-components/icons/UndoIcon.d.ts.map +1 -0
  83. package/dist/common-components/icons/UndoIcon.js +9 -0
  84. package/dist/common-components/icons/index.d.ts +4 -0
  85. package/dist/common-components/icons/index.d.ts.map +1 -0
  86. package/dist/common-components/index.d.ts +12 -0
  87. package/dist/common-components/index.d.ts.map +1 -0
  88. package/dist/components/InkEditor/InkEditor.cjs +1 -1
  89. package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
  90. package/dist/components/InkEditor/InkEditor.js +917 -432
  91. package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.cjs +1 -0
  92. package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.const.cjs +1 -0
  93. package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.const.d.ts +7 -0
  94. package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.const.d.ts.map +1 -0
  95. package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.const.js +10 -0
  96. package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.d.ts +4 -0
  97. package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.d.ts.map +1 -0
  98. package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.js +17 -0
  99. package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.types.d.ts +12 -0
  100. package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.types.d.ts.map +1 -0
  101. package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.utils.cjs +1 -0
  102. package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.utils.d.ts +4 -0
  103. package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.utils.d.ts.map +1 -0
  104. package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.utils.js +25 -0
  105. package/dist/components/InkEditor/components/AiAutocomplete/index.d.ts +5 -0
  106. package/dist/components/InkEditor/components/AiAutocomplete/index.d.ts.map +1 -0
  107. package/dist/components/InkEditor/components/AiPanel/AiPanel.cjs +1 -1
  108. package/dist/components/InkEditor/components/AiPanel/AiPanel.d.ts +1 -0
  109. package/dist/components/InkEditor/components/AiPanel/AiPanel.d.ts.map +1 -1
  110. package/dist/components/InkEditor/components/AiPanel/AiPanel.js +53 -49
  111. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.cjs +1 -1
  112. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.const.cjs +1 -0
  113. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.const.d.ts +15 -0
  114. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.const.d.ts.map +1 -0
  115. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.const.js +18 -0
  116. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.d.ts +1 -6
  117. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.d.ts.map +1 -1
  118. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.js +53 -8
  119. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.types.d.ts +9 -0
  120. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.types.d.ts.map +1 -0
  121. package/dist/components/InkEditor/components/BlockHandles/index.d.ts +2 -1
  122. package/dist/components/InkEditor/components/BlockHandles/index.d.ts.map +1 -1
  123. package/dist/components/InkEditor/components/FindReplace/FindReplace.cjs +1 -1
  124. package/dist/components/InkEditor/components/FindReplace/FindReplace.d.ts.map +1 -1
  125. package/dist/components/InkEditor/components/FindReplace/FindReplace.js +63 -44
  126. package/dist/components/InkEditor/components/FindReplace/FindReplace.types.d.ts +2 -0
  127. package/dist/components/InkEditor/components/FindReplace/FindReplace.types.d.ts.map +1 -1
  128. package/dist/components/InkEditor/components/FindReplace/index.d.ts +1 -1
  129. package/dist/components/InkEditor/components/FindReplace/index.d.ts.map +1 -1
  130. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.cjs +1 -0
  131. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.const.cjs +1 -0
  132. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.const.d.ts +25 -0
  133. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.const.d.ts.map +1 -0
  134. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.const.js +28 -0
  135. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.d.ts +4 -0
  136. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.d.ts.map +1 -0
  137. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.js +140 -0
  138. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.types.d.ts +32 -0
  139. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.types.d.ts.map +1 -0
  140. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.utils.cjs +1 -0
  141. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.utils.d.ts +4 -0
  142. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.utils.d.ts.map +1 -0
  143. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.utils.js +16 -0
  144. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.utils.test.d.ts +2 -0
  145. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.utils.test.d.ts.map +1 -0
  146. package/dist/components/InkEditor/components/InlineToolbar/index.d.ts +5 -0
  147. package/dist/components/InkEditor/components/InlineToolbar/index.d.ts.map +1 -0
  148. package/dist/components/InkEditor/components/SignPad/SignPad.cjs +1 -1
  149. package/dist/components/InkEditor/components/SignPad/SignPad.d.ts.map +1 -1
  150. package/dist/components/InkEditor/components/SignPad/SignPad.js +47 -51
  151. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.cjs +1 -1
  152. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.d.ts.map +1 -1
  153. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.js +20 -16
  154. package/dist/components/InkEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -1
  155. package/dist/components/InkEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +16 -12
  156. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.cjs +1 -0
  157. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.const.cjs +1 -0
  158. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.const.d.ts +10 -0
  159. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.const.d.ts.map +1 -0
  160. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.const.js +18 -0
  161. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.d.ts +4 -0
  162. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.d.ts.map +1 -0
  163. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.js +43 -0
  164. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.types.d.ts +12 -0
  165. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.types.d.ts.map +1 -0
  166. package/dist/components/InkEditor/components/ToolbarCustomize/index.d.ts +4 -0
  167. package/dist/components/InkEditor/components/ToolbarCustomize/index.d.ts.map +1 -0
  168. package/dist/components/InkEditor/components/index.d.ts +7 -1
  169. package/dist/components/InkEditor/components/index.d.ts.map +1 -1
  170. package/dist/components/InkEditor/helpers/format.utils.cjs +2 -1
  171. package/dist/components/InkEditor/helpers/format.utils.d.ts +9 -0
  172. package/dist/components/InkEditor/helpers/format.utils.d.ts.map +1 -1
  173. package/dist/components/InkEditor/helpers/format.utils.js +113 -20
  174. package/dist/components/InkEditor/helpers/index.d.ts +1 -1
  175. package/dist/components/InkEditor/helpers/index.d.ts.map +1 -1
  176. package/dist/constants/blocks.const.cjs +1 -0
  177. package/dist/constants/blocks.const.d.ts +11 -0
  178. package/dist/constants/blocks.const.d.ts.map +1 -0
  179. package/dist/constants/blocks.const.js +14 -0
  180. package/dist/constants/colorMode.const.cjs +1 -0
  181. package/dist/constants/colorMode.const.d.ts +6 -0
  182. package/dist/constants/colorMode.const.d.ts.map +1 -0
  183. package/dist/constants/colorMode.const.js +7 -0
  184. package/dist/constants/contextMenu.const.cjs +1 -0
  185. package/dist/constants/contextMenu.const.d.ts +37 -0
  186. package/dist/constants/contextMenu.const.d.ts.map +1 -0
  187. package/dist/constants/contextMenu.const.js +39 -0
  188. package/dist/constants/defaultIcons.cjs +1 -0
  189. package/dist/constants/defaultIcons.d.ts +4 -0
  190. package/dist/constants/defaultIcons.d.ts.map +1 -0
  191. package/dist/constants/defaultIcons.js +42 -0
  192. package/dist/constants/defaults.const.cjs +1 -1
  193. package/dist/constants/defaults.const.d.ts +4 -0
  194. package/dist/constants/defaults.const.d.ts.map +1 -1
  195. package/dist/constants/defaults.const.js +56 -48
  196. package/dist/constants/findReplaceMenu.const.cjs +1 -0
  197. package/dist/constants/findReplaceMenu.const.d.ts +10 -0
  198. package/dist/constants/findReplaceMenu.const.d.ts.map +1 -0
  199. package/dist/constants/findReplaceMenu.const.js +14 -0
  200. package/dist/constants/fonts.const.cjs +1 -0
  201. package/dist/constants/fonts.const.d.ts +25 -0
  202. package/dist/constants/fonts.const.d.ts.map +1 -0
  203. package/dist/constants/fonts.const.js +40 -0
  204. package/dist/constants/index.d.ts +11 -0
  205. package/dist/constants/index.d.ts.map +1 -1
  206. package/dist/constants/keyboard.const.cjs +1 -0
  207. package/dist/constants/keyboard.const.d.ts +5 -0
  208. package/dist/constants/keyboard.const.d.ts.map +1 -0
  209. package/dist/constants/keyboard.const.js +7 -0
  210. package/dist/constants/lists.const.cjs +1 -0
  211. package/dist/constants/lists.const.d.ts +24 -0
  212. package/dist/constants/lists.const.d.ts.map +1 -0
  213. package/dist/constants/lists.const.js +28 -0
  214. package/dist/constants/numbers.cjs +1 -1
  215. package/dist/constants/numbers.js +30 -15
  216. package/dist/constants/openai.const.cjs +1 -0
  217. package/dist/constants/openai.const.d.ts +42 -0
  218. package/dist/constants/openai.const.d.ts.map +1 -0
  219. package/dist/constants/openai.const.js +58 -0
  220. package/dist/constants/premium.const.cjs +1 -1
  221. package/dist/constants/premium.const.d.ts +1 -2
  222. package/dist/constants/premium.const.d.ts.map +1 -1
  223. package/dist/constants/premium.const.js +6 -34
  224. package/dist/constants/table.const.cjs +1 -0
  225. package/dist/constants/table.const.d.ts +8 -0
  226. package/dist/constants/table.const.d.ts.map +1 -0
  227. package/dist/constants/table.const.js +10 -0
  228. package/dist/constants/toolbar.const.cjs +1 -1
  229. package/dist/constants/toolbar.const.d.ts +7 -0
  230. package/dist/constants/toolbar.const.d.ts.map +1 -1
  231. package/dist/constants/toolbar.const.js +11 -4
  232. package/dist/constants/toolbarMenu.const.cjs +1 -0
  233. package/dist/constants/toolbarMenu.const.d.ts +20 -0
  234. package/dist/constants/toolbarMenu.const.d.ts.map +1 -0
  235. package/dist/constants/toolbarMenu.const.js +66 -0
  236. package/dist/index.cjs +1 -1
  237. package/dist/index.d.ts +7 -4
  238. package/dist/index.d.ts.map +1 -1
  239. package/dist/index.js +103 -47
  240. package/dist/plugins/ai/demoProvider.cjs +1 -1
  241. package/dist/plugins/ai/demoProvider.d.ts.map +1 -1
  242. package/dist/plugins/ai/demoProvider.js +65 -40
  243. package/dist/plugins/ai/index.cjs +1 -1
  244. package/dist/plugins/ai/index.d.ts +3 -1
  245. package/dist/plugins/ai/index.d.ts.map +1 -1
  246. package/dist/plugins/ai/index.js +28 -14
  247. package/dist/plugins/ai/inkServerProvider.cjs +1 -0
  248. package/dist/plugins/ai/inkServerProvider.d.ts +4 -0
  249. package/dist/plugins/ai/inkServerProvider.d.ts.map +1 -0
  250. package/dist/plugins/ai/inkServerProvider.js +52 -0
  251. package/dist/plugins/ai/inkServerProvider.types.d.ts +15 -0
  252. package/dist/plugins/ai/inkServerProvider.types.d.ts.map +1 -0
  253. package/dist/plugins/ai/openaiProvider.cjs +1 -0
  254. package/dist/plugins/ai/openaiProvider.d.ts +4 -0
  255. package/dist/plugins/ai/openaiProvider.d.ts.map +1 -0
  256. package/dist/plugins/ai/openaiProvider.js +128 -0
  257. package/dist/plugins/ai/openaiProvider.types.d.ts +32 -0
  258. package/dist/plugins/ai/openaiProvider.types.d.ts.map +1 -0
  259. package/dist/plugins/ai/openaiProvider.utils.cjs +5 -0
  260. package/dist/plugins/ai/openaiProvider.utils.d.ts +14 -0
  261. package/dist/plugins/ai/openaiProvider.utils.d.ts.map +1 -0
  262. package/dist/plugins/ai/openaiProvider.utils.js +57 -0
  263. package/dist/styles.css +1 -721
  264. package/dist/types/ai.types.d.ts +2 -1
  265. package/dist/types/ai.types.d.ts.map +1 -1
  266. package/dist/types/features.types.d.ts +3 -1
  267. package/dist/types/features.types.d.ts.map +1 -1
  268. package/dist/types/index.d.ts +1 -1
  269. package/dist/types/index.d.ts.map +1 -1
  270. package/dist/types/ink.types.d.ts +7 -2
  271. package/dist/types/ink.types.d.ts.map +1 -1
  272. package/dist/types/premium.types.d.ts +1 -1
  273. package/dist/types/premium.types.d.ts.map +1 -1
  274. package/dist/utils/blocks.utils.cjs +1 -1
  275. package/dist/utils/blocks.utils.d.ts +8 -0
  276. package/dist/utils/blocks.utils.d.ts.map +1 -1
  277. package/dist/utils/blocks.utils.js +61 -19
  278. package/dist/utils/blocks.utils.test.d.ts +2 -0
  279. package/dist/utils/blocks.utils.test.d.ts.map +1 -0
  280. package/dist/utils/comments.utils.cjs +1 -1
  281. package/dist/utils/comments.utils.js +23 -18
  282. package/dist/utils/history.utils.cjs +1 -1
  283. package/dist/utils/history.utils.js +7 -2
  284. package/dist/utils/index.d.ts +6 -2
  285. package/dist/utils/index.d.ts.map +1 -1
  286. package/dist/utils/license.utils.cjs +1 -1
  287. package/dist/utils/license.utils.js +15 -10
  288. package/dist/utils/paste.utils.cjs +1 -1
  289. package/dist/utils/paste.utils.js +27 -23
  290. package/dist/utils/premium.utils.cjs +1 -1
  291. package/dist/utils/premium.utils.js +23 -18
  292. package/dist/utils/selection.utils.cjs +1 -0
  293. package/dist/utils/selection.utils.d.ts +10 -0
  294. package/dist/utils/selection.utils.d.ts.map +1 -0
  295. package/dist/utils/selection.utils.js +58 -0
  296. package/dist/utils/selection.utils.test.d.ts +2 -0
  297. package/dist/utils/selection.utils.test.d.ts.map +1 -0
  298. package/dist/utils/slash.utils.cjs +1 -1
  299. package/dist/utils/slash.utils.js +13 -8
  300. package/dist/utils/table.utils.cjs +1 -1
  301. package/dist/utils/table.utils.d.ts +5 -0
  302. package/dist/utils/table.utils.d.ts.map +1 -1
  303. package/dist/utils/table.utils.js +69 -10
  304. package/dist/utils/table.utils.test.d.ts +2 -0
  305. package/dist/utils/table.utils.test.d.ts.map +1 -0
  306. package/dist/utils/toolbarStorage.utils.cjs +1 -0
  307. package/dist/utils/toolbarStorage.utils.d.ts +12 -0
  308. package/dist/utils/toolbarStorage.utils.d.ts.map +1 -0
  309. package/dist/utils/toolbarStorage.utils.js +92 -0
  310. package/dist/utils/toolbarStorage.utils.test.d.ts +2 -0
  311. package/dist/utils/toolbarStorage.utils.test.d.ts.map +1 -0
  312. package/dist/utils/trackChanges.utils.cjs +1 -1
  313. package/dist/utils/trackChanges.utils.js +14 -9
  314. package/dist/utils/typo.utils.cjs +1 -1
  315. package/dist/utils/typo.utils.js +15 -10
  316. package/package.json +2 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("./AiAutocomplete.const.cjs"),l=i=>{const{suggestion:e,position:t,visible:s}=i;return!s||!e?null:n.jsx("span",{className:o.AI_AUTOCOMPLETE_CLASS,style:{top:t.top,left:t.left},"aria-hidden":o.AI_AUTOCOMPLETE_ARIA_HIDDEN,children:e})};exports.AiAutocomplete=l;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../../../../constants/numbers.cjs"),_="Ink-AiAutocomplete",A=!0,T=E.NUMBER_SIX*E.NUMBER_ONE_HUNDRED,O=E.NUMBER_FOUR*E.NUMBER_ONE_HUNDRED,M=E.NUMBER_FOUR,U="insertText";exports.AI_AUTOCOMPLETE_ARIA_HIDDEN=A;exports.AI_AUTOCOMPLETE_CARET_OFFSET_Y_PX=M;exports.AI_AUTOCOMPLETE_CLASS=_;exports.AI_AUTOCOMPLETE_COMMAND_INSERT_TEXT=U;exports.AI_AUTOCOMPLETE_DEBOUNCE_MS=T;exports.AI_AUTOCOMPLETE_MAX_PREFIX_CHARS=O;
@@ -0,0 +1,7 @@
1
+ export declare const AI_AUTOCOMPLETE_CLASS = "Ink-AiAutocomplete";
2
+ export declare const AI_AUTOCOMPLETE_ARIA_HIDDEN = true;
3
+ export declare const AI_AUTOCOMPLETE_DEBOUNCE_MS: number;
4
+ export declare const AI_AUTOCOMPLETE_MAX_PREFIX_CHARS: number;
5
+ export declare const AI_AUTOCOMPLETE_CARET_OFFSET_Y_PX = 4;
6
+ export declare const AI_AUTOCOMPLETE_COMMAND_INSERT_TEXT = "insertText";
7
+ //# sourceMappingURL=AiAutocomplete.const.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiAutocomplete.const.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiAutocomplete/AiAutocomplete.const.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB,uBAAuB,CAAC;AAC1D,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAChD,eAAO,MAAM,2BAA2B,QAAkC,CAAC;AAC3E,eAAO,MAAM,gCAAgC,QAAmC,CAAC;AACjF,eAAO,MAAM,iCAAiC,IAAc,CAAC;AAC7D,eAAO,MAAM,mCAAmC,eAAe,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { NUMBER_SIX as A, NUMBER_ONE_HUNDRED as E, NUMBER_FOUR as _ } from "../../../../constants/numbers.js";
2
+ const O = "Ink-AiAutocomplete", t = !0, M = A * E, I = _ * E, U = _, o = "insertText";
3
+ export {
4
+ t as AI_AUTOCOMPLETE_ARIA_HIDDEN,
5
+ U as AI_AUTOCOMPLETE_CARET_OFFSET_Y_PX,
6
+ O as AI_AUTOCOMPLETE_CLASS,
7
+ o as AI_AUTOCOMPLETE_COMMAND_INSERT_TEXT,
8
+ M as AI_AUTOCOMPLETE_DEBOUNCE_MS,
9
+ I as AI_AUTOCOMPLETE_MAX_PREFIX_CHARS
10
+ };
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { AiAutocompleteProps } from './AiAutocomplete.types';
3
+ export declare const AiAutocomplete: FC<AiAutocompleteProps>;
4
+ //# sourceMappingURL=AiAutocomplete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiAutocomplete.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiAutocomplete/AiAutocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAalD,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { AI_AUTOCOMPLETE_ARIA_HIDDEN as s, AI_AUTOCOMPLETE_CLASS as n } from "./AiAutocomplete.const.js";
3
+ const p = (e) => {
4
+ const { suggestion: t, position: o, visible: i } = e;
5
+ return !i || !t ? null : /* @__PURE__ */ r(
6
+ "span",
7
+ {
8
+ className: n,
9
+ style: { top: o.top, left: o.left },
10
+ "aria-hidden": s,
11
+ children: t
12
+ }
13
+ );
14
+ };
15
+ export {
16
+ p as AiAutocomplete
17
+ };
@@ -0,0 +1,12 @@
1
+ export interface AiAutocompletePosition {
2
+ top: number;
3
+ left: number;
4
+ }
5
+ export interface AiAutocompleteProps {
6
+ suggestion: string;
7
+ position: AiAutocompletePosition;
8
+ visible: boolean;
9
+ onAccept: () => void;
10
+ onDismiss: () => void;
11
+ }
12
+ //# sourceMappingURL=AiAutocomplete.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiAutocomplete.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiAutocomplete/AiAutocomplete.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,sBAAsB,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../../constants/generals.const.cjs"),s=require("../../../../constants/numbers.cjs"),i=require("./AiAutocomplete.const.cjs"),l=(e,t=i.AI_AUTOCOMPLETE_MAX_PREFIX_CHARS)=>{const n=window.getSelection();if(!n||n.rangeCount===s.NUMBER_ZERO||!n.isCollapsed||!e.contains(n.anchorNode))return c.EMPTY_STRING;const r=n.getRangeAt(s.NUMBER_ZERO),o=document.createRange();return o.selectNodeContents(e),o.setEnd(r.startContainer,r.startOffset),o.toString().slice(-t)},a=e=>{const t=window.getSelection();if(!t||t.rangeCount===s.NUMBER_ZERO||!t.isCollapsed||!e.contains(t.anchorNode))return null;const r=t.getRangeAt(s.NUMBER_ZERO).getBoundingClientRect(),o=e.getBoundingClientRect();return{top:r.top-o.top+e.scrollTop+i.AI_AUTOCOMPLETE_CARET_OFFSET_Y_PX,left:r.left-o.left+e.scrollLeft}};exports.getCaretPositionInRoot=a;exports.getTextBeforeCaret=l;
@@ -0,0 +1,4 @@
1
+ import { AiAutocompletePosition } from './AiAutocomplete.types';
2
+ export declare const getTextBeforeCaret: (root: HTMLElement, maxChars?: number) => string;
3
+ export declare const getCaretPositionInRoot: (root: HTMLElement) => AiAutocompletePosition | null;
4
+ //# sourceMappingURL=AiAutocomplete.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiAutocomplete.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiAutocomplete/AiAutocomplete.utils.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,eAAO,MAAM,kBAAkB,GAC7B,MAAM,WAAW,EACjB,iBAA2C,KAC1C,MAcF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,MAAM,WAAW,KAAG,sBAAsB,GAAG,IAenF,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { EMPTY_STRING as s } from "../../../../constants/generals.const.js";
2
+ import { NUMBER_ZERO as c } from "../../../../constants/numbers.js";
3
+ import { AI_AUTOCOMPLETE_MAX_PREFIX_CHARS as i, AI_AUTOCOMPLETE_CARET_OFFSET_Y_PX as l } from "./AiAutocomplete.const.js";
4
+ const R = (t, e = i) => {
5
+ const n = window.getSelection();
6
+ if (!n || n.rangeCount === c || !n.isCollapsed)
7
+ return s;
8
+ if (!t.contains(n.anchorNode))
9
+ return s;
10
+ const r = n.getRangeAt(c), o = document.createRange();
11
+ return o.selectNodeContents(t), o.setEnd(r.startContainer, r.startOffset), o.toString().slice(-e);
12
+ }, u = (t) => {
13
+ const e = window.getSelection();
14
+ if (!e || e.rangeCount === c || !e.isCollapsed || !t.contains(e.anchorNode))
15
+ return null;
16
+ const r = e.getRangeAt(c).getBoundingClientRect(), o = t.getBoundingClientRect();
17
+ return {
18
+ top: r.top - o.top + t.scrollTop + l,
19
+ left: r.left - o.left + t.scrollLeft
20
+ };
21
+ };
22
+ export {
23
+ u as getCaretPositionInRoot,
24
+ R as getTextBeforeCaret
25
+ };
@@ -0,0 +1,5 @@
1
+ export { AiAutocomplete } from './AiAutocomplete';
2
+ export type { AiAutocompleteProps, AiAutocompletePosition } from './AiAutocomplete.types';
3
+ export { AI_AUTOCOMPLETE_DEBOUNCE_MS, AI_AUTOCOMPLETE_MAX_PREFIX_CHARS, AI_AUTOCOMPLETE_COMMAND_INSERT_TEXT, } from './AiAutocomplete.const';
4
+ export { getTextBeforeCaret, getCaretPositionInRoot } from './AiAutocomplete.utils';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiAutocomplete/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EACL,2BAA2B,EAC3B,gCAAgC,EAChC,mCAAmC,GACpC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),I=require("../../../../constants/defaults.const.cjs"),O=require("../../../../constants/aiModels.const.cjs"),P=require("../../../../plugins/ai/aiPlugin.cjs"),C=require("../../../../utils/id.utils.cjs");require("../../../../utils/paste.utils.cjs");const G=w=>{var p,N,f,y;const{config:s,documentHtml:k,selectionHtml:v,onApplyHtml:T,onClose:b}=w,[a,L]=i.useState("chat"),[x,g]=i.useState(""),[r,_]=i.useState([]),[l,j]=i.useState(!1),[o,h]=i.useState(null),[H,D]=i.useState([]),[A,q]=i.useState(I.INK_TRANSLATE_LANGUAGES[1]),M=s.providerId||O.INK_AI_DEMO_PROVIDER_ID,R=((p=s.uiTheme)==null?void 0:p.className)||s.className||"",c=async(t,d,u)=>{var S;j(!0);try{const E=t==="chat"&&u?[...r,{id:C.createInkId("turn"),role:"user",content:u,timestamp:Date.now(),capability:t}]:r;t==="chat"&&u&&_(E);const n=await P.inkAi.runProvider(M,{capability:t,html:k,selectionHtml:v||void 0,prompt:u,history:E,options:d,modelId:s.modelId,documentSnapshot:{html:k,selectionHtml:v||void 0}});(S=n.turns)!=null&&S.length?_(m=>[...m,...n.turns]):n.text&&t!=="chat"&&_(m=>[...m,{id:C.createInkId("turn"),role:"assistant",content:n.text||"",timestamp:Date.now(),capability:t}]),n.diff&&h(n.diff),n.reviewSuggestions&&D(n.reviewSuggestions)}finally{j(!1)}},K=t=>{t.preventDefault();const d=x.trim();!d||l||(g(""),c("chat",void 0,d))};return e.jsxs("aside",{className:`Ink-Ai ${R}`.trim(),"data-placement":s.placement||"sidebar",style:{"--ink-ai-accent":(N=s.uiTheme)==null?void 0:N.accent,"--ink-ai-surface":(f=s.uiTheme)==null?void 0:f.surface,"--ink-ai-border":(y=s.uiTheme)==null?void 0:y.border},"aria-label":"Ink AI",children:[e.jsxs("div",{className:"Ink-Ai__header",children:[e.jsx("strong",{children:"Ink AI"}),b?e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:b,title:"Close AI",children:"×"}):null]}),e.jsx("div",{className:"Ink-Ai__tabs",role:"tablist",children:["chat","actions","review","translate"].map(t=>e.jsx("button",{type:"button",role:"tab",className:`Ink-Editor__button${a===t?" Ink-Editor__button--active":""}`,"aria-selected":a===t,onClick:()=>L(t),children:t},t))}),e.jsxs("div",{className:"Ink-Ai__body",children:[a==="chat"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"Ink-Ai__history",children:r.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"}),"."]}):r.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:K,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)."}),I.INK_QUICK_ACTIONS.map(t=>e.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Ai__action",disabled:l,onClick:()=>void c(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 c("review"),children:"Run grammar & style review"}),H.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:A,onChange:t=>q(t.target.value),children:I.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 c("translate",{language:A}),children:"Translate"})]}):null,o?e.jsxs("div",{className:"Ink-Ai__diff",children:[e.jsx("strong",{children:"Suggested change"}),e.jsx("p",{children:o.summary}),e.jsx("div",{className:"Ink-Ai__diff-preview",dangerouslySetInnerHTML:{__html:o.suggestedHtml}}),e.jsxs("div",{className:"Ink-Ai__diff-actions",children:[e.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Editor__button--active",onClick:()=>{T(o.suggestedHtml),h(null)},children:"Apply"}),e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:()=>h(null),children:"Dismiss"})]})]}):null]}),e.jsx("footer",{className:"Ink-Ai__footer",children:"Demo provider · BYO LLM"})]})};exports.AiPanel=G;
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;
@@ -6,6 +6,7 @@ export interface AiPanelProps {
6
6
  selectionHtml: string;
7
7
  onApplyHtml: (html: string) => void;
8
8
  onClose?: () => void;
9
+ onBusyChange?: (busy: boolean) => void;
9
10
  }
10
11
  export declare const AiPanel: FC<AiPanelProps>;
11
12
  //# sourceMappingURL=AiPanel.d.ts.map
@@ -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;CACtB;AAID,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CA6NpC,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;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,85 +1,89 @@
1
- import { jsxs as n, jsx as t, Fragment as j } from "react/jsx-runtime";
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 T, INK_QUICK_ACTIONS as G } from "../../../../constants/defaults.const.js";
4
- import { INK_AI_DEMO_PROVIDER_ID as P } from "../../../../constants/aiModels.const.js";
5
- import { inkAi as Q } from "../../../../plugins/ai/aiPlugin.js";
6
- import { createInkId as H } from "../../../../utils/id.utils.js";
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";
5
+ import "../../../../constants/openai.const.js";
6
+ import { createInkId as D } from "../../../../utils/id.utils.js";
7
7
  import "../../../../utils/paste.utils.js";
8
- const W = (D) => {
9
- var N, y, E, C;
10
- const { config: i, documentHtml: k, selectionHtml: v, onApplyHtml: L, onClose: p } = D, [a, x] = l("chat"), [b, g] = l(""), [r, _] = l([]), [o, f] = l(!1), [c, h] = l(null), [M, R] = l([]), [A, K] = l(T[1]), O = i.providerId || P, $ = ((N = i.uiTheme) == null ? void 0 : N.className) || i.className || "", d = async (e, u, m) => {
11
- var w;
12
- f(!0);
8
+ 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) => {
15
+ var S;
16
+ N(!0);
13
17
  try {
14
- const S = e === "chat" && m ? [
18
+ const T = e === "chat" && m ? [
15
19
  ...r,
16
20
  {
17
- id: H("turn"),
21
+ id: D("turn"),
18
22
  role: "user",
19
23
  content: m,
20
24
  timestamp: Date.now(),
21
25
  capability: e
22
26
  }
23
27
  ] : r;
24
- e === "chat" && m && _(S);
25
- const s = await Q.runProvider(O, {
28
+ e === "chat" && m && h(T);
29
+ const s = await F.runProvider(B, {
26
30
  capability: e,
27
- html: k,
31
+ html: p,
28
32
  selectionHtml: v || void 0,
29
33
  prompt: m,
30
- history: S,
34
+ history: T,
31
35
  options: u,
32
36
  modelId: i.modelId,
33
- documentSnapshot: { html: k, selectionHtml: v || void 0 }
37
+ documentSnapshot: { html: p, selectionHtml: v || void 0 }
34
38
  });
35
- (w = s.turns) != null && w.length ? _((I) => [...I, ...s.turns]) : s.text && e !== "chat" && _((I) => [
36
- ...I,
39
+ (S = s.turns) != null && S.length ? h((k) => [...k, ...s.turns]) : s.text && e !== "chat" && h((k) => [
40
+ ...k,
37
41
  {
38
- id: H("turn"),
42
+ id: D("turn"),
39
43
  role: "assistant",
40
44
  content: s.text || "",
41
45
  timestamp: Date.now(),
42
46
  capability: e
43
47
  }
44
- ]), s.diff && h(s.diff), s.reviewSuggestions && R(s.reviewSuggestions);
48
+ ]), s.diff && I(s.diff), s.reviewSuggestions && O(s.reviewSuggestions);
45
49
  } finally {
46
- f(!1);
50
+ N(!1);
47
51
  }
48
- }, B = (e) => {
52
+ }, G = (e) => {
49
53
  e.preventDefault();
50
- const u = b.trim();
51
- !u || o || (g(""), d("chat", void 0, u));
54
+ const u = f.trim();
55
+ !u || a || (g(""), d("chat", void 0, u));
52
56
  };
53
57
  return /* @__PURE__ */ n(
54
58
  "aside",
55
59
  {
56
- className: `Ink-Ai ${$}`.trim(),
60
+ className: `Ink-Ai ${j}`.trim(),
57
61
  "data-placement": i.placement || "sidebar",
58
62
  style: {
59
- "--ink-ai-accent": (y = i.uiTheme) == null ? void 0 : y.accent,
60
- "--ink-ai-surface": (E = i.uiTheme) == null ? void 0 : E.surface,
63
+ "--ink-ai-accent": (E = i.uiTheme) == null ? void 0 : E.accent,
64
+ "--ink-ai-surface": (w = i.uiTheme) == null ? void 0 : w.surface,
61
65
  "--ink-ai-border": (C = i.uiTheme) == null ? void 0 : C.border
62
66
  },
63
67
  "aria-label": "Ink AI",
64
68
  children: [
65
69
  /* @__PURE__ */ n("div", { className: "Ink-Ai__header", children: [
66
70
  /* @__PURE__ */ t("strong", { children: "Ink AI" }),
67
- p ? /* @__PURE__ */ t("button", { type: "button", className: "Ink-Editor__button", onClick: p, title: "Close AI", children: "×" }) : null
71
+ b ? /* @__PURE__ */ t("button", { type: "button", className: "Ink-Editor__button", onClick: b, title: "Close AI", children: "×" }) : null
68
72
  ] }),
69
73
  /* @__PURE__ */ t("div", { className: "Ink-Ai__tabs", role: "tablist", children: ["chat", "actions", "review", "translate"].map((e) => /* @__PURE__ */ t(
70
74
  "button",
71
75
  {
72
76
  type: "button",
73
77
  role: "tab",
74
- className: `Ink-Editor__button${a === e ? " Ink-Editor__button--active" : ""}`,
75
- "aria-selected": a === e,
76
- onClick: () => x(e),
78
+ className: `Ink-Editor__button${o === e ? " Ink-Editor__button--active" : ""}`,
79
+ "aria-selected": o === e,
80
+ onClick: () => M(e),
77
81
  children: e
78
82
  },
79
83
  e
80
84
  )) }),
81
85
  /* @__PURE__ */ n("div", { className: "Ink-Ai__body", children: [
82
- a === "chat" ? /* @__PURE__ */ n(j, { children: [
86
+ o === "chat" ? /* @__PURE__ */ n(P, { children: [
83
87
  /* @__PURE__ */ t("div", { className: "Ink-Ai__history", children: r.length === 0 ? /* @__PURE__ */ n("p", { className: "Ink-Ai__empty", children: [
84
88
  "Multi-turn chat with local demo provider. Bring your own LLM via",
85
89
  " ",
@@ -89,61 +93,61 @@ const W = (D) => {
89
93
  /* @__PURE__ */ t("span", { children: e.role }),
90
94
  /* @__PURE__ */ t("p", { children: e.content })
91
95
  ] }, e.id)) }),
92
- /* @__PURE__ */ n("form", { className: "Ink-Ai__form", onSubmit: B, children: [
96
+ /* @__PURE__ */ n("form", { className: "Ink-Ai__form", onSubmit: G, children: [
93
97
  /* @__PURE__ */ t(
94
98
  "input",
95
99
  {
96
- value: b,
100
+ value: f,
97
101
  onChange: (e) => g(e.target.value),
98
102
  placeholder: "Ask Ink AI…",
99
- disabled: o
103
+ disabled: a
100
104
  }
101
105
  ),
102
- /* @__PURE__ */ t("button", { type: "submit", className: "Ink-Editor__button Ink-Editor__button--active", disabled: o, children: "Send" })
106
+ /* @__PURE__ */ t("button", { type: "submit", className: "Ink-Editor__button Ink-Editor__button--active", disabled: a, children: "Send" })
103
107
  ] })
104
108
  ] }) : null,
105
- a === "actions" ? /* @__PURE__ */ n("div", { className: "Ink-Ai__actions", children: [
109
+ o === "actions" ? /* @__PURE__ */ n("div", { className: "Ink-Ai__actions", children: [
106
110
  /* @__PURE__ */ t("p", { className: "Ink-Ai__hint", children: "Quick actions use the current selection (or full document)." }),
107
- G.map((e) => /* @__PURE__ */ t(
111
+ Q.map((e) => /* @__PURE__ */ t(
108
112
  "button",
109
113
  {
110
114
  type: "button",
111
115
  className: "Ink-Editor__button Ink-Ai__action",
112
- disabled: o,
116
+ disabled: a,
113
117
  onClick: () => void d(e.capability),
114
118
  children: e.label
115
119
  },
116
120
  e.id
117
121
  ))
118
122
  ] }) : null,
119
- a === "review" ? /* @__PURE__ */ n("div", { className: "Ink-Ai__review", children: [
123
+ o === "review" ? /* @__PURE__ */ n("div", { className: "Ink-Ai__review", children: [
120
124
  /* @__PURE__ */ t(
121
125
  "button",
122
126
  {
123
127
  type: "button",
124
128
  className: "Ink-Editor__button Ink-Editor__button--active",
125
- disabled: o,
129
+ disabled: a,
126
130
  onClick: () => void d("review"),
127
131
  children: "Run grammar & style review"
128
132
  }
129
133
  ),
130
- M.map((e) => /* @__PURE__ */ n("article", { className: `Ink-Ai__suggestion Ink-Ai__suggestion--${e.severity}`, children: [
134
+ K.map((e) => /* @__PURE__ */ n("article", { className: `Ink-Ai__suggestion Ink-Ai__suggestion--${e.severity}`, children: [
131
135
  /* @__PURE__ */ t("strong", { children: e.severity }),
132
136
  /* @__PURE__ */ t("p", { children: e.message }),
133
137
  /* @__PURE__ */ t("code", { children: e.suggestedText })
134
138
  ] }, e.id))
135
139
  ] }) : null,
136
- a === "translate" ? /* @__PURE__ */ n("div", { className: "Ink-Ai__translate", children: [
140
+ o === "translate" ? /* @__PURE__ */ n("div", { className: "Ink-Ai__translate", children: [
137
141
  /* @__PURE__ */ n("label", { children: [
138
142
  "Language",
139
- /* @__PURE__ */ t("select", { value: A, onChange: (e) => K(e.target.value), children: T.map((e) => /* @__PURE__ */ t("option", { value: e, children: e }, e)) })
143
+ /* @__PURE__ */ t("select", { value: A, onChange: (e) => $(e.target.value), children: H.map((e) => /* @__PURE__ */ t("option", { value: e, children: e }, e)) })
140
144
  ] }),
141
145
  /* @__PURE__ */ t(
142
146
  "button",
143
147
  {
144
148
  type: "button",
145
149
  className: "Ink-Editor__button Ink-Editor__button--active",
146
- disabled: o,
150
+ disabled: a,
147
151
  onClick: () => void d("translate", { language: A }),
148
152
  children: "Translate"
149
153
  }
@@ -160,12 +164,12 @@ const W = (D) => {
160
164
  type: "button",
161
165
  className: "Ink-Editor__button Ink-Editor__button--active",
162
166
  onClick: () => {
163
- L(c.suggestedHtml), h(null);
167
+ x(c.suggestedHtml), I(null);
164
168
  },
165
169
  children: "Apply"
166
170
  }
167
171
  ),
168
- /* @__PURE__ */ t("button", { type: "button", className: "Ink-Editor__button", onClick: () => h(null), children: "Dismiss" })
172
+ /* @__PURE__ */ t("button", { type: "button", className: "Ink-Editor__button", onClick: () => I(null), children: "Dismiss" })
169
173
  ] })
170
174
  ] }) : null
171
175
  ] }),
@@ -175,5 +179,5 @@ const W = (D) => {
175
179
  );
176
180
  };
177
181
  export {
178
- W as AiPanel
182
+ te as AiPanel
179
183
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=t=>{const{visible:n,top:l,onMoveUp:o,onMoveDown:s}=t;return n?e.jsxs("div",{className:"Ink-BlockHandles",style:{top:l},"aria-hidden":!n,children:[e.jsx("button",{type:"button",className:"Ink-BlockHandles__grip",title:"Block",tabIndex:-1,children:"⋮⋮"}),e.jsx("button",{type:"button",className:"Ink-BlockHandles__btn",title:"Move block up",onClick:o,children:"↑"}),e.jsx("button",{type:"button",className:"Ink-BlockHandles__btn",title:"Move block down",onClick:s,children:"↓"})]}):null};exports.BlockHandles=c;
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;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../../../../constants/blocks.const.cjs"),_="Ink-BlockHandles",A="Ink-BlockHandles__plus",S="Ink-BlockHandles__grip",E="Ink-BlockHandles__btn",D="+",B="↑",C="↓",O="Add",N="Drag block",o="Move block up",H="Move block down",n="text/plain",K="move",c=L.BLOCK_DRAG_PAYLOAD;exports.BLOCK_HANDLES_BTN_CLASS=E;exports.BLOCK_HANDLES_CLASS=_;exports.BLOCK_HANDLES_DOWN_LABEL=C;exports.BLOCK_HANDLES_DRAG_EFFECT_MOVE=K;exports.BLOCK_HANDLES_DRAG_MIME=n;exports.BLOCK_HANDLES_DRAG_PAYLOAD=c;exports.BLOCK_HANDLES_GRIP_CLASS=S;exports.BLOCK_HANDLES_PLUS_CLASS=A;exports.BLOCK_HANDLES_PLUS_LABEL=D;exports.BLOCK_HANDLES_TITLE_DOWN=H;exports.BLOCK_HANDLES_TITLE_GRIP=N;exports.BLOCK_HANDLES_TITLE_PLUS=O;exports.BLOCK_HANDLES_TITLE_UP=o;exports.BLOCK_HANDLES_UP_LABEL=B;
@@ -0,0 +1,15 @@
1
+ export declare const BLOCK_HANDLES_CLASS = "Ink-BlockHandles";
2
+ export declare const BLOCK_HANDLES_PLUS_CLASS = "Ink-BlockHandles__plus";
3
+ export declare const BLOCK_HANDLES_GRIP_CLASS = "Ink-BlockHandles__grip";
4
+ export declare const BLOCK_HANDLES_BTN_CLASS = "Ink-BlockHandles__btn";
5
+ export declare const BLOCK_HANDLES_PLUS_LABEL = "+";
6
+ export declare const BLOCK_HANDLES_UP_LABEL = "\u2191";
7
+ export declare const BLOCK_HANDLES_DOWN_LABEL = "\u2193";
8
+ export declare const BLOCK_HANDLES_TITLE_PLUS = "Add";
9
+ export declare const BLOCK_HANDLES_TITLE_GRIP = "Drag block";
10
+ export declare const BLOCK_HANDLES_TITLE_UP = "Move block up";
11
+ export declare const BLOCK_HANDLES_TITLE_DOWN = "Move block down";
12
+ export declare const BLOCK_HANDLES_DRAG_MIME = "text/plain";
13
+ export declare const BLOCK_HANDLES_DRAG_EFFECT_MOVE = "move";
14
+ export declare const BLOCK_HANDLES_DRAG_PAYLOAD = "ink-block";
15
+ //# sourceMappingURL=BlockHandles.const.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockHandles.const.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/BlockHandles/BlockHandles.const.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AACtD,eAAO,MAAM,wBAAwB,2BAA2B,CAAC;AACjE,eAAO,MAAM,wBAAwB,2BAA2B,CAAC;AACjE,eAAO,MAAM,uBAAuB,0BAA0B,CAAC;AAC/D,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAC5C,eAAO,MAAM,sBAAsB,WAAM,CAAC;AAC1C,eAAO,MAAM,wBAAwB,WAAM,CAAC;AAC5C,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAC9C,eAAO,MAAM,wBAAwB,eAAe,CAAC;AACrD,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AACtD,eAAO,MAAM,wBAAwB,oBAAoB,CAAC;AAC1D,eAAO,MAAM,uBAAuB,eAAe,CAAC;AACpD,eAAO,MAAM,8BAA8B,SAAS,CAAC;AACrD,eAAO,MAAM,0BAA0B,cAAqB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { BLOCK_DRAG_PAYLOAD as _ } from "../../../../constants/blocks.const.js";
2
+ const A = "Ink-BlockHandles", o = "Ink-BlockHandles__plus", n = "Ink-BlockHandles__grip", E = "Ink-BlockHandles__btn", S = "+", B = "↑", D = "↓", c = "Add", C = "Drag block", O = "Move block up", s = "Move block down", t = "text/plain", H = "move", N = _;
3
+ export {
4
+ E as BLOCK_HANDLES_BTN_CLASS,
5
+ A as BLOCK_HANDLES_CLASS,
6
+ D as BLOCK_HANDLES_DOWN_LABEL,
7
+ H as BLOCK_HANDLES_DRAG_EFFECT_MOVE,
8
+ t as BLOCK_HANDLES_DRAG_MIME,
9
+ N as BLOCK_HANDLES_DRAG_PAYLOAD,
10
+ n as BLOCK_HANDLES_GRIP_CLASS,
11
+ o as BLOCK_HANDLES_PLUS_CLASS,
12
+ S as BLOCK_HANDLES_PLUS_LABEL,
13
+ s as BLOCK_HANDLES_TITLE_DOWN,
14
+ C as BLOCK_HANDLES_TITLE_GRIP,
15
+ c as BLOCK_HANDLES_TITLE_PLUS,
16
+ O as BLOCK_HANDLES_TITLE_UP,
17
+ B as BLOCK_HANDLES_UP_LABEL
18
+ };
@@ -1,9 +1,4 @@
1
1
  import { FC } from 'react';
2
- export interface BlockHandlesProps {
3
- visible: boolean;
4
- top: number;
5
- onMoveUp: () => void;
6
- onMoveDown: () => void;
7
- }
2
+ import { BlockHandlesProps } from './BlockHandles.types';
8
3
  export declare const BlockHandles: FC<BlockHandlesProps>;
9
4
  //# sourceMappingURL=BlockHandles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlockHandles.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/BlockHandles/BlockHandles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAgB9C,CAAC"}
1
+ {"version":3,"file":"BlockHandles.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/BlockHandles/BlockHandles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAehC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAyC9C,CAAC"}
@@ -1,12 +1,57 @@
1
- import { jsxs as s, jsx as n } from "react/jsx-runtime";
2
- const a = (e) => {
3
- const { visible: t, top: l, onMoveUp: o, onMoveDown: c } = e;
4
- return t ? /* @__PURE__ */ s("div", { className: "Ink-BlockHandles", style: { top: l }, "aria-hidden": !t, children: [
5
- /* @__PURE__ */ n("button", { type: "button", className: "Ink-BlockHandles__grip", title: "Block", tabIndex: -1, children: "⋮⋮" }),
6
- /* @__PURE__ */ n("button", { type: "button", className: "Ink-BlockHandles__btn", title: "Move block up", onClick: o, children: "↑" }),
7
- /* @__PURE__ */ n("button", { type: "button", className: "Ink-BlockHandles__btn", title: "Move block down", onClick: c, children: "↓" })
1
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
+ import "../../../../constants/openai.const.js";
3
+ import "../../../../utils/paste.utils.js";
4
+ import "react";
5
+ import "react-dom";
6
+ 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 = (_) => {
9
+ const { visible: L, top: e, onMoveUp: n, onMoveDown: r, onDragStart: i } = _;
10
+ return L ? /* @__PURE__ */ l("div", { className: a, style: { top: e }, "aria-hidden": !L, children: [
11
+ /* @__PURE__ */ t(
12
+ "button",
13
+ {
14
+ type: "button",
15
+ className: A,
16
+ title: s,
17
+ tabIndex: -1,
18
+ children: N
19
+ }
20
+ ),
21
+ /* @__PURE__ */ t(
22
+ "button",
23
+ {
24
+ type: "button",
25
+ className: C,
26
+ title: E,
27
+ tabIndex: -1,
28
+ draggable: !0,
29
+ onDragStart: i,
30
+ children: /* @__PURE__ */ t(S, {})
31
+ }
32
+ ),
33
+ /* @__PURE__ */ t(
34
+ "button",
35
+ {
36
+ type: "button",
37
+ className: o,
38
+ title: B,
39
+ onClick: n,
40
+ children: c
41
+ }
42
+ ),
43
+ /* @__PURE__ */ t(
44
+ "button",
45
+ {
46
+ type: "button",
47
+ className: o,
48
+ title: p,
49
+ onClick: r,
50
+ children: m
51
+ }
52
+ )
8
53
  ] }) : null;
9
54
  };
10
55
  export {
11
- a as BlockHandles
56
+ I as BlockHandles
12
57
  };
@@ -0,0 +1,9 @@
1
+ import { DragEvent } from 'react';
2
+ export interface BlockHandlesProps {
3
+ visible: boolean;
4
+ top: number;
5
+ onMoveUp: () => void;
6
+ onMoveDown: () => void;
7
+ onDragStart?: (event: DragEvent<HTMLButtonElement>) => void;
8
+ }
9
+ //# sourceMappingURL=BlockHandles.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockHandles.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/BlockHandles/BlockHandles.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAC7D"}
@@ -1,3 +1,4 @@
1
1
  export { BlockHandles } from './BlockHandles';
2
- export type { BlockHandlesProps } from './BlockHandles';
2
+ export type { BlockHandlesProps } from './BlockHandles.types';
3
+ export { BLOCK_HANDLES_DRAG_EFFECT_MOVE, BLOCK_HANDLES_DRAG_MIME, BLOCK_HANDLES_DRAG_PAYLOAD, } from './BlockHandles.const';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/BlockHandles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/BlockHandles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EACL,8BAA8B,EAC9B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),_=require("../../../../constants/generals.const.cjs"),t=require("./FindReplace.const.cjs"),D=i=>{const{open:E,onClose:o,onReplace:u,findLabel:L=t.FIND_REPLACE_DEFAULT_FIND,replaceLabel:d=t.FIND_REPLACE_DEFAULT_REPLACE,replaceOneLabel:A=t.FIND_REPLACE_DEFAULT_ONE,replaceAllLabel:F=t.FIND_REPLACE_DEFAULT_ALL,closeLabel:b=t.FIND_REPLACE_DEFAULT_CLOSE,title:l=t.FIND_REPLACE_DEFAULT_TITLE}=i,[s,C]=r.useState(_.EMPTY_STRING),[a,N]=r.useState(_.EMPTY_STRING);if(!E)return null;const c=(n,I)=>{n.preventDefault(),s&&u(s,a,I)};return e.jsxs("form",{className:t.FIND_REPLACE_CLASS,"aria-label":l,onSubmit:n=>c(n,!1),children:[e.jsx("p",{className:t.FIND_REPLACE_TITLE_CLASS,children:l}),e.jsxs("label",{className:t.FIND_REPLACE_FIELD_CLASS,children:[e.jsx("span",{children:L}),e.jsx("input",{value:s,onChange:n=>C(n.target.value),autoFocus:!0})]}),e.jsxs("label",{className:t.FIND_REPLACE_FIELD_CLASS,children:[e.jsx("span",{children:d}),e.jsx("input",{value:a,onChange:n=>N(n.target.value)})]}),e.jsxs("div",{className:t.FIND_REPLACE_ACTIONS_CLASS,children:[e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:o,children:b}),e.jsx("button",{type:"submit",className:"Ink-Editor__button",disabled:!s,children:A}),e.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Editor__button--active",disabled:!s,onClick:n=>c(n,!0),children:F})]})]})};exports.FindReplace=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),o=require("../../../../constants/generals.const.cjs"),a=require("../../../../constants/findReplaceMenu.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const r=require("../../../../common-components/Button/Button.cjs"),u=require("../../../../common-components/Field/Field.cjs");require("react-dom");const e=require("./FindReplace.const.cjs"),p=L=>{const{open:F,onClose:C,onReplace:A,findLabel:D=e.FIND_REPLACE_DEFAULT_FIND,replaceLabel:N=e.FIND_REPLACE_DEFAULT_REPLACE,replaceOneLabel:R=e.FIND_REPLACE_DEFAULT_ONE,replaceAllLabel:d=e.FIND_REPLACE_DEFAULT_ALL,closeLabel:I=e.FIND_REPLACE_DEFAULT_CLOSE,title:c=e.FIND_REPLACE_DEFAULT_TITLE,focusField:s=a.FIND_REPLACE_FOCUS_FIND}=L,[l,S]=i.useState(o.EMPTY_STRING),[E,P]=i.useState(o.EMPTY_STRING);if(!F)return null;const _=(n,b)=>{n.preventDefault(),l&&A(l,E,b)};return t.jsxs("form",{className:e.FIND_REPLACE_CLASS,"aria-label":c,onSubmit:n=>_(n,!1),children:[t.jsx("p",{className:e.FIND_REPLACE_TITLE_CLASS,children:c}),t.jsx(u.Field,{className:e.FIND_REPLACE_FIELD_CLASS,label:D,value:l,onChange:S,autoFocus:s===a.FIND_REPLACE_FOCUS_FIND}),t.jsx(u.Field,{className:e.FIND_REPLACE_FIELD_CLASS,label:N,value:E,onChange:P,autoFocus:s===a.FIND_REPLACE_FOCUS_REPLACE}),t.jsxs("div",{className:e.FIND_REPLACE_ACTIONS_CLASS,children:[t.jsx(r.Button,{type:"button",onClick:C,children:I}),t.jsx(r.Button,{type:"submit",disabled:!l,children:R}),t.jsx(r.Button,{type:"button",active:!0,disabled:!l,onClick:n=>_(n,!0),children:d})]})]},s)};exports.FindReplace=p;
@@ -1 +1 @@
1
- {"version":3,"file":"FindReplace.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/FindReplace/FindReplace.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAc1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAoD5C,CAAC"}
1
+ {"version":3,"file":"FindReplace.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/FindReplace/FindReplace.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAmB1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA2D5C,CAAC"}