@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
@@ -1,49 +1,68 @@
1
- import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
- import { useState as E } from "react";
3
- import { EMPTY_STRING as _ } from "../../../../constants/generals.const.js";
4
- import { FIND_REPLACE_DEFAULT_TITLE as I, FIND_REPLACE_DEFAULT_FIND as D, FIND_REPLACE_DEFAULT_REPLACE as R, FIND_REPLACE_DEFAULT_ONE as S, FIND_REPLACE_DEFAULT_ALL as T, FIND_REPLACE_DEFAULT_CLOSE as h, FIND_REPLACE_CLASS as P, FIND_REPLACE_TITLE_CLASS as f, FIND_REPLACE_FIELD_CLASS as i, FIND_REPLACE_ACTIONS_CLASS as v } from "./FindReplace.const.js";
5
- const x = (s) => {
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import { useState as L } from "react";
3
+ import { EMPTY_STRING as n } from "../../../../constants/generals.const.js";
4
+ import { FIND_REPLACE_FOCUS_FIND as s, FIND_REPLACE_FOCUS_REPLACE as P } from "../../../../constants/findReplaceMenu.const.js";
5
+ import "../../../../constants/openai.const.js";
6
+ import "../../../../utils/paste.utils.js";
7
+ import { Button as E } from "../../../../common-components/Button/Button.js";
8
+ import { Field as c } from "../../../../common-components/Field/Field.js";
9
+ import "react-dom";
10
+ import { FIND_REPLACE_DEFAULT_FIND as S, FIND_REPLACE_DEFAULT_REPLACE as T, FIND_REPLACE_DEFAULT_ONE as h, FIND_REPLACE_DEFAULT_ALL as U, FIND_REPLACE_DEFAULT_CLOSE as O, FIND_REPLACE_DEFAULT_TITLE as v, FIND_REPLACE_CLASS as x, FIND_REPLACE_TITLE_CLASS as y, FIND_REPLACE_FIELD_CLASS as F, FIND_REPLACE_ACTIONS_CLASS as g } from "./FindReplace.const.js";
11
+ const J = (A) => {
6
12
  const {
7
- open: c,
8
- onClose: L,
9
- onReplace: u,
10
- findLabel: A = D,
11
- replaceLabel: d = R,
12
- replaceOneLabel: b = S,
13
- replaceAllLabel: p = T,
14
- closeLabel: C = h,
15
- title: a = I
16
- } = s, [l, N] = E(_), [o, F] = E(_);
17
- if (!c) return null;
18
- const r = (e, m) => {
19
- e.preventDefault(), l && u(l, o, m);
13
+ open: C,
14
+ onClose: m,
15
+ onReplace: p,
16
+ findLabel: D = S,
17
+ replaceLabel: N = T,
18
+ replaceOneLabel: u = h,
19
+ replaceAllLabel: I = U,
20
+ closeLabel: R = O,
21
+ title: a = v,
22
+ focusField: o = s
23
+ } = A, [l, d] = L(n), [r, b] = L(n);
24
+ if (!C) return null;
25
+ const _ = (t, f) => {
26
+ t.preventDefault(), l && p(l, r, f);
20
27
  };
21
- return /* @__PURE__ */ n("form", { className: P, "aria-label": a, onSubmit: (e) => r(e, !1), children: [
22
- /* @__PURE__ */ t("p", { className: f, children: a }),
23
- /* @__PURE__ */ n("label", { className: i, children: [
24
- /* @__PURE__ */ t("span", { children: A }),
25
- /* @__PURE__ */ t("input", { value: l, onChange: (e) => N(e.target.value), autoFocus: !0 })
26
- ] }),
27
- /* @__PURE__ */ n("label", { className: i, children: [
28
- /* @__PURE__ */ t("span", { children: d }),
29
- /* @__PURE__ */ t("input", { value: o, onChange: (e) => F(e.target.value) })
30
- ] }),
31
- /* @__PURE__ */ n("div", { className: v, children: [
32
- /* @__PURE__ */ t("button", { type: "button", className: "Ink-Editor__button", onClick: L, children: C }),
33
- /* @__PURE__ */ t("button", { type: "submit", className: "Ink-Editor__button", disabled: !l, children: b }),
34
- /* @__PURE__ */ t(
35
- "button",
36
- {
37
- type: "button",
38
- className: "Ink-Editor__button Ink-Editor__button--active",
39
- disabled: !l,
40
- onClick: (e) => r(e, !0),
41
- children: p
42
- }
43
- )
44
- ] })
45
- ] });
28
+ return /* @__PURE__ */ i(
29
+ "form",
30
+ {
31
+ className: x,
32
+ "aria-label": a,
33
+ onSubmit: (t) => _(t, !1),
34
+ children: [
35
+ /* @__PURE__ */ e("p", { className: y, children: a }),
36
+ /* @__PURE__ */ e(
37
+ c,
38
+ {
39
+ className: F,
40
+ label: D,
41
+ value: l,
42
+ onChange: d,
43
+ autoFocus: o === s
44
+ }
45
+ ),
46
+ /* @__PURE__ */ e(
47
+ c,
48
+ {
49
+ className: F,
50
+ label: N,
51
+ value: r,
52
+ onChange: b,
53
+ autoFocus: o === P
54
+ }
55
+ ),
56
+ /* @__PURE__ */ i("div", { className: g, children: [
57
+ /* @__PURE__ */ e(E, { type: "button", onClick: m, children: R }),
58
+ /* @__PURE__ */ e(E, { type: "submit", disabled: !l, children: u }),
59
+ /* @__PURE__ */ e(E, { type: "button", active: !0, disabled: !l, onClick: (t) => _(t, !0), children: I })
60
+ ] })
61
+ ]
62
+ },
63
+ o
64
+ );
46
65
  };
47
66
  export {
48
- x as FindReplace
67
+ J as FindReplace
49
68
  };
@@ -1,3 +1,4 @@
1
+ export type FindReplaceFocusField = 'find' | 'replace';
1
2
  export interface FindReplaceProps {
2
3
  open: boolean;
3
4
  onClose: () => void;
@@ -8,5 +9,6 @@ export interface FindReplaceProps {
8
9
  replaceAllLabel?: string;
9
10
  closeLabel?: string;
10
11
  title?: string;
12
+ focusField?: FindReplaceFocusField;
11
13
  }
12
14
  //# sourceMappingURL=FindReplace.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FindReplace.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/FindReplace/FindReplace.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"FindReplace.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/FindReplace/FindReplace.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,SAAS,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC"}
@@ -1,3 +1,3 @@
1
1
  export { FindReplace } from './FindReplace';
2
- export type { FindReplaceProps } from './FindReplace.types';
2
+ export type { FindReplaceFocusField, FindReplaceProps } from './FindReplace.types';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/FindReplace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/FindReplace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),a=require("react");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const E=require("../../../../common-components/Button/Button.cjs");require("react-dom");const I=require("./InlineToolbar.const.cjs"),d=R=>{const{open:A,top:B,left:C,icons:e,activeFormats:L,disabled:O=!1,onFormat:u,onLink:c,onClose:o}=R,r=a.useRef(null);if(a.useEffect(()=>{if(!A)return;const N=l=>{var t;const i=l.target;if(!(i instanceof Node)){o();return}(t=r.current)!=null&&t.contains(i)||o()},s=l=>{l.key===I.INLINE_TOOLBAR_KEY_ESCAPE&&o()};return window.addEventListener(I.INLINE_TOOLBAR_EVENT_POINTER_DOWN,N),window.addEventListener(I.INLINE_TOOLBAR_EVENT_KEY_DOWN,s),()=>{window.removeEventListener(I.INLINE_TOOLBAR_EVENT_POINTER_DOWN,N),window.removeEventListener(I.INLINE_TOOLBAR_EVENT_KEY_DOWN,s)}},[A,o]),!A)return null;const n=N=>{N.preventDefault()},T=N=>{u(N)};return _.jsxs("div",{ref:r,className:I.INLINE_TOOLBAR_CLASS,role:I.INLINE_TOOLBAR_ROLE,"aria-label":I.INLINE_TOOLBAR_ARIA_LABEL,style:{top:B,left:C},onPointerDown:N=>N.stopPropagation(),children:[_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_BOLD,"aria-label":I.INLINE_TOOLBAR_TITLE_BOLD,"aria-pressed":L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_BOLD),active:L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_BOLD),disabled:O,onMouseDown:n,onClick:()=>T(I.INLINE_TOOLBAR_ACTION_BOLD),children:e.bold}),_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_ITALIC,"aria-label":I.INLINE_TOOLBAR_TITLE_ITALIC,"aria-pressed":L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_ITALIC),active:L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_ITALIC),disabled:O,onMouseDown:n,onClick:()=>T(I.INLINE_TOOLBAR_ACTION_ITALIC),children:e.italic}),_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_UNDERLINE,"aria-label":I.INLINE_TOOLBAR_TITLE_UNDERLINE,"aria-pressed":L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_UNDERLINE),active:L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_UNDERLINE),disabled:O,onMouseDown:n,onClick:()=>T(I.INLINE_TOOLBAR_ACTION_UNDERLINE),children:e.underline}),_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_CODE,"aria-label":I.INLINE_TOOLBAR_TITLE_CODE,"aria-pressed":L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_CODE),active:L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_CODE),disabled:O,onMouseDown:n,onClick:()=>T(I.INLINE_TOOLBAR_ACTION_CODE),children:e.code}),_.jsx("span",{className:I.INLINE_TOOLBAR_DIVIDER_CLASS,"aria-hidden":"true"}),_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_LINK,"aria-label":I.INLINE_TOOLBAR_TITLE_LINK,disabled:O,"data-action":I.INLINE_TOOLBAR_LINK_ID,onMouseDown:n,onClick:c,children:e.link}),_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_CLEAR,"aria-label":I.INLINE_TOOLBAR_TITLE_CLEAR,disabled:O,onMouseDown:n,onClick:()=>T(I.INLINE_TOOLBAR_ACTION_CLEAR),children:e.clearFormat})]})};exports.InlineToolbar=d;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("../../../../constants/numbers.cjs"),_="Ink-InlineToolbar",L="Ink-InlineToolbar__item",N="Ink-InlineToolbar__divider",E="toolbar",O="Inline formatting toolbar",T=I.NUMBER_EIGHT,A=I.NUMBER_EIGHT,R=I.NUMBER_TWO_HUNDRED_FIFTY,B=I.NUMBER_THIRTY_SIX,n="pointerdown",o="keydown",t="Escape",D="Bold",c="Italic",C="Underline",s="Code",e="Link",i="Clear formatting",l="bold",r="italic",S="underline",P="code",a="clearFormat",d="link";exports.INLINE_TOOLBAR_ACTION_BOLD=l;exports.INLINE_TOOLBAR_ACTION_CLEAR=a;exports.INLINE_TOOLBAR_ACTION_CODE=P;exports.INLINE_TOOLBAR_ACTION_ITALIC=r;exports.INLINE_TOOLBAR_ACTION_UNDERLINE=S;exports.INLINE_TOOLBAR_ARIA_LABEL=O;exports.INLINE_TOOLBAR_CLASS=_;exports.INLINE_TOOLBAR_DIVIDER_CLASS=N;exports.INLINE_TOOLBAR_EDGE_PADDING_PX=A;exports.INLINE_TOOLBAR_ESTIMATED_HEIGHT_PX=B;exports.INLINE_TOOLBAR_ESTIMATED_WIDTH_PX=R;exports.INLINE_TOOLBAR_EVENT_KEY_DOWN=o;exports.INLINE_TOOLBAR_EVENT_POINTER_DOWN=n;exports.INLINE_TOOLBAR_GAP_PX=T;exports.INLINE_TOOLBAR_ITEM_CLASS=L;exports.INLINE_TOOLBAR_KEY_ESCAPE=t;exports.INLINE_TOOLBAR_LINK_ID=d;exports.INLINE_TOOLBAR_ROLE=E;exports.INLINE_TOOLBAR_TITLE_BOLD=D;exports.INLINE_TOOLBAR_TITLE_CLEAR=i;exports.INLINE_TOOLBAR_TITLE_CODE=s;exports.INLINE_TOOLBAR_TITLE_ITALIC=c;exports.INLINE_TOOLBAR_TITLE_LINK=e;exports.INLINE_TOOLBAR_TITLE_UNDERLINE=C;
@@ -0,0 +1,25 @@
1
+ export declare const INLINE_TOOLBAR_CLASS = "Ink-InlineToolbar";
2
+ export declare const INLINE_TOOLBAR_ITEM_CLASS = "Ink-InlineToolbar__item";
3
+ export declare const INLINE_TOOLBAR_DIVIDER_CLASS = "Ink-InlineToolbar__divider";
4
+ export declare const INLINE_TOOLBAR_ROLE = "toolbar";
5
+ export declare const INLINE_TOOLBAR_ARIA_LABEL = "Inline formatting toolbar";
6
+ export declare const INLINE_TOOLBAR_GAP_PX = 8;
7
+ export declare const INLINE_TOOLBAR_EDGE_PADDING_PX = 8;
8
+ export declare const INLINE_TOOLBAR_ESTIMATED_WIDTH_PX = 250;
9
+ export declare const INLINE_TOOLBAR_ESTIMATED_HEIGHT_PX = 36;
10
+ export declare const INLINE_TOOLBAR_EVENT_POINTER_DOWN = "pointerdown";
11
+ export declare const INLINE_TOOLBAR_EVENT_KEY_DOWN = "keydown";
12
+ export declare const INLINE_TOOLBAR_KEY_ESCAPE = "Escape";
13
+ export declare const INLINE_TOOLBAR_TITLE_BOLD = "Bold";
14
+ export declare const INLINE_TOOLBAR_TITLE_ITALIC = "Italic";
15
+ export declare const INLINE_TOOLBAR_TITLE_UNDERLINE = "Underline";
16
+ export declare const INLINE_TOOLBAR_TITLE_CODE = "Code";
17
+ export declare const INLINE_TOOLBAR_TITLE_LINK = "Link";
18
+ export declare const INLINE_TOOLBAR_TITLE_CLEAR = "Clear formatting";
19
+ export declare const INLINE_TOOLBAR_ACTION_BOLD: "bold";
20
+ export declare const INLINE_TOOLBAR_ACTION_ITALIC: "italic";
21
+ export declare const INLINE_TOOLBAR_ACTION_UNDERLINE: "underline";
22
+ export declare const INLINE_TOOLBAR_ACTION_CODE: "code";
23
+ export declare const INLINE_TOOLBAR_ACTION_CLEAR: "clearFormat";
24
+ export declare const INLINE_TOOLBAR_LINK_ID = "link";
25
+ //# sourceMappingURL=InlineToolbar.const.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineToolbar.const.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/InlineToolbar/InlineToolbar.const.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,oBAAoB,sBAAsB,CAAC;AACxD,eAAO,MAAM,yBAAyB,4BAA4B,CAAC;AACnE,eAAO,MAAM,4BAA4B,+BAA+B,CAAC;AACzE,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,yBAAyB,8BAA8B,CAAC;AAErE,eAAO,MAAM,qBAAqB,IAAe,CAAC;AAClD,eAAO,MAAM,8BAA8B,IAAe,CAAC;AAC3D,eAAO,MAAM,iCAAiC,MAA2B,CAAC;AAC1E,eAAO,MAAM,kCAAkC,KAAoB,CAAC;AAEpE,eAAO,MAAM,iCAAiC,gBAAgB,CAAC;AAC/D,eAAO,MAAM,6BAA6B,YAAY,CAAC;AACvD,eAAO,MAAM,yBAAyB,WAAW,CAAC;AAElD,eAAO,MAAM,yBAAyB,SAAS,CAAC;AAChD,eAAO,MAAM,2BAA2B,WAAW,CAAC;AACpD,eAAO,MAAM,8BAA8B,cAAc,CAAC;AAC1D,eAAO,MAAM,yBAAyB,SAAS,CAAC;AAChD,eAAO,MAAM,yBAAyB,SAAS,CAAC;AAChD,eAAO,MAAM,0BAA0B,qBAAqB,CAAC;AAE7D,eAAO,MAAM,0BAA0B,QAAsD,CAAC;AAC9F,eAAO,MAAM,4BAA4B,UAAwD,CAAC;AAClG,eAAO,MAAM,+BAA+B,aACc,CAAC;AAC3D,eAAO,MAAM,0BAA0B,QAAsD,CAAC;AAC9F,eAAO,MAAM,2BAA2B,eACoB,CAAC;AAE7D,eAAO,MAAM,sBAAsB,SAAS,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { NUMBER_EIGHT as I, NUMBER_TWO_HUNDRED_FIFTY as _, NUMBER_THIRTY_SIX as L } from "../../../../constants/numbers.js";
2
+ const E = "Ink-InlineToolbar", O = "Ink-InlineToolbar__item", T = "Ink-InlineToolbar__divider", o = "toolbar", n = "Inline formatting toolbar", A = I, t = I, R = _, B = L, c = "pointerdown", s = "keydown", D = "Escape", e = "Bold", i = "Italic", l = "Underline", r = "Code", C = "Link", a = "Clear formatting", d = "bold", S = "italic", P = "underline", U = "code", b = "clearFormat", k = "link";
3
+ export {
4
+ d as INLINE_TOOLBAR_ACTION_BOLD,
5
+ b as INLINE_TOOLBAR_ACTION_CLEAR,
6
+ U as INLINE_TOOLBAR_ACTION_CODE,
7
+ S as INLINE_TOOLBAR_ACTION_ITALIC,
8
+ P as INLINE_TOOLBAR_ACTION_UNDERLINE,
9
+ n as INLINE_TOOLBAR_ARIA_LABEL,
10
+ E as INLINE_TOOLBAR_CLASS,
11
+ T as INLINE_TOOLBAR_DIVIDER_CLASS,
12
+ t as INLINE_TOOLBAR_EDGE_PADDING_PX,
13
+ B as INLINE_TOOLBAR_ESTIMATED_HEIGHT_PX,
14
+ R as INLINE_TOOLBAR_ESTIMATED_WIDTH_PX,
15
+ s as INLINE_TOOLBAR_EVENT_KEY_DOWN,
16
+ c as INLINE_TOOLBAR_EVENT_POINTER_DOWN,
17
+ A as INLINE_TOOLBAR_GAP_PX,
18
+ O as INLINE_TOOLBAR_ITEM_CLASS,
19
+ D as INLINE_TOOLBAR_KEY_ESCAPE,
20
+ k as INLINE_TOOLBAR_LINK_ID,
21
+ o as INLINE_TOOLBAR_ROLE,
22
+ e as INLINE_TOOLBAR_TITLE_BOLD,
23
+ a as INLINE_TOOLBAR_TITLE_CLEAR,
24
+ r as INLINE_TOOLBAR_TITLE_CODE,
25
+ i as INLINE_TOOLBAR_TITLE_ITALIC,
26
+ C as INLINE_TOOLBAR_TITLE_LINK,
27
+ l as INLINE_TOOLBAR_TITLE_UNDERLINE
28
+ };
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { InlineToolbarProps } from './InlineToolbar.types';
3
+ export declare const InlineToolbar: FC<InlineToolbarProps>;
4
+ //# sourceMappingURL=InlineToolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/InlineToolbar/InlineToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,EAAmB,MAAM,OAAO,CAAC;AAwBpE,OAAO,KAAK,EAEV,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA+HhD,CAAC"}
@@ -0,0 +1,140 @@
1
+ import { jsxs as K, jsx as o } from "react/jsx-runtime";
2
+ import { useRef as P, useEffect as g } from "react";
3
+ import "../../../../constants/openai.const.js";
4
+ import "../../../../utils/paste.utils.js";
5
+ import { Button as l } from "../../../../common-components/Button/Button.js";
6
+ import "react-dom";
7
+ import { INLINE_TOOLBAR_EVENT_POINTER_DOWN as B, INLINE_TOOLBAR_EVENT_KEY_DOWN as u, INLINE_TOOLBAR_ARIA_LABEL as x, INLINE_TOOLBAR_ROLE as y, INLINE_TOOLBAR_CLASS as V, INLINE_TOOLBAR_TITLE_BOLD as C, INLINE_TOOLBAR_ITEM_CLASS as _, INLINE_TOOLBAR_ACTION_BOLD as E, INLINE_TOOLBAR_TITLE_ITALIC as D, INLINE_TOOLBAR_ACTION_ITALIC as s, INLINE_TOOLBAR_TITLE_UNDERLINE as p, INLINE_TOOLBAR_ACTION_UNDERLINE as t, INLINE_TOOLBAR_TITLE_CODE as f, INLINE_TOOLBAR_ACTION_CODE as T, INLINE_TOOLBAR_DIVIDER_CLASS as j, INLINE_TOOLBAR_LINK_ID as U, INLINE_TOOLBAR_TITLE_LINK as h, INLINE_TOOLBAR_TITLE_CLEAR as w, INLINE_TOOLBAR_KEY_ESCAPE as W, INLINE_TOOLBAR_ACTION_CLEAR as Y } from "./InlineToolbar.const.js";
8
+ const Z = (b) => {
9
+ const {
10
+ open: O,
11
+ top: k,
12
+ left: m,
13
+ icons: L,
14
+ activeFormats: e,
15
+ disabled: I = !1,
16
+ onFormat: M,
17
+ onLink: S,
18
+ onClose: i
19
+ } = b, A = P(null);
20
+ if (g(() => {
21
+ if (!O) return;
22
+ const n = (a) => {
23
+ var c;
24
+ const R = a.target;
25
+ if (!(R instanceof Node)) {
26
+ i();
27
+ return;
28
+ }
29
+ (c = A.current) != null && c.contains(R) || i();
30
+ }, d = (a) => {
31
+ a.key === W && i();
32
+ };
33
+ return window.addEventListener(B, n), window.addEventListener(u, d), () => {
34
+ window.removeEventListener(B, n), window.removeEventListener(u, d);
35
+ };
36
+ }, [O, i]), !O) return null;
37
+ const N = (n) => {
38
+ n.preventDefault();
39
+ }, r = (n) => {
40
+ M(n);
41
+ };
42
+ return /* @__PURE__ */ K(
43
+ "div",
44
+ {
45
+ ref: A,
46
+ className: V,
47
+ role: y,
48
+ "aria-label": x,
49
+ style: { top: k, left: m },
50
+ onPointerDown: (n) => n.stopPropagation(),
51
+ children: [
52
+ /* @__PURE__ */ o(
53
+ l,
54
+ {
55
+ className: _,
56
+ title: C,
57
+ "aria-label": C,
58
+ "aria-pressed": e == null ? void 0 : e.has(E),
59
+ active: e == null ? void 0 : e.has(E),
60
+ disabled: I,
61
+ onMouseDown: N,
62
+ onClick: () => r(E),
63
+ children: L.bold
64
+ }
65
+ ),
66
+ /* @__PURE__ */ o(
67
+ l,
68
+ {
69
+ className: _,
70
+ title: D,
71
+ "aria-label": D,
72
+ "aria-pressed": e == null ? void 0 : e.has(s),
73
+ active: e == null ? void 0 : e.has(s),
74
+ disabled: I,
75
+ onMouseDown: N,
76
+ onClick: () => r(s),
77
+ children: L.italic
78
+ }
79
+ ),
80
+ /* @__PURE__ */ o(
81
+ l,
82
+ {
83
+ className: _,
84
+ title: p,
85
+ "aria-label": p,
86
+ "aria-pressed": e == null ? void 0 : e.has(t),
87
+ active: e == null ? void 0 : e.has(t),
88
+ disabled: I,
89
+ onMouseDown: N,
90
+ onClick: () => r(t),
91
+ children: L.underline
92
+ }
93
+ ),
94
+ /* @__PURE__ */ o(
95
+ l,
96
+ {
97
+ className: _,
98
+ title: f,
99
+ "aria-label": f,
100
+ "aria-pressed": e == null ? void 0 : e.has(T),
101
+ active: e == null ? void 0 : e.has(T),
102
+ disabled: I,
103
+ onMouseDown: N,
104
+ onClick: () => r(T),
105
+ children: L.code
106
+ }
107
+ ),
108
+ /* @__PURE__ */ o("span", { className: j, "aria-hidden": "true" }),
109
+ /* @__PURE__ */ o(
110
+ l,
111
+ {
112
+ className: _,
113
+ title: h,
114
+ "aria-label": h,
115
+ disabled: I,
116
+ "data-action": U,
117
+ onMouseDown: N,
118
+ onClick: S,
119
+ children: L.link
120
+ }
121
+ ),
122
+ /* @__PURE__ */ o(
123
+ l,
124
+ {
125
+ className: _,
126
+ title: w,
127
+ "aria-label": w,
128
+ disabled: I,
129
+ onMouseDown: N,
130
+ onClick: () => r(Y),
131
+ children: L.clearFormat
132
+ }
133
+ )
134
+ ]
135
+ }
136
+ );
137
+ };
138
+ export {
139
+ Z as InlineToolbar
140
+ };
@@ -0,0 +1,32 @@
1
+ import { ReactNode } from 'react';
2
+ import { ToolbarOption } from '../../../../types';
3
+ export type InlineToolbarFormatAction = Extract<ToolbarOption, 'bold' | 'italic' | 'underline' | 'code' | 'clearFormat'>;
4
+ export type InlineToolbarIcons = Record<InlineToolbarFormatAction | 'link', ReactNode>;
5
+ export interface InlineToolbarPosition {
6
+ top: number;
7
+ left: number;
8
+ }
9
+ export interface InlineToolbarProps {
10
+ open: boolean;
11
+ top: number;
12
+ left: number;
13
+ icons: InlineToolbarIcons;
14
+ activeFormats?: Set<string>;
15
+ disabled?: boolean;
16
+ onFormat: (action: InlineToolbarFormatAction) => void;
17
+ onLink: () => void;
18
+ onClose: () => void;
19
+ }
20
+ export interface InlineToolbarViewportBounds {
21
+ width: number;
22
+ height: number;
23
+ }
24
+ export interface ClampInlineToolbarPositionInput {
25
+ selectionRect: DOMRect | Pick<DOMRect, 'top' | 'left' | 'width' | 'height' | 'bottom'>;
26
+ toolbarWidth: number;
27
+ toolbarHeight: number;
28
+ viewport: InlineToolbarViewportBounds;
29
+ gap: number;
30
+ edgePadding: number;
31
+ }
32
+ //# sourceMappingURL=InlineToolbar.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineToolbar.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/InlineToolbar/InlineToolbar.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,aAAa,EACb,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,MAAM,GAAG,aAAa,CACzD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,MAAM,CACrC,yBAAyB,GAAG,MAAM,EAClC,SAAS,CACV,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,kBAAkB,CAAC;IAC1B,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,MAAM,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACtD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,+BAA+B;IAC9C,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC;IACvF,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,2BAA2B,CAAC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../../../constants/numbers.cjs"),M=n=>{const{selectionRect:t,toolbarWidth:o,toolbarHeight:r,viewport:a,gap:s,edgePadding:e}=n,c=t.top-r-s,d=t.left+t.width/i.NUMBER_TWO-o/i.NUMBER_TWO,l=Math.max(e,a.height-r-e),u=Math.max(e,a.width-o-e),m=c>=e?Math.min(c,l):Math.min(t.bottom+s,l),h=Math.min(Math.max(d,e),u);return{top:Number.isFinite(m)?m:i.NUMBER_ZERO,left:Number.isFinite(h)?h:i.NUMBER_ZERO}},f=(n,t)=>{if(!n||!t||n.rangeCount===i.NUMBER_ZERO)return!1;const o=n.anchorNode;return o?t.contains(o):!1};exports.clampInlineToolbarPosition=M;exports.selectionIsInsideElement=f;
@@ -0,0 +1,4 @@
1
+ import { ClampInlineToolbarPositionInput, InlineToolbarPosition } from './InlineToolbar.types';
2
+ export declare const clampInlineToolbarPosition: (input: ClampInlineToolbarPositionInput) => InlineToolbarPosition;
3
+ export declare const selectionIsInsideElement: (selection: Selection | null, root: HTMLElement | null) => boolean;
4
+ //# sourceMappingURL=InlineToolbar.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineToolbar.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/InlineToolbar/InlineToolbar.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,+BAA+B,EAC/B,qBAAqB,EACtB,MAAM,uBAAuB,CAAC;AAE/B,eAAO,MAAM,0BAA0B,GACrC,OAAO,+BAA+B,KACrC,qBAoBF,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,WAAW,SAAS,GAAG,IAAI,EAC3B,MAAM,WAAW,GAAG,IAAI,KACvB,OAKF,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { NUMBER_ZERO as i, NUMBER_TWO as l } from "../../../../constants/numbers.js";
2
+ const u = (n) => {
3
+ const { selectionRect: t, toolbarWidth: o, toolbarHeight: a, viewport: r, gap: s, edgePadding: e } = n, c = t.top - a - s, p = t.left + t.width / l - o / l, m = Math.max(e, r.height - a - e), d = Math.max(e, r.width - o - e), h = c >= e ? Math.min(c, m) : Math.min(t.bottom + s, m), f = Math.min(Math.max(p, e), d);
4
+ return {
5
+ top: Number.isFinite(h) ? h : i,
6
+ left: Number.isFinite(f) ? f : i
7
+ };
8
+ }, b = (n, t) => {
9
+ if (!n || !t || n.rangeCount === i) return !1;
10
+ const o = n.anchorNode;
11
+ return o ? t.contains(o) : !1;
12
+ };
13
+ export {
14
+ u as clampInlineToolbarPosition,
15
+ b as selectionIsInsideElement
16
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=InlineToolbar.utils.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineToolbar.utils.test.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/InlineToolbar/InlineToolbar.utils.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export { InlineToolbar } from './InlineToolbar';
2
+ export type { ClampInlineToolbarPositionInput, InlineToolbarFormatAction, InlineToolbarIcons, InlineToolbarPosition, InlineToolbarProps, InlineToolbarViewportBounds, } from './InlineToolbar.types';
3
+ export { INLINE_TOOLBAR_CLASS, INLINE_TOOLBAR_EDGE_PADDING_PX, INLINE_TOOLBAR_ESTIMATED_HEIGHT_PX, INLINE_TOOLBAR_ESTIMATED_WIDTH_PX, INLINE_TOOLBAR_GAP_PX, } from './InlineToolbar.const';
4
+ export { clampInlineToolbarPosition, selectionIsInsideElement } from './InlineToolbar.utils';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/InlineToolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACV,+BAA+B,EAC/B,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,oBAAoB,EACpB,8BAA8B,EAC9B,kCAAkC,EAClC,iCAAiC,EACjC,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("react"),a=require("../../../../constants/numbers.cjs"),n=require("./SignPad.const.cjs"),I=require("./SignPad.utils.cjs"),R=f=>{const{open:_,onClose:S,onConfirm:P,clearLabel:C=n.SIGN_PAD_DEFAULT_CLEAR,confirmLabel:E=n.SIGN_PAD_DEFAULT_CONFIRM,cancelLabel:D=n.SIGN_PAD_DEFAULT_CANCEL,title:d=n.SIGN_PAD_DEFAULT_TITLE}=f,r=l.useRef(null),s=l.useRef(!1),[N,u]=l.useState(!1);if(l.useEffect(()=>{if(!_){s.current=!1;return}const e=r.current,t=e==null?void 0:e.getContext("2d");!e||!t||(t.fillStyle=n.SIGN_PAD_FILL_STYLE,t.fillRect(a.NUMBER_ZERO,a.NUMBER_ZERO,e.width,e.height),t.strokeStyle=n.SIGN_PAD_STROKE_STYLE,t.lineWidth=n.SIGN_PAD_LINE_WIDTH,t.lineCap="round",t.lineJoin="round",s.current=!1,u(!1))},[_]),!_)return null;const L=e=>{const t=r.current,o=t==null?void 0:t.getContext("2d");if(!t||!o)return;s.current=!0,t.setPointerCapture(e.pointerId);const c=I.getCanvasPoint(t,e.clientX,e.clientY);o.beginPath(),o.moveTo(c.x,c.y)},b=e=>{if(!s.current)return;const t=r.current,o=t==null?void 0:t.getContext("2d");if(!t||!o)return;const c=I.getCanvasPoint(t,e.clientX,e.clientY);o.lineTo(c.x,c.y),o.stroke(),u(!0)},A=e=>{var t;s.current=!1,(t=r.current)==null||t.releasePointerCapture(e.pointerId)},h=()=>{const e=r.current,t=e==null?void 0:e.getContext("2d");!e||!t||(t.fillStyle=n.SIGN_PAD_FILL_STYLE,t.fillRect(a.NUMBER_ZERO,a.NUMBER_ZERO,e.width,e.height),u(!1))},g=()=>{const e=r.current;!e||!N||(P(e.toDataURL(n.SIGN_PAD_MIME)),S())};return i.jsxs("div",{className:n.SIGN_PAD_CLASS,role:"dialog","aria-modal":"true","aria-label":d,children:[i.jsx("p",{className:n.SIGN_PAD_TITLE_CLASS,children:d}),i.jsx("canvas",{ref:r,className:n.SIGN_PAD_CANVAS_CLASS,width:n.SIGN_PAD_CANVAS_WIDTH,height:n.SIGN_PAD_CANVAS_HEIGHT,onPointerDown:L,onPointerMove:b,onPointerUp:A,onPointerLeave:A}),i.jsxs("div",{className:n.SIGN_PAD_ACTIONS_CLASS,children:[i.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:h,children:C}),i.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:S,children:D}),i.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Editor__button--active",disabled:!N,onClick:g,children:E})]})]})};exports.SignPad=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("react"),a=require("../../../../constants/numbers.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const S=require("../../../../common-components/Button/Button.cjs"),x=require("../../../../common-components/Canvas/Canvas.cjs");require("react-dom");const n=require("./SignPad.const.cjs"),f=require("./SignPad.utils.cjs"),G=P=>{const{open:u,onClose:d,onConfirm:I,clearLabel:D=n.SIGN_PAD_DEFAULT_CLEAR,confirmLabel:L=n.SIGN_PAD_DEFAULT_CONFIRM,cancelLabel:E=n.SIGN_PAD_DEFAULT_CANCEL,title:A=n.SIGN_PAD_DEFAULT_TITLE}=P,r=l.useRef(null),s=l.useRef(!1),[C,_]=l.useState(!1);if(l.useEffect(()=>{if(!u){s.current=!1;return}const t=r.current,e=t==null?void 0:t.getContext("2d");!t||!e||(e.fillStyle=n.SIGN_PAD_FILL_STYLE,e.fillRect(a.NUMBER_ZERO,a.NUMBER_ZERO,t.width,t.height),e.strokeStyle=n.SIGN_PAD_STROKE_STYLE,e.lineWidth=n.SIGN_PAD_LINE_WIDTH,e.lineCap="round",e.lineJoin="round",s.current=!1,_(!1))},[u]),!u)return null;const h=t=>{const e=r.current,o=e==null?void 0:e.getContext("2d");if(!e||!o)return;s.current=!0,e.setPointerCapture(t.pointerId);const c=f.getCanvasPoint(e,t.clientX,t.clientY);o.beginPath(),o.moveTo(c.x,c.y)},g=t=>{if(!s.current)return;const e=r.current,o=e==null?void 0:e.getContext("2d");if(!e||!o)return;const c=f.getCanvasPoint(e,t.clientX,t.clientY);o.lineTo(c.x,c.y),o.stroke(),_(!0)},N=t=>{var e;s.current=!1,(e=r.current)==null||e.releasePointerCapture(t.pointerId)},R=()=>{const t=r.current,e=t==null?void 0:t.getContext("2d");!t||!e||(e.fillStyle=n.SIGN_PAD_FILL_STYLE,e.fillRect(a.NUMBER_ZERO,a.NUMBER_ZERO,t.width,t.height),_(!1))},T=()=>{const t=r.current;!t||!C||(I(t.toDataURL(n.SIGN_PAD_MIME)),d())};return i.jsxs("div",{className:n.SIGN_PAD_CLASS,role:"dialog","aria-modal":"true","aria-label":A,children:[i.jsx("p",{className:n.SIGN_PAD_TITLE_CLASS,children:A}),i.jsx(x.Canvas,{canvasRef:r,className:n.SIGN_PAD_CANVAS_CLASS,width:n.SIGN_PAD_CANVAS_WIDTH,height:n.SIGN_PAD_CANVAS_HEIGHT,onPointerDown:h,onPointerMove:g,onPointerUp:N,onPointerLeave:N}),i.jsxs("div",{className:n.SIGN_PAD_ACTIONS_CLASS,children:[i.jsx(S.Button,{type:"button",onClick:R,children:D}),i.jsx(S.Button,{type:"button",onClick:d,children:E}),i.jsx(S.Button,{type:"button",active:!0,disabled:!C,onClick:T,children:L})]})]})};exports.SignPad=G;
@@ -1 +1 @@
1
- {"version":3,"file":"SignPad.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/SignPad/SignPad.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,EAAE,EAAqB,MAAM,OAAO,CAAC;AAkBhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CA4GpC,CAAC"}
1
+ {"version":3,"file":"SignPad.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/SignPad/SignPad.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,EAAE,EAAqB,MAAM,OAAO,CAAC;AAmBhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAuGpC,CAAC"}
@@ -1,79 +1,75 @@
1
- import { jsxs as f, jsx as l } from "react/jsx-runtime";
2
- import { useRef as A, useState as p, useEffect as b } from "react";
1
+ import { jsxs as A, jsx as l } from "react/jsx-runtime";
2
+ import { useRef as C, useState as T, useEffect as G } from "react";
3
3
  import { NUMBER_ZERO as c } from "../../../../constants/numbers.js";
4
- import { SIGN_PAD_DEFAULT_TITLE as T, SIGN_PAD_DEFAULT_CLEAR as G, SIGN_PAD_DEFAULT_CONFIRM as g, SIGN_PAD_DEFAULT_CANCEL as x, SIGN_PAD_FILL_STYLE as I, SIGN_PAD_STROKE_STYLE as k, SIGN_PAD_LINE_WIDTH as R, SIGN_PAD_CLASS as w, SIGN_PAD_TITLE_CLASS as y, SIGN_PAD_CANVAS_HEIGHT as U, SIGN_PAD_CANVAS_WIDTH as F, SIGN_PAD_CANVAS_CLASS as H, SIGN_PAD_ACTIONS_CLASS as M, SIGN_PAD_MIME as v } from "./SignPad.const.js";
5
- import { getCanvasPoint as C } from "./SignPad.utils.js";
6
- const J = (N) => {
4
+ import "../../../../constants/openai.const.js";
5
+ import "../../../../utils/paste.utils.js";
6
+ import { Button as _ } from "../../../../common-components/Button/Button.js";
7
+ import { Canvas as g } from "../../../../common-components/Canvas/Canvas.js";
8
+ import "react-dom";
9
+ import { SIGN_PAD_DEFAULT_TITLE as x, SIGN_PAD_DEFAULT_CLEAR as R, SIGN_PAD_DEFAULT_CONFIRM as b, SIGN_PAD_DEFAULT_CANCEL as w, SIGN_PAD_FILL_STYLE as m, SIGN_PAD_STROKE_STYLE as y, SIGN_PAD_LINE_WIDTH as k, SIGN_PAD_CLASS as U, SIGN_PAD_TITLE_CLASS as F, SIGN_PAD_CANVAS_HEIGHT as H, SIGN_PAD_CANVAS_WIDTH as M, SIGN_PAD_CANVAS_CLASS as v, SIGN_PAD_ACTIONS_CLASS as O, SIGN_PAD_MIME as Y } from "./SignPad.const.js";
10
+ import { getCanvasPoint as I } from "./SignPad.utils.js";
11
+ const tt = (N) => {
7
12
  const {
8
13
  open: a,
9
- onClose: _,
14
+ onClose: u,
10
15
  onConfirm: D,
11
- clearLabel: m = G,
12
- confirmLabel: P = g,
13
- cancelLabel: h = x,
14
- title: u = T
15
- } = N, n = A(null), r = A(!1), [S, s] = p(!1);
16
- if (b(() => {
16
+ clearLabel: p = R,
17
+ confirmLabel: P = b,
18
+ cancelLabel: h = w,
19
+ title: S = x
20
+ } = N, n = C(null), o = C(!1), [f, s] = T(!1);
21
+ if (G(() => {
17
22
  if (!a) {
18
- r.current = !1;
23
+ o.current = !1;
19
24
  return;
20
25
  }
21
26
  const e = n.current, t = e == null ? void 0 : e.getContext("2d");
22
- !e || !t || (t.fillStyle = I, t.fillRect(c, c, e.width, e.height), t.strokeStyle = k, t.lineWidth = R, t.lineCap = "round", t.lineJoin = "round", r.current = !1, s(!1));
27
+ !e || !t || (t.fillStyle = m, t.fillRect(c, c, e.width, e.height), t.strokeStyle = y, t.lineWidth = k, t.lineCap = "round", t.lineJoin = "round", o.current = !1, s(!1));
23
28
  }, [a]), !a) return null;
24
29
  const L = (e) => {
25
- const t = n.current, o = t == null ? void 0 : t.getContext("2d");
26
- if (!t || !o) return;
27
- r.current = !0, t.setPointerCapture(e.pointerId);
28
- const i = C(t, e.clientX, e.clientY);
29
- o.beginPath(), o.moveTo(i.x, i.y);
30
+ const t = n.current, r = t == null ? void 0 : t.getContext("2d");
31
+ if (!t || !r) return;
32
+ o.current = !0, t.setPointerCapture(e.pointerId);
33
+ const i = I(t, e.clientX, e.clientY);
34
+ r.beginPath(), r.moveTo(i.x, i.y);
30
35
  }, E = (e) => {
31
- if (!r.current) return;
32
- const t = n.current, o = t == null ? void 0 : t.getContext("2d");
33
- if (!t || !o) return;
34
- const i = C(t, e.clientX, e.clientY);
35
- o.lineTo(i.x, i.y), o.stroke(), s(!0);
36
+ if (!o.current) return;
37
+ const t = n.current, r = t == null ? void 0 : t.getContext("2d");
38
+ if (!t || !r) return;
39
+ const i = I(t, e.clientX, e.clientY);
40
+ r.lineTo(i.x, i.y), r.stroke(), s(!0);
36
41
  }, d = (e) => {
37
42
  var t;
38
- r.current = !1, (t = n.current) == null || t.releasePointerCapture(e.pointerId);
43
+ o.current = !1, (t = n.current) == null || t.releasePointerCapture(e.pointerId);
39
44
  };
40
- return /* @__PURE__ */ f("div", { className: w, role: "dialog", "aria-modal": "true", "aria-label": u, children: [
41
- /* @__PURE__ */ l("p", { className: y, children: u }),
45
+ return /* @__PURE__ */ A("div", { className: U, role: "dialog", "aria-modal": "true", "aria-label": S, children: [
46
+ /* @__PURE__ */ l("p", { className: F, children: S }),
42
47
  /* @__PURE__ */ l(
43
- "canvas",
48
+ g,
44
49
  {
45
- ref: n,
46
- className: H,
47
- width: F,
48
- height: U,
50
+ canvasRef: n,
51
+ className: v,
52
+ width: M,
53
+ height: H,
49
54
  onPointerDown: L,
50
55
  onPointerMove: E,
51
56
  onPointerUp: d,
52
57
  onPointerLeave: d
53
58
  }
54
59
  ),
55
- /* @__PURE__ */ f("div", { className: M, children: [
56
- /* @__PURE__ */ l("button", { type: "button", className: "Ink-Editor__button", onClick: () => {
60
+ /* @__PURE__ */ A("div", { className: O, children: [
61
+ /* @__PURE__ */ l(_, { type: "button", onClick: () => {
57
62
  const e = n.current, t = e == null ? void 0 : e.getContext("2d");
58
- !e || !t || (t.fillStyle = I, t.fillRect(c, c, e.width, e.height), s(!1));
59
- }, children: m }),
60
- /* @__PURE__ */ l("button", { type: "button", className: "Ink-Editor__button", onClick: _, children: h }),
61
- /* @__PURE__ */ l(
62
- "button",
63
- {
64
- type: "button",
65
- className: "Ink-Editor__button Ink-Editor__button--active",
66
- disabled: !S,
67
- onClick: () => {
68
- const e = n.current;
69
- !e || !S || (D(e.toDataURL(v)), _());
70
- },
71
- children: P
72
- }
73
- )
63
+ !e || !t || (t.fillStyle = m, t.fillRect(c, c, e.width, e.height), s(!1));
64
+ }, children: p }),
65
+ /* @__PURE__ */ l(_, { type: "button", onClick: u, children: h }),
66
+ /* @__PURE__ */ l(_, { type: "button", active: !0, disabled: !f, onClick: () => {
67
+ const e = n.current;
68
+ !e || !f || (D(e.toDataURL(Y)), u());
69
+ }, children: P })
74
70
  ] })
75
71
  ] });
76
72
  };
77
73
  export {
78
- J as SignPad
74
+ tt as SignPad
79
75
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("../../../../constants/defaults.const.cjs"),l=require("../../../../utils/cn.utils.cjs");require("../../../../utils/paste.utils.cjs");const c=r=>{const{icon:n,title:e,active:t=!1,onClick:s,disabled:i=!1}=r;return a.jsx("button",{type:"button",title:e,"aria-label":e,"aria-pressed":t,disabled:i,className:l.cn(o.INK_CLASS_BUTTON,t&&o.INK_CLASS_BUTTON_ACTIVE),onClick:s,children:n})};exports.ToolbarButton=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const l=require("../../../../common-components/Button/Button.cjs");require("react");require("react-dom");const c=o=>{const{icon:r,title:e,active:t=!1,onClick:n,disabled:i=!1}=o,u=s=>{s.preventDefault()};return a.jsx(l.Button,{title:e,"aria-label":e,"aria-pressed":t,disabled:i,active:t,onMouseDown:u,onClick:n,children:r})};exports.ToolbarButton=c;
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ToolbarButton/ToolbarButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAI5D,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAehD,CAAC"}
1
+ {"version":3,"file":"ToolbarButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ToolbarButton/ToolbarButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAoBhD,CAAC"}