erl-mathtextx-editor 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CellPropertiesDialogImpl-CgWcr4bD.js → CellPropertiesDialogImpl-D2iy6DEr.js} +1 -1
- package/dist/{ContentViewer-DcvxXP9t.js → ContentViewer-COGXSiwX.js} +1 -1
- package/dist/{ImageInsertDialog-Di0MXcC2.js → ImageInsertDialog-Cn-IrnHN.js} +50 -55
- package/dist/{InsertTableDialogImpl-CKirXRqE.js → InsertTableDialogImpl-Dpo1pByJ.js} +1 -1
- package/dist/{LinkDialogImpl-BSz0F-xG.js → LinkDialogImpl-C1YeHJFJ.js} +27 -27
- package/dist/{TableTemplatesDialogImpl-DrdqLQLH.js → TableTemplatesDialogImpl-CMzxe328.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/{index-DYxMVo98.js → index-jQUBaVKf.js} +857 -885
- package/dist/{mathlive-BwNIIOwE.js → mathlive-Bi6rleK6.js} +113 -113
- package/dist/{tiptap-BhJ7Fu9S.js → tiptap-Bc1mIOtx.js} +26 -26
- package/dist/{viewer-deps-xNPNdmbe.js → viewer-deps-CjbAqdti.js} +1 -1
- package/dist/viewer.js +1 -1
- package/package.json +4 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as e, jsxs as a, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { N as je, a as Ue, R as
|
|
4
|
-
import "./ContentViewer-
|
|
1
|
+
import { jsx as e, jsxs as a, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import ce, { useRef as I, useState as M, useEffect as W, useCallback as g, useMemo as we, lazy as ne, Suspense as Q, useId as Lt } from "react";
|
|
3
|
+
import { N as je, a as Ue, R as Re, m as Ce, E as Ye, T as _t, A as St, b as zt, c as Dt, d as It, U as Bt, S as Pt, e as Vt, f as Rt, C as Et, g as Kt, h as $t, i as Ft, j as Ot, k as Wt, F as qt, l as Gt, H as Xt, L as jt, I as Ut, P as Yt, n as Jt, u as Zt, o as Qt } from "./tiptap-Bc1mIOtx.js";
|
|
4
|
+
import "./ContentViewer-COGXSiwX.js";
|
|
5
5
|
function Ze(n) {
|
|
6
6
|
const t = n.closest(".mtx-content");
|
|
7
7
|
if (!t)
|
|
@@ -18,130 +18,129 @@ function Qe(n, t) {
|
|
|
18
18
|
return l ? l === "auto" || l.endsWith("%") || l.endsWith("px") ? l : /^\d+(\.\d+)?$/.test(l) ? `${Math.round(Number(l))}px` : l : t;
|
|
19
19
|
}
|
|
20
20
|
function ea(n) {
|
|
21
|
-
const { node: t, updateAttributes: l, selected: i, getPos: c, editor: r } = n, s = t.attrs, o =
|
|
22
|
-
}),
|
|
23
|
-
}), p =
|
|
24
|
-
|
|
25
|
-
h.current = s,
|
|
21
|
+
const { node: t, updateAttributes: l, selected: i, getPos: c, editor: r } = n, s = t.attrs, o = I(null), b = I(!1), N = I(null), u = I({ x: 0, y: 0, width: 0, height: 0 }), h = I(s), d = I(() => {
|
|
22
|
+
}), v = I(!1), f = I({ x: 0, y: 0, offsetX: 0, offsetY: 0 }), B = I(() => {
|
|
23
|
+
}), p = I(null), x = I(null), H = I({ x: Number(s.offsetX || 0), y: Number(s.offsetY || 0) }), P = I(s.align === "full" ? "center" : s.align || "center"), z = I({ width: 0, height: 0 }), ee = I(null), j = I(null), le = I(null), [be, te] = M(!1), [oe, Ae] = M(!1), [C, q] = M(null), [me, Ne] = M(!1), [, ae] = M(0);
|
|
24
|
+
W(() => {
|
|
25
|
+
h.current = s, H.current = {
|
|
26
26
|
x: Number(s.offsetX || 0),
|
|
27
27
|
y: Number(s.offsetY || 0)
|
|
28
|
-
},
|
|
29
|
-
}, [s]),
|
|
30
|
-
if (!
|
|
31
|
-
const
|
|
28
|
+
}, P.current = s.align === "full" ? "center" : s.align || "center";
|
|
29
|
+
}, [s]), W(() => {
|
|
30
|
+
if (!me) return;
|
|
31
|
+
const k = window.setTimeout(() => {
|
|
32
32
|
Ne(!1);
|
|
33
33
|
}, 180);
|
|
34
|
-
return () => window.clearTimeout(
|
|
35
|
-
}, [
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const V = x.closest(".mtx-content");
|
|
34
|
+
return () => window.clearTimeout(k);
|
|
35
|
+
}, [me]);
|
|
36
|
+
const ue = g(() => {
|
|
37
|
+
j.current?.remove(), le.current?.remove(), j.current = null, le.current = null;
|
|
38
|
+
}, []), ye = g(() => {
|
|
39
|
+
const k = o.current;
|
|
40
|
+
if (!k) return null;
|
|
41
|
+
const V = k.closest(".mtx-content");
|
|
43
42
|
if (!V) return null;
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
const
|
|
47
|
-
|
|
43
|
+
const F = V.closest(".mtx-editor") || V;
|
|
44
|
+
if (ee.current = F, !le.current) {
|
|
45
|
+
const R = document.createElement("div");
|
|
46
|
+
R.className = "mtx-image-drag-zone", R.setAttribute("aria-hidden", "true"), F.appendChild(R), le.current = R;
|
|
48
47
|
}
|
|
49
|
-
if (!
|
|
50
|
-
const
|
|
51
|
-
|
|
48
|
+
if (!j.current) {
|
|
49
|
+
const R = document.createElement("div");
|
|
50
|
+
R.className = "mtx-image-drag-guide", R.setAttribute("aria-hidden", "true"), F.appendChild(R), j.current = R;
|
|
52
51
|
}
|
|
53
|
-
return { wrapper:
|
|
54
|
-
}, []),
|
|
52
|
+
return { wrapper: k, editorContent: V, host: F };
|
|
53
|
+
}, []), pe = g((k) => {
|
|
55
54
|
const V = ye();
|
|
56
55
|
if (!V) return;
|
|
57
|
-
const { editorContent: K, host:
|
|
58
|
-
if (!
|
|
59
|
-
|
|
60
|
-
const Ee =
|
|
61
|
-
|
|
56
|
+
const { editorContent: K, host: F } = V, R = F.getBoundingClientRect(), X = K.getBoundingClientRect(), U = X.left - R.left, xe = X.top - R.top, ke = X.width, De = X.height, fe = le.current, ie = j.current;
|
|
57
|
+
if (!fe || !ie) return;
|
|
58
|
+
fe.className = "mtx-image-drag-zone", ie.className = "mtx-image-drag-guide", fe.style.left = `${Math.round(U)}px`, fe.style.top = `${Math.round(xe)}px`, fe.style.width = `${Math.round(ke)}px`, fe.style.height = `${Math.round(De)}px`, ie.style.left = `${Math.round(U)}px`, ie.style.top = `${Math.round(xe)}px`, ie.style.width = `${Math.round(ke)}px`, ie.style.height = `${Math.round(De)}px`, ie.style.borderLeft = "2px dashed rgba(37, 99, 235, 0.5)", ie.style.transform = "translateX(-50%)";
|
|
59
|
+
const Ee = k === "left" ? U + ke * 0.33 : k === "right" ? U + ke * 0.66 : U + ke * 0.5;
|
|
60
|
+
ie.style.left = `${Math.round(Ee)}px`;
|
|
62
61
|
}, [ye]);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}, [
|
|
66
|
-
const
|
|
67
|
-
const V = o.current, K =
|
|
68
|
-
if (!
|
|
62
|
+
W(() => () => {
|
|
63
|
+
ue();
|
|
64
|
+
}, [ue]);
|
|
65
|
+
const O = g((k) => {
|
|
66
|
+
const V = o.current, K = N.current;
|
|
67
|
+
if (!b.current || !V || !K)
|
|
69
68
|
return;
|
|
70
|
-
const
|
|
71
|
-
let
|
|
72
|
-
K.includes("e") ?
|
|
73
|
-
width: Math.round(
|
|
74
|
-
height: Math.round(
|
|
69
|
+
const F = k.clientX - u.current.x, R = k.clientY - u.current.y;
|
|
70
|
+
let X = u.current.width, U = u.current.height;
|
|
71
|
+
K.includes("e") ? X = Math.max(50, u.current.width + F) : K.includes("w") && (X = Math.max(50, u.current.width - F)), K.includes("s") ? U = Math.max(50, u.current.height + R) : K.includes("n") && (U = Math.max(50, u.current.height - R)), x.current = {
|
|
72
|
+
width: Math.round(X),
|
|
73
|
+
height: Math.round(U)
|
|
75
74
|
}, p.current === null && (p.current = window.requestAnimationFrame(() => {
|
|
76
|
-
const xe =
|
|
75
|
+
const xe = x.current;
|
|
77
76
|
if (!V || !xe) {
|
|
78
77
|
p.current = null;
|
|
79
78
|
return;
|
|
80
79
|
}
|
|
81
80
|
V.style.width = `${xe.width}px`, h.current.height && h.current.height !== "auto" && (V.style.height = `${xe.height}px`), p.current = null;
|
|
82
81
|
}));
|
|
83
|
-
}, []),
|
|
84
|
-
const
|
|
85
|
-
if (!
|
|
82
|
+
}, []), Te = g(() => {
|
|
83
|
+
const k = o.current;
|
|
84
|
+
if (!b.current || !k)
|
|
86
85
|
return;
|
|
87
|
-
const V =
|
|
86
|
+
const V = k.offsetWidth, K = k.offsetHeight;
|
|
88
87
|
l({
|
|
89
88
|
width: Math.round(V),
|
|
90
89
|
height: h.current.height === "auto" ? "auto" : Math.round(K)
|
|
91
|
-
}),
|
|
92
|
-
}, [
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}, [
|
|
96
|
-
const
|
|
90
|
+
}), b.current = !1, N.current = null, te(!1), x.current = null, window.removeEventListener("mousemove", O), window.removeEventListener("mouseup", d.current);
|
|
91
|
+
}, [O, l]);
|
|
92
|
+
W(() => {
|
|
93
|
+
d.current = Te;
|
|
94
|
+
}, [Te]);
|
|
95
|
+
const de = g((k) => {
|
|
97
96
|
const V = o.current;
|
|
98
|
-
if (!
|
|
97
|
+
if (!v.current || !V)
|
|
99
98
|
return;
|
|
100
|
-
const K = f.current.offsetX + (
|
|
101
|
-
|
|
99
|
+
const K = f.current.offsetX + (k.clientX - f.current.x), F = f.current.offsetY + (k.clientY - f.current.y);
|
|
100
|
+
H.current = {
|
|
102
101
|
x: Math.round(K),
|
|
103
|
-
y: Math.round(
|
|
102
|
+
y: Math.round(F)
|
|
104
103
|
}, p.current === null && (p.current = window.requestAnimationFrame(() => {
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
104
|
+
const R = o.current;
|
|
105
|
+
if (R) {
|
|
106
|
+
R.style.transform = `translate3d(${H.current.x}px, ${H.current.y}px, 0)`;
|
|
107
|
+
const X = Ze(R);
|
|
108
|
+
X !== P.current && (P.current = X, q(X), ae((U) => U + 1)), pe(P.current);
|
|
110
109
|
}
|
|
111
110
|
p.current = null;
|
|
112
111
|
}));
|
|
113
|
-
}, [
|
|
114
|
-
const
|
|
115
|
-
if (!
|
|
112
|
+
}, [pe]), ve = g(() => {
|
|
113
|
+
const k = o.current;
|
|
114
|
+
if (!v.current || !k)
|
|
116
115
|
return;
|
|
117
|
-
const V =
|
|
118
|
-
|
|
116
|
+
const V = P.current || Ze(k);
|
|
117
|
+
v.current = !1, Ae(!1), q(null), Ne(!0), ue(), l({
|
|
119
118
|
align: V,
|
|
120
119
|
offsetX: 0,
|
|
121
120
|
offsetY: 0
|
|
122
|
-
}),
|
|
123
|
-
}, [
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
}), k.style.transform = "translate3d(0px, 0px, 0)", H.current = { x: 0, y: 0 }, window.removeEventListener("mousemove", de), window.removeEventListener("mouseup", B.current);
|
|
122
|
+
}, [de, ue, l]);
|
|
123
|
+
W(() => {
|
|
124
|
+
B.current = ve;
|
|
126
125
|
}, [ve]);
|
|
127
|
-
const
|
|
128
|
-
|
|
126
|
+
const J = g((k, V) => {
|
|
127
|
+
k.preventDefault(), k.stopPropagation();
|
|
129
128
|
const K = o.current;
|
|
130
129
|
if (!K)
|
|
131
130
|
return;
|
|
132
|
-
const
|
|
131
|
+
const F = K.getBoundingClientRect();
|
|
133
132
|
u.current = {
|
|
134
|
-
x:
|
|
135
|
-
y:
|
|
136
|
-
width:
|
|
137
|
-
height:
|
|
138
|
-
},
|
|
139
|
-
}, [
|
|
140
|
-
if (
|
|
133
|
+
x: k.clientX,
|
|
134
|
+
y: k.clientY,
|
|
135
|
+
width: F.width,
|
|
136
|
+
height: F.height
|
|
137
|
+
}, b.current = !0, N.current = V, te(!0), window.addEventListener("mousemove", O), window.addEventListener("mouseup", d.current);
|
|
138
|
+
}, [O]), y = g((k) => {
|
|
139
|
+
if (k.button !== 0 || b.current || k.target.closest(".mtx-image-resize-handles"))
|
|
141
140
|
return;
|
|
142
|
-
if (
|
|
143
|
-
const
|
|
144
|
-
typeof
|
|
141
|
+
if (k.preventDefault(), k.stopPropagation(), typeof c == "function") {
|
|
142
|
+
const F = c();
|
|
143
|
+
typeof F == "number" && r.commands.setNodeSelection(F);
|
|
145
144
|
}
|
|
146
145
|
(h.current.align === "center" || h.current.align === "full") && (l({
|
|
147
146
|
align: "left",
|
|
@@ -152,36 +151,36 @@ function ea(n) {
|
|
|
152
151
|
align: "left",
|
|
153
152
|
offsetX: 0,
|
|
154
153
|
offsetY: 0
|
|
155
|
-
}),
|
|
156
|
-
x:
|
|
157
|
-
y:
|
|
154
|
+
}), P.current = h.current.align === "full" ? "center" : h.current.align || "center", q(P.current), pe(P.current), f.current = {
|
|
155
|
+
x: k.clientX,
|
|
156
|
+
y: k.clientY,
|
|
158
157
|
offsetX: Number(h.current.offsetX || 0),
|
|
159
158
|
offsetY: Number(h.current.offsetY || 0)
|
|
160
159
|
};
|
|
161
160
|
const K = o.current;
|
|
162
|
-
K && (
|
|
161
|
+
K && (z.current = {
|
|
163
162
|
width: K.offsetWidth,
|
|
164
163
|
height: K.offsetHeight
|
|
165
|
-
}),
|
|
164
|
+
}), H.current = {
|
|
166
165
|
x: f.current.offsetX,
|
|
167
166
|
y: f.current.offsetY
|
|
168
|
-
},
|
|
169
|
-
}, [r.commands, c,
|
|
170
|
-
|
|
171
|
-
p.current !== null && window.cancelAnimationFrame(p.current), window.removeEventListener("mousemove",
|
|
172
|
-
}, [
|
|
173
|
-
const
|
|
167
|
+
}, v.current = !0, Ae(!0), window.addEventListener("mousemove", de), window.addEventListener("mouseup", B.current);
|
|
168
|
+
}, [r.commands, c, de, l, pe]);
|
|
169
|
+
W(() => () => {
|
|
170
|
+
p.current !== null && window.cancelAnimationFrame(p.current), window.removeEventListener("mousemove", O), window.removeEventListener("mouseup", d.current), window.removeEventListener("mousemove", de), window.removeEventListener("mouseup", B.current);
|
|
171
|
+
}, [de, O]);
|
|
172
|
+
const w = `mtx-image--${s.align || "center"}`, D = Qe(s.width, "auto"), $ = Qe(s.height, "auto"), ge = C ? `mtx-image-snap-preview--${C}` : "";
|
|
174
173
|
return /* @__PURE__ */ e(
|
|
175
174
|
je,
|
|
176
175
|
{
|
|
177
176
|
as: "figure",
|
|
178
|
-
className: `mtx-image-figure ${
|
|
177
|
+
className: `mtx-image-figure ${w} ${i ? "mtx-image--selected" : ""} ${oe ? "mtx-image--dragging" : ""} ${me ? "mtx-image--snap-animating" : ""} ${ge}`,
|
|
179
178
|
contentEditable: !1,
|
|
180
179
|
children: /* @__PURE__ */ a(
|
|
181
180
|
"div",
|
|
182
181
|
{
|
|
183
182
|
ref: o,
|
|
184
|
-
className: `mtx-image-wrapper ${
|
|
183
|
+
className: `mtx-image-wrapper ${oe ? "is-dragging" : ""}`,
|
|
185
184
|
style: {
|
|
186
185
|
width: D,
|
|
187
186
|
height: $,
|
|
@@ -190,11 +189,11 @@ function ea(n) {
|
|
|
190
189
|
maxWidth: "100%",
|
|
191
190
|
verticalAlign: "top",
|
|
192
191
|
transform: `translate3d(${Number(s.offsetX || 0)}px, ${Number(s.offsetY || 0)}px, 0)`,
|
|
193
|
-
cursor: i ?
|
|
194
|
-
willChange:
|
|
195
|
-
contain:
|
|
192
|
+
cursor: i ? oe ? "grabbing" : "grab" : "default",
|
|
193
|
+
willChange: oe ? "transform" : be ? "width, height" : "auto",
|
|
194
|
+
contain: be ? "layout style" : "none"
|
|
196
195
|
},
|
|
197
|
-
onMouseDown:
|
|
196
|
+
onMouseDown: y,
|
|
198
197
|
children: [
|
|
199
198
|
/* @__PURE__ */ e(
|
|
200
199
|
"img",
|
|
@@ -213,16 +212,16 @@ function ea(n) {
|
|
|
213
212
|
}
|
|
214
213
|
),
|
|
215
214
|
i && /* @__PURE__ */ a("div", { className: "mtx-image-resize-handles", children: [
|
|
216
|
-
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--nw", onMouseDown: (
|
|
217
|
-
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--ne", onMouseDown: (
|
|
218
|
-
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--sw", onMouseDown: (
|
|
219
|
-
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--se", onMouseDown: (
|
|
220
|
-
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--n", onMouseDown: (
|
|
221
|
-
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--e", onMouseDown: (
|
|
222
|
-
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--s", onMouseDown: (
|
|
223
|
-
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--w", onMouseDown: (
|
|
215
|
+
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--nw", onMouseDown: (k) => J(k, "nw") }),
|
|
216
|
+
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--ne", onMouseDown: (k) => J(k, "ne") }),
|
|
217
|
+
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--sw", onMouseDown: (k) => J(k, "sw") }),
|
|
218
|
+
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--se", onMouseDown: (k) => J(k, "se") }),
|
|
219
|
+
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--n", onMouseDown: (k) => J(k, "n") }),
|
|
220
|
+
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--e", onMouseDown: (k) => J(k, "e") }),
|
|
221
|
+
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--s", onMouseDown: (k) => J(k, "s") }),
|
|
222
|
+
/* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--w", onMouseDown: (k) => J(k, "w") })
|
|
224
223
|
] }),
|
|
225
|
-
|
|
224
|
+
be && /* @__PURE__ */ e("div", { className: "mtx-image-resize-overlay" })
|
|
226
225
|
]
|
|
227
226
|
}
|
|
228
227
|
)
|
|
@@ -230,14 +229,14 @@ function ea(n) {
|
|
|
230
229
|
);
|
|
231
230
|
}
|
|
232
231
|
const ta = ({ node: n, updateAttributes: t }) => {
|
|
233
|
-
const l =
|
|
234
|
-
|
|
232
|
+
const l = I(null), [i, c] = M(n.attrs.formula || "sin(x)"), [r, s] = M(n.attrs.xDomain || [-10, 10]), [o, b] = M(n.attrs.yDomain || [-5, 5]);
|
|
233
|
+
W(() => {
|
|
235
234
|
let h = !0;
|
|
236
|
-
return l.current && import("./index-CLGg8QXp.js").then((
|
|
235
|
+
return l.current && import("./index-CLGg8QXp.js").then((d) => d.i).then((d) => {
|
|
237
236
|
if (!h) return;
|
|
238
|
-
const
|
|
237
|
+
const v = d.default;
|
|
239
238
|
try {
|
|
240
|
-
|
|
239
|
+
v({
|
|
241
240
|
target: l.current,
|
|
242
241
|
// Use non-null assertion as we checked graphRef.current
|
|
243
242
|
width: 500,
|
|
@@ -256,11 +255,11 @@ const ta = ({ node: n, updateAttributes: t }) => {
|
|
|
256
255
|
} catch (f) {
|
|
257
256
|
console.error("Graph rendering error:", f);
|
|
258
257
|
}
|
|
259
|
-
}).catch((
|
|
258
|
+
}).catch((d) => console.error("Failed to load function-plot", d)), () => {
|
|
260
259
|
h = !1;
|
|
261
260
|
};
|
|
262
261
|
}, [i, r, o]);
|
|
263
|
-
const
|
|
262
|
+
const N = (h) => {
|
|
264
263
|
c(h.target.value);
|
|
265
264
|
}, u = () => {
|
|
266
265
|
t({ formula: i, xDomain: r, yDomain: o });
|
|
@@ -272,7 +271,7 @@ const ta = ({ node: n, updateAttributes: t }) => {
|
|
|
272
271
|
{
|
|
273
272
|
type: "text",
|
|
274
273
|
value: i,
|
|
275
|
-
onChange:
|
|
274
|
+
onChange: N,
|
|
276
275
|
placeholder: "f(x) = ...",
|
|
277
276
|
onBlur: u,
|
|
278
277
|
className: "mtx-graph-input"
|
|
@@ -287,9 +286,9 @@ const ta = ({ node: n, updateAttributes: t }) => {
|
|
|
287
286
|
] }),
|
|
288
287
|
/* @__PURE__ */ a("div", { className: "mtx-graph-domain-group", children: [
|
|
289
288
|
/* @__PURE__ */ e("span", { className: "mtx-graph-domain-label", children: "Y Axis" }),
|
|
290
|
-
/* @__PURE__ */ e("input", { className: "mtx-graph-domain-input", type: "number", value: o[0], onChange: (h) =>
|
|
289
|
+
/* @__PURE__ */ e("input", { className: "mtx-graph-domain-input", type: "number", value: o[0], onChange: (h) => b([Number(h.target.value), o[1]]), onBlur: u }),
|
|
291
290
|
/* @__PURE__ */ e("span", { className: "mtx-graph-domain-separator", children: "to" }),
|
|
292
|
-
/* @__PURE__ */ e("input", { className: "mtx-graph-domain-input", type: "number", value: o[1], onChange: (h) =>
|
|
291
|
+
/* @__PURE__ */ e("input", { className: "mtx-graph-domain-input", type: "number", value: o[1], onChange: (h) => b([o[0], Number(h.target.value)]), onBlur: u })
|
|
293
292
|
] })
|
|
294
293
|
] })
|
|
295
294
|
] }),
|
|
@@ -320,10 +319,10 @@ const ta = ({ node: n, updateAttributes: t }) => {
|
|
|
320
319
|
];
|
|
321
320
|
},
|
|
322
321
|
renderHTML({ HTMLAttributes: n }) {
|
|
323
|
-
return ["div",
|
|
322
|
+
return ["div", Ce(n, { "data-type": "graph" })];
|
|
324
323
|
},
|
|
325
324
|
addNodeView() {
|
|
326
|
-
return
|
|
325
|
+
return Re(ta);
|
|
327
326
|
},
|
|
328
327
|
addCommands() {
|
|
329
328
|
return {
|
|
@@ -372,26 +371,26 @@ const ta = ({ node: n, updateAttributes: t }) => {
|
|
|
372
371
|
addCommands() {
|
|
373
372
|
const n = (i, c, r) => {
|
|
374
373
|
var s;
|
|
375
|
-
const o = (s = i
|
|
374
|
+
const o = (s = i?.doc) === null || s === void 0 ? void 0 : s.nodeAt(c);
|
|
376
375
|
if (o) {
|
|
377
|
-
const
|
|
378
|
-
let h =
|
|
379
|
-
if (
|
|
380
|
-
const { indent:
|
|
376
|
+
const b = (o.attrs.indent || 0) + r, { minLevel: N, maxLevel: u } = this.options;
|
|
377
|
+
let h = b;
|
|
378
|
+
if (b < N ? h = N : b > u && (h = u), h !== o.attrs.indent) {
|
|
379
|
+
const { indent: d, ...v } = o.attrs, f = h > N ? { ...v, indent: h } : v;
|
|
381
380
|
return i.setNodeMarkup(c, o.type, f, o.marks);
|
|
382
381
|
}
|
|
383
382
|
}
|
|
384
383
|
return i;
|
|
385
384
|
}, t = (i, c) => {
|
|
386
385
|
const { doc: r, selection: s } = i;
|
|
387
|
-
if (r && s && (s instanceof _t || s instanceof
|
|
388
|
-
const { from: o, to:
|
|
389
|
-
r.nodesBetween(o,
|
|
386
|
+
if (r && s && (s instanceof _t || s instanceof St)) {
|
|
387
|
+
const { from: o, to: b } = s;
|
|
388
|
+
r.nodesBetween(o, b, (N, u) => this.options.types.includes(N.type.name) ? (i = n(i, u, c), !1) : !0);
|
|
390
389
|
}
|
|
391
390
|
return i;
|
|
392
391
|
}, l = (i) => () => ({ tr: c, state: r, dispatch: s }) => {
|
|
393
392
|
const { selection: o } = r;
|
|
394
|
-
return c = c.setSelection(o), c = t(c, i), c.docChanged ? (s
|
|
393
|
+
return c = c.setSelection(o), c = t(c, i), c.docChanged ? (s?.(c), !0) : !1;
|
|
395
394
|
};
|
|
396
395
|
return {
|
|
397
396
|
indent: l(1),
|
|
@@ -404,7 +403,7 @@ const ta = ({ node: n, updateAttributes: t }) => {
|
|
|
404
403
|
"Shift-Tab": () => this.editor.commands.outdent()
|
|
405
404
|
};
|
|
406
405
|
}
|
|
407
|
-
}), la = ["plain", "light", "dark", "blue", "striped", "minimal"],
|
|
406
|
+
}), la = ["plain", "light", "dark", "blue", "striped", "minimal"], Fe = ["paragraph", "listItem", "taskItem"], ia = Ye.create({
|
|
408
407
|
name: "indentBackspace",
|
|
409
408
|
addKeyboardShortcuts() {
|
|
410
409
|
return {
|
|
@@ -413,21 +412,21 @@ const ta = ({ node: n, updateAttributes: t }) => {
|
|
|
413
412
|
if (!t || l.parentOffset !== 0)
|
|
414
413
|
return !1;
|
|
415
414
|
const i = l.parent.type.name;
|
|
416
|
-
return !
|
|
415
|
+
return !Fe.includes(i) || !n.can().outdent() ? !1 : n.commands.outdent();
|
|
417
416
|
},
|
|
418
417
|
Tab: () => {
|
|
419
418
|
const { editor: n } = this, { empty: t, $from: l } = n.state.selection;
|
|
420
419
|
if (!t)
|
|
421
420
|
return !1;
|
|
422
421
|
const i = l.parent.type.name;
|
|
423
|
-
return !
|
|
422
|
+
return !Fe.includes(i) || !n.can().indent() ? !1 : n.commands.indent();
|
|
424
423
|
},
|
|
425
424
|
"Shift-Tab": () => {
|
|
426
425
|
const { editor: n } = this, { empty: t, $from: l } = n.state.selection;
|
|
427
426
|
if (!t)
|
|
428
427
|
return !1;
|
|
429
428
|
const i = l.parent.type.name;
|
|
430
|
-
return !
|
|
429
|
+
return !Fe.includes(i) || !n.can().outdent() ? !1 : n.commands.outdent();
|
|
431
430
|
}
|
|
432
431
|
};
|
|
433
432
|
}
|
|
@@ -448,7 +447,7 @@ function et(n) {
|
|
|
448
447
|
const t = String(n).trim();
|
|
449
448
|
return t ? t === "auto" || t.endsWith("%") || t.endsWith("px") ? t : /^\d+(\.\d+)?$/.test(t) ? `${Math.round(Number(t))}px` : t : null;
|
|
450
449
|
}
|
|
451
|
-
const sa =
|
|
450
|
+
const sa = zt.extend({
|
|
452
451
|
addAttributes() {
|
|
453
452
|
return {
|
|
454
453
|
theme: {
|
|
@@ -465,7 +464,7 @@ const sa = St.extend({
|
|
|
465
464
|
const t = typeof n.theme == "string" ? n.theme : "plain", { theme: l, class: i, ...c } = n;
|
|
466
465
|
return [
|
|
467
466
|
"table",
|
|
468
|
-
|
|
467
|
+
Ce(c, {
|
|
469
468
|
class: ["mtx-table", i, `mtx-table--${t}`].filter(Boolean).join(" ")
|
|
470
469
|
}),
|
|
471
470
|
["tbody", 0]
|
|
@@ -473,70 +472,68 @@ const sa = St.extend({
|
|
|
473
472
|
}
|
|
474
473
|
}), ra = Dt.extend({
|
|
475
474
|
addAttributes() {
|
|
476
|
-
var n;
|
|
477
475
|
return {
|
|
478
|
-
...
|
|
476
|
+
...this.parent?.(),
|
|
479
477
|
backgroundColor: {
|
|
480
478
|
default: null,
|
|
481
|
-
parseHTML: (
|
|
479
|
+
parseHTML: (n) => n.style.backgroundColor || null,
|
|
482
480
|
renderHTML: () => ({})
|
|
483
481
|
},
|
|
484
482
|
textAlign: {
|
|
485
483
|
default: null,
|
|
486
|
-
parseHTML: (
|
|
484
|
+
parseHTML: (n) => n.style.textAlign || null,
|
|
487
485
|
renderHTML: () => ({})
|
|
488
486
|
},
|
|
489
487
|
verticalAlign: {
|
|
490
488
|
default: null,
|
|
491
|
-
parseHTML: (
|
|
489
|
+
parseHTML: (n) => n.style.verticalAlign || null,
|
|
492
490
|
renderHTML: () => ({})
|
|
493
491
|
},
|
|
494
492
|
width: {
|
|
495
493
|
default: null,
|
|
496
|
-
parseHTML: (
|
|
494
|
+
parseHTML: (n) => n.style.width || null,
|
|
497
495
|
renderHTML: () => ({})
|
|
498
496
|
}
|
|
499
497
|
};
|
|
500
498
|
},
|
|
501
499
|
renderHTML({ HTMLAttributes: n }) {
|
|
502
500
|
const t = ut(n), { backgroundColor: l, textAlign: i, verticalAlign: c, width: r, ...s } = n;
|
|
503
|
-
return ["td",
|
|
501
|
+
return ["td", Ce(s, t ? { style: t } : {}), 0];
|
|
504
502
|
}
|
|
505
|
-
}), ca =
|
|
503
|
+
}), ca = It.extend({
|
|
506
504
|
addAttributes() {
|
|
507
|
-
var n;
|
|
508
505
|
return {
|
|
509
|
-
...
|
|
506
|
+
...this.parent?.(),
|
|
510
507
|
backgroundColor: {
|
|
511
508
|
default: null,
|
|
512
|
-
parseHTML: (
|
|
509
|
+
parseHTML: (n) => n.style.backgroundColor || null,
|
|
513
510
|
renderHTML: () => ({})
|
|
514
511
|
},
|
|
515
512
|
textAlign: {
|
|
516
513
|
default: null,
|
|
517
|
-
parseHTML: (
|
|
514
|
+
parseHTML: (n) => n.style.textAlign || null,
|
|
518
515
|
renderHTML: () => ({})
|
|
519
516
|
},
|
|
520
517
|
verticalAlign: {
|
|
521
518
|
default: null,
|
|
522
|
-
parseHTML: (
|
|
519
|
+
parseHTML: (n) => n.style.verticalAlign || null,
|
|
523
520
|
renderHTML: () => ({})
|
|
524
521
|
},
|
|
525
522
|
width: {
|
|
526
523
|
default: null,
|
|
527
|
-
parseHTML: (
|
|
524
|
+
parseHTML: (n) => n.style.width || null,
|
|
528
525
|
renderHTML: () => ({})
|
|
529
526
|
}
|
|
530
527
|
};
|
|
531
528
|
},
|
|
532
529
|
renderHTML({ HTMLAttributes: n }) {
|
|
533
530
|
const t = ut(n), { backgroundColor: l, textAlign: i, verticalAlign: c, width: r, ...s } = n;
|
|
534
|
-
return ["th",
|
|
531
|
+
return ["th", Ce(s, t ? { style: t } : {}), 0];
|
|
535
532
|
}
|
|
536
533
|
});
|
|
537
534
|
function oa(n = {}) {
|
|
538
535
|
return [
|
|
539
|
-
|
|
536
|
+
Ft.configure({
|
|
540
537
|
heading: {
|
|
541
538
|
levels: [1, 2, 3, 4]
|
|
542
539
|
},
|
|
@@ -551,10 +548,10 @@ function oa(n = {}) {
|
|
|
551
548
|
}
|
|
552
549
|
}
|
|
553
550
|
}),
|
|
551
|
+
Bt,
|
|
554
552
|
Pt,
|
|
555
553
|
Vt,
|
|
556
|
-
|
|
557
|
-
Ft.configure({
|
|
554
|
+
Ot.configure({
|
|
558
555
|
HTMLAttributes: {
|
|
559
556
|
class: "mtx-task-list"
|
|
560
557
|
}
|
|
@@ -565,7 +562,7 @@ function oa(n = {}) {
|
|
|
565
562
|
class: "mtx-task-item"
|
|
566
563
|
}
|
|
567
564
|
}),
|
|
568
|
-
|
|
565
|
+
Rt,
|
|
569
566
|
Et,
|
|
570
567
|
qt.configure({
|
|
571
568
|
types: ["textStyle"]
|
|
@@ -640,7 +637,7 @@ function oa(n = {}) {
|
|
|
640
637
|
];
|
|
641
638
|
},
|
|
642
639
|
addNodeView() {
|
|
643
|
-
return
|
|
640
|
+
return Re(ea);
|
|
644
641
|
},
|
|
645
642
|
addAttributes() {
|
|
646
643
|
return {
|
|
@@ -678,25 +675,25 @@ function oa(n = {}) {
|
|
|
678
675
|
width: r,
|
|
679
676
|
height: s,
|
|
680
677
|
align: o = "center",
|
|
681
|
-
offsetX:
|
|
682
|
-
offsetY:
|
|
678
|
+
offsetX: b = 0,
|
|
679
|
+
offsetY: N = 0,
|
|
683
680
|
...u
|
|
684
|
-
} = t, h = et(r),
|
|
681
|
+
} = t, h = et(r), d = et(s), v = Ce(u, {
|
|
685
682
|
src: l,
|
|
686
683
|
alt: i,
|
|
687
684
|
title: c,
|
|
688
|
-
style: ["display: block", "max-width: 100%",
|
|
689
|
-
}), f = Number(
|
|
685
|
+
style: ["display: block", "max-width: 100%", d && d !== "auto" ? `height: ${d}` : "height: auto"].filter(Boolean).join("; ")
|
|
686
|
+
}), f = Number(b) !== 0 || Number(N) !== 0, B = [h ? `width: ${h}` : null, d && d !== "auto" ? `height: ${d}` : null, f ? `transform: translate3d(${Number(b)}px, ${Number(N)}px, 0)` : null].filter(Boolean).join("; ");
|
|
690
687
|
return [
|
|
691
688
|
"figure",
|
|
692
689
|
{
|
|
693
690
|
class: `mtx-image-figure mtx-image--${o}`,
|
|
694
691
|
"data-type": "image",
|
|
695
|
-
"data-offset-x": String(
|
|
696
|
-
"data-offset-y": String(
|
|
697
|
-
style:
|
|
692
|
+
"data-offset-x": String(b),
|
|
693
|
+
"data-offset-y": String(N),
|
|
694
|
+
style: B || null
|
|
698
695
|
},
|
|
699
|
-
["img",
|
|
696
|
+
["img", v]
|
|
700
697
|
];
|
|
701
698
|
}
|
|
702
699
|
}).configure({
|
|
@@ -736,34 +733,34 @@ function oa(n = {}) {
|
|
|
736
733
|
];
|
|
737
734
|
}
|
|
738
735
|
function ma({ onInsert: n }) {
|
|
739
|
-
const [t, l] =
|
|
736
|
+
const [t, l] = M(0), [i, c] = M(0), r = 10, s = 10, o = (u, h) => {
|
|
740
737
|
l(u), c(h);
|
|
741
|
-
},
|
|
738
|
+
}, b = () => {
|
|
742
739
|
l(0), c(0);
|
|
743
|
-
},
|
|
740
|
+
}, N = () => {
|
|
744
741
|
if (t > 0 && i > 0) {
|
|
745
742
|
let u = `\\begin{pmatrix}
|
|
746
743
|
`;
|
|
747
744
|
for (let h = 0; h < t; h++) {
|
|
748
|
-
const
|
|
749
|
-
u += " " +
|
|
745
|
+
const d = Array(i).fill("#?").join(" & ");
|
|
746
|
+
u += " " + d + (h < t - 1 ? " \\\\" : "") + `
|
|
750
747
|
`;
|
|
751
748
|
}
|
|
752
749
|
u += "\\end{pmatrix}", n(u);
|
|
753
750
|
}
|
|
754
751
|
};
|
|
755
|
-
return /* @__PURE__ */ a("div", { className: "mtx-matrix-grid-selector", onMouseLeave:
|
|
752
|
+
return /* @__PURE__ */ a("div", { className: "mtx-matrix-grid-selector", onMouseLeave: b, children: [
|
|
756
753
|
/* @__PURE__ */ e("div", { className: "mtx-matrix-grid-label", children: t > 0 ? `${t}×${i}` : "Pilih Ukuran Matriks" }),
|
|
757
|
-
/* @__PURE__ */ e("div", { className: "mtx-matrix-grid-squares", children: Array.from({ length: r }).map((u, h) => /* @__PURE__ */ e("div", { className: "mtx-matrix-grid-row", children: Array.from({ length: s }).map((
|
|
758
|
-
const f = h < t &&
|
|
754
|
+
/* @__PURE__ */ e("div", { className: "mtx-matrix-grid-squares", children: Array.from({ length: r }).map((u, h) => /* @__PURE__ */ e("div", { className: "mtx-matrix-grid-row", children: Array.from({ length: s }).map((d, v) => {
|
|
755
|
+
const f = h < t && v < i;
|
|
759
756
|
return /* @__PURE__ */ e(
|
|
760
757
|
"div",
|
|
761
758
|
{
|
|
762
759
|
className: `mtx-matrix-grid-cell ${f ? "is-active" : ""}`,
|
|
763
|
-
onMouseEnter: () => o(h + 1,
|
|
764
|
-
onClick:
|
|
760
|
+
onMouseEnter: () => o(h + 1, v + 1),
|
|
761
|
+
onClick: N
|
|
765
762
|
},
|
|
766
|
-
|
|
763
|
+
v
|
|
767
764
|
);
|
|
768
765
|
}) }, h)) })
|
|
769
766
|
] });
|
|
@@ -771,7 +768,7 @@ function ma({ onInsert: n }) {
|
|
|
771
768
|
function tt() {
|
|
772
769
|
return window.mathVirtualKeyboard;
|
|
773
770
|
}
|
|
774
|
-
const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }),
|
|
771
|
+
const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), m = () => /* @__PURE__ */ e("span", { className: "mt-ph mt-ph--sm" }), L = ({ t: n }) => /* @__PURE__ */ e("span", { className: "mt-txt-icon", children: n }), Oe = [
|
|
775
772
|
// ---- Tab 1: Fractions & Roots ----
|
|
776
773
|
{
|
|
777
774
|
id: "frac",
|
|
@@ -792,9 +789,9 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
792
789
|
icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
|
|
793
790
|
/* @__PURE__ */ e(S, {}),
|
|
794
791
|
/* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
|
|
795
|
-
/* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e(
|
|
792
|
+
/* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e(m, {}) }),
|
|
796
793
|
/* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
|
|
797
|
-
/* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e(
|
|
794
|
+
/* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e(m, {}) })
|
|
798
795
|
] })
|
|
799
796
|
] }),
|
|
800
797
|
latex: "#?\\frac{#?}{#?}",
|
|
@@ -814,9 +811,9 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
814
811
|
/* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e(S, {}) }),
|
|
815
812
|
/* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
|
|
816
813
|
/* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ a("span", { className: "mt-icon-stack mt-icon-stack--sm", children: [
|
|
817
|
-
/* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e(
|
|
814
|
+
/* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e(m, {}) }),
|
|
818
815
|
/* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
|
|
819
|
-
/* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e(
|
|
816
|
+
/* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e(m, {}) })
|
|
820
817
|
] }) })
|
|
821
818
|
] }),
|
|
822
819
|
latex: "\\cfrac{#?}{\\cfrac{#?}{#?}}",
|
|
@@ -841,7 +838,7 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
841
838
|
},
|
|
842
839
|
{
|
|
843
840
|
icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
|
|
844
|
-
/* @__PURE__ */ e("sup", { className: "mt-icon-idx", children: /* @__PURE__ */ e(
|
|
841
|
+
/* @__PURE__ */ e("sup", { className: "mt-icon-idx", children: /* @__PURE__ */ e(m, {}) }),
|
|
845
842
|
/* @__PURE__ */ e("span", { className: "mt-icon-sqrt", children: "√" }),
|
|
846
843
|
/* @__PURE__ */ e("span", { className: "mt-icon-sqrt-bar", children: /* @__PURE__ */ e(S, {}) })
|
|
847
844
|
] }),
|
|
@@ -853,7 +850,7 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
853
850
|
{
|
|
854
851
|
icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
|
|
855
852
|
/* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
|
|
856
|
-
/* @__PURE__ */ e("sup", { children: /* @__PURE__ */ e(
|
|
853
|
+
/* @__PURE__ */ e("sup", { children: /* @__PURE__ */ e(m, {}) })
|
|
857
854
|
] }),
|
|
858
855
|
latex: "#?^{#?}",
|
|
859
856
|
tip: "Pangkat / Superscript"
|
|
@@ -861,7 +858,7 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
861
858
|
{
|
|
862
859
|
icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
|
|
863
860
|
/* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
|
|
864
|
-
/* @__PURE__ */ e("sub", { children: /* @__PURE__ */ e(
|
|
861
|
+
/* @__PURE__ */ e("sub", { children: /* @__PURE__ */ e(m, {}) })
|
|
865
862
|
] }),
|
|
866
863
|
latex: "#?_{#?}",
|
|
867
864
|
tip: "Subskrip"
|
|
@@ -869,8 +866,8 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
869
866
|
{
|
|
870
867
|
icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
|
|
871
868
|
/* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
|
|
872
|
-
/* @__PURE__ */ e("sub", { children: /* @__PURE__ */ e(
|
|
873
|
-
/* @__PURE__ */ e("sup", { children: /* @__PURE__ */ e(
|
|
869
|
+
/* @__PURE__ */ e("sub", { children: /* @__PURE__ */ e(m, {}) }),
|
|
870
|
+
/* @__PURE__ */ e("sup", { children: /* @__PURE__ */ e(m, {}) })
|
|
874
871
|
] }),
|
|
875
872
|
latex: "#?_{#?}^{#?}",
|
|
876
873
|
tip: "Pangkat + subskrip"
|
|
@@ -878,7 +875,7 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
878
875
|
{
|
|
879
876
|
icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
|
|
880
877
|
/* @__PURE__ */ e("span", { className: "mt-sym", children: "e" }),
|
|
881
|
-
/* @__PURE__ */ e("sup", { children: /* @__PURE__ */ e(
|
|
878
|
+
/* @__PURE__ */ e("sup", { children: /* @__PURE__ */ e(m, {}) })
|
|
882
879
|
] }),
|
|
883
880
|
latex: "e^{#?}",
|
|
884
881
|
tip: "Eksponen e"
|
|
@@ -886,7 +883,7 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
886
883
|
{
|
|
887
884
|
icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
|
|
888
885
|
/* @__PURE__ */ e("span", { className: "mt-sym", children: "10" }),
|
|
889
|
-
/* @__PURE__ */ e("sup", { children: /* @__PURE__ */ e(
|
|
886
|
+
/* @__PURE__ */ e("sup", { children: /* @__PURE__ */ e(m, {}) })
|
|
890
887
|
] }),
|
|
891
888
|
latex: "10^{#?}",
|
|
892
889
|
tip: "Pangkat 10"
|
|
@@ -901,9 +898,9 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
901
898
|
},
|
|
902
899
|
{
|
|
903
900
|
icon: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
|
|
904
|
-
/* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e(
|
|
901
|
+
/* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e(m, {}) }),
|
|
905
902
|
/* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
|
|
906
|
-
/* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e(
|
|
903
|
+
/* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e(m, {}) })
|
|
907
904
|
] }),
|
|
908
905
|
latex: "\\tfrac{#?}{#?}",
|
|
909
906
|
tip: "Pecahan kecil (text)"
|
|
@@ -933,9 +930,9 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
933
930
|
icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
|
|
934
931
|
/* @__PURE__ */ e("span", { className: "mt-icon-sqrt", children: "√" }),
|
|
935
932
|
/* @__PURE__ */ e("span", { className: "mt-icon-sqrt-bar", children: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
|
|
936
|
-
/* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e(
|
|
933
|
+
/* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e(m, {}) }),
|
|
937
934
|
/* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
|
|
938
|
-
/* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e(
|
|
935
|
+
/* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e(m, {}) })
|
|
939
936
|
] }) })
|
|
940
937
|
] }),
|
|
941
938
|
latex: "\\sqrt{\\frac{#?}{#?}}",
|
|
@@ -1165,12 +1162,12 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
1165
1162
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: "(" }),
|
|
1166
1163
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
|
|
1167
1164
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1168
|
-
/* @__PURE__ */ e(
|
|
1169
|
-
/* @__PURE__ */ e(
|
|
1165
|
+
/* @__PURE__ */ e(m, {}),
|
|
1166
|
+
/* @__PURE__ */ e(m, {})
|
|
1170
1167
|
] }),
|
|
1171
1168
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1172
|
-
/* @__PURE__ */ e(
|
|
1173
|
-
/* @__PURE__ */ e(
|
|
1169
|
+
/* @__PURE__ */ e(m, {}),
|
|
1170
|
+
/* @__PURE__ */ e(m, {})
|
|
1174
1171
|
] })
|
|
1175
1172
|
] }),
|
|
1176
1173
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: ")" })
|
|
@@ -1183,19 +1180,19 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
1183
1180
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: "(" }),
|
|
1184
1181
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
|
|
1185
1182
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1186
|
-
/* @__PURE__ */ e(
|
|
1187
|
-
/* @__PURE__ */ e(
|
|
1188
|
-
/* @__PURE__ */ e(
|
|
1183
|
+
/* @__PURE__ */ e(m, {}),
|
|
1184
|
+
/* @__PURE__ */ e(m, {}),
|
|
1185
|
+
/* @__PURE__ */ e(m, {})
|
|
1189
1186
|
] }),
|
|
1190
1187
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1191
|
-
/* @__PURE__ */ e(
|
|
1192
|
-
/* @__PURE__ */ e(
|
|
1193
|
-
/* @__PURE__ */ e(
|
|
1188
|
+
/* @__PURE__ */ e(m, {}),
|
|
1189
|
+
/* @__PURE__ */ e(m, {}),
|
|
1190
|
+
/* @__PURE__ */ e(m, {})
|
|
1194
1191
|
] }),
|
|
1195
1192
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1196
|
-
/* @__PURE__ */ e(
|
|
1197
|
-
/* @__PURE__ */ e(
|
|
1198
|
-
/* @__PURE__ */ e(
|
|
1193
|
+
/* @__PURE__ */ e(m, {}),
|
|
1194
|
+
/* @__PURE__ */ e(m, {}),
|
|
1195
|
+
/* @__PURE__ */ e(m, {})
|
|
1199
1196
|
] })
|
|
1200
1197
|
] }),
|
|
1201
1198
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: ")" })
|
|
@@ -1208,12 +1205,12 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
1208
1205
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: "[" }),
|
|
1209
1206
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
|
|
1210
1207
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1211
|
-
/* @__PURE__ */ e(
|
|
1212
|
-
/* @__PURE__ */ e(
|
|
1208
|
+
/* @__PURE__ */ e(m, {}),
|
|
1209
|
+
/* @__PURE__ */ e(m, {})
|
|
1213
1210
|
] }),
|
|
1214
1211
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1215
|
-
/* @__PURE__ */ e(
|
|
1216
|
-
/* @__PURE__ */ e(
|
|
1212
|
+
/* @__PURE__ */ e(m, {}),
|
|
1213
|
+
/* @__PURE__ */ e(m, {})
|
|
1217
1214
|
] })
|
|
1218
1215
|
] }),
|
|
1219
1216
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: "]" })
|
|
@@ -1226,19 +1223,19 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
1226
1223
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: "[" }),
|
|
1227
1224
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
|
|
1228
1225
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1229
|
-
/* @__PURE__ */ e(
|
|
1230
|
-
/* @__PURE__ */ e(
|
|
1231
|
-
/* @__PURE__ */ e(
|
|
1226
|
+
/* @__PURE__ */ e(m, {}),
|
|
1227
|
+
/* @__PURE__ */ e(m, {}),
|
|
1228
|
+
/* @__PURE__ */ e(m, {})
|
|
1232
1229
|
] }),
|
|
1233
1230
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1234
|
-
/* @__PURE__ */ e(
|
|
1235
|
-
/* @__PURE__ */ e(
|
|
1236
|
-
/* @__PURE__ */ e(
|
|
1231
|
+
/* @__PURE__ */ e(m, {}),
|
|
1232
|
+
/* @__PURE__ */ e(m, {}),
|
|
1233
|
+
/* @__PURE__ */ e(m, {})
|
|
1237
1234
|
] }),
|
|
1238
1235
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1239
|
-
/* @__PURE__ */ e(
|
|
1240
|
-
/* @__PURE__ */ e(
|
|
1241
|
-
/* @__PURE__ */ e(
|
|
1236
|
+
/* @__PURE__ */ e(m, {}),
|
|
1237
|
+
/* @__PURE__ */ e(m, {}),
|
|
1238
|
+
/* @__PURE__ */ e(m, {})
|
|
1242
1239
|
] })
|
|
1243
1240
|
] }),
|
|
1244
1241
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: "]" })
|
|
@@ -1251,12 +1248,12 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
1251
1248
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: "|" }),
|
|
1252
1249
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
|
|
1253
1250
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1254
|
-
/* @__PURE__ */ e(
|
|
1255
|
-
/* @__PURE__ */ e(
|
|
1251
|
+
/* @__PURE__ */ e(m, {}),
|
|
1252
|
+
/* @__PURE__ */ e(m, {})
|
|
1256
1253
|
] }),
|
|
1257
1254
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1258
|
-
/* @__PURE__ */ e(
|
|
1259
|
-
/* @__PURE__ */ e(
|
|
1255
|
+
/* @__PURE__ */ e(m, {}),
|
|
1256
|
+
/* @__PURE__ */ e(m, {})
|
|
1260
1257
|
] })
|
|
1261
1258
|
] }),
|
|
1262
1259
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: "|" })
|
|
@@ -1269,12 +1266,12 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
1269
1266
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: "‖" }),
|
|
1270
1267
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
|
|
1271
1268
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1272
|
-
/* @__PURE__ */ e(
|
|
1273
|
-
/* @__PURE__ */ e(
|
|
1269
|
+
/* @__PURE__ */ e(m, {}),
|
|
1270
|
+
/* @__PURE__ */ e(m, {})
|
|
1274
1271
|
] }),
|
|
1275
1272
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1276
|
-
/* @__PURE__ */ e(
|
|
1277
|
-
/* @__PURE__ */ e(
|
|
1273
|
+
/* @__PURE__ */ e(m, {}),
|
|
1274
|
+
/* @__PURE__ */ e(m, {})
|
|
1278
1275
|
] })
|
|
1279
1276
|
] }),
|
|
1280
1277
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: "‖" })
|
|
@@ -1288,8 +1285,8 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
1288
1285
|
icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
|
|
1289
1286
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: "(" }),
|
|
1290
1287
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
|
|
1291
|
-
/* @__PURE__ */ e("span", { className: "mt-icon-grid-row", children: /* @__PURE__ */ e(
|
|
1292
|
-
/* @__PURE__ */ e("span", { className: "mt-icon-grid-row", children: /* @__PURE__ */ e(
|
|
1288
|
+
/* @__PURE__ */ e("span", { className: "mt-icon-grid-row", children: /* @__PURE__ */ e(m, {}) }),
|
|
1289
|
+
/* @__PURE__ */ e("span", { className: "mt-icon-grid-row", children: /* @__PURE__ */ e(m, {}) })
|
|
1293
1290
|
] }),
|
|
1294
1291
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: ")" })
|
|
1295
1292
|
] }),
|
|
@@ -1300,9 +1297,9 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
1300
1297
|
icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
|
|
1301
1298
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: "(" }),
|
|
1302
1299
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
|
|
1303
|
-
/* @__PURE__ */ e("span", { className: "mt-icon-grid-row", children: /* @__PURE__ */ e(
|
|
1304
|
-
/* @__PURE__ */ e("span", { className: "mt-icon-grid-row", children: /* @__PURE__ */ e(
|
|
1305
|
-
/* @__PURE__ */ e("span", { className: "mt-icon-grid-row", children: /* @__PURE__ */ e(
|
|
1300
|
+
/* @__PURE__ */ e("span", { className: "mt-icon-grid-row", children: /* @__PURE__ */ e(m, {}) }),
|
|
1301
|
+
/* @__PURE__ */ e("span", { className: "mt-icon-grid-row", children: /* @__PURE__ */ e(m, {}) }),
|
|
1302
|
+
/* @__PURE__ */ e("span", { className: "mt-icon-grid-row", children: /* @__PURE__ */ e(m, {}) })
|
|
1306
1303
|
] }),
|
|
1307
1304
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: ")" })
|
|
1308
1305
|
] }),
|
|
@@ -1313,8 +1310,8 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
1313
1310
|
icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
|
|
1314
1311
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: "(" }),
|
|
1315
1312
|
/* @__PURE__ */ e("span", { className: "mt-icon-grid", children: /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1316
|
-
/* @__PURE__ */ e(
|
|
1317
|
-
/* @__PURE__ */ e(
|
|
1313
|
+
/* @__PURE__ */ e(m, {}),
|
|
1314
|
+
/* @__PURE__ */ e(m, {})
|
|
1318
1315
|
] }) }),
|
|
1319
1316
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: ")" })
|
|
1320
1317
|
] }),
|
|
@@ -1326,12 +1323,12 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
1326
1323
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: "{" }),
|
|
1327
1324
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
|
|
1328
1325
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1329
|
-
/* @__PURE__ */ e(
|
|
1330
|
-
/* @__PURE__ */ e(
|
|
1326
|
+
/* @__PURE__ */ e(m, {}),
|
|
1327
|
+
/* @__PURE__ */ e(m, {})
|
|
1331
1328
|
] }),
|
|
1332
1329
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1333
|
-
/* @__PURE__ */ e(
|
|
1334
|
-
/* @__PURE__ */ e(
|
|
1330
|
+
/* @__PURE__ */ e(m, {}),
|
|
1331
|
+
/* @__PURE__ */ e(m, {})
|
|
1335
1332
|
] })
|
|
1336
1333
|
] })
|
|
1337
1334
|
] }),
|
|
@@ -1343,16 +1340,16 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
1343
1340
|
/* @__PURE__ */ e("span", { className: "mt-brak", children: "{" }),
|
|
1344
1341
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
|
|
1345
1342
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1346
|
-
/* @__PURE__ */ e(
|
|
1347
|
-
/* @__PURE__ */ e(
|
|
1343
|
+
/* @__PURE__ */ e(m, {}),
|
|
1344
|
+
/* @__PURE__ */ e(m, {})
|
|
1348
1345
|
] }),
|
|
1349
1346
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1350
|
-
/* @__PURE__ */ e(
|
|
1351
|
-
/* @__PURE__ */ e(
|
|
1347
|
+
/* @__PURE__ */ e(m, {}),
|
|
1348
|
+
/* @__PURE__ */ e(m, {})
|
|
1352
1349
|
] }),
|
|
1353
1350
|
/* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
|
|
1354
|
-
/* @__PURE__ */ e(
|
|
1355
|
-
/* @__PURE__ */ e(
|
|
1351
|
+
/* @__PURE__ */ e(m, {}),
|
|
1352
|
+
/* @__PURE__ */ e(m, {})
|
|
1356
1353
|
] })
|
|
1357
1354
|
] })
|
|
1358
1355
|
] }),
|
|
@@ -1628,9 +1625,9 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
1628
1625
|
},
|
|
1629
1626
|
{
|
|
1630
1627
|
icon: /* @__PURE__ */ e("span", { className: "mt-icon-row", children: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
|
|
1631
|
-
/* @__PURE__ */ e("sup", { className: "mt-icon-idx", children: /* @__PURE__ */ e(
|
|
1628
|
+
/* @__PURE__ */ e("sup", { className: "mt-icon-idx", children: /* @__PURE__ */ e(m, {}) }),
|
|
1632
1629
|
/* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "Σ" }),
|
|
1633
|
-
/* @__PURE__ */ e("sub", { className: "mt-icon-idx", children: /* @__PURE__ */ e(
|
|
1630
|
+
/* @__PURE__ */ e("sub", { className: "mt-icon-idx", children: /* @__PURE__ */ e(m, {}) })
|
|
1634
1631
|
] }) }),
|
|
1635
1632
|
latex: "\\sum_{#?}^{#?} #?",
|
|
1636
1633
|
tip: "Sigma (batas)"
|
|
@@ -1642,9 +1639,9 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
1642
1639
|
},
|
|
1643
1640
|
{
|
|
1644
1641
|
icon: /* @__PURE__ */ e("span", { className: "mt-icon-row", children: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
|
|
1645
|
-
/* @__PURE__ */ e("sup", { className: "mt-icon-idx", children: /* @__PURE__ */ e(
|
|
1642
|
+
/* @__PURE__ */ e("sup", { className: "mt-icon-idx", children: /* @__PURE__ */ e(m, {}) }),
|
|
1646
1643
|
/* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "∏" }),
|
|
1647
|
-
/* @__PURE__ */ e("sub", { className: "mt-icon-idx", children: /* @__PURE__ */ e(
|
|
1644
|
+
/* @__PURE__ */ e("sub", { className: "mt-icon-idx", children: /* @__PURE__ */ e(m, {}) })
|
|
1648
1645
|
] }) }),
|
|
1649
1646
|
latex: "\\prod_{#?}^{#?} #?",
|
|
1650
1647
|
tip: "Produk (batas)"
|
|
@@ -1689,9 +1686,9 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
1689
1686
|
},
|
|
1690
1687
|
{
|
|
1691
1688
|
icon: /* @__PURE__ */ e("span", { className: "mt-icon-row", children: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
|
|
1692
|
-
/* @__PURE__ */ e("sup", { className: "mt-icon-idx", children: /* @__PURE__ */ e(
|
|
1689
|
+
/* @__PURE__ */ e("sup", { className: "mt-icon-idx", children: /* @__PURE__ */ e(m, {}) }),
|
|
1693
1690
|
/* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "∫" }),
|
|
1694
|
-
/* @__PURE__ */ e("sub", { className: "mt-icon-idx", children: /* @__PURE__ */ e(
|
|
1691
|
+
/* @__PURE__ */ e("sub", { className: "mt-icon-idx", children: /* @__PURE__ */ e(m, {}) })
|
|
1695
1692
|
] }) }),
|
|
1696
1693
|
latex: "\\int_{#?}^{#?} #?\\, d#?",
|
|
1697
1694
|
tip: "Integral tentu"
|
|
@@ -1986,60 +1983,56 @@ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /*
|
|
|
1986
1983
|
}
|
|
1987
1984
|
];
|
|
1988
1985
|
function pt({ isOpen: n, onInsert: t, onClose: l, initialLatex: i = "", initialTab: c = "frac" }) {
|
|
1989
|
-
const [r, s] =
|
|
1990
|
-
|
|
1986
|
+
const [r, s] = M(i), [o, b] = M(c), N = I(null), u = I(null);
|
|
1987
|
+
W(() => {
|
|
1991
1988
|
if (!n || !u.current) return;
|
|
1992
|
-
import("./mathlive-
|
|
1989
|
+
import("./mathlive-Bi6rleK6.js").then((H) => {
|
|
1993
1990
|
if (!u.current) return;
|
|
1994
|
-
const
|
|
1995
|
-
|
|
1991
|
+
const P = H;
|
|
1992
|
+
P.MathfieldElement && (P.MathfieldElement.mathVirtualKeyboardPolicy = "manual");
|
|
1996
1993
|
try {
|
|
1997
|
-
const
|
|
1998
|
-
|
|
1994
|
+
const ee = tt();
|
|
1995
|
+
ee && (ee.visible = !1);
|
|
1999
1996
|
} catch {
|
|
2000
1997
|
}
|
|
2001
|
-
const
|
|
2002
|
-
|
|
2003
|
-
const
|
|
2004
|
-
s(
|
|
2005
|
-
}),
|
|
2006
|
-
var W, q;
|
|
1998
|
+
const z = document.createElement("math-field");
|
|
1999
|
+
z.setAttribute("virtual-keyboard-mode", "off"), z.setAttribute("math-virtual-keyboard-policy", "manual"), z.mathVirtualKeyboardPolicy = "manual", z.setAttribute("smart-mode", "true"), z.setAttribute("smart-fence", "true"), z.setAttribute("smart-superscript", "true"), z.style.width = "100%", z.style.minHeight = "120px", z.style.fontSize = "24px", z.style.padding = "12px 16px", z.style.border = "none", z.style.outline = "none", z.style.background = "transparent", z.style.caretColor = "#2563eb", z.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'", z.style.setProperty("--keyboard-zindex", "-1"), z.style.setProperty("--virtual-keyboard-toggle-display", "none"), i && z.setAttribute("value", i), z.addEventListener("input", (ee) => {
|
|
2000
|
+
const j = ee.target;
|
|
2001
|
+
s(j.value);
|
|
2002
|
+
}), z.addEventListener("focus", () => {
|
|
2007
2003
|
try {
|
|
2008
|
-
|
|
2004
|
+
tt()?.hide?.();
|
|
2009
2005
|
} catch {
|
|
2010
2006
|
}
|
|
2011
|
-
}), u.current.innerHTML = "", u.current.appendChild(
|
|
2007
|
+
}), u.current.innerHTML = "", u.current.appendChild(z), N.current = z, setTimeout(() => z.focus(), 100);
|
|
2012
2008
|
});
|
|
2013
|
-
const
|
|
2009
|
+
const x = u.current;
|
|
2014
2010
|
return () => {
|
|
2015
|
-
|
|
2011
|
+
x && (x.innerHTML = ""), N.current = null;
|
|
2016
2012
|
};
|
|
2017
2013
|
}, [n]);
|
|
2018
|
-
const h =
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
const w = y.current;
|
|
2032
|
-
(B = w.executeCommand) == null || B.call(w, ["applyStyle", g]), s(w.value || ""), w.focus();
|
|
2033
|
-
}, []), f = b(() => {
|
|
2014
|
+
const h = g((x) => {
|
|
2015
|
+
if (!N.current) return;
|
|
2016
|
+
const H = N.current;
|
|
2017
|
+
x.command ? H.executeCommand?.(x.command) : x.latex && (H.executeCommand ? H.executeCommand(["insert", x.latex, { focus: !0 }]) : H.value = (H.value || "") + x.latex), s(H.value || ""), H.focus();
|
|
2018
|
+
}, []), d = g((x) => {
|
|
2019
|
+
if (!N.current) return;
|
|
2020
|
+
const H = N.current, P = `\\text{\\class{mt-font-${x}}{#@}}`;
|
|
2021
|
+
H.executeCommand?.(["insert", P, { focus: !0 }]), s(H.value || ""), H.focus();
|
|
2022
|
+
}, []), v = g((x) => {
|
|
2023
|
+
if (!N.current) return;
|
|
2024
|
+
const H = N.current;
|
|
2025
|
+
H.executeCommand?.(["applyStyle", x]), s(H.value || ""), H.focus();
|
|
2026
|
+
}, []), f = g(() => {
|
|
2034
2027
|
r.trim() && t(r), l();
|
|
2035
|
-
}, [r, t, l]),
|
|
2036
|
-
|
|
2028
|
+
}, [r, t, l]), B = g((x) => {
|
|
2029
|
+
x.key === "Escape" && l(), x.key === "Enter" && (x.ctrlKey || x.metaKey) && f();
|
|
2037
2030
|
}, [l, f]);
|
|
2038
|
-
if (
|
|
2039
|
-
n || (s(""),
|
|
2031
|
+
if (W(() => {
|
|
2032
|
+
n || (s(""), b(c));
|
|
2040
2033
|
}, [n, c]), !n) return null;
|
|
2041
|
-
const p =
|
|
2042
|
-
return /* @__PURE__ */ e("div", { className: "mt-overlay", onClick: l, onKeyDown:
|
|
2034
|
+
const p = Oe.find((x) => x.id === o) || Oe[0];
|
|
2035
|
+
return /* @__PURE__ */ e("div", { className: "mt-overlay", onClick: l, onKeyDown: B, children: /* @__PURE__ */ a("div", { className: "mt-dialog", onClick: (x) => x.stopPropagation(), children: [
|
|
2043
2036
|
/* @__PURE__ */ a("div", { className: "mt-titlebar", children: [
|
|
2044
2037
|
/* @__PURE__ */ a("div", { className: "mt-titlebar__left", children: [
|
|
2045
2038
|
/* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: { opacity: 0.9 }, children: /* @__PURE__ */ e("path", { d: "M2 2l3 6-3 6h2.5l2-4 2 4H11l-3-6 3-6H8.5l-2 4-2-4H2zm9 0v2h4V2h-4zm0 5v2h4V7h-4zm0 5v2h4v-2h-4z" }) }),
|
|
@@ -2052,8 +2045,8 @@ function pt({ isOpen: n, onInsert: t, onClose: l, initialLatex: i = "", initialT
|
|
|
2052
2045
|
"select",
|
|
2053
2046
|
{
|
|
2054
2047
|
className: "mt-font-select",
|
|
2055
|
-
onChange: (
|
|
2056
|
-
|
|
2048
|
+
onChange: (x) => {
|
|
2049
|
+
x.target.value && d(x.target.value), x.target.value = "";
|
|
2057
2050
|
},
|
|
2058
2051
|
defaultValue: "",
|
|
2059
2052
|
children: [
|
|
@@ -2069,12 +2062,10 @@ function pt({ isOpen: n, onInsert: t, onClose: l, initialLatex: i = "", initialT
|
|
|
2069
2062
|
),
|
|
2070
2063
|
/* @__PURE__ */ e("div", { style: { fontSize: "11px", color: "#666", borderLeft: "1px solid #ccc", paddingLeft: "8px", marginRight: "8px" }, children: "Font" }),
|
|
2071
2064
|
/* @__PURE__ */ a("div", { className: "mt-format-group", children: [
|
|
2072
|
-
/* @__PURE__ */ e("button", { className: "mt-format-btn", onClick: () =>
|
|
2073
|
-
/* @__PURE__ */ e("button", { className: "mt-format-btn", onClick: () =>
|
|
2065
|
+
/* @__PURE__ */ e("button", { className: "mt-format-btn", onClick: () => v({ fontWeight: "bold" }), title: "Bold", children: /* @__PURE__ */ e("b", { children: "B" }) }),
|
|
2066
|
+
/* @__PURE__ */ e("button", { className: "mt-format-btn", onClick: () => v({ fontStyle: "italic" }), title: "Italic", children: /* @__PURE__ */ e("i", { children: "I" }) }),
|
|
2074
2067
|
/* @__PURE__ */ e("button", { className: "mt-format-btn", onClick: () => {
|
|
2075
|
-
|
|
2076
|
-
const g = y.current;
|
|
2077
|
-
(w = g == null ? void 0 : g.executeCommand) == null || w.call(g, ["insert", "\\underline{#@}", { focus: !0 }]);
|
|
2068
|
+
N.current?.executeCommand?.(["insert", "\\underline{#@}", { focus: !0 }]);
|
|
2078
2069
|
}, title: "Underline", children: /* @__PURE__ */ e("u", { children: "U" }) })
|
|
2079
2070
|
] }),
|
|
2080
2071
|
/* @__PURE__ */ e("div", { className: "mt-format-group", children: /* @__PURE__ */ e(
|
|
@@ -2082,37 +2073,36 @@ function pt({ isOpen: n, onInsert: t, onClose: l, initialLatex: i = "", initialT
|
|
|
2082
2073
|
{
|
|
2083
2074
|
type: "color",
|
|
2084
2075
|
className: "mt-color-picker",
|
|
2085
|
-
onChange: (
|
|
2076
|
+
onChange: (x) => v({ color: x.target.value }),
|
|
2086
2077
|
title: "Text Color"
|
|
2087
2078
|
}
|
|
2088
2079
|
) })
|
|
2089
2080
|
] }),
|
|
2090
|
-
/* @__PURE__ */ e("div", { className: "mt-tab-bar", children:
|
|
2081
|
+
/* @__PURE__ */ e("div", { className: "mt-tab-bar", children: Oe.map((x) => /* @__PURE__ */ e(
|
|
2091
2082
|
"button",
|
|
2092
2083
|
{
|
|
2093
|
-
className: `mt-tab ${o ===
|
|
2094
|
-
onClick: () =>
|
|
2095
|
-
title:
|
|
2096
|
-
children: /* @__PURE__ */ e("span", { className: "mt-tab__icon", children:
|
|
2084
|
+
className: `mt-tab ${o === x.id ? "is-active" : ""}`,
|
|
2085
|
+
onClick: () => b(x.id),
|
|
2086
|
+
title: x.tip,
|
|
2087
|
+
children: /* @__PURE__ */ e("span", { className: "mt-tab__icon", children: x.icon })
|
|
2097
2088
|
},
|
|
2098
|
-
|
|
2089
|
+
x.id
|
|
2099
2090
|
)) }),
|
|
2100
|
-
o === "matrix" && /* @__PURE__ */ e(ma, { onInsert: (
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
(B = w.executeCommand) == null || B.call(w, ["insert", g, { focus: !0 }]), s(w.value || ""), w.focus();
|
|
2091
|
+
o === "matrix" && /* @__PURE__ */ e(ma, { onInsert: (x) => {
|
|
2092
|
+
if (!N.current) return;
|
|
2093
|
+
const H = N.current;
|
|
2094
|
+
H.executeCommand?.(["insert", x, { focus: !0 }]), s(H.value || ""), H.focus();
|
|
2105
2095
|
} }),
|
|
2106
|
-
/* @__PURE__ */ e("div", { className: "mt-grid", children: p.rows.map((
|
|
2096
|
+
/* @__PURE__ */ e("div", { className: "mt-grid", children: p.rows.map((x, H) => /* @__PURE__ */ e("div", { className: "mt-grid__row", children: x.map((P, z) => /* @__PURE__ */ e(
|
|
2107
2097
|
"button",
|
|
2108
2098
|
{
|
|
2109
|
-
className: `mt-grid__btn${
|
|
2110
|
-
onClick: () => h(
|
|
2111
|
-
title:
|
|
2112
|
-
children:
|
|
2099
|
+
className: `mt-grid__btn${P.command === "formula" ? " mt-grid__btn--formula" : ""}`,
|
|
2100
|
+
onClick: () => h(P),
|
|
2101
|
+
title: P.tip,
|
|
2102
|
+
children: P.icon
|
|
2113
2103
|
},
|
|
2114
|
-
|
|
2115
|
-
)) },
|
|
2104
|
+
z
|
|
2105
|
+
)) }, H)) }),
|
|
2116
2106
|
/* @__PURE__ */ e("div", { className: "mt-editor", children: /* @__PURE__ */ e("div", { className: "mt-editor__field", ref: u }) }),
|
|
2117
2107
|
/* @__PURE__ */ a("div", { className: "mt-latex-bar", children: [
|
|
2118
2108
|
/* @__PURE__ */ e("span", { className: "mt-latex-bar__label", children: "LaTeX:" }),
|
|
@@ -2138,7 +2128,7 @@ const da = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2138
2128
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2139
2129
|
let We = null, at = !1;
|
|
2140
2130
|
function gt() {
|
|
2141
|
-
return We || (We = import("./mathlive-
|
|
2131
|
+
return We || (We = import("./mathlive-Bi6rleK6.js").then((n) => {
|
|
2142
2132
|
const t = window.MATHLIVE_FONTS_PATH || "/fonts";
|
|
2143
2133
|
return n.MathfieldElement && (n.MathfieldElement.fontsDirectory = t), n;
|
|
2144
2134
|
})), We;
|
|
@@ -2156,33 +2146,32 @@ function nt() {
|
|
|
2156
2146
|
return window.mathVirtualKeyboard;
|
|
2157
2147
|
}
|
|
2158
2148
|
function xt(n) {
|
|
2159
|
-
const t =
|
|
2149
|
+
const t = I(null), l = I(null), [i, c] = M(!1), [r, s] = M(!1), o = n.node.attrs.display === "block", b = g(() => {
|
|
2160
2150
|
c(!0);
|
|
2161
|
-
}, []),
|
|
2151
|
+
}, []), N = g(() => {
|
|
2162
2152
|
c(!1), s(!1);
|
|
2163
|
-
}, []), u =
|
|
2153
|
+
}, []), u = g((h) => {
|
|
2164
2154
|
n.updateAttributes({ latex: h }), c(!1), s(!1);
|
|
2165
2155
|
}, [n]);
|
|
2166
|
-
return
|
|
2156
|
+
return W(() => {
|
|
2167
2157
|
async function h() {
|
|
2168
2158
|
await ha();
|
|
2169
|
-
const
|
|
2159
|
+
const v = await gt();
|
|
2170
2160
|
if (!t.current) return;
|
|
2171
|
-
|
|
2161
|
+
v.MathfieldElement && (v.MathfieldElement.keypressVibration = !1, v.MathfieldElement.mathVirtualKeyboardPolicy = "manual");
|
|
2172
2162
|
try {
|
|
2173
|
-
const
|
|
2174
|
-
|
|
2163
|
+
const B = nt();
|
|
2164
|
+
B && (B.visible = !1);
|
|
2175
2165
|
} catch {
|
|
2176
2166
|
}
|
|
2177
2167
|
const f = document.createElement("math-field");
|
|
2178
|
-
f.setAttribute("virtual-keyboard-mode", "off"), f.setAttribute("math-virtual-keyboard-policy", "manual"), f.mathVirtualKeyboardPolicy = "manual", f.setAttribute("smart-mode", "true"), f.setAttribute("smart-fence", "true"), f.setAttribute("smart-superscript", "true"), f.style.setProperty("--keyboard-zindex", "-1"), f.style.setProperty("--virtual-keyboard-toggle-display", "none"), n.node.attrs.latex && f.setAttribute("value", n.node.attrs.latex), f.addEventListener("input", (
|
|
2179
|
-
const p =
|
|
2168
|
+
f.setAttribute("virtual-keyboard-mode", "off"), f.setAttribute("math-virtual-keyboard-policy", "manual"), f.mathVirtualKeyboardPolicy = "manual", f.setAttribute("smart-mode", "true"), f.setAttribute("smart-fence", "true"), f.setAttribute("smart-superscript", "true"), f.style.setProperty("--keyboard-zindex", "-1"), f.style.setProperty("--virtual-keyboard-toggle-display", "none"), n.node.attrs.latex && f.setAttribute("value", n.node.attrs.latex), f.addEventListener("input", (B) => {
|
|
2169
|
+
const p = B.target;
|
|
2180
2170
|
n.updateAttributes({ latex: p.value });
|
|
2181
2171
|
}), f.addEventListener("focus", () => {
|
|
2182
|
-
var P, p;
|
|
2183
2172
|
s(!0);
|
|
2184
2173
|
try {
|
|
2185
|
-
|
|
2174
|
+
nt()?.hide?.();
|
|
2186
2175
|
} catch {
|
|
2187
2176
|
}
|
|
2188
2177
|
}), f.addEventListener("blur", () => {
|
|
@@ -2192,11 +2181,11 @@ function xt(n) {
|
|
|
2192
2181
|
}, 50);
|
|
2193
2182
|
}
|
|
2194
2183
|
h().catch(console.error);
|
|
2195
|
-
const
|
|
2184
|
+
const d = t.current;
|
|
2196
2185
|
return () => {
|
|
2197
|
-
|
|
2186
|
+
d && (d.innerHTML = "");
|
|
2198
2187
|
};
|
|
2199
|
-
}, []), /* @__PURE__ */ a(
|
|
2188
|
+
}, []), /* @__PURE__ */ a(Y, { children: [
|
|
2200
2189
|
/* @__PURE__ */ a(
|
|
2201
2190
|
je,
|
|
2202
2191
|
{
|
|
@@ -2209,7 +2198,7 @@ function xt(n) {
|
|
|
2209
2198
|
"button",
|
|
2210
2199
|
{
|
|
2211
2200
|
type: "button",
|
|
2212
|
-
onClick:
|
|
2201
|
+
onClick: b,
|
|
2213
2202
|
className: "mtx-math-edit-btn",
|
|
2214
2203
|
title: "Edit rumus dengan Equation Editor",
|
|
2215
2204
|
children: [
|
|
@@ -2227,7 +2216,7 @@ function xt(n) {
|
|
|
2227
2216
|
isOpen: i,
|
|
2228
2217
|
initialLatex: n.node.attrs.latex,
|
|
2229
2218
|
onInsert: u,
|
|
2230
|
-
onClose:
|
|
2219
|
+
onClose: N
|
|
2231
2220
|
}
|
|
2232
2221
|
)
|
|
2233
2222
|
] });
|
|
@@ -2258,10 +2247,10 @@ const ua = Ue.create({
|
|
|
2258
2247
|
];
|
|
2259
2248
|
},
|
|
2260
2249
|
renderHTML({ HTMLAttributes: n }) {
|
|
2261
|
-
return ["span",
|
|
2250
|
+
return ["span", Ce(n, { "data-type": "math-inline", class: "mtx-math-inline" })];
|
|
2262
2251
|
},
|
|
2263
2252
|
addNodeView() {
|
|
2264
|
-
return
|
|
2253
|
+
return Re(xt);
|
|
2265
2254
|
}
|
|
2266
2255
|
}), pa = Ue.create({
|
|
2267
2256
|
name: "mathBlock",
|
|
@@ -2288,12 +2277,12 @@ const ua = Ue.create({
|
|
|
2288
2277
|
];
|
|
2289
2278
|
},
|
|
2290
2279
|
renderHTML({ HTMLAttributes: n }) {
|
|
2291
|
-
return ["div",
|
|
2280
|
+
return ["div", Ce(n, { "data-type": "math-block", class: "mtx-math-block" })];
|
|
2292
2281
|
},
|
|
2293
2282
|
addNodeView() {
|
|
2294
|
-
return
|
|
2283
|
+
return Re(xt);
|
|
2295
2284
|
}
|
|
2296
|
-
}),
|
|
2285
|
+
}), ft = ce.memo(({
|
|
2297
2286
|
isOpen: n,
|
|
2298
2287
|
position: t,
|
|
2299
2288
|
onClose: l,
|
|
@@ -2302,31 +2291,31 @@ const ua = Ue.create({
|
|
|
2302
2291
|
onDeleteRow: r,
|
|
2303
2292
|
onAddColumnBefore: s,
|
|
2304
2293
|
onAddColumnAfter: o,
|
|
2305
|
-
onDeleteColumn:
|
|
2306
|
-
onDeleteTable:
|
|
2294
|
+
onDeleteColumn: b,
|
|
2295
|
+
onDeleteTable: N,
|
|
2307
2296
|
onMergeCells: u,
|
|
2308
2297
|
onSplitCell: h,
|
|
2309
|
-
onCellProperties:
|
|
2310
|
-
onTableProperties:
|
|
2298
|
+
onCellProperties: d,
|
|
2299
|
+
onTableProperties: v
|
|
2311
2300
|
}) => {
|
|
2312
|
-
const f =
|
|
2301
|
+
const f = g((p) => {
|
|
2313
2302
|
p && p(), l();
|
|
2314
|
-
}, [l]),
|
|
2303
|
+
}, [l]), B = we(() => {
|
|
2315
2304
|
if (!t)
|
|
2316
2305
|
return { x: 0, y: 0 };
|
|
2317
|
-
const p = typeof window < "u" ? window.innerWidth : 1280,
|
|
2306
|
+
const p = typeof window < "u" ? window.innerWidth : 1280, x = typeof window < "u" ? window.innerHeight : 720;
|
|
2318
2307
|
return {
|
|
2319
2308
|
x: Math.min(t.x, p - 260),
|
|
2320
|
-
y: Math.min(t.y,
|
|
2309
|
+
y: Math.min(t.y, x - 360)
|
|
2321
2310
|
};
|
|
2322
2311
|
}, [t]);
|
|
2323
|
-
return !n || !t ? null : /* @__PURE__ */ a(
|
|
2312
|
+
return !n || !t ? null : /* @__PURE__ */ a(Y, { children: [
|
|
2324
2313
|
/* @__PURE__ */ e("button", { type: "button", className: "mtx-table-menu-overlay", onClick: l, "aria-label": "Close table menu" }),
|
|
2325
2314
|
/* @__PURE__ */ e(
|
|
2326
2315
|
"div",
|
|
2327
2316
|
{
|
|
2328
2317
|
className: "mtx-table-menu-dropdown",
|
|
2329
|
-
style: { left:
|
|
2318
|
+
style: { left: B.x, top: B.y },
|
|
2330
2319
|
children: /* @__PURE__ */ a("div", { className: "mtx-table-menu", onClick: (p) => p.stopPropagation(), children: [
|
|
2331
2320
|
/* @__PURE__ */ a("div", { className: "mtx-table-menu-group", children: [
|
|
2332
2321
|
/* @__PURE__ */ e("div", { className: "mtx-table-menu-label", children: "Rows" }),
|
|
@@ -2392,7 +2381,7 @@ const ua = Ue.create({
|
|
|
2392
2381
|
"button",
|
|
2393
2382
|
{
|
|
2394
2383
|
className: "mtx-table-menu-item mtx-table-menu-item--danger",
|
|
2395
|
-
onClick: () => f(
|
|
2384
|
+
onClick: () => f(b),
|
|
2396
2385
|
children: [
|
|
2397
2386
|
/* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "🗑" }),
|
|
2398
2387
|
/* @__PURE__ */ e("span", { children: "Delete Column" })
|
|
@@ -2425,24 +2414,24 @@ const ua = Ue.create({
|
|
|
2425
2414
|
}
|
|
2426
2415
|
)
|
|
2427
2416
|
] }),
|
|
2428
|
-
(
|
|
2417
|
+
(d || v) && /* @__PURE__ */ a("div", { className: "mtx-table-menu-group", children: [
|
|
2429
2418
|
/* @__PURE__ */ e("div", { className: "mtx-table-menu-label", children: "Properties" }),
|
|
2430
|
-
|
|
2419
|
+
d && /* @__PURE__ */ a(
|
|
2431
2420
|
"button",
|
|
2432
2421
|
{
|
|
2433
2422
|
className: "mtx-table-menu-item",
|
|
2434
|
-
onClick: () => f(
|
|
2423
|
+
onClick: () => f(d),
|
|
2435
2424
|
children: [
|
|
2436
2425
|
/* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "⚙" }),
|
|
2437
2426
|
/* @__PURE__ */ e("span", { children: "Cell Properties" })
|
|
2438
2427
|
]
|
|
2439
2428
|
}
|
|
2440
2429
|
),
|
|
2441
|
-
|
|
2430
|
+
v && /* @__PURE__ */ a(
|
|
2442
2431
|
"button",
|
|
2443
2432
|
{
|
|
2444
2433
|
className: "mtx-table-menu-item",
|
|
2445
|
-
onClick: () => f(
|
|
2434
|
+
onClick: () => f(v),
|
|
2446
2435
|
children: [
|
|
2447
2436
|
/* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "⚙" }),
|
|
2448
2437
|
/* @__PURE__ */ e("span", { children: "Table Properties" })
|
|
@@ -2456,7 +2445,7 @@ const ua = Ue.create({
|
|
|
2456
2445
|
"button",
|
|
2457
2446
|
{
|
|
2458
2447
|
className: "mtx-table-menu-item mtx-table-menu-item--danger",
|
|
2459
|
-
onClick: () => f(
|
|
2448
|
+
onClick: () => f(N),
|
|
2460
2449
|
children: [
|
|
2461
2450
|
/* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "🗑" }),
|
|
2462
2451
|
/* @__PURE__ */ e("span", { children: "Delete Table" })
|
|
@@ -2469,8 +2458,8 @@ const ua = Ue.create({
|
|
|
2469
2458
|
)
|
|
2470
2459
|
] });
|
|
2471
2460
|
});
|
|
2472
|
-
|
|
2473
|
-
const ga =
|
|
2461
|
+
ft.displayName = "TableMenu";
|
|
2462
|
+
const ga = ce.memo(function({
|
|
2474
2463
|
isOpen: t,
|
|
2475
2464
|
position: l,
|
|
2476
2465
|
currentAlign: i,
|
|
@@ -2478,23 +2467,23 @@ const ga = oe.memo(function({
|
|
|
2478
2467
|
onClose: r,
|
|
2479
2468
|
onSetAlign: s,
|
|
2480
2469
|
onResetPosition: o,
|
|
2481
|
-
onCenterImage:
|
|
2482
|
-
onEditImage:
|
|
2470
|
+
onCenterImage: b,
|
|
2471
|
+
onEditImage: N
|
|
2483
2472
|
}) {
|
|
2484
|
-
const u =
|
|
2485
|
-
|
|
2486
|
-
}, [r]), h =
|
|
2473
|
+
const u = g((d) => {
|
|
2474
|
+
d?.(), r();
|
|
2475
|
+
}, [r]), h = we(() => {
|
|
2487
2476
|
if (!l)
|
|
2488
2477
|
return { x: 0, y: 0 };
|
|
2489
|
-
const
|
|
2478
|
+
const d = typeof window < "u" ? window.innerWidth : 1280, v = typeof window < "u" ? window.innerHeight : 720;
|
|
2490
2479
|
return {
|
|
2491
|
-
x: Math.min(l.x,
|
|
2492
|
-
y: Math.min(l.y,
|
|
2480
|
+
x: Math.min(l.x, d - 240),
|
|
2481
|
+
y: Math.min(l.y, v - 280)
|
|
2493
2482
|
};
|
|
2494
2483
|
}, [l]);
|
|
2495
|
-
return !t || !l ? null : /* @__PURE__ */ a(
|
|
2484
|
+
return !t || !l ? null : /* @__PURE__ */ a(Y, { children: [
|
|
2496
2485
|
/* @__PURE__ */ e("button", { type: "button", className: "mtx-table-menu-overlay", onClick: r, "aria-label": "Close image menu" }),
|
|
2497
|
-
/* @__PURE__ */ e("div", { className: "mtx-table-menu-dropdown", style: { left: h.x, top: h.y }, children: /* @__PURE__ */ a("div", { className: "mtx-table-menu", onClick: (
|
|
2486
|
+
/* @__PURE__ */ e("div", { className: "mtx-table-menu-dropdown", style: { left: h.x, top: h.y }, children: /* @__PURE__ */ a("div", { className: "mtx-table-menu", onClick: (d) => d.stopPropagation(), children: [
|
|
2498
2487
|
/* @__PURE__ */ a("div", { className: "mtx-table-menu-group", children: [
|
|
2499
2488
|
/* @__PURE__ */ e("div", { className: "mtx-table-menu-label", children: "Text Wrapping" }),
|
|
2500
2489
|
/* @__PURE__ */ a("button", { className: `mtx-table-menu-item ${i === "left" ? "is-active" : ""}`, onClick: () => u(() => s("left")), children: [
|
|
@@ -2514,24 +2503,24 @@ const ga = oe.memo(function({
|
|
|
2514
2503
|
/* @__PURE__ */ e("span", { children: "Full Width" })
|
|
2515
2504
|
] })
|
|
2516
2505
|
] }),
|
|
2517
|
-
|
|
2506
|
+
N && /* @__PURE__ */ a("div", { className: "mtx-table-menu-group", children: [
|
|
2518
2507
|
/* @__PURE__ */ e("div", { className: "mtx-table-menu-label", children: "Image" }),
|
|
2519
2508
|
o && /* @__PURE__ */ a("button", { className: "mtx-table-menu-item", onClick: () => u(o), disabled: !c, children: [
|
|
2520
2509
|
/* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "↺" }),
|
|
2521
2510
|
/* @__PURE__ */ e("span", { children: "Reset Position" })
|
|
2522
2511
|
] }),
|
|
2523
|
-
|
|
2512
|
+
b && /* @__PURE__ */ a("button", { className: "mtx-table-menu-item", onClick: () => u(b), children: [
|
|
2524
2513
|
/* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "◎" }),
|
|
2525
2514
|
/* @__PURE__ */ e("span", { children: "Center & Reset" })
|
|
2526
2515
|
] }),
|
|
2527
|
-
/* @__PURE__ */ a("button", { className: "mtx-table-menu-item", onClick: () => u(
|
|
2516
|
+
/* @__PURE__ */ a("button", { className: "mtx-table-menu-item", onClick: () => u(N), children: [
|
|
2528
2517
|
/* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "✎" }),
|
|
2529
2518
|
/* @__PURE__ */ e("span", { children: "Edit Image" })
|
|
2530
2519
|
] })
|
|
2531
2520
|
] })
|
|
2532
2521
|
] }) })
|
|
2533
2522
|
] });
|
|
2534
|
-
}), xa =
|
|
2523
|
+
}), xa = ne(() => import("./LinkDialogImpl-C1YeHJFJ.js").then((n) => ({ default: n.LinkDialogImpl }))), fa = ne(() => import("./InsertTableDialogImpl-Dpo1pByJ.js").then((n) => ({ default: n.InsertTableDialogImpl }))), ba = ne(() => import("./CellPropertiesDialogImpl-D2iy6DEr.js").then((n) => ({ default: n.CellPropertiesDialogImpl }))), Na = ne(() => import("./TableTemplatesDialogImpl-CMzxe328.js").then((n) => ({ default: n.TableTemplatesDialogImpl }))), ya = ne(() => import("./ImageInsertDialog-Cn-IrnHN.js").then((n) => ({ default: n.ImageInsertDialog }))), A = ce.memo(function({ icon: t, label: l, onClick: i, isActive: c, isDisabled: r, className: s }) {
|
|
2535
2524
|
return /* @__PURE__ */ e(
|
|
2536
2525
|
"button",
|
|
2537
2526
|
{
|
|
@@ -2545,16 +2534,15 @@ const ga = oe.memo(function({
|
|
|
2545
2534
|
}
|
|
2546
2535
|
);
|
|
2547
2536
|
});
|
|
2548
|
-
function
|
|
2537
|
+
function re() {
|
|
2549
2538
|
return /* @__PURE__ */ e("div", { className: "mtx-toolbar-divider" });
|
|
2550
2539
|
}
|
|
2551
2540
|
function va(n) {
|
|
2552
|
-
var l;
|
|
2553
2541
|
if (!n) return null;
|
|
2554
2542
|
const t = n.state.selection.node;
|
|
2555
|
-
return
|
|
2543
|
+
return t?.type?.name === "image" ? t.attrs || {} : n.state.selection.$from.parent.type.name === "image" ? n.state.selection.$from.parent.attrs : null;
|
|
2556
2544
|
}
|
|
2557
|
-
const ka =
|
|
2545
|
+
const ka = ce.memo(({ value: n, onChange: t, options: l, label: i, className: c }) => /* @__PURE__ */ e(
|
|
2558
2546
|
"select",
|
|
2559
2547
|
{
|
|
2560
2548
|
className: `mtx-toolbar-select ${c || ""}`,
|
|
@@ -2564,18 +2552,15 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
2564
2552
|
"aria-label": i,
|
|
2565
2553
|
children: l.map((r) => /* @__PURE__ */ e("option", { value: r.value, children: r.label }, r.value))
|
|
2566
2554
|
}
|
|
2567
|
-
)), lt =
|
|
2568
|
-
const c =
|
|
2569
|
-
return /* @__PURE__ */ a(
|
|
2555
|
+
)), lt = ce.memo(({ color: n, onChange: t, label: l, icon: i }) => {
|
|
2556
|
+
const c = I(null);
|
|
2557
|
+
return /* @__PURE__ */ a(Y, { children: [
|
|
2570
2558
|
/* @__PURE__ */ e(
|
|
2571
2559
|
"button",
|
|
2572
2560
|
{
|
|
2573
2561
|
type: "button",
|
|
2574
2562
|
className: "mtx-toolbar-btn mtx-color-btn",
|
|
2575
|
-
onClick: () =>
|
|
2576
|
-
var r;
|
|
2577
|
-
return (r = c.current) == null ? void 0 : r.click();
|
|
2578
|
-
},
|
|
2563
|
+
onClick: () => c.current?.click(),
|
|
2579
2564
|
title: l,
|
|
2580
2565
|
"aria-label": l,
|
|
2581
2566
|
children: i
|
|
@@ -2593,7 +2578,7 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
2593
2578
|
}
|
|
2594
2579
|
)
|
|
2595
2580
|
] });
|
|
2596
|
-
}),
|
|
2581
|
+
}), T = {
|
|
2597
2582
|
bold: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M4 2h5a3 3 0 0 1 2.1 5.15A3.5 3.5 0 0 1 9.5 14H4V2zm2 5h3a1 1 0 1 0 0-2H6v2zm0 2v3h3.5a1.5 1.5 0 0 0 0-3H6z" }) }),
|
|
2598
2583
|
italic: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M6 2h6v2h-2.2l-2.6 8H9v2H3v-2h2.2l2.6-8H6V2z" }) }),
|
|
2599
2584
|
underline: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M3 13h10v1.5H3V13zM4 2v6a4 4 0 0 0 8 0V2h-2v6a2 2 0 0 1-4 0V2H4z" }) }),
|
|
@@ -2677,144 +2662,144 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
2677
2662
|
{ value: "Georgia", label: "Georgia" },
|
|
2678
2663
|
{ value: "Verdana", label: "Verdana" },
|
|
2679
2664
|
{ value: "Courier New", label: "Courier New" }
|
|
2680
|
-
], Ca =
|
|
2681
|
-
const [
|
|
2682
|
-
|
|
2683
|
-
}, []), Ae =
|
|
2665
|
+
], Ca = ce.memo(function({ editor: t, toolbarMode: l, onInsertMath: i, onInsertImage: c, onEditImage: r, onSetImageAlign: s, onResetImagePosition: o }) {
|
|
2666
|
+
const [b, N] = M("#000000"), [u, h] = M("#fef08a"), [d, v] = M("basic"), [f, B] = M(!1), [p, x] = M(!1), [H, P] = M(!1), [z, ee] = M(!1), [j, le] = M(!1), [be, te] = M({}), oe = g(() => {
|
|
2667
|
+
B(!0);
|
|
2668
|
+
}, []), Ae = g((_) => {
|
|
2684
2669
|
if (!t) return;
|
|
2685
|
-
const { url:
|
|
2686
|
-
|
|
2687
|
-
href:
|
|
2688
|
-
target:
|
|
2689
|
-
rel:
|
|
2670
|
+
const { url: E, text: Z, target: G } = _;
|
|
2671
|
+
Z ? t.chain().focus().deleteSelection().insertContent(Z).setLink({
|
|
2672
|
+
href: E,
|
|
2673
|
+
target: G || "_self",
|
|
2674
|
+
rel: G === "_blank" ? "noopener noreferrer" : void 0
|
|
2690
2675
|
}).run() : t.chain().focus().setLink({
|
|
2691
|
-
href:
|
|
2692
|
-
target:
|
|
2693
|
-
rel:
|
|
2694
|
-
}).run(),
|
|
2695
|
-
}, [t]), C =
|
|
2696
|
-
t && (t.chain().focus().unsetLink().run(),
|
|
2697
|
-
}, [t]),
|
|
2676
|
+
href: E,
|
|
2677
|
+
target: G || "_self",
|
|
2678
|
+
rel: G === "_blank" ? "noopener noreferrer" : void 0
|
|
2679
|
+
}).run(), B(!1);
|
|
2680
|
+
}, [t]), C = g(() => {
|
|
2681
|
+
t && (t.chain().focus().unsetLink().run(), B(!1));
|
|
2682
|
+
}, [t]), q = g(() => t ? {
|
|
2698
2683
|
url: t.getAttributes("link").href || "",
|
|
2699
2684
|
text: t.state.selection.empty ? "" : t.state.doc.textBetween(t.state.selection.from, t.state.selection.to),
|
|
2700
2685
|
title: t.getAttributes("link").title || "",
|
|
2701
2686
|
target: t.getAttributes("link").target || "_blank"
|
|
2702
|
-
} : {}, [t]),
|
|
2703
|
-
t && t.chain().focus().insertTable({ rows:
|
|
2704
|
-
}, [t]), [Ne,
|
|
2705
|
-
|
|
2687
|
+
} : {}, [t]), me = g((_, E, Z) => {
|
|
2688
|
+
t && t.chain().focus().insertTable({ rows: _, cols: E, withHeaderRow: Z }).run();
|
|
2689
|
+
}, [t]), [Ne, ae] = M(!1), [ue, ye] = M(null), [pe, O] = M(!1), [Te, de] = M(null);
|
|
2690
|
+
W(() => {
|
|
2706
2691
|
if (!t) return;
|
|
2707
|
-
const
|
|
2708
|
-
const
|
|
2709
|
-
if (
|
|
2710
|
-
|
|
2692
|
+
const _ = (Z) => {
|
|
2693
|
+
const G = Z, Ie = G.target, Me = Ie.closest("figure.mtx-image-figure, .mtx-image-wrapper, img"), Ke = Ie.closest("td, th");
|
|
2694
|
+
if (Me) {
|
|
2695
|
+
G.preventDefault(), G.stopPropagation();
|
|
2711
2696
|
try {
|
|
2712
|
-
const
|
|
2697
|
+
const He = Me.tagName === "IMG" ? Me : Me.querySelector("img") || Me, Ht = t.view.posAtDOM(He, 0);
|
|
2713
2698
|
t.chain().focus().setNodeSelection(Ht).run();
|
|
2714
|
-
} catch (
|
|
2715
|
-
console.warn("Cannot select image from context menu:",
|
|
2699
|
+
} catch (He) {
|
|
2700
|
+
console.warn("Cannot select image from context menu:", He);
|
|
2716
2701
|
}
|
|
2717
|
-
|
|
2702
|
+
ae(!1), de({ x: G.clientX, y: G.clientY }), O(!0);
|
|
2718
2703
|
return;
|
|
2719
2704
|
}
|
|
2720
|
-
Ke && t.isActive("table") && (
|
|
2721
|
-
},
|
|
2722
|
-
return
|
|
2723
|
-
|
|
2705
|
+
Ke && t.isActive("table") && (G.preventDefault(), G.stopPropagation(), O(!1), ye({ x: G.clientX, y: G.clientY }), ae(!0));
|
|
2706
|
+
}, E = document.querySelector(".mtx-content");
|
|
2707
|
+
return E && E.addEventListener("contextmenu", _), () => {
|
|
2708
|
+
E && E.removeEventListener("contextmenu", _);
|
|
2724
2709
|
};
|
|
2725
2710
|
}, [t]);
|
|
2726
|
-
const ve =
|
|
2711
|
+
const ve = g(() => {
|
|
2727
2712
|
t && t.chain().focus().addRowBefore().run();
|
|
2728
|
-
}, [t]),
|
|
2713
|
+
}, [t]), J = g(() => {
|
|
2729
2714
|
t && t.chain().focus().addRowAfter().run();
|
|
2730
|
-
}, [t]),
|
|
2715
|
+
}, [t]), y = g(() => {
|
|
2731
2716
|
t && t.chain().focus().deleteRow().run();
|
|
2732
|
-
}, [t]),
|
|
2717
|
+
}, [t]), w = g(() => {
|
|
2733
2718
|
t && t.chain().focus().addColumnBefore().run();
|
|
2734
|
-
}, [t]), D =
|
|
2719
|
+
}, [t]), D = g(() => {
|
|
2735
2720
|
t && t.chain().focus().addColumnAfter().run();
|
|
2736
|
-
}, [t]), $ =
|
|
2721
|
+
}, [t]), $ = g(() => {
|
|
2737
2722
|
t && t.chain().focus().deleteColumn().run();
|
|
2738
|
-
}, [t]),
|
|
2739
|
-
t && (t.chain().focus().deleteTable().run(),
|
|
2740
|
-
}, [t]),
|
|
2741
|
-
s
|
|
2742
|
-
}, [s]), V =
|
|
2743
|
-
r
|
|
2744
|
-
}, [r]), K =
|
|
2745
|
-
o
|
|
2746
|
-
}, [o]),
|
|
2747
|
-
s
|
|
2748
|
-
}, [s]),
|
|
2723
|
+
}, [t]), ge = g(() => {
|
|
2724
|
+
t && (t.chain().focus().deleteTable().run(), ae(!1));
|
|
2725
|
+
}, [t]), k = g((_) => {
|
|
2726
|
+
s?.(_), O(!1);
|
|
2727
|
+
}, [s]), V = g(() => {
|
|
2728
|
+
r?.(), O(!1);
|
|
2729
|
+
}, [r]), K = g(() => {
|
|
2730
|
+
o?.(), O(!1);
|
|
2731
|
+
}, [o]), F = g(() => {
|
|
2732
|
+
s?.("center"), O(!1);
|
|
2733
|
+
}, [s]), R = g(() => {
|
|
2749
2734
|
if (!t) return;
|
|
2750
|
-
const
|
|
2751
|
-
if (
|
|
2735
|
+
const _ = t.state.selection.$from.parent;
|
|
2736
|
+
if (_.type.name !== "tableCell" && _.type.name !== "tableHeader")
|
|
2752
2737
|
return;
|
|
2753
|
-
const
|
|
2754
|
-
|
|
2755
|
-
width: typeof
|
|
2756
|
-
backgroundColor:
|
|
2757
|
-
horizontalAlign:
|
|
2758
|
-
verticalAlign:
|
|
2759
|
-
}),
|
|
2760
|
-
}, [t]),
|
|
2738
|
+
const E = Array.isArray(_.attrs.colwidth) ? _.attrs.colwidth[0] : null, Z = _.attrs.width || (typeof E == "number" ? `${E}px` : "");
|
|
2739
|
+
te({
|
|
2740
|
+
width: typeof Z == "string" ? Z : Z ? String(Z) : "",
|
|
2741
|
+
backgroundColor: _.attrs.backgroundColor || "",
|
|
2742
|
+
horizontalAlign: _.attrs.textAlign || "left",
|
|
2743
|
+
verticalAlign: _.attrs.verticalAlign || "top"
|
|
2744
|
+
}), ae(!1), P(!0);
|
|
2745
|
+
}, [t]), X = g(() => {
|
|
2761
2746
|
if (t)
|
|
2762
2747
|
try {
|
|
2763
|
-
t.chain().focus().mergeCells().run(),
|
|
2764
|
-
} catch (
|
|
2765
|
-
console.warn("Cannot merge cells:",
|
|
2748
|
+
t.chain().focus().mergeCells().run(), ae(!1);
|
|
2749
|
+
} catch (_) {
|
|
2750
|
+
console.warn("Cannot merge cells:", _);
|
|
2766
2751
|
}
|
|
2767
|
-
}, [t]),
|
|
2752
|
+
}, [t]), U = g(() => {
|
|
2768
2753
|
if (t)
|
|
2769
2754
|
try {
|
|
2770
|
-
t.chain().focus().splitCell().run(),
|
|
2771
|
-
} catch (
|
|
2772
|
-
console.warn("Cannot split cell:",
|
|
2755
|
+
t.chain().focus().splitCell().run(), ae(!1);
|
|
2756
|
+
} catch (_) {
|
|
2757
|
+
console.warn("Cannot split cell:", _);
|
|
2773
2758
|
}
|
|
2774
|
-
}, [t]), xe =
|
|
2759
|
+
}, [t]), xe = g((_) => {
|
|
2775
2760
|
if (!t) return;
|
|
2776
|
-
const { width:
|
|
2761
|
+
const { width: E, backgroundColor: Z, horizontalAlign: G, verticalAlign: Ie } = _, Ke = t.state.selection.$from.parent.type.name === "tableHeader" ? "tableHeader" : "tableCell", He = E ? parseInt(E, 10) : null;
|
|
2777
2762
|
t.chain().focus().updateAttributes(Ke, {
|
|
2778
|
-
colwidth: Number.isFinite(
|
|
2779
|
-
width:
|
|
2780
|
-
backgroundColor:
|
|
2781
|
-
textAlign:
|
|
2782
|
-
verticalAlign:
|
|
2763
|
+
colwidth: Number.isFinite(He) && E?.endsWith("px") ? [He] : null,
|
|
2764
|
+
width: E || null,
|
|
2765
|
+
backgroundColor: Z || null,
|
|
2766
|
+
textAlign: G || null,
|
|
2767
|
+
verticalAlign: Ie || null
|
|
2783
2768
|
}).run();
|
|
2784
|
-
}, [t]), ke =
|
|
2785
|
-
t && t.isActive("table") && t.chain().focus().updateAttributes("table", { theme:
|
|
2786
|
-
}, [t]), De =
|
|
2769
|
+
}, [t]), ke = g((_) => {
|
|
2770
|
+
t && t.isActive("table") && t.chain().focus().updateAttributes("table", { theme: _.id }).run();
|
|
2771
|
+
}, [t]), De = g(() => {
|
|
2787
2772
|
if (c) {
|
|
2788
2773
|
c();
|
|
2789
2774
|
return;
|
|
2790
2775
|
}
|
|
2791
|
-
|
|
2792
|
-
}, [c]),
|
|
2776
|
+
le(!0);
|
|
2777
|
+
}, [c]), fe = g(() => {
|
|
2793
2778
|
t && t.chain().focus().insertContent({ type: "graph", attrs: { formula: "sin(x)" } }).run();
|
|
2794
|
-
}, [t]),
|
|
2795
|
-
(
|
|
2796
|
-
t && (t.chain().focus().setImage({ src:
|
|
2779
|
+
}, [t]), ie = g(
|
|
2780
|
+
(_, E) => {
|
|
2781
|
+
t && (t.chain().focus().setImage({ src: _, alt: E }).run(), le(!1));
|
|
2797
2782
|
},
|
|
2798
2783
|
[t]
|
|
2799
|
-
), Ee =
|
|
2800
|
-
|
|
2801
|
-
}, []),
|
|
2784
|
+
), Ee = g(() => {
|
|
2785
|
+
x(!0);
|
|
2786
|
+
}, []), Le = va(t), he = !!Le, _e = Le?.align || "center", bt = Le ? Number(Le.offsetX || 0) !== 0 || Number(Le.offsetY || 0) !== 0 : !1, Se = !!t && t.isActive("table"), Nt = !!t && ["tableCell", "tableHeader"].includes(t.state.selection.$from.parent.type.name), yt = !!t && t.can().deleteRow(), vt = !!t && t.can().deleteColumn(), kt = !!t && t.can().mergeCells(), wt = !!t && t.can().splitCell(), se = (l || d) === "advanced", Ct = !l, At = g(() => {
|
|
2802
2787
|
t && t.chain().focus().unsetBold().unsetItalic().unsetUnderline().unsetStrike().unsetSubscript().unsetSuperscript().unsetLink().unsetColor().unsetFontFamily().unsetHighlight().run();
|
|
2803
|
-
}, [t]),
|
|
2804
|
-
|
|
2805
|
-
}, [t]), Mt =
|
|
2806
|
-
h(
|
|
2788
|
+
}, [t]), Tt = g((_) => {
|
|
2789
|
+
N(_), t && t.chain().focus().setColor(_).run();
|
|
2790
|
+
}, [t]), Mt = g((_) => {
|
|
2791
|
+
h(_), t && t.chain().focus().toggleHighlight({ color: _ }).run();
|
|
2807
2792
|
}, [t]);
|
|
2808
2793
|
return t ? /* @__PURE__ */ a("div", { className: "mtx-toolbar", role: "toolbar", "aria-label": "Editor toolbar", children: [
|
|
2809
|
-
Ct && /* @__PURE__ */ a(
|
|
2794
|
+
Ct && /* @__PURE__ */ a(Y, { children: [
|
|
2810
2795
|
/* @__PURE__ */ a("div", { className: "mtx-toolbar-mode-switch", role: "group", "aria-label": "Toolbar density", children: [
|
|
2811
2796
|
/* @__PURE__ */ e(
|
|
2812
2797
|
"button",
|
|
2813
2798
|
{
|
|
2814
2799
|
type: "button",
|
|
2815
|
-
className: `mtx-toolbar-mode-btn ${
|
|
2816
|
-
onClick: () =>
|
|
2817
|
-
"aria-pressed": !
|
|
2800
|
+
className: `mtx-toolbar-mode-btn ${se ? "" : "is-active"}`,
|
|
2801
|
+
onClick: () => v("basic"),
|
|
2802
|
+
"aria-pressed": !se,
|
|
2818
2803
|
children: "Basic"
|
|
2819
2804
|
}
|
|
2820
2805
|
),
|
|
@@ -2822,20 +2807,20 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
2822
2807
|
"button",
|
|
2823
2808
|
{
|
|
2824
2809
|
type: "button",
|
|
2825
|
-
className: `mtx-toolbar-mode-btn ${
|
|
2826
|
-
onClick: () =>
|
|
2827
|
-
"aria-pressed":
|
|
2810
|
+
className: `mtx-toolbar-mode-btn ${se ? "is-active" : ""}`,
|
|
2811
|
+
onClick: () => v("advanced"),
|
|
2812
|
+
"aria-pressed": se,
|
|
2828
2813
|
children: "Advanced"
|
|
2829
2814
|
}
|
|
2830
2815
|
)
|
|
2831
2816
|
] }),
|
|
2832
|
-
/* @__PURE__ */ e(
|
|
2817
|
+
/* @__PURE__ */ e(re, {})
|
|
2833
2818
|
] }),
|
|
2834
2819
|
/* @__PURE__ */ a("div", { className: "mtx-toolbar-group", children: [
|
|
2835
2820
|
/* @__PURE__ */ e(
|
|
2836
2821
|
A,
|
|
2837
2822
|
{
|
|
2838
|
-
icon:
|
|
2823
|
+
icon: T.undo,
|
|
2839
2824
|
label: "Undo (Ctrl+Z)",
|
|
2840
2825
|
onClick: () => t.chain().focus().undo().run(),
|
|
2841
2826
|
isDisabled: !t.can().undo()
|
|
@@ -2844,32 +2829,32 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
2844
2829
|
/* @__PURE__ */ e(
|
|
2845
2830
|
A,
|
|
2846
2831
|
{
|
|
2847
|
-
icon:
|
|
2832
|
+
icon: T.redo,
|
|
2848
2833
|
label: "Redo (Ctrl+Y)",
|
|
2849
2834
|
onClick: () => t.chain().focus().redo().run(),
|
|
2850
2835
|
isDisabled: !t.can().redo()
|
|
2851
2836
|
}
|
|
2852
2837
|
)
|
|
2853
2838
|
] }),
|
|
2854
|
-
/* @__PURE__ */ e(
|
|
2855
|
-
|
|
2839
|
+
/* @__PURE__ */ e(re, {}),
|
|
2840
|
+
se && /* @__PURE__ */ a(Y, { children: [
|
|
2856
2841
|
/* @__PURE__ */ e("div", { className: "mtx-toolbar-group", children: /* @__PURE__ */ e(
|
|
2857
2842
|
ka,
|
|
2858
2843
|
{
|
|
2859
2844
|
value: t.getAttributes("textStyle").fontFamily || "Arial",
|
|
2860
|
-
onChange: (
|
|
2845
|
+
onChange: (_) => t.chain().focus().setFontFamily(_).run(),
|
|
2861
2846
|
options: wa,
|
|
2862
2847
|
label: "Font Family",
|
|
2863
2848
|
className: "mtx-font-select"
|
|
2864
2849
|
}
|
|
2865
2850
|
) }),
|
|
2866
|
-
/* @__PURE__ */ e(
|
|
2851
|
+
/* @__PURE__ */ e(re, {})
|
|
2867
2852
|
] }),
|
|
2868
2853
|
/* @__PURE__ */ a("div", { className: "mtx-toolbar-group", children: [
|
|
2869
2854
|
/* @__PURE__ */ e(
|
|
2870
2855
|
A,
|
|
2871
2856
|
{
|
|
2872
|
-
icon:
|
|
2857
|
+
icon: T.bold,
|
|
2873
2858
|
label: "Bold (Ctrl+B)",
|
|
2874
2859
|
onClick: () => t.chain().focus().toggleBold().run(),
|
|
2875
2860
|
isActive: t.isActive("bold")
|
|
@@ -2878,7 +2863,7 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
2878
2863
|
/* @__PURE__ */ e(
|
|
2879
2864
|
A,
|
|
2880
2865
|
{
|
|
2881
|
-
icon:
|
|
2866
|
+
icon: T.italic,
|
|
2882
2867
|
label: "Italic (Ctrl+I)",
|
|
2883
2868
|
onClick: () => t.chain().focus().toggleItalic().run(),
|
|
2884
2869
|
isActive: t.isActive("italic")
|
|
@@ -2887,7 +2872,7 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
2887
2872
|
/* @__PURE__ */ e(
|
|
2888
2873
|
A,
|
|
2889
2874
|
{
|
|
2890
|
-
icon:
|
|
2875
|
+
icon: T.underline,
|
|
2891
2876
|
label: "Underline (Ctrl+U)",
|
|
2892
2877
|
onClick: () => t.chain().focus().toggleUnderline().run(),
|
|
2893
2878
|
isActive: t.isActive("underline")
|
|
@@ -2896,7 +2881,7 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
2896
2881
|
/* @__PURE__ */ e(
|
|
2897
2882
|
A,
|
|
2898
2883
|
{
|
|
2899
|
-
icon:
|
|
2884
|
+
icon: T.strike,
|
|
2900
2885
|
label: "Strikethrough",
|
|
2901
2886
|
onClick: () => t.chain().focus().toggleStrike().run(),
|
|
2902
2887
|
isActive: t.isActive("strike")
|
|
@@ -2905,7 +2890,7 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
2905
2890
|
/* @__PURE__ */ e(
|
|
2906
2891
|
A,
|
|
2907
2892
|
{
|
|
2908
|
-
icon:
|
|
2893
|
+
icon: T.highlight,
|
|
2909
2894
|
label: "Highlight",
|
|
2910
2895
|
onClick: () => t.chain().focus().toggleHighlight().run(),
|
|
2911
2896
|
isActive: t.isActive("highlight")
|
|
@@ -2921,24 +2906,24 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
2921
2906
|
}
|
|
2922
2907
|
)
|
|
2923
2908
|
] }),
|
|
2924
|
-
/* @__PURE__ */ e(
|
|
2925
|
-
|
|
2909
|
+
/* @__PURE__ */ e(re, {}),
|
|
2910
|
+
se && /* @__PURE__ */ a(Y, { children: [
|
|
2926
2911
|
/* @__PURE__ */ e("div", { className: "mtx-toolbar-group", children: /* @__PURE__ */ e(
|
|
2927
2912
|
lt,
|
|
2928
2913
|
{
|
|
2929
|
-
color:
|
|
2930
|
-
onChange:
|
|
2914
|
+
color: b,
|
|
2915
|
+
onChange: Tt,
|
|
2931
2916
|
label: "Text Color",
|
|
2932
|
-
icon: /* @__PURE__ */ e("span", { style: { width: "16px", height: "3px", background:
|
|
2917
|
+
icon: /* @__PURE__ */ e("span", { style: { width: "16px", height: "3px", background: b, display: "inline-block", borderRadius: "1px" } })
|
|
2933
2918
|
}
|
|
2934
2919
|
) }),
|
|
2935
|
-
/* @__PURE__ */ e(
|
|
2920
|
+
/* @__PURE__ */ e(re, {})
|
|
2936
2921
|
] }),
|
|
2937
2922
|
/* @__PURE__ */ a("div", { className: "mtx-toolbar-group", children: [
|
|
2938
2923
|
/* @__PURE__ */ e(
|
|
2939
2924
|
A,
|
|
2940
2925
|
{
|
|
2941
|
-
icon:
|
|
2926
|
+
icon: T.paragraph,
|
|
2942
2927
|
label: "Paragraph",
|
|
2943
2928
|
onClick: () => t.chain().focus().setParagraph().run(),
|
|
2944
2929
|
isActive: t.isActive("paragraph")
|
|
@@ -2947,7 +2932,7 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
2947
2932
|
/* @__PURE__ */ e(
|
|
2948
2933
|
A,
|
|
2949
2934
|
{
|
|
2950
|
-
icon:
|
|
2935
|
+
icon: T.h1,
|
|
2951
2936
|
label: "Heading 1",
|
|
2952
2937
|
onClick: () => t.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
2953
2938
|
isActive: t.isActive("heading", { level: 1 })
|
|
@@ -2956,7 +2941,7 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
2956
2941
|
/* @__PURE__ */ e(
|
|
2957
2942
|
A,
|
|
2958
2943
|
{
|
|
2959
|
-
icon:
|
|
2944
|
+
icon: T.h2,
|
|
2960
2945
|
label: "Heading 2",
|
|
2961
2946
|
onClick: () => t.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
2962
2947
|
isActive: t.isActive("heading", { level: 2 })
|
|
@@ -2965,19 +2950,19 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
2965
2950
|
/* @__PURE__ */ e(
|
|
2966
2951
|
A,
|
|
2967
2952
|
{
|
|
2968
|
-
icon:
|
|
2953
|
+
icon: T.h3,
|
|
2969
2954
|
label: "Heading 3",
|
|
2970
2955
|
onClick: () => t.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
2971
2956
|
isActive: t.isActive("heading", { level: 3 })
|
|
2972
2957
|
}
|
|
2973
2958
|
)
|
|
2974
2959
|
] }),
|
|
2975
|
-
/* @__PURE__ */ e(
|
|
2960
|
+
/* @__PURE__ */ e(re, {}),
|
|
2976
2961
|
/* @__PURE__ */ a("div", { className: "mtx-toolbar-group", children: [
|
|
2977
2962
|
/* @__PURE__ */ e(
|
|
2978
2963
|
A,
|
|
2979
2964
|
{
|
|
2980
|
-
icon:
|
|
2965
|
+
icon: T.bulletList,
|
|
2981
2966
|
label: "Bullet List",
|
|
2982
2967
|
onClick: () => t.chain().focus().toggleBulletList().run(),
|
|
2983
2968
|
isActive: t.isActive("bulletList")
|
|
@@ -2986,7 +2971,7 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
2986
2971
|
/* @__PURE__ */ e(
|
|
2987
2972
|
A,
|
|
2988
2973
|
{
|
|
2989
|
-
icon:
|
|
2974
|
+
icon: T.orderedList,
|
|
2990
2975
|
label: "Ordered List",
|
|
2991
2976
|
onClick: () => t.chain().focus().toggleOrderedList().run(),
|
|
2992
2977
|
isActive: t.isActive("orderedList")
|
|
@@ -2995,7 +2980,7 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
2995
2980
|
/* @__PURE__ */ e(
|
|
2996
2981
|
A,
|
|
2997
2982
|
{
|
|
2998
|
-
icon:
|
|
2983
|
+
icon: T.taskList,
|
|
2999
2984
|
label: "Checklist",
|
|
3000
2985
|
onClick: () => t.chain().focus().toggleTaskList().run(),
|
|
3001
2986
|
isActive: t.isActive("taskList")
|
|
@@ -3004,7 +2989,7 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
3004
2989
|
/* @__PURE__ */ e(
|
|
3005
2990
|
A,
|
|
3006
2991
|
{
|
|
3007
|
-
icon:
|
|
2992
|
+
icon: T.outdent,
|
|
3008
2993
|
label: "Outdent",
|
|
3009
2994
|
onClick: () => t.chain().focus().outdent().run(),
|
|
3010
2995
|
isDisabled: !t.can().outdent()
|
|
@@ -3013,20 +2998,20 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
3013
2998
|
/* @__PURE__ */ e(
|
|
3014
2999
|
A,
|
|
3015
3000
|
{
|
|
3016
|
-
icon:
|
|
3001
|
+
icon: T.indent,
|
|
3017
3002
|
label: "Indent",
|
|
3018
3003
|
onClick: () => t.chain().focus().indent().run(),
|
|
3019
3004
|
isDisabled: !t.can().indent()
|
|
3020
3005
|
}
|
|
3021
3006
|
)
|
|
3022
3007
|
] }),
|
|
3023
|
-
/* @__PURE__ */ e(
|
|
3024
|
-
|
|
3008
|
+
/* @__PURE__ */ e(re, {}),
|
|
3009
|
+
se && /* @__PURE__ */ a(Y, { children: [
|
|
3025
3010
|
/* @__PURE__ */ a("div", { className: "mtx-toolbar-group", children: [
|
|
3026
3011
|
/* @__PURE__ */ e(
|
|
3027
3012
|
A,
|
|
3028
3013
|
{
|
|
3029
|
-
icon:
|
|
3014
|
+
icon: T.alignLeft,
|
|
3030
3015
|
label: "Align Left",
|
|
3031
3016
|
onClick: () => t.chain().focus().setTextAlign("left").run(),
|
|
3032
3017
|
isActive: t.isActive({ textAlign: "left" })
|
|
@@ -3035,7 +3020,7 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
3035
3020
|
/* @__PURE__ */ e(
|
|
3036
3021
|
A,
|
|
3037
3022
|
{
|
|
3038
|
-
icon:
|
|
3023
|
+
icon: T.alignCenter,
|
|
3039
3024
|
label: "Align Center",
|
|
3040
3025
|
onClick: () => t.chain().focus().setTextAlign("center").run(),
|
|
3041
3026
|
isActive: t.isActive({ textAlign: "center" })
|
|
@@ -3044,7 +3029,7 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
3044
3029
|
/* @__PURE__ */ e(
|
|
3045
3030
|
A,
|
|
3046
3031
|
{
|
|
3047
|
-
icon:
|
|
3032
|
+
icon: T.alignRight,
|
|
3048
3033
|
label: "Align Right",
|
|
3049
3034
|
onClick: () => t.chain().focus().setTextAlign("right").run(),
|
|
3050
3035
|
isActive: t.isActive({ textAlign: "right" })
|
|
@@ -3053,88 +3038,88 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
3053
3038
|
/* @__PURE__ */ e(
|
|
3054
3039
|
A,
|
|
3055
3040
|
{
|
|
3056
|
-
icon:
|
|
3041
|
+
icon: T.alignJustify,
|
|
3057
3042
|
label: "Justify",
|
|
3058
3043
|
onClick: () => t.chain().focus().setTextAlign("justify").run(),
|
|
3059
3044
|
isActive: t.isActive({ textAlign: "justify" })
|
|
3060
3045
|
}
|
|
3061
3046
|
)
|
|
3062
3047
|
] }),
|
|
3063
|
-
/* @__PURE__ */ e(
|
|
3048
|
+
/* @__PURE__ */ e(re, {})
|
|
3064
3049
|
] }),
|
|
3065
3050
|
/* @__PURE__ */ a("div", { className: "mtx-toolbar-group", children: [
|
|
3066
3051
|
/* @__PURE__ */ e(
|
|
3067
3052
|
A,
|
|
3068
3053
|
{
|
|
3069
|
-
icon:
|
|
3054
|
+
icon: T.link,
|
|
3070
3055
|
label: "Link",
|
|
3071
|
-
onClick:
|
|
3056
|
+
onClick: oe,
|
|
3072
3057
|
isActive: t.isActive("link")
|
|
3073
3058
|
}
|
|
3074
3059
|
),
|
|
3075
3060
|
/* @__PURE__ */ e(
|
|
3076
3061
|
A,
|
|
3077
3062
|
{
|
|
3078
|
-
icon:
|
|
3063
|
+
icon: T.image,
|
|
3079
3064
|
label: "Image",
|
|
3080
3065
|
onClick: De
|
|
3081
3066
|
}
|
|
3082
3067
|
),
|
|
3083
|
-
|
|
3068
|
+
se && /* @__PURE__ */ a(Y, { children: [
|
|
3084
3069
|
/* @__PURE__ */ e(
|
|
3085
3070
|
A,
|
|
3086
3071
|
{
|
|
3087
|
-
icon:
|
|
3072
|
+
icon: T.editImage,
|
|
3088
3073
|
label: "Edit Image",
|
|
3089
3074
|
onClick: () => r && r(),
|
|
3090
|
-
isDisabled: !
|
|
3075
|
+
isDisabled: !he
|
|
3091
3076
|
}
|
|
3092
3077
|
),
|
|
3093
3078
|
/* @__PURE__ */ e(
|
|
3094
3079
|
A,
|
|
3095
3080
|
{
|
|
3096
|
-
icon:
|
|
3081
|
+
icon: T.alignLeft,
|
|
3097
3082
|
label: "Wrap Image Left",
|
|
3098
|
-
onClick: () => s
|
|
3099
|
-
isActive:
|
|
3100
|
-
isDisabled: !
|
|
3083
|
+
onClick: () => s?.("left"),
|
|
3084
|
+
isActive: he && _e === "left",
|
|
3085
|
+
isDisabled: !he
|
|
3101
3086
|
}
|
|
3102
3087
|
),
|
|
3103
3088
|
/* @__PURE__ */ e(
|
|
3104
3089
|
A,
|
|
3105
3090
|
{
|
|
3106
|
-
icon:
|
|
3091
|
+
icon: T.alignCenter,
|
|
3107
3092
|
label: "Wrap Image Center",
|
|
3108
|
-
onClick: () => s
|
|
3109
|
-
isActive:
|
|
3110
|
-
isDisabled: !
|
|
3093
|
+
onClick: () => s?.("center"),
|
|
3094
|
+
isActive: he && _e === "center",
|
|
3095
|
+
isDisabled: !he
|
|
3111
3096
|
}
|
|
3112
3097
|
),
|
|
3113
3098
|
/* @__PURE__ */ e(
|
|
3114
3099
|
A,
|
|
3115
3100
|
{
|
|
3116
|
-
icon:
|
|
3101
|
+
icon: T.alignRight,
|
|
3117
3102
|
label: "Wrap Image Right",
|
|
3118
|
-
onClick: () => s
|
|
3119
|
-
isActive:
|
|
3120
|
-
isDisabled: !
|
|
3103
|
+
onClick: () => s?.("right"),
|
|
3104
|
+
isActive: he && _e === "right",
|
|
3105
|
+
isDisabled: !he
|
|
3121
3106
|
}
|
|
3122
3107
|
),
|
|
3123
3108
|
/* @__PURE__ */ e(
|
|
3124
3109
|
A,
|
|
3125
3110
|
{
|
|
3126
|
-
icon:
|
|
3111
|
+
icon: T.alignJustify,
|
|
3127
3112
|
label: "Wrap Image Full",
|
|
3128
|
-
onClick: () => s
|
|
3129
|
-
isActive:
|
|
3130
|
-
isDisabled: !
|
|
3113
|
+
onClick: () => s?.("full"),
|
|
3114
|
+
isActive: he && _e === "full",
|
|
3115
|
+
isDisabled: !he
|
|
3131
3116
|
}
|
|
3132
3117
|
)
|
|
3133
3118
|
] }),
|
|
3134
3119
|
/* @__PURE__ */ e(
|
|
3135
3120
|
A,
|
|
3136
3121
|
{
|
|
3137
|
-
icon:
|
|
3122
|
+
icon: T.table,
|
|
3138
3123
|
label: "Table",
|
|
3139
3124
|
onClick: Ee
|
|
3140
3125
|
}
|
|
@@ -3142,16 +3127,16 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
3142
3127
|
/* @__PURE__ */ e(
|
|
3143
3128
|
A,
|
|
3144
3129
|
{
|
|
3145
|
-
icon:
|
|
3130
|
+
icon: T.graph,
|
|
3146
3131
|
label: "Graph",
|
|
3147
|
-
onClick:
|
|
3132
|
+
onClick: fe
|
|
3148
3133
|
}
|
|
3149
3134
|
),
|
|
3150
|
-
|
|
3135
|
+
Se && /* @__PURE__ */ a(Y, { children: [
|
|
3151
3136
|
/* @__PURE__ */ e(
|
|
3152
3137
|
A,
|
|
3153
3138
|
{
|
|
3154
|
-
icon:
|
|
3139
|
+
icon: T.rowAbove,
|
|
3155
3140
|
label: "Insert Row Above",
|
|
3156
3141
|
onClick: ve
|
|
3157
3142
|
}
|
|
@@ -3159,23 +3144,23 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
3159
3144
|
/* @__PURE__ */ e(
|
|
3160
3145
|
A,
|
|
3161
3146
|
{
|
|
3162
|
-
icon:
|
|
3147
|
+
icon: T.rowBelow,
|
|
3163
3148
|
label: "Insert Row Below",
|
|
3164
|
-
onClick:
|
|
3149
|
+
onClick: J
|
|
3165
3150
|
}
|
|
3166
3151
|
),
|
|
3167
3152
|
/* @__PURE__ */ e(
|
|
3168
3153
|
A,
|
|
3169
3154
|
{
|
|
3170
|
-
icon:
|
|
3155
|
+
icon: T.columnLeft,
|
|
3171
3156
|
label: "Insert Column Left",
|
|
3172
|
-
onClick:
|
|
3157
|
+
onClick: w
|
|
3173
3158
|
}
|
|
3174
3159
|
),
|
|
3175
3160
|
/* @__PURE__ */ e(
|
|
3176
3161
|
A,
|
|
3177
3162
|
{
|
|
3178
|
-
icon:
|
|
3163
|
+
icon: T.columnRight,
|
|
3179
3164
|
label: "Insert Column Right",
|
|
3180
3165
|
onClick: D
|
|
3181
3166
|
}
|
|
@@ -3183,25 +3168,25 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
3183
3168
|
/* @__PURE__ */ e(
|
|
3184
3169
|
A,
|
|
3185
3170
|
{
|
|
3186
|
-
icon:
|
|
3171
|
+
icon: T.cellProperties,
|
|
3187
3172
|
label: "Cell Properties",
|
|
3188
|
-
onClick:
|
|
3173
|
+
onClick: R,
|
|
3189
3174
|
isDisabled: !Nt
|
|
3190
3175
|
}
|
|
3191
3176
|
),
|
|
3192
3177
|
/* @__PURE__ */ e(
|
|
3193
3178
|
A,
|
|
3194
3179
|
{
|
|
3195
|
-
icon:
|
|
3180
|
+
icon: T.deleteRow,
|
|
3196
3181
|
label: "Delete Row",
|
|
3197
|
-
onClick:
|
|
3182
|
+
onClick: y,
|
|
3198
3183
|
isDisabled: !yt
|
|
3199
3184
|
}
|
|
3200
3185
|
),
|
|
3201
3186
|
/* @__PURE__ */ e(
|
|
3202
3187
|
A,
|
|
3203
3188
|
{
|
|
3204
|
-
icon:
|
|
3189
|
+
icon: T.deleteColumn,
|
|
3205
3190
|
label: "Delete Column",
|
|
3206
3191
|
onClick: $,
|
|
3207
3192
|
isDisabled: !vt
|
|
@@ -3210,35 +3195,35 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
3210
3195
|
/* @__PURE__ */ e(
|
|
3211
3196
|
A,
|
|
3212
3197
|
{
|
|
3213
|
-
icon:
|
|
3198
|
+
icon: T.mergeCells,
|
|
3214
3199
|
label: "Merge Cells",
|
|
3215
|
-
onClick:
|
|
3200
|
+
onClick: X,
|
|
3216
3201
|
isDisabled: !kt
|
|
3217
3202
|
}
|
|
3218
3203
|
),
|
|
3219
3204
|
/* @__PURE__ */ e(
|
|
3220
3205
|
A,
|
|
3221
3206
|
{
|
|
3222
|
-
icon:
|
|
3207
|
+
icon: T.splitCell,
|
|
3223
3208
|
label: "Split Cell",
|
|
3224
|
-
onClick:
|
|
3209
|
+
onClick: U,
|
|
3225
3210
|
isDisabled: !wt
|
|
3226
3211
|
}
|
|
3227
3212
|
)
|
|
3228
3213
|
] }),
|
|
3229
|
-
|
|
3214
|
+
se && /* @__PURE__ */ a(Y, { children: [
|
|
3230
3215
|
/* @__PURE__ */ e(
|
|
3231
3216
|
"button",
|
|
3232
3217
|
{
|
|
3233
3218
|
className: "mtx-toolbar-btn mtx-toolbar-btn--dropdown",
|
|
3234
|
-
onClick: (
|
|
3235
|
-
if (!
|
|
3236
|
-
const
|
|
3237
|
-
ye({ x:
|
|
3219
|
+
onClick: (_) => {
|
|
3220
|
+
if (!Se) return;
|
|
3221
|
+
const E = _.currentTarget.getBoundingClientRect();
|
|
3222
|
+
ye({ x: E.left, y: E.bottom + 5 }), ae(!Ne);
|
|
3238
3223
|
},
|
|
3239
3224
|
title: "Table Operations",
|
|
3240
3225
|
"aria-label": "Table Operations",
|
|
3241
|
-
disabled: !
|
|
3226
|
+
disabled: !Se,
|
|
3242
3227
|
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" }) })
|
|
3243
3228
|
}
|
|
3244
3229
|
),
|
|
@@ -3246,17 +3231,17 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
3246
3231
|
"button",
|
|
3247
3232
|
{
|
|
3248
3233
|
className: "mtx-toolbar-btn",
|
|
3249
|
-
onClick: () =>
|
|
3234
|
+
onClick: () => Se && ee(!0),
|
|
3250
3235
|
title: "Table Templates",
|
|
3251
3236
|
"aria-label": "Table Templates",
|
|
3252
|
-
disabled: !
|
|
3237
|
+
disabled: !Se,
|
|
3253
3238
|
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" }) })
|
|
3254
3239
|
}
|
|
3255
3240
|
),
|
|
3256
3241
|
/* @__PURE__ */ e(
|
|
3257
3242
|
A,
|
|
3258
3243
|
{
|
|
3259
|
-
icon:
|
|
3244
|
+
icon: T.horizontalRule,
|
|
3260
3245
|
label: "Horizontal Rule",
|
|
3261
3246
|
onClick: () => t.chain().focus().setHorizontalRule().run()
|
|
3262
3247
|
}
|
|
@@ -3264,7 +3249,7 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
3264
3249
|
/* @__PURE__ */ e(
|
|
3265
3250
|
A,
|
|
3266
3251
|
{
|
|
3267
|
-
icon:
|
|
3252
|
+
icon: T.blockquote,
|
|
3268
3253
|
label: "Blockquote",
|
|
3269
3254
|
onClick: () => t.chain().focus().toggleBlockquote().run(),
|
|
3270
3255
|
isActive: t.isActive("blockquote")
|
|
@@ -3273,7 +3258,7 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
3273
3258
|
/* @__PURE__ */ e(
|
|
3274
3259
|
A,
|
|
3275
3260
|
{
|
|
3276
|
-
icon:
|
|
3261
|
+
icon: T.codeBlock,
|
|
3277
3262
|
label: "Code Block",
|
|
3278
3263
|
onClick: () => t.chain().focus().toggleCodeBlock().run(),
|
|
3279
3264
|
isActive: t.isActive("codeBlock")
|
|
@@ -3281,13 +3266,13 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
3281
3266
|
)
|
|
3282
3267
|
] })
|
|
3283
3268
|
] }),
|
|
3284
|
-
|
|
3285
|
-
/* @__PURE__ */ e(
|
|
3269
|
+
se && /* @__PURE__ */ a(Y, { children: [
|
|
3270
|
+
/* @__PURE__ */ e(re, {}),
|
|
3286
3271
|
/* @__PURE__ */ a("div", { className: "mtx-toolbar-group", children: [
|
|
3287
3272
|
/* @__PURE__ */ e(
|
|
3288
3273
|
A,
|
|
3289
3274
|
{
|
|
3290
|
-
icon:
|
|
3275
|
+
icon: T.superscript,
|
|
3291
3276
|
label: "Superscript",
|
|
3292
3277
|
onClick: () => t.chain().focus().toggleSuperscript().run(),
|
|
3293
3278
|
isActive: t.isActive("superscript")
|
|
@@ -3296,121 +3281,121 @@ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c
|
|
|
3296
3281
|
/* @__PURE__ */ e(
|
|
3297
3282
|
A,
|
|
3298
3283
|
{
|
|
3299
|
-
icon:
|
|
3284
|
+
icon: T.subscript,
|
|
3300
3285
|
label: "Subscript",
|
|
3301
3286
|
onClick: () => t.chain().focus().toggleSubscript().run(),
|
|
3302
3287
|
isActive: t.isActive("subscript")
|
|
3303
3288
|
}
|
|
3304
3289
|
)
|
|
3305
3290
|
] }),
|
|
3306
|
-
/* @__PURE__ */ e(
|
|
3291
|
+
/* @__PURE__ */ e(re, {})
|
|
3307
3292
|
] }),
|
|
3308
3293
|
/* @__PURE__ */ a("div", { className: "mtx-toolbar-group", children: [
|
|
3309
3294
|
/* @__PURE__ */ e(
|
|
3310
3295
|
A,
|
|
3311
3296
|
{
|
|
3312
|
-
icon:
|
|
3297
|
+
icon: T.math,
|
|
3313
3298
|
label: "Math Formula",
|
|
3314
|
-
onClick: () => i
|
|
3299
|
+
onClick: () => i?.(),
|
|
3315
3300
|
className: "mtx-toolbar-btn--accent"
|
|
3316
3301
|
}
|
|
3317
3302
|
),
|
|
3318
|
-
|
|
3303
|
+
se && /* @__PURE__ */ e(
|
|
3319
3304
|
A,
|
|
3320
3305
|
{
|
|
3321
|
-
icon:
|
|
3306
|
+
icon: T.chemistry,
|
|
3322
3307
|
label: "Chemistry Formula",
|
|
3323
|
-
onClick: () => i
|
|
3308
|
+
onClick: () => i?.("chem"),
|
|
3324
3309
|
className: "mtx-toolbar-btn--accent-secondary"
|
|
3325
3310
|
}
|
|
3326
3311
|
)
|
|
3327
3312
|
] }),
|
|
3328
|
-
/* @__PURE__ */ e(
|
|
3313
|
+
/* @__PURE__ */ e(re, {}),
|
|
3329
3314
|
/* @__PURE__ */ e("div", { className: "mtx-toolbar-group", children: /* @__PURE__ */ e(
|
|
3330
3315
|
A,
|
|
3331
3316
|
{
|
|
3332
|
-
icon:
|
|
3317
|
+
icon: T.removeFormat,
|
|
3333
3318
|
label: "Remove Format",
|
|
3334
|
-
onClick:
|
|
3319
|
+
onClick: At
|
|
3335
3320
|
}
|
|
3336
3321
|
) }),
|
|
3337
|
-
f && /* @__PURE__ */ e(
|
|
3322
|
+
f && /* @__PURE__ */ e(Q, { fallback: null, children: /* @__PURE__ */ e(
|
|
3338
3323
|
xa,
|
|
3339
3324
|
{
|
|
3340
3325
|
isOpen: f,
|
|
3341
|
-
currentUrl:
|
|
3342
|
-
currentText:
|
|
3343
|
-
currentTarget:
|
|
3326
|
+
currentUrl: q().url,
|
|
3327
|
+
currentText: q().text,
|
|
3328
|
+
currentTarget: q().target,
|
|
3344
3329
|
onInsert: Ae,
|
|
3345
|
-
onRemove: t
|
|
3346
|
-
onClose: () =>
|
|
3330
|
+
onRemove: t?.isActive("link") ? C : void 0,
|
|
3331
|
+
onClose: () => B(!1)
|
|
3347
3332
|
}
|
|
3348
3333
|
) }),
|
|
3349
|
-
p && /* @__PURE__ */ e(
|
|
3350
|
-
|
|
3334
|
+
p && /* @__PURE__ */ e(Q, { fallback: null, children: /* @__PURE__ */ e(
|
|
3335
|
+
fa,
|
|
3351
3336
|
{
|
|
3352
3337
|
isOpen: p,
|
|
3353
|
-
onInsert:
|
|
3354
|
-
onClose: () =>
|
|
3338
|
+
onInsert: me,
|
|
3339
|
+
onClose: () => x(!1)
|
|
3355
3340
|
}
|
|
3356
3341
|
) }),
|
|
3357
3342
|
/* @__PURE__ */ e(
|
|
3358
|
-
|
|
3343
|
+
ft,
|
|
3359
3344
|
{
|
|
3360
3345
|
isOpen: Ne,
|
|
3361
|
-
position:
|
|
3362
|
-
onClose: () =>
|
|
3346
|
+
position: ue || { x: 200, y: 300 },
|
|
3347
|
+
onClose: () => ae(!1),
|
|
3363
3348
|
onAddRowBefore: ve,
|
|
3364
|
-
onAddRowAfter:
|
|
3365
|
-
onDeleteRow:
|
|
3366
|
-
onAddColumnBefore:
|
|
3349
|
+
onAddRowAfter: J,
|
|
3350
|
+
onDeleteRow: y,
|
|
3351
|
+
onAddColumnBefore: w,
|
|
3367
3352
|
onAddColumnAfter: D,
|
|
3368
3353
|
onDeleteColumn: $,
|
|
3369
|
-
onDeleteTable:
|
|
3370
|
-
onCellProperties:
|
|
3371
|
-
onMergeCells:
|
|
3372
|
-
onSplitCell:
|
|
3354
|
+
onDeleteTable: ge,
|
|
3355
|
+
onCellProperties: R,
|
|
3356
|
+
onMergeCells: X,
|
|
3357
|
+
onSplitCell: U
|
|
3373
3358
|
}
|
|
3374
3359
|
),
|
|
3375
3360
|
/* @__PURE__ */ e(
|
|
3376
3361
|
ga,
|
|
3377
3362
|
{
|
|
3378
|
-
isOpen:
|
|
3379
|
-
position:
|
|
3363
|
+
isOpen: pe,
|
|
3364
|
+
position: Te || { x: 200, y: 300 },
|
|
3380
3365
|
currentAlign: _e,
|
|
3381
|
-
hasCustomPosition:
|
|
3382
|
-
onClose: () =>
|
|
3383
|
-
onSetAlign:
|
|
3366
|
+
hasCustomPosition: bt,
|
|
3367
|
+
onClose: () => O(!1),
|
|
3368
|
+
onSetAlign: k,
|
|
3384
3369
|
onResetPosition: o ? K : void 0,
|
|
3385
|
-
onCenterImage: s ?
|
|
3370
|
+
onCenterImage: s ? F : void 0,
|
|
3386
3371
|
onEditImage: r ? V : void 0
|
|
3387
3372
|
}
|
|
3388
3373
|
),
|
|
3389
|
-
|
|
3390
|
-
|
|
3374
|
+
H && /* @__PURE__ */ e(Q, { fallback: null, children: /* @__PURE__ */ e(
|
|
3375
|
+
ba,
|
|
3391
3376
|
{
|
|
3392
|
-
isOpen:
|
|
3393
|
-
initialData:
|
|
3377
|
+
isOpen: H,
|
|
3378
|
+
initialData: be,
|
|
3394
3379
|
onSave: xe,
|
|
3395
3380
|
onClose: () => {
|
|
3396
|
-
|
|
3381
|
+
P(!1), te({});
|
|
3397
3382
|
}
|
|
3398
3383
|
}
|
|
3399
3384
|
) }),
|
|
3400
|
-
|
|
3385
|
+
z && /* @__PURE__ */ e(Q, { fallback: null, children: /* @__PURE__ */ e(
|
|
3401
3386
|
Na,
|
|
3402
3387
|
{
|
|
3403
|
-
isOpen:
|
|
3388
|
+
isOpen: z,
|
|
3404
3389
|
onSelect: ke,
|
|
3405
|
-
onClose: () =>
|
|
3390
|
+
onClose: () => ee(!1)
|
|
3406
3391
|
}
|
|
3407
3392
|
) }),
|
|
3408
|
-
|
|
3393
|
+
j && /* @__PURE__ */ e(Q, { fallback: null, children: /* @__PURE__ */ e(
|
|
3409
3394
|
ya,
|
|
3410
3395
|
{
|
|
3411
|
-
isOpen:
|
|
3412
|
-
onClose: () =>
|
|
3413
|
-
onInsert:
|
|
3396
|
+
isOpen: j,
|
|
3397
|
+
onClose: () => le(!1),
|
|
3398
|
+
onInsert: ie
|
|
3414
3399
|
}
|
|
3415
3400
|
) })
|
|
3416
3401
|
] }) : null;
|
|
@@ -3492,28 +3477,28 @@ const qe = [
|
|
|
3492
3477
|
{ label: "Kimia", latex: "\\ce{#?}", title: "Rumus Kimia (ce)" }
|
|
3493
3478
|
]
|
|
3494
3479
|
}
|
|
3495
|
-
],
|
|
3496
|
-
function
|
|
3497
|
-
const [i, c] =
|
|
3498
|
-
n(p), c((
|
|
3499
|
-
}, [n]),
|
|
3480
|
+
], Aa = 6;
|
|
3481
|
+
function Ta({ onInsertLatex: n, onToggleSymbols: t, onToggleTemplates: l }) {
|
|
3482
|
+
const [i, c] = M([]), [r, s] = M("Basic"), [o, b] = M(""), N = we(() => qe.flatMap((p) => p.buttons), []), u = we(() => new Map(N.map((p) => [p.latex, p])), [N]), h = g((p) => {
|
|
3483
|
+
n(p), c((x) => [p, ...x.filter((H) => H !== p)].slice(0, Aa));
|
|
3484
|
+
}, [n]), d = we(
|
|
3500
3485
|
() => i.map((p) => u.get(p)).filter((p) => !!p),
|
|
3501
3486
|
[u, i]
|
|
3502
|
-
),
|
|
3487
|
+
), v = o.trim().toLowerCase(), f = we(() => v ? qe.map((p) => ({
|
|
3503
3488
|
...p,
|
|
3504
|
-
buttons: p.buttons.filter((
|
|
3505
|
-
})).filter((p) => p.buttons.length > 0) : qe, [
|
|
3506
|
-
|
|
3489
|
+
buttons: p.buttons.filter((x) => `${x.label} ${x.title} ${x.latex}`.toLowerCase().includes(v))
|
|
3490
|
+
})).filter((p) => p.buttons.length > 0) : qe, [v]);
|
|
3491
|
+
W(() => {
|
|
3507
3492
|
if (typeof window > "u") return;
|
|
3508
3493
|
const p = window.localStorage.getItem(it);
|
|
3509
3494
|
p && s(p);
|
|
3510
|
-
}, []),
|
|
3495
|
+
}, []), W(() => {
|
|
3511
3496
|
typeof window > "u" || !r || window.localStorage.setItem(it, r);
|
|
3512
|
-
}, [r]),
|
|
3513
|
-
|
|
3514
|
-
}, [f,
|
|
3515
|
-
const
|
|
3516
|
-
s((
|
|
3497
|
+
}, [r]), W(() => {
|
|
3498
|
+
v && f.length > 0 && s(f[0].label);
|
|
3499
|
+
}, [f, v]);
|
|
3500
|
+
const B = g((p) => {
|
|
3501
|
+
s((x) => x === p ? "" : p);
|
|
3517
3502
|
}, []);
|
|
3518
3503
|
return /* @__PURE__ */ a("div", { className: "mtx-math-toolbar", role: "toolbar", "aria-label": "Math toolbar", children: [
|
|
3519
3504
|
/* @__PURE__ */ a("div", { className: "mtx-math-toolbar__label", children: [
|
|
@@ -3526,15 +3511,15 @@ function Aa({ onInsertLatex: n, onToggleSymbols: t, onToggleTemplates: l }) {
|
|
|
3526
3511
|
type: "search",
|
|
3527
3512
|
className: "mtx-math-toolbar__search",
|
|
3528
3513
|
value: o,
|
|
3529
|
-
onChange: (p) =>
|
|
3514
|
+
onChange: (p) => b(p.target.value),
|
|
3530
3515
|
placeholder: "Cari rumus...",
|
|
3531
3516
|
"aria-label": "Search math formulas"
|
|
3532
3517
|
}
|
|
3533
3518
|
) }),
|
|
3534
3519
|
/* @__PURE__ */ a("div", { className: "mtx-math-toolbar__buttons", children: [
|
|
3535
|
-
|
|
3520
|
+
d.length > 0 && /* @__PURE__ */ a(Y, { children: [
|
|
3536
3521
|
/* @__PURE__ */ e("div", { className: "mtx-math-toolbar__section-label", children: "Recent" }),
|
|
3537
|
-
|
|
3522
|
+
d.map((p) => /* @__PURE__ */ e(
|
|
3538
3523
|
st,
|
|
3539
3524
|
{
|
|
3540
3525
|
label: p.label,
|
|
@@ -3553,7 +3538,7 @@ function Aa({ onInsertLatex: n, onToggleSymbols: t, onToggleTemplates: l }) {
|
|
|
3553
3538
|
{
|
|
3554
3539
|
type: "button",
|
|
3555
3540
|
className: `mtx-math-toolbar__section-toggle ${r === p.label ? "is-active" : ""}`,
|
|
3556
|
-
onClick: () =>
|
|
3541
|
+
onClick: () => B(p.label),
|
|
3557
3542
|
"aria-expanded": r === p.label,
|
|
3558
3543
|
"aria-label": `${p.label} group`,
|
|
3559
3544
|
children: [
|
|
@@ -3562,18 +3547,18 @@ function Aa({ onInsertLatex: n, onToggleSymbols: t, onToggleTemplates: l }) {
|
|
|
3562
3547
|
]
|
|
3563
3548
|
}
|
|
3564
3549
|
),
|
|
3565
|
-
r === p.label && p.buttons.map((
|
|
3550
|
+
r === p.label && p.buttons.map((x) => /* @__PURE__ */ e(
|
|
3566
3551
|
st,
|
|
3567
3552
|
{
|
|
3568
|
-
label:
|
|
3569
|
-
latex:
|
|
3553
|
+
label: x.label,
|
|
3554
|
+
latex: x.latex,
|
|
3570
3555
|
onClick: h,
|
|
3571
|
-
title:
|
|
3556
|
+
title: x.title
|
|
3572
3557
|
},
|
|
3573
|
-
|
|
3558
|
+
x.latex
|
|
3574
3559
|
))
|
|
3575
3560
|
] }, p.label)),
|
|
3576
|
-
|
|
3561
|
+
v && f.length === 0 && /* @__PURE__ */ e("div", { className: "mtx-math-toolbar__empty", children: "No formula matches your search." })
|
|
3577
3562
|
] }),
|
|
3578
3563
|
/* @__PURE__ */ a("div", { className: "mtx-math-toolbar__actions", children: [
|
|
3579
3564
|
/* @__PURE__ */ a(
|
|
@@ -3699,7 +3684,7 @@ const rt = [
|
|
|
3699
3684
|
}
|
|
3700
3685
|
];
|
|
3701
3686
|
function Ma({ onInsert: n, onClose: t }) {
|
|
3702
|
-
const [l, i] =
|
|
3687
|
+
const [l, i] = M(""), c = we(() => {
|
|
3703
3688
|
if (!l.trim()) return rt;
|
|
3704
3689
|
const r = l.toLowerCase();
|
|
3705
3690
|
return rt.map((s) => ({
|
|
@@ -3766,14 +3751,13 @@ function ct(n, t, l) {
|
|
|
3766
3751
|
}
|
|
3767
3752
|
function Je(n) {
|
|
3768
3753
|
return n.replace(Ha, (t, l, i = "") => {
|
|
3769
|
-
|
|
3770
|
-
const c = i.match(/\sclass=(['"])(.*?)\1/i), r = i.match(/\sdata-indent=(['"])(\d+)\1/i), o = ((u = c == null ? void 0 : c[2].match(/(?:^|\s)tt-indent-(\d+)(?:\s|$)/)) == null ? void 0 : u[1]) || (r == null ? void 0 : r[2]);
|
|
3754
|
+
const c = i.match(/\sclass=(['"])(.*?)\1/i), r = i.match(/\sdata-indent=(['"])(\d+)\1/i), o = c?.[2].match(/(?:^|\s)tt-indent-(\d+)(?:\s|$)/)?.[1] || r?.[2];
|
|
3771
3755
|
if (!o)
|
|
3772
3756
|
return t;
|
|
3773
|
-
const
|
|
3774
|
-
|
|
3775
|
-
let
|
|
3776
|
-
return
|
|
3757
|
+
const b = new Set((c?.[2] || "").split(/\s+/).filter(Boolean));
|
|
3758
|
+
b.add("tt-indent"), b.add(`tt-indent-${o}`);
|
|
3759
|
+
let N = i;
|
|
3760
|
+
return N = ct(N, "class", Array.from(b).join(" ")), N = ct(N, "data-indent", o), `<${l}${N}>`;
|
|
3777
3761
|
});
|
|
3778
3762
|
}
|
|
3779
3763
|
function ot(n) {
|
|
@@ -3804,57 +3788,52 @@ function dn(n) {
|
|
|
3804
3788
|
function _a(n) {
|
|
3805
3789
|
return n.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>");
|
|
3806
3790
|
}
|
|
3807
|
-
function
|
|
3791
|
+
function Sa(n) {
|
|
3808
3792
|
return n.replace(/class="[^"]*kix-[^"]*"/g, "").replace(/style="[^"]*direction:[^"]*"/g, "").replace(/<b style="font-weight:normal"/g, "<span").replace(/<span style="font-weight:normal"/g, "<span");
|
|
3809
3793
|
}
|
|
3810
|
-
function
|
|
3811
|
-
|
|
3812
|
-
const l = (c = t.clipboardData) == null ? void 0 : c.getData("text/html"), i = (r = t.clipboardData) == null ? void 0 : r.getData("text/plain");
|
|
3794
|
+
function za(n, t) {
|
|
3795
|
+
const l = t.clipboardData?.getData("text/html"), i = t.clipboardData?.getData("text/plain");
|
|
3813
3796
|
if (!l && i)
|
|
3814
3797
|
return !1;
|
|
3815
3798
|
if (l) {
|
|
3816
3799
|
if (l.includes("mso-") || l.includes("MsoNormal") || l.includes("<o:p>")) {
|
|
3817
3800
|
t.preventDefault();
|
|
3818
|
-
const
|
|
3819
|
-
return n.chain().focus().insertContent(
|
|
3801
|
+
const c = _a(l);
|
|
3802
|
+
return n.chain().focus().insertContent(c).run(), !0;
|
|
3820
3803
|
}
|
|
3821
3804
|
if (l.includes("kix-") || l.includes("docs-internal-guide")) {
|
|
3822
3805
|
t.preventDefault();
|
|
3823
|
-
const
|
|
3824
|
-
return n.chain().focus().insertContent(
|
|
3806
|
+
const c = Sa(l);
|
|
3807
|
+
return n.chain().focus().insertContent(c).run(), !0;
|
|
3825
3808
|
}
|
|
3826
3809
|
}
|
|
3827
3810
|
return !1;
|
|
3828
3811
|
}
|
|
3829
3812
|
function Da(n, t) {
|
|
3830
|
-
var i;
|
|
3831
3813
|
const l = t;
|
|
3832
3814
|
if (l.shiftKey && (l.ctrlKey || l.metaKey)) {
|
|
3833
3815
|
t.preventDefault();
|
|
3834
|
-
const
|
|
3835
|
-
if (
|
|
3836
|
-
return n.chain().focus().insertContent(
|
|
3816
|
+
const i = t.clipboardData?.getData("text/plain");
|
|
3817
|
+
if (i)
|
|
3818
|
+
return n.chain().focus().insertContent(i).run(), !0;
|
|
3837
3819
|
}
|
|
3838
3820
|
return !1;
|
|
3839
3821
|
}
|
|
3840
3822
|
function mt(n) {
|
|
3841
3823
|
let t = 0;
|
|
3842
3824
|
return n.descendants((l) => {
|
|
3843
|
-
|
|
3844
|
-
l.isText && (t += ((i = l.text) == null ? void 0 : i.split(/\s+/).filter((c) => c.length > 0).length) || 0);
|
|
3825
|
+
l.isText && (t += l.text?.split(/\s+/).filter((i) => i.length > 0).length || 0);
|
|
3845
3826
|
}), t;
|
|
3846
3827
|
}
|
|
3847
3828
|
function dt(n, t = !0) {
|
|
3848
|
-
var i;
|
|
3849
3829
|
let l = 0;
|
|
3850
|
-
return n.descendants((
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
}), t ? l : l - (((i = n.textContent) == null ? void 0 : i.split(" ").length) - 1 || 0);
|
|
3830
|
+
return n.descendants((i) => {
|
|
3831
|
+
i.isText && (l += i.text?.length || 0);
|
|
3832
|
+
}), t ? l : l - (n.textContent?.split(" ").length - 1 || 0);
|
|
3854
3833
|
}
|
|
3855
|
-
const
|
|
3856
|
-
const [t, l] =
|
|
3857
|
-
return
|
|
3834
|
+
const Ia = 120, Ba = ce.memo(({ editor: n }) => {
|
|
3835
|
+
const [t, l] = M({ words: 0, chars: 0 }), i = I(null);
|
|
3836
|
+
return W(() => {
|
|
3858
3837
|
if (!n) return;
|
|
3859
3838
|
const c = () => {
|
|
3860
3839
|
i.current && clearTimeout(i.current), i.current = setTimeout(() => {
|
|
@@ -3862,7 +3841,7 @@ const Ba = 120, Pa = oe.memo(({ editor: n }) => {
|
|
|
3862
3841
|
words: mt(n.state.doc),
|
|
3863
3842
|
chars: dt(n.state.doc, !0)
|
|
3864
3843
|
});
|
|
3865
|
-
},
|
|
3844
|
+
}, Ia);
|
|
3866
3845
|
};
|
|
3867
3846
|
return l({
|
|
3868
3847
|
words: mt(n.state.doc),
|
|
@@ -3882,7 +3861,7 @@ const Ba = 120, Pa = oe.memo(({ editor: n }) => {
|
|
|
3882
3861
|
t.chars === 1 ? "character" : "characters"
|
|
3883
3862
|
] })
|
|
3884
3863
|
] });
|
|
3885
|
-
}),
|
|
3864
|
+
}), Pa = [
|
|
3886
3865
|
"button:not([disabled])",
|
|
3887
3866
|
"[href]",
|
|
3888
3867
|
"input:not([disabled])",
|
|
@@ -3891,39 +3870,39 @@ const Ba = 120, Pa = oe.memo(({ editor: n }) => {
|
|
|
3891
3870
|
'[tabindex]:not([tabindex="-1"])'
|
|
3892
3871
|
].join(", ");
|
|
3893
3872
|
function ht(n) {
|
|
3894
|
-
return Array.from(n.querySelectorAll(
|
|
3873
|
+
return Array.from(n.querySelectorAll(Pa)).filter(
|
|
3895
3874
|
(t) => !t.hasAttribute("disabled") && t.getAttribute("aria-hidden") !== "true"
|
|
3896
3875
|
);
|
|
3897
3876
|
}
|
|
3898
|
-
function
|
|
3877
|
+
function Va({
|
|
3899
3878
|
isOpen: n,
|
|
3900
3879
|
dialogRef: t,
|
|
3901
3880
|
onClose: l
|
|
3902
3881
|
}) {
|
|
3903
|
-
|
|
3882
|
+
W(() => {
|
|
3904
3883
|
if (!n || !t.current) return;
|
|
3905
3884
|
const i = t.current, c = document.activeElement instanceof HTMLElement ? document.activeElement : null, r = ht(i);
|
|
3906
|
-
(r.find((
|
|
3907
|
-
const o = (
|
|
3908
|
-
if (
|
|
3909
|
-
|
|
3885
|
+
(r.find((b) => b.hasAttribute("autofocus")) || r[0] || i).focus();
|
|
3886
|
+
const o = (b) => {
|
|
3887
|
+
if (b.key === "Escape") {
|
|
3888
|
+
b.preventDefault(), l();
|
|
3910
3889
|
return;
|
|
3911
3890
|
}
|
|
3912
|
-
if (
|
|
3913
|
-
const
|
|
3914
|
-
if (
|
|
3915
|
-
|
|
3891
|
+
if (b.key !== "Tab") return;
|
|
3892
|
+
const N = ht(i);
|
|
3893
|
+
if (N.length === 0) {
|
|
3894
|
+
b.preventDefault(), i.focus();
|
|
3916
3895
|
return;
|
|
3917
3896
|
}
|
|
3918
|
-
const u =
|
|
3919
|
-
if (
|
|
3920
|
-
(
|
|
3897
|
+
const u = N[0], h = N[N.length - 1], d = document.activeElement;
|
|
3898
|
+
if (b.shiftKey) {
|
|
3899
|
+
(d === u || d === i) && (b.preventDefault(), h.focus());
|
|
3921
3900
|
return;
|
|
3922
3901
|
}
|
|
3923
|
-
|
|
3902
|
+
d === h && (b.preventDefault(), u.focus());
|
|
3924
3903
|
};
|
|
3925
3904
|
return document.addEventListener("keydown", o), () => {
|
|
3926
|
-
document.removeEventListener("keydown", o), c
|
|
3905
|
+
document.removeEventListener("keydown", o), c?.focus();
|
|
3927
3906
|
};
|
|
3928
3907
|
}, [t, n, l]);
|
|
3929
3908
|
}
|
|
@@ -3935,26 +3914,26 @@ const Ge = {
|
|
|
3935
3914
|
title: "",
|
|
3936
3915
|
maintainAspectRatio: !0
|
|
3937
3916
|
};
|
|
3938
|
-
function
|
|
3917
|
+
function Ra({
|
|
3939
3918
|
isOpen: n,
|
|
3940
3919
|
onClose: t,
|
|
3941
3920
|
onApply: l,
|
|
3942
3921
|
initialData: i
|
|
3943
3922
|
}) {
|
|
3944
|
-
const c = Lt(), r =
|
|
3945
|
-
|
|
3923
|
+
const c = Lt(), r = I(null), [s, o] = M({ ...Ge, ...i });
|
|
3924
|
+
W(() => {
|
|
3946
3925
|
i && o({ ...Ge, ...i });
|
|
3947
|
-
}, [i]),
|
|
3948
|
-
const
|
|
3949
|
-
o((
|
|
3950
|
-
}, []),
|
|
3951
|
-
o((
|
|
3952
|
-
}, []), u =
|
|
3926
|
+
}, [i]), Va({ isOpen: n, dialogRef: r, onClose: t });
|
|
3927
|
+
const b = g((d) => {
|
|
3928
|
+
o((v) => (v.maintainAspectRatio, { ...v, width: d }));
|
|
3929
|
+
}, []), N = g((d) => {
|
|
3930
|
+
o((v) => (v.maintainAspectRatio, { ...v, height: d }));
|
|
3931
|
+
}, []), u = g(() => {
|
|
3953
3932
|
l(s), t();
|
|
3954
|
-
}, [s, l, t]), h =
|
|
3933
|
+
}, [s, l, t]), h = g(() => {
|
|
3955
3934
|
o({ ...Ge, ...i });
|
|
3956
3935
|
}, [i]);
|
|
3957
|
-
return n ? /* @__PURE__ */ a(
|
|
3936
|
+
return n ? /* @__PURE__ */ a(Y, { children: [
|
|
3958
3937
|
/* @__PURE__ */ e("div", { className: "mtx-dialog-overlay", onClick: t }),
|
|
3959
3938
|
/* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog", ref: r, role: "dialog", "aria-modal": "true", "aria-labelledby": c, tabIndex: -1, children: [
|
|
3960
3939
|
/* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__header", children: [
|
|
@@ -3979,7 +3958,7 @@ function Ia({
|
|
|
3979
3958
|
{
|
|
3980
3959
|
type: "text",
|
|
3981
3960
|
value: s.width,
|
|
3982
|
-
onChange: (
|
|
3961
|
+
onChange: (d) => b(d.target.value),
|
|
3983
3962
|
placeholder: "100% atau 300"
|
|
3984
3963
|
}
|
|
3985
3964
|
)
|
|
@@ -3991,7 +3970,7 @@ function Ia({
|
|
|
3991
3970
|
{
|
|
3992
3971
|
type: "text",
|
|
3993
3972
|
value: s.height,
|
|
3994
|
-
onChange: (
|
|
3973
|
+
onChange: (d) => N(d.target.value),
|
|
3995
3974
|
placeholder: "auto atau 200"
|
|
3996
3975
|
}
|
|
3997
3976
|
)
|
|
@@ -4003,16 +3982,16 @@ function Ia({
|
|
|
4003
3982
|
type: "checkbox",
|
|
4004
3983
|
id: "maintain-aspect",
|
|
4005
3984
|
checked: s.maintainAspectRatio,
|
|
4006
|
-
onChange: (
|
|
3985
|
+
onChange: (d) => o((v) => ({ ...v, maintainAspectRatio: d.target.checked }))
|
|
4007
3986
|
}
|
|
4008
3987
|
),
|
|
4009
3988
|
/* @__PURE__ */ e("label", { htmlFor: "maintain-aspect", children: "Pertahankan proporsi" })
|
|
4010
3989
|
] }),
|
|
4011
3990
|
/* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__size-presets", children: [
|
|
4012
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
4013
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
4014
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
4015
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
3991
|
+
/* @__PURE__ */ e("button", { onClick: () => b("25%"), className: "mtx-btn-sm", children: "25%" }),
|
|
3992
|
+
/* @__PURE__ */ e("button", { onClick: () => b("50%"), className: "mtx-btn-sm", children: "50%" }),
|
|
3993
|
+
/* @__PURE__ */ e("button", { onClick: () => b("75%"), className: "mtx-btn-sm", children: "75%" }),
|
|
3994
|
+
/* @__PURE__ */ e("button", { onClick: () => b("100%"), className: "mtx-btn-sm", children: "100%" })
|
|
4016
3995
|
] })
|
|
4017
3996
|
] }),
|
|
4018
3997
|
/* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__section", children: [
|
|
@@ -4022,7 +4001,7 @@ function Ia({
|
|
|
4022
4001
|
"button",
|
|
4023
4002
|
{
|
|
4024
4003
|
className: `mtx-align-btn ${s.align === "left" ? "is-active" : ""}`,
|
|
4025
|
-
onClick: () => o((
|
|
4004
|
+
onClick: () => o((d) => ({ ...d, align: "left" })),
|
|
4026
4005
|
title: "Kiri (Text Wrapping)",
|
|
4027
4006
|
children: [
|
|
4028
4007
|
/* @__PURE__ */ a("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: [
|
|
@@ -4040,7 +4019,7 @@ function Ia({
|
|
|
4040
4019
|
"button",
|
|
4041
4020
|
{
|
|
4042
4021
|
className: `mtx-align-btn ${s.align === "center" ? "is-active" : ""}`,
|
|
4043
|
-
onClick: () => o((
|
|
4022
|
+
onClick: () => o((d) => ({ ...d, align: "center" })),
|
|
4044
4023
|
title: "Tengah",
|
|
4045
4024
|
children: [
|
|
4046
4025
|
/* @__PURE__ */ e("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("rect", { x: "8", y: "5", width: "8", height: "14", rx: "1", fill: "currentColor", opacity: "0.5" }) }),
|
|
@@ -4052,7 +4031,7 @@ function Ia({
|
|
|
4052
4031
|
"button",
|
|
4053
4032
|
{
|
|
4054
4033
|
className: `mtx-align-btn ${s.align === "right" ? "is-active" : ""}`,
|
|
4055
|
-
onClick: () => o((
|
|
4034
|
+
onClick: () => o((d) => ({ ...d, align: "right" })),
|
|
4056
4035
|
title: "Kanan (Text Wrapping)",
|
|
4057
4036
|
children: [
|
|
4058
4037
|
/* @__PURE__ */ a("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: [
|
|
@@ -4070,7 +4049,7 @@ function Ia({
|
|
|
4070
4049
|
"button",
|
|
4071
4050
|
{
|
|
4072
4051
|
className: `mtx-align-btn ${s.align === "full" ? "is-active" : ""}`,
|
|
4073
|
-
onClick: () => o((
|
|
4052
|
+
onClick: () => o((d) => ({ ...d, align: "full" })),
|
|
4074
4053
|
title: "Full Width",
|
|
4075
4054
|
children: [
|
|
4076
4055
|
/* @__PURE__ */ e("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "14", rx: "1", fill: "currentColor", opacity: "0.5" }) }),
|
|
@@ -4094,7 +4073,7 @@ function Ia({
|
|
|
4094
4073
|
{
|
|
4095
4074
|
type: "text",
|
|
4096
4075
|
value: s.alt,
|
|
4097
|
-
onChange: (
|
|
4076
|
+
onChange: (d) => o((v) => ({ ...v, alt: d.target.value })),
|
|
4098
4077
|
placeholder: "Deskripsi gambar..."
|
|
4099
4078
|
}
|
|
4100
4079
|
)
|
|
@@ -4106,7 +4085,7 @@ function Ia({
|
|
|
4106
4085
|
{
|
|
4107
4086
|
type: "text",
|
|
4108
4087
|
value: s.title,
|
|
4109
|
-
onChange: (
|
|
4088
|
+
onChange: (d) => o((v) => ({ ...v, title: d.target.value })),
|
|
4110
4089
|
placeholder: "Judul gambar..."
|
|
4111
4090
|
}
|
|
4112
4091
|
)
|
|
@@ -4123,7 +4102,7 @@ function Ia({
|
|
|
4123
4102
|
] })
|
|
4124
4103
|
] }) : null;
|
|
4125
4104
|
}
|
|
4126
|
-
const Ea =
|
|
4105
|
+
const Ea = ne(() => import("./TemplatePanel-BE_UfzYM.js").then((n) => ({ default: n.TemplatePanel }))), Ka = ne(() => Promise.resolve().then(() => da).then((n) => ({ default: n.MathTypeDialog }))), $a = ne(() => import("./ImageInsertDialog-Cn-IrnHN.js").then((n) => ({ default: n.ImageInsertDialog })));
|
|
4127
4106
|
async function Xe(n) {
|
|
4128
4107
|
return new Promise((t, l) => {
|
|
4129
4108
|
const i = new window.Image();
|
|
@@ -4135,11 +4114,11 @@ async function Xe(n) {
|
|
|
4135
4114
|
}, i.onerror = () => l(new Error("Image load failed")), i.src = n;
|
|
4136
4115
|
});
|
|
4137
4116
|
}
|
|
4138
|
-
function
|
|
4117
|
+
function ze(n, t) {
|
|
4139
4118
|
const l = n && n > 0 ? n : 720, i = Math.max(240, l - 32);
|
|
4140
4119
|
return Math.max(120, Math.min(t, i));
|
|
4141
4120
|
}
|
|
4142
|
-
function
|
|
4121
|
+
function Be(n, t, l) {
|
|
4143
4122
|
return {
|
|
4144
4123
|
src: n,
|
|
4145
4124
|
alt: t,
|
|
@@ -4150,10 +4129,9 @@ function Pe(n, t, l) {
|
|
|
4150
4129
|
align: "center"
|
|
4151
4130
|
};
|
|
4152
4131
|
}
|
|
4153
|
-
function
|
|
4154
|
-
var c;
|
|
4132
|
+
function Pe(n) {
|
|
4155
4133
|
const { selection: t } = n.state, l = t.node;
|
|
4156
|
-
if (
|
|
4134
|
+
if (l?.type?.name === "image")
|
|
4157
4135
|
return {
|
|
4158
4136
|
node: { attrs: l.attrs || {} },
|
|
4159
4137
|
pos: t.from
|
|
@@ -4164,7 +4142,7 @@ function Ve(n) {
|
|
|
4164
4142
|
pos: t.$from.before()
|
|
4165
4143
|
} : null;
|
|
4166
4144
|
}
|
|
4167
|
-
const
|
|
4145
|
+
const Fa = 150;
|
|
4168
4146
|
function hn({
|
|
4169
4147
|
content: n = "",
|
|
4170
4148
|
onChange: t,
|
|
@@ -4174,11 +4152,11 @@ function hn({
|
|
|
4174
4152
|
toolbarMode: r,
|
|
4175
4153
|
className: s,
|
|
4176
4154
|
minHeight: o = "200px",
|
|
4177
|
-
maxHeight:
|
|
4178
|
-
autoFocus:
|
|
4155
|
+
maxHeight: b,
|
|
4156
|
+
autoFocus: N = !1,
|
|
4179
4157
|
onImageUpload: u
|
|
4180
4158
|
}) {
|
|
4181
|
-
const [h,
|
|
4159
|
+
const [h, d] = M(!1), [v, f] = M(!1), [B, p] = M(!1), [x, H] = M(!1), [P, z] = M(!1), [ee, j] = M(null), [le, be] = M("frac"), te = I(null), oe = I(null), Ae = La(n), C = Zt({
|
|
4182
4160
|
extensions: [
|
|
4183
4161
|
...oa({ placeholder: c }),
|
|
4184
4162
|
ua,
|
|
@@ -4186,196 +4164,190 @@ function hn({
|
|
|
4186
4164
|
],
|
|
4187
4165
|
content: Ae,
|
|
4188
4166
|
editable: i,
|
|
4189
|
-
autofocus:
|
|
4167
|
+
autofocus: N ? "end" : !1,
|
|
4190
4168
|
immediatelyRender: !1,
|
|
4191
4169
|
shouldRerenderOnTransaction: !1,
|
|
4192
4170
|
// Debounced onChange — avoids getHTML() serialization on every keystroke
|
|
4193
|
-
onUpdate: ({ editor:
|
|
4194
|
-
|
|
4195
|
-
const
|
|
4196
|
-
t
|
|
4197
|
-
},
|
|
4171
|
+
onUpdate: ({ editor: y }) => {
|
|
4172
|
+
oe.current && clearTimeout(oe.current), oe.current = setTimeout(() => {
|
|
4173
|
+
const w = ot(y);
|
|
4174
|
+
t?.(w);
|
|
4175
|
+
}, Fa);
|
|
4198
4176
|
},
|
|
4199
4177
|
editorProps: {
|
|
4200
|
-
handleKeyDown: (
|
|
4201
|
-
if ((
|
|
4202
|
-
return
|
|
4203
|
-
if ((
|
|
4204
|
-
|
|
4178
|
+
handleKeyDown: (y, w) => {
|
|
4179
|
+
if ((w.ctrlKey || w.metaKey) && w.key === "s")
|
|
4180
|
+
return w.preventDefault(), C && l?.(ot(C)), !0;
|
|
4181
|
+
if ((w.ctrlKey || w.metaKey) && w.key === "k") {
|
|
4182
|
+
w.preventDefault();
|
|
4205
4183
|
const D = document.querySelector('[aria-label="Link"]');
|
|
4206
4184
|
return D && D.click(), !0;
|
|
4207
4185
|
}
|
|
4208
|
-
if ((
|
|
4209
|
-
|
|
4186
|
+
if ((w.ctrlKey || w.metaKey) && w.shiftKey && w.key === "T") {
|
|
4187
|
+
w.preventDefault();
|
|
4210
4188
|
const D = document.querySelector('[aria-label="Table"]');
|
|
4211
4189
|
return D && D.click(), !0;
|
|
4212
4190
|
}
|
|
4213
4191
|
return !1;
|
|
4214
4192
|
},
|
|
4215
|
-
handleDrop: (
|
|
4216
|
-
|
|
4217
|
-
const D = ($ = T.dataTransfer) == null ? void 0 : $.files;
|
|
4193
|
+
handleDrop: (y, w) => {
|
|
4194
|
+
const D = w.dataTransfer?.files;
|
|
4218
4195
|
if (D && D.length > 0) {
|
|
4219
|
-
const
|
|
4220
|
-
if (
|
|
4221
|
-
return
|
|
4196
|
+
const $ = D[0];
|
|
4197
|
+
if ($.type.startsWith("image/"))
|
|
4198
|
+
return w.preventDefault(), O($), !0;
|
|
4222
4199
|
}
|
|
4223
4200
|
return !1;
|
|
4224
4201
|
},
|
|
4225
|
-
handlePaste: (
|
|
4226
|
-
|
|
4227
|
-
const D = ($ = T.clipboardData) == null ? void 0 : $.items;
|
|
4202
|
+
handlePaste: (y, w) => {
|
|
4203
|
+
const D = w.clipboardData?.items;
|
|
4228
4204
|
if (D) {
|
|
4229
|
-
for (const
|
|
4230
|
-
if (
|
|
4231
|
-
|
|
4232
|
-
const
|
|
4233
|
-
return
|
|
4205
|
+
for (const $ of D)
|
|
4206
|
+
if ($.type.startsWith("image/")) {
|
|
4207
|
+
w.preventDefault();
|
|
4208
|
+
const ge = $.getAsFile();
|
|
4209
|
+
return ge && O(ge), !0;
|
|
4234
4210
|
}
|
|
4235
4211
|
}
|
|
4236
|
-
return !!(C && Da(C,
|
|
4212
|
+
return !!(C && Da(C, w) || C && za(C, w));
|
|
4237
4213
|
}
|
|
4238
4214
|
}
|
|
4239
|
-
}),
|
|
4240
|
-
(
|
|
4215
|
+
}), q = g(
|
|
4216
|
+
(y = "") => {
|
|
4241
4217
|
C && C.chain().focus().insertContent({
|
|
4242
4218
|
type: "mathInline",
|
|
4243
|
-
attrs: { latex:
|
|
4219
|
+
attrs: { latex: y, display: "inline" }
|
|
4244
4220
|
}).run();
|
|
4245
4221
|
},
|
|
4246
4222
|
[C]
|
|
4247
|
-
),
|
|
4248
|
-
(
|
|
4223
|
+
), me = g(
|
|
4224
|
+
(y = "") => {
|
|
4249
4225
|
C && C.chain().focus().insertContent({
|
|
4250
4226
|
type: "mathBlock",
|
|
4251
|
-
attrs: { latex:
|
|
4227
|
+
attrs: { latex: y, display: "block" }
|
|
4252
4228
|
}).run();
|
|
4253
4229
|
},
|
|
4254
4230
|
[C]
|
|
4255
|
-
), Ne =
|
|
4256
|
-
(
|
|
4257
|
-
|
|
4231
|
+
), Ne = g(
|
|
4232
|
+
(y) => {
|
|
4233
|
+
q(y);
|
|
4258
4234
|
},
|
|
4259
|
-
[
|
|
4260
|
-
),
|
|
4261
|
-
(
|
|
4262
|
-
|
|
4235
|
+
[q]
|
|
4236
|
+
), ae = g(
|
|
4237
|
+
(y) => {
|
|
4238
|
+
q(y);
|
|
4263
4239
|
},
|
|
4264
|
-
[
|
|
4265
|
-
),
|
|
4266
|
-
(
|
|
4267
|
-
|
|
4240
|
+
[q]
|
|
4241
|
+
), ue = g(
|
|
4242
|
+
(y) => {
|
|
4243
|
+
y.includes("\\begin{") || y.includes("\\frac") || y.length > 30 ? me(y) : q(y);
|
|
4268
4244
|
},
|
|
4269
|
-
[
|
|
4270
|
-
), ye =
|
|
4271
|
-
(
|
|
4272
|
-
|
|
4245
|
+
[q, me]
|
|
4246
|
+
), ye = g(
|
|
4247
|
+
(y) => {
|
|
4248
|
+
y.includes("\\begin{") || y.length > 40 ? me(y) : q(y);
|
|
4273
4249
|
},
|
|
4274
|
-
[
|
|
4275
|
-
),
|
|
4276
|
-
async (
|
|
4277
|
-
var $, F;
|
|
4250
|
+
[q, me]
|
|
4251
|
+
), pe = g(
|
|
4252
|
+
async (y, w) => {
|
|
4278
4253
|
if (!C) return;
|
|
4279
4254
|
let D;
|
|
4280
4255
|
try {
|
|
4281
|
-
const
|
|
4282
|
-
D =
|
|
4256
|
+
const $ = await Xe(y);
|
|
4257
|
+
D = ze(te.current?.clientWidth, $.width);
|
|
4283
4258
|
} catch {
|
|
4284
|
-
D =
|
|
4259
|
+
D = ze(te.current?.clientWidth, 720);
|
|
4285
4260
|
}
|
|
4286
|
-
C.chain().focus().insertContent({ type: "image", attrs:
|
|
4261
|
+
C.chain().focus().insertContent({ type: "image", attrs: Be(y, w || "", D) }).run();
|
|
4287
4262
|
},
|
|
4288
4263
|
[C]
|
|
4289
|
-
),
|
|
4290
|
-
async (
|
|
4291
|
-
var T;
|
|
4264
|
+
), O = g(
|
|
4265
|
+
async (y) => {
|
|
4292
4266
|
if (C)
|
|
4293
4267
|
if (u)
|
|
4294
4268
|
try {
|
|
4295
|
-
const
|
|
4296
|
-
C.chain().focus().insertContent({ type: "image", attrs:
|
|
4269
|
+
const w = await u(y), D = await Xe(w), $ = ze(te.current?.clientWidth, D.width);
|
|
4270
|
+
C.chain().focus().insertContent({ type: "image", attrs: Be(w, "", $) }).run();
|
|
4297
4271
|
} catch {
|
|
4298
4272
|
console.error("Image upload failed");
|
|
4299
4273
|
}
|
|
4300
4274
|
else {
|
|
4301
|
-
const
|
|
4302
|
-
|
|
4303
|
-
const
|
|
4304
|
-
Xe(
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
C.chain().focus().insertContent({ type: "image", attrs: Pe($, "", x) }).run();
|
|
4275
|
+
const w = new FileReader();
|
|
4276
|
+
w.onload = () => {
|
|
4277
|
+
const D = w.result;
|
|
4278
|
+
Xe(D).then(($) => {
|
|
4279
|
+
const ge = ze(te.current?.clientWidth, $.width);
|
|
4280
|
+
C.chain().focus().insertContent({ type: "image", attrs: Be(D, "", ge) }).run();
|
|
4308
4281
|
}).catch(() => {
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
C.chain().focus().insertContent({ type: "image", attrs: Pe($, "", F) }).run();
|
|
4282
|
+
const $ = ze(te.current?.clientWidth, 720);
|
|
4283
|
+
C.chain().focus().insertContent({ type: "image", attrs: Be(D, "", $) }).run();
|
|
4312
4284
|
});
|
|
4313
|
-
},
|
|
4285
|
+
}, w.readAsDataURL(y);
|
|
4314
4286
|
}
|
|
4315
4287
|
},
|
|
4316
4288
|
[C, u]
|
|
4317
|
-
),
|
|
4289
|
+
), Te = g(() => {
|
|
4318
4290
|
if (!C) return;
|
|
4319
|
-
const
|
|
4320
|
-
if (!
|
|
4321
|
-
const
|
|
4322
|
-
width:
|
|
4323
|
-
height:
|
|
4324
|
-
align:
|
|
4325
|
-
alt: String(
|
|
4326
|
-
title: String(
|
|
4291
|
+
const y = Pe(C);
|
|
4292
|
+
if (!y) return;
|
|
4293
|
+
const w = {
|
|
4294
|
+
width: y.node.attrs.width || 720,
|
|
4295
|
+
height: y.node.attrs.height || "auto",
|
|
4296
|
+
align: y.node.attrs.align || "center",
|
|
4297
|
+
alt: String(y.node.attrs.alt || ""),
|
|
4298
|
+
title: String(y.node.attrs.title || ""),
|
|
4327
4299
|
maintainAspectRatio: !0
|
|
4328
4300
|
};
|
|
4329
|
-
|
|
4330
|
-
}, [C]),
|
|
4331
|
-
(
|
|
4301
|
+
j(w), z(!0);
|
|
4302
|
+
}, [C]), de = g(
|
|
4303
|
+
(y) => {
|
|
4332
4304
|
if (!C) return;
|
|
4333
|
-
const
|
|
4334
|
-
if (!
|
|
4305
|
+
const w = Pe(C);
|
|
4306
|
+
if (!w) return;
|
|
4335
4307
|
const D = C.state.tr;
|
|
4336
|
-
D.setNodeMarkup(
|
|
4337
|
-
...
|
|
4338
|
-
width:
|
|
4339
|
-
height:
|
|
4340
|
-
align:
|
|
4341
|
-
alt:
|
|
4342
|
-
title:
|
|
4343
|
-
}), C.view.dispatch(D),
|
|
4308
|
+
D.setNodeMarkup(w.pos, void 0, {
|
|
4309
|
+
...w.node.attrs,
|
|
4310
|
+
width: y.width,
|
|
4311
|
+
height: y.height,
|
|
4312
|
+
align: y.align,
|
|
4313
|
+
alt: y.alt,
|
|
4314
|
+
title: y.title
|
|
4315
|
+
}), C.view.dispatch(D), z(!1), j(null);
|
|
4344
4316
|
},
|
|
4345
4317
|
[C]
|
|
4346
|
-
), ve =
|
|
4347
|
-
(
|
|
4318
|
+
), ve = g(
|
|
4319
|
+
(y) => {
|
|
4348
4320
|
if (!C) return;
|
|
4349
|
-
const
|
|
4350
|
-
if (!
|
|
4321
|
+
const w = Pe(C);
|
|
4322
|
+
if (!w) return;
|
|
4351
4323
|
const D = C.state.tr;
|
|
4352
|
-
D.setNodeMarkup(
|
|
4353
|
-
...
|
|
4354
|
-
align:
|
|
4324
|
+
D.setNodeMarkup(w.pos, void 0, {
|
|
4325
|
+
...w.node.attrs,
|
|
4326
|
+
align: y,
|
|
4355
4327
|
offsetX: 0,
|
|
4356
4328
|
offsetY: 0
|
|
4357
4329
|
}), C.view.dispatch(D);
|
|
4358
4330
|
},
|
|
4359
4331
|
[C]
|
|
4360
|
-
),
|
|
4332
|
+
), J = g(() => {
|
|
4361
4333
|
if (!C) return;
|
|
4362
|
-
const
|
|
4363
|
-
if (!
|
|
4364
|
-
const
|
|
4365
|
-
|
|
4366
|
-
...
|
|
4334
|
+
const y = Pe(C);
|
|
4335
|
+
if (!y) return;
|
|
4336
|
+
const w = C.state.tr;
|
|
4337
|
+
w.setNodeMarkup(y.pos, void 0, {
|
|
4338
|
+
...y.node.attrs,
|
|
4367
4339
|
offsetX: 0,
|
|
4368
4340
|
offsetY: 0
|
|
4369
|
-
}), C.view.dispatch(
|
|
4341
|
+
}), C.view.dispatch(w);
|
|
4370
4342
|
}, [C]);
|
|
4371
4343
|
return /* @__PURE__ */ a(
|
|
4372
4344
|
"div",
|
|
4373
4345
|
{
|
|
4374
4346
|
className: `mtx-editor ${s || ""}`,
|
|
4375
|
-
ref:
|
|
4347
|
+
ref: te,
|
|
4376
4348
|
style: {
|
|
4377
4349
|
"--mtx-min-height": o,
|
|
4378
|
-
"--mtx-max-height":
|
|
4350
|
+
"--mtx-max-height": b || "none"
|
|
4379
4351
|
},
|
|
4380
4352
|
children: [
|
|
4381
4353
|
i && /* @__PURE__ */ e(
|
|
@@ -4383,39 +4355,39 @@ function hn({
|
|
|
4383
4355
|
{
|
|
4384
4356
|
editor: C,
|
|
4385
4357
|
toolbarMode: r,
|
|
4386
|
-
onInsertMath: (
|
|
4387
|
-
|
|
4358
|
+
onInsertMath: (y = "frac") => {
|
|
4359
|
+
be(y), p(!0);
|
|
4388
4360
|
},
|
|
4389
|
-
onInsertImage: () =>
|
|
4390
|
-
onEditImage:
|
|
4361
|
+
onInsertImage: () => H(!0),
|
|
4362
|
+
onEditImage: Te,
|
|
4391
4363
|
onSetImageAlign: ve,
|
|
4392
|
-
onResetImagePosition:
|
|
4364
|
+
onResetImagePosition: J
|
|
4393
4365
|
}
|
|
4394
4366
|
),
|
|
4395
4367
|
i && /* @__PURE__ */ a("div", { style: { position: "relative" }, children: [
|
|
4396
4368
|
/* @__PURE__ */ e(
|
|
4397
|
-
|
|
4369
|
+
Ta,
|
|
4398
4370
|
{
|
|
4399
4371
|
onInsertLatex: Ne,
|
|
4400
4372
|
onToggleSymbols: () => {
|
|
4401
|
-
|
|
4373
|
+
d(!h), f(!1);
|
|
4402
4374
|
},
|
|
4403
4375
|
onToggleTemplates: () => {
|
|
4404
|
-
f(!
|
|
4376
|
+
f(!v), d(!1);
|
|
4405
4377
|
}
|
|
4406
4378
|
}
|
|
4407
4379
|
),
|
|
4408
4380
|
h && /* @__PURE__ */ e(
|
|
4409
4381
|
Ma,
|
|
4410
4382
|
{
|
|
4411
|
-
onInsert:
|
|
4412
|
-
onClose: () =>
|
|
4383
|
+
onInsert: ae,
|
|
4384
|
+
onClose: () => d(!1)
|
|
4413
4385
|
}
|
|
4414
4386
|
),
|
|
4415
|
-
|
|
4387
|
+
v && /* @__PURE__ */ e(Q, { fallback: /* @__PURE__ */ e("div", { className: "mtx-lazy-loading", children: "Loading..." }), children: /* @__PURE__ */ e(
|
|
4416
4388
|
Ea,
|
|
4417
4389
|
{
|
|
4418
|
-
onInsert:
|
|
4390
|
+
onInsert: ue,
|
|
4419
4391
|
onClose: () => f(!1)
|
|
4420
4392
|
}
|
|
4421
4393
|
) })
|
|
@@ -4427,60 +4399,60 @@ function hn({
|
|
|
4427
4399
|
className: "mtx-content",
|
|
4428
4400
|
style: {
|
|
4429
4401
|
minHeight: o,
|
|
4430
|
-
maxHeight:
|
|
4431
|
-
overflowY:
|
|
4402
|
+
maxHeight: b || void 0,
|
|
4403
|
+
overflowY: b ? "auto" : void 0
|
|
4432
4404
|
},
|
|
4433
4405
|
children: /* @__PURE__ */ e(Qt, { editor: C })
|
|
4434
4406
|
}
|
|
4435
4407
|
),
|
|
4436
|
-
C && /* @__PURE__ */ e(
|
|
4437
|
-
|
|
4408
|
+
C && /* @__PURE__ */ e(Ba, { editor: C }),
|
|
4409
|
+
B && /* @__PURE__ */ e(Q, { fallback: null, children: /* @__PURE__ */ e(
|
|
4438
4410
|
Ka,
|
|
4439
4411
|
{
|
|
4440
|
-
isOpen:
|
|
4441
|
-
initialTab:
|
|
4412
|
+
isOpen: B,
|
|
4413
|
+
initialTab: le,
|
|
4442
4414
|
onInsert: ye,
|
|
4443
4415
|
onClose: () => p(!1)
|
|
4444
4416
|
}
|
|
4445
4417
|
) }),
|
|
4446
|
-
|
|
4418
|
+
x && /* @__PURE__ */ e(Q, { fallback: null, children: /* @__PURE__ */ e(
|
|
4447
4419
|
$a,
|
|
4448
4420
|
{
|
|
4449
|
-
isOpen:
|
|
4450
|
-
onClose: () =>
|
|
4451
|
-
onInsert:
|
|
4421
|
+
isOpen: x,
|
|
4422
|
+
onClose: () => H(!1),
|
|
4423
|
+
onInsert: pe,
|
|
4452
4424
|
onImageUpload: u
|
|
4453
4425
|
}
|
|
4454
4426
|
) }),
|
|
4455
|
-
|
|
4456
|
-
|
|
4427
|
+
P && ee && /* @__PURE__ */ e(Q, { fallback: null, children: /* @__PURE__ */ e(
|
|
4428
|
+
Ra,
|
|
4457
4429
|
{
|
|
4458
|
-
isOpen:
|
|
4430
|
+
isOpen: P,
|
|
4459
4431
|
onClose: () => {
|
|
4460
|
-
|
|
4432
|
+
z(!1), j(null);
|
|
4461
4433
|
},
|
|
4462
|
-
onApply:
|
|
4463
|
-
initialData:
|
|
4434
|
+
onApply: de,
|
|
4435
|
+
initialData: ee
|
|
4464
4436
|
}
|
|
4465
4437
|
) })
|
|
4466
4438
|
]
|
|
4467
4439
|
}
|
|
4468
4440
|
);
|
|
4469
4441
|
}
|
|
4470
|
-
const
|
|
4471
|
-
return /* @__PURE__ */ e(
|
|
4442
|
+
const Oa = ne(() => import("./LinkDialogImpl-C1YeHJFJ.js").then((n) => ({ default: n.LinkDialogImpl }))), Wa = ce.memo(function(t) {
|
|
4443
|
+
return /* @__PURE__ */ e(Q, { fallback: null, children: /* @__PURE__ */ e(Oa, { ...t }) });
|
|
4472
4444
|
});
|
|
4473
4445
|
Wa.displayName = "LinkDialog";
|
|
4474
|
-
const qa =
|
|
4475
|
-
return /* @__PURE__ */ e(
|
|
4446
|
+
const qa = ne(() => import("./InsertTableDialogImpl-Dpo1pByJ.js").then((n) => ({ default: n.InsertTableDialogImpl }))), Ga = ce.memo(function(t) {
|
|
4447
|
+
return /* @__PURE__ */ e(Q, { fallback: null, children: /* @__PURE__ */ e(qa, { ...t }) });
|
|
4476
4448
|
});
|
|
4477
4449
|
Ga.displayName = "InsertTableDialog";
|
|
4478
|
-
const Xa =
|
|
4479
|
-
return /* @__PURE__ */ e(
|
|
4450
|
+
const Xa = ne(() => import("./CellPropertiesDialogImpl-D2iy6DEr.js").then((n) => ({ default: n.CellPropertiesDialogImpl }))), ja = ce.memo(function(t) {
|
|
4451
|
+
return /* @__PURE__ */ e(Q, { fallback: null, children: /* @__PURE__ */ e(Xa, { ...t }) });
|
|
4480
4452
|
});
|
|
4481
4453
|
ja.displayName = "CellPropertiesDialog";
|
|
4482
|
-
const Ua =
|
|
4483
|
-
return /* @__PURE__ */ e(
|
|
4454
|
+
const Ua = ne(() => import("./TableTemplatesDialogImpl-CMzxe328.js").then((n) => ({ default: n.TableTemplatesDialogImpl }))), Ya = ce.memo(function(t) {
|
|
4455
|
+
return /* @__PURE__ */ e(Q, { fallback: null, children: /* @__PURE__ */ e(Ua, { ...t }) });
|
|
4484
4456
|
});
|
|
4485
4457
|
Ya.displayName = "TableTemplatesDialog";
|
|
4486
4458
|
function un(n) {
|
|
@@ -4545,7 +4517,7 @@ const Ja = [
|
|
|
4545
4517
|
{ id: "ideal-gas", label: "Gas Ideal", latex: "PV = nRT", category: "Kimia", level: "sma" },
|
|
4546
4518
|
{ id: "ph", label: "pH", latex: "pH = -\\log [H^+]", category: "Kimia", level: "sma" },
|
|
4547
4519
|
{ id: "dilution", label: "Pengenceran", latex: "M_1 V_1 = M_2 V_2", category: "Kimia", level: "sma" }
|
|
4548
|
-
],
|
|
4520
|
+
], Ve = [
|
|
4549
4521
|
...Ja,
|
|
4550
4522
|
...Za,
|
|
4551
4523
|
...Qa,
|
|
@@ -4555,33 +4527,33 @@ const Ja = [
|
|
|
4555
4527
|
...nn
|
|
4556
4528
|
];
|
|
4557
4529
|
function pn(n) {
|
|
4558
|
-
if (n === "all") return
|
|
4530
|
+
if (n === "all") return Ve;
|
|
4559
4531
|
const l = {
|
|
4560
4532
|
sd: ["sd"],
|
|
4561
4533
|
smp: ["sd", "smp"],
|
|
4562
4534
|
sma: ["sd", "smp", "sma"]
|
|
4563
4535
|
}[n] || ["sd", "smp", "sma"];
|
|
4564
|
-
return
|
|
4536
|
+
return Ve.filter((i) => l.includes(i.level));
|
|
4565
4537
|
}
|
|
4566
4538
|
function gn(n) {
|
|
4567
|
-
return
|
|
4539
|
+
return Ve.filter((t) => t.category === n);
|
|
4568
4540
|
}
|
|
4569
4541
|
function xn() {
|
|
4570
|
-
return [...new Set(
|
|
4542
|
+
return [...new Set(Ve.map((n) => n.category))];
|
|
4571
4543
|
}
|
|
4572
4544
|
export {
|
|
4573
4545
|
ja as C,
|
|
4574
|
-
|
|
4546
|
+
Ra as I,
|
|
4575
4547
|
Wa as L,
|
|
4576
4548
|
Ca as M,
|
|
4577
4549
|
Ma as S,
|
|
4578
|
-
|
|
4579
|
-
|
|
4550
|
+
ft as T,
|
|
4551
|
+
Ba as W,
|
|
4580
4552
|
Ga as a,
|
|
4581
4553
|
pa as b,
|
|
4582
4554
|
ua as c,
|
|
4583
4555
|
hn as d,
|
|
4584
|
-
|
|
4556
|
+
Ta as e,
|
|
4585
4557
|
Ya as f,
|
|
4586
4558
|
dt as g,
|
|
4587
4559
|
mt as h,
|
|
@@ -4592,8 +4564,8 @@ export {
|
|
|
4592
4564
|
un as m,
|
|
4593
4565
|
gn as n,
|
|
4594
4566
|
pn as o,
|
|
4595
|
-
|
|
4567
|
+
Ve as p,
|
|
4596
4568
|
La as s,
|
|
4597
4569
|
dn as t,
|
|
4598
|
-
|
|
4570
|
+
Va as u
|
|
4599
4571
|
};
|