@formulaxjs/ckeditor5 0.3.1 → 0.4.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 (46) hide show
  1. package/README.md +24 -21
  2. package/README.zh-CN.md +24 -21
  3. package/dist/base.css +47 -0
  4. package/dist/canvg-runtime-UR3JNX5Q.js +2759 -0
  5. package/dist/canvg-runtime-UR3JNX5Q.js.map +1 -0
  6. package/dist/chunk-4NHESKRD.js +3407 -0
  7. package/dist/chunk-4NHESKRD.js.map +1 -0
  8. package/dist/images/scrollbar/custom/bar-bg.png +0 -0
  9. package/dist/images/scrollbar/custom/bar.png +0 -0
  10. package/dist/images/scrollbar/custom/bg.png +0 -0
  11. package/dist/images/scrollbar/custom/bottom.png +0 -0
  12. package/dist/images/scrollbar/custom/btn.png +0 -0
  13. package/dist/images/scrollbar/custom/down.png +0 -0
  14. package/dist/images/scrollbar/custom/top.png +0 -0
  15. package/dist/images/scrollbar/custom/up.png +0 -0
  16. package/dist/images/scrollbar/edit/bar-bg.png +0 -0
  17. package/dist/images/scrollbar/edit/bar-left.png +0 -0
  18. package/dist/images/scrollbar/edit/bar-right.png +0 -0
  19. package/dist/images/scrollbar/edit/thumb-bg.png +0 -0
  20. package/dist/images/scrollbar/edit/thumb-left.png +0 -0
  21. package/dist/images/scrollbar/edit/thumb-right.png +0 -0
  22. package/dist/images/toolbar/btn.png +0 -0
  23. package/dist/index.cjs +24080 -70
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.global.js +162 -156
  26. package/dist/index.global.js.map +1 -1
  27. package/dist/index.js +3768 -21
  28. package/dist/index.js.map +1 -1
  29. package/dist/install-XGCSWTLU.js +5464 -0
  30. package/dist/install-XGCSWTLU.js.map +1 -0
  31. package/dist/install-XVTKACEN.js +1349 -0
  32. package/dist/install-XVTKACEN.js.map +1 -0
  33. package/dist/other.png +0 -0
  34. package/dist/scrollbar.css +78 -0
  35. package/dist/start-CRRRBVTN.js +4926 -0
  36. package/dist/start-CRRRBVTN.js.map +1 -0
  37. package/dist/ui.css +625 -0
  38. package/package.json +11 -6
  39. /package/dist/{KF_AMS_BB-5QF7FUSO.woff → KF_AMS_BB.woff} +0 -0
  40. /package/dist/{KF_AMS_CAL-NXRNLAZN.woff → KF_AMS_CAL.woff} +0 -0
  41. /package/dist/{KF_AMS_FRAK-CO33WWN4.woff → KF_AMS_FRAK.woff} +0 -0
  42. /package/dist/{KF_AMS_MAIN-25QJVAWY.woff → KF_AMS_MAIN.woff} +0 -0
  43. /package/dist/{KF_AMS_ROMAN-243BR7HH.woff → KF_AMS_ROMAN.woff} +0 -0
  44. /package/dist/{btn-5DANP6JY.png → btn.png} +0 -0
  45. /package/dist/{editor-JT5KLVXX.css → editor.css} +0 -0
  46. /package/dist/{other-OMWJFGL5.png → images/toolbar/other.png} +0 -0
@@ -1,9 +1,17 @@
1
1
  "use strict";
2
2
  var FormulaX = (() => {
3
+ var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
6
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
+ }) : x)(function(x) {
12
+ if (typeof require !== "undefined") return require.apply(this, arguments);
13
+ throw Error('Dynamic require of "' + x + '" is not supported');
14
+ });
7
15
  var __esm = (fn, res) => function __init() {
8
16
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
9
17
  };
@@ -19,98 +27,42 @@ var FormulaX = (() => {
19
27
  }
20
28
  return to;
21
29
  };
30
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
31
+ // If the importer is in node compatibility mode or this is not an ESM
32
+ // file that has been converted to a CommonJS file using a Babel-
33
+ // compatible transform (i.e. "__esModule" has not been set), then set
34
+ // "default" to the CommonJS "module.exports" for node compatibility.
35
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
36
+ mod
37
+ ));
22
38
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
39
 
24
- // ../kity-runtime/public/assets/images/toolbar/btn.png
25
- var btn_default;
26
- var init_btn = __esm({
27
- "../kity-runtime/public/assets/images/toolbar/btn.png"() {
28
- btn_default = "./btn-5DANP6JY.png";
29
- }
30
- });
31
-
32
- // ../kity-runtime/public/assets/images/toolbar/other.png
33
- var other_default;
34
- var init_other = __esm({
35
- "../kity-runtime/public/assets/images/toolbar/other.png"() {
36
- other_default = "./other-OMWJFGL5.png";
37
- }
38
- });
39
-
40
- // ../kity-runtime/public/assets/styles/editor.css?url
41
- var editor_default;
42
- var init_editor = __esm({
43
- "../kity-runtime/public/assets/styles/editor.css?url"() {
44
- editor_default = "./editor-JT5KLVXX.css?url";
45
- }
46
- });
47
-
48
- // ../kity-runtime/public/resource/KF_AMS_BB.woff
49
- var KF_AMS_BB_default;
50
- var init_KF_AMS_BB = __esm({
51
- "../kity-runtime/public/resource/KF_AMS_BB.woff"() {
52
- KF_AMS_BB_default = "./KF_AMS_BB-5QF7FUSO.woff";
53
- }
54
- });
55
-
56
- // ../kity-runtime/public/resource/KF_AMS_CAL.woff
57
- var KF_AMS_CAL_default;
58
- var init_KF_AMS_CAL = __esm({
59
- "../kity-runtime/public/resource/KF_AMS_CAL.woff"() {
60
- KF_AMS_CAL_default = "./KF_AMS_CAL-NXRNLAZN.woff";
61
- }
62
- });
63
-
64
- // ../kity-runtime/public/resource/KF_AMS_FRAK.woff
65
- var KF_AMS_FRAK_default;
66
- var init_KF_AMS_FRAK = __esm({
67
- "../kity-runtime/public/resource/KF_AMS_FRAK.woff"() {
68
- KF_AMS_FRAK_default = "./KF_AMS_FRAK-CO33WWN4.woff";
69
- }
70
- });
71
-
72
- // ../kity-runtime/public/resource/KF_AMS_MAIN.woff
73
- var KF_AMS_MAIN_default;
74
- var init_KF_AMS_MAIN = __esm({
75
- "../kity-runtime/public/resource/KF_AMS_MAIN.woff"() {
76
- KF_AMS_MAIN_default = "./KF_AMS_MAIN-25QJVAWY.woff";
77
- }
78
- });
79
-
80
- // ../kity-runtime/public/resource/KF_AMS_ROMAN.woff
81
- var KF_AMS_ROMAN_default;
82
- var init_KF_AMS_ROMAN = __esm({
83
- "../kity-runtime/public/resource/KF_AMS_ROMAN.woff"() {
84
- KF_AMS_ROMAN_default = "./KF_AMS_ROMAN-243BR7HH.woff";
85
- }
86
- });
87
-
88
40
  // ../kity-runtime/src/asset-manifest.ts
89
- var kityFontAssets, kityToolbarAssets, kityStyleAssets, kityAssetManifest;
41
+ var import_btn, import_other, import_editor, import_KF_AMS_BB, import_KF_AMS_CAL, import_KF_AMS_FRAK, import_KF_AMS_MAIN, import_KF_AMS_ROMAN, kityFontAssets, kityToolbarAssets, kityStyleAssets, kityAssetManifest;
90
42
  var init_asset_manifest = __esm({
91
43
  "../kity-runtime/src/asset-manifest.ts"() {
92
44
  "use strict";
93
- init_btn();
94
- init_other();
95
- init_editor();
96
- init_KF_AMS_BB();
97
- init_KF_AMS_CAL();
98
- init_KF_AMS_FRAK();
99
- init_KF_AMS_MAIN();
100
- init_KF_AMS_ROMAN();
45
+ import_btn = __toESM(__require("./btn.png"), 1);
46
+ import_other = __toESM(__require("./other.png"), 1);
47
+ import_editor = __toESM(__require("./editor.css?url"), 1);
48
+ import_KF_AMS_BB = __toESM(__require("./KF_AMS_BB.woff"), 1);
49
+ import_KF_AMS_CAL = __toESM(__require("./KF_AMS_CAL.woff"), 1);
50
+ import_KF_AMS_FRAK = __toESM(__require("./KF_AMS_FRAK.woff"), 1);
51
+ import_KF_AMS_MAIN = __toESM(__require("./KF_AMS_MAIN.woff"), 1);
52
+ import_KF_AMS_ROMAN = __toESM(__require("./KF_AMS_ROMAN.woff"), 1);
101
53
  kityFontAssets = {
102
- KF_AMS_BB: KF_AMS_BB_default,
103
- KF_AMS_CAL: KF_AMS_CAL_default,
104
- KF_AMS_FRAK: KF_AMS_FRAK_default,
105
- KF_AMS_MAIN: KF_AMS_MAIN_default,
106
- KF_AMS_ROMAN: KF_AMS_ROMAN_default
54
+ KF_AMS_BB: import_KF_AMS_BB.default,
55
+ KF_AMS_CAL: import_KF_AMS_CAL.default,
56
+ KF_AMS_FRAK: import_KF_AMS_FRAK.default,
57
+ KF_AMS_MAIN: import_KF_AMS_MAIN.default,
58
+ KF_AMS_ROMAN: import_KF_AMS_ROMAN.default
107
59
  };
108
60
  kityToolbarAssets = {
109
- btn: btn_default,
110
- other: other_default
61
+ btn: import_btn.default,
62
+ other: import_other.default
111
63
  };
112
64
  kityStyleAssets = {
113
- editor: editor_default
65
+ editor: import_editor.default
114
66
  };
115
67
  kityAssetManifest = {
116
68
  fonts: kityFontAssets,
@@ -5079,11 +5031,76 @@ var FormulaX = (() => {
5079
5031
  }
5080
5032
  return DEFAULT_FORMULAX_LOCALE;
5081
5033
  }
5082
- var DEFAULT_FORMULAX_LOCALE;
5034
+ function translateFormulaXText(namespace, value, locale) {
5035
+ if (locale === "zh_CN") {
5036
+ return value;
5037
+ }
5038
+ const normalizedValue = value.replace(/<br\s*\/?>/gi, "").trim();
5039
+ const translatedValue = FORMULAX_TRANSLATIONS[locale]?.[namespace]?.[normalizedValue];
5040
+ if (!translatedValue) {
5041
+ return value;
5042
+ }
5043
+ const lineBreakMatch = value.match(/<br\s*\/?>/i);
5044
+ if (/<br\s*\/?>/i.test(translatedValue)) {
5045
+ return translatedValue;
5046
+ }
5047
+ return lineBreakMatch ? `${translatedValue}${lineBreakMatch[0]}` : translatedValue;
5048
+ }
5049
+ function getFormulaXRuntimeMessage(key, locale = DEFAULT_FORMULAX_LOCALE) {
5050
+ const normalizedLocale = normalizeFormulaXLocale(locale);
5051
+ return FORMULAX_RUNTIME_MESSAGES[normalizedLocale][key] ?? FORMULAX_RUNTIME_MESSAGES[DEFAULT_FORMULAX_LOCALE][key];
5052
+ }
5053
+ var DEFAULT_FORMULAX_LOCALE, FORMULAX_TRANSLATIONS, FORMULAX_RUNTIME_MESSAGES;
5083
5054
  var init_i18n = __esm({
5084
5055
  "../kity-runtime/src/i18n.ts"() {
5085
5056
  "use strict";
5086
5057
  DEFAULT_FORMULAX_LOCALE = "en_US";
5058
+ FORMULAX_TRANSLATIONS = {
5059
+ en_US: {
5060
+ toolbar: {
5061
+ \u9884\u8BBE: "Presets",
5062
+ \u9884\u8BBE\u516C\u5F0F: "Presets",
5063
+ \u4E8C\u6B21\u516C\u5F0F: "Quadratic",
5064
+ \u4E8C\u9879\u5F0F\u5B9A\u7406: "Binomial",
5065
+ \u52FE\u80A1\u5B9A\u7406: "Pythagorean",
5066
+ \u57FA\u7840\u6570\u5B66: "Basic math",
5067
+ \u5E0C\u814A\u5B57\u6BCD: "Greek",
5068
+ \u6C42\u53CD\u5173\u7CFB\u8FD0\u7B97\u7B26: "Negated operators",
5069
+ \u5B57\u6BCD\u7C7B\u7B26\u53F7: "Letter symbols",
5070
+ \u7BAD\u5934: "Arrows",
5071
+ \u624B\u5199\u4F53: "Script",
5072
+ \u5206\u6570: "Fraction",
5073
+ \u5E38\u7528\u5206\u6570: "Common fractions",
5074
+ \u4E0A\u4E0B\u6807: "Scripts",
5075
+ \u4E0A\u6807\u548C\u4E0B\u6807: "Super/subscripts",
5076
+ \u5E38\u7528\u7684\u4E0A\u6807\u548C\u4E0B\u6807: "Common super/subscripts",
5077
+ \u6839\u5F0F: "Radicals",
5078
+ \u5E38\u7528\u6839\u5F0F: "Common radicals",
5079
+ \u79EF\u5206: "Integrals",
5080
+ \u5927\u578B\u8FD0\u7B97\u7B26: "Large<br/>ops",
5081
+ \u6C42\u548C: "Summations",
5082
+ \u62EC\u53F7: "Brackets",
5083
+ \u65B9\u62EC\u53F7: "Brackets",
5084
+ \u51FD\u6570: "Functions",
5085
+ \u4E09\u89D2\u51FD\u6570: "Trig functions",
5086
+ \u5E38\u7528\u51FD\u6570: "Common functions",
5087
+ \u5C0F\u5199: "Lowercase",
5088
+ \u5927\u5199: "Uppercase",
5089
+ \u53D8\u4F53: "Variants",
5090
+ \u82B1\u4F53: "Fraktur",
5091
+ \u53CC\u7EBF: "Double-struck",
5092
+ \u7F57\u9A6C: "Roman"
5093
+ }
5094
+ }
5095
+ };
5096
+ FORMULAX_RUNTIME_MESSAGES = {
5097
+ en_US: {
5098
+ "editor.placeholder.root": "Type formula here"
5099
+ },
5100
+ zh_CN: {
5101
+ "editor.placeholder.root": "\u8BF7\u8F93\u5165\u516C\u5F0F"
5102
+ }
5103
+ };
5087
5104
  }
5088
5105
  });
5089
5106
 
@@ -14980,8 +14997,8 @@ var FormulaX = (() => {
14980
14997
  }
14981
14998
  return serviceObject;
14982
14999
  }
14983
- var defaultOptions, components, kity2, kf, KFEditor, editor_default2;
14984
- var init_editor2 = __esm({
15000
+ var defaultOptions, components, kity2, kf, KFEditor, editor_default;
15001
+ var init_editor = __esm({
14985
15002
  "../kity-runtime/src/legacy/editor.ts"() {
14986
15003
  "use strict";
14987
15004
  init_legacy_utils();
@@ -15092,7 +15109,7 @@ var FormulaX = (() => {
15092
15109
  components[name] = component;
15093
15110
  }
15094
15111
  });
15095
- editor_default2 = KFEditor;
15112
+ editor_default = KFEditor;
15096
15113
  }
15097
15114
  });
15098
15115
 
@@ -15101,13 +15118,13 @@ var FormulaX = (() => {
15101
15118
  var init_factory = __esm({
15102
15119
  "../kity-runtime/src/legacy/factory.ts"() {
15103
15120
  "use strict";
15104
- init_editor2();
15121
+ init_editor();
15105
15122
  init_runtime_interop();
15106
15123
  EditorWrapper = class {
15107
15124
  callbacks = [];
15108
15125
  editor;
15109
15126
  constructor(container, options) {
15110
- this.editor = new editor_default2(container, options);
15127
+ this.editor = new editor_default(container, options);
15111
15128
  this.editor.ready(() => {
15112
15129
  this.trigger();
15113
15130
  });
@@ -16675,6 +16692,7 @@ var FormulaX = (() => {
16675
16692
  to: "\u2192",
16676
16693
  downarrow: "\u2193",
16677
16694
  leftrightarrow: "\u2194",
16695
+ updownarrow: "\u2195",
16678
16696
  therefore: "\u2234",
16679
16697
  because: "\u2235",
16680
16698
  "+": "+",
@@ -16791,7 +16809,7 @@ var FormulaX = (() => {
16791
16809
  Uparrow: "\u21D1",
16792
16810
  Downarrow: "\u21D3",
16793
16811
  Leftrightarrow: "\u21D4",
16794
- Updownarrow: "\u21F3",
16812
+ Updownarrow: "\u21D5",
16795
16813
  longleftarrow: "\u27F5",
16796
16814
  longrightarrow: "\u27F6",
16797
16815
  longleftrightarrow: "\u27F7",
@@ -16859,16 +16877,7 @@ var FormulaX = (() => {
16859
16877
  Object.keys(list).forEach((key) => callback(list[key], key));
16860
16878
  }
16861
16879
  function translateToolbarText(value, locale) {
16862
- if (locale === "zh_CN") {
16863
- return value;
16864
- }
16865
- const normalizedValue = value.replace(/<br\s*\/?>/gi, "").trim();
16866
- const translatedValue = zhCnToEnUsText.get(normalizedValue);
16867
- if (!translatedValue) {
16868
- return value;
16869
- }
16870
- const lineBreakMatch = value.match(/<br\s*\/?>/i);
16871
- return lineBreakMatch ? `${translatedValue}${lineBreakMatch[0]}` : translatedValue;
16880
+ return translateFormulaXText("toolbar", value, locale);
16872
16881
  }
16873
16882
  function localizeToolbarConfig(value, locale) {
16874
16883
  if (Array.isArray(value)) {
@@ -16912,7 +16921,7 @@ var FormulaX = (() => {
16912
16921
  normalizeFormulaXLocale(locale)
16913
16922
  );
16914
16923
  }
16915
- var UI_ELE_TYPE, BOX_TYPE2, OTHER_POSITION, zhCnToEnUsText, baseToolbarConfig, toolbar_config_default;
16924
+ var UI_ELE_TYPE, BOX_TYPE2, OTHER_POSITION, baseToolbarConfig, toolbar_config_default;
16916
16925
  var init_toolbar_config = __esm({
16917
16926
  "../kity-runtime/src/legacy/toolbar-config.ts"() {
16918
16927
  "use strict";
@@ -16925,40 +16934,6 @@ var FormulaX = (() => {
16925
16934
  UI_ELE_TYPE = legacyEleType;
16926
16935
  BOX_TYPE2 = legacyBoxType;
16927
16936
  OTHER_POSITION = legacyOtherPosition;
16928
- zhCnToEnUsText = /* @__PURE__ */ new Map([
16929
- ["\u9884\u8BBE", "Presets"],
16930
- ["\u9884\u8BBE\u516C\u5F0F", "Preset formulas"],
16931
- ["\u4E8C\u6B21\u516C\u5F0F", "Quadratic formula"],
16932
- ["\u4E8C\u9879\u5F0F\u5B9A\u7406", "Binomial theorem"],
16933
- ["\u52FE\u80A1\u5B9A\u7406", "Pythagorean theorem"],
16934
- ["\u57FA\u7840\u6570\u5B66", "Basic math"],
16935
- ["\u5E0C\u814A\u5B57\u6BCD", "Greek letters"],
16936
- ["\u6C42\u53CD\u5173\u7CFB\u8FD0\u7B97\u7B26", "Negated operators"],
16937
- ["\u5B57\u6BCD\u7C7B\u7B26\u53F7", "Letter-like symbols"],
16938
- ["\u7BAD\u5934", "Arrows"],
16939
- ["\u624B\u5199\u4F53", "Script"],
16940
- ["\u5206\u6570", "Fraction"],
16941
- ["\u5E38\u7528\u5206\u6570", "Common fractions"],
16942
- ["\u4E0A\u4E0B\u6807", "Scripts"],
16943
- ["\u4E0A\u6807\u548C\u4E0B\u6807", "Superscripts and subscripts"],
16944
- ["\u5E38\u7528\u7684\u4E0A\u6807\u548C\u4E0B\u6807", "Common superscripts and subscripts"],
16945
- ["\u6839\u5F0F", "Radicals"],
16946
- ["\u5E38\u7528\u6839\u5F0F", "Common radicals"],
16947
- ["\u79EF\u5206", "Integrals"],
16948
- ["\u5927\u578B\u8FD0\u7B97\u7B26", "Large operators"],
16949
- ["\u6C42\u548C", "Summations"],
16950
- ["\u62EC\u53F7", "Brackets"],
16951
- ["\u65B9\u62EC\u53F7", "Brackets"],
16952
- ["\u51FD\u6570", "Functions"],
16953
- ["\u4E09\u89D2\u51FD\u6570", "Trigonometric functions"],
16954
- ["\u5E38\u7528\u51FD\u6570", "Common functions"],
16955
- ["\u5C0F\u5199", "Lowercase"],
16956
- ["\u5927\u5199", "Uppercase"],
16957
- ["\u53D8\u4F53", "Variants"],
16958
- ["\u82B1\u4F53", "Fraktur"],
16959
- ["\u53CC\u7EBF", "Double-struck"],
16960
- ["\u7F57\u9A6C", "Roman"]
16961
- ]);
16962
16937
  baseToolbarConfig = [{
16963
16938
  type: UI_ELE_TYPE.DRAPDOWN_BOX,
16964
16939
  options: {
@@ -18189,6 +18164,9 @@ var FormulaX = (() => {
18189
18164
  operand: []
18190
18165
  };
18191
18166
  }
18167
+ function getRootPlaceholderText() {
18168
+ return legacySysconf.rootPlaceholder.content;
18169
+ }
18192
18170
  function processRootGroup(parser, tree) {
18193
18171
  if (!parser.isResetId) {
18194
18172
  tree.attr["data-type"] = legacyGroupType.VIRTUAL;
@@ -18236,7 +18214,7 @@ var FormulaX = (() => {
18236
18214
  if (isRoot) {
18237
18215
  processRootGroup(parser, tree);
18238
18216
  } else if (parentTree?.attr?.["data-root"] && tree.name === "placeholder" && onlyPlaceholder(parentTree.operand)) {
18239
- tree.attr.label = ROOT_P_TEXT;
18217
+ tree.attr.label = getRootPlaceholderText();
18240
18218
  }
18241
18219
  for (let i2 = 0; i2 < tree.operand.length; i2 += 1) {
18242
18220
  const currentOperand = tree.operand[i2];
@@ -18248,7 +18226,7 @@ var FormulaX = (() => {
18248
18226
  }
18249
18227
  return tree;
18250
18228
  }
18251
- var CURSOR_CHAR, ROOT_P_TEXT, COMBINATION_NAME, PID_PREFIX, pidSeed, kity14, kf5, BaseComponent, Parser, parser_default;
18229
+ var CURSOR_CHAR, COMBINATION_NAME, PID_PREFIX, pidSeed, kity14, kf5, BaseComponent, Parser, parser_default;
18252
18230
  var init_parser = __esm({
18253
18231
  "../kity-runtime/src/legacy/parser.ts"() {
18254
18232
  "use strict";
@@ -18259,7 +18237,6 @@ var FormulaX = (() => {
18259
18237
  init_kf_ext_extension();
18260
18238
  init_vgroup_def();
18261
18239
  CURSOR_CHAR = legacySysconf.cursorCharacter;
18262
- ROOT_P_TEXT = legacySysconf.rootPlaceholder.content;
18263
18240
  COMBINATION_NAME = "combination";
18264
18241
  PID_PREFIX = "_kf_editor_";
18265
18242
  pidSeed = 0;
@@ -20139,26 +20116,26 @@ var FormulaX = (() => {
20139
20116
  var start_exports = {};
20140
20117
  __export(start_exports, {
20141
20118
  Factory: () => factory_default,
20142
- KFEditor: () => editor_default2,
20119
+ KFEditor: () => editor_default,
20143
20120
  default: () => start_default,
20144
20121
  installKityEditorStart: () => installKityEditorStart
20145
20122
  });
20146
20123
  function installKityEditorStart(target = window) {
20147
20124
  const runtimeTarget = target;
20148
20125
  if (!installed3) {
20149
- editor_default2.registerComponents("ui", ui_default);
20150
- editor_default2.registerComponents("parser", parser_default);
20151
- editor_default2.registerComponents("render", render_default);
20152
- editor_default2.registerComponents("position", position_default);
20153
- editor_default2.registerComponents("syntax", syntax_default);
20154
- editor_default2.registerComponents("control", controller_default);
20155
- editor_default2.registerComponents("print", printer_default);
20126
+ editor_default.registerComponents("ui", ui_default);
20127
+ editor_default.registerComponents("parser", parser_default);
20128
+ editor_default.registerComponents("render", render_default);
20129
+ editor_default.registerComponents("position", position_default);
20130
+ editor_default.registerComponents("syntax", syntax_default);
20131
+ editor_default.registerComponents("control", controller_default);
20132
+ editor_default.registerComponents("print", printer_default);
20156
20133
  installed3 = true;
20157
20134
  }
20158
20135
  runtimeTarget.kf = runtimeTarget.kf ?? {};
20159
20136
  runtimeTarget.kf.EditorFactory = factory_default;
20160
20137
  return {
20161
- KFEditor: editor_default2,
20138
+ KFEditor: editor_default,
20162
20139
  Factory: factory_default
20163
20140
  };
20164
20141
  }
@@ -20166,7 +20143,7 @@ var FormulaX = (() => {
20166
20143
  var init_start = __esm({
20167
20144
  "../kity-runtime/src/boot/start.ts"() {
20168
20145
  "use strict";
20169
- init_editor2();
20146
+ init_editor();
20170
20147
  init_factory();
20171
20148
  init_ui();
20172
20149
  init_parser();
@@ -20303,7 +20280,7 @@ var FormulaX = (() => {
20303
20280
  fontSize: input.fontSize,
20304
20281
  displayMode: input.displayMode,
20305
20282
  className: input.className,
20306
- assetsVersion: input.assetsVersion
20283
+ assetCacheKey: input.assetCacheKey
20307
20284
  });
20308
20285
  }
20309
20286
 
@@ -61463,6 +61440,7 @@ Original error: ${originalError.name}: ${originalError.message}` : "";
61463
61440
  const locale = normalizeFormulaXLocale(options.locale ?? DEFAULT_FORMULAX_LOCALE);
61464
61441
  const assets = resolveEditorAssets(options.assets);
61465
61442
  try {
61443
+ legacySysconf.rootPlaceholder.content = getFormulaXRuntimeMessage("editor.placeholder.root", locale);
61466
61444
  const stylesheetInserted = ensureKityStylesheet(document, assets.styles.editor);
61467
61445
  if (stylesheetInserted) {
61468
61446
  const stylesheetInsertedMark = markFormulaXPerf("fx:kity-css:link-inserted");
@@ -61676,7 +61654,7 @@ Original error: ${originalError.name}: ${originalError.message}` : "";
61676
61654
  }
61677
61655
  function renderLatexToSvgMarkup(latex, options = {}) {
61678
61656
  const normalizedLatex = latex.trim();
61679
- const shouldUseCache = options.cache !== false && !(hasCustomAssetOverrides(options.assets) && !options.assetsVersion);
61657
+ const shouldUseCache = options.cache !== false && !(hasCustomAssetOverrides(options.assets) && !options.assetCacheKey);
61680
61658
  if (!normalizedLatex) {
61681
61659
  return Promise.resolve({
61682
61660
  engine: "kity",
@@ -61692,7 +61670,7 @@ Original error: ${originalError.name}: ${originalError.message}` : "";
61692
61670
  fontSize: options.fontSize,
61693
61671
  displayMode: options.displayMode,
61694
61672
  className: options.className,
61695
- assetsVersion: options.assetsVersion
61673
+ assetCacheKey: options.assetCacheKey
61696
61674
  });
61697
61675
  if (shouldUseCache) {
61698
61676
  const cached = renderCache.get(cacheKey);
@@ -62190,8 +62168,11 @@ Original error: ${originalError.name}: ${originalError.message}` : "";
62190
62168
  inset: 0;
62191
62169
  z-index: 2147483000;
62192
62170
  display: flex;
62193
- align-items: center;
62171
+ align-items: flex-start;
62194
62172
  justify-content: center;
62173
+ padding: 16px;
62174
+ overflow-x: hidden;
62175
+ overflow-y: auto;
62195
62176
  }
62196
62177
 
62197
62178
  .fx-formula-modal-backdrop {
@@ -62204,9 +62185,10 @@ Original error: ${originalError.name}: ${originalError.message}` : "";
62204
62185
  --fx-formula-editor-body-height: 264px;
62205
62186
  --fx-formula-workspace-height: 168px;
62206
62187
  position: relative;
62207
- width: min(860px, calc(100vw - 32px));
62188
+ width: min(920px, calc(100vw - 32px));
62208
62189
  height: auto;
62209
- max-height: calc(100vh - 32px);
62190
+ max-height: none;
62191
+ margin: 0 auto;
62210
62192
  background: #fff;
62211
62193
  border-radius: 14px;
62212
62194
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
@@ -62424,6 +62406,7 @@ Original error: ${originalError.name}: ${originalError.message}` : "";
62424
62406
  initialLatex,
62425
62407
  height: options.height ?? "100%",
62426
62408
  autofocus: options.autofocus ?? true,
62409
+ locale: options.locale,
62427
62410
  assets: options.assets,
62428
62411
  render: {
62429
62412
  fontsize: options.render?.fontsize ?? 40
@@ -62528,6 +62511,26 @@ Original error: ${originalError.name}: ${originalError.message}` : "";
62528
62511
  return null;
62529
62512
  }
62530
62513
 
62514
+ // ../editor/src/i18n.ts
62515
+ var FORMULAX_EDITOR_MESSAGES = {
62516
+ en_US: {
62517
+ "modal.title": "FormulaX Editor",
62518
+ "modal.insert": "Insert",
62519
+ "modal.update": "Update",
62520
+ "modal.cancel": "Cancel"
62521
+ },
62522
+ zh_CN: {
62523
+ "modal.title": "FormulaX \u7F16\u8F91\u5668",
62524
+ "modal.insert": "\u63D2\u5165",
62525
+ "modal.update": "\u66F4\u65B0",
62526
+ "modal.cancel": "\u53D6\u6D88"
62527
+ }
62528
+ };
62529
+ function getFormulaXEditorMessage(key, locale = DEFAULT_FORMULAX_LOCALE) {
62530
+ const normalizedLocale = normalizeFormulaXLocale(locale);
62531
+ return FORMULAX_EDITOR_MESSAGES[normalizedLocale][key] ?? FORMULAX_EDITOR_MESSAGES[DEFAULT_FORMULAX_LOCALE][key];
62532
+ }
62533
+
62531
62534
  // src/modal.ts
62532
62535
  function openFormulaXModal(input) {
62533
62536
  recordFormulaXPerfPoint("fx:modal:open:start");
@@ -62579,6 +62582,7 @@ Original error: ${originalError.name}: ${originalError.message}` : "";
62579
62582
  initialLatex: input.initialLatex,
62580
62583
  height: input.options.editor.height,
62581
62584
  autofocus: input.options.editor.autofocus,
62585
+ locale: input.options.editor.locale,
62582
62586
  assets: input.options.editor.assets,
62583
62587
  render: {
62584
62588
  fontsize: input.options.editor.render.fontsize
@@ -62656,6 +62660,7 @@ Original error: ${originalError.name}: ${originalError.message}` : "";
62656
62660
  var DEFAULT_BUTTON_NAME = "formulaX";
62657
62661
  var DEFAULT_MODEL_NAME = "formulaX";
62658
62662
  function resolveOptions(options = {}) {
62663
+ const locale = options.editor?.locale ?? DEFAULT_FORMULAX_LOCALE;
62659
62664
  return {
62660
62665
  name: options.name ?? DEFAULT_MODEL_NAME,
62661
62666
  buttonName: options.buttonName ?? DEFAULT_BUTTON_NAME,
@@ -62671,15 +62676,16 @@ Original error: ${originalError.name}: ${originalError.message}` : "";
62671
62676
  }),
62672
62677
  preload: options.preload ?? "idle",
62673
62678
  modal: {
62674
- title: options.modal?.title ?? "FormulaX Editor",
62675
- insertText: options.modal?.insertText ?? "Insert",
62676
- updateText: options.modal?.updateText ?? "Update",
62677
- cancelText: options.modal?.cancelText ?? "Cancel",
62679
+ title: options.modal?.title ?? getFormulaXEditorMessage("modal.title", locale),
62680
+ insertText: options.modal?.insertText ?? getFormulaXEditorMessage("modal.insert", locale),
62681
+ updateText: options.modal?.updateText ?? getFormulaXEditorMessage("modal.update", locale),
62682
+ cancelText: options.modal?.cancelText ?? getFormulaXEditorMessage("modal.cancel", locale),
62678
62683
  closeOnBackdrop: options.modal?.closeOnBackdrop ?? true
62679
62684
  },
62680
62685
  editor: {
62681
62686
  height: options.editor?.height ?? "100%",
62682
62687
  autofocus: options.editor?.autofocus ?? true,
62688
+ locale,
62683
62689
  assets: options.editor?.assets ?? {},
62684
62690
  render: {
62685
62691
  fontsize: options.editor?.render?.fontsize ?? 40