@clevertask/scribe 0.1.30 → 0.1.31

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 (52) hide show
  1. package/README.md +5 -2
  2. package/dist/{BarMenu-Bban-B3t.js → BarMenu-Bm5IfWVV.js} +1 -1
  3. package/dist/components/Menu/BarMenu.js +1 -2
  4. package/dist/components/Menu/BubbleMenu.js +2 -2
  5. package/dist/components/Menu/CalloutBubbleMenu.js +2 -2
  6. package/dist/components/Menu/LinkBubbleMenu.d.ts.map +1 -1
  7. package/dist/components/Menu/LinkBubbleMenu.js +70 -48
  8. package/dist/components/Menu/LinkEditor.js +4 -12
  9. package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
  10. package/dist/components/Menu/TableBubbleMenu.js +3 -3
  11. package/dist/components/Menu/TableHeightSettings.js +3 -11
  12. package/dist/components/Menu/TableLayoutOptions.js +1 -5
  13. package/dist/components/Menu/linkBubbleMenuPlugin.js +1 -1
  14. package/dist/components/Scribe/extension/callout.js +1 -1
  15. package/dist/components/Scribe/extension/emoji/suggest.js +2 -2
  16. package/dist/components/Scribe/extension/extension-link.js +1 -2
  17. package/dist/components/Scribe/extension/extension-markdown-paste.js +2 -2
  18. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  19. package/dist/components/Scribe/extension/external-link-preview/commands.js +2 -2
  20. package/dist/components/Scribe/extension/external-link-preview/render-html.js +1 -1
  21. package/dist/components/Scribe/extension/external-link-preview/schema.js +1 -1
  22. package/dist/components/Scribe/extension/external-link-preview/serialization.js +1 -7
  23. package/dist/components/Scribe/extension/index.js +1 -2
  24. package/dist/components/Scribe/extension/resizable-table.js +2 -2
  25. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +10 -14
  26. package/dist/components/Scribe/extension/slashCommand/index.js +2 -2
  27. package/dist/components/Scribe/extension/slashCommand/renderItems.js +2 -2
  28. package/dist/components/Scribe/extension/table-layout.js +1 -2
  29. package/dist/components/Scribe/extension/tableOfContents.js +1 -1
  30. package/dist/components/Scribe/index.js +7 -21
  31. package/dist/{dist-DGEcUiqG.js → dist-BoAzo5MN.js} +27 -37
  32. package/dist/{dist-TKt66Yz8.js → dist-BqlzKS-_.js} +9 -17
  33. package/dist/{dist-ZGDUiMX8.js → dist-SM4NoN4h.js} +61 -64
  34. package/dist/document-node-capabilities.js +1 -1
  35. package/dist/{extension-I7Ocj_D_.js → extension-dz0CIf3r.js} +1 -1
  36. package/dist/{extension-link-Cb1UO6hv.js → extension-link-DxIXGCtV.js} +3 -11
  37. package/dist/{html-to-markdown-DF93it73.js → html-to-markdown-DeRG9OPm.js} +1 -1
  38. package/dist/main.css +1 -0
  39. package/dist/main.js +2 -2
  40. package/dist/{markdown-to-html-BoK5O_j-.js → markdown-to-html-tCPjQ5u6.js} +23 -70
  41. package/dist/{menus-BrQTLTFL.js → menus-BKxcTUsl.js} +23 -105
  42. package/dist/{purify.es-q6CUdJQi.js → purify.es-CSWcs7f1.js} +1 -23
  43. package/dist/{schema-extensions-CzDKrIf8.js → schema-extensions-B9hR1VrD.js} +17 -42
  44. package/dist/schema-extensions.js +1 -2
  45. package/dist/schema.js +1 -1
  46. package/dist/{table-layout-Dt7KmVp_.js → table-layout-ClqaGg1E.js} +1 -1
  47. package/dist/{tippy.esm-MjWnmeEn.js → tippy.esm-C8V6GlaF.js} +5 -17
  48. package/dist/utils/create-scribe-editor.js +1 -2
  49. package/dist/utils/html-to-markdown.js +1 -2
  50. package/dist/utils/index.js +4 -4
  51. package/dist/utils/markdown-to-html.js +1 -2
  52. package/package.json +10 -10
package/README.md CHANGED
@@ -242,8 +242,11 @@ paths too.
242
242
 
243
243
  ## Links
244
244
 
245
- Scribe uses Tiptap's Link extension for ordinary links and URL paste. Use the toolbar or click an
246
- existing link to edit **Text to display** and **URL**, then choose **Apply** or **Remove link**.
245
+ Scribe uses Tiptap's Link extension for ordinary links and URL paste. Clicking an existing link
246
+ opens its popover with focus on the dialog, keeping the software keyboard closed. Tap
247
+ either field to start typing, then choose **Apply** or **Remove link**. The popover follows
248
+ the visible viewport when the keyboard opens, scrolling its form when space is limited.
249
+ The toolbar Link action still focuses the URL immediately.
247
250
  An unchanged label preserves the link's inline formatting. Keyboard users can press `Alt + F10`
248
251
  from a link to open the form and Escape to return to the document.
249
252
 
@@ -1,4 +1,4 @@
1
- import { a as e } from "./dist-ZGDUiMX8.js";
1
+ import { a as e } from "./dist-SM4NoN4h.js";
2
2
  import { getPopupMountTarget as t } from "./components/Scribe/extension/getPopupMountTarget.js";
3
3
  import { getSelectionLinkContext as n, hideLinkBubbleMenu as r } from "./components/Menu/linkBubbleMenuPlugin.js";
4
4
  import i from "./components/Menu/LinkEditor.js";
@@ -1,2 +1 @@
1
- import { t as e } from "../../BarMenu-Bban-B3t.js";
2
- export { e as default };
1
+ export { t as default } from "../../BarMenu-Bm5IfWVV.js";
@@ -1,6 +1,6 @@
1
- import { a as e } from "../../dist-ZGDUiMX8.js";
1
+ import { a as e } from "../../dist-SM4NoN4h.js";
2
2
  import { getPopupMountTarget as t } from "../Scribe/extension/getPopupMountTarget.js";
3
- import { t as n } from "../../menus-BrQTLTFL.js";
3
+ import { t as n } from "../../menus-BKxcTUsl.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 { a as r } from "../../dist-ZGDUiMX8.js";
2
+ import { a as r } from "../../dist-SM4NoN4h.js";
3
3
  import { getPopupMountTarget as i } from "../Scribe/extension/getPopupMountTarget.js";
4
- import { t as a } from "../../menus-BrQTLTFL.js";
4
+ import { t as a } from "../../menus-BKxcTUsl.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 +1 @@
1
- {"version":3,"file":"LinkBubbleMenu.d.ts","sourceRoot":"","sources":["../../../lib/components/Menu/LinkBubbleMenu.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAkB,MAAM,eAAe,CAAC;AAKvD,OAAO,EAAE,EAAE,EAA2E,MAAM,OAAO,CAAC;AAapG,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB;AAiCD,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CA2Y3C,CAAC;eAEa,cAAc"}
1
+ {"version":3,"file":"LinkBubbleMenu.d.ts","sourceRoot":"","sources":["../../../lib/components/Menu/LinkBubbleMenu.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAkB,MAAM,eAAe,CAAC;AAKvD,OAAO,EAAE,EAAE,EAA2E,MAAM,OAAO,CAAC;AAapG,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB;AAoCD,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAkb3C,CAAC;eAEa,cAAc"}
@@ -1,14 +1,14 @@
1
- import { a as e } from "../../dist-ZGDUiMX8.js";
1
+ import { a as e } from "../../dist-SM4NoN4h.js";
2
2
  import { getPopupMountTarget as t } from "../Scribe/extension/getPopupMountTarget.js";
3
3
  import { consumeLinkBubbleMenuFocusTarget as n, getPlainLinkContextAtPosition as r, getSelectionLinkContext as i, hideLinkBubbleMenu as a, linkBubbleMenuPluginKey as o, showLinkBubbleMenu as s } from "./linkBubbleMenuPlugin.js";
4
4
  import c from "./LinkEditor.js";
5
- import { t as l } from "../../menus-BrQTLTFL.js";
5
+ import { t as l } from "../../menus-BKxcTUsl.js";
6
6
  import { getSelectionContextualMenuOwner as u } from "./contextualMenuOwner.js";
7
7
  import { Box as d } from "@radix-ui/themes";
8
8
  import { useCallback as f, useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
9
9
  import { jsx as _ } from "react/jsx-runtime";
10
10
  //#region lib/components/Menu/LinkBubbleMenu.tsx
11
- var v = /auto|overlay|scroll/, y = (e) => {
11
+ var v = /auto|overlay|scroll/, y = 8, b = 16, x = (e) => {
12
12
  let t = e.ownerDocument.defaultView;
13
13
  if (!t) return [];
14
14
  let n = [], r = e.parentElement;
@@ -17,25 +17,25 @@ var v = /auto|overlay|scroll/, y = (e) => {
17
17
  v.test(`${e.overflow} ${e.overflowX} ${e.overflowY}`) && n.push(r), r = r.parentElement;
18
18
  }
19
19
  return n;
20
- }, b = ({ editor: v }) => {
21
- let [b, x] = g(""), [S, C] = g(0), [w, T] = g(null), E = h(null), D = h(null), O = h(null), k = e({
20
+ }, S = ({ editor: v }) => {
21
+ let [S, C] = g(""), [w, T] = g(0), [E, D] = g(null), O = h(null), k = h(null), A = h(null), j = e({
22
22
  editor: v,
23
23
  selector: ({ editor: e }) => ({ context: i(e.state) })
24
24
  });
25
25
  p(() => {
26
- x(k.context?.href ?? "");
26
+ C(j.context?.href ?? "");
27
27
  }, [
28
- k.context?.from,
29
- k.context?.href,
30
- k.context?.to
28
+ j.context?.from,
29
+ j.context?.href,
30
+ j.context?.to
31
31
  ]), p(() => () => {
32
- O.current !== null && window.cancelAnimationFrame(O.current);
32
+ A.current !== null && window.cancelAnimationFrame(A.current);
33
33
  }, []), p(() => {
34
34
  if (v.isDestroyed) return;
35
35
  let e = v.view.dom, t = null, n = (e) => !e || (v.commands.setTextSelection({
36
36
  from: e.from,
37
37
  to: e.to
38
- }), u(v.state) !== "link") ? !1 : (s(v, "url"), !0), i = (n) => {
38
+ }), u(v.state) !== "link") ? !1 : (s(v, "dialog"), !0), i = (n) => {
39
39
  if (n.button !== 0 || !v.isEditable) return;
40
40
  let r = n.target?.closest?.("a");
41
41
  r && e.contains(r) && (t = {
@@ -82,7 +82,7 @@ var v = /auto|overlay|scroll/, y = (e) => {
82
82
  let e = v.view.dom.ownerDocument, t = e.defaultView;
83
83
  if (!t) return;
84
84
  let n = (e) => {
85
- let n = E.current;
85
+ let n = O.current;
86
86
  n?.isConnected && e instanceof t.Node && !n.contains(e) && !v.view.dom.contains(e) && a(v);
87
87
  }, r = (e) => n(e.target), i = (e) => n(e.target);
88
88
  return e.addEventListener("pointerdown", r, !0), e.addEventListener("focusin", i), () => {
@@ -91,15 +91,15 @@ var v = /auto|overlay|scroll/, y = (e) => {
91
91
  }, [v]), p(() => {
92
92
  let e = v.view.dom.ownerDocument.defaultView;
93
93
  if (!e) return;
94
- let t = y(v.view.dom), n = null, r = () => {
94
+ let t = x(v.view.dom), n = null, r = () => {
95
95
  n === null && (n = e.requestAnimationFrame(() => {
96
96
  n = null, v.isDestroyed || v.view.dispatch(v.state.tr.setMeta(o, "updatePosition"));
97
97
  }));
98
98
  };
99
- return e.addEventListener("scroll", r, { passive: !0 }), t.forEach((e) => {
99
+ return e.addEventListener("scroll", r, { passive: !0 }), e.visualViewport?.addEventListener("resize", r), e.visualViewport?.addEventListener("scroll", r), t.forEach((e) => {
100
100
  e.addEventListener("scroll", r, { passive: !0 });
101
101
  }), () => {
102
- n !== null && e.cancelAnimationFrame(n), e.removeEventListener("scroll", r), t.forEach((e) => {
102
+ n !== null && e.cancelAnimationFrame(n), e.removeEventListener("scroll", r), e.visualViewport?.removeEventListener("resize", r), e.visualViewport?.removeEventListener("scroll", r), t.forEach((e) => {
103
103
  e.removeEventListener("scroll", r);
104
104
  });
105
105
  };
@@ -108,73 +108,95 @@ var v = /auto|overlay|scroll/, y = (e) => {
108
108
  if (!e || !t) return;
109
109
  let n = () => {
110
110
  let t = e.getBoundingClientRect().width;
111
- T(t > 0 ? Math.max(t - 16, 0) : null);
111
+ D(t > 0 ? Math.max(t - 16, 0) : null);
112
112
  };
113
113
  if (n(), !t.ResizeObserver) return;
114
114
  let r = new t.ResizeObserver(n);
115
115
  return r.observe(e), () => r.disconnect();
116
116
  }, [v]);
117
- let A = f(() => {
117
+ let M = f(() => {
118
118
  if (v.isDestroyed) return;
119
119
  let e = v.state.selection.to;
120
120
  a(v), v.chain().setTextSelection(e).focus().run();
121
- }, [v]), j = f(() => {
122
- O.current !== null && window.cancelAnimationFrame(O.current);
121
+ }, [v]), N = f(() => {
122
+ A.current !== null && window.cancelAnimationFrame(A.current);
123
123
  let e = i(v.state), t = n(v), r = () => {
124
- t === "dialog" ? E.current?.focus() : (D.current?.focus(), D.current?.select());
124
+ t === "dialog" ? O.current?.focus({ preventScroll: !0 }) : (k.current?.focus({ preventScroll: !0 }), k.current?.select());
125
125
  };
126
- x(e?.href ?? ""), C((e) => e + 1), r(), O.current = window.requestAnimationFrame(() => {
127
- r(), O.current = null;
126
+ C(e?.href ?? ""), T((e) => e + 1), r(), A.current = window.requestAnimationFrame(() => {
127
+ A.current = null, r();
128
128
  });
129
- }, [v]), M = f(() => {
130
- O.current !== null && (window.cancelAnimationFrame(O.current), O.current = null);
131
- }, []), N = f((e) => {
132
- e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), A());
133
- }, [A]), P = f(({ editor: e, element: t, state: n }) => {
129
+ }, [v]), P = f(() => {
130
+ A.current !== null && (window.cancelAnimationFrame(A.current), A.current = null);
131
+ }, []), F = f((e) => {
132
+ e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), M());
133
+ }, [M]), I = f(({ editor: e, element: t, state: n }) => {
134
134
  let r = t.contains(t.ownerDocument.activeElement);
135
135
  return e.isEditable && !!i(n) && u(n) === "link" && r;
136
- }, []), F = f(() => t(v), [v]), I = m(() => ({
136
+ }, []), L = f(() => t(v), [v]), R = f(() => {
137
+ let e = O.current, t = e?.ownerDocument.activeElement;
138
+ if (!e || !t || t === e || !e.contains(t)) return;
139
+ let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = n.top + e.clientTop + y, a = n.top + e.clientTop + e.clientHeight - y;
140
+ r.top < i ? e.scrollTop -= i - r.top : r.bottom > a && (e.scrollTop += r.bottom - a);
141
+ }, []), z = m(() => ({
137
142
  strategy: "fixed",
138
143
  placement: "bottom",
139
- offset: 8,
140
- flip: {},
141
- shift: { padding: 8 },
144
+ offset: y,
145
+ flip: { padding: b },
146
+ shift: {
147
+ padding: b,
148
+ crossAxis: !0
149
+ },
150
+ size: {
151
+ padding: b,
152
+ apply: ({ availableHeight: e }) => {
153
+ O.current && (O.current.style.maxHeight = `min(32rem, ${Math.max(0, e)}px)`);
154
+ }
155
+ },
142
156
  inline: !0,
143
- onHide: M,
144
- onShow: j
145
- }), [M, j]), L = k.context;
157
+ onHide: P,
158
+ onShow: N,
159
+ onUpdate: R
160
+ }), [
161
+ P,
162
+ N,
163
+ R
164
+ ]), B = j.context;
146
165
  return /* @__PURE__ */ _(l, {
147
166
  editor: v,
148
167
  pluginKey: o,
149
168
  updateDelay: 0,
150
169
  resizeDelay: 0,
151
- appendTo: F,
152
- shouldShow: P,
153
- options: I,
170
+ appendTo: L,
171
+ shouldShow: I,
172
+ options: z,
154
173
  children: /* @__PURE__ */ _(d, {
155
- ref: E,
174
+ ref: O,
156
175
  className: "scribe-link-popover",
157
176
  role: "dialog",
158
177
  "aria-label": "Edit link",
159
178
  "aria-keyshortcuts": "Alt+F10",
160
179
  tabIndex: -1,
161
- onKeyDown: N,
180
+ onFocusCapture: (e) => {
181
+ e.target !== e.currentTarget && P();
182
+ },
183
+ onKeyDown: F,
162
184
  style: {
163
- maxWidth: w === null ? "calc(100vw - 32px)" : `min(${w}px, calc(100vw - 32px))`,
185
+ maxWidth: E === null ? "calc(100vw - 32px)" : `min(${E}px, calc(100vw - 32px))`,
164
186
  width: 320
165
187
  },
166
188
  children: /* @__PURE__ */ _(c, {
167
189
  editor: v,
168
- existingHref: L?.href ?? "",
169
- inputRef: D,
170
- onClose: A,
171
- onValueChange: x,
172
- resetToken: S,
173
- targetPosition: L?.kind === "preview" ? L.position : void 0,
174
- value: b
190
+ existingHref: B?.href ?? "",
191
+ inputRef: k,
192
+ onClose: M,
193
+ onValueChange: C,
194
+ resetToken: w,
195
+ targetPosition: B?.kind === "preview" ? B.position : void 0,
196
+ value: S
175
197
  })
176
198
  })
177
199
  });
178
200
  };
179
201
  //#endregion
180
- export { b as default };
202
+ export { S as default };
@@ -58,7 +58,7 @@ var h = (e, t, n) => {
58
58
  return;
59
59
  }
60
60
  let o = E.current, s = D.trim() ? D : a, c = !1;
61
- if (c = o.preview && a.startsWith("/") ? e.chain().focus().command(({ tr: e, state: t }) => {
61
+ c = o.preview && a.startsWith("/") ? e.chain().focus().command(({ tr: e, state: t }) => {
62
62
  let i = t.schema.marks.link, c = e.doc.nodeAt(o.from);
63
63
  if (!i || c?.type.name !== "externalLinkPreview" || !e.doc.resolve(o.from).parent.type.allowsMarkType(i)) return !1;
64
64
  r(e), e.setMeta("preventAutolink", !0);
@@ -93,11 +93,7 @@ var h = (e, t, n) => {
93
93
  e.setSelection(n.create(e.doc, l));
94
94
  }
95
95
  return !0;
96
- }).run(), !c) {
97
- M("Scribe could not save this link.");
98
- return;
99
- }
100
- S && e.commands.selectTextblockEnd(), P();
96
+ }).run(), c ? (S && e.commands.selectTextblockEnd(), P()) : M("Scribe could not save this link.");
101
97
  }, [
102
98
  e,
103
99
  P,
@@ -106,14 +102,10 @@ var h = (e, t, n) => {
106
102
  w
107
103
  ]), I = c(() => {
108
104
  let t = E.current;
109
- if (!e.chain().focus().command(({ tr: e, state: i }) => {
105
+ e.chain().focus().command(({ tr: e, state: i }) => {
110
106
  let a = i.schema.marks.link;
111
107
  return !a || t.from > t.to || t.to > e.doc.content.size ? !1 : (r(e), e.setMeta("preventAutolink", !0), t.preview ? (e.replaceWith(t.from, t.to, i.schema.text(t.text)), e.setSelection(n.create(e.doc, t.from + t.text.length))) : (e.removeMark(t.from, t.to, a), e.setSelection(n.create(e.doc, t.to))), !0);
112
- }).run()) {
113
- M("Scribe could not remove this link.");
114
- return;
115
- }
116
- P();
108
+ }).run() ? P() : M("Scribe could not remove this link.");
117
109
  }, [e, P]), L = c((e) => {
118
110
  e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), P());
119
111
  }, [P]);
@@ -1,4 +1,4 @@
1
- import { a as e } from "../../../dist-ZGDUiMX8.js";
1
+ import { a as e } from "../../../dist-SM4NoN4h.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,7 +1,7 @@
1
- import { c as e, u as t } from "../../table-layout-Dt7KmVp_.js";
2
- import { a as n } from "../../dist-ZGDUiMX8.js";
1
+ import { c as e, u as t } from "../../table-layout-ClqaGg1E.js";
2
+ import { a as n } from "../../dist-SM4NoN4h.js";
3
3
  import { getPopupMountTarget as r } from "../Scribe/extension/getPopupMountTarget.js";
4
- import { t as i } from "../../menus-BrQTLTFL.js";
4
+ import { t as i } from "../../menus-BKxcTUsl.js";
5
5
  import { getSelectionTableContext as a, tableBubbleMenuPluginKey as o } from "./tableBubbleMenuPlugin.js";
6
6
  import { getSelectionContextualMenuOwner as s } from "./contextualMenuOwner.js";
7
7
  import c from "./TableLayoutOptions.js";
@@ -1,4 +1,4 @@
1
- import { c as e, n as t } from "../../table-layout-Dt7KmVp_.js";
1
+ import { c as e, n as t } from "../../table-layout-ClqaGg1E.js";
2
2
  import { getPopupMountTarget as n } from "../Scribe/extension/getPopupMountTarget.js";
3
3
  import { getSelectionTableContext as r } from "./tableBubbleMenuPlugin.js";
4
4
  import { NodeSelection as i } from "@tiptap/pm/state";
@@ -28,11 +28,7 @@ var _ = ({ editor: _, maxHeight: v, canSetMaxHeight: y, onClose: b }) => {
28
28
  };
29
29
  }, [_, b]);
30
30
  let R = (e) => {
31
- if (!L()) {
32
- N.current = !1, b();
33
- return;
34
- }
35
- y && _.commands.setTableMaxHeight(e) && (D.current = _.state.selection.getBookmark(), N.current = !0, b());
31
+ L() ? y && _.commands.setTableMaxHeight(e) && (D.current = _.state.selection.getBookmark(), N.current = !0, b()) : (N.current = !1, b());
36
32
  };
37
33
  return /* @__PURE__ */ h(o.Root, {
38
34
  open: !0,
@@ -69,11 +65,7 @@ var _ = ({ editor: _, maxHeight: v, canSetMaxHeight: y, onClose: b }) => {
69
65
  return;
70
66
  }
71
67
  let r = e(x.trim());
72
- if (r === null) {
73
- w(`Enter a whole number from 120 to ${t}.`), T.current?.focus();
74
- return;
75
- }
76
- R(r);
68
+ r === null ? (w(`Enter a whole number from 120 to ${t}.`), T.current?.focus()) : R(r);
77
69
  },
78
70
  children: [/* @__PURE__ */ g(s, {
79
71
  direction: "column",
@@ -59,11 +59,7 @@ var l = [
59
59
  e.stopPropagation(), E.current = !0;
60
60
  },
61
61
  onCloseAutoFocus: (e) => {
62
- if (D.current) {
63
- e.preventDefault(), D.current = !1;
64
- return;
65
- }
66
- E.current && !u.isDestroyed && (e.preventDefault(), u.chain().focus().run());
62
+ D.current ? (e.preventDefault(), D.current = !1) : E.current && !u.isDestroyed && (e.preventDefault(), u.chain().focus().run());
67
63
  },
68
64
  children: [
69
65
  /* @__PURE__ */ s(n.Label, { children: "Width" }),
@@ -1,4 +1,4 @@
1
- import { v as e } from "../../dist-DGEcUiqG.js";
1
+ import { v as e } from "../../dist-BoAzo5MN.js";
2
2
  import { normalizeExternalLinkPreviewAttributes as t } from "../Scribe/extension/external-link-preview/attributes.js";
3
3
  import { NodeSelection as n, PluginKey as r } from "@tiptap/pm/state";
4
4
  //#region lib/components/Menu/linkBubbleMenuPlugin.ts
@@ -1,4 +1,4 @@
1
- import { B as e, M as t, a as n } from "../../../dist-DGEcUiqG.js";
1
+ import { B as e, M as t, a as n } from "../../../dist-BoAzo5MN.js";
2
2
  import { TextSelection as r } from "@tiptap/pm/state";
3
3
  //#region lib/components/Scribe/extension/callout.ts
4
4
  var i = [
@@ -1,6 +1,6 @@
1
- import { n as e } from "../../../../dist-ZGDUiMX8.js";
1
+ import { n as e } from "../../../../dist-SM4NoN4h.js";
2
2
  import { getPopupMountTarget as t } from "../getPopupMountTarget.js";
3
- import { t as n } from "../../../../tippy.esm-MjWnmeEn.js";
3
+ import { t as n } from "../../../../tippy.esm-C8V6GlaF.js";
4
4
  import { EmojiList as r } from "./EmojiList.js";
5
5
  //#region lib/components/Scribe/extension/emoji/suggest.ts
6
6
  var i = () => ({
@@ -1,2 +1 @@
1
- import { t as e } from "../../../extension-link-Cb1UO6hv.js";
2
- export { e as default };
1
+ export { t as default } from "../../../extension-link-DxIXGCtV.js";
@@ -1,5 +1,5 @@
1
- import { n as e } from "../../../dist-DGEcUiqG.js";
2
- import { n as t, t as n } from "../../../markdown-to-html-BoK5O_j-.js";
1
+ import { n as e } from "../../../dist-BoAzo5MN.js";
2
+ import { n as t, t as n } from "../../../markdown-to-html-tCPjQ5u6.js";
3
3
  import { Plugin as r, PluginKey as i } from "@tiptap/pm/state";
4
4
  //#region lib/components/Scribe/extension/extension-markdown-paste.ts
5
5
  var a = new i("markdownPaste"), o = /* @__PURE__ */ new Set([
@@ -1,4 +1,4 @@
1
- import { n as e } from "../../../dist-DGEcUiqG.js";
1
+ import { n as e } from "../../../dist-BoAzo5MN.js";
2
2
  //#region lib/components/Scribe/extension/extension-selectedText.ts
3
3
  var t = e.create({
4
4
  name: "SelectedText",
@@ -1,4 +1,4 @@
1
- import { v as e } from "../../../../dist-DGEcUiqG.js";
1
+ import { v as e } from "../../../../dist-BoAzo5MN.js";
2
2
  import { EXTERNAL_LINK_PREVIEW_NODE_NAME as t, normalizeExternalLinkPreviewAttributes as n, normalizeExternalLinkPreviewHref as r } from "./attributes.js";
3
3
  import { normalizeLinkUrl as i } from "../../../Menu/linkUrl.js";
4
4
  import { NodeSelection as a, TextSelection as o } from "@tiptap/pm/state";
@@ -63,7 +63,7 @@ var s = (e, t) => {
63
63
  href: d,
64
64
  linkText: e.linkText ?? (f && l.attributes.linkText === l.attributes.href ? d : l.attributes.linkText)
65
65
  });
66
- return m ? !Object.entries(m).some(([e, t]) => l.attributes[e] !== t) || !i || (a.setNodeMarkup(l.position, void 0, m), c(a, l.position), !0) : o();
66
+ return m ? (!Object.entries(m).some(([e, t]) => l.attributes[e] !== t) || !i || (a.setNodeMarkup(l.position, void 0, m), c(a, l.position)), !0) : o();
67
67
  }
68
68
  });
69
69
  //#endregion
@@ -1,4 +1,4 @@
1
- import { B as e } from "../../../../dist-DGEcUiqG.js";
1
+ import { B as e } from "../../../../dist-BoAzo5MN.js";
2
2
  import { getExternalLinkPreviewDataAttributes as t } from "./serialization.js";
3
3
  //#region lib/components/Scribe/extension/external-link-preview/render-html.ts
4
4
  var n = ({ attributes: n, HTMLAttributes: r }) => [
@@ -1,4 +1,4 @@
1
- import { a as e } from "../../../../dist-DGEcUiqG.js";
1
+ import { a as e } from "../../../../dist-BoAzo5MN.js";
2
2
  import { EXTERNAL_LINK_PREVIEW_NODE_NAME as t, isExternalLinkPreviewDisplay as n, normalizeExternalLinkPreviewAttributes as r, normalizeExternalLinkPreviewHref as i, normalizeExternalLinkPreviewLinkText as a, normalizeExternalLinkPreviewMediaUrl as o, normalizeExternalLinkPreviewMetadata as s } from "./attributes.js";
3
3
  import { getExternalLinkPreviewAttributesFromElement as c } from "./serialization.js";
4
4
  import { renderExternalLinkPreviewHTML as l } from "./render-html.js";
@@ -40,13 +40,7 @@ var r = {
40
40
  }, c = (t) => {
41
41
  [...t.matches("span[data-type=\"external-link-preview\"]") ? [t] : [], ...Array.from(t.querySelectorAll(e))].forEach((e) => {
42
42
  let n = e.getAttribute(r.linkText) ?? e.textContent ?? "";
43
- if (!s(e)) {
44
- if (e === t) {
45
- Array.from(e.attributes).forEach((t) => e.removeAttribute(t.name)), e.replaceChildren(e.ownerDocument.createTextNode(n));
46
- return;
47
- }
48
- e.replaceWith(e.ownerDocument.createTextNode(n));
49
- }
43
+ s(e) || (e === t ? (Array.from(e.attributes).forEach((t) => e.removeAttribute(t.name)), e.replaceChildren(e.ownerDocument.createTextNode(n))) : e.replaceWith(e.ownerDocument.createTextNode(n)));
50
44
  });
51
45
  };
52
46
  //#endregion
@@ -1,2 +1 @@
1
- import { t as e } from "../../../extension-I7Ocj_D_.js";
2
- export { e as initExtensions };
1
+ export { t as initExtensions } from "../../../extension-dz0CIf3r.js";
@@ -1,5 +1,5 @@
1
- import { B as e } from "../../../dist-DGEcUiqG.js";
2
- import { c as t, f as n, i as r, l as i, o as a, p as o, s, u as c } from "../../../table-layout-Dt7KmVp_.js";
1
+ import { B as e } from "../../../dist-BoAzo5MN.js";
2
+ import { c as t, f as n, i as r, l as i, o as a, p as o, s, u as c } from "../../../table-layout-ClqaGg1E.js";
3
3
  import { createStickyTableHeaderPlugin as l } from "./table-sticky-header.js";
4
4
  import { NodeSelection as u } from "@tiptap/pm/state";
5
5
  import { columnResizing as d, columnResizingPluginKey as f, tableEditing as p } from "@tiptap/pm/tables";
@@ -1023,16 +1023,15 @@ var d = (/* @__PURE__ */ e(((e, t) => {
1023
1023
  }
1024
1024
  function sa(e, t, r, i, a, o, s) {
1025
1025
  var c = gs(e, r), l = gs(t, r), u = s.get(l);
1026
- if (u) {
1027
- ci(e, r, u);
1028
- return;
1029
- }
1030
- var d = o ? o(c, l, r + "", e, t, s) : n, f = d === n;
1031
- if (f) {
1032
- var p = U(l), m = !p && ru(l), h = !p && !m && Du(l);
1033
- d = l, p || m || h ? U(c) ? d = c : G(c) ? d = z(c) : m ? (f = !1, d = Wa(l, !0)) : h ? (f = !1, d = Ya(l, !0)) : d = [] : Su(l) || eu(l) ? (d = c, eu(c) ? d = Lu(c) : (!K(c) || du(c)) && (d = Xo(l))) : f = !1;
1026
+ if (u) ci(e, r, u);
1027
+ else {
1028
+ var d = o ? o(c, l, r + "", e, t, s) : n, f = d === n;
1029
+ if (f) {
1030
+ var p = U(l), m = !p && ru(l), h = !p && !m && Du(l);
1031
+ d = l, p || m || h ? U(c) ? d = c : G(c) ? d = z(c) : m ? (f = !1, d = Wa(l, !0)) : h ? (f = !1, d = Ya(l, !0)) : d = [] : Su(l) || eu(l) ? (d = c, eu(c) ? d = Lu(c) : (!K(c) || du(c)) && (d = Xo(l))) : f = !1;
1032
+ }
1033
+ f && (s.set(l, d), a(d, l, i, o, s), s.delete(l)), ci(e, r, d);
1034
1034
  }
1035
- f && (s.set(l, d), a(d, l, i, o, s), s.delete(l)), ci(e, r, d);
1036
1035
  }
1037
1036
  function ca(e, t) {
1038
1037
  var r = e.length;
@@ -2699,11 +2698,8 @@ var d = (/* @__PURE__ */ e(((e, t) => {
2699
2698
  return e == null ? "" : Aa(e);
2700
2699
  }
2701
2700
  var zu = io(function(e, t) {
2702
- if (os(t) || W(t)) {
2703
- eo(t, Z(t), e);
2704
- return;
2705
- }
2706
- for (var n in t) w.call(t, n) && li(e, n, t[n]);
2701
+ if (os(t) || W(t)) eo(t, Z(t), e);
2702
+ else for (var n in t) w.call(t, n) && li(e, n, t[n]);
2707
2703
  }), Bu = io(function(e, t) {
2708
2704
  eo(t, Q(t), e);
2709
2705
  }), Vu = io(function(e, t, n, r) {
@@ -1,5 +1,5 @@
1
- import { n as e } from "../../../../dist-DGEcUiqG.js";
2
- import { n as t } from "../../../../dist-TKt66Yz8.js";
1
+ import { n as e } from "../../../../dist-BoAzo5MN.js";
2
+ import { n as t } from "../../../../dist-BqlzKS-_.js";
3
3
  import { PluginKey as n } from "@tiptap/pm/state";
4
4
  //#region lib/components/Scribe/extension/slashCommand/index.ts
5
5
  var r = new n("slashSuggestion"), i = e.create({
@@ -1,6 +1,6 @@
1
- import { n as e } from "../../../../dist-ZGDUiMX8.js";
1
+ import { n as e } from "../../../../dist-SM4NoN4h.js";
2
2
  import { getPopupMountTarget as t } from "../getPopupMountTarget.js";
3
- import { t as n } from "../../../../tippy.esm-MjWnmeEn.js";
3
+ import { t as n } from "../../../../tippy.esm-C8V6GlaF.js";
4
4
  import { SlashCommandList as r } from "./SlashCommandList.js";
5
5
  //#region lib/components/Scribe/extension/slashCommand/renderItems.ts
6
6
  var i = () => {
@@ -1,2 +1 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "../../../table-layout-Dt7KmVp_.js";
2
- export { u as DEFAULT_TABLE_MAX_HEIGHT, o as MAX_TABLE_MAX_HEIGHT, c as MIN_TABLE_MAX_HEIGHT, i as SCRIBE_TABLE_LAYOUTS, e as SCROLL_TABLE_COLUMN_WIDTH, s as ScribeTableView, l as normalizeTableLayout, t as normalizeTableMaxHeight, a as scrollTablePresentation, d as tableHasHeaderRow, n as tableHasStickyHeader, r as tableLayoutAttributes };
1
+ export { t as DEFAULT_TABLE_MAX_HEIGHT, n as MAX_TABLE_MAX_HEIGHT, r as MIN_TABLE_MAX_HEIGHT, i as SCRIBE_TABLE_LAYOUTS, a as SCROLL_TABLE_COLUMN_WIDTH, o as ScribeTableView, s as normalizeTableLayout, c as normalizeTableMaxHeight, l as scrollTablePresentation, u as tableHasHeaderRow, d as tableHasStickyHeader, f as tableLayoutAttributes } from "../../../table-layout-ClqaGg1E.js";
@@ -1,4 +1,4 @@
1
- import { n as e } from "../../../dist-DGEcUiqG.js";
1
+ import { n as e } from "../../../dist-BoAzo5MN.js";
2
2
  import { Plugin as t, PluginKey as n } from "@tiptap/pm/state";
3
3
  //#region lib/components/Scribe/extension/tableOfContents.ts
4
4
  var r = "scribeTableOfContents", i = new n("scribeTableOfContents"), a = 10, o = (e) => e.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "heading", s = (e, t) => {
@@ -1,10 +1,10 @@
1
- import { n as e, t } from "../../BarMenu-Bban-B3t.js";
2
- import { i as n, t as r } from "../../dist-ZGDUiMX8.js";
1
+ import { n as e, t } from "../../BarMenu-Bm5IfWVV.js";
2
+ import { i as n, t as r } from "../../dist-SM4NoN4h.js";
3
3
  import i from "../Menu/CalloutBubbleMenu.js";
4
4
  import a from "../Menu/LinkBubbleMenu.js";
5
5
  import o from "../Menu/TableBubbleMenu.js";
6
- import { t as s } from "../../html-to-markdown-DF93it73.js";
7
- import { t as c } from "../../extension-I7Ocj_D_.js";
6
+ import { t as s } from "../../html-to-markdown-DeRG9OPm.js";
7
+ import { t as c } from "../../extension-dz0CIf3r.js";
8
8
  import { SuggestionItemType as l } from "./extension/slashCommand/items.js";
9
9
  import "./extension/tableOfContents.js";
10
10
  import "../../utils/index.js";
@@ -91,13 +91,7 @@ var y = "Rich text editor", b = [
91
91
  H,
92
92
  V
93
93
  ]), p(() => {
94
- if (g !== void 0) {
95
- if (L.current) {
96
- L.current = !1;
97
- return;
98
- }
99
- S.commands.setContent(g, { emitUpdate: !1 });
100
- }
94
+ g !== void 0 && (L.current ? L.current = !1 : S.commands.setContent(g, { emitUpdate: !1 }));
101
95
  }, [g, S]), p(() => {
102
96
  if (!w) {
103
97
  I.current = null;
@@ -140,11 +134,7 @@ var y = "Rich text editor", b = [
140
134
  let u = c ? o(S.state, r) : null;
141
135
  u && b.forEach((n) => {
142
136
  let r = n in u ? u[n] : a.has(n) ? null : t[n];
143
- if (r == null) {
144
- e.removeAttribute(n);
145
- return;
146
- }
147
- e.setAttribute(n, r);
137
+ r == null ? e.removeAttribute(n) : e.setAttribute(n, r);
148
138
  });
149
139
  }
150
140
  I.current?.editor === S && (I.current = null);
@@ -154,11 +144,7 @@ var y = "Rich text editor", b = [
154
144
  let e = S.view.dom, t = x((w ? I.current?.attributes : typeof C?.editorProps?.attributes == "function" ? C.editorProps.attributes.call(C.editorProps, S.state) : C?.editorProps?.attributes) ?? {}, l, y);
155
145
  b.forEach((n) => {
156
146
  let r = t[n];
157
- if (r === void 0) {
158
- e.removeAttribute(n);
159
- return;
160
- }
161
- e.setAttribute(n, r);
147
+ r === void 0 ? e.removeAttribute(n) : e.setAttribute(n, r);
162
148
  });
163
149
  }, [
164
150
  l,