@clevertask/scribe 0.1.27 → 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 (31) hide show
  1. package/README.md +4 -2
  2. package/dist/components/Menu/TableBubbleMenu.d.ts.map +1 -1
  3. package/dist/components/Menu/TableBubbleMenu.js +145 -132
  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 +5 -0
  8. package/dist/components/Menu/TableLayoutOptions.d.ts.map +1 -1
  9. package/dist/components/Menu/TableLayoutOptions.js +56 -39
  10. package/dist/components/Scribe/extension/index.js +1 -1
  11. package/dist/components/Scribe/extension/resizable-table.d.ts +1 -0
  12. package/dist/components/Scribe/extension/resizable-table.d.ts.map +1 -1
  13. package/dist/components/Scribe/extension/resizable-table.js +63 -42
  14. package/dist/components/Scribe/extension/table-layout.d.ts +5 -0
  15. package/dist/components/Scribe/extension/table-layout.d.ts.map +1 -1
  16. package/dist/components/Scribe/extension/table-layout.js +2 -2
  17. package/dist/components/Scribe/index.js +2 -2
  18. package/dist/document-node-capabilities.d.ts.map +1 -1
  19. package/dist/document-node-capabilities.js +5 -1
  20. package/dist/{extension-CBOxOV0e.js → extension-BU2USLV1.js} +1 -1
  21. package/dist/{html-to-markdown-DZ83bZ9I.js → html-to-markdown-DF93it73.js} +1 -1
  22. package/dist/main.css +2 -1
  23. package/dist/main.js +1 -1
  24. package/dist/{schema-extensions-BXyGPwMf.js → schema-extensions-DyCk1Goa.js} +1 -1
  25. package/dist/schema-extensions.js +1 -1
  26. package/dist/schema.js +1 -1
  27. package/dist/{table-layout-B3sPDpEF.js → table-layout-BoDS50DR.js} +91 -83
  28. package/dist/utils/html-to-markdown.d.ts.map +1 -1
  29. package/dist/utils/html-to-markdown.js +1 -1
  30. package/dist/utils/index.js +2 -2
  31. package/package.json +1 -1
@@ -1,37 +1,37 @@
1
1
  import { I as e, _ as t, a as n, l as r, m as i, n as a } from "./dist-xjmWZ-oh.js";
2
2
  import { TextSelection as o } from "@tiptap/pm/state";
3
- import { CellSelection as s, addColumnAfter as c, addColumnBefore as l, addRowAfter as u, addRowBefore as d, columnResizing as f, deleteColumn as p, deleteRow as m, deleteTable as ee, fixTables as h, goToNextCell as g, mergeCells as _, setCellAttr as v, splitCell as y, tableEditing as te, toggleHeader as b, toggleHeaderCell as x } from "@tiptap/pm/tables";
3
+ import { CellSelection as s, addColumnAfter as c, addColumnBefore as l, addRowAfter as u, addRowBefore as d, columnResizing as f, deleteColumn as ee, deleteRow as p, deleteTable as m, fixTables as te, goToNextCell as h, mergeCells as g, setCellAttr as _, splitCell as v, tableEditing as y, toggleHeader as b, toggleHeaderCell as x } from "@tiptap/pm/tables";
4
4
  //#region node_modules/.pnpm/@tiptap+extension-table@3.31.3_@tiptap+core@3.31.3_@tiptap+pm@3.31.3__@tiptap+pm@3.31.3/node_modules/@tiptap/extension-table/dist/index.js
5
5
  function S(e) {
6
6
  return e === "left" || e === "right" || e === "center" ? e : null;
7
7
  }
8
- function C(e) {
8
+ function ne(e) {
9
9
  let t = (e.style.textAlign || "").trim().toLowerCase(), n = (e.getAttribute("align") || "").trim().toLowerCase();
10
10
  return S(t || n);
11
11
  }
12
- function w(e) {
12
+ function C(e) {
13
13
  return S(e?.align);
14
14
  }
15
- function T() {
15
+ function w() {
16
16
  return {
17
17
  default: null,
18
- parseHTML: (e) => C(e),
18
+ parseHTML: (e) => ne(e),
19
19
  renderHTML: (e) => e.align ? { style: `text-align: ${e.align}` } : {}
20
20
  };
21
21
  }
22
- function E(e) {
22
+ function T(e) {
23
23
  let t = e.parentElement, n = e.closest("table");
24
24
  if (!t || !n) return null;
25
25
  let r = Array.from(t.children).indexOf(e), i = n.querySelectorAll("colgroup > col")[r]?.getAttribute("width");
26
26
  return i ? [parseInt(i, 10)] : null;
27
27
  }
28
- function D(e) {
28
+ function E(e) {
29
29
  let t = e.getAttribute("colwidth");
30
- return t ? t.split(",").map((e) => parseInt(e, 10)) : E(e);
30
+ return t ? t.split(",").map((e) => parseInt(e, 10)) : T(e);
31
31
  }
32
- var ne = /[ \t\r\n\f]+/g;
32
+ var D = /[ \t\r\n\f]+/g;
33
33
  function O(e) {
34
- return e.children.length > 0 ? !1 : (e.textContent ?? "").replace(ne, "") === "";
34
+ return e.children.length > 0 ? !1 : (e.textContent ?? "").replace(D, "") === "";
35
35
  }
36
36
  function k(e) {
37
37
  let t = e.createAndFill();
@@ -50,9 +50,9 @@ var re = n.create({
50
50
  rowspan: { default: 1 },
51
51
  colwidth: {
52
52
  default: null,
53
- parseHTML: D
53
+ parseHTML: E
54
54
  },
55
- align: T()
55
+ align: w()
56
56
  };
57
57
  },
58
58
  tableRole: "cell",
@@ -71,7 +71,7 @@ var re = n.create({
71
71
  0
72
72
  ];
73
73
  }
74
- }), A = n.create({
74
+ }), ie = n.create({
75
75
  name: "tableHeader",
76
76
  addOptions() {
77
77
  return { HTMLAttributes: {} };
@@ -83,9 +83,9 @@ var re = n.create({
83
83
  rowspan: { default: 1 },
84
84
  colwidth: {
85
85
  default: null,
86
- parseHTML: D
86
+ parseHTML: E
87
87
  },
88
- align: T()
88
+ align: w()
89
89
  };
90
90
  },
91
91
  tableRole: "header_cell",
@@ -104,7 +104,7 @@ var re = n.create({
104
104
  0
105
105
  ];
106
106
  }
107
- }), j = n.create({
107
+ }), A = n.create({
108
108
  name: "tableRow",
109
109
  addOptions() {
110
110
  return { HTMLAttributes: {} };
@@ -122,10 +122,10 @@ var re = n.create({
122
122
  ];
123
123
  }
124
124
  });
125
- function M(e, t) {
125
+ function j(e, t) {
126
126
  return t ? ["width", `${Math.max(t, e)}px`] : ["min-width", `${e}px`];
127
127
  }
128
- function N(e, t, n, r, i, a) {
128
+ function M(e, t, n, r, i, a) {
129
129
  let o = 0, s = !0, c = t.firstChild, l = e.firstChild;
130
130
  if (l !== null) for (let e = 0, n = 0; e < l.childCount; e += 1) {
131
131
  let { colspan: u, colwidth: d } = l.child(e).attrs;
@@ -133,12 +133,12 @@ function N(e, t, n, r, i, a) {
133
133
  let l = i === n ? a : d && d[e], u = l ? `${l}px` : "";
134
134
  if (o += l || r, l || (s = !1), c) {
135
135
  if (c.style.width !== u) {
136
- let [e, t] = M(r, l);
136
+ let [e, t] = j(r, l);
137
137
  c.style.setProperty(e, t);
138
138
  }
139
139
  c = c.nextSibling;
140
140
  } else {
141
- let e = document.createElement("col"), [n, i] = M(r, l);
141
+ let e = document.createElement("col"), [n, i] = j(r, l);
142
142
  e.style.setProperty(n, i), t.appendChild(e);
143
143
  }
144
144
  }
@@ -151,21 +151,21 @@ function N(e, t, n, r, i, a) {
151
151
  let d = e.attrs.style && typeof e.attrs.style == "string" && /\bwidth\s*:/i.test(e.attrs.style);
152
152
  s && !d ? (n.style.width = `${o}px`, n.style.minWidth = "") : (n.style.width = "", n.style.minWidth = `${o}px`);
153
153
  }
154
- var P = class {
154
+ var N = class {
155
155
  constructor(e, t, n, r = {}) {
156
156
  this.node = e, this.cellMinWidth = t, this.dom = document.createElement("div"), this.dom.className = "tableWrapper", this.table = this.dom.appendChild(document.createElement("table"));
157
157
  for (let [e, t] of Object.entries(r)) t != null && (e === "style" ? this.table.style.cssText = String(t) : this.table.setAttribute(e, String(t)));
158
- e.attrs.style && (this.table.style.cssText = e.attrs.style), this.colgroup = this.table.appendChild(document.createElement("colgroup")), N(e, this.colgroup, this.table, t), this.contentDOM = this.table.appendChild(document.createElement("tbody"));
158
+ e.attrs.style && (this.table.style.cssText = e.attrs.style), this.colgroup = this.table.appendChild(document.createElement("colgroup")), M(e, this.colgroup, this.table, t), this.contentDOM = this.table.appendChild(document.createElement("tbody"));
159
159
  }
160
160
  update(e) {
161
- return e.type === this.node.type && (this.node = e, N(e, this.colgroup, this.table, this.cellMinWidth), !0);
161
+ return e.type === this.node.type && (this.node = e, M(e, this.colgroup, this.table, this.cellMinWidth), !0);
162
162
  }
163
163
  ignoreMutation(e) {
164
164
  let t = e.target, n = this.dom.contains(t), r = this.contentDOM.contains(t);
165
165
  return !(!n || r || e.type !== "attributes" && e.type !== "childList" && e.type !== "characterData");
166
166
  }
167
167
  };
168
- function F(e, t, n, r) {
168
+ function P(e, t, n, r) {
169
169
  let i = 0, a = !0, o = [], s = e.firstChild;
170
170
  if (!s) return {};
171
171
  for (let e = 0, c = 0; e < s.childCount; e += 1) {
@@ -173,7 +173,7 @@ function F(e, t, n, r) {
173
173
  for (let e = 0; e < l; e += 1, c += 1) {
174
174
  let s = n === c ? r : u && u[e];
175
175
  i += s || t, s || (a = !1);
176
- let [l, d] = M(t, s);
176
+ let [l, d] = j(t, s);
177
177
  o.push(["col", { style: `${l}: ${d}` }]);
178
178
  }
179
179
  }
@@ -188,10 +188,10 @@ function F(e, t, n, r) {
188
188
  tableMinWidth: l
189
189
  };
190
190
  }
191
- function I(e, t) {
191
+ function F(e, t) {
192
192
  return t ? e.createChecked(null, t) : e.createAndFill();
193
193
  }
194
- function L(e) {
194
+ function I(e) {
195
195
  if (e.cached.tableNodeTypes) return e.cached.tableNodeTypes;
196
196
  let t = {};
197
197
  return Object.keys(e.nodes).forEach((n) => {
@@ -199,12 +199,12 @@ function L(e) {
199
199
  r.spec.tableRole && (t[r.spec.tableRole] = r);
200
200
  }), e.cached.tableNodeTypes = t, t;
201
201
  }
202
- function R(e, t, n, r, i) {
203
- let a = L(e), o = [], s = [];
202
+ function L(e, t, n, r, i) {
203
+ let a = I(e), o = [], s = [];
204
204
  for (let e = 0; e < n; e += 1) {
205
- let e = I(a.cell, i);
205
+ let e = F(a.cell, i);
206
206
  if (e && s.push(e), r) {
207
- let e = I(a.header_cell, i);
207
+ let e = F(a.header_cell, i);
208
208
  e && o.push(e);
209
209
  }
210
210
  }
@@ -212,19 +212,19 @@ function R(e, t, n, r, i) {
212
212
  for (let e = 0; e < t; e += 1) c.push(a.row.createChecked(null, r && e === 0 ? o : s));
213
213
  return a.table.createChecked(null, c);
214
214
  }
215
- function z(e) {
215
+ function R(e) {
216
216
  return e instanceof s;
217
217
  }
218
- var B = ({ editor: e }) => {
218
+ var z = ({ editor: e }) => {
219
219
  let { selection: t } = e.state;
220
- if (!z(t)) return !1;
220
+ if (!R(t)) return !1;
221
221
  let n = 0;
222
222
  return i(t.ranges[0].$from, (e) => e.type.name === "table")?.node.descendants((e) => {
223
223
  if (e.type.name === "table") return !1;
224
224
  ["tableCell", "tableHeader"].includes(e.type.name) && (n += 1);
225
225
  }), n === t.ranges.length && (e.commands.deleteTable(), !0);
226
226
  };
227
- function V(e, t) {
227
+ function B(e, t) {
228
228
  let n = e.mapping.map(t);
229
229
  if (i(e.selection.$from, (e) => e.type.name === "table")?.pos === n) return;
230
230
  let r = e.doc.nodeAt(n);
@@ -232,7 +232,7 @@ function V(e, t) {
232
232
  let a = n + r.nodeSize - 1;
233
233
  e.setSelection(o.near(e.doc.resolve(a), -1));
234
234
  }
235
- function H(e) {
235
+ function V(e) {
236
236
  let t = "", n = 0;
237
237
  for (; n < e.length;) {
238
238
  if (e[n] === "\\" && n + 1 < e.length) {
@@ -264,13 +264,13 @@ function H(e) {
264
264
  }
265
265
  return t;
266
266
  }
267
- function U(e) {
268
- return e.split("\n").map((e) => !e.includes("|") || !e.includes("`") ? e : H(e)).join("\n");
267
+ function H(e) {
268
+ return e.split("\n").map((e) => !e.includes("|") || !e.includes("`") ? e : V(e)).join("\n");
269
269
  }
270
- function W(e) {
270
+ function U(e) {
271
271
  return (e || "").replace(/\s+/g, " ").trim();
272
272
  }
273
- function G(e, t, n = {}) {
273
+ function W(e, t, n = {}) {
274
274
  let r = n.cellLineSeparator ?? "";
275
275
  if (!e || !e.content || e.content.length === 0) return "";
276
276
  let i = [];
@@ -279,7 +279,7 @@ function G(e, t, n = {}) {
279
279
  e.content && e.content.forEach((e) => {
280
280
  let i = "";
281
281
  i = e.content && Array.isArray(e.content) && e.content.length > 1 ? e.content.map((e) => t.renderChildren(e)).join(r) : e.content ? t.renderChildren(e.content) : "";
282
- let a = W(i.split(r).join("\n").replace(/[ \t]*\r?\n[ \t]*/g, "<br>")), o = e.type === "tableHeader", s = w(e.attrs);
282
+ let a = U(i.split(r).join("\n").replace(/[ \t]*\r?\n[ \t]*/g, "<br>")), o = e.type === "tableHeader", s = C(e.attrs);
283
283
  n.push({
284
284
  text: a,
285
285
  isHeader: o,
@@ -308,7 +308,7 @@ function G(e, t, n = {}) {
308
308
  d += `| ${Array.from({ length: a }).fill(0).map((t, n) => s(e[n] && e[n].text || "", o[n])).join(" | ")} |\n`;
309
309
  }), d;
310
310
  }
311
- var K = n.create({
311
+ var G = n.create({
312
312
  name: "table",
313
313
  addOptions() {
314
314
  return {
@@ -317,7 +317,7 @@ var K = n.create({
317
317
  renderWrapper: !1,
318
318
  handleWidth: 5,
319
319
  cellMinWidth: 25,
320
- View: P,
320
+ View: N,
321
321
  lastColumnResizable: !0,
322
322
  allowTableNodeSelection: !1
323
323
  };
@@ -330,7 +330,7 @@ var K = n.create({
330
330
  return [{ tag: "table" }];
331
331
  },
332
332
  renderHTML({ node: t, HTMLAttributes: n }) {
333
- let { colgroup: r, tableWidth: i, tableMinWidth: a } = F(t, this.options.cellMinWidth), o = n.style;
333
+ let { colgroup: r, tableWidth: i, tableMinWidth: a } = P(t, this.options.cellMinWidth), o = n.style;
334
334
  function s() {
335
335
  return o || (i ? `width: ${i}` : `min-width: ${a}`);
336
336
  }
@@ -369,7 +369,7 @@ var K = n.create({
369
369
  }), n.push(t.createNode("tableRow", {}, i));
370
370
  }), t.createNode("table", void 0, n);
371
371
  },
372
- renderMarkdown: (e, t) => G(e, t),
372
+ renderMarkdown: (e, t) => W(e, t),
373
373
  markdownTokenizer: {
374
374
  name: "table",
375
375
  level: "block",
@@ -384,7 +384,7 @@ var K = n.create({
384
384
  if (a.length < 2) return;
385
385
  let o = a[1];
386
386
  if (!/^[ \t|:]*-[ \t|:-]*$/.test(o) || !o.includes("|")) return;
387
- let s = U(i);
387
+ let s = H(i);
388
388
  if (s === i) return;
389
389
  let c = n.blockTokens(s)[0];
390
390
  if (c?.type !== "table" || !c.raw) return;
@@ -398,7 +398,7 @@ var K = n.create({
398
398
  addCommands() {
399
399
  return {
400
400
  insertTable: ({ rows: e = 3, cols: t = 3, withHeaderRow: n = !0 } = {}) => ({ tr: r, dispatch: i, editor: a }) => {
401
- let s = R(a.schema, e, t, n);
401
+ let s = L(a.schema, e, t, n);
402
402
  if (i) {
403
403
  let e = r.selection.from + 1;
404
404
  r.replaceSelectionWith(s).scrollIntoView().setSelection(o.near(r.doc.resolve(e)));
@@ -409,29 +409,29 @@ var K = n.create({
409
409
  addColumnAfter: () => ({ state: e, dispatch: t }) => c(e, t),
410
410
  deleteColumn: () => ({ state: e, dispatch: t }) => {
411
411
  let n = i(e.selection.$from, (e) => e.type.name === "table");
412
- return p(e, t && ((e) => {
413
- n && V(e, n.pos), t(e);
412
+ return ee(e, t && ((e) => {
413
+ n && B(e, n.pos), t(e);
414
414
  }));
415
415
  },
416
416
  addRowBefore: () => ({ state: e, dispatch: t }) => d(e, t),
417
417
  addRowAfter: () => ({ state: e, dispatch: t }) => u(e, t),
418
418
  deleteRow: () => ({ state: e, dispatch: t }) => {
419
419
  let n = i(e.selection.$from, (e) => e.type.name === "table");
420
- return m(e, t && ((e) => {
421
- n && V(e, n.pos), t(e);
420
+ return p(e, t && ((e) => {
421
+ n && B(e, n.pos), t(e);
422
422
  }));
423
423
  },
424
- deleteTable: () => ({ state: e, dispatch: t }) => ee(e, t),
425
- mergeCells: () => ({ state: e, dispatch: t }) => _(e, t),
426
- splitCell: () => ({ state: e, dispatch: t }) => y(e, t),
424
+ deleteTable: () => ({ state: e, dispatch: t }) => m(e, t),
425
+ mergeCells: () => ({ state: e, dispatch: t }) => g(e, t),
426
+ splitCell: () => ({ state: e, dispatch: t }) => v(e, t),
427
427
  toggleHeaderColumn: () => ({ state: e, dispatch: t }) => b("column")(e, t),
428
428
  toggleHeaderRow: () => ({ state: e, dispatch: t }) => b("row")(e, t),
429
429
  toggleHeaderCell: () => ({ state: e, dispatch: t }) => x(e, t),
430
- mergeOrSplit: () => ({ state: e, dispatch: t }) => _(e, t) ? !0 : y(e, t),
431
- setCellAttribute: (e, t) => ({ state: n, dispatch: r }) => v(e, t)(n, r),
432
- goToNextCell: () => ({ state: e, dispatch: t }) => g(1)(e, t),
433
- goToPreviousCell: () => ({ state: e, dispatch: t }) => g(-1)(e, t),
434
- fixTables: () => ({ state: e, dispatch: t }) => (t && h(e), !0),
430
+ mergeOrSplit: () => ({ state: e, dispatch: t }) => g(e, t) ? !0 : v(e, t),
431
+ setCellAttribute: (e, t) => ({ state: n, dispatch: r }) => _(e, t)(n, r),
432
+ goToNextCell: () => ({ state: e, dispatch: t }) => h(1)(e, t),
433
+ goToPreviousCell: () => ({ state: e, dispatch: t }) => h(-1)(e, t),
434
+ fixTables: () => ({ state: e, dispatch: t }) => (t && te(e), !0),
435
435
  setCellSelection: (e) => ({ tr: t, dispatch: n }) => {
436
436
  if (n) {
437
437
  let n = s.create(t.doc, e.anchorCell, e.headCell);
@@ -445,10 +445,10 @@ var K = n.create({
445
445
  return {
446
446
  Tab: () => this.editor.commands.goToNextCell() ? !0 : this.editor.can().addRowAfter() ? this.editor.chain().addRowAfter().goToNextCell().run() : !1,
447
447
  "Shift-Tab": () => this.editor.commands.goToPreviousCell(),
448
- Backspace: B,
449
- "Mod-Backspace": B,
450
- Delete: B,
451
- "Mod-Delete": B
448
+ Backspace: z,
449
+ "Mod-Backspace": z,
450
+ Delete: z,
451
+ "Mod-Delete": z
452
452
  };
453
453
  },
454
454
  addProseMirrorPlugins() {
@@ -458,7 +458,7 @@ var K = n.create({
458
458
  defaultCellMinWidth: this.options.cellMinWidth,
459
459
  View: this.options.View,
460
460
  lastColumnResizable: this.options.lastColumnResizable
461
- })] : [], te({ allowTableNodeSelection: this.options.allowTableNodeSelection })];
461
+ })] : [], y({ allowTableNodeSelection: this.options.allowTableNodeSelection })];
462
462
  },
463
463
  addNodeView() {
464
464
  let t = this.options.resizable && this.editor.isEditable, n = this.options.View;
@@ -475,29 +475,36 @@ var K = n.create({
475
475
  };
476
476
  return { tableRole: r(t(e, "tableRole", n)) };
477
477
  }
478
- }), q = a.create({
478
+ }), K = a.create({
479
479
  name: "tableKit",
480
480
  addExtensions() {
481
481
  let e = [];
482
- return this.options.table !== !1 && e.push(K.configure(this.options.table)), this.options.tableCell !== !1 && e.push(re.configure(this.options.tableCell)), this.options.tableHeader !== !1 && e.push(A.configure(this.options.tableHeader)), this.options.tableRow !== !1 && e.push(j.configure(this.options.tableRow)), e;
482
+ return this.options.table !== !1 && e.push(G.configure(this.options.table)), this.options.tableCell !== !1 && e.push(re.configure(this.options.tableCell)), this.options.tableHeader !== !1 && e.push(ie.configure(this.options.tableHeader)), this.options.tableRow !== !1 && e.push(A.configure(this.options.tableRow)), e;
483
483
  }
484
- }), J = [
484
+ }), q = [
485
485
  "auto",
486
486
  "fit",
487
487
  "scroll"
488
- ], Y = 128, X = (e) => e === "fit" || e === "scroll" ? e : "auto", Z = (e) => {
488
+ ], J = 128, ae = 120, oe = 2e3, se = 360, Y = (e) => {
489
+ let t = typeof e == "string" && /^\d+$/.test(e) ? Number(e) : e;
490
+ return typeof t == "number" && Number.isInteger(t) && t >= 120 && t <= 2e3 ? t : null;
491
+ }, X = (e) => e === "fit" || e === "scroll" ? e : "auto", Z = (e) => {
489
492
  let t = e.firstChild;
490
493
  if (!t || t.childCount === 0) return !1;
491
494
  let n = !0;
492
495
  return t.forEach((e) => {
493
496
  e.type.spec.tableRole !== "header_cell" && (n = !1);
494
497
  }), n;
495
- }, Q = (e) => e.attrs.stickyHeaderRow === !0 && Z(e), $ = (e) => ({
496
- "data-table-layout": X(e.attrs.tableLayout),
497
- "data-table-limit-height": e.attrs.limitHeight === !0 ? "true" : "false",
498
- "data-table-sticky-header-row": e.attrs.stickyHeaderRow === !0 ? "true" : "false",
499
- "data-table-sticky-header-active": Q(e) ? "true" : "false"
500
- }), ie = (e, t) => {
498
+ }, Q = (e) => e.attrs.stickyHeaderRow === !0 && Z(e), $ = (e) => {
499
+ let t = Y(e.attrs.maxHeight);
500
+ return {
501
+ "data-table-layout": X(e.attrs.tableLayout),
502
+ "data-table-limit-height": e.attrs.limitHeight === !0 ? "true" : "false",
503
+ "data-table-sticky-header-row": e.attrs.stickyHeaderRow === !0 ? "true" : "false",
504
+ "data-table-sticky-header-active": Q(e) ? "true" : "false",
505
+ ...t === null ? {} : { "data-table-max-height": String(t) }
506
+ };
507
+ }, ce = (e, t) => {
501
508
  let n = 0, r = [];
502
509
  return e.firstChild?.forEach((e) => {
503
510
  for (let i = 0; i < e.attrs.colspan; i++) {
@@ -512,7 +519,7 @@ var K = n.create({
512
519
  ...r
513
520
  ]
514
521
  };
515
- }, ae = class extends P {
522
+ }, le = class extends N {
516
523
  constructor(e, t, n) {
517
524
  super(e, t, n), this.applyLayout();
518
525
  }
@@ -520,17 +527,18 @@ var K = n.create({
520
527
  return super.update(e) ? (this.applyLayout(), !0) : !1;
521
528
  }
522
529
  applyLayout() {
523
- let e = X(this.node.attrs.tableLayout);
530
+ let e = X(this.node.attrs.tableLayout), t = Y(this.node.attrs.maxHeight);
531
+ t === null ? (this.dom.removeAttribute("data-table-max-height"), this.table.removeAttribute("data-table-max-height"), this.dom.style.removeProperty("--scribe-table-custom-max-height")) : this.dom.style.setProperty("--scribe-table-custom-max-height", `${t}px`);
524
532
  for (let [e, t] of Object.entries($(this.node))) this.dom.setAttribute(e, t), this.table.setAttribute(e, t);
525
533
  (!Q(this.node) || this.node.attrs.limitHeight === !0) && this.dom.style.removeProperty("--scribe-table-sticky-header-top");
526
- let t = 0, n = 0;
527
- this.node.firstChild?.forEach((r) => {
528
- for (let i = 0; i < r.attrs.colspan; i++, t++) {
529
- let a = r.attrs.colwidth?.[i], o = e === "scroll" ? 128 : this.cellMinWidth, s = this.colgroup.children[t];
530
- s && (s.style.width = a ? `${Math.max(a, this.cellMinWidth)}px` : "", s.style.minWidth = a ? "" : `${o}px`, n += a ? Math.max(a, this.cellMinWidth) : o);
534
+ let n = 0, r = 0;
535
+ this.node.firstChild?.forEach((t) => {
536
+ for (let i = 0; i < t.attrs.colspan; i++, n++) {
537
+ let a = t.attrs.colwidth?.[i], o = e === "scroll" ? 128 : this.cellMinWidth, s = this.colgroup.children[n];
538
+ s && (s.style.width = a ? `${Math.max(a, this.cellMinWidth)}px` : "", s.style.minWidth = a ? "" : `${o}px`, r += a ? Math.max(a, this.cellMinWidth) : o);
531
539
  }
532
- }), e === "scroll" && (this.table.style.width = `${n}px`, this.table.style.minWidth = `${n}px`);
540
+ }), e === "scroll" && (this.table.style.width = `${r}px`, this.table.style.minWidth = `${r}px`);
533
541
  }
534
542
  };
535
543
  //#endregion
536
- export { ie as a, $ as c, X as i, K as l, Y as n, Z as o, ae as r, Q as s, J as t, q as u };
544
+ export { J as a, Y as c, Q as d, $ as f, q as i, ce as l, K as m, oe as n, le as o, G as p, ae as r, X as s, se as t, Z as u };
@@ -1 +1 @@
1
- {"version":3,"file":"html-to-markdown.d.ts","sourceRoot":"","sources":["../../lib/utils/html-to-markdown.ts"],"names":[],"mappings":"AA2XA,eAAO,MAAM,OAAO,SAAU,MAAM,WA6CnC,CAAC"}
1
+ {"version":3,"file":"html-to-markdown.d.ts","sourceRoot":"","sources":["../../lib/utils/html-to-markdown.ts"],"names":[],"mappings":"AA4XA,eAAO,MAAM,OAAO,SAAU,MAAM,WA6CnC,CAAC"}
@@ -1,2 +1,2 @@
1
- import { t as e } from "../html-to-markdown-DZ83bZ9I.js";
1
+ import { t as e } from "../html-to-markdown-DF93it73.js";
2
2
  export { e as html2md };
@@ -1,9 +1,9 @@
1
1
  import { t as e } from "../dist-xjmWZ-oh.js";
2
- import { t } from "../html-to-markdown-DZ83bZ9I.js";
2
+ import { t } from "../html-to-markdown-DF93it73.js";
3
3
  import { t as n } from "../markdown-to-html-BoK5O_j-.js";
4
4
  import { isInViewport as r } from "./is-in-viewport.js";
5
5
  import { convertLegacyMathDelimiters as i } from "./convert-legacy-math-delimiters.js";
6
- import { t as a } from "../extension-CBOxOV0e.js";
6
+ import { t as a } from "../extension-BU2USLV1.js";
7
7
  //#region lib/utils/create-scribe-editor.ts
8
8
  function o({ content: n = "", editable: r = !1, enableUndoRedo: i, externalLinkPreview: o, onContentChange: s }) {
9
9
  return new e({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clevertask/scribe",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "private": false,
5
5
  "description": "A Radix-based Tiptap rich text editor with a Notion-style block interface for viewing and creating content. Perfect for diverse needs like notes, documents, AI chat, Markdown parsing, and comments.",
6
6
  "keywords": [