@formulaxjs/tinymce 0.2.1 → 0.3.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.
- package/README.md +20 -18
- package/README.zh-CN.md +20 -18
- package/dist/base.css +47 -0
- package/dist/canvg-runtime-UR3JNX5Q.js +2759 -0
- package/dist/canvg-runtime-UR3JNX5Q.js.map +1 -0
- package/dist/chunk-4NHESKRD.js +3407 -0
- package/dist/chunk-4NHESKRD.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 +24136 -128
- package/dist/index.cjs.map +1 -1
- package/dist/index.global.js +162 -156
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +3762 -21
- package/dist/index.js.map +1 -1
- package/dist/install-XGCSWTLU.js +5464 -0
- package/dist/install-XGCSWTLU.js.map +1 -0
- package/dist/install-XVTKACEN.js +1349 -0
- package/dist/install-XVTKACEN.js.map +1 -0
- package/dist/other.png +0 -0
- package/dist/scrollbar.css +78 -0
- package/dist/start-CRRRBVTN.js +4926 -0
- package/dist/start-CRRRBVTN.js.map +1 -0
- package/dist/ui.css +625 -0
- package/package.json +9 -4
- /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.global.js
CHANGED
|
@@ -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
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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:
|
|
103
|
-
KF_AMS_CAL:
|
|
104
|
-
KF_AMS_FRAK:
|
|
105
|
-
KF_AMS_MAIN:
|
|
106
|
-
KF_AMS_ROMAN:
|
|
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:
|
|
110
|
-
other:
|
|
61
|
+
btn: import_btn.default,
|
|
62
|
+
other: import_other.default
|
|
111
63
|
};
|
|
112
64
|
kityStyleAssets = {
|
|
113
|
-
editor:
|
|
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
|
-
|
|
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,
|
|
14984
|
-
var
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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: "\
|
|
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
|
-
|
|
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,
|
|
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 =
|
|
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,
|
|
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: () =>
|
|
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
|
-
|
|
20150
|
-
|
|
20151
|
-
|
|
20152
|
-
|
|
20153
|
-
|
|
20154
|
-
|
|
20155
|
-
|
|
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:
|
|
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
|
-
|
|
20146
|
+
init_editor();
|
|
20170
20147
|
init_factory();
|
|
20171
20148
|
init_ui();
|
|
20172
20149
|
init_parser();
|
|
@@ -20649,7 +20626,7 @@ var FormulaX = (() => {
|
|
|
20649
20626
|
fontSize: input.fontSize,
|
|
20650
20627
|
displayMode: input.displayMode,
|
|
20651
20628
|
className: input.className,
|
|
20652
|
-
|
|
20629
|
+
assetCacheKey: input.assetCacheKey
|
|
20653
20630
|
});
|
|
20654
20631
|
}
|
|
20655
20632
|
|
|
@@ -24627,6 +24604,7 @@ var FormulaX = (() => {
|
|
|
24627
24604
|
const locale = normalizeFormulaXLocale(options.locale ?? DEFAULT_FORMULAX_LOCALE);
|
|
24628
24605
|
const assets = resolveEditorAssets(options.assets);
|
|
24629
24606
|
try {
|
|
24607
|
+
legacySysconf.rootPlaceholder.content = getFormulaXRuntimeMessage("editor.placeholder.root", locale);
|
|
24630
24608
|
const stylesheetInserted = ensureKityStylesheet(document, assets.styles.editor);
|
|
24631
24609
|
if (stylesheetInserted) {
|
|
24632
24610
|
const stylesheetInsertedMark = markFormulaXPerf("fx:kity-css:link-inserted");
|
|
@@ -24840,7 +24818,7 @@ var FormulaX = (() => {
|
|
|
24840
24818
|
}
|
|
24841
24819
|
function renderLatexToSvgMarkup(latex, options = {}) {
|
|
24842
24820
|
const normalizedLatex = latex.trim();
|
|
24843
|
-
const shouldUseCache = options.cache !== false && !(hasCustomAssetOverrides(options.assets) && !options.
|
|
24821
|
+
const shouldUseCache = options.cache !== false && !(hasCustomAssetOverrides(options.assets) && !options.assetCacheKey);
|
|
24844
24822
|
if (!normalizedLatex) {
|
|
24845
24823
|
return Promise.resolve({
|
|
24846
24824
|
engine: "kity",
|
|
@@ -24856,7 +24834,7 @@ var FormulaX = (() => {
|
|
|
24856
24834
|
fontSize: options.fontSize,
|
|
24857
24835
|
displayMode: options.displayMode,
|
|
24858
24836
|
className: options.className,
|
|
24859
|
-
|
|
24837
|
+
assetCacheKey: options.assetCacheKey
|
|
24860
24838
|
});
|
|
24861
24839
|
if (shouldUseCache) {
|
|
24862
24840
|
const cached = renderCache.get(cacheKey);
|
|
@@ -25069,8 +25047,11 @@ var FormulaX = (() => {
|
|
|
25069
25047
|
inset: 0;
|
|
25070
25048
|
z-index: 2147483000;
|
|
25071
25049
|
display: flex;
|
|
25072
|
-
align-items:
|
|
25050
|
+
align-items: flex-start;
|
|
25073
25051
|
justify-content: center;
|
|
25052
|
+
padding: 16px;
|
|
25053
|
+
overflow-x: hidden;
|
|
25054
|
+
overflow-y: auto;
|
|
25074
25055
|
}
|
|
25075
25056
|
|
|
25076
25057
|
.fx-formula-modal-backdrop {
|
|
@@ -25083,9 +25064,10 @@ var FormulaX = (() => {
|
|
|
25083
25064
|
--fx-formula-editor-body-height: 264px;
|
|
25084
25065
|
--fx-formula-workspace-height: 168px;
|
|
25085
25066
|
position: relative;
|
|
25086
|
-
width: min(
|
|
25067
|
+
width: min(920px, calc(100vw - 32px));
|
|
25087
25068
|
height: auto;
|
|
25088
|
-
max-height:
|
|
25069
|
+
max-height: none;
|
|
25070
|
+
margin: 0 auto;
|
|
25089
25071
|
background: #fff;
|
|
25090
25072
|
border-radius: 14px;
|
|
25091
25073
|
box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
|
|
@@ -25303,6 +25285,7 @@ var FormulaX = (() => {
|
|
|
25303
25285
|
initialLatex,
|
|
25304
25286
|
height: options.height ?? "100%",
|
|
25305
25287
|
autofocus: options.autofocus ?? true,
|
|
25288
|
+
locale: options.locale,
|
|
25306
25289
|
assets: options.assets,
|
|
25307
25290
|
render: {
|
|
25308
25291
|
fontsize: options.render?.fontsize ?? 40
|
|
@@ -25407,6 +25390,26 @@ var FormulaX = (() => {
|
|
|
25407
25390
|
return null;
|
|
25408
25391
|
}
|
|
25409
25392
|
|
|
25393
|
+
// ../editor/src/i18n.ts
|
|
25394
|
+
var FORMULAX_EDITOR_MESSAGES = {
|
|
25395
|
+
en_US: {
|
|
25396
|
+
"modal.title": "FormulaX Editor",
|
|
25397
|
+
"modal.insert": "Insert",
|
|
25398
|
+
"modal.update": "Update",
|
|
25399
|
+
"modal.cancel": "Cancel"
|
|
25400
|
+
},
|
|
25401
|
+
zh_CN: {
|
|
25402
|
+
"modal.title": "FormulaX \u7F16\u8F91\u5668",
|
|
25403
|
+
"modal.insert": "\u63D2\u5165",
|
|
25404
|
+
"modal.update": "\u66F4\u65B0",
|
|
25405
|
+
"modal.cancel": "\u53D6\u6D88"
|
|
25406
|
+
}
|
|
25407
|
+
};
|
|
25408
|
+
function getFormulaXEditorMessage(key, locale = DEFAULT_FORMULAX_LOCALE) {
|
|
25409
|
+
const normalizedLocale = normalizeFormulaXLocale(locale);
|
|
25410
|
+
return FORMULAX_EDITOR_MESSAGES[normalizedLocale][key] ?? FORMULAX_EDITOR_MESSAGES[DEFAULT_FORMULAX_LOCALE][key];
|
|
25411
|
+
}
|
|
25412
|
+
|
|
25410
25413
|
// src/styles.ts
|
|
25411
25414
|
function ensureTinyMceStyles(doc2 = document) {
|
|
25412
25415
|
ensureFormulaXBaseStyles(doc2);
|
|
@@ -25419,6 +25422,7 @@ var FormulaX = (() => {
|
|
|
25419
25422
|
initialLatex: input.initialLatex,
|
|
25420
25423
|
height: input.options.editor.height ?? "100%",
|
|
25421
25424
|
autofocus: input.options.editor.autofocus ?? true,
|
|
25425
|
+
locale: input.options.editor.locale,
|
|
25422
25426
|
assets: input.options.editor.assets,
|
|
25423
25427
|
render: {
|
|
25424
25428
|
fontsize: input.options.editor.render?.fontsize ?? 40
|
|
@@ -25685,6 +25689,7 @@ var FormulaX = (() => {
|
|
|
25685
25689
|
"polyline[id|class|style|points|fill|stroke|stroke-width|opacity|transform]"
|
|
25686
25690
|
].join(",");
|
|
25687
25691
|
function resolveOptions(options = {}) {
|
|
25692
|
+
const locale = options.editor?.locale ?? DEFAULT_FORMULAX_LOCALE;
|
|
25688
25693
|
return {
|
|
25689
25694
|
pluginName: options.pluginName ?? "formulax",
|
|
25690
25695
|
buttonName: options.buttonName ?? "formulax",
|
|
@@ -25702,10 +25707,10 @@ var FormulaX = (() => {
|
|
|
25702
25707
|
}),
|
|
25703
25708
|
preload: options.preload ?? "idle",
|
|
25704
25709
|
modal: {
|
|
25705
|
-
title: options.modal?.title ?? "
|
|
25706
|
-
insertText: options.modal?.insertText ?? "
|
|
25707
|
-
updateText: options.modal?.updateText ?? "
|
|
25708
|
-
cancelText: options.modal?.cancelText ?? "
|
|
25710
|
+
title: options.modal?.title ?? getFormulaXEditorMessage("modal.title", locale),
|
|
25711
|
+
insertText: options.modal?.insertText ?? getFormulaXEditorMessage("modal.insert", locale),
|
|
25712
|
+
updateText: options.modal?.updateText ?? getFormulaXEditorMessage("modal.update", locale),
|
|
25713
|
+
cancelText: options.modal?.cancelText ?? getFormulaXEditorMessage("modal.cancel", locale),
|
|
25709
25714
|
width: options.modal?.width ?? "1100px",
|
|
25710
25715
|
height: options.modal?.height ?? "auto",
|
|
25711
25716
|
closeOnBackdrop: options.modal?.closeOnBackdrop ?? true
|
|
@@ -25713,6 +25718,7 @@ var FormulaX = (() => {
|
|
|
25713
25718
|
editor: {
|
|
25714
25719
|
height: options.editor?.height ?? "100%",
|
|
25715
25720
|
autofocus: options.editor?.autofocus ?? true,
|
|
25721
|
+
locale,
|
|
25716
25722
|
assets: options.editor?.assets ?? {},
|
|
25717
25723
|
render: {
|
|
25718
25724
|
fontsize: options.editor?.render?.fontsize ?? 40
|