@forgedevstack/ink 1.1.9 → 1.2.1

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 (247) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/dist/common-components/Box/Box.cjs +1 -1
  3. package/dist/common-components/Box/Box.js +7 -6
  4. package/dist/common-components/Button/Button.cjs +1 -1
  5. package/dist/common-components/Button/Button.js +9 -8
  6. package/dist/common-components/Canvas/Canvas.cjs +1 -1
  7. package/dist/common-components/Canvas/Canvas.js +3 -2
  8. package/dist/common-components/ContextMenu/ContextMenu.cjs +1 -1
  9. package/dist/common-components/ContextMenu/ContextMenu.js +3 -2
  10. package/dist/common-components/Field/Field.cjs +1 -1
  11. package/dist/common-components/Field/Field.js +11 -10
  12. package/dist/common-components/icons/GripIcon.cjs +1 -1
  13. package/dist/common-components/icons/GripIcon.js +3 -2
  14. package/dist/components/InkEditor/InkEditor.cjs +1 -1
  15. package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
  16. package/dist/components/InkEditor/InkEditor.js +1308 -1028
  17. package/dist/components/InkEditor/components/AiPanel/AiPanel.cjs +1 -1
  18. package/dist/components/InkEditor/components/AiPanel/AiPanel.js +13 -12
  19. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.cjs +1 -0
  20. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.cjs +1 -0
  21. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.d.ts +20 -0
  22. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.d.ts.map +1 -0
  23. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.js +25 -0
  24. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.d.ts +4 -0
  25. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.d.ts.map +1 -0
  26. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.js +61 -0
  27. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.types.d.ts +11 -0
  28. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.types.d.ts.map +1 -0
  29. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.cjs +1 -0
  30. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.d.ts +19 -0
  31. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.d.ts.map +1 -0
  32. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.js +30 -0
  33. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.test.d.ts +2 -0
  34. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.test.d.ts.map +1 -0
  35. package/dist/components/InkEditor/components/AiSelectionBubble/index.d.ts +4 -0
  36. package/dist/components/InkEditor/components/AiSelectionBubble/index.d.ts.map +1 -0
  37. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.cjs +1 -1
  38. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.js +7 -6
  39. package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.cjs +1 -1
  40. package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.d.ts +2 -0
  41. package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.d.ts.map +1 -1
  42. package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.js +16 -15
  43. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.cjs +1 -1
  44. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts.map +1 -1
  45. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.js +84 -97
  46. package/dist/components/InkEditor/components/FindReplace/FindReplace.cjs +1 -1
  47. package/dist/components/InkEditor/components/FindReplace/FindReplace.js +21 -20
  48. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.cjs +1 -1
  49. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.js +17 -16
  50. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.cjs +1 -1
  51. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.js +3 -2
  52. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.cjs +1 -1
  53. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.js +7 -6
  54. package/dist/components/InkEditor/components/ImageFrame/ImageFrame.cjs +1 -0
  55. package/dist/components/InkEditor/components/ImageFrame/ImageFrame.d.ts +8 -0
  56. package/dist/components/InkEditor/components/ImageFrame/ImageFrame.d.ts.map +1 -0
  57. package/dist/components/InkEditor/components/ImageFrame/ImageFrame.js +54 -0
  58. package/dist/components/InkEditor/components/ImageFrame/index.d.ts +3 -0
  59. package/dist/components/InkEditor/components/ImageFrame/index.d.ts.map +1 -0
  60. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.cjs +1 -1
  61. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.js +11 -10
  62. package/dist/components/InkEditor/components/MentionMenu/MentionMenu.cjs +1 -0
  63. package/dist/components/InkEditor/components/MentionMenu/MentionMenu.d.ts +16 -0
  64. package/dist/components/InkEditor/components/MentionMenu/MentionMenu.d.ts.map +1 -0
  65. package/dist/components/InkEditor/components/MentionMenu/MentionMenu.js +21 -0
  66. package/dist/components/InkEditor/components/MentionMenu/index.d.ts +3 -0
  67. package/dist/components/InkEditor/components/MentionMenu/index.d.ts.map +1 -0
  68. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.cjs +1 -1
  69. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.js +11 -10
  70. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.cjs +1 -1
  71. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.js +3 -2
  72. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.cjs +1 -1
  73. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.js +6 -5
  74. package/dist/components/InkEditor/components/SignPad/SignPad.cjs +1 -1
  75. package/dist/components/InkEditor/components/SignPad/SignPad.js +7 -6
  76. package/dist/components/InkEditor/components/SlashMenu/SlashMenu.cjs +1 -1
  77. package/dist/components/InkEditor/components/SlashMenu/SlashMenu.js +7 -6
  78. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.cjs +1 -1
  79. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.cjs +1 -1
  80. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.js +8 -7
  81. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.js +38 -38
  82. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.cjs +1 -1
  83. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts.map +1 -1
  84. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.js +56 -39
  85. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.cjs +1 -1
  86. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.js +3 -2
  87. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.cjs +1 -1
  88. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.js +13 -12
  89. package/dist/components/InkEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -1
  90. package/dist/components/InkEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +9 -8
  91. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.cjs +1 -1
  92. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.const.cjs +1 -1
  93. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.const.js +9 -8
  94. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.js +9 -8
  95. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
  96. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.js +19 -18
  97. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.cjs +1 -1
  98. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.js +6 -5
  99. package/dist/components/InkEditor/components/VersionHistory/VersionHistory.cjs +1 -0
  100. package/dist/components/InkEditor/components/VersionHistory/VersionHistory.d.ts +11 -0
  101. package/dist/components/InkEditor/components/VersionHistory/VersionHistory.d.ts.map +1 -0
  102. package/dist/components/InkEditor/components/VersionHistory/VersionHistory.js +22 -0
  103. package/dist/components/InkEditor/components/VersionHistory/index.d.ts +3 -0
  104. package/dist/components/InkEditor/components/VersionHistory/index.d.ts.map +1 -0
  105. package/dist/components/InkEditor/components/index.d.ts +7 -0
  106. package/dist/components/InkEditor/components/index.d.ts.map +1 -1
  107. package/dist/components/InkEditor/helpers/format.utils.cjs +3 -2
  108. package/dist/components/InkEditor/helpers/format.utils.d.ts +1 -0
  109. package/dist/components/InkEditor/helpers/format.utils.d.ts.map +1 -1
  110. package/dist/components/InkEditor/helpers/format.utils.js +106 -84
  111. package/dist/components/InkEditor/helpers/index.d.ts +1 -1
  112. package/dist/components/InkEditor/helpers/index.d.ts.map +1 -1
  113. package/dist/components/InkWorkspace/InkWorkspace.cjs +1 -1
  114. package/dist/components/InkWorkspace/InkWorkspace.d.ts.map +1 -1
  115. package/dist/components/InkWorkspace/InkWorkspace.js +136 -144
  116. package/dist/components/InkWorkspace/hooks/useInkWorkspace.cjs +1 -1
  117. package/dist/components/InkWorkspace/hooks/useInkWorkspace.js +8 -7
  118. package/dist/constants/contextMenu.const.cjs +1 -1
  119. package/dist/constants/contextMenu.const.d.ts +8 -0
  120. package/dist/constants/contextMenu.const.d.ts.map +1 -1
  121. package/dist/constants/contextMenu.const.js +30 -22
  122. package/dist/constants/defaultIcons.cjs +1 -1
  123. package/dist/constants/defaultIcons.js +6 -5
  124. package/dist/constants/defaults.const.cjs +1 -1
  125. package/dist/constants/defaults.const.d.ts.map +1 -1
  126. package/dist/constants/defaults.const.js +150 -138
  127. package/dist/constants/numbers.cjs +1 -1
  128. package/dist/constants/numbers.js +28 -27
  129. package/dist/constants/toolbar.const.cjs +1 -1
  130. package/dist/constants/toolbar.const.d.ts +7 -0
  131. package/dist/constants/toolbar.const.d.ts.map +1 -1
  132. package/dist/constants/toolbar.const.js +16 -9
  133. package/dist/constants/toolbarMenu.const.cjs +1 -1
  134. package/dist/constants/toolbarMenu.const.d.ts.map +1 -1
  135. package/dist/constants/toolbarMenu.const.js +25 -11
  136. package/dist/hooks/useInkCollaboration.cjs +1 -1
  137. package/dist/hooks/useInkCollaboration.js +15 -14
  138. package/dist/hooks/useToolbarOverflow.cjs +1 -1
  139. package/dist/hooks/useToolbarOverflow.js +12 -11
  140. package/dist/index.cjs +1 -1
  141. package/dist/index.js +145 -144
  142. package/dist/plugins/ai/demoProvider.cjs +1 -1
  143. package/dist/plugins/ai/demoProvider.js +3 -2
  144. package/dist/plugins/ai/index.cjs +1 -1
  145. package/dist/plugins/ai/index.js +25 -24
  146. package/dist/plugins/excel/excel.utils.cjs +1 -1
  147. package/dist/plugins/excel/excel.utils.js +17 -16
  148. package/dist/plugins/graph/graph.utils.cjs +1 -1
  149. package/dist/plugins/graph/graph.utils.js +7 -6
  150. package/dist/plugins/theme/inkTheme.cjs +1 -1
  151. package/dist/plugins/theme/inkTheme.js +22 -19
  152. package/dist/plugins/titles/titles.const.cjs +1 -1
  153. package/dist/plugins/titles/titles.const.js +9 -8
  154. package/dist/plugins/titles/titles.utils.cjs +1 -1
  155. package/dist/plugins/titles/titles.utils.js +3 -2
  156. package/dist/styles.css +1 -1
  157. package/dist/types/collab.types.d.ts +0 -1
  158. package/dist/types/collab.types.d.ts.map +1 -1
  159. package/dist/types/features.types.d.ts +1 -1
  160. package/dist/types/features.types.d.ts.map +1 -1
  161. package/dist/types/ink.types.d.ts +1 -3
  162. package/dist/types/ink.types.d.ts.map +1 -1
  163. package/dist/utils/blocks.utils.cjs +1 -1
  164. package/dist/utils/blocks.utils.js +19 -18
  165. package/dist/utils/collab.utils.cjs +1 -1
  166. package/dist/utils/collab.utils.js +7 -6
  167. package/dist/utils/comments.utils.cjs +1 -1
  168. package/dist/utils/comments.utils.d.ts +4 -0
  169. package/dist/utils/comments.utils.d.ts.map +1 -1
  170. package/dist/utils/comments.utils.js +26 -18
  171. package/dist/utils/comments.utils.test.d.ts +2 -0
  172. package/dist/utils/comments.utils.test.d.ts.map +1 -0
  173. package/dist/utils/exportDocument.utils.cjs +2 -0
  174. package/dist/utils/exportDocument.utils.d.ts +16 -0
  175. package/dist/utils/exportDocument.utils.d.ts.map +1 -0
  176. package/dist/utils/exportDocument.utils.js +85 -0
  177. package/dist/utils/exportDocument.utils.test.d.ts +2 -0
  178. package/dist/utils/exportDocument.utils.test.d.ts.map +1 -0
  179. package/dist/utils/formatPainter.utils.cjs +1 -0
  180. package/dist/utils/formatPainter.utils.d.ts +11 -0
  181. package/dist/utils/formatPainter.utils.d.ts.map +1 -0
  182. package/dist/utils/formatPainter.utils.js +20 -0
  183. package/dist/utils/formatPainter.utils.test.d.ts +2 -0
  184. package/dist/utils/formatPainter.utils.test.d.ts.map +1 -0
  185. package/dist/utils/history.utils.cjs +1 -1
  186. package/dist/utils/history.utils.js +3 -2
  187. package/dist/utils/image.utils.cjs +1 -0
  188. package/dist/utils/image.utils.d.ts +14 -0
  189. package/dist/utils/image.utils.d.ts.map +1 -0
  190. package/dist/utils/image.utils.js +33 -0
  191. package/dist/utils/image.utils.test.d.ts +2 -0
  192. package/dist/utils/image.utils.test.d.ts.map +1 -0
  193. package/dist/utils/index.d.ts +10 -3
  194. package/dist/utils/index.d.ts.map +1 -1
  195. package/dist/utils/license.utils.cjs +1 -1
  196. package/dist/utils/license.utils.js +8 -7
  197. package/dist/utils/markdown.utils.cjs +11 -0
  198. package/dist/utils/markdown.utils.d.ts +7 -0
  199. package/dist/utils/markdown.utils.d.ts.map +1 -0
  200. package/dist/utils/markdown.utils.js +87 -0
  201. package/dist/utils/markdown.utils.test.d.ts +2 -0
  202. package/dist/utils/markdown.utils.test.d.ts.map +1 -0
  203. package/dist/utils/mentions.utils.cjs +1 -0
  204. package/dist/utils/mentions.utils.d.ts +13 -0
  205. package/dist/utils/mentions.utils.d.ts.map +1 -0
  206. package/dist/utils/mentions.utils.js +23 -0
  207. package/dist/utils/mentions.utils.test.d.ts +2 -0
  208. package/dist/utils/mentions.utils.test.d.ts.map +1 -0
  209. package/dist/utils/outline.utils.cjs +1 -1
  210. package/dist/utils/outline.utils.js +9 -8
  211. package/dist/utils/paste.utils.cjs +1 -1
  212. package/dist/utils/paste.utils.d.ts +2 -0
  213. package/dist/utils/paste.utils.d.ts.map +1 -1
  214. package/dist/utils/paste.utils.js +53 -19
  215. package/dist/utils/paste.utils.test.d.ts +2 -0
  216. package/dist/utils/paste.utils.test.d.ts.map +1 -0
  217. package/dist/utils/premium.utils.cjs +1 -1
  218. package/dist/utils/premium.utils.js +12 -11
  219. package/dist/utils/selection.utils.cjs +1 -1
  220. package/dist/utils/selection.utils.js +3 -2
  221. package/dist/utils/slash.utils.cjs +1 -1
  222. package/dist/utils/slash.utils.js +10 -9
  223. package/dist/utils/table.utils.cjs +1 -1
  224. package/dist/utils/table.utils.d.ts +8 -0
  225. package/dist/utils/table.utils.d.ts.map +1 -1
  226. package/dist/utils/table.utils.js +78 -54
  227. package/dist/utils/toolbarStorage.utils.cjs +1 -1
  228. package/dist/utils/toolbarStorage.utils.js +15 -14
  229. package/dist/utils/trackChanges.utils.cjs +1 -1
  230. package/dist/utils/trackChanges.utils.js +9 -8
  231. package/dist/utils/typo.utils.cjs +1 -1
  232. package/dist/utils/typo.utils.js +8 -7
  233. package/dist/utils/versions.utils.cjs +1 -0
  234. package/dist/utils/versions.utils.d.ts +11 -0
  235. package/dist/utils/versions.utils.d.ts.map +1 -0
  236. package/dist/utils/versions.utils.js +36 -0
  237. package/dist/utils/versions.utils.test.d.ts +2 -0
  238. package/dist/utils/versions.utils.test.d.ts.map +1 -0
  239. package/dist/utils/words.utils.cjs +1 -1
  240. package/dist/utils/words.utils.js +3 -2
  241. package/package.json +1 -1
  242. package/dist/components/InkEditor/components/ThemePicker/hooks/index.d.ts +0 -3
  243. package/dist/components/InkEditor/components/ThemePicker/hooks/index.d.ts.map +0 -1
  244. package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.cjs +0 -1
  245. package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.d.ts +0 -13
  246. package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.d.ts.map +0 -1
  247. package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.js +0 -39
@@ -1,138 +1,125 @@
1
- import { jsxs as m, jsx as n } from "react/jsx-runtime";
2
- import { useState as C, useRef as v, useEffect as j, Fragment as z } from "react";
3
- import { createPortal as q } from "react-dom";
4
- import { NUMBER_ZERO as c, NUMBER_ONE as d, INK_EXCEL_SHEET_MAX_ROWS as Z, INK_EXCEL_SHEET_MAX_COLS as J, INK_EXCEL_MENU_ESTIMATED_HEIGHT_PX as Q } from "../../../../constants/numbers.js";
5
- import { INK_EXCEL_TITLE as A, INK_EXCEL_ADD_ROW as x, INK_EXCEL_ADD_COL as ee, INK_EXCEL_REMOVE_ROW as te, INK_EXCEL_REMOVE_COL as ne, INK_EXCEL_CLEAR as oe, INK_EXCEL_IMPORT as re, INK_EXCEL_INSERT as le } from "../../../../constants/generals.const.js";
1
+ import { jsxs as _, jsx as n } from "react/jsx-runtime";
2
+ import { useState as u, useRef as L, useEffect as j, Fragment as x } from "react";
3
+ import { createPortal as z } from "react-dom";
4
+ import { NUMBER_ZERO as i, NUMBER_ONE as m, INK_EXCEL_SHEET_MAX_ROWS as q, INK_EXCEL_SHEET_MAX_COLS as Z, INK_EXCEL_MENU_ESTIMATED_HEIGHT_PX as J } from "../../../../constants/numbers.js";
5
+ import { INK_EXCEL_TITLE as v, INK_EXCEL_ADD_ROW as Q, INK_EXCEL_ADD_COL as ee, INK_EXCEL_REMOVE_ROW as te, INK_EXCEL_REMOVE_COL as ne, INK_EXCEL_CLEAR as oe, INK_EXCEL_IMPORT as re, INK_EXCEL_INSERT as le } from "../../../../constants/generals.const.js";
6
6
  import { COLOR_MODE_LIGHT as se } from "../../../../constants/colorMode.const.js";
7
- import { KEY_ESCAPE as ie } from "../../../../constants/keyboard.const.js";
8
- import { INK_CLASS_STYLE_DD as Ee, INK_CLASS_STYLE_MENU as ae, INK_CLASS_STYLE_MENU_PORTAL as ce, INK_CLASS_STYLE_MENU_FORCED as ue, INK_CLASS_EXCEL_PANEL as _e, INK_CLASS_EXCEL_TITLE as me, INK_CLASS_EXCEL_GRID as Ce, INK_CLASS_EXCEL_CORNER as de, EXCEL_COL_LETTERS as Le, INK_CLASS_EXCEL_HEAD as b, INK_CLASS_EXCEL_COL_HOVER as O, INK_CLASS_EXCEL_ROW_HOVER as g, INK_CLASS_EXCEL_CELL as pe, INK_CLASS_EXCEL_ACTIONS as fe, INK_CLASS_EXCEL_INSERT as Ne } from "../../../../constants/defaults.const.js";
7
+ import { KEY_ESCAPE as Ee } from "../../../../constants/keyboard.const.js";
8
+ import { INK_CLASS_STYLE_DD as ie, INK_CLASS_STYLE_MENU as ae, INK_CLASS_STYLE_MENU_PORTAL as ce, INK_CLASS_STYLE_MENU_FORCED as _e, INK_CLASS_EXCEL_PANEL as ue, INK_CLASS_EXCEL_TITLE as me, INK_CLASS_EXCEL_GRID as de, INK_CLASS_EXCEL_CORNER as Ce, EXCEL_COL_LETTERS as Le, INK_CLASS_EXCEL_HEAD as b, INK_CLASS_EXCEL_COL_HOVER as O, INK_CLASS_EXCEL_ROW_HOVER as g, INK_CLASS_EXCEL_CELL as pe, INK_CLASS_EXCEL_ACTIONS as fe, INK_CLASS_EXCEL_INSERT as Ne } from "../../../../constants/defaults.const.js";
9
9
  import "../../../../constants/openai.const.js";
10
10
  import "../../../../utils/paste.utils.js";
11
- import { createEmptyExcelGrid as $, setExcelCell as Se, addExcelRow as ve, addExcelCol as Re, removeExcelRow as Me, removeExcelCol as Ae, clearExcelGrid as he, excelGridToTableHtml as Te, CSV_ACCEPT as Ke, parseCsvText as De } from "../../../../plugins/excel/excel.utils.js";
11
+ import "../../../../utils/exportDocument.utils.js";
12
+ import { createEmptyExcelGrid as I, setExcelCell as Se, addExcelRow as ve, addExcelCol as Re, removeExcelRow as Ae, removeExcelCol as he, clearExcelGrid as Te, excelGridToTableHtml as Ke, CSV_ACCEPT as De, parseCsvText as Me } from "../../../../plugins/excel/excel.utils.js";
12
13
  import { getToolbarDropdownMenuPosition as we } from "../ToolbarDropdown/ToolbarDropdown.utils.js";
13
14
  import { ToolbarButton as Xe } from "../ToolbarButton/ToolbarButton.js";
14
- const Ye = (I) => {
15
- var X;
16
- const { icon: y, disabled: h = !1, hint: H, onHint: P, pluginColor: G, onInsert: F } = I, [R, L] = C(!1), [o, s] = C($), [p, u] = C(null), [f, _] = C(null), [T, U] = C({ top: c, left: c }), K = v(null), D = v(null), M = v(null), w = v(null), N = ((X = o[c]) == null ? void 0 : X.length) ?? d, k = o.length < Z, V = N < J, Y = o.length > d, B = N > d;
15
+ const Be = ($) => {
16
+ var w;
17
+ const { icon: y, disabled: R = !1, hint: H, onHint: P, pluginColor: G, onInsert: F } = $, [p, d] = u(!1), [o, s] = u(I), [A, f] = u(null), [h, N] = u(null), [T, U] = u({ top: i, left: i }), K = L(null), D = L(null), S = L(null), M = L(null), C = ((w = o[i]) == null ? void 0 : w.length) ?? m, k = o.length < q, V = C < Z, Y = o.length > m, B = C > m;
17
18
  j(() => {
18
- if (!R) return;
19
+ if (!p) return;
19
20
  const e = () => {
20
- var a;
21
- const r = (a = M.current) == null ? void 0 : a.getBoundingClientRect().height, E = we(
21
+ var c;
22
+ const l = (c = S.current) == null ? void 0 : c.getBoundingClientRect().height, a = we(
22
23
  D.current,
23
- r && r > c ? r : Q
24
+ l && l > i ? l : J
24
25
  );
25
- U({ top: E.top, left: E.left });
26
+ U({ top: a.top, left: a.left });
26
27
  };
27
28
  e();
28
- const t = window.requestAnimationFrame(e), l = (r) => {
29
- var a, S;
30
- const E = r.target;
31
- (a = K.current) != null && a.contains(E) || (S = M.current) != null && S.contains(E) || L(!1);
32
- }, i = (r) => {
33
- r.key === ie && L(!1);
29
+ const t = window.requestAnimationFrame(e), E = (l) => {
30
+ var c, X;
31
+ const a = l.target;
32
+ (c = K.current) != null && c.contains(a) || (X = S.current) != null && X.contains(a) || d(!1);
33
+ }, r = (l) => {
34
+ l.key === Ee && d(!1);
34
35
  };
35
- return document.addEventListener("mousedown", l), document.addEventListener("keydown", i), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
36
- window.cancelAnimationFrame(t), document.removeEventListener("mousedown", l), document.removeEventListener("keydown", i), window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
36
+ return document.addEventListener("mousedown", E), document.addEventListener("keydown", r), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
37
+ window.cancelAnimationFrame(t), document.removeEventListener("mousedown", E), document.removeEventListener("keydown", r), window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
37
38
  };
38
- }, [R, o.length, N]);
39
+ }, [p, o.length, C]);
39
40
  const W = (e) => {
40
- var i;
41
- const t = (i = e.target.files) == null ? void 0 : i[c];
41
+ var r;
42
+ const t = (r = e.target.files) == null ? void 0 : r[i];
42
43
  if (!t) return;
43
- const l = new FileReader();
44
- l.onload = () => {
45
- s(De(String(l.result)));
46
- }, l.readAsText(t);
44
+ const E = new FileReader();
45
+ E.onload = () => {
46
+ s(Me(String(E.result)));
47
+ }, E.readAsText(t);
47
48
  };
48
- return /* @__PURE__ */ m("div", { className: Ee, ref: K, children: [
49
+ return /* @__PURE__ */ _("div", { className: ie, ref: K, children: [
49
50
  /* @__PURE__ */ n("div", { ref: D, children: /* @__PURE__ */ n(
50
51
  Xe,
51
52
  {
52
53
  icon: y,
53
- title: A,
54
+ title: v,
54
55
  hint: H,
55
56
  onHint: P,
56
57
  pluginColor: G,
57
- disabled: h,
58
+ disabled: R,
58
59
  onClick: () => {
59
- h || (s($()), L((e) => !e));
60
+ R || (s(I()), d((e) => !e));
60
61
  }
61
62
  }
62
63
  ) }),
63
- R ? q(
64
- /* @__PURE__ */ m(
64
+ p ? z(
65
+ /* @__PURE__ */ _(
65
66
  "div",
66
67
  {
67
- ref: M,
68
- className: `${ae} ${ce} ${ue} ${_e}`,
68
+ ref: S,
69
+ className: `${ae} ${ce} ${_e} ${ue}`,
69
70
  "data-color-mode": se,
70
71
  role: "dialog",
71
- "aria-label": A,
72
+ "aria-label": v,
72
73
  style: { top: T.top, left: T.left },
73
74
  children: [
74
- /* @__PURE__ */ n("div", { className: me, children: A }),
75
- /* @__PURE__ */ m(
75
+ /* @__PURE__ */ n("div", { className: me, children: v }),
76
+ /* @__PURE__ */ _(
76
77
  "div",
77
78
  {
78
- className: Ce,
79
+ className: de,
79
80
  style: {
80
- gridTemplateColumns: `2rem repeat(${N}, minmax(0, 1fr))`
81
+ gridTemplateColumns: `2rem repeat(${C}, minmax(0, 1fr))`
81
82
  },
82
83
  onMouseLeave: () => {
83
- u(null), _(null);
84
+ f(null), N(null);
84
85
  },
85
86
  children: [
86
- /* @__PURE__ */ n("span", { className: de }),
87
- (o[c] ?? []).map((e, t) => {
88
- const l = p !== null && t <= p;
89
- return /* @__PURE__ */ n(
87
+ /* @__PURE__ */ n("span", { className: Ce }),
88
+ (o[i] ?? []).map((e, t) => /* @__PURE__ */ n(
89
+ "span",
90
+ {
91
+ className: `${b}${A === t ? ` ${O}` : ""}`,
92
+ onMouseEnter: () => f(t),
93
+ children: Le[t] ?? t + m
94
+ },
95
+ `h-${t}`
96
+ )),
97
+ o.map((e, t) => /* @__PURE__ */ _(x, { children: [
98
+ /* @__PURE__ */ n(
90
99
  "span",
91
100
  {
92
- className: `${b}${l ? ` ${O}` : ""}`,
93
- onMouseEnter: () => u(t),
94
- onMouseMove: () => u(t),
95
- children: Le[t] ?? t + d
101
+ className: `${b}${h === t ? ` ${g}` : ""}`,
102
+ onMouseEnter: () => N(t),
103
+ children: t + m
104
+ }
105
+ ),
106
+ e.map((E, r) => /* @__PURE__ */ n(
107
+ "input",
108
+ {
109
+ className: `${pe}${A === r ? ` ${O}` : ""}${h === t ? ` ${g}` : ""}`,
110
+ value: E,
111
+ onMouseEnter: () => {
112
+ f(r), N(t);
113
+ },
114
+ onChange: (l) => s(Se(o, t, r, l.target.value))
96
115
  },
97
- `h-${t}`
98
- );
99
- }),
100
- o.map((e, t) => {
101
- const l = f !== null && t <= f;
102
- return /* @__PURE__ */ m(z, { children: [
103
- /* @__PURE__ */ n(
104
- "span",
105
- {
106
- className: `${b}${l ? ` ${g}` : ""}`,
107
- onMouseEnter: () => _(t),
108
- onMouseMove: () => _(t),
109
- children: t + d
110
- }
111
- ),
112
- e.map((i, r) => {
113
- const E = p !== null && r <= p, a = f !== null && t <= f;
114
- return /* @__PURE__ */ n(
115
- "input",
116
- {
117
- className: `${pe}${E ? ` ${O}` : ""}${a ? ` ${g}` : ""}`,
118
- value: i,
119
- onMouseEnter: () => {
120
- u(r), _(t);
121
- },
122
- onMouseMove: () => {
123
- u(r), _(t);
124
- },
125
- onChange: (S) => s(Se(o, t, r, S.target.value))
126
- },
127
- `${t}-${r}`
128
- );
129
- })
130
- ] }, `row-${t}`);
131
- })
116
+ `${t}-${r}`
117
+ ))
118
+ ] }, `row-${t}`))
132
119
  ]
133
120
  }
134
121
  ),
135
- /* @__PURE__ */ m("div", { className: fe, children: [
122
+ /* @__PURE__ */ _("div", { className: fe, children: [
136
123
  /* @__PURE__ */ n(
137
124
  "button",
138
125
  {
@@ -141,7 +128,7 @@ const Ye = (I) => {
141
128
  onMouseDown: (e) => {
142
129
  e.preventDefault(), s(ve(o));
143
130
  },
144
- children: x
131
+ children: Q
145
132
  }
146
133
  ),
147
134
  /* @__PURE__ */ n(
@@ -161,7 +148,7 @@ const Ye = (I) => {
161
148
  type: "button",
162
149
  disabled: !Y,
163
150
  onMouseDown: (e) => {
164
- e.preventDefault(), s(Me(o));
151
+ e.preventDefault(), s(Ae(o));
165
152
  },
166
153
  children: te
167
154
  }
@@ -172,7 +159,7 @@ const Ye = (I) => {
172
159
  type: "button",
173
160
  disabled: !B,
174
161
  onMouseDown: (e) => {
175
- e.preventDefault(), s(Ae(o));
162
+ e.preventDefault(), s(he(o));
176
163
  },
177
164
  children: ne
178
165
  }
@@ -182,7 +169,7 @@ const Ye = (I) => {
182
169
  {
183
170
  type: "button",
184
171
  onMouseDown: (e) => {
185
- e.preventDefault(), s(he(o));
172
+ e.preventDefault(), s(Te(o));
186
173
  },
187
174
  children: oe
188
175
  }
@@ -193,7 +180,7 @@ const Ye = (I) => {
193
180
  type: "button",
194
181
  onMouseDown: (e) => {
195
182
  var t;
196
- e.preventDefault(), (t = w.current) == null || t.click();
183
+ e.preventDefault(), (t = M.current) == null || t.click();
197
184
  },
198
185
  children: re
199
186
  }
@@ -204,13 +191,13 @@ const Ye = (I) => {
204
191
  type: "button",
205
192
  className: Ne,
206
193
  onMouseDown: (e) => {
207
- e.preventDefault(), F(Te(o)), L(!1);
194
+ e.preventDefault(), F(Ke(o)), d(!1);
208
195
  },
209
196
  children: le
210
197
  }
211
198
  )
212
199
  ] }),
213
- /* @__PURE__ */ n("input", { ref: w, type: "file", accept: Ke, hidden: !0, onChange: W })
200
+ /* @__PURE__ */ n("input", { ref: M, type: "file", accept: De, hidden: !0, onChange: W })
214
201
  ]
215
202
  }
216
203
  ),
@@ -219,5 +206,5 @@ const Ye = (I) => {
219
206
  ] });
220
207
  };
221
208
  export {
222
- Ye as ExcelSheetPanel
209
+ Be as ExcelSheetPanel
223
210
  };
@@ -1 +1 @@
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
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),o=require("../../../../constants/generals.const.cjs"),r=require("../../../../constants/findReplaceMenu.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const a=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=r.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===r.FIND_REPLACE_FOCUS_FIND}),t.jsx(u.Field,{className:e.FIND_REPLACE_FIELD_CLASS,label:N,value:E,onChange:P,autoFocus:s===r.FIND_REPLACE_FOCUS_REPLACE}),t.jsxs("div",{className:e.FIND_REPLACE_ACTIONS_CLASS,children:[t.jsx(a.Button,{type:"button",onClick:C,children:I}),t.jsx(a.Button,{type:"submit",disabled:!l,children:R}),t.jsx(a.Button,{type:"button",active:!0,disabled:!l,onClick:n=>_(n,!0),children:d})]})]},s)};exports.FindReplace=p;
@@ -1,38 +1,39 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as _, jsx as e } from "react/jsx-runtime";
2
2
  import { useState as L } from "react";
3
3
  import { EMPTY_STRING as n } from "../../../../constants/generals.const.js";
4
4
  import { FIND_REPLACE_FOCUS_FIND as s, FIND_REPLACE_FOCUS_REPLACE as P } from "../../../../constants/findReplaceMenu.const.js";
5
5
  import "../../../../constants/openai.const.js";
6
6
  import "../../../../utils/paste.utils.js";
7
- import { Button as E } from "../../../../common-components/Button/Button.js";
7
+ import "../../../../utils/exportDocument.utils.js";
8
+ import { Button as r } from "../../../../common-components/Button/Button.js";
8
9
  import { Field as c } from "../../../../common-components/Field/Field.js";
9
10
  import "react-dom";
10
11
  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) => {
12
+ const K = (m) => {
12
13
  const {
13
- open: C,
14
- onClose: m,
14
+ open: A,
15
+ onClose: C,
15
16
  onReplace: p,
16
17
  findLabel: D = S,
17
18
  replaceLabel: N = T,
18
19
  replaceOneLabel: u = h,
19
20
  replaceAllLabel: I = U,
20
21
  closeLabel: R = O,
21
- title: a = v,
22
+ title: E = v,
22
23
  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);
24
+ } = m, [l, d] = L(n), [a, b] = L(n);
25
+ if (!A) return null;
26
+ const i = (t, f) => {
27
+ t.preventDefault(), l && p(l, a, f);
27
28
  };
28
- return /* @__PURE__ */ i(
29
+ return /* @__PURE__ */ _(
29
30
  "form",
30
31
  {
31
32
  className: x,
32
- "aria-label": a,
33
- onSubmit: (t) => _(t, !1),
33
+ "aria-label": E,
34
+ onSubmit: (t) => i(t, !1),
34
35
  children: [
35
- /* @__PURE__ */ e("p", { className: y, children: a }),
36
+ /* @__PURE__ */ e("p", { className: y, children: E }),
36
37
  /* @__PURE__ */ e(
37
38
  c,
38
39
  {
@@ -48,15 +49,15 @@ const J = (A) => {
48
49
  {
49
50
  className: F,
50
51
  label: N,
51
- value: r,
52
+ value: a,
52
53
  onChange: b,
53
54
  autoFocus: o === P
54
55
  }
55
56
  ),
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 })
57
+ /* @__PURE__ */ _("div", { className: g, children: [
58
+ /* @__PURE__ */ e(r, { type: "button", onClick: C, children: R }),
59
+ /* @__PURE__ */ e(r, { type: "submit", disabled: !l, children: u }),
60
+ /* @__PURE__ */ e(r, { type: "button", active: !0, disabled: !l, onClick: (t) => i(t, !0), children: I })
60
61
  ] })
61
62
  ]
62
63
  },
@@ -64,5 +65,5 @@ const J = (A) => {
64
65
  );
65
66
  };
66
67
  export {
67
- J as FindReplace
68
+ K as FindReplace
68
69
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("react"),N=require("@forgedevstack/bear"),s=require("../../../../constants/numbers.cjs"),l=require("../../../../constants/generals.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("react-dom");const O=require("../../../../plugins/graph/graph.const.cjs"),C=()=>({label:"•",value:s.NUMBER_ONE}),G=j=>{const{open:p,mode:E,points:d,colors:n,onClose:R,onApply:P}=j,[m,_]=h.useState(d),[v,M]=h.useState(n.length>s.NUMBER_ZERO?n:[...O.GRAPH_COLORS]);h.useEffect(()=>{p&&(_(d),M(n.length>s.NUMBER_ZERO?n:[...O.GRAPH_COLORS]))},[p,d,n]);const b=E==="colors"?l.INK_GRAPH_COLORS_TITLE:l.INK_GRAPH_VALUES_TITLE;return e.jsx(N.Modal,{isOpen:p,onClose:R,title:b,size:"md",footer:e.jsxs(e.Fragment,{children:[e.jsx(N.Button,{variant:"outline",onClick:R,children:l.INK_GRAPH_CANCEL}),e.jsx(N.Button,{variant:"primary",onClick:()=>P(m,v),children:l.INK_GRAPH_APPLY})]}),children:E==="values"?e.jsxs("div",{className:"Ink-GraphModal",children:[m.map((r,a)=>e.jsxs("div",{className:"Ink-GraphModal__row",children:[e.jsx("input",{value:r.label,"aria-label":`Label ${a+s.NUMBER_ONE}`,onChange:o=>{const i=o.target.value;_(c=>c.map((t,u)=>u===a?{...t,label:i}:t))}}),e.jsx("input",{type:"number",value:r.value,"aria-label":`Value ${a+s.NUMBER_ONE}`,onChange:o=>{const i=Number(o.target.value)||s.NUMBER_ZERO;_(c=>c.map((t,u)=>u===a?{...t,value:i}:t))}})]},`${r.label}-${a}`)),e.jsx(N.Button,{variant:"outline",size:"sm",onClick:()=>_(r=>[...r,C()]),children:l.INK_GRAPH_ADD_POINT})]}):e.jsx("div",{className:"Ink-GraphModal",children:v.map((r,a)=>e.jsxs("label",{className:"Ink-GraphModal__row",children:[e.jsx("span",{children:a+s.NUMBER_ONE}),e.jsx("input",{type:"color",value:r,onChange:o=>{const i=o.target.value||l.EMPTY_STRING;M(c=>c.map((t,u)=>u===a?i:t))}})]},`${r}-${a}`))})})};exports.GraphEditModal=G;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("react"),N=require("@forgedevstack/bear"),s=require("../../../../constants/numbers.cjs"),l=require("../../../../constants/generals.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");require("react-dom");const O=require("../../../../plugins/graph/graph.const.cjs"),C=()=>({label:"•",value:s.NUMBER_ONE}),G=j=>{const{open:p,mode:E,points:d,colors:n,onClose:R,onApply:P}=j,[m,_]=h.useState(d),[v,M]=h.useState(n.length>s.NUMBER_ZERO?n:[...O.GRAPH_COLORS]);h.useEffect(()=>{p&&(_(d),M(n.length>s.NUMBER_ZERO?n:[...O.GRAPH_COLORS]))},[p,d,n]);const b=E==="colors"?l.INK_GRAPH_COLORS_TITLE:l.INK_GRAPH_VALUES_TITLE;return e.jsx(N.Modal,{isOpen:p,onClose:R,title:b,size:"md",footer:e.jsxs(e.Fragment,{children:[e.jsx(N.Button,{variant:"outline",onClick:R,children:l.INK_GRAPH_CANCEL}),e.jsx(N.Button,{variant:"primary",onClick:()=>P(m,v),children:l.INK_GRAPH_APPLY})]}),children:E==="values"?e.jsxs("div",{className:"Ink-GraphModal",children:[m.map((r,a)=>e.jsxs("div",{className:"Ink-GraphModal__row",children:[e.jsx("input",{value:r.label,"aria-label":`Label ${a+s.NUMBER_ONE}`,onChange:o=>{const i=o.target.value;_(u=>u.map((t,c)=>c===a?{...t,label:i}:t))}}),e.jsx("input",{type:"number",value:r.value,"aria-label":`Value ${a+s.NUMBER_ONE}`,onChange:o=>{const i=Number(o.target.value)||s.NUMBER_ZERO;_(u=>u.map((t,c)=>c===a?{...t,value:i}:t))}})]},`${r.label}-${a}`)),e.jsx(N.Button,{variant:"outline",size:"sm",onClick:()=>_(r=>[...r,C()]),children:l.INK_GRAPH_ADD_POINT})]}):e.jsx("div",{className:"Ink-GraphModal",children:v.map((r,a)=>e.jsxs("label",{className:"Ink-GraphModal__row",children:[e.jsx("span",{children:a+s.NUMBER_ONE}),e.jsx("input",{type:"color",value:r,onChange:o=>{const i=o.target.value||l.EMPTY_STRING;M(u=>u.map((t,c)=>c===a?i:t))}})]},`${r}-${a}`))})})};exports.GraphEditModal=G;
@@ -1,13 +1,14 @@
1
- import { jsx as l, jsxs as c, Fragment as E } from "react/jsx-runtime";
1
+ import { jsx as l, jsxs as m, Fragment as E } from "react/jsx-runtime";
2
2
  import { useState as P, useEffect as b } from "react";
3
3
  import { Modal as g, Button as h } from "@forgedevstack/bear";
4
- import { NUMBER_ZERO as d, NUMBER_ONE as m } from "../../../../constants/numbers.js";
4
+ import { NUMBER_ZERO as d, NUMBER_ONE as c } from "../../../../constants/numbers.js";
5
5
  import { INK_GRAPH_COLORS_TITLE as M, INK_GRAPH_VALUES_TITLE as L, INK_GRAPH_ADD_POINT as O, EMPTY_STRING as k, INK_GRAPH_CANCEL as T, INK_GRAPH_APPLY as H } from "../../../../constants/generals.const.js";
6
6
  import "../../../../constants/openai.const.js";
7
7
  import "../../../../utils/paste.utils.js";
8
+ import "../../../../utils/exportDocument.utils.js";
8
9
  import "react-dom";
9
10
  import { GRAPH_COLORS as G } from "../../../../plugins/graph/graph.const.js";
10
- const $ = () => ({ label: "•", value: m }), Y = (R) => {
11
+ const $ = () => ({ label: "•", value: c }), F = (R) => {
11
12
  const { open: u, mode: v, points: _, colors: r, onClose: N, onApply: A } = R, [f, p] = P(_), [C, I] = P(
12
13
  r.length > d ? r : [...G]
13
14
  );
@@ -20,22 +21,22 @@ const $ = () => ({ label: "•", value: m }), Y = (R) => {
20
21
  onClose: N,
21
22
  title: v === "colors" ? M : L,
22
23
  size: "md",
23
- footer: /* @__PURE__ */ c(E, { children: [
24
+ footer: /* @__PURE__ */ m(E, { children: [
24
25
  /* @__PURE__ */ l(h, { variant: "outline", onClick: N, children: T }),
25
26
  /* @__PURE__ */ l(h, { variant: "primary", onClick: () => A(f, C), children: H })
26
27
  ] }),
27
- children: v === "values" ? /* @__PURE__ */ c("div", { className: "Ink-GraphModal", children: [
28
- f.map((e, a) => /* @__PURE__ */ c("div", { className: "Ink-GraphModal__row", children: [
28
+ children: v === "values" ? /* @__PURE__ */ m("div", { className: "Ink-GraphModal", children: [
29
+ f.map((e, a) => /* @__PURE__ */ m("div", { className: "Ink-GraphModal__row", children: [
29
30
  /* @__PURE__ */ l(
30
31
  "input",
31
32
  {
32
33
  value: e.label,
33
- "aria-label": `Label ${a + m}`,
34
+ "aria-label": `Label ${a + c}`,
34
35
  onChange: (t) => {
35
36
  const n = t.target.value;
36
37
  p(
37
- (s) => s.map(
38
- (o, i) => i === a ? { ...o, label: n } : o
38
+ (i) => i.map(
39
+ (o, s) => s === a ? { ...o, label: n } : o
39
40
  )
40
41
  );
41
42
  }
@@ -46,12 +47,12 @@ const $ = () => ({ label: "•", value: m }), Y = (R) => {
46
47
  {
47
48
  type: "number",
48
49
  value: e.value,
49
- "aria-label": `Value ${a + m}`,
50
+ "aria-label": `Value ${a + c}`,
50
51
  onChange: (t) => {
51
52
  const n = Number(t.target.value) || d;
52
53
  p(
53
- (s) => s.map(
54
- (o, i) => i === a ? { ...o, value: n } : o
54
+ (i) => i.map(
55
+ (o, s) => s === a ? { ...o, value: n } : o
55
56
  )
56
57
  );
57
58
  }
@@ -67,8 +68,8 @@ const $ = () => ({ label: "•", value: m }), Y = (R) => {
67
68
  children: O
68
69
  }
69
70
  )
70
- ] }) : /* @__PURE__ */ l("div", { className: "Ink-GraphModal", children: C.map((e, a) => /* @__PURE__ */ c("label", { className: "Ink-GraphModal__row", children: [
71
- /* @__PURE__ */ l("span", { children: a + m }),
71
+ ] }) : /* @__PURE__ */ l("div", { className: "Ink-GraphModal", children: C.map((e, a) => /* @__PURE__ */ m("label", { className: "Ink-GraphModal__row", children: [
72
+ /* @__PURE__ */ l("span", { children: a + c }),
72
73
  /* @__PURE__ */ l(
73
74
  "input",
74
75
  {
@@ -77,7 +78,7 @@ const $ = () => ({ label: "•", value: m }), Y = (R) => {
77
78
  onChange: (t) => {
78
79
  const n = t.target.value || k;
79
80
  I(
80
- (s) => s.map((o, i) => i === a ? n : o)
81
+ (i) => i.map((o, s) => s === a ? n : o)
81
82
  );
82
83
  }
83
84
  }
@@ -87,5 +88,5 @@ const $ = () => ({ label: "•", value: m }), Y = (R) => {
87
88
  );
88
89
  };
89
90
  export {
90
- Y as GraphEditModal
91
+ F as GraphEditModal
91
92
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("react"),K=require("react-dom"),A=require("../../../../constants/numbers.cjs"),a=require("../../../../constants/generals.const.cjs"),D=require("../../../../constants/colorMode.const.cjs"),M=require("../../../../constants/keyboard.const.cjs"),o=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const s=require("../../../../plugins/graph/graph.const.cjs"),p=require("../../../../plugins/graph/graph.utils.cjs"),h=require("../ToolbarDropdown/ToolbarDropdown.utils.cjs"),q=require("../ToolbarButton/ToolbarButton.cjs"),g=N=>{const{icon:v,disabled:d=!1,hint:I,onHint:T,pluginColor:b,onInsert:w}=N,[c,i]=n.useState(!1),[l,G]=n.useState(s.GRAPH_KIND_DEFAULT),[_,H]=n.useState({top:A.NUMBER_ZERO,left:A.NUMBER_ZERO}),E=n.useRef(null),L=n.useRef(null),S=n.useRef(null);return n.useEffect(()=>{if(!c)return;const e=()=>{const r=h.getToolbarDropdownMenuPosition(L.current);H({top:r.top,left:r.left})};e();const u=r=>{var m,P;const R=r.target;(m=E.current)!=null&&m.contains(R)||(P=S.current)!=null&&P.contains(R)||i(!1)},f=r=>{r.key===M.KEY_ESCAPE&&i(!1)};return document.addEventListener("mousedown",u),document.addEventListener("keydown",f),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",f),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[c]),t.jsxs("div",{className:o.INK_CLASS_STYLE_DD,ref:E,children:[t.jsx("div",{ref:L,children:t.jsx(q.ToolbarButton,{icon:v,title:a.INK_GRAPH_TITLE,hint:I,onHint:T,pluginColor:b,disabled:d,onClick:()=>{d||i(e=>!e)}})}),c?K.createPortal(t.jsxs("div",{ref:S,className:`${o.INK_CLASS_STYLE_MENU} ${o.INK_CLASS_STYLE_MENU_PORTAL} ${o.INK_CLASS_STYLE_MENU_FORCED} ${o.INK_CLASS_GRAPH_PANEL}`,"data-color-mode":D.COLOR_MODE_LIGHT,role:"dialog","aria-label":a.INK_GRAPH_TITLE,style:{top:_.top,left:_.left},children:[t.jsx("div",{className:o.INK_CLASS_GRAPH_TYPES,children:s.GRAPH_KINDS.map(e=>t.jsx("button",{type:"button","aria-pressed":e===l,onMouseDown:u=>{u.preventDefault(),G(e)},children:s.GRAPH_KIND_LABELS[e]},e))}),t.jsx("div",{className:o.INK_CLASS_GRAPH_PREVIEW,dangerouslySetInnerHTML:{__html:p.buildGraphHtml(l,s.GRAPH_SAMPLE)}}),t.jsx("button",{type:"button",onMouseDown:e=>{e.preventDefault(),w(p.buildGraphHtml(l,s.GRAPH_SAMPLE)),i(!1)},children:a.INK_GRAPH_INSERT})]}),document.body):null]})};exports.GraphPicker=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("react"),K=require("react-dom"),A=require("../../../../constants/numbers.cjs"),a=require("../../../../constants/generals.const.cjs"),q=require("../../../../constants/colorMode.const.cjs"),D=require("../../../../constants/keyboard.const.cjs"),o=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const s=require("../../../../plugins/graph/graph.const.cjs"),p=require("../../../../plugins/graph/graph.utils.cjs"),M=require("../ToolbarDropdown/ToolbarDropdown.utils.cjs"),h=require("../ToolbarButton/ToolbarButton.cjs"),g=N=>{const{icon:v,disabled:d=!1,hint:I,onHint:T,pluginColor:b,onInsert:w}=N,[c,i]=n.useState(!1),[l,G]=n.useState(s.GRAPH_KIND_DEFAULT),[_,H]=n.useState({top:A.NUMBER_ZERO,left:A.NUMBER_ZERO}),E=n.useRef(null),L=n.useRef(null),S=n.useRef(null);return n.useEffect(()=>{if(!c)return;const e=()=>{const r=M.getToolbarDropdownMenuPosition(L.current);H({top:r.top,left:r.left})};e();const u=r=>{var m,P;const R=r.target;(m=E.current)!=null&&m.contains(R)||(P=S.current)!=null&&P.contains(R)||i(!1)},f=r=>{r.key===D.KEY_ESCAPE&&i(!1)};return document.addEventListener("mousedown",u),document.addEventListener("keydown",f),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",f),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[c]),t.jsxs("div",{className:o.INK_CLASS_STYLE_DD,ref:E,children:[t.jsx("div",{ref:L,children:t.jsx(h.ToolbarButton,{icon:v,title:a.INK_GRAPH_TITLE,hint:I,onHint:T,pluginColor:b,disabled:d,onClick:()=>{d||i(e=>!e)}})}),c?K.createPortal(t.jsxs("div",{ref:S,className:`${o.INK_CLASS_STYLE_MENU} ${o.INK_CLASS_STYLE_MENU_PORTAL} ${o.INK_CLASS_STYLE_MENU_FORCED} ${o.INK_CLASS_GRAPH_PANEL}`,"data-color-mode":q.COLOR_MODE_LIGHT,role:"dialog","aria-label":a.INK_GRAPH_TITLE,style:{top:_.top,left:_.left},children:[t.jsx("div",{className:o.INK_CLASS_GRAPH_TYPES,children:s.GRAPH_KINDS.map(e=>t.jsx("button",{type:"button","aria-pressed":e===l,onMouseDown:u=>{u.preventDefault(),G(e)},children:s.GRAPH_KIND_LABELS[e]},e))}),t.jsx("div",{className:o.INK_CLASS_GRAPH_PREVIEW,dangerouslySetInnerHTML:{__html:p.buildGraphHtml(l,s.GRAPH_SAMPLE)}}),t.jsx("button",{type:"button",onMouseDown:e=>{e.preventDefault(),w(p.buildGraphHtml(l,s.GRAPH_SAMPLE)),i(!1)},children:a.INK_GRAPH_INSERT})]}),document.body):null]})};exports.GraphPicker=g;
@@ -8,11 +8,12 @@ import { KEY_ESCAPE as y } from "../../../../constants/keyboard.const.js";
8
8
  import { INK_CLASS_STYLE_DD as g, INK_CLASS_STYLE_MENU as O, INK_CLASS_STYLE_MENU_PORTAL as k, INK_CLASS_STYLE_MENU_FORCED as Y, INK_CLASS_GRAPH_PANEL as U, INK_CLASS_GRAPH_TYPES as $, INK_CLASS_GRAPH_PREVIEW as B } from "../../../../constants/defaults.const.js";
9
9
  import "../../../../constants/openai.const.js";
10
10
  import "../../../../utils/paste.utils.js";
11
+ import "../../../../utils/exportDocument.utils.js";
11
12
  import { GRAPH_KIND_DEFAULT as j, GRAPH_KINDS as z, GRAPH_KIND_LABELS as F, GRAPH_SAMPLE as P } from "../../../../plugins/graph/graph.const.js";
12
13
  import { buildGraphHtml as v } from "../../../../plugins/graph/graph.utils.js";
13
14
  import { getToolbarDropdownMenuPosition as x } from "../ToolbarDropdown/ToolbarDropdown.utils.js";
14
15
  import { ToolbarButton as V } from "../ToolbarButton/ToolbarButton.js";
15
- const me = (R) => {
16
+ const de = (R) => {
16
17
  const { icon: I, disabled: d = !1, hint: w, onHint: K, pluginColor: T, onInsert: D } = R, [i, n] = l(!1), [s, H] = l(j), [a, C] = l({ top: A, left: A }), c = m(null), u = m(null), _ = m(null);
17
18
  return G(() => {
18
19
  if (!i) return;
@@ -94,5 +95,5 @@ const me = (R) => {
94
95
  ] });
95
96
  };
96
97
  export {
97
- me as GraphPicker
98
+ de as GraphPicker
98
99
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),o=require("../../../../constants/generals.const.cjs"),i=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const c=e=>{const{value:r,onChange:t,disabled:a=!1,minHeight:n}=e,l=s=>{t(s.target.value)};return u.jsx("textarea",{className:i.INK_CLASS_SOURCE,"aria-label":o.INK_HTML_SOURCE_TITLE,value:r,disabled:a,spellCheck:!1,style:{minHeight:n},onChange:l})};exports.HtmlSourcePanel=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),i=require("../../../../constants/generals.const.cjs"),o=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");require("react");require("react-dom");const c=e=>{const{value:r,onChange:t,disabled:a=!1,minHeight:n}=e,l=s=>{t(s.target.value)};return u.jsx("textarea",{className:o.INK_CLASS_SOURCE,"aria-label":i.INK_HTML_SOURCE_TITLE,value:r,disabled:a,spellCheck:!1,style:{minHeight:n},onChange:l})};exports.HtmlSourcePanel=c;
@@ -1,17 +1,18 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { INK_HTML_SOURCE_TITLE as m } from "../../../../constants/generals.const.js";
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { INK_HTML_SOURCE_TITLE as n } from "../../../../constants/generals.const.js";
3
3
  import { INK_CLASS_SOURCE as i } from "../../../../constants/defaults.const.js";
4
4
  import "../../../../constants/openai.const.js";
5
5
  import "../../../../utils/paste.utils.js";
6
+ import "../../../../utils/exportDocument.utils.js";
6
7
  import "react";
7
8
  import "react-dom";
8
- const _ = (e) => {
9
+ const d = (e) => {
9
10
  const { value: a, onChange: t, disabled: o = !1, minHeight: r } = e;
10
- return /* @__PURE__ */ n(
11
+ return /* @__PURE__ */ m(
11
12
  "textarea",
12
13
  {
13
14
  className: i,
14
- "aria-label": m,
15
+ "aria-label": n,
15
16
  value: a,
16
17
  disabled: o,
17
18
  spellCheck: !1,
@@ -23,5 +24,5 @@ const _ = (e) => {
23
24
  );
24
25
  };
25
26
  export {
26
- _ as HtmlSourcePanel
27
+ d as HtmlSourcePanel
27
28
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../../../../utils/image.utils.cjs"),c=u=>{var i,r;const{image:a,onChange:l,onClose:s}=u,o=n=>{t.setImageAlign(a,n),l()};return e.jsxs("div",{className:"Ink-ImageFrame",role:"toolbar","aria-label":"Image",children:[e.jsxs("label",{children:["Width",e.jsx("input",{type:"range",min:t.IMAGE_WIDTH_MIN,max:t.IMAGE_WIDTH_MAX,defaultValue:a.clientWidth||t.IMAGE_WIDTH_DEFAULT,onChange:n=>{t.setImageWidth(a,Number(n.target.value)),l()}})]}),e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:()=>o(t.IMAGE_ALIGN_LEFT),children:"Left"}),e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:()=>o(t.IMAGE_ALIGN_CENTER),children:"Center"}),e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:()=>o(t.IMAGE_ALIGN_RIGHT),children:"Right"}),e.jsx("input",{"aria-label":"Alt text",defaultValue:a.alt,placeholder:"Alt text",onBlur:n=>{t.setImageAlt(a,n.target.value),l()}}),e.jsx("input",{"aria-label":"Caption",defaultValue:((r=(i=a.parentElement)==null?void 0:i.querySelector("figcaption"))==null?void 0:r.textContent)??"",placeholder:"Caption",onBlur:n=>{t.setImageCaption(a,n.target.value),l()}}),e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:s,children:"Done"})]})};exports.ImageFrame=c;
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ export interface ImageFrameProps {
3
+ image: HTMLImageElement;
4
+ onChange: () => void;
5
+ onClose: () => void;
6
+ }
7
+ export declare const ImageFrame: FC<ImageFrameProps>;
8
+ //# sourceMappingURL=ImageFrame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageFrame.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ImageFrame/ImageFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAehC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,gBAAgB,CAAC;IACxB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAqD1C,CAAC"}