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