athif-custom-package 1.0.0 → 1.0.2
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/custom-ck-editor-athif-package.css +1 -1
- package/dist/index.cjs +186 -186
- package/dist/index.js +640 -621
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useCallback as e, useEffect as t,
|
|
2
|
-
import { createPortal as
|
|
3
|
-
import { CKEditor as
|
|
4
|
-
import { Bold as
|
|
1
|
+
import { useCallback as e, useEffect as t, useLayoutEffect as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
2
|
+
import { createPortal as o } from "react-dom";
|
|
3
|
+
import { CKEditor as s } from "@ckeditor/ckeditor5-react";
|
|
4
|
+
import { Bold as c, ButtonView as l, ClassicEditor as u, Essentials as d, Heading as f, Italic as p, Link as m, List as h, Paragraph as g, Plugin as _, Table as ee, TableCellProperties as te, TableProperties as v, TableToolbar as y, Underline as ne, Undo as b, Widget as x, toWidget as S } from "ckeditor5";
|
|
5
5
|
import "ckeditor5/ckeditor5.css";
|
|
6
6
|
import "mathlive";
|
|
7
|
-
import { Fragment as
|
|
7
|
+
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
8
8
|
//#region src/SpecialCharacterModal.jsx
|
|
9
|
-
var
|
|
9
|
+
var E = [
|
|
10
10
|
{
|
|
11
11
|
id: "All",
|
|
12
12
|
name: "All"
|
|
@@ -72,9 +72,9 @@ var C = [
|
|
|
72
72
|
[9632, 9727]
|
|
73
73
|
]
|
|
74
74
|
}
|
|
75
|
-
],
|
|
75
|
+
], re = (() => {
|
|
76
76
|
let e = [];
|
|
77
|
-
return
|
|
77
|
+
return E.slice(1).forEach((t) => {
|
|
78
78
|
t.ranges.forEach((n) => {
|
|
79
79
|
for (let r = n[0]; r <= n[1]; r++) r >= 127 && r <= 159 || e.push({
|
|
80
80
|
code: r.toString(16).toUpperCase().padStart(4, "0"),
|
|
@@ -84,19 +84,19 @@ var C = [
|
|
|
84
84
|
});
|
|
85
85
|
}), e;
|
|
86
86
|
})();
|
|
87
|
-
function
|
|
88
|
-
let [c, l] =
|
|
87
|
+
function ie({ isOpen: e, onClose: n, onInsert: i, position: o, contained: s = !1 }) {
|
|
88
|
+
let [c, l] = a(""), [u, d] = a("All");
|
|
89
89
|
t(() => {
|
|
90
90
|
e && (l(""), d("All"));
|
|
91
91
|
}, [e]);
|
|
92
|
-
let f =
|
|
93
|
-
let e =
|
|
92
|
+
let f = r(() => {
|
|
93
|
+
let e = re;
|
|
94
94
|
if (u !== "All" && (e = e.filter((e) => e.category === u)), c.trim()) {
|
|
95
95
|
let t = c.trim().toUpperCase();
|
|
96
96
|
e = e.filter((e) => e.code.includes(t));
|
|
97
97
|
}
|
|
98
98
|
return e;
|
|
99
|
-
}, [u, c]), p =
|
|
99
|
+
}, [u, c]), p = r(() => {
|
|
100
100
|
if (u !== "All" && !c.trim()) return { [u]: f };
|
|
101
101
|
let e = {};
|
|
102
102
|
return f.forEach((t) => {
|
|
@@ -107,7 +107,7 @@ function ae({ isOpen: e, onClose: r, onInsert: a, position: o, contained: s = !1
|
|
|
107
107
|
u,
|
|
108
108
|
c
|
|
109
109
|
]), m = (e) => {
|
|
110
|
-
e.key === "Escape" &&
|
|
110
|
+
e.key === "Escape" && n();
|
|
111
111
|
};
|
|
112
112
|
if (t(() => (e && window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m)), [e]), !e) return null;
|
|
113
113
|
let h = {
|
|
@@ -122,50 +122,50 @@ function ae({ isOpen: e, onClose: r, onInsert: a, position: o, contained: s = !1
|
|
|
122
122
|
left: `${e}px`
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
return /* @__PURE__ */
|
|
125
|
+
return /* @__PURE__ */ w("div", {
|
|
126
126
|
className: `scm-overlay${s ? " scm-overlay--contained" : ""}`,
|
|
127
127
|
onMouseDown: (e) => {
|
|
128
|
-
e.stopPropagation(),
|
|
128
|
+
e.stopPropagation(), n();
|
|
129
129
|
},
|
|
130
|
-
children: /* @__PURE__ */
|
|
130
|
+
children: /* @__PURE__ */ T("div", {
|
|
131
131
|
className: "scm-modal",
|
|
132
132
|
style: h,
|
|
133
133
|
onMouseDown: (e) => e.stopPropagation(),
|
|
134
|
-
children: [/* @__PURE__ */
|
|
134
|
+
children: [/* @__PURE__ */ T("div", {
|
|
135
135
|
className: "scm-toolbar",
|
|
136
|
-
children: [/* @__PURE__ */
|
|
136
|
+
children: [/* @__PURE__ */ w("input", {
|
|
137
137
|
type: "text",
|
|
138
138
|
placeholder: "Code",
|
|
139
139
|
value: c,
|
|
140
140
|
onChange: (e) => l(e.target.value),
|
|
141
141
|
className: "scm-code-input"
|
|
142
|
-
}), /* @__PURE__ */
|
|
142
|
+
}), /* @__PURE__ */ w("select", {
|
|
143
143
|
value: u,
|
|
144
144
|
onChange: (e) => d(e.target.value),
|
|
145
145
|
className: "scm-category-select",
|
|
146
|
-
children:
|
|
146
|
+
children: E.map((e) => /* @__PURE__ */ w("option", {
|
|
147
147
|
value: e.id,
|
|
148
148
|
children: e.name
|
|
149
149
|
}, e.id))
|
|
150
150
|
})]
|
|
151
|
-
}), /* @__PURE__ */
|
|
151
|
+
}), /* @__PURE__ */ w("div", {
|
|
152
152
|
className: "scm-body",
|
|
153
|
-
children: /* @__PURE__ */
|
|
153
|
+
children: /* @__PURE__ */ T("div", {
|
|
154
154
|
className: "scm-grid-container",
|
|
155
|
-
children: [Object.entries(p).map(([e, t]) => /* @__PURE__ */
|
|
155
|
+
children: [Object.entries(p).map(([e, t]) => /* @__PURE__ */ w("div", {
|
|
156
156
|
className: "scm-category-group",
|
|
157
|
-
children: /* @__PURE__ */
|
|
157
|
+
children: /* @__PURE__ */ w("div", {
|
|
158
158
|
className: "scm-char-grid",
|
|
159
|
-
children: t.map((e) => /* @__PURE__ */
|
|
159
|
+
children: t.map((e) => /* @__PURE__ */ w("button", {
|
|
160
160
|
className: "scm-char-btn",
|
|
161
161
|
onClick: () => {
|
|
162
|
-
|
|
162
|
+
i(e.char), n();
|
|
163
163
|
},
|
|
164
164
|
title: `U+${e.code}`,
|
|
165
165
|
children: e.char
|
|
166
166
|
}, e.code))
|
|
167
167
|
})
|
|
168
|
-
}, e)), f.length === 0 && /* @__PURE__ */
|
|
168
|
+
}, e)), f.length === 0 && /* @__PURE__ */ w("div", {
|
|
169
169
|
className: "scm-no-results",
|
|
170
170
|
children: "No characters found."
|
|
171
171
|
})]
|
|
@@ -175,27 +175,27 @@ function ae({ isOpen: e, onClose: r, onInsert: a, position: o, contained: s = !1
|
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
window.__ckMathWidgets = window.__ckMathWidgets || /* @__PURE__ */ new Map(), window.__ckMathWidgetClickHandler = null;
|
|
178
|
-
function
|
|
178
|
+
function D(e) {
|
|
179
179
|
if (!e) return null;
|
|
180
180
|
let t = typeof e.composedPath == "function" ? e.composedPath() : [e];
|
|
181
181
|
for (let e of t) if (e instanceof HTMLElement && (e.classList?.contains("ck-math-widget") || e.dataset?.mathId || e.classList?.contains("ck-widget") && e.querySelector?.(".ck-math-widget-inner"))) return e;
|
|
182
182
|
return e instanceof Element ? e.closest?.(".ck-math-widget, [data-math-id]") : null;
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function O(e) {
|
|
185
185
|
if (!e) return "";
|
|
186
186
|
let t = e.getAttribute("data-latex");
|
|
187
187
|
if (t) return t;
|
|
188
188
|
let n = e.querySelector("math-field");
|
|
189
189
|
return n ? n.getValue ? n.getValue() : n.value || "" : "";
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function k(e) {
|
|
192
192
|
if (!e) return "ltr";
|
|
193
193
|
let t = e.getAttribute("data-dir");
|
|
194
194
|
if (t === "rtl" || t === "ltr") return t;
|
|
195
195
|
let n = e.querySelector("math-field");
|
|
196
196
|
return (n?.getAttribute("dir") || n?.style?.direction) === "rtl" ? "rtl" : "ltr";
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function A(e, t) {
|
|
199
199
|
if (!e || !t) return !1;
|
|
200
200
|
try {
|
|
201
201
|
return e.model.createPositionBefore(t), !0;
|
|
@@ -203,45 +203,45 @@ function D(e, t) {
|
|
|
203
203
|
return !1;
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function j(e, t) {
|
|
207
207
|
if (!e || !t) return null;
|
|
208
208
|
let n = e.model.document.selection.getSelectedElement();
|
|
209
209
|
if (n?.name === "mathInline") return n;
|
|
210
210
|
let r = t.getAttribute("data-math-id");
|
|
211
211
|
if (r) {
|
|
212
212
|
let t = window.__ckMathWidgets.get(r);
|
|
213
|
-
if (
|
|
213
|
+
if (A(e, t)) return t;
|
|
214
214
|
}
|
|
215
215
|
let i = e.editing.view.domConverter.mapDomToView(t);
|
|
216
216
|
if (i) {
|
|
217
217
|
let t = e.editing.mapper.toModelElement(i);
|
|
218
218
|
if (t?.name === "mathInline") return t;
|
|
219
219
|
}
|
|
220
|
-
let a =
|
|
220
|
+
let a = O(t);
|
|
221
221
|
if (!a) return null;
|
|
222
222
|
let o = e.model.document.getRoot();
|
|
223
223
|
for (let { item: t } of e.model.createRangeIn(o)) if (t.is?.("element", "mathInline") && t.getAttribute("latex") === a) return t;
|
|
224
224
|
return null;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function M(e, t, n, r) {
|
|
227
227
|
if (!e || e._mathWidgetOpening) return;
|
|
228
228
|
e._mathWidgetOpening = !0, queueMicrotask(() => {
|
|
229
229
|
e._mathWidgetOpening = !1;
|
|
230
230
|
});
|
|
231
|
-
let i =
|
|
231
|
+
let i = A(e, t) ? t : j(e, r), a = i?.getAttribute("latex") || n || O(r), o = i?.getAttribute("dir") === "rtl" || k(r) === "rtl" ? "rtl" : "ltr";
|
|
232
232
|
a && (i && e.model.change((e) => {
|
|
233
233
|
e.setSelection(i, "on");
|
|
234
234
|
}), (e.mathWidgetClickHandler || window.__ckMathWidgetClickHandler)?.(i, a, o));
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function N(e, t) {
|
|
237
237
|
if (!t || t._ckMathClickBound) return;
|
|
238
238
|
t._ckMathClickBound = !0;
|
|
239
239
|
let n = (n) => {
|
|
240
|
-
n.button === 0 && (n.preventDefault(), n.stopPropagation(), n.stopImmediatePropagation?.(),
|
|
240
|
+
n.button === 0 && (n.preventDefault(), n.stopPropagation(), n.stopImmediatePropagation?.(), M(e, null, O(t), t));
|
|
241
241
|
};
|
|
242
242
|
t.addEventListener("mousedown", n, !0), t.addEventListener("click", n, !0);
|
|
243
243
|
}
|
|
244
|
-
var
|
|
244
|
+
var P = [
|
|
245
245
|
{
|
|
246
246
|
label: "√(□)",
|
|
247
247
|
items: [
|
|
@@ -1521,7 +1521,7 @@ var j = [
|
|
|
1521
1521
|
]
|
|
1522
1522
|
},
|
|
1523
1523
|
{
|
|
1524
|
-
label: /* @__PURE__ */
|
|
1524
|
+
label: /* @__PURE__ */ w(C, { children: "⎡□ □⎤" }),
|
|
1525
1525
|
isMatrix: !0,
|
|
1526
1526
|
items: [
|
|
1527
1527
|
{
|
|
@@ -1684,10 +1684,10 @@ var j = [
|
|
|
1684
1684
|
icon: "division-layout-template-image",
|
|
1685
1685
|
title: "Division Layout"
|
|
1686
1686
|
},
|
|
1687
|
-
|
|
1687
|
+
F("arithmeticLayoutExtras", "More Arithmetic Layouts")
|
|
1688
1688
|
]
|
|
1689
1689
|
}
|
|
1690
|
-
],
|
|
1690
|
+
], ae = {
|
|
1691
1691
|
operatorExtras: [
|
|
1692
1692
|
{
|
|
1693
1693
|
label: "\\",
|
|
@@ -2093,7 +2093,7 @@ var j = [
|
|
|
2093
2093
|
}
|
|
2094
2094
|
]
|
|
2095
2095
|
};
|
|
2096
|
-
function
|
|
2096
|
+
function F(e, t = "More Symbols") {
|
|
2097
2097
|
return {
|
|
2098
2098
|
label: "|",
|
|
2099
2099
|
action: "RELATION_MORE_PICKER",
|
|
@@ -2103,7 +2103,7 @@ function M(e, t = "More Symbols") {
|
|
|
2103
2103
|
cls: "arrow-picker-tool relation-more-picker-tool"
|
|
2104
2104
|
};
|
|
2105
2105
|
}
|
|
2106
|
-
var
|
|
2106
|
+
var I = [
|
|
2107
2107
|
{
|
|
2108
2108
|
label: "cancel",
|
|
2109
2109
|
insert: "\\cancel{#0}",
|
|
@@ -2150,7 +2150,7 @@ var N = [
|
|
|
2150
2150
|
label: "∘",
|
|
2151
2151
|
insert: "∘"
|
|
2152
2152
|
},
|
|
2153
|
-
|
|
2153
|
+
F("operatorExtras", "More Operators"),
|
|
2154
2154
|
{
|
|
2155
2155
|
type: "sep",
|
|
2156
2156
|
cols: 5
|
|
@@ -2193,7 +2193,7 @@ var N = [
|
|
|
2193
2193
|
insert: "''",
|
|
2194
2194
|
cls: "prime-symbol-tool"
|
|
2195
2195
|
},
|
|
2196
|
-
|
|
2196
|
+
F("primeExtras", "More Prime Symbols"),
|
|
2197
2197
|
{
|
|
2198
2198
|
type: "sep",
|
|
2199
2199
|
cols: 3
|
|
@@ -2218,7 +2218,7 @@ var N = [
|
|
|
2218
2218
|
label: "≅",
|
|
2219
2219
|
insert: "\\cong"
|
|
2220
2220
|
},
|
|
2221
|
-
|
|
2221
|
+
F("notEqualExtras", "More Not Equal Relations"),
|
|
2222
2222
|
{
|
|
2223
2223
|
type: "sep",
|
|
2224
2224
|
cols: 3
|
|
@@ -2249,7 +2249,7 @@ var N = [
|
|
|
2249
2249
|
insert: "\\leqslant",
|
|
2250
2250
|
title: "Less Than or Slanted Equal To"
|
|
2251
2251
|
},
|
|
2252
|
-
|
|
2252
|
+
F("comparisonExtras", "More Comparison Symbols"),
|
|
2253
2253
|
{
|
|
2254
2254
|
type: "sep",
|
|
2255
2255
|
cols: 3
|
|
@@ -2278,7 +2278,7 @@ var N = [
|
|
|
2278
2278
|
label: "⊃",
|
|
2279
2279
|
insert: "\\supset"
|
|
2280
2280
|
},
|
|
2281
|
-
|
|
2281
|
+
F("setExtras", "More Set Symbols"),
|
|
2282
2282
|
{
|
|
2283
2283
|
type: "sep",
|
|
2284
2284
|
cols: 3
|
|
@@ -2307,7 +2307,7 @@ var N = [
|
|
|
2307
2307
|
label: "∄",
|
|
2308
2308
|
insert: "\\nexists"
|
|
2309
2309
|
},
|
|
2310
|
-
|
|
2310
|
+
F("logicExtras", "More Logic Symbols"),
|
|
2311
2311
|
{
|
|
2312
2312
|
type: "sep",
|
|
2313
2313
|
cols: 2
|
|
@@ -2324,7 +2324,7 @@ var N = [
|
|
|
2324
2324
|
label: "⊥",
|
|
2325
2325
|
insert: "\\perp"
|
|
2326
2326
|
},
|
|
2327
|
-
|
|
2327
|
+
F("geometryExtras", "More Geometry Symbols"),
|
|
2328
2328
|
{
|
|
2329
2329
|
type: "sep",
|
|
2330
2330
|
cols: 3
|
|
@@ -2341,7 +2341,7 @@ var N = [
|
|
|
2341
2341
|
label: "○",
|
|
2342
2342
|
insert: "\\bigcirc"
|
|
2343
2343
|
},
|
|
2344
|
-
|
|
2344
|
+
F("shapeExtras", "More Shape Symbols"),
|
|
2345
2345
|
{
|
|
2346
2346
|
type: "sep",
|
|
2347
2347
|
cols: 3
|
|
@@ -2358,8 +2358,8 @@ var N = [
|
|
|
2358
2358
|
label: "⊙",
|
|
2359
2359
|
insert: "\\odot"
|
|
2360
2360
|
},
|
|
2361
|
-
|
|
2362
|
-
],
|
|
2361
|
+
F("circledExtras", "More Circled Operators")
|
|
2362
|
+
], L = [
|
|
2363
2363
|
{
|
|
2364
2364
|
label: "↗",
|
|
2365
2365
|
insert: "\\nearrow",
|
|
@@ -2517,7 +2517,7 @@ var N = [
|
|
|
2517
2517
|
insert: "↵",
|
|
2518
2518
|
title: "Downwards Arrow with Corner Leftwards"
|
|
2519
2519
|
}
|
|
2520
|
-
],
|
|
2520
|
+
], R = [
|
|
2521
2521
|
{
|
|
2522
2522
|
insert: "\\xleftrightarrow{#0}",
|
|
2523
2523
|
title: "Right Left Arrows with Overscript",
|
|
@@ -2623,7 +2623,7 @@ var N = [
|
|
|
2623
2623
|
title: "Short Rightwards Arrow over Leftwards Arrow with Under and Overscript",
|
|
2624
2624
|
icon: "short-right-long-left-over-under"
|
|
2625
2625
|
}
|
|
2626
|
-
],
|
|
2626
|
+
], z = [
|
|
2627
2627
|
{
|
|
2628
2628
|
label: "Α",
|
|
2629
2629
|
insert: "\\mathit{Α}",
|
|
@@ -2744,7 +2744,7 @@ var N = [
|
|
|
2744
2744
|
insert: "\\varOmega",
|
|
2745
2745
|
title: "Italic Omega"
|
|
2746
2746
|
}
|
|
2747
|
-
],
|
|
2747
|
+
], B = [
|
|
2748
2748
|
["𝔸", "A"],
|
|
2749
2749
|
["𝔹", "B"],
|
|
2750
2750
|
["ℂ", "C"],
|
|
@@ -2801,7 +2801,7 @@ var N = [
|
|
|
2801
2801
|
label: e,
|
|
2802
2802
|
insert: `\\mathbb{${t}}`,
|
|
2803
2803
|
title: `Blackboard Bold ${t}`
|
|
2804
|
-
})),
|
|
2804
|
+
})), V = [
|
|
2805
2805
|
[
|
|
2806
2806
|
"𝔄",
|
|
2807
2807
|
"\\mathfrak{A}",
|
|
@@ -3326,7 +3326,7 @@ var N = [
|
|
|
3326
3326
|
label: e,
|
|
3327
3327
|
insert: t,
|
|
3328
3328
|
title: n
|
|
3329
|
-
})),
|
|
3329
|
+
})), H = [
|
|
3330
3330
|
{
|
|
3331
3331
|
label: "ℵ",
|
|
3332
3332
|
insert: "\\aleph",
|
|
@@ -3352,7 +3352,7 @@ var N = [
|
|
|
3352
3352
|
insert: "\\mathscr{F}",
|
|
3353
3353
|
title: "Script F"
|
|
3354
3354
|
}
|
|
3355
|
-
],
|
|
3355
|
+
], oe = [
|
|
3356
3356
|
"٠",
|
|
3357
3357
|
"١",
|
|
3358
3358
|
"٢",
|
|
@@ -3363,7 +3363,7 @@ var N = [
|
|
|
3363
3363
|
"٧",
|
|
3364
3364
|
"٨",
|
|
3365
3365
|
"٩"
|
|
3366
|
-
],
|
|
3366
|
+
], U = [
|
|
3367
3367
|
"۰",
|
|
3368
3368
|
"۱",
|
|
3369
3369
|
"۲",
|
|
@@ -3375,12 +3375,12 @@ var N = [
|
|
|
3375
3375
|
"۸",
|
|
3376
3376
|
"۹"
|
|
3377
3377
|
];
|
|
3378
|
-
function
|
|
3378
|
+
function se(e, t) {
|
|
3379
3379
|
if (!e || t === "western") return e;
|
|
3380
|
-
let n = t === "arabicIndic" ?
|
|
3380
|
+
let n = t === "arabicIndic" ? oe : t === "easternArabicIndic" ? U : null;
|
|
3381
3381
|
return n ? String(e).replace(/\d/g, (e) => n[Number(e)] || e) : e;
|
|
3382
3382
|
}
|
|
3383
|
-
var
|
|
3383
|
+
var W = 31, G = 33, ce = 592, K = 295, le = [
|
|
3384
3384
|
{
|
|
3385
3385
|
row: 1,
|
|
3386
3386
|
items: [[
|
|
@@ -4020,7 +4020,7 @@ var V = 31, H = 33, ue = 592, de = 295, U = [
|
|
|
4020
4020
|
col: n,
|
|
4021
4021
|
tone: r,
|
|
4022
4022
|
title: t
|
|
4023
|
-
}))),
|
|
4023
|
+
}))), ue = [
|
|
4024
4024
|
{
|
|
4025
4025
|
label: "Times",
|
|
4026
4026
|
value: "family:roman",
|
|
@@ -4056,10 +4056,10 @@ var V = 31, H = 33, ue = 592, de = 295, U = [
|
|
|
4056
4056
|
value: "variant:double-struck",
|
|
4057
4057
|
style: { variant: "double-struck" }
|
|
4058
4058
|
}
|
|
4059
|
-
],
|
|
4059
|
+
], de = {
|
|
4060
4060
|
fontFamily: "none",
|
|
4061
4061
|
variant: "main"
|
|
4062
|
-
},
|
|
4062
|
+
}, fe = [
|
|
4063
4063
|
{
|
|
4064
4064
|
label: "8px",
|
|
4065
4065
|
value: "3"
|
|
@@ -4088,7 +4088,7 @@ var V = 31, H = 33, ue = 592, de = 295, U = [
|
|
|
4088
4088
|
label: "24px",
|
|
4089
4089
|
value: "10"
|
|
4090
4090
|
}
|
|
4091
|
-
],
|
|
4091
|
+
], pe = {
|
|
4092
4092
|
up: {
|
|
4093
4093
|
x: 0,
|
|
4094
4094
|
y: -1
|
|
@@ -4106,7 +4106,7 @@ var V = 31, H = 33, ue = 592, de = 295, U = [
|
|
|
4106
4106
|
y: 1
|
|
4107
4107
|
}
|
|
4108
4108
|
};
|
|
4109
|
-
function
|
|
4109
|
+
function me(e = "") {
|
|
4110
4110
|
let t = String(e || ""), n = 0, r = 0, i = /^\\htmlStyle\{([^}]*)\}\{([\s\S]*)\}$/;
|
|
4111
4111
|
for (;;) {
|
|
4112
4112
|
let e = t.match(i);
|
|
@@ -4122,14 +4122,14 @@ function ge(e = "") {
|
|
|
4122
4122
|
offsetY: r
|
|
4123
4123
|
};
|
|
4124
4124
|
}
|
|
4125
|
-
function
|
|
4125
|
+
function he(e, t, n) {
|
|
4126
4126
|
let r = ["display:inline-block", "position:relative"];
|
|
4127
4127
|
return t !== 0 && r.push(`left:${t}px`), n !== 0 && r.push(`top:${n}px`), `\\htmlStyle{${r.join(";")};}{${e}}`;
|
|
4128
4128
|
}
|
|
4129
|
-
var
|
|
4129
|
+
var ge = [
|
|
4130
4130
|
{
|
|
4131
4131
|
id: "roots-main",
|
|
4132
|
-
label: /* @__PURE__ */
|
|
4132
|
+
label: /* @__PURE__ */ w(ye, {}),
|
|
4133
4133
|
items: [
|
|
4134
4134
|
{
|
|
4135
4135
|
label: "□/□",
|
|
@@ -4385,18 +4385,18 @@ var ve = [
|
|
|
4385
4385
|
},
|
|
4386
4386
|
{
|
|
4387
4387
|
id: "relations",
|
|
4388
|
-
...
|
|
4389
|
-
items:
|
|
4390
|
-
label: /* @__PURE__ */
|
|
4388
|
+
...P[1],
|
|
4389
|
+
items: I,
|
|
4390
|
+
label: /* @__PURE__ */ w(Se, {})
|
|
4391
4391
|
},
|
|
4392
4392
|
{
|
|
4393
4393
|
id: "arrows",
|
|
4394
|
-
...
|
|
4395
|
-
label: /* @__PURE__ */
|
|
4394
|
+
...P[4],
|
|
4395
|
+
label: /* @__PURE__ */ w(Ee, {})
|
|
4396
4396
|
},
|
|
4397
4397
|
{
|
|
4398
4398
|
id: "greek",
|
|
4399
|
-
label: /* @__PURE__ */
|
|
4399
|
+
label: /* @__PURE__ */ w(Ce, {}),
|
|
4400
4400
|
items: [
|
|
4401
4401
|
{
|
|
4402
4402
|
category: "Lowercase Greek Letters",
|
|
@@ -4703,17 +4703,17 @@ var ve = [
|
|
|
4703
4703
|
},
|
|
4704
4704
|
{
|
|
4705
4705
|
id: "matrix",
|
|
4706
|
-
...
|
|
4707
|
-
label: /* @__PURE__ */
|
|
4706
|
+
...P[11],
|
|
4707
|
+
label: /* @__PURE__ */ w(be, {})
|
|
4708
4708
|
},
|
|
4709
4709
|
{
|
|
4710
4710
|
id: "power-frac",
|
|
4711
|
-
...
|
|
4712
|
-
label: /* @__PURE__ */
|
|
4711
|
+
...P[2],
|
|
4712
|
+
label: /* @__PURE__ */ w(xe, {})
|
|
4713
4713
|
},
|
|
4714
4714
|
{
|
|
4715
4715
|
id: "brackets",
|
|
4716
|
-
label: /* @__PURE__ */
|
|
4716
|
+
label: /* @__PURE__ */ w(we, {}),
|
|
4717
4717
|
items: [
|
|
4718
4718
|
{
|
|
4719
4719
|
label: "(□)",
|
|
@@ -4745,7 +4745,7 @@ var ve = [
|
|
|
4745
4745
|
insert: "\\left\\{#0\\right\\}",
|
|
4746
4746
|
cls: "green-placeholder-glyph"
|
|
4747
4747
|
},
|
|
4748
|
-
|
|
4748
|
+
F("bracketDelimiterExtras", "More Delimiters"),
|
|
4749
4749
|
{
|
|
4750
4750
|
type: "sep",
|
|
4751
4751
|
cols: 2
|
|
@@ -4902,7 +4902,7 @@ var ve = [
|
|
|
4902
4902
|
title: "Rounded Enclosure",
|
|
4903
4903
|
icon: "paren-frame-template-image"
|
|
4904
4904
|
},
|
|
4905
|
-
|
|
4905
|
+
F("enclosureFrameExtras", "More Enclosures"),
|
|
4906
4906
|
{
|
|
4907
4907
|
type: "sep",
|
|
4908
4908
|
cols: 2
|
|
@@ -4939,12 +4939,12 @@ var ve = [
|
|
|
4939
4939
|
title: "Cross Cancel",
|
|
4940
4940
|
icon: "xcancel-template-image"
|
|
4941
4941
|
},
|
|
4942
|
-
|
|
4942
|
+
F("strikeDecorationExtras", "More Strike Decorations")
|
|
4943
4943
|
]
|
|
4944
4944
|
},
|
|
4945
4945
|
{
|
|
4946
4946
|
id: "sets",
|
|
4947
|
-
label: /* @__PURE__ */
|
|
4947
|
+
label: /* @__PURE__ */ w(q, {
|
|
4948
4948
|
top: "Σ ∪",
|
|
4949
4949
|
compact: !0
|
|
4950
4950
|
}),
|
|
@@ -5077,7 +5077,7 @@ var ve = [
|
|
|
5077
5077
|
},
|
|
5078
5078
|
{
|
|
5079
5079
|
id: "calc",
|
|
5080
|
-
label: /* @__PURE__ */
|
|
5080
|
+
label: /* @__PURE__ */ w(Te, {}),
|
|
5081
5081
|
isTemplate: !0,
|
|
5082
5082
|
items: [
|
|
5083
5083
|
{
|
|
@@ -5221,7 +5221,7 @@ var ve = [
|
|
|
5221
5221
|
insert: "\\oiint",
|
|
5222
5222
|
icon: "double-contour-integral-template-image"
|
|
5223
5223
|
},
|
|
5224
|
-
|
|
5224
|
+
F("tripleIntegralExtras", "More Triple Integrals"),
|
|
5225
5225
|
{
|
|
5226
5226
|
type: "sep",
|
|
5227
5227
|
cols: 2
|
|
@@ -5263,12 +5263,12 @@ var ve = [
|
|
|
5263
5263
|
insert: "\\ln\\left(#0\\right)",
|
|
5264
5264
|
cls: "green-placeholder-glyph"
|
|
5265
5265
|
},
|
|
5266
|
-
|
|
5266
|
+
F("trigFunctionExtras", "More Trig Functions")
|
|
5267
5267
|
]
|
|
5268
5268
|
},
|
|
5269
5269
|
{
|
|
5270
5270
|
id: "move-text",
|
|
5271
|
-
label: /* @__PURE__ */
|
|
5271
|
+
label: /* @__PURE__ */ w(J, {}),
|
|
5272
5272
|
isTemplate: !0,
|
|
5273
5273
|
items: [
|
|
5274
5274
|
{
|
|
@@ -5301,10 +5301,10 @@ var ve = [
|
|
|
5301
5301
|
}
|
|
5302
5302
|
]
|
|
5303
5303
|
}
|
|
5304
|
-
],
|
|
5304
|
+
], _e = [
|
|
5305
5305
|
{
|
|
5306
5306
|
id: "chem-period-1",
|
|
5307
|
-
label: /* @__PURE__ */
|
|
5307
|
+
label: /* @__PURE__ */ w(q, {
|
|
5308
5308
|
top: "H-Ne",
|
|
5309
5309
|
bottom: "elem"
|
|
5310
5310
|
}),
|
|
@@ -5328,7 +5328,7 @@ var ve = [
|
|
|
5328
5328
|
},
|
|
5329
5329
|
{
|
|
5330
5330
|
id: "chem-period-2",
|
|
5331
|
-
label: /* @__PURE__ */
|
|
5331
|
+
label: /* @__PURE__ */ w(q, {
|
|
5332
5332
|
top: "Na-Ca",
|
|
5333
5333
|
bottom: "elem"
|
|
5334
5334
|
}),
|
|
@@ -5352,7 +5352,7 @@ var ve = [
|
|
|
5352
5352
|
},
|
|
5353
5353
|
{
|
|
5354
5354
|
id: "chem-reactions",
|
|
5355
|
-
label: /* @__PURE__ */
|
|
5355
|
+
label: /* @__PURE__ */ w(q, {
|
|
5356
5356
|
top: "Fe-Zn",
|
|
5357
5357
|
bottom: "→ ⇌"
|
|
5358
5358
|
}),
|
|
@@ -5476,7 +5476,7 @@ var ve = [
|
|
|
5476
5476
|
},
|
|
5477
5477
|
{
|
|
5478
5478
|
id: "chem-states",
|
|
5479
|
-
label: /* @__PURE__ */
|
|
5479
|
+
label: /* @__PURE__ */ w(q, {
|
|
5480
5480
|
top: "(aq)",
|
|
5481
5481
|
bottom: "± ₂"
|
|
5482
5482
|
}),
|
|
@@ -5616,7 +5616,7 @@ var ve = [
|
|
|
5616
5616
|
},
|
|
5617
5617
|
{
|
|
5618
5618
|
id: "chem-molecules",
|
|
5619
|
-
label: /* @__PURE__ */
|
|
5619
|
+
label: /* @__PURE__ */ w(q, {
|
|
5620
5620
|
top: "H₂O",
|
|
5621
5621
|
bottom: "ions"
|
|
5622
5622
|
}),
|
|
@@ -5725,34 +5725,34 @@ var ve = [
|
|
|
5725
5725
|
]
|
|
5726
5726
|
}
|
|
5727
5727
|
];
|
|
5728
|
-
function
|
|
5728
|
+
function ve(e = "") {
|
|
5729
5729
|
if (String(e).match(/^\\ce\{([\s\S]*)\}$/)) return e;
|
|
5730
5730
|
let t = e.replace(/\\text\{([^}]*)\}/g, "$1").replace(/\$/g, "").trim();
|
|
5731
5731
|
return t ? `\\ce{${t}}` : "";
|
|
5732
5732
|
}
|
|
5733
|
-
function
|
|
5734
|
-
return /* @__PURE__ */
|
|
5733
|
+
function q({ top: e, bottom: t = "", compact: n = !1 }) {
|
|
5734
|
+
return /* @__PURE__ */ T("span", {
|
|
5735
5735
|
className: `cme-tab-icon${n ? " compact" : ""}`,
|
|
5736
5736
|
"aria-hidden": "true",
|
|
5737
|
-
children: [/* @__PURE__ */
|
|
5737
|
+
children: [/* @__PURE__ */ w("span", {
|
|
5738
5738
|
className: "cme-tab-icon-top",
|
|
5739
5739
|
children: e
|
|
5740
|
-
}), t ? /* @__PURE__ */
|
|
5740
|
+
}), t ? /* @__PURE__ */ w("span", {
|
|
5741
5741
|
className: "cme-tab-icon-bottom",
|
|
5742
5742
|
children: t
|
|
5743
5743
|
}) : null]
|
|
5744
5744
|
});
|
|
5745
5745
|
}
|
|
5746
|
-
function
|
|
5747
|
-
return /* @__PURE__ */
|
|
5746
|
+
function ye() {
|
|
5747
|
+
return /* @__PURE__ */ w("span", {
|
|
5748
5748
|
className: "cme-tab-icon cme-tab-icon--svg",
|
|
5749
5749
|
"aria-hidden": "true",
|
|
5750
|
-
children: /* @__PURE__ */
|
|
5750
|
+
children: /* @__PURE__ */ T("svg", {
|
|
5751
5751
|
className: "cme-tab-svg-icon",
|
|
5752
5752
|
viewBox: "0 0 48 24",
|
|
5753
5753
|
focusable: "false",
|
|
5754
5754
|
children: [
|
|
5755
|
-
/* @__PURE__ */
|
|
5755
|
+
/* @__PURE__ */ w("path", {
|
|
5756
5756
|
d: "M2 13 L5 13 L7 18 L10 4 L20 4",
|
|
5757
5757
|
fill: "none",
|
|
5758
5758
|
stroke: "currentColor",
|
|
@@ -5760,7 +5760,7 @@ function G() {
|
|
|
5760
5760
|
strokeLinecap: "round",
|
|
5761
5761
|
strokeLinejoin: "round"
|
|
5762
5762
|
}),
|
|
5763
|
-
/* @__PURE__ */
|
|
5763
|
+
/* @__PURE__ */ w("rect", {
|
|
5764
5764
|
x: "13",
|
|
5765
5765
|
y: "7",
|
|
5766
5766
|
width: "8",
|
|
@@ -5769,7 +5769,7 @@ function G() {
|
|
|
5769
5769
|
stroke: "currentColor",
|
|
5770
5770
|
strokeWidth: "1.7"
|
|
5771
5771
|
}),
|
|
5772
|
-
/* @__PURE__ */
|
|
5772
|
+
/* @__PURE__ */ w("rect", {
|
|
5773
5773
|
x: "31",
|
|
5774
5774
|
y: "3",
|
|
5775
5775
|
width: "6",
|
|
@@ -5778,7 +5778,7 @@ function G() {
|
|
|
5778
5778
|
stroke: "currentColor",
|
|
5779
5779
|
strokeWidth: "1.7"
|
|
5780
5780
|
}),
|
|
5781
|
-
/* @__PURE__ */
|
|
5781
|
+
/* @__PURE__ */ w("line", {
|
|
5782
5782
|
x1: "29",
|
|
5783
5783
|
y1: "12",
|
|
5784
5784
|
x2: "39",
|
|
@@ -5786,7 +5786,7 @@ function G() {
|
|
|
5786
5786
|
stroke: "currentColor",
|
|
5787
5787
|
strokeWidth: "1.7"
|
|
5788
5788
|
}),
|
|
5789
|
-
/* @__PURE__ */
|
|
5789
|
+
/* @__PURE__ */ w("rect", {
|
|
5790
5790
|
x: "31",
|
|
5791
5791
|
y: "15",
|
|
5792
5792
|
width: "6",
|
|
@@ -5799,28 +5799,28 @@ function G() {
|
|
|
5799
5799
|
})
|
|
5800
5800
|
});
|
|
5801
5801
|
}
|
|
5802
|
-
function
|
|
5803
|
-
return /* @__PURE__ */
|
|
5802
|
+
function be() {
|
|
5803
|
+
return /* @__PURE__ */ w("span", {
|
|
5804
5804
|
className: "cme-tab-icon cme-tab-icon--svg",
|
|
5805
5805
|
"aria-hidden": "true",
|
|
5806
|
-
children: /* @__PURE__ */
|
|
5806
|
+
children: /* @__PURE__ */ T("svg", {
|
|
5807
5807
|
className: "cme-tab-svg-icon",
|
|
5808
5808
|
viewBox: "0 0 210 110",
|
|
5809
5809
|
focusable: "false",
|
|
5810
5810
|
children: [
|
|
5811
|
-
/* @__PURE__ */
|
|
5811
|
+
/* @__PURE__ */ w("path", {
|
|
5812
5812
|
d: "M12 8 H4 V102 H12",
|
|
5813
5813
|
fill: "none",
|
|
5814
5814
|
stroke: "currentColor",
|
|
5815
5815
|
strokeWidth: "7"
|
|
5816
5816
|
}),
|
|
5817
|
-
/* @__PURE__ */
|
|
5817
|
+
/* @__PURE__ */ w("path", {
|
|
5818
5818
|
d: "M96 8 H104 V102 H96",
|
|
5819
5819
|
fill: "none",
|
|
5820
5820
|
stroke: "currentColor",
|
|
5821
5821
|
strokeWidth: "7"
|
|
5822
5822
|
}),
|
|
5823
|
-
/* @__PURE__ */
|
|
5823
|
+
/* @__PURE__ */ w("rect", {
|
|
5824
5824
|
x: "24",
|
|
5825
5825
|
y: "15",
|
|
5826
5826
|
width: "22",
|
|
@@ -5829,7 +5829,7 @@ function xe() {
|
|
|
5829
5829
|
stroke: "currentColor",
|
|
5830
5830
|
strokeWidth: "7.5"
|
|
5831
5831
|
}),
|
|
5832
|
-
/* @__PURE__ */
|
|
5832
|
+
/* @__PURE__ */ w("rect", {
|
|
5833
5833
|
x: "64",
|
|
5834
5834
|
y: "15",
|
|
5835
5835
|
width: "22",
|
|
@@ -5838,7 +5838,7 @@ function xe() {
|
|
|
5838
5838
|
stroke: "currentColor",
|
|
5839
5839
|
strokeWidth: "7.5"
|
|
5840
5840
|
}),
|
|
5841
|
-
/* @__PURE__ */
|
|
5841
|
+
/* @__PURE__ */ w("rect", {
|
|
5842
5842
|
x: "24",
|
|
5843
5843
|
y: "63",
|
|
5844
5844
|
width: "22",
|
|
@@ -5847,7 +5847,7 @@ function xe() {
|
|
|
5847
5847
|
stroke: "currentColor",
|
|
5848
5848
|
strokeWidth: "7.5"
|
|
5849
5849
|
}),
|
|
5850
|
-
/* @__PURE__ */
|
|
5850
|
+
/* @__PURE__ */ w("rect", {
|
|
5851
5851
|
x: "64",
|
|
5852
5852
|
y: "63",
|
|
5853
5853
|
width: "22",
|
|
@@ -5856,13 +5856,13 @@ function xe() {
|
|
|
5856
5856
|
stroke: "currentColor",
|
|
5857
5857
|
strokeWidth: "7.5"
|
|
5858
5858
|
}),
|
|
5859
|
-
/* @__PURE__ */
|
|
5859
|
+
/* @__PURE__ */ w("path", {
|
|
5860
5860
|
d: "M142 8 C132 8 132 18 132 28 C132 38 128 45 124 49 C128 53 132 60 132 70 C132 80 132 90 142 102",
|
|
5861
5861
|
fill: "none",
|
|
5862
5862
|
stroke: "currentColor",
|
|
5863
5863
|
strokeWidth: "7"
|
|
5864
5864
|
}),
|
|
5865
|
-
/* @__PURE__ */
|
|
5865
|
+
/* @__PURE__ */ w("rect", {
|
|
5866
5866
|
x: "154",
|
|
5867
5867
|
y: "15",
|
|
5868
5868
|
width: "22",
|
|
@@ -5871,7 +5871,7 @@ function xe() {
|
|
|
5871
5871
|
stroke: "currentColor",
|
|
5872
5872
|
strokeWidth: "7.5"
|
|
5873
5873
|
}),
|
|
5874
|
-
/* @__PURE__ */
|
|
5874
|
+
/* @__PURE__ */ w("rect", {
|
|
5875
5875
|
x: "154",
|
|
5876
5876
|
y: "63",
|
|
5877
5877
|
width: "22",
|
|
@@ -5884,16 +5884,16 @@ function xe() {
|
|
|
5884
5884
|
})
|
|
5885
5885
|
});
|
|
5886
5886
|
}
|
|
5887
|
-
function
|
|
5888
|
-
return /* @__PURE__ */
|
|
5887
|
+
function xe() {
|
|
5888
|
+
return /* @__PURE__ */ w("span", {
|
|
5889
5889
|
className: "cme-tab-icon cme-tab-icon--svg",
|
|
5890
5890
|
"aria-hidden": "true",
|
|
5891
|
-
children: /* @__PURE__ */
|
|
5891
|
+
children: /* @__PURE__ */ T("svg", {
|
|
5892
5892
|
className: "cme-tab-svg-icon",
|
|
5893
5893
|
viewBox: "0 0 70 50",
|
|
5894
5894
|
focusable: "false",
|
|
5895
5895
|
children: [
|
|
5896
|
-
/* @__PURE__ */
|
|
5896
|
+
/* @__PURE__ */ w("rect", {
|
|
5897
5897
|
x: "4",
|
|
5898
5898
|
y: "20",
|
|
5899
5899
|
width: "20",
|
|
@@ -5902,7 +5902,7 @@ function Se() {
|
|
|
5902
5902
|
stroke: "currentColor",
|
|
5903
5903
|
strokeWidth: "4"
|
|
5904
5904
|
}),
|
|
5905
|
-
/* @__PURE__ */
|
|
5905
|
+
/* @__PURE__ */ w("rect", {
|
|
5906
5906
|
x: "24",
|
|
5907
5907
|
y: "6",
|
|
5908
5908
|
width: "12",
|
|
@@ -5911,7 +5911,7 @@ function Se() {
|
|
|
5911
5911
|
stroke: "currentColor",
|
|
5912
5912
|
strokeWidth: "4"
|
|
5913
5913
|
}),
|
|
5914
|
-
/* @__PURE__ */
|
|
5914
|
+
/* @__PURE__ */ w("rect", {
|
|
5915
5915
|
x: "51",
|
|
5916
5916
|
y: "10",
|
|
5917
5917
|
width: "8",
|
|
@@ -5920,7 +5920,7 @@ function Se() {
|
|
|
5920
5920
|
stroke: "currentColor",
|
|
5921
5921
|
strokeWidth: "4"
|
|
5922
5922
|
}),
|
|
5923
|
-
/* @__PURE__ */
|
|
5923
|
+
/* @__PURE__ */ w("rect", {
|
|
5924
5924
|
x: "48",
|
|
5925
5925
|
y: "30",
|
|
5926
5926
|
width: "14",
|
|
@@ -5933,16 +5933,16 @@ function Se() {
|
|
|
5933
5933
|
})
|
|
5934
5934
|
});
|
|
5935
5935
|
}
|
|
5936
|
-
function
|
|
5937
|
-
return /* @__PURE__ */
|
|
5936
|
+
function Se() {
|
|
5937
|
+
return /* @__PURE__ */ w("span", {
|
|
5938
5938
|
className: "cme-tab-icon cme-tab-icon--svg",
|
|
5939
5939
|
"aria-hidden": "true",
|
|
5940
|
-
children: /* @__PURE__ */
|
|
5940
|
+
children: /* @__PURE__ */ T("svg", {
|
|
5941
5941
|
className: "cme-tab-svg-icon",
|
|
5942
5942
|
viewBox: "0 0 56 28",
|
|
5943
5943
|
focusable: "false",
|
|
5944
5944
|
children: [
|
|
5945
|
-
/* @__PURE__ */
|
|
5945
|
+
/* @__PURE__ */ w("path", {
|
|
5946
5946
|
d: "M18 4 C10 4 6 9 6 14 C6 19 10 24 18 24",
|
|
5947
5947
|
fill: "none",
|
|
5948
5948
|
stroke: "currentColor",
|
|
@@ -5950,7 +5950,7 @@ function Ce() {
|
|
|
5950
5950
|
strokeLinecap: "round",
|
|
5951
5951
|
strokeLinejoin: "round"
|
|
5952
5952
|
}),
|
|
5953
|
-
/* @__PURE__ */
|
|
5953
|
+
/* @__PURE__ */ w("line", {
|
|
5954
5954
|
x1: "8",
|
|
5955
5955
|
y1: "14",
|
|
5956
5956
|
x2: "18",
|
|
@@ -5959,7 +5959,7 @@ function Ce() {
|
|
|
5959
5959
|
strokeWidth: "2.5",
|
|
5960
5960
|
strokeLinecap: "round"
|
|
5961
5961
|
}),
|
|
5962
|
-
/* @__PURE__ */
|
|
5962
|
+
/* @__PURE__ */ w("text", {
|
|
5963
5963
|
x: "26",
|
|
5964
5964
|
y: "24",
|
|
5965
5965
|
fill: "currentColor",
|
|
@@ -5971,15 +5971,15 @@ function Ce() {
|
|
|
5971
5971
|
})
|
|
5972
5972
|
});
|
|
5973
5973
|
}
|
|
5974
|
-
function
|
|
5975
|
-
return /* @__PURE__ */
|
|
5974
|
+
function Ce() {
|
|
5975
|
+
return /* @__PURE__ */ w("span", {
|
|
5976
5976
|
className: "cme-tab-icon cme-tab-icon--svg",
|
|
5977
5977
|
"aria-hidden": "true",
|
|
5978
|
-
children: /* @__PURE__ */
|
|
5978
|
+
children: /* @__PURE__ */ w("svg", {
|
|
5979
5979
|
className: "cme-tab-svg-icon",
|
|
5980
5980
|
viewBox: "0 0 40 24",
|
|
5981
5981
|
focusable: "false",
|
|
5982
|
-
children: /* @__PURE__ */
|
|
5982
|
+
children: /* @__PURE__ */ w("text", {
|
|
5983
5983
|
x: "2",
|
|
5984
5984
|
y: "20",
|
|
5985
5985
|
fill: "currentColor",
|
|
@@ -5990,23 +5990,23 @@ function we() {
|
|
|
5990
5990
|
})
|
|
5991
5991
|
});
|
|
5992
5992
|
}
|
|
5993
|
-
function
|
|
5994
|
-
return /* @__PURE__ */
|
|
5993
|
+
function we() {
|
|
5994
|
+
return /* @__PURE__ */ w("span", {
|
|
5995
5995
|
className: "cme-tab-icon cme-tab-icon--svg",
|
|
5996
5996
|
"aria-hidden": "true",
|
|
5997
|
-
children: /* @__PURE__ */
|
|
5997
|
+
children: /* @__PURE__ */ T("svg", {
|
|
5998
5998
|
className: "cme-tab-svg-icon",
|
|
5999
5999
|
viewBox: "0 0 90 50",
|
|
6000
6000
|
focusable: "false",
|
|
6001
6001
|
children: [
|
|
6002
|
-
/* @__PURE__ */
|
|
6002
|
+
/* @__PURE__ */ w("path", {
|
|
6003
6003
|
d: "M12 8 C4 14,4 36,12 42",
|
|
6004
6004
|
fill: "none",
|
|
6005
6005
|
stroke: "currentColor",
|
|
6006
6006
|
strokeWidth: "4",
|
|
6007
6007
|
strokeLinecap: "round"
|
|
6008
6008
|
}),
|
|
6009
|
-
/* @__PURE__ */
|
|
6009
|
+
/* @__PURE__ */ w("rect", {
|
|
6010
6010
|
x: "20",
|
|
6011
6011
|
y: "10",
|
|
6012
6012
|
width: "18",
|
|
@@ -6015,21 +6015,21 @@ function K() {
|
|
|
6015
6015
|
stroke: "currentColor",
|
|
6016
6016
|
strokeWidth: "4"
|
|
6017
6017
|
}),
|
|
6018
|
-
/* @__PURE__ */
|
|
6018
|
+
/* @__PURE__ */ w("path", {
|
|
6019
6019
|
d: "M46 8 C54 14,54 36,46 42",
|
|
6020
6020
|
fill: "none",
|
|
6021
6021
|
stroke: "currentColor",
|
|
6022
6022
|
strokeWidth: "4",
|
|
6023
6023
|
strokeLinecap: "round"
|
|
6024
6024
|
}),
|
|
6025
|
-
/* @__PURE__ */
|
|
6025
|
+
/* @__PURE__ */ w("path", {
|
|
6026
6026
|
d: "M65 10 Q75 2 85 10",
|
|
6027
6027
|
fill: "none",
|
|
6028
6028
|
stroke: "currentColor",
|
|
6029
6029
|
strokeWidth: "4",
|
|
6030
6030
|
strokeLinecap: "round"
|
|
6031
6031
|
}),
|
|
6032
|
-
/* @__PURE__ */
|
|
6032
|
+
/* @__PURE__ */ w("rect", {
|
|
6033
6033
|
x: "68",
|
|
6034
6034
|
y: "18",
|
|
6035
6035
|
width: "14",
|
|
@@ -6043,15 +6043,15 @@ function K() {
|
|
|
6043
6043
|
});
|
|
6044
6044
|
}
|
|
6045
6045
|
function Te() {
|
|
6046
|
-
return /* @__PURE__ */
|
|
6046
|
+
return /* @__PURE__ */ w("span", {
|
|
6047
6047
|
className: "cme-tab-icon cme-tab-icon--svg",
|
|
6048
6048
|
"aria-hidden": "true",
|
|
6049
|
-
children: /* @__PURE__ */
|
|
6049
|
+
children: /* @__PURE__ */ T("svg", {
|
|
6050
6050
|
className: "cme-tab-svg-icon",
|
|
6051
6051
|
viewBox: "0 0 80 50",
|
|
6052
6052
|
focusable: "false",
|
|
6053
6053
|
children: [
|
|
6054
|
-
/* @__PURE__ */
|
|
6054
|
+
/* @__PURE__ */ w("text", {
|
|
6055
6055
|
x: "2",
|
|
6056
6056
|
y: "40",
|
|
6057
6057
|
fill: "currentColor",
|
|
@@ -6060,7 +6060,7 @@ function Te() {
|
|
|
6060
6060
|
fontWeight: "500",
|
|
6061
6061
|
children: "∫"
|
|
6062
6062
|
}),
|
|
6063
|
-
/* @__PURE__ */
|
|
6063
|
+
/* @__PURE__ */ w("rect", {
|
|
6064
6064
|
x: "30",
|
|
6065
6065
|
y: "1",
|
|
6066
6066
|
width: "10",
|
|
@@ -6069,7 +6069,7 @@ function Te() {
|
|
|
6069
6069
|
stroke: "currentColor",
|
|
6070
6070
|
strokeWidth: "2.5"
|
|
6071
6071
|
}),
|
|
6072
|
-
/* @__PURE__ */
|
|
6072
|
+
/* @__PURE__ */ w("rect", {
|
|
6073
6073
|
x: "24",
|
|
6074
6074
|
y: "40",
|
|
6075
6075
|
width: "10",
|
|
@@ -6078,7 +6078,7 @@ function Te() {
|
|
|
6078
6078
|
stroke: "currentColor",
|
|
6079
6079
|
strokeWidth: "2.5"
|
|
6080
6080
|
}),
|
|
6081
|
-
/* @__PURE__ */
|
|
6081
|
+
/* @__PURE__ */ w("text", {
|
|
6082
6082
|
x: "45",
|
|
6083
6083
|
y: "36",
|
|
6084
6084
|
fill: "currentColor",
|
|
@@ -6091,24 +6091,24 @@ function Te() {
|
|
|
6091
6091
|
})
|
|
6092
6092
|
});
|
|
6093
6093
|
}
|
|
6094
|
-
function
|
|
6095
|
-
return /* @__PURE__ */
|
|
6094
|
+
function J() {
|
|
6095
|
+
return /* @__PURE__ */ w("span", {
|
|
6096
6096
|
className: "cme-tab-icon cme-tab-icon--svg",
|
|
6097
6097
|
"aria-hidden": "true",
|
|
6098
|
-
children: /* @__PURE__ */
|
|
6098
|
+
children: /* @__PURE__ */ T("svg", {
|
|
6099
6099
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6100
6100
|
width: "24",
|
|
6101
6101
|
height: "24",
|
|
6102
6102
|
viewBox: "0 0 24 24",
|
|
6103
6103
|
fill: "none",
|
|
6104
6104
|
children: [
|
|
6105
|
-
/* @__PURE__ */
|
|
6105
|
+
/* @__PURE__ */ w("path", {
|
|
6106
6106
|
d: "M12 3V12",
|
|
6107
6107
|
stroke: "currentColor",
|
|
6108
6108
|
"stroke-width": "2",
|
|
6109
6109
|
"stroke-linecap": "round"
|
|
6110
6110
|
}),
|
|
6111
|
-
/* @__PURE__ */
|
|
6111
|
+
/* @__PURE__ */ w("path", {
|
|
6112
6112
|
d: "M8.5 8.5L12 12L15.5 8.5",
|
|
6113
6113
|
stroke: "currentColor",
|
|
6114
6114
|
"stroke-width": "2",
|
|
@@ -6116,14 +6116,14 @@ function q() {
|
|
|
6116
6116
|
"stroke-linejoin": "round",
|
|
6117
6117
|
fill: "none"
|
|
6118
6118
|
}),
|
|
6119
|
-
/* @__PURE__ */
|
|
6119
|
+
/* @__PURE__ */ w("path", {
|
|
6120
6120
|
d: "M4 15C4 19 7.5 22 12 22C16.5 22 20 19 20 15",
|
|
6121
6121
|
stroke: "currentColor",
|
|
6122
6122
|
"stroke-width": "2",
|
|
6123
6123
|
"stroke-linecap": "round",
|
|
6124
6124
|
fill: "none"
|
|
6125
6125
|
}),
|
|
6126
|
-
/* @__PURE__ */
|
|
6126
|
+
/* @__PURE__ */ w("path", {
|
|
6127
6127
|
d: "M7 15C7 17.5 9 19 12 19C15 19 17 17.5 17 15",
|
|
6128
6128
|
stroke: "currentColor",
|
|
6129
6129
|
"stroke-width": "2",
|
|
@@ -6134,29 +6134,29 @@ function q() {
|
|
|
6134
6134
|
})
|
|
6135
6135
|
});
|
|
6136
6136
|
}
|
|
6137
|
-
function
|
|
6138
|
-
return /* @__PURE__ */
|
|
6137
|
+
function Ee() {
|
|
6138
|
+
return /* @__PURE__ */ w("span", {
|
|
6139
6139
|
className: "cme-tab-icon cme-tab-icon--svg",
|
|
6140
6140
|
"aria-hidden": "true",
|
|
6141
|
-
children: /* @__PURE__ */
|
|
6141
|
+
children: /* @__PURE__ */ w("svg", {
|
|
6142
6142
|
className: "cme-tab-svg-icon",
|
|
6143
6143
|
viewBox: "0 0 64 24",
|
|
6144
6144
|
focusable: "false",
|
|
6145
|
-
children: /* @__PURE__ */
|
|
6145
|
+
children: /* @__PURE__ */ T("g", {
|
|
6146
6146
|
fill: "currentColor",
|
|
6147
6147
|
children: [
|
|
6148
|
-
/* @__PURE__ */
|
|
6149
|
-
/* @__PURE__ */
|
|
6148
|
+
/* @__PURE__ */ w("path", { d: "M4 10h20V5l12 7-12 7v-5H4z" }),
|
|
6149
|
+
/* @__PURE__ */ w("circle", {
|
|
6150
6150
|
cx: "44",
|
|
6151
6151
|
cy: "18",
|
|
6152
6152
|
r: "2.5"
|
|
6153
6153
|
}),
|
|
6154
|
-
/* @__PURE__ */
|
|
6154
|
+
/* @__PURE__ */ w("circle", {
|
|
6155
6155
|
cx: "52",
|
|
6156
6156
|
cy: "12",
|
|
6157
6157
|
r: "2.5"
|
|
6158
6158
|
}),
|
|
6159
|
-
/* @__PURE__ */
|
|
6159
|
+
/* @__PURE__ */ w("circle", {
|
|
6160
6160
|
cx: "60",
|
|
6161
6161
|
cy: "6",
|
|
6162
6162
|
r: "2.5"
|
|
@@ -6166,12 +6166,12 @@ function J() {
|
|
|
6166
6166
|
})
|
|
6167
6167
|
});
|
|
6168
6168
|
}
|
|
6169
|
-
var
|
|
6169
|
+
var De = class extends _ {
|
|
6170
6170
|
static get pluginName() {
|
|
6171
6171
|
return "MathInlinePlugin";
|
|
6172
6172
|
}
|
|
6173
6173
|
static get requires() {
|
|
6174
|
-
return [
|
|
6174
|
+
return [x];
|
|
6175
6175
|
}
|
|
6176
6176
|
init() {
|
|
6177
6177
|
let e = this.editor;
|
|
@@ -6199,24 +6199,24 @@ var Ee = class extends g {
|
|
|
6199
6199
|
style: "display:inline-block;vertical-align:middle;margin:0 2px;cursor:pointer;width:auto;max-width:100%;pointer-events:none;"
|
|
6200
6200
|
}, (t) => {
|
|
6201
6201
|
let n = document.createElement("math-field");
|
|
6202
|
-
n.setAttribute("read-only", ""), n.setAttribute("math-virtual-keyboard-policy", "manual"), n.setAttribute("tabindex", "-1"), n.setAttribute("letter-shape-style", "upright"), n.setAttribute("dir", i), n.style.display = "inline-block", n.style.width = "auto", n.style.maxWidth = "100%", n.style.verticalAlign = "middle", n.style.border = "none", n.style.background = "transparent", n.style.outline = "none", n.style.fontSize = "inherit", n.style.minHeight = "auto", n.style.padding = "0 2px", n.style.margin = "0", n.style.pointerEvents = "none", n.style.direction = i, n.style.textAlign = i === "rtl" ? "right" : "left", n.style.unicodeBidi = i === "rtl" ? "plaintext" : "normal", n.style.color = "#
|
|
6202
|
+
n.setAttribute("read-only", ""), n.setAttribute("math-virtual-keyboard-policy", "manual"), n.setAttribute("tabindex", "-1"), n.setAttribute("letter-shape-style", "upright"), n.setAttribute("dir", i), n.style.display = "inline-block", n.style.width = "auto", n.style.maxWidth = "100%", n.style.verticalAlign = "middle", n.style.border = "none", n.style.background = "transparent", n.style.outline = "none", n.style.fontSize = "inherit", n.style.minHeight = "auto", n.style.padding = "0 2px", n.style.margin = "0", n.style.pointerEvents = "none", n.style.direction = i, n.style.textAlign = i === "rtl" ? "right" : "left", n.style.unicodeBidi = i === "rtl" ? "plaintext" : "normal", n.style.color = "#000000";
|
|
6203
6203
|
let a = () => {
|
|
6204
6204
|
n.setValue ? n.setValue(r, { silenceNotifications: !0 }) : n.value = r;
|
|
6205
6205
|
};
|
|
6206
6206
|
customElements.get("math-field") ? requestAnimationFrame(a) : customElements.whenDefined("math-field").then(() => requestAnimationFrame(a)), t.appendChild(n);
|
|
6207
6207
|
let o = () => {
|
|
6208
6208
|
let n = t.parentElement;
|
|
6209
|
-
n &&
|
|
6209
|
+
n && N(e, n);
|
|
6210
6210
|
};
|
|
6211
6211
|
o(), requestAnimationFrame(o);
|
|
6212
6212
|
});
|
|
6213
|
-
return n.insert(n.createPositionAt(o, 0), s),
|
|
6213
|
+
return n.insert(n.createPositionAt(o, 0), s), S(o, n, { label: "math formula" });
|
|
6214
6214
|
}
|
|
6215
6215
|
});
|
|
6216
6216
|
let t = e.editing.view.document;
|
|
6217
6217
|
this.listenTo(t, "mousedown", (t, n) => {
|
|
6218
|
-
let r =
|
|
6219
|
-
r && n.domEvent.button === 0 && (t.stop(), n.preventDefault(),
|
|
6218
|
+
let r = D(n.domTarget);
|
|
6219
|
+
r && n.domEvent.button === 0 && (t.stop(), n.preventDefault(), M(e, null, O(r), r));
|
|
6220
6220
|
}, { priority: "high" }), e.conversion.for("dataDowncast").elementToElement({
|
|
6221
6221
|
model: "mathInline",
|
|
6222
6222
|
view: (e, { writer: t }) => {
|
|
@@ -6243,7 +6243,7 @@ var Ee = class extends g {
|
|
|
6243
6243
|
}
|
|
6244
6244
|
});
|
|
6245
6245
|
}
|
|
6246
|
-
},
|
|
6246
|
+
}, Y = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\"><path d=\"M4 12h3l3 6l5-12h5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>", Oe = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\"><rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"3\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"/><text x=\"12\" y=\"16\" text-anchor=\"middle\" font-size=\"12\" font-weight=\"bold\" fill=\"currentColor\" font-family=\"system-ui, sans-serif\">C</text><text x=\"6\" y=\"8\" font-size=\"4\" font-weight=\"bold\" fill=\"currentColor\" font-family=\"system-ui, sans-serif\">6</text></svg>", ke = [
|
|
6247
6247
|
{
|
|
6248
6248
|
label: "Black",
|
|
6249
6249
|
value: "#000000"
|
|
@@ -6341,7 +6341,7 @@ var Ee = class extends g {
|
|
|
6341
6341
|
value: "#ffd700"
|
|
6342
6342
|
}
|
|
6343
6343
|
];
|
|
6344
|
-
function
|
|
6344
|
+
function Ae(e) {
|
|
6345
6345
|
let t = String(e || "").trim();
|
|
6346
6346
|
if (!t) return "";
|
|
6347
6347
|
if (t === "none") return "none";
|
|
@@ -6370,7 +6370,7 @@ function Z(e) {
|
|
|
6370
6370
|
</svg>
|
|
6371
6371
|
`);
|
|
6372
6372
|
}
|
|
6373
|
-
var
|
|
6373
|
+
var je = {
|
|
6374
6374
|
"fraction-template-image": X("\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"> \n <rect x=\"6.1\" y=\"1.8\" width=\"6\" height=\"4.8\" rx=\"0\" fill=\"none\" stroke=\"#2c8a43\" stroke-width=\"1.6\"/>\n <line x1=\"3.2\" y1=\"9\" x2=\"14.8\" y2=\"9\" stroke=\"#000000\" stroke-width=\"1.6\" stroke-linecap=\"square\"/>\n <rect x=\"6.1\" y=\"11.4\" width=\"6\" height=\"4.8\" rx=\"0\" fill=\"none\" stroke=\"#2c8a43\" stroke-width=\"1.6\"/>\n </svg>\n "),
|
|
6375
6375
|
"superscript-template-image": X("\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\">\n <rect x=\"3.1\" y=\"7.3\" width=\"6.5\" height=\"7.4\" rx=\"0.6\" fill=\"none\" stroke=\"#2c8a43\" stroke-width=\"1.5\"/>\n <rect x=\"10.3\" y=\"3.2\" width=\"4.6\" height=\"5.6\" rx=\"0.6\" fill=\"none\" stroke=\"#2c8a43\" stroke-width=\"1.5\"/>\n </svg>\n "),
|
|
6376
6376
|
"sqrt-template-image": X("\n<svg width=\"48\" height=\"32\" viewBox=\"-7 0 48 32\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M4 18 L11 25 L18 4 L38 4\"\n fill=\"none\"\n stroke=\"#222\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <rect\n x=\"23\" \n y=\"9\"\n width=\"10\"\n height=\"13\"\n fill=\"none\"\n stroke=\"#43A047\"\n stroke-width=\"2\"\n />\n</svg> \n "),
|
|
@@ -6551,43 +6551,43 @@ var Ae = {
|
|
|
6551
6551
|
"arabic-indic-numerals-template-image": X("\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\">\n <text x=\"4\" y=\"36\" font-family=\"Amiri, Noto Naskh Arabic, serif\" font-size=\"38\" fill=\"#000\">٤٦</text>\n </svg>\n "),
|
|
6552
6552
|
"eastern-arabic-indic-numerals-template-image": X("\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\">\n <text x=\"4\" y=\"36\" font-size=\"36\" font-family=\"sans-serif\" fill=\"#000\">۴۶</text>\n </svg>\n ")
|
|
6553
6553
|
};
|
|
6554
|
-
function
|
|
6555
|
-
if (e.cls?.includes("arrow-picker-tool")) return /* @__PURE__ */
|
|
6554
|
+
function Me(e, t = {}) {
|
|
6555
|
+
if (e.cls?.includes("arrow-picker-tool")) return /* @__PURE__ */ w("span", {
|
|
6556
6556
|
className: "cme-toolbar-chevron-indicator",
|
|
6557
6557
|
"aria-hidden": "true",
|
|
6558
6558
|
children: "⏵"
|
|
6559
6559
|
});
|
|
6560
|
-
if (e.icon &&
|
|
6560
|
+
if (e.icon && je[e.icon]) return /* @__PURE__ */ w("span", {
|
|
6561
6561
|
className: `cme-toolbar-icon-image-wrapper cme-toolbar-icon-image-wrapper--${e.icon}`,
|
|
6562
6562
|
"aria-hidden": "true",
|
|
6563
|
-
children: /* @__PURE__ */
|
|
6563
|
+
children: /* @__PURE__ */ w("img", {
|
|
6564
6564
|
className: `cme-toolbar-icon-image cme-toolbar-icon-image--${e.icon}`,
|
|
6565
|
-
src:
|
|
6565
|
+
src: je[e.icon],
|
|
6566
6566
|
alt: ""
|
|
6567
6567
|
})
|
|
6568
6568
|
});
|
|
6569
|
-
if (e.icon === "stacked-fraction") return /* @__PURE__ */
|
|
6569
|
+
if (e.icon === "stacked-fraction") return /* @__PURE__ */ w("span", {
|
|
6570
6570
|
className: `cme-fraction-icon cme-fraction-stack${e.cls?.includes("black-glyph-template") ? " cme-fraction-stack--black-glyph-template" : ""}`,
|
|
6571
6571
|
"aria-hidden": "true",
|
|
6572
|
-
children: /* @__PURE__ */
|
|
6572
|
+
children: /* @__PURE__ */ T("svg", {
|
|
6573
6573
|
className: "cme-fraction-svg",
|
|
6574
6574
|
viewBox: "0 0 24 24",
|
|
6575
6575
|
focusable: "false",
|
|
6576
6576
|
"aria-hidden": "true",
|
|
6577
6577
|
children: [
|
|
6578
|
-
/* @__PURE__ */
|
|
6578
|
+
/* @__PURE__ */ w("rect", {
|
|
6579
6579
|
x: "7.5",
|
|
6580
6580
|
y: "-0.2",
|
|
6581
6581
|
width: "9",
|
|
6582
6582
|
height: "9"
|
|
6583
6583
|
}),
|
|
6584
|
-
/* @__PURE__ */
|
|
6584
|
+
/* @__PURE__ */ w("line", {
|
|
6585
6585
|
x1: "5.5",
|
|
6586
6586
|
y1: "12",
|
|
6587
6587
|
x2: "18.5",
|
|
6588
6588
|
y2: "12"
|
|
6589
6589
|
}),
|
|
6590
|
-
/* @__PURE__ */
|
|
6590
|
+
/* @__PURE__ */ w("rect", {
|
|
6591
6591
|
x: "7.5",
|
|
6592
6592
|
y: "15.3",
|
|
6593
6593
|
width: "9",
|
|
@@ -6862,71 +6862,71 @@ function je(e, t = {}) {
|
|
|
6862
6862
|
height: 4.9
|
|
6863
6863
|
}
|
|
6864
6864
|
}
|
|
6865
|
-
}[e.icon], a = t === "left" ? /* @__PURE__ */
|
|
6866
|
-
/* @__PURE__ */
|
|
6867
|
-
/* @__PURE__ */
|
|
6868
|
-
/* @__PURE__ */
|
|
6865
|
+
}[e.icon], a = t === "left" ? /* @__PURE__ */ w("path", { d: `M5.1 ${n - 1.55}L2.55 ${n}L5.1 ${n + 1.55}M2.95 ${n}H14.9` }) : t === "both" ? /* @__PURE__ */ w("path", { d: `M5.1 ${n - 1.55}L2.55 ${n}L5.1 ${n + 1.55}M2.95 ${n}H15.05M12.5 ${n - 1.55}L15.05 ${n}L12.5 ${n + 1.55}` }) : t === "harpoon-rl" ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("path", { d: `M3.1 ${n - 1.95}H14.35M12.05 ${n - 3.15}L14.55 ${n - 1.95}L12.05 ${n - .75}` }), /* @__PURE__ */ w("path", { d: `M14.45 ${n + 1.65}H3.2M5.45 ${n + .45}L2.95 ${n + 1.65}L5.45 ${n + 2.85}` })] }) : t === "harpoon-lr" ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("path", { d: `M14.45 ${n - 1.95}H3.2M5.45 ${n - 3.15}L2.95 ${n - 1.95}L5.45 ${n - .75}` }), /* @__PURE__ */ w("path", { d: `M3.1 ${n + 1.65}H14.35M12.05 ${n + .45}L14.55 ${n + 1.65}L12.05 ${n + 2.85}` })] }) : t === "bar-harpoon-rl" ? /* @__PURE__ */ T(C, { children: [
|
|
6866
|
+
/* @__PURE__ */ w("path", { d: `M4.3 ${n - 1.95}H14.1M11.8 ${n - 3.15}L14.3 ${n - 1.95}L11.8 ${n - .75}` }),
|
|
6867
|
+
/* @__PURE__ */ w("path", { d: `M14.2 ${n + 1.65}H4.1M6.35 ${n + .45}L3.85 ${n + 1.65}L6.35 ${n + 2.85}` }),
|
|
6868
|
+
/* @__PURE__ */ w("line", {
|
|
6869
6869
|
x1: "2.95",
|
|
6870
6870
|
y1: n - 1.95,
|
|
6871
6871
|
x2: "4.15",
|
|
6872
6872
|
y2: n - 1.95
|
|
6873
6873
|
}),
|
|
6874
|
-
/* @__PURE__ */
|
|
6874
|
+
/* @__PURE__ */ w("line", {
|
|
6875
6875
|
x1: "14.2",
|
|
6876
6876
|
y1: n + 1.65,
|
|
6877
6877
|
x2: "15.3",
|
|
6878
6878
|
y2: n + 1.65
|
|
6879
6879
|
})
|
|
6880
|
-
] }) : t === "bar-harpoon-lr" ? /* @__PURE__ */
|
|
6881
|
-
/* @__PURE__ */
|
|
6882
|
-
/* @__PURE__ */
|
|
6883
|
-
/* @__PURE__ */
|
|
6880
|
+
] }) : t === "bar-harpoon-lr" ? /* @__PURE__ */ T(C, { children: [
|
|
6881
|
+
/* @__PURE__ */ w("path", { d: `M14.2 ${n - 1.95}H4.1M6.35 ${n - 3.15}L3.85 ${n - 1.95}L6.35 ${n - .75}` }),
|
|
6882
|
+
/* @__PURE__ */ w("path", { d: `M4.3 ${n + 1.65}H14.1M11.8 ${n + .45}L14.3 ${n + 1.65}L11.8 ${n + 2.85}` }),
|
|
6883
|
+
/* @__PURE__ */ w("line", {
|
|
6884
6884
|
x1: "14.2",
|
|
6885
6885
|
y1: n - 1.95,
|
|
6886
6886
|
x2: "15.3",
|
|
6887
6887
|
y2: n - 1.95
|
|
6888
6888
|
}),
|
|
6889
|
-
/* @__PURE__ */
|
|
6889
|
+
/* @__PURE__ */ w("line", {
|
|
6890
6890
|
x1: "2.95",
|
|
6891
6891
|
y1: n + 1.65,
|
|
6892
6892
|
x2: "4.15",
|
|
6893
6893
|
y2: n + 1.65
|
|
6894
6894
|
})
|
|
6895
|
-
] }) : t === "bar-arrow-rl" ? /* @__PURE__ */
|
|
6896
|
-
/* @__PURE__ */
|
|
6897
|
-
/* @__PURE__ */
|
|
6898
|
-
/* @__PURE__ */
|
|
6895
|
+
] }) : t === "bar-arrow-rl" ? /* @__PURE__ */ T(C, { children: [
|
|
6896
|
+
/* @__PURE__ */ w("path", { d: `M4.2 ${n - 1.95}H14.05M11.75 ${n - 3.15}L14.25 ${n - 1.95}L11.75 ${n - .75}` }),
|
|
6897
|
+
/* @__PURE__ */ w("path", { d: `M14.15 ${n + 1.65}H4.25M6.55 ${n + .45}L4.05 ${n + 1.65}L6.55 ${n + 2.85}` }),
|
|
6898
|
+
/* @__PURE__ */ w("line", {
|
|
6899
6899
|
x1: "4.05",
|
|
6900
6900
|
y1: n + 1.65,
|
|
6901
6901
|
x2: "14.15",
|
|
6902
6902
|
y2: n + 1.65
|
|
6903
6903
|
})
|
|
6904
|
-
] }) : t === "bar-arrow-lr" ? /* @__PURE__ */
|
|
6905
|
-
/* @__PURE__ */
|
|
6906
|
-
/* @__PURE__ */
|
|
6907
|
-
/* @__PURE__ */
|
|
6904
|
+
] }) : t === "bar-arrow-lr" ? /* @__PURE__ */ T(C, { children: [
|
|
6905
|
+
/* @__PURE__ */ w("path", { d: `M14.15 ${n - 1.95}H4.25M6.55 ${n - 3.15}L4.05 ${n - 1.95}L6.55 ${n - .75}` }),
|
|
6906
|
+
/* @__PURE__ */ w("path", { d: `M4.2 ${n + 1.65}H14.05M11.75 ${n + .45}L14.25 ${n + 1.65}L11.75 ${n + 2.85}` }),
|
|
6907
|
+
/* @__PURE__ */ w("line", {
|
|
6908
6908
|
x1: "4.05",
|
|
6909
6909
|
y1: n - 1.95,
|
|
6910
6910
|
x2: "14.15",
|
|
6911
6911
|
y2: n - 1.95
|
|
6912
6912
|
})
|
|
6913
|
-
] }) : /* @__PURE__ */
|
|
6914
|
-
return /* @__PURE__ */
|
|
6913
|
+
] }) : /* @__PURE__ */ w("path", { d: `M12.5 ${n - 1.55}L15.05 ${n}L12.5 ${n + 1.55}M2.95 ${n}H14.65` });
|
|
6914
|
+
return /* @__PURE__ */ w("span", {
|
|
6915
6915
|
className: "cme-arrow-label-icon",
|
|
6916
6916
|
"aria-hidden": "true",
|
|
6917
|
-
children: /* @__PURE__ */
|
|
6917
|
+
children: /* @__PURE__ */ T("svg", {
|
|
6918
6918
|
className: "cme-arrow-label-svg",
|
|
6919
6919
|
viewBox: "0 0 18 18",
|
|
6920
6920
|
focusable: "false",
|
|
6921
6921
|
"aria-hidden": "true",
|
|
6922
6922
|
children: [
|
|
6923
|
-
r ? /* @__PURE__ */
|
|
6923
|
+
r ? /* @__PURE__ */ w("rect", {
|
|
6924
6924
|
...r,
|
|
6925
6925
|
rx: "0.45",
|
|
6926
6926
|
className: "cme-arrow-label-placeholder-box"
|
|
6927
6927
|
}) : null,
|
|
6928
6928
|
a,
|
|
6929
|
-
i ? /* @__PURE__ */
|
|
6929
|
+
i ? /* @__PURE__ */ w("rect", {
|
|
6930
6930
|
...i,
|
|
6931
6931
|
rx: "0.45",
|
|
6932
6932
|
className: "cme-arrow-label-placeholder-box"
|
|
@@ -6954,15 +6954,15 @@ function je(e, t = {}) {
|
|
|
6954
6954
|
[5.3, 11.25],
|
|
6955
6955
|
[10.1, 11.25]
|
|
6956
6956
|
], r;
|
|
6957
|
-
return t === "bmatrix" ? r = /* @__PURE__ */
|
|
6957
|
+
return t === "bmatrix" ? r = /* @__PURE__ */ w("path", { d: "M3 1.8H1.95V15.85H3M12.95 1.8H14V15.85H12.95" }) : t === "pmatrix" ? r = /* @__PURE__ */ w("path", { d: "M3.15 1.8C1.85 3.05 1.35 4.75 1.35 8.85C1.35 12.95 1.85 14.65 3.15 15.85M12.85 1.8C14.15 3.05 14.65 4.75 14.65 8.85C14.65 12.95 14.15 14.65 12.85 15.85" }) : t === "vmatrix" && (r = /* @__PURE__ */ w("path", { d: "M2.6 1.9V15.75M13.4 1.9V15.75" })), /* @__PURE__ */ w("span", {
|
|
6958
6958
|
className: "cme-matrix-icon",
|
|
6959
6959
|
"aria-hidden": "true",
|
|
6960
|
-
children: /* @__PURE__ */
|
|
6960
|
+
children: /* @__PURE__ */ T("svg", {
|
|
6961
6961
|
className: "cme-matrix-svg",
|
|
6962
6962
|
viewBox: "0 0 16 18",
|
|
6963
6963
|
focusable: "false",
|
|
6964
6964
|
"aria-hidden": "true",
|
|
6965
|
-
children: [r, n.map(([e, n], r) => /* @__PURE__ */
|
|
6965
|
+
children: [r, n.map(([e, n], r) => /* @__PURE__ */ w("rect", {
|
|
6966
6966
|
x: e,
|
|
6967
6967
|
y: n,
|
|
6968
6968
|
width: "2.35",
|
|
@@ -7025,15 +7025,15 @@ function je(e, t = {}) {
|
|
|
7025
7025
|
}[e.insert];
|
|
7026
7026
|
if (n) {
|
|
7027
7027
|
let e;
|
|
7028
|
-
return n.frame === "brackets" ? e = /* @__PURE__ */
|
|
7028
|
+
return n.frame === "brackets" ? e = /* @__PURE__ */ w("path", { d: "M2.7 1.4H1.75V16.1H2.7M13.3 1.4H14.25V16.1H13.3" }) : n.frame === "parentheses" && (e = /* @__PURE__ */ w("path", { d: "M3 1.4C1.95 2.7 1.55 4.65 1.55 8.75C1.55 12.85 1.95 14.8 3 16.1M13 1.4C14.05 2.7 14.45 4.65 14.45 8.75C14.45 12.85 14.05 14.8 13 16.1" })), /* @__PURE__ */ w("span", {
|
|
7029
7029
|
className: "cme-matrix-template-icon",
|
|
7030
7030
|
"aria-hidden": "true",
|
|
7031
|
-
children: /* @__PURE__ */
|
|
7031
|
+
children: /* @__PURE__ */ T("svg", {
|
|
7032
7032
|
className: "cme-matrix-template-svg",
|
|
7033
7033
|
viewBox: "0 0 16 18",
|
|
7034
7034
|
focusable: "false",
|
|
7035
7035
|
"aria-hidden": "true",
|
|
7036
|
-
children: [e, n.cells.map(([e, t], n) => /* @__PURE__ */
|
|
7036
|
+
children: [e, n.cells.map(([e, t], n) => /* @__PURE__ */ w("rect", {
|
|
7037
7037
|
x: e,
|
|
7038
7038
|
y: t,
|
|
7039
7039
|
width: "2.35",
|
|
@@ -7044,33 +7044,33 @@ function je(e, t = {}) {
|
|
|
7044
7044
|
})
|
|
7045
7045
|
});
|
|
7046
7046
|
}
|
|
7047
|
-
if (e.icon === "superscript-template" || e.icon === "subscript-template") return /* @__PURE__ */
|
|
7047
|
+
if (e.icon === "superscript-template" || e.icon === "subscript-template") return /* @__PURE__ */ w("span", {
|
|
7048
7048
|
className: "cme-script-icon",
|
|
7049
7049
|
"aria-hidden": "true",
|
|
7050
|
-
children: /* @__PURE__ */
|
|
7050
|
+
children: /* @__PURE__ */ w("svg", {
|
|
7051
7051
|
className: "cme-script-svg",
|
|
7052
7052
|
viewBox: "0 0 18 18",
|
|
7053
7053
|
focusable: "false",
|
|
7054
7054
|
"aria-hidden": "true",
|
|
7055
|
-
children: e.icon === "superscript-template" ? /* @__PURE__ */
|
|
7055
|
+
children: e.icon === "superscript-template" ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("rect", {
|
|
7056
7056
|
x: "3",
|
|
7057
7057
|
y: "7",
|
|
7058
7058
|
width: "6",
|
|
7059
7059
|
height: "8",
|
|
7060
7060
|
rx: "0.5"
|
|
7061
|
-
}), /* @__PURE__ */
|
|
7061
|
+
}), /* @__PURE__ */ w("rect", {
|
|
7062
7062
|
x: "10",
|
|
7063
7063
|
y: "3",
|
|
7064
7064
|
width: "5",
|
|
7065
7065
|
height: "7",
|
|
7066
7066
|
rx: "0.5"
|
|
7067
|
-
})] }) : /* @__PURE__ */
|
|
7067
|
+
})] }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("rect", {
|
|
7068
7068
|
x: "3",
|
|
7069
7069
|
y: "3",
|
|
7070
7070
|
width: "6",
|
|
7071
7071
|
height: "8",
|
|
7072
7072
|
rx: "0.5"
|
|
7073
|
-
}), /* @__PURE__ */
|
|
7073
|
+
}), /* @__PURE__ */ w("rect", {
|
|
7074
7074
|
x: "10",
|
|
7075
7075
|
y: "8",
|
|
7076
7076
|
width: "5",
|
|
@@ -7081,10 +7081,10 @@ function je(e, t = {}) {
|
|
|
7081
7081
|
});
|
|
7082
7082
|
if (e.icon === "square-root-template" || e.icon === "nth-root-template") {
|
|
7083
7083
|
let t = e.icon === "nth-root-template";
|
|
7084
|
-
return /* @__PURE__ */
|
|
7084
|
+
return /* @__PURE__ */ w("span", {
|
|
7085
7085
|
className: "cme-root-icon",
|
|
7086
7086
|
"aria-hidden": "true",
|
|
7087
|
-
children: /* @__PURE__ */
|
|
7087
|
+
children: /* @__PURE__ */ T("svg", {
|
|
7088
7088
|
className: "cme-root-svg",
|
|
7089
7089
|
width: "48",
|
|
7090
7090
|
height: "32",
|
|
@@ -7092,15 +7092,15 @@ function je(e, t = {}) {
|
|
|
7092
7092
|
focusable: "false",
|
|
7093
7093
|
"aria-hidden": "true",
|
|
7094
7094
|
children: [
|
|
7095
|
-
t ? /* @__PURE__ */
|
|
7095
|
+
t ? /* @__PURE__ */ w("rect", {
|
|
7096
7096
|
x: "8",
|
|
7097
7097
|
y: "4",
|
|
7098
7098
|
width: "8",
|
|
7099
7099
|
height: "10",
|
|
7100
7100
|
className: "cme-root-svg-box cme-root-svg-box--small"
|
|
7101
7101
|
}) : null,
|
|
7102
|
-
/* @__PURE__ */
|
|
7103
|
-
/* @__PURE__ */
|
|
7102
|
+
/* @__PURE__ */ w("path", { d: t ? "M10 18 L17 25 L24 4 L46 4" : "M4 18 L11 25 L18 4 L42 4" }),
|
|
7103
|
+
/* @__PURE__ */ w("rect", {
|
|
7104
7104
|
x: t ? "30" : "24",
|
|
7105
7105
|
y: "9",
|
|
7106
7106
|
width: "11",
|
|
@@ -7113,20 +7113,20 @@ function je(e, t = {}) {
|
|
|
7113
7113
|
}
|
|
7114
7114
|
if (e.icon === "accent-harpoon-right" || e.icon === "accent-arrow-right" || e.icon === "accent-arrow-both" || e.icon === "accent-bar") {
|
|
7115
7115
|
let t;
|
|
7116
|
-
return t = e.icon === "accent-bar" ? /* @__PURE__ */
|
|
7116
|
+
return t = e.icon === "accent-bar" ? /* @__PURE__ */ w("line", {
|
|
7117
7117
|
x1: "3.5",
|
|
7118
7118
|
y1: "4.5",
|
|
7119
7119
|
x2: "14.5",
|
|
7120
7120
|
y2: "4.5"
|
|
7121
|
-
}) : e.icon === "accent-arrow-both" ? /* @__PURE__ */
|
|
7121
|
+
}) : e.icon === "accent-arrow-both" ? /* @__PURE__ */ w("path", { d: "M3.3 5.5L5 3.9M3.3 5.5L5 7.1M3.5 5.5H14.5M13 3.9L14.7 5.5L13 7.1" }) : e.icon === "accent-harpoon-right" ? /* @__PURE__ */ w("path", { d: "M3.5 5.5H14.5M12 3.9L14.7 5.5M14 5.5V5" }) : /* @__PURE__ */ w("path", { d: "M3.5 5.5H14.2M11.8 3.9L14.7 5.5L11.8 7.1" }), /* @__PURE__ */ w("span", {
|
|
7122
7122
|
className: "cme-accent-icon",
|
|
7123
7123
|
"aria-hidden": "true",
|
|
7124
|
-
children: /* @__PURE__ */
|
|
7124
|
+
children: /* @__PURE__ */ T("svg", {
|
|
7125
7125
|
className: "cme-accent-svg",
|
|
7126
7126
|
viewBox: "0 0 18 18",
|
|
7127
7127
|
focusable: "false",
|
|
7128
7128
|
"aria-hidden": "true",
|
|
7129
|
-
children: [t, /* @__PURE__ */
|
|
7129
|
+
children: [t, /* @__PURE__ */ w("rect", {
|
|
7130
7130
|
x: "6.4",
|
|
7131
7131
|
y: "8.6",
|
|
7132
7132
|
width: "5.2",
|
|
@@ -7145,19 +7145,19 @@ function je(e, t = {}) {
|
|
|
7145
7145
|
let i = /^(?:[+-]|[²³][⁺⁻])$/u.test(String(e.label || ""));
|
|
7146
7146
|
r.includes("chem-element") && n.push("cme-toolbar-glyph--chem-element"), r.includes("chem-arrow") && n.push("cme-toolbar-glyph--chem-arrow"), r.includes("chem-state") && n.push("cme-toolbar-glyph--chem-state"), t && n.push("cme-toolbar-glyph--chem-script"), i && n.push("cme-toolbar-glyph--chem-charge");
|
|
7147
7147
|
} else i && n.push("cme-toolbar-glyph--roots-main"), a && n.push("cme-toolbar-glyph--relations"), !i && !a && n.push("cme-toolbar-glyph--math"), o && n.push("cme-toolbar-glyph--greek");
|
|
7148
|
-
return r.includes("green-template") && n.push("cme-toolbar-glyph--template"), r.includes("soft-tool") && n.push("cme-toolbar-glyph--tool"), r.includes("format-tool") && n.push("cme-toolbar-glyph--format"), l >= 4 && n.push("cme-toolbar-glyph--wide"), l >= 8 && n.push("cme-toolbar-glyph--very-wide"), /* @__PURE__ */
|
|
7148
|
+
return r.includes("green-template") && n.push("cme-toolbar-glyph--template"), r.includes("soft-tool") && n.push("cme-toolbar-glyph--tool"), r.includes("format-tool") && n.push("cme-toolbar-glyph--format"), l >= 4 && n.push("cme-toolbar-glyph--wide"), l >= 8 && n.push("cme-toolbar-glyph--very-wide"), /* @__PURE__ */ w("span", {
|
|
7149
7149
|
className: n.join(" "),
|
|
7150
7150
|
"aria-hidden": "true",
|
|
7151
|
-
children: r.includes("green-placeholder-glyph") || r.includes("black-glyph-template") || r.includes("black-placeholder-glyph") ? Array.from(c).map((e, t) => e === "□" ? /* @__PURE__ */
|
|
7151
|
+
children: r.includes("green-placeholder-glyph") || r.includes("black-glyph-template") || r.includes("black-placeholder-glyph") ? Array.from(c).map((e, t) => e === "□" ? /* @__PURE__ */ w("span", {
|
|
7152
7152
|
className: r.includes("black-placeholder-glyph") ? "cme-toolbar-placeholder-box-black" : "cme-toolbar-placeholder-box-green",
|
|
7153
7153
|
children: e
|
|
7154
|
-
}, `placeholder-${t}`) : /* @__PURE__ */
|
|
7154
|
+
}, `placeholder-${t}`) : /* @__PURE__ */ w("span", { children: e }, `glyph-${t}`)) : e.label
|
|
7155
7155
|
});
|
|
7156
7156
|
}
|
|
7157
7157
|
return e.label;
|
|
7158
7158
|
}
|
|
7159
|
-
function
|
|
7160
|
-
let n = Math.min(Math.max(e.x - 6, 8), window.innerWidth - 348), r = Math.min(e.y + 2, window.innerHeight - 148), i = (e) => e.preview === "rightleft-short-left" ? /* @__PURE__ */
|
|
7159
|
+
function Ne({ position: e, onInsert: t }) {
|
|
7160
|
+
let n = Math.min(Math.max(e.x - 6, 8), window.innerWidth - 348), r = Math.min(e.y + 2, window.innerHeight - 148), i = (e) => e.preview === "rightleft-short-left" ? /* @__PURE__ */ T("svg", {
|
|
7161
7161
|
width: "22",
|
|
7162
7162
|
height: "18",
|
|
7163
7163
|
viewBox: "0 0 50 24",
|
|
@@ -7168,22 +7168,22 @@ function Me({ position: e, onInsert: t }) {
|
|
|
7168
7168
|
strokeLinejoin: "round",
|
|
7169
7169
|
"aria-hidden": "true",
|
|
7170
7170
|
children: [
|
|
7171
|
-
/* @__PURE__ */
|
|
7171
|
+
/* @__PURE__ */ w("line", {
|
|
7172
7172
|
x1: "10",
|
|
7173
7173
|
y1: "8",
|
|
7174
7174
|
x2: "38",
|
|
7175
7175
|
y2: "8"
|
|
7176
7176
|
}),
|
|
7177
|
-
/* @__PURE__ */
|
|
7178
|
-
/* @__PURE__ */
|
|
7177
|
+
/* @__PURE__ */ w("polyline", { points: "30,2 38,8 30,14" }),
|
|
7178
|
+
/* @__PURE__ */ w("line", {
|
|
7179
7179
|
x1: "34",
|
|
7180
7180
|
y1: "16",
|
|
7181
7181
|
x2: "18",
|
|
7182
7182
|
y2: "16"
|
|
7183
7183
|
}),
|
|
7184
|
-
/* @__PURE__ */
|
|
7184
|
+
/* @__PURE__ */ w("polyline", { points: "26,10 18,16 26,22" })
|
|
7185
7185
|
]
|
|
7186
|
-
}) : e.preview === "right-short-over-left-long" ? /* @__PURE__ */
|
|
7186
|
+
}) : e.preview === "right-short-over-left-long" ? /* @__PURE__ */ T("svg", {
|
|
7187
7187
|
width: "22",
|
|
7188
7188
|
height: "18",
|
|
7189
7189
|
viewBox: "0 0 50 24",
|
|
@@ -7194,22 +7194,22 @@ function Me({ position: e, onInsert: t }) {
|
|
|
7194
7194
|
strokeLinejoin: "round",
|
|
7195
7195
|
"aria-hidden": "true",
|
|
7196
7196
|
children: [
|
|
7197
|
-
/* @__PURE__ */
|
|
7197
|
+
/* @__PURE__ */ w("line", {
|
|
7198
7198
|
x1: "14",
|
|
7199
7199
|
y1: "8",
|
|
7200
7200
|
x2: "30",
|
|
7201
7201
|
y2: "8"
|
|
7202
7202
|
}),
|
|
7203
|
-
/* @__PURE__ */
|
|
7204
|
-
/* @__PURE__ */
|
|
7203
|
+
/* @__PURE__ */ w("polyline", { points: "22,2 30,8 22,14" }),
|
|
7204
|
+
/* @__PURE__ */ w("line", {
|
|
7205
7205
|
x1: "40",
|
|
7206
7206
|
y1: "16",
|
|
7207
7207
|
x2: "12",
|
|
7208
7208
|
y2: "16"
|
|
7209
7209
|
}),
|
|
7210
|
-
/* @__PURE__ */
|
|
7210
|
+
/* @__PURE__ */ w("polyline", { points: "20,10 12,16 20,22" })
|
|
7211
7211
|
]
|
|
7212
|
-
}) : /* @__PURE__ */
|
|
7212
|
+
}) : /* @__PURE__ */ w("span", {
|
|
7213
7213
|
"aria-hidden": "true",
|
|
7214
7214
|
style: {
|
|
7215
7215
|
fontSize: "18px",
|
|
@@ -7219,7 +7219,7 @@ function Me({ position: e, onInsert: t }) {
|
|
|
7219
7219
|
},
|
|
7220
7220
|
children: e.label
|
|
7221
7221
|
});
|
|
7222
|
-
return /* @__PURE__ */
|
|
7222
|
+
return /* @__PURE__ */ w("div", {
|
|
7223
7223
|
className: "cme-arrow-picker-popup",
|
|
7224
7224
|
style: {
|
|
7225
7225
|
position: "fixed",
|
|
@@ -7228,9 +7228,9 @@ function Me({ position: e, onInsert: t }) {
|
|
|
7228
7228
|
zIndex: 1e5
|
|
7229
7229
|
},
|
|
7230
7230
|
onMouseDown: (e) => e.stopPropagation(),
|
|
7231
|
-
children: /* @__PURE__ */
|
|
7231
|
+
children: /* @__PURE__ */ w("div", {
|
|
7232
7232
|
className: "cme-arrow-picker-grid",
|
|
7233
|
-
children:
|
|
7233
|
+
children: L.map((e) => /* @__PURE__ */ w("button", {
|
|
7234
7234
|
type: "button",
|
|
7235
7235
|
className: "cme-arrow-picker-btn",
|
|
7236
7236
|
title: e.title,
|
|
@@ -7242,7 +7242,7 @@ function Me({ position: e, onInsert: t }) {
|
|
|
7242
7242
|
})
|
|
7243
7243
|
});
|
|
7244
7244
|
}
|
|
7245
|
-
function
|
|
7245
|
+
function Pe({ position: e, items: t = [], onInsert: n, popupBounds: r = null, picker: i = "" }) {
|
|
7246
7246
|
let a = i === "trigFunctionExtras" || i === "bracketDelimiterExtras" || i === "enclosureFrameExtras" || i === "strikeDecorationExtras" || i === "arithmeticLayoutExtras", o = a ? 2 : Math.max(1, Math.min(t.length, 5)), s = a ? 88 : 30, c = a ? 34 : 30, l = a ? 10 : 8, u = a ? 8 : 6, d = a ? 18 : 20, f = a ? 18 : 16, p = Math.max(1, Math.ceil(t.length / o)), m = o * s + (o - 1) * l + d, h = p * c + (p - 1) * u + f, g = r ? {
|
|
7247
7247
|
left: r.left,
|
|
7248
7248
|
top: r.top,
|
|
@@ -7253,24 +7253,24 @@ function Ne({ position: e, items: t = [], onInsert: n, popupBounds: r = null, pi
|
|
|
7253
7253
|
top: 8,
|
|
7254
7254
|
right: window.innerWidth - 8,
|
|
7255
7255
|
bottom: window.innerHeight - 8
|
|
7256
|
-
}, _ = g.left + 8, ee = Math.max(_, g.right - m - 8), te = g.top + 8, v = Math.max(te, g.bottom - h - 8),
|
|
7257
|
-
return /* @__PURE__ */
|
|
7256
|
+
}, _ = g.left + 8, ee = Math.max(_, g.right - m - 8), te = g.top + 8, v = Math.max(te, g.bottom - h - 8), y = Math.min(Math.max(e.x - 6, _), ee), ne = e.y + 2, b = e.y - h - 6, x = ne <= v ? ne : Math.max(te, Math.min(b, v));
|
|
7257
|
+
return /* @__PURE__ */ w("div", {
|
|
7258
7258
|
className: "cme-arrow-picker-popup cme-relation-more-picker-popup",
|
|
7259
7259
|
style: {
|
|
7260
7260
|
position: "fixed",
|
|
7261
|
-
left: `${
|
|
7262
|
-
top: `${
|
|
7261
|
+
left: `${y}px`,
|
|
7262
|
+
top: `${x}px`,
|
|
7263
7263
|
zIndex: 1e5
|
|
7264
7264
|
},
|
|
7265
7265
|
onMouseDown: (e) => e.stopPropagation(),
|
|
7266
|
-
children: /* @__PURE__ */
|
|
7266
|
+
children: /* @__PURE__ */ w("div", {
|
|
7267
7267
|
className: "cme-arrow-picker-grid",
|
|
7268
7268
|
style: {
|
|
7269
7269
|
gridTemplateColumns: `repeat(${o}, ${s}px)`,
|
|
7270
7270
|
gridAutoRows: `${c}px`,
|
|
7271
7271
|
gap: `${u}px ${l}px`
|
|
7272
7272
|
},
|
|
7273
|
-
children: t.map((e) => /* @__PURE__ */
|
|
7273
|
+
children: t.map((e) => /* @__PURE__ */ w("button", {
|
|
7274
7274
|
type: "button",
|
|
7275
7275
|
className: `cme-arrow-picker-btn${e.cls ? ` ${e.cls}` : ""}`,
|
|
7276
7276
|
title: e.title || e.label,
|
|
@@ -7282,7 +7282,7 @@ function Ne({ position: e, items: t = [], onInsert: n, popupBounds: r = null, pi
|
|
|
7282
7282
|
onMouseDown: (t) => {
|
|
7283
7283
|
t.preventDefault(), n(e.insert);
|
|
7284
7284
|
},
|
|
7285
|
-
children:
|
|
7285
|
+
children: Me(e, {
|
|
7286
7286
|
groupId: "relations",
|
|
7287
7287
|
isMathMode: !0,
|
|
7288
7288
|
isChemMode: !1
|
|
@@ -7291,9 +7291,9 @@ function Ne({ position: e, items: t = [], onInsert: n, popupBounds: r = null, pi
|
|
|
7291
7291
|
})
|
|
7292
7292
|
});
|
|
7293
7293
|
}
|
|
7294
|
-
function
|
|
7295
|
-
let n = Math.ceil(
|
|
7296
|
-
return /* @__PURE__ */
|
|
7294
|
+
function Fe({ position: e, onInsert: t }) {
|
|
7295
|
+
let n = Math.ceil(R.length / 4), r = n * 34 + (n - 1) * 4 + 12, i = Math.min(Math.max(e.x - 8, 8), Math.max(8, window.innerWidth - 220 - 8)), a = Math.min(e.y + 2, Math.max(8, window.innerHeight - r - 8));
|
|
7296
|
+
return /* @__PURE__ */ w("div", {
|
|
7297
7297
|
className: "cme-arrow-label-picker-popup",
|
|
7298
7298
|
style: {
|
|
7299
7299
|
position: "fixed",
|
|
@@ -7302,17 +7302,17 @@ function Pe({ position: e, onInsert: t }) {
|
|
|
7302
7302
|
zIndex: 1e5
|
|
7303
7303
|
},
|
|
7304
7304
|
onMouseDown: (e) => e.stopPropagation(),
|
|
7305
|
-
children: /* @__PURE__ */
|
|
7305
|
+
children: /* @__PURE__ */ w("div", {
|
|
7306
7306
|
className: "cme-arrow-label-picker-grid",
|
|
7307
7307
|
style: { gridTemplateColumns: "repeat(4, 48px)" },
|
|
7308
|
-
children:
|
|
7308
|
+
children: R.map((e) => /* @__PURE__ */ w("button", {
|
|
7309
7309
|
type: "button",
|
|
7310
7310
|
className: "cme-arrow-label-picker-btn",
|
|
7311
7311
|
title: e.title,
|
|
7312
7312
|
onMouseDown: (n) => {
|
|
7313
7313
|
n.preventDefault(), t(e.insert);
|
|
7314
7314
|
},
|
|
7315
|
-
children:
|
|
7315
|
+
children: Me(e, {
|
|
7316
7316
|
groupId: "arrows",
|
|
7317
7317
|
isMathMode: !0,
|
|
7318
7318
|
isChemMode: !1
|
|
@@ -7321,9 +7321,9 @@ function Pe({ position: e, onInsert: t }) {
|
|
|
7321
7321
|
})
|
|
7322
7322
|
});
|
|
7323
7323
|
}
|
|
7324
|
-
function
|
|
7324
|
+
function Ie({ position: e, onInsert: t }) {
|
|
7325
7325
|
let n = Math.min(Math.max(e.x - 8, 8), window.innerWidth - 356), r = Math.min(e.y + 2, window.innerHeight - 148);
|
|
7326
|
-
return /* @__PURE__ */
|
|
7326
|
+
return /* @__PURE__ */ w("div", {
|
|
7327
7327
|
className: "cme-greek-italic-picker-popup",
|
|
7328
7328
|
style: {
|
|
7329
7329
|
position: "fixed",
|
|
@@ -7332,16 +7332,16 @@ function Fe({ position: e, onInsert: t }) {
|
|
|
7332
7332
|
zIndex: 1e5
|
|
7333
7333
|
},
|
|
7334
7334
|
onMouseDown: (e) => e.stopPropagation(),
|
|
7335
|
-
children: /* @__PURE__ */
|
|
7335
|
+
children: /* @__PURE__ */ w("div", {
|
|
7336
7336
|
className: "cme-greek-italic-picker-grid",
|
|
7337
|
-
children:
|
|
7337
|
+
children: z.map((e) => /* @__PURE__ */ w("button", {
|
|
7338
7338
|
type: "button",
|
|
7339
7339
|
className: "cme-greek-italic-picker-btn",
|
|
7340
7340
|
title: e.title,
|
|
7341
7341
|
onMouseDown: (n) => {
|
|
7342
7342
|
n.preventDefault(), t(e.insert);
|
|
7343
7343
|
},
|
|
7344
|
-
children: /* @__PURE__ */
|
|
7344
|
+
children: /* @__PURE__ */ w("span", {
|
|
7345
7345
|
className: "cme-greek-italic-picker-glyph",
|
|
7346
7346
|
"aria-hidden": "true",
|
|
7347
7347
|
children: e.label
|
|
@@ -7350,9 +7350,9 @@ function Fe({ position: e, onInsert: t }) {
|
|
|
7350
7350
|
})
|
|
7351
7351
|
});
|
|
7352
7352
|
}
|
|
7353
|
-
function
|
|
7353
|
+
function Le({ position: e, onInsert: t }) {
|
|
7354
7354
|
let n = Math.min(Math.max(e.x - 8, 8), window.innerWidth - 356), r = Math.min(e.y + 2, window.innerHeight - 308);
|
|
7355
|
-
return /* @__PURE__ */
|
|
7355
|
+
return /* @__PURE__ */ w("div", {
|
|
7356
7356
|
className: "cme-blackboard-bold-picker-popup",
|
|
7357
7357
|
style: {
|
|
7358
7358
|
position: "fixed",
|
|
@@ -7361,16 +7361,16 @@ function Ie({ position: e, onInsert: t }) {
|
|
|
7361
7361
|
zIndex: 1e5
|
|
7362
7362
|
},
|
|
7363
7363
|
onMouseDown: (e) => e.stopPropagation(),
|
|
7364
|
-
children: /* @__PURE__ */
|
|
7364
|
+
children: /* @__PURE__ */ w("div", {
|
|
7365
7365
|
className: "cme-blackboard-bold-picker-grid",
|
|
7366
|
-
children:
|
|
7366
|
+
children: B.map((e) => /* @__PURE__ */ w("button", {
|
|
7367
7367
|
type: "button",
|
|
7368
7368
|
className: "cme-blackboard-bold-picker-btn",
|
|
7369
7369
|
title: e.title,
|
|
7370
7370
|
onMouseDown: (n) => {
|
|
7371
7371
|
n.preventDefault(), t(e.insert);
|
|
7372
7372
|
},
|
|
7373
|
-
children: /* @__PURE__ */
|
|
7373
|
+
children: /* @__PURE__ */ w("span", {
|
|
7374
7374
|
className: "cme-blackboard-bold-picker-glyph",
|
|
7375
7375
|
"aria-hidden": "true",
|
|
7376
7376
|
children: e.label
|
|
@@ -7379,9 +7379,9 @@ function Ie({ position: e, onInsert: t }) {
|
|
|
7379
7379
|
})
|
|
7380
7380
|
});
|
|
7381
7381
|
}
|
|
7382
|
-
function
|
|
7382
|
+
function Re({ position: e, onInsert: t }) {
|
|
7383
7383
|
let n = Math.min(Math.max(e.x - 8, 8), window.innerWidth - 356), r = Math.min(e.y + 2, window.innerHeight - 348);
|
|
7384
|
-
return /* @__PURE__ */
|
|
7384
|
+
return /* @__PURE__ */ w("div", {
|
|
7385
7385
|
className: "cme-fraktur-script-picker-popup",
|
|
7386
7386
|
style: {
|
|
7387
7387
|
position: "fixed",
|
|
@@ -7390,16 +7390,16 @@ function Le({ position: e, onInsert: t }) {
|
|
|
7390
7390
|
zIndex: 1e5
|
|
7391
7391
|
},
|
|
7392
7392
|
onMouseDown: (e) => e.stopPropagation(),
|
|
7393
|
-
children: /* @__PURE__ */
|
|
7393
|
+
children: /* @__PURE__ */ w("div", {
|
|
7394
7394
|
className: "cme-fraktur-script-picker-grid",
|
|
7395
|
-
children:
|
|
7395
|
+
children: V.map((e) => /* @__PURE__ */ w("button", {
|
|
7396
7396
|
type: "button",
|
|
7397
7397
|
className: "cme-fraktur-script-picker-btn",
|
|
7398
7398
|
title: e.title,
|
|
7399
7399
|
onMouseDown: (n) => {
|
|
7400
7400
|
n.preventDefault(), t(e.insert);
|
|
7401
7401
|
},
|
|
7402
|
-
children: /* @__PURE__ */
|
|
7402
|
+
children: /* @__PURE__ */ w("span", {
|
|
7403
7403
|
className: "cme-fraktur-script-picker-glyph",
|
|
7404
7404
|
"aria-hidden": "true",
|
|
7405
7405
|
children: e.label
|
|
@@ -7408,9 +7408,9 @@ function Le({ position: e, onInsert: t }) {
|
|
|
7408
7408
|
})
|
|
7409
7409
|
});
|
|
7410
7410
|
}
|
|
7411
|
-
function
|
|
7411
|
+
function ze({ position: e, onInsert: t }) {
|
|
7412
7412
|
let n = Math.min(Math.max(e.x - 8, 8), window.innerWidth - 248), r = Math.min(e.y + 2, window.innerHeight - 88);
|
|
7413
|
-
return /* @__PURE__ */
|
|
7413
|
+
return /* @__PURE__ */ w("div", {
|
|
7414
7414
|
className: "cme-hebrew-symbol-picker-popup",
|
|
7415
7415
|
style: {
|
|
7416
7416
|
position: "fixed",
|
|
@@ -7419,16 +7419,16 @@ function Re({ position: e, onInsert: t }) {
|
|
|
7419
7419
|
zIndex: 1e5
|
|
7420
7420
|
},
|
|
7421
7421
|
onMouseDown: (e) => e.stopPropagation(),
|
|
7422
|
-
children: /* @__PURE__ */
|
|
7422
|
+
children: /* @__PURE__ */ w("div", {
|
|
7423
7423
|
className: "cme-hebrew-symbol-picker-grid",
|
|
7424
|
-
children:
|
|
7424
|
+
children: H.map((e) => /* @__PURE__ */ w("button", {
|
|
7425
7425
|
type: "button",
|
|
7426
7426
|
className: "cme-hebrew-symbol-picker-btn",
|
|
7427
7427
|
title: e.title,
|
|
7428
7428
|
onMouseDown: (n) => {
|
|
7429
7429
|
n.preventDefault(), t(e.insert);
|
|
7430
7430
|
},
|
|
7431
|
-
children: /* @__PURE__ */
|
|
7431
|
+
children: /* @__PURE__ */ w("span", {
|
|
7432
7432
|
className: "cme-hebrew-symbol-picker-glyph",
|
|
7433
7433
|
"aria-hidden": "true",
|
|
7434
7434
|
children: e.label
|
|
@@ -7437,9 +7437,9 @@ function Re({ position: e, onInsert: t }) {
|
|
|
7437
7437
|
})
|
|
7438
7438
|
});
|
|
7439
7439
|
}
|
|
7440
|
-
function
|
|
7441
|
-
let n = Math.min(Math.max(e.x - 8, 8), window.innerWidth - 612), r = Math.min(e.y + 2, window.innerHeight - 313), i = 2 *
|
|
7442
|
-
return /* @__PURE__ */
|
|
7440
|
+
function Be({ position: e, onInsert: t }) {
|
|
7441
|
+
let n = Math.min(Math.max(e.x - 8, 8), window.innerWidth - 612), r = Math.min(e.y + 2, window.innerHeight - 313), i = 2 * G + Math.floor(W / 2), a = 5 * G + Math.floor(W / 2), o = 7 * G + Math.floor(W / 2), s = 8 * G + Math.floor(W / 2), c = 3 * G;
|
|
7442
|
+
return /* @__PURE__ */ w("div", {
|
|
7443
7443
|
className: "cme-periodic-table-picker-popup",
|
|
7444
7444
|
style: {
|
|
7445
7445
|
position: "fixed",
|
|
@@ -7448,14 +7448,14 @@ function ze({ position: e, onInsert: t }) {
|
|
|
7448
7448
|
zIndex: 1e5
|
|
7449
7449
|
},
|
|
7450
7450
|
onMouseDown: (e) => e.stopPropagation(),
|
|
7451
|
-
children: /* @__PURE__ */
|
|
7451
|
+
children: /* @__PURE__ */ T("div", {
|
|
7452
7452
|
className: "cme-periodic-table-board",
|
|
7453
7453
|
style: {
|
|
7454
|
-
width: `${
|
|
7455
|
-
height: `${
|
|
7454
|
+
width: `${ce}px`,
|
|
7455
|
+
height: `${K}px`
|
|
7456
7456
|
},
|
|
7457
7457
|
children: [
|
|
7458
|
-
/* @__PURE__ */
|
|
7458
|
+
/* @__PURE__ */ w("div", {
|
|
7459
7459
|
className: "cme-periodic-table-connector cme-periodic-table-connector--vertical",
|
|
7460
7460
|
style: {
|
|
7461
7461
|
left: `${i}px`,
|
|
@@ -7463,7 +7463,7 @@ function ze({ position: e, onInsert: t }) {
|
|
|
7463
7463
|
height: `${s - a}px`
|
|
7464
7464
|
}
|
|
7465
7465
|
}),
|
|
7466
|
-
/* @__PURE__ */
|
|
7466
|
+
/* @__PURE__ */ w("div", {
|
|
7467
7467
|
className: "cme-periodic-table-connector cme-periodic-table-connector--horizontal",
|
|
7468
7468
|
style: {
|
|
7469
7469
|
left: `${i}px`,
|
|
@@ -7471,7 +7471,7 @@ function ze({ position: e, onInsert: t }) {
|
|
|
7471
7471
|
width: `${c - i}px`
|
|
7472
7472
|
}
|
|
7473
7473
|
}),
|
|
7474
|
-
/* @__PURE__ */
|
|
7474
|
+
/* @__PURE__ */ w("div", {
|
|
7475
7475
|
className: "cme-periodic-table-connector cme-periodic-table-connector--horizontal",
|
|
7476
7476
|
style: {
|
|
7477
7477
|
left: `${i}px`,
|
|
@@ -7479,15 +7479,15 @@ function ze({ position: e, onInsert: t }) {
|
|
|
7479
7479
|
width: `${c - i}px`
|
|
7480
7480
|
}
|
|
7481
7481
|
}),
|
|
7482
|
-
|
|
7482
|
+
le.map((e) => /* @__PURE__ */ w("button", {
|
|
7483
7483
|
type: "button",
|
|
7484
7484
|
className: `cme-periodic-table-cell cme-periodic-table-cell--${e.tone}`,
|
|
7485
7485
|
title: e.title,
|
|
7486
7486
|
style: {
|
|
7487
|
-
left: `${(e.col - 1) *
|
|
7488
|
-
top: `${(e.row - 1) *
|
|
7489
|
-
width: `${
|
|
7490
|
-
height: `${
|
|
7487
|
+
left: `${(e.col - 1) * G}px`,
|
|
7488
|
+
top: `${(e.row - 1) * G}px`,
|
|
7489
|
+
width: `${W}px`,
|
|
7490
|
+
height: `${W}px`
|
|
7491
7491
|
},
|
|
7492
7492
|
onMouseDown: (n) => {
|
|
7493
7493
|
n.preventDefault(), t(e.insert);
|
|
@@ -7498,9 +7498,9 @@ function ze({ position: e, onInsert: t }) {
|
|
|
7498
7498
|
})
|
|
7499
7499
|
});
|
|
7500
7500
|
}
|
|
7501
|
-
function
|
|
7501
|
+
function Ve({ position: e, options: t, value: n, onSelect: r, width: i = 132 }) {
|
|
7502
7502
|
let a = Math.min(Math.max(e.x, 8), window.innerWidth - i - 8), o = Math.max(8, Math.min(e.y + 4, window.innerHeight - 290));
|
|
7503
|
-
return /* @__PURE__ */
|
|
7503
|
+
return /* @__PURE__ */ w("div", {
|
|
7504
7504
|
className: "cme-style-dropdown-popup",
|
|
7505
7505
|
style: {
|
|
7506
7506
|
position: "fixed",
|
|
@@ -7510,7 +7510,7 @@ function Be({ position: e, options: t, value: n, onSelect: r, width: i = 132 })
|
|
|
7510
7510
|
zIndex: 1e5
|
|
7511
7511
|
},
|
|
7512
7512
|
onMouseDown: (e) => e.stopPropagation(),
|
|
7513
|
-
children: t.map((e) => /* @__PURE__ */
|
|
7513
|
+
children: t.map((e) => /* @__PURE__ */ w("button", {
|
|
7514
7514
|
type: "button",
|
|
7515
7515
|
className: `cme-style-dropdown-option${n === e.value ? " active" : ""}`,
|
|
7516
7516
|
onMouseDown: (t) => {
|
|
@@ -7520,30 +7520,30 @@ function Be({ position: e, options: t, value: n, onSelect: r, width: i = 132 })
|
|
|
7520
7520
|
}, e.value))
|
|
7521
7521
|
});
|
|
7522
7522
|
}
|
|
7523
|
-
function
|
|
7524
|
-
return class extends
|
|
7523
|
+
function He(e) {
|
|
7524
|
+
return class extends _ {
|
|
7525
7525
|
init() {
|
|
7526
7526
|
let t = this.editor;
|
|
7527
7527
|
t.ui.componentFactory.add("mathType", () => {
|
|
7528
|
-
let t = new
|
|
7528
|
+
let t = new l();
|
|
7529
7529
|
return t.set({
|
|
7530
7530
|
label: "Math",
|
|
7531
|
-
icon:
|
|
7531
|
+
icon: Y,
|
|
7532
7532
|
tooltip: "Insert Math Formula"
|
|
7533
7533
|
}), t.on("execute", () => e("math")), t;
|
|
7534
7534
|
}), t.ui.componentFactory.add("chemType", () => {
|
|
7535
|
-
let t = new
|
|
7535
|
+
let t = new l();
|
|
7536
7536
|
return t.set({
|
|
7537
7537
|
label: "Chemistry",
|
|
7538
|
-
icon:
|
|
7538
|
+
icon: Oe,
|
|
7539
7539
|
tooltip: "Insert Chemistry Formula"
|
|
7540
7540
|
}), t.on("execute", () => e("chem")), t;
|
|
7541
7541
|
});
|
|
7542
7542
|
}
|
|
7543
7543
|
};
|
|
7544
7544
|
}
|
|
7545
|
-
function
|
|
7546
|
-
let [l, u] =
|
|
7545
|
+
function Ue({ matrixType: n, x: r, y: i, onSelect: o, onMouseEnter: s, onMouseLeave: c }) {
|
|
7546
|
+
let [l, u] = a({
|
|
7547
7547
|
r: 2,
|
|
7548
7548
|
c: 2
|
|
7549
7549
|
}), d = {
|
|
@@ -7567,22 +7567,22 @@ function He({ matrixType: n, x: r, y: a, onSelect: o, onMouseEnter: s, onMouseLe
|
|
|
7567
7567
|
l.r,
|
|
7568
7568
|
l.c,
|
|
7569
7569
|
o
|
|
7570
|
-
]), /* @__PURE__ */
|
|
7570
|
+
]), /* @__PURE__ */ T("div", {
|
|
7571
7571
|
className: "cme-matrix-hover-popover ck-only",
|
|
7572
7572
|
style: {
|
|
7573
|
-
top: `${
|
|
7573
|
+
top: `${i}px`,
|
|
7574
7574
|
left: `${r}px`
|
|
7575
7575
|
},
|
|
7576
7576
|
onMouseDown: (e) => e.stopPropagation(),
|
|
7577
7577
|
onMouseEnter: s,
|
|
7578
7578
|
onMouseLeave: c,
|
|
7579
7579
|
children: [
|
|
7580
|
-
/* @__PURE__ */
|
|
7580
|
+
/* @__PURE__ */ T("div", {
|
|
7581
7581
|
className: "cme-matrix-hover-title-wrap",
|
|
7582
|
-
children: [/* @__PURE__ */
|
|
7582
|
+
children: [/* @__PURE__ */ w("div", {
|
|
7583
7583
|
className: "cme-matrix-hover-title",
|
|
7584
7584
|
children: d[n] || "Matrix"
|
|
7585
|
-
}), /* @__PURE__ */
|
|
7585
|
+
}), /* @__PURE__ */ T("div", {
|
|
7586
7586
|
className: "cme-matrix-hover-subtitle",
|
|
7587
7587
|
children: [
|
|
7588
7588
|
l.r,
|
|
@@ -7591,11 +7591,11 @@ function He({ matrixType: n, x: r, y: a, onSelect: o, onMouseEnter: s, onMouseLe
|
|
|
7591
7591
|
]
|
|
7592
7592
|
})]
|
|
7593
7593
|
}),
|
|
7594
|
-
/* @__PURE__ */
|
|
7594
|
+
/* @__PURE__ */ w("div", {
|
|
7595
7595
|
className: "cme-matrix-hover-grid",
|
|
7596
|
-
children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */
|
|
7596
|
+
children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ w("div", {
|
|
7597
7597
|
className: "cme-matrix-hover-row",
|
|
7598
|
-
children: Array.from({ length: 6 }).map((e, n) => /* @__PURE__ */
|
|
7598
|
+
children: Array.from({ length: 6 }).map((e, n) => /* @__PURE__ */ w("div", {
|
|
7599
7599
|
className: `cme-matrix-hover-cell${t < l.r && n < l.c ? " selected" : ""}`,
|
|
7600
7600
|
onMouseEnter: () => u({
|
|
7601
7601
|
r: t + 1,
|
|
@@ -7607,16 +7607,16 @@ function He({ matrixType: n, x: r, y: a, onSelect: o, onMouseEnter: s, onMouseLe
|
|
|
7607
7607
|
}, `${t}-${n}`))
|
|
7608
7608
|
}, t))
|
|
7609
7609
|
}),
|
|
7610
|
-
/* @__PURE__ */
|
|
7610
|
+
/* @__PURE__ */ T("div", {
|
|
7611
7611
|
className: "cme-matrix-hover-footer",
|
|
7612
|
-
children: [/* @__PURE__ */
|
|
7612
|
+
children: [/* @__PURE__ */ T("div", {
|
|
7613
7613
|
className: "cme-matrix-counter",
|
|
7614
7614
|
children: [
|
|
7615
|
-
/* @__PURE__ */
|
|
7615
|
+
/* @__PURE__ */ w("span", {
|
|
7616
7616
|
className: "cme-counter-label",
|
|
7617
7617
|
children: "R"
|
|
7618
7618
|
}),
|
|
7619
|
-
/* @__PURE__ */
|
|
7619
|
+
/* @__PURE__ */ w("input", {
|
|
7620
7620
|
type: "number",
|
|
7621
7621
|
min: "1",
|
|
7622
7622
|
max: "20",
|
|
@@ -7625,16 +7625,16 @@ function He({ matrixType: n, x: r, y: a, onSelect: o, onMouseEnter: s, onMouseLe
|
|
|
7625
7625
|
onChange: (e) => f("r", e.target.value),
|
|
7626
7626
|
onMouseDown: (e) => e.stopPropagation()
|
|
7627
7627
|
}),
|
|
7628
|
-
/* @__PURE__ */
|
|
7628
|
+
/* @__PURE__ */ T("div", {
|
|
7629
7629
|
className: "cme-counter-btns",
|
|
7630
|
-
children: [/* @__PURE__ */
|
|
7630
|
+
children: [/* @__PURE__ */ w("button", {
|
|
7631
7631
|
type: "button",
|
|
7632
7632
|
onClick: () => u((e) => ({
|
|
7633
7633
|
...e,
|
|
7634
7634
|
r: Math.min(20, e.r + 1)
|
|
7635
7635
|
})),
|
|
7636
7636
|
children: "+"
|
|
7637
|
-
}), /* @__PURE__ */
|
|
7637
|
+
}), /* @__PURE__ */ w("button", {
|
|
7638
7638
|
type: "button",
|
|
7639
7639
|
onClick: () => u((e) => ({
|
|
7640
7640
|
...e,
|
|
@@ -7644,14 +7644,14 @@ function He({ matrixType: n, x: r, y: a, onSelect: o, onMouseEnter: s, onMouseLe
|
|
|
7644
7644
|
})]
|
|
7645
7645
|
})
|
|
7646
7646
|
]
|
|
7647
|
-
}), /* @__PURE__ */
|
|
7647
|
+
}), /* @__PURE__ */ T("div", {
|
|
7648
7648
|
className: "cme-matrix-counter",
|
|
7649
7649
|
children: [
|
|
7650
|
-
/* @__PURE__ */
|
|
7650
|
+
/* @__PURE__ */ w("span", {
|
|
7651
7651
|
className: "cme-counter-label",
|
|
7652
7652
|
children: "C"
|
|
7653
7653
|
}),
|
|
7654
|
-
/* @__PURE__ */
|
|
7654
|
+
/* @__PURE__ */ w("input", {
|
|
7655
7655
|
type: "number",
|
|
7656
7656
|
min: "1",
|
|
7657
7657
|
max: "20",
|
|
@@ -7660,16 +7660,16 @@ function He({ matrixType: n, x: r, y: a, onSelect: o, onMouseEnter: s, onMouseLe
|
|
|
7660
7660
|
onChange: (e) => f("c", e.target.value),
|
|
7661
7661
|
onMouseDown: (e) => e.stopPropagation()
|
|
7662
7662
|
}),
|
|
7663
|
-
/* @__PURE__ */
|
|
7663
|
+
/* @__PURE__ */ T("div", {
|
|
7664
7664
|
className: "cme-counter-btns",
|
|
7665
|
-
children: [/* @__PURE__ */
|
|
7665
|
+
children: [/* @__PURE__ */ w("button", {
|
|
7666
7666
|
type: "button",
|
|
7667
7667
|
onClick: () => u((e) => ({
|
|
7668
7668
|
...e,
|
|
7669
7669
|
c: Math.min(20, e.c + 1)
|
|
7670
7670
|
})),
|
|
7671
7671
|
children: "+"
|
|
7672
|
-
}), /* @__PURE__ */
|
|
7672
|
+
}), /* @__PURE__ */ w("button", {
|
|
7673
7673
|
type: "button",
|
|
7674
7674
|
onClick: () => u((e) => ({
|
|
7675
7675
|
...e,
|
|
@@ -7684,69 +7684,69 @@ function He({ matrixType: n, x: r, y: a, onSelect: o, onMouseEnter: s, onMouseLe
|
|
|
7684
7684
|
]
|
|
7685
7685
|
});
|
|
7686
7686
|
}
|
|
7687
|
-
function
|
|
7688
|
-
let f =
|
|
7687
|
+
function We({ mode: n, onInsert: s, onClose: c, initialLatex: l, initialDirection: u = "ltr", isEditing: d }) {
|
|
7688
|
+
let f = i(null), p = i(null), m = i(null), h = i(null), g = i(() => {}), _ = i(null), [ee, te] = a(0), [v, y] = a(null), [ne, b] = a(null), [x, S] = a(null), [C, E] = a(null), [re, D] = a(null), [O, k] = a(null), [A, j] = a(null), [M, N] = a(null), [P, F] = a(null), [I, L] = a(null), [R, z] = a(null), [B, V] = a(null), [H, oe] = a("normal"), [U, W] = a(null), [G, ce] = a(!1), [K, le] = a(u === "rtl"), [q, ye] = a(""), [be, xe] = a(""), Se = n === "math" ? ge : _e, Ce = n === "math", we = n === "chem", Te = Ce || we, J = Se[ee] || {}, Ee = Ce && J.id ? ` cme-symbol-subgroup--tab-${J.id}` : "", De = r(() => ke.map((e) => ({
|
|
7689
7689
|
...e,
|
|
7690
|
-
normalized:
|
|
7691
|
-
})), []), [Y,
|
|
7690
|
+
normalized: Ae(e.value) || e.value.toLowerCase()
|
|
7691
|
+
})), []), [Y, Oe] = a({
|
|
7692
7692
|
bold: !1,
|
|
7693
7693
|
italic: !1,
|
|
7694
7694
|
boldItalic: !1,
|
|
7695
7695
|
color: "none",
|
|
7696
7696
|
fontOption: "",
|
|
7697
7697
|
fontSize: "auto"
|
|
7698
|
-
}), [
|
|
7698
|
+
}), [X, Z] = a("western"), [je, He] = a("thin"), We = e((e, t) => {
|
|
7699
7699
|
let n = p.current, r = n?.offsetWidth || 720, i = n?.offsetHeight || 384, a = Math.max(12, window.innerWidth - r - 12), o = Math.max(12, window.innerHeight - i - 12);
|
|
7700
7700
|
return {
|
|
7701
7701
|
x: Math.min(Math.max(12, e), a),
|
|
7702
7702
|
y: Math.min(Math.max(12, t), o)
|
|
7703
7703
|
};
|
|
7704
7704
|
}, []), Ge = e(() => {
|
|
7705
|
-
g.current(), g.current = () => {}, h.current = null,
|
|
7705
|
+
g.current(), g.current = () => {}, h.current = null, ce(!1);
|
|
7706
7706
|
}, []);
|
|
7707
7707
|
t(() => () => Ge(), [Ge]), t(() => {
|
|
7708
|
-
m.current =
|
|
7709
|
-
}, [
|
|
7710
|
-
|
|
7711
|
-
}, [
|
|
7712
|
-
if (
|
|
7708
|
+
m.current = U;
|
|
7709
|
+
}, [U]), t(() => {
|
|
7710
|
+
H === "minimized" && (y(null), b(null), S(null), E(null), D(null), k(null), j(null), N(null), F(null), L(null), z(null), V(null));
|
|
7711
|
+
}, [H]), t(() => {
|
|
7712
|
+
if (H === "maximized") return;
|
|
7713
7713
|
let e = () => {
|
|
7714
7714
|
let e = p.current;
|
|
7715
7715
|
if (!e) return;
|
|
7716
7716
|
let t = m.current;
|
|
7717
7717
|
if (t) {
|
|
7718
7718
|
let e = We(t.x, t.y);
|
|
7719
|
-
m.current = e,
|
|
7719
|
+
m.current = e, W(e);
|
|
7720
7720
|
return;
|
|
7721
7721
|
}
|
|
7722
7722
|
let n = e.getBoundingClientRect(), r = We(window.innerWidth - n.width - 24, window.innerHeight - n.height - 24);
|
|
7723
|
-
m.current = r,
|
|
7723
|
+
m.current = r, W(r);
|
|
7724
7724
|
}, t = requestAnimationFrame(e), n = p.current, r = (t) => {
|
|
7725
7725
|
t.target === n && (t.propertyName !== "width" && t.propertyName !== "height" || e());
|
|
7726
7726
|
};
|
|
7727
7727
|
return n?.addEventListener("transitionend", r), () => {
|
|
7728
7728
|
cancelAnimationFrame(t), n?.removeEventListener("transitionend", r);
|
|
7729
7729
|
};
|
|
7730
|
-
}, [We,
|
|
7731
|
-
if (
|
|
7730
|
+
}, [We, H]), t(() => {
|
|
7731
|
+
if (H === "maximized") return;
|
|
7732
7732
|
let e = () => {
|
|
7733
7733
|
let e = m.current;
|
|
7734
7734
|
if (!e) return;
|
|
7735
7735
|
let t = We(e.x, e.y);
|
|
7736
|
-
m.current = t,
|
|
7736
|
+
m.current = t, W(t);
|
|
7737
7737
|
};
|
|
7738
7738
|
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
7739
|
-
}, [We,
|
|
7739
|
+
}, [We, H]);
|
|
7740
7740
|
let Ke = e((e) => {
|
|
7741
|
-
if (
|
|
7741
|
+
if (H === "maximized" || e.button !== void 0 && e.button !== 0 || e.target.closest(".cme-popup-actions")) return;
|
|
7742
7742
|
let t = p.current;
|
|
7743
7743
|
if (!t) return;
|
|
7744
|
-
e.preventDefault(),
|
|
7744
|
+
e.preventDefault(), ce(!0);
|
|
7745
7745
|
let n = t.getBoundingClientRect(), r = m.current || {
|
|
7746
7746
|
x: n.left,
|
|
7747
7747
|
y: n.top
|
|
7748
7748
|
};
|
|
7749
|
-
m.current = r,
|
|
7749
|
+
m.current = r, W(r), h.current = {
|
|
7750
7750
|
offsetX: e.clientX - n.left,
|
|
7751
7751
|
offsetY: e.clientY - n.top
|
|
7752
7752
|
};
|
|
@@ -7754,7 +7754,7 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
7754
7754
|
if (!h.current) return;
|
|
7755
7755
|
e.preventDefault();
|
|
7756
7756
|
let t = We(e.clientX - h.current.offsetX, e.clientY - h.current.offsetY);
|
|
7757
|
-
m.current = t,
|
|
7757
|
+
m.current = t, W(t);
|
|
7758
7758
|
}, a = () => Ge();
|
|
7759
7759
|
g.current = () => {
|
|
7760
7760
|
window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", a);
|
|
@@ -7762,21 +7762,21 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
7762
7762
|
}, [
|
|
7763
7763
|
We,
|
|
7764
7764
|
Ge,
|
|
7765
|
-
|
|
7765
|
+
H
|
|
7766
7766
|
]);
|
|
7767
7767
|
t(() => {
|
|
7768
|
-
|
|
7768
|
+
le(u === "rtl");
|
|
7769
7769
|
}, [u]), t(() => {
|
|
7770
7770
|
let e = f.current;
|
|
7771
7771
|
if (!e) return;
|
|
7772
|
-
let t =
|
|
7773
|
-
e.setAttribute("dir", t), e.style.direction = t, e.style.textAlign =
|
|
7774
|
-
}, [
|
|
7772
|
+
let t = K ? "rtl" : "ltr";
|
|
7773
|
+
e.setAttribute("dir", t), e.style.direction = t, e.style.textAlign = K ? "right" : "left", e.style.unicodeBidi = K ? "plaintext" : "normal";
|
|
7774
|
+
}, [K]);
|
|
7775
7775
|
let Q = e(() => {
|
|
7776
7776
|
let e = f.current;
|
|
7777
7777
|
if (!(!e || typeof e.queryStyle != "function")) try {
|
|
7778
|
-
let t = e.queryStyle({ variantStyle: "bolditalic" }) === "all", n = t || e.queryStyle({ fontSeries: "b" }) === "all" || e.queryStyle({ variantStyle: "bold" }) === "all", r = t || e.queryStyle({ fontShape: "it" }) === "all" || e.queryStyle({ variantStyle: "italic" }) === "all", i =
|
|
7779
|
-
|
|
7778
|
+
let t = e.queryStyle({ variantStyle: "bolditalic" }) === "all", n = t || e.queryStyle({ fontSeries: "b" }) === "all" || e.queryStyle({ variantStyle: "bold" }) === "all", r = t || e.queryStyle({ fontShape: "it" }) === "all" || e.queryStyle({ variantStyle: "italic" }) === "all", i = ue.find(({ style: t }) => Object.entries(t).every(([t, n]) => e.queryStyle({ [t]: n }) === "all")) || null, a = fe.find(({ value: t }) => e.queryStyle({ fontSize: parseInt(t, 10) }) === "all")?.value || "auto", o = Ae(q), s = [...new Set(De.flatMap((e) => [e.normalized, e.value]).concat(Y.color === "none" ? [] : [Y.color]).concat(o ? [o, q.trim()] : []).filter(Boolean))].find((t) => e.queryStyle({ color: t }) === "all"), c = s ? Ae(s) || s : "none";
|
|
7779
|
+
Oe({
|
|
7780
7780
|
bold: n,
|
|
7781
7781
|
italic: r,
|
|
7782
7782
|
boldItalic: t,
|
|
@@ -7790,7 +7790,7 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
7790
7790
|
}, [
|
|
7791
7791
|
Y.color,
|
|
7792
7792
|
De,
|
|
7793
|
-
|
|
7793
|
+
q
|
|
7794
7794
|
]), qe = e((e) => {
|
|
7795
7795
|
let t = f.current;
|
|
7796
7796
|
if (!t || typeof t.applyStyle != "function") return;
|
|
@@ -7799,8 +7799,8 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
7799
7799
|
variantStyle: i,
|
|
7800
7800
|
fontSeries: n ? "b" : "m",
|
|
7801
7801
|
fontShape: r ? "it" : "n"
|
|
7802
|
-
}), t.applyStyle({ color: e.color === "none" ? "none" : e.color }), t.applyStyle(
|
|
7803
|
-
let a =
|
|
7802
|
+
}), t.applyStyle({ color: e.color === "none" ? "none" : e.color }), t.applyStyle(de);
|
|
7803
|
+
let a = ue.find(({ value: t }) => t === e.fontOption);
|
|
7804
7804
|
if (a && t.applyStyle(a.style), e.fontSize !== "auto") {
|
|
7805
7805
|
let n = parseInt(e.fontSize, 10);
|
|
7806
7806
|
t.applyStyle({
|
|
@@ -7823,20 +7823,20 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
7823
7823
|
]), Ye = e((e) => {
|
|
7824
7824
|
let t = f.current;
|
|
7825
7825
|
if (!t || typeof t.applyStyle != "function") return !1;
|
|
7826
|
-
let n = e === "none" ? "none" :
|
|
7827
|
-
if (e !== "none" && !n) return
|
|
7826
|
+
let n = e === "none" ? "none" : Ae(e);
|
|
7827
|
+
if (e !== "none" && !n) return xe("Enter a valid hex code or CSS color name."), !1;
|
|
7828
7828
|
let r = e === "none" ? "none" : n;
|
|
7829
|
-
return t.focus(), t.applyStyle({ color: r }),
|
|
7829
|
+
return t.focus(), t.applyStyle({ color: r }), Oe((e) => ({
|
|
7830
7830
|
...e,
|
|
7831
7831
|
color: r
|
|
7832
|
-
})),
|
|
7832
|
+
})), ye(r === "none" ? "" : r), xe(""), requestAnimationFrame(Q), !0;
|
|
7833
7833
|
}, [Q]), Xe = e((e, t) => {
|
|
7834
7834
|
let n = f.current;
|
|
7835
7835
|
if (!(!n || typeof n.applyStyle != "function")) {
|
|
7836
7836
|
if (n.focus(), e === "font") {
|
|
7837
|
-
n.applyStyle(
|
|
7838
|
-
let e =
|
|
7839
|
-
e && n.applyStyle(e.style),
|
|
7837
|
+
n.applyStyle(de);
|
|
7838
|
+
let e = ue.find((e) => e.value === t);
|
|
7839
|
+
e && n.applyStyle(e.style), Oe((e) => ({
|
|
7840
7840
|
...e,
|
|
7841
7841
|
fontOption: t
|
|
7842
7842
|
}));
|
|
@@ -7845,7 +7845,7 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
7845
7845
|
n.applyStyle({
|
|
7846
7846
|
fontSize: e,
|
|
7847
7847
|
size: e
|
|
7848
|
-
}),
|
|
7848
|
+
}), Oe((e) => ({
|
|
7849
7849
|
...e,
|
|
7850
7850
|
fontSize: t || "auto"
|
|
7851
7851
|
}));
|
|
@@ -7854,39 +7854,39 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
7854
7854
|
}
|
|
7855
7855
|
}, [Q]);
|
|
7856
7856
|
t(() => {
|
|
7857
|
-
if (!v && !
|
|
7857
|
+
if (!v && !R && !B && !x && !C && !re && !O && !A && !M && !P && !I) return;
|
|
7858
7858
|
let e = (e) => {
|
|
7859
|
-
!e.target.closest(".cme-matrix-hover-popover") && !e.target.closest(".cme-matrix-btn-wrapper") &&
|
|
7859
|
+
!e.target.closest(".cme-matrix-hover-popover") && !e.target.closest(".cme-matrix-btn-wrapper") && y(null), !e.target.closest(".cme-color-picker-popup") && !e.target.closest("[title=\"Text Color\"]") && z(null), !e.target.closest(".cme-style-dropdown-popup") && !e.target.closest(".cme-style-select-trigger") && V(null), !e.target.closest(".cme-arrow-picker-popup") && !e.target.closest(".arrow-picker-tool") && S(null), !e.target.closest(".cme-relation-more-picker-popup") && !e.target.closest(".relation-more-picker-tool") && E(null), !e.target.closest(".cme-arrow-label-picker-popup") && !e.target.closest(".arrow-label-picker-tool") && D(null), !e.target.closest(".cme-greek-italic-picker-popup") && !e.target.closest(".greek-italic-picker-tool") && k(null), !e.target.closest(".cme-blackboard-bold-picker-popup") && !e.target.closest(".blackboard-bold-picker-tool") && j(null), !e.target.closest(".cme-fraktur-script-picker-popup") && !e.target.closest(".fraktur-script-picker-tool") && N(null), !e.target.closest(".cme-hebrew-symbol-picker-popup") && !e.target.closest(".hebrew-symbol-picker-tool") && F(null), !e.target.closest(".cme-periodic-table-picker-popup") && !e.target.closest(".periodic-table-picker-tool") && L(null);
|
|
7860
7860
|
};
|
|
7861
7861
|
return window.addEventListener("mousedown", e, !0), window.addEventListener("pointerdown", e, !0), () => {
|
|
7862
7862
|
window.removeEventListener("mousedown", e, !0), window.removeEventListener("pointerdown", e, !0);
|
|
7863
7863
|
};
|
|
7864
7864
|
}, [
|
|
7865
7865
|
v,
|
|
7866
|
-
I,
|
|
7867
7866
|
R,
|
|
7868
|
-
|
|
7867
|
+
B,
|
|
7868
|
+
x,
|
|
7869
7869
|
C,
|
|
7870
|
-
|
|
7871
|
-
E,
|
|
7870
|
+
re,
|
|
7872
7871
|
O,
|
|
7873
7872
|
A,
|
|
7874
7873
|
M,
|
|
7875
|
-
P
|
|
7874
|
+
P,
|
|
7875
|
+
I
|
|
7876
7876
|
]), t(() => {
|
|
7877
7877
|
let e = f.current;
|
|
7878
7878
|
if (!e) return;
|
|
7879
|
-
e.defaultMode =
|
|
7879
|
+
e.defaultMode = n === "chem" ? "text" : "math", e.letterShapeStyle = "upright";
|
|
7880
7880
|
let t = () => {
|
|
7881
7881
|
let t = l || "";
|
|
7882
|
-
if (
|
|
7882
|
+
if (n === "chem" && t) {
|
|
7883
7883
|
let e = t.match(/^\\ce\{([\s\S]*)\}$/);
|
|
7884
7884
|
e && (t = e[1]);
|
|
7885
7885
|
}
|
|
7886
7886
|
e.setValue ? e.setValue(t, { silenceNotifications: !0 }) : e.value = t, requestAnimationFrame(() => e.focus());
|
|
7887
7887
|
};
|
|
7888
7888
|
customElements.get("math-field") ? requestAnimationFrame(t) : customElements.whenDefined("math-field").then(() => requestAnimationFrame(t));
|
|
7889
|
-
}, [
|
|
7889
|
+
}, [n, l]), t(() => {
|
|
7890
7890
|
let e = f.current;
|
|
7891
7891
|
if (!e) return;
|
|
7892
7892
|
let t = () => e.getValue ? e.getValue() : e.value || "", n = () => {
|
|
@@ -7909,44 +7909,44 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
7909
7909
|
});
|
|
7910
7910
|
}, i = (n) => {
|
|
7911
7911
|
let i = n.key.length === 1 && n.key !== " " && !n.ctrlKey && !n.metaKey && !n.altKey, a = /^\d$/.test(n.key) && !n.ctrlKey && !n.metaKey && !n.altKey;
|
|
7912
|
-
if (
|
|
7912
|
+
if (je === "negativeThin" && i) {
|
|
7913
7913
|
n.preventDefault();
|
|
7914
|
-
let i =
|
|
7915
|
-
|
|
7914
|
+
let i = X !== "western" && a ? se(n.key, X) : n.key;
|
|
7915
|
+
K ? r(`\\!${i}${t()}`) : e.executeCommand(["insert", `\\!${i}`]);
|
|
7916
7916
|
return;
|
|
7917
7917
|
}
|
|
7918
|
-
if (
|
|
7918
|
+
if (X !== "western" && a) {
|
|
7919
7919
|
n.preventDefault();
|
|
7920
|
-
let i =
|
|
7921
|
-
|
|
7920
|
+
let i = se(n.key, X);
|
|
7921
|
+
K ? r(`${i}${t()}`) : e.executeCommand(["insert", i]);
|
|
7922
7922
|
return;
|
|
7923
7923
|
}
|
|
7924
7924
|
if (n.key === " ") {
|
|
7925
7925
|
n.preventDefault();
|
|
7926
|
-
let i =
|
|
7927
|
-
|
|
7926
|
+
let i = je === "negativeThin" ? "\\!" : "\\, ";
|
|
7927
|
+
K ? r(`${i}${t()}`) : e.executeCommand(["insert", i]);
|
|
7928
7928
|
return;
|
|
7929
7929
|
} else if (n.key === "Enter") {
|
|
7930
|
-
n.preventDefault(),
|
|
7930
|
+
n.preventDefault(), K ? r(`\\\\${t()}`) : e.executeCommand(["insert", "\\\\"]), setTimeout(() => {
|
|
7931
7931
|
qe(Y), Q();
|
|
7932
7932
|
}, 10);
|
|
7933
7933
|
return;
|
|
7934
7934
|
}
|
|
7935
|
-
if (
|
|
7935
|
+
if (K && n.key === "Backspace") {
|
|
7936
7936
|
n.preventDefault(), r(t().slice(1));
|
|
7937
7937
|
return;
|
|
7938
7938
|
}
|
|
7939
|
-
|
|
7939
|
+
K && i && (n.preventDefault(), r(`${n.key}${t()}`));
|
|
7940
7940
|
};
|
|
7941
7941
|
return e.addEventListener("keydown", i), () => e.removeEventListener("keydown", i);
|
|
7942
7942
|
}, [
|
|
7943
|
-
|
|
7943
|
+
n,
|
|
7944
7944
|
Y,
|
|
7945
7945
|
qe,
|
|
7946
7946
|
Q,
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7947
|
+
K,
|
|
7948
|
+
X,
|
|
7949
|
+
je
|
|
7950
7950
|
]), t(() => {
|
|
7951
7951
|
let e = f.current;
|
|
7952
7952
|
if (!e) return;
|
|
@@ -7983,13 +7983,13 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
7983
7983
|
return;
|
|
7984
7984
|
}
|
|
7985
7985
|
if (e === "\\,") {
|
|
7986
|
-
|
|
7986
|
+
He("thin"), t.executeCommand(["insert", "\\,"]);
|
|
7987
7987
|
return;
|
|
7988
7988
|
}
|
|
7989
|
-
e === "\\!" && (
|
|
7989
|
+
e === "\\!" && (He("negativeThin"), t.executeCommand(["insert", "\\!"]));
|
|
7990
7990
|
}
|
|
7991
7991
|
}, []), Qe = e((e) => {
|
|
7992
|
-
let t = f.current, n =
|
|
7992
|
+
let t = f.current, n = pe[e];
|
|
7993
7993
|
if (!t || !n) return;
|
|
7994
7994
|
let r = t.selection || t.model?.selection;
|
|
7995
7995
|
if (!(r && Array.isArray(r.ranges) && r.ranges.length > 0 && r.ranges.some(([e, t]) => e !== t))) {
|
|
@@ -8004,7 +8004,7 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8004
8004
|
_.current = null;
|
|
8005
8005
|
return;
|
|
8006
8006
|
}
|
|
8007
|
-
let a =
|
|
8007
|
+
let a = me(i), o = _.current, s = a.baseLatex, c = o?.baseLatex === s, l = c ? o.offsetX : a.offsetX, u = c ? o.offsetY : a.offsetY, d = l + n.x, p = u + n.y, m = he(s, d, p);
|
|
8008
8008
|
if (_.current = {
|
|
8009
8009
|
baseLatex: s,
|
|
8010
8010
|
offsetX: d,
|
|
@@ -8033,41 +8033,41 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8033
8033
|
c();
|
|
8034
8034
|
return;
|
|
8035
8035
|
}
|
|
8036
|
-
|
|
8037
|
-
}, tt =
|
|
8038
|
-
left: `${
|
|
8039
|
-
top: `${
|
|
8036
|
+
n === "chem" && (t = ve(t)), s(t, { direction: K ? "rtl" : "ltr" }), e.setValue ? e.setValue("") : e.value = "", c();
|
|
8037
|
+
}, tt = H !== "maximized" && U ? {
|
|
8038
|
+
left: `${U.x}px`,
|
|
8039
|
+
top: `${U.y}px`,
|
|
8040
8040
|
right: "auto",
|
|
8041
8041
|
bottom: "auto"
|
|
8042
8042
|
} : void 0;
|
|
8043
|
-
return /* @__PURE__ */
|
|
8043
|
+
return /* @__PURE__ */ T("div", {
|
|
8044
8044
|
ref: p,
|
|
8045
|
-
className: `cme-editor-popup ${
|
|
8045
|
+
className: `cme-editor-popup ${H}${G ? " dragging" : ""}`,
|
|
8046
8046
|
style: tt,
|
|
8047
8047
|
onMouseDown: (e) => e.stopPropagation(),
|
|
8048
8048
|
children: [
|
|
8049
|
-
/* @__PURE__ */
|
|
8049
|
+
/* @__PURE__ */ T("div", {
|
|
8050
8050
|
className: "cme-popup-header",
|
|
8051
8051
|
onPointerDown: Ke,
|
|
8052
|
-
children: [/* @__PURE__ */
|
|
8052
|
+
children: [/* @__PURE__ */ w("span", { children: n === "math" ? "MathType" : "ChemType" }), /* @__PURE__ */ T("div", {
|
|
8053
8053
|
className: "cme-popup-actions",
|
|
8054
8054
|
onPointerDown: (e) => e.stopPropagation(),
|
|
8055
8055
|
children: [
|
|
8056
|
-
/* @__PURE__ */
|
|
8056
|
+
/* @__PURE__ */ w("button", {
|
|
8057
8057
|
type: "button",
|
|
8058
8058
|
className: "cme-popup-window-btn",
|
|
8059
|
-
"aria-label":
|
|
8060
|
-
onClick: () =>
|
|
8061
|
-
children:
|
|
8059
|
+
"aria-label": H === "minimized" ? "Restore window" : "Minimize window",
|
|
8060
|
+
onClick: () => oe((e) => e === "minimized" ? "normal" : "minimized"),
|
|
8061
|
+
children: H === "minimized" ? "+" : "-"
|
|
8062
8062
|
}),
|
|
8063
|
-
/* @__PURE__ */
|
|
8063
|
+
/* @__PURE__ */ w("button", {
|
|
8064
8064
|
type: "button",
|
|
8065
8065
|
className: "cme-popup-window-btn",
|
|
8066
|
-
"aria-label":
|
|
8067
|
-
onClick: () =>
|
|
8068
|
-
children:
|
|
8066
|
+
"aria-label": H === "maximized" ? "Restore window" : "Maximize window",
|
|
8067
|
+
onClick: () => oe((e) => e === "maximized" ? "normal" : "maximized"),
|
|
8068
|
+
children: H === "maximized" ? "o" : "⤢ "
|
|
8069
8069
|
}),
|
|
8070
|
-
/* @__PURE__ */
|
|
8070
|
+
/* @__PURE__ */ w("button", {
|
|
8071
8071
|
type: "button",
|
|
8072
8072
|
className: "cme-popup-close",
|
|
8073
8073
|
onClick: () => {
|
|
@@ -8078,25 +8078,25 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8078
8078
|
]
|
|
8079
8079
|
})]
|
|
8080
8080
|
}),
|
|
8081
|
-
/* @__PURE__ */
|
|
8081
|
+
/* @__PURE__ */ T("div", {
|
|
8082
8082
|
className: "cme-toolbar",
|
|
8083
8083
|
role: "toolbar",
|
|
8084
8084
|
"aria-label": "Symbol palette",
|
|
8085
|
-
children: [/* @__PURE__ */
|
|
8085
|
+
children: [/* @__PURE__ */ w("div", {
|
|
8086
8086
|
className: "cme-toolbar-groups",
|
|
8087
|
-
children:
|
|
8088
|
-
className: `cme-group-tab${
|
|
8087
|
+
children: Se.map((e, t) => /* @__PURE__ */ w("button", {
|
|
8088
|
+
className: `cme-group-tab${Te ? " cme-group-tab--popup" : ""}${Ce ? " cme-group-tab--math" : ""}${we ? " cme-group-tab--chem" : ""}${ee === t ? " active" : ""}`,
|
|
8089
8089
|
type: "button",
|
|
8090
8090
|
onClick: () => {
|
|
8091
|
-
te(t),
|
|
8091
|
+
te(t), y(null);
|
|
8092
8092
|
},
|
|
8093
|
-
children: /* @__PURE__ */
|
|
8093
|
+
children: /* @__PURE__ */ w("span", {
|
|
8094
8094
|
className: "cme-group-tab-label",
|
|
8095
8095
|
children: e.label
|
|
8096
8096
|
})
|
|
8097
8097
|
}, e.id || t))
|
|
8098
|
-
}), /* @__PURE__ */
|
|
8099
|
-
className: `cme-toolbar-items${ee === 0 &&
|
|
8098
|
+
}), /* @__PURE__ */ w("div", {
|
|
8099
|
+
className: `cme-toolbar-items${ee === 0 && Ce ? " cme-toolbar-items--first-tab" : ""}${J.id === "greek" ? " cme-toolbar-items--greek" : ""}${J.id === "relations" ? " cme-toolbar-items--relations" : ""}${J.id === "arrows" ? " cme-toolbar-items--arrows" : ""}${J.id === "brackets" ? " cme-toolbar-items--brackets" : ""}${J.id === "matrix" ? " cme-toolbar-items--matrix" : ""}${Te ? " cme-toolbar-items--popup-compact" : ""}`,
|
|
8100
8100
|
children: (() => {
|
|
8101
8101
|
let e = J.items || [];
|
|
8102
8102
|
if (J.id === "greek") {
|
|
@@ -8153,30 +8153,30 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8153
8153
|
rows: 3
|
|
8154
8154
|
}
|
|
8155
8155
|
}, r = Object.entries(t);
|
|
8156
|
-
return /* @__PURE__ */
|
|
8156
|
+
return /* @__PURE__ */ w("div", {
|
|
8157
8157
|
className: "cme-greek-panel",
|
|
8158
8158
|
children: r.map(([e, t], i) => {
|
|
8159
8159
|
let a = n[e] || {
|
|
8160
8160
|
cols: 2,
|
|
8161
8161
|
rows: Math.max(1, Math.ceil(t.length / 2))
|
|
8162
8162
|
}, o = a.cols, s = a.rows, c = t.every((e) => e.cls?.includes("arrow-picker-tool")), l = r[i + 1]?.[1] || [], u = l.length > 0 && l.every((e) => e.cls?.includes("arrow-picker-tool"));
|
|
8163
|
-
return /* @__PURE__ */
|
|
8164
|
-
className: `cme-symbol-subgroup cme-greek-subgroup${e === "Fraktur Symbols" ? " cme-greek-subgroup--no-right-border" : ""}${c ? " cme-greek-subgroup--picker" : ""}${u ? " cme-greek-subgroup--before-picker" : ""}${
|
|
8163
|
+
return /* @__PURE__ */ w("section", {
|
|
8164
|
+
className: `cme-symbol-subgroup cme-greek-subgroup${e === "Fraktur Symbols" ? " cme-greek-subgroup--no-right-border" : ""}${c ? " cme-greek-subgroup--picker" : ""}${u ? " cme-greek-subgroup--before-picker" : ""}${Te ? " cme-symbol-subgroup--compact" : ""}${Ee}`,
|
|
8165
8165
|
style: {
|
|
8166
8166
|
gridTemplateColumns: `repeat(${o}, auto)`,
|
|
8167
8167
|
gridTemplateRows: `repeat(${s}, auto)`,
|
|
8168
8168
|
"--cme-greek-rows": `repeat(${s}, auto)`
|
|
8169
8169
|
},
|
|
8170
8170
|
children: t.map((t, n) => {
|
|
8171
|
-
let r = J, i = `${r.id || r.label || ee}-${e}-${n}-${t.insert || t.action || t.label}`, a = t.action === "GREEK_ITALIC_PICKER", o = t.action === "BLACKBOARD_BOLD_PICKER", s = t.action === "FRAKTUR_SCRIPT_PICKER", c = t.action === "HEBREW_SYMBOL_PICKER", l = t.action === "PERIODIC_TABLE_PICKER", u = t.action === "ARABIC_INDIC_NUMERALS", d = t.action === "EASTERN_ARABIC_INDIC_NUMERALS", p = a ? !!
|
|
8172
|
-
return /* @__PURE__ */
|
|
8171
|
+
let r = J, i = `${r.id || r.label || ee}-${e}-${n}-${t.insert || t.action || t.label}`, a = t.action === "GREEK_ITALIC_PICKER", o = t.action === "BLACKBOARD_BOLD_PICKER", s = t.action === "FRAKTUR_SCRIPT_PICKER", c = t.action === "HEBREW_SYMBOL_PICKER", l = t.action === "PERIODIC_TABLE_PICKER", u = t.action === "ARABIC_INDIC_NUMERALS", d = t.action === "EASTERN_ARABIC_INDIC_NUMERALS", p = a ? !!O : o ? !!A : s ? !!M : c ? !!P : l ? !!I : u ? X === "arabicIndic" : d ? X === "easternArabicIndic" : !1;
|
|
8172
|
+
return /* @__PURE__ */ w("button", {
|
|
8173
8173
|
type: "button",
|
|
8174
|
-
className: `cme-btn cme-greek-btn${
|
|
8174
|
+
className: `cme-btn cme-greek-btn${Te ? " cme-btn--compact" : ""}${t.cls ? ` ${t.cls}` : ""}${p ? " active" : ""}`,
|
|
8175
8175
|
title: t.title || t.insert,
|
|
8176
8176
|
onMouseDown: (e) => {
|
|
8177
8177
|
if (e.preventDefault(), t.action === "GREEK_ITALIC_PICKER") {
|
|
8178
8178
|
let t = e.currentTarget.getBoundingClientRect();
|
|
8179
|
-
|
|
8179
|
+
S(null), D(null), z(null), b(null), j(null), N(null), F(null), L(null), k((e) => e ? null : {
|
|
8180
8180
|
x: t.left,
|
|
8181
8181
|
y: t.bottom + 4
|
|
8182
8182
|
});
|
|
@@ -8184,7 +8184,7 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8184
8184
|
}
|
|
8185
8185
|
if (t.action === "BLACKBOARD_BOLD_PICKER") {
|
|
8186
8186
|
let t = e.currentTarget.getBoundingClientRect();
|
|
8187
|
-
|
|
8187
|
+
S(null), D(null), z(null), b(null), k(null), N(null), F(null), L(null), j((e) => e ? null : {
|
|
8188
8188
|
x: t.left,
|
|
8189
8189
|
y: t.bottom + 4
|
|
8190
8190
|
});
|
|
@@ -8192,7 +8192,7 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8192
8192
|
}
|
|
8193
8193
|
if (t.action === "FRAKTUR_SCRIPT_PICKER") {
|
|
8194
8194
|
let t = e.currentTarget.getBoundingClientRect();
|
|
8195
|
-
|
|
8195
|
+
S(null), D(null), z(null), b(null), k(null), j(null), F(null), L(null), N((e) => e ? null : {
|
|
8196
8196
|
x: t.left,
|
|
8197
8197
|
y: t.bottom + 4
|
|
8198
8198
|
});
|
|
@@ -8200,7 +8200,7 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8200
8200
|
}
|
|
8201
8201
|
if (t.action === "HEBREW_SYMBOL_PICKER") {
|
|
8202
8202
|
let t = e.currentTarget.getBoundingClientRect();
|
|
8203
|
-
|
|
8203
|
+
S(null), D(null), z(null), b(null), k(null), j(null), N(null), L(null), F((e) => e ? null : {
|
|
8204
8204
|
x: t.left,
|
|
8205
8205
|
y: t.bottom + 4
|
|
8206
8206
|
});
|
|
@@ -8208,26 +8208,26 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8208
8208
|
}
|
|
8209
8209
|
if (t.action === "PERIODIC_TABLE_PICKER") {
|
|
8210
8210
|
let t = e.currentTarget.getBoundingClientRect();
|
|
8211
|
-
|
|
8211
|
+
S(null), D(null), z(null), b(null), k(null), j(null), N(null), F(null), L((e) => e ? null : {
|
|
8212
8212
|
x: t.left,
|
|
8213
8213
|
y: t.bottom + 4
|
|
8214
8214
|
});
|
|
8215
8215
|
return;
|
|
8216
8216
|
}
|
|
8217
8217
|
if (t.action === "ARABIC_INDIC_NUMERALS") {
|
|
8218
|
-
|
|
8218
|
+
S(null), D(null), z(null), b(null), k(null), j(null), N(null), F(null), L(null), Z((e) => e === "arabicIndic" ? "western" : "arabicIndic"), requestAnimationFrame(() => f.current?.focus?.());
|
|
8219
8219
|
return;
|
|
8220
8220
|
}
|
|
8221
8221
|
if (t.action === "EASTERN_ARABIC_INDIC_NUMERALS") {
|
|
8222
|
-
|
|
8222
|
+
S(null), D(null), z(null), b(null), k(null), j(null), N(null), F(null), L(null), Z((e) => e === "easternArabicIndic" ? "western" : "easternArabicIndic"), requestAnimationFrame(() => f.current?.focus?.());
|
|
8223
8223
|
return;
|
|
8224
8224
|
}
|
|
8225
8225
|
$(t.insert);
|
|
8226
8226
|
},
|
|
8227
|
-
children:
|
|
8227
|
+
children: Me(t, {
|
|
8228
8228
|
groupId: r.id,
|
|
8229
|
-
isMathMode:
|
|
8230
|
-
isChemMode:
|
|
8229
|
+
isMathMode: Ce,
|
|
8230
|
+
isChemMode: we
|
|
8231
8231
|
})
|
|
8232
8232
|
}, i);
|
|
8233
8233
|
})
|
|
@@ -8596,8 +8596,8 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8596
8596
|
});
|
|
8597
8597
|
return n.map((e, t) => {
|
|
8598
8598
|
let n = e.cols || 1, r = e.trackCols || n, i = e.items.length, a = n > 0 ? i % n : 0, o = a === 0 ? n : a, s = i - o, c = Math.max(1, Math.floor(r / n));
|
|
8599
|
-
return /* @__PURE__ */
|
|
8600
|
-
className: `cme-symbol-subgroup${e.className || ""}${
|
|
8599
|
+
return /* @__PURE__ */ w("div", {
|
|
8600
|
+
className: `cme-symbol-subgroup${e.className || ""}${Te ? " cme-symbol-subgroup--compact" : ""}${Ee}`,
|
|
8601
8601
|
style: {
|
|
8602
8602
|
gridTemplateColumns: `repeat(${r}, ${e.equalColumns ? "minmax(0, 1fr)" : "auto"})`,
|
|
8603
8603
|
gridTemplateRows: `repeat(${e.rows || Math.ceil(e.items.length / n)}, auto)`,
|
|
@@ -8607,8 +8607,8 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8607
8607
|
children: e.items.map((a, l) => {
|
|
8608
8608
|
let u = e.stretchLastRow && i > 0 && l >= s && o < n ? `span ${Math.max(1, Math.floor(r / o))}` : c > 1 ? `span ${c}` : void 0, d = J, p = d.id || d.label || ee, m = `${p}-${t * 4 + l}-${a.insert || a.action || a.label}`;
|
|
8609
8609
|
if (a.type === "dropdown") {
|
|
8610
|
-
let t = a.label === "Font...", n = a.label === "Size", r = t && Y.fontOption !== "", i = n && Y.fontSize !== "auto" && Y.fontSize !== "5", o = t ? Y.fontOption : n ? Y.fontSize === "auto" || Y.fontSize === "5" ? "" : Y.fontSize : "", s = (t ?
|
|
8611
|
-
return /* @__PURE__ */
|
|
8610
|
+
let t = a.label === "Font...", n = a.label === "Size", r = t && Y.fontOption !== "", i = n && Y.fontSize !== "auto" && Y.fontSize !== "5", o = t ? Y.fontOption : n ? Y.fontSize === "auto" || Y.fontSize === "5" ? "" : Y.fontSize : "", s = (t ? ue : fe).find((e) => e.value === o)?.label || a.label, c = B?.buttonKey === m;
|
|
8611
|
+
return /* @__PURE__ */ w("button", {
|
|
8612
8612
|
type: "button",
|
|
8613
8613
|
className: `cme-style-select-trigger cme-select cme-btn template${r || i || c ? " active" : ""}`,
|
|
8614
8614
|
title: a.label,
|
|
@@ -8622,7 +8622,7 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8622
8622
|
onMouseDown: (e) => {
|
|
8623
8623
|
e.preventDefault(), e.stopPropagation();
|
|
8624
8624
|
let n = e.currentTarget.getBoundingClientRect();
|
|
8625
|
-
|
|
8625
|
+
V((e) => e?.buttonKey === m ? null : {
|
|
8626
8626
|
x: n.left,
|
|
8627
8627
|
y: n.bottom,
|
|
8628
8628
|
type: t ? "font" : "size",
|
|
@@ -8632,34 +8632,34 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8632
8632
|
children: s
|
|
8633
8633
|
}, l);
|
|
8634
8634
|
}
|
|
8635
|
-
if (d.isMatrix && !a.directInsert && !a.action) return /* @__PURE__ */
|
|
8635
|
+
if (d.isMatrix && !a.directInsert && !a.action) return /* @__PURE__ */ w("div", {
|
|
8636
8636
|
className: "cme-matrix-btn-wrapper",
|
|
8637
|
-
children: /* @__PURE__ */
|
|
8637
|
+
children: /* @__PURE__ */ w("button", {
|
|
8638
8638
|
type: "button",
|
|
8639
|
-
className: `cme-btn template${
|
|
8639
|
+
className: `cme-btn template${Te ? " cme-btn--compact" : ""}${a.cls ? ` ${a.cls}` : ""}${v?.type === a.insert ? " active" : ""}`,
|
|
8640
8640
|
title: a.insert,
|
|
8641
8641
|
onMouseDown: (e) => {
|
|
8642
|
-
if (e.preventDefault(), e.stopPropagation(), v?.type === a.insert)
|
|
8642
|
+
if (e.preventDefault(), e.stopPropagation(), v?.type === a.insert) y(null);
|
|
8643
8643
|
else {
|
|
8644
8644
|
let t = e.currentTarget.getBoundingClientRect();
|
|
8645
|
-
|
|
8645
|
+
y({
|
|
8646
8646
|
type: a.insert,
|
|
8647
8647
|
x: t.left + t.width / 2,
|
|
8648
8648
|
y: t.bottom
|
|
8649
8649
|
});
|
|
8650
8650
|
}
|
|
8651
8651
|
},
|
|
8652
|
-
children:
|
|
8652
|
+
children: Me(a, {
|
|
8653
8653
|
groupId: d.id,
|
|
8654
|
-
isMathMode:
|
|
8655
|
-
isChemMode:
|
|
8654
|
+
isMathMode: Ce,
|
|
8655
|
+
isChemMode: we
|
|
8656
8656
|
})
|
|
8657
8657
|
})
|
|
8658
8658
|
}, l);
|
|
8659
|
-
let h = a.action === "BOLD", g = a.action === "ITALIC", _ = a.action === "BOLD_ITALIC", te = a.action === "TEXT_COLOR",
|
|
8660
|
-
return /* @__PURE__ */
|
|
8659
|
+
let h = a.action === "BOLD", g = a.action === "ITALIC", _ = a.action === "BOLD_ITALIC", te = a.action === "TEXT_COLOR", ne = a.action === "TOGGLE_RTL", T = a.action === "ARROW_PICKER", ie = a.action === "RELATION_MORE_PICKER", O = a.action === "ARROW_LABEL_PICKER", ae = a.action === "BLACKBOARD_BOLD_PICKER", R = a.action === "FRAKTUR_SCRIPT_PICKER", H = a.action === "HEBREW_SYMBOL_PICKER", oe = a.action === "PERIODIC_TABLE_PICKER", U = h && Y.bold && !Y.italic || g && Y.italic && !Y.bold || _ && Y.boldItalic || ne && K || T && !!x || ie && C?.picker === a.picker || O && !!re || ae && !!A || R && !!M || H && !!P || oe && !!I || te && Y.color !== "none";
|
|
8660
|
+
return /* @__PURE__ */ w("button", {
|
|
8661
8661
|
type: "button",
|
|
8662
|
-
className: `cme-btn${d.isTemplate ? " template" : ""}${
|
|
8662
|
+
className: `cme-btn${d.isTemplate ? " template" : ""}${Te ? " cme-btn--compact" : ""}${a.cls ? ` ${a.cls}` : ""}${U ? " active" : ""}`,
|
|
8663
8663
|
title: a.title || a.insert,
|
|
8664
8664
|
style: a.gridColumn || a.gridRow || u ? {
|
|
8665
8665
|
gridColumn: a.gridColumn || u,
|
|
@@ -8670,60 +8670,60 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8670
8670
|
let t = f.current;
|
|
8671
8671
|
if (a.action === "SPECIAL_CHARS") {
|
|
8672
8672
|
let t = e.currentTarget.getBoundingClientRect();
|
|
8673
|
-
|
|
8673
|
+
S(null), E(null), D(null), k(null), j(null), N(null), F(null), L(null), z(null), b({
|
|
8674
8674
|
x: t.left,
|
|
8675
8675
|
y: t.bottom + 4
|
|
8676
8676
|
});
|
|
8677
8677
|
} else if (a.action === "ARROW_PICKER") {
|
|
8678
8678
|
let t = e.currentTarget.getBoundingClientRect();
|
|
8679
|
-
|
|
8679
|
+
b(null), E(null), D(null), k(null), j(null), N(null), F(null), L(null), z(null), S((e) => e ? null : {
|
|
8680
8680
|
x: t.left,
|
|
8681
8681
|
y: t.bottom + 4
|
|
8682
8682
|
});
|
|
8683
8683
|
} else if (a.action === "RELATION_MORE_PICKER") {
|
|
8684
8684
|
let t = e.currentTarget.getBoundingClientRect();
|
|
8685
|
-
|
|
8685
|
+
b(null), S(null), D(null), k(null), j(null), N(null), F(null), L(null), z(null), E((e) => e?.picker === a.picker ? null : {
|
|
8686
8686
|
x: t.left,
|
|
8687
8687
|
y: t.bottom + 4,
|
|
8688
8688
|
picker: a.picker
|
|
8689
8689
|
});
|
|
8690
8690
|
} else if (a.action === "ARROW_LABEL_PICKER") {
|
|
8691
8691
|
let t = e.currentTarget.getBoundingClientRect();
|
|
8692
|
-
|
|
8692
|
+
b(null), S(null), E(null), k(null), j(null), N(null), F(null), L(null), z(null), D((e) => e ? null : {
|
|
8693
8693
|
x: t.left,
|
|
8694
8694
|
y: t.bottom + 4
|
|
8695
8695
|
});
|
|
8696
8696
|
} else if (a.action === "BLACKBOARD_BOLD_PICKER") {
|
|
8697
8697
|
let t = e.currentTarget.getBoundingClientRect();
|
|
8698
|
-
|
|
8698
|
+
b(null), S(null), D(null), z(null), E(null), k(null), N(null), F(null), L(null), j((e) => e ? null : {
|
|
8699
8699
|
x: t.left,
|
|
8700
8700
|
y: t.bottom + 4
|
|
8701
8701
|
});
|
|
8702
8702
|
} else if (a.action === "FRAKTUR_SCRIPT_PICKER") {
|
|
8703
8703
|
let t = e.currentTarget.getBoundingClientRect();
|
|
8704
|
-
|
|
8704
|
+
b(null), S(null), D(null), z(null), E(null), k(null), j(null), F(null), L(null), N((e) => e ? null : {
|
|
8705
8705
|
x: t.left,
|
|
8706
8706
|
y: t.bottom + 4
|
|
8707
8707
|
});
|
|
8708
8708
|
} else if (a.action === "HEBREW_SYMBOL_PICKER") {
|
|
8709
8709
|
let t = e.currentTarget.getBoundingClientRect();
|
|
8710
|
-
|
|
8710
|
+
b(null), S(null), D(null), z(null), E(null), k(null), j(null), N(null), L(null), F((e) => e ? null : {
|
|
8711
8711
|
x: t.left,
|
|
8712
8712
|
y: t.bottom + 4
|
|
8713
8713
|
});
|
|
8714
8714
|
} else if (a.action === "PERIODIC_TABLE_PICKER") {
|
|
8715
8715
|
let t = e.currentTarget.getBoundingClientRect();
|
|
8716
|
-
|
|
8716
|
+
b(null), S(null), D(null), z(null), E(null), k(null), j(null), N(null), F(null), L((e) => e ? null : {
|
|
8717
8717
|
x: t.left,
|
|
8718
8718
|
y: t.bottom + 4
|
|
8719
8719
|
});
|
|
8720
8720
|
} else if (a.action === "TEXT_COLOR") {
|
|
8721
8721
|
let t = e.currentTarget.getBoundingClientRect();
|
|
8722
|
-
|
|
8722
|
+
S(null), E(null), D(null), k(null), j(null), N(null), F(null), L(null), ye(Y.color === "none" ? "" : Y.color), xe(""), z({
|
|
8723
8723
|
x: t.left,
|
|
8724
8724
|
y: t.bottom + 4
|
|
8725
8725
|
});
|
|
8726
|
-
} else if (a.action === "TOGGLE_RTL")
|
|
8726
|
+
} else if (a.action === "TOGGLE_RTL") le((e) => !e), requestAnimationFrame(() => f.current?.focus?.());
|
|
8727
8727
|
else if (a.action === "BOLD") Je(!Y.bold, Y.italic);
|
|
8728
8728
|
else if (a.action === "BOLD_ITALIC") {
|
|
8729
8729
|
let e = !Y.boldItalic;
|
|
@@ -8735,13 +8735,13 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8735
8735
|
let e = t ? t.getValue ? t.getValue() : t.value || "" : "";
|
|
8736
8736
|
e && navigator.clipboard?.writeText && navigator.clipboard.writeText(e).catch(() => {});
|
|
8737
8737
|
} else a.action === "PASTE" ? navigator.clipboard?.readText && navigator.clipboard.readText().then((e) => {
|
|
8738
|
-
e && $(
|
|
8739
|
-
}).catch(() => {}) : a.action === "ARABIC_INDIC_NUMERALS" ? (
|
|
8738
|
+
e && $(se(e, X));
|
|
8739
|
+
}).catch(() => {}) : a.action === "ARABIC_INDIC_NUMERALS" ? (Z((e) => e === "arabicIndic" ? "western" : "arabicIndic"), requestAnimationFrame(() => f.current?.focus?.())) : a.action === "EASTERN_ARABIC_INDIC_NUMERALS" ? (Z((e) => e === "easternArabicIndic" ? "western" : "easternArabicIndic"), requestAnimationFrame(() => f.current?.focus?.())) : a.action === "MOVE_TEXT_UP" ? Qe("up") : a.action === "MOVE_TEXT_RIGHT" ? Qe("right") : a.action === "MOVE_TEXT_LEFT" ? Qe("left") : a.action === "MOVE_TEXT_DOWN" ? Qe("down") : a.action === "BLACKBOARD" ? $("\\mathbb{#0}") : a.action === "GREEK" ? $("\\Omega") : a.action === "TILDE" ? $("\\widetilde{#0}") : a.action === "ITALIC" ? Je(Y.bold, !Y.italic) : a.action === "TEXT" ? $("\\text{#0}") : a.action === "UNDO" ? f.current?.executeCommand("undo") : a.action === "REDO" ? f.current?.executeCommand("redo") : a.action === "CLEAR" ? t && (typeof t.setValue == "function" ? t.setValue("") : t.value = "", t.focus?.()) : a.insert === "\\hphantom{0}" || a.insert === "\\," || a.insert === "\\!" ? Ze(a.insert) : $(a.insert);
|
|
8740
8740
|
},
|
|
8741
|
-
children:
|
|
8741
|
+
children: Me(a, {
|
|
8742
8742
|
groupId: d.id,
|
|
8743
|
-
isMathMode:
|
|
8744
|
-
isChemMode:
|
|
8743
|
+
isMathMode: Ce,
|
|
8744
|
+
isChemMode: we
|
|
8745
8745
|
})
|
|
8746
8746
|
}, `${p}-${t * 4 + l}`);
|
|
8747
8747
|
})
|
|
@@ -8750,121 +8750,121 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8750
8750
|
})()
|
|
8751
8751
|
})]
|
|
8752
8752
|
}),
|
|
8753
|
-
/* @__PURE__ */
|
|
8754
|
-
className: `cme-mathfield-container${
|
|
8753
|
+
/* @__PURE__ */ w("div", {
|
|
8754
|
+
className: `cme-mathfield-container${K ? " cme-mathfield-container--rtl" : ""}`,
|
|
8755
8755
|
onMouseDown: (e) => {
|
|
8756
8756
|
f.current && (e.target === f.current || f.current.contains(e.target)) || (e.preventDefault(), requestAnimationFrame(() => {
|
|
8757
8757
|
f.current?.focus?.();
|
|
8758
8758
|
}));
|
|
8759
8759
|
},
|
|
8760
|
-
children: /* @__PURE__ */
|
|
8760
|
+
children: /* @__PURE__ */ w("math-field", {
|
|
8761
8761
|
ref: f,
|
|
8762
|
-
class: `cme-mathfield${
|
|
8763
|
-
dir:
|
|
8762
|
+
class: `cme-mathfield${K ? " cme-mathfield--rtl" : ""}`,
|
|
8763
|
+
dir: K ? "rtl" : "ltr",
|
|
8764
8764
|
"letter-shape-style": "upright",
|
|
8765
8765
|
tabIndex: 0,
|
|
8766
8766
|
"math-virtual-keyboard-policy": "manual",
|
|
8767
8767
|
placeholder: ""
|
|
8768
8768
|
})
|
|
8769
8769
|
}),
|
|
8770
|
-
/* @__PURE__ */
|
|
8770
|
+
/* @__PURE__ */ T("div", {
|
|
8771
8771
|
className: "cme-popup-footer",
|
|
8772
|
-
children: [/* @__PURE__ */
|
|
8772
|
+
children: [/* @__PURE__ */ w("button", {
|
|
8773
8773
|
type: "button",
|
|
8774
8774
|
className: "cme-insert-btn",
|
|
8775
8775
|
onClick: et,
|
|
8776
8776
|
children: d ? "Update" : "Insert"
|
|
8777
|
-
}), /* @__PURE__ */
|
|
8777
|
+
}), /* @__PURE__ */ w("button", {
|
|
8778
8778
|
type: "button",
|
|
8779
8779
|
className: "cme-cancel-btn",
|
|
8780
8780
|
onClick: c,
|
|
8781
8781
|
children: "Cancel"
|
|
8782
8782
|
})]
|
|
8783
8783
|
}),
|
|
8784
|
-
v && /* @__PURE__ */
|
|
8784
|
+
v && /* @__PURE__ */ w(Ue, {
|
|
8785
8785
|
matrixType: v.type,
|
|
8786
8786
|
x: v.x,
|
|
8787
8787
|
y: v.y,
|
|
8788
8788
|
onSelect: (e, t) => {
|
|
8789
|
-
$e(v.type, e, t),
|
|
8789
|
+
$e(v.type, e, t), y(null);
|
|
8790
8790
|
},
|
|
8791
8791
|
onMouseEnter: () => {},
|
|
8792
8792
|
onMouseLeave: () => {}
|
|
8793
8793
|
}),
|
|
8794
|
-
|
|
8795
|
-
isOpen: !!
|
|
8796
|
-
position:
|
|
8797
|
-
onClose: () =>
|
|
8794
|
+
ne && o(/* @__PURE__ */ w(ie, {
|
|
8795
|
+
isOpen: !!ne,
|
|
8796
|
+
position: ne,
|
|
8797
|
+
onClose: () => b(null),
|
|
8798
8798
|
onInsert: (e) => {
|
|
8799
|
-
$(e),
|
|
8799
|
+
$(e), b(null);
|
|
8800
8800
|
}
|
|
8801
8801
|
}), document.body),
|
|
8802
|
-
|
|
8803
|
-
position:
|
|
8802
|
+
x && o(/* @__PURE__ */ w(Ne, {
|
|
8803
|
+
position: x,
|
|
8804
8804
|
onInsert: (e) => {
|
|
8805
|
-
$(e),
|
|
8805
|
+
$(e), S(null);
|
|
8806
8806
|
}
|
|
8807
8807
|
}), document.body),
|
|
8808
|
-
C &&
|
|
8808
|
+
C && o(/* @__PURE__ */ w(Pe, {
|
|
8809
8809
|
position: C,
|
|
8810
8810
|
picker: C.picker,
|
|
8811
8811
|
popupBounds: p.current?.getBoundingClientRect?.() || null,
|
|
8812
|
-
items:
|
|
8813
|
-
onInsert: (e) => {
|
|
8814
|
-
$(e), w(null);
|
|
8815
|
-
}
|
|
8816
|
-
}), document.body),
|
|
8817
|
-
oe && a(/* @__PURE__ */ x(Pe, {
|
|
8818
|
-
position: oe,
|
|
8812
|
+
items: ae[C.picker] || [],
|
|
8819
8813
|
onInsert: (e) => {
|
|
8820
|
-
$(e),
|
|
8814
|
+
$(e), E(null);
|
|
8821
8815
|
}
|
|
8822
8816
|
}), document.body),
|
|
8823
|
-
|
|
8824
|
-
position:
|
|
8817
|
+
re && o(/* @__PURE__ */ w(Fe, {
|
|
8818
|
+
position: re,
|
|
8825
8819
|
onInsert: (e) => {
|
|
8826
8820
|
$(e), D(null);
|
|
8827
8821
|
}
|
|
8828
8822
|
}), document.body),
|
|
8829
|
-
O &&
|
|
8823
|
+
O && o(/* @__PURE__ */ w(Ie, {
|
|
8830
8824
|
position: O,
|
|
8831
8825
|
onInsert: (e) => {
|
|
8832
8826
|
$(e), k(null);
|
|
8833
8827
|
}
|
|
8834
8828
|
}), document.body),
|
|
8835
|
-
A &&
|
|
8829
|
+
A && o(/* @__PURE__ */ w(Le, {
|
|
8836
8830
|
position: A,
|
|
8837
8831
|
onInsert: (e) => {
|
|
8838
8832
|
$(e), j(null);
|
|
8839
8833
|
}
|
|
8840
8834
|
}), document.body),
|
|
8841
|
-
M &&
|
|
8835
|
+
M && o(/* @__PURE__ */ w(Re, {
|
|
8842
8836
|
position: M,
|
|
8843
8837
|
onInsert: (e) => {
|
|
8844
8838
|
$(e), N(null);
|
|
8845
8839
|
}
|
|
8846
8840
|
}), document.body),
|
|
8847
|
-
P &&
|
|
8841
|
+
P && o(/* @__PURE__ */ w(ze, {
|
|
8848
8842
|
position: P,
|
|
8849
8843
|
onInsert: (e) => {
|
|
8850
8844
|
$(e), F(null);
|
|
8851
8845
|
}
|
|
8852
8846
|
}), document.body),
|
|
8853
|
-
|
|
8854
|
-
position:
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8847
|
+
I && o(/* @__PURE__ */ w(Be, {
|
|
8848
|
+
position: I,
|
|
8849
|
+
onInsert: (e) => {
|
|
8850
|
+
$(e), L(null);
|
|
8851
|
+
}
|
|
8852
|
+
}), document.body),
|
|
8853
|
+
B && o(/* @__PURE__ */ w(Ve, {
|
|
8854
|
+
position: B,
|
|
8855
|
+
options: B.type === "font" ? ue : fe,
|
|
8856
|
+
value: B.type === "font" ? Y.fontOption : Y.fontSize,
|
|
8857
|
+
width: B.type === "font" ? 142 : 96,
|
|
8858
8858
|
onSelect: (e) => {
|
|
8859
|
-
Xe(
|
|
8859
|
+
Xe(B.type, e), V(null);
|
|
8860
8860
|
}
|
|
8861
8861
|
}), document.body),
|
|
8862
|
-
|
|
8862
|
+
R && o(/* @__PURE__ */ T("div", {
|
|
8863
8863
|
className: "cme-color-picker-popup",
|
|
8864
8864
|
style: {
|
|
8865
8865
|
position: "fixed",
|
|
8866
|
-
left: Math.min(
|
|
8867
|
-
top: Math.min(
|
|
8866
|
+
left: Math.min(R.x, window.innerWidth - 260) + "px",
|
|
8867
|
+
top: Math.min(R.y, window.innerHeight - 235) + "px",
|
|
8868
8868
|
zIndex: 1e5,
|
|
8869
8869
|
width: "244px",
|
|
8870
8870
|
background: "linear-gradient(180deg, #ffffff 0%, #f6fafc 100%)",
|
|
@@ -8877,14 +8877,14 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8877
8877
|
boxShadow: "0 16px 28px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.08)"
|
|
8878
8878
|
},
|
|
8879
8879
|
children: [
|
|
8880
|
-
/* @__PURE__ */
|
|
8880
|
+
/* @__PURE__ */ T("div", {
|
|
8881
8881
|
style: {
|
|
8882
8882
|
display: "flex",
|
|
8883
8883
|
alignItems: "center",
|
|
8884
8884
|
justifyContent: "space-between",
|
|
8885
8885
|
gap: "10px"
|
|
8886
8886
|
},
|
|
8887
|
-
children: [/* @__PURE__ */
|
|
8887
|
+
children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("div", {
|
|
8888
8888
|
style: {
|
|
8889
8889
|
fontSize: "12px",
|
|
8890
8890
|
fontWeight: 700,
|
|
@@ -8892,26 +8892,26 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8892
8892
|
lineHeight: 1.1
|
|
8893
8893
|
},
|
|
8894
8894
|
children: "Text Color"
|
|
8895
|
-
}), /* @__PURE__ */
|
|
8895
|
+
}), /* @__PURE__ */ w("div", {
|
|
8896
8896
|
style: {
|
|
8897
8897
|
fontSize: "10px",
|
|
8898
8898
|
color: "#667b88",
|
|
8899
8899
|
marginTop: "2px"
|
|
8900
8900
|
},
|
|
8901
8901
|
children: "Pick a swatch or enter a custom value"
|
|
8902
|
-
})] }), /* @__PURE__ */
|
|
8902
|
+
})] }), /* @__PURE__ */ w("div", {
|
|
8903
8903
|
style: {
|
|
8904
8904
|
width: "28px",
|
|
8905
8905
|
height: "28px",
|
|
8906
8906
|
borderRadius: "8px",
|
|
8907
8907
|
border: "1px solid #b8c8d2",
|
|
8908
|
-
background: Y.color === "none" ? "linear-gradient(135deg, #ffffff 0%, #eef3f7 100%)" :
|
|
8908
|
+
background: Y.color === "none" ? "linear-gradient(135deg, #ffffff 0%, #eef3f7 100%)" : Ae(q) || Y.color,
|
|
8909
8909
|
boxShadow: "inset 0 1px 0 rgba(255,255,255,0.8)"
|
|
8910
8910
|
},
|
|
8911
8911
|
title: Y.color === "none" ? "No color selected" : Y.color
|
|
8912
8912
|
})]
|
|
8913
8913
|
}),
|
|
8914
|
-
/* @__PURE__ */
|
|
8914
|
+
/* @__PURE__ */ w("div", {
|
|
8915
8915
|
style: {
|
|
8916
8916
|
display: "grid",
|
|
8917
8917
|
gridTemplateColumns: "repeat(6, 1fr)",
|
|
@@ -8923,7 +8923,7 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8923
8923
|
},
|
|
8924
8924
|
children: De.map((e) => {
|
|
8925
8925
|
let t = Y.color === e.normalized;
|
|
8926
|
-
return /* @__PURE__ */
|
|
8926
|
+
return /* @__PURE__ */ w("div", {
|
|
8927
8927
|
title: e.label,
|
|
8928
8928
|
style: {
|
|
8929
8929
|
width: "22px",
|
|
@@ -8936,18 +8936,18 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8936
8936
|
boxShadow: t ? "0 0 0 2px rgba(214, 165, 40, 0.16)" : "inset 0 1px 0 rgba(255,255,255,0.6)"
|
|
8937
8937
|
},
|
|
8938
8938
|
onMouseDown: (t) => {
|
|
8939
|
-
t.preventDefault(), t.stopPropagation(), Ye(e.normalized) &&
|
|
8939
|
+
t.preventDefault(), t.stopPropagation(), Ye(e.normalized) && z(null);
|
|
8940
8940
|
}
|
|
8941
8941
|
}, e.normalized);
|
|
8942
8942
|
})
|
|
8943
8943
|
}),
|
|
8944
|
-
/* @__PURE__ */
|
|
8944
|
+
/* @__PURE__ */ T("div", {
|
|
8945
8945
|
style: {
|
|
8946
8946
|
display: "flex",
|
|
8947
8947
|
flexDirection: "column",
|
|
8948
8948
|
gap: "6px"
|
|
8949
8949
|
},
|
|
8950
|
-
children: [/* @__PURE__ */
|
|
8950
|
+
children: [/* @__PURE__ */ w("div", {
|
|
8951
8951
|
style: {
|
|
8952
8952
|
fontSize: "10px",
|
|
8953
8953
|
fontWeight: 700,
|
|
@@ -8956,15 +8956,15 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8956
8956
|
textTransform: "uppercase"
|
|
8957
8957
|
},
|
|
8958
8958
|
children: "Custom Value"
|
|
8959
|
-
}), /* @__PURE__ */
|
|
8959
|
+
}), /* @__PURE__ */ w("input", {
|
|
8960
8960
|
type: "text",
|
|
8961
|
-
value:
|
|
8961
|
+
value: q,
|
|
8962
8962
|
placeholder: "#2c8a43 or tomato",
|
|
8963
8963
|
style: {
|
|
8964
8964
|
width: "100%",
|
|
8965
8965
|
minWidth: 0,
|
|
8966
8966
|
height: "32px",
|
|
8967
|
-
border: `1px solid ${
|
|
8967
|
+
border: `1px solid ${be ? "#dc2626" : "#b7c7d1"}`,
|
|
8968
8968
|
borderRadius: "8px",
|
|
8969
8969
|
padding: "0 10px",
|
|
8970
8970
|
fontSize: "12px",
|
|
@@ -8974,20 +8974,20 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
8974
8974
|
outline: "none"
|
|
8975
8975
|
},
|
|
8976
8976
|
onChange: (e) => {
|
|
8977
|
-
|
|
8977
|
+
ye(e.target.value), be && xe("");
|
|
8978
8978
|
},
|
|
8979
8979
|
onMouseDown: (e) => e.stopPropagation(),
|
|
8980
8980
|
onKeyDown: (e) => {
|
|
8981
|
-
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), Ye(
|
|
8981
|
+
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), Ye(q) && z(null));
|
|
8982
8982
|
}
|
|
8983
8983
|
})]
|
|
8984
8984
|
}),
|
|
8985
|
-
/* @__PURE__ */
|
|
8985
|
+
/* @__PURE__ */ T("div", {
|
|
8986
8986
|
style: {
|
|
8987
8987
|
display: "flex",
|
|
8988
8988
|
gap: "8px"
|
|
8989
8989
|
},
|
|
8990
|
-
children: [/* @__PURE__ */
|
|
8990
|
+
children: [/* @__PURE__ */ w("button", {
|
|
8991
8991
|
type: "button",
|
|
8992
8992
|
style: {
|
|
8993
8993
|
flex: 1,
|
|
@@ -9003,10 +9003,10 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
9003
9003
|
cursor: "pointer"
|
|
9004
9004
|
},
|
|
9005
9005
|
onMouseDown: (e) => {
|
|
9006
|
-
e.preventDefault(), e.stopPropagation(), Ye(
|
|
9006
|
+
e.preventDefault(), e.stopPropagation(), Ye(q) && z(null);
|
|
9007
9007
|
},
|
|
9008
9008
|
children: "Apply Color"
|
|
9009
|
-
}), /* @__PURE__ */
|
|
9009
|
+
}), /* @__PURE__ */ w("button", {
|
|
9010
9010
|
type: "button",
|
|
9011
9011
|
style: {
|
|
9012
9012
|
width: "32px",
|
|
@@ -9023,26 +9023,26 @@ function Ue({ mode: o, onInsert: s, onClose: c, initialLatex: l, initialDirectio
|
|
|
9023
9023
|
},
|
|
9024
9024
|
title: "Clear color",
|
|
9025
9025
|
onMouseDown: (e) => {
|
|
9026
|
-
e.preventDefault(), e.stopPropagation(), Ye("none"),
|
|
9026
|
+
e.preventDefault(), e.stopPropagation(), Ye("none"), z(null);
|
|
9027
9027
|
},
|
|
9028
9028
|
children: "×"
|
|
9029
9029
|
})]
|
|
9030
9030
|
}),
|
|
9031
|
-
|
|
9031
|
+
be ? /* @__PURE__ */ w("div", {
|
|
9032
9032
|
style: {
|
|
9033
9033
|
fontSize: "10px",
|
|
9034
9034
|
color: "#b91c1c",
|
|
9035
9035
|
lineHeight: 1.2,
|
|
9036
9036
|
marginTop: "-2px"
|
|
9037
9037
|
},
|
|
9038
|
-
children:
|
|
9038
|
+
children: be
|
|
9039
9039
|
}) : null
|
|
9040
9040
|
]
|
|
9041
9041
|
}), document.body)
|
|
9042
9042
|
]
|
|
9043
9043
|
});
|
|
9044
9044
|
}
|
|
9045
|
-
function
|
|
9045
|
+
function Ge(e) {
|
|
9046
9046
|
let t = e, n = t.match(/^\\ce\{([\s\S]*)\}$/);
|
|
9047
9047
|
n && (t = n[1]);
|
|
9048
9048
|
let r = [
|
|
@@ -9136,9 +9136,9 @@ function We(e) {
|
|
|
9136
9136
|
["\\ln", "ln"],
|
|
9137
9137
|
["\\exp", "exp"],
|
|
9138
9138
|
["\\lim", "lim"],
|
|
9139
|
-
...
|
|
9140
|
-
...
|
|
9141
|
-
...
|
|
9139
|
+
...B.map(({ insert: e, label: t }) => [e, t]),
|
|
9140
|
+
...V.map(({ insert: e, label: t }) => [e, t]),
|
|
9141
|
+
...H.map(({ insert: e, label: t }) => [e, t]),
|
|
9142
9142
|
["\\wp", "℘"],
|
|
9143
9143
|
["\\left(", "("],
|
|
9144
9144
|
["\\right)", ")"],
|
|
@@ -9209,41 +9209,60 @@ function We(e) {
|
|
|
9209
9209
|
};
|
|
9210
9210
|
return t = t.replace(/_\{([^}]*)\}/g, (e, t) => t.split("").map((e) => a[e] || e).join("")), t = t.replace(/_([a-zA-Z0-9])/g, (e, t) => a[t] || t), t = t.replace(/->/g, "→"), t = t.replace(/<=>/g, "⇌"), t = t.replace(/\\[a-zA-Z]+/g, ""), t = t.replace(/[{}]/g, ""), t = t.replace(/\s+/g, " "), t = t.replace(/\\\\/g, "\n"), t.trim();
|
|
9211
9211
|
}
|
|
9212
|
-
function
|
|
9213
|
-
|
|
9212
|
+
function Ke(e = "") {
|
|
9213
|
+
if (!e || typeof document > "u") return e || "";
|
|
9214
|
+
let t = document.createElement("template");
|
|
9215
|
+
return t.innerHTML = e, t.content.querySelectorAll(".math-tex").forEach((e) => {
|
|
9216
|
+
e.getAttribute("data-latex") || e.setAttribute("data-latex", e.textContent || ""), e.textContent = "";
|
|
9217
|
+
}), t.innerHTML;
|
|
9218
|
+
}
|
|
9219
|
+
function Q(e) {
|
|
9220
|
+
e && e.querySelectorAll(".math-tex").forEach((e) => {
|
|
9221
|
+
let t = e.getAttribute("data-latex") || e.textContent || "", n = e.getAttribute("data-dir") || "ltr";
|
|
9222
|
+
e.innerHTML = "";
|
|
9223
|
+
let r = document.createElement("math-field");
|
|
9224
|
+
r.setAttribute("read-only", ""), r.setAttribute("math-virtual-keyboard-policy", "manual"), r.setAttribute("tabindex", "-1"), r.setAttribute("letter-shape-style", "upright"), r.setAttribute("dir", n), r.style.display = "inline-block", r.style.width = "auto", r.style.maxWidth = "100%", r.style.verticalAlign = "middle", r.style.border = "none", r.style.background = "transparent", r.style.outline = "none", r.style.fontSize = "inherit", r.style.minHeight = "auto", r.style.padding = "0 2px", r.style.margin = "0", r.style.pointerEvents = "none", r.style.direction = n, r.style.textAlign = n === "rtl" ? "right" : "left", r.style.unicodeBidi = n === "rtl" ? "plaintext" : "normal", r.style.color = "#000000";
|
|
9225
|
+
let i = () => {
|
|
9226
|
+
r.setValue ? r.setValue(t, { silenceNotifications: !0 }) : r.value = t;
|
|
9227
|
+
};
|
|
9228
|
+
customElements.get("math-field") ? i() : customElements.whenDefined("math-field").then(i), e.appendChild(r);
|
|
9229
|
+
});
|
|
9230
|
+
}
|
|
9231
|
+
function qe({ value: l, defaultValue: _ = "", onChange: x, className: S = "", title: C = "custom ck editor", showPreviewButton: E = !0, previewButtonLabel: re = "Preview Question", previewModalTitle: ie = "Question Preview", previewEmptyMessage: k = "Type your question to preview it here." }) {
|
|
9232
|
+
let j = i(null), N = i(!1), [P, ae] = a(null), [F, I] = a(null), [L, R] = a(!1), [z, B] = a(""), V = i(null), H = l !== void 0, [oe, U] = a(() => l ?? _);
|
|
9214
9233
|
t(() => {
|
|
9215
|
-
|
|
9216
|
-
}, [
|
|
9217
|
-
|
|
9218
|
-
}, [
|
|
9234
|
+
N.current = !!P;
|
|
9235
|
+
}, [P]), t(() => {
|
|
9236
|
+
H && U(l ?? "");
|
|
9237
|
+
}, [H, l]), t(() => () => {
|
|
9219
9238
|
window.__ckMathWidgetClickHandler = null;
|
|
9220
9239
|
}, []);
|
|
9221
|
-
let
|
|
9222
|
-
|
|
9223
|
-
}, []),
|
|
9224
|
-
|
|
9225
|
-
let e =
|
|
9240
|
+
let se = e((e) => {
|
|
9241
|
+
I(null), N.current = !0, ae(e);
|
|
9242
|
+
}, []), W = e(() => {
|
|
9243
|
+
N.current = !1, ae(null), I(null);
|
|
9244
|
+
let e = j.current;
|
|
9226
9245
|
e && e.model.change((e) => {
|
|
9227
9246
|
e.setSelection(null);
|
|
9228
9247
|
});
|
|
9229
|
-
}, []), [
|
|
9230
|
-
let n =
|
|
9248
|
+
}, []), [G, ce] = a(!1), K = e((e, { direction: t = "ltr" } = {}) => {
|
|
9249
|
+
let n = j.current;
|
|
9231
9250
|
if (!n || !e?.trim()) return;
|
|
9232
9251
|
let r = {
|
|
9233
9252
|
latex: e.trim(),
|
|
9234
9253
|
dir: t === "rtl" ? "rtl" : "ltr"
|
|
9235
9254
|
};
|
|
9236
|
-
if (
|
|
9237
|
-
let e =
|
|
9255
|
+
if (F) {
|
|
9256
|
+
let e = A(n, F.modelElement) ? F.modelElement : null;
|
|
9238
9257
|
e ? n.model.change((t) => {
|
|
9239
9258
|
let n = t.createElement("mathInline", r), i = t.createPositionBefore(e);
|
|
9240
9259
|
t.insert(n, i), t.remove(e), t.setSelection(t.createPositionAfter(n));
|
|
9241
9260
|
}) : n.model.change((e) => {
|
|
9242
9261
|
let t = e.createElement("mathInline", r);
|
|
9243
9262
|
n.model.insertContent(t);
|
|
9244
|
-
}),
|
|
9245
|
-
} else if (
|
|
9246
|
-
let t =
|
|
9263
|
+
}), I(null);
|
|
9264
|
+
} else if (G) {
|
|
9265
|
+
let t = Ge(e.trim());
|
|
9247
9266
|
if (!t) return;
|
|
9248
9267
|
n.model.change((e) => {
|
|
9249
9268
|
let r = e.createText(t);
|
|
@@ -9254,77 +9273,79 @@ function Ge({ value: c, defaultValue: g = "", onChange: y, className: ie = "", t
|
|
|
9254
9273
|
n.model.insertContent(t), n.model.insertContent(e.createText(" "));
|
|
9255
9274
|
});
|
|
9256
9275
|
n.editing.view.focus();
|
|
9257
|
-
}, [
|
|
9258
|
-
|
|
9276
|
+
}, [G, F]), le = r(() => He(se), [se]), ue = e((e) => {
|
|
9277
|
+
j.current = e;
|
|
9259
9278
|
let t = (e, t, n = "ltr") => {
|
|
9260
9279
|
if (!t) return;
|
|
9261
9280
|
let r = /^\\ce\{/.test(t), i = e?.getAttribute("dir") === "rtl" || n === "rtl" ? "rtl" : "ltr";
|
|
9262
|
-
|
|
9281
|
+
N.current = !0, I({
|
|
9263
9282
|
modelElement: e,
|
|
9264
9283
|
latex: t,
|
|
9265
9284
|
direction: i
|
|
9266
|
-
}),
|
|
9285
|
+
}), ae(r ? "chem" : "math");
|
|
9267
9286
|
};
|
|
9268
9287
|
e.mathWidgetClickHandler = t, window.__ckMathWidgetClickHandler = t;
|
|
9269
9288
|
let n = e.ui.getEditableElement();
|
|
9270
9289
|
if (!n || n._ckMathClickAttached) return;
|
|
9271
9290
|
n._ckMathClickAttached = !0;
|
|
9272
9291
|
let r = (t) => {
|
|
9273
|
-
let n =
|
|
9274
|
-
n && t.button === 0 && (t.preventDefault(), t.stopPropagation(), t.stopImmediatePropagation?.(),
|
|
9292
|
+
let n = D(t.target);
|
|
9293
|
+
n && t.button === 0 && (t.preventDefault(), t.stopPropagation(), t.stopImmediatePropagation?.(), M(e, null, O(n), n));
|
|
9275
9294
|
};
|
|
9276
9295
|
n.addEventListener("mousedown", r, !0), n.addEventListener("click", r, !0);
|
|
9277
|
-
}, []),
|
|
9278
|
-
let e =
|
|
9279
|
-
|
|
9280
|
-
}, [
|
|
9281
|
-
|
|
9296
|
+
}, []), de = e(() => {
|
|
9297
|
+
let e = j.current;
|
|
9298
|
+
B(Ke((e ? e.getData() : oe) || "")), R(!0);
|
|
9299
|
+
}, [oe]), fe = e(() => {
|
|
9300
|
+
R(!1);
|
|
9282
9301
|
}, []);
|
|
9283
9302
|
return t(() => {
|
|
9284
|
-
if (!
|
|
9303
|
+
if (!L) return;
|
|
9285
9304
|
let e = (e) => {
|
|
9286
|
-
e.key === "Escape" &&
|
|
9305
|
+
e.key === "Escape" && R(!1);
|
|
9287
9306
|
};
|
|
9288
9307
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
9289
|
-
}, [
|
|
9290
|
-
|
|
9308
|
+
}, [L]), n(() => {
|
|
9309
|
+
L && Q(V.current);
|
|
9310
|
+
}, [L, z]), /* @__PURE__ */ T("div", {
|
|
9311
|
+
className: `ck-editor-shell ${S}`.trim(),
|
|
9291
9312
|
children: [
|
|
9292
|
-
/* @__PURE__ */
|
|
9293
|
-
(
|
|
9313
|
+
/* @__PURE__ */ w("style", { children: "\n .ck-powered-by { display: none !important; }\n .ck-math-widget {\n display: inline-block !important;\n position: relative !important;\n width: auto !important;\n max-width: 100% !important;\n cursor: pointer !important;\n vertical-align: middle !important;\n }\n .ck-math-widget::after {\n content: '';\n position: absolute;\n inset: 0;\n z-index: 2;\n cursor: pointer;\n }\n .ck-math-widget .ck-math-widget-inner,\n .ck-math-widget math-field {\n display: inline-block !important;\n width: auto !important;\n max-width: 100% !important;\n pointer-events: none !important;\n color: #000000 !important;\n }\n .ck-math-widget[data-dir=\"rtl\"] {\n direction: rtl !important;\n unicode-bidi: plaintext !important;\n }\n .ck-math-widget[data-dir=\"rtl\"] .ck-math-widget-inner,\n .ck-math-widget[data-dir=\"rtl\"] math-field {\n direction: rtl !important;\n text-align: right !important;\n }\n .ck-math-widget:hover,\n .ck-math-widget.ck-widget_selected { outline: 2px solid #0f766e; outline-offset: 1px; border-radius: 4px; }\n " }),
|
|
9314
|
+
(C || E) && /* @__PURE__ */ T("div", {
|
|
9294
9315
|
className: "ck-preview-toolbar",
|
|
9295
|
-
children: [
|
|
9316
|
+
children: [C ? /* @__PURE__ */ w("p", {
|
|
9296
9317
|
className: "ck-preview-toolbar-label",
|
|
9297
|
-
children:
|
|
9298
|
-
}) : null,
|
|
9318
|
+
children: C
|
|
9319
|
+
}) : null, E ? /* @__PURE__ */ w("button", {
|
|
9299
9320
|
id: "ck-preview-question-btn",
|
|
9300
9321
|
type: "button",
|
|
9301
9322
|
className: "ck-preview-trigger",
|
|
9302
|
-
onClick:
|
|
9303
|
-
children: /* @__PURE__ */
|
|
9323
|
+
onClick: de,
|
|
9324
|
+
children: /* @__PURE__ */ w("span", { children: re })
|
|
9304
9325
|
}) : null]
|
|
9305
9326
|
}),
|
|
9306
|
-
/* @__PURE__ */
|
|
9307
|
-
editor:
|
|
9308
|
-
data:
|
|
9309
|
-
onReady:
|
|
9327
|
+
/* @__PURE__ */ w(s, {
|
|
9328
|
+
editor: u,
|
|
9329
|
+
data: oe,
|
|
9330
|
+
onReady: ue,
|
|
9310
9331
|
config: {
|
|
9311
9332
|
licenseKey: "GPL",
|
|
9312
9333
|
plugins: [
|
|
9313
|
-
u,
|
|
9314
|
-
s,
|
|
9315
|
-
f,
|
|
9316
|
-
ne,
|
|
9317
|
-
h,
|
|
9318
9334
|
d,
|
|
9319
|
-
|
|
9320
|
-
|
|
9335
|
+
c,
|
|
9336
|
+
p,
|
|
9337
|
+
ne,
|
|
9338
|
+
g,
|
|
9339
|
+
f,
|
|
9321
9340
|
ee,
|
|
9341
|
+
y,
|
|
9322
9342
|
te,
|
|
9343
|
+
v,
|
|
9344
|
+
h,
|
|
9323
9345
|
m,
|
|
9324
|
-
|
|
9325
|
-
|
|
9326
|
-
|
|
9327
|
-
de
|
|
9346
|
+
b,
|
|
9347
|
+
De,
|
|
9348
|
+
le
|
|
9328
9349
|
],
|
|
9329
9350
|
toolbar: { items: [
|
|
9330
9351
|
"heading",
|
|
@@ -9356,22 +9377,22 @@ function Ge({ value: c, defaultValue: g = "", onChange: y, className: ie = "", t
|
|
|
9356
9377
|
},
|
|
9357
9378
|
onChange: (e, t) => {
|
|
9358
9379
|
let n = t.getData();
|
|
9359
|
-
|
|
9380
|
+
H || U(n), x && x(n);
|
|
9360
9381
|
}
|
|
9361
9382
|
}),
|
|
9362
|
-
|
|
9363
|
-
mode:
|
|
9364
|
-
onInsert:
|
|
9365
|
-
onClose:
|
|
9366
|
-
initialLatex:
|
|
9367
|
-
initialDirection:
|
|
9368
|
-
isEditing: !!
|
|
9383
|
+
P && /* @__PURE__ */ w(We, {
|
|
9384
|
+
mode: P,
|
|
9385
|
+
onInsert: K,
|
|
9386
|
+
onClose: W,
|
|
9387
|
+
initialLatex: F?.latex || "",
|
|
9388
|
+
initialDirection: F?.direction || "ltr",
|
|
9389
|
+
isEditing: !!F
|
|
9369
9390
|
}),
|
|
9370
|
-
|
|
9391
|
+
L && o(/* @__PURE__ */ w("div", {
|
|
9371
9392
|
id: "ck-preview-modal-overlay",
|
|
9372
9393
|
className: "ck-preview-modal-overlay",
|
|
9373
|
-
onClick:
|
|
9374
|
-
children: /* @__PURE__ */
|
|
9394
|
+
onClick: fe,
|
|
9395
|
+
children: /* @__PURE__ */ T("div", {
|
|
9375
9396
|
id: "ck-preview-modal",
|
|
9376
9397
|
className: "ck-preview-modal",
|
|
9377
9398
|
role: "dialog",
|
|
@@ -9379,38 +9400,36 @@ function Ge({ value: c, defaultValue: g = "", onChange: y, className: ie = "", t
|
|
|
9379
9400
|
"aria-labelledby": "ck-preview-modal-title",
|
|
9380
9401
|
onClick: (e) => e.stopPropagation(),
|
|
9381
9402
|
children: [
|
|
9382
|
-
/* @__PURE__ */
|
|
9403
|
+
/* @__PURE__ */ T("div", {
|
|
9383
9404
|
className: "ck-preview-modal-header",
|
|
9384
|
-
children: [/* @__PURE__ */
|
|
9405
|
+
children: [/* @__PURE__ */ w("h2", {
|
|
9385
9406
|
id: "ck-preview-modal-title",
|
|
9386
9407
|
className: "ck-preview-modal-title",
|
|
9387
|
-
children:
|
|
9388
|
-
}), /* @__PURE__ */
|
|
9408
|
+
children: ie
|
|
9409
|
+
}), /* @__PURE__ */ w("button", {
|
|
9389
9410
|
id: "ck-preview-modal-close-x",
|
|
9390
9411
|
type: "button",
|
|
9391
9412
|
className: "ck-preview-modal-icon-button",
|
|
9392
|
-
onClick:
|
|
9413
|
+
onClick: fe,
|
|
9393
9414
|
"aria-label": "Close preview",
|
|
9394
9415
|
children: "×"
|
|
9395
9416
|
})]
|
|
9396
9417
|
}),
|
|
9397
|
-
/* @__PURE__ */
|
|
9418
|
+
/* @__PURE__ */ w("div", {
|
|
9398
9419
|
className: "ck-preview-modal-body",
|
|
9399
|
-
children:
|
|
9420
|
+
children: /* @__PURE__ */ w("div", {
|
|
9421
|
+
ref: V,
|
|
9400
9422
|
className: "ck-preview-render-zone",
|
|
9401
|
-
dangerouslySetInnerHTML: { __html:
|
|
9402
|
-
}) : /* @__PURE__ */ x("p", {
|
|
9403
|
-
className: "ck-preview-empty-state",
|
|
9404
|
-
children: E
|
|
9423
|
+
dangerouslySetInnerHTML: { __html: z }
|
|
9405
9424
|
})
|
|
9406
9425
|
}),
|
|
9407
|
-
/* @__PURE__ */
|
|
9426
|
+
/* @__PURE__ */ w("div", {
|
|
9408
9427
|
className: "ck-preview-modal-footer",
|
|
9409
|
-
children: /* @__PURE__ */
|
|
9428
|
+
children: /* @__PURE__ */ w("button", {
|
|
9410
9429
|
id: "ck-preview-modal-close-btn",
|
|
9411
9430
|
type: "button",
|
|
9412
9431
|
className: "ck-preview-modal-close-button",
|
|
9413
|
-
onClick:
|
|
9432
|
+
onClick: fe,
|
|
9414
9433
|
children: "Close"
|
|
9415
9434
|
})
|
|
9416
9435
|
})
|
|
@@ -9422,6 +9441,6 @@ function Ge({ value: c, defaultValue: g = "", onChange: y, className: ie = "", t
|
|
|
9422
9441
|
}
|
|
9423
9442
|
//#endregion
|
|
9424
9443
|
//#region src/index.js
|
|
9425
|
-
var
|
|
9444
|
+
var Je = qe;
|
|
9426
9445
|
//#endregion
|
|
9427
|
-
export {
|
|
9446
|
+
export { qe as CkEditor, qe as CustomCkEditorPackage, Je as default };
|