@clevertask/scribe 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +60 -16
  2. package/dist/{BarMenu-BDtEfu-R.js → BarMenu-DaKIz3zZ.js} +1 -1
  3. package/dist/assets/index.css +1 -1
  4. package/dist/components/Menu/BarMenu.js +2 -2
  5. package/dist/components/Menu/BubbleMenu.js +78 -74
  6. package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
  7. package/dist/components/Scribe/extension/emoji/suggest.js +1 -1
  8. package/dist/components/Scribe/extension/extension-link.js +1 -1
  9. package/dist/components/Scribe/extension/extension-markdown-paste.js +2 -2
  10. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  11. package/dist/components/Scribe/extension/index.d.ts +17 -2
  12. package/dist/components/Scribe/extension/index.d.ts.map +1 -1
  13. package/dist/components/Scribe/extension/index.js +2655 -2580
  14. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +1616 -1618
  15. package/dist/components/Scribe/extension/slashCommand/index.js +2 -2
  16. package/dist/components/Scribe/extension/slashCommand/renderItems.js +1 -1
  17. package/dist/components/Scribe/extension/tableOfContents.d.ts +49 -0
  18. package/dist/components/Scribe/extension/tableOfContents.d.ts.map +1 -0
  19. package/dist/components/Scribe/extension/tableOfContents.js +181 -0
  20. package/dist/components/Scribe/index.d.ts +12 -0
  21. package/dist/components/Scribe/index.d.ts.map +1 -1
  22. package/dist/components/Scribe/index.js +108 -65
  23. package/dist/{extension-link-D3eyOFkn.js → extension-link-Ch_T7WWG.js} +1 -1
  24. package/dist/{index-hHvpW2H6.js → index-BiBV5TQx.js} +1287 -1250
  25. package/dist/{index-FY_iYS6i.js → index-CqzMmrnw.js} +1 -1
  26. package/dist/{index-PJNQPLn5.js → index-DxF-1P4n.js} +196 -203
  27. package/dist/index-V-gN11Y9.js +249 -0
  28. package/dist/main.js +1 -1
  29. package/dist/{markdown-to-html-BwS08CTi.js → markdown-to-html-pL7ckd-m.js} +14 -14
  30. package/dist/purify.es-exIQuqhb.js +595 -0
  31. package/dist/utils/create-scribe-editor.js +3 -3
  32. package/dist/utils/html-to-markdown.js +226 -306
  33. package/dist/utils/index.js +1 -1
  34. package/dist/utils/markdown-to-html.js +2 -2
  35. package/package.json +30 -30
  36. package/dist/index-DZylq4Bc.js +0 -232
  37. package/dist/purify.es-BPDBzHtc.js +0 -552
@@ -1,27 +1,27 @@
1
- import A, { useState as ce, useDebugValue as le, forwardRef as fe, version as z, useLayoutEffect as de, useEffect as he, useContext as B, createContext as U, useMemo as k } from "react";
2
- import pe, { flushSync as me } from "react-dom";
3
- import { jsx as R, jsxs as Ee, Fragment as ie } from "react/jsx-runtime";
4
- var L = { exports: {} }, I = {};
1
+ import R, { useState as ce, useDebugValue as fe, forwardRef as le, version as k, useLayoutEffect as de, useEffect as pe, useContext as U, createContext as B, useMemo as z } from "react";
2
+ import he, { flushSync as me } from "react-dom";
3
+ import { jsx as w, jsxs as Ee, Fragment as ie } from "react/jsx-runtime";
4
+ var L = { exports: {} }, D = {};
5
5
  var K;
6
6
  function ve() {
7
- if (K) return I;
7
+ if (K) return D;
8
8
  K = 1;
9
- var e = A;
9
+ var e = R;
10
10
  function t(d, E) {
11
11
  return d === E && (d !== 0 || 1 / d === 1 / E) || d !== d && E !== E;
12
12
  }
13
13
  var r = typeof Object.is == "function" ? Object.is : t, n = e.useState, o = e.useEffect, a = e.useLayoutEffect, u = e.useDebugValue;
14
14
  function s(d, E) {
15
- var c = E(), f = n({ inst: { value: c, getSnapshot: E } }), p = f[0].inst, i = f[1];
15
+ var c = E(), l = n({ inst: { value: c, getSnapshot: E } }), h = l[0].inst, i = l[1];
16
16
  return a(
17
17
  function() {
18
- p.value = c, p.getSnapshot = E, y(p) && i({ inst: p });
18
+ h.value = c, h.getSnapshot = E, y(h) && i({ inst: h });
19
19
  },
20
20
  [d, c, E]
21
21
  ), o(
22
22
  function() {
23
- return y(p) && i({ inst: p }), d(function() {
24
- y(p) && i({ inst: p });
23
+ return y(h) && i({ inst: h }), d(function() {
24
+ y(h) && i({ inst: h });
25
25
  });
26
26
  },
27
27
  [d]
@@ -40,69 +40,69 @@ function ve() {
40
40
  function v(d, E) {
41
41
  return E();
42
42
  }
43
- var h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : s;
44
- return I.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : h, I;
43
+ var p = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : s;
44
+ return D.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : p, D;
45
45
  }
46
- var D = {};
46
+ var I = {};
47
47
  var H;
48
48
  function ye() {
49
49
  return H || (H = 1, process.env.NODE_ENV !== "production" && (function() {
50
- function e(c, f) {
51
- return c === f && (c !== 0 || 1 / c === 1 / f) || c !== c && f !== f;
50
+ function e(c, l) {
51
+ return c === l && (c !== 0 || 1 / c === 1 / l) || c !== c && l !== l;
52
52
  }
53
- function t(c, f) {
54
- h || o.startTransition === void 0 || (h = !0, console.error(
53
+ function t(c, l) {
54
+ p || o.startTransition === void 0 || (p = !0, console.error(
55
55
  "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
56
56
  ));
57
- var p = f();
57
+ var h = l();
58
58
  if (!d) {
59
- var i = f();
60
- a(p, i) || (console.error(
59
+ var i = l();
60
+ a(h, i) || (console.error(
61
61
  "The result of getSnapshot should be cached to avoid an infinite loop"
62
62
  ), d = !0);
63
63
  }
64
64
  i = u({
65
- inst: { value: p, getSnapshot: f }
65
+ inst: { value: h, getSnapshot: l }
66
66
  });
67
- var l = i[0].inst, m = i[1];
67
+ var f = i[0].inst, m = i[1];
68
68
  return y(
69
69
  function() {
70
- l.value = p, l.getSnapshot = f, r(l) && m({ inst: l });
70
+ f.value = h, f.getSnapshot = l, r(f) && m({ inst: f });
71
71
  },
72
- [c, p, f]
72
+ [c, h, l]
73
73
  ), s(
74
74
  function() {
75
- return r(l) && m({ inst: l }), c(function() {
76
- r(l) && m({ inst: l });
75
+ return r(f) && m({ inst: f }), c(function() {
76
+ r(f) && m({ inst: f });
77
77
  });
78
78
  },
79
79
  [c]
80
- ), v(p), p;
80
+ ), v(h), h;
81
81
  }
82
82
  function r(c) {
83
- var f = c.getSnapshot;
83
+ var l = c.getSnapshot;
84
84
  c = c.value;
85
85
  try {
86
- var p = f();
87
- return !a(c, p);
86
+ var h = l();
87
+ return !a(c, h);
88
88
  } catch {
89
89
  return !0;
90
90
  }
91
91
  }
92
- function n(c, f) {
93
- return f();
92
+ function n(c, l) {
93
+ return l();
94
94
  }
95
95
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
96
- var o = A, a = typeof Object.is == "function" ? Object.is : e, u = o.useState, s = o.useEffect, y = o.useLayoutEffect, v = o.useDebugValue, h = !1, d = !1, E = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? n : t;
97
- D.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : E, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
98
- })()), D;
96
+ var o = R, a = typeof Object.is == "function" ? Object.is : e, u = o.useState, s = o.useEffect, y = o.useLayoutEffect, v = o.useDebugValue, p = !1, d = !1, E = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? n : t;
97
+ I.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : E, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
98
+ })()), I;
99
99
  }
100
100
  var F;
101
101
  function $() {
102
102
  return F || (F = 1, process.env.NODE_ENV === "production" ? L.exports = ve() : L.exports = ye()), L.exports;
103
103
  }
104
104
  var _e = $();
105
- const { getOwnPropertyNames: Se, getOwnPropertySymbols: Oe } = Object, { hasOwnProperty: be } = Object.prototype;
105
+ const { getOwnPropertyNames: Se, getOwnPropertySymbols: Oe } = Object, { hasOwnProperty: ge } = Object.prototype;
106
106
  function x(e, t) {
107
107
  return function(n, o, a) {
108
108
  return e(n, o, a) && t(n, o, a);
@@ -120,21 +120,21 @@ function q(e) {
120
120
  return a.delete(r), a.delete(n), y;
121
121
  };
122
122
  }
123
- function ge(e) {
123
+ function Ae(e) {
124
124
  return e?.[Symbol.toStringTag];
125
125
  }
126
126
  function Y(e) {
127
127
  return Se(e).concat(Oe(e));
128
128
  }
129
- const Ae = (
129
+ const Re = (
130
130
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
131
- Object.hasOwn || ((e, t) => be.call(e, t))
131
+ Object.hasOwn || ((e, t) => ge.call(e, t))
132
132
  );
133
- function C(e, t) {
133
+ function T(e, t) {
134
134
  return e === t || !e && !t && e !== e && t !== t;
135
135
  }
136
- const Re = "__v", we = "__o", Ce = "_owner", { getOwnPropertyDescriptor: J, keys: X } = Object;
137
- function Te(e, t) {
136
+ const we = "__v", be = "__o", Te = "_owner", { getOwnPropertyDescriptor: J, keys: X } = Object;
137
+ function Ce(e, t) {
138
138
  return e.byteLength === t.byteLength && V(new Uint8Array(e), new Uint8Array(t));
139
139
  }
140
140
  function je(e, t, r) {
@@ -150,7 +150,7 @@ function Le(e, t) {
150
150
  return e.byteLength === t.byteLength && V(new Uint8Array(e.buffer, e.byteOffset, e.byteLength), new Uint8Array(t.buffer, t.byteOffset, t.byteLength));
151
151
  }
152
152
  function qe(e, t) {
153
- return C(e.getTime(), t.getTime());
153
+ return T(e.getTime(), t.getTime());
154
154
  }
155
155
  function Ne(e, t) {
156
156
  return e.name === t.name && e.message === t.message && e.cause === t.cause && e.stack === t.stack;
@@ -168,7 +168,7 @@ function Z(e, t, r) {
168
168
  let u, s, y = 0;
169
169
  for (; (u = a.next()) && !u.done; ) {
170
170
  const v = t.entries();
171
- let h = !1, d = 0;
171
+ let p = !1, d = 0;
172
172
  for (; (s = v.next()) && !s.done; ) {
173
173
  if (o[d]) {
174
174
  d++;
@@ -176,19 +176,19 @@ function Z(e, t, r) {
176
176
  }
177
177
  const E = u.value, c = s.value;
178
178
  if (r.equals(E[0], c[0], y, d, e, t, r) && r.equals(E[1], c[1], E[0], c[0], e, t, r)) {
179
- h = o[d] = !0;
179
+ p = o[d] = !0;
180
180
  break;
181
181
  }
182
182
  d++;
183
183
  }
184
- if (!h)
184
+ if (!p)
185
185
  return !1;
186
186
  y++;
187
187
  }
188
188
  return !0;
189
189
  }
190
- const Ie = C;
191
- function De(e, t, r) {
190
+ const De = T;
191
+ function Ie(e, t, r) {
192
192
  const n = X(e);
193
193
  let o = n.length;
194
194
  if (X(t).length !== o)
@@ -210,7 +210,7 @@ function j(e, t, r) {
210
210
  return !0;
211
211
  }
212
212
  function xe(e, t) {
213
- return C(e.valueOf(), t.valueOf());
213
+ return T(e.valueOf(), t.valueOf());
214
214
  }
215
215
  function Me(e, t) {
216
216
  return e.source === t.source && e.flags === t.flags;
@@ -225,13 +225,13 @@ function Q(e, t, r) {
225
225
  let u, s;
226
226
  for (; (u = a.next()) && !u.done; ) {
227
227
  const y = t.values();
228
- let v = !1, h = 0;
228
+ let v = !1, p = 0;
229
229
  for (; (s = y.next()) && !s.done; ) {
230
- if (!o[h] && r.equals(u.value, s.value, u.value, s.value, e, t, r)) {
231
- v = o[h] = !0;
230
+ if (!o[p] && r.equals(u.value, s.value, u.value, s.value, e, t, r)) {
231
+ v = o[p] = !0;
232
232
  break;
233
233
  }
234
- h++;
234
+ p++;
235
235
  }
236
236
  if (!v)
237
237
  return !1;
@@ -251,9 +251,9 @@ function Ge(e, t) {
251
251
  return e.hostname === t.hostname && e.pathname === t.pathname && e.protocol === t.protocol && e.port === t.port && e.hash === t.hash && e.username === t.username && e.password === t.password;
252
252
  }
253
253
  function ue(e, t, r, n) {
254
- return (n === Ce || n === we || n === Re) && (e.$$typeof || t.$$typeof) ? !0 : Ae(t, n) && r.equals(e[n], t[n], n, n, e, t, r);
254
+ return (n === Te || n === be || n === we) && (e.$$typeof || t.$$typeof) ? !0 : Re(t, n) && r.equals(e[n], t[n], n, n, e, t, r);
255
255
  }
256
- const Be = "[object ArrayBuffer]", Ue = "[object Arguments]", $e = "[object Boolean]", Pe = "[object DataView]", We = "[object Date]", ze = "[object Error]", ke = "[object Map]", Ke = "[object Number]", He = "[object Object]", Fe = "[object RegExp]", Ye = "[object Set]", Je = "[object String]", Xe = {
256
+ const Ue = "[object ArrayBuffer]", Be = "[object Arguments]", $e = "[object Boolean]", Pe = "[object DataView]", We = "[object Date]", ke = "[object Error]", ze = "[object Map]", Ke = "[object Number]", He = "[object Object]", Fe = "[object RegExp]", Ye = "[object Set]", Je = "[object String]", Xe = {
257
257
  "[object Int8Array]": !0,
258
258
  "[object Uint8Array]": !0,
259
259
  "[object Uint8ClampedArray]": !0,
@@ -267,80 +267,80 @@ const Be = "[object ArrayBuffer]", Ue = "[object Arguments]", $e = "[object Bool
267
267
  "[object BigInt64Array]": !0,
268
268
  "[object BigUint64Array]": !0
269
269
  }, Ze = "[object URL]", Qe = Object.prototype.toString;
270
- function et({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: r, areDatesEqual: n, areErrorsEqual: o, areFunctionsEqual: a, areMapsEqual: u, areNumbersEqual: s, areObjectsEqual: y, arePrimitiveWrappersEqual: v, areRegExpsEqual: h, areSetsEqual: d, areTypedArraysEqual: E, areUrlsEqual: c, unknownTagComparators: f }) {
271
- return function(i, l, m) {
272
- if (i === l)
270
+ function et({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: r, areDatesEqual: n, areErrorsEqual: o, areFunctionsEqual: a, areMapsEqual: u, areNumbersEqual: s, areObjectsEqual: y, arePrimitiveWrappersEqual: v, areRegExpsEqual: p, areSetsEqual: d, areTypedArraysEqual: E, areUrlsEqual: c, unknownTagComparators: l }) {
271
+ return function(i, f, m) {
272
+ if (i === f)
273
273
  return !0;
274
- if (i == null || l == null)
274
+ if (i == null || f == null)
275
275
  return !1;
276
- const g = typeof i;
277
- if (g !== typeof l)
276
+ const A = typeof i;
277
+ if (A !== typeof f)
278
278
  return !1;
279
- if (g !== "object")
280
- return g === "number" ? s(i, l, m) : g === "function" ? a(i, l, m) : !1;
279
+ if (A !== "object")
280
+ return A === "number" ? s(i, f, m) : A === "function" ? a(i, f, m) : !1;
281
281
  const O = i.constructor;
282
- if (O !== l.constructor)
282
+ if (O !== f.constructor)
283
283
  return !1;
284
284
  if (O === Object)
285
- return y(i, l, m);
285
+ return y(i, f, m);
286
286
  if (Array.isArray(i))
287
- return t(i, l, m);
287
+ return t(i, f, m);
288
288
  if (O === Date)
289
- return n(i, l, m);
289
+ return n(i, f, m);
290
290
  if (O === RegExp)
291
- return h(i, l, m);
291
+ return p(i, f, m);
292
292
  if (O === Map)
293
- return u(i, l, m);
293
+ return u(i, f, m);
294
294
  if (O === Set)
295
- return d(i, l, m);
295
+ return d(i, f, m);
296
296
  const S = Qe.call(i);
297
297
  if (S === We)
298
- return n(i, l, m);
298
+ return n(i, f, m);
299
299
  if (S === Fe)
300
- return h(i, l, m);
301
- if (S === ke)
302
- return u(i, l, m);
300
+ return p(i, f, m);
301
+ if (S === ze)
302
+ return u(i, f, m);
303
303
  if (S === Ye)
304
- return d(i, l, m);
304
+ return d(i, f, m);
305
305
  if (S === He)
306
- return typeof i.then != "function" && typeof l.then != "function" && y(i, l, m);
306
+ return typeof i.then != "function" && typeof f.then != "function" && y(i, f, m);
307
307
  if (S === Ze)
308
- return c(i, l, m);
309
- if (S === ze)
310
- return o(i, l, m);
311
- if (S === Ue)
312
- return y(i, l, m);
313
- if (Xe[S])
314
- return E(i, l, m);
308
+ return c(i, f, m);
309
+ if (S === ke)
310
+ return o(i, f, m);
315
311
  if (S === Be)
316
- return e(i, l, m);
312
+ return y(i, f, m);
313
+ if (Xe[S])
314
+ return E(i, f, m);
315
+ if (S === Ue)
316
+ return e(i, f, m);
317
317
  if (S === Pe)
318
- return r(i, l, m);
318
+ return r(i, f, m);
319
319
  if (S === $e || S === Ke || S === Je)
320
- return v(i, l, m);
321
- if (f) {
322
- let _ = f[S];
320
+ return v(i, f, m);
321
+ if (l) {
322
+ let _ = l[S];
323
323
  if (!_) {
324
- const b = ge(i);
325
- b && (_ = f[b]);
324
+ const g = Ae(i);
325
+ g && (_ = l[g]);
326
326
  }
327
327
  if (_)
328
- return _(i, l, m);
328
+ return _(i, f, m);
329
329
  }
330
330
  return !1;
331
331
  };
332
332
  }
333
333
  function tt({ circular: e, createCustomConfig: t, strict: r }) {
334
334
  let n = {
335
- areArrayBuffersEqual: Te,
335
+ areArrayBuffersEqual: Ce,
336
336
  areArraysEqual: r ? j : je,
337
337
  areDataViewsEqual: Le,
338
338
  areDatesEqual: qe,
339
339
  areErrorsEqual: Ne,
340
340
  areFunctionsEqual: Ve,
341
341
  areMapsEqual: r ? x(Z, j) : Z,
342
- areNumbersEqual: Ie,
343
- areObjectsEqual: r ? j : De,
342
+ areNumbersEqual: De,
343
+ areObjectsEqual: r ? j : Ie,
344
344
  arePrimitiveWrappersEqual: xe,
345
345
  areRegExpsEqual: Me,
346
346
  areSetsEqual: r ? x(Q, j) : Q,
@@ -367,11 +367,11 @@ function rt(e) {
367
367
  function nt({ circular: e, comparator: t, createState: r, equals: n, strict: o }) {
368
368
  if (r)
369
369
  return function(s, y) {
370
- const { cache: v = e ? /* @__PURE__ */ new WeakMap() : void 0, meta: h } = r();
370
+ const { cache: v = e ? /* @__PURE__ */ new WeakMap() : void 0, meta: p } = r();
371
371
  return t(s, y, {
372
372
  cache: v,
373
373
  equals: n,
374
- meta: h,
374
+ meta: p,
375
375
  strict: o
376
376
  });
377
377
  };
@@ -394,30 +394,30 @@ function nt({ circular: e, comparator: t, createState: r, equals: n, strict: o }
394
394
  return t(s, y, a);
395
395
  };
396
396
  }
397
- const ot = w();
398
- w({ strict: !0 });
399
- w({ circular: !0 });
400
- w({
397
+ const ot = b();
398
+ b({ strict: !0 });
399
+ b({ circular: !0 });
400
+ b({
401
401
  circular: !0,
402
402
  strict: !0
403
403
  });
404
- w({
405
- createInternalComparator: () => C
404
+ b({
405
+ createInternalComparator: () => T
406
406
  });
407
- w({
407
+ b({
408
408
  strict: !0,
409
- createInternalComparator: () => C
409
+ createInternalComparator: () => T
410
410
  });
411
- w({
411
+ b({
412
412
  circular: !0,
413
- createInternalComparator: () => C
413
+ createInternalComparator: () => T
414
414
  });
415
- w({
415
+ b({
416
416
  circular: !0,
417
- createInternalComparator: () => C,
417
+ createInternalComparator: () => T,
418
418
  strict: !0
419
419
  });
420
- function w(e = {}) {
420
+ function b(e = {}) {
421
421
  const { circular: t = !1, createInternalComparator: r, createState: n, strict: o = !1 } = e, a = tt(e), u = et(a), s = r ? r(u) : rt(u);
422
422
  return nt({ circular: t, comparator: u, createState: n, equals: s, strict: o });
423
423
  }
@@ -426,48 +426,48 @@ var ee;
426
426
  function it() {
427
427
  if (ee) return M;
428
428
  ee = 1;
429
- var e = A, t = $();
430
- function r(v, h) {
431
- return v === h && (v !== 0 || 1 / v === 1 / h) || v !== v && h !== h;
429
+ var e = R, t = $();
430
+ function r(v, p) {
431
+ return v === p && (v !== 0 || 1 / v === 1 / p) || v !== v && p !== p;
432
432
  }
433
433
  var n = typeof Object.is == "function" ? Object.is : r, o = t.useSyncExternalStore, a = e.useRef, u = e.useEffect, s = e.useMemo, y = e.useDebugValue;
434
- return M.useSyncExternalStoreWithSelector = function(v, h, d, E, c) {
435
- var f = a(null);
436
- if (f.current === null) {
437
- var p = { hasValue: !1, value: null };
438
- f.current = p;
439
- } else p = f.current;
440
- f = s(
434
+ return M.useSyncExternalStoreWithSelector = function(v, p, d, E, c) {
435
+ var l = a(null);
436
+ if (l.current === null) {
437
+ var h = { hasValue: !1, value: null };
438
+ l.current = h;
439
+ } else h = l.current;
440
+ l = s(
441
441
  function() {
442
- function l(_) {
442
+ function f(_) {
443
443
  if (!m) {
444
- if (m = !0, g = _, _ = E(_), c !== void 0 && p.hasValue) {
445
- var b = p.value;
446
- if (c(b, _))
447
- return O = b;
444
+ if (m = !0, A = _, _ = E(_), c !== void 0 && h.hasValue) {
445
+ var g = h.value;
446
+ if (c(g, _))
447
+ return O = g;
448
448
  }
449
449
  return O = _;
450
450
  }
451
- if (b = O, n(g, _)) return b;
452
- var T = E(_);
453
- return c !== void 0 && c(b, T) ? (g = _, b) : (g = _, O = T);
451
+ if (g = O, n(A, _)) return g;
452
+ var C = E(_);
453
+ return c !== void 0 && c(g, C) ? (A = _, g) : (A = _, O = C);
454
454
  }
455
- var m = !1, g, O, S = d === void 0 ? null : d;
455
+ var m = !1, A, O, S = d === void 0 ? null : d;
456
456
  return [
457
457
  function() {
458
- return l(h());
458
+ return f(p());
459
459
  },
460
460
  S === null ? void 0 : function() {
461
- return l(S());
461
+ return f(S());
462
462
  }
463
463
  ];
464
464
  },
465
- [h, d, E, c]
465
+ [p, d, E, c]
466
466
  );
467
- var i = o(v, f[0], f[1]);
467
+ var i = o(v, l[0], l[1]);
468
468
  return u(
469
469
  function() {
470
- p.hasValue = !0, p.value = i;
470
+ h.hasValue = !0, h.value = i;
471
471
  },
472
472
  [i]
473
473
  ), y(i), i;
@@ -477,49 +477,49 @@ var G = {};
477
477
  var te;
478
478
  function ut() {
479
479
  return te || (te = 1, process.env.NODE_ENV !== "production" && (function() {
480
- function e(v, h) {
481
- return v === h && (v !== 0 || 1 / v === 1 / h) || v !== v && h !== h;
480
+ function e(v, p) {
481
+ return v === p && (v !== 0 || 1 / v === 1 / p) || v !== v && p !== p;
482
482
  }
483
483
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
484
- var t = A, r = $(), n = typeof Object.is == "function" ? Object.is : e, o = r.useSyncExternalStore, a = t.useRef, u = t.useEffect, s = t.useMemo, y = t.useDebugValue;
485
- G.useSyncExternalStoreWithSelector = function(v, h, d, E, c) {
486
- var f = a(null);
487
- if (f.current === null) {
488
- var p = { hasValue: !1, value: null };
489
- f.current = p;
490
- } else p = f.current;
491
- f = s(
484
+ var t = R, r = $(), n = typeof Object.is == "function" ? Object.is : e, o = r.useSyncExternalStore, a = t.useRef, u = t.useEffect, s = t.useMemo, y = t.useDebugValue;
485
+ G.useSyncExternalStoreWithSelector = function(v, p, d, E, c) {
486
+ var l = a(null);
487
+ if (l.current === null) {
488
+ var h = { hasValue: !1, value: null };
489
+ l.current = h;
490
+ } else h = l.current;
491
+ l = s(
492
492
  function() {
493
- function l(_) {
493
+ function f(_) {
494
494
  if (!m) {
495
- if (m = !0, g = _, _ = E(_), c !== void 0 && p.hasValue) {
496
- var b = p.value;
497
- if (c(b, _))
498
- return O = b;
495
+ if (m = !0, A = _, _ = E(_), c !== void 0 && h.hasValue) {
496
+ var g = h.value;
497
+ if (c(g, _))
498
+ return O = g;
499
499
  }
500
500
  return O = _;
501
501
  }
502
- if (b = O, n(g, _))
503
- return b;
504
- var T = E(_);
505
- return c !== void 0 && c(b, T) ? (g = _, b) : (g = _, O = T);
502
+ if (g = O, n(A, _))
503
+ return g;
504
+ var C = E(_);
505
+ return c !== void 0 && c(g, C) ? (A = _, g) : (A = _, O = C);
506
506
  }
507
- var m = !1, g, O, S = d === void 0 ? null : d;
507
+ var m = !1, A, O, S = d === void 0 ? null : d;
508
508
  return [
509
509
  function() {
510
- return l(h());
510
+ return f(p());
511
511
  },
512
512
  S === null ? void 0 : function() {
513
- return l(S());
513
+ return f(S());
514
514
  }
515
515
  ];
516
516
  },
517
- [h, d, E, c]
517
+ [p, d, E, c]
518
518
  );
519
- var i = o(v, f[0], f[1]);
519
+ var i = o(v, l[0], l[1]);
520
520
  return u(
521
521
  function() {
522
- p.hasValue = !0, p.value = i;
522
+ h.hasValue = !0, h.value = i;
523
523
  },
524
524
  [i]
525
525
  ), y(i), i;
@@ -534,15 +534,15 @@ var at = st(), ct = (...e) => (t) => {
534
534
  e.forEach((r) => {
535
535
  typeof r == "function" ? r(t) : r && (r.current = t);
536
536
  });
537
- }, lt = ({ contentComponent: e }) => {
537
+ }, ft = ({ contentComponent: e }) => {
538
538
  const t = _e.useSyncExternalStore(
539
539
  e.subscribe,
540
540
  e.getSnapshot,
541
541
  e.getServerSnapshot
542
542
  );
543
- return /* @__PURE__ */ R(ie, { children: Object.values(t) });
543
+ return /* @__PURE__ */ w(ie, { children: Object.values(t) });
544
544
  };
545
- function ft() {
545
+ function lt() {
546
546
  const e = /* @__PURE__ */ new Set();
547
547
  let t = {};
548
548
  return {
@@ -566,7 +566,7 @@ function ft() {
566
566
  setRenderer(r, n) {
567
567
  t = {
568
568
  ...t,
569
- [r]: pe.createPortal(n.reactElement, n.element, r)
569
+ [r]: he.createPortal(n.reactElement, n.element, r)
570
570
  }, e.forEach((o) => o());
571
571
  },
572
572
  /**
@@ -578,12 +578,9 @@ function ft() {
578
578
  }
579
579
  };
580
580
  }
581
- var dt = class extends A.Component {
581
+ var dt = class extends R.Component {
582
582
  constructor(e) {
583
- var t;
584
- super(e), this.editorContentRef = A.createRef(), this.initialized = !1, this.state = {
585
- hasContentComponentInitialized: !!((t = e.editor) != null && t.contentComponent)
586
- };
583
+ super(e), this.editorContentRef = R.createRef();
587
584
  }
588
585
  componentDidMount() {
589
586
  this.init();
@@ -600,20 +597,16 @@ var dt = class extends A.Component {
600
597
  const r = this.editorContentRef.current;
601
598
  r.append(...t.view.dom.parentNode.childNodes), t.setOptions({
602
599
  element: r
603
- }), t.contentComponent = ft(), this.state.hasContentComponentInitialized || (this.unsubscribeToContentComponent = t.contentComponent.subscribe(() => {
604
- this.setState((n) => n.hasContentComponentInitialized ? n : {
605
- hasContentComponentInitialized: !0
606
- }), this.unsubscribeToContentComponent && this.unsubscribeToContentComponent();
607
- })), t.createNodeViews(), this.initialized = !0;
600
+ }), t.contentComponent = lt(), t.createNodeViews(), t.isEditorContentInitialized = !0, this.forceUpdate();
608
601
  }
609
602
  }
610
603
  componentWillUnmount() {
611
604
  var e;
612
605
  const t = this.props.editor;
613
606
  if (t) {
614
- this.initialized = !1, t.isDestroyed || t.view.setProps({
607
+ t.isEditorContentInitialized = !1, t.isDestroyed || t.view.setProps({
615
608
  nodeViews: {}
616
- }), this.unsubscribeToContentComponent && this.unsubscribeToContentComponent(), t.contentComponent = null;
609
+ }), t.contentComponent = null;
617
610
  try {
618
611
  if (!((e = t.view.dom) != null && e.parentNode))
619
612
  return;
@@ -628,20 +621,20 @@ var dt = class extends A.Component {
628
621
  render() {
629
622
  const { editor: e, innerRef: t, ...r } = this.props;
630
623
  return /* @__PURE__ */ Ee(ie, { children: [
631
- /* @__PURE__ */ R("div", { ref: ct(t, this.editorContentRef), ...r }),
632
- e?.contentComponent && /* @__PURE__ */ R(lt, { contentComponent: e.contentComponent })
624
+ /* @__PURE__ */ w("div", { ref: ct(t, this.editorContentRef), ...r }),
625
+ e?.contentComponent && /* @__PURE__ */ w(ft, { contentComponent: e.contentComponent })
633
626
  ] });
634
627
  }
635
- }, ht = fe(
628
+ }, pt = le(
636
629
  (e, t) => {
637
- const r = A.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
638
- return A.createElement(dt, {
630
+ const r = R.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
631
+ return R.createElement(dt, {
639
632
  key: r,
640
633
  innerRef: t,
641
634
  ...e
642
635
  });
643
636
  }
644
- ), pt = A.memo(ht), mt = typeof window < "u" ? de : he, Et = class {
637
+ ), ht = R.memo(pt), mt = typeof window < "u" ? de : pe, Et = class {
645
638
  constructor(e) {
646
639
  this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = e, this.lastSnapshot = { editor: e, transactionNumber: 0 }, this.getSnapshot = this.getSnapshot.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.watch = this.watch.bind(this), this.subscribe = this.subscribe.bind(this);
647
640
  }
@@ -679,7 +672,7 @@ var dt = class extends A.Component {
679
672
  }
680
673
  }
681
674
  };
682
- function wt(e) {
675
+ function bt(e) {
683
676
  var t;
684
677
  const [r] = ce(() => new Et(e.editor)), n = at.useSyncExternalStoreWithSelector(
685
678
  r.subscribe,
@@ -688,25 +681,25 @@ function wt(e) {
688
681
  e.selector,
689
682
  (t = e.equalityFn) != null ? t : ot
690
683
  );
691
- return mt(() => r.watch(e.editor), [e.editor, r]), le(n), n;
684
+ return mt(() => r.watch(e.editor), [e.editor, r]), fe(n), n;
692
685
  }
693
686
  process.env.NODE_ENV;
694
- var P = U({
687
+ var P = B({
695
688
  editor: null
696
689
  });
697
690
  P.Consumer;
698
- var Ct = () => B(P), vt = U({
691
+ var Tt = () => U(P), vt = B({
699
692
  onDragStart: () => {
700
693
  },
701
694
  nodeViewContentChildren: void 0,
702
695
  nodeViewContentRef: () => {
703
696
  }
704
- }), yt = () => B(vt);
705
- A.forwardRef((e, t) => {
697
+ }), yt = () => U(vt);
698
+ R.forwardRef((e, t) => {
706
699
  const { onDragStart: r } = yt(), n = e.as || "div";
707
700
  return (
708
701
  // @ts-ignore
709
- /* @__PURE__ */ R(
702
+ /* @__PURE__ */ w(
710
703
  n,
711
704
  {
712
705
  ...e,
@@ -742,18 +735,18 @@ function St(e) {
742
735
  }
743
736
  function Ot() {
744
737
  try {
745
- if (z)
746
- return parseInt(z.split(".")[0], 10) >= 19;
738
+ if (k)
739
+ return parseInt(k.split(".")[0], 10) >= 19;
747
740
  } catch {
748
741
  }
749
742
  return !1;
750
743
  }
751
- var Tt = class {
744
+ var Ct = class {
752
745
  /**
753
746
  * Immediately creates element and renders the provided React component.
754
747
  */
755
748
  constructor(e, { editor: t, props: r = {}, as: n = "div", className: o = "" }) {
756
- this.ref = null, this.destroyed = !1, this.id = Math.floor(Math.random() * 4294967295).toString(), this.component = e, this.editor = t, this.props = r, this.element = document.createElement(n), this.element.classList.add("react-renderer"), o && this.element.classList.add(...o.split(" ")), this.editor.isInitialized ? me(() => {
749
+ this.ref = null, this.destroyed = !1, this.id = Math.floor(Math.random() * 4294967295).toString(), this.component = e, this.editor = t, this.props = r, this.element = document.createElement(n), this.element.classList.add("react-renderer"), o && this.element.classList.add(...o.split(" ")), this.editor.isEditorContentInitialized ? me(() => {
757
750
  this.render();
758
751
  }) : queueMicrotask(() => {
759
752
  this.destroyed || this.render();
@@ -769,7 +762,7 @@ var Tt = class {
769
762
  const t = this.component, r = this.props, n = this.editor, o = Ot(), a = St(t), u = { ...r };
770
763
  u.ref && !(o || a) && delete u.ref, !u.ref && (o || a) && (u.ref = (s) => {
771
764
  this.ref = s;
772
- }), this.reactElement = /* @__PURE__ */ R(t, { ...u }), (e = n?.contentComponent) == null || e.setRenderer(this.id, this);
765
+ }), this.reactElement = /* @__PURE__ */ w(t, { ...u }), (e = n?.contentComponent) == null || e.setRenderer(this.id, this);
773
766
  }
774
767
  /**
775
768
  * Re-renders the React component with new props.
@@ -802,28 +795,28 @@ var Tt = class {
802
795
  });
803
796
  }
804
797
  };
805
- A.createContext({
798
+ R.createContext({
806
799
  markViewContentRef: () => {
807
800
  }
808
801
  });
809
- var W = U({
802
+ var W = B({
810
803
  get editor() {
811
804
  throw new Error("useTiptap must be used within a <Tiptap> provider");
812
805
  }
813
806
  });
814
807
  W.displayName = "TiptapContext";
815
- var bt = () => B(W);
808
+ var gt = () => U(W);
816
809
  function se({ editor: e, instance: t, children: r }) {
817
810
  const n = e ?? t;
818
811
  if (!n)
819
812
  throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");
820
- const o = k(() => ({ editor: n }), [n]), a = k(() => ({ editor: n }), [n]);
821
- return /* @__PURE__ */ R(P.Provider, { value: a, children: /* @__PURE__ */ R(W.Provider, { value: o, children: r }) });
813
+ const o = z(() => ({ editor: n }), [n]), a = z(() => ({ editor: n }), [n]);
814
+ return /* @__PURE__ */ w(P.Provider, { value: a, children: /* @__PURE__ */ w(W.Provider, { value: o, children: r }) });
822
815
  }
823
816
  se.displayName = "Tiptap";
824
817
  function ae({ ...e }) {
825
- const { editor: t } = bt();
826
- return /* @__PURE__ */ R(pt, { editor: t, ...e });
818
+ const { editor: t } = gt();
819
+ return /* @__PURE__ */ w(ht, { editor: t, ...e });
827
820
  }
828
821
  ae.displayName = "Tiptap.Content";
829
822
  Object.assign(se, {
@@ -834,8 +827,8 @@ Object.assign(se, {
834
827
  Content: ae
835
828
  });
836
829
  export {
837
- pt as E,
838
- Tt as R,
839
- Ct as a,
840
- wt as u
830
+ ht as E,
831
+ Ct as R,
832
+ Tt as a,
833
+ bt as u
841
834
  };