@clevertask/scribe 0.1.27 → 0.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +4 -2
  2. package/dist/{BarMenu-BGWT4Oyk.js → BarMenu-BC8XoC6e.js} +1 -1
  3. package/dist/assets/index.css +1 -1
  4. package/dist/components/Menu/BarMenu.js +1 -1
  5. package/dist/components/Menu/BubbleMenu.js +2 -2
  6. package/dist/components/Menu/CalloutBubbleMenu.js +2 -2
  7. package/dist/components/Menu/LinkBubbleMenu.js +2 -2
  8. package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
  9. package/dist/components/Menu/TableBubbleMenu.d.ts.map +1 -1
  10. package/dist/components/Menu/TableBubbleMenu.js +145 -132
  11. package/dist/components/Menu/TableHeightSettings.d.ts +11 -0
  12. package/dist/components/Menu/TableHeightSettings.d.ts.map +1 -0
  13. package/dist/components/Menu/TableHeightSettings.js +156 -0
  14. package/dist/components/Menu/TableLayoutOptions.d.ts +5 -0
  15. package/dist/components/Menu/TableLayoutOptions.d.ts.map +1 -1
  16. package/dist/components/Menu/TableLayoutOptions.js +56 -39
  17. package/dist/components/Menu/linkBubbleMenuPlugin.js +1 -1
  18. package/dist/components/Scribe/extension/callout.js +7 -7
  19. package/dist/components/Scribe/extension/emoji/suggest.js +1 -1
  20. package/dist/components/Scribe/extension/extension-link.js +1 -1
  21. package/dist/components/Scribe/extension/extension-markdown-paste.js +1 -1
  22. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  23. package/dist/components/Scribe/extension/external-link-preview/commands.js +1 -1
  24. package/dist/components/Scribe/extension/external-link-preview/index.js +1 -1
  25. package/dist/components/Scribe/extension/external-link-preview/node-view.js +1 -1
  26. package/dist/components/Scribe/extension/external-link-preview/render-html.js +1 -1
  27. package/dist/components/Scribe/extension/external-link-preview/schema.js +1 -1
  28. package/dist/components/Scribe/extension/index.js +1 -1
  29. package/dist/components/Scribe/extension/resizable-table.d.ts +1 -0
  30. package/dist/components/Scribe/extension/resizable-table.d.ts.map +1 -1
  31. package/dist/components/Scribe/extension/resizable-table.js +64 -43
  32. package/dist/components/Scribe/extension/slashCommand/index.js +2 -2
  33. package/dist/components/Scribe/extension/slashCommand/renderItems.js +1 -1
  34. package/dist/components/Scribe/extension/table-layout.d.ts +5 -0
  35. package/dist/components/Scribe/extension/table-layout.d.ts.map +1 -1
  36. package/dist/components/Scribe/extension/table-layout.js +2 -2
  37. package/dist/components/Scribe/extension/tableOfContents.js +1 -1
  38. package/dist/components/Scribe/index.js +4 -4
  39. package/dist/{dist-BiognBi4.js → dist-B0xwy1Q5.js} +175 -154
  40. package/dist/{dist-Dk0fXvrc.js → dist-CDJRm4fL.js} +2 -2
  41. package/dist/{dist-xjmWZ-oh.js → dist-DnVcys79.js} +632 -571
  42. package/dist/document-node-capabilities.d.ts.map +1 -1
  43. package/dist/document-node-capabilities.js +5 -1
  44. package/dist/{extension-CBOxOV0e.js → extension-BPeoqfHR.js} +2 -2
  45. package/dist/{extension-link-DmM_EJTn.js → extension-link-RvaqaDqr.js} +319 -294
  46. package/dist/{html-to-markdown-DZ83bZ9I.js → html-to-markdown-DF93it73.js} +1 -1
  47. package/dist/main.css +2 -1
  48. package/dist/main.js +1 -1
  49. package/dist/{menus-BDXjZsFU.js → menus-scgppp2C.js} +25 -25
  50. package/dist/{schema-extensions-BXyGPwMf.js → schema-extensions-ITR9LEgX.js} +2025 -1898
  51. package/dist/schema-extensions.js +1 -1
  52. package/dist/schema.js +1 -1
  53. package/dist/{table-layout-B3sPDpEF.js → table-layout-iVolql5p.js} +180 -121
  54. package/dist/utils/html-to-markdown.d.ts.map +1 -1
  55. package/dist/utils/html-to-markdown.js +1 -1
  56. package/dist/utils/index.js +3 -3
  57. package/package.json +51 -51
@@ -1,14 +1,15 @@
1
1
  import { t as e } from "./rolldown-runtime-CtkjhSXr.js";
2
- import { C as t, N as n, o as r, t as i } from "./dist-xjmWZ-oh.js";
3
- import * as a from "react";
4
- import o, { createContext as s, createElement as c, createRef as l, forwardRef as u, memo as d, useContext as f, useDebugValue as p, useEffect as m, useLayoutEffect as h, useMemo as g, useRef as _, useState as v, version as y } from "react";
5
- import b, { flushSync as ee } from "react-dom";
6
- import { Fragment as x, jsx as S, jsxs as te } from "react/jsx-runtime";
2
+ import { C as t, D as n, I as r, P as i, o as a, t as o } from "./dist-DnVcys79.js";
3
+ import { Plugin as s, PluginKey as c } from "@tiptap/pm/state";
4
+ import * as l from "react";
5
+ import u, { createContext as d, createElement as f, createRef as p, forwardRef as m, memo as h, useContext as g, useDebugValue as _, useEffect as v, useLayoutEffect as y, useMemo as b, useRef as ee, useState as x, version as te } from "react";
6
+ import ne, { flushSync as re } from "react-dom";
7
+ import { Fragment as S, jsx as C, jsxs as ie } from "react/jsx-runtime";
7
8
  //#region builtin:esm-external-require-react
8
- var C = /* @__PURE__ */ e(((e, t) => {
9
- t.exports = Object.prototype.hasOwnProperty.call(a, "module.exports") ? a["module.exports"] : { ...a };
10
- })), ne = /* @__PURE__ */ e(((e) => {
11
- var t = C();
9
+ var w = /* @__PURE__ */ e(((e, t) => {
10
+ t.exports = Object.prototype.hasOwnProperty.call(l, "module.exports") ? l["module.exports"] : { ...l };
11
+ })), ae = /* @__PURE__ */ e(((e) => {
12
+ var t = w();
12
13
  function n(e, t) {
13
14
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
14
15
  }
@@ -45,7 +46,7 @@ var C = /* @__PURE__ */ e(((e, t) => {
45
46
  }
46
47
  var d = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? u : c;
47
48
  e.useSyncExternalStore = t.useSyncExternalStore === void 0 ? d : t.useSyncExternalStore;
48
- })), re = /* @__PURE__ */ e(((e) => {
49
+ })), oe = /* @__PURE__ */ e(((e) => {
49
50
  process.env.NODE_ENV !== "production" && (function() {
50
51
  function t(e, t) {
51
52
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
@@ -88,12 +89,12 @@ var C = /* @__PURE__ */ e(((e, t) => {
88
89
  return t();
89
90
  }
90
91
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
91
- var a = C(), o = typeof Object.is == "function" ? Object.is : t, s = a.useState, c = a.useEffect, l = a.useLayoutEffect, u = a.useDebugValue, d = !1, f = !1, p = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? i : n;
92
+ var a = w(), o = typeof Object.is == "function" ? Object.is : t, s = a.useState, c = a.useEffect, l = a.useLayoutEffect, u = a.useDebugValue, d = !1, f = !1, p = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? i : n;
92
93
  e.useSyncExternalStore = a.useSyncExternalStore === void 0 ? p : a.useSyncExternalStore, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
93
94
  })();
94
- })), w = /* @__PURE__ */ e(((e, t) => {
95
- t.exports = process.env.NODE_ENV === "production" ? ne() : re();
96
- })), T = w(), { getOwnPropertyNames: ie, getOwnPropertySymbols: ae } = Object, { hasOwnProperty: oe } = Object.prototype;
95
+ })), T = /* @__PURE__ */ e(((e, t) => {
96
+ t.exports = process.env.NODE_ENV === "production" ? ae() : oe();
97
+ })), se = T(), { getOwnPropertyNames: ce, getOwnPropertySymbols: le } = Object, { hasOwnProperty: ue } = Object.prototype;
97
98
  function E(e, t) {
98
99
  return function(n, r, i) {
99
100
  return e(n, r, i) && t(n, r, i);
@@ -109,36 +110,36 @@ function D(e) {
109
110
  return i.delete(t), i.delete(n), s;
110
111
  };
111
112
  }
112
- function se(e) {
113
+ function de(e) {
113
114
  return e?.[Symbol.toStringTag];
114
115
  }
115
116
  function O(e) {
116
- return ie(e).concat(ae(e));
117
+ return ce(e).concat(le(e));
117
118
  }
118
- var ce = Object.hasOwn || ((e, t) => oe.call(e, t));
119
+ var fe = Object.hasOwn || ((e, t) => ue.call(e, t));
119
120
  function k(e, t) {
120
121
  return e === t || !e && !t && e !== e && t !== t;
121
122
  }
122
- var le = "__v", ue = "__o", de = "_owner", fe = typeof Float16Array < "u", { getOwnPropertyDescriptor: A, keys: j } = Object;
123
- function pe(e, t) {
123
+ var pe = "__v", me = "__o", he = "_owner", ge = typeof Float16Array < "u", { getOwnPropertyDescriptor: A, keys: j } = Object;
124
+ function _e(e, t) {
124
125
  return e.byteLength === t.byteLength && L(new Uint8Array(e), new Uint8Array(t));
125
126
  }
126
- function me(e, t, n) {
127
+ function ve(e, t, n) {
127
128
  let r = e.length;
128
129
  if (t.length !== r) return !1;
129
130
  for (; r-- > 0;) if (!n.equals(e[r], t[r], r, r, e, t, n)) return !1;
130
131
  return !0;
131
132
  }
132
- function he(e, t) {
133
+ function ye(e, t) {
133
134
  return e.byteLength === t.byteLength && L(new Uint8Array(e.buffer, e.byteOffset, e.byteLength), new Uint8Array(t.buffer, t.byteOffset, t.byteLength));
134
135
  }
135
- function ge(e, t) {
136
+ function be(e, t) {
136
137
  return k(e.getTime(), t.getTime());
137
138
  }
138
139
  function M(e, t, n) {
139
140
  return e.name === t.name && e.message === t.message && e.stack === t.stack && n.equals(e.cause, t.cause, "cause", "cause", e, t, n);
140
141
  }
141
- function _e(e, t) {
142
+ function xe(e, t) {
142
143
  return e === t;
143
144
  }
144
145
  function N(e, t, n) {
@@ -165,7 +166,7 @@ function N(e, t, n) {
165
166
  }
166
167
  return !0;
167
168
  }
168
- var ve = k;
169
+ var Se = k;
169
170
  function P(e, t, n) {
170
171
  let r = j(e), i = r.length;
171
172
  if (j(t).length !== i) return !1;
@@ -179,10 +180,10 @@ function F(e, t, n) {
179
180
  for (; i-- > 0;) if (a = r[i], !z(e, t, n, a) || (o = A(e, a), s = A(t, a), (o || s) && (!o || !s || o.configurable !== s.configurable || o.enumerable !== s.enumerable || o.writable !== s.writable))) return !1;
180
181
  return !0;
181
182
  }
182
- function ye(e, t) {
183
+ function Ce(e, t) {
183
184
  return k(e.valueOf(), t.valueOf());
184
185
  }
185
- function be(e, t) {
186
+ function we(e, t) {
186
187
  return e.source === t.source && e.flags === t.flags;
187
188
  }
188
189
  function I(e, t, n) {
@@ -206,17 +207,17 @@ function I(e, t, n) {
206
207
  function L(e, t) {
207
208
  let n = e.length;
208
209
  if (t.length !== n || e.byteOffset !== t.byteOffset) return !1;
209
- if (e instanceof Float64Array || e instanceof Float32Array || fe && e instanceof Float16Array) {
210
+ if (e instanceof Float64Array || e instanceof Float32Array || ge && e instanceof Float16Array) {
210
211
  for (; n-- > 0;) if (e[n] !== t[n] && (e[n] === e[n] || t[n] === t[n])) return !1;
211
212
  return !0;
212
213
  }
213
214
  for (; n-- > 0;) if (e[n] !== t[n]) return !1;
214
215
  return !0;
215
216
  }
216
- function xe(e, t) {
217
- return e.href === t.href || e.protocol === t.protocol && e.username === t.username && e.password === t.password && e.host === t.host && e.pathname === t.pathname && e.hash === t.hash && Se(e.searchParams, t.searchParams);
217
+ function Te(e, t) {
218
+ return e.href === t.href || e.protocol === t.protocol && e.username === t.username && e.password === t.password && e.host === t.host && e.pathname === t.pathname && e.hash === t.hash && Ee(e.searchParams, t.searchParams);
218
219
  }
219
- function Se(e, t) {
220
+ function Ee(e, t) {
220
221
  let n = e.toString(), r = t.toString();
221
222
  return n === r || R(n) === R(r);
222
223
  }
@@ -224,9 +225,9 @@ function R(e) {
224
225
  return e.split("&").sort().join("&");
225
226
  }
226
227
  function z(e, t, n, r) {
227
- return (r === de || r === ue || r === le) && (e.$$typeof || t.$$typeof) ? !0 : ce(t, r) && n.equals(e[r], t[r], r, r, e, t, n);
228
+ return (r === he || r === me || r === pe) && (e.$$typeof || t.$$typeof) ? !0 : fe(t, r) && n.equals(e[r], t[r], r, r, e, t, n);
228
229
  }
229
- var Ce = "[object ArrayBuffer]", we = "[object Arguments]", Te = "[object Boolean]", Ee = "[object DataView]", De = "[object Date]", Oe = "[object Error]", ke = "[object Map]", Ae = "[object Number]", je = "[object Object]", Me = "[object RegExp]", Ne = "[object Set]", Pe = "[object String]", Fe = {
230
+ var De = "[object ArrayBuffer]", Oe = "[object Arguments]", ke = "[object Boolean]", Ae = "[object DataView]", je = "[object Date]", Me = "[object Error]", Ne = "[object Map]", Pe = "[object Number]", Fe = "[object Object]", Ie = "[object RegExp]", Le = "[object Set]", Re = "[object String]", ze = {
230
231
  "[object Int8Array]": !0,
231
232
  "[object Uint8Array]": !0,
232
233
  "[object Uint8ClampedArray]": !0,
@@ -239,8 +240,8 @@ var Ce = "[object ArrayBuffer]", we = "[object Arguments]", Te = "[object Boolea
239
240
  "[object Float64Array]": !0,
240
241
  "[object BigInt64Array]": !0,
241
242
  "[object BigUint64Array]": !0
242
- }, Ie = "[object URL]", Le = Object.prototype.toString;
243
- function Re({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: n, areDatesEqual: r, areErrorsEqual: i, areFunctionsEqual: a, areMapsEqual: o, areNumbersEqual: s, areObjectsEqual: c, arePrimitiveWrappersEqual: l, areRegExpsEqual: u, areSetsEqual: d, areTypedArraysEqual: f, areUrlsEqual: p, unknownTagComparators: m }) {
243
+ }, Be = "[object URL]", Ve = Object.prototype.toString;
244
+ function He({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: n, areDatesEqual: r, areErrorsEqual: i, areFunctionsEqual: a, areMapsEqual: o, areNumbersEqual: s, areObjectsEqual: c, arePrimitiveWrappersEqual: l, areRegExpsEqual: u, areSetsEqual: d, areTypedArraysEqual: f, areUrlsEqual: p, unknownTagComparators: m }) {
244
245
  return function(h, g, _) {
245
246
  if (h === g) return !0;
246
247
  if (h == null || g == null) return !1;
@@ -256,23 +257,23 @@ function Re({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: n,
256
257
  if (y === Map) return o(h, g, _);
257
258
  if (y === Set) return d(h, g, _);
258
259
  if (y == null) return c(h, g, _);
259
- let b = Le.call(h);
260
- if (b === De) return r(h, g, _);
261
- if (b === Me) return u(h, g, _);
262
- if (b === ke) return o(h, g, _);
263
- if (b === Ne) return d(h, g, _);
264
- if (b === je) return typeof h.then != "function" && typeof g.then != "function" && c(h, g, _);
265
- if (b === Ie) return p(h, g, _);
266
- if (b === Oe) return i(h, g, _);
267
- if (b === we) return c(h, g, _);
268
- if (Fe[b]) return f(h, g, _);
269
- if (b === Ce) return e(h, g, _);
270
- if (b === Ee) return n(h, g, _);
271
- if (b === Te || b === Ae || b === Pe) return l(h, g, _);
260
+ let b = Ve.call(h);
261
+ if (b === je) return r(h, g, _);
262
+ if (b === Ie) return u(h, g, _);
263
+ if (b === Ne) return o(h, g, _);
264
+ if (b === Le) return d(h, g, _);
265
+ if (b === Fe) return typeof h.then != "function" && typeof g.then != "function" && c(h, g, _);
266
+ if (b === Be) return p(h, g, _);
267
+ if (b === Me) return i(h, g, _);
268
+ if (b === Oe) return c(h, g, _);
269
+ if (ze[b]) return f(h, g, _);
270
+ if (b === De) return e(h, g, _);
271
+ if (b === Ae) return n(h, g, _);
272
+ if (b === ke || b === Pe || b === Re) return l(h, g, _);
272
273
  if (m) {
273
274
  let e = m[b];
274
275
  if (!e) {
275
- let t = se(h);
276
+ let t = de(h);
276
277
  t && (e = m[t]);
277
278
  }
278
279
  if (e) return e(h, g, _);
@@ -280,22 +281,22 @@ function Re({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: n,
280
281
  return !1;
281
282
  };
282
283
  }
283
- function ze({ circular: e, createCustomConfig: t, strict: n }) {
284
+ function Ue({ circular: e, createCustomConfig: t, strict: n }) {
284
285
  let r = {
285
- areArrayBuffersEqual: pe,
286
- areArraysEqual: n ? F : me,
287
- areDataViewsEqual: he,
288
- areDatesEqual: ge,
286
+ areArrayBuffersEqual: _e,
287
+ areArraysEqual: n ? F : ve,
288
+ areDataViewsEqual: ye,
289
+ areDatesEqual: be,
289
290
  areErrorsEqual: n ? E(M, F) : E(M, P),
290
- areFunctionsEqual: _e,
291
+ areFunctionsEqual: xe,
291
292
  areMapsEqual: n ? E(N, F) : N,
292
- areNumbersEqual: ve,
293
+ areNumbersEqual: Se,
293
294
  areObjectsEqual: n ? F : P,
294
- arePrimitiveWrappersEqual: ye,
295
- areRegExpsEqual: be,
295
+ arePrimitiveWrappersEqual: Ce,
296
+ areRegExpsEqual: we,
296
297
  areSetsEqual: n ? E(I, F) : I,
297
298
  areTypedArraysEqual: n ? E(L, F) : L,
298
- areUrlsEqual: xe,
299
+ areUrlsEqual: Te,
299
300
  unknownTagComparators: void 0
300
301
  };
301
302
  if (t && (r = Object.assign({}, r, t(r))), e) {
@@ -310,12 +311,12 @@ function ze({ circular: e, createCustomConfig: t, strict: n }) {
310
311
  }
311
312
  return r;
312
313
  }
313
- function Be(e) {
314
+ function We(e) {
314
315
  return function(t, n, r, i, a, o, s) {
315
316
  return e(t, n, s);
316
317
  };
317
318
  }
318
- function Ve({ circular: e, comparator: t, createState: n, equals: r, strict: i }) {
319
+ function Ge({ circular: e, comparator: t, createState: n, equals: r, strict: i }) {
319
320
  if (n) return function(a, o) {
320
321
  let { cache: s = e ? /* @__PURE__ */ new WeakMap() : void 0, meta: c } = n();
321
322
  return t(a, o, {
@@ -343,7 +344,7 @@ function Ve({ circular: e, comparator: t, createState: n, equals: r, strict: i }
343
344
  return t(e, n, a);
344
345
  };
345
346
  }
346
- var He = B();
347
+ var Ke = B();
347
348
  B({ strict: !0 }), B({ circular: !0 }), B({
348
349
  circular: !0,
349
350
  strict: !0
@@ -359,19 +360,19 @@ B({ strict: !0 }), B({ circular: !0 }), B({
359
360
  strict: !0
360
361
  });
361
362
  function B(e = {}) {
362
- let { circular: t = !1, createInternalComparator: n, createState: r, strict: i = !1 } = e, a = Re(ze(e));
363
- return Ve({
363
+ let { circular: t = !1, createInternalComparator: n, createState: r, strict: i = !1 } = e, a = He(Ue(e));
364
+ return Ge({
364
365
  circular: t,
365
366
  comparator: a,
366
367
  createState: r,
367
- equals: n ? n(a) : Be(a),
368
+ equals: n ? n(a) : We(a),
368
369
  strict: i
369
370
  });
370
371
  }
371
372
  //#endregion
372
373
  //#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
373
- var Ue = /* @__PURE__ */ e(((e) => {
374
- var t = C(), n = w();
374
+ var qe = /* @__PURE__ */ e(((e) => {
375
+ var t = w(), n = T();
375
376
  function r(e, t) {
376
377
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
377
378
  }
@@ -415,13 +416,13 @@ var Ue = /* @__PURE__ */ e(((e) => {
415
416
  f.hasValue = !0, f.value = p;
416
417
  }, [p]), l(p), p;
417
418
  };
418
- })), We = /* @__PURE__ */ e(((e) => {
419
+ })), Je = /* @__PURE__ */ e(((e) => {
419
420
  process.env.NODE_ENV !== "production" && (function() {
420
421
  function t(e, t) {
421
422
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
422
423
  }
423
424
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
424
- var n = C(), r = w(), i = typeof Object.is == "function" ? Object.is : t, a = r.useSyncExternalStore, o = n.useRef, s = n.useEffect, c = n.useMemo, l = n.useDebugValue;
425
+ var n = w(), r = T(), i = typeof Object.is == "function" ? Object.is : t, a = r.useSyncExternalStore, o = n.useRef, s = n.useEffect, c = n.useMemo, l = n.useDebugValue;
425
426
  e.useSyncExternalStoreWithSelector = function(e, t, n, r, u) {
426
427
  var d = o(null);
427
428
  if (d.current === null) {
@@ -462,17 +463,34 @@ var Ue = /* @__PURE__ */ e(((e) => {
462
463
  }, [p]), l(p), p;
463
464
  }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
464
465
  })();
465
- })), Ge = (/* @__PURE__ */ e(((e, t) => {
466
- t.exports = process.env.NODE_ENV === "production" ? Ue() : We();
467
- })))(), Ke = (...e) => (t) => {
466
+ })), Ye = (/* @__PURE__ */ e(((e, t) => {
467
+ t.exports = process.env.NODE_ENV === "production" ? qe() : Je();
468
+ })))();
469
+ function Xe(e, t) {
470
+ if (e.isDestroyed || t.defaultPrevented || !t.cancelable || !e.isEditable || t.inputType !== "insertParagraph" && t.inputType !== "insertLineBreak" || !r() && !n()) return;
471
+ 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
+ if (!s || !i.dom.contains(s)) return;
473
+ let c = i.input.lastKeyCode;
474
+ c === 13 && (i.input.lastKeyCode = null), i.domObserver.forceFlush(), i.domObserver.flush();
475
+ let l = new KeyboardEvent("keydown", {
476
+ key: "Enter",
477
+ code: "Enter",
478
+ keyCode: 13,
479
+ shiftKey: t.inputType === "insertLineBreak",
480
+ bubbles: !0,
481
+ cancelable: !0
482
+ });
483
+ i.someProp("handleKeyDown", (e) => e(i, l)) ? (t.preventDefault(), i.input.lastIOSEnter = 0, clearTimeout(i.input.lastIOSEnterFallbackTimeout)) : c === 13 && (i.input.lastKeyCode = c);
484
+ }
485
+ var V = new c("reactMobileEnter"), Ze = (...e) => (t) => {
468
486
  e.forEach((e) => {
469
487
  typeof e == "function" ? e(t) : e && (e.current = t);
470
488
  });
471
- }, qe = ({ contentComponent: e }) => {
472
- let t = (0, T.useSyncExternalStore)(e.subscribe, e.getSnapshot, e.getServerSnapshot);
473
- return /* @__PURE__ */ S(x, { children: Object.values(t) });
489
+ }, Qe = ({ contentComponent: e }) => {
490
+ let t = (0, se.useSyncExternalStore)(e.subscribe, e.getSnapshot, e.getServerSnapshot);
491
+ return /* @__PURE__ */ C(S, { children: Object.values(t) });
474
492
  };
475
- function Je() {
493
+ function $e() {
476
494
  let e = /* @__PURE__ */ new Set(), t = {}, n = !1, r = () => {
477
495
  !n && e.size && (n = !0, queueMicrotask(() => {
478
496
  n = !1, e.forEach((e) => e());
@@ -493,7 +511,7 @@ function Je() {
493
511
  setRenderer(e, n) {
494
512
  t = {
495
513
  ...t,
496
- [e]: b.createPortal(n.reactElement, n.element, e)
514
+ [e]: ne.createPortal(n.reactElement, n.element, e)
497
515
  }, r();
498
516
  },
499
517
  removeRenderer(e) {
@@ -502,9 +520,9 @@ function Je() {
502
520
  }
503
521
  };
504
522
  }
505
- var Ye = class extends o.Component {
523
+ var et = class extends u.Component {
506
524
  constructor(e) {
507
- super(e), this.editorContentRef = o.createRef();
525
+ super(e), this.editorContentRef = u.createRef();
508
526
  }
509
527
  componentDidMount() {
510
528
  this.init();
@@ -517,13 +535,16 @@ var Ye = class extends o.Component {
517
535
  if (e && !e.isDestroyed && e.view.dom?.parentNode) {
518
536
  if (e.contentComponent) return;
519
537
  let t = this.editorContentRef.current;
520
- t.append(...e.view.dom.parentNode.childNodes), e.setOptions({ element: t }), e.contentComponent = Je(), e.createNodeViews(), e.isEditorContentInitialized = !0, this.forceUpdate();
538
+ t.append(...e.view.dom.parentNode.childNodes), e.setOptions({ element: t }), e.contentComponent = $e(), e.createNodeViews(), e.registerPlugin(new s({
539
+ key: V,
540
+ props: { handleDOMEvents: { beforeinput: (t, n) => Xe(e, n) } }
541
+ })), e.isEditorContentInitialized = !0, this.forceUpdate();
521
542
  }
522
543
  }
523
544
  componentWillUnmount() {
524
545
  let e = this.props.editor;
525
546
  if (e) {
526
- e.isEditorContentInitialized = !1, e.isDestroyed || e.view.setProps({ nodeViews: {} }), e.contentComponent = null;
547
+ e.isEditorContentInitialized = !1, e.isDestroyed || (e.unregisterPlugin(V), e.view.setProps({ nodeViews: {} })), e.contentComponent = null;
527
548
  try {
528
549
  if (!e.view.dom?.parentNode) return;
529
550
  let t = document.createElement("div");
@@ -533,19 +554,19 @@ var Ye = class extends o.Component {
533
554
  }
534
555
  render() {
535
556
  let { editor: e, innerRef: t, ...n } = this.props;
536
- return /* @__PURE__ */ te(x, { children: [/* @__PURE__ */ S("div", {
537
- ref: Ke(t, this.editorContentRef),
557
+ return /* @__PURE__ */ ie(S, { children: [/* @__PURE__ */ C("div", {
558
+ ref: Ze(t, this.editorContentRef),
538
559
  ...n
539
- }), e?.contentComponent && /* @__PURE__ */ S(qe, { contentComponent: e.contentComponent })] });
560
+ }), e?.contentComponent && /* @__PURE__ */ C(Qe, { contentComponent: e.contentComponent })] });
540
561
  }
541
- }, Xe = u((e, t) => {
542
- let n = o.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
543
- return o.createElement(Ye, {
562
+ }, tt = m((e, t) => {
563
+ let n = u.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
564
+ return u.createElement(et, {
544
565
  key: n,
545
566
  innerRef: t,
546
567
  ...e
547
568
  });
548
- }), V = o.memo(Xe), Ze = typeof window < "u" ? h : m, Qe = class {
569
+ }), H = u.memo(tt), nt = typeof window < "u" ? y : v, rt = class {
549
570
  constructor(e) {
550
571
  this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = e, this.lastSnapshot = {
551
572
  editor: e,
@@ -580,11 +601,11 @@ var Ye = class extends o.Component {
580
601
  }
581
602
  }
582
603
  };
583
- function H(e) {
584
- let [t] = v(() => new Qe(e.editor)), n = (0, Ge.useSyncExternalStoreWithSelector)(t.subscribe, t.getSnapshot, t.getServerSnapshot, e.selector, e.equalityFn ?? He);
585
- return Ze(() => t.watch(e.editor), [e.editor, t]), p(n), n;
604
+ function U(e) {
605
+ let [t] = x(() => new rt(e.editor)), n = (0, Ye.useSyncExternalStoreWithSelector)(t.subscribe, t.getSnapshot, t.getServerSnapshot, e.selector, e.equalityFn ?? Ke);
606
+ return nt(() => t.watch(e.editor), [e.editor, t]), _(n), n;
586
607
  }
587
- var U = process.env.NODE_ENV !== "production", W = typeof window > "u", $e = W || !!(typeof window < "u" && window.next), et = class e {
608
+ var W = process.env.NODE_ENV !== "production", G = typeof window > "u", it = G || !!(typeof window < "u" && window.next), at = class e {
588
609
  constructor(e) {
589
610
  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);
590
611
  }
@@ -593,7 +614,7 @@ var U = process.env.NODE_ENV !== "production", W = typeof window > "u", $e = W |
593
614
  }
594
615
  getInitialEditor() {
595
616
  let e = this.options.current.immediatelyRender, t = e ?? !0;
596
- return W ? (t && U && console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"), t = !1) : $e && e === void 0 && (t = !1, U && 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;
617
+ return G ? (t && W && console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"), t = !1) : it && e === void 0 && (t = !1, W && 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;
597
618
  }
598
619
  createEditor() {
599
620
  let e = {
@@ -655,7 +676,7 @@ var U = process.env.NODE_ENV !== "production", W = typeof window > "u", $e = W |
655
676
  return (t = this.options.current).onUnmount?.call(t, ...e);
656
677
  }
657
678
  };
658
- return new i(e);
679
+ return new o(e);
659
680
  }
660
681
  getEditor() {
661
682
  return this.editor;
@@ -712,24 +733,24 @@ var U = process.env.NODE_ENV !== "production", W = typeof window > "u", $e = W |
712
733
  }, 1);
713
734
  }
714
735
  };
715
- function tt(e = {}, t = []) {
716
- let n = _(e);
736
+ function ot(e = {}, t = []) {
737
+ let n = ee(e);
717
738
  n.current = e;
718
- let [r] = v(() => new et(n)), i = (0, T.useSyncExternalStore)(r.subscribe, r.getEditor, r.getServerSnapshot);
719
- return p(i), m(r.onRender(t)), H({
739
+ let [r] = x(() => new at(n)), i = (0, se.useSyncExternalStore)(r.subscribe, r.getEditor, r.getServerSnapshot);
740
+ return _(i), v(r.onRender(t)), U({
720
741
  editor: i,
721
742
  selector: ({ transactionNumber: t }) => e.shouldRerenderOnTransaction === !1 || e.shouldRerenderOnTransaction === void 0 ? null : e.immediatelyRender && t === 0 ? 0 : t + 1
722
743
  }), i;
723
744
  }
724
- var G = s({ editor: null });
725
- G.Consumer;
726
- var nt = () => f(G), K = s({
745
+ var K = d({ editor: null });
746
+ K.Consumer;
747
+ var st = () => g(K), q = d({
727
748
  onDragStart: () => {},
728
749
  nodeViewContentChildren: void 0,
729
750
  nodeViewContentRef: () => {}
730
- }), rt = () => f(K), it = o.forwardRef((e, t) => {
731
- let { onDragStart: n } = rt(), r = e.as || "div";
732
- return /* @__PURE__ */ S(r, {
751
+ }), ct = () => g(q), lt = u.forwardRef((e, t) => {
752
+ let { onDragStart: n } = ct(), r = e.as || "div";
753
+ return /* @__PURE__ */ C(r, {
733
754
  ...e,
734
755
  ref: t,
735
756
  "data-node-view-wrapper": "",
@@ -740,32 +761,32 @@ var nt = () => f(G), K = s({
740
761
  }
741
762
  });
742
763
  });
743
- function q(e) {
764
+ function J(e) {
744
765
  return !!(typeof e == "function" && e.prototype && e.prototype.isReactComponent);
745
766
  }
746
- function J(e) {
767
+ function Y(e) {
747
768
  return !(typeof e != "object" || !e.$$typeof || e.$$typeof.toString() !== "Symbol(react.forward_ref)" && e.$$typeof.description !== "react.forward_ref");
748
769
  }
749
- function at(e) {
770
+ function ut(e) {
750
771
  return !(typeof e != "object" || !e.$$typeof || e.$$typeof.toString() !== "Symbol(react.memo)" && e.$$typeof.description !== "react.memo");
751
772
  }
752
- function ot(e) {
753
- if (q(e) || J(e)) return !0;
754
- if (at(e)) {
773
+ function dt(e) {
774
+ if (J(e) || Y(e)) return !0;
775
+ if (ut(e)) {
755
776
  let t = e.type;
756
- if (t) return q(t) || J(t);
777
+ if (t) return J(t) || Y(t);
757
778
  }
758
779
  return !1;
759
780
  }
760
- function st() {
781
+ function ft() {
761
782
  try {
762
- if (y) return parseInt(y.split(".")[0], 10) >= 19;
783
+ if (te) return parseInt(te.split(".")[0], 10) >= 19;
763
784
  } catch {}
764
785
  return !1;
765
786
  }
766
- var Y = class {
787
+ var X = class {
767
788
  constructor(e, { editor: t, props: n = {}, as: r = "div", className: i = "" }) {
768
- this.ref = null, this.destroyed = !1, this.id = Math.floor(Math.random() * 4294967295).toString(), this.component = e, this.editor = t, this.props = n, this.element = document.createElement(r), this.element.classList.add("react-renderer"), i && this.element.classList.add(...i.split(" ")), this.editor.isEditorContentInitialized ? ee(() => {
789
+ this.ref = null, this.destroyed = !1, this.id = Math.floor(Math.random() * 4294967295).toString(), this.component = e, this.editor = t, this.props = n, this.element = document.createElement(r), this.element.classList.add("react-renderer"), i && this.element.classList.add(...i.split(" ")), this.editor.isEditorContentInitialized ? re(() => {
769
790
  this.render();
770
791
  }) : queueMicrotask(() => {
771
792
  this.destroyed || this.render();
@@ -774,10 +795,10 @@ var Y = class {
774
795
  render() {
775
796
  var e;
776
797
  if (this.destroyed) return;
777
- let t = this.component, n = this.props, r = this.editor, i = st(), a = ot(t), o = { ...n };
798
+ let t = this.component, n = this.props, r = this.editor, i = ft(), a = dt(t), o = { ...n };
778
799
  o.ref && !(i || a) && delete o.ref, !o.ref && (i || a) && (o.ref = (e) => {
779
800
  this.ref = e;
780
- }), this.reactElement = /* @__PURE__ */ S(t, { ...o }), r == null || (e = r.contentComponent) == null || e.setRenderer(this.id, this);
801
+ }), this.reactElement = /* @__PURE__ */ C(t, { ...o }), r == null || (e = r.contentComponent) == null || e.setRenderer(this.id, this);
781
802
  }
782
803
  updateProps(e = {}) {
783
804
  if (this.destroyed) return;
@@ -809,8 +830,8 @@ var Y = class {
809
830
  });
810
831
  }
811
832
  };
812
- o.createContext({ markViewContentRef: () => {} });
813
- function ct(e) {
833
+ u.createContext({ markViewContentRef: () => {} });
834
+ function pt(e) {
814
835
  var t;
815
836
  let n = e.getRootNode(), r = typeof n.getSelection == "function" ? n.getSelection() : (t = e.ownerDocument) == null || (t = t.defaultView) == null ? void 0 : t.getSelection();
816
837
  if (!r || r.rangeCount === 0) return null;
@@ -821,16 +842,16 @@ function ct(e) {
821
842
  } catch {}
822
843
  };
823
844
  }
824
- function lt(e, t, n) {
845
+ function mt(e, t, n) {
825
846
  return e.node(n) === t.node(n) && e.before(n) === t.before(n);
826
847
  }
827
- function X(e) {
828
- if (!n(e)) return [];
829
- let { $from: t, $to: r } = e, i = [], a = Math.min(t.depth, r.depth);
830
- for (let e = 1; e <= a && lt(t, r, e); e += 1) i.push(t.before(e));
831
- return i;
848
+ function Z(e) {
849
+ if (!i(e)) return [];
850
+ let { $from: t, $to: n } = e, r = [], a = Math.min(t.depth, n.depth);
851
+ for (let e = 1; e <= a && mt(t, n, e); e += 1) r.push(t.before(e));
852
+ return r;
832
853
  }
833
- var ut = class {
854
+ var ht = class {
834
855
  constructor(e) {
835
856
  this.views = /* @__PURE__ */ new WeakMap(), this.viewCount = 0, this.insideViews = /* @__PURE__ */ new Set(), this.syncQueued = !1, this.scheduleSync = () => {
836
857
  this.syncQueued || (this.syncQueued = !0, queueMicrotask(() => {
@@ -854,18 +875,18 @@ var ut = class {
854
875
  }
855
876
  findInsideViews() {
856
877
  let e = /* @__PURE__ */ new Set();
857
- for (let t of X(this.editor.state.selection)) {
878
+ for (let t of Z(this.editor.state.selection)) {
858
879
  let n = this.editor.view.nodeDOM(t), r = n ? this.views.get(n) : void 0;
859
880
  r && e.add(r);
860
881
  }
861
882
  return e;
862
883
  }
863
- }, Z = /* @__PURE__ */ new WeakMap();
864
- function Q(e) {
865
- let t = Z.get(e);
866
- return t || (t = new ut(e), Z.set(e, t)), t;
884
+ }, gt = /* @__PURE__ */ new WeakMap();
885
+ function _t(e) {
886
+ let t = gt.get(e);
887
+ return t || (t = new ht(e), gt.set(e, t)), t;
867
888
  }
868
- var dt = class extends r {
889
+ var vt = class extends a {
869
890
  constructor(e, t, n) {
870
891
  if (super(e, t, n), this.nodeSelected = !1, this.handlePositionUpdate = () => {
871
892
  let e = this.getPos();
@@ -900,7 +921,7 @@ var dt = class extends r {
900
921
  getPos: () => this.getPos(),
901
922
  updateAttributes: (e = {}) => this.updateAttributes(e),
902
923
  deleteNode: () => this.deleteNode(),
903
- ref: l()
924
+ ref: p()
904
925
  };
905
926
  if (!this.component.displayName) {
906
927
  let e = (e) => e.charAt(0).toUpperCase() + e.substring(1);
@@ -911,24 +932,24 @@ var dt = class extends r {
911
932
  nodeViewContentRef: (e) => {
912
933
  if (e && this.contentDOMElement && e.firstChild !== this.contentDOMElement) {
913
934
  e.hasAttribute("data-node-view-wrapper") && e.removeAttribute("data-node-view-wrapper");
914
- let t = ct(this.contentDOMElement);
935
+ let t = pt(this.contentDOMElement);
915
936
  e.appendChild(this.contentDOMElement), t?.();
916
937
  }
917
938
  }
918
- }, n = this.component, r = d((e) => /* @__PURE__ */ S(K.Provider, {
939
+ }, n = this.component, r = h((e) => /* @__PURE__ */ C(q.Provider, {
919
940
  value: t,
920
- children: c(n, e)
941
+ children: f(n, e)
921
942
  }));
922
943
  r.displayName = "ReactNodeView";
923
944
  let i = this.node.isInline ? "span" : "div";
924
945
  this.options.as && (i = this.options.as);
925
946
  let { className: a = "" } = this.options;
926
- this.renderer = new Y(r, {
947
+ this.renderer = new X(r, {
927
948
  editor: this.editor,
928
949
  props: e,
929
950
  as: i,
930
951
  className: `node-${this.node.type.name} ${a}`.trim()
931
- }), Q(this.editor).register(this), this.updateElementAttributes(), this.currentPos = this.getPos();
952
+ }), _t(this.editor).register(this), this.updateElementAttributes(), this.currentPos = this.getPos();
932
953
  }
933
954
  get dom() {
934
955
  if (this.renderer.element.firstElementChild && !this.renderer.element.firstElementChild?.hasAttribute("data-node-view-wrapper")) throw Error("Please use the NodeViewWrapper component for your node view.");
@@ -988,10 +1009,10 @@ var dt = class extends r {
988
1009
  }
989
1010
  isTextSelectionInside() {
990
1011
  let e = this.getPos();
991
- return typeof e == "number" && X(this.editor.state.selection).includes(e);
1012
+ return typeof e == "number" && Z(this.editor.state.selection).includes(e);
992
1013
  }
993
1014
  destroy() {
994
- this.renderer.destroy(), Q(this.editor).unregister(this), this.options.trackNodeViewPosition && this.editor.off("update", this.handlePositionUpdate), this.contentDOMElement = null;
1015
+ this.renderer.destroy(), _t(this.editor).unregister(this), this.options.trackNodeViewPosition && this.editor.off("update", this.handlePositionUpdate), this.contentDOMElement = null;
995
1016
  }
996
1017
  updateElementAttributes() {
997
1018
  if (this.options.attrs) {
@@ -1007,8 +1028,8 @@ var dt = class extends r {
1007
1028
  }
1008
1029
  }
1009
1030
  };
1010
- function ft(e, t) {
1011
- return (n) => n.editor.contentComponent ? new dt(e, n, t) : {
1031
+ function yt(e, t) {
1032
+ return (n) => n.editor.contentComponent ? new vt(e, n, t) : {
1012
1033
  dom: document.createElement("span"),
1013
1034
  contentDOM: null,
1014
1035
  update: () => !1,
@@ -1019,31 +1040,31 @@ function ft(e, t) {
1019
1040
  ignoreMutation: () => !0
1020
1041
  };
1021
1042
  }
1022
- var $ = s({ get editor() {
1043
+ var Q = d({ get editor() {
1023
1044
  throw Error("useTiptap must be used within a <Tiptap> provider");
1024
1045
  } });
1025
- $.displayName = "TiptapContext";
1026
- var pt = () => f($);
1027
- function mt({ children: e, ...t }) {
1046
+ Q.displayName = "TiptapContext";
1047
+ var bt = () => g(Q);
1048
+ function xt({ children: e, ...t }) {
1028
1049
  let n = "editor" in t ? t.editor : t.instance;
1029
1050
  if (!n) throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");
1030
- let r = g(() => ({ editor: n }), [n]), i = g(() => ({ editor: n }), [n]);
1031
- return /* @__PURE__ */ S(G.Provider, {
1051
+ let r = b(() => ({ editor: n }), [n]), i = b(() => ({ editor: n }), [n]);
1052
+ return /* @__PURE__ */ C(K.Provider, {
1032
1053
  value: i,
1033
- children: /* @__PURE__ */ S($.Provider, {
1054
+ children: /* @__PURE__ */ C(Q.Provider, {
1034
1055
  value: r,
1035
1056
  children: e
1036
1057
  })
1037
1058
  });
1038
1059
  }
1039
- mt.displayName = "Tiptap";
1040
- function ht({ ...e }) {
1041
- let { editor: t } = pt();
1042
- return /* @__PURE__ */ S(V, {
1060
+ xt.displayName = "Tiptap";
1061
+ function $({ ...e }) {
1062
+ let { editor: t } = bt();
1063
+ return /* @__PURE__ */ C(H, {
1043
1064
  editor: t,
1044
1065
  ...e
1045
1066
  });
1046
1067
  }
1047
- ht.displayName = "Tiptap.Content", Object.assign(mt, { Content: ht });
1068
+ $.displayName = "Tiptap.Content", Object.assign(xt, { Content: $ });
1048
1069
  //#endregion
1049
- export { nt as a, Y as i, it as n, tt as o, ft as r, H as s, V as t };
1070
+ export { st as a, X as i, lt as n, ot as o, yt as r, U as s, H as t };