@forgedevstack/ink 1.1.8 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/dist/common-components/Box/Box.cjs +1 -1
  3. package/dist/common-components/Box/Box.js +7 -6
  4. package/dist/common-components/Button/Button.cjs +1 -1
  5. package/dist/common-components/Button/Button.js +9 -8
  6. package/dist/common-components/Canvas/Canvas.cjs +1 -1
  7. package/dist/common-components/Canvas/Canvas.js +3 -2
  8. package/dist/common-components/ContextMenu/ContextMenu.cjs +1 -1
  9. package/dist/common-components/ContextMenu/ContextMenu.js +3 -2
  10. package/dist/common-components/Field/Field.cjs +1 -1
  11. package/dist/common-components/Field/Field.js +11 -10
  12. package/dist/common-components/icons/GripIcon.cjs +1 -1
  13. package/dist/common-components/icons/GripIcon.js +3 -2
  14. package/dist/components/InkEditor/InkEditor.cjs +1 -1
  15. package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
  16. package/dist/components/InkEditor/InkEditor.js +1301 -1006
  17. package/dist/components/InkEditor/components/AiPanel/AiPanel.cjs +1 -1
  18. package/dist/components/InkEditor/components/AiPanel/AiPanel.js +13 -12
  19. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.cjs +1 -0
  20. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.cjs +1 -0
  21. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.d.ts +20 -0
  22. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.d.ts.map +1 -0
  23. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.js +25 -0
  24. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.d.ts +4 -0
  25. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.d.ts.map +1 -0
  26. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.js +61 -0
  27. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.types.d.ts +11 -0
  28. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.types.d.ts.map +1 -0
  29. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.cjs +1 -0
  30. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.d.ts +19 -0
  31. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.d.ts.map +1 -0
  32. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.js +30 -0
  33. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.test.d.ts +2 -0
  34. package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.test.d.ts.map +1 -0
  35. package/dist/components/InkEditor/components/AiSelectionBubble/index.d.ts +4 -0
  36. package/dist/components/InkEditor/components/AiSelectionBubble/index.d.ts.map +1 -0
  37. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.cjs +1 -1
  38. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.js +7 -6
  39. package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.cjs +1 -1
  40. package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.d.ts +2 -0
  41. package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.d.ts.map +1 -1
  42. package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.js +16 -15
  43. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.cjs +1 -1
  44. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.js +14 -13
  45. package/dist/components/InkEditor/components/FindReplace/FindReplace.cjs +1 -1
  46. package/dist/components/InkEditor/components/FindReplace/FindReplace.js +21 -20
  47. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.cjs +1 -1
  48. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.js +17 -16
  49. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.cjs +1 -1
  50. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.js +3 -2
  51. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.cjs +1 -1
  52. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.js +7 -6
  53. package/dist/components/InkEditor/components/ImageFrame/ImageFrame.cjs +1 -0
  54. package/dist/components/InkEditor/components/ImageFrame/ImageFrame.d.ts +8 -0
  55. package/dist/components/InkEditor/components/ImageFrame/ImageFrame.d.ts.map +1 -0
  56. package/dist/components/InkEditor/components/ImageFrame/ImageFrame.js +54 -0
  57. package/dist/components/InkEditor/components/ImageFrame/index.d.ts +3 -0
  58. package/dist/components/InkEditor/components/ImageFrame/index.d.ts.map +1 -0
  59. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.cjs +1 -1
  60. package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.js +11 -10
  61. package/dist/components/InkEditor/components/MentionMenu/MentionMenu.cjs +1 -0
  62. package/dist/components/InkEditor/components/MentionMenu/MentionMenu.d.ts +16 -0
  63. package/dist/components/InkEditor/components/MentionMenu/MentionMenu.d.ts.map +1 -0
  64. package/dist/components/InkEditor/components/MentionMenu/MentionMenu.js +21 -0
  65. package/dist/components/InkEditor/components/MentionMenu/index.d.ts +3 -0
  66. package/dist/components/InkEditor/components/MentionMenu/index.d.ts.map +1 -0
  67. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.cjs +1 -1
  68. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.js +11 -10
  69. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.cjs +1 -0
  70. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.cjs +1 -0
  71. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.d.ts +7 -0
  72. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.d.ts.map +1 -0
  73. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.js +9 -0
  74. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.d.ts +4 -0
  75. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.d.ts.map +1 -0
  76. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.js +83 -0
  77. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.types.d.ts +8 -0
  78. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.types.d.ts.map +1 -0
  79. package/dist/components/InkEditor/components/PresenceStack/index.d.ts +3 -0
  80. package/dist/components/InkEditor/components/PresenceStack/index.d.ts.map +1 -0
  81. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.cjs +1 -0
  82. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.cjs +1 -0
  83. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.d.ts +7 -0
  84. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.d.ts.map +1 -0
  85. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.js +10 -0
  86. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.d.ts +4 -0
  87. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.d.ts.map +1 -0
  88. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.js +66 -0
  89. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.types.d.ts +6 -0
  90. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.types.d.ts.map +1 -0
  91. package/dist/components/InkEditor/components/RemoteCursors/index.d.ts +3 -0
  92. package/dist/components/InkEditor/components/RemoteCursors/index.d.ts.map +1 -0
  93. package/dist/components/InkEditor/components/SignPad/SignPad.cjs +1 -1
  94. package/dist/components/InkEditor/components/SignPad/SignPad.js +7 -6
  95. package/dist/components/InkEditor/components/SlashMenu/SlashMenu.cjs +1 -1
  96. package/dist/components/InkEditor/components/SlashMenu/SlashMenu.js +7 -6
  97. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.cjs +1 -1
  98. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.cjs +1 -1
  99. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.js +8 -7
  100. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.js +7 -6
  101. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.cjs +1 -1
  102. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.js +7 -6
  103. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.cjs +1 -1
  104. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.js +3 -2
  105. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.cjs +1 -1
  106. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.js +13 -12
  107. package/dist/components/InkEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -1
  108. package/dist/components/InkEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +9 -8
  109. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.cjs +1 -1
  110. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.const.cjs +1 -1
  111. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.const.js +9 -8
  112. package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.js +9 -8
  113. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
  114. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.js +19 -18
  115. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.cjs +1 -1
  116. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.js +6 -5
  117. package/dist/components/InkEditor/components/VersionHistory/VersionHistory.cjs +1 -0
  118. package/dist/components/InkEditor/components/VersionHistory/VersionHistory.d.ts +11 -0
  119. package/dist/components/InkEditor/components/VersionHistory/VersionHistory.d.ts.map +1 -0
  120. package/dist/components/InkEditor/components/VersionHistory/VersionHistory.js +22 -0
  121. package/dist/components/InkEditor/components/VersionHistory/index.d.ts +3 -0
  122. package/dist/components/InkEditor/components/VersionHistory/index.d.ts.map +1 -0
  123. package/dist/components/InkEditor/components/index.d.ts +11 -0
  124. package/dist/components/InkEditor/components/index.d.ts.map +1 -1
  125. package/dist/components/InkEditor/helpers/format.utils.cjs +3 -2
  126. package/dist/components/InkEditor/helpers/format.utils.d.ts +1 -0
  127. package/dist/components/InkEditor/helpers/format.utils.d.ts.map +1 -1
  128. package/dist/components/InkEditor/helpers/format.utils.js +106 -84
  129. package/dist/components/InkEditor/helpers/index.d.ts +1 -1
  130. package/dist/components/InkEditor/helpers/index.d.ts.map +1 -1
  131. package/dist/components/InkTabs/InkTabs.cjs +1 -0
  132. package/dist/components/InkTabs/InkTabs.d.ts +4 -0
  133. package/dist/components/InkTabs/InkTabs.d.ts.map +1 -0
  134. package/dist/components/InkTabs/InkTabs.js +104 -0
  135. package/dist/components/InkTabs/index.d.ts +2 -0
  136. package/dist/components/InkTabs/index.d.ts.map +1 -0
  137. package/dist/components/InkWorkspace/InkWorkspace.cjs +1 -0
  138. package/dist/components/InkWorkspace/InkWorkspace.d.ts +4 -0
  139. package/dist/components/InkWorkspace/InkWorkspace.d.ts.map +1 -0
  140. package/dist/components/InkWorkspace/InkWorkspace.js +309 -0
  141. package/dist/components/InkWorkspace/components/WorkspaceIcons.cjs +1 -0
  142. package/dist/components/InkWorkspace/components/WorkspaceIcons.d.ts +11 -0
  143. package/dist/components/InkWorkspace/components/WorkspaceIcons.d.ts.map +1 -0
  144. package/dist/components/InkWorkspace/components/WorkspaceIcons.js +39 -0
  145. package/dist/components/InkWorkspace/hooks/useInkWorkspace.cjs +1 -0
  146. package/dist/components/InkWorkspace/hooks/useInkWorkspace.d.ts +30 -0
  147. package/dist/components/InkWorkspace/hooks/useInkWorkspace.d.ts.map +1 -0
  148. package/dist/components/InkWorkspace/hooks/useInkWorkspace.js +73 -0
  149. package/dist/components/InkWorkspace/index.d.ts +4 -0
  150. package/dist/components/InkWorkspace/index.d.ts.map +1 -0
  151. package/dist/components/index.d.ts +2 -0
  152. package/dist/components/index.d.ts.map +1 -1
  153. package/dist/constants/collab.const.cjs +1 -0
  154. package/dist/constants/collab.const.d.ts +20 -0
  155. package/dist/constants/collab.const.d.ts.map +1 -0
  156. package/dist/constants/collab.const.js +54 -0
  157. package/dist/constants/contextMenu.const.cjs +1 -1
  158. package/dist/constants/contextMenu.const.d.ts +8 -0
  159. package/dist/constants/contextMenu.const.d.ts.map +1 -1
  160. package/dist/constants/contextMenu.const.js +30 -22
  161. package/dist/constants/defaultIcons.cjs +1 -1
  162. package/dist/constants/defaultIcons.js +6 -5
  163. package/dist/constants/defaults.const.cjs +1 -1
  164. package/dist/constants/defaults.const.d.ts.map +1 -1
  165. package/dist/constants/defaults.const.js +150 -138
  166. package/dist/constants/index.d.ts +2 -0
  167. package/dist/constants/index.d.ts.map +1 -1
  168. package/dist/constants/numbers.cjs +1 -1
  169. package/dist/constants/numbers.js +43 -37
  170. package/dist/constants/toolbar.const.cjs +1 -1
  171. package/dist/constants/toolbar.const.d.ts +7 -0
  172. package/dist/constants/toolbar.const.d.ts.map +1 -1
  173. package/dist/constants/toolbar.const.js +16 -9
  174. package/dist/constants/toolbarMenu.const.cjs +1 -1
  175. package/dist/constants/toolbarMenu.const.d.ts.map +1 -1
  176. package/dist/constants/toolbarMenu.const.js +25 -11
  177. package/dist/constants/workspace.const.cjs +1 -0
  178. package/dist/constants/workspace.const.d.ts +24 -0
  179. package/dist/constants/workspace.const.d.ts.map +1 -0
  180. package/dist/constants/workspace.const.js +23 -0
  181. package/dist/hooks/index.d.ts +2 -0
  182. package/dist/hooks/index.d.ts.map +1 -1
  183. package/dist/hooks/useInkCollaboration.cjs +1 -0
  184. package/dist/hooks/useInkCollaboration.d.ts +4 -0
  185. package/dist/hooks/useInkCollaboration.d.ts.map +1 -0
  186. package/dist/hooks/useInkCollaboration.js +87 -0
  187. package/dist/hooks/useToolbarOverflow.cjs +1 -1
  188. package/dist/hooks/useToolbarOverflow.js +12 -11
  189. package/dist/index.cjs +1 -1
  190. package/dist/index.d.ts +5 -3
  191. package/dist/index.d.ts.map +1 -1
  192. package/dist/index.js +151 -135
  193. package/dist/plugins/ai/demoProvider.cjs +1 -1
  194. package/dist/plugins/ai/demoProvider.js +3 -2
  195. package/dist/plugins/ai/index.cjs +1 -1
  196. package/dist/plugins/ai/index.js +25 -24
  197. package/dist/plugins/excel/excel.utils.cjs +1 -1
  198. package/dist/plugins/excel/excel.utils.js +17 -16
  199. package/dist/plugins/graph/graph.utils.cjs +1 -1
  200. package/dist/plugins/graph/graph.utils.js +7 -6
  201. package/dist/plugins/titles/titles.const.cjs +1 -1
  202. package/dist/plugins/titles/titles.const.js +9 -8
  203. package/dist/plugins/titles/titles.utils.cjs +1 -1
  204. package/dist/plugins/titles/titles.utils.js +3 -2
  205. package/dist/styles.css +1 -1
  206. package/dist/types/collab.types.d.ts +54 -0
  207. package/dist/types/collab.types.d.ts.map +1 -0
  208. package/dist/types/features.types.d.ts +1 -1
  209. package/dist/types/features.types.d.ts.map +1 -1
  210. package/dist/types/index.d.ts +2 -0
  211. package/dist/types/index.d.ts.map +1 -1
  212. package/dist/types/ink.types.d.ts +3 -1
  213. package/dist/types/ink.types.d.ts.map +1 -1
  214. package/dist/types/workspace.types.d.ts +54 -0
  215. package/dist/types/workspace.types.d.ts.map +1 -0
  216. package/dist/utils/blocks.utils.cjs +1 -1
  217. package/dist/utils/blocks.utils.js +19 -18
  218. package/dist/utils/collab.utils.cjs +1 -0
  219. package/dist/utils/collab.utils.d.ts +5 -0
  220. package/dist/utils/collab.utils.d.ts.map +1 -0
  221. package/dist/utils/collab.utils.js +33 -0
  222. package/dist/utils/collab.utils.test.d.ts +2 -0
  223. package/dist/utils/collab.utils.test.d.ts.map +1 -0
  224. package/dist/utils/comments.utils.cjs +1 -1
  225. package/dist/utils/comments.utils.d.ts +4 -0
  226. package/dist/utils/comments.utils.d.ts.map +1 -1
  227. package/dist/utils/comments.utils.js +26 -18
  228. package/dist/utils/comments.utils.test.d.ts +2 -0
  229. package/dist/utils/comments.utils.test.d.ts.map +1 -0
  230. package/dist/utils/exportDocument.utils.cjs +2 -0
  231. package/dist/utils/exportDocument.utils.d.ts +16 -0
  232. package/dist/utils/exportDocument.utils.d.ts.map +1 -0
  233. package/dist/utils/exportDocument.utils.js +85 -0
  234. package/dist/utils/exportDocument.utils.test.d.ts +2 -0
  235. package/dist/utils/exportDocument.utils.test.d.ts.map +1 -0
  236. package/dist/utils/formatPainter.utils.cjs +1 -0
  237. package/dist/utils/formatPainter.utils.d.ts +11 -0
  238. package/dist/utils/formatPainter.utils.d.ts.map +1 -0
  239. package/dist/utils/formatPainter.utils.js +20 -0
  240. package/dist/utils/formatPainter.utils.test.d.ts +2 -0
  241. package/dist/utils/formatPainter.utils.test.d.ts.map +1 -0
  242. package/dist/utils/history.utils.cjs +1 -1
  243. package/dist/utils/history.utils.js +3 -2
  244. package/dist/utils/image.utils.cjs +1 -0
  245. package/dist/utils/image.utils.d.ts +14 -0
  246. package/dist/utils/image.utils.d.ts.map +1 -0
  247. package/dist/utils/image.utils.js +33 -0
  248. package/dist/utils/image.utils.test.d.ts +2 -0
  249. package/dist/utils/image.utils.test.d.ts.map +1 -0
  250. package/dist/utils/index.d.ts +12 -3
  251. package/dist/utils/index.d.ts.map +1 -1
  252. package/dist/utils/ink.brand.test.d.ts +2 -0
  253. package/dist/utils/ink.brand.test.d.ts.map +1 -0
  254. package/dist/utils/license.utils.cjs +1 -1
  255. package/dist/utils/license.utils.js +8 -7
  256. package/dist/utils/markdown.utils.cjs +11 -0
  257. package/dist/utils/markdown.utils.d.ts +7 -0
  258. package/dist/utils/markdown.utils.d.ts.map +1 -0
  259. package/dist/utils/markdown.utils.js +87 -0
  260. package/dist/utils/markdown.utils.test.d.ts +2 -0
  261. package/dist/utils/markdown.utils.test.d.ts.map +1 -0
  262. package/dist/utils/mentions.utils.cjs +1 -0
  263. package/dist/utils/mentions.utils.d.ts +13 -0
  264. package/dist/utils/mentions.utils.d.ts.map +1 -0
  265. package/dist/utils/mentions.utils.js +23 -0
  266. package/dist/utils/mentions.utils.test.d.ts +2 -0
  267. package/dist/utils/mentions.utils.test.d.ts.map +1 -0
  268. package/dist/utils/outline.utils.cjs +1 -1
  269. package/dist/utils/outline.utils.js +9 -8
  270. package/dist/utils/paste.utils.cjs +1 -1
  271. package/dist/utils/paste.utils.d.ts +2 -0
  272. package/dist/utils/paste.utils.d.ts.map +1 -1
  273. package/dist/utils/paste.utils.js +53 -19
  274. package/dist/utils/paste.utils.test.d.ts +2 -0
  275. package/dist/utils/paste.utils.test.d.ts.map +1 -0
  276. package/dist/utils/premium.utils.cjs +1 -1
  277. package/dist/utils/premium.utils.js +12 -11
  278. package/dist/utils/selection.utils.cjs +1 -1
  279. package/dist/utils/selection.utils.js +3 -2
  280. package/dist/utils/slash.utils.cjs +1 -1
  281. package/dist/utils/slash.utils.js +10 -9
  282. package/dist/utils/table.utils.cjs +1 -1
  283. package/dist/utils/table.utils.d.ts +8 -0
  284. package/dist/utils/table.utils.d.ts.map +1 -1
  285. package/dist/utils/table.utils.js +78 -54
  286. package/dist/utils/toolbarStorage.utils.cjs +1 -1
  287. package/dist/utils/toolbarStorage.utils.js +15 -14
  288. package/dist/utils/trackChanges.utils.cjs +1 -1
  289. package/dist/utils/trackChanges.utils.js +9 -8
  290. package/dist/utils/typo.utils.cjs +1 -1
  291. package/dist/utils/typo.utils.js +8 -7
  292. package/dist/utils/versions.utils.cjs +1 -0
  293. package/dist/utils/versions.utils.d.ts +11 -0
  294. package/dist/utils/versions.utils.d.ts.map +1 -0
  295. package/dist/utils/versions.utils.js +36 -0
  296. package/dist/utils/versions.utils.test.d.ts +2 -0
  297. package/dist/utils/versions.utils.test.d.ts.map +1 -0
  298. package/dist/utils/words.utils.cjs +1 -1
  299. package/dist/utils/words.utils.js +3 -2
  300. package/dist/utils/workspace.utils.cjs +1 -0
  301. package/dist/utils/workspace.utils.d.ts +5 -0
  302. package/dist/utils/workspace.utils.d.ts.map +1 -0
  303. package/dist/utils/workspace.utils.js +26 -0
  304. package/dist/utils/workspace.utils.test.d.ts +2 -0
  305. package/dist/utils/workspace.utils.test.d.ts.map +1 -0
  306. package/package.json +1 -1
@@ -1,119 +1,141 @@
1
- import { NUMBER_ZERO as i } from "../../../constants/numbers.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
- import { DIR_ATTRIBUTE as k } from "../../../constants/blocks.const.js";
1
+ import { NUMBER_ZERO as c } from "../../../constants/numbers.js";
2
+ import { FONT_VALUE_SYSTEM as U, FONT_FAMILY_BY_VALUE as x, FONT_COMMAND_NAME as m, FONT_STYLE_PROPERTY as Y } from "../../../constants/fonts.const.js";
3
+ import { LIST_MARKDOWN_SPACE as h, LIST_MARKDOWN_DASH as A, LIST_MARKDOWN_STAR as C, LIST_TAG_UL as R, LIST_CLASS_DASH as _, LIST_VALUE_DASH as L, LIST_VALUE_BULLET as u, LIST_TAG_OL as M, LIST_CLASS_ALPHA as S, LIST_STYLE_LOWER_ALPHA as I, LIST_VALUE_LETTERS as D, LIST_VALUE_NUMBERS as P, LIST_STYLE_DISC as v, LIST_STYLE_DECIMAL as B } from "../../../constants/lists.const.js";
4
+ import { DIR_ATTRIBUTE as b } from "../../../constants/blocks.const.js";
5
5
  import "../../../constants/openai.const.js";
6
6
  import "react/jsx-runtime";
7
- import { getBlockElement as F } from "../../../utils/blocks.utils.js";
7
+ import { getBlockElement as H } from "../../../utils/blocks.utils.js";
8
8
  import "../../../utils/paste.utils.js";
9
+ import "../../../utils/exportDocument.utils.js";
9
10
  import "react";
10
11
  import "react-dom";
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
+ const F = "color", W = "background-color", K = "background", g = "color", y = "style", q = 1, w = 3, $ = "removeFormat", p = "insertUnorderedList", E = "insertOrderedList", G = "superscript", V = "subscript", X = "styleWithCSS", s = (t, e) => document.execCommand(t, !1, e), l = (t) => document.queryCommandState(t), St = (t) => document.queryCommandValue(t), Q = "http://", O = "https://", Z = "mailto:", j = "&amp;", z = "&lt;", J = "&gt;", tt = "&quot;", et = (t) => t.replace(/&/g, j).replace(/</g, z).replace(/>/g, J).replace(/"/g, tt), pt = (t, e = "") => {
12
13
  if (!t) return !1;
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
- const r = new FileReader();
20
- r.onload = () => e(String(r.result)), r.onerror = n, r.readAsDataURL(t);
21
- }), At = () => {
14
+ const o = t.startsWith(Q) || t.startsWith(O) || t.startsWith(Z) ? t : `${O}${t}`, n = window.getSelection();
15
+ return (!n || n.isCollapsed) && e ? s("insertHTML", `<a href="${o}">${et(e)}</a>`) : s("createLink", o);
16
+ }, Et = (t) => s("foreColor", t), At = (t) => s("hiliteColor", t), ot = (t) => s("insertHTML", t), Ct = (t, e = "") => {
17
+ const o = e.replace(/"/g, "&quot;");
18
+ return ot(`<img src="${t}" alt="${o}" style="max-width:100%;height:auto;" />`);
19
+ }, gt = (t) => new Promise((e, o) => {
20
+ const n = new FileReader();
21
+ n.onload = () => e(String(n.result)), n.onerror = o, n.readAsDataURL(t);
22
+ }), yt = () => {
22
23
  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(S) && t.add("bulletList"), c(D) && t.add("orderedList"), c($) && t.add("superscript"), c(G) && t.add("subscript"), t;
24
- }, g = (t) => {
25
- t.style.removeProperty(v), t.style.removeProperty(B), t.style.removeProperty(W), t.hasAttribute(C) && t.removeAttribute(C);
24
+ return l("bold") && t.add("bold"), l("italic") && t.add("italic"), l("underline") && t.add("underline"), l("strikeThrough") && t.add("strikethrough"), l(p) && t.add("bulletList"), l(E) && t.add("orderedList"), l(G) && t.add("superscript"), l(V) && t.add("subscript"), t;
25
+ }, N = (t) => {
26
+ t.style.removeProperty(F), t.style.removeProperty(W), t.style.removeProperty(K), t.hasAttribute(g) && t.removeAttribute(g);
26
27
  const e = t.getAttribute(y);
27
28
  e !== null && !e.trim() && t.removeAttribute(y);
28
- }, rt = () => {
29
+ }, nt = () => {
29
30
  const t = window.getSelection();
30
- if (!t || t.rangeCount === i) return;
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);
31
+ if (!t || t.rangeCount === c) return;
32
+ const o = t.getRangeAt(c).commonAncestorContainer, n = o.nodeType === q ? o : o.parentElement;
33
+ n && (n instanceof HTMLElement && t.containsNode(n, !0) && N(n), n.querySelectorAll("*").forEach((r) => {
34
+ r instanceof HTMLElement && t.containsNode(r, !0) && N(r);
34
35
  }));
35
- }, Ct = () => {
36
- const t = s(q);
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);
36
+ }, Ot = () => {
37
+ const t = s($);
38
+ return nt(), t;
39
+ }, Nt = (t) => {
40
+ const e = x[t] ?? t;
41
+ if (s(X, "true"), t === U) {
42
+ const o = window.getSelection();
43
+ if (!o || o.rangeCount === c || o.isCollapsed)
44
+ return s(m, e);
45
+ const n = o.getRangeAt(c), r = document.createElement("span");
46
+ r.style.setProperty(Y, e);
46
47
  try {
47
- return r.surroundContents(o), !0;
48
+ return n.surroundContents(r), !0;
48
49
  } catch {
49
- return s(d, e);
50
+ return s(m, e);
50
51
  }
51
52
  }
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);
53
+ return s(m, t);
54
+ }, rt = (t) => {
55
+ t.classList.remove(_, S), t.style.removeProperty("list-style-type");
56
+ }, ht = (t) => {
57
+ s(t === u || t === L ? p : E);
57
58
  const e = window.getSelection();
58
- let r = (e == null ? void 0 : e.anchorNode) ?? null, o = null;
59
- for (; r; ) {
60
- if (r instanceof HTMLElement && (r.tagName === N || r.tagName === R)) {
61
- o = r;
59
+ let n = (e == null ? void 0 : e.anchorNode) ?? null, r = null;
60
+ for (; n; ) {
61
+ if (n instanceof HTMLElement && (n.tagName === R || n.tagName === M)) {
62
+ r = n;
62
63
  break;
63
64
  }
64
- r = r.parentNode;
65
+ n = n.parentNode;
65
66
  }
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 = () => {
67
+ return r && (rt(r), t === u ? r.style.listStyleType = v : t === L ? r.classList.add(_) : t === P ? r.style.listStyleType = B : t === D && (r.classList.add(S), r.style.listStyleType = I)), !0;
68
+ }, Rt = () => {
68
69
  const t = window.getSelection();
69
70
  let e = (t == null ? void 0 : t.anchorNode) ?? null;
70
71
  for (; e; ) {
71
72
  if (e instanceof HTMLElement) {
72
- if (e.tagName === N)
73
- return e.classList.contains(_) ? u : l;
74
73
  if (e.tagName === R)
75
- return e.classList.contains(f) || e.style.listStyleType === M ? I : h;
74
+ return e.classList.contains(_) ? L : u;
75
+ if (e.tagName === M)
76
+ return e.classList.contains(S) || e.style.listStyleType === I ? D : P;
76
77
  }
77
78
  e = e.parentNode;
78
79
  }
79
- return l;
80
- }, Nt = (t, e) => {
81
- const n = window.getSelection(), r = F((n == null ? void 0 : n.anchorNode) ?? null, t);
82
- return r ? (r.setAttribute(k, e), !0) : !1;
83
- }, Rt = (t) => {
84
- if (t.key !== Y) return !1;
80
+ return u;
81
+ }, Mt = (t, e) => {
82
+ const o = window.getSelection(), n = H((o == null ? void 0 : o.anchorNode) ?? null, t);
83
+ return n ? (n.setAttribute(b, e), !0) : !1;
84
+ }, st = [
85
+ { prefix: "###", command: "formatBlock", value: "h3" },
86
+ { prefix: "##", command: "formatBlock", value: "h2" },
87
+ { prefix: "#", command: "formatBlock", value: "h1" },
88
+ { prefix: ">", command: "formatBlock", value: "blockquote" },
89
+ { prefix: "1.", command: E }
90
+ ], It = (t) => {
91
+ if (t.key !== h) return !1;
85
92
  const e = window.getSelection();
86
- if (!e || !e.isCollapsed || e.rangeCount === i)
93
+ if (!e || !e.isCollapsed || e.rangeCount === c) return !1;
94
+ const o = e.anchorNode;
95
+ if (!o || o.nodeType !== w) return !1;
96
+ const n = o.textContent ?? "", r = e.anchorOffset, d = n.slice(c, r), i = st.find((k) => d.endsWith(k.prefix));
97
+ if (!i) return !1;
98
+ const a = r - i.prefix.length, T = a > c ? d[a - 1] : "";
99
+ if (T && T !== `
100
+ `) return !1;
101
+ t.preventDefault();
102
+ const f = e.getRangeAt(c);
103
+ return f.setStart(o, a), f.setEnd(o, r), f.deleteContents(), i.value ? s(i.command, i.value) : s(i.command), !0;
104
+ }, Dt = (t) => {
105
+ if (t.key !== h) return !1;
106
+ const e = window.getSelection();
107
+ if (!e || !e.isCollapsed || e.rangeCount === c)
87
108
  return !1;
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
- if (a < i) return !1;
94
- const p = a > i ? T[a - 1] : "";
95
- if (p && p !== `
109
+ const o = e.anchorNode;
110
+ if (!o || o.nodeType !== w) return !1;
111
+ const n = o.textContent ?? "", r = e.anchorOffset, d = n.slice(c, r), i = d.endsWith(A) ? A : d.endsWith(C) ? C : null;
112
+ if (!i) return !1;
113
+ const a = r - i.length;
114
+ if (a < c) return !1;
115
+ const T = a > c ? d[a - 1] : "";
116
+ if (T && T !== `
96
117
  `) return !1;
97
118
  t.preventDefault();
98
- const L = e.getRangeAt(i);
99
- return L.setStart(n, a), L.setEnd(n, o), L.deleteContents(), s(S), !0;
119
+ const f = e.getRangeAt(c);
120
+ return f.setStart(o, a), f.setEnd(o, r), f.deleteContents(), s(p), !0;
100
121
  };
101
122
  export {
102
- yt as applyFontFamily,
103
- Ot as applyListType,
104
- Ct as clearFormatDeep,
105
- gt as detectListType,
123
+ Nt as applyFontFamily,
124
+ ht as applyListType,
125
+ Ot as clearFormatDeep,
126
+ Rt as detectListType,
106
127
  s as execCommand,
107
- Et as fileToDataUrl,
108
- At as getActiveFormats,
109
- et as insertHTML,
110
- pt as insertImage,
111
- ft as insertLink,
112
- c as queryCommandState,
113
- _t as queryCommandValue,
114
- Nt as setBlockDirection,
115
- mt as setHighlightColor,
116
- St as setTextColor,
117
- rt as stripSelectionColors,
118
- Rt as tryConvertMarkdownListPrefix
128
+ gt as fileToDataUrl,
129
+ yt as getActiveFormats,
130
+ ot as insertHTML,
131
+ Ct as insertImage,
132
+ pt as insertLink,
133
+ l as queryCommandState,
134
+ St as queryCommandValue,
135
+ Mt as setBlockDirection,
136
+ At as setHighlightColor,
137
+ Et as setTextColor,
138
+ nt as stripSelectionColors,
139
+ It as tryConvertMarkdownBlockPrefix,
140
+ Dt as tryConvertMarkdownListPrefix
119
141
  };
@@ -1,2 +1,2 @@
1
- export { execCommand, queryCommandState, queryCommandValue, insertLink, setTextColor, setHighlightColor, insertHTML, insertImage, fileToDataUrl, getActiveFormats, applyFormat, applyFontFamily, applyListType, detectListType, setBlockDirection, clearFormatDeep, stripSelectionColors, tryConvertMarkdownListPrefix, isSelectionInListItem, } from './format.utils';
1
+ export { execCommand, queryCommandState, queryCommandValue, insertLink, setTextColor, setHighlightColor, insertHTML, insertImage, fileToDataUrl, getActiveFormats, applyFormat, applyFontFamily, applyListType, detectListType, setBlockDirection, clearFormatDeep, stripSelectionColors, tryConvertMarkdownBlockPrefix, tryConvertMarkdownListPrefix, isSelectionInListItem, } from './format.utils';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/InkEditor/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/InkEditor/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,6BAA6B,EAC7B,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,gBAAgB,CAAC"}
@@ -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"}
@@ -0,0 +1,104 @@
1
+ import { jsxs as l, jsx as i } from "react/jsx-runtime";
2
+ import { useState as b } from "react";
3
+ const f = ({
4
+ documents: c,
5
+ activeDocumentId: y,
6
+ onTabSelect: g,
7
+ onTabClose: d,
8
+ onTabAdd: h,
9
+ onTabRename: a,
10
+ className: m = ""
11
+ }) => {
12
+ const [u, s] = b(null), [r, k] = b(""), v = (t, n, o) => {
13
+ o.stopPropagation(), a && (s(t), k(n));
14
+ }, p = (t) => {
15
+ u === t && r.trim() && (a == null || a(t, r.trim())), s(null);
16
+ }, x = (t, n) => {
17
+ n.key === "Enter" ? p(t) : n.key === "Escape" && s(null);
18
+ };
19
+ return /* @__PURE__ */ l(
20
+ "div",
21
+ {
22
+ className: `ink-tabs-container ${m}`.trim(),
23
+ role: "tablist",
24
+ "aria-label": "Document tabs",
25
+ children: [
26
+ /* @__PURE__ */ i("div", { className: "ink-tabs-scroll-area", children: c.map((t) => {
27
+ const n = t.id === y, o = u === t.id;
28
+ return /* @__PURE__ */ l(
29
+ "div",
30
+ {
31
+ role: "tab",
32
+ "aria-selected": n,
33
+ tabIndex: n ? 0 : -1,
34
+ className: `ink-tab-item ${n ? "ink-tab-active" : ""} ${t.isDirty ? "ink-tab-dirty" : ""}`,
35
+ onClick: () => g(t.id),
36
+ onDoubleClick: (e) => v(t.id, t.title, e),
37
+ title: t.title,
38
+ children: [
39
+ /* @__PURE__ */ i("span", { className: "ink-tab-icon", "aria-hidden": "true", children: t.icon || /* @__PURE__ */ l("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
40
+ /* @__PURE__ */ i("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
41
+ /* @__PURE__ */ i("polyline", { points: "14 2 14 8 20 8" })
42
+ ] }) }),
43
+ o ? /* @__PURE__ */ i(
44
+ "input",
45
+ {
46
+ type: "text",
47
+ className: "ink-tab-title-input",
48
+ value: r,
49
+ autoFocus: !0,
50
+ onChange: (e) => k(e.target.value),
51
+ onBlur: () => p(t.id),
52
+ onKeyDown: (e) => x(t.id, e),
53
+ onClick: (e) => e.stopPropagation()
54
+ }
55
+ ) : /* @__PURE__ */ i("span", { className: "ink-tab-title", children: t.title || "Untitled" }),
56
+ t.isDirty && /* @__PURE__ */ i(
57
+ "span",
58
+ {
59
+ className: "ink-tab-dirty-indicator",
60
+ title: "Unsaved changes",
61
+ "aria-label": "Unsaved changes"
62
+ }
63
+ ),
64
+ d && c.length > 1 && /* @__PURE__ */ i(
65
+ "button",
66
+ {
67
+ type: "button",
68
+ className: "ink-tab-close-btn",
69
+ "aria-label": `Close ${t.title}`,
70
+ onClick: (e) => {
71
+ e.stopPropagation(), d(t.id);
72
+ },
73
+ children: /* @__PURE__ */ l("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
74
+ /* @__PURE__ */ i("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
75
+ /* @__PURE__ */ i("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
76
+ ] })
77
+ }
78
+ )
79
+ ]
80
+ },
81
+ t.id
82
+ );
83
+ }) }),
84
+ h && /* @__PURE__ */ i(
85
+ "button",
86
+ {
87
+ type: "button",
88
+ className: "ink-tab-add-btn",
89
+ "aria-label": "New document",
90
+ title: "New document",
91
+ onClick: h,
92
+ children: /* @__PURE__ */ l("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
93
+ /* @__PURE__ */ i("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
94
+ /* @__PURE__ */ i("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
95
+ ] })
96
+ }
97
+ )
98
+ ]
99
+ }
100
+ );
101
+ };
102
+ export {
103
+ f as InkTabs
104
+ };
@@ -0,0 +1,2 @@
1
+ export { InkTabs } from './InkTabs';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/InkTabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),H=require("../InkTabs/InkTabs.cjs"),j=require("../InkEditor/InkEditor.cjs"),f=require("../InkEditor/components/PresenceStack/PresenceStack.cjs"),X=require("./hooks/useInkWorkspace.cjs"),t=require("./components/WorkspaceIcons.cjs"),P=require("../../constants/numbers.cjs"),A=require("../../constants/generals.const.cjs");require("../../constants/openai.const.cjs");const d=require("../../utils/cn.utils.cjs");require("../../utils/paste.utils.cjs");require("../../utils/exportDocument.utils.cjs");const i=require("../../common-components/Button/Button.cjs");require("react");require("react-dom");const n=require("../../constants/workspace.const.cjs"),G=p=>{const{documents:E,activeDocumentId:O,onActiveDocumentChange:T,onDocumentChange:r,onDocumentDelete:N,onDocumentRename:b,onDocumentSave:u,folders:S=[],onFolderCreate:K,onFolderDelete:m,collaboration:o,editorProps:C={},className:W=A.EMPTY_STRING,style:D}=p,{sidebarOpen:k,setSidebarOpen:v,splitMode:_,setSplitMode:I,setSecondaryDocId:w,searchQuery:y,setSearchQuery:B,editingDocId:g,editTitle:q,setEditTitle:M,activeDocument:l,secondaryDocument:c,filteredDocs:F,handleCreateDocument:R,handleStartRename:x,handleSaveRename:h,handleCancelRename:U}=X.useInkWorkspace(p);return e.jsxs("div",{className:d.cn("ink-workspace-root",W),style:D,"data-split-mode":_,children:[e.jsxs("header",{className:"ink-workspace-header",children:[e.jsxs("div",{className:"ink-workspace-header-left",children:[e.jsx(i.Button,{type:"button",className:"ink-workspace-toggle-btn",onClick:()=>v(!k),title:k?n.INK_WORKSPACE_HIDE_EXPLORER_TITLE:n.INK_WORKSPACE_SHOW_EXPLORER_TITLE,"aria-label":k?n.INK_WORKSPACE_HIDE_EXPLORER_TITLE:n.INK_WORKSPACE_SHOW_EXPLORER_TITLE,children:e.jsx(t.SidebarToggleIcon,{})}),e.jsx("span",{className:"ink-workspace-title",children:n.INK_WORKSPACE_TITLE}),e.jsxs("span",{className:"ink-workspace-count",children:["(",E.length," ",n.INK_WORKSPACE_DOCS_SUFFIX,")"]})]}),e.jsxs("div",{className:"ink-workspace-header-right",children:[e.jsxs("div",{className:"ink-workspace-split-controls",role:"group","aria-label":n.INK_WORKSPACE_SPLIT_VIEW_LABEL,children:[e.jsx(i.Button,{type:"button",className:d.cn("ink-workspace-icon-btn",_===n.INK_SPLIT_MODE_NONE&&"ink-active"),onClick:()=>I(n.INK_SPLIT_MODE_NONE),title:n.INK_WORKSPACE_SINGLE_VIEW_TITLE,children:e.jsx(t.SingleViewIcon,{})}),e.jsx(i.Button,{type:"button",className:d.cn("ink-workspace-icon-btn",_===n.INK_SPLIT_MODE_VERTICAL&&"ink-active"),onClick:()=>I(n.INK_SPLIT_MODE_VERTICAL),title:n.INK_WORKSPACE_SPLIT_SIDE_TITLE,children:e.jsx(t.SplitVerticalIcon,{})}),e.jsx(i.Button,{type:"button",className:d.cn("ink-workspace-icon-btn",_===n.INK_SPLIT_MODE_HORIZONTAL&&"ink-active"),onClick:()=>I(n.INK_SPLIT_MODE_HORIZONTAL),title:n.INK_WORKSPACE_SPLIT_STACKED_TITLE,children:e.jsx(t.SplitHorizontalIcon,{})})]}),u&&l&&e.jsx(i.Button,{type:"button",className:"ink-workspace-icon-btn",onClick:()=>u(l.id),title:n.INK_WORKSPACE_SAVE_TITLE,"aria-label":n.INK_WORKSPACE_SAVE_TITLE,children:e.jsx(t.SaveDocIcon,{})}),(o==null?void 0:o.collaborators)&&e.jsx(f.PresenceStack,{collaborators:o.collaborators,maxAvatars:o.maxAvatars})]})]}),e.jsxs("div",{className:"ink-workspace-body",children:[k&&e.jsxs("aside",{className:"ink-workspace-sidebar","aria-label":n.INK_WORKSPACE_TITLE,children:[e.jsxs("div",{className:"ink-workspace-sidebar-toolbar",children:[e.jsx("input",{type:"text",className:"ink-workspace-search-input",placeholder:n.INK_WORKSPACE_SEARCH_PLACEHOLDER,value:y,onChange:s=>B(s.target.value)}),e.jsx(i.Button,{type:"button",className:"ink-workspace-new-doc-btn",onClick:R,title:n.INK_WORKSPACE_NEW_DOC_BUTTON,"aria-label":n.INK_WORKSPACE_NEW_DOC_BUTTON,children:n.INK_WORKSPACE_NEW_DOC_BUTTON}),K&&e.jsx(i.Button,{type:"button",className:"ink-workspace-icon-btn",onClick:()=>K(n.INK_WORKSPACE_NEW_FOLDER),title:n.INK_WORKSPACE_NEW_FOLDER,"aria-label":n.INK_WORKSPACE_NEW_FOLDER,children:e.jsx(t.NewFolderIcon,{})})]}),S.length>P.NUMBER_ZERO&&e.jsx("div",{className:"ink-workspace-folders-section",children:S.map(s=>e.jsxs("div",{className:"ink-workspace-folder-item",children:[e.jsx("span",{className:"ink-doc-icon",children:"📁"}),e.jsx("span",{className:"ink-doc-title",children:s.name}),m&&e.jsx(i.Button,{type:"button",className:"ink-doc-action-btn ink-delete",onClick:()=>m(s.id),title:n.INK_WORKSPACE_CLOSE_FOLDER_BUTTON,"aria-label":n.INK_WORKSPACE_CLOSE_FOLDER_BUTTON,children:n.INK_WORKSPACE_CLOSE_FOLDER_BUTTON})]},s.id))}),e.jsx("div",{className:"ink-workspace-doc-list",role:"tree",children:F.map(s=>{const L=s.id===O,V=g===s.id;return e.jsxs("div",{role:"treeitem","aria-selected":L,className:d.cn("ink-workspace-doc-item",L&&"ink-doc-active"),onClick:()=>T(s.id),children:[e.jsx("span",{className:"ink-doc-icon",children:s.icon||e.jsx(t.FileDocumentIcon,{})}),V?e.jsx("input",{type:"text",className:"ink-doc-title-input",value:q,autoFocus:!0,onChange:a=>M(a.target.value),onBlur:()=>h(s.id),onKeyDown:a=>{a.key==="Enter"&&h(s.id),a.key==="Escape"&&U()},onClick:a=>a.stopPropagation()}):e.jsx("span",{className:"ink-doc-title",onDoubleClick:a=>x(s.id,s.title,a),children:s.title||n.INK_WORKSPACE_UNTITLED_FALLBACK}),s.isDirty&&e.jsx("span",{className:"ink-doc-dirty-dot"}),e.jsxs("div",{className:"ink-doc-actions",children:[e.jsx(i.Button,{type:"button",className:"ink-doc-action-btn",onClick:a=>x(s.id,s.title,a),title:n.INK_WORKSPACE_RENAME_TITLE,"aria-label":n.INK_WORKSPACE_RENAME_TITLE,children:e.jsx(t.RenamePencilIcon,{})}),E.length>P.NUMBER_ONE&&N&&e.jsx(i.Button,{type:"button",className:"ink-doc-action-btn ink-delete",onClick:a=>{a.stopPropagation(),N(s.id)},title:n.INK_WORKSPACE_DELETE_TITLE,"aria-label":n.INK_WORKSPACE_DELETE_TITLE,children:e.jsx(t.CloseCrossIcon,{})})]})]},s.id)})})]}),e.jsxs("main",{className:d.cn("ink-workspace-main-area",`ink-split-${_}`),children:[e.jsxs("section",{className:"ink-workspace-pane ink-primary-pane",children:[e.jsx(H.InkTabs,{documents:E,activeDocumentId:O,onTabSelect:T,onTabClose:N,onTabAdd:R,onTabRename:b}),l&&e.jsx("div",{className:"ink-workspace-editor-wrapper",children:e.jsx(j.InkEditor,{value:l.content,onChange:s=>r==null?void 0:r(l.id,s),readOnly:l.readOnly,collaboration:o,...C},l.id)})]}),_!==n.INK_SPLIT_MODE_NONE&&e.jsxs("section",{className:"ink-workspace-pane ink-secondary-pane",children:[e.jsxs("div",{className:"ink-secondary-pane-header",children:[e.jsx("span",{className:"ink-secondary-pane-label",children:n.INK_WORKSPACE_SPLIT_VIEW_LABEL}),e.jsx("select",{className:"ink-secondary-pane-select",value:(c==null?void 0:c.id)||A.EMPTY_STRING,onChange:s=>w(s.target.value),"aria-label":n.INK_WORKSPACE_SPLIT_VIEW_LABEL,children:E.map(s=>e.jsx("option",{value:s.id,children:s.title},s.id))})]}),c&&e.jsx("div",{className:"ink-workspace-editor-wrapper",children:e.jsx(j.InkEditor,{value:c.content,onChange:s=>r==null?void 0:r(c.id,s),readOnly:c.readOnly,...C},`sec-${c.id}`)})]})]})]})]})};exports.InkWorkspace=G;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { InkWorkspaceProps } from '../../types';
3
+ export declare const InkWorkspace: React.FC<InkWorkspaceProps>;
4
+ //# sourceMappingURL=InkWorkspace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkWorkspace.d.ts","sourceRoot":"","sources":["../../../src/components/InkWorkspace/InkWorkspace.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AA2CjD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA0SpD,CAAC"}