@pretextbook/web-editor 0.0.5 → 0.0.7
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/dist/components/Editors.d.ts +2 -0
- package/dist/components/FullPreview.d.ts +4 -1
- package/dist/components/MenuBar.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +357 -342
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +76 -76
- package/dist/index.js.map +1 -1
- package/dist/web-editor.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ce from "react";
|
|
2
|
-
import Be, { useContext as ao, useState as Ct, useRef as Ce, useEffect as
|
|
2
|
+
import Be, { useContext as ao, useState as Ct, useRef as Ce, useEffect as He, memo as lo, useCallback as _a, createRef as q1, createContext as Yd, createElement as _1, version as K0, useDebugValue as Jd, forwardRef as W1, useLayoutEffect as U1 } from "react";
|
|
3
3
|
import G1, { flushSync as K1, createPortal as Xd } from "react-dom";
|
|
4
4
|
var Ji = { exports: {} }, si = {};
|
|
5
5
|
var Y0;
|
|
@@ -2073,7 +2073,7 @@ var su = function(e) {
|
|
|
2073
2073
|
}, D = function() {
|
|
2074
2074
|
!d || !a.current || (ke.removeInlineStyle(a.current), o(!1));
|
|
2075
2075
|
};
|
|
2076
|
-
return
|
|
2076
|
+
return He(function() {
|
|
2077
2077
|
h || N();
|
|
2078
2078
|
}, [h]), {
|
|
2079
2079
|
id: w,
|
|
@@ -2573,7 +2573,7 @@ svg.p-icon g,
|
|
|
2573
2573
|
`).concat(Og, `
|
|
2574
2574
|
`).concat(Ng, `
|
|
2575
2575
|
}
|
|
2576
|
-
`),
|
|
2576
|
+
`), je = {
|
|
2577
2577
|
cProps: void 0,
|
|
2578
2578
|
cParams: void 0,
|
|
2579
2579
|
cName: void 0,
|
|
@@ -2587,9 +2587,9 @@ svg.p-icon g,
|
|
|
2587
2587
|
classes: {},
|
|
2588
2588
|
styles: "",
|
|
2589
2589
|
extend: function() {
|
|
2590
|
-
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.css, n = Je(Je({}, e.defaultProps),
|
|
2590
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.css, n = Je(Je({}, e.defaultProps), je.defaultProps), i = {}, s = function(c) {
|
|
2591
2591
|
var d = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2592
|
-
return
|
|
2592
|
+
return je.context = d, je.cProps = c, Ee.getMergedProps(c, n);
|
|
2593
2593
|
}, o = function(c) {
|
|
2594
2594
|
return Ee.getDiffProps(c, n);
|
|
2595
2595
|
}, a = function() {
|
|
@@ -2601,8 +2601,8 @@ svg.p-icon g,
|
|
|
2601
2601
|
var we, C;
|
|
2602
2602
|
return ((we = h.props) === null || we === void 0 ? void 0 : we[Q]) || ((C = N(h)) === null || C === void 0 ? void 0 : C[Q]);
|
|
2603
2603
|
};
|
|
2604
|
-
|
|
2605
|
-
var L = D("ptOptions") ||
|
|
2604
|
+
je.cParams = h, je.cName = E;
|
|
2605
|
+
var L = D("ptOptions") || je.context.ptOptions || {}, z = L.mergeSections, $ = z === void 0 ? !0 : z, ee = L.mergeProps, re = ee === void 0 ? !1 : ee, ue = function() {
|
|
2606
2606
|
var Q = pr.apply(void 0, arguments);
|
|
2607
2607
|
return Array.isArray(Q) ? {
|
|
2608
2608
|
className: wi.apply(void 0, au(Q))
|
|
@@ -2613,7 +2613,7 @@ svg.p-icon g,
|
|
|
2613
2613
|
} : Q;
|
|
2614
2614
|
}, te = m ? y ? ih(ue, v, h) : sh(ue, v, h) : void 0, W = y ? void 0 : ho(co(d, E), ue, v, h), J = !I && Je(Je({}, w === "root" && Ka({}, "".concat(O, "name"), h.props && h.props.__parentMetadata ? Ee.toFlatCase(h.props.__TYPE) : E)), {}, Ka({}, "".concat(O, "section"), w));
|
|
2615
2615
|
return $ || !$ && W ? re ? Ls([te, W, Object.keys(J).length ? J : {}], {
|
|
2616
|
-
classNameMergeFunction: (c =
|
|
2616
|
+
classNameMergeFunction: (c = je.context.ptOptions) === null || c === void 0 ? void 0 : c.classNameMergeFunction
|
|
2617
2617
|
}) : Je(Je(Je({}, te), W), Object.keys(J).length ? J : {}) : Je(Je({}, W), Object.keys(J).length ? J : {});
|
|
2618
2618
|
}, l = function() {
|
|
2619
2619
|
var c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, d = c.props, f = c.state, h = function() {
|
|
@@ -2623,7 +2623,7 @@ svg.p-icon g,
|
|
|
2623
2623
|
var E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, I = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", O = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2624
2624
|
return a(E, I, O, !1);
|
|
2625
2625
|
}, v = function() {
|
|
2626
|
-
return
|
|
2626
|
+
return je.context.unstyled || uo.unstyled || d.unstyled;
|
|
2627
2627
|
}, y = function() {
|
|
2628
2628
|
var E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", I = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2629
2629
|
return v() ? void 0 : pr(t && t.classes, E, Je({
|
|
@@ -2641,7 +2641,7 @@ svg.p-icon g,
|
|
|
2641
2641
|
state: f
|
|
2642
2642
|
}, I));
|
|
2643
2643
|
return Ls([L, D], {
|
|
2644
|
-
classNameMergeFunction: (N =
|
|
2644
|
+
classNameMergeFunction: (N = je.context.ptOptions) === null || N === void 0 ? void 0 : N.classNameMergeFunction
|
|
2645
2645
|
});
|
|
2646
2646
|
}
|
|
2647
2647
|
};
|
|
@@ -2669,7 +2669,7 @@ svg.p-icon g,
|
|
|
2669
2669
|
}, co = function(e) {
|
|
2670
2670
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", n = arguments.length > 2 ? arguments[2] : void 0, i = e?._usept, s = function(a) {
|
|
2671
2671
|
var l, u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, c = n ? n(a) : a, d = Ee.toFlatCase(t);
|
|
2672
|
-
return (l = u ? d !==
|
|
2672
|
+
return (l = u ? d !== je.cName ? c?.[d] : void 0 : c?.[d]) !== null && l !== void 0 ? l : c;
|
|
2673
2673
|
};
|
|
2674
2674
|
return Ee.isNotEmpty(i) ? {
|
|
2675
2675
|
_usept: i,
|
|
@@ -2681,19 +2681,19 @@ svg.p-icon g,
|
|
|
2681
2681
|
return t(v, n, i);
|
|
2682
2682
|
};
|
|
2683
2683
|
if (e != null && e.hasOwnProperty("_usept")) {
|
|
2684
|
-
var o = e._usept ||
|
|
2684
|
+
var o = e._usept || je.context.ptOptions || {}, a = o.mergeSections, l = a === void 0 ? !0 : a, u = o.mergeProps, c = u === void 0 ? !1 : u, d = o.classNameMergeFunction, f = s(e.originalValue), h = s(e.value);
|
|
2685
2685
|
return f === void 0 && h === void 0 ? void 0 : Ee.isString(h) ? h : Ee.isString(f) ? f : l || !l && h ? c ? Ls([f, h], {
|
|
2686
2686
|
classNameMergeFunction: d
|
|
2687
2687
|
}) : Je(Je({}, f), h) : h;
|
|
2688
2688
|
}
|
|
2689
2689
|
return s(e);
|
|
2690
2690
|
}, Rg = function() {
|
|
2691
|
-
return co(
|
|
2692
|
-
return Ee.getItemValue(e,
|
|
2691
|
+
return co(je.context.pt || uo.pt, void 0, function(e) {
|
|
2692
|
+
return Ee.getItemValue(e, je.cParams);
|
|
2693
2693
|
});
|
|
2694
2694
|
}, Ig = function() {
|
|
2695
|
-
return co(
|
|
2696
|
-
return pr(e,
|
|
2695
|
+
return co(je.context.pt || uo.pt, void 0, function(e) {
|
|
2696
|
+
return pr(e, je.cName, je.cParams) || Ee.getItemValue(e, je.cParams);
|
|
2697
2697
|
});
|
|
2698
2698
|
}, ih = function(e, t, n) {
|
|
2699
2699
|
return ho(Rg(), e, t, n);
|
|
@@ -2701,7 +2701,7 @@ svg.p-icon g,
|
|
|
2701
2701
|
return ho(Ig(), e, t, n);
|
|
2702
2702
|
}, Pg = function(e) {
|
|
2703
2703
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() {
|
|
2704
|
-
}, n = arguments.length > 2 ? arguments[2] : void 0, i = n.name, s = n.styled, o = s === void 0 ? !1 : s, a = n.hostName, l = a === void 0 ? "" : a, u = ih(pr, "global.css",
|
|
2704
|
+
}, n = arguments.length > 2 ? arguments[2] : void 0, i = n.name, s = n.styled, o = s === void 0 ? !1 : s, a = n.hostName, l = a === void 0 ? "" : a, u = ih(pr, "global.css", je.cParams), c = Ee.toFlatCase(i), d = Xi(Eg, {
|
|
2705
2705
|
name: "base",
|
|
2706
2706
|
manual: !0
|
|
2707
2707
|
}), f = d.load, h = Xi(Dg, {
|
|
@@ -2715,7 +2715,7 @@ svg.p-icon g,
|
|
|
2715
2715
|
manual: !0
|
|
2716
2716
|
}), k = w.load, E = function(O) {
|
|
2717
2717
|
if (!l) {
|
|
2718
|
-
var N = ho(co((
|
|
2718
|
+
var N = ho(co((je.cProps || {}).pt, c), pr, "hooks.".concat(O)), D = sh(pr, "hooks.".concat(O));
|
|
2719
2719
|
N?.(), D?.();
|
|
2720
2720
|
}
|
|
2721
2721
|
};
|
|
@@ -2891,7 +2891,7 @@ var _g = {
|
|
|
2891
2891
|
}
|
|
2892
2892
|
}
|
|
2893
2893
|
|
|
2894
|
-
`, Qi =
|
|
2894
|
+
`, Qi = je.extend({
|
|
2895
2895
|
defaultProps: {
|
|
2896
2896
|
__TYPE: "Splitter",
|
|
2897
2897
|
className: null,
|
|
@@ -2909,7 +2909,7 @@ var _g = {
|
|
|
2909
2909
|
classes: _g,
|
|
2910
2910
|
styles: Wg
|
|
2911
2911
|
}
|
|
2912
|
-
}), As =
|
|
2912
|
+
}), As = je.extend({
|
|
2913
2913
|
defaultProps: {
|
|
2914
2914
|
__TYPE: "SplitterPanel",
|
|
2915
2915
|
className: null,
|
|
@@ -3564,12 +3564,12 @@ function V4({ width: r, height: e, isEditorReady: t, loading: n, _ref: i, classN
|
|
|
3564
3564
|
}
|
|
3565
3565
|
var j4 = V4, fh = lo(j4);
|
|
3566
3566
|
function q4(r) {
|
|
3567
|
-
|
|
3567
|
+
He(r, []);
|
|
3568
3568
|
}
|
|
3569
3569
|
var ph = q4;
|
|
3570
3570
|
function _4(r, e, t = !0) {
|
|
3571
3571
|
let n = Ce(!0);
|
|
3572
|
-
|
|
3572
|
+
He(n.current || !t ? () => {
|
|
3573
3573
|
n.current = !1;
|
|
3574
3574
|
} : r, e);
|
|
3575
3575
|
}
|
|
@@ -3624,9 +3624,9 @@ function G4({ original: r, modified: e, language: t, originalLanguage: n, modifi
|
|
|
3624
3624
|
}, [t, e, i, r, n, s, o]), ue = _a(() => {
|
|
3625
3625
|
!ee.current && L.current && (N.current = D.current.editor.createDiffEditor(L.current, { automaticLayout: !0, ...d }), re(), D.current?.editor.setTheme(u), E(!0), ee.current = !0);
|
|
3626
3626
|
}, [d, u, re]);
|
|
3627
|
-
|
|
3627
|
+
He(() => {
|
|
3628
3628
|
k && z.current(N.current, D.current);
|
|
3629
|
-
}, [k]),
|
|
3629
|
+
}, [k]), He(() => {
|
|
3630
3630
|
!I && !k && ue();
|
|
3631
3631
|
}, [I, k, ue]);
|
|
3632
3632
|
function te() {
|
|
@@ -3639,7 +3639,7 @@ var K4 = G4;
|
|
|
3639
3639
|
lo(K4);
|
|
3640
3640
|
function Y4(r) {
|
|
3641
3641
|
let e = Ce();
|
|
3642
|
-
return
|
|
3642
|
+
return He(() => {
|
|
3643
3643
|
e.current = r;
|
|
3644
3644
|
}, [r]), e.current;
|
|
3645
3645
|
}
|
|
@@ -3671,15 +3671,15 @@ function X4({ defaultValue: r, defaultLanguage: e, defaultPath: t, value: n, lan
|
|
|
3671
3671
|
$.current = z.current?.editor.create(ee.current, { model: R, automaticLayout: !0, ...u }, c), d && $.current.restoreViewState(ts.get(x)), z.current.editor.setTheme(o), a !== void 0 && $.current.revealLine(a), N(!0), me.current = !0;
|
|
3672
3672
|
}
|
|
3673
3673
|
}, [r, e, t, n, i, s, u, c, d, o, a]);
|
|
3674
|
-
|
|
3674
|
+
He(() => {
|
|
3675
3675
|
O && re.current($.current, z.current);
|
|
3676
|
-
}, [O]),
|
|
3676
|
+
}, [O]), He(() => {
|
|
3677
3677
|
!D && !O && we();
|
|
3678
|
-
}, [D, O, we]), W.current = n,
|
|
3678
|
+
}, [D, O, we]), W.current = n, He(() => {
|
|
3679
3679
|
O && E && (te.current?.dispose(), te.current = $.current?.onDidChangeModelContent((x) => {
|
|
3680
3680
|
Q.current || E($.current.getValue(), x);
|
|
3681
3681
|
}));
|
|
3682
|
-
}, [O, E]),
|
|
3682
|
+
}, [O, E]), He(() => {
|
|
3683
3683
|
if (O) {
|
|
3684
3684
|
let x = z.current.editor.onDidChangeMarkers((R) => {
|
|
3685
3685
|
let V = $.current.getModel()?.uri;
|
|
@@ -3702,7 +3702,6 @@ function X4({ defaultValue: r, defaultLanguage: e, defaultPath: t, value: n, lan
|
|
|
3702
3702
|
}
|
|
3703
3703
|
var Z4 = X4, Q4 = lo(Z4);
|
|
3704
3704
|
const e2 = {
|
|
3705
|
-
theme: "vs-light",
|
|
3706
3705
|
automaticLayout: !0,
|
|
3707
3706
|
minimap: { enabled: !1 },
|
|
3708
3707
|
wordWrap: "on",
|
|
@@ -3711,7 +3710,7 @@ const e2 = {
|
|
|
3711
3710
|
padding: { top: 10, bottom: 10 }
|
|
3712
3711
|
}, t2 = ({ content: r, onChange: e }) => {
|
|
3713
3712
|
const t = Ce(null), n = Ce(null), i = Ce(null), [, s] = Ct(!1), [, o] = Ct(!1);
|
|
3714
|
-
|
|
3713
|
+
He(() => () => {
|
|
3715
3714
|
n.current?.dispose?.(), i.current && clearTimeout(i.current);
|
|
3716
3715
|
}, []);
|
|
3717
3716
|
const a = (c) => {
|
|
@@ -3737,7 +3736,6 @@ const e2 = {
|
|
|
3737
3736
|
options: e2,
|
|
3738
3737
|
width: "100%",
|
|
3739
3738
|
height: "100%",
|
|
3740
|
-
theme: "vs-dark",
|
|
3741
3739
|
language: "xml",
|
|
3742
3740
|
value: r,
|
|
3743
3741
|
onMount: a,
|
|
@@ -8830,7 +8828,7 @@ function Yh(r, e, t) {
|
|
|
8830
8828
|
}
|
|
8831
8829
|
return t;
|
|
8832
8830
|
}
|
|
8833
|
-
class
|
|
8831
|
+
class Ve {
|
|
8834
8832
|
/**
|
|
8835
8833
|
Create a plugin.
|
|
8836
8834
|
*/
|
|
@@ -11025,7 +11023,7 @@ function Ef(r) {
|
|
|
11025
11023
|
let e = r.pmViewDesc;
|
|
11026
11024
|
return e && e.node && e.node.isBlock;
|
|
11027
11025
|
}
|
|
11028
|
-
function
|
|
11026
|
+
function e5(r, e) {
|
|
11029
11027
|
for (; r && e == r.childNodes.length && !Fi(r); )
|
|
11030
11028
|
e = rt(r) + 1, r = r.parentNode;
|
|
11031
11029
|
for (; r && e < r.childNodes.length; ) {
|
|
@@ -11037,7 +11035,7 @@ function ey(r, e) {
|
|
|
11037
11035
|
r = t, e = 0;
|
|
11038
11036
|
}
|
|
11039
11037
|
}
|
|
11040
|
-
function
|
|
11038
|
+
function t5(r, e) {
|
|
11041
11039
|
for (; r && !e && !Fi(r); )
|
|
11042
11040
|
e = rt(r), r = r.parentNode;
|
|
11043
11041
|
for (; r && e; ) {
|
|
@@ -11052,7 +11050,7 @@ function ty(r, e) {
|
|
|
11052
11050
|
function hl(r, e, t) {
|
|
11053
11051
|
if (e.nodeType != 3) {
|
|
11054
11052
|
let s, o;
|
|
11055
|
-
(o =
|
|
11053
|
+
(o = e5(e, t)) ? (e = o, t = 0) : (s = t5(e, t)) && (e = s, t = s.nodeValue.length);
|
|
11056
11054
|
}
|
|
11057
11055
|
let n = r.domSelection();
|
|
11058
11056
|
if (!n)
|
|
@@ -11120,7 +11118,7 @@ function tc(r, e) {
|
|
|
11120
11118
|
function rc(r, e, t) {
|
|
11121
11119
|
r.domObserver.stop(), e.contentEditable = t, r.domObserver.start();
|
|
11122
11120
|
}
|
|
11123
|
-
function
|
|
11121
|
+
function r5(r) {
|
|
11124
11122
|
if (!ot || r.state.selection.$head.parentOffset > 0)
|
|
11125
11123
|
return !1;
|
|
11126
11124
|
let { focusNode: e, focusOffset: t } = r.domSelectionRange();
|
|
@@ -11130,12 +11128,12 @@ function ry(r) {
|
|
|
11130
11128
|
}
|
|
11131
11129
|
return !1;
|
|
11132
11130
|
}
|
|
11133
|
-
function
|
|
11131
|
+
function n5(r) {
|
|
11134
11132
|
let e = "";
|
|
11135
11133
|
return r.ctrlKey && (e += "c"), r.metaKey && (e += "m"), r.altKey && (e += "a"), r.shiftKey && (e += "s"), e;
|
|
11136
11134
|
}
|
|
11137
|
-
function
|
|
11138
|
-
let t = e.keyCode, n =
|
|
11135
|
+
function i5(r, e) {
|
|
11136
|
+
let t = e.keyCode, n = n5(e);
|
|
11139
11137
|
if (t == 8 || Rt && t == 72 && n == "c")
|
|
11140
11138
|
return tc(r, -1) || On(r, -1);
|
|
11141
11139
|
if (t == 46 && !e.shiftKey || Rt && t == 68 && n == "c")
|
|
@@ -11152,7 +11150,7 @@ function iy(r, e) {
|
|
|
11152
11150
|
if (t == 38 || Rt && t == 80 && n == "c")
|
|
11153
11151
|
return ec(r, -1, n) || On(r, -1);
|
|
11154
11152
|
if (t == 40 || Rt && t == 78 && n == "c")
|
|
11155
|
-
return
|
|
11153
|
+
return r5(r) || ec(r, 1, n) || On(r, 1);
|
|
11156
11154
|
if (n == (Rt ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
|
|
11157
11155
|
return !0;
|
|
11158
11156
|
}
|
|
@@ -11212,7 +11210,7 @@ function Af(r, e, t, n, i) {
|
|
|
11212
11210
|
} else
|
|
11213
11211
|
r.someProp("transformPastedHTML", (d) => {
|
|
11214
11212
|
t = d(t, r);
|
|
11215
|
-
}), o =
|
|
11213
|
+
}), o = l5(t), $i && u5(o);
|
|
11216
11214
|
let u = o && o.querySelector("[data-pm-slice]"), c = u && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice") || "");
|
|
11217
11215
|
if (c && c[3])
|
|
11218
11216
|
for (let d = +c[3]; d > 0; d--) {
|
|
@@ -11227,11 +11225,11 @@ function Af(r, e, t, n, i) {
|
|
|
11227
11225
|
preserveWhitespace: !!(l || c),
|
|
11228
11226
|
context: i,
|
|
11229
11227
|
ruleFromNode(f) {
|
|
11230
|
-
return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !
|
|
11228
|
+
return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !s5.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
|
|
11231
11229
|
}
|
|
11232
11230
|
})), c)
|
|
11233
|
-
a =
|
|
11234
|
-
else if (a = G.maxOpen(
|
|
11231
|
+
a = c5(nc(a, +c[1], +c[2]), c[4]);
|
|
11232
|
+
else if (a = G.maxOpen(o5(a.content, i), !0), a.openStart || a.openEnd) {
|
|
11235
11233
|
let d = 0, f = 0;
|
|
11236
11234
|
for (let h = a.content.firstChild; d < a.openStart && !h.type.spec.isolating; d++, h = h.firstChild)
|
|
11237
11235
|
;
|
|
@@ -11243,8 +11241,8 @@ function Af(r, e, t, n, i) {
|
|
|
11243
11241
|
a = d(a, r, l);
|
|
11244
11242
|
}), a;
|
|
11245
11243
|
}
|
|
11246
|
-
const
|
|
11247
|
-
function
|
|
11244
|
+
const s5 = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
|
|
11245
|
+
function o5(r, e) {
|
|
11248
11246
|
if (r.childCount < 2)
|
|
11249
11247
|
return r;
|
|
11250
11248
|
for (let t = e.depth; t >= 0; t--) {
|
|
@@ -11310,27 +11308,27 @@ function If() {
|
|
|
11310
11308
|
return ic || (ic = document.implementation.createHTMLDocument("title"));
|
|
11311
11309
|
}
|
|
11312
11310
|
let ca = null;
|
|
11313
|
-
function
|
|
11311
|
+
function a5(r) {
|
|
11314
11312
|
let e = window.trustedTypes;
|
|
11315
11313
|
return e ? (ca || (ca = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), ca.createHTML(r)) : r;
|
|
11316
11314
|
}
|
|
11317
|
-
function
|
|
11315
|
+
function l5(r) {
|
|
11318
11316
|
let e = /^(\s*<meta [^>]*>)*/.exec(r);
|
|
11319
11317
|
e && (r = r.slice(e[0].length));
|
|
11320
11318
|
let t = If().createElement("div"), n = /<([a-z][^>\s]+)/i.exec(r), i;
|
|
11321
|
-
if ((i = n && Rf[n[1].toLowerCase()]) && (r = i.map((s) => "<" + s + ">").join("") + r + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML =
|
|
11319
|
+
if ((i = n && Rf[n[1].toLowerCase()]) && (r = i.map((s) => "<" + s + ">").join("") + r + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML = a5(r), i)
|
|
11322
11320
|
for (let s = 0; s < i.length; s++)
|
|
11323
11321
|
t = t.querySelector(i[s]) || t;
|
|
11324
11322
|
return t;
|
|
11325
11323
|
}
|
|
11326
|
-
function
|
|
11324
|
+
function u5(r) {
|
|
11327
11325
|
let e = r.querySelectorAll(Ze ? "span:not([class]):not([style])" : "span.Apple-converted-space");
|
|
11328
11326
|
for (let t = 0; t < e.length; t++) {
|
|
11329
11327
|
let n = e[t];
|
|
11330
11328
|
n.childNodes.length == 1 && n.textContent == " " && n.parentNode && n.parentNode.replaceChild(r.ownerDocument.createTextNode(" "), n);
|
|
11331
11329
|
}
|
|
11332
11330
|
}
|
|
11333
|
-
function
|
|
11331
|
+
function c5(r, e) {
|
|
11334
11332
|
if (!r.size)
|
|
11335
11333
|
return r;
|
|
11336
11334
|
let t = r.content.firstChild.type.schema, n;
|
|
@@ -11348,25 +11346,25 @@ function cy(r, e) {
|
|
|
11348
11346
|
}
|
|
11349
11347
|
return new G(i, s, o);
|
|
11350
11348
|
}
|
|
11351
|
-
const ht = {}, ft = {},
|
|
11352
|
-
class
|
|
11349
|
+
const ht = {}, ft = {}, d5 = { touchstart: !0, touchmove: !0 };
|
|
11350
|
+
class h5 {
|
|
11353
11351
|
constructor() {
|
|
11354
11352
|
this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "", button: 0 }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
|
|
11355
11353
|
}
|
|
11356
11354
|
}
|
|
11357
|
-
function
|
|
11355
|
+
function f5(r) {
|
|
11358
11356
|
for (let e in ht) {
|
|
11359
11357
|
let t = ht[e];
|
|
11360
11358
|
r.dom.addEventListener(e, r.input.eventHandlers[e] = (n) => {
|
|
11361
|
-
|
|
11362
|
-
},
|
|
11359
|
+
m5(r, n) && !Ql(r, n) && (r.editable || !(n.type in ft)) && t(r, n);
|
|
11360
|
+
}, d5[e] ? { passive: !0 } : void 0);
|
|
11363
11361
|
}
|
|
11364
11362
|
ot && r.dom.addEventListener("input", () => null), pl(r);
|
|
11365
11363
|
}
|
|
11366
11364
|
function Vr(r, e) {
|
|
11367
11365
|
r.input.lastSelectionOrigin = e, r.input.lastSelectionTime = Date.now();
|
|
11368
11366
|
}
|
|
11369
|
-
function
|
|
11367
|
+
function p5(r) {
|
|
11370
11368
|
r.domObserver.stop();
|
|
11371
11369
|
for (let e in r.input.eventHandlers)
|
|
11372
11370
|
r.dom.removeEventListener(e, r.input.eventHandlers[e]);
|
|
@@ -11384,7 +11382,7 @@ function Ql(r, e) {
|
|
|
11384
11382
|
return n ? n(r, e) || e.defaultPrevented : !1;
|
|
11385
11383
|
});
|
|
11386
11384
|
}
|
|
11387
|
-
function
|
|
11385
|
+
function m5(r, e) {
|
|
11388
11386
|
if (!e.bubbles)
|
|
11389
11387
|
return !0;
|
|
11390
11388
|
if (e.defaultPrevented)
|
|
@@ -11394,7 +11392,7 @@ function my(r, e) {
|
|
|
11394
11392
|
return !1;
|
|
11395
11393
|
return !0;
|
|
11396
11394
|
}
|
|
11397
|
-
function
|
|
11395
|
+
function g5(r, e) {
|
|
11398
11396
|
!Ql(r, e) && ht[e.type] && (r.editable || !(e.type in ft)) && ht[e.type](r, e);
|
|
11399
11397
|
}
|
|
11400
11398
|
ft.keydown = (r, e) => {
|
|
@@ -11405,7 +11403,7 @@ ft.keydown = (r, e) => {
|
|
|
11405
11403
|
r.input.lastIOSEnter = n, r.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
11406
11404
|
r.input.lastIOSEnter == n && (r.someProp("handleKeyDown", (i) => i(r, cn(13, "Enter"))), r.input.lastIOSEnter = 0);
|
|
11407
11405
|
}, 200);
|
|
11408
|
-
} else r.someProp("handleKeyDown", (n) => n(r, t)) ||
|
|
11406
|
+
} else r.someProp("handleKeyDown", (n) => n(r, t)) || i5(r, t) ? t.preventDefault() : Vr(r, "key");
|
|
11409
11407
|
};
|
|
11410
11408
|
ft.keyup = (r, e) => {
|
|
11411
11409
|
e.keyCode == 16 && (r.input.shiftKey = !1);
|
|
@@ -11427,7 +11425,7 @@ ft.keypress = (r, e) => {
|
|
|
11427
11425
|
function wo(r) {
|
|
11428
11426
|
return { left: r.clientX, top: r.clientY };
|
|
11429
11427
|
}
|
|
11430
|
-
function
|
|
11428
|
+
function v5(r, e) {
|
|
11431
11429
|
let t = e.x - r.clientX, n = e.y - r.clientY;
|
|
11432
11430
|
return t * t + n * n < 100;
|
|
11433
11431
|
}
|
|
@@ -11446,13 +11444,13 @@ function Bn(r, e, t) {
|
|
|
11446
11444
|
let n = r.state.tr.setSelection(e);
|
|
11447
11445
|
n.setMeta("pointer", !0), r.dispatch(n);
|
|
11448
11446
|
}
|
|
11449
|
-
function
|
|
11447
|
+
function y5(r, e) {
|
|
11450
11448
|
if (e == -1)
|
|
11451
11449
|
return !1;
|
|
11452
11450
|
let t = r.state.doc.resolve(e), n = t.nodeAfter;
|
|
11453
11451
|
return n && n.isAtom && ie.isSelectable(n) ? (Bn(r, new ie(t)), !0) : !1;
|
|
11454
11452
|
}
|
|
11455
|
-
function
|
|
11453
|
+
function b5(r, e) {
|
|
11456
11454
|
if (e == -1)
|
|
11457
11455
|
return !1;
|
|
11458
11456
|
let t = r.state.selection, n, i;
|
|
@@ -11467,16 +11465,16 @@ function by(r, e) {
|
|
|
11467
11465
|
}
|
|
11468
11466
|
return i != null ? (Bn(r, ie.create(r.state.doc, i)), !0) : !1;
|
|
11469
11467
|
}
|
|
11470
|
-
function
|
|
11471
|
-
return e0(r, "handleClickOn", e, t, n) || r.someProp("handleClick", (s) => s(r, e, n)) || (i ?
|
|
11468
|
+
function w5(r, e, t, n, i) {
|
|
11469
|
+
return e0(r, "handleClickOn", e, t, n) || r.someProp("handleClick", (s) => s(r, e, n)) || (i ? b5(r, t) : y5(r, t));
|
|
11472
11470
|
}
|
|
11473
|
-
function
|
|
11471
|
+
function x5(r, e, t, n) {
|
|
11474
11472
|
return e0(r, "handleDoubleClickOn", e, t, n) || r.someProp("handleDoubleClick", (i) => i(r, e, n));
|
|
11475
11473
|
}
|
|
11476
|
-
function
|
|
11477
|
-
return e0(r, "handleTripleClickOn", e, t, n) || r.someProp("handleTripleClick", (i) => i(r, e, n)) ||
|
|
11474
|
+
function S5(r, e, t, n) {
|
|
11475
|
+
return e0(r, "handleTripleClickOn", e, t, n) || r.someProp("handleTripleClick", (i) => i(r, e, n)) || k5(r, t, n);
|
|
11478
11476
|
}
|
|
11479
|
-
function
|
|
11477
|
+
function k5(r, e, t) {
|
|
11480
11478
|
if (t.button != 0)
|
|
11481
11479
|
return !1;
|
|
11482
11480
|
let n = r.state.doc;
|
|
@@ -11502,11 +11500,11 @@ ht.mousedown = (r, e) => {
|
|
|
11502
11500
|
let t = e;
|
|
11503
11501
|
r.input.shiftKey = t.shiftKey;
|
|
11504
11502
|
let n = t0(r), i = Date.now(), s = "singleClick";
|
|
11505
|
-
i - r.input.lastClick.time < 500 &&
|
|
11503
|
+
i - r.input.lastClick.time < 500 && v5(t, r.input.lastClick) && !t[Pf] && r.input.lastClick.button == t.button && (r.input.lastClick.type == "singleClick" ? s = "doubleClick" : r.input.lastClick.type == "doubleClick" && (s = "tripleClick")), r.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s, button: t.button };
|
|
11506
11504
|
let o = r.posAtCoords(wo(t));
|
|
11507
|
-
o && (s == "singleClick" ? (r.input.mouseDown && r.input.mouseDown.done(), r.input.mouseDown = new
|
|
11505
|
+
o && (s == "singleClick" ? (r.input.mouseDown && r.input.mouseDown.done(), r.input.mouseDown = new T5(r, o, t, !!n)) : (s == "doubleClick" ? x5 : S5)(r, o.pos, o.inside, t) ? t.preventDefault() : Vr(r, "pointer"));
|
|
11508
11506
|
};
|
|
11509
|
-
class
|
|
11507
|
+
class T5 {
|
|
11510
11508
|
constructor(e, t, n, i) {
|
|
11511
11509
|
this.view = e, this.pos = t, this.event = n, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!n[Pf], this.allowDefault = n.shiftKey;
|
|
11512
11510
|
let s, o;
|
|
@@ -11535,7 +11533,7 @@ class Ty {
|
|
|
11535
11533
|
if (this.done(), !this.view.dom.contains(e.target))
|
|
11536
11534
|
return;
|
|
11537
11535
|
let t = this.pos;
|
|
11538
|
-
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(wo(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Vr(this.view, "pointer") :
|
|
11536
|
+
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(wo(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Vr(this.view, "pointer") : w5(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
|
|
11539
11537
|
ot && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
|
|
11540
11538
|
// cursor, but still report that the node is selected
|
|
11541
11539
|
// when asked through getSelection. You'll then get a
|
|
@@ -11562,12 +11560,12 @@ ht.contextmenu = (r) => t0(r);
|
|
|
11562
11560
|
function zf(r, e) {
|
|
11563
11561
|
return r.composing ? !0 : ot && Math.abs(e.timeStamp - r.input.compositionEndedAt) < 500 ? (r.input.compositionEndedAt = -2e8, !0) : !1;
|
|
11564
11562
|
}
|
|
11565
|
-
const
|
|
11563
|
+
const M5 = mr ? 5e3 : -1;
|
|
11566
11564
|
ft.compositionstart = ft.compositionupdate = (r) => {
|
|
11567
11565
|
if (!r.composing) {
|
|
11568
11566
|
r.domObserver.flush();
|
|
11569
11567
|
let { state: e } = r, t = e.selection.$to;
|
|
11570
|
-
if (e.selection instanceof de && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((n) => n.type.spec.inclusive === !1) || Ze && hf &&
|
|
11568
|
+
if (e.selection instanceof de && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((n) => n.type.spec.inclusive === !1) || Ze && hf && C5(r)))
|
|
11571
11569
|
r.markCursor = r.state.storedMarks || t.marks(), _s(r, !0), r.markCursor = null;
|
|
11572
11570
|
else if (_s(r, !e.selection.empty), zt && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
|
|
11573
11571
|
let n = r.domSelectionRange();
|
|
@@ -11585,9 +11583,9 @@ ft.compositionstart = ft.compositionupdate = (r) => {
|
|
|
11585
11583
|
}
|
|
11586
11584
|
r.input.composing = !0;
|
|
11587
11585
|
}
|
|
11588
|
-
Lf(r,
|
|
11586
|
+
Lf(r, M5);
|
|
11589
11587
|
};
|
|
11590
|
-
function
|
|
11588
|
+
function C5(r) {
|
|
11591
11589
|
let { focusNode: e, focusOffset: t } = r.domSelectionRange();
|
|
11592
11590
|
if (!e || e.nodeType != 1 || t >= e.childNodes.length)
|
|
11593
11591
|
return !1;
|
|
@@ -11601,10 +11599,10 @@ function Lf(r, e) {
|
|
|
11601
11599
|
clearTimeout(r.input.composingTimeout), e > -1 && (r.input.composingTimeout = setTimeout(() => _s(r), e));
|
|
11602
11600
|
}
|
|
11603
11601
|
function Bf(r) {
|
|
11604
|
-
for (r.composing && (r.input.composing = !1, r.input.compositionEndedAt =
|
|
11602
|
+
for (r.composing && (r.input.composing = !1, r.input.compositionEndedAt = A5()); r.input.compositionNodes.length > 0; )
|
|
11605
11603
|
r.input.compositionNodes.pop().markParentsDirty();
|
|
11606
11604
|
}
|
|
11607
|
-
function
|
|
11605
|
+
function E5(r) {
|
|
11608
11606
|
let e = r.domSelectionRange();
|
|
11609
11607
|
if (!e.focusNode)
|
|
11610
11608
|
return null;
|
|
@@ -11623,7 +11621,7 @@ function Ey(r) {
|
|
|
11623
11621
|
}
|
|
11624
11622
|
return t || n;
|
|
11625
11623
|
}
|
|
11626
|
-
function
|
|
11624
|
+
function A5() {
|
|
11627
11625
|
let r = document.createEvent("Event");
|
|
11628
11626
|
return r.initEvent("event", !0, !0), r.timeStamp;
|
|
11629
11627
|
}
|
|
@@ -11636,7 +11634,7 @@ function _s(r, e = !1) {
|
|
|
11636
11634
|
return !1;
|
|
11637
11635
|
}
|
|
11638
11636
|
}
|
|
11639
|
-
function
|
|
11637
|
+
function O5(r, e) {
|
|
11640
11638
|
if (!r.dom.parentNode)
|
|
11641
11639
|
return;
|
|
11642
11640
|
let t = r.dom.parentNode.appendChild(document.createElement("div"));
|
|
@@ -11652,12 +11650,12 @@ ht.copy = ft.cut = (r, e) => {
|
|
|
11652
11650
|
if (n.empty)
|
|
11653
11651
|
return;
|
|
11654
11652
|
let s = Oi ? null : t.clipboardData, o = n.content(), { dom: a, text: l } = Zl(r, o);
|
|
11655
|
-
s ? (t.preventDefault(), s.clearData(), s.setData("text/html", a.innerHTML), s.setData("text/plain", l)) :
|
|
11653
|
+
s ? (t.preventDefault(), s.clearData(), s.setData("text/html", a.innerHTML), s.setData("text/plain", l)) : O5(r, a), i && r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
|
|
11656
11654
|
};
|
|
11657
|
-
function
|
|
11655
|
+
function N5(r) {
|
|
11658
11656
|
return r.openStart == 0 && r.openEnd == 0 && r.content.childCount == 1 ? r.content.firstChild : null;
|
|
11659
11657
|
}
|
|
11660
|
-
function
|
|
11658
|
+
function D5(r, e) {
|
|
11661
11659
|
if (!r.dom.parentNode)
|
|
11662
11660
|
return;
|
|
11663
11661
|
let t = r.input.shiftKey || r.state.selection.$from.parent.type.spec.code, n = r.dom.parentNode.appendChild(document.createElement(t ? "textarea" : "div"));
|
|
@@ -11673,7 +11671,7 @@ function Ni(r, e, t, n, i) {
|
|
|
11673
11671
|
return !0;
|
|
11674
11672
|
if (!s)
|
|
11675
11673
|
return !1;
|
|
11676
|
-
let o =
|
|
11674
|
+
let o = N5(s), a = o ? r.state.tr.replaceSelectionWith(o, n) : r.state.tr.replaceSelection(s);
|
|
11677
11675
|
return r.dispatch(a.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
|
|
11678
11676
|
}
|
|
11679
11677
|
function Ff(r) {
|
|
@@ -11688,17 +11686,17 @@ ft.paste = (r, e) => {
|
|
|
11688
11686
|
if (r.composing && !mr)
|
|
11689
11687
|
return;
|
|
11690
11688
|
let n = Oi ? null : t.clipboardData, i = r.input.shiftKey && r.input.lastKeyCode != 45;
|
|
11691
|
-
n && Ni(r, Ff(n), n.getData("text/html"), i, t) ? t.preventDefault() :
|
|
11689
|
+
n && Ni(r, Ff(n), n.getData("text/html"), i, t) ? t.preventDefault() : D5(r, t);
|
|
11692
11690
|
};
|
|
11693
11691
|
class $f {
|
|
11694
11692
|
constructor(e, t, n) {
|
|
11695
11693
|
this.slice = e, this.move = t, this.node = n;
|
|
11696
11694
|
}
|
|
11697
11695
|
}
|
|
11698
|
-
const
|
|
11696
|
+
const R5 = Rt ? "altKey" : "ctrlKey";
|
|
11699
11697
|
function Hf(r, e) {
|
|
11700
11698
|
let t = r.someProp("dragCopies", (n) => !n(e));
|
|
11701
|
-
return t ?? !e[
|
|
11699
|
+
return t ?? !e[R5];
|
|
11702
11700
|
}
|
|
11703
11701
|
ht.dragstart = (r, e) => {
|
|
11704
11702
|
let t = e, n = r.input.mouseDown;
|
|
@@ -11725,12 +11723,12 @@ ht.dragend = (r) => {
|
|
|
11725
11723
|
ft.dragover = ft.dragenter = (r, e) => e.preventDefault();
|
|
11726
11724
|
ft.drop = (r, e) => {
|
|
11727
11725
|
try {
|
|
11728
|
-
|
|
11726
|
+
I5(r, e, r.dragging);
|
|
11729
11727
|
} finally {
|
|
11730
11728
|
r.dragging = null;
|
|
11731
11729
|
}
|
|
11732
11730
|
};
|
|
11733
|
-
function
|
|
11731
|
+
function I5(r, e, t) {
|
|
11734
11732
|
if (!e.dataTransfer)
|
|
11735
11733
|
return;
|
|
11736
11734
|
let n = r.posAtCoords(wo(e));
|
|
@@ -11986,7 +11984,7 @@ class ze {
|
|
|
11986
11984
|
let l = this.local[a].map(e, n, i);
|
|
11987
11985
|
l && l.type.valid(t, l) ? (o || (o = [])).push(l) : s.onRemove && s.onRemove(this.local[a].spec);
|
|
11988
11986
|
}
|
|
11989
|
-
return this.children.length ?
|
|
11987
|
+
return this.children.length ? P5(this.children, o || [], e, t, n, i, s) : o ? new ze(o.sort(gn), Rn) : st;
|
|
11990
11988
|
}
|
|
11991
11989
|
/**
|
|
11992
11990
|
Add the given array of decorations to the ones in the set,
|
|
@@ -12164,7 +12162,7 @@ class Fr {
|
|
|
12164
12162
|
this.members[t].forEachSet(e);
|
|
12165
12163
|
}
|
|
12166
12164
|
}
|
|
12167
|
-
function
|
|
12165
|
+
function P5(r, e, t, n, i, s, o) {
|
|
12168
12166
|
let a = r.slice();
|
|
12169
12167
|
for (let u = 0, c = s; u < t.maps.length; u++) {
|
|
12170
12168
|
let d = 0;
|
|
@@ -12200,7 +12198,7 @@ function Py(r, e, t, n, i, s, o) {
|
|
|
12200
12198
|
l = !0;
|
|
12201
12199
|
}
|
|
12202
12200
|
if (l) {
|
|
12203
|
-
let u =
|
|
12201
|
+
let u = z5(a, r, e, t, i, s, o), c = Us(u, n, 0, o);
|
|
12204
12202
|
e = c.local;
|
|
12205
12203
|
for (let d = 0; d < a.length; d += 3)
|
|
12206
12204
|
a[d + 1] < 0 && (a.splice(d, 3), d -= 3);
|
|
@@ -12223,7 +12221,7 @@ function Vf(r, e) {
|
|
|
12223
12221
|
}
|
|
12224
12222
|
return t;
|
|
12225
12223
|
}
|
|
12226
|
-
function
|
|
12224
|
+
function z5(r, e, t, n, i, s, o) {
|
|
12227
12225
|
function a(l, u) {
|
|
12228
12226
|
for (let c = 0; c < l.local.length; c++) {
|
|
12229
12227
|
let d = l.local[c].map(n, i, u);
|
|
@@ -12298,15 +12296,15 @@ function da(r) {
|
|
|
12298
12296
|
n && n != st && e.push(n);
|
|
12299
12297
|
}), r.cursorWrapper && e.push(ze.create(r.state.doc, [r.cursorWrapper.deco])), Fr.from(e);
|
|
12300
12298
|
}
|
|
12301
|
-
const
|
|
12299
|
+
const L5 = {
|
|
12302
12300
|
childList: !0,
|
|
12303
12301
|
characterData: !0,
|
|
12304
12302
|
characterDataOldValue: !0,
|
|
12305
12303
|
attributes: !0,
|
|
12306
12304
|
attributeOldValue: !0,
|
|
12307
12305
|
subtree: !0
|
|
12308
|
-
},
|
|
12309
|
-
class
|
|
12306
|
+
}, B5 = vt && Ur <= 11;
|
|
12307
|
+
class F5 {
|
|
12310
12308
|
constructor() {
|
|
12311
12309
|
this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
|
|
12312
12310
|
}
|
|
@@ -12320,13 +12318,13 @@ class Fy {
|
|
|
12320
12318
|
return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
|
|
12321
12319
|
}
|
|
12322
12320
|
}
|
|
12323
|
-
class $
|
|
12321
|
+
class $5 {
|
|
12324
12322
|
constructor(e, t) {
|
|
12325
|
-
this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new
|
|
12323
|
+
this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new F5(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((n) => {
|
|
12326
12324
|
for (let i = 0; i < n.length; i++)
|
|
12327
12325
|
this.queue.push(n[i]);
|
|
12328
12326
|
vt && Ur <= 11 && n.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : this.flush();
|
|
12329
|
-
}),
|
|
12327
|
+
}), B5 && (this.onCharData = (n) => {
|
|
12330
12328
|
this.queue.push({ target: n.target, type: "characterData", oldValue: n.prevValue }), this.flushSoon();
|
|
12331
12329
|
}), this.onSelectionChange = this.onSelectionChange.bind(this);
|
|
12332
12330
|
}
|
|
@@ -12339,7 +12337,7 @@ class $y {
|
|
|
12339
12337
|
this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
|
|
12340
12338
|
}
|
|
12341
12339
|
start() {
|
|
12342
|
-
this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom,
|
|
12340
|
+
this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, L5)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
|
|
12343
12341
|
}
|
|
12344
12342
|
stop() {
|
|
12345
12343
|
if (this.observer) {
|
|
@@ -12422,7 +12420,7 @@ class $y {
|
|
|
12422
12420
|
let { focusNode: d } = this.currentSelection;
|
|
12423
12421
|
for (let f of c) {
|
|
12424
12422
|
let h = f.parentNode;
|
|
12425
|
-
h && h.nodeName == "LI" && (!d ||
|
|
12423
|
+
h && h.nodeName == "LI" && (!d || j5(e, d) != h) && f.remove();
|
|
12426
12424
|
}
|
|
12427
12425
|
}
|
|
12428
12426
|
} else if ((Ze || ot) && l.some((c) => c.nodeName == "BR") && (e.input.lastKeyCode == 8 || e.input.lastKeyCode == 46)) {
|
|
@@ -12433,7 +12431,7 @@ class $y {
|
|
|
12433
12431
|
}
|
|
12434
12432
|
}
|
|
12435
12433
|
let u = null;
|
|
12436
|
-
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && yo(n) && (u = Jl(e)) && u.eq(ae.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, yr(e), this.currentSelection.set(n), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o),
|
|
12434
|
+
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && yo(n) && (u = Jl(e)) && u.eq(ae.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, yr(e), this.currentSelection.set(n), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), H5(e)), this.handleDOMChange(s, o, a, l), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(n) || yr(e), this.currentSelection.set(n));
|
|
12437
12435
|
}
|
|
12438
12436
|
registerMutation(e, t) {
|
|
12439
12437
|
if (t.indexOf(e.target) > -1)
|
|
@@ -12469,7 +12467,7 @@ class $y {
|
|
|
12469
12467
|
}
|
|
12470
12468
|
}
|
|
12471
12469
|
let oc = /* @__PURE__ */ new WeakMap(), ac = !1;
|
|
12472
|
-
function
|
|
12470
|
+
function H5(r) {
|
|
12473
12471
|
if (!oc.has(r) && (oc.set(r, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(r.dom).whiteSpace) !== -1)) {
|
|
12474
12472
|
if (r.requiresGeckoHackNode = zt, ac)
|
|
12475
12473
|
return;
|
|
@@ -12480,7 +12478,7 @@ function lc(r, e) {
|
|
|
12480
12478
|
let t = e.startContainer, n = e.startOffset, i = e.endContainer, s = e.endOffset, o = r.domAtPos(r.state.selection.anchor);
|
|
12481
12479
|
return wn(o.node, o.offset, i, s) && ([t, n, i, s] = [i, s, t, n]), { anchorNode: t, anchorOffset: n, focusNode: i, focusOffset: s };
|
|
12482
12480
|
}
|
|
12483
|
-
function
|
|
12481
|
+
function V5(r, e) {
|
|
12484
12482
|
if (e.getComposedRanges) {
|
|
12485
12483
|
let i = e.getComposedRanges(r.root)[0];
|
|
12486
12484
|
if (i)
|
|
@@ -12492,7 +12490,7 @@ function Vy(r, e) {
|
|
|
12492
12490
|
}
|
|
12493
12491
|
return r.dom.addEventListener("beforeinput", n, !0), document.execCommand("indent"), r.dom.removeEventListener("beforeinput", n, !0), t ? lc(r, t) : null;
|
|
12494
12492
|
}
|
|
12495
|
-
function
|
|
12493
|
+
function j5(r, e) {
|
|
12496
12494
|
for (let t = e.parentNode; t && t != r.dom; t = t.parentNode) {
|
|
12497
12495
|
let n = r.docView.nearestDesc(t, !0);
|
|
12498
12496
|
if (n && n.node.isBlock)
|
|
@@ -12500,7 +12498,7 @@ function jy(r, e) {
|
|
|
12500
12498
|
}
|
|
12501
12499
|
return null;
|
|
12502
12500
|
}
|
|
12503
|
-
function
|
|
12501
|
+
function q5(r, e, t) {
|
|
12504
12502
|
let { node: n, fromOffset: i, toOffset: s, from: o, to: a } = r.docView.parseRange(e, t), l = r.domSelectionRange(), u, c = l.anchorNode;
|
|
12505
12503
|
if (c && r.dom.contains(c.nodeType == 1 ? c : c.parentNode) && (u = [{ node: c, offset: l.anchorOffset }], yo(l) || u.push({ node: l.focusNode, offset: l.focusOffset })), Ze && r.input.lastKeyCode === 8)
|
|
12506
12504
|
for (let y = s; y > i; y--) {
|
|
@@ -12520,7 +12518,7 @@ function qy(r, e, t) {
|
|
|
12520
12518
|
to: s,
|
|
12521
12519
|
preserveWhitespace: h.parent.type.whitespace == "pre" ? "full" : !0,
|
|
12522
12520
|
findPositions: u,
|
|
12523
|
-
ruleFromNode:
|
|
12521
|
+
ruleFromNode: _5,
|
|
12524
12522
|
context: h
|
|
12525
12523
|
});
|
|
12526
12524
|
if (u && u[0].pos != null) {
|
|
@@ -12529,7 +12527,7 @@ function qy(r, e, t) {
|
|
|
12529
12527
|
}
|
|
12530
12528
|
return { doc: v, sel: m, from: o, to: a };
|
|
12531
12529
|
}
|
|
12532
|
-
function
|
|
12530
|
+
function _5(r) {
|
|
12533
12531
|
let e = r.pmViewDesc;
|
|
12534
12532
|
if (e)
|
|
12535
12533
|
return e.parseRule();
|
|
@@ -12543,8 +12541,8 @@ function _y(r) {
|
|
|
12543
12541
|
return { ignore: !0 };
|
|
12544
12542
|
return null;
|
|
12545
12543
|
}
|
|
12546
|
-
const
|
|
12547
|
-
function
|
|
12544
|
+
const W5 = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
|
|
12545
|
+
function U5(r, e, t, n, i) {
|
|
12548
12546
|
let s = r.input.compositionPendingChanges || (r.composing ? r.input.compositionID : 0);
|
|
12549
12547
|
if (r.input.compositionPendingChanges = 0, e < 0) {
|
|
12550
12548
|
let D = r.input.lastSelectionTime > Date.now() - 50 ? r.input.lastSelectionOrigin : null, L = Jl(r, D);
|
|
@@ -12558,10 +12556,10 @@ function Uy(r, e, t, n, i) {
|
|
|
12558
12556
|
}
|
|
12559
12557
|
let o = r.state.doc.resolve(e), a = o.sharedDepth(t);
|
|
12560
12558
|
e = o.before(a + 1), t = r.state.doc.resolve(t).after(a + 1);
|
|
12561
|
-
let l = r.state.selection, u =
|
|
12559
|
+
let l = r.state.selection, u = q5(r, e, t), c = r.state.doc, d = c.slice(u.from, u.to), f, h;
|
|
12562
12560
|
r.input.lastKeyCode === 8 && Date.now() - 100 < r.input.lastKeyCodeTime ? (f = r.state.selection.to, h = "end") : (f = r.state.selection.from, h = "start"), r.input.lastKeyCode = null;
|
|
12563
|
-
let m =
|
|
12564
|
-
if (m && r.input.domChangeCount++, (qn && r.input.lastIOSEnter > Date.now() - 225 || mr) && i.some((D) => D.nodeType == 1 && !
|
|
12561
|
+
let m = Y5(d.content, u.doc.content, u.from, f, h);
|
|
12562
|
+
if (m && r.input.domChangeCount++, (qn && r.input.lastIOSEnter > Date.now() - 225 || mr) && i.some((D) => D.nodeType == 1 && !W5.test(D.nodeName)) && (!m || m.endA >= m.endB) && r.someProp("handleKeyDown", (D) => D(r, cn(13, "Enter")))) {
|
|
12565
12563
|
r.input.lastIOSEnter = 0;
|
|
12566
12564
|
return;
|
|
12567
12565
|
}
|
|
@@ -12584,7 +12582,7 @@ function Uy(r, e, t, n, i) {
|
|
|
12584
12582
|
r.input.lastIOSEnter = 0;
|
|
12585
12583
|
return;
|
|
12586
12584
|
}
|
|
12587
|
-
if (r.state.selection.anchor > m.start &&
|
|
12585
|
+
if (r.state.selection.anchor > m.start && K5(c, m.start, m.endA, v, y) && r.someProp("handleKeyDown", (D) => D(r, cn(8, "Backspace")))) {
|
|
12588
12586
|
mr && Ze && r.domObserver.suppressSelectionUpdates();
|
|
12589
12587
|
return;
|
|
12590
12588
|
}
|
|
@@ -12608,7 +12606,7 @@ function Uy(r, e, t, n, i) {
|
|
|
12608
12606
|
L && D.ensureMarks(L), r.dispatch(D);
|
|
12609
12607
|
} else if (
|
|
12610
12608
|
// Adding or removing a mark
|
|
12611
|
-
m.endA == m.endB && (N =
|
|
12609
|
+
m.endA == m.endB && (N = G5(v.parent.content.cut(v.parentOffset, y.parentOffset), w.parent.content.cut(w.parentOffset, m.endA - w.start())))
|
|
12612
12610
|
) {
|
|
12613
12611
|
let D = O(r.state.tr);
|
|
12614
12612
|
N.type == "add" ? D.addMark(E, I, N.mark) : D.removeMark(E, I, N.mark), r.dispatch(D);
|
|
@@ -12623,7 +12621,7 @@ function Uy(r, e, t, n, i) {
|
|
|
12623
12621
|
function uc(r, e, t) {
|
|
12624
12622
|
return Math.max(t.anchor, t.head) > e.content.size ? null : Xl(r, e.resolve(t.anchor), e.resolve(t.head));
|
|
12625
12623
|
}
|
|
12626
|
-
function
|
|
12624
|
+
function G5(r, e) {
|
|
12627
12625
|
let t = r.firstChild.marks, n = e.firstChild.marks, i = t, s = n, o, a, l;
|
|
12628
12626
|
for (let c = 0; c < n.length; c++)
|
|
12629
12627
|
i = n[c].removeFromSet(i);
|
|
@@ -12641,7 +12639,7 @@ function Gy(r, e) {
|
|
|
12641
12639
|
if (B.from(u).eq(r))
|
|
12642
12640
|
return { mark: a, type: o };
|
|
12643
12641
|
}
|
|
12644
|
-
function
|
|
12642
|
+
function K5(r, e, t, n, i) {
|
|
12645
12643
|
if (
|
|
12646
12644
|
// The content must have shrunk
|
|
12647
12645
|
t - e <= i.pos - n.pos || // newEnd must point directly at or after the end of the block that newStart points into
|
|
@@ -12669,7 +12667,7 @@ function ha(r, e, t) {
|
|
|
12669
12667
|
}
|
|
12670
12668
|
return i;
|
|
12671
12669
|
}
|
|
12672
|
-
function
|
|
12670
|
+
function Y5(r, e, t, n, i) {
|
|
12673
12671
|
let s = r.findDiffStart(e, t);
|
|
12674
12672
|
if (s == null)
|
|
12675
12673
|
return null;
|
|
@@ -12702,7 +12700,7 @@ class _f {
|
|
|
12702
12700
|
added to the document.
|
|
12703
12701
|
*/
|
|
12704
12702
|
constructor(e, t) {
|
|
12705
|
-
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new
|
|
12703
|
+
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new h5(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(mc), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = fc(this), hc(this), this.nodeViews = pc(this), this.docView = Wu(this.state.doc, dc(this), da(this), this.dom, this), this.domObserver = new $5(this, (n, i, s, o) => U5(this, n, i, s, o)), this.domObserver.start(), f5(this), this.updatePluginViews();
|
|
12706
12704
|
}
|
|
12707
12705
|
/**
|
|
12708
12706
|
Holds `true` when a
|
|
@@ -12762,7 +12760,7 @@ class _f {
|
|
|
12762
12760
|
let a = i.plugins != e.plugins || this._props.plugins != t.plugins;
|
|
12763
12761
|
if (a || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
|
|
12764
12762
|
let h = pc(this);
|
|
12765
|
-
|
|
12763
|
+
X5(h, this.nodeViews) && (this.nodeViews = h, s = !0);
|
|
12766
12764
|
}
|
|
12767
12765
|
(a || t.handleDOMEvents != this._props.handleDOMEvents) && pl(this), this.editable = fc(this), hc(this);
|
|
12768
12766
|
let l = da(this), u = dc(this), c = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", d = s || !this.docView.matchesNode(e.doc, u, l);
|
|
@@ -12770,10 +12768,10 @@ class _f {
|
|
|
12770
12768
|
let f = c == "preserve" && o && this.dom.style.overflowAnchor == null && Ev(this);
|
|
12771
12769
|
if (o) {
|
|
12772
12770
|
this.domObserver.stop();
|
|
12773
|
-
let h = d && (vt || Ze) && !this.composing && !i.selection.empty && !e.selection.empty &&
|
|
12771
|
+
let h = d && (vt || Ze) && !this.composing && !i.selection.empty && !e.selection.empty && J5(i.selection, e.selection);
|
|
12774
12772
|
if (d) {
|
|
12775
12773
|
let m = Ze ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
12776
|
-
this.composing && (this.input.compositionNode =
|
|
12774
|
+
this.composing && (this.input.compositionNode = E5(this)), (s || !this.docView.update(e.doc, u, l, this)) && (this.docView.updateOuterDeco(u), this.docView.destroy(), this.docView = Wu(e.doc, u, l, this.dom, this)), m && !this.trackWrites && (h = !0);
|
|
12777
12775
|
}
|
|
12778
12776
|
h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && Xv(this)) ? yr(this, h) : (Mf(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
12779
12777
|
}
|
|
@@ -12995,7 +12993,7 @@ class _f {
|
|
|
12995
12993
|
views](https://prosemirror.net/docs/ref/#view.NodeView).
|
|
12996
12994
|
*/
|
|
12997
12995
|
destroy() {
|
|
12998
|
-
this.docView && (
|
|
12996
|
+
this.docView && (p5(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], da(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, vv());
|
|
12999
12997
|
}
|
|
13000
12998
|
/**
|
|
13001
12999
|
This is true when the view has been
|
|
@@ -13009,14 +13007,14 @@ class _f {
|
|
|
13009
13007
|
Used for testing.
|
|
13010
13008
|
*/
|
|
13011
13009
|
dispatchEvent(e) {
|
|
13012
|
-
return
|
|
13010
|
+
return g5(this, e);
|
|
13013
13011
|
}
|
|
13014
13012
|
/**
|
|
13015
13013
|
@internal
|
|
13016
13014
|
*/
|
|
13017
13015
|
domSelectionRange() {
|
|
13018
13016
|
let e = this.domSelection();
|
|
13019
|
-
return e ? ot && this.root.nodeType === 11 && Sv(this.dom.ownerDocument) == this.dom &&
|
|
13017
|
+
return e ? ot && this.root.nodeType === 11 && Sv(this.dom.ownerDocument) == this.dom && V5(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
|
|
13020
13018
|
}
|
|
13021
13019
|
/**
|
|
13022
13020
|
@internal
|
|
@@ -13047,7 +13045,7 @@ function hc(r) {
|
|
|
13047
13045
|
function fc(r) {
|
|
13048
13046
|
return !r.someProp("editable", (e) => e(r.state) === !1);
|
|
13049
13047
|
}
|
|
13050
|
-
function
|
|
13048
|
+
function J5(r, e) {
|
|
13051
13049
|
let t = Math.min(r.$anchor.sharedDepth(r.head), e.$anchor.sharedDepth(e.head));
|
|
13052
13050
|
return r.$anchor.start(t) != e.$anchor.start(t);
|
|
13053
13051
|
}
|
|
@@ -13059,7 +13057,7 @@ function pc(r) {
|
|
|
13059
13057
|
}
|
|
13060
13058
|
return r.someProp("nodeViews", t), r.someProp("markViews", t), e;
|
|
13061
13059
|
}
|
|
13062
|
-
function
|
|
13060
|
+
function X5(r, e) {
|
|
13063
13061
|
let t = 0, n = 0;
|
|
13064
13062
|
for (let i in r) {
|
|
13065
13063
|
if (r[i] != e[i])
|
|
@@ -13152,18 +13150,18 @@ var Yr = {
|
|
|
13152
13150
|
220: "|",
|
|
13153
13151
|
221: "}",
|
|
13154
13152
|
222: '"'
|
|
13155
|
-
},
|
|
13153
|
+
}, Z5 = typeof navigator < "u" && /Mac/.test(navigator.platform), Q5 = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
13156
13154
|
for (var nt = 0; nt < 10; nt++) Yr[48 + nt] = Yr[96 + nt] = String(nt);
|
|
13157
13155
|
for (var nt = 1; nt <= 24; nt++) Yr[nt + 111] = "F" + nt;
|
|
13158
13156
|
for (var nt = 65; nt <= 90; nt++)
|
|
13159
13157
|
Yr[nt] = String.fromCharCode(nt + 32), Gs[nt] = String.fromCharCode(nt);
|
|
13160
13158
|
for (var fa in Yr) Gs.hasOwnProperty(fa) || (Gs[fa] = Yr[fa]);
|
|
13161
|
-
function
|
|
13162
|
-
var e =
|
|
13159
|
+
function ey(r) {
|
|
13160
|
+
var e = Z5 && r.metaKey && r.shiftKey && !r.ctrlKey && !r.altKey || Q5 && r.shiftKey && r.key && r.key.length == 1 || r.key == "Unidentified", t = !e && r.key || (r.shiftKey ? Gs : Yr)[r.keyCode] || r.key || "Unidentified";
|
|
13163
13161
|
return t == "Esc" && (t = "Escape"), t == "Del" && (t = "Delete"), t == "Left" && (t = "ArrowLeft"), t == "Up" && (t = "ArrowUp"), t == "Right" && (t = "ArrowRight"), t == "Down" && (t = "ArrowDown"), t;
|
|
13164
13162
|
}
|
|
13165
|
-
const
|
|
13166
|
-
function
|
|
13163
|
+
const ty = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), ry = typeof navigator < "u" && /Win/.test(navigator.platform);
|
|
13164
|
+
function ny(r) {
|
|
13167
13165
|
let e = r.split(/-(?!$)/), t = e[e.length - 1];
|
|
13168
13166
|
t == "Space" && (t = " ");
|
|
13169
13167
|
let n, i, s, o;
|
|
@@ -13178,28 +13176,28 @@ function n5(r) {
|
|
|
13178
13176
|
else if (/^s(hift)?$/i.test(l))
|
|
13179
13177
|
s = !0;
|
|
13180
13178
|
else if (/^mod$/i.test(l))
|
|
13181
|
-
|
|
13179
|
+
ty ? o = !0 : i = !0;
|
|
13182
13180
|
else
|
|
13183
13181
|
throw new Error("Unrecognized modifier name: " + l);
|
|
13184
13182
|
}
|
|
13185
13183
|
return n && (t = "Alt-" + t), i && (t = "Ctrl-" + t), o && (t = "Meta-" + t), s && (t = "Shift-" + t), t;
|
|
13186
13184
|
}
|
|
13187
|
-
function
|
|
13185
|
+
function iy(r) {
|
|
13188
13186
|
let e = /* @__PURE__ */ Object.create(null);
|
|
13189
13187
|
for (let t in r)
|
|
13190
|
-
e[
|
|
13188
|
+
e[ny(t)] = r[t];
|
|
13191
13189
|
return e;
|
|
13192
13190
|
}
|
|
13193
13191
|
function pa(r, e, t = !0) {
|
|
13194
13192
|
return e.altKey && (r = "Alt-" + r), e.ctrlKey && (r = "Ctrl-" + r), e.metaKey && (r = "Meta-" + r), t && e.shiftKey && (r = "Shift-" + r), r;
|
|
13195
13193
|
}
|
|
13196
|
-
function
|
|
13197
|
-
return new
|
|
13194
|
+
function sy(r) {
|
|
13195
|
+
return new Ve({ props: { handleKeyDown: i0(r) } });
|
|
13198
13196
|
}
|
|
13199
13197
|
function i0(r) {
|
|
13200
|
-
let e =
|
|
13198
|
+
let e = iy(r);
|
|
13201
13199
|
return function(t, n) {
|
|
13202
|
-
let i =
|
|
13200
|
+
let i = ey(n), s, o = e[pa(i, n)];
|
|
13203
13201
|
if (o && o(t.state, t.dispatch, t))
|
|
13204
13202
|
return !0;
|
|
13205
13203
|
if (i.length == 1 && i != " ") {
|
|
@@ -13209,7 +13207,7 @@ function i0(r) {
|
|
|
13209
13207
|
return !0;
|
|
13210
13208
|
}
|
|
13211
13209
|
if ((n.altKey || n.metaKey || n.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
|
|
13212
|
-
!(
|
|
13210
|
+
!(ry && n.ctrlKey && n.altKey) && (s = Yr[n.keyCode]) && s != i) {
|
|
13213
13211
|
let a = e[pa(s, n)];
|
|
13214
13212
|
if (a && a(t.state, t.dispatch, t))
|
|
13215
13213
|
return !0;
|
|
@@ -13218,9 +13216,9 @@ function i0(r) {
|
|
|
13218
13216
|
return !1;
|
|
13219
13217
|
};
|
|
13220
13218
|
}
|
|
13221
|
-
var
|
|
13219
|
+
var oy = Object.defineProperty, s0 = (r, e) => {
|
|
13222
13220
|
for (var t in e)
|
|
13223
|
-
|
|
13221
|
+
oy(r, t, { get: e[t], enumerable: !0 });
|
|
13224
13222
|
};
|
|
13225
13223
|
function xo(r) {
|
|
13226
13224
|
const { state: e, transaction: t } = r;
|
|
@@ -13316,46 +13314,46 @@ var So = class {
|
|
|
13316
13314
|
}
|
|
13317
13315
|
}, Wf = {};
|
|
13318
13316
|
s0(Wf, {
|
|
13319
|
-
blur: () =>
|
|
13320
|
-
clearContent: () =>
|
|
13321
|
-
clearNodes: () =>
|
|
13322
|
-
command: () =>
|
|
13323
|
-
createParagraphNear: () =>
|
|
13324
|
-
cut: () =>
|
|
13325
|
-
deleteCurrentNode: () =>
|
|
13326
|
-
deleteNode: () =>
|
|
13327
|
-
deleteRange: () =>
|
|
13328
|
-
deleteSelection: () =>
|
|
13329
|
-
enter: () =>
|
|
13330
|
-
exitCode: () =>
|
|
13331
|
-
extendMarkRange: () =>
|
|
13332
|
-
first: () =>
|
|
13333
|
-
focus: () =>
|
|
13334
|
-
forEach: () =>
|
|
13335
|
-
insertContent: () =>
|
|
13336
|
-
insertContentAt: () =>
|
|
13337
|
-
joinBackward: () =>
|
|
13338
|
-
joinDown: () =>
|
|
13339
|
-
joinForward: () =>
|
|
13340
|
-
joinItemBackward: () =>
|
|
13341
|
-
joinItemForward: () =>
|
|
13342
|
-
joinTextblockBackward: () =>
|
|
13343
|
-
joinTextblockForward: () =>
|
|
13344
|
-
joinUp: () =>
|
|
13345
|
-
keyboardShortcut: () =>
|
|
13346
|
-
lift: () =>
|
|
13347
|
-
liftEmptyBlock: () =>
|
|
13348
|
-
liftListItem: () => $
|
|
13349
|
-
newlineInCode: () =>
|
|
13350
|
-
resetAttributes: () =>
|
|
13351
|
-
scrollIntoView: () =>
|
|
13352
|
-
selectAll: () =>
|
|
13353
|
-
selectNodeBackward: () =>
|
|
13354
|
-
selectNodeForward: () =>
|
|
13355
|
-
selectParentNode: () =>
|
|
13356
|
-
selectTextblockEnd: () =>
|
|
13357
|
-
selectTextblockStart: () =>
|
|
13358
|
-
setContent: () =>
|
|
13317
|
+
blur: () => ay,
|
|
13318
|
+
clearContent: () => ly,
|
|
13319
|
+
clearNodes: () => uy,
|
|
13320
|
+
command: () => cy,
|
|
13321
|
+
createParagraphNear: () => dy,
|
|
13322
|
+
cut: () => hy,
|
|
13323
|
+
deleteCurrentNode: () => fy,
|
|
13324
|
+
deleteNode: () => py,
|
|
13325
|
+
deleteRange: () => my,
|
|
13326
|
+
deleteSelection: () => gy,
|
|
13327
|
+
enter: () => vy,
|
|
13328
|
+
exitCode: () => yy,
|
|
13329
|
+
extendMarkRange: () => by,
|
|
13330
|
+
first: () => wy,
|
|
13331
|
+
focus: () => xy,
|
|
13332
|
+
forEach: () => Sy,
|
|
13333
|
+
insertContent: () => ky,
|
|
13334
|
+
insertContentAt: () => Cy,
|
|
13335
|
+
joinBackward: () => Oy,
|
|
13336
|
+
joinDown: () => Ay,
|
|
13337
|
+
joinForward: () => Ny,
|
|
13338
|
+
joinItemBackward: () => Dy,
|
|
13339
|
+
joinItemForward: () => Ry,
|
|
13340
|
+
joinTextblockBackward: () => Iy,
|
|
13341
|
+
joinTextblockForward: () => Py,
|
|
13342
|
+
joinUp: () => Ey,
|
|
13343
|
+
keyboardShortcut: () => Ly,
|
|
13344
|
+
lift: () => By,
|
|
13345
|
+
liftEmptyBlock: () => Fy,
|
|
13346
|
+
liftListItem: () => $y,
|
|
13347
|
+
newlineInCode: () => Hy,
|
|
13348
|
+
resetAttributes: () => Vy,
|
|
13349
|
+
scrollIntoView: () => jy,
|
|
13350
|
+
selectAll: () => qy,
|
|
13351
|
+
selectNodeBackward: () => _y,
|
|
13352
|
+
selectNodeForward: () => Wy,
|
|
13353
|
+
selectParentNode: () => Uy,
|
|
13354
|
+
selectTextblockEnd: () => Gy,
|
|
13355
|
+
selectTextblockStart: () => Ky,
|
|
13356
|
+
setContent: () => Yy,
|
|
13359
13357
|
setMark: () => v3,
|
|
13360
13358
|
setMeta: () => y3,
|
|
13361
13359
|
setNode: () => b3,
|
|
@@ -13377,10 +13375,10 @@ s0(Wf, {
|
|
|
13377
13375
|
wrapIn: () => z3,
|
|
13378
13376
|
wrapInList: () => L3
|
|
13379
13377
|
});
|
|
13380
|
-
var
|
|
13378
|
+
var ay = () => ({ editor: r, view: e }) => (requestAnimationFrame(() => {
|
|
13381
13379
|
var t;
|
|
13382
13380
|
r.isDestroyed || (e.dom.blur(), (t = window?.getSelection()) == null || t.removeAllRanges());
|
|
13383
|
-
}), !0),
|
|
13381
|
+
}), !0), ly = (r = !0) => ({ commands: e }) => e.setContent("", { emitUpdate: r }), uy = () => ({ state: r, tr: e, dispatch: t }) => {
|
|
13384
13382
|
const { selection: n } = e, { ranges: i } = n;
|
|
13385
13383
|
return t && i.forEach(({ $from: s, $to: o }) => {
|
|
13386
13384
|
r.doc.nodesBetween(s.pos, o.pos, (a, l) => {
|
|
@@ -13397,12 +13395,12 @@ var a5 = () => ({ editor: r, view: e }) => (requestAnimationFrame(() => {
|
|
|
13397
13395
|
(m || m === 0) && e.lift(h, m);
|
|
13398
13396
|
});
|
|
13399
13397
|
}), !0;
|
|
13400
|
-
},
|
|
13398
|
+
}, cy = (r) => (e) => r(e), dy = () => ({ state: r, dispatch: e }) => of(r, e), hy = (r, e) => ({ editor: t, tr: n }) => {
|
|
13401
13399
|
const { state: i } = t, s = i.doc.slice(r.from, r.to);
|
|
13402
13400
|
n.deleteRange(r.from, r.to);
|
|
13403
13401
|
const o = n.mapping.map(e);
|
|
13404
13402
|
return n.insert(o, s.content), n.setSelection(new de(n.doc.resolve(Math.max(o - 1, 0)))), !0;
|
|
13405
|
-
},
|
|
13403
|
+
}, fy = () => ({ tr: r, dispatch: e }) => {
|
|
13406
13404
|
const { selection: t } = r, n = t.$anchor.node();
|
|
13407
13405
|
if (n.content.size > 0)
|
|
13408
13406
|
return !1;
|
|
@@ -13425,7 +13423,7 @@ function Ge(r, e) {
|
|
|
13425
13423
|
}
|
|
13426
13424
|
return r;
|
|
13427
13425
|
}
|
|
13428
|
-
var
|
|
13426
|
+
var py = (r) => ({ tr: e, state: t, dispatch: n }) => {
|
|
13429
13427
|
const i = Ge(r, t.schema), s = e.selection.$anchor;
|
|
13430
13428
|
for (let o = s.depth; o > 0; o -= 1)
|
|
13431
13429
|
if (s.node(o).type === i) {
|
|
@@ -13436,10 +13434,10 @@ var p5 = (r) => ({ tr: e, state: t, dispatch: n }) => {
|
|
|
13436
13434
|
return !0;
|
|
13437
13435
|
}
|
|
13438
13436
|
return !1;
|
|
13439
|
-
},
|
|
13437
|
+
}, my = (r) => ({ tr: e, dispatch: t }) => {
|
|
13440
13438
|
const { from: n, to: i } = r;
|
|
13441
13439
|
return t && e.delete(n, i), !0;
|
|
13442
|
-
},
|
|
13440
|
+
}, gy = () => ({ state: r, dispatch: e }) => _l(r, e), vy = () => ({ commands: r }) => r.keyboardShortcut("Enter"), yy = () => ({ state: r, dispatch: e }) => rv(r, e);
|
|
13443
13441
|
function o0(r) {
|
|
13444
13442
|
return Object.prototype.toString.call(r) === "[object RegExp]";
|
|
13445
13443
|
}
|
|
@@ -13482,7 +13480,7 @@ function Mr(r, e) {
|
|
|
13482
13480
|
}
|
|
13483
13481
|
return r;
|
|
13484
13482
|
}
|
|
13485
|
-
var
|
|
13483
|
+
var by = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
|
|
13486
13484
|
const s = Mr(r, n.schema), { doc: o, selection: a } = t, { $from: l, from: u, to: c } = a;
|
|
13487
13485
|
if (i) {
|
|
13488
13486
|
const d = a0(l, s, e);
|
|
@@ -13492,7 +13490,7 @@ var b5 = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
|
|
|
13492
13490
|
}
|
|
13493
13491
|
}
|
|
13494
13492
|
return !0;
|
|
13495
|
-
},
|
|
13493
|
+
}, wy = (r) => (e) => {
|
|
13496
13494
|
const t = typeof r == "function" ? r(e) : r;
|
|
13497
13495
|
for (let n = 0; n < t.length; n += 1)
|
|
13498
13496
|
if (t[n](e))
|
|
@@ -13523,7 +13521,7 @@ function ko() {
|
|
|
13523
13521
|
return ["iPad Simulator", "iPhone Simulator", "iPod Simulator", "iPad", "iPhone", "iPod"].includes(navigator.platform) || // iPad on iOS 13 detection
|
|
13524
13522
|
navigator.userAgent.includes("Mac") && "ontouchend" in document;
|
|
13525
13523
|
}
|
|
13526
|
-
var
|
|
13524
|
+
var xy = (r = null, e = {}) => ({ editor: t, view: n, tr: i, dispatch: s }) => {
|
|
13527
13525
|
e = {
|
|
13528
13526
|
scrollIntoView: !0,
|
|
13529
13527
|
...e
|
|
@@ -13539,7 +13537,7 @@ var x5 = (r = null, e = {}) => ({ editor: t, view: n, tr: i, dispatch: s }) => {
|
|
|
13539
13537
|
return o(), !0;
|
|
13540
13538
|
const a = Gf(i.doc, r) || t.state.selection, l = t.state.selection.eq(a);
|
|
13541
13539
|
return s && (l || i.setSelection(a), l && i.storedMarks && i.setStoredMarks(i.storedMarks), o()), !0;
|
|
13542
|
-
},
|
|
13540
|
+
}, Sy = (r, e) => (t) => r.every((n, i) => e(n, { ...t, index: i })), ky = (r, e) => ({ tr: t, commands: n }) => n.insertContentAt({ from: t.selection.from, to: t.selection.to }, r, e), Yf = (r) => {
|
|
13543
13541
|
const e = r.childNodes;
|
|
13544
13542
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
13545
13543
|
const n = e[t];
|
|
@@ -13604,7 +13602,7 @@ function Ri(r, e, t) {
|
|
|
13604
13602
|
}
|
|
13605
13603
|
return Ri("", e, t);
|
|
13606
13604
|
}
|
|
13607
|
-
function
|
|
13605
|
+
function Ty(r, e, t) {
|
|
13608
13606
|
const n = r.steps.length - 1;
|
|
13609
13607
|
if (n < e)
|
|
13610
13608
|
return;
|
|
@@ -13617,7 +13615,7 @@ function T5(r, e, t) {
|
|
|
13617
13615
|
o === 0 && (o = c);
|
|
13618
13616
|
}), r.setSelection(ae.near(r.doc.resolve(o), t));
|
|
13619
13617
|
}
|
|
13620
|
-
var
|
|
13618
|
+
var My = (r) => !("type" in r), Cy = (r, e, t) => ({ tr: n, dispatch: i, editor: s }) => {
|
|
13621
13619
|
var o;
|
|
13622
13620
|
if (i) {
|
|
13623
13621
|
t = {
|
|
@@ -13658,7 +13656,7 @@ var M5 = (r) => !("type" in r), C5 = (r, e, t) => ({ tr: n, dispatch: i, editor:
|
|
|
13658
13656
|
return l(y), !1;
|
|
13659
13657
|
}
|
|
13660
13658
|
let { from: c, to: d } = typeof r == "number" ? { from: r, to: r } : { from: r.from, to: r.to }, f = !0, h = !0;
|
|
13661
|
-
if ((
|
|
13659
|
+
if ((My(a) ? a : [a]).forEach((y) => {
|
|
13662
13660
|
y.check(), f = f ? y.isText && y.marks.length === 0 : !1, h = h ? y.isBlock : !1;
|
|
13663
13661
|
}), c === d && h) {
|
|
13664
13662
|
const { parent: y } = n.doc.resolve(c);
|
|
@@ -13680,28 +13678,28 @@ var M5 = (r) => !("type" in r), C5 = (r, e, t) => ({ tr: n, dispatch: i, editor:
|
|
|
13680
13678
|
const y = n.doc.resolve(c), w = y.node(), k = y.parentOffset === 0, E = w.isText || w.isTextblock, I = w.content.size > 0;
|
|
13681
13679
|
k && E && I && (c = Math.max(0, c - 1)), n.replaceWith(c, d, v);
|
|
13682
13680
|
}
|
|
13683
|
-
t.updateSelection &&
|
|
13681
|
+
t.updateSelection && Ty(n, n.steps.length - 1, -1), t.applyInputRules && n.setMeta("applyInputRules", { from: c, text: v }), t.applyPasteRules && n.setMeta("applyPasteRules", { from: c, text: v });
|
|
13684
13682
|
}
|
|
13685
13683
|
return !0;
|
|
13686
|
-
},
|
|
13684
|
+
}, Ey = () => ({ state: r, dispatch: e }) => Q2(r, e), Ay = () => ({ state: r, dispatch: e }) => ev(r, e), Oy = () => ({ state: r, dispatch: e }) => Zh(r, e), Ny = () => ({ state: r, dispatch: e }) => rf(r, e), Dy = () => ({ state: r, dispatch: e, tr: t }) => {
|
|
13687
13685
|
try {
|
|
13688
13686
|
const n = mo(r.doc, r.selection.$from.pos, -1);
|
|
13689
13687
|
return n == null ? !1 : (t.join(n, 2), e && e(t), !0);
|
|
13690
13688
|
} catch {
|
|
13691
13689
|
return !1;
|
|
13692
13690
|
}
|
|
13693
|
-
},
|
|
13691
|
+
}, Ry = () => ({ state: r, dispatch: e, tr: t }) => {
|
|
13694
13692
|
try {
|
|
13695
13693
|
const n = mo(r.doc, r.selection.$from.pos, 1);
|
|
13696
13694
|
return n == null ? !1 : (t.join(n, 2), e && e(t), !0);
|
|
13697
13695
|
} catch {
|
|
13698
13696
|
return !1;
|
|
13699
13697
|
}
|
|
13700
|
-
},
|
|
13698
|
+
}, Iy = () => ({ state: r, dispatch: e }) => X2(r, e), Py = () => ({ state: r, dispatch: e }) => Z2(r, e);
|
|
13701
13699
|
function Jf() {
|
|
13702
13700
|
return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
|
|
13703
13701
|
}
|
|
13704
|
-
function
|
|
13702
|
+
function zy(r) {
|
|
13705
13703
|
const e = r.split(/-(?!$)/);
|
|
13706
13704
|
let t = e[e.length - 1];
|
|
13707
13705
|
t === "Space" && (t = " ");
|
|
@@ -13723,8 +13721,8 @@ function z5(r) {
|
|
|
13723
13721
|
}
|
|
13724
13722
|
return n && (t = `Alt-${t}`), i && (t = `Ctrl-${t}`), o && (t = `Meta-${t}`), s && (t = `Shift-${t}`), t;
|
|
13725
13723
|
}
|
|
13726
|
-
var
|
|
13727
|
-
const s =
|
|
13724
|
+
var Ly = (r) => ({ editor: e, view: t, tr: n, dispatch: i }) => {
|
|
13725
|
+
const s = zy(r).split(/-(?!$)/), o = s.find((u) => !["Alt", "Ctrl", "Meta", "Shift"].includes(u)), a = new KeyboardEvent("keydown", {
|
|
13728
13726
|
key: o === "Space" ? " " : o,
|
|
13729
13727
|
altKey: s.includes("Alt"),
|
|
13730
13728
|
ctrlKey: s.includes("Ctrl"),
|
|
@@ -13755,13 +13753,13 @@ function Jr(r, e, t = {}) {
|
|
|
13755
13753
|
const l = i - n, u = a.filter((d) => o ? o.name === d.node.type.name : !0).filter((d) => Ks(d.node.attrs, t, { strict: !1 }));
|
|
13756
13754
|
return s ? !!u.length : u.reduce((d, f) => d + f.to - f.from, 0) >= l;
|
|
13757
13755
|
}
|
|
13758
|
-
var
|
|
13756
|
+
var By = (r, e = {}) => ({ state: t, dispatch: n }) => {
|
|
13759
13757
|
const i = Ge(r, t.schema);
|
|
13760
13758
|
return Jr(t, i, e) ? tv(t, n) : !1;
|
|
13761
|
-
},
|
|
13759
|
+
}, Fy = () => ({ state: r, dispatch: e }) => af(r, e), $y = (r) => ({ state: e, dispatch: t }) => {
|
|
13762
13760
|
const n = Ge(r, e.schema);
|
|
13763
13761
|
return fv(n)(e, t);
|
|
13764
|
-
},
|
|
13762
|
+
}, Hy = () => ({ state: r, dispatch: e }) => sf(r, e);
|
|
13765
13763
|
function To(r, e) {
|
|
13766
13764
|
return e.nodes[r] ? "node" : e.marks[r] ? "mark" : null;
|
|
13767
13765
|
}
|
|
@@ -13769,7 +13767,7 @@ function vc(r, e) {
|
|
|
13769
13767
|
const t = typeof e == "string" ? [e] : e;
|
|
13770
13768
|
return Object.keys(r).reduce((n, i) => (t.includes(i) || (n[i] = r[i]), n), {});
|
|
13771
13769
|
}
|
|
13772
|
-
var
|
|
13770
|
+
var Vy = (r, e) => ({ tr: t, state: n, dispatch: i }) => {
|
|
13773
13771
|
let s = null, o = null;
|
|
13774
13772
|
const a = To(
|
|
13775
13773
|
typeof r == "string" ? r : r.name,
|
|
@@ -13786,13 +13784,13 @@ var V5 = (r, e) => ({ tr: t, state: n, dispatch: i }) => {
|
|
|
13786
13784
|
});
|
|
13787
13785
|
});
|
|
13788
13786
|
}), l;
|
|
13789
|
-
},
|
|
13787
|
+
}, jy = () => ({ tr: r, dispatch: e }) => (e && r.scrollIntoView(), !0), qy = () => ({ tr: r, dispatch: e }) => {
|
|
13790
13788
|
if (e) {
|
|
13791
13789
|
const t = new Et(r.doc);
|
|
13792
13790
|
r.setSelection(t);
|
|
13793
13791
|
}
|
|
13794
13792
|
return !0;
|
|
13795
|
-
},
|
|
13793
|
+
}, _y = () => ({ state: r, dispatch: e }) => ef(r, e), Wy = () => ({ state: r, dispatch: e }) => nf(r, e), Uy = () => ({ state: r, dispatch: e }) => sv(r, e), Gy = () => ({ state: r, dispatch: e }) => lv(r, e), Ky = () => ({ state: r, dispatch: e }) => av(r, e);
|
|
13796
13794
|
function ml(r, e, t = {}, n = {}) {
|
|
13797
13795
|
return Ri(r, e, {
|
|
13798
13796
|
slice: !1,
|
|
@@ -13800,7 +13798,7 @@ function ml(r, e, t = {}, n = {}) {
|
|
|
13800
13798
|
errorOnInvalidContent: n.errorOnInvalidContent
|
|
13801
13799
|
});
|
|
13802
13800
|
}
|
|
13803
|
-
var
|
|
13801
|
+
var Yy = (r, { errorOnInvalidContent: e, emitUpdate: t = !0, parseOptions: n = {} } = {}) => ({ editor: i, tr: s, dispatch: o, commands: a }) => {
|
|
13804
13802
|
const { doc: l } = s;
|
|
13805
13803
|
if (n.preserveWhitespace !== "full") {
|
|
13806
13804
|
const u = ml(r, i.schema, n, {
|
|
@@ -13821,7 +13819,7 @@ function Xf(r, e) {
|
|
|
13821
13819
|
const a = o.find((l) => l.type.name === t.name);
|
|
13822
13820
|
return a ? { ...a.attrs } : {};
|
|
13823
13821
|
}
|
|
13824
|
-
function
|
|
13822
|
+
function Jy(r, e) {
|
|
13825
13823
|
const t = new Gh(r);
|
|
13826
13824
|
return e.forEach((n) => {
|
|
13827
13825
|
n.steps.forEach((i) => {
|
|
@@ -13829,7 +13827,7 @@ function J5(r, e) {
|
|
|
13829
13827
|
});
|
|
13830
13828
|
}), t;
|
|
13831
13829
|
}
|
|
13832
|
-
function
|
|
13830
|
+
function Xy(r) {
|
|
13833
13831
|
for (let e = 0; e < r.edgeCount; e += 1) {
|
|
13834
13832
|
const { type: t } = r.edge(e);
|
|
13835
13833
|
if (t.isTextblock && !t.hasRequiredAttrs())
|
|
@@ -13837,7 +13835,7 @@ function X5(r) {
|
|
|
13837
13835
|
}
|
|
13838
13836
|
return null;
|
|
13839
13837
|
}
|
|
13840
|
-
function
|
|
13838
|
+
function Zy(r, e) {
|
|
13841
13839
|
for (let t = r.depth; t > 0; t -= 1) {
|
|
13842
13840
|
const n = r.node(t);
|
|
13843
13841
|
if (e(n))
|
|
@@ -13850,7 +13848,7 @@ function Z5(r, e) {
|
|
|
13850
13848
|
}
|
|
13851
13849
|
}
|
|
13852
13850
|
function Mo(r) {
|
|
13853
|
-
return (e) =>
|
|
13851
|
+
return (e) => Zy(e.$from, r);
|
|
13854
13852
|
}
|
|
13855
13853
|
function ne(r, e, t) {
|
|
13856
13854
|
return r.config[e] === void 0 && r.parent ? ne(r.parent, e, t) : typeof r.config[e] == "function" ? r.config[e].bind({
|
|
@@ -13878,7 +13876,7 @@ function Zf(r) {
|
|
|
13878
13876
|
function Te(r, e = void 0, ...t) {
|
|
13879
13877
|
return Zf(r) ? e ? r.bind(e)(...t) : r(...t) : r;
|
|
13880
13878
|
}
|
|
13881
|
-
function
|
|
13879
|
+
function Qy(r = {}) {
|
|
13882
13880
|
return Object.keys(r).length === 0 && r.constructor === Object;
|
|
13883
13881
|
}
|
|
13884
13882
|
function _n(r) {
|
|
@@ -14006,7 +14004,7 @@ function yc(r, e) {
|
|
|
14006
14004
|
function bc(r) {
|
|
14007
14005
|
return Object.fromEntries(
|
|
14008
14006
|
// @ts-ignore
|
|
14009
|
-
Object.entries(r).filter(([e, t]) => e === "attrs" &&
|
|
14007
|
+
Object.entries(r).filter(([e, t]) => e === "attrs" && Qy(t) ? !1 : t != null)
|
|
14010
14008
|
);
|
|
14011
14009
|
}
|
|
14012
14010
|
function wc(r) {
|
|
@@ -14476,7 +14474,7 @@ var T3 = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor
|
|
|
14476
14474
|
return !a.parentOffset || !vr(o, a.pos) ? !1 : (n && (r && kc(t, i.extensionManager.splittableMarks), e.split(a.pos).scrollIntoView()), !0);
|
|
14477
14475
|
if (!a.parent.isBlock)
|
|
14478
14476
|
return !1;
|
|
14479
|
-
const d = l.parentOffset === l.parent.content.size, f = a.depth === 0 ? void 0 :
|
|
14477
|
+
const d = l.parentOffset === l.parent.content.size, f = a.depth === 0 ? void 0 : Xy(a.node(-1).contentMatchAt(a.indexAfter(-1)));
|
|
14480
14478
|
let h = d && f ? [
|
|
14481
14479
|
{
|
|
14482
14480
|
type: f,
|
|
@@ -14780,7 +14778,7 @@ function as(r) {
|
|
|
14780
14778
|
}), c;
|
|
14781
14779
|
}
|
|
14782
14780
|
function $3(r) {
|
|
14783
|
-
const { editor: e, rules: t } = r, n = new
|
|
14781
|
+
const { editor: e, rules: t } = r, n = new Ve({
|
|
14784
14782
|
state: {
|
|
14785
14783
|
init() {
|
|
14786
14784
|
return null;
|
|
@@ -15025,7 +15023,7 @@ function U3(r) {
|
|
|
15025
15023
|
return o = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, v;
|
|
15026
15024
|
}
|
|
15027
15025
|
};
|
|
15028
|
-
return t.map((c) => new
|
|
15026
|
+
return t.map((c) => new Ve({
|
|
15029
15027
|
// we register a global drag handler to track the current drag source element
|
|
15030
15028
|
view(d) {
|
|
15031
15029
|
const f = (m) => {
|
|
@@ -15135,7 +15133,7 @@ var Eo = class {
|
|
|
15135
15133
|
);
|
|
15136
15134
|
a = { ...a, ...f };
|
|
15137
15135
|
}
|
|
15138
|
-
const l =
|
|
15136
|
+
const l = sy(a);
|
|
15139
15137
|
s.push(l);
|
|
15140
15138
|
const u = ne(n, "addInputRules", i);
|
|
15141
15139
|
if (xc(n, r.options.enableInputRules) && u) {
|
|
@@ -15319,7 +15317,7 @@ var Se = class up extends p0 {
|
|
|
15319
15317
|
},
|
|
15320
15318
|
addProseMirrorPlugins() {
|
|
15321
15319
|
return [
|
|
15322
|
-
new
|
|
15320
|
+
new Ve({
|
|
15323
15321
|
key: new _e("clipboardTextSerializer"),
|
|
15324
15322
|
props: {
|
|
15325
15323
|
clipboardTextSerializer: () => {
|
|
@@ -15348,7 +15346,7 @@ var Se = class up extends p0 {
|
|
|
15348
15346
|
var o, a, l, u;
|
|
15349
15347
|
if ((u = (l = (a = (o = this.editor.options.coreExtensionOptions) == null ? void 0 : o.delete) == null ? void 0 : a.filterTransaction) == null ? void 0 : l.call(a, r)) != null ? u : r.getMeta("y-sync$"))
|
|
15350
15348
|
return;
|
|
15351
|
-
const c =
|
|
15349
|
+
const c = Jy(r.before, [r, ...e]);
|
|
15352
15350
|
a3(c).forEach((h) => {
|
|
15353
15351
|
c.mapping.mapResult(h.oldRange.from).deletedAfter && c.mapping.mapResult(h.oldRange.to).deletedBefore && c.before.nodesBetween(h.oldRange.from, h.oldRange.to, (m, v) => {
|
|
15354
15352
|
const y = v + m.nodeSize - 2, w = h.oldRange.from <= v && y <= h.oldRange.to;
|
|
@@ -15400,7 +15398,7 @@ var Se = class up extends p0 {
|
|
|
15400
15398
|
name: "drop",
|
|
15401
15399
|
addProseMirrorPlugins() {
|
|
15402
15400
|
return [
|
|
15403
|
-
new
|
|
15401
|
+
new Ve({
|
|
15404
15402
|
key: new _e("tiptapDrop"),
|
|
15405
15403
|
props: {
|
|
15406
15404
|
handleDrop: (r, e, t, n) => {
|
|
@@ -15419,7 +15417,7 @@ var Se = class up extends p0 {
|
|
|
15419
15417
|
name: "editable",
|
|
15420
15418
|
addProseMirrorPlugins() {
|
|
15421
15419
|
return [
|
|
15422
|
-
new
|
|
15420
|
+
new Ve({
|
|
15423
15421
|
key: new _e("editable"),
|
|
15424
15422
|
props: {
|
|
15425
15423
|
editable: () => this.editor.options.editable
|
|
@@ -15432,7 +15430,7 @@ var Se = class up extends p0 {
|
|
|
15432
15430
|
addProseMirrorPlugins() {
|
|
15433
15431
|
const { editor: r } = this;
|
|
15434
15432
|
return [
|
|
15435
|
-
new
|
|
15433
|
+
new Ve({
|
|
15436
15434
|
key: mp,
|
|
15437
15435
|
props: {
|
|
15438
15436
|
handleDOMEvents: {
|
|
@@ -15505,7 +15503,7 @@ var Se = class up extends p0 {
|
|
|
15505
15503
|
// to a paragraph if necessary.
|
|
15506
15504
|
// This is an alternative to ProseMirror's `AllSelection`, which doesn’t work well
|
|
15507
15505
|
// with many other commands.
|
|
15508
|
-
new
|
|
15506
|
+
new Ve({
|
|
15509
15507
|
key: new _e("clearDocument"),
|
|
15510
15508
|
appendTransaction: (r, e, t) => {
|
|
15511
15509
|
if (r.some((v) => v.getMeta("composition")))
|
|
@@ -15533,7 +15531,7 @@ var Se = class up extends p0 {
|
|
|
15533
15531
|
name: "paste",
|
|
15534
15532
|
addProseMirrorPlugins() {
|
|
15535
15533
|
return [
|
|
15536
|
-
new
|
|
15534
|
+
new Ve({
|
|
15537
15535
|
key: new _e("tiptapPaste"),
|
|
15538
15536
|
props: {
|
|
15539
15537
|
handlePaste: (r, e, t) => {
|
|
@@ -15551,7 +15549,7 @@ var Se = class up extends p0 {
|
|
|
15551
15549
|
name: "tabindex",
|
|
15552
15550
|
addProseMirrorPlugins() {
|
|
15553
15551
|
return [
|
|
15554
|
-
new
|
|
15552
|
+
new Ve({
|
|
15555
15553
|
key: new _e("tabindex"),
|
|
15556
15554
|
props: {
|
|
15557
15555
|
attributes: () => this.editor.isEditable ? { tabindex: "0" } : {}
|
|
@@ -15590,7 +15588,7 @@ var Se = class up extends p0 {
|
|
|
15590
15588
|
},
|
|
15591
15589
|
addProseMirrorPlugins() {
|
|
15592
15590
|
return [
|
|
15593
|
-
new
|
|
15591
|
+
new Ve({
|
|
15594
15592
|
key: new _e("textDirection"),
|
|
15595
15593
|
props: {
|
|
15596
15594
|
attributes: () => {
|
|
@@ -16807,7 +16805,7 @@ function Ao(r) {
|
|
|
16807
16805
|
});
|
|
16808
16806
|
}
|
|
16809
16807
|
function o6(r = {}) {
|
|
16810
|
-
return new
|
|
16808
|
+
return new Ve({
|
|
16811
16809
|
view(e) {
|
|
16812
16810
|
return new a6(e, r);
|
|
16813
16811
|
}
|
|
@@ -17025,7 +17023,7 @@ function u6(r) {
|
|
|
17025
17023
|
return !0;
|
|
17026
17024
|
}
|
|
17027
17025
|
function c6() {
|
|
17028
|
-
return new
|
|
17026
|
+
return new Ve({
|
|
17029
17027
|
props: {
|
|
17030
17028
|
decorations: p6,
|
|
17031
17029
|
createSelectionBetween(r, e, t) {
|
|
@@ -17386,7 +17384,7 @@ function k6(r = {}) {
|
|
|
17386
17384
|
return r = {
|
|
17387
17385
|
depth: r.depth || 100,
|
|
17388
17386
|
newGroupDelay: r.newGroupDelay || 500
|
|
17389
|
-
}, new
|
|
17387
|
+
}, new Ve({
|
|
17390
17388
|
key: vn,
|
|
17391
17389
|
state: {
|
|
17392
17390
|
init() {
|
|
@@ -17452,7 +17450,7 @@ Se.create({
|
|
|
17452
17450
|
addProseMirrorPlugins() {
|
|
17453
17451
|
let r = !1;
|
|
17454
17452
|
return [
|
|
17455
|
-
new
|
|
17453
|
+
new Ve({
|
|
17456
17454
|
key: new _e("characterCount"),
|
|
17457
17455
|
appendTransaction: (e, t, n) => {
|
|
17458
17456
|
if (r)
|
|
@@ -17512,7 +17510,7 @@ var T6 = Se.create({
|
|
|
17512
17510
|
},
|
|
17513
17511
|
addProseMirrorPlugins() {
|
|
17514
17512
|
return [
|
|
17515
|
-
new
|
|
17513
|
+
new Ve({
|
|
17516
17514
|
key: new _e("focus"),
|
|
17517
17515
|
props: {
|
|
17518
17516
|
decorations: ({ doc: r, selection: e }) => {
|
|
@@ -17575,7 +17573,7 @@ Se.create({
|
|
|
17575
17573
|
},
|
|
17576
17574
|
addProseMirrorPlugins() {
|
|
17577
17575
|
return [
|
|
17578
|
-
new
|
|
17576
|
+
new Ve({
|
|
17579
17577
|
key: new _e("placeholder"),
|
|
17580
17578
|
props: {
|
|
17581
17579
|
decorations: ({ doc: r, selection: e }) => {
|
|
@@ -17617,7 +17615,7 @@ Se.create({
|
|
|
17617
17615
|
addProseMirrorPlugins() {
|
|
17618
17616
|
const { editor: r, options: e } = this;
|
|
17619
17617
|
return [
|
|
17620
|
-
new
|
|
17618
|
+
new Ve({
|
|
17621
17619
|
key: new _e("selection"),
|
|
17622
17620
|
props: {
|
|
17623
17621
|
decorations(t) {
|
|
@@ -17647,7 +17645,7 @@ Se.create({
|
|
|
17647
17645
|
var r;
|
|
17648
17646
|
const e = new _e(this.name), t = this.options.node || ((r = this.editor.schema.topNodeType.contentMatch.defaultType) == null ? void 0 : r.name) || "paragraph", n = Object.entries(this.editor.schema.nodes).map(([, i]) => i).filter((i) => (this.options.notAfter || []).concat(t).includes(i.name));
|
|
17649
17647
|
return [
|
|
17650
|
-
new
|
|
17648
|
+
new Ve({
|
|
17651
17649
|
key: e,
|
|
17652
17650
|
appendTransaction: (i, s, o) => {
|
|
17653
17651
|
const { doc: a, tr: l, schema: u } = o, c = e.getState(o), d = a.content.size, f = u.nodes[t];
|
|
@@ -18337,7 +18335,7 @@ var x7 = class extends Be.Component {
|
|
|
18337
18335
|
...r
|
|
18338
18336
|
});
|
|
18339
18337
|
}
|
|
18340
|
-
), k7 = Be.memo(S7), T7 = typeof window < "u" ? U1 :
|
|
18338
|
+
), k7 = Be.memo(S7), T7 = typeof window < "u" ? U1 : He, M7 = class {
|
|
18341
18339
|
constructor(r) {
|
|
18342
18340
|
this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = r, this.lastSnapshot = { editor: r, transactionNumber: 0 }, this.getSnapshot = this.getSnapshot.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.watch = this.watch.bind(this), this.subscribe = this.subscribe.bind(this);
|
|
18343
18341
|
}
|
|
@@ -18557,7 +18555,7 @@ function A7(r = {}, e = []) {
|
|
|
18557
18555
|
n.getEditor,
|
|
18558
18556
|
n.getServerSnapshot
|
|
18559
18557
|
);
|
|
18560
|
-
return Jd(i),
|
|
18558
|
+
return Jd(i), He(n.onRender(e)), Op({
|
|
18561
18559
|
editor: i,
|
|
18562
18560
|
selector: ({ transactionNumber: s }) => r.shouldRerenderOnTransaction === !1 || r.shouldRerenderOnTransaction === void 0 ? null : r.immediatelyRender && s === 0 ? 0 : s + 1
|
|
18563
18561
|
}), i;
|
|
@@ -33689,7 +33687,7 @@ var Va = 4, kw = /^```([a-z]+)?[\s\n]$/, Tw = /^~~~([a-z]+)?[\s\n]$/, Mw = Me.cr
|
|
|
33689
33687
|
return [
|
|
33690
33688
|
// this plugin creates a code block for pasted content from VS Code
|
|
33691
33689
|
// we can also detect the copied code language
|
|
33692
|
-
new
|
|
33690
|
+
new Ve({
|
|
33693
33691
|
key: new _e("codeBlockVSCodeHandler"),
|
|
33694
33692
|
props: {
|
|
33695
33693
|
handlePaste: (r, e) => {
|
|
@@ -35650,7 +35648,7 @@ var Ix = class {
|
|
|
35650
35648
|
destroy() {
|
|
35651
35649
|
this.hide(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.removeEventListener("dragstart", this.dragstartHandler), window.removeEventListener("resize", this.resizeHandler), this.scrollTarget.removeEventListener("scroll", this.resizeHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler), this.editor.off("transaction", this.transactionHandler), this.floatingUIOptions.onDestroy && this.floatingUIOptions.onDestroy();
|
|
35652
35650
|
}
|
|
35653
|
-
}, C1 = (r) => new
|
|
35651
|
+
}, C1 = (r) => new Ve({
|
|
35654
35652
|
key: typeof r.pluginKey == "string" ? new _e(r.pluginKey) : r.pluginKey,
|
|
35655
35653
|
view: (e) => new Ix({ view: e, ...r })
|
|
35656
35654
|
});
|
|
@@ -35781,7 +35779,7 @@ var Px = class {
|
|
|
35781
35779
|
destroy() {
|
|
35782
35780
|
this.hide(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler), this.floatingUIOptions.onDestroy && this.floatingUIOptions.onDestroy();
|
|
35783
35781
|
}
|
|
35784
|
-
}, E1 = (r) => new
|
|
35782
|
+
}, E1 = (r) => new Ve({
|
|
35785
35783
|
key: typeof r.pluginKey == "string" ? new _e(r.pluginKey) : r.pluginKey,
|
|
35786
35784
|
view: (e) => new Px({ view: e, ...r })
|
|
35787
35785
|
});
|
|
@@ -35833,7 +35831,7 @@ var zx = Be.forwardRef(
|
|
|
35833
35831
|
getReferencedVirtualElement: o,
|
|
35834
35832
|
options: a
|
|
35835
35833
|
}, v = Ce(m);
|
|
35836
|
-
return v.current = m,
|
|
35834
|
+
return v.current = m, He(() => {
|
|
35837
35835
|
if (h?.isDestroyed)
|
|
35838
35836
|
return;
|
|
35839
35837
|
if (!h) {
|
|
@@ -35862,7 +35860,7 @@ Be.forwardRef(
|
|
|
35862
35860
|
const l = Ce(document.createElement("div"));
|
|
35863
35861
|
typeof a == "function" ? a(l.current) : a && (a.current = l.current);
|
|
35864
35862
|
const { editor: u } = Rp();
|
|
35865
|
-
return
|
|
35863
|
+
return He(() => {
|
|
35866
35864
|
const c = l.current;
|
|
35867
35865
|
if (c.style.visibility = "hidden", c.style.position = "absolute", e?.isDestroyed || u?.isDestroyed)
|
|
35868
35866
|
return;
|
|
@@ -35893,7 +35891,7 @@ const Lx = ({ editor: r }) => {
|
|
|
35893
35891
|
if (!r)
|
|
35894
35892
|
return null;
|
|
35895
35893
|
const [e] = Be.useState(!0), [t] = Be.useState(!0);
|
|
35896
|
-
|
|
35894
|
+
He(() => {
|
|
35897
35895
|
r && r.setEditable(t);
|
|
35898
35896
|
}, [t, r]);
|
|
35899
35897
|
const n = Op({
|
|
@@ -36257,11 +36255,11 @@ const jx = Me.create({
|
|
|
36257
36255
|
}, 500);
|
|
36258
36256
|
}
|
|
36259
36257
|
});
|
|
36260
|
-
|
|
36258
|
+
He(() => () => {
|
|
36261
36259
|
t.current && clearTimeout(t.current);
|
|
36262
36260
|
}, []);
|
|
36263
36261
|
const i = Ce(!0);
|
|
36264
|
-
|
|
36262
|
+
He(() => {
|
|
36265
36263
|
if (n && r !== n.getHTML() && i.current) {
|
|
36266
36264
|
const a = r;
|
|
36267
36265
|
if (n)
|
|
@@ -36271,7 +36269,7 @@ const jx = Me.create({
|
|
|
36271
36269
|
console.error("Error setting content: ", l);
|
|
36272
36270
|
}
|
|
36273
36271
|
}
|
|
36274
|
-
}, [r, n]),
|
|
36272
|
+
}, [r, n]), He(() => {
|
|
36275
36273
|
if (!n) return;
|
|
36276
36274
|
const a = () => {
|
|
36277
36275
|
i.current = !1;
|
|
@@ -36279,11 +36277,11 @@ const jx = Me.create({
|
|
|
36279
36277
|
return n.on("update", a), () => {
|
|
36280
36278
|
n.off("update", a);
|
|
36281
36279
|
};
|
|
36282
|
-
}, [n]),
|
|
36280
|
+
}, [n]), He(() => {
|
|
36283
36281
|
i.current = !0;
|
|
36284
36282
|
}, [r]);
|
|
36285
36283
|
const [s, o] = Ct(!1);
|
|
36286
|
-
return
|
|
36284
|
+
return He(
|
|
36287
36285
|
() => {
|
|
36288
36286
|
n && n.setEditable(s, !1);
|
|
36289
36287
|
},
|
|
@@ -36307,112 +36305,121 @@ const jx = Me.create({
|
|
|
36307
36305
|
/* @__PURE__ */ X.jsx("div", { className: (s ? "editable" : "read-only") + " ptx-page", children: /* @__PURE__ */ X.jsx(k7, { editor: n }) }),
|
|
36308
36306
|
/* @__PURE__ */ X.jsx(Lx, { editor: n })
|
|
36309
36307
|
] });
|
|
36310
|
-
}, Wx = (
|
|
36311
|
-
const
|
|
36312
|
-
|
|
36313
|
-
|
|
36314
|
-
|
|
36315
|
-
|
|
36316
|
-
|
|
36317
|
-
|
|
36318
|
-
|
|
36319
|
-
|
|
36320
|
-
|
|
36308
|
+
}, Wx = (r, e, t) => {
|
|
36309
|
+
const n = document.createElement("form");
|
|
36310
|
+
n.method = "POST", n.action = r, n.target = t, n.style.display = "none";
|
|
36311
|
+
for (const i in e)
|
|
36312
|
+
if (Object.hasOwnProperty.call(e, i)) {
|
|
36313
|
+
const s = document.createElement("input");
|
|
36314
|
+
s.type = "hidden", s.name = i, s.value = e[i], n.appendChild(s);
|
|
36315
|
+
}
|
|
36316
|
+
document.body.appendChild(n), n.submit(), n.remove();
|
|
36317
|
+
}, Ux = ({ content: r, title: e, onRebuild: t }) => {
|
|
36318
|
+
He(() => {
|
|
36319
|
+
n();
|
|
36320
|
+
}, []);
|
|
36321
|
+
const n = () => {
|
|
36321
36322
|
const i = r, s = e || "Document Title";
|
|
36322
|
-
|
|
36323
|
-
|
|
36323
|
+
if (t) {
|
|
36324
|
+
t(i, s, (a, l) => {
|
|
36325
|
+
Wx(a, l, "fullPreview");
|
|
36326
|
+
});
|
|
36327
|
+
return;
|
|
36328
|
+
}
|
|
36324
36329
|
};
|
|
36325
|
-
return /* @__PURE__ */ X.jsxs("div", { className: "
|
|
36326
|
-
/* @__PURE__ */ X.jsxs("div", { className: "
|
|
36327
|
-
/* @__PURE__ */ X.jsx("p", { className: "
|
|
36330
|
+
return /* @__PURE__ */ X.jsxs("div", { className: "pretext-plus-editor__full-preview", children: [
|
|
36331
|
+
/* @__PURE__ */ X.jsxs("div", { className: "pretext-plus-editor__preview-header", children: [
|
|
36332
|
+
/* @__PURE__ */ X.jsx("p", { className: "pretext-plus-editor__preview-title", children: "Full Preview" }),
|
|
36328
36333
|
/* @__PURE__ */ X.jsx(
|
|
36329
36334
|
"button",
|
|
36330
36335
|
{
|
|
36331
|
-
className: "
|
|
36336
|
+
className: "pretext-plus-editor__rebuild-button",
|
|
36332
36337
|
onClick: () => n(),
|
|
36333
36338
|
children: "Rebuild"
|
|
36334
36339
|
}
|
|
36335
36340
|
)
|
|
36336
36341
|
] }),
|
|
36337
|
-
/* @__PURE__ */ X.jsx("div", { children: /* @__PURE__ */ X.jsx(
|
|
36342
|
+
/* @__PURE__ */ X.jsx("div", { className: "pretext-plus-editor__preview-container", children: /* @__PURE__ */ X.jsx(
|
|
36338
36343
|
"iframe",
|
|
36339
36344
|
{
|
|
36340
|
-
|
|
36341
|
-
name: "fullPreview"
|
|
36342
|
-
src: "https://build.pretext.plus"
|
|
36345
|
+
className: "pretext-plus-editor__preview-iframe",
|
|
36346
|
+
name: "fullPreview"
|
|
36343
36347
|
}
|
|
36344
36348
|
) })
|
|
36345
36349
|
] });
|
|
36346
|
-
},
|
|
36347
|
-
|
|
36348
|
-
|
|
36349
|
-
" ",
|
|
36350
|
+
}, Gx = (r) => {
|
|
36351
|
+
let e;
|
|
36352
|
+
return r.showPreviewModeToggle === !1 ? e = null : e = /* @__PURE__ */ X.jsxs("label", { className: "pretext-plus-editor__preview-toggle", children: [
|
|
36350
36353
|
/* @__PURE__ */ X.jsx(
|
|
36351
36354
|
"input",
|
|
36352
36355
|
{
|
|
36353
|
-
|
|
36354
|
-
|
|
36355
|
-
|
|
36356
|
-
|
|
36357
|
-
}
|
|
36358
|
-
)
|
|
36359
|
-
] }) }),
|
|
36360
|
-
/* @__PURE__ */ X.jsxs("div", { className: "right-side flex items-center space-x-4", children: [
|
|
36361
|
-
r.onSaveButton && /* @__PURE__ */ X.jsx(
|
|
36362
|
-
"button",
|
|
36363
|
-
{
|
|
36364
|
-
className: "w-full sm:w-auto rounded-md px-3.5 py-2.5 !bg-green-600 hover:!bg-green-700 !text-white inline-block font-medium cursor-pointer",
|
|
36365
|
-
onClick: r.onSaveButton,
|
|
36366
|
-
children: r.saveButtonLabel || "Save"
|
|
36356
|
+
type: "checkbox",
|
|
36357
|
+
checked: !r.isChecked,
|
|
36358
|
+
onChange: r.onChange,
|
|
36359
|
+
className: "pretext-plus-editor__preview-toggle-input"
|
|
36367
36360
|
}
|
|
36368
36361
|
),
|
|
36369
|
-
|
|
36370
|
-
"
|
|
36371
|
-
{
|
|
36372
|
-
className: "w-full sm:w-auto rounded-md px-3.5 py-2.5 !bg-gray-300 hover:!bg-gray-400 !text-black inline-block font-medium cursor-pointer ml-4",
|
|
36373
|
-
onClick: r.onCancelButton,
|
|
36374
|
-
children: r.cancelButtonLabel || "Cancel"
|
|
36375
|
-
}
|
|
36376
|
-
),
|
|
36377
|
-
/* @__PURE__ */ X.jsxs("label", { className: "relative inline-flex cursor-pointer select-none items-center flex-col", children: [
|
|
36362
|
+
/* @__PURE__ */ X.jsxs("div", { className: "pretext-plus-editor__preview-toggle-container", children: [
|
|
36363
|
+
/* @__PURE__ */ X.jsx("span", { className: "pretext-plus-editor__preview-toggle-label", children: "Simple" }),
|
|
36378
36364
|
/* @__PURE__ */ X.jsx(
|
|
36379
|
-
"
|
|
36365
|
+
"span",
|
|
36380
36366
|
{
|
|
36381
|
-
|
|
36382
|
-
|
|
36383
|
-
|
|
36384
|
-
|
|
36367
|
+
className: `pretext-plus-editor__preview-toggle-slider ${r.isChecked ? "pretext-plus-editor__preview-toggle-slider--active" : ""}`,
|
|
36368
|
+
children: /* @__PURE__ */ X.jsx(
|
|
36369
|
+
"span",
|
|
36370
|
+
{
|
|
36371
|
+
className: `pretext-plus-editor__preview-toggle-dot ${r.isChecked ? "pretext-plus-editor__preview-toggle-dot--active" : ""}`
|
|
36372
|
+
}
|
|
36373
|
+
)
|
|
36385
36374
|
}
|
|
36386
36375
|
),
|
|
36387
|
-
/* @__PURE__ */ X.
|
|
36388
|
-
|
|
36389
|
-
|
|
36390
|
-
|
|
36391
|
-
|
|
36392
|
-
|
|
36393
|
-
|
|
36394
|
-
|
|
36395
|
-
|
|
36396
|
-
|
|
36397
|
-
|
|
36398
|
-
|
|
36399
|
-
|
|
36400
|
-
|
|
36401
|
-
|
|
36402
|
-
|
|
36403
|
-
/* @__PURE__ */ X.jsx("span", { className: "mt-1 text-xs font-medium text-gray-600 text-center", children: "Preview Mode" }),
|
|
36376
|
+
/* @__PURE__ */ X.jsx("span", { className: "pretext-plus-editor__preview-toggle-label", children: "Full" })
|
|
36377
|
+
] }),
|
|
36378
|
+
/* @__PURE__ */ X.jsx("span", { className: "pretext-plus-editor__preview-toggle-caption", children: "Preview Mode" }),
|
|
36379
|
+
/* @__PURE__ */ X.jsx(
|
|
36380
|
+
"input",
|
|
36381
|
+
{
|
|
36382
|
+
type: "checkbox",
|
|
36383
|
+
checked: r.isChecked,
|
|
36384
|
+
onChange: r.onChange,
|
|
36385
|
+
className: "pretext-plus-editor__preview-toggle-input"
|
|
36386
|
+
}
|
|
36387
|
+
)
|
|
36388
|
+
] }), /* @__PURE__ */ X.jsxs("div", { className: "pretext-plus-editor__menu-bar", children: [
|
|
36389
|
+
/* @__PURE__ */ X.jsx("div", { className: "pretext-plus-editor__menu-left", children: r.title !== void 0 && r.onTitleChange && /* @__PURE__ */ X.jsxs("label", { className: "pretext-plus-editor__title-label", children: [
|
|
36390
|
+
"Title",
|
|
36391
|
+
" ",
|
|
36404
36392
|
/* @__PURE__ */ X.jsx(
|
|
36405
36393
|
"input",
|
|
36406
36394
|
{
|
|
36407
|
-
|
|
36408
|
-
|
|
36409
|
-
|
|
36410
|
-
|
|
36395
|
+
className: "pretext-plus-editor__title-input",
|
|
36396
|
+
type: "text",
|
|
36397
|
+
value: r.title,
|
|
36398
|
+
onChange: (t) => r.onTitleChange?.(t.target.value)
|
|
36411
36399
|
}
|
|
36412
36400
|
)
|
|
36401
|
+
] }) }),
|
|
36402
|
+
/* @__PURE__ */ X.jsxs("div", { className: "pretext-plus-editor__menu-right", children: [
|
|
36403
|
+
r.onSaveButton && /* @__PURE__ */ X.jsx(
|
|
36404
|
+
"button",
|
|
36405
|
+
{
|
|
36406
|
+
className: "pretext-plus-editor__button pretext-plus-editor__button--save",
|
|
36407
|
+
onClick: r.onSaveButton,
|
|
36408
|
+
children: r.saveButtonLabel || "Save"
|
|
36409
|
+
}
|
|
36410
|
+
),
|
|
36411
|
+
r.onCancelButton && /* @__PURE__ */ X.jsx(
|
|
36412
|
+
"button",
|
|
36413
|
+
{
|
|
36414
|
+
className: "pretext-plus-editor__button pretext-plus-editor__button--cancel",
|
|
36415
|
+
onClick: r.onCancelButton,
|
|
36416
|
+
children: r.cancelButtonLabel || "Cancel"
|
|
36417
|
+
}
|
|
36418
|
+
),
|
|
36419
|
+
e
|
|
36413
36420
|
] })
|
|
36414
|
-
] })
|
|
36415
|
-
|
|
36421
|
+
] });
|
|
36422
|
+
}, Kx = `
|
|
36416
36423
|
<section>
|
|
36417
36424
|
<title>My Section</title>
|
|
36418
36425
|
<p>
|
|
@@ -36491,10 +36498,17 @@ const jx = Me.create({
|
|
|
36491
36498
|
|
|
36492
36499
|
<p> And that's the end of the demo. Thanks for coming!</p>
|
|
36493
36500
|
</section>
|
|
36494
|
-
`,
|
|
36495
|
-
const [e, t] = Ct(r.content ||
|
|
36501
|
+
`, Yx = Kx, Zx = (r) => {
|
|
36502
|
+
const [e, t] = Ct(r.content || Yx), [n, i] = Ct(r.title || "Document Title"), [s, o] = Ct(!1);
|
|
36496
36503
|
let a;
|
|
36497
|
-
return s
|
|
36504
|
+
return s && r.onPreviewRebuild ? a = /* @__PURE__ */ X.jsx(
|
|
36505
|
+
Ux,
|
|
36506
|
+
{
|
|
36507
|
+
content: e,
|
|
36508
|
+
title: n,
|
|
36509
|
+
onRebuild: r.onPreviewRebuild
|
|
36510
|
+
}
|
|
36511
|
+
) : a = /* @__PURE__ */ X.jsx(
|
|
36498
36512
|
_x,
|
|
36499
36513
|
{
|
|
36500
36514
|
content: e,
|
|
@@ -36502,9 +36516,9 @@ const jx = Me.create({
|
|
|
36502
36516
|
t(l || ""), r.onContentChange(l);
|
|
36503
36517
|
}
|
|
36504
36518
|
}
|
|
36505
|
-
), /* @__PURE__ */ X.jsxs("div", { children: [
|
|
36519
|
+
), /* @__PURE__ */ X.jsxs("div", { className: "pretext-plus-editor", children: [
|
|
36506
36520
|
/* @__PURE__ */ X.jsx(
|
|
36507
|
-
|
|
36521
|
+
Gx,
|
|
36508
36522
|
{
|
|
36509
36523
|
isChecked: s,
|
|
36510
36524
|
onChange: () => o(!s),
|
|
@@ -36515,11 +36529,12 @@ const jx = Me.create({
|
|
|
36515
36529
|
onSaveButton: r.onSaveButton,
|
|
36516
36530
|
saveButtonLabel: r.saveButtonLabel,
|
|
36517
36531
|
onCancelButton: r.onCancelButton,
|
|
36518
|
-
cancelButtonLabel: r.cancelButtonLabel
|
|
36532
|
+
cancelButtonLabel: r.cancelButtonLabel,
|
|
36533
|
+
showPreviewModeToggle: r.onPreviewRebuild !== void 0
|
|
36519
36534
|
}
|
|
36520
36535
|
),
|
|
36521
|
-
/* @__PURE__ */ X.jsxs(ah, {
|
|
36522
|
-
/* @__PURE__ */ X.jsx(Xa, { className: "
|
|
36536
|
+
/* @__PURE__ */ X.jsxs(ah, { className: "pretext-plus-editor__splitter", children: [
|
|
36537
|
+
/* @__PURE__ */ X.jsx(Xa, { className: "pretext-plus-editor__editor-panel", children: /* @__PURE__ */ X.jsx(
|
|
36523
36538
|
t2,
|
|
36524
36539
|
{
|
|
36525
36540
|
content: e,
|
|
@@ -36528,15 +36543,15 @@ const jx = Me.create({
|
|
|
36528
36543
|
}
|
|
36529
36544
|
}
|
|
36530
36545
|
) }),
|
|
36531
|
-
/* @__PURE__ */ X.jsx(Xa, { className: "
|
|
36532
|
-
] })
|
|
36533
|
-
/* @__PURE__ */ X.jsx("textarea", { value: e, readOnly: !0, style: { display: "none", width: "98vw", height: "20vh", marginTop: "10px" } })
|
|
36546
|
+
/* @__PURE__ */ X.jsx(Xa, { className: "pretext-plus-editor__preview-panel", children: a })
|
|
36547
|
+
] })
|
|
36534
36548
|
] });
|
|
36535
36549
|
};
|
|
36536
36550
|
export {
|
|
36537
36551
|
t2 as CodeEditor,
|
|
36538
|
-
|
|
36539
|
-
|
|
36540
|
-
_x as VisualEditor
|
|
36552
|
+
Zx as Editors,
|
|
36553
|
+
Ux as FullPreview,
|
|
36554
|
+
_x as VisualEditor,
|
|
36555
|
+
Wx as postToIframe
|
|
36541
36556
|
};
|
|
36542
36557
|
//# sourceMappingURL=index.es.js.map
|