@clevertask/scribe 0.1.6 → 0.1.8

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 (44) hide show
  1. package/README.md +6 -4
  2. package/dist/{BarMenu-CXaFlpRJ.js → BarMenu-BG_w4DVo.js} +53 -25
  3. package/dist/assets/index.css +1 -1
  4. package/dist/components/Menu/BarMenu.d.ts.map +1 -1
  5. package/dist/components/Menu/BarMenu.js +1 -1
  6. package/dist/components/Menu/BubbleMenu.js +2 -2
  7. package/dist/components/Menu/LinkBubbleMenu.js +13 -13
  8. package/dist/components/Menu/LinkEditor.js +4 -4
  9. package/dist/components/Menu/Mobile/ListOptionBar.d.ts.map +1 -1
  10. package/dist/components/Menu/Mobile/ListOptionBar.js +11 -5
  11. package/dist/components/Menu/linkBubbleMenuPlugin.js +1 -1
  12. package/dist/components/Scribe/extension/emoji/EmojiList.d.ts.map +1 -1
  13. package/dist/components/Scribe/extension/emoji/EmojiList.js +6 -2
  14. package/dist/components/Scribe/extension/emoji/suggest.js +2 -2
  15. package/dist/components/Scribe/extension/extension-link.js +1 -1
  16. package/dist/components/Scribe/extension/extension-markdown-paste.js +14 -6
  17. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  18. package/dist/components/Scribe/extension/index.js +1 -1
  19. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.d.ts.map +1 -1
  20. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +948 -943
  21. package/dist/components/Scribe/extension/slashCommand/index.js +1 -1
  22. package/dist/components/Scribe/extension/slashCommand/renderItems.js +2 -2
  23. package/dist/components/Scribe/extension/tableOfContents.js +2 -2
  24. package/dist/components/Scribe/index.d.ts +6 -0
  25. package/dist/components/Scribe/index.d.ts.map +1 -1
  26. package/dist/components/Scribe/index.js +213 -76
  27. package/dist/{dist-BQjH-i-q.js → dist-BMKyBtRa.js} +112 -105
  28. package/dist/{dist-Cp938P7P.js → dist-BgEySLwo.js} +283 -146
  29. package/dist/{dist-CnXCIcnl.js → dist-FrapLVQu.js} +16 -9
  30. package/dist/{extension-CZOsheCI.js → extension-BVGWENts.js} +1306 -1300
  31. package/dist/{extension-link-DZID_SYl.js → extension-link-CMRfHUc5.js} +5 -5
  32. package/dist/{floating-ui.dom-rih69525.js → floating-ui.dom-CmJ6iBdh.js} +4 -5
  33. package/dist/{html-to-markdown-CrNOkSye.js → html-to-markdown-Cta7-ssO.js} +3 -2
  34. package/dist/main.js +2 -2
  35. package/dist/{markdown-to-html-DEczPfuq.js → markdown-to-html-DwSNqq2i.js} +8 -6
  36. package/dist/{menus-CakIdDdY.js → menus-D9OsP28c.js} +8 -8
  37. package/dist/{purify.es-DF9CW1cl.js → purify.es-CFiLaBu1.js} +1 -1
  38. package/dist/{slashCommand-B7CRIaKG.js → slashCommand-B6Iz1i0d.js} +5 -8
  39. package/dist/{tables-CjOC70rm.js → tables-CXpUVKdw.js} +9 -7
  40. package/dist/{tippy.esm-D9LL2xiE.js → tippy.esm-DOXqN1Qm.js} +2 -7
  41. package/dist/utils/html-to-markdown.js +1 -1
  42. package/dist/utils/index.js +4 -4
  43. package/dist/utils/markdown-to-html.js +1 -1
  44. package/package.json +49 -34
@@ -1,13 +1,14 @@
1
1
  import { t as e } from "./rolldown-runtime-CtkjhSXr.js";
2
- import * as t from "react";
3
- import n, { createContext as r, forwardRef as i, useContext as a, useDebugValue as o, useEffect as s, useLayoutEffect as c, useMemo as l, useState as u, version as d } from "react";
4
- import f, { flushSync as p } from "react-dom";
5
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
2
+ import { t } from "./dist-BMKyBtRa.js";
3
+ import * as n from "react";
4
+ import r, { createContext as i, forwardRef as a, useContext as o, useDebugValue as s, useEffect as c, useLayoutEffect as l, useMemo as u, useRef as d, useState as f, version as p } from "react";
5
+ import m, { flushSync as h } from "react-dom";
6
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
6
7
  //#region builtin:esm-external-require-react
7
- var _ = /* @__PURE__ */ e(((e, n) => {
8
- n.exports = { ...t };
9
- })), v = /* @__PURE__ */ e(((e) => {
10
- var t = _();
8
+ var y = /* @__PURE__ */ e(((e, t) => {
9
+ t.exports = { ...n };
10
+ })), b = /* @__PURE__ */ e(((e) => {
11
+ var t = y();
11
12
  function n(e, t) {
12
13
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
13
14
  }
@@ -44,7 +45,7 @@ var _ = /* @__PURE__ */ e(((e, n) => {
44
45
  }
45
46
  var d = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? u : c;
46
47
  e.useSyncExternalStore = t.useSyncExternalStore === void 0 ? d : t.useSyncExternalStore;
47
- })), y = /* @__PURE__ */ e(((e) => {
48
+ })), ee = /* @__PURE__ */ e(((e) => {
48
49
  process.env.NODE_ENV !== "production" && (function() {
49
50
  function t(e, t) {
50
51
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
@@ -87,18 +88,18 @@ var _ = /* @__PURE__ */ e(((e, n) => {
87
88
  return t();
88
89
  }
89
90
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
90
- var a = _(), 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;
91
+ var a = y(), 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;
91
92
  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());
92
93
  })();
93
- })), b = /* @__PURE__ */ e(((e, t) => {
94
- process.env.NODE_ENV === "production" ? t.exports = v() : t.exports = y();
95
- })), ee = b(), { getOwnPropertyNames: te, getOwnPropertySymbols: x } = Object, { hasOwnProperty: S } = Object.prototype;
96
- function C(e, t) {
94
+ })), x = /* @__PURE__ */ e(((e, t) => {
95
+ t.exports = process.env.NODE_ENV === "production" ? b() : ee();
96
+ })), S = x(), { getOwnPropertyNames: te, getOwnPropertySymbols: C } = Object, { hasOwnProperty: w } = Object.prototype;
97
+ function T(e, t) {
97
98
  return function(n, r, i) {
98
99
  return e(n, r, i) && t(n, r, i);
99
100
  };
100
101
  }
101
- function w(e) {
102
+ function E(e) {
102
103
  return function(t, n, r) {
103
104
  if (!t || !n || typeof t != "object" || typeof n != "object") return e(t, n, r);
104
105
  let { cache: i } = r, a = i.get(t), o = i.get(n);
@@ -108,39 +109,39 @@ function w(e) {
108
109
  return i.delete(t), i.delete(n), s;
109
110
  };
110
111
  }
111
- function T(e) {
112
+ function ne(e) {
112
113
  return e?.[Symbol.toStringTag];
113
114
  }
114
- function E(e) {
115
- return te(e).concat(x(e));
115
+ function D(e) {
116
+ return te(e).concat(C(e));
116
117
  }
117
- var D = Object.hasOwn || ((e, t) => S.call(e, t));
118
- function O(e, t) {
118
+ var O = Object.hasOwn || ((e, t) => w.call(e, t));
119
+ function k(e, t) {
119
120
  return e === t || !e && !t && e !== e && t !== t;
120
121
  }
121
- var k = "__v", ne = "__o", re = "_owner", { getOwnPropertyDescriptor: A, keys: j } = Object;
122
- function ie(e, t) {
123
- return e.byteLength === t.byteLength && z(new Uint8Array(e), new Uint8Array(t));
122
+ var A = "__v", re = "__o", ie = "_owner", { getOwnPropertyDescriptor: j, keys: M } = Object;
123
+ function ae(e, t) {
124
+ return e.byteLength === t.byteLength && R(new Uint8Array(e), new Uint8Array(t));
124
125
  }
125
- function ae(e, t, n) {
126
+ function oe(e, t, n) {
126
127
  let r = e.length;
127
128
  if (t.length !== r) return !1;
128
129
  for (; r-- > 0;) if (!n.equals(e[r], t[r], r, r, e, t, n)) return !1;
129
130
  return !0;
130
131
  }
131
- function oe(e, t) {
132
- return e.byteLength === t.byteLength && z(new Uint8Array(e.buffer, e.byteOffset, e.byteLength), new Uint8Array(t.buffer, t.byteOffset, t.byteLength));
133
- }
134
132
  function se(e, t) {
135
- return O(e.getTime(), t.getTime());
133
+ return e.byteLength === t.byteLength && R(new Uint8Array(e.buffer, e.byteOffset, e.byteLength), new Uint8Array(t.buffer, t.byteOffset, t.byteLength));
136
134
  }
137
135
  function ce(e, t) {
138
- return e.name === t.name && e.message === t.message && e.cause === t.cause && e.stack === t.stack;
136
+ return k(e.getTime(), t.getTime());
139
137
  }
140
138
  function le(e, t) {
139
+ return e.name === t.name && e.message === t.message && e.cause === t.cause && e.stack === t.stack;
140
+ }
141
+ function ue(e, t) {
141
142
  return e === t;
142
143
  }
143
- function M(e, t, n) {
144
+ function N(e, t, n) {
144
145
  let r = e.size;
145
146
  if (r !== t.size) return !1;
146
147
  if (!r) return !0;
@@ -164,27 +165,27 @@ function M(e, t, n) {
164
165
  }
165
166
  return !0;
166
167
  }
167
- var N = O;
168
- function P(e, t, n) {
169
- let r = j(e), i = r.length;
170
- if (j(t).length !== i) return !1;
171
- for (; i-- > 0;) if (!V(e, t, n, r[i])) return !1;
168
+ var de = k;
169
+ function fe(e, t, n) {
170
+ let r = M(e), i = r.length;
171
+ if (M(t).length !== i) return !1;
172
+ for (; i-- > 0;) if (!B(e, t, n, r[i])) return !1;
172
173
  return !0;
173
174
  }
174
- function F(e, t, n) {
175
- let r = E(e), i = r.length;
176
- if (E(t).length !== i) return !1;
175
+ function P(e, t, n) {
176
+ let r = D(e), i = r.length;
177
+ if (D(t).length !== i) return !1;
177
178
  let a, o, s;
178
- for (; i-- > 0;) if (a = r[i], !V(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;
179
+ for (; i-- > 0;) if (a = r[i], !B(e, t, n, a) || (o = j(e, a), s = j(t, a), (o || s) && (!o || !s || o.configurable !== s.configurable || o.enumerable !== s.enumerable || o.writable !== s.writable))) return !1;
179
180
  return !0;
180
181
  }
181
- function I(e, t) {
182
- return O(e.valueOf(), t.valueOf());
182
+ function F(e, t) {
183
+ return k(e.valueOf(), t.valueOf());
183
184
  }
184
- function L(e, t) {
185
+ function I(e, t) {
185
186
  return e.source === t.source && e.flags === t.flags;
186
187
  }
187
- function R(e, t, n) {
188
+ function L(e, t, n) {
188
189
  let r = e.size;
189
190
  if (r !== t.size) return !1;
190
191
  if (!r) return !0;
@@ -202,19 +203,19 @@ function R(e, t, n) {
202
203
  }
203
204
  return !0;
204
205
  }
205
- function z(e, t) {
206
+ function R(e, t) {
206
207
  let n = e.byteLength;
207
208
  if (t.byteLength !== n || e.byteOffset !== t.byteOffset) return !1;
208
209
  for (; n-- > 0;) if (e[n] !== t[n]) return !1;
209
210
  return !0;
210
211
  }
211
- function B(e, t) {
212
+ function z(e, t) {
212
213
  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;
213
214
  }
214
- function V(e, t, n, r) {
215
- return (r === re || r === ne || r === k) && (e.$$typeof || t.$$typeof) ? !0 : D(t, r) && n.equals(e[r], t[r], r, r, e, t, n);
215
+ function B(e, t, n, r) {
216
+ return (r === ie || r === re || r === A) && (e.$$typeof || t.$$typeof) ? !0 : O(t, r) && n.equals(e[r], t[r], r, r, e, t, n);
216
217
  }
217
- var H = "[object ArrayBuffer]", U = "[object Arguments]", W = "[object Boolean]", ue = "[object DataView]", de = "[object Date]", fe = "[object Error]", pe = "[object Map]", me = "[object Number]", he = "[object Object]", ge = "[object RegExp]", _e = "[object Set]", ve = "[object String]", ye = {
218
+ var V = "[object ArrayBuffer]", pe = "[object Arguments]", me = "[object Boolean]", he = "[object DataView]", ge = "[object Date]", _e = "[object Error]", ve = "[object Map]", ye = "[object Number]", be = "[object Object]", xe = "[object RegExp]", Se = "[object Set]", Ce = "[object String]", we = {
218
219
  "[object Int8Array]": !0,
219
220
  "[object Uint8Array]": !0,
220
221
  "[object Uint8ClampedArray]": !0,
@@ -227,8 +228,8 @@ var H = "[object ArrayBuffer]", U = "[object Arguments]", W = "[object Boolean]"
227
228
  "[object Float64Array]": !0,
228
229
  "[object BigInt64Array]": !0,
229
230
  "[object BigUint64Array]": !0
230
- }, be = "[object URL]", xe = Object.prototype.toString;
231
- function Se({ 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 }) {
231
+ }, Te = "[object URL]", Ee = Object.prototype.toString;
232
+ function De({ 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 }) {
232
233
  return function(h, g, _) {
233
234
  if (h === g) return !0;
234
235
  if (h == null || g == null) return !1;
@@ -243,23 +244,23 @@ function Se({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: n,
243
244
  if (y === RegExp) return u(h, g, _);
244
245
  if (y === Map) return o(h, g, _);
245
246
  if (y === Set) return d(h, g, _);
246
- let b = xe.call(h);
247
- if (b === de) return r(h, g, _);
248
- if (b === ge) return u(h, g, _);
249
- if (b === pe) return o(h, g, _);
250
- if (b === _e) return d(h, g, _);
251
- if (b === he) return typeof h.then != "function" && typeof g.then != "function" && c(h, g, _);
252
- if (b === be) return p(h, g, _);
253
- if (b === fe) return i(h, g, _);
254
- if (b === U) return c(h, g, _);
255
- if (ye[b]) return f(h, g, _);
256
- if (b === H) return e(h, g, _);
257
- if (b === ue) return n(h, g, _);
258
- if (b === W || b === me || b === ve) return l(h, g, _);
247
+ let b = Ee.call(h);
248
+ if (b === ge) return r(h, g, _);
249
+ if (b === xe) return u(h, g, _);
250
+ if (b === ve) return o(h, g, _);
251
+ if (b === Se) return d(h, g, _);
252
+ if (b === be) return typeof h.then != "function" && typeof g.then != "function" && c(h, g, _);
253
+ if (b === Te) return p(h, g, _);
254
+ if (b === _e) return i(h, g, _);
255
+ if (b === pe) return c(h, g, _);
256
+ if (we[b]) return f(h, g, _);
257
+ if (b === V) return e(h, g, _);
258
+ if (b === he) return n(h, g, _);
259
+ if (b === me || b === ye || b === Ce) return l(h, g, _);
259
260
  if (m) {
260
261
  let e = m[b];
261
262
  if (!e) {
262
- let t = T(h);
263
+ let t = ne(h);
263
264
  t && (e = m[t]);
264
265
  }
265
266
  if (e) return e(h, g, _);
@@ -267,26 +268,26 @@ function Se({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: n,
267
268
  return !1;
268
269
  };
269
270
  }
270
- function Ce({ circular: e, createCustomConfig: t, strict: n }) {
271
+ function Oe({ circular: e, createCustomConfig: t, strict: n }) {
271
272
  let r = {
272
- areArrayBuffersEqual: ie,
273
- areArraysEqual: n ? F : ae,
274
- areDataViewsEqual: oe,
275
- areDatesEqual: se,
276
- areErrorsEqual: ce,
277
- areFunctionsEqual: le,
278
- areMapsEqual: n ? C(M, F) : M,
279
- areNumbersEqual: N,
280
- areObjectsEqual: n ? F : P,
281
- arePrimitiveWrappersEqual: I,
282
- areRegExpsEqual: L,
283
- areSetsEqual: n ? C(R, F) : R,
284
- areTypedArraysEqual: n ? C(z, F) : z,
285
- areUrlsEqual: B,
273
+ areArrayBuffersEqual: ae,
274
+ areArraysEqual: n ? P : oe,
275
+ areDataViewsEqual: se,
276
+ areDatesEqual: ce,
277
+ areErrorsEqual: le,
278
+ areFunctionsEqual: ue,
279
+ areMapsEqual: n ? T(N, P) : N,
280
+ areNumbersEqual: de,
281
+ areObjectsEqual: n ? P : fe,
282
+ arePrimitiveWrappersEqual: F,
283
+ areRegExpsEqual: I,
284
+ areSetsEqual: n ? T(L, P) : L,
285
+ areTypedArraysEqual: n ? T(R, P) : R,
286
+ areUrlsEqual: z,
286
287
  unknownTagComparators: void 0
287
288
  };
288
289
  if (t && (r = Object.assign({}, r, t(r))), e) {
289
- let e = w(r.areArraysEqual), t = w(r.areMapsEqual), n = w(r.areObjectsEqual), i = w(r.areSetsEqual);
290
+ let e = E(r.areArraysEqual), t = E(r.areMapsEqual), n = E(r.areObjectsEqual), i = E(r.areSetsEqual);
290
291
  r = Object.assign({}, r, {
291
292
  areArraysEqual: e,
292
293
  areMapsEqual: t,
@@ -296,12 +297,12 @@ function Ce({ circular: e, createCustomConfig: t, strict: n }) {
296
297
  }
297
298
  return r;
298
299
  }
299
- function we(e) {
300
+ function ke(e) {
300
301
  return function(t, n, r, i, a, o, s) {
301
302
  return e(t, n, s);
302
303
  };
303
304
  }
304
- function Te({ circular: e, comparator: t, createState: n, equals: r, strict: i }) {
305
+ function Ae({ circular: e, comparator: t, createState: n, equals: r, strict: i }) {
305
306
  if (n) return function(a, o) {
306
307
  let { cache: s = e ? /* @__PURE__ */ new WeakMap() : void 0, meta: c } = n();
307
308
  return t(a, o, {
@@ -329,35 +330,35 @@ function Te({ circular: e, comparator: t, createState: n, equals: r, strict: i }
329
330
  return t(e, n, a);
330
331
  };
331
332
  }
332
- var Ee = G();
333
- G({ strict: !0 }), G({ circular: !0 }), G({
333
+ var je = H();
334
+ H({ strict: !0 }), H({ circular: !0 }), H({
334
335
  circular: !0,
335
336
  strict: !0
336
- }), G({ createInternalComparator: () => O }), G({
337
+ }), H({ createInternalComparator: () => k }), H({
337
338
  strict: !0,
338
- createInternalComparator: () => O
339
- }), G({
339
+ createInternalComparator: () => k
340
+ }), H({
340
341
  circular: !0,
341
- createInternalComparator: () => O
342
- }), G({
342
+ createInternalComparator: () => k
343
+ }), H({
343
344
  circular: !0,
344
- createInternalComparator: () => O,
345
+ createInternalComparator: () => k,
345
346
  strict: !0
346
347
  });
347
- function G(e = {}) {
348
- let { circular: t = !1, createInternalComparator: n, createState: r, strict: i = !1 } = e, a = Se(Ce(e));
349
- return Te({
348
+ function H(e = {}) {
349
+ let { circular: t = !1, createInternalComparator: n, createState: r, strict: i = !1 } = e, a = De(Oe(e));
350
+ return Ae({
350
351
  circular: t,
351
352
  comparator: a,
352
353
  createState: r,
353
- equals: n ? n(a) : we(a),
354
+ equals: n ? n(a) : ke(a),
354
355
  strict: i
355
356
  });
356
357
  }
357
358
  //#endregion
358
359
  //#region node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.5/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js
359
- var De = /* @__PURE__ */ e(((e) => {
360
- var t = _(), n = b();
360
+ var Me = /* @__PURE__ */ e(((e) => {
361
+ var t = y(), n = x();
361
362
  function r(e, t) {
362
363
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
363
364
  }
@@ -401,13 +402,13 @@ var De = /* @__PURE__ */ e(((e) => {
401
402
  f.hasValue = !0, f.value = p;
402
403
  }, [p]), l(p), p;
403
404
  };
404
- })), Oe = /* @__PURE__ */ e(((e) => {
405
+ })), Ne = /* @__PURE__ */ e(((e) => {
405
406
  process.env.NODE_ENV !== "production" && (function() {
406
407
  function t(e, t) {
407
408
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
408
409
  }
409
410
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
410
- var n = _(), r = b(), i = typeof Object.is == "function" ? Object.is : t, a = r.useSyncExternalStore, o = n.useRef, s = n.useEffect, c = n.useMemo, l = n.useDebugValue;
411
+ var n = y(), r = x(), i = typeof Object.is == "function" ? Object.is : t, a = r.useSyncExternalStore, o = n.useRef, s = n.useEffect, c = n.useMemo, l = n.useDebugValue;
411
412
  e.useSyncExternalStoreWithSelector = function(e, t, n, r, u) {
412
413
  var d = o(null);
413
414
  if (d.current === null) {
@@ -448,17 +449,17 @@ var De = /* @__PURE__ */ e(((e) => {
448
449
  }, [p]), l(p), p;
449
450
  }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
450
451
  })();
451
- })), ke = (/* @__PURE__ */ e(((e, t) => {
452
- process.env.NODE_ENV === "production" ? t.exports = De() : t.exports = Oe();
453
- })))(), Ae = (...e) => (t) => {
452
+ })), Pe = (/* @__PURE__ */ e(((e, t) => {
453
+ t.exports = process.env.NODE_ENV === "production" ? Me() : Ne();
454
+ })))(), Fe = (...e) => (t) => {
454
455
  e.forEach((e) => {
455
456
  typeof e == "function" ? e(t) : e && (e.current = t);
456
457
  });
457
- }, je = ({ contentComponent: e }) => {
458
- let t = (0, ee.useSyncExternalStore)(e.subscribe, e.getSnapshot, e.getServerSnapshot);
459
- return /* @__PURE__ */ h(m, { children: Object.values(t) });
458
+ }, Ie = ({ contentComponent: e }) => {
459
+ let t = (0, S.useSyncExternalStore)(e.subscribe, e.getSnapshot, e.getServerSnapshot);
460
+ return /* @__PURE__ */ _(g, { children: Object.values(t) });
460
461
  };
461
- function Me() {
462
+ function Le() {
462
463
  let e = /* @__PURE__ */ new Set(), t = {}, n = !1, r = () => {
463
464
  n || !e.size || (n = !0, queueMicrotask(() => {
464
465
  n = !1, e.forEach((e) => e());
@@ -479,7 +480,7 @@ function Me() {
479
480
  setRenderer(e, n) {
480
481
  t = {
481
482
  ...t,
482
- [e]: f.createPortal(n.reactElement, n.element, e)
483
+ [e]: m.createPortal(n.reactElement, n.element, e)
483
484
  }, r();
484
485
  },
485
486
  removeRenderer(e) {
@@ -488,9 +489,9 @@ function Me() {
488
489
  }
489
490
  };
490
491
  }
491
- var Ne = class extends n.Component {
492
+ var Re = class extends r.Component {
492
493
  constructor(e) {
493
- super(e), this.editorContentRef = n.createRef();
494
+ super(e), this.editorContentRef = r.createRef();
494
495
  }
495
496
  componentDidMount() {
496
497
  this.init();
@@ -503,7 +504,7 @@ var Ne = class extends n.Component {
503
504
  if (e && !e.isDestroyed && e.view.dom?.parentNode) {
504
505
  if (e.contentComponent) return;
505
506
  let t = this.editorContentRef.current;
506
- t.append(...e.view.dom.parentNode.childNodes), e.setOptions({ element: t }), e.contentComponent = Me(), e.createNodeViews(), e.isEditorContentInitialized = !0, this.forceUpdate();
507
+ t.append(...e.view.dom.parentNode.childNodes), e.setOptions({ element: t }), e.contentComponent = Le(), e.createNodeViews(), e.isEditorContentInitialized = !0, this.forceUpdate();
507
508
  }
508
509
  }
509
510
  componentWillUnmount() {
@@ -519,19 +520,19 @@ var Ne = class extends n.Component {
519
520
  }
520
521
  render() {
521
522
  let { editor: e, innerRef: t, ...n } = this.props;
522
- return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("div", {
523
- ref: Ae(t, this.editorContentRef),
523
+ return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", {
524
+ ref: Fe(t, this.editorContentRef),
524
525
  ...n
525
- }), e?.contentComponent && /* @__PURE__ */ h(je, { contentComponent: e.contentComponent })] });
526
+ }), e?.contentComponent && /* @__PURE__ */ _(Ie, { contentComponent: e.contentComponent })] });
526
527
  }
527
- }, Pe = i((e, t) => {
528
- let r = n.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
529
- return n.createElement(Ne, {
530
- key: r,
528
+ }, ze = a((e, t) => {
529
+ let n = r.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
530
+ return r.createElement(Re, {
531
+ key: n,
531
532
  innerRef: t,
532
533
  ...e
533
534
  });
534
- }), K = n.memo(Pe), Fe = typeof window < "u" ? c : s, Ie = class {
535
+ }), U = r.memo(ze), Be = typeof window < "u" ? l : c, Ve = class {
535
536
  constructor(e) {
536
537
  this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = e, this.lastSnapshot = {
537
538
  editor: e,
@@ -558,7 +559,7 @@ var Ne = class extends n.Component {
558
559
  watch(e) {
559
560
  if (this.editor = e, this.editor) {
560
561
  let e, t = (t) => {
561
- t?.transaction !== void 0 && t.transaction === e || (e = t?.transaction, this.transactionNumber += 1, this.subscribers.forEach((e) => e()));
562
+ (t?.transaction === void 0 || t.transaction !== e) && (e = t?.transaction, this.transactionNumber += 1, this.subscribers.forEach((e) => e()));
562
563
  }, n = this.editor;
563
564
  return n.on("transaction", t), n.on("update", t), () => {
564
565
  n.off("transaction", t), n.off("update", t);
@@ -566,21 +567,157 @@ var Ne = class extends n.Component {
566
567
  }
567
568
  }
568
569
  };
569
- function Le(e) {
570
- let [t] = u(() => new Ie(e.editor)), n = (0, ke.useSyncExternalStoreWithSelector)(t.subscribe, t.getSnapshot, t.getServerSnapshot, e.selector, e.equalityFn ?? Ee);
571
- return Fe(() => t.watch(e.editor), [e.editor, t]), o(n), n;
570
+ function W(e) {
571
+ let [t] = f(() => new Ve(e.editor)), n = (0, Pe.useSyncExternalStoreWithSelector)(t.subscribe, t.getSnapshot, t.getServerSnapshot, e.selector, e.equalityFn ?? je);
572
+ return Be(() => t.watch(e.editor), [e.editor, t]), s(n), n;
572
573
  }
573
- process.env.NODE_ENV, typeof window > "u" || typeof window < "u" && window.next;
574
- var q = r({ editor: null });
574
+ var G = process.env.NODE_ENV !== "production", K = typeof window > "u", He = K || !!(typeof window < "u" && window.next), Ue = class e {
575
+ constructor(e) {
576
+ 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);
577
+ }
578
+ setEditor(e) {
579
+ this.editor = e, this.instanceId = Math.random().toString(36).slice(2, 9), this.subscriptions.forEach((e) => e());
580
+ }
581
+ getInitialEditor() {
582
+ let e = this.options.current.immediatelyRender, t = e ?? !0;
583
+ return K ? (t && G && console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"), t = !1) : He && 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;
584
+ }
585
+ createEditor() {
586
+ let e = {
587
+ ...this.options.current,
588
+ onBeforeCreate: (...e) => {
589
+ var t;
590
+ return (t = this.options.current).onBeforeCreate?.call(t, ...e);
591
+ },
592
+ onBlur: (...e) => {
593
+ var t;
594
+ return (t = this.options.current).onBlur?.call(t, ...e);
595
+ },
596
+ onCreate: (...e) => {
597
+ var t;
598
+ return (t = this.options.current).onCreate?.call(t, ...e);
599
+ },
600
+ onDestroy: (...e) => {
601
+ var t;
602
+ return (t = this.options.current).onDestroy?.call(t, ...e);
603
+ },
604
+ onFocus: (...e) => {
605
+ var t;
606
+ return (t = this.options.current).onFocus?.call(t, ...e);
607
+ },
608
+ onSelectionUpdate: (...e) => {
609
+ var t;
610
+ return (t = this.options.current).onSelectionUpdate?.call(t, ...e);
611
+ },
612
+ onTransaction: (...e) => {
613
+ var t;
614
+ return (t = this.options.current).onTransaction?.call(t, ...e);
615
+ },
616
+ onUpdate: (...e) => {
617
+ var t;
618
+ return (t = this.options.current).onUpdate?.call(t, ...e);
619
+ },
620
+ onContentError: (...e) => {
621
+ var t;
622
+ return (t = this.options.current).onContentError?.call(t, ...e);
623
+ },
624
+ onDrop: (...e) => {
625
+ var t;
626
+ return (t = this.options.current).onDrop?.call(t, ...e);
627
+ },
628
+ onPaste: (...e) => {
629
+ var t;
630
+ return (t = this.options.current).onPaste?.call(t, ...e);
631
+ },
632
+ onDelete: (...e) => {
633
+ var t;
634
+ return (t = this.options.current).onDelete?.call(t, ...e);
635
+ },
636
+ onMount: (...e) => {
637
+ var t;
638
+ return (t = this.options.current).onMount?.call(t, ...e);
639
+ },
640
+ onUnmount: (...e) => {
641
+ var t;
642
+ return (t = this.options.current).onUnmount?.call(t, ...e);
643
+ }
644
+ };
645
+ return new t(e);
646
+ }
647
+ getEditor() {
648
+ return this.editor;
649
+ }
650
+ getServerSnapshot() {
651
+ return null;
652
+ }
653
+ subscribe(e) {
654
+ return this.subscriptions.add(e), () => {
655
+ this.subscriptions.delete(e);
656
+ };
657
+ }
658
+ static compareOptions(e, t) {
659
+ return Object.keys(e).every((n) => [
660
+ "onCreate",
661
+ "onBeforeCreate",
662
+ "onDestroy",
663
+ "onUpdate",
664
+ "onTransaction",
665
+ "onFocus",
666
+ "onBlur",
667
+ "onSelectionUpdate",
668
+ "onContentError",
669
+ "onDrop",
670
+ "onPaste"
671
+ ].includes(n) ? !0 : n === "extensions" && e.extensions && t.extensions ? e.extensions.length === t.extensions.length && e.extensions.every((e, n) => e === t.extensions?.[n]) : e[n] === t[n]);
672
+ }
673
+ onRender(t) {
674
+ return () => (this.isComponentMounted = !0, clearTimeout(this.scheduledDestructionTimeout), this.editor && !this.editor.isDestroyed && t.length === 0 ? e.compareOptions(this.options.current, this.editor.options) || this.editor.setOptions({
675
+ ...this.options.current,
676
+ editable: this.editor.isEditable
677
+ }) : this.refreshEditorInstance(t), () => {
678
+ this.isComponentMounted = !1, this.scheduleDestroy();
679
+ });
680
+ }
681
+ refreshEditorInstance(e) {
682
+ if (this.editor && !this.editor.isDestroyed) {
683
+ if (this.previousDeps === null) {
684
+ this.previousDeps = e;
685
+ return;
686
+ }
687
+ if (this.previousDeps.length === e.length && this.previousDeps.every((t, n) => t === e[n])) return;
688
+ }
689
+ this.editor && !this.editor.isDestroyed && this.editor.destroy(), this.setEditor(this.createEditor()), this.previousDeps = e;
690
+ }
691
+ scheduleDestroy() {
692
+ let e = this.instanceId, t = this.editor;
693
+ this.scheduledDestructionTimeout = setTimeout(() => {
694
+ if (this.isComponentMounted && this.instanceId === e) {
695
+ t && t.setOptions(this.options.current);
696
+ return;
697
+ }
698
+ t && !t.isDestroyed && (t.destroy(), this.instanceId === e && this.setEditor(null));
699
+ }, 1);
700
+ }
701
+ };
702
+ function We(e = {}, t = []) {
703
+ let n = d(e);
704
+ n.current = e;
705
+ let [r] = f(() => new Ue(n)), i = (0, S.useSyncExternalStore)(r.subscribe, r.getEditor, r.getServerSnapshot);
706
+ return s(i), c(r.onRender(t)), W({
707
+ editor: i,
708
+ selector: ({ transactionNumber: t }) => e.shouldRerenderOnTransaction === !1 || e.shouldRerenderOnTransaction === void 0 ? null : e.immediatelyRender && t === 0 ? 0 : t + 1
709
+ }), i;
710
+ }
711
+ var q = i({ editor: null });
575
712
  q.Consumer;
576
- var Re = () => a(q), ze = r({
713
+ var Ge = () => o(q), Ke = i({
577
714
  onDragStart: () => {},
578
715
  nodeViewContentChildren: void 0,
579
716
  nodeViewContentRef: () => {}
580
- }), J = () => a(ze);
581
- n.forwardRef((e, t) => {
582
- let { onDragStart: n } = J();
583
- return /* @__PURE__ */ h(e.as || "div", {
717
+ }), J = () => o(Ke);
718
+ r.forwardRef((e, t) => {
719
+ let { onDragStart: n } = J(), r = e.as || "div";
720
+ return /* @__PURE__ */ _(r, {
584
721
  ...e,
585
722
  ref: t,
586
723
  "data-node-view-wrapper": "",
@@ -597,26 +734,26 @@ function Y(e) {
597
734
  function X(e) {
598
735
  return !!(typeof e == "object" && e.$$typeof && (e.$$typeof.toString() === "Symbol(react.forward_ref)" || e.$$typeof.description === "react.forward_ref"));
599
736
  }
600
- function Be(e) {
737
+ function qe(e) {
601
738
  return !!(typeof e == "object" && e.$$typeof && (e.$$typeof.toString() === "Symbol(react.memo)" || e.$$typeof.description === "react.memo"));
602
739
  }
603
- function Ve(e) {
740
+ function Je(e) {
604
741
  if (Y(e) || X(e)) return !0;
605
- if (Be(e)) {
742
+ if (qe(e)) {
606
743
  let t = e.type;
607
744
  if (t) return Y(t) || X(t);
608
745
  }
609
746
  return !1;
610
747
  }
611
- function He() {
748
+ function Ye() {
612
749
  try {
613
- if (d) return parseInt(d.split(".")[0], 10) >= 19;
750
+ if (p) return parseInt(p.split(".")[0], 10) >= 19;
614
751
  } catch {}
615
752
  return !1;
616
753
  }
617
- var Ue = class {
754
+ var Xe = class {
618
755
  constructor(e, { editor: t, props: n = {}, as: r = "div", className: i = "" }) {
619
- 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 ? p(() => {
756
+ 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 ? h(() => {
620
757
  this.render();
621
758
  }) : queueMicrotask(() => {
622
759
  this.destroyed || this.render();
@@ -625,10 +762,10 @@ var Ue = class {
625
762
  render() {
626
763
  var e;
627
764
  if (this.destroyed) return;
628
- let t = this.component, n = this.props, r = this.editor, i = He(), a = Ve(t), o = { ...n };
765
+ let t = this.component, n = this.props, r = this.editor, i = Ye(), a = Je(t), o = { ...n };
629
766
  o.ref && !(i || a) && delete o.ref, !o.ref && (i || a) && (o.ref = (e) => {
630
767
  this.ref = e;
631
- }), this.reactElement = /* @__PURE__ */ h(t, { ...o }), (e = r?.contentComponent) == null || e.setRenderer(this.id, this);
768
+ }), this.reactElement = /* @__PURE__ */ _(t, { ...o }), (e = r?.contentComponent) == null || e.setRenderer(this.id, this);
632
769
  }
633
770
  updateProps(e = {}) {
634
771
  if (this.destroyed) return;
@@ -658,19 +795,19 @@ var Ue = class {
658
795
  });
659
796
  }
660
797
  };
661
- n.createContext({ markViewContentRef: () => {} });
662
- var Z = r({ get editor() {
798
+ r.createContext({ markViewContentRef: () => {} });
799
+ var Z = i({ get editor() {
663
800
  throw Error("useTiptap must be used within a <Tiptap> provider");
664
801
  } });
665
802
  Z.displayName = "TiptapContext";
666
- var We = () => a(Z);
803
+ var Ze = () => o(Z);
667
804
  function Q({ children: e, ...t }) {
668
805
  let n = "editor" in t ? t.editor : t.instance;
669
806
  if (!n) throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");
670
- let r = l(() => ({ editor: n }), [n]), i = l(() => ({ editor: n }), [n]);
671
- return /* @__PURE__ */ h(q.Provider, {
807
+ let r = u(() => ({ editor: n }), [n]), i = u(() => ({ editor: n }), [n]);
808
+ return /* @__PURE__ */ _(q.Provider, {
672
809
  value: i,
673
- children: /* @__PURE__ */ h(Z.Provider, {
810
+ children: /* @__PURE__ */ _(Z.Provider, {
674
811
  value: r,
675
812
  children: e
676
813
  })
@@ -678,12 +815,12 @@ function Q({ children: e, ...t }) {
678
815
  }
679
816
  Q.displayName = "Tiptap";
680
817
  function $({ ...e }) {
681
- let { editor: t } = We();
682
- return /* @__PURE__ */ h(K, {
818
+ let { editor: t } = Ze();
819
+ return /* @__PURE__ */ _(U, {
683
820
  editor: t,
684
821
  ...e
685
822
  });
686
823
  }
687
824
  $.displayName = "Tiptap.Content", Object.assign(Q, { Content: $ });
688
825
  //#endregion
689
- export { Le as i, Ue as n, Re as r, K as t };
826
+ export { W as a, We as i, Xe as n, Ge as r, U as t };