@drghaliasri/butex 3.2.2 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/dist/document.js +72 -0
- package/dist/document.js.map +1 -1
- package/dist/document.mjs +72 -0
- package/dist/document.mjs.map +1 -1
- package/dist/document2.d.mts +11 -5
- package/dist/document2.d.ts +11 -5
- package/dist/document2.js +207 -35
- package/dist/document2.js.map +1 -1
- package/dist/document2.mjs +202 -35
- package/dist/document2.mjs.map +1 -1
- package/dist/index.d.mts +81 -4
- package/dist/index.d.ts +81 -4
- package/dist/index.global.js +436 -31
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +436 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +436 -31
- package/dist/index.mjs.map +1 -1
- package/dist/react-document.d.mts +1 -1
- package/dist/react-document.d.ts +1 -1
- package/dist/react-document.js +649 -175
- package/dist/react-document.js.map +1 -1
- package/dist/react-document.mjs +649 -175
- package/dist/react-document.mjs.map +1 -1
- package/dist/react-document2.d.mts +31 -9
- package/dist/react-document2.d.ts +31 -9
- package/dist/react-document2.js +1196 -411
- package/dist/react-document2.js.map +1 -1
- package/dist/react-document2.mjs +1196 -411
- package/dist/react-document2.mjs.map +1 -1
- package/dist/react.d.mts +80 -1
- package/dist/react.d.ts +80 -1
- package/dist/react.js +631 -175
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +631 -175
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react-document.mjs
CHANGED
|
@@ -1125,6 +1125,24 @@ var ATOMIC_OPERATOR_COMMANDS = {
|
|
|
1125
1125
|
title: "\u0623\u0643\u0628\u0631 \u0645\u0646 \u0623\u0648 \u064A\u0633\u0627\u0648\u064A",
|
|
1126
1126
|
svg_path: null
|
|
1127
1127
|
},
|
|
1128
|
+
coloneqq: {
|
|
1129
|
+
id: "coloneqq",
|
|
1130
|
+
category: "operators1",
|
|
1131
|
+
Tex: "\\coloneqq",
|
|
1132
|
+
mirror: true,
|
|
1133
|
+
Label: "\u2254",
|
|
1134
|
+
title: "\u064A\u0639\u0631\u0641 \u0628\u0623\u0646\u0647 \u064A\u0633\u0627\u0648\u064A",
|
|
1135
|
+
svg_path: null
|
|
1136
|
+
},
|
|
1137
|
+
eqqcolon: {
|
|
1138
|
+
id: "eqqcolon",
|
|
1139
|
+
category: "operators1",
|
|
1140
|
+
Tex: "\\eqqcolon",
|
|
1141
|
+
mirror: true,
|
|
1142
|
+
Label: "\u2255",
|
|
1143
|
+
title: "\u064A\u0633\u0627\u0648\u064A \u0628\u0627\u0644\u062A\u0639\u0631\u064A\u0641",
|
|
1144
|
+
svg_path: null
|
|
1145
|
+
},
|
|
1128
1146
|
///// Operators 2
|
|
1129
1147
|
propto: {
|
|
1130
1148
|
id: "propto",
|
|
@@ -1291,6 +1309,60 @@ var ATOMIC_OPERATOR_COMMANDS = {
|
|
|
1291
1309
|
title: "\u064A\u0643\u0627\u0641\u0626",
|
|
1292
1310
|
svg_path: null
|
|
1293
1311
|
},
|
|
1312
|
+
implies: {
|
|
1313
|
+
id: "implies",
|
|
1314
|
+
category: "operators3",
|
|
1315
|
+
Tex: "\\implies",
|
|
1316
|
+
mirror: true,
|
|
1317
|
+
Label: "\u21D2",
|
|
1318
|
+
title: "\u064A\u0633\u062A\u0644\u0632\u0645",
|
|
1319
|
+
svg_path: null
|
|
1320
|
+
},
|
|
1321
|
+
impliedby: {
|
|
1322
|
+
id: "impliedby",
|
|
1323
|
+
category: "operators3",
|
|
1324
|
+
Tex: "\\impliedby",
|
|
1325
|
+
mirror: true,
|
|
1326
|
+
Label: "\u21D0",
|
|
1327
|
+
title: "\u0645\u0633\u062A\u0644\u0632\u0645 \u0645\u0646",
|
|
1328
|
+
svg_path: null
|
|
1329
|
+
},
|
|
1330
|
+
iff: {
|
|
1331
|
+
id: "iff",
|
|
1332
|
+
category: "operators3",
|
|
1333
|
+
Tex: "\\iff",
|
|
1334
|
+
mirror: false,
|
|
1335
|
+
Label: "\u21D4",
|
|
1336
|
+
title: "\u0625\u0630\u0627 \u0648\u0641\u0642\u0637 \u0625\u0630\u0627",
|
|
1337
|
+
svg_path: null
|
|
1338
|
+
},
|
|
1339
|
+
Longrightarrow: {
|
|
1340
|
+
id: "Longrightarrow",
|
|
1341
|
+
category: "operators3",
|
|
1342
|
+
Tex: "\\Longrightarrow",
|
|
1343
|
+
mirror: true,
|
|
1344
|
+
Label: "\u27F9",
|
|
1345
|
+
title: "\u0633\u0647\u0645 \u0645\u0632\u062F\u0648\u062C \u0637\u0648\u064A\u0644 \u0625\u0644\u0649 \u0627\u0644\u064A\u0645\u064A\u0646",
|
|
1346
|
+
svg_path: null
|
|
1347
|
+
},
|
|
1348
|
+
Longleftarrow: {
|
|
1349
|
+
id: "Longleftarrow",
|
|
1350
|
+
category: "operators3",
|
|
1351
|
+
Tex: "\\Longleftarrow",
|
|
1352
|
+
mirror: true,
|
|
1353
|
+
Label: "\u27F8",
|
|
1354
|
+
title: "\u0633\u0647\u0645 \u0645\u0632\u062F\u0648\u062C \u0637\u0648\u064A\u0644 \u0625\u0644\u0649 \u0627\u0644\u064A\u0633\u0627\u0631",
|
|
1355
|
+
svg_path: null
|
|
1356
|
+
},
|
|
1357
|
+
to: {
|
|
1358
|
+
id: "to",
|
|
1359
|
+
category: "operators3",
|
|
1360
|
+
Tex: "\\to",
|
|
1361
|
+
mirror: true,
|
|
1362
|
+
Label: "\u2192",
|
|
1363
|
+
title: "\u064A\u0624\u0648\u0644 \u0625\u0644\u0649",
|
|
1364
|
+
svg_path: null
|
|
1365
|
+
},
|
|
1294
1366
|
rightleftharpoons: {
|
|
1295
1367
|
id: "rightleftharpoons",
|
|
1296
1368
|
category: "operators3",
|
|
@@ -2373,6 +2445,321 @@ function undoRedoCanRedo(stacks) {
|
|
|
2373
2445
|
return stacks.future.length > 0;
|
|
2374
2446
|
}
|
|
2375
2447
|
|
|
2448
|
+
// src/editor/uiLocale.ts
|
|
2449
|
+
var ENGLISH_COMMAND_TITLES = {
|
|
2450
|
+
cos: "Cosine",
|
|
2451
|
+
sin: "Sine",
|
|
2452
|
+
tan: "Tangent",
|
|
2453
|
+
cot: "Cotangent",
|
|
2454
|
+
sec: "Secant",
|
|
2455
|
+
csc: "Cosecant",
|
|
2456
|
+
arccos: "Inverse cosine",
|
|
2457
|
+
arcsin: "Inverse sine",
|
|
2458
|
+
arctan: "Inverse tangent",
|
|
2459
|
+
arccot: "Inverse cotangent",
|
|
2460
|
+
arcsec: "Inverse secant",
|
|
2461
|
+
arccsc: "Inverse cosecant",
|
|
2462
|
+
cosh: "Hyperbolic cosine",
|
|
2463
|
+
sinh: "Hyperbolic sine",
|
|
2464
|
+
tanh: "Hyperbolic tangent",
|
|
2465
|
+
coth: "Hyperbolic cotangent",
|
|
2466
|
+
sum: "Sum",
|
|
2467
|
+
prod: "Product",
|
|
2468
|
+
lim: "Limit",
|
|
2469
|
+
max: "Maximum",
|
|
2470
|
+
min: "Minimum",
|
|
2471
|
+
sup: "Supremum",
|
|
2472
|
+
inf: "Infimum",
|
|
2473
|
+
pi: "Pi",
|
|
2474
|
+
exp: "Exponential",
|
|
2475
|
+
ln: "Natural logarithm",
|
|
2476
|
+
log: "Logarithm",
|
|
2477
|
+
det: "Determinant",
|
|
2478
|
+
N: "Natural numbers",
|
|
2479
|
+
Z: "Integers",
|
|
2480
|
+
Q: "Rational numbers",
|
|
2481
|
+
R: "Real numbers",
|
|
2482
|
+
C: "Complex numbers",
|
|
2483
|
+
H: "Quaternions",
|
|
2484
|
+
negThinSpace: "Negative thin space",
|
|
2485
|
+
mediumSpace: "Medium space",
|
|
2486
|
+
thickSpace: "Thick space",
|
|
2487
|
+
quadSpace: "Large space",
|
|
2488
|
+
qquadSpace: "Extra-large space"
|
|
2489
|
+
};
|
|
2490
|
+
var ENGLISH_OPERATOR_TITLES = {
|
|
2491
|
+
inf: "Infinity",
|
|
2492
|
+
times: "Multiplication",
|
|
2493
|
+
div: "Division",
|
|
2494
|
+
pm: "Plus or minus",
|
|
2495
|
+
mp: "Minus or plus",
|
|
2496
|
+
neq: "Not equal",
|
|
2497
|
+
approx: "Approximately equal",
|
|
2498
|
+
sim: "Similar",
|
|
2499
|
+
mid: "Divides",
|
|
2500
|
+
leq: "Less than or equal",
|
|
2501
|
+
geq: "Greater than or equal",
|
|
2502
|
+
coloneqq: "Defined as equal to",
|
|
2503
|
+
eqqcolon: "Equal by definition",
|
|
2504
|
+
propto: "Proportional to",
|
|
2505
|
+
in: "Element of",
|
|
2506
|
+
notin: "Not an element of",
|
|
2507
|
+
subset: "Subset of",
|
|
2508
|
+
supset: "Superset of",
|
|
2509
|
+
subseteq: "Subset of or equal",
|
|
2510
|
+
supseteq: "Superset of or equal",
|
|
2511
|
+
cap: "Intersection",
|
|
2512
|
+
cup: "Union",
|
|
2513
|
+
emptyset: "Empty set",
|
|
2514
|
+
nsubseteq: "Not a subset of or equal",
|
|
2515
|
+
nsupseteq: "Not a superset of or equal",
|
|
2516
|
+
ldots: "Horizontal dots",
|
|
2517
|
+
cdot: "Multiplication dot",
|
|
2518
|
+
cdots: "Centered horizontal dots",
|
|
2519
|
+
vdots: "Vertical dots",
|
|
2520
|
+
ddots: "Diagonal dots",
|
|
2521
|
+
leftrightarrowDouble: "Equivalent",
|
|
2522
|
+
implies: "Implies",
|
|
2523
|
+
impliedby: "Implied by",
|
|
2524
|
+
iff: "If and only if",
|
|
2525
|
+
Longrightarrow: "Long double arrow right",
|
|
2526
|
+
Longleftarrow: "Long double arrow left",
|
|
2527
|
+
to: "Maps to",
|
|
2528
|
+
rightleftharpoons: "Equilibrium",
|
|
2529
|
+
leftarrow: "Left arrow",
|
|
2530
|
+
rightarrow: "Right arrow",
|
|
2531
|
+
leftarrowDouble: "Double left arrow",
|
|
2532
|
+
rightarrowDouble: "Double right arrow",
|
|
2533
|
+
leftharpoonup: "Upper left harpoon",
|
|
2534
|
+
rightharpoonup: "Upper right harpoon",
|
|
2535
|
+
leftharpoondown: "Lower left harpoon",
|
|
2536
|
+
rightharpoondown: "Lower right harpoon",
|
|
2537
|
+
int: "Integral",
|
|
2538
|
+
iint: "Double integral",
|
|
2539
|
+
iiint: "Triple integral",
|
|
2540
|
+
iiiint: "Quadruple integral",
|
|
2541
|
+
oint: "Contour integral",
|
|
2542
|
+
oiint: "Closed surface integral",
|
|
2543
|
+
oiiint: "Closed volume integral"
|
|
2544
|
+
};
|
|
2545
|
+
var EQUATION_EDITOR_MESSAGES = {
|
|
2546
|
+
ar: {
|
|
2547
|
+
undoRedo: "\u062A\u0631\u0627\u062C\u0639 \u0648\u0625\u0639\u0627\u062F\u0629",
|
|
2548
|
+
undo: "\u062A\u0631\u0627\u062C\u0639",
|
|
2549
|
+
redo: "\u0625\u0639\u0627\u062F\u0629",
|
|
2550
|
+
clipboard: "\u0627\u0644\u062D\u0627\u0641\u0638\u0629",
|
|
2551
|
+
copy: "\u0646\u0633\u062E",
|
|
2552
|
+
cut: "\u0642\u0635",
|
|
2553
|
+
paste: "\u0644\u0635\u0642",
|
|
2554
|
+
editorSettings: "\u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0627\u0644\u0645\u062D\u0631\u0631",
|
|
2555
|
+
toggleSide: "\u062A\u0628\u062F\u064A\u0644 \u0639\u0631\u0628\u064A / \u0625\u0646\u062C\u0644\u064A\u0632\u064A",
|
|
2556
|
+
structures: "\u0627\u0644\u0628\u0646\u0649",
|
|
2557
|
+
insertDelimiters: "\u0625\u062F\u0631\u0627\u062C \u0645\u062D\u062F\u062F\u0627\u062A",
|
|
2558
|
+
insertParentheses: "\u0625\u062F\u0631\u0627\u062C \u0642\u0648\u0633\u064A\u0646",
|
|
2559
|
+
insertBrackets: "\u0625\u062F\u0631\u0627\u062C \u0645\u0639\u0642\u0648\u0641\u064A\u0646",
|
|
2560
|
+
insertBraces: "\u0625\u062F\u0631\u0627\u062C \u062D\u0627\u0635\u0631\u062A\u064A\u0646",
|
|
2561
|
+
insertFraction: "\u0625\u062F\u0631\u0627\u062C \u0643\u0633\u0631",
|
|
2562
|
+
insertRoot: "\u0625\u062F\u0631\u0627\u062C \u062C\u0630\u0631",
|
|
2563
|
+
environments: "\u0627\u0644\u0628\u064A\u0626\u0627\u062A",
|
|
2564
|
+
insertEnvironment: "\u0625\u062F\u0631\u0627\u062C \u0628\u064A\u0626\u0629 \u0634\u0628\u0643\u064A\u0629",
|
|
2565
|
+
environmentType: "\u0646\u0648\u0639 \u0627\u0644\u0628\u064A\u0626\u0629",
|
|
2566
|
+
matrix: "\u0645\u0635\u0641\u0648\u0641\u0629",
|
|
2567
|
+
array: "\u062C\u062F\u0648\u0644",
|
|
2568
|
+
aligned: "\u0645\u062D\u0627\u0630\u0627\u0629",
|
|
2569
|
+
matrixType: "\u0646\u0648\u0639 \u0627\u0644\u0645\u0635\u0641\u0648\u0641\u0629",
|
|
2570
|
+
chooseEnvironmentSize: "\u0627\u062E\u062A\u064A\u0627\u0631 \u062D\u062C\u0645 \u0627\u0644\u0628\u064A\u0626\u0629",
|
|
2571
|
+
rows: "\u0635\u0641\u0648\u0641",
|
|
2572
|
+
columns: "\u0623\u0639\u0645\u062F\u0629",
|
|
2573
|
+
row: "\u0635\u0641",
|
|
2574
|
+
column: "\u0639\u0645\u0648\u062F",
|
|
2575
|
+
insert: "\u0625\u062F\u0631\u0627\u062C",
|
|
2576
|
+
editSelectedEnvironment: "\u062A\u0639\u062F\u064A\u0644 \u0627\u0644\u0628\u064A\u0626\u0629 \u0627\u0644\u0645\u062D\u062F\u062F\u0629",
|
|
2577
|
+
applySelectedMatrixStyle: "\u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0646\u0645\u0637 \u0639\u0644\u0649 \u0627\u0644\u0645\u0635\u0641\u0648\u0641\u0629 \u0627\u0644\u0645\u062D\u062F\u062F\u0629",
|
|
2578
|
+
applyStyle: "\u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0646\u0645\u0637",
|
|
2579
|
+
addRow: "\u0625\u0636\u0627\u0641\u0629 \u0635\u0641",
|
|
2580
|
+
removeRow: "\u062D\u0630\u0641 \u0635\u0641",
|
|
2581
|
+
addColumn: "\u0625\u0636\u0627\u0641\u0629 \u0639\u0645\u0648\u062F",
|
|
2582
|
+
removeColumn: "\u062D\u0630\u0641 \u0639\u0645\u0648\u062F",
|
|
2583
|
+
spaces: "\u0627\u0644\u0641\u0631\u0627\u063A\u0627\u062A",
|
|
2584
|
+
insertSpace: "\u0625\u062F\u0631\u0627\u062C \u0641\u0631\u0627\u063A",
|
|
2585
|
+
functions: "\u0627\u0644\u062F\u0648\u0627\u0644",
|
|
2586
|
+
insertFunction: "\u0625\u062F\u0631\u0627\u062C \u062F\u0627\u0644\u0629",
|
|
2587
|
+
insertLimitsSeries: "\u0625\u062F\u0631\u0627\u062C \u062D\u062F\u0648\u062F \u0648\u0645\u062A\u0633\u0644\u0633\u0644\u0627\u062A",
|
|
2588
|
+
insertAdditionalFunctions: "\u0625\u062F\u0631\u0627\u062C \u062F\u0648\u0627\u0644 \u0625\u0636\u0627\u0641\u064A\u0629",
|
|
2589
|
+
insertNumberSets: "\u0625\u062F\u0631\u0627\u062C \u0645\u062C\u0645\u0648\u0639\u0627\u062A \u0623\u0639\u062F\u0627\u062F",
|
|
2590
|
+
operations: "\u0627\u0644\u0639\u0645\u0644\u064A\u0627\u062A",
|
|
2591
|
+
insertOperation: "\u0625\u062F\u0631\u0627\u062C \u0631\u0645\u0632 \u0639\u0645\u0644\u064A\u0629",
|
|
2592
|
+
insertRelationsSets: "\u0625\u062F\u0631\u0627\u062C \u0631\u0645\u0648\u0632 \u0639\u0644\u0627\u0642\u0627\u062A \u0648\u0645\u062C\u0645\u0648\u0639\u0627\u062A",
|
|
2593
|
+
insertArrows: "\u0625\u062F\u0631\u0627\u062C \u0623\u0633\u0647\u0645",
|
|
2594
|
+
insertDots: "\u0625\u062F\u0631\u0627\u062C \u0646\u0642\u0627\u0637",
|
|
2595
|
+
insertIntegrals: "\u0625\u062F\u0631\u0627\u062C \u062A\u0643\u0627\u0645\u0644\u0627\u062A",
|
|
2596
|
+
scripts: "\u0627\u0644\u0623\u0633 \u0648\u0627\u0644\u0633\u0641\u0644\u064A",
|
|
2597
|
+
addSuperscript: "\u0625\u0636\u0627\u0641\u0629 \u0623\u0633",
|
|
2598
|
+
addSubscript: "\u0625\u0636\u0627\u0641\u0629 \u0633\u0641\u0644\u064A",
|
|
2599
|
+
removeSuperscript: "\u0625\u0632\u0627\u0644\u0629 \u0627\u0644\u0623\u0633",
|
|
2600
|
+
removeSubscript: "\u0625\u0632\u0627\u0644\u0629 \u0627\u0644\u0633\u0641\u0644\u064A",
|
|
2601
|
+
inputStyles: "\u0623\u0646\u0645\u0627\u0637 \u0627\u0644\u0625\u062F\u062E\u0627\u0644",
|
|
2602
|
+
deleteSelectedStructure: "\u062D\u0630\u0641 \u0627\u0644\u0628\u0646\u064A\u0629 \u0627\u0644\u0645\u062D\u062F\u062F\u0629",
|
|
2603
|
+
toggleLetterMerging: "\u062A\u0628\u062F\u064A\u0644 \u062F\u0645\u062C \u0627\u0644\u062D\u0631\u0648\u0641",
|
|
2604
|
+
disableLetterMerging: "\u062A\u0639\u0637\u064A\u0644 \u062F\u0645\u062C \u0627\u0644\u062D\u0631\u0648\u0641",
|
|
2605
|
+
enableLetterMerging: "\u062A\u0641\u0639\u064A\u0644 \u062F\u0645\u062C \u0627\u0644\u062D\u0631\u0648\u0641",
|
|
2606
|
+
chooseWritingFont: "\u0627\u062E\u062A\u064A\u0627\u0631 \u062E\u0637 \u0627\u0644\u0643\u062A\u0627\u0628\u0629",
|
|
2607
|
+
chooseDigitForm: "\u0627\u062E\u062A\u064A\u0627\u0631 \u0634\u0643\u0644 \u0627\u0644\u0623\u0631\u0642\u0627\u0645",
|
|
2608
|
+
defaultFont: "\u0627\u0644\u062E\u0637 \u0627\u0644\u0627\u0641\u062A\u0631\u0627\u0636\u064A",
|
|
2609
|
+
takweenFont: "\u062E\u0637 \u062A\u0643\u0648\u064A\u0646",
|
|
2610
|
+
diwaniFont: "\u062E\u0637 \u062F\u064A\u0648\u0627\u0646\u064A",
|
|
2611
|
+
diwaniOutlineFont: "\u062E\u0637 \u062F\u064A\u0648\u0627\u0646\u064A \u0645\u0638\u0644\u0644",
|
|
2612
|
+
writeDefaultFont: "\u0627\u0644\u0643\u062A\u0627\u0628\u0629 \u0628\u0627\u0644\u062E\u0637 \u0627\u0644\u0627\u0641\u062A\u0631\u0627\u0636\u064A",
|
|
2613
|
+
writeTakweenFont: "\u0627\u0644\u0643\u062A\u0627\u0628\u0629 \u0628\u062E\u0637 \u062A\u0643\u0648\u064A\u0646",
|
|
2614
|
+
westernDigits: "\u0623\u0631\u0642\u0627\u0645 \u063A\u0631\u0628\u064A\u0629",
|
|
2615
|
+
arabicIndicDigits: "\u0623\u0631\u0642\u0627\u0645 \u0639\u0631\u0628\u064A\u0629 \u0647\u0646\u062F\u064A\u0629",
|
|
2616
|
+
persianIndicDigits: "\u0623\u0631\u0642\u0627\u0645 \u0641\u0627\u0631\u0633\u064A\u0629 \u0647\u0646\u062F\u064A\u0629",
|
|
2617
|
+
equationEditor: "\u0645\u062D\u0631\u0631 \u0627\u0644\u0645\u0639\u0627\u062F\u0644\u0627\u062A",
|
|
2618
|
+
renderPreview: "\u0645\u0639\u0627\u064A\u0646\u0629 \u0627\u0644\u0631\u0633\u0645",
|
|
2619
|
+
development: "\u062A\u0637\u0648\u064A\u0631",
|
|
2620
|
+
showDebugLog: "\u0625\u0638\u0647\u0627\u0631 \u0633\u062C\u0644 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",
|
|
2621
|
+
hideDebugLog: "\u0625\u062E\u0641\u0627\u0621 \u0633\u062C\u0644 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",
|
|
2622
|
+
copyDebugLog: "\u0646\u0633\u062E \u0633\u062C\u0644 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",
|
|
2623
|
+
empty: "\u0641\u0627\u0631\u063A",
|
|
2624
|
+
englishLatex: "LaTeX \u0625\u0646\u062C\u0644\u064A\u0632\u064A",
|
|
2625
|
+
arabicLatex: "LaTeX \u0639\u0631\u0628\u064A",
|
|
2626
|
+
inactiveEnglish: "\u0627\u0644\u0633\u0644\u0633\u0644\u0629 \u063A\u064A\u0631 \u0627\u0644\u0646\u0634\u0637\u0629 (\u0625\u0646\u062C\u0644\u064A\u0632\u064A)",
|
|
2627
|
+
inactiveArabic: "\u0627\u0644\u0633\u0644\u0633\u0644\u0629 \u063A\u064A\u0631 \u0627\u0644\u0646\u0634\u0637\u0629 (\u0639\u0631\u0628\u064A)",
|
|
2628
|
+
mathJaxError: "\u062E\u0637\u0623 MathJax",
|
|
2629
|
+
previewError: "\u062E\u0637\u0623 \u0641\u064A \u0627\u0644\u0645\u0639\u0627\u064A\u0646\u0629",
|
|
2630
|
+
activeSide: "\u0627\u0644\u062C\u0627\u0646\u0628 \u0627\u0644\u0646\u0634\u0637",
|
|
2631
|
+
syncState: "\u062D\u0627\u0644\u0629 \u0627\u0644\u0645\u0632\u0627\u0645\u0646\u0629",
|
|
2632
|
+
arabicSide: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629",
|
|
2633
|
+
englishSide: "\u0627\u0644\u0625\u0646\u062C\u0644\u064A\u0632\u064A\u0629",
|
|
2634
|
+
synced: "\u0645\u062A\u0632\u0627\u0645\u0646",
|
|
2635
|
+
differentItems: "\u0639\u0646\u0627\u0635\u0631 \u0645\u062E\u062A\u0644\u0641\u0629",
|
|
2636
|
+
alignLeft: "\u064A\u0633\u0627\u0631",
|
|
2637
|
+
alignCenter: "\u0648\u0633\u0637",
|
|
2638
|
+
alignRight: "\u064A\u0645\u064A\u0646",
|
|
2639
|
+
alignColumnLeft: "\u0645\u062D\u0627\u0630\u0627\u0629 \u0627\u0644\u0639\u0645\u0648\u062F \u0625\u0644\u0649 \u0627\u0644\u064A\u0633\u0627\u0631",
|
|
2640
|
+
alignColumnCenter: "\u0645\u062D\u0627\u0630\u0627\u0629 \u0627\u0644\u0639\u0645\u0648\u062F \u0641\u064A \u0627\u0644\u0648\u0633\u0637",
|
|
2641
|
+
alignColumnRight: "\u0645\u062D\u0627\u0630\u0627\u0629 \u0627\u0644\u0639\u0645\u0648\u062F \u0625\u0644\u0649 \u0627\u0644\u064A\u0645\u064A\u0646",
|
|
2642
|
+
matrixNoDelimiters: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u0644\u0627 \u0623\u0642\u0648\u0627\u0633",
|
|
2643
|
+
matrixParentheses: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u064A\u0646 \u0642\u0648\u0633\u064A\u0646",
|
|
2644
|
+
matrixBrackets: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u064A\u0646 \u0645\u0639\u0642\u0648\u0641\u064A\u0646",
|
|
2645
|
+
matrixBraces: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u064A\u0646 \u062D\u0627\u0635\u0631\u062A\u064A\u0646",
|
|
2646
|
+
matrixBars: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u064A\u0646 \u062E\u0637\u064A\u0646",
|
|
2647
|
+
matrixDoubleBars: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u064A\u0646 \u062E\u0637\u064A\u0646 \u0645\u0632\u062F\u0648\u062C\u064A\u0646"
|
|
2648
|
+
},
|
|
2649
|
+
en: {
|
|
2650
|
+
undoRedo: "Undo and redo",
|
|
2651
|
+
undo: "Undo",
|
|
2652
|
+
redo: "Redo",
|
|
2653
|
+
clipboard: "Clipboard",
|
|
2654
|
+
copy: "Copy",
|
|
2655
|
+
cut: "Cut",
|
|
2656
|
+
paste: "Paste",
|
|
2657
|
+
editorSettings: "Editor settings",
|
|
2658
|
+
toggleSide: "Switch Arabic / English equation side",
|
|
2659
|
+
structures: "Structures",
|
|
2660
|
+
insertDelimiters: "Insert delimiters",
|
|
2661
|
+
insertParentheses: "Insert parentheses",
|
|
2662
|
+
insertBrackets: "Insert brackets",
|
|
2663
|
+
insertBraces: "Insert braces",
|
|
2664
|
+
insertFraction: "Insert fraction",
|
|
2665
|
+
insertRoot: "Insert root",
|
|
2666
|
+
environments: "Environments",
|
|
2667
|
+
insertEnvironment: "Insert grid environment",
|
|
2668
|
+
environmentType: "Environment type",
|
|
2669
|
+
matrix: "Matrix",
|
|
2670
|
+
array: "Array",
|
|
2671
|
+
aligned: "Aligned",
|
|
2672
|
+
matrixType: "Matrix type",
|
|
2673
|
+
chooseEnvironmentSize: "Choose environment size",
|
|
2674
|
+
rows: "Rows",
|
|
2675
|
+
columns: "Columns",
|
|
2676
|
+
row: "Row",
|
|
2677
|
+
column: "Column",
|
|
2678
|
+
insert: "Insert",
|
|
2679
|
+
editSelectedEnvironment: "Edit selected environment",
|
|
2680
|
+
applySelectedMatrixStyle: "Apply style to selected matrix",
|
|
2681
|
+
applyStyle: "Apply style",
|
|
2682
|
+
addRow: "Add row",
|
|
2683
|
+
removeRow: "Remove row",
|
|
2684
|
+
addColumn: "Add column",
|
|
2685
|
+
removeColumn: "Remove column",
|
|
2686
|
+
spaces: "Spacing",
|
|
2687
|
+
insertSpace: "Insert space",
|
|
2688
|
+
functions: "Functions",
|
|
2689
|
+
insertFunction: "Insert function",
|
|
2690
|
+
insertLimitsSeries: "Insert limits and series",
|
|
2691
|
+
insertAdditionalFunctions: "Insert additional functions",
|
|
2692
|
+
insertNumberSets: "Insert number sets",
|
|
2693
|
+
operations: "Operators",
|
|
2694
|
+
insertOperation: "Insert operator",
|
|
2695
|
+
insertRelationsSets: "Insert relation or set symbol",
|
|
2696
|
+
insertArrows: "Insert arrow",
|
|
2697
|
+
insertDots: "Insert dots",
|
|
2698
|
+
insertIntegrals: "Insert integral",
|
|
2699
|
+
scripts: "Superscript and subscript",
|
|
2700
|
+
addSuperscript: "Add superscript",
|
|
2701
|
+
addSubscript: "Add subscript",
|
|
2702
|
+
removeSuperscript: "Remove superscript",
|
|
2703
|
+
removeSubscript: "Remove subscript",
|
|
2704
|
+
inputStyles: "Input styles",
|
|
2705
|
+
deleteSelectedStructure: "Delete selected structure",
|
|
2706
|
+
toggleLetterMerging: "Toggle letter merging",
|
|
2707
|
+
disableLetterMerging: "Disable letter merging",
|
|
2708
|
+
enableLetterMerging: "Enable letter merging",
|
|
2709
|
+
chooseWritingFont: "Choose writing font",
|
|
2710
|
+
chooseDigitForm: "Choose digit form",
|
|
2711
|
+
defaultFont: "Default font",
|
|
2712
|
+
takweenFont: "Takween font",
|
|
2713
|
+
diwaniFont: "Diwani font",
|
|
2714
|
+
diwaniOutlineFont: "Outlined Diwani font",
|
|
2715
|
+
writeDefaultFont: "Write with the default font",
|
|
2716
|
+
writeTakweenFont: "Write with Takween font",
|
|
2717
|
+
westernDigits: "Western digits",
|
|
2718
|
+
arabicIndicDigits: "Arabic-Indic digits",
|
|
2719
|
+
persianIndicDigits: "Persian digits",
|
|
2720
|
+
equationEditor: "Equation editor",
|
|
2721
|
+
renderPreview: "Rendered preview",
|
|
2722
|
+
development: "Development",
|
|
2723
|
+
showDebugLog: "Show debug log",
|
|
2724
|
+
hideDebugLog: "Hide debug log",
|
|
2725
|
+
copyDebugLog: "Copy debug log",
|
|
2726
|
+
empty: "Empty",
|
|
2727
|
+
englishLatex: "English LaTeX",
|
|
2728
|
+
arabicLatex: "Arabic LaTeX",
|
|
2729
|
+
inactiveEnglish: "Inactive chain (English)",
|
|
2730
|
+
inactiveArabic: "Inactive chain (Arabic)",
|
|
2731
|
+
mathJaxError: "MathJax error",
|
|
2732
|
+
previewError: "Preview error",
|
|
2733
|
+
activeSide: "Active side",
|
|
2734
|
+
syncState: "Sync state",
|
|
2735
|
+
arabicSide: "Arabic",
|
|
2736
|
+
englishSide: "English",
|
|
2737
|
+
synced: "Synced",
|
|
2738
|
+
differentItems: "different items",
|
|
2739
|
+
alignLeft: "Left",
|
|
2740
|
+
alignCenter: "Center",
|
|
2741
|
+
alignRight: "Right",
|
|
2742
|
+
alignColumnLeft: "Align column left",
|
|
2743
|
+
alignColumnCenter: "Align column center",
|
|
2744
|
+
alignColumnRight: "Align column right",
|
|
2745
|
+
matrixNoDelimiters: "Matrix without delimiters",
|
|
2746
|
+
matrixParentheses: "Matrix in parentheses",
|
|
2747
|
+
matrixBrackets: "Matrix in brackets",
|
|
2748
|
+
matrixBraces: "Matrix in braces",
|
|
2749
|
+
matrixBars: "Matrix between bars",
|
|
2750
|
+
matrixDoubleBars: "Matrix between double bars"
|
|
2751
|
+
}
|
|
2752
|
+
};
|
|
2753
|
+
function equationEditorMessages(locale) {
|
|
2754
|
+
return EQUATION_EDITOR_MESSAGES[locale];
|
|
2755
|
+
}
|
|
2756
|
+
function atomicCommandTitle(spec, locale) {
|
|
2757
|
+
return locale === "en" ? ENGLISH_COMMAND_TITLES[spec.id] ?? spec.title : spec.title;
|
|
2758
|
+
}
|
|
2759
|
+
function atomicOperatorCommandTitle(spec, locale) {
|
|
2760
|
+
return locale === "en" ? ENGLISH_OPERATOR_TITLES[spec.id] ?? spec.title : spec.title;
|
|
2761
|
+
}
|
|
2762
|
+
|
|
2376
2763
|
// src/editor/state.ts
|
|
2377
2764
|
function ensureSyncEntry(session, nodeId) {
|
|
2378
2765
|
if (!session.sync[nodeId]) {
|
|
@@ -4069,8 +4456,8 @@ function spacingArrowForSide(spec, side) {
|
|
|
4069
4456
|
}
|
|
4070
4457
|
return side === "arabic" ? "\u2192" : "\u2190";
|
|
4071
4458
|
}
|
|
4072
|
-
function spacingTooltipForSide(spec, side) {
|
|
4073
|
-
return `${spec
|
|
4459
|
+
function spacingTooltipForSide(spec, side, uiLocale = "ar") {
|
|
4460
|
+
return `${atomicCommandTitle(spec, uiLocale)} ${spacingArrowForSide(spec, side).repeat(spec.spacing.level)}`;
|
|
4074
4461
|
}
|
|
4075
4462
|
function buildFunctionAtomicCommandBody(node, side, spec) {
|
|
4076
4463
|
const value = document.createElement("span");
|
|
@@ -4094,19 +4481,19 @@ function buildFunctionAtomicCommandBody(node, side, spec) {
|
|
|
4094
4481
|
value.textContent = side === "arabic" ? spec?.arabicLabel ?? node.expr : spec?.englishTex.replace("\\", "") ?? node.expr;
|
|
4095
4482
|
return value;
|
|
4096
4483
|
}
|
|
4097
|
-
function buildSpacingAtomicCommandBody(spec, side) {
|
|
4484
|
+
function buildSpacingAtomicCommandBody(spec, side, uiLocale) {
|
|
4098
4485
|
const value = document.createElement("span");
|
|
4099
4486
|
value.className = `atomic-spacing atomic-spacing--${spec.spacing.direction} atomic-spacing--level-${String(spec.spacing.level)}`;
|
|
4100
|
-
value.title = spacingTooltipForSide(spec, side);
|
|
4487
|
+
value.title = spacingTooltipForSide(spec, side, uiLocale);
|
|
4101
4488
|
const marker = document.createElement("span");
|
|
4102
4489
|
marker.className = "atomic-spacing__marker";
|
|
4103
4490
|
value.appendChild(marker);
|
|
4104
4491
|
return value;
|
|
4105
4492
|
}
|
|
4106
|
-
function buildAtomicCommandNodeBody(node, side) {
|
|
4493
|
+
function buildAtomicCommandNodeBody(node, side, uiLocale = "ar") {
|
|
4107
4494
|
const spec = atomicCommandSpec(node.expr);
|
|
4108
4495
|
if (isSpacingCommandSpec(spec)) {
|
|
4109
|
-
return buildSpacingAtomicCommandBody(spec, side);
|
|
4496
|
+
return buildSpacingAtomicCommandBody(spec, side, uiLocale);
|
|
4110
4497
|
}
|
|
4111
4498
|
return buildFunctionAtomicCommandBody(node, side, spec);
|
|
4112
4499
|
}
|
|
@@ -4140,11 +4527,11 @@ function buildOperatorLabel(spec) {
|
|
|
4140
4527
|
value.textContent = spec.Label;
|
|
4141
4528
|
return value;
|
|
4142
4529
|
}
|
|
4143
|
-
function buildAtomicOperatorCommandNodeBody(node, side) {
|
|
4530
|
+
function buildAtomicOperatorCommandNodeBody(node, side, uiLocale = "ar") {
|
|
4144
4531
|
const spec = atomicOperatorCommandSpec(node.expr);
|
|
4145
4532
|
const value = document.createElement("span");
|
|
4146
4533
|
value.className = "atomic-operator-command";
|
|
4147
|
-
value.title = spec
|
|
4534
|
+
value.title = spec ? atomicOperatorCommandTitle(spec, uiLocale) : node.expr;
|
|
4148
4535
|
if (side === "arabic" && shouldMirrorOperatorDisplay(spec)) {
|
|
4149
4536
|
value.classList.add("atomic-operator-command--mirrored");
|
|
4150
4537
|
}
|
|
@@ -4198,7 +4585,7 @@ function buildNodeScripts(node, buildChain) {
|
|
|
4198
4585
|
}
|
|
4199
4586
|
|
|
4200
4587
|
// src/editor/display/index.ts
|
|
4201
|
-
function buildNodeBody(node, buildChain, side, digitForm = "western") {
|
|
4588
|
+
function buildNodeBody(node, buildChain, side, digitForm = "western", uiLocale = "ar") {
|
|
4202
4589
|
if (node.kind === "delimiter") {
|
|
4203
4590
|
return buildDelimiterNodeBody(node, buildChain);
|
|
4204
4591
|
}
|
|
@@ -4212,10 +4599,10 @@ function buildNodeBody(node, buildChain, side, digitForm = "western") {
|
|
|
4212
4599
|
return buildMatrixEnvNodeBody(node, buildChain, side);
|
|
4213
4600
|
}
|
|
4214
4601
|
if (node.kind === "atomicCommand") {
|
|
4215
|
-
return buildAtomicCommandNodeBody(node, side);
|
|
4602
|
+
return buildAtomicCommandNodeBody(node, side, uiLocale);
|
|
4216
4603
|
}
|
|
4217
4604
|
if (node.kind === "atomicOperatorCommand") {
|
|
4218
|
-
return buildAtomicOperatorCommandNodeBody(node, side);
|
|
4605
|
+
return buildAtomicOperatorCommandNodeBody(node, side, uiLocale);
|
|
4219
4606
|
}
|
|
4220
4607
|
return buildBaseNodeBody(node, digitForm);
|
|
4221
4608
|
}
|
|
@@ -4436,6 +4823,10 @@ function createEditorRuntime(options) {
|
|
|
4436
4823
|
const buttonElements = options.buttonElements ?? {};
|
|
4437
4824
|
const outsidePointerIgnoreSelectors = options.outsidePointerIgnoreSelectors ?? [];
|
|
4438
4825
|
let session = options.initialSession ?? createStarterSession();
|
|
4826
|
+
let uiLocale = options.uiLocale ?? "ar";
|
|
4827
|
+
if (options.defaultSide) {
|
|
4828
|
+
session = { ...session, activeSide: options.defaultSide };
|
|
4829
|
+
}
|
|
4439
4830
|
const undoRedo = createUndoRedoStacks();
|
|
4440
4831
|
let lastInternalFragment = null;
|
|
4441
4832
|
let initialKeyboardFocusPending = true;
|
|
@@ -4467,14 +4858,15 @@ function createEditorRuntime(options) {
|
|
|
4467
4858
|
return index >= start && index < end;
|
|
4468
4859
|
}
|
|
4469
4860
|
function refreshUndoRedoButtons() {
|
|
4861
|
+
const messages = equationEditorMessages(uiLocale);
|
|
4470
4862
|
if (buttonElements.undoBtn) {
|
|
4471
4863
|
buttonElements.undoBtn.disabled = !undoRedoCanUndo(undoRedo);
|
|
4472
4864
|
const arabicEquation = session.activeSide === "arabic";
|
|
4473
4865
|
const undoArrow = arabicEquation ? "\u21B7" : "\u21B6";
|
|
4474
4866
|
const vs = "\uFE0E";
|
|
4475
4867
|
buttonElements.undoBtn.textContent = `${undoArrow}${vs}`;
|
|
4476
|
-
buttonElements.undoBtn.title =
|
|
4477
|
-
buttonElements.undoBtn.setAttribute("aria-label",
|
|
4868
|
+
buttonElements.undoBtn.title = messages.undo;
|
|
4869
|
+
buttonElements.undoBtn.setAttribute("aria-label", messages.undo);
|
|
4478
4870
|
}
|
|
4479
4871
|
if (buttonElements.redoBtn) {
|
|
4480
4872
|
buttonElements.redoBtn.disabled = !undoRedoCanRedo(undoRedo);
|
|
@@ -4482,8 +4874,8 @@ function createEditorRuntime(options) {
|
|
|
4482
4874
|
const redoArrow = arabicEquation ? "\u21B6" : "\u21B7";
|
|
4483
4875
|
const vs = "\uFE0E";
|
|
4484
4876
|
buttonElements.redoBtn.textContent = `${redoArrow}${vs}`;
|
|
4485
|
-
buttonElements.redoBtn.title =
|
|
4486
|
-
buttonElements.redoBtn.setAttribute("aria-label",
|
|
4877
|
+
buttonElements.redoBtn.title = messages.redo;
|
|
4878
|
+
buttonElements.redoBtn.setAttribute("aria-label", messages.redo);
|
|
4487
4879
|
}
|
|
4488
4880
|
}
|
|
4489
4881
|
function refreshClipboardButtons() {
|
|
@@ -4502,9 +4894,10 @@ function createEditorRuntime(options) {
|
|
|
4502
4894
|
return;
|
|
4503
4895
|
}
|
|
4504
4896
|
const mergeOn = !session.splitLeafTyping;
|
|
4897
|
+
const messages = equationEditorMessages(uiLocale);
|
|
4505
4898
|
buttonElements.splitTypingBtn.textContent = mergeOn ? "\u0633\u0635\u0639" : "\u0633 \u0635 \u0639";
|
|
4506
|
-
buttonElements.splitTypingBtn.title = mergeOn ?
|
|
4507
|
-
buttonElements.splitTypingBtn.setAttribute("aria-label", mergeOn ?
|
|
4899
|
+
buttonElements.splitTypingBtn.title = mergeOn ? messages.disableLetterMerging : messages.enableLetterMerging;
|
|
4900
|
+
buttonElements.splitTypingBtn.setAttribute("aria-label", mergeOn ? messages.disableLetterMerging : messages.enableLetterMerging);
|
|
4508
4901
|
buttonElements.splitTypingBtn.setAttribute("aria-pressed", mergeOn ? "true" : "false");
|
|
4509
4902
|
buttonElements.splitTypingBtn.classList.toggle("accent", mergeOn);
|
|
4510
4903
|
}
|
|
@@ -4513,9 +4906,10 @@ function createEditorRuntime(options) {
|
|
|
4513
4906
|
return;
|
|
4514
4907
|
}
|
|
4515
4908
|
const takweenOn = (session.currentCharacterFont ?? "default") === "takween";
|
|
4909
|
+
const messages = equationEditorMessages(uiLocale);
|
|
4516
4910
|
buttonElements.characterFontBtn.textContent = "\u062A\u0643";
|
|
4517
|
-
buttonElements.characterFontBtn.title = takweenOn ?
|
|
4518
|
-
buttonElements.characterFontBtn.setAttribute("aria-label", takweenOn ?
|
|
4911
|
+
buttonElements.characterFontBtn.title = takweenOn ? messages.writeDefaultFont : messages.writeTakweenFont;
|
|
4912
|
+
buttonElements.characterFontBtn.setAttribute("aria-label", takweenOn ? messages.writeDefaultFont : messages.writeTakweenFont);
|
|
4519
4913
|
buttonElements.characterFontBtn.setAttribute("aria-pressed", takweenOn ? "true" : "false");
|
|
4520
4914
|
buttonElements.characterFontBtn.classList.toggle("accent", takweenOn);
|
|
4521
4915
|
}
|
|
@@ -4526,8 +4920,9 @@ function createEditorRuntime(options) {
|
|
|
4526
4920
|
const digitForm = session.currentDigitForm ?? "western";
|
|
4527
4921
|
const label = digitForm === "arabicIndic" ? "\u0664\u0665\u0666" : digitForm === "persianIndic" ? "\u06F4\u06F5\u06F6" : "456";
|
|
4528
4922
|
buttonElements.digitFormBtn.textContent = label;
|
|
4529
|
-
|
|
4530
|
-
buttonElements.digitFormBtn.
|
|
4923
|
+
const messages = equationEditorMessages(uiLocale);
|
|
4924
|
+
buttonElements.digitFormBtn.title = messages.chooseDigitForm;
|
|
4925
|
+
buttonElements.digitFormBtn.setAttribute("aria-label", messages.chooseDigitForm);
|
|
4531
4926
|
buttonElements.digitFormBtn.dataset.digitForm = digitForm;
|
|
4532
4927
|
}
|
|
4533
4928
|
function applyStructural(updater) {
|
|
@@ -4729,7 +5124,7 @@ function createEditorRuntime(options) {
|
|
|
4729
5124
|
const atomicSpec = node.kind === "atomicCommand" ? atomicCommandSpec(node.expr) : null;
|
|
4730
5125
|
if (isSpacingCommandSpec(atomicSpec)) {
|
|
4731
5126
|
nodeEl.classList.add("node--atomic-spacing");
|
|
4732
|
-
nodeEl.title = spacingTooltipForSide(atomicSpec, session.activeSide);
|
|
5127
|
+
nodeEl.title = spacingTooltipForSide(atomicSpec, session.activeSide, uiLocale);
|
|
4733
5128
|
}
|
|
4734
5129
|
if (session.selectedNodeId === node.id || session.selectedStructureNodeId === node.id) {
|
|
4735
5130
|
nodeEl.classList.add("selected");
|
|
@@ -4759,7 +5154,7 @@ function createEditorRuntime(options) {
|
|
|
4759
5154
|
});
|
|
4760
5155
|
const body = document.createElement("span");
|
|
4761
5156
|
body.className = "node-body";
|
|
4762
|
-
body.appendChild(buildNodeBody(node, buildChain, session.activeSide, session.currentDigitForm ?? "western"));
|
|
5157
|
+
body.appendChild(buildNodeBody(node, buildChain, session.activeSide, session.currentDigitForm ?? "western", uiLocale));
|
|
4763
5158
|
nodeEl.appendChild(body);
|
|
4764
5159
|
const scripts = buildNodeScripts(node, buildChain);
|
|
4765
5160
|
if (scripts) {
|
|
@@ -5040,6 +5435,13 @@ function createEditorRuntime(options) {
|
|
|
5040
5435
|
session = next;
|
|
5041
5436
|
render();
|
|
5042
5437
|
},
|
|
5438
|
+
setUiLocale: (locale) => {
|
|
5439
|
+
if (uiLocale === locale) {
|
|
5440
|
+
return;
|
|
5441
|
+
}
|
|
5442
|
+
uiLocale = locale;
|
|
5443
|
+
render();
|
|
5444
|
+
},
|
|
5043
5445
|
performUndo,
|
|
5044
5446
|
performRedo,
|
|
5045
5447
|
performCopy,
|
|
@@ -7289,18 +7691,23 @@ function injectWidgetChromeCss(doc) {
|
|
|
7289
7691
|
d.head.appendChild(style);
|
|
7290
7692
|
}
|
|
7291
7693
|
|
|
7694
|
+
// src/uiLocale.ts
|
|
7695
|
+
function uiLocaleDirection(locale) {
|
|
7696
|
+
return locale === "ar" ? "rtl" : "ltr";
|
|
7697
|
+
}
|
|
7698
|
+
|
|
7292
7699
|
// src/react/ButexEditor.tsx
|
|
7293
7700
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7294
7701
|
var DIGIT_FORM_OPTIONS = [
|
|
7295
|
-
{ id: "western", label: "456"
|
|
7296
|
-
{ id: "arabicIndic", label: "\u0664\u0665\u0666"
|
|
7297
|
-
{ id: "persianIndic", label: "\u06F4\u06F5\u06F6"
|
|
7702
|
+
{ id: "western", label: "456" },
|
|
7703
|
+
{ id: "arabicIndic", label: "\u0664\u0665\u0666" },
|
|
7704
|
+
{ id: "persianIndic", label: "\u06F4\u06F5\u06F6" }
|
|
7298
7705
|
];
|
|
7299
7706
|
var CHARACTER_FONT_OPTIONS = [
|
|
7300
|
-
{ id: "default", label: "\u0633"
|
|
7301
|
-
{ id: "takween", label: "\u062A\u0643"
|
|
7302
|
-
{ id: "diwani", label: "\u062F\u064A\u0648"
|
|
7303
|
-
{ id: "diwaniOutline", label: "\u0638\u0644"
|
|
7707
|
+
{ id: "default", label: "\u0633" },
|
|
7708
|
+
{ id: "takween", label: "\u062A\u0643" },
|
|
7709
|
+
{ id: "diwani", label: "\u062F\u064A\u0648" },
|
|
7710
|
+
{ id: "diwaniOutline", label: "\u0638\u0644" }
|
|
7304
7711
|
];
|
|
7305
7712
|
var FUNCTION_COMMANDS = atomicCommandsByCategory("function");
|
|
7306
7713
|
var LIMITS_SERIES_COMMANDS = atomicCommandsByCategory("limits_series");
|
|
@@ -7313,20 +7720,20 @@ var OPERATOR3_COMMANDS = atomicOperatorCommandsByCategory("operators3");
|
|
|
7313
7720
|
var DOT_COMMANDS = atomicOperatorCommandsByCategory("dots");
|
|
7314
7721
|
var INTEGRAL_COMMANDS = atomicOperatorCommandsByCategory("integrals");
|
|
7315
7722
|
var MATRIX_STYLES = [
|
|
7316
|
-
{ id: "matrix", label: "\u25A1"
|
|
7317
|
-
{ id: "pmatrix", label: "(\u25A1)"
|
|
7318
|
-
{ id: "bmatrix", label: "[\u25A1]"
|
|
7319
|
-
{ id: "Bmatrix", label: "{\u25A1}"
|
|
7320
|
-
{ id: "vmatrix", label: "|\u25A1|"
|
|
7321
|
-
{ id: "Vmatrix", label: "||\u25A1||"
|
|
7723
|
+
{ id: "matrix", label: "\u25A1" },
|
|
7724
|
+
{ id: "pmatrix", label: "(\u25A1)" },
|
|
7725
|
+
{ id: "bmatrix", label: "[\u25A1]" },
|
|
7726
|
+
{ id: "Bmatrix", label: "{\u25A1}" },
|
|
7727
|
+
{ id: "vmatrix", label: "|\u25A1|" },
|
|
7728
|
+
{ id: "Vmatrix", label: "||\u25A1||" }
|
|
7322
7729
|
];
|
|
7323
7730
|
var ARRAY_ALIGNMENTS = [
|
|
7324
|
-
{ id: "l"
|
|
7325
|
-
{ id: "c"
|
|
7326
|
-
{ id: "r"
|
|
7731
|
+
{ id: "l" },
|
|
7732
|
+
{ id: "c" },
|
|
7733
|
+
{ id: "r" }
|
|
7327
7734
|
];
|
|
7328
|
-
function matrixSizeLabel(rows, columns) {
|
|
7329
|
-
return `${String(rows)}
|
|
7735
|
+
function matrixSizeLabel(rows, columns, messages) {
|
|
7736
|
+
return `${String(rows)} ${messages.row} \xD7 ${String(columns)} ${messages.column}`;
|
|
7330
7737
|
}
|
|
7331
7738
|
function clampMatrixSize(value) {
|
|
7332
7739
|
return Math.max(1, Math.min(12, Math.trunc(value)));
|
|
@@ -7337,6 +7744,30 @@ function digitFormLabel(digitForm) {
|
|
|
7337
7744
|
function characterFontOption(fontId) {
|
|
7338
7745
|
return CHARACTER_FONT_OPTIONS.find((option) => option.id === fontId) ?? CHARACTER_FONT_OPTIONS[0];
|
|
7339
7746
|
}
|
|
7747
|
+
function characterFontTitle(fontId, messages) {
|
|
7748
|
+
if (fontId === "takween") return messages.takweenFont;
|
|
7749
|
+
if (fontId === "diwani") return messages.diwaniFont;
|
|
7750
|
+
if (fontId === "diwaniOutline") return messages.diwaniOutlineFont;
|
|
7751
|
+
return messages.defaultFont;
|
|
7752
|
+
}
|
|
7753
|
+
function digitFormTitle(digitForm, messages) {
|
|
7754
|
+
if (digitForm === "arabicIndic") return messages.arabicIndicDigits;
|
|
7755
|
+
if (digitForm === "persianIndic") return messages.persianIndicDigits;
|
|
7756
|
+
return messages.westernDigits;
|
|
7757
|
+
}
|
|
7758
|
+
function matrixStyleTitle(style, messages) {
|
|
7759
|
+
if (style === "pmatrix") return messages.matrixParentheses;
|
|
7760
|
+
if (style === "bmatrix") return messages.matrixBrackets;
|
|
7761
|
+
if (style === "Bmatrix") return messages.matrixBraces;
|
|
7762
|
+
if (style === "vmatrix") return messages.matrixBars;
|
|
7763
|
+
if (style === "Vmatrix") return messages.matrixDoubleBars;
|
|
7764
|
+
return messages.matrixNoDelimiters;
|
|
7765
|
+
}
|
|
7766
|
+
function alignmentCopy(alignment, messages) {
|
|
7767
|
+
if (alignment === "l") return { label: messages.alignLeft, title: messages.alignColumnLeft };
|
|
7768
|
+
if (alignment === "r") return { label: messages.alignRight, title: messages.alignColumnRight };
|
|
7769
|
+
return { label: messages.alignCenter, title: messages.alignColumnCenter };
|
|
7770
|
+
}
|
|
7340
7771
|
function spacingArrow(spec, side) {
|
|
7341
7772
|
const pointsWithFlow = spec.spacing.direction === "positive";
|
|
7342
7773
|
if (pointsWithFlow) {
|
|
@@ -7375,16 +7806,17 @@ function renderOperatorMenuButtonLabel(command, fallback) {
|
|
|
7375
7806
|
}
|
|
7376
7807
|
return /* @__PURE__ */ jsx("span", { className: shouldMirrorOperatorDisplay(command) ? "operator-command-label operator-command-label--mirror" : "operator-command-label", children: renderOperatorCommandLabel(command) });
|
|
7377
7808
|
}
|
|
7378
|
-
function passiveTreeText(session) {
|
|
7809
|
+
function passiveTreeText(session, messages) {
|
|
7379
7810
|
const passive = session.activeSide === "arabic" ? session.englishTree : session.arabicTree;
|
|
7380
|
-
const title = session.activeSide === "arabic" ?
|
|
7811
|
+
const title = session.activeSide === "arabic" ? messages.inactiveEnglish : messages.inactiveArabic;
|
|
7381
7812
|
const latex = session.activeSide === "arabic" ? renderChainEnglish(passive) : renderChainArabic(passive);
|
|
7382
7813
|
return `${title}
|
|
7383
7814
|
|
|
7384
|
-
${latex ||
|
|
7815
|
+
${latex || messages.empty}`;
|
|
7385
7816
|
}
|
|
7386
7817
|
var ButexEditor = forwardRef(
|
|
7387
|
-
function ButexEditor2({ className, debug = false, initialSession, onSessionChange }, ref) {
|
|
7818
|
+
function ButexEditor2({ className, debug = false, defaultSide, uiLocale = "ar", initialSession, onSessionChange }, ref) {
|
|
7819
|
+
const messages = equationEditorMessages(uiLocale);
|
|
7388
7820
|
const wrapperRef = useRef(null);
|
|
7389
7821
|
const surfaceRef = useRef(null);
|
|
7390
7822
|
const mathOutputRef = useRef(null);
|
|
@@ -7402,6 +7834,8 @@ var ButexEditor = forwardRef(
|
|
|
7402
7834
|
const runtimeRef = useRef(null);
|
|
7403
7835
|
const debugRef = useRef(debug);
|
|
7404
7836
|
debugRef.current = debug;
|
|
7837
|
+
const uiLocaleRef = useRef(uiLocale);
|
|
7838
|
+
uiLocaleRef.current = uiLocale;
|
|
7405
7839
|
const onSessionChangeRef = useRef(onSessionChange);
|
|
7406
7840
|
onSessionChangeRef.current = onSessionChange;
|
|
7407
7841
|
const debugBodyHiddenRef = useRef(false);
|
|
@@ -7443,14 +7877,15 @@ var ButexEditor = forwardRef(
|
|
|
7443
7877
|
const arabic = renderArabicLatexFromSession(session);
|
|
7444
7878
|
const activeLatex = session.activeSide === "arabic" ? arabic : english;
|
|
7445
7879
|
if (debugRef.current && latexLinesEl) {
|
|
7446
|
-
|
|
7447
|
-
|
|
7880
|
+
const currentMessages = equationEditorMessages(uiLocaleRef.current);
|
|
7881
|
+
latexLinesEl.textContent = `${currentMessages.englishLatex}:
|
|
7882
|
+
${english || currentMessages.empty}
|
|
7448
7883
|
|
|
7449
|
-
|
|
7450
|
-
${arabic ||
|
|
7884
|
+
${currentMessages.arabicLatex}:
|
|
7885
|
+
${arabic || currentMessages.empty}`;
|
|
7451
7886
|
}
|
|
7452
7887
|
if (debugRef.current && passivePreviewEl) {
|
|
7453
|
-
passivePreviewEl.textContent = passiveTreeText(session);
|
|
7888
|
+
passivePreviewEl.textContent = passiveTreeText(session, equationEditorMessages(uiLocaleRef.current));
|
|
7454
7889
|
passivePreviewEl.classList.toggle("passive--ltr", session.activeSide === "arabic");
|
|
7455
7890
|
}
|
|
7456
7891
|
if (debugRef.current && debugLogEl) {
|
|
@@ -7476,7 +7911,7 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7476
7911
|
} catch (err) {
|
|
7477
7912
|
const message = err instanceof Error ? err.message : String(err);
|
|
7478
7913
|
renderErrorEl.hidden = false;
|
|
7479
|
-
renderErrorEl.textContent =
|
|
7914
|
+
renderErrorEl.textContent = `${equationEditorMessages(uiLocaleRef.current).mathJaxError}: ${message}`;
|
|
7480
7915
|
if (runtimeRef.current) {
|
|
7481
7916
|
runtimeRef.current.setSession(setRenderError(runtimeRef.current.getSession(), message));
|
|
7482
7917
|
}
|
|
@@ -7494,6 +7929,8 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7494
7929
|
const runtime = createEditorRuntime({
|
|
7495
7930
|
surfaceEl,
|
|
7496
7931
|
initialSession,
|
|
7932
|
+
defaultSide,
|
|
7933
|
+
uiLocale,
|
|
7497
7934
|
buttonElements: {
|
|
7498
7935
|
undoBtn: undoBtnRef.current,
|
|
7499
7936
|
redoBtn: redoBtnRef.current,
|
|
@@ -7513,7 +7950,7 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7513
7950
|
const el = renderErrorRef.current;
|
|
7514
7951
|
if (el) {
|
|
7515
7952
|
el.hidden = false;
|
|
7516
|
-
el.textContent =
|
|
7953
|
+
el.textContent = `${equationEditorMessages(uiLocaleRef.current).previewError}: ${message}`;
|
|
7517
7954
|
}
|
|
7518
7955
|
});
|
|
7519
7956
|
}
|
|
@@ -7538,6 +7975,13 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7538
7975
|
runtimeRef.current = null;
|
|
7539
7976
|
};
|
|
7540
7977
|
}, []);
|
|
7978
|
+
useEffect(() => {
|
|
7979
|
+
runtimeRef.current?.setUiLocale(uiLocale);
|
|
7980
|
+
const session = runtimeRef.current?.getSession();
|
|
7981
|
+
if (session) {
|
|
7982
|
+
void updatePreviewRef.current(session);
|
|
7983
|
+
}
|
|
7984
|
+
}, [uiLocale]);
|
|
7541
7985
|
function focusSurface() {
|
|
7542
7986
|
surfaceRef.current?.focus();
|
|
7543
7987
|
}
|
|
@@ -7555,26 +7999,26 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7555
7999
|
{
|
|
7556
8000
|
ref: wrapperRef,
|
|
7557
8001
|
className: `butex-widget ${className ?? ""}`.trim(),
|
|
7558
|
-
dir:
|
|
7559
|
-
lang:
|
|
8002
|
+
dir: uiLocaleDirection(uiLocale),
|
|
8003
|
+
lang: uiLocale,
|
|
7560
8004
|
children: /* @__PURE__ */ jsxs("div", { className: "butex-widget-layout", children: [
|
|
7561
8005
|
/* @__PURE__ */ jsxs("section", { className: "panel", children: [
|
|
7562
8006
|
/* @__PURE__ */ jsxs("div", { className: "toolbar", children: [
|
|
7563
|
-
/* @__PURE__ */ jsxs("div", { className: "toolbar-group toolbar-history", role: "group", "aria-label":
|
|
7564
|
-
/* @__PURE__ */ jsx("button", { ref: undoBtnRef, id: "btn-undo", type: "button", className: "icon-btn", title:
|
|
7565
|
-
/* @__PURE__ */ jsx("button", { ref: redoBtnRef, id: "btn-redo", type: "button", className: "icon-btn", title:
|
|
8007
|
+
/* @__PURE__ */ jsxs("div", { className: "toolbar-group toolbar-history", role: "group", "aria-label": messages.undoRedo, children: [
|
|
8008
|
+
/* @__PURE__ */ jsx("button", { ref: undoBtnRef, id: "btn-undo", type: "button", className: "icon-btn", title: messages.undo, "aria-label": messages.undo, children: "\u21B7" }),
|
|
8009
|
+
/* @__PURE__ */ jsx("button", { ref: redoBtnRef, id: "btn-redo", type: "button", className: "icon-btn", title: messages.redo, "aria-label": messages.redo, children: "\u21B6" })
|
|
7566
8010
|
] }),
|
|
7567
|
-
/* @__PURE__ */ jsxs("div", { className: "toolbar-group toolbar-clipboard", role: "group", "aria-label":
|
|
7568
|
-
/* @__PURE__ */ jsx("button", { ref: copyBtnRef, id: "btn-copy", type: "button", className: "icon-btn", title:
|
|
7569
|
-
/* @__PURE__ */ jsx("button", { ref: cutBtnRef, id: "btn-cut", type: "button", className: "icon-btn", title:
|
|
8011
|
+
/* @__PURE__ */ jsxs("div", { className: "toolbar-group toolbar-clipboard", role: "group", "aria-label": messages.clipboard, children: [
|
|
8012
|
+
/* @__PURE__ */ jsx("button", { ref: copyBtnRef, id: "btn-copy", type: "button", className: "icon-btn", title: messages.copy, "aria-label": messages.copy, disabled: true, children: "\u29C9" }),
|
|
8013
|
+
/* @__PURE__ */ jsx("button", { ref: cutBtnRef, id: "btn-cut", type: "button", className: "icon-btn", title: messages.cut, "aria-label": messages.cut, disabled: true, children: "\u2702" }),
|
|
7570
8014
|
/* @__PURE__ */ jsx(
|
|
7571
8015
|
"button",
|
|
7572
8016
|
{
|
|
7573
8017
|
id: "btn-paste",
|
|
7574
8018
|
type: "button",
|
|
7575
8019
|
className: "icon-btn",
|
|
7576
|
-
title:
|
|
7577
|
-
"aria-label":
|
|
8020
|
+
title: messages.paste,
|
|
8021
|
+
"aria-label": messages.paste,
|
|
7578
8022
|
onClick: () => {
|
|
7579
8023
|
void runtimeRef.current?.performPaste().then(() => {
|
|
7580
8024
|
focusSurface();
|
|
@@ -7584,8 +8028,8 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7584
8028
|
}
|
|
7585
8029
|
)
|
|
7586
8030
|
] }),
|
|
7587
|
-
/* @__PURE__ */ jsx("div", { className: "toolbar-group toolbar-settings", role: "group", "aria-label":
|
|
7588
|
-
/* @__PURE__ */ jsxs("div", { className: "toolbar-group toolbar-structures", role: "group", "aria-label":
|
|
8031
|
+
/* @__PURE__ */ jsx("div", { className: "toolbar-group toolbar-settings", role: "group", "aria-label": messages.editorSettings, children: /* @__PURE__ */ jsx("button", { className: "icon-btn accent", type: "button", title: messages.toggleSide, "aria-label": messages.toggleSide, onClick: () => runtimeRef.current?.toggleSide(), children: "\u21C4" }) }),
|
|
8032
|
+
/* @__PURE__ */ jsxs("div", { className: "toolbar-group toolbar-structures", role: "group", "aria-label": messages.structures, children: [
|
|
7589
8033
|
/* @__PURE__ */ jsxs(
|
|
7590
8034
|
"div",
|
|
7591
8035
|
{
|
|
@@ -7602,15 +8046,15 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7602
8046
|
{
|
|
7603
8047
|
className: "icon-btn delimiter-command-btn",
|
|
7604
8048
|
type: "button",
|
|
7605
|
-
title:
|
|
7606
|
-
"aria-label":
|
|
8049
|
+
title: messages.insertDelimiters,
|
|
8050
|
+
"aria-label": messages.insertDelimiters,
|
|
7607
8051
|
"aria-haspopup": "listbox",
|
|
7608
8052
|
"aria-expanded": delimiterMenuOpen,
|
|
7609
8053
|
onClick: () => setDelimiterMenuOpen((open) => !open),
|
|
7610
8054
|
children: "()"
|
|
7611
8055
|
}
|
|
7612
8056
|
),
|
|
7613
|
-
/* @__PURE__ */ jsxs("div", { className: "delimiter-command-options", role: "listbox", "aria-label":
|
|
8057
|
+
/* @__PURE__ */ jsxs("div", { className: "delimiter-command-options", role: "listbox", "aria-label": messages.insertDelimiters, hidden: !delimiterMenuOpen, children: [
|
|
7614
8058
|
/* @__PURE__ */ jsx(
|
|
7615
8059
|
"button",
|
|
7616
8060
|
{
|
|
@@ -7618,8 +8062,8 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7618
8062
|
"data-delim": "paren",
|
|
7619
8063
|
type: "button",
|
|
7620
8064
|
role: "option",
|
|
7621
|
-
title:
|
|
7622
|
-
"aria-label":
|
|
8065
|
+
title: messages.insertParentheses,
|
|
8066
|
+
"aria-label": messages.insertParentheses,
|
|
7623
8067
|
onMouseDown: (event) => event.preventDefault(),
|
|
7624
8068
|
onClick: () => {
|
|
7625
8069
|
runtimeRef.current?.insertDelimiterByKind("paren");
|
|
@@ -7636,8 +8080,8 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7636
8080
|
"data-delim": "bracket",
|
|
7637
8081
|
type: "button",
|
|
7638
8082
|
role: "option",
|
|
7639
|
-
title:
|
|
7640
|
-
"aria-label":
|
|
8083
|
+
title: messages.insertBrackets,
|
|
8084
|
+
"aria-label": messages.insertBrackets,
|
|
7641
8085
|
onMouseDown: (event) => event.preventDefault(),
|
|
7642
8086
|
onClick: () => {
|
|
7643
8087
|
runtimeRef.current?.insertDelimiterByKind("bracket");
|
|
@@ -7654,8 +8098,8 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7654
8098
|
"data-delim": "brace",
|
|
7655
8099
|
type: "button",
|
|
7656
8100
|
role: "option",
|
|
7657
|
-
title:
|
|
7658
|
-
"aria-label":
|
|
8101
|
+
title: messages.insertBraces,
|
|
8102
|
+
"aria-label": messages.insertBraces,
|
|
7659
8103
|
onMouseDown: (event) => event.preventDefault(),
|
|
7660
8104
|
onClick: () => {
|
|
7661
8105
|
runtimeRef.current?.insertDelimiterByKind("brace");
|
|
@@ -7669,19 +8113,19 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7669
8113
|
]
|
|
7670
8114
|
}
|
|
7671
8115
|
),
|
|
7672
|
-
/* @__PURE__ */ jsx("button", { id: "insert-frac", className: "icon-btn frac-icon-btn", type: "button", title:
|
|
8116
|
+
/* @__PURE__ */ jsx("button", { id: "insert-frac", className: "icon-btn frac-icon-btn", type: "button", title: messages.insertFraction, "aria-label": messages.insertFraction, onClick: () => {
|
|
7673
8117
|
runtimeRef.current?.insertFraction();
|
|
7674
8118
|
focusSurface();
|
|
7675
8119
|
}, children: /* @__PURE__ */ jsxs("span", { className: "toolbar-frac-icon", "aria-hidden": "true", children: [
|
|
7676
8120
|
/* @__PURE__ */ jsx("span", { children: "\u0623" }),
|
|
7677
8121
|
/* @__PURE__ */ jsx("span", { children: "\u0628" })
|
|
7678
8122
|
] }) }),
|
|
7679
|
-
/* @__PURE__ */ jsx("button", { id: "insert-sqrt", className: "icon-btn", type: "button", title:
|
|
8123
|
+
/* @__PURE__ */ jsx("button", { id: "insert-sqrt", className: "icon-btn", type: "button", title: messages.insertRoot, "aria-label": messages.insertRoot, onClick: () => {
|
|
7680
8124
|
runtimeRef.current?.insertSqrt();
|
|
7681
8125
|
focusSurface();
|
|
7682
8126
|
}, children: /* @__PURE__ */ jsx("span", { className: "toolbar-sqrt-icon", "aria-hidden": "true", children: "\u221A" }) })
|
|
7683
8127
|
] }),
|
|
7684
|
-
/* @__PURE__ */ jsx("div", { className: "toolbar-group toolbar-environments", role: "group", "aria-label":
|
|
8128
|
+
/* @__PURE__ */ jsx("div", { className: "toolbar-group toolbar-environments", role: "group", "aria-label": messages.environments, children: /* @__PURE__ */ jsxs(
|
|
7685
8129
|
"div",
|
|
7686
8130
|
{
|
|
7687
8131
|
className: "matrix-command-menu",
|
|
@@ -7697,8 +8141,8 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7697
8141
|
{
|
|
7698
8142
|
className: "icon-btn matrix-command-btn",
|
|
7699
8143
|
type: "button",
|
|
7700
|
-
title:
|
|
7701
|
-
"aria-label":
|
|
8144
|
+
title: messages.insertEnvironment,
|
|
8145
|
+
"aria-label": messages.insertEnvironment,
|
|
7702
8146
|
"aria-haspopup": "dialog",
|
|
7703
8147
|
"aria-expanded": matrixMenuOpen,
|
|
7704
8148
|
onClick: () => setMatrixMenuOpen((open) => !open),
|
|
@@ -7710,11 +8154,11 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7710
8154
|
] })
|
|
7711
8155
|
}
|
|
7712
8156
|
),
|
|
7713
|
-
/* @__PURE__ */ jsxs("div", { className: "matrix-command-popover", role: "dialog", "aria-label":
|
|
7714
|
-
/* @__PURE__ */ jsx("div", { className: "matrix-style-options", role: "listbox", "aria-label":
|
|
7715
|
-
{ id: "matrix", label:
|
|
7716
|
-
{ id: "array", label:
|
|
7717
|
-
{ id: "aligned", label:
|
|
8157
|
+
/* @__PURE__ */ jsxs("div", { className: "matrix-command-popover", role: "dialog", "aria-label": messages.insertEnvironment, hidden: !matrixMenuOpen, children: [
|
|
8158
|
+
/* @__PURE__ */ jsx("div", { className: "matrix-style-options", role: "listbox", "aria-label": messages.environmentType, children: [
|
|
8159
|
+
{ id: "matrix", label: messages.matrix },
|
|
8160
|
+
{ id: "array", label: messages.array },
|
|
8161
|
+
{ id: "aligned", label: messages.aligned }
|
|
7718
8162
|
].map((option) => /* @__PURE__ */ jsx(
|
|
7719
8163
|
"button",
|
|
7720
8164
|
{
|
|
@@ -7733,14 +8177,14 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7733
8177
|
},
|
|
7734
8178
|
option.id
|
|
7735
8179
|
)) }),
|
|
7736
|
-
envPaletteMode === "matrix" ? /* @__PURE__ */ jsx("div", { className: "matrix-style-options", role: "listbox", "aria-label":
|
|
8180
|
+
envPaletteMode === "matrix" ? /* @__PURE__ */ jsx("div", { className: "matrix-style-options", role: "listbox", "aria-label": messages.matrixType, children: MATRIX_STYLES.map((style) => /* @__PURE__ */ jsx(
|
|
7737
8181
|
"button",
|
|
7738
8182
|
{
|
|
7739
8183
|
type: "button",
|
|
7740
8184
|
role: "option",
|
|
7741
8185
|
"aria-selected": matrixStyle === style.id,
|
|
7742
8186
|
className: "matrix-style-option",
|
|
7743
|
-
title: style.
|
|
8187
|
+
title: matrixStyleTitle(style.id, messages),
|
|
7744
8188
|
onMouseDown: (event) => event.preventDefault(),
|
|
7745
8189
|
onClick: () => {
|
|
7746
8190
|
setMatrixStyle(style.id);
|
|
@@ -7749,8 +8193,8 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7749
8193
|
},
|
|
7750
8194
|
style.id
|
|
7751
8195
|
)) }) : null,
|
|
7752
|
-
/* @__PURE__ */ jsx("div", { className: "matrix-size-readout", children: matrixHover ? matrixSizeLabel(matrixHover.rows, matrixHover.columns) : matrixSizeLabel(matrixRows, matrixColumns) }),
|
|
7753
|
-
/* @__PURE__ */ jsx("div", { className: "matrix-grid-picker", "aria-label":
|
|
8196
|
+
/* @__PURE__ */ jsx("div", { className: "matrix-size-readout", children: matrixHover ? matrixSizeLabel(matrixHover.rows, matrixHover.columns, messages) : matrixSizeLabel(matrixRows, matrixColumns, messages) }),
|
|
8197
|
+
/* @__PURE__ */ jsx("div", { className: "matrix-grid-picker", "aria-label": messages.chooseEnvironmentSize, children: Array.from(
|
|
7754
8198
|
{ length: 8 },
|
|
7755
8199
|
(_, rowIndex) => Array.from({ length: 8 }, (_2, columnIndex) => {
|
|
7756
8200
|
const rows = rowIndex + 1;
|
|
@@ -7762,8 +8206,8 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7762
8206
|
{
|
|
7763
8207
|
type: "button",
|
|
7764
8208
|
className: rows <= activeRows && columns <= activeColumns ? "matrix-grid-cell active" : "matrix-grid-cell",
|
|
7765
|
-
title: matrixSizeLabel(rows, columns),
|
|
7766
|
-
"aria-label": matrixSizeLabel(rows, columns),
|
|
8209
|
+
title: matrixSizeLabel(rows, columns, messages),
|
|
8210
|
+
"aria-label": matrixSizeLabel(rows, columns, messages),
|
|
7767
8211
|
onMouseEnter: () => setMatrixHover({ rows, columns }),
|
|
7768
8212
|
onMouseDown: (event) => event.preventDefault(),
|
|
7769
8213
|
onClick: () => {
|
|
@@ -7781,7 +8225,7 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7781
8225
|
) }),
|
|
7782
8226
|
/* @__PURE__ */ jsxs("div", { className: "matrix-custom-size", children: [
|
|
7783
8227
|
/* @__PURE__ */ jsxs("label", { children: [
|
|
7784
|
-
|
|
8228
|
+
messages.row,
|
|
7785
8229
|
/* @__PURE__ */ jsx(
|
|
7786
8230
|
"input",
|
|
7787
8231
|
{
|
|
@@ -7794,7 +8238,7 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7794
8238
|
)
|
|
7795
8239
|
] }),
|
|
7796
8240
|
/* @__PURE__ */ jsxs("label", { children: [
|
|
7797
|
-
|
|
8241
|
+
messages.column,
|
|
7798
8242
|
/* @__PURE__ */ jsx(
|
|
7799
8243
|
"input",
|
|
7800
8244
|
{
|
|
@@ -7820,15 +8264,15 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7820
8264
|
setMatrixHover(null);
|
|
7821
8265
|
focusSurface();
|
|
7822
8266
|
},
|
|
7823
|
-
children:
|
|
8267
|
+
children: messages.insert
|
|
7824
8268
|
}
|
|
7825
8269
|
)
|
|
7826
8270
|
] }),
|
|
7827
|
-
/* @__PURE__ */ jsxs("div", { className: "matrix-edit-actions", "aria-label":
|
|
7828
|
-
envPaletteMode === "matrix" ? /* @__PURE__ */ jsx("button", { type: "button", title:
|
|
8271
|
+
/* @__PURE__ */ jsxs("div", { className: "matrix-edit-actions", "aria-label": messages.editSelectedEnvironment, children: [
|
|
8272
|
+
envPaletteMode === "matrix" ? /* @__PURE__ */ jsx("button", { type: "button", title: messages.applySelectedMatrixStyle, onMouseDown: (event) => event.preventDefault(), onClick: () => runtimeRef.current?.setMatrixEnvStyle(matrixStyle), children: messages.applyStyle }) : null,
|
|
7829
8273
|
envPaletteMode === "array" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7830
8274
|
/* @__PURE__ */ jsxs("label", { children: [
|
|
7831
|
-
|
|
8275
|
+
messages.column,
|
|
7832
8276
|
/* @__PURE__ */ jsx(
|
|
7833
8277
|
"input",
|
|
7834
8278
|
{
|
|
@@ -7844,24 +8288,36 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7844
8288
|
"button",
|
|
7845
8289
|
{
|
|
7846
8290
|
type: "button",
|
|
7847
|
-
title: alignment.title,
|
|
8291
|
+
title: alignmentCopy(alignment.id, messages).title,
|
|
7848
8292
|
onMouseDown: (event) => event.preventDefault(),
|
|
7849
8293
|
onClick: () => runtimeRef.current?.setArrayColumnAlignment(arrayAlignmentColumn - 1, alignment.id),
|
|
7850
|
-
children: alignment.label
|
|
8294
|
+
children: alignmentCopy(alignment.id, messages).label
|
|
7851
8295
|
},
|
|
7852
8296
|
alignment.id
|
|
7853
8297
|
))
|
|
7854
8298
|
] }) : null,
|
|
7855
|
-
/* @__PURE__ */
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
8299
|
+
/* @__PURE__ */ jsxs("button", { type: "button", title: messages.addRow, onMouseDown: (event) => event.preventDefault(), onClick: () => runtimeRef.current?.addMatrixRow(), children: [
|
|
8300
|
+
"+",
|
|
8301
|
+
messages.row
|
|
8302
|
+
] }),
|
|
8303
|
+
/* @__PURE__ */ jsxs("button", { type: "button", title: messages.removeRow, onMouseDown: (event) => event.preventDefault(), onClick: () => runtimeRef.current?.removeMatrixRow(), children: [
|
|
8304
|
+
"-",
|
|
8305
|
+
messages.row
|
|
8306
|
+
] }),
|
|
8307
|
+
/* @__PURE__ */ jsxs("button", { type: "button", title: messages.addColumn, onMouseDown: (event) => event.preventDefault(), onClick: () => runtimeRef.current?.addMatrixColumn(), children: [
|
|
8308
|
+
"+",
|
|
8309
|
+
messages.column
|
|
8310
|
+
] }),
|
|
8311
|
+
/* @__PURE__ */ jsxs("button", { type: "button", title: messages.removeColumn, onMouseDown: (event) => event.preventDefault(), onClick: () => runtimeRef.current?.removeMatrixColumn(), children: [
|
|
8312
|
+
"-",
|
|
8313
|
+
messages.column
|
|
8314
|
+
] })
|
|
7859
8315
|
] })
|
|
7860
8316
|
] })
|
|
7861
8317
|
]
|
|
7862
8318
|
}
|
|
7863
8319
|
) }),
|
|
7864
|
-
/* @__PURE__ */ jsx("div", { className: "toolbar-group toolbar-settings", role: "group", "aria-label":
|
|
8320
|
+
/* @__PURE__ */ jsx("div", { className: "toolbar-group toolbar-settings", role: "group", "aria-label": messages.spaces, children: /* @__PURE__ */ jsxs(
|
|
7865
8321
|
"div",
|
|
7866
8322
|
{
|
|
7867
8323
|
className: `spacing-command-menu spacing-command-menu--${activeEditorSide}`,
|
|
@@ -7877,8 +8333,8 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7877
8333
|
{
|
|
7878
8334
|
className: "icon-btn spacing-command-btn",
|
|
7879
8335
|
type: "button",
|
|
7880
|
-
title:
|
|
7881
|
-
"aria-label":
|
|
8336
|
+
title: messages.insertSpace,
|
|
8337
|
+
"aria-label": messages.insertSpace,
|
|
7882
8338
|
"aria-haspopup": "listbox",
|
|
7883
8339
|
"aria-expanded": spacingMenuOpen,
|
|
7884
8340
|
onClick: () => setSpacingMenuOpen((open) => !open),
|
|
@@ -7888,13 +8344,13 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7888
8344
|
] })
|
|
7889
8345
|
}
|
|
7890
8346
|
),
|
|
7891
|
-
/* @__PURE__ */ jsx("div", { className: "spacing-command-options", role: "listbox", "aria-label":
|
|
8347
|
+
/* @__PURE__ */ jsx("div", { className: "spacing-command-options", role: "listbox", "aria-label": messages.insertSpace, hidden: !spacingMenuOpen, children: SPACING_COMMANDS.map((command) => /* @__PURE__ */ jsxs(
|
|
7892
8348
|
"button",
|
|
7893
8349
|
{
|
|
7894
8350
|
type: "button",
|
|
7895
8351
|
role: "option",
|
|
7896
8352
|
className: `spacing-command-option spacing-command-option--${command.spacing.direction}`,
|
|
7897
|
-
title: command
|
|
8353
|
+
title: atomicCommandTitle(command, uiLocale),
|
|
7898
8354
|
onMouseDown: (event) => event.preventDefault(),
|
|
7899
8355
|
onClick: () => {
|
|
7900
8356
|
runtimeRef.current?.insertAtomicCommand(command.id);
|
|
@@ -7907,7 +8363,7 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7907
8363
|
/* @__PURE__ */ jsx("span", { className: "spacing-command-glyph__bar" }),
|
|
7908
8364
|
command.spacing.direction === "positive" ? /* @__PURE__ */ jsx("span", { className: "spacing-command-glyph__arrow", children: spacingArrow(command, activeEditorSide) }) : null
|
|
7909
8365
|
] }),
|
|
7910
|
-
/* @__PURE__ */ jsx("span", { className: "spacing-command-option__name", children: command
|
|
8366
|
+
/* @__PURE__ */ jsx("span", { className: "spacing-command-option__name", children: atomicCommandTitle(command, uiLocale) })
|
|
7911
8367
|
]
|
|
7912
8368
|
},
|
|
7913
8369
|
command.id
|
|
@@ -7915,7 +8371,7 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7915
8371
|
]
|
|
7916
8372
|
}
|
|
7917
8373
|
) }),
|
|
7918
|
-
/* @__PURE__ */ jsxs("div", { className: "toolbar-group toolbar-functions", role: "group", "aria-label":
|
|
8374
|
+
/* @__PURE__ */ jsxs("div", { className: "toolbar-group toolbar-functions", role: "group", "aria-label": messages.functions, children: [
|
|
7919
8375
|
/* @__PURE__ */ jsxs(
|
|
7920
8376
|
"div",
|
|
7921
8377
|
{
|
|
@@ -7932,22 +8388,22 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7932
8388
|
{
|
|
7933
8389
|
className: "icon-btn function-command-btn",
|
|
7934
8390
|
type: "button",
|
|
7935
|
-
title:
|
|
7936
|
-
"aria-label":
|
|
8391
|
+
title: messages.insertFunction,
|
|
8392
|
+
"aria-label": messages.insertFunction,
|
|
7937
8393
|
"aria-haspopup": "listbox",
|
|
7938
8394
|
"aria-expanded": functionMenuOpen,
|
|
7939
8395
|
onClick: () => setFunctionMenuOpen((open) => !open),
|
|
7940
8396
|
children: FUNCTION_COMMANDS[0]?.arabicLabel ?? "\u062F"
|
|
7941
8397
|
}
|
|
7942
8398
|
),
|
|
7943
|
-
/* @__PURE__ */ jsx("div", { className: "function-command-options", role: "listbox", "aria-label":
|
|
8399
|
+
/* @__PURE__ */ jsx("div", { className: "function-command-options", role: "listbox", "aria-label": messages.insertFunction, hidden: !functionMenuOpen, children: FUNCTION_COMMANDS.map((command) => /* @__PURE__ */ jsx(
|
|
7944
8400
|
"button",
|
|
7945
8401
|
{
|
|
7946
8402
|
className: "function-command-option",
|
|
7947
8403
|
type: "button",
|
|
7948
8404
|
role: "option",
|
|
7949
|
-
title: command
|
|
7950
|
-
"aria-label": command
|
|
8405
|
+
title: atomicCommandTitle(command, uiLocale),
|
|
8406
|
+
"aria-label": atomicCommandTitle(command, uiLocale),
|
|
7951
8407
|
onMouseDown: (event) => event.preventDefault(),
|
|
7952
8408
|
onClick: () => {
|
|
7953
8409
|
runtimeRef.current?.insertAtomicCommand(command.id);
|
|
@@ -7977,22 +8433,22 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
7977
8433
|
{
|
|
7978
8434
|
className: "icon-btn function-command-btn",
|
|
7979
8435
|
type: "button",
|
|
7980
|
-
title:
|
|
7981
|
-
"aria-label":
|
|
8436
|
+
title: messages.insertLimitsSeries,
|
|
8437
|
+
"aria-label": messages.insertLimitsSeries,
|
|
7982
8438
|
"aria-haspopup": "listbox",
|
|
7983
8439
|
"aria-expanded": limitsSeriesMenuOpen,
|
|
7984
8440
|
onClick: () => setLimitsSeriesMenuOpen((open) => !open),
|
|
7985
8441
|
children: LIMITS_SERIES_COMMANDS[0]?.arabicLabel ?? "\u062D\u062F"
|
|
7986
8442
|
}
|
|
7987
8443
|
),
|
|
7988
|
-
/* @__PURE__ */ jsx("div", { className: "function-command-options", role: "listbox", "aria-label":
|
|
8444
|
+
/* @__PURE__ */ jsx("div", { className: "function-command-options", role: "listbox", "aria-label": messages.insertLimitsSeries, hidden: !limitsSeriesMenuOpen, children: LIMITS_SERIES_COMMANDS.map((command) => /* @__PURE__ */ jsx(
|
|
7989
8445
|
"button",
|
|
7990
8446
|
{
|
|
7991
8447
|
className: "function-command-option",
|
|
7992
8448
|
type: "button",
|
|
7993
8449
|
role: "option",
|
|
7994
|
-
title: command
|
|
7995
|
-
"aria-label": command
|
|
8450
|
+
title: atomicCommandTitle(command, uiLocale),
|
|
8451
|
+
"aria-label": atomicCommandTitle(command, uiLocale),
|
|
7996
8452
|
onMouseDown: (event) => event.preventDefault(),
|
|
7997
8453
|
onClick: () => {
|
|
7998
8454
|
runtimeRef.current?.insertAtomicCommand(command.id);
|
|
@@ -8022,22 +8478,22 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
8022
8478
|
{
|
|
8023
8479
|
className: "icon-btn function-command-btn",
|
|
8024
8480
|
type: "button",
|
|
8025
|
-
title:
|
|
8026
|
-
"aria-label":
|
|
8481
|
+
title: messages.insertAdditionalFunctions,
|
|
8482
|
+
"aria-label": messages.insertAdditionalFunctions,
|
|
8027
8483
|
"aria-haspopup": "listbox",
|
|
8028
8484
|
"aria-expanded": function2MenuOpen,
|
|
8029
8485
|
onClick: () => setFunction2MenuOpen((open) => !open),
|
|
8030
8486
|
children: FUNCTION2_COMMANDS[0]?.arabicLabel ?? "\u062F"
|
|
8031
8487
|
}
|
|
8032
8488
|
),
|
|
8033
|
-
/* @__PURE__ */ jsx("div", { className: "function-command-options", role: "listbox", "aria-label":
|
|
8489
|
+
/* @__PURE__ */ jsx("div", { className: "function-command-options", role: "listbox", "aria-label": messages.insertAdditionalFunctions, hidden: !function2MenuOpen, children: FUNCTION2_COMMANDS.map((command) => /* @__PURE__ */ jsx(
|
|
8034
8490
|
"button",
|
|
8035
8491
|
{
|
|
8036
8492
|
className: "function-command-option",
|
|
8037
8493
|
type: "button",
|
|
8038
8494
|
role: "option",
|
|
8039
|
-
title: command
|
|
8040
|
-
"aria-label": command
|
|
8495
|
+
title: atomicCommandTitle(command, uiLocale),
|
|
8496
|
+
"aria-label": atomicCommandTitle(command, uiLocale),
|
|
8041
8497
|
onMouseDown: (event) => event.preventDefault(),
|
|
8042
8498
|
onClick: () => {
|
|
8043
8499
|
runtimeRef.current?.insertAtomicCommand(command.id);
|
|
@@ -8067,22 +8523,22 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
8067
8523
|
{
|
|
8068
8524
|
className: "icon-btn function-command-btn",
|
|
8069
8525
|
type: "button",
|
|
8070
|
-
title:
|
|
8071
|
-
"aria-label":
|
|
8526
|
+
title: messages.insertNumberSets,
|
|
8527
|
+
"aria-label": messages.insertNumberSets,
|
|
8072
8528
|
"aria-haspopup": "listbox",
|
|
8073
8529
|
"aria-expanded": groupMenuOpen,
|
|
8074
8530
|
onClick: () => setGroupMenuOpen((open) => !open),
|
|
8075
8531
|
children: GROUP_COMMANDS[0]?.arabicLabel ?? "\u0645"
|
|
8076
8532
|
}
|
|
8077
8533
|
),
|
|
8078
|
-
/* @__PURE__ */ jsx("div", { className: "function-command-options", role: "listbox", "aria-label":
|
|
8534
|
+
/* @__PURE__ */ jsx("div", { className: "function-command-options", role: "listbox", "aria-label": messages.insertNumberSets, hidden: !groupMenuOpen, children: GROUP_COMMANDS.map((command) => /* @__PURE__ */ jsx(
|
|
8079
8535
|
"button",
|
|
8080
8536
|
{
|
|
8081
8537
|
className: "function-command-option",
|
|
8082
8538
|
type: "button",
|
|
8083
8539
|
role: "option",
|
|
8084
|
-
title: command
|
|
8085
|
-
"aria-label": command
|
|
8540
|
+
title: atomicCommandTitle(command, uiLocale),
|
|
8541
|
+
"aria-label": atomicCommandTitle(command, uiLocale),
|
|
8086
8542
|
onMouseDown: (event) => event.preventDefault(),
|
|
8087
8543
|
onClick: () => {
|
|
8088
8544
|
runtimeRef.current?.insertAtomicCommand(command.id);
|
|
@@ -8097,7 +8553,7 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
8097
8553
|
}
|
|
8098
8554
|
)
|
|
8099
8555
|
] }),
|
|
8100
|
-
/* @__PURE__ */ jsxs("div", { className: "toolbar-group toolbar-operators", role: "group", "aria-label":
|
|
8556
|
+
/* @__PURE__ */ jsxs("div", { className: "toolbar-group toolbar-operators", role: "group", "aria-label": messages.operations, children: [
|
|
8101
8557
|
/* @__PURE__ */ jsxs(
|
|
8102
8558
|
"div",
|
|
8103
8559
|
{
|
|
@@ -8114,22 +8570,22 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
8114
8570
|
{
|
|
8115
8571
|
className: "icon-btn function-command-btn operator-command-btn",
|
|
8116
8572
|
type: "button",
|
|
8117
|
-
title:
|
|
8118
|
-
"aria-label":
|
|
8573
|
+
title: messages.insertOperation,
|
|
8574
|
+
"aria-label": messages.insertOperation,
|
|
8119
8575
|
"aria-haspopup": "listbox",
|
|
8120
8576
|
"aria-expanded": operatorMenuOpen,
|
|
8121
8577
|
onClick: () => setOperatorMenuOpen((open) => !open),
|
|
8122
8578
|
children: renderOperatorMenuButtonLabel(OPERATOR_COMMANDS[0], "\u2217")
|
|
8123
8579
|
}
|
|
8124
8580
|
),
|
|
8125
|
-
/* @__PURE__ */ jsx("div", { className: "function-command-options operator-command-options", role: "listbox", "aria-label":
|
|
8581
|
+
/* @__PURE__ */ jsx("div", { className: "function-command-options operator-command-options", role: "listbox", "aria-label": messages.insertOperation, hidden: !operatorMenuOpen, children: OPERATOR_COMMANDS.map((command) => /* @__PURE__ */ jsx(
|
|
8126
8582
|
"button",
|
|
8127
8583
|
{
|
|
8128
8584
|
className: "function-command-option operator-command-option",
|
|
8129
8585
|
type: "button",
|
|
8130
8586
|
role: "option",
|
|
8131
|
-
title: command
|
|
8132
|
-
"aria-label": command
|
|
8587
|
+
title: atomicOperatorCommandTitle(command, uiLocale),
|
|
8588
|
+
"aria-label": atomicOperatorCommandTitle(command, uiLocale),
|
|
8133
8589
|
onMouseDown: (event) => event.preventDefault(),
|
|
8134
8590
|
onClick: () => {
|
|
8135
8591
|
runtimeRef.current?.insertAtomicOperatorCommand(command.id);
|
|
@@ -8159,22 +8615,22 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
8159
8615
|
{
|
|
8160
8616
|
className: "icon-btn function-command-btn operator-command-btn",
|
|
8161
8617
|
type: "button",
|
|
8162
|
-
title:
|
|
8163
|
-
"aria-label":
|
|
8618
|
+
title: messages.insertRelationsSets,
|
|
8619
|
+
"aria-label": messages.insertRelationsSets,
|
|
8164
8620
|
"aria-haspopup": "listbox",
|
|
8165
8621
|
"aria-expanded": operator2MenuOpen,
|
|
8166
8622
|
onClick: () => setOperator2MenuOpen((open) => !open),
|
|
8167
8623
|
children: "\u2229"
|
|
8168
8624
|
}
|
|
8169
8625
|
),
|
|
8170
|
-
/* @__PURE__ */ jsx("div", { className: "function-command-options operator-command-options", role: "listbox", "aria-label":
|
|
8626
|
+
/* @__PURE__ */ jsx("div", { className: "function-command-options operator-command-options", role: "listbox", "aria-label": messages.insertRelationsSets, hidden: !operator2MenuOpen, children: OPERATOR2_COMMANDS.map((command) => /* @__PURE__ */ jsx(
|
|
8171
8627
|
"button",
|
|
8172
8628
|
{
|
|
8173
8629
|
className: "function-command-option operator-command-option",
|
|
8174
8630
|
type: "button",
|
|
8175
8631
|
role: "option",
|
|
8176
|
-
title: command
|
|
8177
|
-
"aria-label": command
|
|
8632
|
+
title: atomicOperatorCommandTitle(command, uiLocale),
|
|
8633
|
+
"aria-label": atomicOperatorCommandTitle(command, uiLocale),
|
|
8178
8634
|
onMouseDown: (event) => event.preventDefault(),
|
|
8179
8635
|
onClick: () => {
|
|
8180
8636
|
runtimeRef.current?.insertAtomicOperatorCommand(command.id);
|
|
@@ -8204,22 +8660,22 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
8204
8660
|
{
|
|
8205
8661
|
className: "icon-btn function-command-btn operator-command-btn",
|
|
8206
8662
|
type: "button",
|
|
8207
|
-
title:
|
|
8208
|
-
"aria-label":
|
|
8663
|
+
title: messages.insertArrows,
|
|
8664
|
+
"aria-label": messages.insertArrows,
|
|
8209
8665
|
"aria-haspopup": "listbox",
|
|
8210
8666
|
"aria-expanded": operator3MenuOpen,
|
|
8211
8667
|
onClick: () => setOperator3MenuOpen((open) => !open),
|
|
8212
8668
|
children: renderOperatorMenuButtonLabel(OPERATOR3_COMMANDS[0], "\u21D2")
|
|
8213
8669
|
}
|
|
8214
8670
|
),
|
|
8215
|
-
/* @__PURE__ */ jsx("div", { className: "function-command-options operator-command-options", role: "listbox", "aria-label":
|
|
8671
|
+
/* @__PURE__ */ jsx("div", { className: "function-command-options operator-command-options", role: "listbox", "aria-label": messages.insertArrows, hidden: !operator3MenuOpen, children: OPERATOR3_COMMANDS.map((command) => /* @__PURE__ */ jsx(
|
|
8216
8672
|
"button",
|
|
8217
8673
|
{
|
|
8218
8674
|
className: "function-command-option operator-command-option",
|
|
8219
8675
|
type: "button",
|
|
8220
8676
|
role: "option",
|
|
8221
|
-
title: command
|
|
8222
|
-
"aria-label": command
|
|
8677
|
+
title: atomicOperatorCommandTitle(command, uiLocale),
|
|
8678
|
+
"aria-label": atomicOperatorCommandTitle(command, uiLocale),
|
|
8223
8679
|
onMouseDown: (event) => event.preventDefault(),
|
|
8224
8680
|
onClick: () => {
|
|
8225
8681
|
runtimeRef.current?.insertAtomicOperatorCommand(command.id);
|
|
@@ -8249,22 +8705,22 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
8249
8705
|
{
|
|
8250
8706
|
className: "icon-btn function-command-btn operator-command-btn",
|
|
8251
8707
|
type: "button",
|
|
8252
|
-
title:
|
|
8253
|
-
"aria-label":
|
|
8708
|
+
title: messages.insertDots,
|
|
8709
|
+
"aria-label": messages.insertDots,
|
|
8254
8710
|
"aria-haspopup": "listbox",
|
|
8255
8711
|
"aria-expanded": dotMenuOpen,
|
|
8256
8712
|
onClick: () => setDotMenuOpen((open) => !open),
|
|
8257
8713
|
children: renderOperatorMenuButtonLabel(DOT_COMMANDS[0], "\u2026")
|
|
8258
8714
|
}
|
|
8259
8715
|
),
|
|
8260
|
-
/* @__PURE__ */ jsx("div", { className: "function-command-options operator-command-options", role: "listbox", "aria-label":
|
|
8716
|
+
/* @__PURE__ */ jsx("div", { className: "function-command-options operator-command-options", role: "listbox", "aria-label": messages.insertDots, hidden: !dotMenuOpen, children: DOT_COMMANDS.map((command) => /* @__PURE__ */ jsx(
|
|
8261
8717
|
"button",
|
|
8262
8718
|
{
|
|
8263
8719
|
className: "function-command-option operator-command-option",
|
|
8264
8720
|
type: "button",
|
|
8265
8721
|
role: "option",
|
|
8266
|
-
title: command
|
|
8267
|
-
"aria-label": command
|
|
8722
|
+
title: atomicOperatorCommandTitle(command, uiLocale),
|
|
8723
|
+
"aria-label": atomicOperatorCommandTitle(command, uiLocale),
|
|
8268
8724
|
onMouseDown: (event) => event.preventDefault(),
|
|
8269
8725
|
onClick: () => {
|
|
8270
8726
|
runtimeRef.current?.insertAtomicOperatorCommand(command.id);
|
|
@@ -8294,22 +8750,22 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
8294
8750
|
{
|
|
8295
8751
|
className: "icon-btn function-command-btn operator-command-btn",
|
|
8296
8752
|
type: "button",
|
|
8297
|
-
title:
|
|
8298
|
-
"aria-label":
|
|
8753
|
+
title: messages.insertIntegrals,
|
|
8754
|
+
"aria-label": messages.insertIntegrals,
|
|
8299
8755
|
"aria-haspopup": "listbox",
|
|
8300
8756
|
"aria-expanded": integralMenuOpen,
|
|
8301
8757
|
onClick: () => setIntegralMenuOpen((open) => !open),
|
|
8302
8758
|
children: renderOperatorMenuButtonLabel(INTEGRAL_COMMANDS[0], "\u222B")
|
|
8303
8759
|
}
|
|
8304
8760
|
),
|
|
8305
|
-
/* @__PURE__ */ jsx("div", { className: "function-command-options operator-command-options", role: "listbox", "aria-label":
|
|
8761
|
+
/* @__PURE__ */ jsx("div", { className: "function-command-options operator-command-options", role: "listbox", "aria-label": messages.insertIntegrals, hidden: !integralMenuOpen, children: INTEGRAL_COMMANDS.map((command) => /* @__PURE__ */ jsx(
|
|
8306
8762
|
"button",
|
|
8307
8763
|
{
|
|
8308
8764
|
className: "function-command-option operator-command-option",
|
|
8309
8765
|
type: "button",
|
|
8310
8766
|
role: "option",
|
|
8311
|
-
title: command
|
|
8312
|
-
"aria-label": command
|
|
8767
|
+
title: atomicOperatorCommandTitle(command, uiLocale),
|
|
8768
|
+
"aria-label": atomicOperatorCommandTitle(command, uiLocale),
|
|
8313
8769
|
onMouseDown: (event) => event.preventDefault(),
|
|
8314
8770
|
onClick: () => {
|
|
8315
8771
|
runtimeRef.current?.insertAtomicOperatorCommand(command.id);
|
|
@@ -8324,27 +8780,27 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
8324
8780
|
}
|
|
8325
8781
|
)
|
|
8326
8782
|
] }),
|
|
8327
|
-
/* @__PURE__ */ jsxs("div", { className: "toolbar-group toolbar-scripts", role: "group", "aria-label":
|
|
8328
|
-
/* @__PURE__ */ jsx("button", { className: "icon-btn script-icon-btn", type: "button", title:
|
|
8783
|
+
/* @__PURE__ */ jsxs("div", { className: "toolbar-group toolbar-scripts", role: "group", "aria-label": messages.scripts, children: [
|
|
8784
|
+
/* @__PURE__ */ jsx("button", { className: "icon-btn script-icon-btn", type: "button", title: messages.addSuperscript, "aria-label": messages.addSuperscript, onClick: () => runtimeRef.current?.addSup(), children: /* @__PURE__ */ jsxs("span", { className: "toolbar-script-icon toolbar-script-icon--sup", "aria-hidden": "true", children: [
|
|
8329
8785
|
/* @__PURE__ */ jsx("span", { children: "\u0646" }),
|
|
8330
8786
|
/* @__PURE__ */ jsx("span", { children: "\u0633" })
|
|
8331
8787
|
] }) }),
|
|
8332
|
-
/* @__PURE__ */ jsx("button", { className: "icon-btn script-icon-btn", type: "button", title:
|
|
8788
|
+
/* @__PURE__ */ jsx("button", { className: "icon-btn script-icon-btn", type: "button", title: messages.addSubscript, "aria-label": messages.addSubscript, onClick: () => runtimeRef.current?.addSub(), children: /* @__PURE__ */ jsxs("span", { className: "toolbar-script-icon toolbar-script-icon--sub", "aria-hidden": "true", children: [
|
|
8333
8789
|
/* @__PURE__ */ jsx("span", { children: "\u0646" }),
|
|
8334
8790
|
/* @__PURE__ */ jsx("span", { children: "\u0633" })
|
|
8335
8791
|
] }) }),
|
|
8336
|
-
/* @__PURE__ */ jsx("button", { className: "icon-btn script-icon-btn remove-script-btn", type: "button", title:
|
|
8792
|
+
/* @__PURE__ */ jsx("button", { className: "icon-btn script-icon-btn remove-script-btn", type: "button", title: messages.removeSuperscript, "aria-label": messages.removeSuperscript, onClick: () => runtimeRef.current?.removeSup(), children: /* @__PURE__ */ jsxs("span", { className: "toolbar-remove-script-icon toolbar-remove-script-icon--sup", "aria-hidden": "true", children: [
|
|
8337
8793
|
/* @__PURE__ */ jsx("span", { children: "\u0646" }),
|
|
8338
8794
|
/* @__PURE__ */ jsx("span", { children: "\xD7" })
|
|
8339
8795
|
] }) }),
|
|
8340
|
-
/* @__PURE__ */ jsx("button", { className: "icon-btn script-icon-btn remove-script-btn", type: "button", title:
|
|
8796
|
+
/* @__PURE__ */ jsx("button", { className: "icon-btn script-icon-btn remove-script-btn", type: "button", title: messages.removeSubscript, "aria-label": messages.removeSubscript, onClick: () => runtimeRef.current?.removeSub(), children: /* @__PURE__ */ jsxs("span", { className: "toolbar-remove-script-icon toolbar-remove-script-icon--sub", "aria-hidden": "true", children: [
|
|
8341
8797
|
/* @__PURE__ */ jsx("span", { children: "\u0646" }),
|
|
8342
8798
|
/* @__PURE__ */ jsx("span", { children: "\xD7" })
|
|
8343
8799
|
] }) })
|
|
8344
8800
|
] }),
|
|
8345
|
-
/* @__PURE__ */ jsxs("div", { className: "toolbar-group toolbar-settings", role: "group", "aria-label":
|
|
8346
|
-
/* @__PURE__ */ jsx("button", { className: "icon-btn delete-node-btn", type: "button", title:
|
|
8347
|
-
/* @__PURE__ */ jsx("button", { ref: splitTypingBtnRef, id: "toggle-split-leaf-typing", className: "icon-btn ligature-btn", type: "button", title:
|
|
8801
|
+
/* @__PURE__ */ jsxs("div", { className: "toolbar-group toolbar-settings", role: "group", "aria-label": messages.inputStyles, children: [
|
|
8802
|
+
/* @__PURE__ */ jsx("button", { className: "icon-btn delete-node-btn", type: "button", title: messages.deleteSelectedStructure, "aria-label": messages.deleteSelectedStructure, onClick: () => runtimeRef.current?.deleteStructure(), children: "\xD7" }),
|
|
8803
|
+
/* @__PURE__ */ jsx("button", { ref: splitTypingBtnRef, id: "toggle-split-leaf-typing", className: "icon-btn ligature-btn", type: "button", title: messages.toggleLetterMerging, "aria-label": messages.toggleLetterMerging, onClick: () => runtimeRef.current?.toggleSplitLeafTyping(), children: "\u0633\u0635\u0639" }),
|
|
8348
8804
|
/* @__PURE__ */ jsxs(
|
|
8349
8805
|
"div",
|
|
8350
8806
|
{
|
|
@@ -8363,22 +8819,22 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
8363
8819
|
id: "select-character-font",
|
|
8364
8820
|
className: `icon-btn font-mode-btn font-mode-btn--${selectedCharacterFont}`,
|
|
8365
8821
|
type: "button",
|
|
8366
|
-
title:
|
|
8367
|
-
"aria-label":
|
|
8822
|
+
title: characterFontTitle(selectedCharacterFont, messages),
|
|
8823
|
+
"aria-label": messages.chooseWritingFont,
|
|
8368
8824
|
"aria-haspopup": "listbox",
|
|
8369
8825
|
"aria-expanded": characterFontMenuOpen,
|
|
8370
8826
|
onClick: () => setCharacterFontMenuOpen((open) => !open),
|
|
8371
8827
|
children: characterFontOption(selectedCharacterFont).label
|
|
8372
8828
|
}
|
|
8373
8829
|
),
|
|
8374
|
-
/* @__PURE__ */ jsx("div", { className: "character-font-options", role: "listbox", "aria-label":
|
|
8830
|
+
/* @__PURE__ */ jsx("div", { className: "character-font-options", role: "listbox", "aria-label": messages.chooseWritingFont, hidden: !characterFontMenuOpen, children: CHARACTER_FONT_OPTIONS.map((option) => /* @__PURE__ */ jsx(
|
|
8375
8831
|
"button",
|
|
8376
8832
|
{
|
|
8377
8833
|
type: "button",
|
|
8378
8834
|
role: "option",
|
|
8379
8835
|
"aria-selected": selectedCharacterFont === option.id,
|
|
8380
8836
|
className: `character-font-option character-font-option--${option.id}`,
|
|
8381
|
-
title: option.
|
|
8837
|
+
title: characterFontTitle(option.id, messages),
|
|
8382
8838
|
onMouseDown: (event) => event.preventDefault(),
|
|
8383
8839
|
onClick: () => {
|
|
8384
8840
|
runtimeRef.current?.setCurrentCharacterFont(option.id);
|
|
@@ -8411,22 +8867,22 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
8411
8867
|
id: "select-digit-form",
|
|
8412
8868
|
className: "icon-btn digit-form-btn",
|
|
8413
8869
|
type: "button",
|
|
8414
|
-
title:
|
|
8415
|
-
"aria-label":
|
|
8870
|
+
title: messages.chooseDigitForm,
|
|
8871
|
+
"aria-label": messages.chooseDigitForm,
|
|
8416
8872
|
"aria-haspopup": "listbox",
|
|
8417
8873
|
"aria-expanded": digitMenuOpen,
|
|
8418
8874
|
onClick: () => setDigitMenuOpen((open) => !open),
|
|
8419
8875
|
children: digitFormLabel(selectedDigitForm2)
|
|
8420
8876
|
}
|
|
8421
8877
|
),
|
|
8422
|
-
/* @__PURE__ */ jsx("div", { className: "digit-form-options", role: "listbox", "aria-label":
|
|
8878
|
+
/* @__PURE__ */ jsx("div", { className: "digit-form-options", role: "listbox", "aria-label": messages.chooseDigitForm, hidden: !digitMenuOpen, children: DIGIT_FORM_OPTIONS.map((option) => /* @__PURE__ */ jsx(
|
|
8423
8879
|
"button",
|
|
8424
8880
|
{
|
|
8425
8881
|
type: "button",
|
|
8426
8882
|
role: "option",
|
|
8427
8883
|
"aria-selected": selectedDigitForm2 === option.id,
|
|
8428
8884
|
className: "digit-form-option",
|
|
8429
|
-
title: option.
|
|
8885
|
+
title: digitFormTitle(option.id, messages),
|
|
8430
8886
|
onMouseDown: (event) => event.preventDefault(),
|
|
8431
8887
|
onClick: () => {
|
|
8432
8888
|
runtimeRef.current?.setCurrentDigitForm(option.id);
|
|
@@ -8450,15 +8906,15 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
8450
8906
|
id: "butex-editor-surface",
|
|
8451
8907
|
className: "surface surface--arabic",
|
|
8452
8908
|
tabIndex: 0,
|
|
8453
|
-
"aria-label":
|
|
8909
|
+
"aria-label": messages.equationEditor
|
|
8454
8910
|
}
|
|
8455
8911
|
),
|
|
8456
8912
|
/* @__PURE__ */ jsx("div", { ref: renderErrorRef, className: "error", hidden: true })
|
|
8457
8913
|
] }),
|
|
8458
|
-
/* @__PURE__ */ jsx("section", { className: "panel panel-preview", "aria-label":
|
|
8914
|
+
/* @__PURE__ */ jsx("section", { className: "panel panel-preview", "aria-label": messages.renderPreview, children: /* @__PURE__ */ jsx("div", { ref: mathOutputRef, className: "preview-box" }) }),
|
|
8459
8915
|
debug ? /* @__PURE__ */ jsxs("section", { className: "panel", children: [
|
|
8460
8916
|
/* @__PURE__ */ jsxs("div", { className: "dev-strip", children: [
|
|
8461
|
-
/* @__PURE__ */ jsx("span", { className: "dev-badge", children:
|
|
8917
|
+
/* @__PURE__ */ jsx("span", { className: "dev-badge", children: messages.development }),
|
|
8462
8918
|
/* @__PURE__ */ jsx("div", { ref: latexLinesRef, className: "ascii" }),
|
|
8463
8919
|
/* @__PURE__ */ jsx("div", { ref: passivePreviewRef, className: "passive-preview-text" })
|
|
8464
8920
|
] }),
|
|
@@ -8481,7 +8937,7 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
8481
8937
|
return next;
|
|
8482
8938
|
});
|
|
8483
8939
|
},
|
|
8484
|
-
children: debugBodyHidden ?
|
|
8940
|
+
children: debugBodyHidden ? messages.showDebugLog : messages.hideDebugLog
|
|
8485
8941
|
}
|
|
8486
8942
|
),
|
|
8487
8943
|
/* @__PURE__ */ jsx(
|
|
@@ -8495,7 +8951,7 @@ ${arabic || "\u0641\u0627\u0631\u063A"}`;
|
|
|
8495
8951
|
} catch {
|
|
8496
8952
|
}
|
|
8497
8953
|
},
|
|
8498
|
-
children:
|
|
8954
|
+
children: messages.copyDebugLog
|
|
8499
8955
|
}
|
|
8500
8956
|
)
|
|
8501
8957
|
] }),
|
|
@@ -8824,6 +9280,24 @@ var DOCUMENT_WIDGET_CSS = `
|
|
|
8824
9280
|
margin: 0 0 12px;
|
|
8825
9281
|
}
|
|
8826
9282
|
|
|
9283
|
+
.butex-document-widget__preview h1 {
|
|
9284
|
+
font-size: 1.75rem;
|
|
9285
|
+
font-weight: 700;
|
|
9286
|
+
line-height: 1.35;
|
|
9287
|
+
}
|
|
9288
|
+
|
|
9289
|
+
.butex-document-widget__preview h2 {
|
|
9290
|
+
font-size: 1.4rem;
|
|
9291
|
+
font-weight: 600;
|
|
9292
|
+
line-height: 1.4;
|
|
9293
|
+
}
|
|
9294
|
+
|
|
9295
|
+
.butex-document-widget__preview h3 {
|
|
9296
|
+
font-size: 1.2rem;
|
|
9297
|
+
font-weight: 600;
|
|
9298
|
+
line-height: 1.45;
|
|
9299
|
+
}
|
|
9300
|
+
|
|
8827
9301
|
.butex-document-widget__preview ul,
|
|
8828
9302
|
.butex-document-widget__preview ol {
|
|
8829
9303
|
margin: 0 0 12px;
|