@pretextbook/web-editor 0.0.11 → 0.0.12
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/index.es.js +116 -115
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +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 yt, useRef as
|
|
2
|
+
import Be, { useContext as ao, useState as yt, useRef as ke, useEffect as He, memo as lo, useCallback as qa, createRef as q1, createContext as Jd, createElement as W1, version as G0, useDebugValue as Yd, forwardRef as U1, useLayoutEffect as G1 } from "react";
|
|
3
3
|
import K1, { flushSync as J1, createPortal as Xd } from "react-dom";
|
|
4
4
|
var Yi = { exports: {} }, si = {};
|
|
5
5
|
var K0;
|
|
@@ -426,7 +426,7 @@ function X0(r, e) {
|
|
|
426
426
|
for (var t = 0, n = Array(e); t < e; t++) n[t] = r[t];
|
|
427
427
|
return n;
|
|
428
428
|
}
|
|
429
|
-
var
|
|
429
|
+
var Me = /* @__PURE__ */ (function() {
|
|
430
430
|
function r() {
|
|
431
431
|
Qd(this, r);
|
|
432
432
|
}
|
|
@@ -1261,8 +1261,8 @@ var Te = /* @__PURE__ */ (function() {
|
|
|
1261
1261
|
}
|
|
1262
1262
|
}]);
|
|
1263
1263
|
})();
|
|
1264
|
-
Bl(
|
|
1265
|
-
Bl(
|
|
1264
|
+
Bl(Me, "DATA_PROPS", ["data-"]);
|
|
1265
|
+
Bl(Me, "ARIA_PROPS", ["aria", "focus-target"]);
|
|
1266
1266
|
function Z0(r, e) {
|
|
1267
1267
|
var t = typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
|
|
1268
1268
|
if (!t) {
|
|
@@ -2021,7 +2021,7 @@ var iu = function(e) {
|
|
|
2021
2021
|
}, su = function(e) {
|
|
2022
2022
|
var t = e.target, n = t === void 0 ? "document" : t, i = e.type, s = e.listener, o = e.options, a = e.when, l = a === void 0 ? !0 : a, u = ce.useRef(null), c = ce.useRef(null), d = iu(s), f = iu(o), h = function() {
|
|
2023
2023
|
var k = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, E = k.target;
|
|
2024
|
-
Ee.isNotEmpty(E) && (m(), (k.when || l) && (u.current =
|
|
2024
|
+
Ee.isNotEmpty(E) && (m(), (k.when || l) && (u.current = Me.getTargetElement(E))), !c.current && u.current && (c.current = function(I) {
|
|
2025
2025
|
return s && s(I);
|
|
2026
2026
|
}, u.current.addEventListener(i, c.current, o));
|
|
2027
2027
|
}, m = function() {
|
|
@@ -2029,7 +2029,7 @@ var iu = function(e) {
|
|
|
2029
2029
|
}, v = function() {
|
|
2030
2030
|
m(), d = null, f = null;
|
|
2031
2031
|
}, y = ce.useCallback(function() {
|
|
2032
|
-
l ? u.current =
|
|
2032
|
+
l ? u.current = Me.getTargetElement(n) : (m(), u.current = null);
|
|
2033
2033
|
}, [n, l]);
|
|
2034
2034
|
return ce.useEffect(function() {
|
|
2035
2035
|
y();
|
|
@@ -2053,7 +2053,7 @@ var iu = function(e) {
|
|
|
2053
2053
|
return t.current = !0, e && e();
|
|
2054
2054
|
}, []);
|
|
2055
2055
|
}, wg = 0, Xi = function(e) {
|
|
2056
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = yt(!1), i = yg(n, 2), s = i[0], o = i[1], a =
|
|
2056
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = yt(!1), i = yg(n, 2), s = i[0], o = i[1], a = ke(null), l = ao(Fl), u = Me.isClient() ? window.document : void 0, c = t.document, d = c === void 0 ? u : c, f = t.manual, h = f === void 0 ? !1 : f, m = t.name, v = m === void 0 ? "style_".concat(++wg) : m, y = t.id, w = y === void 0 ? void 0 : y, k = t.media, E = k === void 0 ? void 0 : k, I = function(z) {
|
|
2057
2057
|
var $ = z.querySelector('style[data-primereact-style-id="'.concat(v, '"]'));
|
|
2058
2058
|
if ($)
|
|
2059
2059
|
return $;
|
|
@@ -2068,10 +2068,10 @@ var iu = function(e) {
|
|
|
2068
2068
|
}, N = function() {
|
|
2069
2069
|
if (!(!d || s)) {
|
|
2070
2070
|
var z = l?.styleContainer || d.head;
|
|
2071
|
-
a.current = I(z), a.current.isConnected || (a.current.type = "text/css", w && (a.current.id = w), E && (a.current.media = E),
|
|
2071
|
+
a.current = I(z), a.current.isConnected || (a.current.type = "text/css", w && (a.current.id = w), E && (a.current.media = E), Me.addNonce(a.current, l && l.nonce || uo.nonce), z.appendChild(a.current), v && a.current.setAttribute("data-primereact-style-id", v)), a.current.textContent = e, o(!0);
|
|
2072
2072
|
}
|
|
2073
2073
|
}, D = function() {
|
|
2074
|
-
!d || !a.current || (
|
|
2074
|
+
!d || !a.current || (Me.removeInlineStyle(a.current), o(!1));
|
|
2075
2075
|
};
|
|
2076
2076
|
return He(function() {
|
|
2077
2077
|
h || N();
|
|
@@ -2957,7 +2957,7 @@ var Xa = function() {
|
|
|
2957
2957
|
props: i,
|
|
2958
2958
|
state: {
|
|
2959
2959
|
panelSizes: D,
|
|
2960
|
-
nested:
|
|
2960
|
+
nested: Me.getAttribute(o.current && o.current.parentElement, "data-p-splitter-panel-nested") === !0
|
|
2961
2961
|
}
|
|
2962
2962
|
}, Q = Qi.setMetaData(Yo({}, me)), xe = Q.ptm, C = Q.cx, x = Q.isUnstyled;
|
|
2963
2963
|
zg(Qi.css.styles, x, {
|
|
@@ -3005,7 +3005,7 @@ var Xa = function() {
|
|
|
3005
3005
|
be && L(JSON.parse(be));
|
|
3006
3006
|
}, [Cn, i.stateKey]), Nr = function(U, Z, Se) {
|
|
3007
3007
|
var Dr = U.type === "touchstart" ? U.touches[0].pageX : U.pageX, Rr = U.type === "touchstart" ? U.touches[0].pageY : U.pageY;
|
|
3008
|
-
a.current = l.current[Z], u.current = X ?
|
|
3008
|
+
a.current = l.current[Z], u.current = X ? Me.getWidth(o.current) : Me.getHeight(o.current), c.current = !0, d.current = X ? Dr : Rr, f.current = a.current.previousElementSibling, h.current = a.current.nextElementSibling, Se ? (m.current = X ? Me.getOuterWidth(f.current, !0) : Me.getOuterHeight(f.current, !0), w.current = X ? Me.getOuterWidth(h.current, !0) : Me.getOuterHeight(h.current, !0)) : (m.current = 100 * (X ? Me.getOuterWidth(f.current, !0) : Me.getOuterHeight(f.current, !0)) / u.current, w.current = 100 * (X ? Me.getOuterWidth(h.current, !0) : Me.getOuterHeight(h.current, !0)) / u.current), y.current = m.current, k.current = w.current, E.current = Z, !x() && Me.addClass(a.current, "p-splitter-gutter-resizing"), a.current.setAttribute("data-p-splitter-gutter-resizing", !0), !x() && Me.addClass(o.current, "p-splitter-resizing"), o.current.setAttribute("data-p-splitter-resizing", !0);
|
|
3009
3009
|
}, jo = function(U) {
|
|
3010
3010
|
var Z = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, Se = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, Dr, Rr, En, Go = U.type === "touchmove" ? U.touches[0].pageX : U.pageX, Ko = U.type === "touchmove" ? U.touches[0].pageY : U.pageY;
|
|
3011
3011
|
Se ? X ? (En = 100 * (m.current + Z) / u.current, Rr = 100 * (w.current - Z) / u.current) : (En = 100 * (m.current - Z) / u.current, Rr = 100 * (w.current + Z) / u.current) : (X ? Dr = Go * 100 / u.current - d.current * 100 / u.current : Dr = Ko * 100 / u.current - d.current * 100 / u.current, En = m.current + Dr, Rr = w.current - Dr), ni(E.current, En, Rr);
|
|
@@ -3014,9 +3014,9 @@ var Xa = function() {
|
|
|
3014
3014
|
Z[E.current] = y.current, Z[E.current + 1] = k.current, i.onResizeEnd && i.onResizeEnd({
|
|
3015
3015
|
originalEvent: U,
|
|
3016
3016
|
sizes: Z
|
|
3017
|
-
}), ue && ri(Z), L(Z), !x() &&
|
|
3017
|
+
}), ue && ri(Z), L(Z), !x() && Me.removeClass(a.current, "p-splitter-gutter-resizing"), l.current && Object.keys(l.current).forEach(function(Se) {
|
|
3018
3018
|
return l.current[Se].setAttribute("data-p-splitter-gutter-resizing", !1);
|
|
3019
|
-
}), !x() &&
|
|
3019
|
+
}), !x() && Me.removeClass(o.current, "p-splitter-resizing"), o.current.setAttribute("data-p-splitter-resizing", !1), Ki();
|
|
3020
3020
|
}, I1 = function() {
|
|
3021
3021
|
L1(), qo();
|
|
3022
3022
|
}, P1 = function(U, Z) {
|
|
@@ -3053,7 +3053,7 @@ var Xa = function() {
|
|
|
3053
3053
|
}
|
|
3054
3054
|
}
|
|
3055
3055
|
}, ni = function(U, Z, Se) {
|
|
3056
|
-
E.current = U, a.current = l.current[U], u.current = X ?
|
|
3056
|
+
E.current = U, a.current = l.current[U], u.current = X ? Me.getWidth(o.current) : Me.getHeight(o.current), f.current = a.current.previousElementSibling, h.current = a.current.nextElementSibling, ti(Z, Se) && (y.current = Z, k.current = Se, f.current.style.flexBasis = "calc(" + Z + "% - " + (i.children.length - 1) * i.gutterSize + "px)", h.current.style.flexBasis = "calc(" + Se + "% - " + (i.children.length - 1) * i.gutterSize + "px)", v.current = parseFloat(Z).toFixed(4));
|
|
3057
3057
|
}, z1 = function(U, Z, Se) {
|
|
3058
3058
|
Nr(U, Z, !0), jo(U, Se, !0);
|
|
3059
3059
|
}, Ji = function(U, Z, Se) {
|
|
@@ -3085,10 +3085,10 @@ var Xa = function() {
|
|
|
3085
3085
|
o.current && (s.current = ug());
|
|
3086
3086
|
}), ce.useEffect(function() {
|
|
3087
3087
|
var be = lu(o.current.children).filter(function(Z) {
|
|
3088
|
-
return
|
|
3088
|
+
return Me.getAttribute(Z, "data-pc-section") === "splitterpanel.root";
|
|
3089
3089
|
}), U = [];
|
|
3090
3090
|
be.map(function(Z, Se) {
|
|
3091
|
-
v.current = W(D, 0), U[Se] = W(D, Se), Z.childNodes && Ee.isNotEmpty(
|
|
3091
|
+
v.current = W(D, 0), U[Se] = W(D, Se), Z.childNodes && Ee.isNotEmpty(Me.find(Z, "[data-pc-name='splitter']") && Me.find(Z, "[data-pc-section='root']")) && (!x() && Me.addClass(Z, "p-splitter-panel-nested"), Z.setAttribute("data-p-splitter-panel-nested", !0), re(!0));
|
|
3092
3092
|
}), L(U);
|
|
3093
3093
|
}, []), ce.useEffect(function() {
|
|
3094
3094
|
ue && an();
|
|
@@ -3568,7 +3568,7 @@ function q4(r) {
|
|
|
3568
3568
|
}
|
|
3569
3569
|
var ph = q4;
|
|
3570
3570
|
function W4(r, e, t = !0) {
|
|
3571
|
-
let n =
|
|
3571
|
+
let n = ke(!0);
|
|
3572
3572
|
He(n.current || !t ? () => {
|
|
3573
3573
|
n.current = !1;
|
|
3574
3574
|
} : r, e);
|
|
@@ -3589,7 +3589,7 @@ function mh(r, e) {
|
|
|
3589
3589
|
return r.Uri.parse(e);
|
|
3590
3590
|
}
|
|
3591
3591
|
function K4({ original: r, modified: e, language: t, originalLanguage: n, modifiedLanguage: i, originalModelPath: s, modifiedModelPath: o, keepCurrentOriginalModel: a = !1, keepCurrentModifiedModel: l = !1, theme: u = "light", loading: c = "Loading...", options: d = {}, height: f = "100%", width: h = "100%", className: m, wrapperProps: v = {}, beforeMount: y = pi, onMount: w = pi }) {
|
|
3592
|
-
let [k, E] = yt(!1), [I, O] = yt(!0), N =
|
|
3592
|
+
let [k, E] = yt(!1), [I, O] = yt(!0), N = ke(null), D = ke(null), L = ke(null), z = ke(w), $ = ke(y), ee = ke(!1);
|
|
3593
3593
|
ph(() => {
|
|
3594
3594
|
let W = hh.init();
|
|
3595
3595
|
return W.then((X) => (D.current = X) && O(!1)).catch((X) => X?.type !== "cancelation" && console.error("Monaco initialization: error:", X)), () => N.current ? te() : W.cancel();
|
|
@@ -3638,14 +3638,14 @@ function K4({ original: r, modified: e, language: t, originalLanguage: n, modifi
|
|
|
3638
3638
|
var J4 = K4;
|
|
3639
3639
|
lo(J4);
|
|
3640
3640
|
function Y4(r) {
|
|
3641
|
-
let e =
|
|
3641
|
+
let e = ke();
|
|
3642
3642
|
return He(() => {
|
|
3643
3643
|
e.current = r;
|
|
3644
3644
|
}, [r]), e.current;
|
|
3645
3645
|
}
|
|
3646
3646
|
var X4 = Y4, ts = /* @__PURE__ */ new Map();
|
|
3647
3647
|
function Z4({ defaultValue: r, defaultLanguage: e, defaultPath: t, value: n, language: i, path: s, theme: o = "light", line: a, loading: l = "Loading...", options: u = {}, overrideServices: c = {}, saveViewState: d = !0, keepCurrentModel: f = !1, width: h = "100%", height: m = "100%", className: v, wrapperProps: y = {}, beforeMount: w = pi, onMount: k = pi, onChange: E, onValidate: I = pi }) {
|
|
3648
|
-
let [O, N] = yt(!1), [D, L] = yt(!0), z =
|
|
3648
|
+
let [O, N] = yt(!1), [D, L] = yt(!0), z = ke(null), $ = ke(null), ee = ke(null), re = ke(k), ue = ke(w), te = ke(), W = ke(n), X = X4(s), me = ke(!1), Q = ke(!1);
|
|
3649
3649
|
ph(() => {
|
|
3650
3650
|
let x = hh.init();
|
|
3651
3651
|
return x.then((R) => (z.current = R) && L(!1)).catch((R) => R?.type !== "cancelation" && console.error("Monaco initialization: error:", R)), () => $.current ? C() : x.cancel();
|
|
@@ -3709,7 +3709,7 @@ const t2 = {
|
|
|
3709
3709
|
tabSize: 2,
|
|
3710
3710
|
padding: { top: 10, bottom: 10 }
|
|
3711
3711
|
}, r2 = ({ content: r, onChange: e }) => {
|
|
3712
|
-
const t =
|
|
3712
|
+
const t = ke(null), n = ke(null), i = ke(null), [, s] = yt(!1), [, o] = yt(!1);
|
|
3713
3713
|
He(() => () => {
|
|
3714
3714
|
n.current?.dispose?.(), i.current && clearTimeout(i.current);
|
|
3715
3715
|
}, []);
|
|
@@ -13873,7 +13873,7 @@ function u0(r, e) {
|
|
|
13873
13873
|
function Zf(r) {
|
|
13874
13874
|
return typeof r == "function";
|
|
13875
13875
|
}
|
|
13876
|
-
function
|
|
13876
|
+
function Ce(r, e = void 0, ...t) {
|
|
13877
13877
|
return Zf(r) ? e ? r.bind(e)(...t) : r(...t) : r;
|
|
13878
13878
|
}
|
|
13879
13879
|
function e3(r = {}) {
|
|
@@ -14029,22 +14029,22 @@ function r3(r, e) {
|
|
|
14029
14029
|
};
|
|
14030
14030
|
}, {}), h = yc({
|
|
14031
14031
|
...f,
|
|
14032
|
-
content:
|
|
14033
|
-
marks:
|
|
14034
|
-
group:
|
|
14035
|
-
inline:
|
|
14036
|
-
atom:
|
|
14037
|
-
selectable:
|
|
14038
|
-
draggable:
|
|
14039
|
-
code:
|
|
14040
|
-
whitespace:
|
|
14041
|
-
linebreakReplacement:
|
|
14032
|
+
content: Ce(ne(u, "content", d)),
|
|
14033
|
+
marks: Ce(ne(u, "marks", d)),
|
|
14034
|
+
group: Ce(ne(u, "group", d)),
|
|
14035
|
+
inline: Ce(ne(u, "inline", d)),
|
|
14036
|
+
atom: Ce(ne(u, "atom", d)),
|
|
14037
|
+
selectable: Ce(ne(u, "selectable", d)),
|
|
14038
|
+
draggable: Ce(ne(u, "draggable", d)),
|
|
14039
|
+
code: Ce(ne(u, "code", d)),
|
|
14040
|
+
whitespace: Ce(ne(u, "whitespace", d)),
|
|
14041
|
+
linebreakReplacement: Ce(
|
|
14042
14042
|
ne(u, "linebreakReplacement", d)
|
|
14043
14043
|
),
|
|
14044
|
-
defining:
|
|
14045
|
-
isolating:
|
|
14044
|
+
defining: Ce(ne(u, "defining", d)),
|
|
14045
|
+
isolating: Ce(ne(u, "isolating", d)),
|
|
14046
14046
|
attrs: Object.fromEntries(c.map(bc))
|
|
14047
|
-
}), m =
|
|
14047
|
+
}), m = Ce(ne(u, "parseHTML", d));
|
|
14048
14048
|
m && (h.parseDOM = m.map(
|
|
14049
14049
|
(w) => vc(w, c)
|
|
14050
14050
|
));
|
|
@@ -14071,13 +14071,13 @@ function r3(r, e) {
|
|
|
14071
14071
|
};
|
|
14072
14072
|
}, {}), h = yc({
|
|
14073
14073
|
...f,
|
|
14074
|
-
inclusive:
|
|
14075
|
-
excludes:
|
|
14076
|
-
group:
|
|
14077
|
-
spanning:
|
|
14078
|
-
code:
|
|
14074
|
+
inclusive: Ce(ne(u, "inclusive", d)),
|
|
14075
|
+
excludes: Ce(ne(u, "excludes", d)),
|
|
14076
|
+
group: Ce(ne(u, "group", d)),
|
|
14077
|
+
spanning: Ce(ne(u, "spanning", d)),
|
|
14078
|
+
code: Ce(ne(u, "code", d)),
|
|
14079
14079
|
attrs: Object.fromEntries(c.map(bc))
|
|
14080
|
-
}), m =
|
|
14080
|
+
}), m = Ce(ne(u, "parseHTML", d));
|
|
14081
14081
|
m && (h.parseDOM = m.map(
|
|
14082
14082
|
(y) => vc(y, c)
|
|
14083
14083
|
));
|
|
@@ -14305,7 +14305,7 @@ function xc(r, e) {
|
|
|
14305
14305
|
name: n.name,
|
|
14306
14306
|
options: n.options,
|
|
14307
14307
|
storage: n.storage
|
|
14308
|
-
}, s =
|
|
14308
|
+
}, s = Ce(ne(n, "group", i));
|
|
14309
14309
|
return typeof s != "string" ? !1 : s.split(" ").includes("list");
|
|
14310
14310
|
}
|
|
14311
14311
|
function Co(r, {
|
|
@@ -14872,7 +14872,7 @@ var f0 = class {
|
|
|
14872
14872
|
}
|
|
14873
14873
|
get options() {
|
|
14874
14874
|
return {
|
|
14875
|
-
...
|
|
14875
|
+
...Ce(
|
|
14876
14876
|
ne(this, "addOptions", {
|
|
14877
14877
|
name: this.name
|
|
14878
14878
|
})
|
|
@@ -14881,7 +14881,7 @@ var f0 = class {
|
|
|
14881
14881
|
}
|
|
14882
14882
|
get storage() {
|
|
14883
14883
|
return {
|
|
14884
|
-
...
|
|
14884
|
+
...Ce(
|
|
14885
14885
|
ne(this, "addStorage", {
|
|
14886
14886
|
name: this.name,
|
|
14887
14887
|
options: this.options
|
|
@@ -15262,7 +15262,7 @@ var Eo = class {
|
|
|
15262
15262
|
editor: this.editor,
|
|
15263
15263
|
type: ma(e.name, this.schema)
|
|
15264
15264
|
};
|
|
15265
|
-
e.type === "mark" && ((t =
|
|
15265
|
+
e.type === "mark" && ((t = Ce(ne(e, "keepOnSplit", n))) == null || t) && this.splittableMarks.push(e.name);
|
|
15266
15266
|
const i = ne(e, "onBeforeCreate", n), s = ne(e, "onCreate", n), o = ne(e, "onUpdate", n), a = ne(
|
|
15267
15267
|
e,
|
|
15268
15268
|
"onSelectionUpdate",
|
|
@@ -15289,7 +15289,7 @@ i0(K3, {
|
|
|
15289
15289
|
TextDirection: () => wp,
|
|
15290
15290
|
focusEventsPluginKey: () => mp
|
|
15291
15291
|
});
|
|
15292
|
-
var
|
|
15292
|
+
var Te = class up extends f0 {
|
|
15293
15293
|
constructor() {
|
|
15294
15294
|
super(...arguments), this.type = "extension";
|
|
15295
15295
|
}
|
|
@@ -15308,7 +15308,7 @@ var ke = class up extends f0 {
|
|
|
15308
15308
|
const t = typeof e == "function" ? e() : e;
|
|
15309
15309
|
return super.extend(t);
|
|
15310
15310
|
}
|
|
15311
|
-
}, cp =
|
|
15311
|
+
}, cp = Te.create({
|
|
15312
15312
|
name: "clipboardTextSerializer",
|
|
15313
15313
|
addOptions() {
|
|
15314
15314
|
return {
|
|
@@ -15331,14 +15331,14 @@ var ke = class up extends f0 {
|
|
|
15331
15331
|
})
|
|
15332
15332
|
];
|
|
15333
15333
|
}
|
|
15334
|
-
}), dp =
|
|
15334
|
+
}), dp = Te.create({
|
|
15335
15335
|
name: "commands",
|
|
15336
15336
|
addCommands() {
|
|
15337
15337
|
return {
|
|
15338
15338
|
...Wf
|
|
15339
15339
|
};
|
|
15340
15340
|
}
|
|
15341
|
-
}), hp =
|
|
15341
|
+
}), hp = Te.create({
|
|
15342
15342
|
name: "delete",
|
|
15343
15343
|
onUpdate({ transaction: r, appendedTransactions: e }) {
|
|
15344
15344
|
var t, n, i;
|
|
@@ -15394,7 +15394,7 @@ var ke = class up extends f0 {
|
|
|
15394
15394
|
};
|
|
15395
15395
|
(i = (n = (t = this.editor.options.coreExtensionOptions) == null ? void 0 : t.delete) == null ? void 0 : n.async) == null || i ? setTimeout(s, 0) : s();
|
|
15396
15396
|
}
|
|
15397
|
-
}), fp =
|
|
15397
|
+
}), fp = Te.create({
|
|
15398
15398
|
name: "drop",
|
|
15399
15399
|
addProseMirrorPlugins() {
|
|
15400
15400
|
return [
|
|
@@ -15413,7 +15413,7 @@ var ke = class up extends f0 {
|
|
|
15413
15413
|
})
|
|
15414
15414
|
];
|
|
15415
15415
|
}
|
|
15416
|
-
}), pp =
|
|
15416
|
+
}), pp = Te.create({
|
|
15417
15417
|
name: "editable",
|
|
15418
15418
|
addProseMirrorPlugins() {
|
|
15419
15419
|
return [
|
|
@@ -15425,7 +15425,7 @@ var ke = class up extends f0 {
|
|
|
15425
15425
|
})
|
|
15426
15426
|
];
|
|
15427
15427
|
}
|
|
15428
|
-
}), mp = new qe("focusEvents"), gp =
|
|
15428
|
+
}), mp = new qe("focusEvents"), gp = Te.create({
|
|
15429
15429
|
name: "focusEvents",
|
|
15430
15430
|
addProseMirrorPlugins() {
|
|
15431
15431
|
const { editor: r } = this;
|
|
@@ -15449,7 +15449,7 @@ var ke = class up extends f0 {
|
|
|
15449
15449
|
})
|
|
15450
15450
|
];
|
|
15451
15451
|
}
|
|
15452
|
-
}), vp =
|
|
15452
|
+
}), vp = Te.create({
|
|
15453
15453
|
name: "keymap",
|
|
15454
15454
|
addKeyboardShortcuts() {
|
|
15455
15455
|
const r = () => this.editor.commands.first(({ commands: o }) => [
|
|
@@ -15527,7 +15527,7 @@ var ke = class up extends f0 {
|
|
|
15527
15527
|
})
|
|
15528
15528
|
];
|
|
15529
15529
|
}
|
|
15530
|
-
}), yp =
|
|
15530
|
+
}), yp = Te.create({
|
|
15531
15531
|
name: "paste",
|
|
15532
15532
|
addProseMirrorPlugins() {
|
|
15533
15533
|
return [
|
|
@@ -15545,7 +15545,7 @@ var ke = class up extends f0 {
|
|
|
15545
15545
|
})
|
|
15546
15546
|
];
|
|
15547
15547
|
}
|
|
15548
|
-
}), bp =
|
|
15548
|
+
}), bp = Te.create({
|
|
15549
15549
|
name: "tabindex",
|
|
15550
15550
|
addProseMirrorPlugins() {
|
|
15551
15551
|
return [
|
|
@@ -15557,7 +15557,7 @@ var ke = class up extends f0 {
|
|
|
15557
15557
|
})
|
|
15558
15558
|
];
|
|
15559
15559
|
}
|
|
15560
|
-
}), wp =
|
|
15560
|
+
}), wp = Te.create({
|
|
15561
15561
|
name: "textDirection",
|
|
15562
15562
|
addOptions() {
|
|
15563
15563
|
return {
|
|
@@ -16235,7 +16235,7 @@ function Xr(r) {
|
|
|
16235
16235
|
return new h0({
|
|
16236
16236
|
find: r.find,
|
|
16237
16237
|
handler: ({ state: e, range: t, match: n }) => {
|
|
16238
|
-
const i =
|
|
16238
|
+
const i = Ce(r.getAttributes, void 0, n);
|
|
16239
16239
|
if (i === !1 || i === null)
|
|
16240
16240
|
return null;
|
|
16241
16241
|
const { tr: s } = e, o = n[n.length - 1], a = n[0];
|
|
@@ -16255,7 +16255,7 @@ function vl(r) {
|
|
|
16255
16255
|
return new h0({
|
|
16256
16256
|
find: r.find,
|
|
16257
16257
|
handler: ({ state: e, range: t, match: n }) => {
|
|
16258
|
-
const i = e.doc.resolve(t.from), s =
|
|
16258
|
+
const i = e.doc.resolve(t.from), s = Ce(r.getAttributes, void 0, n) || {};
|
|
16259
16259
|
if (!i.node(-1).canReplaceWith(i.index(-1), i.indexAfter(-1), r.type))
|
|
16260
16260
|
return null;
|
|
16261
16261
|
e.tr.delete(t.from, t.to).setBlockType(t.from, t.from, r.type, s);
|
|
@@ -16267,7 +16267,7 @@ function ht(r) {
|
|
|
16267
16267
|
return new h0({
|
|
16268
16268
|
find: r.find,
|
|
16269
16269
|
handler: ({ state: e, range: t, match: n, chain: i }) => {
|
|
16270
|
-
const s =
|
|
16270
|
+
const s = Ce(r.getAttributes, void 0, n) || {}, o = e.tr.delete(t.from, t.to), l = o.doc.resolve(t.from).blockRange(), u = l && Vl(l, r.type, s);
|
|
16271
16271
|
if (!u)
|
|
16272
16272
|
return null;
|
|
16273
16273
|
if (o.wrap(l, u), r.keepMarks && r.editor) {
|
|
@@ -16790,7 +16790,7 @@ function Ao(r) {
|
|
|
16790
16790
|
return new j3({
|
|
16791
16791
|
find: r.find,
|
|
16792
16792
|
handler: ({ state: e, range: t, match: n, pasteEvent: i }) => {
|
|
16793
|
-
const s =
|
|
16793
|
+
const s = Ce(r.getAttributes, void 0, n, i);
|
|
16794
16794
|
if (s === !1 || s === null)
|
|
16795
16795
|
return null;
|
|
16796
16796
|
const { tr: o } = e, a = n[n.length - 1], l = n[0];
|
|
@@ -17418,7 +17418,7 @@ function Tp(r, e) {
|
|
|
17418
17418
|
};
|
|
17419
17419
|
}
|
|
17420
17420
|
const Mp = Tp(!1, !0), Cp = Tp(!0, !0);
|
|
17421
|
-
|
|
17421
|
+
Te.create({
|
|
17422
17422
|
name: "characterCount",
|
|
17423
17423
|
addOptions() {
|
|
17424
17424
|
return {
|
|
@@ -17487,7 +17487,7 @@ ke.create({
|
|
|
17487
17487
|
];
|
|
17488
17488
|
}
|
|
17489
17489
|
});
|
|
17490
|
-
|
|
17490
|
+
Te.create({
|
|
17491
17491
|
name: "dropCursor",
|
|
17492
17492
|
addOptions() {
|
|
17493
17493
|
return {
|
|
@@ -17500,7 +17500,7 @@ ke.create({
|
|
|
17500
17500
|
return [a6(this.options)];
|
|
17501
17501
|
}
|
|
17502
17502
|
});
|
|
17503
|
-
var M6 =
|
|
17503
|
+
var M6 = Te.create({
|
|
17504
17504
|
name: "focus",
|
|
17505
17505
|
addOptions() {
|
|
17506
17506
|
return {
|
|
@@ -17542,7 +17542,7 @@ var M6 = ke.create({
|
|
|
17542
17542
|
})
|
|
17543
17543
|
];
|
|
17544
17544
|
}
|
|
17545
|
-
}), C6 =
|
|
17545
|
+
}), C6 = Te.create({
|
|
17546
17546
|
name: "gapCursor",
|
|
17547
17547
|
addProseMirrorPlugins() {
|
|
17548
17548
|
return [d6()];
|
|
@@ -17555,11 +17555,11 @@ var M6 = ke.create({
|
|
|
17555
17555
|
storage: r.storage
|
|
17556
17556
|
};
|
|
17557
17557
|
return {
|
|
17558
|
-
allowGapCursor: (e =
|
|
17558
|
+
allowGapCursor: (e = Ce(ne(r, "allowGapCursor", t))) != null ? e : null
|
|
17559
17559
|
};
|
|
17560
17560
|
}
|
|
17561
17561
|
});
|
|
17562
|
-
|
|
17562
|
+
Te.create({
|
|
17563
17563
|
name: "placeholder",
|
|
17564
17564
|
addOptions() {
|
|
17565
17565
|
return {
|
|
@@ -17605,7 +17605,7 @@ ke.create({
|
|
|
17605
17605
|
];
|
|
17606
17606
|
}
|
|
17607
17607
|
});
|
|
17608
|
-
|
|
17608
|
+
Te.create({
|
|
17609
17609
|
name: "selection",
|
|
17610
17610
|
addOptions() {
|
|
17611
17611
|
return {
|
|
@@ -17633,7 +17633,7 @@ ke.create({
|
|
|
17633
17633
|
function Mc({ types: r, node: e }) {
|
|
17634
17634
|
return e && Array.isArray(r) && r.includes(e.type) || e?.type === r;
|
|
17635
17635
|
}
|
|
17636
|
-
|
|
17636
|
+
Te.create({
|
|
17637
17637
|
name: "trailingNode",
|
|
17638
17638
|
addOptions() {
|
|
17639
17639
|
return {
|
|
@@ -17668,7 +17668,7 @@ ke.create({
|
|
|
17668
17668
|
];
|
|
17669
17669
|
}
|
|
17670
17670
|
});
|
|
17671
|
-
var E6 =
|
|
17671
|
+
var E6 = Te.create({
|
|
17672
17672
|
name: "undoRedo",
|
|
17673
17673
|
addOptions() {
|
|
17674
17674
|
return {
|
|
@@ -18548,7 +18548,7 @@ var Bc = process.env.NODE_ENV !== "production", bl = typeof window > "u", E7 = b
|
|
|
18548
18548
|
}
|
|
18549
18549
|
};
|
|
18550
18550
|
function O7(r = {}, e = []) {
|
|
18551
|
-
const t =
|
|
18551
|
+
const t = ke(r);
|
|
18552
18552
|
t.current = r;
|
|
18553
18553
|
const [n] = yt(() => new A7(t)), i = Ep.useSyncExternalStore(
|
|
18554
18554
|
n.subscribe,
|
|
@@ -19047,7 +19047,7 @@ var _i = (r, e) => {
|
|
|
19047
19047
|
var t;
|
|
19048
19048
|
const { $anchor: n } = e.selection, i = e.doc.resolve(n.pos - n.parentOffset - 2);
|
|
19049
19049
|
return !(i.index() === i.parent.childCount - 1 || ((t = i.nodeAfter) == null ? void 0 : t.type.name) !== r);
|
|
19050
|
-
}, H7 =
|
|
19050
|
+
}, H7 = Te.create({
|
|
19051
19051
|
name: "listKeymap",
|
|
19052
19052
|
addOptions() {
|
|
19053
19053
|
return {
|
|
@@ -19538,7 +19538,7 @@ var q7 = "listItem", jc = "textStyle", qc = /^(\d+)\.\s$/, Wp = we.create({
|
|
|
19538
19538
|
};
|
|
19539
19539
|
}
|
|
19540
19540
|
});
|
|
19541
|
-
|
|
19541
|
+
Te.create({
|
|
19542
19542
|
name: "listKit",
|
|
19543
19543
|
addExtensions() {
|
|
19544
19544
|
const r = [];
|
|
@@ -31530,7 +31530,7 @@ const G8 = we.create({
|
|
|
31530
31530
|
})
|
|
31531
31531
|
];
|
|
31532
31532
|
}
|
|
31533
|
-
}), n9 =
|
|
31533
|
+
}), n9 = Te.create({
|
|
31534
31534
|
name: "divisions",
|
|
31535
31535
|
addExtensions() {
|
|
31536
31536
|
return [X8, Z8, Q8, e9, t9, r9, Y8];
|
|
@@ -31715,7 +31715,7 @@ const o9 = i9.extend({}), a9 = s9.extend({}), l9 = Vi.create({
|
|
|
31715
31715
|
})
|
|
31716
31716
|
];
|
|
31717
31717
|
}
|
|
31718
|
-
}), h9 =
|
|
31718
|
+
}), h9 = Te.create({
|
|
31719
31719
|
name: "myinline",
|
|
31720
31720
|
addExtensions() {
|
|
31721
31721
|
return [o9, a9, l9, u9, c9, d9];
|
|
@@ -33247,7 +33247,7 @@ const mw = [
|
|
|
33247
33247
|
"proposition",
|
|
33248
33248
|
"claim",
|
|
33249
33249
|
"fact"
|
|
33250
|
-
], gw =
|
|
33250
|
+
], gw = Te.create({
|
|
33251
33251
|
name: "theoremLike",
|
|
33252
33252
|
addExtensions() {
|
|
33253
33253
|
const r = [];
|
|
@@ -33325,7 +33325,7 @@ const mw = [
|
|
|
33325
33325
|
"heuristic",
|
|
33326
33326
|
"hypothesis",
|
|
33327
33327
|
"principle"
|
|
33328
|
-
], yw =
|
|
33328
|
+
], yw = Te.create({
|
|
33329
33329
|
name: "axiomLike",
|
|
33330
33330
|
addExtensions() {
|
|
33331
33331
|
const r = [];
|
|
@@ -33377,7 +33377,7 @@ const mw = [
|
|
|
33377
33377
|
addInputRules() {
|
|
33378
33378
|
return Tr("statement", this.type);
|
|
33379
33379
|
}
|
|
33380
|
-
}), ww = ["example", "question", "problem"], xw =
|
|
33380
|
+
}), ww = ["example", "question", "problem"], xw = Te.create({
|
|
33381
33381
|
name: "exampleLike",
|
|
33382
33382
|
addExtensions() {
|
|
33383
33383
|
const r = [];
|
|
@@ -33485,7 +33485,7 @@ const mw = [
|
|
|
33485
33485
|
"observation",
|
|
33486
33486
|
"remark",
|
|
33487
33487
|
"warning"
|
|
33488
|
-
], kw =
|
|
33488
|
+
], kw = Te.create({
|
|
33489
33489
|
name: "remarkLike",
|
|
33490
33490
|
addExtensions() {
|
|
33491
33491
|
return Sw.map(
|
|
@@ -33551,7 +33551,7 @@ const mw = [
|
|
|
33551
33551
|
})
|
|
33552
33552
|
];
|
|
33553
33553
|
}
|
|
33554
|
-
}), Mw =
|
|
33554
|
+
}), Mw = Te.create({
|
|
33555
33555
|
name: "blocks",
|
|
33556
33556
|
addExtensions() {
|
|
33557
33557
|
return [Tw, gw, xw, yw, kw, bw];
|
|
@@ -35718,7 +35718,7 @@ var Lx = class {
|
|
|
35718
35718
|
key: typeof r.pluginKey == "string" ? new qe(r.pluginKey) : r.pluginKey,
|
|
35719
35719
|
view: (e) => new Lx({ view: e, ...r })
|
|
35720
35720
|
});
|
|
35721
|
-
|
|
35721
|
+
Te.create({
|
|
35722
35722
|
name: "bubbleMenu",
|
|
35723
35723
|
addOptions() {
|
|
35724
35724
|
return {
|
|
@@ -35849,7 +35849,7 @@ var Bx = class {
|
|
|
35849
35849
|
key: typeof r.pluginKey == "string" ? new qe(r.pluginKey) : r.pluginKey,
|
|
35850
35850
|
view: (e) => new Bx({ view: e, ...r })
|
|
35851
35851
|
});
|
|
35852
|
-
|
|
35852
|
+
Te.create({
|
|
35853
35853
|
name: "floatingMenu",
|
|
35854
35854
|
addOptions() {
|
|
35855
35855
|
return {
|
|
@@ -35886,7 +35886,7 @@ var Fx = Be.forwardRef(
|
|
|
35886
35886
|
children: l,
|
|
35887
35887
|
...u
|
|
35888
35888
|
}, c) => {
|
|
35889
|
-
const d =
|
|
35889
|
+
const d = ke(document.createElement("div"));
|
|
35890
35890
|
typeof c == "function" ? c(d.current) : c && (c.current = d.current);
|
|
35891
35891
|
const { editor: f } = Rp(), h = e || f, m = {
|
|
35892
35892
|
updateDelay: t,
|
|
@@ -35896,7 +35896,7 @@ var Fx = Be.forwardRef(
|
|
|
35896
35896
|
shouldShow: s,
|
|
35897
35897
|
getReferencedVirtualElement: o,
|
|
35898
35898
|
options: a
|
|
35899
|
-
}, v =
|
|
35899
|
+
}, v = ke(m);
|
|
35900
35900
|
return v.current = m, He(() => {
|
|
35901
35901
|
if (h?.isDestroyed)
|
|
35902
35902
|
return;
|
|
@@ -35923,7 +35923,7 @@ var Fx = Be.forwardRef(
|
|
|
35923
35923
|
);
|
|
35924
35924
|
Be.forwardRef(
|
|
35925
35925
|
({ pluginKey: r = "floatingMenu", editor: e, appendTo: t, shouldShow: n = null, options: i, children: s, ...o }, a) => {
|
|
35926
|
-
const l =
|
|
35926
|
+
const l = ke(document.createElement("div"));
|
|
35927
35927
|
typeof a == "function" ? a(l.current) : a && (a.current = l.current);
|
|
35928
35928
|
const { editor: u } = Rp();
|
|
35929
35929
|
return He(() => {
|
|
@@ -36309,50 +36309,50 @@ const Wx = we.create({
|
|
|
36309
36309
|
// });
|
|
36310
36310
|
//},
|
|
36311
36311
|
], Gx = ({ content: r, onChange: e }) => {
|
|
36312
|
-
const t =
|
|
36312
|
+
const t = ke(null), n = ke(!1), i = O7({
|
|
36313
36313
|
extensions: Ux,
|
|
36314
|
-
content:
|
|
36315
|
-
onContentError(
|
|
36316
|
-
console.log("Content error: ",
|
|
36314
|
+
content: r,
|
|
36315
|
+
onContentError(l) {
|
|
36316
|
+
console.log("Content error: ", l.error), l.disableCollaboration(), l.editor.setEditable(!1, !1);
|
|
36317
36317
|
},
|
|
36318
36318
|
enableContentCheck: !0,
|
|
36319
|
-
onUpdate: ({ editor:
|
|
36320
|
-
t.current && clearTimeout(t.current), t.current = setTimeout(() => {
|
|
36321
|
-
e(qx(Iw(
|
|
36319
|
+
onUpdate: ({ editor: l }) => {
|
|
36320
|
+
console.log("Editor update detected."), t.current && clearTimeout(t.current), t.current = setTimeout(() => {
|
|
36321
|
+
n.current && e(qx(Iw(l.getJSON())));
|
|
36322
36322
|
}, 500);
|
|
36323
36323
|
}
|
|
36324
36324
|
});
|
|
36325
36325
|
He(() => () => {
|
|
36326
36326
|
t.current && clearTimeout(t.current);
|
|
36327
36327
|
}, []);
|
|
36328
|
-
const
|
|
36328
|
+
const s = ke(!0);
|
|
36329
36329
|
He(() => {
|
|
36330
|
-
if (
|
|
36331
|
-
const
|
|
36332
|
-
if (
|
|
36330
|
+
if (i && r !== i.getHTML() && s.current) {
|
|
36331
|
+
const l = r;
|
|
36332
|
+
if (i)
|
|
36333
36333
|
try {
|
|
36334
|
-
|
|
36334
|
+
i.commands.setContent(fw(l), {
|
|
36335
36335
|
emitUpdate: !1
|
|
36336
|
-
});
|
|
36337
|
-
} catch (
|
|
36338
|
-
console.error("Error setting content: ",
|
|
36336
|
+
}), console.log("External content set in visual editor.");
|
|
36337
|
+
} catch (u) {
|
|
36338
|
+
console.error("Error setting content: ", u);
|
|
36339
36339
|
}
|
|
36340
36340
|
}
|
|
36341
|
-
}, [r,
|
|
36342
|
-
if (!
|
|
36343
|
-
const
|
|
36344
|
-
|
|
36341
|
+
}, [r, i]), He(() => {
|
|
36342
|
+
if (!i) return;
|
|
36343
|
+
const l = () => {
|
|
36344
|
+
s.current = !1;
|
|
36345
36345
|
};
|
|
36346
|
-
return
|
|
36347
|
-
|
|
36346
|
+
return i.on("update", l), () => {
|
|
36347
|
+
i.off("update", l);
|
|
36348
36348
|
};
|
|
36349
|
-
}, [
|
|
36350
|
-
|
|
36349
|
+
}, [i]), He(() => {
|
|
36350
|
+
s.current = !0;
|
|
36351
36351
|
}, [r]);
|
|
36352
|
-
const [
|
|
36352
|
+
const [o, a] = yt(!1);
|
|
36353
36353
|
return He(() => {
|
|
36354
|
-
n &&
|
|
36355
|
-
}, [
|
|
36354
|
+
n.current = o, i && i.setEditable(o, !1);
|
|
36355
|
+
}, [i, o]), /* @__PURE__ */ J.jsxs("div", { className: "pretext-plus-editor__visual-editor", children: [
|
|
36356
36356
|
/* @__PURE__ */ J.jsxs("div", { className: "pretext-plus-editor__visual-editor-header", children: [
|
|
36357
36357
|
/* @__PURE__ */ J.jsx("p", { className: "pretext-plus-editor__visual-editor-title", children: "Simple Preview" }),
|
|
36358
36358
|
/* @__PURE__ */ J.jsxs("label", { className: "pretext-plus-editor__edit-toggle", children: [
|
|
@@ -36361,15 +36361,15 @@ const Wx = we.create({
|
|
|
36361
36361
|
{
|
|
36362
36362
|
className: "pretext-plus-editor__edit-checkbox",
|
|
36363
36363
|
type: "checkbox",
|
|
36364
|
-
checked:
|
|
36365
|
-
onChange: () =>
|
|
36364
|
+
checked: o,
|
|
36365
|
+
onChange: () => a(!o)
|
|
36366
36366
|
}
|
|
36367
36367
|
),
|
|
36368
36368
|
"Edit"
|
|
36369
36369
|
] })
|
|
36370
36370
|
] }),
|
|
36371
|
-
/* @__PURE__ */ J.jsx("div", { className: (
|
|
36372
|
-
/* @__PURE__ */ J.jsx($x, { editor:
|
|
36371
|
+
/* @__PURE__ */ J.jsx("div", { className: (o ? "editable" : "read-only") + " ptx-page", children: /* @__PURE__ */ J.jsx(T7, { editor: i }) }),
|
|
36372
|
+
/* @__PURE__ */ J.jsx($x, { editor: i })
|
|
36373
36373
|
] });
|
|
36374
36374
|
}, Kx = (r, e, t) => {
|
|
36375
36375
|
const n = document.createElement("form");
|
|
@@ -36381,7 +36381,7 @@ const Wx = we.create({
|
|
|
36381
36381
|
}
|
|
36382
36382
|
document.body.appendChild(n), n.submit(), n.remove();
|
|
36383
36383
|
}, Jx = ({ content: r, title: e, onRebuild: t }) => {
|
|
36384
|
-
const [n, i] = yt(!1), s =
|
|
36384
|
+
const [n, i] = yt(!1), s = ke(null);
|
|
36385
36385
|
He(() => {
|
|
36386
36386
|
o();
|
|
36387
36387
|
}, []);
|
|
@@ -36497,6 +36497,7 @@ const Wx = we.create({
|
|
|
36497
36497
|
] })
|
|
36498
36498
|
] });
|
|
36499
36499
|
}, Xx = `
|
|
36500
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
36500
36501
|
<section>
|
|
36501
36502
|
<title>My Section</title>
|
|
36502
36503
|
<p>
|