erl-mathtextx-editor 0.1.6 → 0.1.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/README.md +253 -251
- package/dist/{CellPropertiesDialogImpl-CHemDwqM.js → CellPropertiesDialogImpl-HPT77uxM.js} +1 -1
- package/dist/{ContentViewer-CsFSAN_B.js → ContentViewer-CWZ30KYR.js} +15 -15
- package/dist/ImageInsertDialog-DzLFhSDK.js +217 -0
- package/dist/{InsertTableDialogImpl-65qn7ajF.js → InsertTableDialogImpl-DZrLgDKN.js} +1 -1
- package/dist/{LinkDialogImpl-BXNEtesu.js → LinkDialogImpl-DTHugWZM.js} +45 -60
- package/dist/{TableTemplatesDialogImpl-Djt0R6Hh.js → TableTemplatesDialogImpl-D0sFSAKl.js} +1 -1
- package/dist/assets/erl-mathtextx-editor.css +1 -1
- package/dist/assets/viewer.css +1 -1
- package/dist/erl-mathtextx-editor.js +2 -2
- package/dist/erl-mathtextx-editor.umd.cjs +131 -131
- package/dist/{index-wMMXFiRr.js → index-Ci20X1Rj.js} +454 -478
- package/dist/viewer.js +1 -1
- package/package.json +133 -133
- package/dist/ImageInsertDialog-CJPVdXtW.js +0 -238
- package/dist/math/MathFieldView.d.ts +0 -5
- package/dist/utils/logger.d.ts +0 -46
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import re, { useRef as z, useState as M, useEffect as $, useCallback as b, useMemo as fe, lazy as de, Suspense as me, useId as
|
|
3
|
-
import { N as
|
|
4
|
-
import "./ContentViewer-
|
|
5
|
-
function
|
|
2
|
+
import re, { useRef as z, useState as M, useEffect as $, useCallback as b, useMemo as fe, lazy as de, Suspense as me, useId as Pa } from "react";
|
|
3
|
+
import { N as Xe, a as Ue, R as Re, m as Ce, E as Ye, T as Sa, A as La, b as Da, c as Ba, d as za, U as Ia, S as Ea, e as Ra, f as Va, C as Ka, g as Fa, h as qa, i as Oa, j as $a, k as Ga, F as Wa, l as ja, H as Xa, L as Ua, I as Ya, P as Ja, n as Qa, u as Za, o as et } from "./tiptap-Bc1mIOtx.js";
|
|
4
|
+
import "./ContentViewer-CWZ30KYR.js";
|
|
5
|
+
function Qe(l) {
|
|
6
6
|
const a = l.closest(".mtx-content");
|
|
7
7
|
if (!a)
|
|
8
8
|
return "left";
|
|
9
9
|
const n = l.getBoundingClientRect(), i = a.getBoundingClientRect(), c = (n.left + n.width / 2 - i.left) / Math.max(i.width, 1), r = 0.38, m = 0.62;
|
|
10
10
|
return c <= r ? "left" : c >= m ? "right" : "center";
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Ze(l, a) {
|
|
13
13
|
if (l == null || l === "")
|
|
14
14
|
return a;
|
|
15
15
|
if (typeof l == "number")
|
|
@@ -17,84 +17,84 @@ function aa(l, a) {
|
|
|
17
17
|
const n = l.trim();
|
|
18
18
|
return n ? n === "auto" || n.endsWith("%") || n.endsWith("px") ? n : /^\d+(\.\d+)?$/.test(n) ? `${Math.round(Number(n))}px` : n : a;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function at(l) {
|
|
21
21
|
const { node: a, updateAttributes: n, selected: i, getPos: o, editor: c } = l, r = a.attrs, m = z(null), f = z(!1), w = z(null), g = z({ x: 0, y: 0, width: 0, height: 0 }), p = z(r), h = z(() => {
|
|
22
22
|
}), s = z(!1), d = z({ x: 0, y: 0, offsetX: 0, offsetY: 0 }), B = z(() => {
|
|
23
|
-
}), x = z(null), v = z(null), T = z({ x: Number(r.offsetX || 0), y: Number(r.offsetY || 0) }),
|
|
23
|
+
}), x = z(null), v = z(null), T = z({ x: Number(r.offsetX || 0), y: Number(r.offsetY || 0) }), I = z(r.align === "full" ? "center" : r.align || "center"), L = z({ width: 0, height: 0 }), Z = z(null), X = z(null), te = z(null), [ve, ee] = M(!1), [se, _e] = M(!1), [C, G] = M(null), [ce, we] = M(!1), [, ae] = M(0);
|
|
24
24
|
$(() => {
|
|
25
25
|
p.current = r, T.current = {
|
|
26
26
|
x: Number(r.offsetX || 0),
|
|
27
27
|
y: Number(r.offsetY || 0)
|
|
28
|
-
},
|
|
28
|
+
}, I.current = r.align === "full" ? "center" : r.align || "center";
|
|
29
29
|
}, [r]), $(() => {
|
|
30
30
|
if (!ce) return;
|
|
31
31
|
const N = window.setTimeout(() => {
|
|
32
|
-
|
|
32
|
+
we(!1);
|
|
33
33
|
}, 180);
|
|
34
34
|
return () => window.clearTimeout(N);
|
|
35
35
|
}, [ce]);
|
|
36
36
|
const he = b(() => {
|
|
37
|
-
|
|
38
|
-
}, []),
|
|
37
|
+
X.current?.remove(), te.current?.remove(), X.current = null, te.current = null;
|
|
38
|
+
}, []), ye = b(() => {
|
|
39
39
|
const N = m.current;
|
|
40
40
|
if (!N) return null;
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
43
|
-
const q =
|
|
41
|
+
const E = N.closest(".mtx-content");
|
|
42
|
+
if (!E) return null;
|
|
43
|
+
const q = E.closest(".mtx-editor") || E;
|
|
44
44
|
if (Z.current = q, !te.current) {
|
|
45
45
|
const R = document.createElement("div");
|
|
46
46
|
R.className = "mtx-image-drag-zone", R.setAttribute("aria-hidden", "true"), q.appendChild(R), te.current = R;
|
|
47
47
|
}
|
|
48
|
-
if (!
|
|
48
|
+
if (!X.current) {
|
|
49
49
|
const R = document.createElement("div");
|
|
50
|
-
R.className = "mtx-image-drag-guide", R.setAttribute("aria-hidden", "true"), q.appendChild(R),
|
|
50
|
+
R.className = "mtx-image-drag-guide", R.setAttribute("aria-hidden", "true"), q.appendChild(R), X.current = R;
|
|
51
51
|
}
|
|
52
|
-
return { wrapper: N, editorContent:
|
|
52
|
+
return { wrapper: N, editorContent: E, host: q };
|
|
53
53
|
}, []), ue = b((N) => {
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
56
|
-
const { editorContent: K, host: q } =
|
|
54
|
+
const E = ye();
|
|
55
|
+
if (!E) return;
|
|
56
|
+
const { editorContent: K, host: q } = E, R = q.getBoundingClientRect(), j = K.getBoundingClientRect(), U = j.left - R.left, ge = j.top - R.top, ke = j.width, De = j.height, be = te.current, le = X.current;
|
|
57
57
|
if (!be || !le) return;
|
|
58
|
-
be.className = "mtx-image-drag-zone", le.className = "mtx-image-drag-guide", be.style.left = `${Math.round(U)}px`, be.style.top = `${Math.round(ge)}px`, be.style.width = `${Math.round(
|
|
59
|
-
const
|
|
60
|
-
le.style.left = `${Math.round(
|
|
61
|
-
}, [
|
|
58
|
+
be.className = "mtx-image-drag-zone", le.className = "mtx-image-drag-guide", be.style.left = `${Math.round(U)}px`, be.style.top = `${Math.round(ge)}px`, be.style.width = `${Math.round(ke)}px`, be.style.height = `${Math.round(De)}px`, le.style.left = `${Math.round(U)}px`, le.style.top = `${Math.round(ge)}px`, le.style.width = `${Math.round(ke)}px`, le.style.height = `${Math.round(De)}px`, le.style.borderLeft = "2px dashed rgba(37, 99, 235, 0.5)", le.style.transform = "translateX(-50%)";
|
|
59
|
+
const Ve = N === "left" ? U + ke * 0.33 : N === "right" ? U + ke * 0.66 : U + ke * 0.5;
|
|
60
|
+
le.style.left = `${Math.round(Ve)}px`;
|
|
61
|
+
}, [ye]);
|
|
62
62
|
$(() => () => {
|
|
63
63
|
he();
|
|
64
64
|
}, [he]);
|
|
65
65
|
const O = b((N) => {
|
|
66
|
-
const
|
|
67
|
-
if (!f.current || !
|
|
66
|
+
const E = m.current, K = w.current;
|
|
67
|
+
if (!f.current || !E || !K)
|
|
68
68
|
return;
|
|
69
69
|
const q = N.clientX - g.current.x, R = N.clientY - g.current.y;
|
|
70
|
-
let
|
|
71
|
-
K.includes("e") ?
|
|
72
|
-
width: Math.round(
|
|
70
|
+
let j = g.current.width, U = g.current.height;
|
|
71
|
+
K.includes("e") ? j = Math.max(50, g.current.width + q) : K.includes("w") && (j = Math.max(50, g.current.width - q)), K.includes("s") ? U = Math.max(50, g.current.height + R) : K.includes("n") && (U = Math.max(50, g.current.height - R)), v.current = {
|
|
72
|
+
width: Math.round(j),
|
|
73
73
|
height: Math.round(U)
|
|
74
74
|
}, x.current === null && (x.current = window.requestAnimationFrame(() => {
|
|
75
75
|
const ge = v.current;
|
|
76
|
-
if (!
|
|
76
|
+
if (!E || !ge) {
|
|
77
77
|
x.current = null;
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
E.style.width = `${ge.width}px`, p.current.height && p.current.height !== "auto" && (E.style.height = `${ge.height}px`), x.current = null;
|
|
81
81
|
}));
|
|
82
|
-
}, []),
|
|
82
|
+
}, []), Ae = b(() => {
|
|
83
83
|
const N = m.current;
|
|
84
84
|
if (!f.current || !N)
|
|
85
85
|
return;
|
|
86
|
-
const
|
|
86
|
+
const E = N.offsetWidth, K = N.offsetHeight;
|
|
87
87
|
n({
|
|
88
|
-
width: Math.round(
|
|
88
|
+
width: Math.round(E),
|
|
89
89
|
height: p.current.height === "auto" ? "auto" : Math.round(K)
|
|
90
90
|
}), f.current = !1, w.current = null, ee(!1), v.current = null, window.removeEventListener("mousemove", O), window.removeEventListener("mouseup", h.current);
|
|
91
91
|
}, [O, n]);
|
|
92
92
|
$(() => {
|
|
93
|
-
h.current =
|
|
94
|
-
}, [
|
|
93
|
+
h.current = Ae;
|
|
94
|
+
}, [Ae]);
|
|
95
95
|
const oe = b((N) => {
|
|
96
|
-
const
|
|
97
|
-
if (!s.current || !
|
|
96
|
+
const E = m.current;
|
|
97
|
+
if (!s.current || !E)
|
|
98
98
|
return;
|
|
99
99
|
const K = d.current.offsetX + (N.clientX - d.current.x), q = d.current.offsetY + (N.clientY - d.current.y);
|
|
100
100
|
T.current = {
|
|
@@ -104,26 +104,26 @@ function lt(l) {
|
|
|
104
104
|
const R = m.current;
|
|
105
105
|
if (R) {
|
|
106
106
|
R.style.transform = `translate3d(${T.current.x}px, ${T.current.y}px, 0)`;
|
|
107
|
-
const
|
|
108
|
-
|
|
107
|
+
const j = Qe(R);
|
|
108
|
+
j !== I.current && (I.current = j, G(j), ae((U) => U + 1)), ue(I.current);
|
|
109
109
|
}
|
|
110
110
|
x.current = null;
|
|
111
111
|
}));
|
|
112
|
-
}, [ue]),
|
|
112
|
+
}, [ue]), Ne = b(() => {
|
|
113
113
|
const N = m.current;
|
|
114
114
|
if (!s.current || !N)
|
|
115
115
|
return;
|
|
116
|
-
const
|
|
117
|
-
s.current = !1,
|
|
118
|
-
align:
|
|
116
|
+
const E = I.current || Qe(N);
|
|
117
|
+
s.current = !1, _e(!1), G(null), we(!0), he(), n({
|
|
118
|
+
align: E,
|
|
119
119
|
offsetX: 0,
|
|
120
120
|
offsetY: 0
|
|
121
121
|
}), N.style.transform = "translate3d(0px, 0px, 0)", T.current = { x: 0, y: 0 }, window.removeEventListener("mousemove", oe), window.removeEventListener("mouseup", B.current);
|
|
122
122
|
}, [oe, he, n]);
|
|
123
123
|
$(() => {
|
|
124
|
-
B.current =
|
|
125
|
-
}, [
|
|
126
|
-
const J = b((N,
|
|
124
|
+
B.current = Ne;
|
|
125
|
+
}, [Ne]);
|
|
126
|
+
const J = b((N, E) => {
|
|
127
127
|
N.preventDefault(), N.stopPropagation();
|
|
128
128
|
const K = m.current;
|
|
129
129
|
if (!K)
|
|
@@ -134,7 +134,7 @@ function lt(l) {
|
|
|
134
134
|
y: N.clientY,
|
|
135
135
|
width: q.width,
|
|
136
136
|
height: q.height
|
|
137
|
-
}, f.current = !0, w.current =
|
|
137
|
+
}, f.current = !0, w.current = E, ee(!0), window.addEventListener("mousemove", O), window.addEventListener("mouseup", h.current);
|
|
138
138
|
}, [O]), y = b((N) => {
|
|
139
139
|
if (N.button !== 0 || f.current || N.target.closest(".mtx-image-resize-handles"))
|
|
140
140
|
return;
|
|
@@ -151,7 +151,7 @@ function lt(l) {
|
|
|
151
151
|
align: "left",
|
|
152
152
|
offsetX: 0,
|
|
153
153
|
offsetY: 0
|
|
154
|
-
}),
|
|
154
|
+
}), I.current = p.current.align === "full" ? "center" : p.current.align || "center", G(I.current), ue(I.current), d.current = {
|
|
155
155
|
x: N.clientX,
|
|
156
156
|
y: N.clientY,
|
|
157
157
|
offsetX: Number(p.current.offsetX || 0),
|
|
@@ -164,14 +164,14 @@ function lt(l) {
|
|
|
164
164
|
}), T.current = {
|
|
165
165
|
x: d.current.offsetX,
|
|
166
166
|
y: d.current.offsetY
|
|
167
|
-
}, s.current = !0,
|
|
167
|
+
}, s.current = !0, _e(!0), window.addEventListener("mousemove", oe), window.addEventListener("mouseup", B.current);
|
|
168
168
|
}, [c.commands, o, oe, n, ue]);
|
|
169
169
|
$(() => () => {
|
|
170
170
|
x.current !== null && window.cancelAnimationFrame(x.current), window.removeEventListener("mousemove", O), window.removeEventListener("mouseup", h.current), window.removeEventListener("mousemove", oe), window.removeEventListener("mouseup", B.current);
|
|
171
171
|
}, [oe, O]);
|
|
172
|
-
const k = `mtx-image--${r.align || "center"}`, D =
|
|
172
|
+
const k = `mtx-image--${r.align || "center"}`, D = Ze(r.width, "auto"), F = Ze(r.height, "auto"), xe = C ? `mtx-image-snap-preview--${C}` : "";
|
|
173
173
|
return /* @__PURE__ */ e(
|
|
174
|
-
|
|
174
|
+
Xe,
|
|
175
175
|
{
|
|
176
176
|
as: "figure",
|
|
177
177
|
className: `mtx-image-figure ${k} ${i ? "mtx-image--selected" : ""} ${se ? "mtx-image--dragging" : ""} ${ce ? "mtx-image--snap-animating" : ""} ${xe}`,
|
|
@@ -190,8 +190,8 @@ function lt(l) {
|
|
|
190
190
|
verticalAlign: "top",
|
|
191
191
|
transform: `translate3d(${Number(r.offsetX || 0)}px, ${Number(r.offsetY || 0)}px, 0)`,
|
|
192
192
|
cursor: i ? se ? "grabbing" : "grab" : "default",
|
|
193
|
-
willChange: se ? "transform" :
|
|
194
|
-
contain:
|
|
193
|
+
willChange: se ? "transform" : ve ? "width, height" : "auto",
|
|
194
|
+
contain: ve ? "layout style" : "none"
|
|
195
195
|
},
|
|
196
196
|
onMouseDown: y,
|
|
197
197
|
children: [
|
|
@@ -221,45 +221,14 @@ function lt(l) {
|
|
|
221
221
|
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--s", onMouseDown: (N) => J(N, "s") }),
|
|
222
222
|
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--w", onMouseDown: (N) => J(N, "w") })
|
|
223
223
|
] }),
|
|
224
|
-
|
|
224
|
+
ve && /* @__PURE__ */ e("div", { className: "mtx-image-resize-overlay" })
|
|
225
225
|
]
|
|
226
226
|
}
|
|
227
227
|
)
|
|
228
228
|
}
|
|
229
229
|
);
|
|
230
230
|
}
|
|
231
|
-
const
|
|
232
|
-
try {
|
|
233
|
-
nt?.MODE;
|
|
234
|
-
} catch {
|
|
235
|
-
}
|
|
236
|
-
return !!(typeof window < "u" && window.__DEV__);
|
|
237
|
-
})(), Ee = it, ve = {
|
|
238
|
-
/**
|
|
239
|
-
* Log error messages. In production, consider sending to error tracking service.
|
|
240
|
-
*/
|
|
241
|
-
error: (l, a) => {
|
|
242
|
-
Ee && console.error(`[MathTextX Editor] ${l}`, a);
|
|
243
|
-
},
|
|
244
|
-
/**
|
|
245
|
-
* Log warning messages.
|
|
246
|
-
*/
|
|
247
|
-
warn: (l, a) => {
|
|
248
|
-
Ee && console.warn(`[MathTextX Editor] ${l}`, a);
|
|
249
|
-
},
|
|
250
|
-
/**
|
|
251
|
-
* Log informational messages (uses warn in dev to comply with ESLint rules).
|
|
252
|
-
*/
|
|
253
|
-
info: (l, a) => {
|
|
254
|
-
Ee && console.warn(`[MathTextX Editor] INFO: ${l}`, a);
|
|
255
|
-
},
|
|
256
|
-
/**
|
|
257
|
-
* Log debug messages (verbose logging for development, uses warn in dev).
|
|
258
|
-
*/
|
|
259
|
-
debug: (l, a) => {
|
|
260
|
-
Ee && console.warn(`[MathTextX Editor] DEBUG: ${l}`, a);
|
|
261
|
-
}
|
|
262
|
-
}, rt = ({ node: l, updateAttributes: a }) => {
|
|
231
|
+
const tt = ({ node: l, updateAttributes: a }) => {
|
|
263
232
|
const n = z(null), [i, o] = M(l.attrs.formula || "sin(x)"), [c, r] = M(l.attrs.xDomain || [-10, 10]), [m, f] = M(l.attrs.yDomain || [-5, 5]);
|
|
264
233
|
$(() => {
|
|
265
234
|
let p = !0;
|
|
@@ -284,9 +253,9 @@ const nt = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, it
|
|
|
284
253
|
disableZoom: !1
|
|
285
254
|
});
|
|
286
255
|
} catch (d) {
|
|
287
|
-
|
|
256
|
+
console.error("Graph rendering error:", d);
|
|
288
257
|
}
|
|
289
|
-
}).catch((h) =>
|
|
258
|
+
}).catch((h) => console.error("Failed to load function-plot", h)), () => {
|
|
290
259
|
p = !1;
|
|
291
260
|
};
|
|
292
261
|
}, [i, c, m]);
|
|
@@ -295,7 +264,7 @@ const nt = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, it
|
|
|
295
264
|
}, g = () => {
|
|
296
265
|
a({ formula: i, xDomain: c, yDomain: m });
|
|
297
266
|
};
|
|
298
|
-
return /* @__PURE__ */ t(
|
|
267
|
+
return /* @__PURE__ */ t(Xe, { className: "mtx-graph-component", children: [
|
|
299
268
|
/* @__PURE__ */ t("div", { className: "mtx-graph-controls", children: [
|
|
300
269
|
/* @__PURE__ */ e(
|
|
301
270
|
"input",
|
|
@@ -325,7 +294,7 @@ const nt = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, it
|
|
|
325
294
|
] }),
|
|
326
295
|
/* @__PURE__ */ e("div", { ref: n, className: "mtx-graph-render" })
|
|
327
296
|
] });
|
|
328
|
-
},
|
|
297
|
+
}, lt = Ue.create({
|
|
329
298
|
name: "graph",
|
|
330
299
|
group: "block",
|
|
331
300
|
atom: !0,
|
|
@@ -350,10 +319,10 @@ const nt = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, it
|
|
|
350
319
|
];
|
|
351
320
|
},
|
|
352
321
|
renderHTML({ HTMLAttributes: l }) {
|
|
353
|
-
return ["div",
|
|
322
|
+
return ["div", Ce(l, { "data-type": "graph" })];
|
|
354
323
|
},
|
|
355
324
|
addNodeView() {
|
|
356
|
-
return
|
|
325
|
+
return Re(tt);
|
|
357
326
|
},
|
|
358
327
|
addCommands() {
|
|
359
328
|
return {
|
|
@@ -365,7 +334,7 @@ const nt = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, it
|
|
|
365
334
|
})
|
|
366
335
|
};
|
|
367
336
|
}
|
|
368
|
-
}),
|
|
337
|
+
}), Fe = "tt-indent-", nt = Ye.create({
|
|
369
338
|
name: "indent",
|
|
370
339
|
addOptions() {
|
|
371
340
|
return {
|
|
@@ -382,14 +351,14 @@ const nt = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, it
|
|
|
382
351
|
indent: {
|
|
383
352
|
default: null,
|
|
384
353
|
renderHTML: (l) => l.indent ? l.indent > this.options.minLevel ? {
|
|
385
|
-
class: `${
|
|
354
|
+
class: `${Fe}${l.indent}`
|
|
386
355
|
} : {} : {},
|
|
387
356
|
parseHTML: (l) => {
|
|
388
357
|
let a = "";
|
|
389
358
|
if (l.classList.forEach((n) => {
|
|
390
|
-
n.indexOf(
|
|
359
|
+
n.indexOf(Fe) === 0 && (a = n);
|
|
391
360
|
}), a) {
|
|
392
|
-
const n = parseInt(a.slice(
|
|
361
|
+
const n = parseInt(a.slice(Fe.length), 10);
|
|
393
362
|
return n && n > this.options.minLevel ? n : null;
|
|
394
363
|
}
|
|
395
364
|
return null;
|
|
@@ -414,7 +383,7 @@ const nt = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, it
|
|
|
414
383
|
return i;
|
|
415
384
|
}, a = (i, o) => {
|
|
416
385
|
const { doc: c, selection: r } = i;
|
|
417
|
-
if (c && r && (r instanceof
|
|
386
|
+
if (c && r && (r instanceof Sa || r instanceof La)) {
|
|
418
387
|
const { from: m, to: f } = r;
|
|
419
388
|
c.nodesBetween(m, f, (w, g) => this.options.types.includes(w.type.name) ? (i = l(i, g, o), !1) : !0);
|
|
420
389
|
}
|
|
@@ -434,7 +403,7 @@ const nt = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, it
|
|
|
434
403
|
"Shift-Tab": () => this.editor.commands.outdent()
|
|
435
404
|
};
|
|
436
405
|
}
|
|
437
|
-
}),
|
|
406
|
+
}), it = ["plain", "light", "dark", "blue", "striped", "minimal"], qe = ["paragraph", "listItem", "taskItem"], rt = Ye.create({
|
|
438
407
|
name: "indentBackspace",
|
|
439
408
|
addKeyboardShortcuts() {
|
|
440
409
|
return {
|
|
@@ -443,26 +412,26 @@ const nt = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, it
|
|
|
443
412
|
if (!a || n.parentOffset !== 0)
|
|
444
413
|
return !1;
|
|
445
414
|
const i = n.parent.type.name;
|
|
446
|
-
return
|
|
415
|
+
return !qe.includes(i) || !l.can().outdent() ? !1 : l.commands.outdent();
|
|
447
416
|
},
|
|
448
417
|
Tab: () => {
|
|
449
418
|
const { editor: l } = this, { empty: a, $from: n } = l.state.selection;
|
|
450
419
|
if (!a)
|
|
451
420
|
return !1;
|
|
452
421
|
const i = n.parent.type.name;
|
|
453
|
-
return
|
|
422
|
+
return !qe.includes(i) || !l.can().indent() ? !1 : l.commands.indent();
|
|
454
423
|
},
|
|
455
424
|
"Shift-Tab": () => {
|
|
456
425
|
const { editor: l } = this, { empty: a, $from: n } = l.state.selection;
|
|
457
426
|
if (!a)
|
|
458
427
|
return !1;
|
|
459
428
|
const i = n.parent.type.name;
|
|
460
|
-
return
|
|
429
|
+
return !qe.includes(i) || !l.can().outdent() ? !1 : l.commands.outdent();
|
|
461
430
|
}
|
|
462
431
|
};
|
|
463
432
|
}
|
|
464
433
|
});
|
|
465
|
-
function
|
|
434
|
+
function ua(l) {
|
|
466
435
|
const a = [];
|
|
467
436
|
if (l.backgroundColor && a.push(`background-color: ${String(l.backgroundColor)}`), l.textAlign && a.push(`text-align: ${String(l.textAlign)}`), l.verticalAlign) {
|
|
468
437
|
const n = l.verticalAlign === "middle" ? "middle" : String(l.verticalAlign);
|
|
@@ -470,7 +439,7 @@ function ga(l) {
|
|
|
470
439
|
}
|
|
471
440
|
return l.width && a.push(`width: ${String(l.width)}`), a.join("; ");
|
|
472
441
|
}
|
|
473
|
-
function
|
|
442
|
+
function ea(l) {
|
|
474
443
|
if (l == null || l === "")
|
|
475
444
|
return null;
|
|
476
445
|
if (typeof l == "number")
|
|
@@ -478,14 +447,14 @@ function ta(l) {
|
|
|
478
447
|
const a = String(l).trim();
|
|
479
448
|
return a ? a === "auto" || a.endsWith("%") || a.endsWith("px") ? a : /^\d+(\.\d+)?$/.test(a) ? `${Math.round(Number(a))}px` : a : null;
|
|
480
449
|
}
|
|
481
|
-
const
|
|
450
|
+
const st = Da.extend({
|
|
482
451
|
addAttributes() {
|
|
483
452
|
return {
|
|
484
453
|
theme: {
|
|
485
454
|
default: "plain",
|
|
486
455
|
parseHTML: (l) => {
|
|
487
456
|
const a = l;
|
|
488
|
-
return
|
|
457
|
+
return it.find((n) => a.classList.contains(`mtx-table--${n}`)) || "plain";
|
|
489
458
|
},
|
|
490
459
|
renderHTML: () => ({})
|
|
491
460
|
}
|
|
@@ -495,13 +464,13 @@ const dt = za.extend({
|
|
|
495
464
|
const a = typeof l.theme == "string" ? l.theme : "plain", { theme: n, class: i, ...o } = l;
|
|
496
465
|
return [
|
|
497
466
|
"table",
|
|
498
|
-
|
|
467
|
+
Ce(o, {
|
|
499
468
|
class: ["mtx-table", i, `mtx-table--${a}`].filter(Boolean).join(" ")
|
|
500
469
|
}),
|
|
501
470
|
["tbody", 0]
|
|
502
471
|
];
|
|
503
472
|
}
|
|
504
|
-
}),
|
|
473
|
+
}), ct = Ba.extend({
|
|
505
474
|
addAttributes() {
|
|
506
475
|
return {
|
|
507
476
|
...this.parent?.(),
|
|
@@ -528,10 +497,10 @@ const dt = za.extend({
|
|
|
528
497
|
};
|
|
529
498
|
},
|
|
530
499
|
renderHTML({ HTMLAttributes: l }) {
|
|
531
|
-
const a =
|
|
532
|
-
return ["td",
|
|
500
|
+
const a = ua(l), { backgroundColor: n, textAlign: i, verticalAlign: o, width: c, ...r } = l;
|
|
501
|
+
return ["td", Ce(r, a ? { style: a } : {}), 0];
|
|
533
502
|
}
|
|
534
|
-
}),
|
|
503
|
+
}), ot = za.extend({
|
|
535
504
|
addAttributes() {
|
|
536
505
|
return {
|
|
537
506
|
...this.parent?.(),
|
|
@@ -558,13 +527,13 @@ const dt = za.extend({
|
|
|
558
527
|
};
|
|
559
528
|
},
|
|
560
529
|
renderHTML({ HTMLAttributes: l }) {
|
|
561
|
-
const a =
|
|
562
|
-
return ["th",
|
|
530
|
+
const a = ua(l), { backgroundColor: n, textAlign: i, verticalAlign: o, width: c, ...r } = l;
|
|
531
|
+
return ["th", Ce(r, a ? { style: a } : {}), 0];
|
|
563
532
|
}
|
|
564
533
|
});
|
|
565
|
-
function
|
|
534
|
+
function mt(l = {}) {
|
|
566
535
|
return [
|
|
567
|
-
|
|
536
|
+
Oa.configure({
|
|
568
537
|
heading: {
|
|
569
538
|
levels: [1, 2, 3, 4]
|
|
570
539
|
},
|
|
@@ -579,44 +548,44 @@ function ut(l = {}) {
|
|
|
579
548
|
}
|
|
580
549
|
}
|
|
581
550
|
}),
|
|
551
|
+
Ia,
|
|
552
|
+
Ea,
|
|
582
553
|
Ra,
|
|
583
|
-
|
|
584
|
-
Ka,
|
|
585
|
-
Wa.configure({
|
|
554
|
+
$a.configure({
|
|
586
555
|
HTMLAttributes: {
|
|
587
556
|
class: "mtx-task-list"
|
|
588
557
|
}
|
|
589
558
|
}),
|
|
590
|
-
|
|
559
|
+
Ga.configure({
|
|
591
560
|
nested: !0,
|
|
592
561
|
HTMLAttributes: {
|
|
593
562
|
class: "mtx-task-item"
|
|
594
563
|
}
|
|
595
564
|
}),
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
565
|
+
Va,
|
|
566
|
+
Ka,
|
|
567
|
+
Wa.configure({
|
|
599
568
|
types: ["textStyle"]
|
|
600
569
|
}),
|
|
601
|
-
|
|
570
|
+
ja.configure({
|
|
602
571
|
types: ["heading", "paragraph"],
|
|
603
572
|
alignments: ["left", "center", "right", "justify"],
|
|
604
573
|
defaultAlignment: "left"
|
|
605
574
|
}),
|
|
606
|
-
|
|
575
|
+
Xa.configure({
|
|
607
576
|
multicolor: !0,
|
|
608
577
|
HTMLAttributes: {
|
|
609
578
|
class: "mtx-highlight"
|
|
610
579
|
}
|
|
611
580
|
}),
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
581
|
+
Fa,
|
|
582
|
+
rt,
|
|
583
|
+
nt.configure({
|
|
615
584
|
types: ["paragraph", "listItem", "taskItem"],
|
|
616
585
|
minLevel: 0,
|
|
617
586
|
maxLevel: 7
|
|
618
587
|
}),
|
|
619
|
-
|
|
588
|
+
Ua.configure({
|
|
620
589
|
openOnClick: !1,
|
|
621
590
|
autolink: !0,
|
|
622
591
|
HTMLAttributes: {
|
|
@@ -625,7 +594,7 @@ function ut(l = {}) {
|
|
|
625
594
|
target: "_blank"
|
|
626
595
|
}
|
|
627
596
|
}),
|
|
628
|
-
|
|
597
|
+
Ya.extend({
|
|
629
598
|
parseHTML() {
|
|
630
599
|
return [
|
|
631
600
|
{
|
|
@@ -668,7 +637,7 @@ function ut(l = {}) {
|
|
|
668
637
|
];
|
|
669
638
|
},
|
|
670
639
|
addNodeView() {
|
|
671
|
-
return
|
|
640
|
+
return Re(at);
|
|
672
641
|
},
|
|
673
642
|
addAttributes() {
|
|
674
643
|
return {
|
|
@@ -709,7 +678,7 @@ function ut(l = {}) {
|
|
|
709
678
|
offsetX: f = 0,
|
|
710
679
|
offsetY: w = 0,
|
|
711
680
|
...g
|
|
712
|
-
} = a, p =
|
|
681
|
+
} = a, p = ea(c), h = ea(r), s = Ce(g, {
|
|
713
682
|
src: n,
|
|
714
683
|
alt: i,
|
|
715
684
|
title: o,
|
|
@@ -734,25 +703,25 @@ function ut(l = {}) {
|
|
|
734
703
|
class: "mtx-image"
|
|
735
704
|
}
|
|
736
705
|
}),
|
|
737
|
-
|
|
706
|
+
st.configure({
|
|
738
707
|
resizable: !0,
|
|
739
708
|
HTMLAttributes: {
|
|
740
709
|
class: "mtx-table"
|
|
741
710
|
}
|
|
742
711
|
}),
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
712
|
+
qa,
|
|
713
|
+
ct,
|
|
714
|
+
ot,
|
|
715
|
+
Ja.configure({
|
|
747
716
|
placeholder: l.placeholder || "Tulis soal di sini...",
|
|
748
717
|
emptyEditorClass: "mtx-placeholder"
|
|
749
718
|
}),
|
|
750
|
-
|
|
751
|
-
|
|
719
|
+
lt,
|
|
720
|
+
Ye.create({
|
|
752
721
|
name: "slash-graph",
|
|
753
722
|
addInputRules() {
|
|
754
723
|
return [
|
|
755
|
-
new
|
|
724
|
+
new Qa({
|
|
756
725
|
find: /^\/graph\s$/,
|
|
757
726
|
handler: ({ range: a, chain: n }) => {
|
|
758
727
|
n().deleteRange(a).insertContent({ type: "graph", attrs: { formula: "sin(x)" } }).run();
|
|
@@ -763,7 +732,7 @@ function ut(l = {}) {
|
|
|
763
732
|
})
|
|
764
733
|
];
|
|
765
734
|
}
|
|
766
|
-
function
|
|
735
|
+
function dt({ onInsert: l }) {
|
|
767
736
|
const [a, n] = M(0), [i, o] = M(0), c = 10, r = 10, m = (g, p) => {
|
|
768
737
|
n(g), o(p);
|
|
769
738
|
}, f = () => {
|
|
@@ -796,10 +765,10 @@ function xt({ onInsert: l }) {
|
|
|
796
765
|
}) }, p)) })
|
|
797
766
|
] });
|
|
798
767
|
}
|
|
799
|
-
function
|
|
768
|
+
function aa() {
|
|
800
769
|
return window.mathVirtualKeyboard;
|
|
801
770
|
}
|
|
802
|
-
const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), u = () => /* @__PURE__ */ e("span", { className: "mt-ph mt-ph--sm" }), H = ({ t: l }) => /* @__PURE__ */ e("span", { className: "mt-txt-icon", children: l }),
|
|
771
|
+
const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), u = () => /* @__PURE__ */ e("span", { className: "mt-ph mt-ph--sm" }), H = ({ t: l }) => /* @__PURE__ */ e("span", { className: "mt-txt-icon", children: l }), Oe = [
|
|
803
772
|
// ---- Tab 1: Fractions & Roots ----
|
|
804
773
|
{
|
|
805
774
|
id: "frac",
|
|
@@ -2013,26 +1982,26 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), u = () => /*
|
|
|
2013
1982
|
]
|
|
2014
1983
|
}
|
|
2015
1984
|
];
|
|
2016
|
-
function
|
|
1985
|
+
function xa({ isOpen: l, onInsert: a, onClose: n, initialLatex: i = "", initialTab: o = "frac" }) {
|
|
2017
1986
|
const [c, r] = M(i), [m, f] = M(o), w = z(null), g = z(null);
|
|
2018
1987
|
$(() => {
|
|
2019
1988
|
if (!l || !g.current) return;
|
|
2020
1989
|
import("./mathlive-Bi6rleK6.js").then((T) => {
|
|
2021
1990
|
if (!g.current) return;
|
|
2022
|
-
const
|
|
2023
|
-
|
|
1991
|
+
const I = T;
|
|
1992
|
+
I.MathfieldElement && (I.MathfieldElement.mathVirtualKeyboardPolicy = "manual");
|
|
2024
1993
|
try {
|
|
2025
|
-
const Z =
|
|
1994
|
+
const Z = aa();
|
|
2026
1995
|
Z && (Z.visible = !1);
|
|
2027
1996
|
} catch {
|
|
2028
1997
|
}
|
|
2029
1998
|
const L = document.createElement("math-field");
|
|
2030
1999
|
L.setAttribute("virtual-keyboard-mode", "off"), L.setAttribute("math-virtual-keyboard-policy", "manual"), L.mathVirtualKeyboardPolicy = "manual", L.setAttribute("smart-mode", "true"), L.setAttribute("smart-fence", "true"), L.setAttribute("smart-superscript", "true"), L.style.width = "100%", L.style.minHeight = "120px", L.style.fontSize = "24px", L.style.padding = "12px 16px", L.style.border = "none", L.style.outline = "none", L.style.background = "transparent", L.style.caretColor = "#2563eb", L.style.fontFamily = "'KaTeX_Main', 'KaTeX_Math', 'Times New Roman', serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', 'Amiri', 'Malgun Gothic', 'SimSun'", L.style.setProperty("--keyboard-zindex", "-1"), L.style.setProperty("--virtual-keyboard-toggle-display", "none"), i && L.setAttribute("value", i), L.addEventListener("input", (Z) => {
|
|
2031
|
-
const
|
|
2032
|
-
r(
|
|
2000
|
+
const X = Z.target;
|
|
2001
|
+
r(X.value);
|
|
2033
2002
|
}), L.addEventListener("focus", () => {
|
|
2034
2003
|
try {
|
|
2035
|
-
|
|
2004
|
+
aa()?.hide?.();
|
|
2036
2005
|
} catch {
|
|
2037
2006
|
}
|
|
2038
2007
|
}), g.current.innerHTML = "", g.current.appendChild(L), w.current = L, setTimeout(() => L.focus(), 100);
|
|
@@ -2048,8 +2017,8 @@ function ba({ isOpen: l, onInsert: a, onClose: n, initialLatex: i = "", initialT
|
|
|
2048
2017
|
v.command ? T.executeCommand?.(v.command) : v.latex && (T.executeCommand ? T.executeCommand(["insert", v.latex, { focus: !0 }]) : T.value = (T.value || "") + v.latex), r(T.value || ""), T.focus();
|
|
2049
2018
|
}, []), h = b((v) => {
|
|
2050
2019
|
if (!w.current) return;
|
|
2051
|
-
const T = w.current,
|
|
2052
|
-
T.executeCommand?.(["insert",
|
|
2020
|
+
const T = w.current, I = `\\text{\\class{mt-font-${v}}{#@}}`;
|
|
2021
|
+
T.executeCommand?.(["insert", I, { focus: !0 }]), r(T.value || ""), T.focus();
|
|
2053
2022
|
}, []), s = b((v) => {
|
|
2054
2023
|
if (!w.current) return;
|
|
2055
2024
|
const T = w.current;
|
|
@@ -2062,7 +2031,7 @@ function ba({ isOpen: l, onInsert: a, onClose: n, initialLatex: i = "", initialT
|
|
|
2062
2031
|
if ($(() => {
|
|
2063
2032
|
l || (r(""), f(o));
|
|
2064
2033
|
}, [l, o]), !l) return null;
|
|
2065
|
-
const x =
|
|
2034
|
+
const x = Oe.find((v) => v.id === m) || Oe[0];
|
|
2066
2035
|
return /* @__PURE__ */ e("div", { className: "mt-overlay", onClick: n, onKeyDown: B, children: /* @__PURE__ */ t("div", { className: "mt-dialog", onClick: (v) => v.stopPropagation(), children: [
|
|
2067
2036
|
/* @__PURE__ */ t("div", { className: "mt-titlebar", children: [
|
|
2068
2037
|
/* @__PURE__ */ t("div", { className: "mt-titlebar__left", children: [
|
|
@@ -2109,7 +2078,7 @@ function ba({ isOpen: l, onInsert: a, onClose: n, initialLatex: i = "", initialT
|
|
|
2109
2078
|
}
|
|
2110
2079
|
) })
|
|
2111
2080
|
] }),
|
|
2112
|
-
/* @__PURE__ */ e("div", { className: "mt-tab-bar", children:
|
|
2081
|
+
/* @__PURE__ */ e("div", { className: "mt-tab-bar", children: Oe.map((v) => /* @__PURE__ */ e(
|
|
2113
2082
|
"button",
|
|
2114
2083
|
{
|
|
2115
2084
|
className: `mt-tab ${m === v.id ? "is-active" : ""}`,
|
|
@@ -2119,18 +2088,18 @@ function ba({ isOpen: l, onInsert: a, onClose: n, initialLatex: i = "", initialT
|
|
|
2119
2088
|
},
|
|
2120
2089
|
v.id
|
|
2121
2090
|
)) }),
|
|
2122
|
-
m === "matrix" && /* @__PURE__ */ e(
|
|
2091
|
+
m === "matrix" && /* @__PURE__ */ e(dt, { onInsert: (v) => {
|
|
2123
2092
|
if (!w.current) return;
|
|
2124
2093
|
const T = w.current;
|
|
2125
2094
|
T.executeCommand?.(["insert", v, { focus: !0 }]), r(T.value || ""), T.focus();
|
|
2126
2095
|
} }),
|
|
2127
|
-
/* @__PURE__ */ e("div", { className: "mt-grid", children: x.rows.map((v, T) => /* @__PURE__ */ e("div", { className: "mt-grid__row", children: v.map((
|
|
2096
|
+
/* @__PURE__ */ e("div", { className: "mt-grid", children: x.rows.map((v, T) => /* @__PURE__ */ e("div", { className: "mt-grid__row", children: v.map((I, L) => /* @__PURE__ */ e(
|
|
2128
2097
|
"button",
|
|
2129
2098
|
{
|
|
2130
|
-
className: `mt-grid__btn${
|
|
2131
|
-
onClick: () => p(
|
|
2132
|
-
title:
|
|
2133
|
-
children:
|
|
2099
|
+
className: `mt-grid__btn${I.command === "formula" ? " mt-grid__btn--formula" : ""}`,
|
|
2100
|
+
onClick: () => p(I),
|
|
2101
|
+
title: I.tip,
|
|
2102
|
+
children: I.icon
|
|
2134
2103
|
},
|
|
2135
2104
|
L
|
|
2136
2105
|
)) }, T)) }),
|
|
@@ -2153,26 +2122,26 @@ function ba({ isOpen: l, onInsert: a, onClose: n, initialLatex: i = "", initialT
|
|
|
2153
2122
|
] })
|
|
2154
2123
|
] }) });
|
|
2155
2124
|
}
|
|
2156
|
-
let
|
|
2157
|
-
function
|
|
2158
|
-
return
|
|
2125
|
+
let $e = null, ta = !1;
|
|
2126
|
+
function ga() {
|
|
2127
|
+
return $e || ($e = import("./mathlive-Bi6rleK6.js").then((l) => {
|
|
2159
2128
|
const a = window.MATHLIVE_FONTS_PATH || "/fonts";
|
|
2160
2129
|
return l.MathfieldElement && (l.MathfieldElement.fontsDirectory = a), l;
|
|
2161
|
-
})),
|
|
2130
|
+
})), $e;
|
|
2162
2131
|
}
|
|
2163
|
-
async function
|
|
2164
|
-
if (!
|
|
2132
|
+
async function pt() {
|
|
2133
|
+
if (!ta)
|
|
2165
2134
|
try {
|
|
2166
|
-
const l = await
|
|
2167
|
-
l.loadFonts && (await l.loadFonts({ fontsDirectory: a }),
|
|
2135
|
+
const l = await ga(), a = window.MATHLIVE_FONTS_PATH || "/fonts";
|
|
2136
|
+
l.loadFonts && (await l.loadFonts({ fontsDirectory: a }), ta = !0);
|
|
2168
2137
|
} catch (l) {
|
|
2169
|
-
|
|
2138
|
+
console.warn("MathLive fonts could not be loaded:", l);
|
|
2170
2139
|
}
|
|
2171
2140
|
}
|
|
2172
|
-
function
|
|
2141
|
+
function la() {
|
|
2173
2142
|
return window.mathVirtualKeyboard;
|
|
2174
2143
|
}
|
|
2175
|
-
function
|
|
2144
|
+
function ba(l) {
|
|
2176
2145
|
const a = z(null), n = z(null), [i, o] = M(!1), [c, r] = M(!1), m = l.node.attrs.display === "block", f = b(() => {
|
|
2177
2146
|
o(!0);
|
|
2178
2147
|
}, []), w = b(() => {
|
|
@@ -2182,12 +2151,12 @@ function va(l) {
|
|
|
2182
2151
|
}, [l]);
|
|
2183
2152
|
return $(() => {
|
|
2184
2153
|
async function p() {
|
|
2185
|
-
await
|
|
2186
|
-
const s = await
|
|
2154
|
+
await pt();
|
|
2155
|
+
const s = await ga();
|
|
2187
2156
|
if (!a.current) return;
|
|
2188
2157
|
s.MathfieldElement && (s.MathfieldElement.keypressVibration = !1, s.MathfieldElement.mathVirtualKeyboardPolicy = "manual");
|
|
2189
2158
|
try {
|
|
2190
|
-
const B =
|
|
2159
|
+
const B = la();
|
|
2191
2160
|
B && (B.visible = !1);
|
|
2192
2161
|
} catch {
|
|
2193
2162
|
}
|
|
@@ -2198,7 +2167,7 @@ function va(l) {
|
|
|
2198
2167
|
}), d.addEventListener("focus", () => {
|
|
2199
2168
|
r(!0);
|
|
2200
2169
|
try {
|
|
2201
|
-
|
|
2170
|
+
la()?.hide?.();
|
|
2202
2171
|
} catch {
|
|
2203
2172
|
}
|
|
2204
2173
|
}), d.addEventListener("blur", () => {
|
|
@@ -2207,14 +2176,14 @@ function va(l) {
|
|
|
2207
2176
|
d.focus();
|
|
2208
2177
|
}, 50);
|
|
2209
2178
|
}
|
|
2210
|
-
p().catch(
|
|
2179
|
+
p().catch(console.error);
|
|
2211
2180
|
const h = a.current;
|
|
2212
2181
|
return () => {
|
|
2213
2182
|
h && (h.innerHTML = "");
|
|
2214
2183
|
};
|
|
2215
2184
|
}, []), /* @__PURE__ */ t(Y, { children: [
|
|
2216
2185
|
/* @__PURE__ */ t(
|
|
2217
|
-
|
|
2186
|
+
Xe,
|
|
2218
2187
|
{
|
|
2219
2188
|
className: m ? "mtx-math-block" : "mtx-math-inline",
|
|
2220
2189
|
"data-latex": l.node.attrs.latex,
|
|
@@ -2238,7 +2207,7 @@ function va(l) {
|
|
|
2238
2207
|
}
|
|
2239
2208
|
),
|
|
2240
2209
|
i && /* @__PURE__ */ e(
|
|
2241
|
-
|
|
2210
|
+
xa,
|
|
2242
2211
|
{
|
|
2243
2212
|
isOpen: i,
|
|
2244
2213
|
initialLatex: l.node.attrs.latex,
|
|
@@ -2248,7 +2217,7 @@ function va(l) {
|
|
|
2248
2217
|
)
|
|
2249
2218
|
] });
|
|
2250
2219
|
}
|
|
2251
|
-
const
|
|
2220
|
+
const ht = Ue.create({
|
|
2252
2221
|
name: "mathInline",
|
|
2253
2222
|
group: "inline",
|
|
2254
2223
|
inline: !0,
|
|
@@ -2274,12 +2243,12 @@ const bt = Je.create({
|
|
|
2274
2243
|
];
|
|
2275
2244
|
},
|
|
2276
2245
|
renderHTML({ HTMLAttributes: l }) {
|
|
2277
|
-
return ["span",
|
|
2246
|
+
return ["span", Ce(l, { "data-type": "math-inline", class: "mtx-math-inline" })];
|
|
2278
2247
|
},
|
|
2279
2248
|
addNodeView() {
|
|
2280
|
-
return
|
|
2249
|
+
return Re(ba);
|
|
2281
2250
|
}
|
|
2282
|
-
}),
|
|
2251
|
+
}), ut = Ue.create({
|
|
2283
2252
|
name: "mathBlock",
|
|
2284
2253
|
group: "block",
|
|
2285
2254
|
atom: !0,
|
|
@@ -2304,12 +2273,12 @@ const bt = Je.create({
|
|
|
2304
2273
|
];
|
|
2305
2274
|
},
|
|
2306
2275
|
renderHTML({ HTMLAttributes: l }) {
|
|
2307
|
-
return ["div",
|
|
2276
|
+
return ["div", Ce(l, { "data-type": "math-block", class: "mtx-math-block" })];
|
|
2308
2277
|
},
|
|
2309
2278
|
addNodeView() {
|
|
2310
|
-
return
|
|
2279
|
+
return Re(ba);
|
|
2311
2280
|
}
|
|
2312
|
-
}),
|
|
2281
|
+
}), fa = re.memo(({
|
|
2313
2282
|
isOpen: l,
|
|
2314
2283
|
position: a,
|
|
2315
2284
|
onClose: n,
|
|
@@ -2485,8 +2454,8 @@ const bt = Je.create({
|
|
|
2485
2454
|
)
|
|
2486
2455
|
] });
|
|
2487
2456
|
});
|
|
2488
|
-
|
|
2489
|
-
const
|
|
2457
|
+
fa.displayName = "TableMenu";
|
|
2458
|
+
const xt = re.memo(function({
|
|
2490
2459
|
isOpen: a,
|
|
2491
2460
|
position: n,
|
|
2492
2461
|
currentAlign: i,
|
|
@@ -2510,44 +2479,51 @@ const vt = re.memo(function({
|
|
|
2510
2479
|
}, [n]);
|
|
2511
2480
|
return !a || !n ? null : /* @__PURE__ */ t(Y, { children: [
|
|
2512
2481
|
/* @__PURE__ */ e("button", { type: "button", className: "mtx-table-menu-overlay", onClick: c, "aria-label": "Close image menu" }),
|
|
2513
|
-
/* @__PURE__ */ e(
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2482
|
+
/* @__PURE__ */ e(
|
|
2483
|
+
"div",
|
|
2484
|
+
{
|
|
2485
|
+
className: "mtx-table-menu-dropdown",
|
|
2486
|
+
style: { "--mtx-dropdown-x": `${p.x}px`, "--mtx-dropdown-y": `${p.y}px` },
|
|
2487
|
+
children: /* @__PURE__ */ t("div", { className: "mtx-table-menu", onClick: (h) => h.stopPropagation(), children: [
|
|
2488
|
+
/* @__PURE__ */ t("div", { className: "mtx-table-menu-group", children: [
|
|
2489
|
+
/* @__PURE__ */ e("div", { className: "mtx-table-menu-label", children: "Text Wrapping" }),
|
|
2490
|
+
/* @__PURE__ */ t("button", { className: `mtx-table-menu-item ${i === "left" ? "is-active" : ""}`, onClick: () => g(() => r("left")), children: [
|
|
2491
|
+
/* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "◧" }),
|
|
2492
|
+
/* @__PURE__ */ e("span", { children: "Wrap Left" })
|
|
2493
|
+
] }),
|
|
2494
|
+
/* @__PURE__ */ t("button", { className: `mtx-table-menu-item ${i === "center" ? "is-active" : ""}`, onClick: () => g(() => r("center")), children: [
|
|
2495
|
+
/* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "▣" }),
|
|
2496
|
+
/* @__PURE__ */ e("span", { children: "Wrap Center" })
|
|
2497
|
+
] }),
|
|
2498
|
+
/* @__PURE__ */ t("button", { className: `mtx-table-menu-item ${i === "right" ? "is-active" : ""}`, onClick: () => g(() => r("right")), children: [
|
|
2499
|
+
/* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "◨" }),
|
|
2500
|
+
/* @__PURE__ */ e("span", { children: "Wrap Right" })
|
|
2501
|
+
] }),
|
|
2502
|
+
/* @__PURE__ */ t("button", { className: `mtx-table-menu-item ${i === "full" ? "is-active" : ""}`, onClick: () => g(() => r("full")), children: [
|
|
2503
|
+
/* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "▤" }),
|
|
2504
|
+
/* @__PURE__ */ e("span", { children: "Full Width" })
|
|
2505
|
+
] })
|
|
2506
|
+
] }),
|
|
2507
|
+
w && /* @__PURE__ */ t("div", { className: "mtx-table-menu-group", children: [
|
|
2508
|
+
/* @__PURE__ */ e("div", { className: "mtx-table-menu-label", children: "Image" }),
|
|
2509
|
+
m && /* @__PURE__ */ t("button", { className: "mtx-table-menu-item", onClick: () => g(m), disabled: !o, children: [
|
|
2510
|
+
/* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "↺" }),
|
|
2511
|
+
/* @__PURE__ */ e("span", { children: "Reset Position" })
|
|
2512
|
+
] }),
|
|
2513
|
+
f && /* @__PURE__ */ t("button", { className: "mtx-table-menu-item", onClick: () => g(f), children: [
|
|
2514
|
+
/* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "◎" }),
|
|
2515
|
+
/* @__PURE__ */ e("span", { children: "Center & Reset" })
|
|
2516
|
+
] }),
|
|
2517
|
+
/* @__PURE__ */ t("button", { className: "mtx-table-menu-item", onClick: () => g(w), children: [
|
|
2518
|
+
/* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "✎" }),
|
|
2519
|
+
/* @__PURE__ */ e("span", { children: "Edit Image" })
|
|
2520
|
+
] })
|
|
2521
|
+
] })
|
|
2546
2522
|
] })
|
|
2547
|
-
|
|
2548
|
-
|
|
2523
|
+
}
|
|
2524
|
+
)
|
|
2549
2525
|
] });
|
|
2550
|
-
}),
|
|
2526
|
+
}), gt = de(() => import("./LinkDialogImpl-DTHugWZM.js").then((l) => ({ default: l.LinkDialogImpl }))), bt = de(() => import("./InsertTableDialogImpl-DZrLgDKN.js").then((l) => ({ default: l.InsertTableDialogImpl }))), ft = de(() => import("./CellPropertiesDialogImpl-HPT77uxM.js").then((l) => ({ default: l.CellPropertiesDialogImpl }))), vt = de(() => import("./TableTemplatesDialogImpl-D0sFSAKl.js").then((l) => ({ default: l.TableTemplatesDialogImpl }))), wt = de(() => import("./ImageInsertDialog-DzLFhSDK.js").then((l) => ({ default: l.ImageInsertDialog }))), _ = re.memo(function({ icon: a, label: n, onClick: i, isActive: o, isDisabled: c, className: r }) {
|
|
2551
2527
|
return /* @__PURE__ */ e(
|
|
2552
2528
|
"button",
|
|
2553
2529
|
{
|
|
@@ -2555,7 +2531,7 @@ const vt = re.memo(function({
|
|
|
2555
2531
|
className: `mtx-toolbar-btn ${o ? "is-active" : ""} ${r || ""}`,
|
|
2556
2532
|
onClick: i,
|
|
2557
2533
|
disabled: c,
|
|
2558
|
-
|
|
2534
|
+
title: n,
|
|
2559
2535
|
"aria-label": n,
|
|
2560
2536
|
children: a
|
|
2561
2537
|
}
|
|
@@ -2564,12 +2540,12 @@ const vt = re.memo(function({
|
|
|
2564
2540
|
function ie() {
|
|
2565
2541
|
return /* @__PURE__ */ e("div", { className: "mtx-toolbar-divider" });
|
|
2566
2542
|
}
|
|
2567
|
-
function
|
|
2543
|
+
function yt(l) {
|
|
2568
2544
|
if (!l) return null;
|
|
2569
2545
|
const a = l.state.selection.node;
|
|
2570
2546
|
return a?.type?.name === "image" ? a.attrs || {} : l.state.selection.$from.parent.type.name === "image" ? l.state.selection.$from.parent.attrs : null;
|
|
2571
2547
|
}
|
|
2572
|
-
const
|
|
2548
|
+
const Nt = re.memo(({ value: l, onChange: a, options: n, label: i, className: o }) => /* @__PURE__ */ e(
|
|
2573
2549
|
"select",
|
|
2574
2550
|
{
|
|
2575
2551
|
className: `mtx-toolbar-select ${o || ""}`,
|
|
@@ -2579,7 +2555,7 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
2579
2555
|
"aria-label": i,
|
|
2580
2556
|
children: n.map((c) => /* @__PURE__ */ e("option", { value: c.value, children: c.label }, c.value))
|
|
2581
2557
|
}
|
|
2582
|
-
)),
|
|
2558
|
+
)), na = re.memo(({ color: l, onChange: a, label: n, icon: i }) => {
|
|
2583
2559
|
const o = z(null);
|
|
2584
2560
|
return /* @__PURE__ */ t(Y, { children: [
|
|
2585
2561
|
/* @__PURE__ */ e(
|
|
@@ -2683,16 +2659,16 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
2683
2659
|
/* @__PURE__ */ e("path", { d: "M2 2h12v1.5H2V2zm2 3h8v1.5H4V5zm2 3h4v1.5H6V8zm-4 3h12v1.5H2v-1.5zm2 3h8v1.5H4v-1.5z" }),
|
|
2684
2660
|
/* @__PURE__ */ e("path", { d: "M1 1l14 14", stroke: "currentColor", strokeWidth: "1.5" })
|
|
2685
2661
|
] })
|
|
2686
|
-
},
|
|
2662
|
+
}, kt = [
|
|
2687
2663
|
{ value: "Arial", label: "Arial" },
|
|
2688
2664
|
{ value: "Times New Roman", label: "Times New Roman" },
|
|
2689
2665
|
{ value: "Georgia", label: "Georgia" },
|
|
2690
2666
|
{ value: "Verdana", label: "Verdana" },
|
|
2691
2667
|
{ value: "Courier New", label: "Courier New" }
|
|
2692
|
-
],
|
|
2693
|
-
const [f, w] = M("#000000"), [g, p] = M("#fef08a"), [h, s] = M("basic"), [d, B] = M(!1), [x, v] = M(!1), [T,
|
|
2668
|
+
], Ct = re.memo(function({ editor: a, toolbarMode: n, onInsertMath: i, onInsertImage: o, onEditImage: c, onSetImageAlign: r, onResetImagePosition: m }) {
|
|
2669
|
+
const [f, w] = M("#000000"), [g, p] = M("#fef08a"), [h, s] = M("basic"), [d, B] = M(!1), [x, v] = M(!1), [T, I] = M(!1), [L, Z] = M(!1), [X, te] = M(!1), [ve, ee] = M({}), se = b(() => {
|
|
2694
2670
|
B(!0);
|
|
2695
|
-
}, []),
|
|
2671
|
+
}, []), _e = b((P) => {
|
|
2696
2672
|
if (!a) return;
|
|
2697
2673
|
const { url: V, text: Q, target: W } = P;
|
|
2698
2674
|
Q ? a.chain().focus().deleteSelection().insertContent(Q).setLink({
|
|
@@ -2713,29 +2689,29 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
2713
2689
|
target: a.getAttributes("link").target || "_blank"
|
|
2714
2690
|
} : {}, [a]), ce = b((P, V, Q) => {
|
|
2715
2691
|
a && a.chain().focus().insertTable({ rows: P, cols: V, withHeaderRow: Q }).run();
|
|
2716
|
-
}, [a]), [
|
|
2692
|
+
}, [a]), [we, ae] = M(!1), [he, ye] = M(null), [ue, O] = M(!1), [Ae, oe] = M(null);
|
|
2717
2693
|
$(() => {
|
|
2718
2694
|
if (!a) return;
|
|
2719
2695
|
const P = (Q) => {
|
|
2720
|
-
const W = Q,
|
|
2721
|
-
if (
|
|
2696
|
+
const W = Q, Be = W.target, Me = Be.closest("figure.mtx-image-figure, .mtx-image-wrapper, img"), Ke = Be.closest("td, th");
|
|
2697
|
+
if (Me) {
|
|
2722
2698
|
W.preventDefault(), W.stopPropagation();
|
|
2723
2699
|
try {
|
|
2724
|
-
const
|
|
2725
|
-
a.chain().focus().setNodeSelection(
|
|
2726
|
-
} catch (
|
|
2727
|
-
|
|
2700
|
+
const Te = Me.tagName === "IMG" ? Me : Me.querySelector("img") || Me, Ha = a.view.posAtDOM(Te, 0);
|
|
2701
|
+
a.chain().focus().setNodeSelection(Ha).run();
|
|
2702
|
+
} catch (Te) {
|
|
2703
|
+
console.warn("Cannot select image from context menu:", Te);
|
|
2728
2704
|
}
|
|
2729
2705
|
ae(!1), oe({ x: W.clientX, y: W.clientY }), O(!0);
|
|
2730
2706
|
return;
|
|
2731
2707
|
}
|
|
2732
|
-
|
|
2708
|
+
Ke && a.isActive("table") && (W.preventDefault(), W.stopPropagation(), O(!1), ye({ x: W.clientX, y: W.clientY }), ae(!0));
|
|
2733
2709
|
}, V = document.querySelector(".mtx-content");
|
|
2734
2710
|
return V && V.addEventListener("contextmenu", P), () => {
|
|
2735
2711
|
V && V.removeEventListener("contextmenu", P);
|
|
2736
2712
|
};
|
|
2737
2713
|
}, [a]);
|
|
2738
|
-
const
|
|
2714
|
+
const Ne = b(() => {
|
|
2739
2715
|
a && a.chain().focus().addRowBefore().run();
|
|
2740
2716
|
}, [a]), J = b(() => {
|
|
2741
2717
|
a && a.chain().focus().addRowAfter().run();
|
|
@@ -2751,7 +2727,7 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
2751
2727
|
a && (a.chain().focus().deleteTable().run(), ae(!1));
|
|
2752
2728
|
}, [a]), N = b((P) => {
|
|
2753
2729
|
r?.(P), O(!1);
|
|
2754
|
-
}, [r]),
|
|
2730
|
+
}, [r]), E = b(() => {
|
|
2755
2731
|
c?.(), O(!1);
|
|
2756
2732
|
}, [c]), K = b(() => {
|
|
2757
2733
|
m?.(), O(!1);
|
|
@@ -2768,34 +2744,34 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
2768
2744
|
backgroundColor: P.attrs.backgroundColor || "",
|
|
2769
2745
|
horizontalAlign: P.attrs.textAlign || "left",
|
|
2770
2746
|
verticalAlign: P.attrs.verticalAlign || "top"
|
|
2771
|
-
}), ae(!1),
|
|
2772
|
-
}, [a]),
|
|
2747
|
+
}), ae(!1), I(!0);
|
|
2748
|
+
}, [a]), j = b(() => {
|
|
2773
2749
|
if (a)
|
|
2774
2750
|
try {
|
|
2775
2751
|
a.chain().focus().mergeCells().run(), ae(!1);
|
|
2776
2752
|
} catch (P) {
|
|
2777
|
-
|
|
2753
|
+
console.warn("Cannot merge cells:", P);
|
|
2778
2754
|
}
|
|
2779
2755
|
}, [a]), U = b(() => {
|
|
2780
2756
|
if (a)
|
|
2781
2757
|
try {
|
|
2782
2758
|
a.chain().focus().splitCell().run(), ae(!1);
|
|
2783
2759
|
} catch (P) {
|
|
2784
|
-
|
|
2760
|
+
console.warn("Cannot split cell:", P);
|
|
2785
2761
|
}
|
|
2786
2762
|
}, [a]), ge = b((P) => {
|
|
2787
2763
|
if (!a) return;
|
|
2788
|
-
const { width: V, backgroundColor: Q, horizontalAlign: W, verticalAlign:
|
|
2789
|
-
a.chain().focus().updateAttributes(
|
|
2790
|
-
colwidth: Number.isFinite(
|
|
2764
|
+
const { width: V, backgroundColor: Q, horizontalAlign: W, verticalAlign: Be } = P, Ke = a.state.selection.$from.parent.type.name === "tableHeader" ? "tableHeader" : "tableCell", Te = V ? parseInt(V, 10) : null;
|
|
2765
|
+
a.chain().focus().updateAttributes(Ke, {
|
|
2766
|
+
colwidth: Number.isFinite(Te) && V?.endsWith("px") ? [Te] : null,
|
|
2791
2767
|
width: V || null,
|
|
2792
2768
|
backgroundColor: Q || null,
|
|
2793
2769
|
textAlign: W || null,
|
|
2794
|
-
verticalAlign:
|
|
2770
|
+
verticalAlign: Be || null
|
|
2795
2771
|
}).run();
|
|
2796
|
-
}, [a]),
|
|
2772
|
+
}, [a]), ke = b((P) => {
|
|
2797
2773
|
a && a.isActive("table") && a.chain().focus().updateAttributes("table", { theme: P.id }).run();
|
|
2798
|
-
}, [a]),
|
|
2774
|
+
}, [a]), De = b(() => {
|
|
2799
2775
|
if (o) {
|
|
2800
2776
|
o();
|
|
2801
2777
|
return;
|
|
@@ -2808,17 +2784,17 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
2808
2784
|
a && (a.chain().focus().setImage({ src: P, alt: V }).run(), te(!1));
|
|
2809
2785
|
},
|
|
2810
2786
|
[a]
|
|
2811
|
-
),
|
|
2787
|
+
), Ve = b(() => {
|
|
2812
2788
|
v(!0);
|
|
2813
|
-
}, []),
|
|
2789
|
+
}, []), He = yt(a), pe = !!He, Pe = He?.align || "center", va = He ? Number(He.offsetX || 0) !== 0 || Number(He.offsetY || 0) !== 0 : !1, Se = !!a && a.isActive("table"), wa = !!a && ["tableCell", "tableHeader"].includes(a.state.selection.$from.parent.type.name), ya = !!a && a.can().deleteRow(), Na = !!a && a.can().deleteColumn(), ka = !!a && a.can().mergeCells(), Ca = !!a && a.can().splitCell(), ne = (n || h) === "advanced", _a = !n, Aa = b(() => {
|
|
2814
2790
|
a && a.chain().focus().unsetBold().unsetItalic().unsetUnderline().unsetStrike().unsetSubscript().unsetSuperscript().unsetLink().unsetColor().unsetFontFamily().unsetHighlight().run();
|
|
2815
|
-
}, [a]),
|
|
2791
|
+
}, [a]), Ma = b((P) => {
|
|
2816
2792
|
w(P), a && a.chain().focus().setColor(P).run();
|
|
2817
|
-
}, [a]),
|
|
2793
|
+
}, [a]), Ta = b((P) => {
|
|
2818
2794
|
p(P), a && a.chain().focus().toggleHighlight({ color: P }).run();
|
|
2819
2795
|
}, [a]);
|
|
2820
2796
|
return a ? /* @__PURE__ */ t("div", { className: "mtx-toolbar", role: "toolbar", "aria-label": "Editor toolbar", children: [
|
|
2821
|
-
|
|
2797
|
+
_a && /* @__PURE__ */ t(Y, { children: [
|
|
2822
2798
|
/* @__PURE__ */ t("div", { className: "mtx-toolbar-mode-switch", role: "group", "aria-label": "Toolbar density", children: [
|
|
2823
2799
|
/* @__PURE__ */ e(
|
|
2824
2800
|
"button",
|
|
@@ -2866,11 +2842,11 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
2866
2842
|
/* @__PURE__ */ e(ie, {}),
|
|
2867
2843
|
ne && /* @__PURE__ */ t(Y, { children: [
|
|
2868
2844
|
/* @__PURE__ */ e("div", { className: "mtx-toolbar-group", children: /* @__PURE__ */ e(
|
|
2869
|
-
|
|
2845
|
+
Nt,
|
|
2870
2846
|
{
|
|
2871
2847
|
value: a.getAttributes("textStyle").fontFamily || "Arial",
|
|
2872
2848
|
onChange: (P) => a.chain().focus().setFontFamily(P).run(),
|
|
2873
|
-
options:
|
|
2849
|
+
options: kt,
|
|
2874
2850
|
label: "Font Family",
|
|
2875
2851
|
className: "mtx-font-select"
|
|
2876
2852
|
}
|
|
@@ -2924,10 +2900,10 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
2924
2900
|
}
|
|
2925
2901
|
),
|
|
2926
2902
|
/* @__PURE__ */ e(
|
|
2927
|
-
|
|
2903
|
+
na,
|
|
2928
2904
|
{
|
|
2929
2905
|
color: g,
|
|
2930
|
-
onChange:
|
|
2906
|
+
onChange: Ta,
|
|
2931
2907
|
label: "Highlight Color",
|
|
2932
2908
|
icon: /* @__PURE__ */ e("span", { style: { width: "12px", height: "12px", background: g, borderRadius: "2px", display: "inline-block" } })
|
|
2933
2909
|
}
|
|
@@ -2936,10 +2912,10 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
2936
2912
|
/* @__PURE__ */ e(ie, {}),
|
|
2937
2913
|
ne && /* @__PURE__ */ t(Y, { children: [
|
|
2938
2914
|
/* @__PURE__ */ e("div", { className: "mtx-toolbar-group", children: /* @__PURE__ */ e(
|
|
2939
|
-
|
|
2915
|
+
na,
|
|
2940
2916
|
{
|
|
2941
2917
|
color: f,
|
|
2942
|
-
onChange:
|
|
2918
|
+
onChange: Ma,
|
|
2943
2919
|
label: "Text Color",
|
|
2944
2920
|
icon: /* @__PURE__ */ e("span", { style: { width: "16px", height: "3px", background: f, display: "inline-block", borderRadius: "1px" } })
|
|
2945
2921
|
}
|
|
@@ -3089,7 +3065,7 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3089
3065
|
{
|
|
3090
3066
|
icon: A.image,
|
|
3091
3067
|
label: "Image",
|
|
3092
|
-
onClick:
|
|
3068
|
+
onClick: De
|
|
3093
3069
|
}
|
|
3094
3070
|
),
|
|
3095
3071
|
ne && /* @__PURE__ */ t(Y, { children: [
|
|
@@ -3108,7 +3084,7 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3108
3084
|
icon: A.alignLeft,
|
|
3109
3085
|
label: "Wrap Image Left",
|
|
3110
3086
|
onClick: () => r?.("left"),
|
|
3111
|
-
isActive: pe &&
|
|
3087
|
+
isActive: pe && Pe === "left",
|
|
3112
3088
|
isDisabled: !pe
|
|
3113
3089
|
}
|
|
3114
3090
|
),
|
|
@@ -3118,7 +3094,7 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3118
3094
|
icon: A.alignCenter,
|
|
3119
3095
|
label: "Wrap Image Center",
|
|
3120
3096
|
onClick: () => r?.("center"),
|
|
3121
|
-
isActive: pe &&
|
|
3097
|
+
isActive: pe && Pe === "center",
|
|
3122
3098
|
isDisabled: !pe
|
|
3123
3099
|
}
|
|
3124
3100
|
),
|
|
@@ -3128,7 +3104,7 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3128
3104
|
icon: A.alignRight,
|
|
3129
3105
|
label: "Wrap Image Right",
|
|
3130
3106
|
onClick: () => r?.("right"),
|
|
3131
|
-
isActive: pe &&
|
|
3107
|
+
isActive: pe && Pe === "right",
|
|
3132
3108
|
isDisabled: !pe
|
|
3133
3109
|
}
|
|
3134
3110
|
),
|
|
@@ -3138,7 +3114,7 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3138
3114
|
icon: A.alignJustify,
|
|
3139
3115
|
label: "Wrap Image Full",
|
|
3140
3116
|
onClick: () => r?.("full"),
|
|
3141
|
-
isActive: pe &&
|
|
3117
|
+
isActive: pe && Pe === "full",
|
|
3142
3118
|
isDisabled: !pe
|
|
3143
3119
|
}
|
|
3144
3120
|
)
|
|
@@ -3148,7 +3124,7 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3148
3124
|
{
|
|
3149
3125
|
icon: A.table,
|
|
3150
3126
|
label: "Table",
|
|
3151
|
-
onClick:
|
|
3127
|
+
onClick: Ve
|
|
3152
3128
|
}
|
|
3153
3129
|
),
|
|
3154
3130
|
/* @__PURE__ */ e(
|
|
@@ -3159,13 +3135,13 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3159
3135
|
onClick: be
|
|
3160
3136
|
}
|
|
3161
3137
|
),
|
|
3162
|
-
|
|
3138
|
+
Se && /* @__PURE__ */ t(Y, { children: [
|
|
3163
3139
|
/* @__PURE__ */ e(
|
|
3164
3140
|
_,
|
|
3165
3141
|
{
|
|
3166
3142
|
icon: A.rowAbove,
|
|
3167
3143
|
label: "Insert Row Above",
|
|
3168
|
-
onClick:
|
|
3144
|
+
onClick: Ne
|
|
3169
3145
|
}
|
|
3170
3146
|
),
|
|
3171
3147
|
/* @__PURE__ */ e(
|
|
@@ -3198,7 +3174,7 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3198
3174
|
icon: A.cellProperties,
|
|
3199
3175
|
label: "Cell Properties",
|
|
3200
3176
|
onClick: R,
|
|
3201
|
-
isDisabled: !
|
|
3177
|
+
isDisabled: !wa
|
|
3202
3178
|
}
|
|
3203
3179
|
),
|
|
3204
3180
|
/* @__PURE__ */ e(
|
|
@@ -3207,7 +3183,7 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3207
3183
|
icon: A.deleteRow,
|
|
3208
3184
|
label: "Delete Row",
|
|
3209
3185
|
onClick: y,
|
|
3210
|
-
isDisabled: !
|
|
3186
|
+
isDisabled: !ya
|
|
3211
3187
|
}
|
|
3212
3188
|
),
|
|
3213
3189
|
/* @__PURE__ */ e(
|
|
@@ -3216,7 +3192,7 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3216
3192
|
icon: A.deleteColumn,
|
|
3217
3193
|
label: "Delete Column",
|
|
3218
3194
|
onClick: F,
|
|
3219
|
-
isDisabled: !
|
|
3195
|
+
isDisabled: !Na
|
|
3220
3196
|
}
|
|
3221
3197
|
),
|
|
3222
3198
|
/* @__PURE__ */ e(
|
|
@@ -3224,8 +3200,8 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3224
3200
|
{
|
|
3225
3201
|
icon: A.mergeCells,
|
|
3226
3202
|
label: "Merge Cells",
|
|
3227
|
-
onClick:
|
|
3228
|
-
isDisabled: !
|
|
3203
|
+
onClick: j,
|
|
3204
|
+
isDisabled: !ka
|
|
3229
3205
|
}
|
|
3230
3206
|
),
|
|
3231
3207
|
/* @__PURE__ */ e(
|
|
@@ -3234,7 +3210,7 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3234
3210
|
icon: A.splitCell,
|
|
3235
3211
|
label: "Split Cell",
|
|
3236
3212
|
onClick: U,
|
|
3237
|
-
isDisabled: !
|
|
3213
|
+
isDisabled: !Ca
|
|
3238
3214
|
}
|
|
3239
3215
|
)
|
|
3240
3216
|
] }),
|
|
@@ -3244,13 +3220,13 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3244
3220
|
{
|
|
3245
3221
|
className: "mtx-toolbar-btn mtx-toolbar-btn--dropdown",
|
|
3246
3222
|
onClick: (P) => {
|
|
3247
|
-
if (!
|
|
3223
|
+
if (!Se) return;
|
|
3248
3224
|
const V = P.currentTarget.getBoundingClientRect();
|
|
3249
|
-
|
|
3225
|
+
ye({ x: V.left, y: V.bottom + 5 }), ae(!we);
|
|
3250
3226
|
},
|
|
3251
3227
|
title: "Table Operations",
|
|
3252
3228
|
"aria-label": "Table Operations",
|
|
3253
|
-
disabled: !
|
|
3229
|
+
disabled: !Se,
|
|
3254
3230
|
children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M8 11l-4-4h8l-4 4z" }) })
|
|
3255
3231
|
}
|
|
3256
3232
|
),
|
|
@@ -3258,10 +3234,10 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3258
3234
|
"button",
|
|
3259
3235
|
{
|
|
3260
3236
|
className: "mtx-toolbar-btn",
|
|
3261
|
-
onClick: () =>
|
|
3237
|
+
onClick: () => Se && Z(!0),
|
|
3262
3238
|
title: "Table Templates",
|
|
3263
3239
|
"aria-label": "Table Templates",
|
|
3264
|
-
disabled: !
|
|
3240
|
+
disabled: !Se,
|
|
3265
3241
|
children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 2h5v5H2V2zm7 0h5v5H9V2zM2 9h5v5H2V9zm7 0h5v5H9V9z" }) })
|
|
3266
3242
|
}
|
|
3267
3243
|
),
|
|
@@ -3343,23 +3319,23 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3343
3319
|
{
|
|
3344
3320
|
icon: A.removeFormat,
|
|
3345
3321
|
label: "Remove Format",
|
|
3346
|
-
onClick:
|
|
3322
|
+
onClick: Aa
|
|
3347
3323
|
}
|
|
3348
3324
|
) }),
|
|
3349
3325
|
d && /* @__PURE__ */ e(me, { fallback: null, children: /* @__PURE__ */ e(
|
|
3350
|
-
|
|
3326
|
+
gt,
|
|
3351
3327
|
{
|
|
3352
3328
|
isOpen: d,
|
|
3353
3329
|
currentUrl: G().url,
|
|
3354
3330
|
currentText: G().text,
|
|
3355
3331
|
currentTarget: G().target,
|
|
3356
|
-
onInsert:
|
|
3332
|
+
onInsert: _e,
|
|
3357
3333
|
onRemove: a?.isActive("link") ? C : void 0,
|
|
3358
3334
|
onClose: () => B(!1)
|
|
3359
3335
|
}
|
|
3360
3336
|
) }),
|
|
3361
3337
|
x && /* @__PURE__ */ e(me, { fallback: null, children: /* @__PURE__ */ e(
|
|
3362
|
-
|
|
3338
|
+
bt,
|
|
3363
3339
|
{
|
|
3364
3340
|
isOpen: x,
|
|
3365
3341
|
onInsert: ce,
|
|
@@ -3367,12 +3343,12 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3367
3343
|
}
|
|
3368
3344
|
) }),
|
|
3369
3345
|
/* @__PURE__ */ e(
|
|
3370
|
-
|
|
3346
|
+
fa,
|
|
3371
3347
|
{
|
|
3372
|
-
isOpen:
|
|
3348
|
+
isOpen: we,
|
|
3373
3349
|
position: he || { x: 200, y: 300 },
|
|
3374
3350
|
onClose: () => ae(!1),
|
|
3375
|
-
onAddRowBefore:
|
|
3351
|
+
onAddRowBefore: Ne,
|
|
3376
3352
|
onAddRowAfter: J,
|
|
3377
3353
|
onDeleteRow: y,
|
|
3378
3354
|
onAddColumnBefore: k,
|
|
@@ -3380,54 +3356,54 @@ const At = re.memo(({ value: l, onChange: a, options: n, label: i, className: o
|
|
|
3380
3356
|
onDeleteColumn: F,
|
|
3381
3357
|
onDeleteTable: xe,
|
|
3382
3358
|
onCellProperties: R,
|
|
3383
|
-
onMergeCells:
|
|
3359
|
+
onMergeCells: j,
|
|
3384
3360
|
onSplitCell: U
|
|
3385
3361
|
}
|
|
3386
3362
|
),
|
|
3387
3363
|
/* @__PURE__ */ e(
|
|
3388
|
-
|
|
3364
|
+
xt,
|
|
3389
3365
|
{
|
|
3390
3366
|
isOpen: ue,
|
|
3391
|
-
position:
|
|
3392
|
-
currentAlign:
|
|
3393
|
-
hasCustomPosition:
|
|
3367
|
+
position: Ae || { x: 200, y: 300 },
|
|
3368
|
+
currentAlign: Pe,
|
|
3369
|
+
hasCustomPosition: va,
|
|
3394
3370
|
onClose: () => O(!1),
|
|
3395
3371
|
onSetAlign: N,
|
|
3396
3372
|
onResetPosition: m ? K : void 0,
|
|
3397
3373
|
onCenterImage: r ? q : void 0,
|
|
3398
|
-
onEditImage: c ?
|
|
3374
|
+
onEditImage: c ? E : void 0
|
|
3399
3375
|
}
|
|
3400
3376
|
),
|
|
3401
3377
|
T && /* @__PURE__ */ e(me, { fallback: null, children: /* @__PURE__ */ e(
|
|
3402
|
-
|
|
3378
|
+
ft,
|
|
3403
3379
|
{
|
|
3404
3380
|
isOpen: T,
|
|
3405
|
-
initialData:
|
|
3381
|
+
initialData: ve,
|
|
3406
3382
|
onSave: ge,
|
|
3407
3383
|
onClose: () => {
|
|
3408
|
-
|
|
3384
|
+
I(!1), ee({});
|
|
3409
3385
|
}
|
|
3410
3386
|
}
|
|
3411
3387
|
) }),
|
|
3412
3388
|
L && /* @__PURE__ */ e(me, { fallback: null, children: /* @__PURE__ */ e(
|
|
3413
|
-
|
|
3389
|
+
vt,
|
|
3414
3390
|
{
|
|
3415
3391
|
isOpen: L,
|
|
3416
|
-
onSelect:
|
|
3392
|
+
onSelect: ke,
|
|
3417
3393
|
onClose: () => Z(!1)
|
|
3418
3394
|
}
|
|
3419
3395
|
) }),
|
|
3420
|
-
|
|
3421
|
-
|
|
3396
|
+
X && /* @__PURE__ */ e(me, { fallback: null, children: /* @__PURE__ */ e(
|
|
3397
|
+
wt,
|
|
3422
3398
|
{
|
|
3423
|
-
isOpen:
|
|
3399
|
+
isOpen: X,
|
|
3424
3400
|
onClose: () => te(!1),
|
|
3425
3401
|
onInsert: le
|
|
3426
3402
|
}
|
|
3427
3403
|
) })
|
|
3428
3404
|
] }) : null;
|
|
3429
|
-
}),
|
|
3430
|
-
function
|
|
3405
|
+
}), ia = "mtx-math-toolbar-expanded-section";
|
|
3406
|
+
function ra({ label: l, latex: a, onClick: n, title: i, variant: o = "default" }) {
|
|
3431
3407
|
return /* @__PURE__ */ e(
|
|
3432
3408
|
"button",
|
|
3433
3409
|
{
|
|
@@ -3440,7 +3416,7 @@ function ca({ label: l, latex: a, onClick: n, title: i, variant: o = "default" }
|
|
|
3440
3416
|
}
|
|
3441
3417
|
);
|
|
3442
3418
|
}
|
|
3443
|
-
const
|
|
3419
|
+
const Ge = [
|
|
3444
3420
|
{
|
|
3445
3421
|
label: "Basic",
|
|
3446
3422
|
buttons: [
|
|
@@ -3504,23 +3480,23 @@ const Xe = [
|
|
|
3504
3480
|
{ label: "Kimia", latex: "\\ce{#?}", title: "Rumus Kimia (ce)" }
|
|
3505
3481
|
]
|
|
3506
3482
|
}
|
|
3507
|
-
],
|
|
3508
|
-
function
|
|
3509
|
-
const [i, o] = M([]), [c, r] = M("Basic"), [m, f] = M(""), w = fe(() =>
|
|
3510
|
-
l(x), o((v) => [x, ...v.filter((T) => T !== x)].slice(0,
|
|
3483
|
+
], _t = 6;
|
|
3484
|
+
function At({ onInsertLatex: l, onToggleSymbols: a, onToggleTemplates: n }) {
|
|
3485
|
+
const [i, o] = M([]), [c, r] = M("Basic"), [m, f] = M(""), w = fe(() => Ge.flatMap((x) => x.buttons), []), g = fe(() => new Map(w.map((x) => [x.latex, x])), [w]), p = b((x) => {
|
|
3486
|
+
l(x), o((v) => [x, ...v.filter((T) => T !== x)].slice(0, _t));
|
|
3511
3487
|
}, [l]), h = fe(
|
|
3512
3488
|
() => i.map((x) => g.get(x)).filter((x) => !!x),
|
|
3513
3489
|
[g, i]
|
|
3514
|
-
), s = m.trim().toLowerCase(), d = fe(() => s ?
|
|
3490
|
+
), s = m.trim().toLowerCase(), d = fe(() => s ? Ge.map((x) => ({
|
|
3515
3491
|
...x,
|
|
3516
3492
|
buttons: x.buttons.filter((v) => `${v.label} ${v.title} ${v.latex}`.toLowerCase().includes(s))
|
|
3517
|
-
})).filter((x) => x.buttons.length > 0) :
|
|
3493
|
+
})).filter((x) => x.buttons.length > 0) : Ge, [s]);
|
|
3518
3494
|
$(() => {
|
|
3519
3495
|
if (typeof window > "u") return;
|
|
3520
|
-
const x = window.localStorage.getItem(
|
|
3496
|
+
const x = window.localStorage.getItem(ia);
|
|
3521
3497
|
x && r(x);
|
|
3522
3498
|
}, []), $(() => {
|
|
3523
|
-
typeof window > "u" || !c || window.localStorage.setItem(
|
|
3499
|
+
typeof window > "u" || !c || window.localStorage.setItem(ia, c);
|
|
3524
3500
|
}, [c]), $(() => {
|
|
3525
3501
|
s && d.length > 0 && r(d[0].label);
|
|
3526
3502
|
}, [d, s]);
|
|
@@ -3547,7 +3523,7 @@ function Pt({ onInsertLatex: l, onToggleSymbols: a, onToggleTemplates: n }) {
|
|
|
3547
3523
|
h.length > 0 && /* @__PURE__ */ t(Y, { children: [
|
|
3548
3524
|
/* @__PURE__ */ e("div", { className: "mtx-math-toolbar__section-label", children: "Recent" }),
|
|
3549
3525
|
h.map((x) => /* @__PURE__ */ e(
|
|
3550
|
-
|
|
3526
|
+
ra,
|
|
3551
3527
|
{
|
|
3552
3528
|
label: x.label,
|
|
3553
3529
|
latex: x.latex,
|
|
@@ -3575,7 +3551,7 @@ function Pt({ onInsertLatex: l, onToggleSymbols: a, onToggleTemplates: n }) {
|
|
|
3575
3551
|
}
|
|
3576
3552
|
),
|
|
3577
3553
|
c === x.label && x.buttons.map((v) => /* @__PURE__ */ e(
|
|
3578
|
-
|
|
3554
|
+
ra,
|
|
3579
3555
|
{
|
|
3580
3556
|
label: v.label,
|
|
3581
3557
|
latex: v.latex,
|
|
@@ -3617,7 +3593,7 @@ function Pt({ onInsertLatex: l, onToggleSymbols: a, onToggleTemplates: n }) {
|
|
|
3617
3593
|
] })
|
|
3618
3594
|
] });
|
|
3619
3595
|
}
|
|
3620
|
-
const
|
|
3596
|
+
const sa = [
|
|
3621
3597
|
{
|
|
3622
3598
|
name: "Huruf Yunani",
|
|
3623
3599
|
symbols: [
|
|
@@ -3710,11 +3686,11 @@ const oa = [
|
|
|
3710
3686
|
]
|
|
3711
3687
|
}
|
|
3712
3688
|
];
|
|
3713
|
-
function
|
|
3689
|
+
function Mt({ onInsert: l, onClose: a }) {
|
|
3714
3690
|
const [n, i] = M(""), o = fe(() => {
|
|
3715
|
-
if (!n.trim()) return
|
|
3691
|
+
if (!n.trim()) return sa;
|
|
3716
3692
|
const c = n.toLowerCase();
|
|
3717
|
-
return
|
|
3693
|
+
return sa.map((r) => ({
|
|
3718
3694
|
...r,
|
|
3719
3695
|
symbols: r.symbols.filter(
|
|
3720
3696
|
(m) => m.name.toLowerCase().includes(c) || m.char.includes(c) || m.latex.toLowerCase().includes(c)
|
|
@@ -3771,29 +3747,29 @@ function St({ onInsert: l, onClose: a }) {
|
|
|
3771
3747
|
] })
|
|
3772
3748
|
] });
|
|
3773
3749
|
}
|
|
3774
|
-
const
|
|
3775
|
-
function
|
|
3750
|
+
const Tt = /<(p|h[1-4]|li)\b([^>]*)>/gi;
|
|
3751
|
+
function ca(l, a, n) {
|
|
3776
3752
|
const i = new RegExp(`\\s${a}=(['"]).*?\\1`, "i");
|
|
3777
3753
|
return i.test(l) ? l.replace(i, ` ${a}="${n}"`) : `${l} ${a}="${n}"`;
|
|
3778
3754
|
}
|
|
3779
|
-
function
|
|
3780
|
-
return l.replace(
|
|
3755
|
+
function Je(l) {
|
|
3756
|
+
return l.replace(Tt, (a, n, i = "") => {
|
|
3781
3757
|
const o = i.match(/\sclass=(['"])(.*?)\1/i), c = i.match(/\sdata-indent=(['"])(\d+)\1/i), m = o?.[2].match(/(?:^|\s)tt-indent-(\d+)(?:\s|$)/)?.[1] || c?.[2];
|
|
3782
3758
|
if (!m)
|
|
3783
3759
|
return a;
|
|
3784
3760
|
const f = new Set((o?.[2] || "").split(/\s+/).filter(Boolean));
|
|
3785
3761
|
f.add("tt-indent"), f.add(`tt-indent-${m}`);
|
|
3786
3762
|
let w = i;
|
|
3787
|
-
return w =
|
|
3763
|
+
return w = ca(w, "class", Array.from(f).join(" ")), w = ca(w, "data-indent", m), `<${n}${w}>`;
|
|
3788
3764
|
});
|
|
3789
3765
|
}
|
|
3790
|
-
function
|
|
3791
|
-
return
|
|
3766
|
+
function oa(l) {
|
|
3767
|
+
return Je(l.getHTML());
|
|
3792
3768
|
}
|
|
3793
|
-
function
|
|
3769
|
+
function ol(l) {
|
|
3794
3770
|
return l.getJSON();
|
|
3795
3771
|
}
|
|
3796
|
-
function
|
|
3772
|
+
function Ht(l) {
|
|
3797
3773
|
if (!l) return "";
|
|
3798
3774
|
let a = l;
|
|
3799
3775
|
return a = a.replace(/\s*data-cke-[a-z-]*="[^"]*"/gi, ""), a = a.replace(/\s*contenteditable="[^"]*"/gi, ""), a = a.replace(/<span[^>]*class="[^"]*cke_widget[^"]*"[^>]*>/gi, ""), a = a.replace(/<\/span>/gi, (n) => n), a = a.replace(
|
|
@@ -3802,41 +3778,41 @@ function Dt(l) {
|
|
|
3802
3778
|
const o = decodeURIComponent(i);
|
|
3803
3779
|
return `<span class="mtx-math-inline" data-mathml="${encodeURIComponent(o)}">${o}</span>`;
|
|
3804
3780
|
}
|
|
3805
|
-
),
|
|
3781
|
+
), Je(a);
|
|
3806
3782
|
}
|
|
3807
|
-
function
|
|
3783
|
+
function ml(l) {
|
|
3808
3784
|
if (!l) return "";
|
|
3809
3785
|
let a = l;
|
|
3810
3786
|
return a = a.replace(
|
|
3811
3787
|
/<span[^>]*class="mtx-math[^"]*"[^>]*data-latex="([^"]*)"[^>]*>.*?<\/span>/gi,
|
|
3812
3788
|
(n, i) => `<span class="mtx-math-inline" data-latex="${i}">\\(${i}\\)</span>`
|
|
3813
|
-
),
|
|
3789
|
+
), Je(a);
|
|
3814
3790
|
}
|
|
3815
|
-
function
|
|
3791
|
+
function Pt(l) {
|
|
3816
3792
|
return l.replace(/class="MsoNormal"/g, "").replace(/class="MsoListParagraph"/g, "").replace(/style="[^"]*mso-[^"]*"/g, "").replace(/<!--\[if[\s\S]*?<!\[endif\]-->/g, "").replace(/<o:p>.*?<\/o:p>/g, "").replace(/<w:.*?>.*?<\/w:.*?>/g, "").replace(/<style[\s\S]*?<\/style>/g, "").replace(/<meta[\s\S]*?>/g, "").replace(/\n/g, "<br>");
|
|
3817
3793
|
}
|
|
3818
|
-
function
|
|
3794
|
+
function St(l) {
|
|
3819
3795
|
return l.replace(/class="[^"]*kix-[^"]*"/g, "").replace(/style="[^"]*direction:[^"]*"/g, "").replace(/<b style="font-weight:normal"/g, "<span").replace(/<span style="font-weight:normal"/g, "<span");
|
|
3820
3796
|
}
|
|
3821
|
-
function
|
|
3797
|
+
function Lt(l, a) {
|
|
3822
3798
|
const n = a.clipboardData?.getData("text/html"), i = a.clipboardData?.getData("text/plain");
|
|
3823
3799
|
if (!n && i)
|
|
3824
3800
|
return !1;
|
|
3825
3801
|
if (n) {
|
|
3826
3802
|
if (n.includes("mso-") || n.includes("MsoNormal") || n.includes("<o:p>")) {
|
|
3827
3803
|
a.preventDefault();
|
|
3828
|
-
const o =
|
|
3804
|
+
const o = Pt(n);
|
|
3829
3805
|
return l.chain().focus().insertContent(o).run(), !0;
|
|
3830
3806
|
}
|
|
3831
3807
|
if (n.includes("kix-") || n.includes("docs-internal-guide")) {
|
|
3832
3808
|
a.preventDefault();
|
|
3833
|
-
const o =
|
|
3809
|
+
const o = St(n);
|
|
3834
3810
|
return l.chain().focus().insertContent(o).run(), !0;
|
|
3835
3811
|
}
|
|
3836
3812
|
}
|
|
3837
3813
|
return !1;
|
|
3838
3814
|
}
|
|
3839
|
-
function
|
|
3815
|
+
function Dt(l, a) {
|
|
3840
3816
|
const n = a;
|
|
3841
3817
|
if (n.shiftKey && (n.ctrlKey || n.metaKey)) {
|
|
3842
3818
|
a.preventDefault();
|
|
@@ -3846,33 +3822,33 @@ function It(l, a) {
|
|
|
3846
3822
|
}
|
|
3847
3823
|
return !1;
|
|
3848
3824
|
}
|
|
3849
|
-
function
|
|
3825
|
+
function ma(l) {
|
|
3850
3826
|
let a = 0;
|
|
3851
3827
|
return l.descendants((n) => {
|
|
3852
3828
|
n.isText && (a += n.text?.split(/\s+/).filter((i) => i.length > 0).length || 0);
|
|
3853
3829
|
}), a;
|
|
3854
3830
|
}
|
|
3855
|
-
function
|
|
3831
|
+
function da(l, a = !0) {
|
|
3856
3832
|
let n = 0;
|
|
3857
3833
|
return l.descendants((i) => {
|
|
3858
3834
|
i.isText && (n += i.text?.length || 0);
|
|
3859
3835
|
}), a ? n : n - (l.textContent?.split(" ").length - 1 || 0);
|
|
3860
3836
|
}
|
|
3861
|
-
const
|
|
3837
|
+
const Bt = 120, zt = re.memo(({ editor: l }) => {
|
|
3862
3838
|
const [a, n] = M({ words: 0, chars: 0 }), i = z(null);
|
|
3863
3839
|
return $(() => {
|
|
3864
3840
|
if (!l) return;
|
|
3865
3841
|
const o = () => {
|
|
3866
3842
|
i.current && clearTimeout(i.current), i.current = setTimeout(() => {
|
|
3867
3843
|
n({
|
|
3868
|
-
words:
|
|
3869
|
-
chars:
|
|
3844
|
+
words: ma(l.state.doc),
|
|
3845
|
+
chars: da(l.state.doc, !0)
|
|
3870
3846
|
});
|
|
3871
|
-
},
|
|
3847
|
+
}, Bt);
|
|
3872
3848
|
};
|
|
3873
3849
|
return n({
|
|
3874
|
-
words:
|
|
3875
|
-
chars:
|
|
3850
|
+
words: ma(l.state.doc),
|
|
3851
|
+
chars: da(l.state.doc, !0)
|
|
3876
3852
|
}), l.on("transaction", o), () => {
|
|
3877
3853
|
l.off("transaction", o), i.current && clearTimeout(i.current);
|
|
3878
3854
|
};
|
|
@@ -3888,7 +3864,7 @@ const Rt = 120, Vt = re.memo(({ editor: l }) => {
|
|
|
3888
3864
|
a.chars === 1 ? "character" : "characters"
|
|
3889
3865
|
] })
|
|
3890
3866
|
] });
|
|
3891
|
-
}),
|
|
3867
|
+
}), It = [
|
|
3892
3868
|
"button:not([disabled])",
|
|
3893
3869
|
"[href]",
|
|
3894
3870
|
"input:not([disabled])",
|
|
@@ -3896,19 +3872,19 @@ const Rt = 120, Vt = re.memo(({ editor: l }) => {
|
|
|
3896
3872
|
"textarea:not([disabled])",
|
|
3897
3873
|
'[tabindex]:not([tabindex="-1"])'
|
|
3898
3874
|
].join(", ");
|
|
3899
|
-
function
|
|
3900
|
-
return Array.from(l.querySelectorAll(
|
|
3875
|
+
function pa(l) {
|
|
3876
|
+
return Array.from(l.querySelectorAll(It)).filter(
|
|
3901
3877
|
(a) => !a.hasAttribute("disabled") && a.getAttribute("aria-hidden") !== "true"
|
|
3902
3878
|
);
|
|
3903
3879
|
}
|
|
3904
|
-
function
|
|
3880
|
+
function Et({
|
|
3905
3881
|
isOpen: l,
|
|
3906
3882
|
dialogRef: a,
|
|
3907
3883
|
onClose: n
|
|
3908
3884
|
}) {
|
|
3909
3885
|
$(() => {
|
|
3910
3886
|
if (!l || !a.current) return;
|
|
3911
|
-
const i = a.current, o = document.activeElement instanceof HTMLElement ? document.activeElement : null, c =
|
|
3887
|
+
const i = a.current, o = document.activeElement instanceof HTMLElement ? document.activeElement : null, c = pa(i);
|
|
3912
3888
|
(c.find((f) => f.hasAttribute("autofocus")) || c[0] || i).focus();
|
|
3913
3889
|
const m = (f) => {
|
|
3914
3890
|
if (f.key === "Escape") {
|
|
@@ -3916,7 +3892,7 @@ function Ft({
|
|
|
3916
3892
|
return;
|
|
3917
3893
|
}
|
|
3918
3894
|
if (f.key !== "Tab") return;
|
|
3919
|
-
const w =
|
|
3895
|
+
const w = pa(i);
|
|
3920
3896
|
if (w.length === 0) {
|
|
3921
3897
|
f.preventDefault(), i.focus();
|
|
3922
3898
|
return;
|
|
@@ -3933,7 +3909,7 @@ function Ft({
|
|
|
3933
3909
|
};
|
|
3934
3910
|
}, [a, l, n]);
|
|
3935
3911
|
}
|
|
3936
|
-
const
|
|
3912
|
+
const We = {
|
|
3937
3913
|
width: 720,
|
|
3938
3914
|
height: "auto",
|
|
3939
3915
|
align: "center",
|
|
@@ -3941,16 +3917,16 @@ const je = {
|
|
|
3941
3917
|
title: "",
|
|
3942
3918
|
maintainAspectRatio: !0
|
|
3943
3919
|
};
|
|
3944
|
-
function
|
|
3920
|
+
function Rt({
|
|
3945
3921
|
isOpen: l,
|
|
3946
3922
|
onClose: a,
|
|
3947
3923
|
onApply: n,
|
|
3948
3924
|
initialData: i
|
|
3949
3925
|
}) {
|
|
3950
|
-
const o =
|
|
3926
|
+
const o = Pa(), c = z(null), [r, m] = M({ ...We, ...i });
|
|
3951
3927
|
$(() => {
|
|
3952
|
-
i && m({ ...
|
|
3953
|
-
}, [i]),
|
|
3928
|
+
i && m({ ...We, ...i });
|
|
3929
|
+
}, [i]), Et({ isOpen: l, dialogRef: c, onClose: a });
|
|
3954
3930
|
const f = b((h) => {
|
|
3955
3931
|
m((s) => (s.maintainAspectRatio, { ...s, width: h }));
|
|
3956
3932
|
}, []), w = b((h) => {
|
|
@@ -3958,7 +3934,7 @@ function qt({
|
|
|
3958
3934
|
}, []), g = b(() => {
|
|
3959
3935
|
n(r), a();
|
|
3960
3936
|
}, [r, n, a]), p = b(() => {
|
|
3961
|
-
m({ ...
|
|
3937
|
+
m({ ...We, ...i });
|
|
3962
3938
|
}, [i]);
|
|
3963
3939
|
return l ? /* @__PURE__ */ t(Y, { children: [
|
|
3964
3940
|
/* @__PURE__ */ e("div", { className: "mtx-dialog-overlay", onClick: a }),
|
|
@@ -4129,7 +4105,7 @@ function qt({
|
|
|
4129
4105
|
] })
|
|
4130
4106
|
] }) : null;
|
|
4131
4107
|
}
|
|
4132
|
-
const
|
|
4108
|
+
const ha = [
|
|
4133
4109
|
// ==========================================
|
|
4134
4110
|
// 🏫 SD (Sekolah Dasar) — Kelas 1-6
|
|
4135
4111
|
// ==========================================
|
|
@@ -4728,7 +4704,7 @@ const xa = [
|
|
|
4728
4704
|
{ label: "Integral cos x", latex: "\\int \\cos x dx = \\sin x + C", preview: "∫cos x dx = sin x" }
|
|
4729
4705
|
]
|
|
4730
4706
|
}
|
|
4731
|
-
],
|
|
4707
|
+
], Vt = [
|
|
4732
4708
|
{ id: "all", label: "Semua Level", icon: "📚" },
|
|
4733
4709
|
{ id: "SD", label: "SD", icon: "🏫" },
|
|
4734
4710
|
{ id: "SMP", label: "SMP", icon: "🏫" },
|
|
@@ -4736,9 +4712,9 @@ const xa = [
|
|
|
4736
4712
|
{ id: "Kuliah", label: "Kuliah", icon: "🎓" },
|
|
4737
4713
|
{ id: "Master", label: "Master", icon: "🧪" }
|
|
4738
4714
|
];
|
|
4739
|
-
function
|
|
4715
|
+
function Kt({ onInsert: l, onClose: a }) {
|
|
4740
4716
|
const [n, i] = M(""), [o, c] = M("all"), [r, m] = M(""), f = fe(() => {
|
|
4741
|
-
let s =
|
|
4717
|
+
let s = ha;
|
|
4742
4718
|
if (o !== "all" && (s = s.filter((d) => d.level === o)), n.trim()) {
|
|
4743
4719
|
const d = n.toLowerCase();
|
|
4744
4720
|
s = s.map((B) => ({
|
|
@@ -4749,7 +4725,7 @@ function $t({ onInsert: l, onClose: a }) {
|
|
|
4749
4725
|
})).filter((B) => B.templates.length > 0);
|
|
4750
4726
|
}
|
|
4751
4727
|
return s;
|
|
4752
|
-
}, [n, o]), w = f.map((s) => s.name), g = w.includes(r) ? r : w[0] || "", p = n.trim() ? f : f.filter((s) => s.name === g), h =
|
|
4728
|
+
}, [n, o]), w = f.map((s) => s.name), g = w.includes(r) ? r : w[0] || "", p = n.trim() ? f : f.filter((s) => s.name === g), h = ha.reduce((s, d) => s + d.templates.length, 0);
|
|
4753
4729
|
return /* @__PURE__ */ t("div", { className: "mtx-template-panel", role: "dialog", "aria-label": "Template Panel", children: [
|
|
4754
4730
|
/* @__PURE__ */ t("div", { className: "mtx-template-panel__header", children: [
|
|
4755
4731
|
/* @__PURE__ */ t("span", { className: "mtx-template-panel__title", children: [
|
|
@@ -4759,7 +4735,7 @@ function $t({ onInsert: l, onClose: a }) {
|
|
|
4759
4735
|
] }),
|
|
4760
4736
|
/* @__PURE__ */ e("button", { className: "mtx-template-panel__close", onClick: a, title: "Tutup", children: "×" })
|
|
4761
4737
|
] }),
|
|
4762
|
-
/* @__PURE__ */ e("div", { className: "mtx-template-panel__levels", children:
|
|
4738
|
+
/* @__PURE__ */ e("div", { className: "mtx-template-panel__levels", children: Vt.map((s) => /* @__PURE__ */ t(
|
|
4763
4739
|
"button",
|
|
4764
4740
|
{
|
|
4765
4741
|
className: `mtx-template-panel__level ${o === s.id ? "is-active" : ""}`,
|
|
@@ -4834,8 +4810,8 @@ function $t({ onInsert: l, onClose: a }) {
|
|
|
4834
4810
|
] })
|
|
4835
4811
|
] });
|
|
4836
4812
|
}
|
|
4837
|
-
const
|
|
4838
|
-
async function
|
|
4813
|
+
const Ft = de(() => import("./ImageInsertDialog-DzLFhSDK.js").then((l) => ({ default: l.ImageInsertDialog })));
|
|
4814
|
+
async function je(l) {
|
|
4839
4815
|
return new Promise((a, n) => {
|
|
4840
4816
|
const i = new window.Image();
|
|
4841
4817
|
i.onload = () => {
|
|
@@ -4846,11 +4822,11 @@ async function Ue(l) {
|
|
|
4846
4822
|
}, i.onerror = () => n(new Error("Image load failed")), i.src = l;
|
|
4847
4823
|
});
|
|
4848
4824
|
}
|
|
4849
|
-
function
|
|
4825
|
+
function Le(l, a) {
|
|
4850
4826
|
const n = l && l > 0 ? l : 720, i = Math.max(240, n - 32);
|
|
4851
4827
|
return Math.max(120, Math.min(a, i));
|
|
4852
4828
|
}
|
|
4853
|
-
function
|
|
4829
|
+
function ze(l, a, n) {
|
|
4854
4830
|
return {
|
|
4855
4831
|
src: l,
|
|
4856
4832
|
alt: a,
|
|
@@ -4861,7 +4837,7 @@ function Ie(l, a, n) {
|
|
|
4861
4837
|
align: "center"
|
|
4862
4838
|
};
|
|
4863
4839
|
}
|
|
4864
|
-
function
|
|
4840
|
+
function Ie(l) {
|
|
4865
4841
|
const { selection: a } = l.state, n = a.node;
|
|
4866
4842
|
if (n?.type?.name === "image")
|
|
4867
4843
|
return {
|
|
@@ -4874,8 +4850,8 @@ function Re(l) {
|
|
|
4874
4850
|
pos: a.$from.before()
|
|
4875
4851
|
} : null;
|
|
4876
4852
|
}
|
|
4877
|
-
const
|
|
4878
|
-
function
|
|
4853
|
+
const qt = 150;
|
|
4854
|
+
function dl({
|
|
4879
4855
|
content: l = "",
|
|
4880
4856
|
onChange: a,
|
|
4881
4857
|
onSave: n,
|
|
@@ -4888,13 +4864,13 @@ function xl({
|
|
|
4888
4864
|
autoFocus: w = !1,
|
|
4889
4865
|
onImageUpload: g
|
|
4890
4866
|
}) {
|
|
4891
|
-
const [p, h] = M(!1), [s, d] = M(!1), [B, x] = M(!1), [v, T] = M(!1), [
|
|
4867
|
+
const [p, h] = M(!1), [s, d] = M(!1), [B, x] = M(!1), [v, T] = M(!1), [I, L] = M(!1), [Z, X] = M(null), [te, ve] = M("frac"), ee = z(null), se = z(null), _e = Ht(l), C = Za({
|
|
4892
4868
|
extensions: [
|
|
4893
|
-
...
|
|
4894
|
-
|
|
4895
|
-
|
|
4869
|
+
...mt({ placeholder: o }),
|
|
4870
|
+
ht,
|
|
4871
|
+
ut
|
|
4896
4872
|
],
|
|
4897
|
-
content:
|
|
4873
|
+
content: _e,
|
|
4898
4874
|
editable: i,
|
|
4899
4875
|
autofocus: w ? "end" : !1,
|
|
4900
4876
|
immediatelyRender: !1,
|
|
@@ -4902,14 +4878,14 @@ function xl({
|
|
|
4902
4878
|
// Debounced onChange — avoids getHTML() serialization on every keystroke
|
|
4903
4879
|
onUpdate: ({ editor: y }) => {
|
|
4904
4880
|
se.current && clearTimeout(se.current), se.current = setTimeout(() => {
|
|
4905
|
-
const k =
|
|
4881
|
+
const k = oa(y);
|
|
4906
4882
|
a?.(k);
|
|
4907
|
-
},
|
|
4883
|
+
}, qt);
|
|
4908
4884
|
},
|
|
4909
4885
|
editorProps: {
|
|
4910
4886
|
handleKeyDown: (y, k) => {
|
|
4911
4887
|
if ((k.ctrlKey || k.metaKey) && k.key === "s")
|
|
4912
|
-
return k.preventDefault(), C && n?.(
|
|
4888
|
+
return k.preventDefault(), C && n?.(oa(C)), !0;
|
|
4913
4889
|
if ((k.ctrlKey || k.metaKey) && k.key === "k") {
|
|
4914
4890
|
k.preventDefault();
|
|
4915
4891
|
const D = document.querySelector('[aria-label="Link"]');
|
|
@@ -4941,7 +4917,7 @@ function xl({
|
|
|
4941
4917
|
return xe && O(xe), !0;
|
|
4942
4918
|
}
|
|
4943
4919
|
}
|
|
4944
|
-
return !!(C &&
|
|
4920
|
+
return !!(C && Dt(C, k) || C && Lt(C, k));
|
|
4945
4921
|
}
|
|
4946
4922
|
}
|
|
4947
4923
|
}), G = b(
|
|
@@ -4960,7 +4936,7 @@ function xl({
|
|
|
4960
4936
|
}).run();
|
|
4961
4937
|
},
|
|
4962
4938
|
[C]
|
|
4963
|
-
),
|
|
4939
|
+
), we = b(
|
|
4964
4940
|
(y) => {
|
|
4965
4941
|
G(y);
|
|
4966
4942
|
},
|
|
@@ -4975,7 +4951,7 @@ function xl({
|
|
|
4975
4951
|
y.includes("\\begin{") || y.includes("\\frac") || y.length > 30 ? ce(y) : G(y);
|
|
4976
4952
|
},
|
|
4977
4953
|
[G, ce]
|
|
4978
|
-
),
|
|
4954
|
+
), ye = b(
|
|
4979
4955
|
(y) => {
|
|
4980
4956
|
y.includes("\\begin{") || y.length > 40 ? ce(y) : G(y);
|
|
4981
4957
|
},
|
|
@@ -4985,12 +4961,12 @@ function xl({
|
|
|
4985
4961
|
if (!C) return;
|
|
4986
4962
|
let D;
|
|
4987
4963
|
try {
|
|
4988
|
-
const F = await
|
|
4989
|
-
D =
|
|
4964
|
+
const F = await je(y);
|
|
4965
|
+
D = Le(ee.current?.clientWidth, F.width);
|
|
4990
4966
|
} catch {
|
|
4991
|
-
D =
|
|
4967
|
+
D = Le(ee.current?.clientWidth, 720);
|
|
4992
4968
|
}
|
|
4993
|
-
C.chain().focus().insertContent({ type: "image", attrs:
|
|
4969
|
+
C.chain().focus().insertContent({ type: "image", attrs: ze(y, k || "", D) }).run();
|
|
4994
4970
|
},
|
|
4995
4971
|
[C]
|
|
4996
4972
|
), O = b(
|
|
@@ -4998,29 +4974,29 @@ function xl({
|
|
|
4998
4974
|
if (C)
|
|
4999
4975
|
if (g)
|
|
5000
4976
|
try {
|
|
5001
|
-
const k = await g(y), D = await
|
|
5002
|
-
C.chain().focus().insertContent({ type: "image", attrs:
|
|
4977
|
+
const k = await g(y), D = await je(k), F = Le(ee.current?.clientWidth, D.width);
|
|
4978
|
+
C.chain().focus().insertContent({ type: "image", attrs: ze(k, "", F) }).run();
|
|
5003
4979
|
} catch {
|
|
5004
|
-
|
|
4980
|
+
console.error("Image upload failed");
|
|
5005
4981
|
}
|
|
5006
4982
|
else {
|
|
5007
4983
|
const k = new FileReader();
|
|
5008
4984
|
k.onload = () => {
|
|
5009
4985
|
const D = k.result;
|
|
5010
|
-
|
|
5011
|
-
const xe =
|
|
5012
|
-
C.chain().focus().insertContent({ type: "image", attrs:
|
|
4986
|
+
je(D).then((F) => {
|
|
4987
|
+
const xe = Le(ee.current?.clientWidth, F.width);
|
|
4988
|
+
C.chain().focus().insertContent({ type: "image", attrs: ze(D, "", xe) }).run();
|
|
5013
4989
|
}).catch(() => {
|
|
5014
|
-
const F =
|
|
5015
|
-
C.chain().focus().insertContent({ type: "image", attrs:
|
|
4990
|
+
const F = Le(ee.current?.clientWidth, 720);
|
|
4991
|
+
C.chain().focus().insertContent({ type: "image", attrs: ze(D, "", F) }).run();
|
|
5016
4992
|
});
|
|
5017
4993
|
}, k.readAsDataURL(y);
|
|
5018
4994
|
}
|
|
5019
4995
|
},
|
|
5020
4996
|
[C, g]
|
|
5021
|
-
),
|
|
4997
|
+
), Ae = b(() => {
|
|
5022
4998
|
if (!C) return;
|
|
5023
|
-
const y =
|
|
4999
|
+
const y = Ie(C);
|
|
5024
5000
|
if (!y) return;
|
|
5025
5001
|
const k = {
|
|
5026
5002
|
width: y.node.attrs.width || 720,
|
|
@@ -5030,11 +5006,11 @@ function xl({
|
|
|
5030
5006
|
title: String(y.node.attrs.title || ""),
|
|
5031
5007
|
maintainAspectRatio: !0
|
|
5032
5008
|
};
|
|
5033
|
-
|
|
5009
|
+
X(k), L(!0);
|
|
5034
5010
|
}, [C]), oe = b(
|
|
5035
5011
|
(y) => {
|
|
5036
5012
|
if (!C) return;
|
|
5037
|
-
const k =
|
|
5013
|
+
const k = Ie(C);
|
|
5038
5014
|
if (!k) return;
|
|
5039
5015
|
const D = C.state.tr;
|
|
5040
5016
|
D.setNodeMarkup(k.pos, void 0, {
|
|
@@ -5044,13 +5020,13 @@ function xl({
|
|
|
5044
5020
|
align: y.align,
|
|
5045
5021
|
alt: y.alt,
|
|
5046
5022
|
title: y.title
|
|
5047
|
-
}), C.view.dispatch(D), L(!1),
|
|
5023
|
+
}), C.view.dispatch(D), L(!1), X(null);
|
|
5048
5024
|
},
|
|
5049
5025
|
[C]
|
|
5050
|
-
),
|
|
5026
|
+
), Ne = b(
|
|
5051
5027
|
(y) => {
|
|
5052
5028
|
if (!C) return;
|
|
5053
|
-
const k =
|
|
5029
|
+
const k = Ie(C);
|
|
5054
5030
|
if (!k) return;
|
|
5055
5031
|
const D = C.state.tr;
|
|
5056
5032
|
D.setNodeMarkup(k.pos, void 0, {
|
|
@@ -5063,7 +5039,7 @@ function xl({
|
|
|
5063
5039
|
[C]
|
|
5064
5040
|
), J = b(() => {
|
|
5065
5041
|
if (!C) return;
|
|
5066
|
-
const y =
|
|
5042
|
+
const y = Ie(C);
|
|
5067
5043
|
if (!y) return;
|
|
5068
5044
|
const k = C.state.tr;
|
|
5069
5045
|
k.setNodeMarkup(y.pos, void 0, {
|
|
@@ -5083,24 +5059,24 @@ function xl({
|
|
|
5083
5059
|
},
|
|
5084
5060
|
children: [
|
|
5085
5061
|
i && /* @__PURE__ */ e(
|
|
5086
|
-
|
|
5062
|
+
Ct,
|
|
5087
5063
|
{
|
|
5088
5064
|
editor: C,
|
|
5089
5065
|
toolbarMode: c,
|
|
5090
5066
|
onInsertMath: (y = "frac") => {
|
|
5091
|
-
|
|
5067
|
+
ve(y), x(!0);
|
|
5092
5068
|
},
|
|
5093
5069
|
onInsertImage: () => T(!0),
|
|
5094
|
-
onEditImage:
|
|
5095
|
-
onSetImageAlign:
|
|
5070
|
+
onEditImage: Ae,
|
|
5071
|
+
onSetImageAlign: Ne,
|
|
5096
5072
|
onResetImagePosition: J
|
|
5097
5073
|
}
|
|
5098
5074
|
),
|
|
5099
5075
|
i && /* @__PURE__ */ t("div", { style: { position: "relative" }, children: [
|
|
5100
5076
|
/* @__PURE__ */ e(
|
|
5101
|
-
|
|
5077
|
+
At,
|
|
5102
5078
|
{
|
|
5103
|
-
onInsertLatex:
|
|
5079
|
+
onInsertLatex: we,
|
|
5104
5080
|
onToggleSymbols: () => {
|
|
5105
5081
|
h(!p), d(!1);
|
|
5106
5082
|
},
|
|
@@ -5110,14 +5086,14 @@ function xl({
|
|
|
5110
5086
|
}
|
|
5111
5087
|
),
|
|
5112
5088
|
p && /* @__PURE__ */ e(
|
|
5113
|
-
|
|
5089
|
+
Mt,
|
|
5114
5090
|
{
|
|
5115
5091
|
onInsert: ae,
|
|
5116
5092
|
onClose: () => h(!1)
|
|
5117
5093
|
}
|
|
5118
5094
|
),
|
|
5119
5095
|
s && /* @__PURE__ */ e(
|
|
5120
|
-
|
|
5096
|
+
Kt,
|
|
5121
5097
|
{
|
|
5122
5098
|
onInsert: he,
|
|
5123
5099
|
onClose: () => d(!1)
|
|
@@ -5134,21 +5110,21 @@ function xl({
|
|
|
5134
5110
|
maxHeight: f || void 0,
|
|
5135
5111
|
overflowY: f ? "auto" : void 0
|
|
5136
5112
|
},
|
|
5137
|
-
children: /* @__PURE__ */ e(
|
|
5113
|
+
children: /* @__PURE__ */ e(et, { editor: C })
|
|
5138
5114
|
}
|
|
5139
5115
|
),
|
|
5140
|
-
C && /* @__PURE__ */ e(
|
|
5116
|
+
C && /* @__PURE__ */ e(zt, { editor: C }),
|
|
5141
5117
|
B && /* @__PURE__ */ e(
|
|
5142
|
-
|
|
5118
|
+
xa,
|
|
5143
5119
|
{
|
|
5144
5120
|
isOpen: B,
|
|
5145
5121
|
initialTab: te,
|
|
5146
|
-
onInsert:
|
|
5122
|
+
onInsert: ye,
|
|
5147
5123
|
onClose: () => x(!1)
|
|
5148
5124
|
}
|
|
5149
5125
|
),
|
|
5150
5126
|
v && /* @__PURE__ */ e(me, { fallback: null, children: /* @__PURE__ */ e(
|
|
5151
|
-
|
|
5127
|
+
Ft,
|
|
5152
5128
|
{
|
|
5153
5129
|
isOpen: v,
|
|
5154
5130
|
onClose: () => T(!1),
|
|
@@ -5156,12 +5132,12 @@ function xl({
|
|
|
5156
5132
|
onImageUpload: g
|
|
5157
5133
|
}
|
|
5158
5134
|
) }),
|
|
5159
|
-
|
|
5160
|
-
|
|
5135
|
+
I && Z && /* @__PURE__ */ e(
|
|
5136
|
+
Rt,
|
|
5161
5137
|
{
|
|
5162
|
-
isOpen:
|
|
5138
|
+
isOpen: I,
|
|
5163
5139
|
onClose: () => {
|
|
5164
|
-
L(!1),
|
|
5140
|
+
L(!1), X(null);
|
|
5165
5141
|
},
|
|
5166
5142
|
onApply: oe,
|
|
5167
5143
|
initialData: Z
|
|
@@ -5171,27 +5147,27 @@ function xl({
|
|
|
5171
5147
|
}
|
|
5172
5148
|
);
|
|
5173
5149
|
}
|
|
5174
|
-
const
|
|
5175
|
-
return /* @__PURE__ */ e(me, { fallback: null, children: /* @__PURE__ */ e(
|
|
5150
|
+
const Ot = de(() => import("./LinkDialogImpl-DTHugWZM.js").then((l) => ({ default: l.LinkDialogImpl }))), $t = re.memo(function(a) {
|
|
5151
|
+
return /* @__PURE__ */ e(me, { fallback: null, children: /* @__PURE__ */ e(Ot, { ...a }) });
|
|
5176
5152
|
});
|
|
5177
|
-
|
|
5178
|
-
const
|
|
5179
|
-
return /* @__PURE__ */ e(me, { fallback: null, children: /* @__PURE__ */ e(
|
|
5153
|
+
$t.displayName = "LinkDialog";
|
|
5154
|
+
const Gt = de(() => import("./InsertTableDialogImpl-DZrLgDKN.js").then((l) => ({ default: l.InsertTableDialogImpl }))), Wt = re.memo(function(a) {
|
|
5155
|
+
return /* @__PURE__ */ e(me, { fallback: null, children: /* @__PURE__ */ e(Gt, { ...a }) });
|
|
5180
5156
|
});
|
|
5181
|
-
|
|
5182
|
-
const
|
|
5183
|
-
return /* @__PURE__ */ e(me, { fallback: null, children: /* @__PURE__ */ e(
|
|
5157
|
+
Wt.displayName = "InsertTableDialog";
|
|
5158
|
+
const jt = de(() => import("./CellPropertiesDialogImpl-HPT77uxM.js").then((l) => ({ default: l.CellPropertiesDialogImpl }))), Xt = re.memo(function(a) {
|
|
5159
|
+
return /* @__PURE__ */ e(me, { fallback: null, children: /* @__PURE__ */ e(jt, { ...a }) });
|
|
5184
5160
|
});
|
|
5185
|
-
|
|
5186
|
-
const
|
|
5187
|
-
return /* @__PURE__ */ e(me, { fallback: null, children: /* @__PURE__ */ e(
|
|
5161
|
+
Xt.displayName = "CellPropertiesDialog";
|
|
5162
|
+
const Ut = de(() => import("./TableTemplatesDialogImpl-D0sFSAKl.js").then((l) => ({ default: l.TableTemplatesDialogImpl }))), Yt = re.memo(function(a) {
|
|
5163
|
+
return /* @__PURE__ */ e(me, { fallback: null, children: /* @__PURE__ */ e(Ut, { ...a }) });
|
|
5188
5164
|
});
|
|
5189
|
-
|
|
5190
|
-
function
|
|
5165
|
+
Yt.displayName = "TableTemplatesDialog";
|
|
5166
|
+
function pl(l) {
|
|
5191
5167
|
const a = {};
|
|
5192
5168
|
return l.headerStyle === "light" ? a.th = "background-color: #f1f5f9; font-weight: 600;" : l.headerStyle === "dark" ? a.th = "background-color: #1e293b; color: white; font-weight: 600;" : l.headerStyle === "blue" && (a.th = "background-color: #3b82f6; color: white; font-weight: 600;"), l.borderStyle === "all" ? a["td, th"] = "border: 1px solid #cbd5e1;" : l.borderStyle === "horizontal" ? a["td, th"] = "border-top: 1px solid #cbd5e1; border-bottom: 1px solid #cbd5e1;" : l.borderStyle === "vertical" && (a["td, th"] = "border-left: 1px solid #cbd5e1; border-right: 1px solid #cbd5e1;"), a;
|
|
5193
5169
|
}
|
|
5194
|
-
const
|
|
5170
|
+
const Jt = [
|
|
5195
5171
|
{ id: "quad-formula", label: "Rumus ABC (Kuadrat)", latex: "x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}", category: "Algebra", level: "smp" },
|
|
5196
5172
|
{ id: "quad-eq", label: "Persamaan Kuadrat", latex: "ax^2 + bx + c = 0", category: "Algebra", level: "smp" },
|
|
5197
5173
|
{ id: "linear-eq", label: "Persamaan Linear", latex: "y = mx + c", category: "Algebra", level: "smp" },
|
|
@@ -5200,7 +5176,7 @@ const al = [
|
|
|
5200
5176
|
{ id: "abs-value", label: "Nilai Mutlak", latex: "|x - a| = b", category: "Algebra", level: "sma" },
|
|
5201
5177
|
{ id: "log-def", label: "Logaritma", latex: "\\log_a b = c \\iff a^c = b", category: "Algebra", level: "sma" },
|
|
5202
5178
|
{ id: "exponent-rule", label: "Aturan Eksponen", latex: "a^m \\cdot a^n = a^{m+n}", category: "Algebra", level: "smp" }
|
|
5203
|
-
],
|
|
5179
|
+
], Qt = [
|
|
5204
5180
|
{ id: "pythagoras", label: "Teorema Pythagoras", latex: "a^2 + b^2 = c^2", category: "Geometri", level: "smp" },
|
|
5205
5181
|
{ id: "circle-area", label: "Luas Lingkaran", latex: "L = \\pi r^2", category: "Geometri", level: "sd" },
|
|
5206
5182
|
{ id: "circle-circumference", label: "Keliling Lingkaran", latex: "K = 2\\pi r", category: "Geometri", level: "sd" },
|
|
@@ -5210,7 +5186,7 @@ const al = [
|
|
|
5210
5186
|
{ id: "cylinder-volume", label: "Volume Tabung", latex: "V = \\pi r^2 t", category: "Geometri", level: "smp" },
|
|
5211
5187
|
{ id: "cone-volume", label: "Volume Kerucut", latex: "V = \\frac{1}{3} \\pi r^2 t", category: "Geometri", level: "smp" },
|
|
5212
5188
|
{ id: "distance-2d", label: "Jarak Dua Titik", latex: "d = \\sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}", category: "Geometri", level: "sma" }
|
|
5213
|
-
],
|
|
5189
|
+
], Zt = [
|
|
5214
5190
|
{ id: "sin-def", label: "Sinus", latex: "\\sin \\theta = \\frac{\\text{depan}}{\\text{miring}}", category: "Trigonometri", level: "sma" },
|
|
5215
5191
|
{ id: "cos-def", label: "Cosinus", latex: "\\cos \\theta = \\frac{\\text{samping}}{\\text{miring}}", category: "Trigonometri", level: "sma" },
|
|
5216
5192
|
{ id: "tan-def", label: "Tangen", latex: "\\tan \\theta = \\frac{\\sin \\theta}{\\cos \\theta}", category: "Trigonometri", level: "sma" },
|
|
@@ -5218,14 +5194,14 @@ const al = [
|
|
|
5218
5194
|
{ id: "sin-rule", label: "Aturan Sinus", latex: "\\frac{a}{\\sin A} = \\frac{b}{\\sin B} = \\frac{c}{\\sin C}", category: "Trigonometri", level: "sma" },
|
|
5219
5195
|
{ id: "cos-rule", label: "Aturan Cosinus", latex: "c^2 = a^2 + b^2 - 2ab\\cos C", category: "Trigonometri", level: "sma" },
|
|
5220
5196
|
{ id: "double-angle-sin", label: "Sudut Ganda (Sin)", latex: "\\sin 2\\theta = 2\\sin \\theta \\cos \\theta", category: "Trigonometri", level: "sma" }
|
|
5221
|
-
],
|
|
5197
|
+
], el = [
|
|
5222
5198
|
{ id: "derivative-def", label: "Definisi Turunan", latex: "f'(x) = \\lim_{h \\to 0} \\frac{f(x+h) - f(x)}{h}", category: "Kalkulus", level: "sma" },
|
|
5223
5199
|
{ id: "power-rule", label: "Aturan Pangkat", latex: "\\frac{d}{dx} x^n = nx^{n-1}", category: "Kalkulus", level: "sma" },
|
|
5224
5200
|
{ id: "chain-rule", label: "Aturan Rantai", latex: "\\frac{dy}{dx} = \\frac{dy}{du} \\cdot \\frac{du}{dx}", category: "Kalkulus", level: "sma" },
|
|
5225
5201
|
{ id: "definite-integral", label: "Integral Tentu", latex: "\\int_a^b f(x)\\, dx = F(b) - F(a)", category: "Kalkulus", level: "sma" },
|
|
5226
5202
|
{ id: "indef-integral", label: "Integral Tak Tentu", latex: "\\int x^n\\, dx = \\frac{x^{n+1}}{n+1} + C", category: "Kalkulus", level: "sma" },
|
|
5227
5203
|
{ id: "limit-def", label: "Limit", latex: "\\lim_{x \\to a} f(x) = L", category: "Kalkulus", level: "sma" }
|
|
5228
|
-
],
|
|
5204
|
+
], al = [
|
|
5229
5205
|
{ id: "mean", label: "Rata-rata (Mean)", latex: "\\bar{x} = \\frac{\\sum_{i=1}^{n} x_i}{n}", category: "Statistik", level: "smp" },
|
|
5230
5206
|
{ id: "median", label: "Median", latex: "Me = x_{\\frac{n+1}{2}}", category: "Statistik", level: "smp" },
|
|
5231
5207
|
{ id: "std-dev", label: "Simpangan Baku", latex: "s = \\sqrt{\\frac{\\sum_{i=1}^{n}(x_i - \\bar{x})^2}{n-1}}", category: "Statistik", level: "sma" },
|
|
@@ -5233,7 +5209,7 @@ const al = [
|
|
|
5233
5209
|
{ id: "combination", label: "Kombinasi", latex: "C(n, r) = \\binom{n}{r} = \\frac{n!}{r!(n-r)!}", category: "Statistik", level: "sma" },
|
|
5234
5210
|
{ id: "permutation", label: "Permutasi", latex: "P(n, r) = \\frac{n!}{(n-r)!}", category: "Statistik", level: "sma" },
|
|
5235
5211
|
{ id: "probability", label: "Peluang", latex: "P(A) = \\frac{n(A)}{n(S)}", category: "Statistik", level: "smp" }
|
|
5236
|
-
],
|
|
5212
|
+
], tl = [
|
|
5237
5213
|
{ id: "velocity", label: "Kecepatan", latex: "v = \\frac{s}{t}", category: "Fisika", level: "smp" },
|
|
5238
5214
|
{ id: "acceleration", label: "Percepatan", latex: "a = \\frac{\\Delta v}{\\Delta t}", category: "Fisika", level: "smp" },
|
|
5239
5215
|
{ id: "newton-2", label: "Hukum Newton II", latex: "F = m \\cdot a", category: "Fisika", level: "smp" },
|
|
@@ -5243,63 +5219,63 @@ const al = [
|
|
|
5243
5219
|
{ id: "ohm-law", label: "Hukum Ohm", latex: "V = I \\cdot R", category: "Fisika", level: "sma" },
|
|
5244
5220
|
{ id: "power-physics", label: "Daya", latex: "P = \\frac{W}{t}", category: "Fisika", level: "sma" },
|
|
5245
5221
|
{ id: "gravity", label: "Gravitasi Newton", latex: "F = G \\frac{m_1 m_2}{r^2}", category: "Fisika", level: "sma" }
|
|
5246
|
-
],
|
|
5222
|
+
], ll = [
|
|
5247
5223
|
{ id: "mol", label: "Jumlah Mol", latex: "n = \\frac{m}{M_r}", category: "Kimia", level: "sma" },
|
|
5248
5224
|
{ id: "molar-conc", label: "Molaritas", latex: "M = \\frac{n}{V}", category: "Kimia", level: "sma" },
|
|
5249
5225
|
{ id: "ideal-gas", label: "Gas Ideal", latex: "PV = nRT", category: "Kimia", level: "sma" },
|
|
5250
5226
|
{ id: "ph", label: "pH", latex: "pH = -\\log [H^+]", category: "Kimia", level: "sma" },
|
|
5251
5227
|
{ id: "dilution", label: "Pengenceran", latex: "M_1 V_1 = M_2 V_2", category: "Kimia", level: "sma" }
|
|
5252
|
-
],
|
|
5228
|
+
], Ee = [
|
|
5229
|
+
...Jt,
|
|
5230
|
+
...Qt,
|
|
5231
|
+
...Zt,
|
|
5232
|
+
...el,
|
|
5253
5233
|
...al,
|
|
5254
5234
|
...tl,
|
|
5255
|
-
...ll
|
|
5256
|
-
...nl,
|
|
5257
|
-
...il,
|
|
5258
|
-
...rl,
|
|
5259
|
-
...sl
|
|
5235
|
+
...ll
|
|
5260
5236
|
];
|
|
5261
|
-
function
|
|
5262
|
-
if (l === "all") return
|
|
5237
|
+
function hl(l) {
|
|
5238
|
+
if (l === "all") return Ee;
|
|
5263
5239
|
const n = {
|
|
5264
5240
|
sd: ["sd"],
|
|
5265
5241
|
smp: ["sd", "smp"],
|
|
5266
5242
|
sma: ["sd", "smp", "sma"]
|
|
5267
5243
|
}[l] || ["sd", "smp", "sma"];
|
|
5268
|
-
return
|
|
5244
|
+
return Ee.filter((i) => n.includes(i.level));
|
|
5269
5245
|
}
|
|
5270
|
-
function
|
|
5271
|
-
return
|
|
5246
|
+
function ul(l) {
|
|
5247
|
+
return Ee.filter((a) => a.category === l);
|
|
5272
5248
|
}
|
|
5273
|
-
function
|
|
5274
|
-
return [...new Set(
|
|
5249
|
+
function xl() {
|
|
5250
|
+
return [...new Set(Ee.map((l) => l.category))];
|
|
5275
5251
|
}
|
|
5276
5252
|
export {
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5253
|
+
Xt as C,
|
|
5254
|
+
Rt as I,
|
|
5255
|
+
$t as L,
|
|
5256
|
+
Ct as M,
|
|
5257
|
+
Mt as S,
|
|
5258
|
+
fa as T,
|
|
5259
|
+
zt as W,
|
|
5260
|
+
Wt as a,
|
|
5261
|
+
ut as b,
|
|
5262
|
+
ht as c,
|
|
5263
|
+
dl as d,
|
|
5264
|
+
At as e,
|
|
5265
|
+
xa as f,
|
|
5266
|
+
Yt as g,
|
|
5267
|
+
Kt as h,
|
|
5268
|
+
da as i,
|
|
5269
|
+
ma as j,
|
|
5270
|
+
mt as k,
|
|
5271
|
+
oa as l,
|
|
5272
|
+
ol as m,
|
|
5273
|
+
xl as n,
|
|
5274
|
+
pl as o,
|
|
5275
|
+
ul as p,
|
|
5276
|
+
hl as q,
|
|
5277
|
+
Ee as r,
|
|
5278
|
+
Ht as s,
|
|
5279
|
+
ml as t,
|
|
5280
|
+
Et as u
|
|
5305
5281
|
};
|