@formulaxjs/kity-runtime 0.4.0 → 0.5.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.
Files changed (42) hide show
  1. package/README.md +14 -11
  2. package/README.zh-CN.md +44 -0
  3. package/dist/base.css +47 -0
  4. package/dist/{chunk-LIDQRZXL.js → chunk-EQCAHDH7.js} +85 -34
  5. package/dist/chunk-EQCAHDH7.js.map +1 -0
  6. package/dist/images/scrollbar/custom/bar-bg.png +0 -0
  7. package/dist/images/scrollbar/custom/bar.png +0 -0
  8. package/dist/images/scrollbar/custom/bg.png +0 -0
  9. package/dist/images/scrollbar/custom/bottom.png +0 -0
  10. package/dist/images/scrollbar/custom/btn.png +0 -0
  11. package/dist/images/scrollbar/custom/down.png +0 -0
  12. package/dist/images/scrollbar/custom/top.png +0 -0
  13. package/dist/images/scrollbar/custom/up.png +0 -0
  14. package/dist/images/scrollbar/edit/bar-bg.png +0 -0
  15. package/dist/images/scrollbar/edit/bar-left.png +0 -0
  16. package/dist/images/scrollbar/edit/bar-right.png +0 -0
  17. package/dist/images/scrollbar/edit/thumb-bg.png +0 -0
  18. package/dist/images/scrollbar/edit/thumb-left.png +0 -0
  19. package/dist/images/scrollbar/edit/thumb-right.png +0 -0
  20. package/dist/images/toolbar/btn.png +0 -0
  21. package/dist/index.cjs +124 -148
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.global.js +127 -147
  24. package/dist/index.global.js.map +1 -1
  25. package/dist/index.js +8 -3
  26. package/dist/index.js.map +1 -1
  27. package/dist/other.png +0 -0
  28. package/dist/scrollbar.css +78 -0
  29. package/dist/{start-H6H24L6P.js → start-N66J24A5.js} +11 -50
  30. package/dist/start-N66J24A5.js.map +1 -0
  31. package/dist/ui.css +625 -0
  32. package/package.json +7 -2
  33. package/dist/chunk-LIDQRZXL.js.map +0 -1
  34. package/dist/start-H6H24L6P.js.map +0 -1
  35. /package/dist/{KF_AMS_BB-5QF7FUSO.woff → KF_AMS_BB.woff} +0 -0
  36. /package/dist/{KF_AMS_CAL-NXRNLAZN.woff → KF_AMS_CAL.woff} +0 -0
  37. /package/dist/{KF_AMS_FRAK-CO33WWN4.woff → KF_AMS_FRAK.woff} +0 -0
  38. /package/dist/{KF_AMS_MAIN-25QJVAWY.woff → KF_AMS_MAIN.woff} +0 -0
  39. /package/dist/{KF_AMS_ROMAN-243BR7HH.woff → KF_AMS_ROMAN.woff} +0 -0
  40. /package/dist/{btn-5DANP6JY.png → btn.png} +0 -0
  41. /package/dist/{editor-JT5KLVXX.css → editor.css} +0 -0
  42. /package/dist/{other-OMWJFGL5.png → images/toolbar/other.png} +0 -0
package/dist/other.png ADDED
Binary file
@@ -0,0 +1,78 @@
1
+ /*!
2
+ * Scrollbar
3
+ **/
4
+
5
+ .kf-editor-edit-scrollbar {
6
+ width: 100%;
7
+ height: 16px;
8
+ position: absolute;
9
+ bottom: 0;
10
+ left: 0;
11
+ z-index: 994;
12
+ border-top: 1px solid #ddd;
13
+ }
14
+
15
+ .kf-editor-ui-left-button {
16
+ position: absolute;
17
+ top: 0;
18
+ left: 0;
19
+ width: 5px;
20
+ height: 100%;
21
+ background: white;
22
+ }
23
+
24
+ .kf-editor-ui-right-button {
25
+ position: absolute;
26
+ top: 0;
27
+ right: 0;
28
+ width: 5px;
29
+ height: 100%;
30
+ background: white;
31
+ }
32
+
33
+ .kf-editor-ui-track {
34
+ position: absolute;
35
+ top: 0;
36
+ left: 5px;
37
+ width: 0;
38
+ height: 100%;
39
+ background-image: url(./images/scrollbar/edit/bar-left.png), url(./images/scrollbar/edit/bar-right.png), url(./images/scrollbar/edit/bar-bg.png);
40
+ background-repeat: no-repeat, no-repeat, repeat-x;
41
+ background-position: 0 0, right 0, 0 0;
42
+ }
43
+
44
+ .kf-editor-ui-thumb {
45
+ position: absolute;
46
+ top: 0;
47
+ left: 0;
48
+ width: 0;
49
+ height: 100%;
50
+ }
51
+
52
+ .kf-editor-ui-thumb-left {
53
+ width: 5px;
54
+ height: 100%;
55
+ position: absolute;
56
+ top: 0;
57
+ left: 0;
58
+ background: url(./images/scrollbar/edit/thumb-left.png) no-repeat 0 0;
59
+ z-index: 1;
60
+ }
61
+
62
+ .kf-editor-ui-thumb-right {
63
+ width: 5px;
64
+ height: 100%;
65
+ position: absolute;
66
+ top: 0;
67
+ right: 0;
68
+ background: url(./images/scrollbar/edit/thumb-right.png) no-repeat 0 0;
69
+ }
70
+
71
+ .kf-editor-ui-thumb-body {
72
+ position: absolute;
73
+ top: 0;
74
+ left: 5px;
75
+ width: 0;
76
+ height: 100%;
77
+ background: url(./images/scrollbar/edit/thumb-bg.png) repeat-x 0 0;
78
+ }
@@ -13,8 +13,9 @@ import {
13
13
  legacySysconf,
14
14
  legacyUiDef,
15
15
  normalizeFormulaXLocale,
16
- resolveToolbarAssetPath
17
- } from "./chunk-LIDQRZXL.js";
16
+ resolveToolbarAssetPath,
17
+ translateFormulaXText
18
+ } from "./chunk-EQCAHDH7.js";
18
19
 
19
20
  // src/vendor/runtime-interop.ts
20
21
  function getLegacyRuntime() {
@@ -1620,6 +1621,7 @@ var UNICODE_SYMBOLS = {
1620
1621
  to: "\u2192",
1621
1622
  downarrow: "\u2193",
1622
1623
  leftrightarrow: "\u2194",
1624
+ updownarrow: "\u2195",
1623
1625
  therefore: "\u2234",
1624
1626
  because: "\u2235",
1625
1627
  "+": "+",
@@ -1736,7 +1738,7 @@ var UNICODE_SYMBOLS = {
1736
1738
  Uparrow: "\u21D1",
1737
1739
  Downarrow: "\u21D3",
1738
1740
  Leftrightarrow: "\u21D4",
1739
- Updownarrow: "\u21F3",
1741
+ Updownarrow: "\u21D5",
1740
1742
  longleftarrow: "\u27F5",
1741
1743
  longrightarrow: "\u27F6",
1742
1744
  longleftrightarrow: "\u27F7",
@@ -1815,40 +1817,6 @@ function resolveUnicode(key) {
1815
1817
  var UI_ELE_TYPE = legacyEleType;
1816
1818
  var BOX_TYPE2 = legacyBoxType;
1817
1819
  var OTHER_POSITION = legacyOtherPosition;
1818
- var zhCnToEnUsText = /* @__PURE__ */ new Map([
1819
- ["\u9884\u8BBE", "Presets"],
1820
- ["\u9884\u8BBE\u516C\u5F0F", "Preset formulas"],
1821
- ["\u4E8C\u6B21\u516C\u5F0F", "Quadratic formula"],
1822
- ["\u4E8C\u9879\u5F0F\u5B9A\u7406", "Binomial theorem"],
1823
- ["\u52FE\u80A1\u5B9A\u7406", "Pythagorean theorem"],
1824
- ["\u57FA\u7840\u6570\u5B66", "Basic math"],
1825
- ["\u5E0C\u814A\u5B57\u6BCD", "Greek letters"],
1826
- ["\u6C42\u53CD\u5173\u7CFB\u8FD0\u7B97\u7B26", "Negated operators"],
1827
- ["\u5B57\u6BCD\u7C7B\u7B26\u53F7", "Letter-like symbols"],
1828
- ["\u7BAD\u5934", "Arrows"],
1829
- ["\u624B\u5199\u4F53", "Script"],
1830
- ["\u5206\u6570", "Fraction"],
1831
- ["\u5E38\u7528\u5206\u6570", "Common fractions"],
1832
- ["\u4E0A\u4E0B\u6807", "Scripts"],
1833
- ["\u4E0A\u6807\u548C\u4E0B\u6807", "Superscripts and subscripts"],
1834
- ["\u5E38\u7528\u7684\u4E0A\u6807\u548C\u4E0B\u6807", "Common superscripts and subscripts"],
1835
- ["\u6839\u5F0F", "Radicals"],
1836
- ["\u5E38\u7528\u6839\u5F0F", "Common radicals"],
1837
- ["\u79EF\u5206", "Integrals"],
1838
- ["\u5927\u578B\u8FD0\u7B97\u7B26", "Large operators"],
1839
- ["\u6C42\u548C", "Summations"],
1840
- ["\u62EC\u53F7", "Brackets"],
1841
- ["\u65B9\u62EC\u53F7", "Brackets"],
1842
- ["\u51FD\u6570", "Functions"],
1843
- ["\u4E09\u89D2\u51FD\u6570", "Trigonometric functions"],
1844
- ["\u5E38\u7528\u51FD\u6570", "Common functions"],
1845
- ["\u5C0F\u5199", "Lowercase"],
1846
- ["\u5927\u5199", "Uppercase"],
1847
- ["\u53D8\u4F53", "Variants"],
1848
- ["\u82B1\u4F53", "Fraktur"],
1849
- ["\u53CC\u7EBF", "Double-struck"],
1850
- ["\u7F57\u9A6C", "Roman"]
1851
- ]);
1852
1820
  function each(list, callback) {
1853
1821
  if (Array.isArray(list)) {
1854
1822
  list.forEach((item, index) => callback(item, index));
@@ -1857,16 +1825,7 @@ function each(list, callback) {
1857
1825
  Object.keys(list).forEach((key) => callback(list[key], key));
1858
1826
  }
1859
1827
  function translateToolbarText(value, locale) {
1860
- if (locale === "zh_CN") {
1861
- return value;
1862
- }
1863
- const normalizedValue = value.replace(/<br\s*\/?>/gi, "").trim();
1864
- const translatedValue = zhCnToEnUsText.get(normalizedValue);
1865
- if (!translatedValue) {
1866
- return value;
1867
- }
1868
- const lineBreakMatch = value.match(/<br\s*\/?>/i);
1869
- return lineBreakMatch ? `${translatedValue}${lineBreakMatch[0]}` : translatedValue;
1828
+ return translateFormulaXText("toolbar", value, locale);
1870
1829
  }
1871
1830
  function localizeToolbarConfig(value, locale) {
1872
1831
  if (Array.isArray(value)) {
@@ -3058,7 +3017,6 @@ var vgroup_def_default = legacyVirtualGroupMap;
3058
3017
 
3059
3018
  // src/legacy/parser.ts
3060
3019
  var CURSOR_CHAR = legacySysconf.cursorCharacter;
3061
- var ROOT_P_TEXT = legacySysconf.rootPlaceholder.content;
3062
3020
  var COMBINATION_NAME = "combination";
3063
3021
  var PID_PREFIX = "_kf_editor_";
3064
3022
  var pidSeed = 0;
@@ -3100,6 +3058,9 @@ function createGroup(parser) {
3100
3058
  operand: []
3101
3059
  };
3102
3060
  }
3061
+ function getRootPlaceholderText() {
3062
+ return legacySysconf.rootPlaceholder.content;
3063
+ }
3103
3064
  function processRootGroup(parser, tree) {
3104
3065
  if (!parser.isResetId) {
3105
3066
  tree.attr["data-type"] = legacyGroupType.VIRTUAL;
@@ -3147,7 +3108,7 @@ function supplementTree(parser, tree, parentTree) {
3147
3108
  if (isRoot) {
3148
3109
  processRootGroup(parser, tree);
3149
3110
  } else if (parentTree?.attr?.["data-root"] && tree.name === "placeholder" && onlyPlaceholder(parentTree.operand)) {
3150
- tree.attr.label = ROOT_P_TEXT;
3111
+ tree.attr.label = getRootPlaceholderText();
3151
3112
  }
3152
3113
  for (let i = 0; i < tree.operand.length; i += 1) {
3153
3114
  const currentOperand = tree.operand[i];
@@ -4962,4 +4923,4 @@ export {
4962
4923
  start_default as default,
4963
4924
  installKityEditorStart
4964
4925
  };
4965
- //# sourceMappingURL=start-H6H24L6P.js.map
4926
+ //# sourceMappingURL=start-N66J24A5.js.map