@drghaliasri/butex 3.2.2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1168,6 +1168,321 @@ function buildMatrixEnvNodeBody(node, buildChain, side) {
1168
1168
  return wrap;
1169
1169
  }
1170
1170
 
1171
+ // src/editor/uiLocale.ts
1172
+ var ENGLISH_COMMAND_TITLES = {
1173
+ cos: "Cosine",
1174
+ sin: "Sine",
1175
+ tan: "Tangent",
1176
+ cot: "Cotangent",
1177
+ sec: "Secant",
1178
+ csc: "Cosecant",
1179
+ arccos: "Inverse cosine",
1180
+ arcsin: "Inverse sine",
1181
+ arctan: "Inverse tangent",
1182
+ arccot: "Inverse cotangent",
1183
+ arcsec: "Inverse secant",
1184
+ arccsc: "Inverse cosecant",
1185
+ cosh: "Hyperbolic cosine",
1186
+ sinh: "Hyperbolic sine",
1187
+ tanh: "Hyperbolic tangent",
1188
+ coth: "Hyperbolic cotangent",
1189
+ sum: "Sum",
1190
+ prod: "Product",
1191
+ lim: "Limit",
1192
+ max: "Maximum",
1193
+ min: "Minimum",
1194
+ sup: "Supremum",
1195
+ inf: "Infimum",
1196
+ pi: "Pi",
1197
+ exp: "Exponential",
1198
+ ln: "Natural logarithm",
1199
+ log: "Logarithm",
1200
+ det: "Determinant",
1201
+ N: "Natural numbers",
1202
+ Z: "Integers",
1203
+ Q: "Rational numbers",
1204
+ R: "Real numbers",
1205
+ C: "Complex numbers",
1206
+ H: "Quaternions",
1207
+ negThinSpace: "Negative thin space",
1208
+ mediumSpace: "Medium space",
1209
+ thickSpace: "Thick space",
1210
+ quadSpace: "Large space",
1211
+ qquadSpace: "Extra-large space"
1212
+ };
1213
+ var ENGLISH_OPERATOR_TITLES = {
1214
+ inf: "Infinity",
1215
+ times: "Multiplication",
1216
+ div: "Division",
1217
+ pm: "Plus or minus",
1218
+ mp: "Minus or plus",
1219
+ neq: "Not equal",
1220
+ approx: "Approximately equal",
1221
+ sim: "Similar",
1222
+ mid: "Divides",
1223
+ leq: "Less than or equal",
1224
+ geq: "Greater than or equal",
1225
+ coloneqq: "Defined as equal to",
1226
+ eqqcolon: "Equal by definition",
1227
+ propto: "Proportional to",
1228
+ in: "Element of",
1229
+ notin: "Not an element of",
1230
+ subset: "Subset of",
1231
+ supset: "Superset of",
1232
+ subseteq: "Subset of or equal",
1233
+ supseteq: "Superset of or equal",
1234
+ cap: "Intersection",
1235
+ cup: "Union",
1236
+ emptyset: "Empty set",
1237
+ nsubseteq: "Not a subset of or equal",
1238
+ nsupseteq: "Not a superset of or equal",
1239
+ ldots: "Horizontal dots",
1240
+ cdot: "Multiplication dot",
1241
+ cdots: "Centered horizontal dots",
1242
+ vdots: "Vertical dots",
1243
+ ddots: "Diagonal dots",
1244
+ leftrightarrowDouble: "Equivalent",
1245
+ implies: "Implies",
1246
+ impliedby: "Implied by",
1247
+ iff: "If and only if",
1248
+ Longrightarrow: "Long double arrow right",
1249
+ Longleftarrow: "Long double arrow left",
1250
+ to: "Maps to",
1251
+ rightleftharpoons: "Equilibrium",
1252
+ leftarrow: "Left arrow",
1253
+ rightarrow: "Right arrow",
1254
+ leftarrowDouble: "Double left arrow",
1255
+ rightarrowDouble: "Double right arrow",
1256
+ leftharpoonup: "Upper left harpoon",
1257
+ rightharpoonup: "Upper right harpoon",
1258
+ leftharpoondown: "Lower left harpoon",
1259
+ rightharpoondown: "Lower right harpoon",
1260
+ int: "Integral",
1261
+ iint: "Double integral",
1262
+ iiint: "Triple integral",
1263
+ iiiint: "Quadruple integral",
1264
+ oint: "Contour integral",
1265
+ oiint: "Closed surface integral",
1266
+ oiiint: "Closed volume integral"
1267
+ };
1268
+ var EQUATION_EDITOR_MESSAGES = {
1269
+ ar: {
1270
+ undoRedo: "\u062A\u0631\u0627\u062C\u0639 \u0648\u0625\u0639\u0627\u062F\u0629",
1271
+ undo: "\u062A\u0631\u0627\u062C\u0639",
1272
+ redo: "\u0625\u0639\u0627\u062F\u0629",
1273
+ clipboard: "\u0627\u0644\u062D\u0627\u0641\u0638\u0629",
1274
+ copy: "\u0646\u0633\u062E",
1275
+ cut: "\u0642\u0635",
1276
+ paste: "\u0644\u0635\u0642",
1277
+ editorSettings: "\u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0627\u0644\u0645\u062D\u0631\u0631",
1278
+ toggleSide: "\u062A\u0628\u062F\u064A\u0644 \u0639\u0631\u0628\u064A / \u0625\u0646\u062C\u0644\u064A\u0632\u064A",
1279
+ structures: "\u0627\u0644\u0628\u0646\u0649",
1280
+ insertDelimiters: "\u0625\u062F\u0631\u0627\u062C \u0645\u062D\u062F\u062F\u0627\u062A",
1281
+ insertParentheses: "\u0625\u062F\u0631\u0627\u062C \u0642\u0648\u0633\u064A\u0646",
1282
+ insertBrackets: "\u0625\u062F\u0631\u0627\u062C \u0645\u0639\u0642\u0648\u0641\u064A\u0646",
1283
+ insertBraces: "\u0625\u062F\u0631\u0627\u062C \u062D\u0627\u0635\u0631\u062A\u064A\u0646",
1284
+ insertFraction: "\u0625\u062F\u0631\u0627\u062C \u0643\u0633\u0631",
1285
+ insertRoot: "\u0625\u062F\u0631\u0627\u062C \u062C\u0630\u0631",
1286
+ environments: "\u0627\u0644\u0628\u064A\u0626\u0627\u062A",
1287
+ insertEnvironment: "\u0625\u062F\u0631\u0627\u062C \u0628\u064A\u0626\u0629 \u0634\u0628\u0643\u064A\u0629",
1288
+ environmentType: "\u0646\u0648\u0639 \u0627\u0644\u0628\u064A\u0626\u0629",
1289
+ matrix: "\u0645\u0635\u0641\u0648\u0641\u0629",
1290
+ array: "\u062C\u062F\u0648\u0644",
1291
+ aligned: "\u0645\u062D\u0627\u0630\u0627\u0629",
1292
+ matrixType: "\u0646\u0648\u0639 \u0627\u0644\u0645\u0635\u0641\u0648\u0641\u0629",
1293
+ chooseEnvironmentSize: "\u0627\u062E\u062A\u064A\u0627\u0631 \u062D\u062C\u0645 \u0627\u0644\u0628\u064A\u0626\u0629",
1294
+ rows: "\u0635\u0641\u0648\u0641",
1295
+ columns: "\u0623\u0639\u0645\u062F\u0629",
1296
+ row: "\u0635\u0641",
1297
+ column: "\u0639\u0645\u0648\u062F",
1298
+ insert: "\u0625\u062F\u0631\u0627\u062C",
1299
+ editSelectedEnvironment: "\u062A\u0639\u062F\u064A\u0644 \u0627\u0644\u0628\u064A\u0626\u0629 \u0627\u0644\u0645\u062D\u062F\u062F\u0629",
1300
+ 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",
1301
+ applyStyle: "\u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0646\u0645\u0637",
1302
+ addRow: "\u0625\u0636\u0627\u0641\u0629 \u0635\u0641",
1303
+ removeRow: "\u062D\u0630\u0641 \u0635\u0641",
1304
+ addColumn: "\u0625\u0636\u0627\u0641\u0629 \u0639\u0645\u0648\u062F",
1305
+ removeColumn: "\u062D\u0630\u0641 \u0639\u0645\u0648\u062F",
1306
+ spaces: "\u0627\u0644\u0641\u0631\u0627\u063A\u0627\u062A",
1307
+ insertSpace: "\u0625\u062F\u0631\u0627\u062C \u0641\u0631\u0627\u063A",
1308
+ functions: "\u0627\u0644\u062F\u0648\u0627\u0644",
1309
+ insertFunction: "\u0625\u062F\u0631\u0627\u062C \u062F\u0627\u0644\u0629",
1310
+ insertLimitsSeries: "\u0625\u062F\u0631\u0627\u062C \u062D\u062F\u0648\u062F \u0648\u0645\u062A\u0633\u0644\u0633\u0644\u0627\u062A",
1311
+ insertAdditionalFunctions: "\u0625\u062F\u0631\u0627\u062C \u062F\u0648\u0627\u0644 \u0625\u0636\u0627\u0641\u064A\u0629",
1312
+ insertNumberSets: "\u0625\u062F\u0631\u0627\u062C \u0645\u062C\u0645\u0648\u0639\u0627\u062A \u0623\u0639\u062F\u0627\u062F",
1313
+ operations: "\u0627\u0644\u0639\u0645\u0644\u064A\u0627\u062A",
1314
+ insertOperation: "\u0625\u062F\u0631\u0627\u062C \u0631\u0645\u0632 \u0639\u0645\u0644\u064A\u0629",
1315
+ insertRelationsSets: "\u0625\u062F\u0631\u0627\u062C \u0631\u0645\u0648\u0632 \u0639\u0644\u0627\u0642\u0627\u062A \u0648\u0645\u062C\u0645\u0648\u0639\u0627\u062A",
1316
+ insertArrows: "\u0625\u062F\u0631\u0627\u062C \u0623\u0633\u0647\u0645",
1317
+ insertDots: "\u0625\u062F\u0631\u0627\u062C \u0646\u0642\u0627\u0637",
1318
+ insertIntegrals: "\u0625\u062F\u0631\u0627\u062C \u062A\u0643\u0627\u0645\u0644\u0627\u062A",
1319
+ scripts: "\u0627\u0644\u0623\u0633 \u0648\u0627\u0644\u0633\u0641\u0644\u064A",
1320
+ addSuperscript: "\u0625\u0636\u0627\u0641\u0629 \u0623\u0633",
1321
+ addSubscript: "\u0625\u0636\u0627\u0641\u0629 \u0633\u0641\u0644\u064A",
1322
+ removeSuperscript: "\u0625\u0632\u0627\u0644\u0629 \u0627\u0644\u0623\u0633",
1323
+ removeSubscript: "\u0625\u0632\u0627\u0644\u0629 \u0627\u0644\u0633\u0641\u0644\u064A",
1324
+ inputStyles: "\u0623\u0646\u0645\u0627\u0637 \u0627\u0644\u0625\u062F\u062E\u0627\u0644",
1325
+ deleteSelectedStructure: "\u062D\u0630\u0641 \u0627\u0644\u0628\u0646\u064A\u0629 \u0627\u0644\u0645\u062D\u062F\u062F\u0629",
1326
+ toggleLetterMerging: "\u062A\u0628\u062F\u064A\u0644 \u062F\u0645\u062C \u0627\u0644\u062D\u0631\u0648\u0641",
1327
+ disableLetterMerging: "\u062A\u0639\u0637\u064A\u0644 \u062F\u0645\u062C \u0627\u0644\u062D\u0631\u0648\u0641",
1328
+ enableLetterMerging: "\u062A\u0641\u0639\u064A\u0644 \u062F\u0645\u062C \u0627\u0644\u062D\u0631\u0648\u0641",
1329
+ chooseWritingFont: "\u0627\u062E\u062A\u064A\u0627\u0631 \u062E\u0637 \u0627\u0644\u0643\u062A\u0627\u0628\u0629",
1330
+ chooseDigitForm: "\u0627\u062E\u062A\u064A\u0627\u0631 \u0634\u0643\u0644 \u0627\u0644\u0623\u0631\u0642\u0627\u0645",
1331
+ defaultFont: "\u0627\u0644\u062E\u0637 \u0627\u0644\u0627\u0641\u062A\u0631\u0627\u0636\u064A",
1332
+ takweenFont: "\u062E\u0637 \u062A\u0643\u0648\u064A\u0646",
1333
+ diwaniFont: "\u062E\u0637 \u062F\u064A\u0648\u0627\u0646\u064A",
1334
+ diwaniOutlineFont: "\u062E\u0637 \u062F\u064A\u0648\u0627\u0646\u064A \u0645\u0638\u0644\u0644",
1335
+ writeDefaultFont: "\u0627\u0644\u0643\u062A\u0627\u0628\u0629 \u0628\u0627\u0644\u062E\u0637 \u0627\u0644\u0627\u0641\u062A\u0631\u0627\u0636\u064A",
1336
+ writeTakweenFont: "\u0627\u0644\u0643\u062A\u0627\u0628\u0629 \u0628\u062E\u0637 \u062A\u0643\u0648\u064A\u0646",
1337
+ westernDigits: "\u0623\u0631\u0642\u0627\u0645 \u063A\u0631\u0628\u064A\u0629",
1338
+ arabicIndicDigits: "\u0623\u0631\u0642\u0627\u0645 \u0639\u0631\u0628\u064A\u0629 \u0647\u0646\u062F\u064A\u0629",
1339
+ persianIndicDigits: "\u0623\u0631\u0642\u0627\u0645 \u0641\u0627\u0631\u0633\u064A\u0629 \u0647\u0646\u062F\u064A\u0629",
1340
+ equationEditor: "\u0645\u062D\u0631\u0631 \u0627\u0644\u0645\u0639\u0627\u062F\u0644\u0627\u062A",
1341
+ renderPreview: "\u0645\u0639\u0627\u064A\u0646\u0629 \u0627\u0644\u0631\u0633\u0645",
1342
+ development: "\u062A\u0637\u0648\u064A\u0631",
1343
+ showDebugLog: "\u0625\u0638\u0647\u0627\u0631 \u0633\u062C\u0644 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",
1344
+ hideDebugLog: "\u0625\u062E\u0641\u0627\u0621 \u0633\u062C\u0644 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",
1345
+ copyDebugLog: "\u0646\u0633\u062E \u0633\u062C\u0644 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",
1346
+ empty: "\u0641\u0627\u0631\u063A",
1347
+ englishLatex: "LaTeX \u0625\u0646\u062C\u0644\u064A\u0632\u064A",
1348
+ arabicLatex: "LaTeX \u0639\u0631\u0628\u064A",
1349
+ inactiveEnglish: "\u0627\u0644\u0633\u0644\u0633\u0644\u0629 \u063A\u064A\u0631 \u0627\u0644\u0646\u0634\u0637\u0629 (\u0625\u0646\u062C\u0644\u064A\u0632\u064A)",
1350
+ inactiveArabic: "\u0627\u0644\u0633\u0644\u0633\u0644\u0629 \u063A\u064A\u0631 \u0627\u0644\u0646\u0634\u0637\u0629 (\u0639\u0631\u0628\u064A)",
1351
+ mathJaxError: "\u062E\u0637\u0623 MathJax",
1352
+ previewError: "\u062E\u0637\u0623 \u0641\u064A \u0627\u0644\u0645\u0639\u0627\u064A\u0646\u0629",
1353
+ activeSide: "\u0627\u0644\u062C\u0627\u0646\u0628 \u0627\u0644\u0646\u0634\u0637",
1354
+ syncState: "\u062D\u0627\u0644\u0629 \u0627\u0644\u0645\u0632\u0627\u0645\u0646\u0629",
1355
+ arabicSide: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629",
1356
+ englishSide: "\u0627\u0644\u0625\u0646\u062C\u0644\u064A\u0632\u064A\u0629",
1357
+ synced: "\u0645\u062A\u0632\u0627\u0645\u0646",
1358
+ differentItems: "\u0639\u0646\u0627\u0635\u0631 \u0645\u062E\u062A\u0644\u0641\u0629",
1359
+ alignLeft: "\u064A\u0633\u0627\u0631",
1360
+ alignCenter: "\u0648\u0633\u0637",
1361
+ alignRight: "\u064A\u0645\u064A\u0646",
1362
+ alignColumnLeft: "\u0645\u062D\u0627\u0630\u0627\u0629 \u0627\u0644\u0639\u0645\u0648\u062F \u0625\u0644\u0649 \u0627\u0644\u064A\u0633\u0627\u0631",
1363
+ alignColumnCenter: "\u0645\u062D\u0627\u0630\u0627\u0629 \u0627\u0644\u0639\u0645\u0648\u062F \u0641\u064A \u0627\u0644\u0648\u0633\u0637",
1364
+ alignColumnRight: "\u0645\u062D\u0627\u0630\u0627\u0629 \u0627\u0644\u0639\u0645\u0648\u062F \u0625\u0644\u0649 \u0627\u0644\u064A\u0645\u064A\u0646",
1365
+ matrixNoDelimiters: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u0644\u0627 \u0623\u0642\u0648\u0627\u0633",
1366
+ matrixParentheses: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u064A\u0646 \u0642\u0648\u0633\u064A\u0646",
1367
+ matrixBrackets: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u064A\u0646 \u0645\u0639\u0642\u0648\u0641\u064A\u0646",
1368
+ matrixBraces: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u064A\u0646 \u062D\u0627\u0635\u0631\u062A\u064A\u0646",
1369
+ matrixBars: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u064A\u0646 \u062E\u0637\u064A\u0646",
1370
+ matrixDoubleBars: "\u0645\u0635\u0641\u0648\u0641\u0629 \u0628\u064A\u0646 \u062E\u0637\u064A\u0646 \u0645\u0632\u062F\u0648\u062C\u064A\u0646"
1371
+ },
1372
+ en: {
1373
+ undoRedo: "Undo and redo",
1374
+ undo: "Undo",
1375
+ redo: "Redo",
1376
+ clipboard: "Clipboard",
1377
+ copy: "Copy",
1378
+ cut: "Cut",
1379
+ paste: "Paste",
1380
+ editorSettings: "Editor settings",
1381
+ toggleSide: "Switch Arabic / English equation side",
1382
+ structures: "Structures",
1383
+ insertDelimiters: "Insert delimiters",
1384
+ insertParentheses: "Insert parentheses",
1385
+ insertBrackets: "Insert brackets",
1386
+ insertBraces: "Insert braces",
1387
+ insertFraction: "Insert fraction",
1388
+ insertRoot: "Insert root",
1389
+ environments: "Environments",
1390
+ insertEnvironment: "Insert grid environment",
1391
+ environmentType: "Environment type",
1392
+ matrix: "Matrix",
1393
+ array: "Array",
1394
+ aligned: "Aligned",
1395
+ matrixType: "Matrix type",
1396
+ chooseEnvironmentSize: "Choose environment size",
1397
+ rows: "Rows",
1398
+ columns: "Columns",
1399
+ row: "Row",
1400
+ column: "Column",
1401
+ insert: "Insert",
1402
+ editSelectedEnvironment: "Edit selected environment",
1403
+ applySelectedMatrixStyle: "Apply style to selected matrix",
1404
+ applyStyle: "Apply style",
1405
+ addRow: "Add row",
1406
+ removeRow: "Remove row",
1407
+ addColumn: "Add column",
1408
+ removeColumn: "Remove column",
1409
+ spaces: "Spacing",
1410
+ insertSpace: "Insert space",
1411
+ functions: "Functions",
1412
+ insertFunction: "Insert function",
1413
+ insertLimitsSeries: "Insert limits and series",
1414
+ insertAdditionalFunctions: "Insert additional functions",
1415
+ insertNumberSets: "Insert number sets",
1416
+ operations: "Operators",
1417
+ insertOperation: "Insert operator",
1418
+ insertRelationsSets: "Insert relation or set symbol",
1419
+ insertArrows: "Insert arrow",
1420
+ insertDots: "Insert dots",
1421
+ insertIntegrals: "Insert integral",
1422
+ scripts: "Superscript and subscript",
1423
+ addSuperscript: "Add superscript",
1424
+ addSubscript: "Add subscript",
1425
+ removeSuperscript: "Remove superscript",
1426
+ removeSubscript: "Remove subscript",
1427
+ inputStyles: "Input styles",
1428
+ deleteSelectedStructure: "Delete selected structure",
1429
+ toggleLetterMerging: "Toggle letter merging",
1430
+ disableLetterMerging: "Disable letter merging",
1431
+ enableLetterMerging: "Enable letter merging",
1432
+ chooseWritingFont: "Choose writing font",
1433
+ chooseDigitForm: "Choose digit form",
1434
+ defaultFont: "Default font",
1435
+ takweenFont: "Takween font",
1436
+ diwaniFont: "Diwani font",
1437
+ diwaniOutlineFont: "Outlined Diwani font",
1438
+ writeDefaultFont: "Write with the default font",
1439
+ writeTakweenFont: "Write with Takween font",
1440
+ westernDigits: "Western digits",
1441
+ arabicIndicDigits: "Arabic-Indic digits",
1442
+ persianIndicDigits: "Persian digits",
1443
+ equationEditor: "Equation editor",
1444
+ renderPreview: "Rendered preview",
1445
+ development: "Development",
1446
+ showDebugLog: "Show debug log",
1447
+ hideDebugLog: "Hide debug log",
1448
+ copyDebugLog: "Copy debug log",
1449
+ empty: "Empty",
1450
+ englishLatex: "English LaTeX",
1451
+ arabicLatex: "Arabic LaTeX",
1452
+ inactiveEnglish: "Inactive chain (English)",
1453
+ inactiveArabic: "Inactive chain (Arabic)",
1454
+ mathJaxError: "MathJax error",
1455
+ previewError: "Preview error",
1456
+ activeSide: "Active side",
1457
+ syncState: "Sync state",
1458
+ arabicSide: "Arabic",
1459
+ englishSide: "English",
1460
+ synced: "Synced",
1461
+ differentItems: "different items",
1462
+ alignLeft: "Left",
1463
+ alignCenter: "Center",
1464
+ alignRight: "Right",
1465
+ alignColumnLeft: "Align column left",
1466
+ alignColumnCenter: "Align column center",
1467
+ alignColumnRight: "Align column right",
1468
+ matrixNoDelimiters: "Matrix without delimiters",
1469
+ matrixParentheses: "Matrix in parentheses",
1470
+ matrixBrackets: "Matrix in brackets",
1471
+ matrixBraces: "Matrix in braces",
1472
+ matrixBars: "Matrix between bars",
1473
+ matrixDoubleBars: "Matrix between double bars"
1474
+ }
1475
+ };
1476
+ function equationEditorMessages(locale) {
1477
+ return EQUATION_EDITOR_MESSAGES[locale];
1478
+ }
1479
+ function atomicCommandTitle(spec, locale) {
1480
+ return locale === "en" ? ENGLISH_COMMAND_TITLES[spec.id] ?? spec.title : spec.title;
1481
+ }
1482
+ function atomicOperatorCommandTitle(spec, locale) {
1483
+ return locale === "en" ? ENGLISH_OPERATOR_TITLES[spec.id] ?? spec.title : spec.title;
1484
+ }
1485
+
1171
1486
  // src/editor/display/atomicCommand.ts
1172
1487
  var ATOMIC_COMMAND_CSS = `
1173
1488
  /* Shared atomic-command display */
@@ -1241,8 +1556,8 @@ function spacingArrowForSide(spec, side) {
1241
1556
  }
1242
1557
  return side === "arabic" ? "\u2192" : "\u2190";
1243
1558
  }
1244
- function spacingTooltipForSide(spec, side) {
1245
- return `${spec.title} ${spacingArrowForSide(spec, side).repeat(spec.spacing.level)}`;
1559
+ function spacingTooltipForSide(spec, side, uiLocale = "ar") {
1560
+ return `${atomicCommandTitle(spec, uiLocale)} ${spacingArrowForSide(spec, side).repeat(spec.spacing.level)}`;
1246
1561
  }
1247
1562
  function buildFunctionAtomicCommandBody(node, side, spec) {
1248
1563
  const value = document.createElement("span");
@@ -1266,19 +1581,19 @@ function buildFunctionAtomicCommandBody(node, side, spec) {
1266
1581
  value.textContent = side === "arabic" ? spec?.arabicLabel ?? node.expr : spec?.englishTex.replace("\\", "") ?? node.expr;
1267
1582
  return value;
1268
1583
  }
1269
- function buildSpacingAtomicCommandBody(spec, side) {
1584
+ function buildSpacingAtomicCommandBody(spec, side, uiLocale) {
1270
1585
  const value = document.createElement("span");
1271
1586
  value.className = `atomic-spacing atomic-spacing--${spec.spacing.direction} atomic-spacing--level-${String(spec.spacing.level)}`;
1272
- value.title = spacingTooltipForSide(spec, side);
1587
+ value.title = spacingTooltipForSide(spec, side, uiLocale);
1273
1588
  const marker = document.createElement("span");
1274
1589
  marker.className = "atomic-spacing__marker";
1275
1590
  value.appendChild(marker);
1276
1591
  return value;
1277
1592
  }
1278
- function buildAtomicCommandNodeBody(node, side) {
1593
+ function buildAtomicCommandNodeBody(node, side, uiLocale = "ar") {
1279
1594
  const spec = atomicCommandSpec(node.expr);
1280
1595
  if (isSpacingCommandSpec(spec)) {
1281
- return buildSpacingAtomicCommandBody(spec, side);
1596
+ return buildSpacingAtomicCommandBody(spec, side, uiLocale);
1282
1597
  }
1283
1598
  return buildFunctionAtomicCommandBody(node, side, spec);
1284
1599
  }
@@ -1384,6 +1699,24 @@ var ATOMIC_OPERATOR_COMMANDS = {
1384
1699
  title: "\u0623\u0643\u0628\u0631 \u0645\u0646 \u0623\u0648 \u064A\u0633\u0627\u0648\u064A",
1385
1700
  svg_path: null
1386
1701
  },
1702
+ coloneqq: {
1703
+ id: "coloneqq",
1704
+ category: "operators1",
1705
+ Tex: "\\coloneqq",
1706
+ mirror: true,
1707
+ Label: "\u2254",
1708
+ title: "\u064A\u0639\u0631\u0641 \u0628\u0623\u0646\u0647 \u064A\u0633\u0627\u0648\u064A",
1709
+ svg_path: null
1710
+ },
1711
+ eqqcolon: {
1712
+ id: "eqqcolon",
1713
+ category: "operators1",
1714
+ Tex: "\\eqqcolon",
1715
+ mirror: true,
1716
+ Label: "\u2255",
1717
+ title: "\u064A\u0633\u0627\u0648\u064A \u0628\u0627\u0644\u062A\u0639\u0631\u064A\u0641",
1718
+ svg_path: null
1719
+ },
1387
1720
  ///// Operators 2
1388
1721
  propto: {
1389
1722
  id: "propto",
@@ -1550,6 +1883,60 @@ var ATOMIC_OPERATOR_COMMANDS = {
1550
1883
  title: "\u064A\u0643\u0627\u0641\u0626",
1551
1884
  svg_path: null
1552
1885
  },
1886
+ implies: {
1887
+ id: "implies",
1888
+ category: "operators3",
1889
+ Tex: "\\implies",
1890
+ mirror: true,
1891
+ Label: "\u21D2",
1892
+ title: "\u064A\u0633\u062A\u0644\u0632\u0645",
1893
+ svg_path: null
1894
+ },
1895
+ impliedby: {
1896
+ id: "impliedby",
1897
+ category: "operators3",
1898
+ Tex: "\\impliedby",
1899
+ mirror: true,
1900
+ Label: "\u21D0",
1901
+ title: "\u0645\u0633\u062A\u0644\u0632\u0645 \u0645\u0646",
1902
+ svg_path: null
1903
+ },
1904
+ iff: {
1905
+ id: "iff",
1906
+ category: "operators3",
1907
+ Tex: "\\iff",
1908
+ mirror: false,
1909
+ Label: "\u21D4",
1910
+ title: "\u0625\u0630\u0627 \u0648\u0641\u0642\u0637 \u0625\u0630\u0627",
1911
+ svg_path: null
1912
+ },
1913
+ Longrightarrow: {
1914
+ id: "Longrightarrow",
1915
+ category: "operators3",
1916
+ Tex: "\\Longrightarrow",
1917
+ mirror: true,
1918
+ Label: "\u27F9",
1919
+ title: "\u0633\u0647\u0645 \u0645\u0632\u062F\u0648\u062C \u0637\u0648\u064A\u0644 \u0625\u0644\u0649 \u0627\u0644\u064A\u0645\u064A\u0646",
1920
+ svg_path: null
1921
+ },
1922
+ Longleftarrow: {
1923
+ id: "Longleftarrow",
1924
+ category: "operators3",
1925
+ Tex: "\\Longleftarrow",
1926
+ mirror: true,
1927
+ Label: "\u27F8",
1928
+ title: "\u0633\u0647\u0645 \u0645\u0632\u062F\u0648\u062C \u0637\u0648\u064A\u0644 \u0625\u0644\u0649 \u0627\u0644\u064A\u0633\u0627\u0631",
1929
+ svg_path: null
1930
+ },
1931
+ to: {
1932
+ id: "to",
1933
+ category: "operators3",
1934
+ Tex: "\\to",
1935
+ mirror: true,
1936
+ Label: "\u2192",
1937
+ title: "\u064A\u0624\u0648\u0644 \u0625\u0644\u0649",
1938
+ svg_path: null
1939
+ },
1553
1940
  rightleftharpoons: {
1554
1941
  id: "rightleftharpoons",
1555
1942
  category: "operators3",
@@ -1793,11 +2180,11 @@ function buildOperatorLabel(spec) {
1793
2180
  value.textContent = spec.Label;
1794
2181
  return value;
1795
2182
  }
1796
- function buildAtomicOperatorCommandNodeBody(node, side) {
2183
+ function buildAtomicOperatorCommandNodeBody(node, side, uiLocale = "ar") {
1797
2184
  const spec = atomicOperatorCommandSpec(node.expr);
1798
2185
  const value = document.createElement("span");
1799
2186
  value.className = "atomic-operator-command";
1800
- value.title = spec?.title ?? node.expr;
2187
+ value.title = spec ? atomicOperatorCommandTitle(spec, uiLocale) : node.expr;
1801
2188
  if (side === "arabic" && shouldMirrorOperatorDisplay(spec)) {
1802
2189
  value.classList.add("atomic-operator-command--mirrored");
1803
2190
  }
@@ -4124,12 +4511,13 @@ function createStarterSession() {
4124
4511
  appendDebug(session, "createStarterSession", "initialized");
4125
4512
  return session;
4126
4513
  }
4127
- function syncStateSummary(session) {
4514
+ function syncStateSummary(session, uiLocale = "ar") {
4515
+ const messages = equationEditorMessages(uiLocale);
4128
4516
  const diverged = Object.values(session.sync).filter((entry) => entry.expr === "diverged").length;
4129
4517
  if (diverged === 0) {
4130
- return "\u0645\u062A\u0632\u0627\u0645\u0646";
4518
+ return messages.synced;
4131
4519
  }
4132
- return `\u064A\u0648\u062C\u062F ${String(diverged)} \u0639\u0646\u0627\u0635\u0631 \u0645\u062E\u062A\u0644\u0641\u0629`;
4520
+ return uiLocale === "ar" ? `\u064A\u0648\u062C\u062F ${String(diverged)} ${messages.differentItems}` : `${String(diverged)} ${messages.differentItems}`;
4133
4521
  }
4134
4522
  function setRenderError(session, message) {
4135
4523
  const next = cloneEditorSession(session);
@@ -4144,8 +4532,9 @@ function setRenderError(session, message) {
4144
4532
  };
4145
4533
  return next;
4146
4534
  }
4147
- function activeSideLabel(side) {
4148
- return side === "arabic" ? "\u0627\u0644\u0639\u0631\u0628\u064A\u0629" : "\u0627\u0644\u0625\u0646\u062C\u0644\u064A\u0632\u064A\u0629";
4535
+ function activeSideLabel(side, uiLocale = "ar") {
4536
+ const messages = equationEditorMessages(uiLocale);
4537
+ return side === "arabic" ? messages.arabicSide : messages.englishSide;
4149
4538
  }
4150
4539
  var PASTE_OPERATORS = /* @__PURE__ */ new Set(["+", "-", "*", "/", "=", "<", ">", "."]);
4151
4540
  function copySelection(session) {
@@ -4275,7 +4664,7 @@ function buildNodeScripts(node, buildChain) {
4275
4664
  }
4276
4665
 
4277
4666
  // src/editor/display/index.ts
4278
- function buildNodeBody(node, buildChain, side, digitForm = "western") {
4667
+ function buildNodeBody(node, buildChain, side, digitForm = "western", uiLocale = "ar") {
4279
4668
  if (node.kind === "delimiter") {
4280
4669
  return buildDelimiterNodeBody(node, buildChain);
4281
4670
  }
@@ -4289,10 +4678,10 @@ function buildNodeBody(node, buildChain, side, digitForm = "western") {
4289
4678
  return buildMatrixEnvNodeBody(node, buildChain, side);
4290
4679
  }
4291
4680
  if (node.kind === "atomicCommand") {
4292
- return buildAtomicCommandNodeBody(node, side);
4681
+ return buildAtomicCommandNodeBody(node, side, uiLocale);
4293
4682
  }
4294
4683
  if (node.kind === "atomicOperatorCommand") {
4295
- return buildAtomicOperatorCommandNodeBody(node, side);
4684
+ return buildAtomicOperatorCommandNodeBody(node, side, uiLocale);
4296
4685
  }
4297
4686
  return buildBaseNodeBody(node, digitForm);
4298
4687
  }
@@ -4303,6 +4692,10 @@ function createEditorRuntime(options) {
4303
4692
  const buttonElements = options.buttonElements ?? {};
4304
4693
  const outsidePointerIgnoreSelectors = options.outsidePointerIgnoreSelectors ?? [];
4305
4694
  let session = options.initialSession ?? createStarterSession();
4695
+ let uiLocale = options.uiLocale ?? "ar";
4696
+ if (options.defaultSide) {
4697
+ session = { ...session, activeSide: options.defaultSide };
4698
+ }
4306
4699
  const undoRedo = createUndoRedoStacks();
4307
4700
  let lastInternalFragment = null;
4308
4701
  let initialKeyboardFocusPending = true;
@@ -4334,14 +4727,15 @@ function createEditorRuntime(options) {
4334
4727
  return index >= start && index < end;
4335
4728
  }
4336
4729
  function refreshUndoRedoButtons() {
4730
+ const messages = equationEditorMessages(uiLocale);
4337
4731
  if (buttonElements.undoBtn) {
4338
4732
  buttonElements.undoBtn.disabled = !undoRedoCanUndo(undoRedo);
4339
4733
  const arabicEquation = session.activeSide === "arabic";
4340
4734
  const undoArrow = arabicEquation ? "\u21B7" : "\u21B6";
4341
4735
  const vs = "\uFE0E";
4342
4736
  buttonElements.undoBtn.textContent = `${undoArrow}${vs}`;
4343
- buttonElements.undoBtn.title = "\u062A\u0631\u0627\u062C\u0639";
4344
- buttonElements.undoBtn.setAttribute("aria-label", "\u062A\u0631\u0627\u062C\u0639");
4737
+ buttonElements.undoBtn.title = messages.undo;
4738
+ buttonElements.undoBtn.setAttribute("aria-label", messages.undo);
4345
4739
  }
4346
4740
  if (buttonElements.redoBtn) {
4347
4741
  buttonElements.redoBtn.disabled = !undoRedoCanRedo(undoRedo);
@@ -4349,8 +4743,8 @@ function createEditorRuntime(options) {
4349
4743
  const redoArrow = arabicEquation ? "\u21B6" : "\u21B7";
4350
4744
  const vs = "\uFE0E";
4351
4745
  buttonElements.redoBtn.textContent = `${redoArrow}${vs}`;
4352
- buttonElements.redoBtn.title = "\u0625\u0639\u0627\u062F\u0629";
4353
- buttonElements.redoBtn.setAttribute("aria-label", "\u0625\u0639\u0627\u062F\u0629");
4746
+ buttonElements.redoBtn.title = messages.redo;
4747
+ buttonElements.redoBtn.setAttribute("aria-label", messages.redo);
4354
4748
  }
4355
4749
  }
4356
4750
  function refreshClipboardButtons() {
@@ -4369,9 +4763,10 @@ function createEditorRuntime(options) {
4369
4763
  return;
4370
4764
  }
4371
4765
  const mergeOn = !session.splitLeafTyping;
4766
+ const messages = equationEditorMessages(uiLocale);
4372
4767
  buttonElements.splitTypingBtn.textContent = mergeOn ? "\u0633\u0635\u0639" : "\u0633 \u0635 \u0639";
4373
- buttonElements.splitTypingBtn.title = mergeOn ? "\u062A\u0639\u0637\u064A\u0644 \u062F\u0645\u062C \u0627\u0644\u062D\u0631\u0648\u0641" : "\u062A\u0641\u0639\u064A\u0644 \u062F\u0645\u062C \u0627\u0644\u062D\u0631\u0648\u0641";
4374
- buttonElements.splitTypingBtn.setAttribute("aria-label", mergeOn ? "\u062A\u0639\u0637\u064A\u0644 \u062F\u0645\u062C \u0627\u0644\u062D\u0631\u0648\u0641" : "\u062A\u0641\u0639\u064A\u0644 \u062F\u0645\u062C \u0627\u0644\u062D\u0631\u0648\u0641");
4768
+ buttonElements.splitTypingBtn.title = mergeOn ? messages.disableLetterMerging : messages.enableLetterMerging;
4769
+ buttonElements.splitTypingBtn.setAttribute("aria-label", mergeOn ? messages.disableLetterMerging : messages.enableLetterMerging);
4375
4770
  buttonElements.splitTypingBtn.setAttribute("aria-pressed", mergeOn ? "true" : "false");
4376
4771
  buttonElements.splitTypingBtn.classList.toggle("accent", mergeOn);
4377
4772
  }
@@ -4380,9 +4775,10 @@ function createEditorRuntime(options) {
4380
4775
  return;
4381
4776
  }
4382
4777
  const takweenOn = (session.currentCharacterFont ?? "default") === "takween";
4778
+ const messages = equationEditorMessages(uiLocale);
4383
4779
  buttonElements.characterFontBtn.textContent = "\u062A\u0643";
4384
- buttonElements.characterFontBtn.title = takweenOn ? "\u0627\u0644\u0643\u062A\u0627\u0628\u0629 \u0628\u0627\u0644\u062E\u0637 \u0627\u0644\u0627\u0641\u062A\u0631\u0627\u0636\u064A" : "\u0627\u0644\u0643\u062A\u0627\u0628\u0629 \u0628\u062E\u0637 \u062A\u0643\u0648\u064A\u0646";
4385
- buttonElements.characterFontBtn.setAttribute("aria-label", takweenOn ? "\u0627\u0644\u0643\u062A\u0627\u0628\u0629 \u0628\u0627\u0644\u062E\u0637 \u0627\u0644\u0627\u0641\u062A\u0631\u0627\u0636\u064A" : "\u0627\u0644\u0643\u062A\u0627\u0628\u0629 \u0628\u062E\u0637 \u062A\u0643\u0648\u064A\u0646");
4780
+ buttonElements.characterFontBtn.title = takweenOn ? messages.writeDefaultFont : messages.writeTakweenFont;
4781
+ buttonElements.characterFontBtn.setAttribute("aria-label", takweenOn ? messages.writeDefaultFont : messages.writeTakweenFont);
4386
4782
  buttonElements.characterFontBtn.setAttribute("aria-pressed", takweenOn ? "true" : "false");
4387
4783
  buttonElements.characterFontBtn.classList.toggle("accent", takweenOn);
4388
4784
  }
@@ -4393,8 +4789,9 @@ function createEditorRuntime(options) {
4393
4789
  const digitForm = session.currentDigitForm ?? "western";
4394
4790
  const label = digitForm === "arabicIndic" ? "\u0664\u0665\u0666" : digitForm === "persianIndic" ? "\u06F4\u06F5\u06F6" : "456";
4395
4791
  buttonElements.digitFormBtn.textContent = label;
4396
- buttonElements.digitFormBtn.title = "\u0627\u062E\u062A\u064A\u0627\u0631 \u0634\u0643\u0644 \u0627\u0644\u0623\u0631\u0642\u0627\u0645";
4397
- buttonElements.digitFormBtn.setAttribute("aria-label", "\u0627\u062E\u062A\u064A\u0627\u0631 \u0634\u0643\u0644 \u0627\u0644\u0623\u0631\u0642\u0627\u0645");
4792
+ const messages = equationEditorMessages(uiLocale);
4793
+ buttonElements.digitFormBtn.title = messages.chooseDigitForm;
4794
+ buttonElements.digitFormBtn.setAttribute("aria-label", messages.chooseDigitForm);
4398
4795
  buttonElements.digitFormBtn.dataset.digitForm = digitForm;
4399
4796
  }
4400
4797
  function applyStructural(updater) {
@@ -4596,7 +4993,7 @@ function createEditorRuntime(options) {
4596
4993
  const atomicSpec = node.kind === "atomicCommand" ? atomicCommandSpec(node.expr) : null;
4597
4994
  if (isSpacingCommandSpec(atomicSpec)) {
4598
4995
  nodeEl.classList.add("node--atomic-spacing");
4599
- nodeEl.title = spacingTooltipForSide(atomicSpec, session.activeSide);
4996
+ nodeEl.title = spacingTooltipForSide(atomicSpec, session.activeSide, uiLocale);
4600
4997
  }
4601
4998
  if (session.selectedNodeId === node.id || session.selectedStructureNodeId === node.id) {
4602
4999
  nodeEl.classList.add("selected");
@@ -4626,7 +5023,7 @@ function createEditorRuntime(options) {
4626
5023
  });
4627
5024
  const body = document.createElement("span");
4628
5025
  body.className = "node-body";
4629
- body.appendChild(buildNodeBody(node, buildChain, session.activeSide, session.currentDigitForm ?? "western"));
5026
+ body.appendChild(buildNodeBody(node, buildChain, session.activeSide, session.currentDigitForm ?? "western", uiLocale));
4630
5027
  nodeEl.appendChild(body);
4631
5028
  const scripts = buildNodeScripts(node, buildChain);
4632
5029
  if (scripts) {
@@ -4907,6 +5304,13 @@ function createEditorRuntime(options) {
4907
5304
  session = next;
4908
5305
  render();
4909
5306
  },
5307
+ setUiLocale: (locale) => {
5308
+ if (uiLocale === locale) {
5309
+ return;
5310
+ }
5311
+ uiLocale = locale;
5312
+ render();
5313
+ },
4910
5314
  performUndo,
4911
5315
  performRedo,
4912
5316
  performCopy,
@@ -5016,10 +5420,11 @@ function createEditorRuntime(options) {
5016
5420
  render();
5017
5421
  return api;
5018
5422
  }
5019
- function runtimeStatusText(session) {
5423
+ function runtimeStatusText(session, uiLocale = "ar") {
5424
+ const messages = equationEditorMessages(uiLocale);
5020
5425
  return {
5021
- activeSide: `\u0627\u0644\u062C\u0627\u0646\u0628 \u0627\u0644\u0646\u0634\u0637: ${activeSideLabel(session.activeSide)}`,
5022
- sync: `\u062D\u0627\u0644\u0629 \u0627\u0644\u0645\u0632\u0627\u0645\u0646\u0629: ${syncStateSummary(session)}`
5426
+ activeSide: `${messages.activeSide}: ${activeSideLabel(session.activeSide, uiLocale)}`,
5427
+ sync: `${messages.syncState}: ${syncStateSummary(session, uiLocale)}`
5023
5428
  };
5024
5429
  }
5025
5430