@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.
Files changed (43) hide show
  1. package/dist/document.d.mts +1 -1
  2. package/dist/document.d.ts +1 -1
  3. package/dist/document.js +36 -1
  4. package/dist/document.js.map +1 -1
  5. package/dist/document.mjs +36 -1
  6. package/dist/document.mjs.map +1 -1
  7. package/dist/document2-cli.js +56 -1
  8. package/dist/document2-cli.js.map +1 -1
  9. package/dist/document2.d.mts +1 -1
  10. package/dist/document2.d.ts +1 -1
  11. package/dist/document2.js +56 -1
  12. package/dist/document2.js.map +1 -1
  13. package/dist/document2.mjs +56 -1
  14. package/dist/document2.mjs.map +1 -1
  15. package/dist/index.d.mts +7 -2
  16. package/dist/index.d.ts +7 -2
  17. package/dist/index.global.js +75 -2
  18. package/dist/index.global.js.map +1 -1
  19. package/dist/index.js +75 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +75 -2
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/react-document.js +71 -1
  24. package/dist/react-document.js.map +1 -1
  25. package/dist/react-document.mjs +71 -1
  26. package/dist/react-document.mjs.map +1 -1
  27. package/dist/react-document2-preview.js +50 -1
  28. package/dist/react-document2-preview.js.map +1 -1
  29. package/dist/react-document2-preview.mjs +50 -1
  30. package/dist/react-document2-preview.mjs.map +1 -1
  31. package/dist/react-document2.d.mts +1 -1
  32. package/dist/react-document2.d.ts +1 -1
  33. package/dist/react-document2.js +71 -1
  34. package/dist/react-document2.js.map +1 -1
  35. package/dist/react-document2.mjs +71 -1
  36. package/dist/react-document2.mjs.map +1 -1
  37. package/dist/react.d.mts +1 -1
  38. package/dist/react.d.ts +1 -1
  39. package/dist/react.js +71 -1
  40. package/dist/react.js.map +1 -1
  41. package/dist/react.mjs +71 -1
  42. package/dist/react.mjs.map +1 -1
  43. package/package.json +1 -1
package/dist/document.mjs CHANGED
@@ -1937,8 +1937,9 @@ function characterFontSpec(fontId) {
1937
1937
  // src/editor/divideOperator.ts
1938
1938
  var DIVIDE_OPERATOR_EN = "/";
1939
1939
  var DIVIDE_OPERATOR_AR = "\\";
1940
+ var DIVIDE_OPERATOR_AR_LATEX = "\\backslash";
1940
1941
  function isDivideOperatorExpr(expr) {
1941
- return expr === DIVIDE_OPERATOR_EN || expr === DIVIDE_OPERATOR_AR;
1942
+ return expr === DIVIDE_OPERATOR_EN || expr === DIVIDE_OPERATOR_AR || expr === DIVIDE_OPERATOR_AR_LATEX;
1942
1943
  }
1943
1944
  function renderDivideOperatorLatex(side) {
1944
1945
  return side === "arabic" ? "\\backslash" : DIVIDE_OPERATOR_EN;
@@ -2042,6 +2043,10 @@ function renderNodeArabic(node, options) {
2042
2043
  const content = `${node.leftDelimExpr}${renderChainArabic(node.innerExpr, options)}${node.rightDelimExpr}`;
2043
2044
  return arabicScripts(node, content, options);
2044
2045
  }
2046
+ if (node.kind === "boxed" && node.innerExpr) {
2047
+ const content = `\\boxed{${renderChainArabic(node.innerExpr, options)}}`;
2048
+ return arabicScripts(node, content, options);
2049
+ }
2045
2050
  if (node.kind === "frac" && node.numerator && node.denominator) {
2046
2051
  const content = `\\frac{${renderChainArabic(node.numerator, options)}}{${renderChainArabic(node.denominator, options)}}`;
2047
2052
  return arabicScripts(node, content, options);
@@ -2150,6 +2155,21 @@ var rightDelimExpr = buildDelimiterExpr(
2150
2155
  [")", "]", "\\}", "\\rfloor", "\\rceil", "\\rangle", "`", "|", "\\|", "\\rvert", "\\vert", "\\rVert", "\\Vert"]
2151
2156
  );
2152
2157
 
2158
+ // src/editor/display/boxed.ts
2159
+ var BOXED_CSS = `
2160
+ .boxed-command {
2161
+ display: inline-flex;
2162
+ align-items: center;
2163
+ border: 1.5px solid currentColor;
2164
+ padding: 0.12em 0.22em;
2165
+ min-height: 1.25em;
2166
+ }
2167
+
2168
+ .boxed-command > .chain {
2169
+ min-height: auto;
2170
+ }
2171
+ `.trim();
2172
+
2153
2173
  // src/editor/display/frac.ts
2154
2174
  var FRAC_CSS = `
2155
2175
  .frac {
@@ -2662,6 +2682,13 @@ ${CHARACTER_FONT_CSS}
2662
2682
  font-weight: 700;
2663
2683
  }
2664
2684
 
2685
+ .node-value--unit {
2686
+ font-style: normal;
2687
+ text-decoration-line: underline;
2688
+ text-decoration-style: dotted;
2689
+ text-underline-offset: 0.2em;
2690
+ }
2691
+
2665
2692
  .chain {
2666
2693
  display: inline-flex;
2667
2694
  align-items: center;
@@ -2815,6 +2842,8 @@ ${CHARACTER_FONT_CSS}
2815
2842
 
2816
2843
  ${DELIMITER_CSS}
2817
2844
 
2845
+ ${BOXED_CSS}
2846
+
2818
2847
  ${FRAC_CSS}
2819
2848
 
2820
2849
  ${SQRT_CSS}
@@ -2947,6 +2976,12 @@ function editorNodeToAstNode(node) {
2947
2976
  return inner;
2948
2977
  }
2949
2978
  astNode = new DelimiterNode(node.leftDelimExpr, inner.chain, node.rightDelimExpr);
2979
+ } else if (node.kind === "boxed" && node.innerExpr) {
2980
+ const inner = editorChainToAstChain(node.innerExpr);
2981
+ if (!inner.ok) {
2982
+ return inner;
2983
+ }
2984
+ astNode = new CommandNode("\\boxed", [], [inner.chain]);
2950
2985
  } else if (node.kind === "frac" && node.numerator && node.denominator) {
2951
2986
  const numerator = editorChainToAstChain(node.numerator);
2952
2987
  const denominator = editorChainToAstChain(node.denominator);