@drghaliasri/butex 7.3.0 → 7.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/document.d.mts +1 -1
- package/dist/document.d.ts +1 -1
- package/dist/document.js +36 -1
- package/dist/document.js.map +1 -1
- package/dist/document.mjs +36 -1
- package/dist/document.mjs.map +1 -1
- package/dist/document2-cli.js +56 -1
- package/dist/document2-cli.js.map +1 -1
- package/dist/document2.d.mts +1 -1
- package/dist/document2.d.ts +1 -1
- package/dist/document2.js +56 -1
- package/dist/document2.js.map +1 -1
- package/dist/document2.mjs +56 -1
- package/dist/document2.mjs.map +1 -1
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.global.js +75 -2
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +75 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +75 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react-document.js +71 -1
- package/dist/react-document.js.map +1 -1
- package/dist/react-document.mjs +71 -1
- package/dist/react-document.mjs.map +1 -1
- package/dist/react-document2-preview.js +50 -1
- package/dist/react-document2-preview.js.map +1 -1
- package/dist/react-document2-preview.mjs +50 -1
- package/dist/react-document2-preview.mjs.map +1 -1
- package/dist/react-document2.d.mts +1 -1
- package/dist/react-document2.d.ts +1 -1
- package/dist/react-document2.js +71 -1
- package/dist/react-document2.js.map +1 -1
- package/dist/react-document2.mjs +71 -1
- package/dist/react-document2.mjs.map +1 -1
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +71 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +71 -1
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -2651,6 +2651,12 @@ function createDelimiterNode(leftDelimExpr2, rightDelimExpr2) {
|
|
|
2651
2651
|
innerExpr: createEditorChain()
|
|
2652
2652
|
};
|
|
2653
2653
|
}
|
|
2654
|
+
function createBoxedNode() {
|
|
2655
|
+
return {
|
|
2656
|
+
...createEditorNode("boxed", ""),
|
|
2657
|
+
innerExpr: createEditorChain()
|
|
2658
|
+
};
|
|
2659
|
+
}
|
|
2654
2660
|
function createFracNode() {
|
|
2655
2661
|
return {
|
|
2656
2662
|
...createEditorNode("frac", ""),
|
|
@@ -2868,8 +2874,9 @@ function characterFontSpec(fontId) {
|
|
|
2868
2874
|
// src/editor/divideOperator.ts
|
|
2869
2875
|
var DIVIDE_OPERATOR_EN = "/";
|
|
2870
2876
|
var DIVIDE_OPERATOR_AR = "\\";
|
|
2877
|
+
var DIVIDE_OPERATOR_AR_LATEX = "\\backslash";
|
|
2871
2878
|
function isDivideOperatorExpr(expr) {
|
|
2872
|
-
return expr === DIVIDE_OPERATOR_EN || expr === DIVIDE_OPERATOR_AR;
|
|
2879
|
+
return expr === DIVIDE_OPERATOR_EN || expr === DIVIDE_OPERATOR_AR || expr === DIVIDE_OPERATOR_AR_LATEX;
|
|
2873
2880
|
}
|
|
2874
2881
|
function renderDivideOperatorLatex(side) {
|
|
2875
2882
|
return side === "arabic" ? "\\backslash" : DIVIDE_OPERATOR_EN;
|
|
@@ -2984,6 +2991,10 @@ function renderNodeEnglish(node, options) {
|
|
|
2984
2991
|
if (node.kind === "delimiter" && node.innerExpr) {
|
|
2985
2992
|
return `${node.leftDelimExpr}${renderChainEnglish(node.innerExpr, options)}${node.rightDelimExpr}${latinScripts(node, options)}`;
|
|
2986
2993
|
}
|
|
2994
|
+
if (node.kind === "boxed" && node.innerExpr) {
|
|
2995
|
+
const body = `\\boxed{${renderChainEnglish(node.innerExpr, options)}}`;
|
|
2996
|
+
return `${body}${latinScripts(node, options)}`;
|
|
2997
|
+
}
|
|
2987
2998
|
if (node.kind === "frac" && node.numerator && node.denominator) {
|
|
2988
2999
|
const body = `\\frac{${renderChainEnglish(node.numerator, options)}}{${renderChainEnglish(node.denominator, options)}}`;
|
|
2989
3000
|
return `${body}${latinScripts(node, options)}`;
|
|
@@ -3040,6 +3051,10 @@ function renderNodeArabic(node, options) {
|
|
|
3040
3051
|
const content = `${node.leftDelimExpr}${renderChainArabic(node.innerExpr, options)}${node.rightDelimExpr}`;
|
|
3041
3052
|
return arabicScripts(node, content, options);
|
|
3042
3053
|
}
|
|
3054
|
+
if (node.kind === "boxed" && node.innerExpr) {
|
|
3055
|
+
const content = `\\boxed{${renderChainArabic(node.innerExpr, options)}}`;
|
|
3056
|
+
return arabicScripts(node, content, options);
|
|
3057
|
+
}
|
|
3043
3058
|
if (node.kind === "frac" && node.numerator && node.denominator) {
|
|
3044
3059
|
const content = `\\frac{${renderChainArabic(node.numerator, options)}}{${renderChainArabic(node.denominator, options)}}`;
|
|
3045
3060
|
return arabicScripts(node, content, options);
|
|
@@ -3176,6 +3191,21 @@ var rightDelimExpr = buildDelimiterExpr(
|
|
|
3176
3191
|
[")", "]", "\\}", "\\rfloor", "\\rceil", "\\rangle", "`", "|", "\\|", "\\rvert", "\\vert", "\\rVert", "\\Vert"]
|
|
3177
3192
|
);
|
|
3178
3193
|
|
|
3194
|
+
// src/editor/display/boxed.ts
|
|
3195
|
+
var BOXED_CSS = `
|
|
3196
|
+
.boxed-command {
|
|
3197
|
+
display: inline-flex;
|
|
3198
|
+
align-items: center;
|
|
3199
|
+
border: 1.5px solid currentColor;
|
|
3200
|
+
padding: 0.12em 0.22em;
|
|
3201
|
+
min-height: 1.25em;
|
|
3202
|
+
}
|
|
3203
|
+
|
|
3204
|
+
.boxed-command > .chain {
|
|
3205
|
+
min-height: auto;
|
|
3206
|
+
}
|
|
3207
|
+
`.trim();
|
|
3208
|
+
|
|
3179
3209
|
// src/editor/display/frac.ts
|
|
3180
3210
|
var FRAC_CSS = `
|
|
3181
3211
|
.frac {
|
|
@@ -3688,6 +3718,13 @@ ${CHARACTER_FONT_CSS}
|
|
|
3688
3718
|
font-weight: 700;
|
|
3689
3719
|
}
|
|
3690
3720
|
|
|
3721
|
+
.node-value--unit {
|
|
3722
|
+
font-style: normal;
|
|
3723
|
+
text-decoration-line: underline;
|
|
3724
|
+
text-decoration-style: dotted;
|
|
3725
|
+
text-underline-offset: 0.2em;
|
|
3726
|
+
}
|
|
3727
|
+
|
|
3691
3728
|
.chain {
|
|
3692
3729
|
display: inline-flex;
|
|
3693
3730
|
align-items: center;
|
|
@@ -3841,6 +3878,8 @@ ${CHARACTER_FONT_CSS}
|
|
|
3841
3878
|
|
|
3842
3879
|
${DELIMITER_CSS}
|
|
3843
3880
|
|
|
3881
|
+
${BOXED_CSS}
|
|
3882
|
+
|
|
3844
3883
|
${FRAC_CSS}
|
|
3845
3884
|
|
|
3846
3885
|
${SQRT_CSS}
|
|
@@ -4167,6 +4206,16 @@ function commandToEditorNode(node) {
|
|
|
4167
4206
|
}
|
|
4168
4207
|
return { editable: true, node: sqrt };
|
|
4169
4208
|
}
|
|
4209
|
+
if (node.name === "\\boxed" && node.optionalArgs.length === 0 && node.mandatoryArgs.length === 1) {
|
|
4210
|
+
const boxed = createBoxedNode();
|
|
4211
|
+
const inner = chainToEditorChain(node.mandatoryArgs[0]);
|
|
4212
|
+
if (!inner.editable) {
|
|
4213
|
+
return inner;
|
|
4214
|
+
}
|
|
4215
|
+
boxed.innerExpr = inner.chain;
|
|
4216
|
+
const scripts = attachScripts(node, boxed);
|
|
4217
|
+
return scripts ?? { editable: true, node: boxed };
|
|
4218
|
+
}
|
|
4170
4219
|
if (node.name === "\\overset" && node.mandatoryArgs.length >= 2) {
|
|
4171
4220
|
const overset = createOversetNode();
|
|
4172
4221
|
const overExpr = chainToEditorChain(node.mandatoryArgs[0]);
|