@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/index.global.js
CHANGED
|
@@ -1210,6 +1210,321 @@ mjx-container[jax="SVG"] svg .butex-preview-mirror {
|
|
|
1210
1210
|
return wrap;
|
|
1211
1211
|
}
|
|
1212
1212
|
|
|
1213
|
+
// src/editor/uiLocale.ts
|
|
1214
|
+
var ENGLISH_COMMAND_TITLES = {
|
|
1215
|
+
cos: "Cosine",
|
|
1216
|
+
sin: "Sine",
|
|
1217
|
+
tan: "Tangent",
|
|
1218
|
+
cot: "Cotangent",
|
|
1219
|
+
sec: "Secant",
|
|
1220
|
+
csc: "Cosecant",
|
|
1221
|
+
arccos: "Inverse cosine",
|
|
1222
|
+
arcsin: "Inverse sine",
|
|
1223
|
+
arctan: "Inverse tangent",
|
|
1224
|
+
arccot: "Inverse cotangent",
|
|
1225
|
+
arcsec: "Inverse secant",
|
|
1226
|
+
arccsc: "Inverse cosecant",
|
|
1227
|
+
cosh: "Hyperbolic cosine",
|
|
1228
|
+
sinh: "Hyperbolic sine",
|
|
1229
|
+
tanh: "Hyperbolic tangent",
|
|
1230
|
+
coth: "Hyperbolic cotangent",
|
|
1231
|
+
sum: "Sum",
|
|
1232
|
+
prod: "Product",
|
|
1233
|
+
lim: "Limit",
|
|
1234
|
+
max: "Maximum",
|
|
1235
|
+
min: "Minimum",
|
|
1236
|
+
sup: "Supremum",
|
|
1237
|
+
inf: "Infimum",
|
|
1238
|
+
pi: "Pi",
|
|
1239
|
+
exp: "Exponential",
|
|
1240
|
+
ln: "Natural logarithm",
|
|
1241
|
+
log: "Logarithm",
|
|
1242
|
+
det: "Determinant",
|
|
1243
|
+
N: "Natural numbers",
|
|
1244
|
+
Z: "Integers",
|
|
1245
|
+
Q: "Rational numbers",
|
|
1246
|
+
R: "Real numbers",
|
|
1247
|
+
C: "Complex numbers",
|
|
1248
|
+
H: "Quaternions",
|
|
1249
|
+
negThinSpace: "Negative thin space",
|
|
1250
|
+
mediumSpace: "Medium space",
|
|
1251
|
+
thickSpace: "Thick space",
|
|
1252
|
+
quadSpace: "Large space",
|
|
1253
|
+
qquadSpace: "Extra-large space"
|
|
1254
|
+
};
|
|
1255
|
+
var ENGLISH_OPERATOR_TITLES = {
|
|
1256
|
+
inf: "Infinity",
|
|
1257
|
+
times: "Multiplication",
|
|
1258
|
+
div: "Division",
|
|
1259
|
+
pm: "Plus or minus",
|
|
1260
|
+
mp: "Minus or plus",
|
|
1261
|
+
neq: "Not equal",
|
|
1262
|
+
approx: "Approximately equal",
|
|
1263
|
+
sim: "Similar",
|
|
1264
|
+
mid: "Divides",
|
|
1265
|
+
leq: "Less than or equal",
|
|
1266
|
+
geq: "Greater than or equal",
|
|
1267
|
+
coloneqq: "Defined as equal to",
|
|
1268
|
+
eqqcolon: "Equal by definition",
|
|
1269
|
+
propto: "Proportional to",
|
|
1270
|
+
in: "Element of",
|
|
1271
|
+
notin: "Not an element of",
|
|
1272
|
+
subset: "Subset of",
|
|
1273
|
+
supset: "Superset of",
|
|
1274
|
+
subseteq: "Subset of or equal",
|
|
1275
|
+
supseteq: "Superset of or equal",
|
|
1276
|
+
cap: "Intersection",
|
|
1277
|
+
cup: "Union",
|
|
1278
|
+
emptyset: "Empty set",
|
|
1279
|
+
nsubseteq: "Not a subset of or equal",
|
|
1280
|
+
nsupseteq: "Not a superset of or equal",
|
|
1281
|
+
ldots: "Horizontal dots",
|
|
1282
|
+
cdot: "Multiplication dot",
|
|
1283
|
+
cdots: "Centered horizontal dots",
|
|
1284
|
+
vdots: "Vertical dots",
|
|
1285
|
+
ddots: "Diagonal dots",
|
|
1286
|
+
leftrightarrowDouble: "Equivalent",
|
|
1287
|
+
implies: "Implies",
|
|
1288
|
+
impliedby: "Implied by",
|
|
1289
|
+
iff: "If and only if",
|
|
1290
|
+
Longrightarrow: "Long double arrow right",
|
|
1291
|
+
Longleftarrow: "Long double arrow left",
|
|
1292
|
+
to: "Maps to",
|
|
1293
|
+
rightleftharpoons: "Equilibrium",
|
|
1294
|
+
leftarrow: "Left arrow",
|
|
1295
|
+
rightarrow: "Right arrow",
|
|
1296
|
+
leftarrowDouble: "Double left arrow",
|
|
1297
|
+
rightarrowDouble: "Double right arrow",
|
|
1298
|
+
leftharpoonup: "Upper left harpoon",
|
|
1299
|
+
rightharpoonup: "Upper right harpoon",
|
|
1300
|
+
leftharpoondown: "Lower left harpoon",
|
|
1301
|
+
rightharpoondown: "Lower right harpoon",
|
|
1302
|
+
int: "Integral",
|
|
1303
|
+
iint: "Double integral",
|
|
1304
|
+
iiint: "Triple integral",
|
|
1305
|
+
iiiint: "Quadruple integral",
|
|
1306
|
+
oint: "Contour integral",
|
|
1307
|
+
oiint: "Closed surface integral",
|
|
1308
|
+
oiiint: "Closed volume integral"
|
|
1309
|
+
};
|
|
1310
|
+
var EQUATION_EDITOR_MESSAGES = {
|
|
1311
|
+
ar: {
|
|
1312
|
+
undoRedo: "\u062A\u0631\u0627\u062C\u0639 \u0648\u0625\u0639\u0627\u062F\u0629",
|
|
1313
|
+
undo: "\u062A\u0631\u0627\u062C\u0639",
|
|
1314
|
+
redo: "\u0625\u0639\u0627\u062F\u0629",
|
|
1315
|
+
clipboard: "\u0627\u0644\u062D\u0627\u0641\u0638\u0629",
|
|
1316
|
+
copy: "\u0646\u0633\u062E",
|
|
1317
|
+
cut: "\u0642\u0635",
|
|
1318
|
+
paste: "\u0644\u0635\u0642",
|
|
1319
|
+
editorSettings: "\u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0627\u0644\u0645\u062D\u0631\u0631",
|
|
1320
|
+
toggleSide: "\u062A\u0628\u062F\u064A\u0644 \u0639\u0631\u0628\u064A / \u0625\u0646\u062C\u0644\u064A\u0632\u064A",
|
|
1321
|
+
structures: "\u0627\u0644\u0628\u0646\u0649",
|
|
1322
|
+
insertDelimiters: "\u0625\u062F\u0631\u0627\u062C \u0645\u062D\u062F\u062F\u0627\u062A",
|
|
1323
|
+
insertParentheses: "\u0625\u062F\u0631\u0627\u062C \u0642\u0648\u0633\u064A\u0646",
|
|
1324
|
+
insertBrackets: "\u0625\u062F\u0631\u0627\u062C \u0645\u0639\u0642\u0648\u0641\u064A\u0646",
|
|
1325
|
+
insertBraces: "\u0625\u062F\u0631\u0627\u062C \u062D\u0627\u0635\u0631\u062A\u064A\u0646",
|
|
1326
|
+
insertFraction: "\u0625\u062F\u0631\u0627\u062C \u0643\u0633\u0631",
|
|
1327
|
+
insertRoot: "\u0625\u062F\u0631\u0627\u062C \u062C\u0630\u0631",
|
|
1328
|
+
environments: "\u0627\u0644\u0628\u064A\u0626\u0627\u062A",
|
|
1329
|
+
insertEnvironment: "\u0625\u062F\u0631\u0627\u062C \u0628\u064A\u0626\u0629 \u0634\u0628\u0643\u064A\u0629",
|
|
1330
|
+
environmentType: "\u0646\u0648\u0639 \u0627\u0644\u0628\u064A\u0626\u0629",
|
|
1331
|
+
matrix: "\u0645\u0635\u0641\u0648\u0641\u0629",
|
|
1332
|
+
array: "\u062C\u062F\u0648\u0644",
|
|
1333
|
+
aligned: "\u0645\u062D\u0627\u0630\u0627\u0629",
|
|
1334
|
+
matrixType: "\u0646\u0648\u0639 \u0627\u0644\u0645\u0635\u0641\u0648\u0641\u0629",
|
|
1335
|
+
chooseEnvironmentSize: "\u0627\u062E\u062A\u064A\u0627\u0631 \u062D\u062C\u0645 \u0627\u0644\u0628\u064A\u0626\u0629",
|
|
1336
|
+
rows: "\u0635\u0641\u0648\u0641",
|
|
1337
|
+
columns: "\u0623\u0639\u0645\u062F\u0629",
|
|
1338
|
+
row: "\u0635\u0641",
|
|
1339
|
+
column: "\u0639\u0645\u0648\u062F",
|
|
1340
|
+
insert: "\u0625\u062F\u0631\u0627\u062C",
|
|
1341
|
+
editSelectedEnvironment: "\u062A\u0639\u062F\u064A\u0644 \u0627\u0644\u0628\u064A\u0626\u0629 \u0627\u0644\u0645\u062D\u062F\u062F\u0629",
|
|
1342
|
+
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",
|
|
1343
|
+
applyStyle: "\u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0646\u0645\u0637",
|
|
1344
|
+
addRow: "\u0625\u0636\u0627\u0641\u0629 \u0635\u0641",
|
|
1345
|
+
removeRow: "\u062D\u0630\u0641 \u0635\u0641",
|
|
1346
|
+
addColumn: "\u0625\u0636\u0627\u0641\u0629 \u0639\u0645\u0648\u062F",
|
|
1347
|
+
removeColumn: "\u062D\u0630\u0641 \u0639\u0645\u0648\u062F",
|
|
1348
|
+
spaces: "\u0627\u0644\u0641\u0631\u0627\u063A\u0627\u062A",
|
|
1349
|
+
insertSpace: "\u0625\u062F\u0631\u0627\u062C \u0641\u0631\u0627\u063A",
|
|
1350
|
+
functions: "\u0627\u0644\u062F\u0648\u0627\u0644",
|
|
1351
|
+
insertFunction: "\u0625\u062F\u0631\u0627\u062C \u062F\u0627\u0644\u0629",
|
|
1352
|
+
insertLimitsSeries: "\u0625\u062F\u0631\u0627\u062C \u062D\u062F\u0648\u062F \u0648\u0645\u062A\u0633\u0644\u0633\u0644\u0627\u062A",
|
|
1353
|
+
insertAdditionalFunctions: "\u0625\u062F\u0631\u0627\u062C \u062F\u0648\u0627\u0644 \u0625\u0636\u0627\u0641\u064A\u0629",
|
|
1354
|
+
insertNumberSets: "\u0625\u062F\u0631\u0627\u062C \u0645\u062C\u0645\u0648\u0639\u0627\u062A \u0623\u0639\u062F\u0627\u062F",
|
|
1355
|
+
operations: "\u0627\u0644\u0639\u0645\u0644\u064A\u0627\u062A",
|
|
1356
|
+
insertOperation: "\u0625\u062F\u0631\u0627\u062C \u0631\u0645\u0632 \u0639\u0645\u0644\u064A\u0629",
|
|
1357
|
+
insertRelationsSets: "\u0625\u062F\u0631\u0627\u062C \u0631\u0645\u0648\u0632 \u0639\u0644\u0627\u0642\u0627\u062A \u0648\u0645\u062C\u0645\u0648\u0639\u0627\u062A",
|
|
1358
|
+
insertArrows: "\u0625\u062F\u0631\u0627\u062C \u0623\u0633\u0647\u0645",
|
|
1359
|
+
insertDots: "\u0625\u062F\u0631\u0627\u062C \u0646\u0642\u0627\u0637",
|
|
1360
|
+
insertIntegrals: "\u0625\u062F\u0631\u0627\u062C \u062A\u0643\u0627\u0645\u0644\u0627\u062A",
|
|
1361
|
+
scripts: "\u0627\u0644\u0623\u0633 \u0648\u0627\u0644\u0633\u0641\u0644\u064A",
|
|
1362
|
+
addSuperscript: "\u0625\u0636\u0627\u0641\u0629 \u0623\u0633",
|
|
1363
|
+
addSubscript: "\u0625\u0636\u0627\u0641\u0629 \u0633\u0641\u0644\u064A",
|
|
1364
|
+
removeSuperscript: "\u0625\u0632\u0627\u0644\u0629 \u0627\u0644\u0623\u0633",
|
|
1365
|
+
removeSubscript: "\u0625\u0632\u0627\u0644\u0629 \u0627\u0644\u0633\u0641\u0644\u064A",
|
|
1366
|
+
inputStyles: "\u0623\u0646\u0645\u0627\u0637 \u0627\u0644\u0625\u062F\u062E\u0627\u0644",
|
|
1367
|
+
deleteSelectedStructure: "\u062D\u0630\u0641 \u0627\u0644\u0628\u0646\u064A\u0629 \u0627\u0644\u0645\u062D\u062F\u062F\u0629",
|
|
1368
|
+
toggleLetterMerging: "\u062A\u0628\u062F\u064A\u0644 \u062F\u0645\u062C \u0627\u0644\u062D\u0631\u0648\u0641",
|
|
1369
|
+
disableLetterMerging: "\u062A\u0639\u0637\u064A\u0644 \u062F\u0645\u062C \u0627\u0644\u062D\u0631\u0648\u0641",
|
|
1370
|
+
enableLetterMerging: "\u062A\u0641\u0639\u064A\u0644 \u062F\u0645\u062C \u0627\u0644\u062D\u0631\u0648\u0641",
|
|
1371
|
+
chooseWritingFont: "\u0627\u062E\u062A\u064A\u0627\u0631 \u062E\u0637 \u0627\u0644\u0643\u062A\u0627\u0628\u0629",
|
|
1372
|
+
chooseDigitForm: "\u0627\u062E\u062A\u064A\u0627\u0631 \u0634\u0643\u0644 \u0627\u0644\u0623\u0631\u0642\u0627\u0645",
|
|
1373
|
+
defaultFont: "\u0627\u0644\u062E\u0637 \u0627\u0644\u0627\u0641\u062A\u0631\u0627\u0636\u064A",
|
|
1374
|
+
takweenFont: "\u062E\u0637 \u062A\u0643\u0648\u064A\u0646",
|
|
1375
|
+
diwaniFont: "\u062E\u0637 \u062F\u064A\u0648\u0627\u0646\u064A",
|
|
1376
|
+
diwaniOutlineFont: "\u062E\u0637 \u062F\u064A\u0648\u0627\u0646\u064A \u0645\u0638\u0644\u0644",
|
|
1377
|
+
writeDefaultFont: "\u0627\u0644\u0643\u062A\u0627\u0628\u0629 \u0628\u0627\u0644\u062E\u0637 \u0627\u0644\u0627\u0641\u062A\u0631\u0627\u0636\u064A",
|
|
1378
|
+
writeTakweenFont: "\u0627\u0644\u0643\u062A\u0627\u0628\u0629 \u0628\u062E\u0637 \u062A\u0643\u0648\u064A\u0646",
|
|
1379
|
+
westernDigits: "\u0623\u0631\u0642\u0627\u0645 \u063A\u0631\u0628\u064A\u0629",
|
|
1380
|
+
arabicIndicDigits: "\u0623\u0631\u0642\u0627\u0645 \u0639\u0631\u0628\u064A\u0629 \u0647\u0646\u062F\u064A\u0629",
|
|
1381
|
+
persianIndicDigits: "\u0623\u0631\u0642\u0627\u0645 \u0641\u0627\u0631\u0633\u064A\u0629 \u0647\u0646\u062F\u064A\u0629",
|
|
1382
|
+
equationEditor: "\u0645\u062D\u0631\u0631 \u0627\u0644\u0645\u0639\u0627\u062F\u0644\u0627\u062A",
|
|
1383
|
+
renderPreview: "\u0645\u0639\u0627\u064A\u0646\u0629 \u0627\u0644\u0631\u0633\u0645",
|
|
1384
|
+
development: "\u062A\u0637\u0648\u064A\u0631",
|
|
1385
|
+
showDebugLog: "\u0625\u0638\u0647\u0627\u0631 \u0633\u062C\u0644 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",
|
|
1386
|
+
hideDebugLog: "\u0625\u062E\u0641\u0627\u0621 \u0633\u062C\u0644 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",
|
|
1387
|
+
copyDebugLog: "\u0646\u0633\u062E \u0633\u062C\u0644 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",
|
|
1388
|
+
empty: "\u0641\u0627\u0631\u063A",
|
|
1389
|
+
englishLatex: "LaTeX \u0625\u0646\u062C\u0644\u064A\u0632\u064A",
|
|
1390
|
+
arabicLatex: "LaTeX \u0639\u0631\u0628\u064A",
|
|
1391
|
+
inactiveEnglish: "\u0627\u0644\u0633\u0644\u0633\u0644\u0629 \u063A\u064A\u0631 \u0627\u0644\u0646\u0634\u0637\u0629 (\u0625\u0646\u062C\u0644\u064A\u0632\u064A)",
|
|
1392
|
+
inactiveArabic: "\u0627\u0644\u0633\u0644\u0633\u0644\u0629 \u063A\u064A\u0631 \u0627\u0644\u0646\u0634\u0637\u0629 (\u0639\u0631\u0628\u064A)",
|
|
1393
|
+
mathJaxError: "\u062E\u0637\u0623 MathJax",
|
|
1394
|
+
previewError: "\u062E\u0637\u0623 \u0641\u064A \u0627\u0644\u0645\u0639\u0627\u064A\u0646\u0629",
|
|
1395
|
+
activeSide: "\u0627\u0644\u062C\u0627\u0646\u0628 \u0627\u0644\u0646\u0634\u0637",
|
|
1396
|
+
syncState: "\u062D\u0627\u0644\u0629 \u0627\u0644\u0645\u0632\u0627\u0645\u0646\u0629",
|
|
1397
|
+
arabicSide: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629",
|
|
1398
|
+
englishSide: "\u0627\u0644\u0625\u0646\u062C\u0644\u064A\u0632\u064A\u0629",
|
|
1399
|
+
synced: "\u0645\u062A\u0632\u0627\u0645\u0646",
|
|
1400
|
+
differentItems: "\u0639\u0646\u0627\u0635\u0631 \u0645\u062E\u062A\u0644\u0641\u0629",
|
|
1401
|
+
alignLeft: "\u064A\u0633\u0627\u0631",
|
|
1402
|
+
alignCenter: "\u0648\u0633\u0637",
|
|
1403
|
+
alignRight: "\u064A\u0645\u064A\u0646",
|
|
1404
|
+
alignColumnLeft: "\u0645\u062D\u0627\u0630\u0627\u0629 \u0627\u0644\u0639\u0645\u0648\u062F \u0625\u0644\u0649 \u0627\u0644\u064A\u0633\u0627\u0631",
|
|
1405
|
+
alignColumnCenter: "\u0645\u062D\u0627\u0630\u0627\u0629 \u0627\u0644\u0639\u0645\u0648\u062F \u0641\u064A \u0627\u0644\u0648\u0633\u0637",
|
|
1406
|
+
alignColumnRight: "\u0645\u062D\u0627\u0630\u0627\u0629 \u0627\u0644\u0639\u0645\u0648\u062F \u0625\u0644\u0649 \u0627\u0644\u064A\u0645\u064A\u0646",
|
|
1407
|
+
matrixNoDelimiters: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u0644\u0627 \u0623\u0642\u0648\u0627\u0633",
|
|
1408
|
+
matrixParentheses: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u064A\u0646 \u0642\u0648\u0633\u064A\u0646",
|
|
1409
|
+
matrixBrackets: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u064A\u0646 \u0645\u0639\u0642\u0648\u0641\u064A\u0646",
|
|
1410
|
+
matrixBraces: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u064A\u0646 \u062D\u0627\u0635\u0631\u062A\u064A\u0646",
|
|
1411
|
+
matrixBars: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u064A\u0646 \u062E\u0637\u064A\u0646",
|
|
1412
|
+
matrixDoubleBars: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u064A\u0646 \u062E\u0637\u064A\u0646 \u0645\u0632\u062F\u0648\u062C\u064A\u0646"
|
|
1413
|
+
},
|
|
1414
|
+
en: {
|
|
1415
|
+
undoRedo: "Undo and redo",
|
|
1416
|
+
undo: "Undo",
|
|
1417
|
+
redo: "Redo",
|
|
1418
|
+
clipboard: "Clipboard",
|
|
1419
|
+
copy: "Copy",
|
|
1420
|
+
cut: "Cut",
|
|
1421
|
+
paste: "Paste",
|
|
1422
|
+
editorSettings: "Editor settings",
|
|
1423
|
+
toggleSide: "Switch Arabic / English equation side",
|
|
1424
|
+
structures: "Structures",
|
|
1425
|
+
insertDelimiters: "Insert delimiters",
|
|
1426
|
+
insertParentheses: "Insert parentheses",
|
|
1427
|
+
insertBrackets: "Insert brackets",
|
|
1428
|
+
insertBraces: "Insert braces",
|
|
1429
|
+
insertFraction: "Insert fraction",
|
|
1430
|
+
insertRoot: "Insert root",
|
|
1431
|
+
environments: "Environments",
|
|
1432
|
+
insertEnvironment: "Insert grid environment",
|
|
1433
|
+
environmentType: "Environment type",
|
|
1434
|
+
matrix: "Matrix",
|
|
1435
|
+
array: "Array",
|
|
1436
|
+
aligned: "Aligned",
|
|
1437
|
+
matrixType: "Matrix type",
|
|
1438
|
+
chooseEnvironmentSize: "Choose environment size",
|
|
1439
|
+
rows: "Rows",
|
|
1440
|
+
columns: "Columns",
|
|
1441
|
+
row: "Row",
|
|
1442
|
+
column: "Column",
|
|
1443
|
+
insert: "Insert",
|
|
1444
|
+
editSelectedEnvironment: "Edit selected environment",
|
|
1445
|
+
applySelectedMatrixStyle: "Apply style to selected matrix",
|
|
1446
|
+
applyStyle: "Apply style",
|
|
1447
|
+
addRow: "Add row",
|
|
1448
|
+
removeRow: "Remove row",
|
|
1449
|
+
addColumn: "Add column",
|
|
1450
|
+
removeColumn: "Remove column",
|
|
1451
|
+
spaces: "Spacing",
|
|
1452
|
+
insertSpace: "Insert space",
|
|
1453
|
+
functions: "Functions",
|
|
1454
|
+
insertFunction: "Insert function",
|
|
1455
|
+
insertLimitsSeries: "Insert limits and series",
|
|
1456
|
+
insertAdditionalFunctions: "Insert additional functions",
|
|
1457
|
+
insertNumberSets: "Insert number sets",
|
|
1458
|
+
operations: "Operators",
|
|
1459
|
+
insertOperation: "Insert operator",
|
|
1460
|
+
insertRelationsSets: "Insert relation or set symbol",
|
|
1461
|
+
insertArrows: "Insert arrow",
|
|
1462
|
+
insertDots: "Insert dots",
|
|
1463
|
+
insertIntegrals: "Insert integral",
|
|
1464
|
+
scripts: "Superscript and subscript",
|
|
1465
|
+
addSuperscript: "Add superscript",
|
|
1466
|
+
addSubscript: "Add subscript",
|
|
1467
|
+
removeSuperscript: "Remove superscript",
|
|
1468
|
+
removeSubscript: "Remove subscript",
|
|
1469
|
+
inputStyles: "Input styles",
|
|
1470
|
+
deleteSelectedStructure: "Delete selected structure",
|
|
1471
|
+
toggleLetterMerging: "Toggle letter merging",
|
|
1472
|
+
disableLetterMerging: "Disable letter merging",
|
|
1473
|
+
enableLetterMerging: "Enable letter merging",
|
|
1474
|
+
chooseWritingFont: "Choose writing font",
|
|
1475
|
+
chooseDigitForm: "Choose digit form",
|
|
1476
|
+
defaultFont: "Default font",
|
|
1477
|
+
takweenFont: "Takween font",
|
|
1478
|
+
diwaniFont: "Diwani font",
|
|
1479
|
+
diwaniOutlineFont: "Outlined Diwani font",
|
|
1480
|
+
writeDefaultFont: "Write with the default font",
|
|
1481
|
+
writeTakweenFont: "Write with Takween font",
|
|
1482
|
+
westernDigits: "Western digits",
|
|
1483
|
+
arabicIndicDigits: "Arabic-Indic digits",
|
|
1484
|
+
persianIndicDigits: "Persian digits",
|
|
1485
|
+
equationEditor: "Equation editor",
|
|
1486
|
+
renderPreview: "Rendered preview",
|
|
1487
|
+
development: "Development",
|
|
1488
|
+
showDebugLog: "Show debug log",
|
|
1489
|
+
hideDebugLog: "Hide debug log",
|
|
1490
|
+
copyDebugLog: "Copy debug log",
|
|
1491
|
+
empty: "Empty",
|
|
1492
|
+
englishLatex: "English LaTeX",
|
|
1493
|
+
arabicLatex: "Arabic LaTeX",
|
|
1494
|
+
inactiveEnglish: "Inactive chain (English)",
|
|
1495
|
+
inactiveArabic: "Inactive chain (Arabic)",
|
|
1496
|
+
mathJaxError: "MathJax error",
|
|
1497
|
+
previewError: "Preview error",
|
|
1498
|
+
activeSide: "Active side",
|
|
1499
|
+
syncState: "Sync state",
|
|
1500
|
+
arabicSide: "Arabic",
|
|
1501
|
+
englishSide: "English",
|
|
1502
|
+
synced: "Synced",
|
|
1503
|
+
differentItems: "different items",
|
|
1504
|
+
alignLeft: "Left",
|
|
1505
|
+
alignCenter: "Center",
|
|
1506
|
+
alignRight: "Right",
|
|
1507
|
+
alignColumnLeft: "Align column left",
|
|
1508
|
+
alignColumnCenter: "Align column center",
|
|
1509
|
+
alignColumnRight: "Align column right",
|
|
1510
|
+
matrixNoDelimiters: "Matrix without delimiters",
|
|
1511
|
+
matrixParentheses: "Matrix in parentheses",
|
|
1512
|
+
matrixBrackets: "Matrix in brackets",
|
|
1513
|
+
matrixBraces: "Matrix in braces",
|
|
1514
|
+
matrixBars: "Matrix between bars",
|
|
1515
|
+
matrixDoubleBars: "Matrix between double bars"
|
|
1516
|
+
}
|
|
1517
|
+
};
|
|
1518
|
+
function equationEditorMessages(locale) {
|
|
1519
|
+
return EQUATION_EDITOR_MESSAGES[locale];
|
|
1520
|
+
}
|
|
1521
|
+
function atomicCommandTitle(spec, locale) {
|
|
1522
|
+
return locale === "en" ? ENGLISH_COMMAND_TITLES[spec.id] ?? spec.title : spec.title;
|
|
1523
|
+
}
|
|
1524
|
+
function atomicOperatorCommandTitle(spec, locale) {
|
|
1525
|
+
return locale === "en" ? ENGLISH_OPERATOR_TITLES[spec.id] ?? spec.title : spec.title;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1213
1528
|
// src/editor/display/atomicCommand.ts
|
|
1214
1529
|
var ATOMIC_COMMAND_CSS = `
|
|
1215
1530
|
/* Shared atomic-command display */
|
|
@@ -1283,8 +1598,8 @@ mjx-container[jax="SVG"] svg .butex-preview-mirror {
|
|
|
1283
1598
|
}
|
|
1284
1599
|
return side === "arabic" ? "\u2192" : "\u2190";
|
|
1285
1600
|
}
|
|
1286
|
-
function spacingTooltipForSide(spec, side) {
|
|
1287
|
-
return `${spec
|
|
1601
|
+
function spacingTooltipForSide(spec, side, uiLocale = "ar") {
|
|
1602
|
+
return `${atomicCommandTitle(spec, uiLocale)} ${spacingArrowForSide(spec, side).repeat(spec.spacing.level)}`;
|
|
1288
1603
|
}
|
|
1289
1604
|
function buildFunctionAtomicCommandBody(node, side, spec) {
|
|
1290
1605
|
const value = document.createElement("span");
|
|
@@ -1308,19 +1623,19 @@ mjx-container[jax="SVG"] svg .butex-preview-mirror {
|
|
|
1308
1623
|
value.textContent = side === "arabic" ? spec?.arabicLabel ?? node.expr : spec?.englishTex.replace("\\", "") ?? node.expr;
|
|
1309
1624
|
return value;
|
|
1310
1625
|
}
|
|
1311
|
-
function buildSpacingAtomicCommandBody(spec, side) {
|
|
1626
|
+
function buildSpacingAtomicCommandBody(spec, side, uiLocale) {
|
|
1312
1627
|
const value = document.createElement("span");
|
|
1313
1628
|
value.className = `atomic-spacing atomic-spacing--${spec.spacing.direction} atomic-spacing--level-${String(spec.spacing.level)}`;
|
|
1314
|
-
value.title = spacingTooltipForSide(spec, side);
|
|
1629
|
+
value.title = spacingTooltipForSide(spec, side, uiLocale);
|
|
1315
1630
|
const marker = document.createElement("span");
|
|
1316
1631
|
marker.className = "atomic-spacing__marker";
|
|
1317
1632
|
value.appendChild(marker);
|
|
1318
1633
|
return value;
|
|
1319
1634
|
}
|
|
1320
|
-
function buildAtomicCommandNodeBody(node, side) {
|
|
1635
|
+
function buildAtomicCommandNodeBody(node, side, uiLocale = "ar") {
|
|
1321
1636
|
const spec = atomicCommandSpec(node.expr);
|
|
1322
1637
|
if (isSpacingCommandSpec(spec)) {
|
|
1323
|
-
return buildSpacingAtomicCommandBody(spec, side);
|
|
1638
|
+
return buildSpacingAtomicCommandBody(spec, side, uiLocale);
|
|
1324
1639
|
}
|
|
1325
1640
|
return buildFunctionAtomicCommandBody(node, side, spec);
|
|
1326
1641
|
}
|
|
@@ -1426,6 +1741,24 @@ mjx-container[jax="SVG"] svg .butex-preview-mirror {
|
|
|
1426
1741
|
title: "\u0623\u0643\u0628\u0631 \u0645\u0646 \u0623\u0648 \u064A\u0633\u0627\u0648\u064A",
|
|
1427
1742
|
svg_path: null
|
|
1428
1743
|
},
|
|
1744
|
+
coloneqq: {
|
|
1745
|
+
id: "coloneqq",
|
|
1746
|
+
category: "operators1",
|
|
1747
|
+
Tex: "\\coloneqq",
|
|
1748
|
+
mirror: true,
|
|
1749
|
+
Label: "\u2254",
|
|
1750
|
+
title: "\u064A\u0639\u0631\u0641 \u0628\u0623\u0646\u0647 \u064A\u0633\u0627\u0648\u064A",
|
|
1751
|
+
svg_path: null
|
|
1752
|
+
},
|
|
1753
|
+
eqqcolon: {
|
|
1754
|
+
id: "eqqcolon",
|
|
1755
|
+
category: "operators1",
|
|
1756
|
+
Tex: "\\eqqcolon",
|
|
1757
|
+
mirror: true,
|
|
1758
|
+
Label: "\u2255",
|
|
1759
|
+
title: "\u064A\u0633\u0627\u0648\u064A \u0628\u0627\u0644\u062A\u0639\u0631\u064A\u0641",
|
|
1760
|
+
svg_path: null
|
|
1761
|
+
},
|
|
1429
1762
|
///// Operators 2
|
|
1430
1763
|
propto: {
|
|
1431
1764
|
id: "propto",
|
|
@@ -1592,6 +1925,60 @@ mjx-container[jax="SVG"] svg .butex-preview-mirror {
|
|
|
1592
1925
|
title: "\u064A\u0643\u0627\u0641\u0626",
|
|
1593
1926
|
svg_path: null
|
|
1594
1927
|
},
|
|
1928
|
+
implies: {
|
|
1929
|
+
id: "implies",
|
|
1930
|
+
category: "operators3",
|
|
1931
|
+
Tex: "\\implies",
|
|
1932
|
+
mirror: true,
|
|
1933
|
+
Label: "\u21D2",
|
|
1934
|
+
title: "\u064A\u0633\u062A\u0644\u0632\u0645",
|
|
1935
|
+
svg_path: null
|
|
1936
|
+
},
|
|
1937
|
+
impliedby: {
|
|
1938
|
+
id: "impliedby",
|
|
1939
|
+
category: "operators3",
|
|
1940
|
+
Tex: "\\impliedby",
|
|
1941
|
+
mirror: true,
|
|
1942
|
+
Label: "\u21D0",
|
|
1943
|
+
title: "\u0645\u0633\u062A\u0644\u0632\u0645 \u0645\u0646",
|
|
1944
|
+
svg_path: null
|
|
1945
|
+
},
|
|
1946
|
+
iff: {
|
|
1947
|
+
id: "iff",
|
|
1948
|
+
category: "operators3",
|
|
1949
|
+
Tex: "\\iff",
|
|
1950
|
+
mirror: false,
|
|
1951
|
+
Label: "\u21D4",
|
|
1952
|
+
title: "\u0625\u0630\u0627 \u0648\u0641\u0642\u0637 \u0625\u0630\u0627",
|
|
1953
|
+
svg_path: null
|
|
1954
|
+
},
|
|
1955
|
+
Longrightarrow: {
|
|
1956
|
+
id: "Longrightarrow",
|
|
1957
|
+
category: "operators3",
|
|
1958
|
+
Tex: "\\Longrightarrow",
|
|
1959
|
+
mirror: true,
|
|
1960
|
+
Label: "\u27F9",
|
|
1961
|
+
title: "\u0633\u0647\u0645 \u0645\u0632\u062F\u0648\u062C \u0637\u0648\u064A\u0644 \u0625\u0644\u0649 \u0627\u0644\u064A\u0645\u064A\u0646",
|
|
1962
|
+
svg_path: null
|
|
1963
|
+
},
|
|
1964
|
+
Longleftarrow: {
|
|
1965
|
+
id: "Longleftarrow",
|
|
1966
|
+
category: "operators3",
|
|
1967
|
+
Tex: "\\Longleftarrow",
|
|
1968
|
+
mirror: true,
|
|
1969
|
+
Label: "\u27F8",
|
|
1970
|
+
title: "\u0633\u0647\u0645 \u0645\u0632\u062F\u0648\u062C \u0637\u0648\u064A\u0644 \u0625\u0644\u0649 \u0627\u0644\u064A\u0633\u0627\u0631",
|
|
1971
|
+
svg_path: null
|
|
1972
|
+
},
|
|
1973
|
+
to: {
|
|
1974
|
+
id: "to",
|
|
1975
|
+
category: "operators3",
|
|
1976
|
+
Tex: "\\to",
|
|
1977
|
+
mirror: true,
|
|
1978
|
+
Label: "\u2192",
|
|
1979
|
+
title: "\u064A\u0624\u0648\u0644 \u0625\u0644\u0649",
|
|
1980
|
+
svg_path: null
|
|
1981
|
+
},
|
|
1595
1982
|
rightleftharpoons: {
|
|
1596
1983
|
id: "rightleftharpoons",
|
|
1597
1984
|
category: "operators3",
|
|
@@ -1835,11 +2222,11 @@ mjx-container[jax="SVG"] svg .butex-preview-mirror {
|
|
|
1835
2222
|
value.textContent = spec.Label;
|
|
1836
2223
|
return value;
|
|
1837
2224
|
}
|
|
1838
|
-
function buildAtomicOperatorCommandNodeBody(node, side) {
|
|
2225
|
+
function buildAtomicOperatorCommandNodeBody(node, side, uiLocale = "ar") {
|
|
1839
2226
|
const spec = atomicOperatorCommandSpec(node.expr);
|
|
1840
2227
|
const value = document.createElement("span");
|
|
1841
2228
|
value.className = "atomic-operator-command";
|
|
1842
|
-
value.title = spec
|
|
2229
|
+
value.title = spec ? atomicOperatorCommandTitle(spec, uiLocale) : node.expr;
|
|
1843
2230
|
if (side === "arabic" && shouldMirrorOperatorDisplay(spec)) {
|
|
1844
2231
|
value.classList.add("atomic-operator-command--mirrored");
|
|
1845
2232
|
}
|
|
@@ -4166,12 +4553,13 @@ ${ATOMIC_OPERATOR_COMMAND_CSS}
|
|
|
4166
4553
|
appendDebug(session, "createStarterSession", "initialized");
|
|
4167
4554
|
return session;
|
|
4168
4555
|
}
|
|
4169
|
-
function syncStateSummary(session) {
|
|
4556
|
+
function syncStateSummary(session, uiLocale = "ar") {
|
|
4557
|
+
const messages = equationEditorMessages(uiLocale);
|
|
4170
4558
|
const diverged = Object.values(session.sync).filter((entry) => entry.expr === "diverged").length;
|
|
4171
4559
|
if (diverged === 0) {
|
|
4172
|
-
return
|
|
4560
|
+
return messages.synced;
|
|
4173
4561
|
}
|
|
4174
|
-
return `\u064A\u0648\u062C\u062F ${String(diverged)}
|
|
4562
|
+
return uiLocale === "ar" ? `\u064A\u0648\u062C\u062F ${String(diverged)} ${messages.differentItems}` : `${String(diverged)} ${messages.differentItems}`;
|
|
4175
4563
|
}
|
|
4176
4564
|
function setRenderError(session, message) {
|
|
4177
4565
|
const next = cloneEditorSession(session);
|
|
@@ -4186,8 +4574,9 @@ ${ATOMIC_OPERATOR_COMMAND_CSS}
|
|
|
4186
4574
|
};
|
|
4187
4575
|
return next;
|
|
4188
4576
|
}
|
|
4189
|
-
function activeSideLabel(side) {
|
|
4190
|
-
|
|
4577
|
+
function activeSideLabel(side, uiLocale = "ar") {
|
|
4578
|
+
const messages = equationEditorMessages(uiLocale);
|
|
4579
|
+
return side === "arabic" ? messages.arabicSide : messages.englishSide;
|
|
4191
4580
|
}
|
|
4192
4581
|
var PASTE_OPERATORS = /* @__PURE__ */ new Set(["+", "-", "*", "/", "=", "<", ">", "."]);
|
|
4193
4582
|
function copySelection(session) {
|
|
@@ -4317,7 +4706,7 @@ ${ATOMIC_OPERATOR_COMMAND_CSS}
|
|
|
4317
4706
|
}
|
|
4318
4707
|
|
|
4319
4708
|
// src/editor/display/index.ts
|
|
4320
|
-
function buildNodeBody(node, buildChain, side, digitForm = "western") {
|
|
4709
|
+
function buildNodeBody(node, buildChain, side, digitForm = "western", uiLocale = "ar") {
|
|
4321
4710
|
if (node.kind === "delimiter") {
|
|
4322
4711
|
return buildDelimiterNodeBody(node, buildChain);
|
|
4323
4712
|
}
|
|
@@ -4331,10 +4720,10 @@ ${ATOMIC_OPERATOR_COMMAND_CSS}
|
|
|
4331
4720
|
return buildMatrixEnvNodeBody(node, buildChain, side);
|
|
4332
4721
|
}
|
|
4333
4722
|
if (node.kind === "atomicCommand") {
|
|
4334
|
-
return buildAtomicCommandNodeBody(node, side);
|
|
4723
|
+
return buildAtomicCommandNodeBody(node, side, uiLocale);
|
|
4335
4724
|
}
|
|
4336
4725
|
if (node.kind === "atomicOperatorCommand") {
|
|
4337
|
-
return buildAtomicOperatorCommandNodeBody(node, side);
|
|
4726
|
+
return buildAtomicOperatorCommandNodeBody(node, side, uiLocale);
|
|
4338
4727
|
}
|
|
4339
4728
|
return buildBaseNodeBody(node, digitForm);
|
|
4340
4729
|
}
|
|
@@ -4345,6 +4734,10 @@ ${ATOMIC_OPERATOR_COMMAND_CSS}
|
|
|
4345
4734
|
const buttonElements = options.buttonElements ?? {};
|
|
4346
4735
|
const outsidePointerIgnoreSelectors = options.outsidePointerIgnoreSelectors ?? [];
|
|
4347
4736
|
let session = options.initialSession ?? createStarterSession();
|
|
4737
|
+
let uiLocale = options.uiLocale ?? "ar";
|
|
4738
|
+
if (options.defaultSide) {
|
|
4739
|
+
session = { ...session, activeSide: options.defaultSide };
|
|
4740
|
+
}
|
|
4348
4741
|
const undoRedo = createUndoRedoStacks();
|
|
4349
4742
|
let lastInternalFragment = null;
|
|
4350
4743
|
let initialKeyboardFocusPending = true;
|
|
@@ -4376,14 +4769,15 @@ ${ATOMIC_OPERATOR_COMMAND_CSS}
|
|
|
4376
4769
|
return index >= start && index < end;
|
|
4377
4770
|
}
|
|
4378
4771
|
function refreshUndoRedoButtons() {
|
|
4772
|
+
const messages = equationEditorMessages(uiLocale);
|
|
4379
4773
|
if (buttonElements.undoBtn) {
|
|
4380
4774
|
buttonElements.undoBtn.disabled = !undoRedoCanUndo(undoRedo);
|
|
4381
4775
|
const arabicEquation = session.activeSide === "arabic";
|
|
4382
4776
|
const undoArrow = arabicEquation ? "\u21B7" : "\u21B6";
|
|
4383
4777
|
const vs = "\uFE0E";
|
|
4384
4778
|
buttonElements.undoBtn.textContent = `${undoArrow}${vs}`;
|
|
4385
|
-
buttonElements.undoBtn.title =
|
|
4386
|
-
buttonElements.undoBtn.setAttribute("aria-label",
|
|
4779
|
+
buttonElements.undoBtn.title = messages.undo;
|
|
4780
|
+
buttonElements.undoBtn.setAttribute("aria-label", messages.undo);
|
|
4387
4781
|
}
|
|
4388
4782
|
if (buttonElements.redoBtn) {
|
|
4389
4783
|
buttonElements.redoBtn.disabled = !undoRedoCanRedo(undoRedo);
|
|
@@ -4391,8 +4785,8 @@ ${ATOMIC_OPERATOR_COMMAND_CSS}
|
|
|
4391
4785
|
const redoArrow = arabicEquation ? "\u21B6" : "\u21B7";
|
|
4392
4786
|
const vs = "\uFE0E";
|
|
4393
4787
|
buttonElements.redoBtn.textContent = `${redoArrow}${vs}`;
|
|
4394
|
-
buttonElements.redoBtn.title =
|
|
4395
|
-
buttonElements.redoBtn.setAttribute("aria-label",
|
|
4788
|
+
buttonElements.redoBtn.title = messages.redo;
|
|
4789
|
+
buttonElements.redoBtn.setAttribute("aria-label", messages.redo);
|
|
4396
4790
|
}
|
|
4397
4791
|
}
|
|
4398
4792
|
function refreshClipboardButtons() {
|
|
@@ -4411,9 +4805,10 @@ ${ATOMIC_OPERATOR_COMMAND_CSS}
|
|
|
4411
4805
|
return;
|
|
4412
4806
|
}
|
|
4413
4807
|
const mergeOn = !session.splitLeafTyping;
|
|
4808
|
+
const messages = equationEditorMessages(uiLocale);
|
|
4414
4809
|
buttonElements.splitTypingBtn.textContent = mergeOn ? "\u0633\u0635\u0639" : "\u0633 \u0635 \u0639";
|
|
4415
|
-
buttonElements.splitTypingBtn.title = mergeOn ?
|
|
4416
|
-
buttonElements.splitTypingBtn.setAttribute("aria-label", mergeOn ?
|
|
4810
|
+
buttonElements.splitTypingBtn.title = mergeOn ? messages.disableLetterMerging : messages.enableLetterMerging;
|
|
4811
|
+
buttonElements.splitTypingBtn.setAttribute("aria-label", mergeOn ? messages.disableLetterMerging : messages.enableLetterMerging);
|
|
4417
4812
|
buttonElements.splitTypingBtn.setAttribute("aria-pressed", mergeOn ? "true" : "false");
|
|
4418
4813
|
buttonElements.splitTypingBtn.classList.toggle("accent", mergeOn);
|
|
4419
4814
|
}
|
|
@@ -4422,9 +4817,10 @@ ${ATOMIC_OPERATOR_COMMAND_CSS}
|
|
|
4422
4817
|
return;
|
|
4423
4818
|
}
|
|
4424
4819
|
const takweenOn = (session.currentCharacterFont ?? "default") === "takween";
|
|
4820
|
+
const messages = equationEditorMessages(uiLocale);
|
|
4425
4821
|
buttonElements.characterFontBtn.textContent = "\u062A\u0643";
|
|
4426
|
-
buttonElements.characterFontBtn.title = takweenOn ?
|
|
4427
|
-
buttonElements.characterFontBtn.setAttribute("aria-label", takweenOn ?
|
|
4822
|
+
buttonElements.characterFontBtn.title = takweenOn ? messages.writeDefaultFont : messages.writeTakweenFont;
|
|
4823
|
+
buttonElements.characterFontBtn.setAttribute("aria-label", takweenOn ? messages.writeDefaultFont : messages.writeTakweenFont);
|
|
4428
4824
|
buttonElements.characterFontBtn.setAttribute("aria-pressed", takweenOn ? "true" : "false");
|
|
4429
4825
|
buttonElements.characterFontBtn.classList.toggle("accent", takweenOn);
|
|
4430
4826
|
}
|
|
@@ -4435,8 +4831,9 @@ ${ATOMIC_OPERATOR_COMMAND_CSS}
|
|
|
4435
4831
|
const digitForm = session.currentDigitForm ?? "western";
|
|
4436
4832
|
const label = digitForm === "arabicIndic" ? "\u0664\u0665\u0666" : digitForm === "persianIndic" ? "\u06F4\u06F5\u06F6" : "456";
|
|
4437
4833
|
buttonElements.digitFormBtn.textContent = label;
|
|
4438
|
-
|
|
4439
|
-
buttonElements.digitFormBtn.
|
|
4834
|
+
const messages = equationEditorMessages(uiLocale);
|
|
4835
|
+
buttonElements.digitFormBtn.title = messages.chooseDigitForm;
|
|
4836
|
+
buttonElements.digitFormBtn.setAttribute("aria-label", messages.chooseDigitForm);
|
|
4440
4837
|
buttonElements.digitFormBtn.dataset.digitForm = digitForm;
|
|
4441
4838
|
}
|
|
4442
4839
|
function applyStructural(updater) {
|
|
@@ -4638,7 +5035,7 @@ ${ATOMIC_OPERATOR_COMMAND_CSS}
|
|
|
4638
5035
|
const atomicSpec = node.kind === "atomicCommand" ? atomicCommandSpec(node.expr) : null;
|
|
4639
5036
|
if (isSpacingCommandSpec(atomicSpec)) {
|
|
4640
5037
|
nodeEl.classList.add("node--atomic-spacing");
|
|
4641
|
-
nodeEl.title = spacingTooltipForSide(atomicSpec, session.activeSide);
|
|
5038
|
+
nodeEl.title = spacingTooltipForSide(atomicSpec, session.activeSide, uiLocale);
|
|
4642
5039
|
}
|
|
4643
5040
|
if (session.selectedNodeId === node.id || session.selectedStructureNodeId === node.id) {
|
|
4644
5041
|
nodeEl.classList.add("selected");
|
|
@@ -4668,7 +5065,7 @@ ${ATOMIC_OPERATOR_COMMAND_CSS}
|
|
|
4668
5065
|
});
|
|
4669
5066
|
const body = document.createElement("span");
|
|
4670
5067
|
body.className = "node-body";
|
|
4671
|
-
body.appendChild(buildNodeBody(node, buildChain, session.activeSide, session.currentDigitForm ?? "western"));
|
|
5068
|
+
body.appendChild(buildNodeBody(node, buildChain, session.activeSide, session.currentDigitForm ?? "western", uiLocale));
|
|
4672
5069
|
nodeEl.appendChild(body);
|
|
4673
5070
|
const scripts = buildNodeScripts(node, buildChain);
|
|
4674
5071
|
if (scripts) {
|
|
@@ -4949,6 +5346,13 @@ ${ATOMIC_OPERATOR_COMMAND_CSS}
|
|
|
4949
5346
|
session = next;
|
|
4950
5347
|
render();
|
|
4951
5348
|
},
|
|
5349
|
+
setUiLocale: (locale) => {
|
|
5350
|
+
if (uiLocale === locale) {
|
|
5351
|
+
return;
|
|
5352
|
+
}
|
|
5353
|
+
uiLocale = locale;
|
|
5354
|
+
render();
|
|
5355
|
+
},
|
|
4952
5356
|
performUndo,
|
|
4953
5357
|
performRedo,
|
|
4954
5358
|
performCopy,
|
|
@@ -5058,10 +5462,11 @@ ${ATOMIC_OPERATOR_COMMAND_CSS}
|
|
|
5058
5462
|
render();
|
|
5059
5463
|
return api;
|
|
5060
5464
|
}
|
|
5061
|
-
function runtimeStatusText(session) {
|
|
5465
|
+
function runtimeStatusText(session, uiLocale = "ar") {
|
|
5466
|
+
const messages = equationEditorMessages(uiLocale);
|
|
5062
5467
|
return {
|
|
5063
|
-
activeSide:
|
|
5064
|
-
sync:
|
|
5468
|
+
activeSide: `${messages.activeSide}: ${activeSideLabel(session.activeSide, uiLocale)}`,
|
|
5469
|
+
sync: `${messages.syncState}: ${syncStateSummary(session, uiLocale)}`
|
|
5065
5470
|
};
|
|
5066
5471
|
}
|
|
5067
5472
|
|