@clevertask/scribe 0.1.27 → 0.1.29

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 (57) hide show
  1. package/README.md +4 -2
  2. package/dist/{BarMenu-BGWT4Oyk.js → BarMenu-BC8XoC6e.js} +1 -1
  3. package/dist/assets/index.css +1 -1
  4. package/dist/components/Menu/BarMenu.js +1 -1
  5. package/dist/components/Menu/BubbleMenu.js +2 -2
  6. package/dist/components/Menu/CalloutBubbleMenu.js +2 -2
  7. package/dist/components/Menu/LinkBubbleMenu.js +2 -2
  8. package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
  9. package/dist/components/Menu/TableBubbleMenu.d.ts.map +1 -1
  10. package/dist/components/Menu/TableBubbleMenu.js +145 -132
  11. package/dist/components/Menu/TableHeightSettings.d.ts +11 -0
  12. package/dist/components/Menu/TableHeightSettings.d.ts.map +1 -0
  13. package/dist/components/Menu/TableHeightSettings.js +156 -0
  14. package/dist/components/Menu/TableLayoutOptions.d.ts +5 -0
  15. package/dist/components/Menu/TableLayoutOptions.d.ts.map +1 -1
  16. package/dist/components/Menu/TableLayoutOptions.js +56 -39
  17. package/dist/components/Menu/linkBubbleMenuPlugin.js +1 -1
  18. package/dist/components/Scribe/extension/callout.js +7 -7
  19. package/dist/components/Scribe/extension/emoji/suggest.js +1 -1
  20. package/dist/components/Scribe/extension/extension-link.js +1 -1
  21. package/dist/components/Scribe/extension/extension-markdown-paste.js +1 -1
  22. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  23. package/dist/components/Scribe/extension/external-link-preview/commands.js +1 -1
  24. package/dist/components/Scribe/extension/external-link-preview/index.js +1 -1
  25. package/dist/components/Scribe/extension/external-link-preview/node-view.js +1 -1
  26. package/dist/components/Scribe/extension/external-link-preview/render-html.js +1 -1
  27. package/dist/components/Scribe/extension/external-link-preview/schema.js +1 -1
  28. package/dist/components/Scribe/extension/index.js +1 -1
  29. package/dist/components/Scribe/extension/resizable-table.d.ts +1 -0
  30. package/dist/components/Scribe/extension/resizable-table.d.ts.map +1 -1
  31. package/dist/components/Scribe/extension/resizable-table.js +64 -43
  32. package/dist/components/Scribe/extension/slashCommand/index.js +2 -2
  33. package/dist/components/Scribe/extension/slashCommand/renderItems.js +1 -1
  34. package/dist/components/Scribe/extension/table-layout.d.ts +5 -0
  35. package/dist/components/Scribe/extension/table-layout.d.ts.map +1 -1
  36. package/dist/components/Scribe/extension/table-layout.js +2 -2
  37. package/dist/components/Scribe/extension/tableOfContents.js +1 -1
  38. package/dist/components/Scribe/index.js +4 -4
  39. package/dist/{dist-BiognBi4.js → dist-B0xwy1Q5.js} +175 -154
  40. package/dist/{dist-Dk0fXvrc.js → dist-CDJRm4fL.js} +2 -2
  41. package/dist/{dist-xjmWZ-oh.js → dist-DnVcys79.js} +632 -571
  42. package/dist/document-node-capabilities.d.ts.map +1 -1
  43. package/dist/document-node-capabilities.js +5 -1
  44. package/dist/{extension-CBOxOV0e.js → extension-BPeoqfHR.js} +2 -2
  45. package/dist/{extension-link-DmM_EJTn.js → extension-link-RvaqaDqr.js} +319 -294
  46. package/dist/{html-to-markdown-DZ83bZ9I.js → html-to-markdown-DF93it73.js} +1 -1
  47. package/dist/main.css +2 -1
  48. package/dist/main.js +1 -1
  49. package/dist/{menus-BDXjZsFU.js → menus-scgppp2C.js} +25 -25
  50. package/dist/{schema-extensions-BXyGPwMf.js → schema-extensions-ITR9LEgX.js} +2025 -1898
  51. package/dist/schema-extensions.js +1 -1
  52. package/dist/schema.js +1 -1
  53. package/dist/{table-layout-B3sPDpEF.js → table-layout-iVolql5p.js} +180 -121
  54. package/dist/utils/html-to-markdown.d.ts.map +1 -1
  55. package/dist/utils/html-to-markdown.js +1 -1
  56. package/dist/utils/index.js +3 -3
  57. package/package.json +51 -51
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../BarMenu-BGWT4Oyk.js";
1
+ import { t as e } from "../../BarMenu-BC8XoC6e.js";
2
2
  export { e as default };
@@ -1,6 +1,6 @@
1
- import { s as e } from "../../dist-BiognBi4.js";
1
+ import { s as e } from "../../dist-B0xwy1Q5.js";
2
2
  import { getPopupMountTarget as t } from "../Scribe/extension/getPopupMountTarget.js";
3
- import { t as n } from "../../menus-BDXjZsFU.js";
3
+ import { t as n } from "../../menus-scgppp2C.js";
4
4
  import { Flex as r, IconButton as i } from "@radix-ui/themes";
5
5
  import { useCallback as a } from "react";
6
6
  import { jsx as o } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  import { CALLOUT_VARIANTS as e, CALLOUT_VARIANT_LABELS as t, isCalloutVariant as n } from "../Scribe/extension/callout.js";
2
- import { s as r } from "../../dist-BiognBi4.js";
2
+ import { s as r } from "../../dist-B0xwy1Q5.js";
3
3
  import { getPopupMountTarget as i } from "../Scribe/extension/getPopupMountTarget.js";
4
- import { t as a } from "../../menus-BDXjZsFU.js";
4
+ import { t as a } from "../../menus-scgppp2C.js";
5
5
  import { CalloutIcon as o, RemoveCalloutIcon as s } from "../../icons/CalloutIcon.js";
6
6
  import { calloutBubbleMenuPluginKey as c, getSelectionCalloutContext as l } from "./calloutBubbleMenuPlugin.js";
7
7
  import { getSelectionContextualMenuOwner as u } from "./contextualMenuOwner.js";
@@ -1,9 +1,9 @@
1
1
  import { getExternalLinkPreviewHostname as e } from "../Scribe/extension/external-link-preview/attributes.js";
2
- import { s as t } from "../../dist-BiognBi4.js";
2
+ import { s as t } from "../../dist-B0xwy1Q5.js";
3
3
  import { getPopupMountTarget as n } from "../Scribe/extension/getPopupMountTarget.js";
4
4
  import r from "./LinkEditor.js";
5
5
  import { consumeLinkBubbleMenuFocusTarget as i, getPlainLinkContextAtPosition as a, getSelectionLinkContext as o, hideLinkBubbleMenu as s, linkBubbleMenuPluginKey as c, showLinkBubbleMenu as l } from "./linkBubbleMenuPlugin.js";
6
- import { t as u } from "../../menus-BDXjZsFU.js";
6
+ import { t as u } from "../../menus-scgppp2C.js";
7
7
  import { getSelectionContextualMenuOwner as d } from "./contextualMenuOwner.js";
8
8
  import { getExternalLinkPreviewResolutionStatus as f } from "../Scribe/extension/external-link-preview/resolver.js";
9
9
  import { Box as p } from "@radix-ui/themes";
@@ -1,4 +1,4 @@
1
- import { s as e } from "../../../dist-BiognBi4.js";
1
+ import { s as e } from "../../../dist-B0xwy1Q5.js";
2
2
  import { Button as t, Flex as n } from "@radix-ui/themes";
3
3
  import { useCallback as r } from "react";
4
4
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
@@ -1 +1 @@
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;AAsJD,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA4X7C,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,15 +1,15 @@
1
- import { o as e } from "../../table-layout-B3sPDpEF.js";
2
- import { s as t } from "../../dist-BiognBi4.js";
3
- import { getPopupMountTarget as n } from "../Scribe/extension/getPopupMountTarget.js";
4
- import { t as r } from "../../menus-BDXjZsFU.js";
5
- import { getSelectionTableContext as i, tableBubbleMenuPluginKey as a } from "./tableBubbleMenuPlugin.js";
6
- import { getSelectionContextualMenuOwner as o } from "./contextualMenuOwner.js";
7
- import s from "./TableLayoutOptions.js";
8
- import { Flex as c, IconButton as l, Separator as u } from "@radix-ui/themes";
9
- import { useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
10
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
1
+ import { c as e, u as t } from "../../table-layout-iVolql5p.js";
2
+ import { s as n } from "../../dist-B0xwy1Q5.js";
3
+ import { getPopupMountTarget as r } from "../Scribe/extension/getPopupMountTarget.js";
4
+ import { t as i } from "../../menus-scgppp2C.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";
11
11
  //#region lib/components/Menu/TableBubbleMenu.tsx
12
- var y = [
12
+ var b = [
13
13
  "addColumnAfter",
14
14
  "addColumnBefore",
15
15
  "addRowAfter",
@@ -18,7 +18,7 @@ var y = [
18
18
  "deleteRow",
19
19
  "deleteTable",
20
20
  "toggleHeaderRow"
21
- ], b = {
21
+ ], x = {
22
22
  canAddColumnAfter: !1,
23
23
  canAddColumnBefore: !1,
24
24
  canAddRowAfter: !1,
@@ -30,20 +30,22 @@ var y = [
30
30
  hasHeaderRow: !1,
31
31
  canSetTableLayout: !1,
32
32
  canSetTableHeightLimit: !1,
33
+ canSetTableMaxHeight: !1,
33
34
  canSetTableStickyHeaderRow: !1,
34
35
  tableLayout: "auto",
35
36
  limitHeight: !1,
37
+ maxHeight: null,
36
38
  stickyHeaderRow: !1
37
- }, x = /auto|overlay|scroll/, S = (e) => {
39
+ }, S = /auto|overlay|scroll/, C = (e) => {
38
40
  let t = e.ownerDocument.defaultView;
39
41
  if (!t) return [];
40
42
  let n = [], r = e.parentElement;
41
43
  for (; r && r !== e.ownerDocument.body && r !== e.ownerDocument.documentElement;) {
42
44
  let e = t.getComputedStyle(r);
43
- x.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;
44
46
  }
45
47
  return n;
46
- }, C = ({ name: e }) => {
48
+ }, w = ({ name: e }) => {
47
49
  let t = {
48
50
  "aria-hidden": !0,
49
51
  fill: "none",
@@ -58,12 +60,12 @@ var y = [
58
60
  };
59
61
  if (e === "add-row-above" || e === "add-row-below") {
60
62
  let r = e === "add-row-above" ? 3.5 : 16.5;
61
- return /* @__PURE__ */ v("svg", {
63
+ return /* @__PURE__ */ y("svg", {
62
64
  ...t,
63
- children: [/* @__PURE__ */ _("path", {
65
+ children: [/* @__PURE__ */ v("path", {
64
66
  d: "M3.5 6.5h13v7h-13zM3.5 10h13M10 6.5v7",
65
67
  ...n
66
- }), /* @__PURE__ */ _("path", {
68
+ }), /* @__PURE__ */ v("path", {
67
69
  d: `M7.75 ${r}h4.5M10 ${r - 2.25}v4.5`,
68
70
  ...n
69
71
  })]
@@ -71,98 +73,104 @@ var y = [
71
73
  }
72
74
  if (e === "add-column-before" || e === "add-column-after") {
73
75
  let r = e === "add-column-before" ? 3.5 : 16.5;
74
- return /* @__PURE__ */ v("svg", {
76
+ return /* @__PURE__ */ y("svg", {
75
77
  ...t,
76
- children: [/* @__PURE__ */ _("path", {
78
+ children: [/* @__PURE__ */ v("path", {
77
79
  d: "M6.5 3.5h7v13h-7zM10 3.5v13M6.5 10h7",
78
80
  ...n
79
- }), /* @__PURE__ */ _("path", {
81
+ }), /* @__PURE__ */ v("path", {
80
82
  d: `M${r - 2.25} 10h4.5M${r} 7.75v4.5`,
81
83
  ...n
82
84
  })]
83
85
  });
84
86
  }
85
- return e === "delete-row" ? /* @__PURE__ */ v("svg", {
87
+ return e === "delete-row" ? /* @__PURE__ */ y("svg", {
86
88
  ...t,
87
- children: [/* @__PURE__ */ _("path", {
89
+ children: [/* @__PURE__ */ v("path", {
88
90
  d: "M3.5 4h13v12h-13zM3.5 8h13M3.5 12h13M10 4v12",
89
91
  ...n
90
- }), /* @__PURE__ */ _("path", {
92
+ }), /* @__PURE__ */ v("path", {
91
93
  d: "M6.75 10h6.5",
92
94
  stroke: "currentColor",
93
95
  strokeWidth: "2.2"
94
96
  })]
95
- }) : e === "delete-column" ? /* @__PURE__ */ v("svg", {
97
+ }) : e === "delete-column" ? /* @__PURE__ */ y("svg", {
96
98
  ...t,
97
- children: [/* @__PURE__ */ _("path", {
99
+ children: [/* @__PURE__ */ v("path", {
98
100
  d: "M4 3.5h12v13h-12zM8 3.5v13M12 3.5v13M4 10h12",
99
101
  ...n
100
- }), /* @__PURE__ */ _("path", {
102
+ }), /* @__PURE__ */ v("path", {
101
103
  d: "M10 6.75v6.5",
102
104
  stroke: "currentColor",
103
105
  strokeWidth: "2.2"
104
106
  })]
105
- }) : e === "toggle-header-row" ? /* @__PURE__ */ v("svg", {
107
+ }) : e === "toggle-header-row" ? /* @__PURE__ */ y("svg", {
106
108
  ...t,
107
- children: [/* @__PURE__ */ _("path", {
109
+ children: [/* @__PURE__ */ v("path", {
108
110
  d: "M3.5 4h13v12h-13zM3.5 8h13M10 4v12",
109
111
  ...n
110
- }), /* @__PURE__ */ _("path", {
112
+ }), /* @__PURE__ */ v("path", {
111
113
  d: "M4.2 4.7h11.6v2.6H4.2z",
112
114
  fill: "currentColor",
113
115
  opacity: "0.45"
114
116
  })]
115
- }) : /* @__PURE__ */ v("svg", {
117
+ }) : /* @__PURE__ */ y("svg", {
116
118
  ...t,
117
- children: [/* @__PURE__ */ _("path", {
119
+ children: [/* @__PURE__ */ v("path", {
118
120
  d: "M3.5 4h13v12h-13zM3.5 8h13M10 4v12",
119
121
  ...n
120
- }), /* @__PURE__ */ _("path", {
122
+ }), /* @__PURE__ */ v("path", {
121
123
  d: "m6.75 7 6.5 6.5m0-6.5-6.5 6.5",
122
124
  stroke: "currentColor",
123
125
  strokeWidth: "1.8"
124
126
  })]
125
127
  });
126
- }, w = ({ editor: x }) => {
127
- let w = m(null), [T, E] = h(null), [D, O] = h(!1), k = p(() => y.every((e) => typeof x.commands[e] == "function"), [x]), A = p(() => typeof x.commands.setTableLayout == "function" && typeof x.commands.setTableHeightLimit == "function", [x]), j = p(() => typeof x.commands.setTableStickyHeaderRow == "function", [x]), M = t({
128
- editor: x,
129
- selector: ({ editor: t }) => {
130
- if (!k) return b;
131
- let n = i(t.state), r = t.can(), a = n ? e(n.node) : !1, o = n?.node.attrs.limitHeight === !0, s = n?.node.attrs.stickyHeaderRow === !0;
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;
132
134
  return {
133
- canAddColumnAfter: r.addColumnAfter(),
134
- canAddColumnBefore: r.addColumnBefore(),
135
- canAddRowAfter: r.addRowAfter(),
136
- canAddRowBefore: r.addRowBefore(),
137
- canDeleteColumn: r.deleteColumn(),
138
- canDeleteRow: r.deleteRow(),
139
- canDeleteTable: r.deleteTable(),
140
- canToggleHeaderRow: r.toggleHeaderRow(),
141
- hasHeaderRow: a,
142
- canSetTableLayout: A && r.setTableLayout("auto"),
143
- canSetTableHeightLimit: A && r.setTableHeightLimit(!0),
144
- canSetTableStickyHeaderRow: t.isEditable && j && a && r.setTableStickyHeaderRow(!s),
145
- tableLayout: n?.node.attrs.tableLayout ?? "auto",
146
- limitHeight: o,
147
- stickyHeaderRow: s
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
148
152
  };
149
153
  }
150
- }), N = d(({ editor: e, element: t, state: n, view: r }) => {
151
- let i = D || r.hasFocus() || t.contains(t.ownerDocument.activeElement);
152
- return k && e.isEditable && i && o(n) === "table";
153
- }, [k, D]), P = d(() => {
154
- if (x.isDestroyed) return null;
155
- let e = i(x.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);
156
164
  if (!e) return null;
157
- let t = x.view.nodeDOM(e.position);
165
+ let t = S.view.nodeDOM(e.position);
158
166
  return t instanceof HTMLElement ? t.closest(".tableWrapper") ?? t.querySelector(".tableWrapper") ?? t : null;
159
- }, [x]), F = d(() => n(x), [x]);
160
- f(() => {
161
- let e = x.view.dom.ownerDocument.defaultView;
167
+ }, [S]), z = f(() => r(S), [S]);
168
+ p(() => {
169
+ let e = S.view.dom.ownerDocument.defaultView;
162
170
  if (!e) return;
163
- let t = S(x.view.dom), n = null, r = () => {
171
+ let t = C(S.view.dom), n = null, r = () => {
164
172
  n === null && (n = e.requestAnimationFrame(() => {
165
- n = null, x.isDestroyed || x.view.dispatch(x.state.tr.setMeta(a, "updatePosition"));
173
+ n = null, S.isDestroyed || S.view.dispatch(S.state.tr.setMeta(o, "updatePosition"));
166
174
  }));
167
175
  };
168
176
  return t.forEach((e) => {
@@ -172,27 +180,27 @@ var y = [
172
180
  e.removeEventListener("scroll", r);
173
181
  });
174
182
  };
175
- }, [x]), f(() => {
176
- let e = x.view.dom.closest("[data-scribe-root]"), t = x.view.dom.ownerDocument.defaultView;
183
+ }, [S]), p(() => {
184
+ let e = S.view.dom.closest("[data-scribe-root]"), t = S.view.dom.ownerDocument.defaultView;
177
185
  if (!e || !t) return;
178
186
  let n = () => {
179
187
  let t = e.getBoundingClientRect().width;
180
- E(t > 0 ? Math.max(t - 16, 0) : null);
188
+ D(t > 0 ? Math.max(t - 16, 0) : null);
181
189
  };
182
190
  if (n(), !t.ResizeObserver) return;
183
191
  let r = new t.ResizeObserver(n);
184
192
  return r.observe(e), () => r.disconnect();
185
- }, [x]), f(() => {
186
- let e = x.view.dom, t = (e) => {
187
- if (e.key !== "F10" || !e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || !x.isEditable || o(x.state) !== "table") return;
188
- let t = w.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)");
189
197
  t && (e.preventDefault(), t.focus());
190
198
  };
191
199
  return e.addEventListener("keydown", t, !0), () => e.removeEventListener("keydown", t, !0);
192
- }, [x]);
193
- let I = d((e) => {
200
+ }, [S]);
201
+ let B = f((e) => {
194
202
  if (e.key === "Escape") {
195
- e.preventDefault(), x.chain().focus().run();
203
+ e.preventDefault(), S.chain().focus().run();
196
204
  return;
197
205
  }
198
206
  if (![
@@ -205,113 +213,118 @@ var y = [
205
213
  if (t.length === 0) return;
206
214
  let n = e.currentTarget.ownerDocument.activeElement, r = t.findIndex((e) => e === n), i = r;
207
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();
208
- }, [x]), L = p(() => ({
216
+ }, [S]), V = m(() => ({
209
217
  strategy: "fixed",
210
218
  placement: "top-start",
211
219
  offset: 8,
212
220
  flip: {},
213
221
  shift: { padding: 8 }
214
- }), []), R = p(() => [
222
+ }), []), H = m(() => [
215
223
  [
216
224
  {
217
225
  label: "Add row above",
218
- command: () => x.chain().focus().addRowBefore().run(),
219
- disabled: !M.canAddRowBefore,
220
- icon: /* @__PURE__ */ _(C, { name: "add-row-above" })
226
+ command: () => S.chain().focus().addRowBefore().run(),
227
+ disabled: !I.canAddRowBefore,
228
+ icon: /* @__PURE__ */ v(w, { name: "add-row-above" })
221
229
  },
222
230
  {
223
231
  label: "Add row below",
224
- command: () => x.chain().focus().addRowAfter().run(),
225
- disabled: !M.canAddRowAfter,
226
- icon: /* @__PURE__ */ _(C, { name: "add-row-below" })
232
+ command: () => S.chain().focus().addRowAfter().run(),
233
+ disabled: !I.canAddRowAfter,
234
+ icon: /* @__PURE__ */ v(w, { name: "add-row-below" })
227
235
  },
228
236
  {
229
237
  label: "Delete row",
230
- command: () => x.chain().focus().deleteRow().run(),
231
- disabled: !M.canDeleteRow,
232
- icon: /* @__PURE__ */ _(C, { name: "delete-row" })
238
+ command: () => S.chain().focus().deleteRow().run(),
239
+ disabled: !I.canDeleteRow,
240
+ icon: /* @__PURE__ */ v(w, { name: "delete-row" })
233
241
  }
234
242
  ],
235
243
  [
236
244
  {
237
245
  label: "Add column before",
238
- command: () => x.chain().focus().addColumnBefore().run(),
239
- disabled: !M.canAddColumnBefore,
240
- icon: /* @__PURE__ */ _(C, { name: "add-column-before" })
246
+ command: () => S.chain().focus().addColumnBefore().run(),
247
+ disabled: !I.canAddColumnBefore,
248
+ icon: /* @__PURE__ */ v(w, { name: "add-column-before" })
241
249
  },
242
250
  {
243
251
  label: "Add column after",
244
- command: () => x.chain().focus().addColumnAfter().run(),
245
- disabled: !M.canAddColumnAfter,
246
- icon: /* @__PURE__ */ _(C, { name: "add-column-after" })
252
+ command: () => S.chain().focus().addColumnAfter().run(),
253
+ disabled: !I.canAddColumnAfter,
254
+ icon: /* @__PURE__ */ v(w, { name: "add-column-after" })
247
255
  },
248
256
  {
249
257
  label: "Delete column",
250
- command: () => x.chain().focus().deleteColumn().run(),
251
- disabled: !M.canDeleteColumn,
252
- icon: /* @__PURE__ */ _(C, { name: "delete-column" })
258
+ command: () => S.chain().focus().deleteColumn().run(),
259
+ disabled: !I.canDeleteColumn,
260
+ icon: /* @__PURE__ */ v(w, { name: "delete-column" })
253
261
  }
254
262
  ],
255
263
  [{
256
264
  label: "Toggle header row",
257
- command: () => x.chain().focus().toggleHeaderRow().run(),
258
- disabled: !M.canToggleHeaderRow,
259
- icon: /* @__PURE__ */ _(C, { name: "toggle-header-row" }),
260
- ariaPressed: M.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
261
269
  }],
262
270
  [{
263
271
  label: "Delete table",
264
- command: () => x.chain().focus().deleteTable().run(),
265
- disabled: !M.canDeleteTable,
266
- icon: /* @__PURE__ */ _(C, { name: "delete-table" })
272
+ command: () => S.chain().focus().deleteTable().run(),
273
+ disabled: !I.canDeleteTable,
274
+ icon: /* @__PURE__ */ v(w, { name: "delete-table" })
267
275
  }]
268
- ], [x, M]);
269
- return /* @__PURE__ */ _(r, {
270
- editor: x,
271
- pluginKey: a,
276
+ ], [S, I]);
277
+ return /* @__PURE__ */ v(i, {
278
+ editor: S,
279
+ pluginKey: o,
272
280
  updateDelay: 0,
273
281
  resizeDelay: 0,
274
- appendTo: F,
275
- shouldShow: N,
276
- getReferencedVirtualElement: P,
277
- options: L,
278
- children: /* @__PURE__ */ _(c, {
279
- ref: w,
282
+ appendTo: z,
283
+ shouldShow: L,
284
+ getReferencedVirtualElement: R,
285
+ options: V,
286
+ children: /* @__PURE__ */ v(l, {
287
+ ref: T,
280
288
  className: "scribe-table-bubble-menu",
281
289
  role: "toolbar",
282
290
  "aria-label": "Table controls",
283
291
  "aria-keyshortcuts": "Alt+F10",
284
292
  align: "center",
285
293
  gap: "2",
286
- onKeyDown: I,
287
- style: T === null ? void 0 : { maxWidth: T },
288
- children: R.map((e, t) => /* @__PURE__ */ v(c, {
294
+ onKeyDown: B,
295
+ style: E === null ? void 0 : { maxWidth: E },
296
+ children: H.map((e, t) => /* @__PURE__ */ y(l, {
289
297
  align: "center",
290
298
  gap: "1",
291
299
  children: [
292
- t > 0 ? /* @__PURE__ */ _(u, {
300
+ t > 0 ? /* @__PURE__ */ v(d, {
293
301
  orientation: "vertical",
294
302
  decorative: !0,
295
303
  style: { height: 20 }
296
304
  }) : null,
297
- t === R.length - 1 && A ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(s, {
298
- editor: x,
299
- layout: M.tableLayout,
300
- limitHeight: M.limitHeight,
301
- stickyHeaderRow: M.stickyHeaderRow,
302
- hasHeaderRow: M.hasHeaderRow,
303
- canSetLayout: M.canSetTableLayout,
304
- canSetHeightLimit: M.canSetTableHeightLimit,
305
- hasStickyHeaderCommand: j,
306
- canSetStickyHeaderRow: M.canSetTableStickyHeaderRow,
307
- open: D,
308
- onOpenChange: O
309
- }), /* @__PURE__ */ _(u, {
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, {
310
323
  orientation: "vertical",
311
324
  decorative: !0,
312
325
  style: { height: 20 }
313
326
  })] }) : null,
314
- e.map((e) => /* @__PURE__ */ _(l, {
327
+ e.map((e) => /* @__PURE__ */ v(u, {
315
328
  type: "button",
316
329
  size: "1",
317
330
  radius: "medium",
@@ -330,4 +343,4 @@ var y = [
330
343
  });
331
344
  };
332
345
  //#endregion
333
- export { w 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"}