@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
@@ -707,29 +707,25 @@ function zt(e) {
707
707
  let t = [], n = "", r = !1, i = !1, a = 0, o = e.length;
708
708
  for (let s = 0; s < o; s += 1) {
709
709
  let o = e[s];
710
- if (o === "'" && !i) {
711
- r = !r, n += o;
712
- continue;
713
- }
714
- if (o === "\"" && !r) {
715
- i = !i, n += o;
716
- continue;
717
- }
718
- if (!r && !i) {
719
- if (o === "(") {
720
- a += 1, n += o;
721
- continue;
722
- }
723
- if (o === ")" && a > 0) {
724
- --a, n += o;
725
- continue;
726
- }
727
- if (o === ";" && a === 0) {
728
- t.push(n), n = "";
729
- continue;
710
+ if (o === "'" && !i) r = !r, n += o;
711
+ else if (o === "\"" && !r) i = !i, n += o;
712
+ else {
713
+ if (!r && !i) {
714
+ if (o === "(") {
715
+ a += 1, n += o;
716
+ continue;
717
+ }
718
+ if (o === ")" && a > 0) {
719
+ --a, n += o;
720
+ continue;
721
+ }
722
+ if (o === ";" && a === 0) {
723
+ t.push(n), n = "";
724
+ continue;
725
+ }
730
726
  }
727
+ n += o;
731
728
  }
732
- n += o;
733
729
  }
734
730
  return n && t.push(n), t;
735
731
  }
@@ -747,20 +743,14 @@ function Vt(...e) {
747
743
  return e.filter((e) => !!e).reduce((e, t) => {
748
744
  let n = { ...e };
749
745
  return Object.entries(t).forEach(([e, t]) => {
750
- if (e === "__proto__") {
751
- Object.defineProperty(n, e, {
752
- configurable: !0,
753
- enumerable: !0,
754
- value: t,
755
- writable: !0
756
- });
757
- return;
758
- }
759
- if (!n[e]) {
760
- n[e] = t;
761
- return;
762
- }
763
- if (e === "class") {
746
+ if (e === "__proto__") Object.defineProperty(n, e, {
747
+ configurable: !0,
748
+ enumerable: !0,
749
+ value: t,
750
+ writable: !0
751
+ });
752
+ else if (!n[e]) n[e] = t;
753
+ else if (e === "class") {
764
754
  let r = t ? String(t).split(" ") : [], i = n[e] ? n[e].split(" ") : [], a = r.filter((e) => !i.includes(e));
765
755
  n[e] = [...i, ...a].join(" ");
766
756
  } else if (e === "style") {
@@ -2029,12 +2019,12 @@ function Nr(e) {
2029
2019
  commands: h,
2030
2020
  chain: g,
2031
2021
  can: _
2032
- }) === null || !d.steps.length ? !1 : u && (l.dispatch(u), !l.state.doc.eq(u.doc)) ? !0 : (ye(d), d.setMeta("inputRule", !0), a.undoable && d.setMeta(s, {
2022
+ }) === null || !d.steps.length ? !1 : (u && (l.dispatch(u), !l.state.doc.eq(u.doc)) || (ye(d), d.setMeta("inputRule", !0), a.undoable && d.setMeta(s, {
2033
2023
  transform: d,
2034
2024
  from: n,
2035
2025
  to: f,
2036
2026
  text: i
2037
- }), l.dispatch(d), !0);
2027
+ }), l.dispatch(d)), !0);
2038
2028
  }
2039
2029
  function Pr(e, t, n) {
2040
2030
  let r = t[0].length - n.length;
@@ -1,4 +1,4 @@
1
- import { f as e } from "./dist-DGEcUiqG.js";
1
+ import { f as e } from "./dist-BoAzo5MN.js";
2
2
  import { a as t, c as n, i as r, r as i } from "./floating-ui.dom-CmJ6iBdh.js";
3
3
  import { Plugin as a, PluginKey as o } from "@tiptap/pm/state";
4
4
  import { Decoration as s, DecorationSet as c } from "@tiptap/pm/view";
@@ -219,20 +219,16 @@ function b({ getReferenceRect: e, contextElement: t, config: n, container: a, di
219
219
  strategy: n.strategy,
220
220
  middleware: n.middleware
221
221
  }).then(({ x: e, y: t, placement: n, strategy: r }) => {
222
- if (l.onPosition) {
223
- l.onPosition({
224
- x: e,
225
- y: t,
226
- placement: n,
227
- strategy: r
228
- });
229
- return;
230
- }
231
- Object.assign(c.style, {
222
+ l.onPosition ? l.onPosition({
223
+ x: e,
224
+ y: t,
225
+ placement: n,
226
+ strategy: r
227
+ }) : (Object.assign(c.style, {
232
228
  position: r,
233
229
  left: `${e}px`,
234
230
  top: `${t}px`
235
- }), d || (d = !0, c.style.visibility = "");
231
+ }), d || (d = !0, c.style.visibility = ""));
236
232
  });
237
233
  }, l.autoUpdate), m;
238
234
  return o && (m = (e) => {
@@ -344,11 +340,7 @@ function x({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i,
344
340
  };
345
341
  }
346
342
  }
347
- if (C === "stopped") {
348
- y.abort(), S(C, g), g = void 0;
349
- return;
350
- }
351
- C === "updated" && S(C, g);
343
+ C === "stopped" ? (y.abort(), S(C, g), g = void 0) : C === "updated" && S(C, g);
352
344
  },
353
345
  destroy: () => {
354
346
  var e;
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./rolldown-runtime-CtkjhSXr.js";
2
- import { L as t, O as n, t as r } from "./dist-DGEcUiqG.js";
2
+ import { L as t, O as n, t as r } from "./dist-BoAzo5MN.js";
3
3
  import { Plugin as i, PluginKey as a } from "@tiptap/pm/state";
4
4
  import * as o from "react";
5
5
  import s, { createContext as c, forwardRef as l, useContext as u, useDebugValue as d, useEffect as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g, version as _ } from "react";
@@ -120,7 +120,7 @@ var se = Object.hasOwn || ((e, t) => ae.call(e, t));
120
120
  function O(e, t) {
121
121
  return e === t || !e && !t && e !== e && t !== t;
122
122
  }
123
- var ce = "__v", le = "__o", ue = "_owner", de = typeof Float16Array < "u", { getOwnPropertyDescriptor: k, keys: A } = Object;
123
+ var ce = "__v", le = "__o", ue = "_owner", { getOwnPropertyDescriptor: k, keys: A } = Object, de = k(Object.getPrototypeOf(Int8Array.prototype), Symbol.toStringTag).get;
124
124
  function fe(e, t) {
125
125
  return e.byteLength === t.byteLength && R(new Uint8Array(e), new Uint8Array(t));
126
126
  }
@@ -207,7 +207,8 @@ function L(e, t, n) {
207
207
  function R(e, t) {
208
208
  let n = e.length;
209
209
  if (t.length !== n || e.byteOffset !== t.byteOffset) return !1;
210
- if (e instanceof Float64Array || e instanceof Float32Array || de && e instanceof Float16Array) {
210
+ let r = de.call(e);
211
+ if (r === "Float64Array" || r === "Float32Array" || r === "Float16Array") {
211
212
  for (; n-- > 0;) if (e[n] !== t[n] && (e[n] === e[n] || t[n] === t[n])) return !1;
212
213
  return !0;
213
214
  }
@@ -281,7 +282,7 @@ function Fe({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: n,
281
282
  return !1;
282
283
  };
283
284
  }
284
- function V({ circular: e, createCustomConfig: t, strict: n }) {
285
+ function Ie({ circular: e, createCustomConfig: t, strict: n }) {
285
286
  let r = {
286
287
  areArrayBuffersEqual: fe,
287
288
  areArraysEqual: n ? P : pe,
@@ -311,12 +312,12 @@ function V({ circular: e, createCustomConfig: t, strict: n }) {
311
312
  }
312
313
  return r;
313
314
  }
314
- function Ie(e) {
315
+ function Le(e) {
315
316
  return function(t, n, r, i, a, o, s) {
316
317
  return e(t, n, s);
317
318
  };
318
319
  }
319
- function Le({ circular: e, comparator: t, createState: n, equals: r, strict: i }) {
320
+ function Re({ circular: e, comparator: t, createState: n, equals: r, strict: i }) {
320
321
  if (n) return function(a, o) {
321
322
  let { cache: s = e ? /* @__PURE__ */ new WeakMap() : void 0, meta: c } = n();
322
323
  return t(a, o, {
@@ -344,34 +345,34 @@ function Le({ circular: e, comparator: t, createState: n, equals: r, strict: i }
344
345
  return t(e, n, a);
345
346
  };
346
347
  }
347
- var Re = H();
348
- H({ strict: !0 }), H({ circular: !0 }), H({
348
+ var ze = V();
349
+ V({ strict: !0 }), V({ circular: !0 }), V({
349
350
  circular: !0,
350
351
  strict: !0
351
- }), H({ createInternalComparator: () => O }), H({
352
+ }), V({ createInternalComparator: () => O }), V({
352
353
  strict: !0,
353
354
  createInternalComparator: () => O
354
- }), H({
355
+ }), V({
355
356
  circular: !0,
356
357
  createInternalComparator: () => O
357
- }), H({
358
+ }), V({
358
359
  circular: !0,
359
360
  createInternalComparator: () => O,
360
361
  strict: !0
361
362
  });
362
- function H(e = {}) {
363
- let { circular: t = !1, createInternalComparator: n, createState: r, strict: i = !1 } = e, a = Fe(V(e));
364
- return Le({
363
+ function V(e = {}) {
364
+ let { circular: t = !1, createInternalComparator: n, createState: r, strict: i = !1 } = e, a = Fe(Ie(e));
365
+ return Re({
365
366
  circular: t,
366
367
  comparator: a,
367
368
  createState: r,
368
- equals: n ? n(a) : Ie(a),
369
+ equals: n ? n(a) : Le(a),
369
370
  strict: i
370
371
  });
371
372
  }
372
373
  //#endregion
373
374
  //#region node_modules/.pnpm/use-sync-external-store@1.7.0_react@19.2.5/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js
374
- var ze = /* @__PURE__ */ e(((e) => {
375
+ var Be = /* @__PURE__ */ e(((e) => {
375
376
  var t = S(), n = C();
376
377
  function r(e, t) {
377
378
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
@@ -416,7 +417,7 @@ var ze = /* @__PURE__ */ e(((e) => {
416
417
  f.hasValue = !0, f.value = p;
417
418
  }, [p]), l(p), p;
418
419
  };
419
- })), Be = /* @__PURE__ */ e(((e) => {
420
+ })), Ve = /* @__PURE__ */ e(((e) => {
420
421
  process.env.NODE_ENV !== "production" && (function() {
421
422
  function t(e, t) {
422
423
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
@@ -463,10 +464,10 @@ var ze = /* @__PURE__ */ e(((e) => {
463
464
  }, [p]), l(p), p;
464
465
  }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
465
466
  })();
466
- })), Ve = (/* @__PURE__ */ e(((e, t) => {
467
- t.exports = process.env.NODE_ENV === "production" ? ze() : Be();
467
+ })), He = (/* @__PURE__ */ e(((e, t) => {
468
+ t.exports = process.env.NODE_ENV === "production" ? Be() : Ve();
468
469
  })))();
469
- function He(e, r) {
470
+ function Ue(e, r) {
470
471
  if (e.isDestroyed || r.defaultPrevented || !r.cancelable || !e.isEditable || r.inputType !== "insertParagraph" && r.inputType !== "insertLineBreak" || !t() && !n()) return;
471
472
  let i = e.view, a = i.root, o = (a.getSelection?.call(a) ?? i.dom.ownerDocument.getSelection())?.anchorNode, s = (o?.nodeType === 1 ? o : o?.parentElement)?.closest("[data-node-view-content-react]");
472
473
  if (!s || !i.dom.contains(s)) return;
@@ -482,15 +483,15 @@ function He(e, r) {
482
483
  });
483
484
  i.someProp("handleKeyDown", (e) => e(i, l)) ? (r.preventDefault(), i.input.lastIOSEnter = 0, clearTimeout(i.input.lastIOSEnterFallbackTimeout)) : c === 13 && (i.input.lastKeyCode = c);
484
485
  }
485
- var U = new a("reactMobileEnter"), Ue = (...e) => (t) => {
486
+ var H = new a("reactMobileEnter"), We = (...e) => (t) => {
486
487
  e.forEach((e) => {
487
488
  typeof e == "function" ? e(t) : e && (e.current = t);
488
489
  });
489
- }, We = ({ contentComponent: e }) => {
490
+ }, Ge = ({ contentComponent: e }) => {
490
491
  let t = (0, w.useSyncExternalStore)(e.subscribe, e.getSnapshot, e.getServerSnapshot);
491
492
  return /* @__PURE__ */ x(b, { children: Object.values(t) });
492
493
  };
493
- function Ge() {
494
+ function Ke() {
494
495
  let e = /* @__PURE__ */ new Set(), t = {}, n = !1, r = () => {
495
496
  !n && e.size && (n = !0, queueMicrotask(() => {
496
497
  n = !1, e.forEach((e) => e());
@@ -520,7 +521,7 @@ function Ge() {
520
521
  }
521
522
  };
522
523
  }
523
- var Ke = class extends s.Component {
524
+ var qe = class extends s.Component {
524
525
  constructor(e) {
525
526
  super(e), this.editorContentRef = s.createRef();
526
527
  }
@@ -535,16 +536,16 @@ var Ke = class extends s.Component {
535
536
  if (e && !e.isDestroyed && e.view.dom?.parentNode) {
536
537
  if (e.contentComponent) return;
537
538
  let t = this.editorContentRef.current;
538
- t.append(...e.view.dom.parentNode.childNodes), e.setOptions({ element: t }), e.contentComponent = Ge(), e.createNodeViews(), e.registerPlugin(new i({
539
- key: U,
540
- props: { handleDOMEvents: { beforeinput: (t, n) => He(e, n) } }
539
+ t.append(...e.view.dom.parentNode.childNodes), e.setOptions({ element: t }), e.contentComponent = Ke(), e.createNodeViews(), e.registerPlugin(new i({
540
+ key: H,
541
+ props: { handleDOMEvents: { beforeinput: (t, n) => Ue(e, n) } }
541
542
  })), e.isEditorContentInitialized = !0, this.forceUpdate();
542
543
  }
543
544
  }
544
545
  componentWillUnmount() {
545
546
  let e = this.props.editor;
546
547
  if (e) {
547
- e.isEditorContentInitialized = !1, e.isDestroyed || (e.unregisterPlugin(U), e.view.setProps({ nodeViews: {} })), e.contentComponent = null;
548
+ e.isEditorContentInitialized = !1, e.isDestroyed || (e.unregisterPlugin(H), e.view.setProps({ nodeViews: {} })), e.contentComponent = null;
548
549
  try {
549
550
  if (!e.view.dom?.parentNode) return;
550
551
  let t = document.createElement("div");
@@ -555,18 +556,18 @@ var Ke = class extends s.Component {
555
556
  render() {
556
557
  let { editor: e, innerRef: t, ...n } = this.props;
557
558
  return /* @__PURE__ */ ee(b, { children: [/* @__PURE__ */ x("div", {
558
- ref: Ue(t, this.editorContentRef),
559
+ ref: We(t, this.editorContentRef),
559
560
  ...n
560
- }), e?.contentComponent && /* @__PURE__ */ x(We, { contentComponent: e.contentComponent })] });
561
+ }), e?.contentComponent && /* @__PURE__ */ x(Ge, { contentComponent: e.contentComponent })] });
561
562
  }
562
- }, qe = l((e, t) => {
563
+ }, Je = l((e, t) => {
563
564
  let n = s.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
564
- return s.createElement(Ke, {
565
+ return s.createElement(qe, {
565
566
  key: n,
566
567
  innerRef: t,
567
568
  ...e
568
569
  });
569
- }), W = s.memo(qe), Je = typeof window < "u" ? p : f, Ye = class {
570
+ }), U = s.memo(Je), Ye = typeof window < "u" ? p : f, Xe = class {
570
571
  constructor(e) {
571
572
  this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = e, this.lastSnapshot = {
572
573
  editor: e,
@@ -574,10 +575,10 @@ var Ke = class extends s.Component {
574
575
  }, this.getSnapshot = this.getSnapshot.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.watch = this.watch.bind(this), this.subscribe = this.subscribe.bind(this);
575
576
  }
576
577
  getSnapshot() {
577
- return this.transactionNumber === this.lastTransactionNumber ? this.lastSnapshot : (this.lastTransactionNumber = this.transactionNumber, this.lastSnapshot = {
578
+ return this.transactionNumber === this.lastTransactionNumber || (this.lastTransactionNumber = this.transactionNumber, this.lastSnapshot = {
578
579
  editor: this.editor,
579
580
  transactionNumber: this.transactionNumber
580
- }, this.lastSnapshot);
581
+ }), this.lastSnapshot;
581
582
  }
582
583
  getServerSnapshot() {
583
584
  return {
@@ -601,11 +602,11 @@ var Ke = class extends s.Component {
601
602
  }
602
603
  }
603
604
  };
604
- function G(e) {
605
- let [t] = g(() => new Ye(e.editor)), n = (0, Ve.useSyncExternalStoreWithSelector)(t.subscribe, t.getSnapshot, t.getServerSnapshot, e.selector, e.equalityFn ?? Re);
606
- return Je(() => t.watch(e.editor), [e.editor, t]), d(n), n;
605
+ function W(e) {
606
+ let [t] = g(() => new Xe(e.editor)), n = (0, He.useSyncExternalStoreWithSelector)(t.subscribe, t.getSnapshot, t.getServerSnapshot, e.selector, e.equalityFn ?? ze);
607
+ return Ye(() => t.watch(e.editor), [e.editor, t]), d(n), n;
607
608
  }
608
- var K = process.env.NODE_ENV !== "production", q = typeof window > "u", Xe = q || !!(typeof window < "u" && window.next), Ze = class e {
609
+ var G = process.env.NODE_ENV !== "production", K = typeof window > "u", Ze = K || !!(typeof window < "u" && window.next), Qe = class e {
609
610
  constructor(e) {
610
611
  this.editor = null, this.subscriptions = /* @__PURE__ */ new Set(), this.isComponentMounted = !1, this.previousDeps = null, this.instanceId = "", this.options = e, this.subscriptions = /* @__PURE__ */ new Set(), this.setEditor(this.getInitialEditor()), this.scheduleDestroy(), this.getEditor = this.getEditor.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.subscribe = this.subscribe.bind(this), this.refreshEditorInstance = this.refreshEditorInstance.bind(this), this.scheduleDestroy = this.scheduleDestroy.bind(this), this.onRender = this.onRender.bind(this), this.createEditor = this.createEditor.bind(this);
611
612
  }
@@ -614,7 +615,7 @@ var K = process.env.NODE_ENV !== "production", q = typeof window > "u", Xe = q |
614
615
  }
615
616
  getInitialEditor() {
616
617
  let e = this.options.current.immediatelyRender, t = e ?? !0;
617
- return q ? (t && K && console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"), t = !1) : Xe && e === void 0 && (t = !1, K && console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")), t ? this.createEditor() : null;
618
+ return K ? (t && G && console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"), t = !1) : Ze && e === void 0 && (t = !1, G && console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")), t ? this.createEditor() : null;
618
619
  }
619
620
  createEditor() {
620
621
  let e = {
@@ -725,32 +726,28 @@ var K = process.env.NODE_ENV !== "production", q = typeof window > "u", Xe = q |
725
726
  scheduleDestroy() {
726
727
  let e = this.instanceId, t = this.editor;
727
728
  this.scheduledDestructionTimeout = setTimeout(() => {
728
- if (this.isComponentMounted && this.instanceId === e) {
729
- t && t.setOptions(this.options.current);
730
- return;
731
- }
732
- t && !t.isDestroyed && (t.destroy(), this.instanceId === e && this.setEditor(null));
729
+ this.isComponentMounted && this.instanceId === e ? t && t.setOptions(this.options.current) : t && !t.isDestroyed && (t.destroy(), this.instanceId === e && this.setEditor(null));
733
730
  }, 1);
734
731
  }
735
732
  };
736
- function Qe(e = {}, t = []) {
733
+ function $e(e = {}, t = []) {
737
734
  let n = h(e);
738
735
  n.current = e;
739
- let [r] = g(() => new Ze(n)), i = (0, w.useSyncExternalStore)(r.subscribe, r.getEditor, r.getServerSnapshot);
740
- return d(i), f(r.onRender(t)), G({
736
+ let [r] = g(() => new Qe(n)), i = (0, w.useSyncExternalStore)(r.subscribe, r.getEditor, r.getServerSnapshot);
737
+ return d(i), f(r.onRender(t)), W({
741
738
  editor: i,
742
739
  selector: ({ transactionNumber: t }) => e.shouldRerenderOnTransaction === !1 || e.shouldRerenderOnTransaction === void 0 ? null : e.immediatelyRender && t === 0 ? 0 : t + 1
743
740
  }), i;
744
741
  }
745
- var J = c({ editor: null });
746
- J.Consumer;
747
- var $e = () => u(J), et = c({
742
+ var q = c({ editor: null });
743
+ q.Consumer;
744
+ var et = () => u(q), tt = c({
748
745
  onDragStart: () => {},
749
746
  nodeViewContentChildren: void 0,
750
747
  nodeViewContentRef: () => {}
751
- }), tt = () => u(et);
748
+ }), nt = () => u(tt);
752
749
  s.forwardRef((e, t) => {
753
- let { onDragStart: n } = tt(), r = e.as || "div";
750
+ let { onDragStart: n } = nt(), r = e.as || "div";
754
751
  return /* @__PURE__ */ x(r, {
755
752
  ...e,
756
753
  ref: t,
@@ -762,20 +759,20 @@ s.forwardRef((e, t) => {
762
759
  }
763
760
  });
764
761
  });
765
- function Y(e) {
762
+ function J(e) {
766
763
  return !!(typeof e == "function" && e.prototype && e.prototype.isReactComponent);
767
764
  }
768
- function X(e) {
765
+ function Y(e) {
769
766
  return !(typeof e != "object" || !e.$$typeof || e.$$typeof.toString() !== "Symbol(react.forward_ref)" && e.$$typeof.description !== "react.forward_ref");
770
767
  }
771
- function nt(e) {
768
+ function rt(e) {
772
769
  return !(typeof e != "object" || !e.$$typeof || e.$$typeof.toString() !== "Symbol(react.memo)" && e.$$typeof.description !== "react.memo");
773
770
  }
774
- function rt(e) {
775
- if (Y(e) || X(e)) return !0;
776
- if (nt(e)) {
771
+ function X(e) {
772
+ if (J(e) || Y(e)) return !0;
773
+ if (rt(e)) {
777
774
  let t = e.type;
778
- if (t) return Y(t) || X(t);
775
+ if (t) return J(t) || Y(t);
779
776
  }
780
777
  return !1;
781
778
  }
@@ -796,7 +793,7 @@ var at = class {
796
793
  render() {
797
794
  var e;
798
795
  if (this.destroyed) return;
799
- let t = this.component, n = this.props, r = this.editor, i = it(), a = rt(t), o = { ...n };
796
+ let t = this.component, n = this.props, r = this.editor, i = it(), a = X(t), o = { ...n };
800
797
  o.ref && !(i || a) && delete o.ref, !o.ref && (i || a) && (o.ref = (e) => {
801
798
  this.ref = e;
802
799
  }), this.reactElement = /* @__PURE__ */ x(t, { ...o }), r == null || (e = r.contentComponent) == null || e.setRenderer(this.id, this);
@@ -841,7 +838,7 @@ function Q({ children: e, ...t }) {
841
838
  let n = "editor" in t ? t.editor : t.instance;
842
839
  if (!n) throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");
843
840
  let r = m(() => ({ editor: n }), [n]), i = m(() => ({ editor: n }), [n]);
844
- return /* @__PURE__ */ x(J.Provider, {
841
+ return /* @__PURE__ */ x(q.Provider, {
845
842
  value: i,
846
843
  children: /* @__PURE__ */ x(Z.Provider, {
847
844
  value: r,
@@ -852,11 +849,11 @@ function Q({ children: e, ...t }) {
852
849
  Q.displayName = "Tiptap";
853
850
  function $({ ...e }) {
854
851
  let { editor: t } = ot();
855
- return /* @__PURE__ */ x(W, {
852
+ return /* @__PURE__ */ x(U, {
856
853
  editor: t,
857
854
  ...e
858
855
  });
859
856
  }
860
857
  $.displayName = "Tiptap.Content", Object.assign(Q, { Content: $ });
861
858
  //#endregion
862
- export { G as a, Qe as i, at as n, $e as r, W as t };
859
+ export { W as a, $e as i, at as n, et as r, U as t };
@@ -1,4 +1,4 @@
1
- import { i as e } from "./table-layout-Dt7KmVp_.js";
1
+ import { i as e } from "./table-layout-ClqaGg1E.js";
2
2
  import { CALLOUT_VARIANTS as t } from "./components/Scribe/extension/callout.js";
3
3
  import { EXTERNAL_LINK_PREVIEW_DISPLAYS as n } from "./components/Scribe/extension/external-link-preview/types.js";
4
4
  //#region lib/document-node-capabilities.ts
@@ -1,4 +1,4 @@
1
- import { n as e, r as t, t as n } from "./schema-extensions-CzDKrIf8.js";
1
+ import { n as e, r as t, t as n } from "./schema-extensions-B9hR1VrD.js";
2
2
  import r from "./components/Scribe/extension/extension-markdown-paste.js";
3
3
  import { SlashCommand as i } from "./components/Scribe/extension/slashCommand/index.js";
4
4
  import a from "./components/Scribe/extension/extension-selectedText.js";
@@ -1,4 +1,4 @@
1
- import { B as e, R as t, b as n, d as r, g as i, h as a, i as o, n as s, o as c, p as l, r as u, u as d, y as f, z as p } from "./dist-DGEcUiqG.js";
1
+ import { B as e, R as t, b as n, d as r, g as i, h as a, i as o, n as s, o as c, p as l, r as u, u as d, y as f, z as p } from "./dist-BoAzo5MN.js";
2
2
  import { Plugin as m, PluginKey as h } from "@tiptap/pm/state";
3
3
  import { ReplaceStep as g } from "@tiptap/pm/transform";
4
4
  import { isHistoryTransaction as _ } from "@tiptap/pm/history";
@@ -607,11 +607,7 @@ function It(e, t) {
607
607
  function Lt(e, t) {
608
608
  let n = 0, r = 0;
609
609
  for (; r < t;) {
610
- if (e[r] !== "`") {
611
- r += 1;
612
- continue;
613
- }
614
- if (n === 0 && It(e, r)) {
610
+ if (e[r] !== "`" || n === 0 && It(e, r)) {
615
611
  r += 1;
616
612
  continue;
617
613
  }
@@ -723,11 +719,7 @@ var Gt = o.create({
723
719
  exitable: !0,
724
720
  onCreate() {
725
721
  this.options.validate && !this.options.shouldAutoLink && (this.options.shouldAutoLink = this.options.validate, console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")), this.options.protocols.forEach((e) => {
726
- if (typeof e == "string") {
727
- xt(e);
728
- return;
729
- }
730
- xt(e.scheme, e.optionalSlashes);
722
+ typeof e == "string" ? xt(e) : xt(e.scheme, e.optionalSlashes);
731
723
  });
732
724
  },
733
725
  onDestroy() {
@@ -1,5 +1,5 @@
1
1
  import { normalizeExternalLinkPreviewElement as e, normalizeExternalLinkPreviewsInTree as t } from "./components/Scribe/extension/external-link-preview/serialization.js";
2
- import { t as n } from "./purify.es-q6CUdJQi.js";
2
+ import { t as n } from "./purify.es-CSWcs7f1.js";
3
3
  //#region node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.browser.es.js
4
4
  function r(e) {
5
5
  for (var t = 1; t < arguments.length; t++) {
package/dist/main.css CHANGED
@@ -415,6 +415,7 @@
415
415
 
416
416
  .scribe-link-popover {
417
417
  background: var(--color-panel-solid);
418
+ box-sizing: border-box;
418
419
  border: 1px solid var(--gray-6);
419
420
  border-radius: 12px;
420
421
  box-shadow:
package/dist/main.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { CALLOUT_VARIANTS as e, CALLOUT_VARIANT_LABELS as t, Callout as n, DEFAULT_CALLOUT_VARIANT as r, isCalloutVariant as i } from "./components/Scribe/extension/callout.js";
2
2
  import { EXTERNAL_LINK_PREVIEW_DISPLAYS as a } from "./components/Scribe/extension/external-link-preview/types.js";
3
3
  import { EXTERNAL_LINK_PREVIEW_NODE_NAME as o } from "./components/Scribe/extension/external-link-preview/attributes.js";
4
- import { t as s } from "./html-to-markdown-DF93it73.js";
5
- import { t as c } from "./markdown-to-html-BoK5O_j-.js";
4
+ import { t as s } from "./html-to-markdown-DeRG9OPm.js";
5
+ import { t as c } from "./markdown-to-html-tCPjQ5u6.js";
6
6
  import { isInViewport as l } from "./utils/is-in-viewport.js";
7
7
  import { convertLegacyMathDelimiters as u } from "./utils/convert-legacy-math-delimiters.js";
8
8
  import { SuggestionItemType as d } from "./components/Scribe/extension/slashCommand/items.js";