@formulaxjs/editor 0.3.1 → 0.4.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.
@@ -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();
@@ -20186,6 +20163,7 @@ var FormulaX = (() => {
20186
20163
  clearFormulaXPerfMarks: () => clearFormulaXPerfMarks2,
20187
20164
  ensureFormulaXModalStyles: () => ensureFormulaXModalStyles,
20188
20165
  formulaXModalStyles: () => formulaXModalStyles,
20166
+ getFormulaXEditorMessage: () => getFormulaXEditorMessage,
20189
20167
  markFormulaXPerf: () => markFormulaXPerf2,
20190
20168
  measureFormulaXPerf: () => measureFormulaXPerf2,
20191
20169
  mountFormulaXEditor: () => mountFormulaXEditor,
@@ -24118,6 +24096,7 @@ var FormulaX = (() => {
24118
24096
  const locale = normalizeFormulaXLocale(options.locale ?? DEFAULT_FORMULAX_LOCALE);
24119
24097
  const assets = resolveEditorAssets(options.assets);
24120
24098
  try {
24099
+ legacySysconf.rootPlaceholder.content = getFormulaXRuntimeMessage("editor.placeholder.root", locale);
24121
24100
  const stylesheetInserted = ensureKityStylesheet(document, assets.styles.editor);
24122
24101
  if (stylesheetInserted) {
24123
24102
  const stylesheetInsertedMark = markFormulaXPerf("fx:kity-css:link-inserted");
@@ -24788,8 +24767,11 @@ var FormulaX = (() => {
24788
24767
  inset: 0;
24789
24768
  z-index: 2147483000;
24790
24769
  display: flex;
24791
- align-items: center;
24770
+ align-items: flex-start;
24792
24771
  justify-content: center;
24772
+ padding: 16px;
24773
+ overflow-x: hidden;
24774
+ overflow-y: auto;
24793
24775
  }
24794
24776
 
24795
24777
  .fx-formula-modal-backdrop {
@@ -24802,9 +24784,10 @@ var FormulaX = (() => {
24802
24784
  --fx-formula-editor-body-height: 264px;
24803
24785
  --fx-formula-workspace-height: 168px;
24804
24786
  position: relative;
24805
- width: min(860px, calc(100vw - 32px));
24787
+ width: min(920px, calc(100vw - 32px));
24806
24788
  height: auto;
24807
- max-height: calc(100vh - 32px);
24789
+ max-height: none;
24790
+ margin: 0 auto;
24808
24791
  background: #fff;
24809
24792
  border-radius: 14px;
24810
24793
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
@@ -25022,6 +25005,7 @@ var FormulaX = (() => {
25022
25005
  initialLatex,
25023
25006
  height: options.height ?? "100%",
25024
25007
  autofocus: options.autofocus ?? true,
25008
+ locale: options.locale,
25025
25009
  assets: options.assets,
25026
25010
  render: {
25027
25011
  fontsize: options.render?.fontsize ?? 40
@@ -25125,6 +25109,26 @@ var FormulaX = (() => {
25125
25109
  }
25126
25110
  return null;
25127
25111
  }
25112
+
25113
+ // src/i18n.ts
25114
+ var FORMULAX_EDITOR_MESSAGES = {
25115
+ en_US: {
25116
+ "modal.title": "FormulaX Editor",
25117
+ "modal.insert": "Insert",
25118
+ "modal.update": "Update",
25119
+ "modal.cancel": "Cancel"
25120
+ },
25121
+ zh_CN: {
25122
+ "modal.title": "FormulaX \u7F16\u8F91\u5668",
25123
+ "modal.insert": "\u63D2\u5165",
25124
+ "modal.update": "\u66F4\u65B0",
25125
+ "modal.cancel": "\u53D6\u6D88"
25126
+ }
25127
+ };
25128
+ function getFormulaXEditorMessage(key, locale = DEFAULT_FORMULAX_LOCALE) {
25129
+ const normalizedLocale = normalizeFormulaXLocale(locale);
25130
+ return FORMULAX_EDITOR_MESSAGES[normalizedLocale][key] ?? FORMULAX_EDITOR_MESSAGES[DEFAULT_FORMULAX_LOCALE][key];
25131
+ }
25128
25132
  return __toCommonJS(index_exports);
25129
25133
  })();
25130
25134
  /*!