@clevertask/scribe 0.1.26 → 0.1.28

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 (37) hide show
  1. package/README.md +9 -1
  2. package/dist/components/Menu/TableBubbleMenu.d.ts.map +1 -1
  3. package/dist/components/Menu/TableBubbleMenu.js +174 -134
  4. package/dist/components/Menu/TableHeightSettings.d.ts +11 -0
  5. package/dist/components/Menu/TableHeightSettings.d.ts.map +1 -0
  6. package/dist/components/Menu/TableHeightSettings.js +156 -0
  7. package/dist/components/Menu/TableLayoutOptions.d.ts +24 -0
  8. package/dist/components/Menu/TableLayoutOptions.d.ts.map +1 -0
  9. package/dist/components/Menu/TableLayoutOptions.js +126 -0
  10. package/dist/components/Scribe/extension/index.js +1 -1
  11. package/dist/components/Scribe/extension/resizable-table.d.ts +13 -1
  12. package/dist/components/Scribe/extension/resizable-table.d.ts.map +1 -1
  13. package/dist/components/Scribe/extension/resizable-table.js +165 -2
  14. package/dist/components/Scribe/extension/slashCommand/items.js +1 -1
  15. package/dist/components/Scribe/extension/table-layout.d.ts +31 -0
  16. package/dist/components/Scribe/extension/table-layout.d.ts.map +1 -0
  17. package/dist/components/Scribe/extension/table-layout.js +2 -0
  18. package/dist/components/Scribe/extension/table-sticky-header.d.ts +7 -0
  19. package/dist/components/Scribe/extension/table-sticky-header.d.ts.map +1 -0
  20. package/dist/components/Scribe/extension/table-sticky-header.js +106 -0
  21. package/dist/components/Scribe/index.js +2 -2
  22. package/dist/document-node-capabilities.d.ts.map +1 -1
  23. package/dist/document-node-capabilities.js +80 -68
  24. package/dist/{extension-BFPlsViw.js → extension-BU2USLV1.js} +1 -1
  25. package/dist/{html-to-markdown-BpR-7GtJ.js → html-to-markdown-DF93it73.js} +1 -1
  26. package/dist/main.css +47 -0
  27. package/dist/main.d.ts +1 -0
  28. package/dist/main.d.ts.map +1 -1
  29. package/dist/main.js +1 -1
  30. package/dist/{schema-extensions-BryyErmk.js → schema-extensions-DyCk1Goa.js} +10 -9
  31. package/dist/schema-extensions.js +1 -1
  32. package/dist/schema.js +1 -1
  33. package/dist/{resizable-table-JZOaj_L3.js → table-layout-BoDS50DR.js} +140 -110
  34. package/dist/utils/html-to-markdown.d.ts.map +1 -1
  35. package/dist/utils/html-to-markdown.js +1 -1
  36. package/dist/utils/index.js +2 -2
  37. package/package.json +1 -1
package/README.md CHANGED
@@ -221,9 +221,17 @@ function App() {
221
221
 
222
222
  Type `/table` to insert a 3 × 3 table with a header row. Selecting a table cell opens nearby controls for adding or deleting rows and columns, toggling the header row, and deleting the table. Drag a column boundary to resize it.
223
223
 
224
+ The **Table layout** menu stores each table's explicit layout choice. **Auto** keeps the existing sizing behavior. **Fit to width** wraps the table into the available editor width and temporarily disables column resizing. **Scroll horizontally** retains authored column widths, gives columns without a saved width a readable 128px minimum, and scrolls inside the editor when the table needs more room. Switching layouts retains the table's saved column widths.
225
+
226
+ **Limit height** caps the table and enables vertical scrolling; shorter tables stay compact. In **Table layout → Maximum height…**, enter a whole number from 120 to 2000 pixels and choose **Apply** to set that table's maximum. **Use default** clears its override and uses the host's `--scribe-table-max-height`, with a 360px fallback. Turning **Limit height** off retains the saved maximum for when it is enabled again. Changing the maximum leaves the limit toggle, width layout, and sticky header preference unchanged.
227
+
228
+ Layout and height choices apply in both editing and read-only views, and remain intact when content is saved and loaded as JSON, HTML, or Markdown. Hosts can use `editor.commands.setTableLayout("scroll")` (accepts `"auto"`, `"fit"`, or `"scroll"`), `editor.commands.setTableHeightLimit(true)` (accepts a boolean), and `editor.commands.setTableMaxHeight(600)` (accepts a whole number from 120 to 2000, or `null` to restore the default) while the selection is inside an editable table. The optional `maxHeight` table attribute is serialized as `data-table-max-height` in HTML; existing tables without it keep the host default.
229
+
230
+ **Sticky header row** keeps the first row visible while scrolling, independently of **Limit height**. New tables created with `/table` or `insertTable` start with it enabled when their entire first row contains header cells. Existing and imported tables retain their saved setting; tables without a saved sticky preference stay off. Toggle it in **Table layout**. With **Limit height** on, the header stays at the top of the table's own scroll area. With it off, the header follows the document's vertical scroll area until the table ends. This also works with horizontal scrolling and retains saved column widths. The preference stays saved if the header row is removed and becomes active again when it is restored. It works in editing and read-only views. Hosts can use `editor.commands.setTableStickyHeaderRow(true)` to enable it or `false` to clear it while the selection is inside an editable table. For document scrolling, set `--scribe-table-sticky-header-offset` on the editor's container to leave room above the header for a document toolbar; the default is `0px`.
231
+
224
232
  Keyboard users can press `Alt + F10` while editing a table to focus its controls, use the arrow, Home, and End keys to move between actions, and press Escape to return to the active cell.
225
233
 
226
- Simple headed tables serialize as GFM Markdown. Tables with merged cells, multiple blocks in a cell, resized columns, or other structures that GFM cannot represent are kept as sanitized raw HTML inside the Markdown output so their structure is not silently lost.
234
+ Simple headed tables without layout, height, or sticky-header preferences serialize as GFM Markdown. Tables with those preferences (including a saved maximum while **Limit height** is off or an inactive sticky preference), merged cells, multiple blocks in a cell, resized columns, or other structures that GFM cannot represent are kept as sanitized raw HTML inside the Markdown output so their structure is not silently lost.
227
235
 
228
236
  Scribe's `insertTable` command and `/table` action do not create a table while the selection is
229
237
  already inside another table. Existing documents containing nested tables remain loadable so old
@@ -1 +1 @@
1
- {"version":3,"file":"TableBubbleMenu.d.ts","sourceRoot":"","sources":["../../../lib/components/Menu/TableBubbleMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAkB,MAAM,eAAe,CAAC;AAKvD,OAAO,EACL,EAAE,EAQH,MAAM,OAAO,CAAC;AAKf,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;CAChB;AAkKD,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAiV7C,CAAC;eAEa,eAAe"}
1
+ {"version":3,"file":"TableBubbleMenu.d.ts","sourceRoot":"","sources":["../../../lib/components/Menu/TableBubbleMenu.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAkB,MAAM,eAAe,CAAC;AAKvD,OAAO,EACL,EAAE,EAQH,MAAM,OAAO,CAAC;AAQf,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;CAChB;AAwJD,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA4Y7C,CAAC;eAEa,eAAe"}
@@ -1,13 +1,15 @@
1
- import { s as e } from "../../dist-BiognBi4.js";
2
- import { getPopupMountTarget as t } from "../Scribe/extension/getPopupMountTarget.js";
3
- import { t as n } from "../../menus-BDXjZsFU.js";
4
- import { getSelectionTableContext as r, tableBubbleMenuPluginKey as i } from "./tableBubbleMenuPlugin.js";
5
- import { getSelectionContextualMenuOwner as a } from "./contextualMenuOwner.js";
6
- import { Flex as o, IconButton as s, Separator as c } from "@radix-ui/themes";
7
- import { useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
8
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
1
+ import { c as e, u as t } from "../../table-layout-BoDS50DR.js";
2
+ import { s as n } from "../../dist-BiognBi4.js";
3
+ import { getPopupMountTarget as r } from "../Scribe/extension/getPopupMountTarget.js";
4
+ import { t as i } from "../../menus-BDXjZsFU.js";
5
+ import { getSelectionTableContext as a, tableBubbleMenuPluginKey as o } from "./tableBubbleMenuPlugin.js";
6
+ import { getSelectionContextualMenuOwner as s } from "./contextualMenuOwner.js";
7
+ import c from "./TableLayoutOptions.js";
8
+ import { Flex as l, IconButton as u, Separator as d } from "@radix-ui/themes";
9
+ import { useCallback as f, useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
10
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
9
11
  //#region lib/components/Menu/TableBubbleMenu.tsx
10
- var g = [
12
+ var b = [
11
13
  "addColumnAfter",
12
14
  "addColumnBefore",
13
15
  "addRowAfter",
@@ -16,7 +18,7 @@ var g = [
16
18
  "deleteRow",
17
19
  "deleteTable",
18
20
  "toggleHeaderRow"
19
- ], _ = {
21
+ ], x = {
20
22
  canAddColumnAfter: !1,
21
23
  canAddColumnBefore: !1,
22
24
  canAddRowAfter: !1,
@@ -25,24 +27,25 @@ var g = [
25
27
  canDeleteRow: !1,
26
28
  canDeleteTable: !1,
27
29
  canToggleHeaderRow: !1,
28
- hasHeaderRow: !1
29
- }, v = /auto|overlay|scroll/, y = (e) => {
30
+ hasHeaderRow: !1,
31
+ canSetTableLayout: !1,
32
+ canSetTableHeightLimit: !1,
33
+ canSetTableMaxHeight: !1,
34
+ canSetTableStickyHeaderRow: !1,
35
+ tableLayout: "auto",
36
+ limitHeight: !1,
37
+ maxHeight: null,
38
+ stickyHeaderRow: !1
39
+ }, S = /auto|overlay|scroll/, C = (e) => {
30
40
  let t = e.ownerDocument.defaultView;
31
41
  if (!t) return [];
32
42
  let n = [], r = e.parentElement;
33
43
  for (; r && r !== e.ownerDocument.body && r !== e.ownerDocument.documentElement;) {
34
44
  let e = t.getComputedStyle(r);
35
- v.test(`${e.overflow} ${e.overflowX} ${e.overflowY}`) && n.push(r), r = r.parentElement;
45
+ S.test(`${e.overflow} ${e.overflowX} ${e.overflowY}`) && n.push(r), r = r.parentElement;
36
46
  }
37
47
  return n;
38
- }, b = (e) => {
39
- let t = e.firstChild;
40
- if (!t || t.childCount === 0) return !1;
41
- let n = !0;
42
- return t.forEach((e) => {
43
- e.type.name !== "tableHeader" && (n = !1);
44
- }), n;
45
- }, x = ({ name: e }) => {
48
+ }, w = ({ name: e }) => {
46
49
  let t = {
47
50
  "aria-hidden": !0,
48
51
  fill: "none",
@@ -57,12 +60,12 @@ var g = [
57
60
  };
58
61
  if (e === "add-row-above" || e === "add-row-below") {
59
62
  let r = e === "add-row-above" ? 3.5 : 16.5;
60
- return /* @__PURE__ */ h("svg", {
63
+ return /* @__PURE__ */ y("svg", {
61
64
  ...t,
62
- children: [/* @__PURE__ */ m("path", {
65
+ children: [/* @__PURE__ */ v("path", {
63
66
  d: "M3.5 6.5h13v7h-13zM3.5 10h13M10 6.5v7",
64
67
  ...n
65
- }), /* @__PURE__ */ m("path", {
68
+ }), /* @__PURE__ */ v("path", {
66
69
  d: `M7.75 ${r}h4.5M10 ${r - 2.25}v4.5`,
67
70
  ...n
68
71
  })]
@@ -70,92 +73,104 @@ var g = [
70
73
  }
71
74
  if (e === "add-column-before" || e === "add-column-after") {
72
75
  let r = e === "add-column-before" ? 3.5 : 16.5;
73
- return /* @__PURE__ */ h("svg", {
76
+ return /* @__PURE__ */ y("svg", {
74
77
  ...t,
75
- children: [/* @__PURE__ */ m("path", {
78
+ children: [/* @__PURE__ */ v("path", {
76
79
  d: "M6.5 3.5h7v13h-7zM10 3.5v13M6.5 10h7",
77
80
  ...n
78
- }), /* @__PURE__ */ m("path", {
81
+ }), /* @__PURE__ */ v("path", {
79
82
  d: `M${r - 2.25} 10h4.5M${r} 7.75v4.5`,
80
83
  ...n
81
84
  })]
82
85
  });
83
86
  }
84
- return e === "delete-row" ? /* @__PURE__ */ h("svg", {
87
+ return e === "delete-row" ? /* @__PURE__ */ y("svg", {
85
88
  ...t,
86
- children: [/* @__PURE__ */ m("path", {
89
+ children: [/* @__PURE__ */ v("path", {
87
90
  d: "M3.5 4h13v12h-13zM3.5 8h13M3.5 12h13M10 4v12",
88
91
  ...n
89
- }), /* @__PURE__ */ m("path", {
92
+ }), /* @__PURE__ */ v("path", {
90
93
  d: "M6.75 10h6.5",
91
94
  stroke: "currentColor",
92
95
  strokeWidth: "2.2"
93
96
  })]
94
- }) : e === "delete-column" ? /* @__PURE__ */ h("svg", {
97
+ }) : e === "delete-column" ? /* @__PURE__ */ y("svg", {
95
98
  ...t,
96
- children: [/* @__PURE__ */ m("path", {
99
+ children: [/* @__PURE__ */ v("path", {
97
100
  d: "M4 3.5h12v13h-12zM8 3.5v13M12 3.5v13M4 10h12",
98
101
  ...n
99
- }), /* @__PURE__ */ m("path", {
102
+ }), /* @__PURE__ */ v("path", {
100
103
  d: "M10 6.75v6.5",
101
104
  stroke: "currentColor",
102
105
  strokeWidth: "2.2"
103
106
  })]
104
- }) : e === "toggle-header-row" ? /* @__PURE__ */ h("svg", {
107
+ }) : e === "toggle-header-row" ? /* @__PURE__ */ y("svg", {
105
108
  ...t,
106
- children: [/* @__PURE__ */ m("path", {
109
+ children: [/* @__PURE__ */ v("path", {
107
110
  d: "M3.5 4h13v12h-13zM3.5 8h13M10 4v12",
108
111
  ...n
109
- }), /* @__PURE__ */ m("path", {
112
+ }), /* @__PURE__ */ v("path", {
110
113
  d: "M4.2 4.7h11.6v2.6H4.2z",
111
114
  fill: "currentColor",
112
115
  opacity: "0.45"
113
116
  })]
114
- }) : /* @__PURE__ */ h("svg", {
117
+ }) : /* @__PURE__ */ y("svg", {
115
118
  ...t,
116
- children: [/* @__PURE__ */ m("path", {
119
+ children: [/* @__PURE__ */ v("path", {
117
120
  d: "M3.5 4h13v12h-13zM3.5 8h13M10 4v12",
118
121
  ...n
119
- }), /* @__PURE__ */ m("path", {
122
+ }), /* @__PURE__ */ v("path", {
120
123
  d: "m6.75 7 6.5 6.5m0-6.5-6.5 6.5",
121
124
  stroke: "currentColor",
122
125
  strokeWidth: "1.8"
123
126
  })]
124
127
  });
125
- }, S = ({ editor: v }) => {
126
- let S = f(null), [C, w] = p(null), T = d(() => g.every((e) => typeof v.commands[e] == "function"), [v]), E = e({
127
- editor: v,
128
- selector: ({ editor: e }) => {
129
- if (!T) return _;
130
- let t = r(e.state), n = e.can();
128
+ }, T = ({ editor: S }) => {
129
+ let T = h(null), [E, D] = g(null), [O, k] = g(!1), [A, j] = g(!1), M = m(() => b.every((e) => typeof S.commands[e] == "function"), [S]), N = m(() => typeof S.commands.setTableLayout == "function" && typeof S.commands.setTableHeightLimit == "function", [S]), P = m(() => typeof S.commands.setTableStickyHeaderRow == "function", [S]), F = m(() => typeof S.commands.setTableMaxHeight == "function", [S]), I = n({
130
+ editor: S,
131
+ selector: ({ editor: n }) => {
132
+ if (!M || n.isDestroyed) return x;
133
+ let r = a(n.state), i = n.can(), o = r ? t(r.node) : !1, s = r?.node.attrs.limitHeight === !0, c = r?.node.attrs.stickyHeaderRow === !0;
131
134
  return {
132
- canAddColumnAfter: n.addColumnAfter(),
133
- canAddColumnBefore: n.addColumnBefore(),
134
- canAddRowAfter: n.addRowAfter(),
135
- canAddRowBefore: n.addRowBefore(),
136
- canDeleteColumn: n.deleteColumn(),
137
- canDeleteRow: n.deleteRow(),
138
- canDeleteTable: n.deleteTable(),
139
- canToggleHeaderRow: n.toggleHeaderRow(),
140
- hasHeaderRow: t ? b(t.node) : !1
135
+ canAddColumnAfter: i.addColumnAfter(),
136
+ canAddColumnBefore: i.addColumnBefore(),
137
+ canAddRowAfter: i.addRowAfter(),
138
+ canAddRowBefore: i.addRowBefore(),
139
+ canDeleteColumn: i.deleteColumn(),
140
+ canDeleteRow: i.deleteRow(),
141
+ canDeleteTable: i.deleteTable(),
142
+ canToggleHeaderRow: i.toggleHeaderRow(),
143
+ hasHeaderRow: o,
144
+ canSetTableLayout: N && i.setTableLayout("auto"),
145
+ canSetTableHeightLimit: N && i.setTableHeightLimit(!0),
146
+ canSetTableMaxHeight: n.isEditable && F && i.setTableMaxHeight(null),
147
+ canSetTableStickyHeaderRow: n.isEditable && P && o && i.setTableStickyHeaderRow(!c),
148
+ tableLayout: r?.node.attrs.tableLayout ?? "auto",
149
+ limitHeight: s,
150
+ maxHeight: e(r?.node.attrs.maxHeight),
151
+ stickyHeaderRow: c
141
152
  };
142
153
  }
143
- }), D = l(({ editor: e, element: t, state: n, view: r }) => {
144
- let i = r.hasFocus() || t.contains(t.ownerDocument.activeElement);
145
- return T && e.isEditable && i && a(n) === "table";
146
- }, [T]), O = l(() => {
147
- if (v.isDestroyed) return null;
148
- let e = r(v.state);
154
+ }), L = f(({ editor: e, element: t, state: n, view: r }) => {
155
+ let i = O || A || r.hasFocus() || t.contains(t.ownerDocument.activeElement);
156
+ return M && e.isEditable && i && s(n) === "table";
157
+ }, [
158
+ M,
159
+ O,
160
+ A
161
+ ]), R = f(() => {
162
+ if (S.isDestroyed) return null;
163
+ let e = a(S.state);
149
164
  if (!e) return null;
150
- let t = v.view.nodeDOM(e.position);
165
+ let t = S.view.nodeDOM(e.position);
151
166
  return t instanceof HTMLElement ? t.closest(".tableWrapper") ?? t.querySelector(".tableWrapper") ?? t : null;
152
- }, [v]), k = l(() => t(v), [v]);
153
- u(() => {
154
- let e = v.view.dom.ownerDocument.defaultView;
167
+ }, [S]), z = f(() => r(S), [S]);
168
+ p(() => {
169
+ let e = S.view.dom.ownerDocument.defaultView;
155
170
  if (!e) return;
156
- let t = y(v.view.dom), n = null, r = () => {
171
+ let t = C(S.view.dom), n = null, r = () => {
157
172
  n === null && (n = e.requestAnimationFrame(() => {
158
- n = null, v.isDestroyed || v.view.dispatch(v.state.tr.setMeta(i, "updatePosition"));
173
+ n = null, S.isDestroyed || S.view.dispatch(S.state.tr.setMeta(o, "updatePosition"));
159
174
  }));
160
175
  };
161
176
  return t.forEach((e) => {
@@ -165,27 +180,27 @@ var g = [
165
180
  e.removeEventListener("scroll", r);
166
181
  });
167
182
  };
168
- }, [v]), u(() => {
169
- let e = v.view.dom.closest("[data-scribe-root]"), t = v.view.dom.ownerDocument.defaultView;
183
+ }, [S]), p(() => {
184
+ let e = S.view.dom.closest("[data-scribe-root]"), t = S.view.dom.ownerDocument.defaultView;
170
185
  if (!e || !t) return;
171
186
  let n = () => {
172
187
  let t = e.getBoundingClientRect().width;
173
- w(t > 0 ? Math.max(t - 16, 0) : null);
188
+ D(t > 0 ? Math.max(t - 16, 0) : null);
174
189
  };
175
190
  if (n(), !t.ResizeObserver) return;
176
191
  let r = new t.ResizeObserver(n);
177
192
  return r.observe(e), () => r.disconnect();
178
- }, [v]), u(() => {
179
- let e = v.view.dom, t = (e) => {
180
- if (e.key !== "F10" || !e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || !v.isEditable || a(v.state) !== "table") return;
181
- let t = S.current?.querySelector("button:not(:disabled)");
193
+ }, [S]), p(() => {
194
+ let e = S.view.dom, t = (e) => {
195
+ if (e.key !== "F10" || !e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || !S.isEditable || s(S.state) !== "table") return;
196
+ let t = T.current?.querySelector("button:not(:disabled)");
182
197
  t && (e.preventDefault(), t.focus());
183
198
  };
184
199
  return e.addEventListener("keydown", t, !0), () => e.removeEventListener("keydown", t, !0);
185
- }, [v]);
186
- let A = l((e) => {
200
+ }, [S]);
201
+ let B = f((e) => {
187
202
  if (e.key === "Escape") {
188
- e.preventDefault(), v.chain().focus().run();
203
+ e.preventDefault(), S.chain().focus().run();
189
204
  return;
190
205
  }
191
206
  if (![
@@ -198,109 +213,134 @@ var g = [
198
213
  if (t.length === 0) return;
199
214
  let n = e.currentTarget.ownerDocument.activeElement, r = t.findIndex((e) => e === n), i = r;
200
215
  i = e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : e.key === "ArrowLeft" ? r <= 0 ? t.length - 1 : r - 1 : r < 0 || r === t.length - 1 ? 0 : r + 1, e.preventDefault(), t[i]?.focus();
201
- }, [v]), j = d(() => ({
216
+ }, [S]), V = m(() => ({
202
217
  strategy: "fixed",
203
218
  placement: "top-start",
204
219
  offset: 8,
205
220
  flip: {},
206
221
  shift: { padding: 8 }
207
- }), []), M = d(() => [
222
+ }), []), H = m(() => [
208
223
  [
209
224
  {
210
225
  label: "Add row above",
211
- command: () => v.chain().focus().addRowBefore().run(),
212
- disabled: !E.canAddRowBefore,
213
- icon: /* @__PURE__ */ m(x, { name: "add-row-above" })
226
+ command: () => S.chain().focus().addRowBefore().run(),
227
+ disabled: !I.canAddRowBefore,
228
+ icon: /* @__PURE__ */ v(w, { name: "add-row-above" })
214
229
  },
215
230
  {
216
231
  label: "Add row below",
217
- command: () => v.chain().focus().addRowAfter().run(),
218
- disabled: !E.canAddRowAfter,
219
- icon: /* @__PURE__ */ m(x, { name: "add-row-below" })
232
+ command: () => S.chain().focus().addRowAfter().run(),
233
+ disabled: !I.canAddRowAfter,
234
+ icon: /* @__PURE__ */ v(w, { name: "add-row-below" })
220
235
  },
221
236
  {
222
237
  label: "Delete row",
223
- command: () => v.chain().focus().deleteRow().run(),
224
- disabled: !E.canDeleteRow,
225
- icon: /* @__PURE__ */ m(x, { name: "delete-row" })
238
+ command: () => S.chain().focus().deleteRow().run(),
239
+ disabled: !I.canDeleteRow,
240
+ icon: /* @__PURE__ */ v(w, { name: "delete-row" })
226
241
  }
227
242
  ],
228
243
  [
229
244
  {
230
245
  label: "Add column before",
231
- command: () => v.chain().focus().addColumnBefore().run(),
232
- disabled: !E.canAddColumnBefore,
233
- icon: /* @__PURE__ */ m(x, { name: "add-column-before" })
246
+ command: () => S.chain().focus().addColumnBefore().run(),
247
+ disabled: !I.canAddColumnBefore,
248
+ icon: /* @__PURE__ */ v(w, { name: "add-column-before" })
234
249
  },
235
250
  {
236
251
  label: "Add column after",
237
- command: () => v.chain().focus().addColumnAfter().run(),
238
- disabled: !E.canAddColumnAfter,
239
- icon: /* @__PURE__ */ m(x, { name: "add-column-after" })
252
+ command: () => S.chain().focus().addColumnAfter().run(),
253
+ disabled: !I.canAddColumnAfter,
254
+ icon: /* @__PURE__ */ v(w, { name: "add-column-after" })
240
255
  },
241
256
  {
242
257
  label: "Delete column",
243
- command: () => v.chain().focus().deleteColumn().run(),
244
- disabled: !E.canDeleteColumn,
245
- icon: /* @__PURE__ */ m(x, { name: "delete-column" })
258
+ command: () => S.chain().focus().deleteColumn().run(),
259
+ disabled: !I.canDeleteColumn,
260
+ icon: /* @__PURE__ */ v(w, { name: "delete-column" })
246
261
  }
247
262
  ],
248
263
  [{
249
264
  label: "Toggle header row",
250
- command: () => v.chain().focus().toggleHeaderRow().run(),
251
- disabled: !E.canToggleHeaderRow,
252
- icon: /* @__PURE__ */ m(x, { name: "toggle-header-row" }),
253
- ariaPressed: E.hasHeaderRow
265
+ command: () => S.chain().focus().toggleHeaderRow().run(),
266
+ disabled: !I.canToggleHeaderRow,
267
+ icon: /* @__PURE__ */ v(w, { name: "toggle-header-row" }),
268
+ ariaPressed: I.hasHeaderRow
254
269
  }],
255
270
  [{
256
271
  label: "Delete table",
257
- command: () => v.chain().focus().deleteTable().run(),
258
- disabled: !E.canDeleteTable,
259
- icon: /* @__PURE__ */ m(x, { name: "delete-table" })
272
+ command: () => S.chain().focus().deleteTable().run(),
273
+ disabled: !I.canDeleteTable,
274
+ icon: /* @__PURE__ */ v(w, { name: "delete-table" })
260
275
  }]
261
- ], [v, E]);
262
- return /* @__PURE__ */ m(n, {
263
- editor: v,
264
- pluginKey: i,
276
+ ], [S, I]);
277
+ return /* @__PURE__ */ v(i, {
278
+ editor: S,
279
+ pluginKey: o,
265
280
  updateDelay: 0,
266
281
  resizeDelay: 0,
267
- appendTo: k,
268
- shouldShow: D,
269
- getReferencedVirtualElement: O,
270
- options: j,
271
- children: /* @__PURE__ */ m(o, {
272
- ref: S,
282
+ appendTo: z,
283
+ shouldShow: L,
284
+ getReferencedVirtualElement: R,
285
+ options: V,
286
+ children: /* @__PURE__ */ v(l, {
287
+ ref: T,
273
288
  className: "scribe-table-bubble-menu",
274
289
  role: "toolbar",
275
290
  "aria-label": "Table controls",
276
291
  "aria-keyshortcuts": "Alt+F10",
277
292
  align: "center",
278
293
  gap: "2",
279
- onKeyDown: A,
280
- style: C === null ? void 0 : { maxWidth: C },
281
- children: M.map((e, t) => /* @__PURE__ */ h(o, {
294
+ onKeyDown: B,
295
+ style: E === null ? void 0 : { maxWidth: E },
296
+ children: H.map((e, t) => /* @__PURE__ */ y(l, {
282
297
  align: "center",
283
298
  gap: "1",
284
- children: [t > 0 ? /* @__PURE__ */ m(c, {
285
- orientation: "vertical",
286
- decorative: !0,
287
- style: { height: 20 }
288
- }) : null, e.map((e) => /* @__PURE__ */ m(s, {
289
- type: "button",
290
- size: "1",
291
- radius: "medium",
292
- color: e.label === "Delete table" ? "red" : "gray",
293
- variant: e.ariaPressed ? "soft" : "ghost",
294
- "aria-label": e.label,
295
- "aria-pressed": e.ariaPressed,
296
- disabled: e.disabled,
297
- title: e.label,
298
- onClick: e.command,
299
- children: e.icon
300
- }, e.label))]
299
+ children: [
300
+ t > 0 ? /* @__PURE__ */ v(d, {
301
+ orientation: "vertical",
302
+ decorative: !0,
303
+ style: { height: 20 }
304
+ }) : null,
305
+ t === H.length - 1 && N ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(c, {
306
+ editor: S,
307
+ layout: I.tableLayout,
308
+ limitHeight: I.limitHeight,
309
+ maxHeight: I.maxHeight,
310
+ stickyHeaderRow: I.stickyHeaderRow,
311
+ hasHeaderRow: I.hasHeaderRow,
312
+ canSetLayout: I.canSetTableLayout,
313
+ canSetHeightLimit: I.canSetTableHeightLimit,
314
+ hasMaxHeightCommand: F,
315
+ canSetMaxHeight: I.canSetTableMaxHeight,
316
+ hasStickyHeaderCommand: P,
317
+ canSetStickyHeaderRow: I.canSetTableStickyHeaderRow,
318
+ open: O,
319
+ onOpenChange: k,
320
+ heightSettingsOpen: A,
321
+ onHeightSettingsOpenChange: j
322
+ }), /* @__PURE__ */ v(d, {
323
+ orientation: "vertical",
324
+ decorative: !0,
325
+ style: { height: 20 }
326
+ })] }) : null,
327
+ e.map((e) => /* @__PURE__ */ v(u, {
328
+ type: "button",
329
+ size: "1",
330
+ radius: "medium",
331
+ color: e.label === "Delete table" ? "red" : "gray",
332
+ variant: e.ariaPressed ? "soft" : "ghost",
333
+ "aria-label": e.label,
334
+ "aria-pressed": e.ariaPressed,
335
+ disabled: e.disabled,
336
+ title: e.label,
337
+ onClick: e.command,
338
+ children: e.icon
339
+ }, e.label))
340
+ ]
301
341
  }, e[0]?.label))
302
342
  })
303
343
  });
304
344
  };
305
345
  //#endregion
306
- export { S as default };
346
+ export { T as default };
@@ -0,0 +1,11 @@
1
+ import { Editor } from "@tiptap/react";
2
+ import { FC } from "react";
3
+ interface TableHeightSettingsProps {
4
+ editor: Editor;
5
+ maxHeight: number | null;
6
+ canSetMaxHeight: boolean;
7
+ onClose: () => void;
8
+ }
9
+ declare const TableHeightSettings: FC<TableHeightSettingsProps>;
10
+ export default TableHeightSettings;
11
+ //# sourceMappingURL=TableHeightSettings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableHeightSettings.d.ts","sourceRoot":"","sources":["../../../lib/components/Menu/TableHeightSettings.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,EAAE,EAA+C,MAAM,OAAO,CAAC;AASxE,UAAU,wBAAwB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CAqNrD,CAAC;eAEa,mBAAmB"}