@forgedevstack/ink 1.1.7 → 1.1.8

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 (213) hide show
  1. package/CHANGELOG.md +31 -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 +1178 -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 +209 -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/TableSizePicker/TableSizePicker.cjs +1 -0
  49. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.cjs +1 -0
  50. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.d.ts +10 -0
  51. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.d.ts.map +1 -0
  52. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.js +18 -0
  53. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.d.ts +4 -0
  54. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.d.ts.map +1 -0
  55. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.js +95 -0
  56. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.types.d.ts +11 -0
  57. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.types.d.ts.map +1 -0
  58. package/dist/components/InkEditor/components/TableSizePicker/index.d.ts +3 -0
  59. package/dist/components/InkEditor/components/TableSizePicker/index.d.ts.map +1 -0
  60. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.cjs +1 -0
  61. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts +4 -0
  62. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts.map +1 -0
  63. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.js +81 -0
  64. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.types.d.ts +12 -0
  65. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.types.d.ts.map +1 -0
  66. package/dist/components/InkEditor/components/ThemePicker/index.d.ts +3 -0
  67. package/dist/components/InkEditor/components/ThemePicker/index.d.ts.map +1 -0
  68. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.cjs +1 -0
  69. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.d.ts +4 -0
  70. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.d.ts.map +1 -0
  71. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.js +79 -0
  72. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.types.d.ts +10 -0
  73. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.types.d.ts.map +1 -0
  74. package/dist/components/InkEditor/components/TitleGallery/index.d.ts +3 -0
  75. package/dist/components/InkEditor/components/TitleGallery/index.d.ts.map +1 -0
  76. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.cjs +1 -1
  77. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.d.ts.map +1 -1
  78. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.js +41 -18
  79. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
  80. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.d.ts.map +1 -1
  81. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.js +25 -23
  82. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.cjs +1 -1
  83. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts +1 -1
  84. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts.map +1 -1
  85. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.js +7 -7
  86. package/dist/components/InkEditor/components/index.d.ts +14 -0
  87. package/dist/components/InkEditor/components/index.d.ts.map +1 -1
  88. package/dist/components/InkEditor/helpers/format.utils.cjs +2 -2
  89. package/dist/components/InkEditor/helpers/format.utils.d.ts +1 -1
  90. package/dist/components/InkEditor/helpers/format.utils.d.ts.map +1 -1
  91. package/dist/components/InkEditor/helpers/format.utils.js +72 -72
  92. package/dist/constants/colorMode.const.cjs +1 -1
  93. package/dist/constants/colorMode.const.d.ts +1 -1
  94. package/dist/constants/colorMode.const.d.ts.map +1 -1
  95. package/dist/constants/colorMode.const.js +4 -4
  96. package/dist/constants/contextMenu.const.cjs +1 -1
  97. package/dist/constants/contextMenu.const.d.ts +2 -0
  98. package/dist/constants/contextMenu.const.d.ts.map +1 -1
  99. package/dist/constants/contextMenu.const.js +17 -15
  100. package/dist/constants/defaultIcons.cjs +1 -1
  101. package/dist/constants/defaultIcons.d.ts.map +1 -1
  102. package/dist/constants/defaultIcons.js +20 -13
  103. package/dist/constants/defaults.const.cjs +1 -1
  104. package/dist/constants/defaults.const.d.ts +48 -0
  105. package/dist/constants/defaults.const.d.ts.map +1 -1
  106. package/dist/constants/defaults.const.js +201 -102
  107. package/dist/constants/generals.const.cjs +1 -1
  108. package/dist/constants/generals.const.d.ts +48 -0
  109. package/dist/constants/generals.const.d.ts.map +1 -1
  110. package/dist/constants/generals.const.js +71 -28
  111. package/dist/constants/index.d.ts +1 -0
  112. package/dist/constants/index.d.ts.map +1 -1
  113. package/dist/constants/numbers.cjs +1 -1
  114. package/dist/constants/numbers.d.ts +14 -0
  115. package/dist/constants/numbers.d.ts.map +1 -1
  116. package/dist/constants/numbers.js +44 -30
  117. package/dist/constants/plugins.const.cjs +1 -0
  118. package/dist/constants/plugins.const.d.ts +13 -0
  119. package/dist/constants/plugins.const.d.ts.map +1 -0
  120. package/dist/constants/plugins.const.js +45 -0
  121. package/dist/constants/table.const.cjs +1 -1
  122. package/dist/constants/table.const.d.ts +4 -0
  123. package/dist/constants/table.const.d.ts.map +1 -1
  124. package/dist/constants/table.const.js +10 -6
  125. package/dist/constants/toolbar.const.cjs +1 -1
  126. package/dist/constants/toolbar.const.d.ts +7 -0
  127. package/dist/constants/toolbar.const.d.ts.map +1 -1
  128. package/dist/constants/toolbar.const.js +16 -9
  129. package/dist/constants/toolbarMenu.const.cjs +1 -1
  130. package/dist/constants/toolbarMenu.const.d.ts +2 -0
  131. package/dist/constants/toolbarMenu.const.d.ts.map +1 -1
  132. package/dist/constants/toolbarMenu.const.js +80 -19
  133. package/dist/hooks/index.d.ts +2 -0
  134. package/dist/hooks/index.d.ts.map +1 -0
  135. package/dist/hooks/useToolbarOverflow.cjs +1 -0
  136. package/dist/hooks/useToolbarOverflow.d.ts +8 -0
  137. package/dist/hooks/useToolbarOverflow.d.ts.map +1 -0
  138. package/dist/hooks/useToolbarOverflow.js +29 -0
  139. package/dist/index.cjs +1 -1
  140. package/dist/index.d.ts +5 -2
  141. package/dist/index.d.ts.map +1 -1
  142. package/dist/index.js +117 -86
  143. package/dist/plugins/excel/excel.utils.cjs +1 -0
  144. package/dist/plugins/excel/excel.utils.d.ts +13 -0
  145. package/dist/plugins/excel/excel.utils.d.ts.map +1 -0
  146. package/dist/plugins/excel/excel.utils.js +40 -0
  147. package/dist/plugins/excel/index.d.ts +3 -0
  148. package/dist/plugins/excel/index.d.ts.map +1 -0
  149. package/dist/plugins/graph/graph.const.cjs +1 -0
  150. package/dist/plugins/graph/graph.const.d.ts +14 -0
  151. package/dist/plugins/graph/graph.const.d.ts.map +1 -0
  152. package/dist/plugins/graph/graph.const.js +24 -0
  153. package/dist/plugins/graph/graph.types.d.ts +7 -0
  154. package/dist/plugins/graph/graph.types.d.ts.map +1 -0
  155. package/dist/plugins/graph/graph.utils.cjs +1 -0
  156. package/dist/plugins/graph/graph.utils.d.ts +11 -0
  157. package/dist/plugins/graph/graph.utils.d.ts.map +1 -0
  158. package/dist/plugins/graph/graph.utils.js +76 -0
  159. package/dist/plugins/graph/index.d.ts +4 -0
  160. package/dist/plugins/graph/index.d.ts.map +1 -0
  161. package/dist/plugins/host/index.d.ts +2 -0
  162. package/dist/plugins/host/index.d.ts.map +1 -0
  163. package/dist/plugins/host/inkPlugins.cjs +1 -0
  164. package/dist/plugins/host/inkPlugins.d.ts +16 -0
  165. package/dist/plugins/host/inkPlugins.d.ts.map +1 -0
  166. package/dist/plugins/host/inkPlugins.js +20 -0
  167. package/dist/plugins/index.d.ts +5 -0
  168. package/dist/plugins/index.d.ts.map +1 -0
  169. package/dist/plugins/theme/index.d.ts +4 -0
  170. package/dist/plugins/theme/index.d.ts.map +1 -0
  171. package/dist/plugins/theme/inkTheme.cjs +1 -0
  172. package/dist/plugins/theme/inkTheme.d.ts +5 -0
  173. package/dist/plugins/theme/inkTheme.d.ts.map +1 -0
  174. package/dist/plugins/theme/inkTheme.js +30 -0
  175. package/dist/plugins/theme/theme.const.cjs +1 -0
  176. package/dist/plugins/theme/theme.const.d.ts +9 -0
  177. package/dist/plugins/theme/theme.const.d.ts.map +1 -0
  178. package/dist/plugins/theme/theme.const.js +15 -0
  179. package/dist/plugins/theme/theme.types.d.ts +12 -0
  180. package/dist/plugins/theme/theme.types.d.ts.map +1 -0
  181. package/dist/plugins/titles/index.d.ts +4 -0
  182. package/dist/plugins/titles/index.d.ts.map +1 -0
  183. package/dist/plugins/titles/titles.const.cjs +1 -0
  184. package/dist/plugins/titles/titles.const.d.ts +4 -0
  185. package/dist/plugins/titles/titles.const.d.ts.map +1 -0
  186. package/dist/plugins/titles/titles.const.js +15 -0
  187. package/dist/plugins/titles/titles.types.d.ts +2 -0
  188. package/dist/plugins/titles/titles.types.d.ts.map +1 -0
  189. package/dist/plugins/titles/titles.utils.cjs +1 -0
  190. package/dist/plugins/titles/titles.utils.d.ts +3 -0
  191. package/dist/plugins/titles/titles.utils.d.ts.map +1 -0
  192. package/dist/plugins/titles/titles.utils.js +14 -0
  193. package/dist/styles.css +1 -1
  194. package/dist/types/features.types.d.ts +1 -1
  195. package/dist/types/features.types.d.ts.map +1 -1
  196. package/dist/types/index.d.ts +1 -0
  197. package/dist/types/index.d.ts.map +1 -1
  198. package/dist/types/ink.types.d.ts +6 -2
  199. package/dist/types/ink.types.d.ts.map +1 -1
  200. package/dist/types/plugin.types.d.ts +8 -0
  201. package/dist/types/plugin.types.d.ts.map +1 -0
  202. package/dist/types/premium.types.d.ts +1 -1
  203. package/dist/types/premium.types.d.ts.map +1 -1
  204. package/dist/utils/index.d.ts +1 -1
  205. package/dist/utils/index.d.ts.map +1 -1
  206. package/dist/utils/outline.utils.cjs +1 -1
  207. package/dist/utils/outline.utils.d.ts.map +1 -1
  208. package/dist/utils/outline.utils.js +32 -32
  209. package/dist/utils/table.utils.cjs +1 -1
  210. package/dist/utils/table.utils.d.ts +4 -0
  211. package/dist/utils/table.utils.d.ts.map +1 -1
  212. package/dist/utils/table.utils.js +84 -45
  213. package/package.json +7 -1
@@ -1,72 +1,111 @@
1
- import { INK_DEFAULT_TABLE_ROWS as g, INK_DEFAULT_TABLE_COLS as N, INK_TABLE_MIN_COLS as _, INK_TABLE_MIN_ROWS as d, INK_TABLE_MAX_COLS as A, INK_TABLE_MAX_ROWS as L } from "../constants/numbers.js";
1
+ import { INK_DEFAULT_TABLE_ROWS as I, INK_DEFAULT_TABLE_COLS as S, INK_TABLE_MIN_COLS as B, INK_TABLE_MIN_ROWS as b, INK_TABLE_MAX_COLS as w, INK_TABLE_MAX_ROWS as y, INK_TABLE_COL_MIN_WIDTH_PX as M } from "../constants/numbers.js";
2
2
  import { EMPTY_STRING as m } from "../constants/generals.const.js";
3
3
  import "../constants/openai.const.js";
4
4
  import "react/jsx-runtime";
5
- import { TABLE_CLASS_NAME as w, TABLE_TAG as f, TABLE_ROW_TAG as u, TABLE_CELL_SELECTOR as S, TABLE_SECTION_THEAD as b, TABLE_CELL_TAG_TH as p, TABLE_CELL_TAG_TD as h } from "../constants/table.const.js";
5
+ import { TABLE_HEADER_PREFIX as N, TABLE_COLGROUP as T, TABLE_COL as _, TABLE_CLASS_NAME as O, TABLE_TAG as d, TABLE_ROW_TAG as u, TABLE_CELL_SELECTOR as x, TABLE_SECTION_THEAD as R, TABLE_CELL_TAG_TH as h, TABLE_CELL_TAG_TD as A, TABLE_SECTION_TBODY as H } from "../constants/table.const.js";
6
6
  import "./paste.utils.js";
7
7
  import "react";
8
8
  import "react-dom";
9
- const T = (t, e, n) => Math.min(n, Math.max(e, t)), C = (t) => {
9
+ const g = (t, e, n) => Math.min(n, Math.max(e, t)), E = (t) => {
10
10
  const e = document.createElement(t);
11
11
  return e.contentEditable = "true", e.innerHTML = "<br>", e;
12
- }, B = (t) => {
12
+ }, L = (t) => {
13
13
  const e = t.parentElement;
14
14
  return e ? Array.from(e.cells).indexOf(t) : 0;
15
- }, D = (t = g, e = N) => {
16
- const n = T(t, d, L), r = T(e, _, A), o = Array.from(
15
+ }, q = (t = I, e = S) => {
16
+ const n = g(t, b, y), r = g(e, B, w), o = Array.from(
17
17
  { length: r },
18
- (l, s) => `<th contenteditable="true">Header ${s + 1}</th>`
19
- ).join(m), c = Array.from({ length: Math.max(0, n - 1) }, () => `<tr>${Array.from(
18
+ (s, c) => `<th contenteditable="true">${N}${c + 1}</th>`
19
+ ).join(m), l = Array.from({ length: Math.max(0, n - 1) }, () => `<tr>${Array.from(
20
20
  { length: r },
21
21
  () => '<td contenteditable="true"><br></td>'
22
- ).join(m)}</tr>`).join(m);
23
- return `<table class="${w}"><thead><tr>${o}</tr></thead><tbody>${c}</tbody></table><p><br></p>`;
24
- }, G = () => {
22
+ ).join(m)}</tr>`).join(m), a = `<${T}>${Array.from({ length: r }, () => `<${_}>`).join(m)}</${T}>`;
23
+ return `<table class="${O}">${a}<thead><tr>${o}</tr></thead><tbody>${l}</tbody></table><p><br></p>`;
24
+ }, F = () => {
25
25
  const t = window.getSelection();
26
26
  if (!t || t.rangeCount === 0) return null;
27
27
  let e = t.anchorNode;
28
- return e && e.nodeType === Node.TEXT_NODE && (e = e.parentElement), e instanceof Element ? e.closest(S) : null;
29
- }, $ = (t, e) => {
30
- var i, a;
31
- const n = t.closest(u), r = t.closest(f);
28
+ return e && e.nodeType === Node.TEXT_NODE && (e = e.parentElement), e instanceof Element ? e.closest(x) : null;
29
+ }, P = (t, e) => {
30
+ var c, i;
31
+ const n = t.closest(u), r = t.closest(d);
32
32
  if (!n || !r) return !1;
33
33
  const o = n.cells.length;
34
- if (r.rows.length >= L) return !1;
35
- const l = !!n.closest(b) ? p : h, s = document.createElement(u);
36
- for (let E = 0; E < o; E += 1)
37
- s.appendChild(C(l));
38
- return e === "before" ? (i = n.parentElement) == null || i.insertBefore(s, n) : (a = n.parentElement) == null || a.insertBefore(s, n.nextSibling), !0;
39
- }, W = (t, e) => {
40
- const n = t.closest(f);
34
+ if (r.rows.length >= y) return !1;
35
+ const a = !!n.closest(R) ? h : A, s = document.createElement(u);
36
+ for (let f = 0; f < o; f += 1)
37
+ s.appendChild(E(a));
38
+ return e === "before" ? (c = n.parentElement) == null || c.insertBefore(s, n) : (i = n.parentElement) == null || i.insertBefore(s, n.nextSibling), !0;
39
+ }, U = (t, e) => {
40
+ const n = t.closest(d);
41
41
  if (!n) return !1;
42
- const r = B(t);
42
+ const r = L(t);
43
43
  if (r < 0) return !1;
44
44
  const o = n.rows[0];
45
- if (!o || o.cells.length >= A) return !1;
46
- const c = e === "before" ? r : r + 1;
47
- return Array.from(n.rows).forEach((l) => {
48
- const s = l.cells[c] ?? null, i = l.closest(b) ? p : h, a = C(i);
49
- s ? l.insertBefore(a, s) : l.appendChild(a);
50
- }), !0;
51
- }, j = (t) => {
52
- const e = t.closest(u), n = t.closest(f);
53
- return !e || !n || n.rows.length <= d ? !1 : (e.remove(), !0);
54
- }, F = (t) => {
55
- const e = t.closest(f);
45
+ if (!o || o.cells.length >= w) return !1;
46
+ const l = e === "before" ? r : r + 1;
47
+ return Array.from(n.rows).forEach((a) => {
48
+ const s = a.cells[l] ?? null, c = a.closest(R) ? h : A, i = E(c);
49
+ s ? a.insertBefore(i, s) : a.appendChild(i);
50
+ }), C(n), !0;
51
+ }, Y = (t) => {
52
+ const e = t.closest(u), n = t.closest(d);
53
+ return !e || !n || n.rows.length <= b ? !1 : (e.remove(), !0);
54
+ }, z = (t) => {
55
+ const e = t.closest(d);
56
56
  if (!e) return !1;
57
- const n = B(t);
57
+ const n = L(t);
58
58
  if (n < 0) return !1;
59
59
  const r = e.rows[0];
60
- return !r || r.cells.length <= _ ? !1 : (Array.from(e.rows).forEach((o) => {
61
- const c = o.cells[n];
62
- c && c.remove();
63
- }), !0);
60
+ return !r || r.cells.length <= B ? !1 : (Array.from(e.rows).forEach((o) => {
61
+ const l = o.cells[n];
62
+ l && l.remove();
63
+ }), C(e), !0);
64
+ }, k = (t) => {
65
+ const e = t.closest(d);
66
+ if (!e) return !1;
67
+ const n = e.tHead, r = n == null ? void 0 : n.querySelector(u);
68
+ if (n && r) {
69
+ const c = e.tBodies[0] ?? e.createTBody(), i = document.createElement(u);
70
+ return Array.from(r.cells).forEach((f) => {
71
+ const p = E(A);
72
+ p.innerHTML = f.innerHTML, i.appendChild(p);
73
+ }), c.insertBefore(i, c.firstChild), n.remove(), !0;
74
+ }
75
+ const o = e.tBodies[0] ?? e.querySelector(H), l = o == null ? void 0 : o.querySelector(u);
76
+ if (!o || !l) return !1;
77
+ const a = e.createTHead(), s = document.createElement(u);
78
+ return Array.from(l.cells).forEach((c, i) => {
79
+ const f = E(h);
80
+ f.innerHTML = c.innerHTML || `${N}${i + 1}`, s.appendChild(f);
81
+ }), a.appendChild(s), l.remove(), !0;
82
+ }, C = (t) => {
83
+ var r, o;
84
+ let e = t.querySelector(T);
85
+ const n = ((r = t.rows[0]) == null ? void 0 : r.cells.length) ?? 0;
86
+ for (e || (e = document.createElement(T), t.insertBefore(e, t.firstChild)); e.children.length < n; )
87
+ e.appendChild(document.createElement(_));
88
+ for (; e.children.length > n; )
89
+ (o = e.lastElementChild) == null || o.remove();
90
+ return e.getElementsByTagName(_);
91
+ }, J = (t, e, n) => {
92
+ const r = e.getBoundingClientRect();
93
+ return Math.abs(r.right - t) > n ? null : L(e);
94
+ }, Q = (t, e, n) => {
95
+ const o = C(t).item(e);
96
+ if (!o) return;
97
+ const l = Math.max(M, n);
98
+ o.style.width = `${l}px`;
64
99
  };
65
100
  export {
66
- D as buildTableHtml,
67
- F as deleteTableColumn,
68
- j as deleteTableRow,
69
- G as getTableCellFromSelection,
70
- W as insertTableColumn,
71
- $ as insertTableRow
101
+ q as buildTableHtml,
102
+ z as deleteTableColumn,
103
+ Y as deleteTableRow,
104
+ C as ensureTableColgroup,
105
+ J as getColumnResizeIndex,
106
+ F as getTableCellFromSelection,
107
+ U as insertTableColumn,
108
+ P as insertTableRow,
109
+ Q as setTableColumnWidth,
110
+ k as toggleTableHeaderRow
72
111
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgedevstack/ink",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "ForgeStack rich text editor for React — WYSIWYG with tables, track changes, comments, block handles, sign pad, and pluggable Ink AI (BYO LLM). The writing layer of ForgeStack.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -27,8 +27,12 @@
27
27
  },
28
28
  "./styles.css": "./dist/styles.css"
29
29
  },
30
+ "bin": {
31
+ "ink": "./bin/ink.mjs"
32
+ },
30
33
  "files": [
31
34
  "dist",
35
+ "bin",
32
36
  "README.md",
33
37
  "CHANGELOG.md",
34
38
  "LICENSE",
@@ -42,6 +46,7 @@
42
46
  "prepublishOnly": "npm run build"
43
47
  },
44
48
  "peerDependencies": {
49
+ "@forgedevstack/bear": ">=1.3.2",
45
50
  "react": ">=18.0.0",
46
51
  "react-dom": ">=18.0.0"
47
52
  },
@@ -54,6 +59,7 @@
54
59
  }
55
60
  },
56
61
  "devDependencies": {
62
+ "@forgedevstack/bear": "^1.3.2",
57
63
  "@types/react": "^18.3.18",
58
64
  "@types/react-dom": "^18.3.5",
59
65
  "@vitejs/plugin-react": "^4.3.4",