@forgedevstack/ink 1.1.7 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +9 -1
  3. package/bin/ink.const.mjs +26 -0
  4. package/bin/ink.mjs +58 -0
  5. package/dist/components/InkEditor/InkEditor.cjs +1 -1
  6. package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
  7. package/dist/components/InkEditor/InkEditor.js +1193 -834
  8. package/dist/components/InkEditor/components/AiPanel/AiPanel.cjs +1 -1
  9. package/dist/components/InkEditor/components/AiPanel/AiPanel.d.ts.map +1 -1
  10. package/dist/components/InkEditor/components/AiPanel/AiPanel.js +58 -52
  11. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.cjs +1 -0
  12. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts +4 -0
  13. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts.map +1 -0
  14. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.js +223 -0
  15. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.types.d.ts +10 -0
  16. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.types.d.ts.map +1 -0
  17. package/dist/components/InkEditor/components/ExcelSheetPanel/index.d.ts +3 -0
  18. package/dist/components/InkEditor/components/ExcelSheetPanel/index.d.ts.map +1 -0
  19. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.cjs +1 -0
  20. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.d.ts +4 -0
  21. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.d.ts.map +1 -0
  22. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.js +91 -0
  23. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.types.d.ts +11 -0
  24. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.types.d.ts.map +1 -0
  25. package/dist/components/InkEditor/components/GraphEditModal/index.d.ts +3 -0
  26. package/dist/components/InkEditor/components/GraphEditModal/index.d.ts.map +1 -0
  27. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.cjs +1 -0
  28. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.d.ts +4 -0
  29. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.d.ts.map +1 -0
  30. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.js +98 -0
  31. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.types.d.ts +10 -0
  32. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.types.d.ts.map +1 -0
  33. package/dist/components/InkEditor/components/GraphPicker/index.d.ts +3 -0
  34. package/dist/components/InkEditor/components/GraphPicker/index.d.ts.map +1 -0
  35. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.cjs +1 -0
  36. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.d.ts +4 -0
  37. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.d.ts.map +1 -0
  38. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.js +27 -0
  39. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.types.d.ts +7 -0
  40. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.types.d.ts.map +1 -0
  41. package/dist/components/InkEditor/components/HtmlSourcePanel/index.d.ts +3 -0
  42. package/dist/components/InkEditor/components/HtmlSourcePanel/index.d.ts.map +1 -0
  43. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.cjs +1 -1
  44. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.d.ts.map +1 -1
  45. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.js +17 -12
  46. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.types.d.ts +1 -0
  47. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.types.d.ts.map +1 -1
  48. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.cjs +1 -0
  49. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.cjs +1 -0
  50. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.d.ts +7 -0
  51. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.d.ts.map +1 -0
  52. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.js +9 -0
  53. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.d.ts +4 -0
  54. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.d.ts.map +1 -0
  55. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.js +82 -0
  56. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.types.d.ts +8 -0
  57. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.types.d.ts.map +1 -0
  58. package/dist/components/InkEditor/components/PresenceStack/index.d.ts +3 -0
  59. package/dist/components/InkEditor/components/PresenceStack/index.d.ts.map +1 -0
  60. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.cjs +1 -0
  61. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.cjs +1 -0
  62. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.d.ts +7 -0
  63. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.d.ts.map +1 -0
  64. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.js +10 -0
  65. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.d.ts +4 -0
  66. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.d.ts.map +1 -0
  67. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.js +65 -0
  68. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.types.d.ts +6 -0
  69. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.types.d.ts.map +1 -0
  70. package/dist/components/InkEditor/components/RemoteCursors/index.d.ts +3 -0
  71. package/dist/components/InkEditor/components/RemoteCursors/index.d.ts.map +1 -0
  72. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.cjs +1 -0
  73. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.cjs +1 -0
  74. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.d.ts +10 -0
  75. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.d.ts.map +1 -0
  76. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.js +18 -0
  77. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.d.ts +4 -0
  78. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.d.ts.map +1 -0
  79. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.js +96 -0
  80. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.types.d.ts +11 -0
  81. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.types.d.ts.map +1 -0
  82. package/dist/components/InkEditor/components/TableSizePicker/index.d.ts +3 -0
  83. package/dist/components/InkEditor/components/TableSizePicker/index.d.ts.map +1 -0
  84. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.cjs +1 -0
  85. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts +4 -0
  86. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts.map +1 -0
  87. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.js +65 -0
  88. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.types.d.ts +12 -0
  89. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.types.d.ts.map +1 -0
  90. package/dist/components/InkEditor/components/ThemePicker/hooks/index.d.ts +3 -0
  91. package/dist/components/InkEditor/components/ThemePicker/hooks/index.d.ts.map +1 -0
  92. package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.cjs +1 -0
  93. package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.d.ts +13 -0
  94. package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.d.ts.map +1 -0
  95. package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.js +39 -0
  96. package/dist/components/InkEditor/components/ThemePicker/index.d.ts +3 -0
  97. package/dist/components/InkEditor/components/ThemePicker/index.d.ts.map +1 -0
  98. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.cjs +1 -0
  99. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.d.ts +4 -0
  100. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.d.ts.map +1 -0
  101. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.js +79 -0
  102. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.types.d.ts +10 -0
  103. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.types.d.ts.map +1 -0
  104. package/dist/components/InkEditor/components/TitleGallery/index.d.ts +3 -0
  105. package/dist/components/InkEditor/components/TitleGallery/index.d.ts.map +1 -0
  106. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.cjs +1 -1
  107. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.d.ts.map +1 -1
  108. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.js +41 -18
  109. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
  110. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.d.ts.map +1 -1
  111. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.js +25 -23
  112. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.cjs +1 -1
  113. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts +1 -1
  114. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts.map +1 -1
  115. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.js +7 -7
  116. package/dist/components/InkEditor/components/index.d.ts +18 -0
  117. package/dist/components/InkEditor/components/index.d.ts.map +1 -1
  118. package/dist/components/InkEditor/helpers/format.utils.cjs +2 -2
  119. package/dist/components/InkEditor/helpers/format.utils.d.ts +1 -1
  120. package/dist/components/InkEditor/helpers/format.utils.d.ts.map +1 -1
  121. package/dist/components/InkEditor/helpers/format.utils.js +72 -72
  122. package/dist/components/InkTabs/InkTabs.cjs +1 -0
  123. package/dist/components/InkTabs/InkTabs.d.ts +4 -0
  124. package/dist/components/InkTabs/InkTabs.d.ts.map +1 -0
  125. package/dist/components/InkTabs/InkTabs.js +104 -0
  126. package/dist/components/InkTabs/index.d.ts +2 -0
  127. package/dist/components/InkTabs/index.d.ts.map +1 -0
  128. package/dist/components/InkWorkspace/InkWorkspace.cjs +1 -0
  129. package/dist/components/InkWorkspace/InkWorkspace.d.ts +4 -0
  130. package/dist/components/InkWorkspace/InkWorkspace.d.ts.map +1 -0
  131. package/dist/components/InkWorkspace/InkWorkspace.js +317 -0
  132. package/dist/components/InkWorkspace/components/WorkspaceIcons.cjs +1 -0
  133. package/dist/components/InkWorkspace/components/WorkspaceIcons.d.ts +11 -0
  134. package/dist/components/InkWorkspace/components/WorkspaceIcons.d.ts.map +1 -0
  135. package/dist/components/InkWorkspace/components/WorkspaceIcons.js +39 -0
  136. package/dist/components/InkWorkspace/hooks/useInkWorkspace.cjs +1 -0
  137. package/dist/components/InkWorkspace/hooks/useInkWorkspace.d.ts +30 -0
  138. package/dist/components/InkWorkspace/hooks/useInkWorkspace.d.ts.map +1 -0
  139. package/dist/components/InkWorkspace/hooks/useInkWorkspace.js +72 -0
  140. package/dist/components/InkWorkspace/index.d.ts +4 -0
  141. package/dist/components/InkWorkspace/index.d.ts.map +1 -0
  142. package/dist/components/index.d.ts +2 -0
  143. package/dist/components/index.d.ts.map +1 -1
  144. package/dist/constants/collab.const.cjs +1 -0
  145. package/dist/constants/collab.const.d.ts +20 -0
  146. package/dist/constants/collab.const.d.ts.map +1 -0
  147. package/dist/constants/collab.const.js +54 -0
  148. package/dist/constants/colorMode.const.cjs +1 -1
  149. package/dist/constants/colorMode.const.d.ts +1 -1
  150. package/dist/constants/colorMode.const.d.ts.map +1 -1
  151. package/dist/constants/colorMode.const.js +4 -4
  152. package/dist/constants/contextMenu.const.cjs +1 -1
  153. package/dist/constants/contextMenu.const.d.ts +2 -0
  154. package/dist/constants/contextMenu.const.d.ts.map +1 -1
  155. package/dist/constants/contextMenu.const.js +17 -15
  156. package/dist/constants/defaultIcons.cjs +1 -1
  157. package/dist/constants/defaultIcons.d.ts.map +1 -1
  158. package/dist/constants/defaultIcons.js +20 -13
  159. package/dist/constants/defaults.const.cjs +1 -1
  160. package/dist/constants/defaults.const.d.ts +48 -0
  161. package/dist/constants/defaults.const.d.ts.map +1 -1
  162. package/dist/constants/defaults.const.js +201 -102
  163. package/dist/constants/generals.const.cjs +1 -1
  164. package/dist/constants/generals.const.d.ts +48 -0
  165. package/dist/constants/generals.const.d.ts.map +1 -1
  166. package/dist/constants/generals.const.js +71 -28
  167. package/dist/constants/index.d.ts +3 -0
  168. package/dist/constants/index.d.ts.map +1 -1
  169. package/dist/constants/numbers.cjs +1 -1
  170. package/dist/constants/numbers.d.ts +14 -0
  171. package/dist/constants/numbers.d.ts.map +1 -1
  172. package/dist/constants/numbers.js +47 -28
  173. package/dist/constants/plugins.const.cjs +1 -0
  174. package/dist/constants/plugins.const.d.ts +13 -0
  175. package/dist/constants/plugins.const.d.ts.map +1 -0
  176. package/dist/constants/plugins.const.js +45 -0
  177. package/dist/constants/table.const.cjs +1 -1
  178. package/dist/constants/table.const.d.ts +4 -0
  179. package/dist/constants/table.const.d.ts.map +1 -1
  180. package/dist/constants/table.const.js +10 -6
  181. package/dist/constants/toolbar.const.cjs +1 -1
  182. package/dist/constants/toolbar.const.d.ts +7 -0
  183. package/dist/constants/toolbar.const.d.ts.map +1 -1
  184. package/dist/constants/toolbar.const.js +16 -9
  185. package/dist/constants/toolbarMenu.const.cjs +1 -1
  186. package/dist/constants/toolbarMenu.const.d.ts +2 -0
  187. package/dist/constants/toolbarMenu.const.d.ts.map +1 -1
  188. package/dist/constants/toolbarMenu.const.js +80 -19
  189. package/dist/constants/workspace.const.cjs +1 -0
  190. package/dist/constants/workspace.const.d.ts +24 -0
  191. package/dist/constants/workspace.const.d.ts.map +1 -0
  192. package/dist/constants/workspace.const.js +23 -0
  193. package/dist/hooks/index.d.ts +4 -0
  194. package/dist/hooks/index.d.ts.map +1 -0
  195. package/dist/hooks/useInkCollaboration.cjs +1 -0
  196. package/dist/hooks/useInkCollaboration.d.ts +4 -0
  197. package/dist/hooks/useInkCollaboration.d.ts.map +1 -0
  198. package/dist/hooks/useInkCollaboration.js +86 -0
  199. package/dist/hooks/useToolbarOverflow.cjs +1 -0
  200. package/dist/hooks/useToolbarOverflow.d.ts +8 -0
  201. package/dist/hooks/useToolbarOverflow.d.ts.map +1 -0
  202. package/dist/hooks/useToolbarOverflow.js +29 -0
  203. package/dist/index.cjs +1 -1
  204. package/dist/index.d.ts +8 -3
  205. package/dist/index.d.ts.map +1 -1
  206. package/dist/index.js +150 -104
  207. package/dist/plugins/excel/excel.utils.cjs +1 -0
  208. package/dist/plugins/excel/excel.utils.d.ts +13 -0
  209. package/dist/plugins/excel/excel.utils.d.ts.map +1 -0
  210. package/dist/plugins/excel/excel.utils.js +40 -0
  211. package/dist/plugins/excel/index.d.ts +3 -0
  212. package/dist/plugins/excel/index.d.ts.map +1 -0
  213. package/dist/plugins/graph/graph.const.cjs +1 -0
  214. package/dist/plugins/graph/graph.const.d.ts +14 -0
  215. package/dist/plugins/graph/graph.const.d.ts.map +1 -0
  216. package/dist/plugins/graph/graph.const.js +24 -0
  217. package/dist/plugins/graph/graph.types.d.ts +7 -0
  218. package/dist/plugins/graph/graph.types.d.ts.map +1 -0
  219. package/dist/plugins/graph/graph.utils.cjs +1 -0
  220. package/dist/plugins/graph/graph.utils.d.ts +11 -0
  221. package/dist/plugins/graph/graph.utils.d.ts.map +1 -0
  222. package/dist/plugins/graph/graph.utils.js +76 -0
  223. package/dist/plugins/graph/index.d.ts +4 -0
  224. package/dist/plugins/graph/index.d.ts.map +1 -0
  225. package/dist/plugins/host/index.d.ts +2 -0
  226. package/dist/plugins/host/index.d.ts.map +1 -0
  227. package/dist/plugins/host/inkPlugins.cjs +1 -0
  228. package/dist/plugins/host/inkPlugins.d.ts +16 -0
  229. package/dist/plugins/host/inkPlugins.d.ts.map +1 -0
  230. package/dist/plugins/host/inkPlugins.js +20 -0
  231. package/dist/plugins/index.d.ts +5 -0
  232. package/dist/plugins/index.d.ts.map +1 -0
  233. package/dist/plugins/theme/index.d.ts +4 -0
  234. package/dist/plugins/theme/index.d.ts.map +1 -0
  235. package/dist/plugins/theme/inkTheme.cjs +1 -0
  236. package/dist/plugins/theme/inkTheme.d.ts +5 -0
  237. package/dist/plugins/theme/inkTheme.d.ts.map +1 -0
  238. package/dist/plugins/theme/inkTheme.js +27 -0
  239. package/dist/plugins/theme/theme.const.cjs +1 -0
  240. package/dist/plugins/theme/theme.const.d.ts +9 -0
  241. package/dist/plugins/theme/theme.const.d.ts.map +1 -0
  242. package/dist/plugins/theme/theme.const.js +15 -0
  243. package/dist/plugins/theme/theme.types.d.ts +12 -0
  244. package/dist/plugins/theme/theme.types.d.ts.map +1 -0
  245. package/dist/plugins/titles/index.d.ts +4 -0
  246. package/dist/plugins/titles/index.d.ts.map +1 -0
  247. package/dist/plugins/titles/titles.const.cjs +1 -0
  248. package/dist/plugins/titles/titles.const.d.ts +4 -0
  249. package/dist/plugins/titles/titles.const.d.ts.map +1 -0
  250. package/dist/plugins/titles/titles.const.js +15 -0
  251. package/dist/plugins/titles/titles.types.d.ts +2 -0
  252. package/dist/plugins/titles/titles.types.d.ts.map +1 -0
  253. package/dist/plugins/titles/titles.utils.cjs +1 -0
  254. package/dist/plugins/titles/titles.utils.d.ts +3 -0
  255. package/dist/plugins/titles/titles.utils.d.ts.map +1 -0
  256. package/dist/plugins/titles/titles.utils.js +14 -0
  257. package/dist/styles.css +1 -1
  258. package/dist/types/collab.types.d.ts +55 -0
  259. package/dist/types/collab.types.d.ts.map +1 -0
  260. package/dist/types/features.types.d.ts +1 -1
  261. package/dist/types/features.types.d.ts.map +1 -1
  262. package/dist/types/index.d.ts +3 -0
  263. package/dist/types/index.d.ts.map +1 -1
  264. package/dist/types/ink.types.d.ts +10 -2
  265. package/dist/types/ink.types.d.ts.map +1 -1
  266. package/dist/types/plugin.types.d.ts +8 -0
  267. package/dist/types/plugin.types.d.ts.map +1 -0
  268. package/dist/types/premium.types.d.ts +1 -1
  269. package/dist/types/premium.types.d.ts.map +1 -1
  270. package/dist/types/workspace.types.d.ts +54 -0
  271. package/dist/types/workspace.types.d.ts.map +1 -0
  272. package/dist/utils/collab.utils.cjs +1 -0
  273. package/dist/utils/collab.utils.d.ts +5 -0
  274. package/dist/utils/collab.utils.d.ts.map +1 -0
  275. package/dist/utils/collab.utils.js +32 -0
  276. package/dist/utils/collab.utils.test.d.ts +2 -0
  277. package/dist/utils/collab.utils.test.d.ts.map +1 -0
  278. package/dist/utils/index.d.ts +3 -1
  279. package/dist/utils/index.d.ts.map +1 -1
  280. package/dist/utils/ink.brand.test.d.ts +2 -0
  281. package/dist/utils/ink.brand.test.d.ts.map +1 -0
  282. package/dist/utils/outline.utils.cjs +1 -1
  283. package/dist/utils/outline.utils.d.ts.map +1 -1
  284. package/dist/utils/outline.utils.js +32 -32
  285. package/dist/utils/table.utils.cjs +1 -1
  286. package/dist/utils/table.utils.d.ts +4 -0
  287. package/dist/utils/table.utils.d.ts.map +1 -1
  288. package/dist/utils/table.utils.js +84 -45
  289. package/dist/utils/workspace.utils.cjs +1 -0
  290. package/dist/utils/workspace.utils.d.ts +5 -0
  291. package/dist/utils/workspace.utils.d.ts.map +1 -0
  292. package/dist/utils/workspace.utils.js +26 -0
  293. package/dist/utils/workspace.utils.test.d.ts +2 -0
  294. package/dist/utils/workspace.utils.test.d.ts.map +1 -0
  295. package/package.json +7 -1
@@ -1,28 +1,51 @@
1
- import { jsx as l } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as f } from "react/jsx-runtime";
2
+ import { EMPTY_STRING as N } from "../../../../constants/generals.const.js";
3
+ import { INK_CLASS_TOOL_WRAP as _, INK_CLASS_PLUGIN_PIP as I } from "../../../../constants/defaults.const.js";
2
4
  import "../../../../constants/openai.const.js";
3
5
  import "../../../../utils/paste.utils.js";
4
- import { Button as p } from "../../../../common-components/Button/Button.js";
6
+ import { Button as L } from "../../../../common-components/Button/Button.js";
5
7
  import "react";
6
8
  import "react-dom";
7
- const w = (e) => {
8
- const { icon: r, title: o, active: t = !1, onClick: s, disabled: i = !1, className: n } = e;
9
- return /* @__PURE__ */ l(
10
- p,
9
+ const x = (a) => {
10
+ const {
11
+ icon: l,
12
+ title: e,
13
+ hint: i,
14
+ onHint: o,
15
+ pluginColor: r,
16
+ active: s = !1,
17
+ onClick: n,
18
+ disabled: m = !1,
19
+ className: p
20
+ } = a, c = (d) => {
21
+ d.preventDefault();
22
+ }, u = i || e;
23
+ return /* @__PURE__ */ t(
24
+ "span",
11
25
  {
12
- title: o,
13
- "aria-label": o,
14
- "aria-pressed": t,
15
- disabled: i,
16
- active: t,
17
- className: n,
18
- onMouseDown: (a) => {
19
- a.preventDefault();
20
- },
21
- onClick: s,
22
- children: r
26
+ className: _,
27
+ onMouseEnter: () => o == null ? void 0 : o(u),
28
+ onMouseLeave: () => o == null ? void 0 : o(N),
29
+ children: /* @__PURE__ */ f(
30
+ L,
31
+ {
32
+ title: e,
33
+ "aria-label": e,
34
+ "aria-pressed": s,
35
+ disabled: m,
36
+ active: s,
37
+ className: p,
38
+ onMouseDown: c,
39
+ onClick: n,
40
+ children: [
41
+ l,
42
+ r ? /* @__PURE__ */ t("span", { className: I, style: { background: r }, "aria-hidden": !0 }) : null
43
+ ]
44
+ }
45
+ )
23
46
  }
24
47
  );
25
48
  };
26
49
  export {
27
- w as ToolbarButton
50
+ x as ToolbarButton
28
51
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),r=require("react"),g=require("react-dom"),u=require("../../../../constants/numbers.cjs"),c=require("../../../../constants/generals.const.cjs"),x=require("../../../../constants/keyboard.const.cjs"),t=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const K=require("./ToolbarDropdown.utils.cjs"),P=()=>n.jsx("svg",{className:t.INK_CLASS_STYLE_CHEV,viewBox:"0 0 10 10","aria-hidden":"true",children:n.jsx("path",{d:"M2 3.5L5 6.5L8 3.5",stroke:"currentColor",strokeWidth:"1.4",fill:"none"})}),D=R=>{const{options:d,value:f,onChange:w,title:_,disabled:L=!1}=R,[i,l]=r.useState(!1),[E,C]=r.useState({top:u.NUMBER_ZERO,left:u.NUMBER_ZERO,minWidth:u.NUMBER_ZERO}),m=r.useRef(null),v=r.useRef(null),N=r.useRef(null),S=d.find(e=>e.value===f)??d[u.NUMBER_ZERO],h=(S==null?void 0:S.label)??c.EMPTY_STRING;r.useEffect(()=>{if(!i)return;const e=()=>{C(K.getToolbarDropdownMenuPosition(v.current))};e();const o=s=>{var p,b;const T=s.target;(p=m.current)!=null&&p.contains(T)||(b=N.current)!=null&&b.contains(T)||l(!1)},a=s=>{s.key===x.KEY_ESCAPE&&l(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",a),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",a),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[i]);const I=e=>{e.preventDefault()},M=()=>{L||l(e=>!e)};return n.jsxs("div",{className:t.INK_CLASS_STYLE_DD,ref:m,children:[n.jsxs("button",{ref:v,type:"button",className:t.INK_CLASS_STYLE_TRIGGER,title:_,"aria-label":_,"aria-haspopup":"listbox","aria-expanded":i,disabled:L,onMouseDown:I,onClick:M,children:[n.jsx("span",{children:h}),n.jsx(P,{})]}),i?g.createPortal(n.jsx("div",{ref:N,className:`${t.INK_CLASS_STYLE_MENU} ${t.INK_CLASS_STYLE_MENU_PORTAL}`,role:"listbox","aria-label":_,style:{top:E.top,left:E.left,minWidth:E.minWidth},children:d.map(e=>{const o=e.value===f,a=`${t.INK_CLASS_STYLE_OPTION}${o?`${c.SPACE_STRING}${t.INK_CLASS_STYLE_OPTION_SEL}`:c.EMPTY_STRING}`;return n.jsxs("button",{type:"button",role:"option","aria-selected":o,className:a,onMouseDown:s=>{s.preventDefault(),w(e.value),l(!1)},children:[o?n.jsx("span",{className:t.INK_CLASS_STYLE_CHECK,"aria-hidden":"true",children:c.INK_STYLE_CHECK}):null,e.label]},e.value)})}),document.body):null]})};exports.ToolbarDropdown=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("react"),O=require("react-dom"),c=require("../../../../constants/numbers.cjs"),u=require("../../../../constants/generals.const.cjs"),g=require("../../../../constants/colorMode.const.cjs"),x=require("../../../../constants/keyboard.const.cjs"),n=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const D=require("./ToolbarDropdown.utils.cjs"),K=()=>t.jsx("svg",{className:n.INK_CLASS_STYLE_CHEV,viewBox:"0 0 10 10","aria-hidden":"true",children:t.jsx("path",{d:"M2 3.5L5 6.5L8 3.5",stroke:"currentColor",strokeWidth:"1.4",fill:"none"})}),P=R=>{const{options:d,value:L,onChange:b,title:_,disabled:f=!1}=R,[i,l]=r.useState(!1),[E,w]=r.useState({top:c.NUMBER_ZERO,left:c.NUMBER_ZERO,minWidth:c.NUMBER_ZERO}),m=r.useRef(null),N=r.useRef(null),T=r.useRef(null),S=d.find(e=>e.value===L)??d[c.NUMBER_ZERO],I=(S==null?void 0:S.label)??u.EMPTY_STRING;r.useEffect(()=>{if(!i)return;const e=()=>{w(D.getToolbarDropdownMenuPosition(N.current))};e();const o=s=>{var p,C;const v=s.target;(p=m.current)!=null&&p.contains(v)||(C=T.current)!=null&&C.contains(v)||l(!1)},a=s=>{s.key===x.KEY_ESCAPE&&l(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",a),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",a),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[i]);const M=e=>{e.preventDefault()},h=()=>{f||l(e=>!e)};return t.jsxs("div",{className:n.INK_CLASS_STYLE_DD,ref:m,children:[t.jsxs("button",{ref:N,type:"button",className:n.INK_CLASS_STYLE_TRIGGER,title:_,"aria-label":_,"aria-haspopup":"listbox","aria-expanded":i,disabled:f,onMouseDown:M,onClick:h,children:[t.jsx("span",{children:I}),t.jsx(K,{})]}),i?O.createPortal(t.jsx("div",{ref:T,className:`${n.INK_CLASS_STYLE_MENU} ${n.INK_CLASS_STYLE_MENU_PORTAL} ${n.INK_CLASS_STYLE_MENU_FORCED}`,"data-color-mode":g.COLOR_MODE_LIGHT,role:"listbox","aria-label":_,style:{top:E.top,left:E.left,minWidth:E.minWidth},children:d.map(e=>{const o=e.value===L,a=`${n.INK_CLASS_STYLE_OPTION}${o?`${u.SPACE_STRING}${n.INK_CLASS_STYLE_OPTION_SEL}`:u.EMPTY_STRING}`;return t.jsxs("button",{type:"button",role:"option","aria-selected":o,className:a,onMouseDown:s=>{s.preventDefault(),b(e.value),l(!1)},children:[o?t.jsx("span",{className:n.INK_CLASS_STYLE_CHECK,"aria-hidden":"true",children:u.INK_STYLE_CHECK}):null,e.label]},e.value)})}),document.body):null]})};exports.ToolbarDropdown=P;
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarDropdown.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,EAAE,EAAmB,MAAM,OAAO,CAAC;AAiB9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAU9D,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA4GpD,CAAC"}
1
+ {"version":3,"file":"ToolbarDropdown.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,EAAE,EAAmB,MAAM,OAAO,CAAC;AAmB9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAU9D,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA6GpD,CAAC"}
@@ -1,42 +1,43 @@
1
1
  import { jsxs as m, jsx as n } from "react/jsx-runtime";
2
- import { useState as C, useRef as f, useEffect as K } from "react";
3
- import { createPortal as A } from "react-dom";
2
+ import { useState as C, useRef as _, useEffect as K } from "react";
3
+ import { createPortal as M } from "react-dom";
4
4
  import { NUMBER_ZERO as l } from "../../../../constants/numbers.js";
5
- import { EMPTY_STRING as w, SPACE_STRING as M, INK_STYLE_CHECK as P } from "../../../../constants/generals.const.js";
6
- import { KEY_ESCAPE as R } from "../../../../constants/keyboard.const.js";
7
- import { INK_CLASS_STYLE_DD as Y, INK_CLASS_STYLE_TRIGGER as D, INK_CLASS_STYLE_MENU as y, INK_CLASS_STYLE_MENU_PORTAL as x, INK_CLASS_STYLE_OPTION as O, INK_CLASS_STYLE_OPTION_SEL as k, INK_CLASS_STYLE_CHECK as $, INK_CLASS_STYLE_CHEV as G } from "../../../../constants/defaults.const.js";
5
+ import { EMPTY_STRING as w, SPACE_STRING as R, INK_STYLE_CHECK as A } from "../../../../constants/generals.const.js";
6
+ import { COLOR_MODE_LIGHT as D } from "../../../../constants/colorMode.const.js";
7
+ import { KEY_ESCAPE as Y } from "../../../../constants/keyboard.const.js";
8
+ import { INK_CLASS_STYLE_DD as O, INK_CLASS_STYLE_TRIGGER as P, INK_CLASS_STYLE_MENU as y, INK_CLASS_STYLE_MENU_PORTAL as x, INK_CLASS_STYLE_MENU_FORCED as $, INK_CLASS_STYLE_OPTION as k, INK_CLASS_STYLE_OPTION_SEL as G, INK_CLASS_STYLE_CHECK as H, INK_CLASS_STYLE_CHEV as U } from "../../../../constants/defaults.const.js";
8
9
  import "../../../../constants/openai.const.js";
9
10
  import "../../../../utils/paste.utils.js";
10
11
  import { getToolbarDropdownMenuPosition as W } from "./ToolbarDropdown.utils.js";
11
- const H = () => /* @__PURE__ */ n("svg", { className: G, viewBox: "0 0 10 10", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M2 3.5L5 6.5L8 3.5", stroke: "currentColor", strokeWidth: "1.4", fill: "none" }) }), oe = (h) => {
12
- const { options: a, value: E, onChange: b, title: c, disabled: S = !1 } = h, [r, s] = C(!1), [d, g] = C({
12
+ const j = () => /* @__PURE__ */ n("svg", { className: U, viewBox: "0 0 10 10", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M2 3.5L5 6.5L8 3.5", stroke: "currentColor", strokeWidth: "1.4", fill: "none" }) }), re = (h) => {
13
+ const { options: a, value: E, onChange: I, title: c, disabled: S = !1 } = h, [r, s] = C(!1), [d, b] = C({
13
14
  top: l,
14
15
  left: l,
15
16
  minWidth: l
16
- }), _ = f(null), p = f(null), L = f(null), u = a.find((e) => e.value === E) ?? a[l], I = (u == null ? void 0 : u.label) ?? w;
17
+ }), f = _(null), L = _(null), p = _(null), u = a.find((e) => e.value === E) ?? a[l], g = (u == null ? void 0 : u.label) ?? w;
17
18
  return K(() => {
18
19
  if (!r) return;
19
20
  const e = () => {
20
- g(W(p.current));
21
+ b(W(L.current));
21
22
  };
22
23
  e();
23
24
  const o = (t) => {
24
25
  var N, T;
25
26
  const v = t.target;
26
- (N = _.current) != null && N.contains(v) || (T = L.current) != null && T.contains(v) || s(!1);
27
+ (N = f.current) != null && N.contains(v) || (T = p.current) != null && T.contains(v) || s(!1);
27
28
  }, i = (t) => {
28
- t.key === R && s(!1);
29
+ t.key === Y && s(!1);
29
30
  };
30
31
  return document.addEventListener("mousedown", o), document.addEventListener("keydown", i), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
31
32
  document.removeEventListener("mousedown", o), document.removeEventListener("keydown", i), window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
32
33
  };
33
- }, [r]), /* @__PURE__ */ m("div", { className: Y, ref: _, children: [
34
+ }, [r]), /* @__PURE__ */ m("div", { className: O, ref: f, children: [
34
35
  /* @__PURE__ */ m(
35
36
  "button",
36
37
  {
37
- ref: p,
38
+ ref: L,
38
39
  type: "button",
39
- className: D,
40
+ className: P,
40
41
  title: c,
41
42
  "aria-label": c,
42
43
  "aria-haspopup": "listbox",
@@ -49,22 +50,23 @@ const H = () => /* @__PURE__ */ n("svg", { className: G, viewBox: "0 0 10 10", "
49
50
  S || s((e) => !e);
50
51
  },
51
52
  children: [
52
- /* @__PURE__ */ n("span", { children: I }),
53
- /* @__PURE__ */ n(H, {})
53
+ /* @__PURE__ */ n("span", { children: g }),
54
+ /* @__PURE__ */ n(j, {})
54
55
  ]
55
56
  }
56
57
  ),
57
- r ? A(
58
+ r ? M(
58
59
  /* @__PURE__ */ n(
59
60
  "div",
60
61
  {
61
- ref: L,
62
- className: `${y} ${x}`,
62
+ ref: p,
63
+ className: `${y} ${x} ${$}`,
64
+ "data-color-mode": D,
63
65
  role: "listbox",
64
66
  "aria-label": c,
65
67
  style: { top: d.top, left: d.left, minWidth: d.minWidth },
66
68
  children: a.map((e) => {
67
- const o = e.value === E, i = `${O}${o ? `${M}${k}` : w}`;
69
+ const o = e.value === E, i = `${k}${o ? `${R}${G}` : w}`;
68
70
  return /* @__PURE__ */ m(
69
71
  "button",
70
72
  {
@@ -73,10 +75,10 @@ const H = () => /* @__PURE__ */ n("svg", { className: G, viewBox: "0 0 10 10", "
73
75
  "aria-selected": o,
74
76
  className: i,
75
77
  onMouseDown: (t) => {
76
- t.preventDefault(), b(e.value), s(!1);
78
+ t.preventDefault(), I(e.value), s(!1);
77
79
  },
78
80
  children: [
79
- o ? /* @__PURE__ */ n("span", { className: $, "aria-hidden": "true", children: P }) : null,
81
+ o ? /* @__PURE__ */ n("span", { className: H, "aria-hidden": "true", children: A }) : null,
80
82
  e.label
81
83
  ]
82
84
  },
@@ -90,5 +92,5 @@ const H = () => /* @__PURE__ */ n("svg", { className: G, viewBox: "0 0 10 10", "
90
92
  ] });
91
93
  };
92
94
  export {
93
- oe as ToolbarDropdown
95
+ re as ToolbarDropdown
94
96
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../../constants/numbers.cjs");require("../../../../constants/openai.const.cjs");require("react/jsx-runtime");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const T=E=>{if(!E)return{top:t.NUMBER_ZERO,left:t.NUMBER_ZERO,minWidth:t.INK_STYLE_MENU_MIN_WIDTH_PX};const _=E.getBoundingClientRect(),n=window.innerWidth,i=window.innerHeight,e=Math.max(_.width,t.INK_STYLE_MENU_MIN_WIDTH_PX),r=Math.max(t.INK_STYLE_MENU_EDGE_PX,n-e-t.INK_STYLE_MENU_EDGE_PX),N=Math.min(Math.max(_.left,t.INK_STYLE_MENU_EDGE_PX),r),o=_.bottom+t.INK_STYLE_MENU_GAP_PX,M=_.top-t.INK_STYLE_MENU_ESTIMATED_HEIGHT_PX-t.INK_STYLE_MENU_GAP_PX;return{top:o+t.INK_STYLE_MENU_ESTIMATED_HEIGHT_PX>i-t.INK_STYLE_MENU_EDGE_PX?Math.max(t.INK_STYLE_MENU_EDGE_PX,M):o,left:N,minWidth:e}};exports.getToolbarDropdownMenuPosition=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../../../../constants/numbers.cjs");require("../../../../constants/openai.const.cjs");require("react/jsx-runtime");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const c=(E,o=_.INK_STYLE_MENU_ESTIMATED_HEIGHT_PX)=>{if(!E)return{top:_.NUMBER_ZERO,left:_.NUMBER_ZERO,minWidth:_.INK_STYLE_MENU_MIN_WIDTH_PX};const t=E.getBoundingClientRect(),r=window.innerWidth,N=window.innerHeight,e=Math.max(t.width,_.INK_STYLE_MENU_MIN_WIDTH_PX),M=Math.max(_.INK_STYLE_MENU_EDGE_PX,r-e-_.INK_STYLE_MENU_EDGE_PX),T=Math.min(Math.max(t.left,_.INK_STYLE_MENU_EDGE_PX),M),n=o>_.NUMBER_ZERO?o:_.INK_STYLE_MENU_ESTIMATED_HEIGHT_PX,i=t.bottom+_.INK_STYLE_MENU_GAP_PX,I=t.top-n-_.INK_STYLE_MENU_GAP_PX;return{top:i+n>N-_.INK_STYLE_MENU_EDGE_PX?Math.max(_.INK_STYLE_MENU_EDGE_PX,I):i,left:T,minWidth:e}};exports.getToolbarDropdownMenuPosition=c;
@@ -1,3 +1,3 @@
1
1
  import { ToolbarDropdownMenuPosition } from './ToolbarDropdown.types';
2
- export declare const getToolbarDropdownMenuPosition: (trigger: HTMLElement | null) => ToolbarDropdownMenuPosition;
2
+ export declare const getToolbarDropdownMenuPosition: (trigger: HTMLElement | null, estimatedHeight?: number) => ToolbarDropdownMenuPosition;
3
3
  //# sourceMappingURL=ToolbarDropdown.utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarDropdown.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAS3E,eAAO,MAAM,8BAA8B,GACzC,SAAS,WAAW,GAAG,IAAI,KAC1B,2BAiBF,CAAC"}
1
+ {"version":3,"file":"ToolbarDropdown.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAS3E,eAAO,MAAM,8BAA8B,GACzC,SAAS,WAAW,GAAG,IAAI,EAC3B,wBAAoD,KACnD,2BAkBF,CAAC"}
@@ -1,15 +1,15 @@
1
- import { INK_STYLE_MENU_MIN_WIDTH_PX as _, NUMBER_ZERO as r, INK_STYLE_MENU_EDGE_PX as t, INK_STYLE_MENU_GAP_PX as m, INK_STYLE_MENU_ESTIMATED_HEIGHT_PX as E } from "../../../../constants/numbers.js";
1
+ import { INK_STYLE_MENU_ESTIMATED_HEIGHT_PX as E, INK_STYLE_MENU_MIN_WIDTH_PX as p, NUMBER_ZERO as n, INK_STYLE_MENU_EDGE_PX as t, INK_STYLE_MENU_GAP_PX as c } from "../../../../constants/numbers.js";
2
2
  import "../../../../constants/openai.const.js";
3
3
  import "react/jsx-runtime";
4
4
  import "../../../../utils/paste.utils.js";
5
5
  import "react";
6
6
  import "react-dom";
7
- const l = (n) => {
8
- if (!n)
9
- return { top: r, left: r, minWidth: _ };
10
- const o = n.getBoundingClientRect(), p = window.innerWidth, M = window.innerHeight, i = Math.max(o.width, _), a = Math.max(t, p - i - t), c = Math.min(Math.max(o.left, t), a), e = o.bottom + m, h = o.top - E - m;
11
- return { top: e + E > M - t ? Math.max(t, h) : e, left: c, minWidth: i };
7
+ const P = (i, e = E) => {
8
+ if (!i)
9
+ return { top: n, left: n, minWidth: p };
10
+ const o = i.getBoundingClientRect(), M = window.innerWidth, h = window.innerHeight, _ = Math.max(o.width, p), a = Math.max(t, M - _ - t), s = Math.min(Math.max(o.left, t), a), r = e > n ? e : E, m = o.bottom + c, N = o.top - r - c;
11
+ return { top: m + r > h - t ? Math.max(t, N) : m, left: s, minWidth: _ };
12
12
  };
13
13
  export {
14
- l as getToolbarDropdownMenuPosition
14
+ P as getToolbarDropdownMenuPosition
15
15
  };
@@ -16,4 +16,22 @@ export { SignPad } from './SignPad';
16
16
  export { FindReplace } from './FindReplace';
17
17
  export { ToolbarCustomize } from './ToolbarCustomize';
18
18
  export type { ToolbarCustomizeProps } from './ToolbarCustomize';
19
+ export { HtmlSourcePanel } from './HtmlSourcePanel';
20
+ export type { HtmlSourcePanelProps } from './HtmlSourcePanel';
21
+ export { TableSizePicker } from './TableSizePicker';
22
+ export type { TableSizePickerProps } from './TableSizePicker';
23
+ export { TitleGallery } from './TitleGallery';
24
+ export type { TitleGalleryProps } from './TitleGallery';
25
+ export { ExcelSheetPanel } from './ExcelSheetPanel';
26
+ export type { ExcelSheetPanelProps } from './ExcelSheetPanel';
27
+ export { GraphPicker } from './GraphPicker';
28
+ export type { GraphPickerProps } from './GraphPicker';
29
+ export { GraphEditModal } from './GraphEditModal';
30
+ export type { GraphEditModalProps, GraphEditMode } from './GraphEditModal';
31
+ export { ThemePicker } from './ThemePicker';
32
+ export type { ThemePickerProps } from './ThemePicker';
33
+ export { PresenceStack } from './PresenceStack';
34
+ export type { PresenceStackProps } from './PresenceStack';
35
+ export { RemoteCursors } from './RemoteCursors';
36
+ export type { RemoteCursorsProps } from './RemoteCursors';
19
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/InkEditor/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,cAAc,EACd,2BAA2B,EAC3B,gCAAgC,EAChC,mCAAmC,EACnC,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,EACL,YAAY,EACZ,8BAA8B,EAC9B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,aAAa,EACb,0BAA0B,EAC1B,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,iCAAiC,EACjC,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/InkEditor/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,cAAc,EACd,2BAA2B,EAC3B,gCAAgC,EAChC,mCAAmC,EACnC,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,EACL,YAAY,EACZ,8BAA8B,EAC9B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,aAAa,EACb,0BAA0B,EAC1B,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,iCAAiC,EACjC,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../constants/numbers.cjs"),l=require("../../../constants/fonts.const.cjs"),r=require("../../../constants/lists.const.cjs"),y=require("../../../constants/blocks.const.cjs");require("../../../constants/openai.const.cjs");require("react/jsx-runtime");const M=require("../../../utils/blocks.utils.cjs");require("../../../utils/paste.utils.cjs");require("react");require("react-dom");const N="color",O="background-color",p="background",A="color",d="style",g=1,I=3,D="removeFormat",S="insertUnorderedList",m="insertOrderedList",U="superscript",h="subscript",B="styleWithCSS",i=(t,e)=>document.execCommand(t,!1,e),c=t=>document.queryCommandState(t),H=t=>document.queryCommandValue(t),P=t=>{if(!t)return!1;const e=t.startsWith("http://")||t.startsWith("https://")||t.startsWith("mailto:")?t:`https://${t}`;return i("createLink",e)},b=t=>i("foreColor",t),w=t=>i("hiliteColor",t),C=t=>i("insertHTML",t),F=(t,e="")=>{const o=e.replace(/"/g,"&quot;");return C(`<img src="${t}" alt="${o}" style="max-width:100%;height:auto;" />`)},k=t=>new Promise((e,o)=>{const n=new FileReader;n.onload=()=>e(String(n.result)),n.onerror=o,n.readAsDataURL(t)}),q=()=>{const t=new Set;return c("bold")&&t.add("bold"),c("italic")&&t.add("italic"),c("underline")&&t.add("underline"),c("strikeThrough")&&t.add("strikethrough"),c(S)&&t.add("bulletList"),c(m)&&t.add("orderedList"),c(U)&&t.add("superscript"),c(h)&&t.add("subscript"),t},f=t=>{t.style.removeProperty(N),t.style.removeProperty(O),t.style.removeProperty(p),t.hasAttribute(A)&&t.removeAttribute(A);const e=t.getAttribute(d);e!==null&&!e.trim()&&t.removeAttribute(d)},R=()=>{const t=window.getSelection();if(!t||t.rangeCount===a.NUMBER_ZERO)return;const o=t.getRangeAt(a.NUMBER_ZERO).commonAncestorContainer,n=o.nodeType===g?o:o.parentElement;n&&(n instanceof HTMLElement&&t.containsNode(n,!0)&&f(n),n.querySelectorAll("*").forEach(s=>{s instanceof HTMLElement&&t.containsNode(s,!0)&&f(s)}))},Y=()=>{const t=i(D);return R(),t},v=t=>{const e=l.FONT_FAMILY_BY_VALUE[t]??t;if(i(B,"true"),t===l.FONT_VALUE_SYSTEM){const o=window.getSelection();if(!o||o.rangeCount===a.NUMBER_ZERO||o.isCollapsed)return i(l.FONT_COMMAND_NAME,e);const n=o.getRangeAt(a.NUMBER_ZERO),s=document.createElement("span");s.style.setProperty(l.FONT_STYLE_PROPERTY,e);try{return n.surroundContents(s),!0}catch{return i(l.FONT_COMMAND_NAME,e)}}return i(l.FONT_COMMAND_NAME,t)},W=t=>{t.classList.remove(r.LIST_CLASS_DASH,r.LIST_CLASS_ALPHA),t.style.removeProperty("list-style-type")},x=t=>{t===r.LIST_VALUE_BULLET||t===r.LIST_VALUE_DASH?i(S):i(m);const e=window.getSelection();let n=(e==null?void 0:e.anchorNode)??null,s=null;for(;n;){if(n instanceof HTMLElement&&(n.tagName===r.LIST_TAG_UL||n.tagName===r.LIST_TAG_OL)){s=n;break}n=n.parentNode}return s&&(W(s),t===r.LIST_VALUE_BULLET?s.style.listStyleType=r.LIST_STYLE_DISC:t===r.LIST_VALUE_DASH?s.classList.add(r.LIST_CLASS_DASH):t===r.LIST_VALUE_NUMBERS?s.style.listStyleType=r.LIST_STYLE_DECIMAL:t===r.LIST_VALUE_LETTERS&&(s.classList.add(r.LIST_CLASS_ALPHA),s.style.listStyleType=r.LIST_STYLE_LOWER_ALPHA)),!0},V=()=>{const t=window.getSelection();let e=(t==null?void 0:t.anchorNode)??null;for(;e;){if(e instanceof HTMLElement){if(e.tagName===r.LIST_TAG_UL)return e.classList.contains(r.LIST_CLASS_DASH)?r.LIST_VALUE_DASH:r.LIST_VALUE_BULLET;if(e.tagName===r.LIST_TAG_OL)return e.classList.contains(r.LIST_CLASS_ALPHA)||e.style.listStyleType===r.LIST_STYLE_LOWER_ALPHA?r.LIST_VALUE_LETTERS:r.LIST_VALUE_NUMBERS}e=e.parentNode}return r.LIST_VALUE_BULLET},Z=(t,e)=>{const o=window.getSelection(),n=M.getBlockElement((o==null?void 0:o.anchorNode)??null,t);return n?(n.setAttribute(y.DIR_ATTRIBUTE,e),!0):!1},K=t=>{if(t.key!==r.LIST_MARKDOWN_SPACE)return!1;const e=window.getSelection();if(!e||!e.isCollapsed||e.rangeCount===a.NUMBER_ZERO)return!1;const o=e.anchorNode;if(!o||o.nodeType!==I)return!1;const n=o.textContent??"",s=e.anchorOffset,_=n.slice(a.NUMBER_ZERO,s),u=_.endsWith(r.LIST_MARKDOWN_DASH)?r.LIST_MARKDOWN_DASH:_.endsWith(r.LIST_MARKDOWN_STAR)?r.LIST_MARKDOWN_STAR:null;if(!u)return!1;const L=s-u.length;if(L<a.NUMBER_ZERO)return!1;const E=L>a.NUMBER_ZERO?_[L-1]:"";if(E&&E!==`
2
- `)return!1;t.preventDefault();const T=e.getRangeAt(a.NUMBER_ZERO);return T.setStart(o,L),T.setEnd(o,s),T.deleteContents(),i(S),!0};exports.applyFontFamily=v;exports.applyListType=x;exports.clearFormatDeep=Y;exports.detectListType=V;exports.execCommand=i;exports.fileToDataUrl=k;exports.getActiveFormats=q;exports.insertHTML=C;exports.insertImage=F;exports.insertLink=P;exports.queryCommandState=c;exports.queryCommandValue=H;exports.setBlockDirection=Z;exports.setHighlightColor=w;exports.setTextColor=b;exports.stripSelectionColors=R;exports.tryConvertMarkdownListPrefix=K;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../constants/numbers.cjs"),l=require("../../../constants/fonts.const.cjs"),r=require("../../../constants/lists.const.cjs"),R=require("../../../constants/blocks.const.cjs");require("../../../constants/openai.const.cjs");require("react/jsx-runtime");const p=require("../../../utils/blocks.utils.cjs");require("../../../utils/paste.utils.cjs");require("react");require("react-dom");const M="color",y="background-color",g="background",A="color",d="style",I=1,U=3,D="removeFormat",S="insertUnorderedList",m="insertOrderedList",h="superscript",P="subscript",H="styleWithCSS",i=(t,e)=>document.execCommand(t,!1,e),c=t=>document.queryCommandState(t),B=t=>document.queryCommandValue(t),w="http://",f="https://",Y="mailto:",b="&amp;",q="&lt;",F="&gt;",k="&quot;",v=t=>t.replace(/&/g,b).replace(/</g,q).replace(/>/g,F).replace(/"/g,k),W=(t,e="")=>{if(!t)return!1;const o=t.startsWith(w)||t.startsWith(f)||t.startsWith(Y)?t:`${f}${t}`,n=window.getSelection();return(!n||n.isCollapsed)&&e?i("insertHTML",`<a href="${o}">${v(e)}</a>`):i("createLink",o)},x=t=>i("foreColor",t),K=t=>i("hiliteColor",t),C=t=>i("insertHTML",t),V=(t,e="")=>{const o=e.replace(/"/g,"&quot;");return C(`<img src="${t}" alt="${o}" style="max-width:100%;height:auto;" />`)},Z=t=>new Promise((e,o)=>{const n=new FileReader;n.onload=()=>e(String(n.result)),n.onerror=o,n.readAsDataURL(t)}),G=()=>{const t=new Set;return c("bold")&&t.add("bold"),c("italic")&&t.add("italic"),c("underline")&&t.add("underline"),c("strikeThrough")&&t.add("strikethrough"),c(S)&&t.add("bulletList"),c(m)&&t.add("orderedList"),c(h)&&t.add("superscript"),c(P)&&t.add("subscript"),t},O=t=>{t.style.removeProperty(M),t.style.removeProperty(y),t.style.removeProperty(g),t.hasAttribute(A)&&t.removeAttribute(A);const e=t.getAttribute(d);e!==null&&!e.trim()&&t.removeAttribute(d)},N=()=>{const t=window.getSelection();if(!t||t.rangeCount===a.NUMBER_ZERO)return;const o=t.getRangeAt(a.NUMBER_ZERO).commonAncestorContainer,n=o.nodeType===I?o:o.parentElement;n&&(n instanceof HTMLElement&&t.containsNode(n,!0)&&O(n),n.querySelectorAll("*").forEach(s=>{s instanceof HTMLElement&&t.containsNode(s,!0)&&O(s)}))},$=()=>{const t=i(D);return N(),t},j=t=>{const e=l.FONT_FAMILY_BY_VALUE[t]??t;if(i(H,"true"),t===l.FONT_VALUE_SYSTEM){const o=window.getSelection();if(!o||o.rangeCount===a.NUMBER_ZERO||o.isCollapsed)return i(l.FONT_COMMAND_NAME,e);const n=o.getRangeAt(a.NUMBER_ZERO),s=document.createElement("span");s.style.setProperty(l.FONT_STYLE_PROPERTY,e);try{return n.surroundContents(s),!0}catch{return i(l.FONT_COMMAND_NAME,e)}}return i(l.FONT_COMMAND_NAME,t)},Q=t=>{t.classList.remove(r.LIST_CLASS_DASH,r.LIST_CLASS_ALPHA),t.style.removeProperty("list-style-type")},X=t=>{t===r.LIST_VALUE_BULLET||t===r.LIST_VALUE_DASH?i(S):i(m);const e=window.getSelection();let n=(e==null?void 0:e.anchorNode)??null,s=null;for(;n;){if(n instanceof HTMLElement&&(n.tagName===r.LIST_TAG_UL||n.tagName===r.LIST_TAG_OL)){s=n;break}n=n.parentNode}return s&&(Q(s),t===r.LIST_VALUE_BULLET?s.style.listStyleType=r.LIST_STYLE_DISC:t===r.LIST_VALUE_DASH?s.classList.add(r.LIST_CLASS_DASH):t===r.LIST_VALUE_NUMBERS?s.style.listStyleType=r.LIST_STYLE_DECIMAL:t===r.LIST_VALUE_LETTERS&&(s.classList.add(r.LIST_CLASS_ALPHA),s.style.listStyleType=r.LIST_STYLE_LOWER_ALPHA)),!0},z=()=>{const t=window.getSelection();let e=(t==null?void 0:t.anchorNode)??null;for(;e;){if(e instanceof HTMLElement){if(e.tagName===r.LIST_TAG_UL)return e.classList.contains(r.LIST_CLASS_DASH)?r.LIST_VALUE_DASH:r.LIST_VALUE_BULLET;if(e.tagName===r.LIST_TAG_OL)return e.classList.contains(r.LIST_CLASS_ALPHA)||e.style.listStyleType===r.LIST_STYLE_LOWER_ALPHA?r.LIST_VALUE_LETTERS:r.LIST_VALUE_NUMBERS}e=e.parentNode}return r.LIST_VALUE_BULLET},J=(t,e)=>{const o=window.getSelection(),n=p.getBlockElement((o==null?void 0:o.anchorNode)??null,t);return n?(n.setAttribute(R.DIR_ATTRIBUTE,e),!0):!1},tt=t=>{if(t.key!==r.LIST_MARKDOWN_SPACE)return!1;const e=window.getSelection();if(!e||!e.isCollapsed||e.rangeCount===a.NUMBER_ZERO)return!1;const o=e.anchorNode;if(!o||o.nodeType!==U)return!1;const n=o.textContent??"",s=e.anchorOffset,T=n.slice(a.NUMBER_ZERO,s),E=T.endsWith(r.LIST_MARKDOWN_DASH)?r.LIST_MARKDOWN_DASH:T.endsWith(r.LIST_MARKDOWN_STAR)?r.LIST_MARKDOWN_STAR:null;if(!E)return!1;const L=s-E.length;if(L<a.NUMBER_ZERO)return!1;const u=L>a.NUMBER_ZERO?T[L-1]:"";if(u&&u!==`
2
+ `)return!1;t.preventDefault();const _=e.getRangeAt(a.NUMBER_ZERO);return _.setStart(o,L),_.setEnd(o,s),_.deleteContents(),i(S),!0};exports.applyFontFamily=j;exports.applyListType=X;exports.clearFormatDeep=$;exports.detectListType=z;exports.execCommand=i;exports.fileToDataUrl=Z;exports.getActiveFormats=G;exports.insertHTML=C;exports.insertImage=V;exports.insertLink=W;exports.queryCommandState=c;exports.queryCommandValue=B;exports.setBlockDirection=J;exports.setHighlightColor=K;exports.setTextColor=x;exports.stripSelectionColors=N;exports.tryConvertMarkdownListPrefix=tt;
@@ -3,7 +3,7 @@ import { DIR_LTR, DIR_RTL } from '../../../constants';
3
3
  export declare const execCommand: (command: string, value?: string) => boolean;
4
4
  export declare const queryCommandState: (command: string) => boolean;
5
5
  export declare const queryCommandValue: (command: string) => string;
6
- export declare const insertLink: (url: string) => boolean;
6
+ export declare const insertLink: (url: string, fallbackText?: string) => boolean;
7
7
  export declare const setTextColor: (color: string) => boolean;
8
8
  export declare const setHighlightColor: (color: string) => boolean;
9
9
  export declare const insertHTML: (html: string) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"format.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/InkEditor/helpers/format.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAEL,OAAO,EACP,OAAO,EAqBR,MAAM,oBAAoB,CAAC;AAiB5B,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,QAAQ,MAAM,KAAG,OACjB,CAAC;AAE9C,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,OACf,CAAC;AAEtC,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,MACf,CAAC;AAEtC,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,OAOxC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,OAA0C,CAAC;AAExF,eAAO,MAAM,iBAAiB,GAAI,OAAO,MAAM,KAAG,OAA4C,CAAC;AAE/F,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,KAAG,OAA0C,CAAC;AAErF,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,YAAQ,KAAG,OAGnD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,IAAI,KAAG,OAAO,CAAC,MAAM,CAMrD,CAAC;AAEL,eAAO,MAAM,gBAAgB,QAAO,GAAG,CAAC,MAAM,CAW7C,CAAC;AAeF,eAAO,MAAM,oBAAoB,QAAO,IAkBvC,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,OAIlC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,WAAW,MAAM,KAAG,OAmBnD,CAAC;AAOF,eAAO,MAAM,aAAa,GAAI,WAAW,MAAM,KAAG,OAgCjD,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,MAsBjC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,MAAM,WAAW,EACjB,WAAW,OAAO,OAAO,GAAG,OAAO,OAAO,KACzC,OAMF,CAAC;AAEF,eAAO,MAAM,4BAA4B,GAAI,OAAO,aAAa,KAAG,OA4BnE,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAO,OAUxC,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,QAAQ,aAAa,KAAG,OA6BnD,CAAC"}
1
+ {"version":3,"file":"format.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/InkEditor/helpers/format.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAEL,OAAO,EACP,OAAO,EAqBR,MAAM,oBAAoB,CAAC;AAiB5B,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,QAAQ,MAAM,KAAG,OACjB,CAAC;AAE9C,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,OACf,CAAC;AAEtC,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,MACf,CAAC;AAiBtC,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,EAAE,qBAAiB,KAAG,OAa3D,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,OAA0C,CAAC;AAExF,eAAO,MAAM,iBAAiB,GAAI,OAAO,MAAM,KAAG,OAA4C,CAAC;AAE/F,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,KAAG,OAA0C,CAAC;AAErF,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,YAAQ,KAAG,OAGnD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,IAAI,KAAG,OAAO,CAAC,MAAM,CAMrD,CAAC;AAEL,eAAO,MAAM,gBAAgB,QAAO,GAAG,CAAC,MAAM,CAW7C,CAAC;AAeF,eAAO,MAAM,oBAAoB,QAAO,IAkBvC,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,OAIlC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,WAAW,MAAM,KAAG,OAmBnD,CAAC;AAOF,eAAO,MAAM,aAAa,GAAI,WAAW,MAAM,KAAG,OAgCjD,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,MAsBjC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,MAAM,WAAW,EACjB,WAAW,OAAO,OAAO,GAAG,OAAO,OAAO,KACzC,OAMF,CAAC;AAEF,eAAO,MAAM,4BAA4B,GAAI,OAAO,aAAa,KAAG,OA4BnE,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAO,OAUxC,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,QAAQ,aAAa,KAAG,OA6BnD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { NUMBER_ZERO as i } from "../../../constants/numbers.js";
2
- import { FONT_VALUE_SYSTEM as I, FONT_FAMILY_BY_VALUE as U, FONT_COMMAND_NAME as f, FONT_STYLE_PROPERTY as w } from "../../../constants/fonts.const.js";
3
- import { LIST_TAG_UL as N, LIST_CLASS_DASH as L, LIST_VALUE_DASH as u, LIST_VALUE_BULLET as l, LIST_TAG_OL as O, LIST_CLASS_ALPHA as S, LIST_STYLE_LOWER_ALPHA as R, LIST_VALUE_LETTERS as M, LIST_VALUE_NUMBERS as h, LIST_MARKDOWN_SPACE as P, LIST_MARKDOWN_DASH as p, LIST_MARKDOWN_STAR as A, LIST_STYLE_DISC as b, LIST_STYLE_DECIMAL as Y } from "../../../constants/lists.const.js";
2
+ import { FONT_VALUE_SYSTEM as P, FONT_FAMILY_BY_VALUE as w, FONT_COMMAND_NAME as d, FONT_STYLE_PROPERTY as U } from "../../../constants/fonts.const.js";
3
+ import { LIST_TAG_UL as N, LIST_CLASS_DASH as _, LIST_VALUE_DASH as u, LIST_VALUE_BULLET as l, LIST_TAG_OL as R, LIST_CLASS_ALPHA as f, LIST_STYLE_LOWER_ALPHA as M, LIST_VALUE_LETTERS as I, LIST_VALUE_NUMBERS as h, LIST_MARKDOWN_SPACE as Y, LIST_MARKDOWN_DASH as E, LIST_MARKDOWN_STAR as A, LIST_STYLE_DISC as H, LIST_STYLE_DECIMAL as b } from "../../../constants/lists.const.js";
4
4
  import { DIR_ATTRIBUTE as k } from "../../../constants/blocks.const.js";
5
5
  import "../../../constants/openai.const.js";
6
6
  import "react/jsx-runtime";
@@ -8,112 +8,112 @@ import { getBlockElement as F } from "../../../utils/blocks.utils.js";
8
8
  import "../../../utils/paste.utils.js";
9
9
  import "react";
10
10
  import "react-dom";
11
- const H = "color", v = "background-color", B = "background", y = "color", C = "style", W = 1, x = 3, q = "removeFormat", m = "insertUnorderedList", D = "insertOrderedList", K = "superscript", G = "subscript", $ = "styleWithCSS", s = (t, e) => document.execCommand(t, !1, e), c = (t) => document.queryCommandState(t), it = (t) => document.queryCommandValue(t), ct = (t) => {
11
+ const v = "color", B = "background-color", W = "background", C = "color", y = "style", x = 1, K = 3, q = "removeFormat", S = "insertUnorderedList", D = "insertOrderedList", $ = "superscript", G = "subscript", V = "styleWithCSS", s = (t, e) => document.execCommand(t, !1, e), c = (t) => document.queryCommandState(t), _t = (t) => document.queryCommandValue(t), Q = "http://", O = "https://", X = "mailto:", Z = "&amp;", j = "&lt;", z = "&gt;", J = "&quot;", tt = (t) => t.replace(/&/g, Z).replace(/</g, j).replace(/>/g, z).replace(/"/g, J), ft = (t, e = "") => {
12
12
  if (!t) return !1;
13
- const e = t.startsWith("http://") || t.startsWith("https://") || t.startsWith("mailto:") ? t : `https://${t}`;
14
- return s("createLink", e);
15
- }, at = (t) => s("foreColor", t), lt = (t) => s("hiliteColor", t), V = (t) => s("insertHTML", t), dt = (t, e = "") => {
16
- const o = e.replace(/"/g, "&quot;");
17
- return V(`<img src="${t}" alt="${o}" style="max-width:100%;height:auto;" />`);
18
- }, Tt = (t) => new Promise((e, o) => {
13
+ const n = t.startsWith(Q) || t.startsWith(O) || t.startsWith(X) ? t : `${O}${t}`, r = window.getSelection();
14
+ return (!r || r.isCollapsed) && e ? s("insertHTML", `<a href="${n}">${tt(e)}</a>`) : s("createLink", n);
15
+ }, St = (t) => s("foreColor", t), mt = (t) => s("hiliteColor", t), et = (t) => s("insertHTML", t), pt = (t, e = "") => {
16
+ const n = e.replace(/"/g, "&quot;");
17
+ return et(`<img src="${t}" alt="${n}" style="max-width:100%;height:auto;" />`);
18
+ }, Et = (t) => new Promise((e, n) => {
19
19
  const r = new FileReader();
20
- r.onload = () => e(String(r.result)), r.onerror = o, r.readAsDataURL(t);
21
- }), ft = () => {
20
+ r.onload = () => e(String(r.result)), r.onerror = n, r.readAsDataURL(t);
21
+ }), At = () => {
22
22
  const t = /* @__PURE__ */ new Set();
23
- return c("bold") && t.add("bold"), c("italic") && t.add("italic"), c("underline") && t.add("underline"), c("strikeThrough") && t.add("strikethrough"), c(m) && t.add("bulletList"), c(D) && t.add("orderedList"), c(K) && t.add("superscript"), c(G) && t.add("subscript"), t;
23
+ return c("bold") && t.add("bold"), c("italic") && t.add("italic"), c("underline") && t.add("underline"), c("strikeThrough") && t.add("strikethrough"), c(S) && t.add("bulletList"), c(D) && t.add("orderedList"), c($) && t.add("superscript"), c(G) && t.add("subscript"), t;
24
24
  }, g = (t) => {
25
- t.style.removeProperty(H), t.style.removeProperty(v), t.style.removeProperty(B), t.hasAttribute(y) && t.removeAttribute(y);
26
- const e = t.getAttribute(C);
27
- e !== null && !e.trim() && t.removeAttribute(C);
28
- }, X = () => {
25
+ t.style.removeProperty(v), t.style.removeProperty(B), t.style.removeProperty(W), t.hasAttribute(C) && t.removeAttribute(C);
26
+ const e = t.getAttribute(y);
27
+ e !== null && !e.trim() && t.removeAttribute(y);
28
+ }, rt = () => {
29
29
  const t = window.getSelection();
30
30
  if (!t || t.rangeCount === i) return;
31
- const o = t.getRangeAt(i).commonAncestorContainer, r = o.nodeType === W ? o : o.parentElement;
32
- r && (r instanceof HTMLElement && t.containsNode(r, !0) && g(r), r.querySelectorAll("*").forEach((n) => {
33
- n instanceof HTMLElement && t.containsNode(n, !0) && g(n);
31
+ const n = t.getRangeAt(i).commonAncestorContainer, r = n.nodeType === x ? n : n.parentElement;
32
+ r && (r instanceof HTMLElement && t.containsNode(r, !0) && g(r), r.querySelectorAll("*").forEach((o) => {
33
+ o instanceof HTMLElement && t.containsNode(o, !0) && g(o);
34
34
  }));
35
- }, ut = () => {
35
+ }, Ct = () => {
36
36
  const t = s(q);
37
- return X(), t;
38
- }, Lt = (t) => {
39
- const e = U[t] ?? t;
40
- if (s($, "true"), t === I) {
41
- const o = window.getSelection();
42
- if (!o || o.rangeCount === i || o.isCollapsed)
43
- return s(f, e);
44
- const r = o.getRangeAt(i), n = document.createElement("span");
45
- n.style.setProperty(w, e);
37
+ return rt(), t;
38
+ }, yt = (t) => {
39
+ const e = w[t] ?? t;
40
+ if (s(V, "true"), t === P) {
41
+ const n = window.getSelection();
42
+ if (!n || n.rangeCount === i || n.isCollapsed)
43
+ return s(d, e);
44
+ const r = n.getRangeAt(i), o = document.createElement("span");
45
+ o.style.setProperty(U, e);
46
46
  try {
47
- return r.surroundContents(n), !0;
47
+ return r.surroundContents(o), !0;
48
48
  } catch {
49
- return s(f, e);
49
+ return s(d, e);
50
50
  }
51
51
  }
52
- return s(f, t);
53
- }, Z = (t) => {
54
- t.classList.remove(L, S), t.style.removeProperty("list-style-type");
55
- }, St = (t) => {
56
- s(t === l || t === u ? m : D);
52
+ return s(d, t);
53
+ }, nt = (t) => {
54
+ t.classList.remove(_, f), t.style.removeProperty("list-style-type");
55
+ }, Ot = (t) => {
56
+ s(t === l || t === u ? S : D);
57
57
  const e = window.getSelection();
58
- let r = (e == null ? void 0 : e.anchorNode) ?? null, n = null;
58
+ let r = (e == null ? void 0 : e.anchorNode) ?? null, o = null;
59
59
  for (; r; ) {
60
- if (r instanceof HTMLElement && (r.tagName === N || r.tagName === O)) {
61
- n = r;
60
+ if (r instanceof HTMLElement && (r.tagName === N || r.tagName === R)) {
61
+ o = r;
62
62
  break;
63
63
  }
64
64
  r = r.parentNode;
65
65
  }
66
- return n && (Z(n), t === l ? n.style.listStyleType = b : t === u ? n.classList.add(L) : t === h ? n.style.listStyleType = Y : t === M && (n.classList.add(S), n.style.listStyleType = R)), !0;
67
- }, mt = () => {
66
+ return o && (nt(o), t === l ? o.style.listStyleType = H : t === u ? o.classList.add(_) : t === h ? o.style.listStyleType = b : t === I && (o.classList.add(f), o.style.listStyleType = M)), !0;
67
+ }, gt = () => {
68
68
  const t = window.getSelection();
69
69
  let e = (t == null ? void 0 : t.anchorNode) ?? null;
70
70
  for (; e; ) {
71
71
  if (e instanceof HTMLElement) {
72
72
  if (e.tagName === N)
73
- return e.classList.contains(L) ? u : l;
74
- if (e.tagName === O)
75
- return e.classList.contains(S) || e.style.listStyleType === R ? M : h;
73
+ return e.classList.contains(_) ? u : l;
74
+ if (e.tagName === R)
75
+ return e.classList.contains(f) || e.style.listStyleType === M ? I : h;
76
76
  }
77
77
  e = e.parentNode;
78
78
  }
79
79
  return l;
80
- }, _t = (t, e) => {
81
- const o = window.getSelection(), r = F((o == null ? void 0 : o.anchorNode) ?? null, t);
80
+ }, Nt = (t, e) => {
81
+ const n = window.getSelection(), r = F((n == null ? void 0 : n.anchorNode) ?? null, t);
82
82
  return r ? (r.setAttribute(k, e), !0) : !1;
83
- }, Et = (t) => {
84
- if (t.key !== P) return !1;
83
+ }, Rt = (t) => {
84
+ if (t.key !== Y) return !1;
85
85
  const e = window.getSelection();
86
86
  if (!e || !e.isCollapsed || e.rangeCount === i)
87
87
  return !1;
88
- const o = e.anchorNode;
89
- if (!o || o.nodeType !== x) return !1;
90
- const r = o.textContent ?? "", n = e.anchorOffset, d = r.slice(i, n), _ = d.endsWith(p) ? p : d.endsWith(A) ? A : null;
91
- if (!_) return !1;
92
- const a = n - _.length;
88
+ const n = e.anchorNode;
89
+ if (!n || n.nodeType !== K) return !1;
90
+ const r = n.textContent ?? "", o = e.anchorOffset, T = r.slice(i, o), m = T.endsWith(E) ? E : T.endsWith(A) ? A : null;
91
+ if (!m) return !1;
92
+ const a = o - m.length;
93
93
  if (a < i) return !1;
94
- const E = a > i ? d[a - 1] : "";
95
- if (E && E !== `
94
+ const p = a > i ? T[a - 1] : "";
95
+ if (p && p !== `
96
96
  `) return !1;
97
97
  t.preventDefault();
98
- const T = e.getRangeAt(i);
99
- return T.setStart(o, a), T.setEnd(o, n), T.deleteContents(), s(m), !0;
98
+ const L = e.getRangeAt(i);
99
+ return L.setStart(n, a), L.setEnd(n, o), L.deleteContents(), s(S), !0;
100
100
  };
101
101
  export {
102
- Lt as applyFontFamily,
103
- St as applyListType,
104
- ut as clearFormatDeep,
105
- mt as detectListType,
102
+ yt as applyFontFamily,
103
+ Ot as applyListType,
104
+ Ct as clearFormatDeep,
105
+ gt as detectListType,
106
106
  s as execCommand,
107
- Tt as fileToDataUrl,
108
- ft as getActiveFormats,
109
- V as insertHTML,
110
- dt as insertImage,
111
- ct as insertLink,
107
+ Et as fileToDataUrl,
108
+ At as getActiveFormats,
109
+ et as insertHTML,
110
+ pt as insertImage,
111
+ ft as insertLink,
112
112
  c as queryCommandState,
113
- it as queryCommandValue,
114
- _t as setBlockDirection,
115
- lt as setHighlightColor,
116
- at as setTextColor,
117
- X as stripSelectionColors,
118
- Et as tryConvertMarkdownListPrefix
113
+ _t as queryCommandValue,
114
+ Nt as setBlockDirection,
115
+ mt as setHighlightColor,
116
+ St as setTextColor,
117
+ rt as stripSelectionColors,
118
+ Rt as tryConvertMarkdownListPrefix
119
119
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),k=require("react"),v=({documents:o,activeDocumentId:b,onTabSelect:y,onTabClose:c,onTabAdd:d,onTabRename:s,className:j=""})=>{const[h,l]=k.useState(null),[a,u]=k.useState(""),p=(t,n,r)=>{r.stopPropagation(),s&&(l(t),u(n))},x=t=>{h===t&&a.trim()&&(s==null||s(t,a.trim())),l(null)},g=(t,n)=>{n.key==="Enter"?x(t):n.key==="Escape"&&l(null)};return i.jsxs("div",{className:`ink-tabs-container ${j}`.trim(),role:"tablist","aria-label":"Document tabs",children:[i.jsx("div",{className:"ink-tabs-scroll-area",children:o.map(t=>{const n=t.id===b,r=h===t.id;return i.jsxs("div",{role:"tab","aria-selected":n,tabIndex:n?0:-1,className:`ink-tab-item ${n?"ink-tab-active":""} ${t.isDirty?"ink-tab-dirty":""}`,onClick:()=>y(t.id),onDoubleClick:e=>p(t.id,t.title,e),title:t.title,children:[i.jsx("span",{className:"ink-tab-icon","aria-hidden":"true",children:t.icon||i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),i.jsx("polyline",{points:"14 2 14 8 20 8"})]})}),r?i.jsx("input",{type:"text",className:"ink-tab-title-input",value:a,autoFocus:!0,onChange:e=>u(e.target.value),onBlur:()=>x(t.id),onKeyDown:e=>g(t.id,e),onClick:e=>e.stopPropagation()}):i.jsx("span",{className:"ink-tab-title",children:t.title||"Untitled"}),t.isDirty&&i.jsx("span",{className:"ink-tab-dirty-indicator",title:"Unsaved changes","aria-label":"Unsaved changes"}),c&&o.length>1&&i.jsx("button",{type:"button",className:"ink-tab-close-btn","aria-label":`Close ${t.title}`,onClick:e=>{e.stopPropagation(),c(t.id)},children:i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},t.id)})}),d&&i.jsx("button",{type:"button",className:"ink-tab-add-btn","aria-label":"New document",title:"New document",onClick:d,children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),i.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})};exports.InkTabs=v;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { InkTabsProps } from '../../types/workspace.types';
3
+ export declare const InkTabs: React.FC<InkTabsProps>;
4
+ //# sourceMappingURL=InkTabs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkTabs.d.ts","sourceRoot":"","sources":["../../../src/components/InkTabs/InkTabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA6H1C,CAAC"}