@formulaxjs/kity-runtime 0.4.0 → 0.5.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.
- package/README.md +41 -30
- package/README.zh-CN.md +52 -0
- package/dist/base.css +47 -0
- package/dist/{chunk-LIDQRZXL.js → chunk-EQCAHDH7.js} +85 -34
- package/dist/chunk-EQCAHDH7.js.map +1 -0
- package/dist/images/scrollbar/custom/bar-bg.png +0 -0
- package/dist/images/scrollbar/custom/bar.png +0 -0
- package/dist/images/scrollbar/custom/bg.png +0 -0
- package/dist/images/scrollbar/custom/bottom.png +0 -0
- package/dist/images/scrollbar/custom/btn.png +0 -0
- package/dist/images/scrollbar/custom/down.png +0 -0
- package/dist/images/scrollbar/custom/top.png +0 -0
- package/dist/images/scrollbar/custom/up.png +0 -0
- package/dist/images/scrollbar/edit/bar-bg.png +0 -0
- package/dist/images/scrollbar/edit/bar-left.png +0 -0
- package/dist/images/scrollbar/edit/bar-right.png +0 -0
- package/dist/images/scrollbar/edit/thumb-bg.png +0 -0
- package/dist/images/scrollbar/edit/thumb-left.png +0 -0
- package/dist/images/scrollbar/edit/thumb-right.png +0 -0
- package/dist/images/toolbar/btn.png +0 -0
- package/dist/index.cjs +124 -148
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2118 -0
- package/dist/index.d.ts +2118 -0
- package/dist/index.global.js +127 -147
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/other.png +0 -0
- package/dist/scrollbar.css +78 -0
- package/dist/{start-H6H24L6P.js → start-N66J24A5.js} +11 -50
- package/dist/start-N66J24A5.js.map +1 -0
- package/dist/ui.css +625 -0
- package/package.json +7 -2
- package/dist/chunk-LIDQRZXL.js.map +0 -1
- package/dist/start-H6H24L6P.js.map +0 -1
- /package/dist/{KF_AMS_BB-5QF7FUSO.woff → KF_AMS_BB.woff} +0 -0
- /package/dist/{KF_AMS_CAL-NXRNLAZN.woff → KF_AMS_CAL.woff} +0 -0
- /package/dist/{KF_AMS_FRAK-CO33WWN4.woff → KF_AMS_FRAK.woff} +0 -0
- /package/dist/{KF_AMS_MAIN-25QJVAWY.woff → KF_AMS_MAIN.woff} +0 -0
- /package/dist/{KF_AMS_ROMAN-243BR7HH.woff → KF_AMS_ROMAN.woff} +0 -0
- /package/dist/{btn-5DANP6JY.png → btn.png} +0 -0
- /package/dist/{editor-JT5KLVXX.css → editor.css} +0 -0
- /package/dist/{other-OMWJFGL5.png → images/toolbar/other.png} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __esm = (fn, res) => function __init() {
|
|
7
9
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
@@ -18,98 +20,42 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
20
|
}
|
|
19
21
|
return to;
|
|
20
22
|
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
21
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
32
|
|
|
23
|
-
// public/assets/images/toolbar/btn.png
|
|
24
|
-
var btn_default;
|
|
25
|
-
var init_btn = __esm({
|
|
26
|
-
"public/assets/images/toolbar/btn.png"() {
|
|
27
|
-
btn_default = "./btn-5DANP6JY.png";
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
// public/assets/images/toolbar/other.png
|
|
32
|
-
var other_default;
|
|
33
|
-
var init_other = __esm({
|
|
34
|
-
"public/assets/images/toolbar/other.png"() {
|
|
35
|
-
other_default = "./other-OMWJFGL5.png";
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
// public/assets/styles/editor.css?url
|
|
40
|
-
var editor_default;
|
|
41
|
-
var init_editor = __esm({
|
|
42
|
-
"public/assets/styles/editor.css?url"() {
|
|
43
|
-
editor_default = "./editor-JT5KLVXX.css?url";
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
// public/resource/KF_AMS_BB.woff
|
|
48
|
-
var KF_AMS_BB_default;
|
|
49
|
-
var init_KF_AMS_BB = __esm({
|
|
50
|
-
"public/resource/KF_AMS_BB.woff"() {
|
|
51
|
-
KF_AMS_BB_default = "./KF_AMS_BB-5QF7FUSO.woff";
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
// public/resource/KF_AMS_CAL.woff
|
|
56
|
-
var KF_AMS_CAL_default;
|
|
57
|
-
var init_KF_AMS_CAL = __esm({
|
|
58
|
-
"public/resource/KF_AMS_CAL.woff"() {
|
|
59
|
-
KF_AMS_CAL_default = "./KF_AMS_CAL-NXRNLAZN.woff";
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
// public/resource/KF_AMS_FRAK.woff
|
|
64
|
-
var KF_AMS_FRAK_default;
|
|
65
|
-
var init_KF_AMS_FRAK = __esm({
|
|
66
|
-
"public/resource/KF_AMS_FRAK.woff"() {
|
|
67
|
-
KF_AMS_FRAK_default = "./KF_AMS_FRAK-CO33WWN4.woff";
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
// public/resource/KF_AMS_MAIN.woff
|
|
72
|
-
var KF_AMS_MAIN_default;
|
|
73
|
-
var init_KF_AMS_MAIN = __esm({
|
|
74
|
-
"public/resource/KF_AMS_MAIN.woff"() {
|
|
75
|
-
KF_AMS_MAIN_default = "./KF_AMS_MAIN-25QJVAWY.woff";
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
// public/resource/KF_AMS_ROMAN.woff
|
|
80
|
-
var KF_AMS_ROMAN_default;
|
|
81
|
-
var init_KF_AMS_ROMAN = __esm({
|
|
82
|
-
"public/resource/KF_AMS_ROMAN.woff"() {
|
|
83
|
-
KF_AMS_ROMAN_default = "./KF_AMS_ROMAN-243BR7HH.woff";
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
|
|
87
33
|
// src/asset-manifest.ts
|
|
88
|
-
var kityFontAssets, kityToolbarAssets, kityStyleAssets, kityAssetManifest;
|
|
34
|
+
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;
|
|
89
35
|
var init_asset_manifest = __esm({
|
|
90
36
|
"src/asset-manifest.ts"() {
|
|
91
37
|
"use strict";
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
38
|
+
import_btn = __toESM(require("./btn.png"), 1);
|
|
39
|
+
import_other = __toESM(require("./other.png"), 1);
|
|
40
|
+
import_editor = __toESM(require("./editor.css?url"), 1);
|
|
41
|
+
import_KF_AMS_BB = __toESM(require("./KF_AMS_BB.woff"), 1);
|
|
42
|
+
import_KF_AMS_CAL = __toESM(require("./KF_AMS_CAL.woff"), 1);
|
|
43
|
+
import_KF_AMS_FRAK = __toESM(require("./KF_AMS_FRAK.woff"), 1);
|
|
44
|
+
import_KF_AMS_MAIN = __toESM(require("./KF_AMS_MAIN.woff"), 1);
|
|
45
|
+
import_KF_AMS_ROMAN = __toESM(require("./KF_AMS_ROMAN.woff"), 1);
|
|
100
46
|
kityFontAssets = {
|
|
101
|
-
KF_AMS_BB:
|
|
102
|
-
KF_AMS_CAL:
|
|
103
|
-
KF_AMS_FRAK:
|
|
104
|
-
KF_AMS_MAIN:
|
|
105
|
-
KF_AMS_ROMAN:
|
|
47
|
+
KF_AMS_BB: import_KF_AMS_BB.default,
|
|
48
|
+
KF_AMS_CAL: import_KF_AMS_CAL.default,
|
|
49
|
+
KF_AMS_FRAK: import_KF_AMS_FRAK.default,
|
|
50
|
+
KF_AMS_MAIN: import_KF_AMS_MAIN.default,
|
|
51
|
+
KF_AMS_ROMAN: import_KF_AMS_ROMAN.default
|
|
106
52
|
};
|
|
107
53
|
kityToolbarAssets = {
|
|
108
|
-
btn:
|
|
109
|
-
other:
|
|
54
|
+
btn: import_btn.default,
|
|
55
|
+
other: import_other.default
|
|
110
56
|
};
|
|
111
57
|
kityStyleAssets = {
|
|
112
|
-
editor:
|
|
58
|
+
editor: import_editor.default
|
|
113
59
|
};
|
|
114
60
|
kityAssetManifest = {
|
|
115
61
|
fonts: kityFontAssets,
|
|
@@ -1087,12 +1033,77 @@ function normalizeFormulaXLocale(locale) {
|
|
|
1087
1033
|
}
|
|
1088
1034
|
return DEFAULT_FORMULAX_LOCALE;
|
|
1089
1035
|
}
|
|
1090
|
-
|
|
1036
|
+
function translateFormulaXText(namespace, value, locale) {
|
|
1037
|
+
if (locale === "zh_CN") {
|
|
1038
|
+
return value;
|
|
1039
|
+
}
|
|
1040
|
+
const normalizedValue = value.replace(/<br\s*\/?>/gi, "").trim();
|
|
1041
|
+
const translatedValue = FORMULAX_TRANSLATIONS[locale]?.[namespace]?.[normalizedValue];
|
|
1042
|
+
if (!translatedValue) {
|
|
1043
|
+
return value;
|
|
1044
|
+
}
|
|
1045
|
+
const lineBreakMatch = value.match(/<br\s*\/?>/i);
|
|
1046
|
+
if (/<br\s*\/?>/i.test(translatedValue)) {
|
|
1047
|
+
return translatedValue;
|
|
1048
|
+
}
|
|
1049
|
+
return lineBreakMatch ? `${translatedValue}${lineBreakMatch[0]}` : translatedValue;
|
|
1050
|
+
}
|
|
1051
|
+
function getFormulaXRuntimeMessage(key, locale = DEFAULT_FORMULAX_LOCALE) {
|
|
1052
|
+
const normalizedLocale = normalizeFormulaXLocale(locale);
|
|
1053
|
+
return FORMULAX_RUNTIME_MESSAGES[normalizedLocale][key] ?? FORMULAX_RUNTIME_MESSAGES[DEFAULT_FORMULAX_LOCALE][key];
|
|
1054
|
+
}
|
|
1055
|
+
var FORMULAX_LOCALES, DEFAULT_FORMULAX_LOCALE, FORMULAX_TRANSLATIONS, FORMULAX_RUNTIME_MESSAGES;
|
|
1091
1056
|
var init_i18n = __esm({
|
|
1092
1057
|
"src/i18n.ts"() {
|
|
1093
1058
|
"use strict";
|
|
1094
1059
|
FORMULAX_LOCALES = ["en_US", "zh_CN"];
|
|
1095
1060
|
DEFAULT_FORMULAX_LOCALE = "en_US";
|
|
1061
|
+
FORMULAX_TRANSLATIONS = {
|
|
1062
|
+
en_US: {
|
|
1063
|
+
toolbar: {
|
|
1064
|
+
\u9884\u8BBE: "Presets",
|
|
1065
|
+
\u9884\u8BBE\u516C\u5F0F: "Presets",
|
|
1066
|
+
\u4E8C\u6B21\u516C\u5F0F: "Quadratic",
|
|
1067
|
+
\u4E8C\u9879\u5F0F\u5B9A\u7406: "Binomial",
|
|
1068
|
+
\u52FE\u80A1\u5B9A\u7406: "Pythagorean",
|
|
1069
|
+
\u57FA\u7840\u6570\u5B66: "Basic math",
|
|
1070
|
+
\u5E0C\u814A\u5B57\u6BCD: "Greek",
|
|
1071
|
+
\u6C42\u53CD\u5173\u7CFB\u8FD0\u7B97\u7B26: "Negated operators",
|
|
1072
|
+
\u5B57\u6BCD\u7C7B\u7B26\u53F7: "Letter symbols",
|
|
1073
|
+
\u7BAD\u5934: "Arrows",
|
|
1074
|
+
\u624B\u5199\u4F53: "Script",
|
|
1075
|
+
\u5206\u6570: "Fraction",
|
|
1076
|
+
\u5E38\u7528\u5206\u6570: "Common fractions",
|
|
1077
|
+
\u4E0A\u4E0B\u6807: "Scripts",
|
|
1078
|
+
\u4E0A\u6807\u548C\u4E0B\u6807: "Super/subscripts",
|
|
1079
|
+
\u5E38\u7528\u7684\u4E0A\u6807\u548C\u4E0B\u6807: "Common super/subscripts",
|
|
1080
|
+
\u6839\u5F0F: "Radicals",
|
|
1081
|
+
\u5E38\u7528\u6839\u5F0F: "Common radicals",
|
|
1082
|
+
\u79EF\u5206: "Integrals",
|
|
1083
|
+
\u5927\u578B\u8FD0\u7B97\u7B26: "Large<br/>ops",
|
|
1084
|
+
\u6C42\u548C: "Summations",
|
|
1085
|
+
\u62EC\u53F7: "Brackets",
|
|
1086
|
+
\u65B9\u62EC\u53F7: "Brackets",
|
|
1087
|
+
\u51FD\u6570: "Functions",
|
|
1088
|
+
\u4E09\u89D2\u51FD\u6570: "Trig functions",
|
|
1089
|
+
\u5E38\u7528\u51FD\u6570: "Common functions",
|
|
1090
|
+
\u5C0F\u5199: "Lowercase",
|
|
1091
|
+
\u5927\u5199: "Uppercase",
|
|
1092
|
+
\u53D8\u4F53: "Variants",
|
|
1093
|
+
\u82B1\u4F53: "Fraktur",
|
|
1094
|
+
\u53CC\u7EBF: "Double-struck",
|
|
1095
|
+
\u7F57\u9A6C: "Roman"
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
};
|
|
1099
|
+
FORMULAX_RUNTIME_MESSAGES = {
|
|
1100
|
+
en_US: {
|
|
1101
|
+
"editor.placeholder.root": "Type formula here"
|
|
1102
|
+
},
|
|
1103
|
+
zh_CN: {
|
|
1104
|
+
"editor.placeholder.root": "\u8BF7\u8F93\u5165\u516C\u5F0F"
|
|
1105
|
+
}
|
|
1106
|
+
};
|
|
1096
1107
|
}
|
|
1097
1108
|
});
|
|
1098
1109
|
|
|
@@ -10989,8 +11000,8 @@ function getService(serviceName) {
|
|
|
10989
11000
|
}
|
|
10990
11001
|
return serviceObject;
|
|
10991
11002
|
}
|
|
10992
|
-
var defaultOptions, components, kity2, kf, KFEditor,
|
|
10993
|
-
var
|
|
11003
|
+
var defaultOptions, components, kity2, kf, KFEditor, editor_default;
|
|
11004
|
+
var init_editor = __esm({
|
|
10994
11005
|
"src/legacy/editor.ts"() {
|
|
10995
11006
|
"use strict";
|
|
10996
11007
|
init_legacy_utils();
|
|
@@ -11101,7 +11112,7 @@ var init_editor2 = __esm({
|
|
|
11101
11112
|
components[name] = component;
|
|
11102
11113
|
}
|
|
11103
11114
|
});
|
|
11104
|
-
|
|
11115
|
+
editor_default = KFEditor;
|
|
11105
11116
|
}
|
|
11106
11117
|
});
|
|
11107
11118
|
|
|
@@ -11110,13 +11121,13 @@ var EditorWrapper, factory, factory_default;
|
|
|
11110
11121
|
var init_factory = __esm({
|
|
11111
11122
|
"src/legacy/factory.ts"() {
|
|
11112
11123
|
"use strict";
|
|
11113
|
-
|
|
11124
|
+
init_editor();
|
|
11114
11125
|
init_runtime_interop();
|
|
11115
11126
|
EditorWrapper = class {
|
|
11116
11127
|
callbacks = [];
|
|
11117
11128
|
editor;
|
|
11118
11129
|
constructor(container, options) {
|
|
11119
|
-
this.editor = new
|
|
11130
|
+
this.editor = new editor_default(container, options);
|
|
11120
11131
|
this.editor.ready(() => {
|
|
11121
11132
|
this.trigger();
|
|
11122
11133
|
});
|
|
@@ -12684,6 +12695,7 @@ var init_formula_symbols = __esm({
|
|
|
12684
12695
|
to: "\u2192",
|
|
12685
12696
|
downarrow: "\u2193",
|
|
12686
12697
|
leftrightarrow: "\u2194",
|
|
12698
|
+
updownarrow: "\u2195",
|
|
12687
12699
|
therefore: "\u2234",
|
|
12688
12700
|
because: "\u2235",
|
|
12689
12701
|
"+": "+",
|
|
@@ -12800,7 +12812,7 @@ var init_formula_symbols = __esm({
|
|
|
12800
12812
|
Uparrow: "\u21D1",
|
|
12801
12813
|
Downarrow: "\u21D3",
|
|
12802
12814
|
Leftrightarrow: "\u21D4",
|
|
12803
|
-
Updownarrow: "\
|
|
12815
|
+
Updownarrow: "\u21D5",
|
|
12804
12816
|
longleftarrow: "\u27F5",
|
|
12805
12817
|
longrightarrow: "\u27F6",
|
|
12806
12818
|
longleftrightarrow: "\u27F7",
|
|
@@ -12868,16 +12880,7 @@ function each(list, callback) {
|
|
|
12868
12880
|
Object.keys(list).forEach((key) => callback(list[key], key));
|
|
12869
12881
|
}
|
|
12870
12882
|
function translateToolbarText(value, locale) {
|
|
12871
|
-
|
|
12872
|
-
return value;
|
|
12873
|
-
}
|
|
12874
|
-
const normalizedValue = value.replace(/<br\s*\/?>/gi, "").trim();
|
|
12875
|
-
const translatedValue = zhCnToEnUsText.get(normalizedValue);
|
|
12876
|
-
if (!translatedValue) {
|
|
12877
|
-
return value;
|
|
12878
|
-
}
|
|
12879
|
-
const lineBreakMatch = value.match(/<br\s*\/?>/i);
|
|
12880
|
-
return lineBreakMatch ? `${translatedValue}${lineBreakMatch[0]}` : translatedValue;
|
|
12883
|
+
return translateFormulaXText("toolbar", value, locale);
|
|
12881
12884
|
}
|
|
12882
12885
|
function localizeToolbarConfig(value, locale) {
|
|
12883
12886
|
if (Array.isArray(value)) {
|
|
@@ -12921,7 +12924,7 @@ function createToolbarConfig(locale = DEFAULT_FORMULAX_LOCALE) {
|
|
|
12921
12924
|
normalizeFormulaXLocale(locale)
|
|
12922
12925
|
);
|
|
12923
12926
|
}
|
|
12924
|
-
var UI_ELE_TYPE, BOX_TYPE2, OTHER_POSITION,
|
|
12927
|
+
var UI_ELE_TYPE, BOX_TYPE2, OTHER_POSITION, baseToolbarConfig, toolbar_config_default;
|
|
12925
12928
|
var init_toolbar_config = __esm({
|
|
12926
12929
|
"src/legacy/toolbar-config.ts"() {
|
|
12927
12930
|
"use strict";
|
|
@@ -12934,40 +12937,6 @@ var init_toolbar_config = __esm({
|
|
|
12934
12937
|
UI_ELE_TYPE = legacyEleType;
|
|
12935
12938
|
BOX_TYPE2 = legacyBoxType;
|
|
12936
12939
|
OTHER_POSITION = legacyOtherPosition;
|
|
12937
|
-
zhCnToEnUsText = /* @__PURE__ */ new Map([
|
|
12938
|
-
["\u9884\u8BBE", "Presets"],
|
|
12939
|
-
["\u9884\u8BBE\u516C\u5F0F", "Preset formulas"],
|
|
12940
|
-
["\u4E8C\u6B21\u516C\u5F0F", "Quadratic formula"],
|
|
12941
|
-
["\u4E8C\u9879\u5F0F\u5B9A\u7406", "Binomial theorem"],
|
|
12942
|
-
["\u52FE\u80A1\u5B9A\u7406", "Pythagorean theorem"],
|
|
12943
|
-
["\u57FA\u7840\u6570\u5B66", "Basic math"],
|
|
12944
|
-
["\u5E0C\u814A\u5B57\u6BCD", "Greek letters"],
|
|
12945
|
-
["\u6C42\u53CD\u5173\u7CFB\u8FD0\u7B97\u7B26", "Negated operators"],
|
|
12946
|
-
["\u5B57\u6BCD\u7C7B\u7B26\u53F7", "Letter-like symbols"],
|
|
12947
|
-
["\u7BAD\u5934", "Arrows"],
|
|
12948
|
-
["\u624B\u5199\u4F53", "Script"],
|
|
12949
|
-
["\u5206\u6570", "Fraction"],
|
|
12950
|
-
["\u5E38\u7528\u5206\u6570", "Common fractions"],
|
|
12951
|
-
["\u4E0A\u4E0B\u6807", "Scripts"],
|
|
12952
|
-
["\u4E0A\u6807\u548C\u4E0B\u6807", "Superscripts and subscripts"],
|
|
12953
|
-
["\u5E38\u7528\u7684\u4E0A\u6807\u548C\u4E0B\u6807", "Common superscripts and subscripts"],
|
|
12954
|
-
["\u6839\u5F0F", "Radicals"],
|
|
12955
|
-
["\u5E38\u7528\u6839\u5F0F", "Common radicals"],
|
|
12956
|
-
["\u79EF\u5206", "Integrals"],
|
|
12957
|
-
["\u5927\u578B\u8FD0\u7B97\u7B26", "Large operators"],
|
|
12958
|
-
["\u6C42\u548C", "Summations"],
|
|
12959
|
-
["\u62EC\u53F7", "Brackets"],
|
|
12960
|
-
["\u65B9\u62EC\u53F7", "Brackets"],
|
|
12961
|
-
["\u51FD\u6570", "Functions"],
|
|
12962
|
-
["\u4E09\u89D2\u51FD\u6570", "Trigonometric functions"],
|
|
12963
|
-
["\u5E38\u7528\u51FD\u6570", "Common functions"],
|
|
12964
|
-
["\u5C0F\u5199", "Lowercase"],
|
|
12965
|
-
["\u5927\u5199", "Uppercase"],
|
|
12966
|
-
["\u53D8\u4F53", "Variants"],
|
|
12967
|
-
["\u82B1\u4F53", "Fraktur"],
|
|
12968
|
-
["\u53CC\u7EBF", "Double-struck"],
|
|
12969
|
-
["\u7F57\u9A6C", "Roman"]
|
|
12970
|
-
]);
|
|
12971
12940
|
baseToolbarConfig = [{
|
|
12972
12941
|
type: UI_ELE_TYPE.DRAPDOWN_BOX,
|
|
12973
12942
|
options: {
|
|
@@ -14198,6 +14167,9 @@ function createGroup(parser) {
|
|
|
14198
14167
|
operand: []
|
|
14199
14168
|
};
|
|
14200
14169
|
}
|
|
14170
|
+
function getRootPlaceholderText() {
|
|
14171
|
+
return legacySysconf.rootPlaceholder.content;
|
|
14172
|
+
}
|
|
14201
14173
|
function processRootGroup(parser, tree) {
|
|
14202
14174
|
if (!parser.isResetId) {
|
|
14203
14175
|
tree.attr["data-type"] = legacyGroupType.VIRTUAL;
|
|
@@ -14245,7 +14217,7 @@ function supplementTree(parser, tree, parentTree) {
|
|
|
14245
14217
|
if (isRoot) {
|
|
14246
14218
|
processRootGroup(parser, tree);
|
|
14247
14219
|
} else if (parentTree?.attr?.["data-root"] && tree.name === "placeholder" && onlyPlaceholder(parentTree.operand)) {
|
|
14248
|
-
tree.attr.label =
|
|
14220
|
+
tree.attr.label = getRootPlaceholderText();
|
|
14249
14221
|
}
|
|
14250
14222
|
for (let i2 = 0; i2 < tree.operand.length; i2 += 1) {
|
|
14251
14223
|
const currentOperand = tree.operand[i2];
|
|
@@ -14257,7 +14229,7 @@ function supplementTree(parser, tree, parentTree) {
|
|
|
14257
14229
|
}
|
|
14258
14230
|
return tree;
|
|
14259
14231
|
}
|
|
14260
|
-
var CURSOR_CHAR,
|
|
14232
|
+
var CURSOR_CHAR, COMBINATION_NAME, PID_PREFIX, pidSeed, kity14, kf5, BaseComponent, Parser, parser_default;
|
|
14261
14233
|
var init_parser = __esm({
|
|
14262
14234
|
"src/legacy/parser.ts"() {
|
|
14263
14235
|
"use strict";
|
|
@@ -14268,7 +14240,6 @@ var init_parser = __esm({
|
|
|
14268
14240
|
init_kf_ext_extension();
|
|
14269
14241
|
init_vgroup_def();
|
|
14270
14242
|
CURSOR_CHAR = legacySysconf.cursorCharacter;
|
|
14271
|
-
ROOT_P_TEXT = legacySysconf.rootPlaceholder.content;
|
|
14272
14243
|
COMBINATION_NAME = "combination";
|
|
14273
14244
|
PID_PREFIX = "_kf_editor_";
|
|
14274
14245
|
pidSeed = 0;
|
|
@@ -16148,26 +16119,26 @@ var init_printer = __esm({
|
|
|
16148
16119
|
var start_exports = {};
|
|
16149
16120
|
__export(start_exports, {
|
|
16150
16121
|
Factory: () => factory_default,
|
|
16151
|
-
KFEditor: () =>
|
|
16122
|
+
KFEditor: () => editor_default,
|
|
16152
16123
|
default: () => start_default,
|
|
16153
16124
|
installKityEditorStart: () => installKityEditorStart
|
|
16154
16125
|
});
|
|
16155
16126
|
function installKityEditorStart(target = window) {
|
|
16156
16127
|
const runtimeTarget = target;
|
|
16157
16128
|
if (!installed3) {
|
|
16158
|
-
|
|
16159
|
-
|
|
16160
|
-
|
|
16161
|
-
|
|
16162
|
-
|
|
16163
|
-
|
|
16164
|
-
|
|
16129
|
+
editor_default.registerComponents("ui", ui_default);
|
|
16130
|
+
editor_default.registerComponents("parser", parser_default);
|
|
16131
|
+
editor_default.registerComponents("render", render_default);
|
|
16132
|
+
editor_default.registerComponents("position", position_default);
|
|
16133
|
+
editor_default.registerComponents("syntax", syntax_default);
|
|
16134
|
+
editor_default.registerComponents("control", controller_default);
|
|
16135
|
+
editor_default.registerComponents("print", printer_default);
|
|
16165
16136
|
installed3 = true;
|
|
16166
16137
|
}
|
|
16167
16138
|
runtimeTarget.kf = runtimeTarget.kf ?? {};
|
|
16168
16139
|
runtimeTarget.kf.EditorFactory = factory_default;
|
|
16169
16140
|
return {
|
|
16170
|
-
KFEditor:
|
|
16141
|
+
KFEditor: editor_default,
|
|
16171
16142
|
Factory: factory_default
|
|
16172
16143
|
};
|
|
16173
16144
|
}
|
|
@@ -16175,7 +16146,7 @@ var installed3, start_default;
|
|
|
16175
16146
|
var init_start = __esm({
|
|
16176
16147
|
"src/boot/start.ts"() {
|
|
16177
16148
|
"use strict";
|
|
16178
|
-
|
|
16149
|
+
init_editor();
|
|
16179
16150
|
init_factory();
|
|
16180
16151
|
init_ui();
|
|
16181
16152
|
init_parser();
|
|
@@ -16203,6 +16174,7 @@ __export(index_exports, {
|
|
|
16203
16174
|
delegateEvent: () => delegateEvent,
|
|
16204
16175
|
ensureKityRuntime: () => ensureKityRuntime,
|
|
16205
16176
|
getClassList: () => getClassList,
|
|
16177
|
+
getFormulaXRuntimeMessage: () => getFormulaXRuntimeMessage,
|
|
16206
16178
|
getRectBox: () => getRectBox,
|
|
16207
16179
|
installLegacyKityData: () => installLegacyKityData,
|
|
16208
16180
|
kityAssetManifest: () => kityAssetManifest,
|
|
@@ -16226,7 +16198,8 @@ __export(index_exports, {
|
|
|
16226
16198
|
normalizeFormulaXLocale: () => normalizeFormulaXLocale,
|
|
16227
16199
|
normalizeMouseEvent: () => normalizeMouseEvent,
|
|
16228
16200
|
publish: () => publish,
|
|
16229
|
-
subscribe: () => subscribe
|
|
16201
|
+
subscribe: () => subscribe,
|
|
16202
|
+
translateFormulaXText: () => translateFormulaXText
|
|
16230
16203
|
});
|
|
16231
16204
|
module.exports = __toCommonJS(index_exports);
|
|
16232
16205
|
init_asset_manifest();
|
|
@@ -19865,6 +19838,7 @@ async function createKityEditor(container, options = {}) {
|
|
|
19865
19838
|
const locale = normalizeFormulaXLocale(options.locale ?? DEFAULT_FORMULAX_LOCALE);
|
|
19866
19839
|
const assets = resolveEditorAssets(options.assets);
|
|
19867
19840
|
try {
|
|
19841
|
+
legacySysconf.rootPlaceholder.content = getFormulaXRuntimeMessage("editor.placeholder.root", locale);
|
|
19868
19842
|
const stylesheetInserted = ensureKityStylesheet(document, assets.styles.editor);
|
|
19869
19843
|
if (stylesheetInserted) {
|
|
19870
19844
|
const stylesheetInsertedMark = markFormulaXPerf("fx:kity-css:link-inserted");
|
|
@@ -20014,6 +19988,7 @@ init_legacy_utils();
|
|
|
20014
19988
|
delegateEvent,
|
|
20015
19989
|
ensureKityRuntime,
|
|
20016
19990
|
getClassList,
|
|
19991
|
+
getFormulaXRuntimeMessage,
|
|
20017
19992
|
getRectBox,
|
|
20018
19993
|
installLegacyKityData,
|
|
20019
19994
|
kityAssetManifest,
|
|
@@ -20037,7 +20012,8 @@ init_legacy_utils();
|
|
|
20037
20012
|
normalizeFormulaXLocale,
|
|
20038
20013
|
normalizeMouseEvent,
|
|
20039
20014
|
publish,
|
|
20040
|
-
subscribe
|
|
20015
|
+
subscribe,
|
|
20016
|
+
translateFormulaXText
|
|
20041
20017
|
});
|
|
20042
20018
|
/*!
|
|
20043
20019
|
* Reverse parsing handler: brackets
|