@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/README.md
CHANGED
|
@@ -156,10 +156,12 @@ Shipped as a separate entry so apps that do not use React never pull it in.
|
|
|
156
156
|
import { ButexEditor } from 'butex/react';
|
|
157
157
|
|
|
158
158
|
export default function Page() {
|
|
159
|
-
return <ButexEditor />;
|
|
159
|
+
return <ButexEditor uiLocale="en" defaultSide="english" />;
|
|
160
160
|
}
|
|
161
161
|
```
|
|
162
162
|
|
|
163
|
+
`uiLocale` selects Arabic (`"ar"`, the default) or English (`"en"`) GUI labels, tooltips, errors, accessibility text, and chrome direction. `defaultSide` independently selects the initial `"english"` or `"arabic"` equation side; users can still switch equation sides from the toolbar.
|
|
164
|
+
|
|
163
165
|
### Document AST (`butex/document`)
|
|
164
166
|
|
|
165
167
|
Use this headless entry when a host app or remote service already has `DocumentObject` JSON and needs a structured import/export layer.
|
|
@@ -240,13 +242,17 @@ export default function Page() {
|
|
|
240
242
|
return (
|
|
241
243
|
<ButexDocumentEditor2
|
|
242
244
|
debug
|
|
245
|
+
uiLocale="en"
|
|
246
|
+
documentDirection="ltr"
|
|
247
|
+
equationSide="english"
|
|
248
|
+
editableEquations
|
|
243
249
|
onLatexChange={(latex) => console.log(latex)}
|
|
244
250
|
/>
|
|
245
251
|
);
|
|
246
252
|
}
|
|
247
253
|
```
|
|
248
254
|
|
|
249
|
-
Host apps still register BuTeX with MathJax before preview rendering. Document editor v2 defaults to **`tex-svg.js`**; use `tex-chtml.js` only if you pass `mathOutput="chtml"`.
|
|
255
|
+
Host apps still register BuTeX with MathJax before preview rendering. `uiLocale` selects Arabic (`"ar"`, the default) or English (`"en"`) document-editor chrome and is passed to the embedded equation editor. `documentDirection` independently controls prose inputs and preview flow without creating a second document tree. `equationSide` independently controls whether structured equations open, render, and save from the `"english"` or `"arabic"` side. Set `editableEquations={false}` to show math islands without equation insertion, deletion, or editor access. Raw-only equations keep their original source because the browser does not parse raw LaTeX into equation ASTs. Document editor v2 defaults to **`tex-svg.js`**; use `tex-chtml.js` only if you pass `mathOutput="chtml"`.
|
|
250
256
|
|
|
251
257
|
### Styling/theming contract
|
|
252
258
|
|
package/dist/document.js
CHANGED
|
@@ -1222,6 +1222,24 @@ var ATOMIC_OPERATOR_COMMANDS = {
|
|
|
1222
1222
|
title: "\u0623\u0643\u0628\u0631 \u0645\u0646 \u0623\u0648 \u064A\u0633\u0627\u0648\u064A",
|
|
1223
1223
|
svg_path: null
|
|
1224
1224
|
},
|
|
1225
|
+
coloneqq: {
|
|
1226
|
+
id: "coloneqq",
|
|
1227
|
+
category: "operators1",
|
|
1228
|
+
Tex: "\\coloneqq",
|
|
1229
|
+
mirror: true,
|
|
1230
|
+
Label: "\u2254",
|
|
1231
|
+
title: "\u064A\u0639\u0631\u0641 \u0628\u0623\u0646\u0647 \u064A\u0633\u0627\u0648\u064A",
|
|
1232
|
+
svg_path: null
|
|
1233
|
+
},
|
|
1234
|
+
eqqcolon: {
|
|
1235
|
+
id: "eqqcolon",
|
|
1236
|
+
category: "operators1",
|
|
1237
|
+
Tex: "\\eqqcolon",
|
|
1238
|
+
mirror: true,
|
|
1239
|
+
Label: "\u2255",
|
|
1240
|
+
title: "\u064A\u0633\u0627\u0648\u064A \u0628\u0627\u0644\u062A\u0639\u0631\u064A\u0641",
|
|
1241
|
+
svg_path: null
|
|
1242
|
+
},
|
|
1225
1243
|
///// Operators 2
|
|
1226
1244
|
propto: {
|
|
1227
1245
|
id: "propto",
|
|
@@ -1388,6 +1406,60 @@ var ATOMIC_OPERATOR_COMMANDS = {
|
|
|
1388
1406
|
title: "\u064A\u0643\u0627\u0641\u0626",
|
|
1389
1407
|
svg_path: null
|
|
1390
1408
|
},
|
|
1409
|
+
implies: {
|
|
1410
|
+
id: "implies",
|
|
1411
|
+
category: "operators3",
|
|
1412
|
+
Tex: "\\implies",
|
|
1413
|
+
mirror: true,
|
|
1414
|
+
Label: "\u21D2",
|
|
1415
|
+
title: "\u064A\u0633\u062A\u0644\u0632\u0645",
|
|
1416
|
+
svg_path: null
|
|
1417
|
+
},
|
|
1418
|
+
impliedby: {
|
|
1419
|
+
id: "impliedby",
|
|
1420
|
+
category: "operators3",
|
|
1421
|
+
Tex: "\\impliedby",
|
|
1422
|
+
mirror: true,
|
|
1423
|
+
Label: "\u21D0",
|
|
1424
|
+
title: "\u0645\u0633\u062A\u0644\u0632\u0645 \u0645\u0646",
|
|
1425
|
+
svg_path: null
|
|
1426
|
+
},
|
|
1427
|
+
iff: {
|
|
1428
|
+
id: "iff",
|
|
1429
|
+
category: "operators3",
|
|
1430
|
+
Tex: "\\iff",
|
|
1431
|
+
mirror: false,
|
|
1432
|
+
Label: "\u21D4",
|
|
1433
|
+
title: "\u0625\u0630\u0627 \u0648\u0641\u0642\u0637 \u0625\u0630\u0627",
|
|
1434
|
+
svg_path: null
|
|
1435
|
+
},
|
|
1436
|
+
Longrightarrow: {
|
|
1437
|
+
id: "Longrightarrow",
|
|
1438
|
+
category: "operators3",
|
|
1439
|
+
Tex: "\\Longrightarrow",
|
|
1440
|
+
mirror: true,
|
|
1441
|
+
Label: "\u27F9",
|
|
1442
|
+
title: "\u0633\u0647\u0645 \u0645\u0632\u062F\u0648\u062C \u0637\u0648\u064A\u0644 \u0625\u0644\u0649 \u0627\u0644\u064A\u0645\u064A\u0646",
|
|
1443
|
+
svg_path: null
|
|
1444
|
+
},
|
|
1445
|
+
Longleftarrow: {
|
|
1446
|
+
id: "Longleftarrow",
|
|
1447
|
+
category: "operators3",
|
|
1448
|
+
Tex: "\\Longleftarrow",
|
|
1449
|
+
mirror: true,
|
|
1450
|
+
Label: "\u27F8",
|
|
1451
|
+
title: "\u0633\u0647\u0645 \u0645\u0632\u062F\u0648\u062C \u0637\u0648\u064A\u0644 \u0625\u0644\u0649 \u0627\u0644\u064A\u0633\u0627\u0631",
|
|
1452
|
+
svg_path: null
|
|
1453
|
+
},
|
|
1454
|
+
to: {
|
|
1455
|
+
id: "to",
|
|
1456
|
+
category: "operators3",
|
|
1457
|
+
Tex: "\\to",
|
|
1458
|
+
mirror: true,
|
|
1459
|
+
Label: "\u2192",
|
|
1460
|
+
title: "\u064A\u0624\u0648\u0644 \u0625\u0644\u0649",
|
|
1461
|
+
svg_path: null
|
|
1462
|
+
},
|
|
1391
1463
|
rightleftharpoons: {
|
|
1392
1464
|
id: "rightleftharpoons",
|
|
1393
1465
|
category: "operators3",
|