@zero-library/common 3.1.4 → 3.1.6
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/dist/index.cjs.js +956 -255
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +618 -34
- package/dist/index.d.ts +618 -34
- package/dist/index.esm.js +944 -255
- package/dist/index.esm.js.map +1 -1
- package/package.json +4 -2
package/dist/index.cjs.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var i18next = require('i18next');
|
|
4
|
+
var reactI18next = require('react-i18next');
|
|
5
5
|
var antd = require('antd');
|
|
6
|
-
var classNames2 = require('classnames');
|
|
7
|
-
var docxPreview = require('docx-preview');
|
|
8
|
-
var React3 = require('react');
|
|
9
6
|
var copyToClipboard = require('copy-to-clipboard');
|
|
10
7
|
var AES = require('crypto-js/aes');
|
|
11
8
|
var encUtf8 = require('crypto-js/enc-utf8');
|
|
@@ -21,6 +18,11 @@ var Decimal = require('decimal.js');
|
|
|
21
18
|
var dayjs = require('dayjs');
|
|
22
19
|
var relativeTime = require('dayjs/plugin/relativeTime');
|
|
23
20
|
var axios = require('axios');
|
|
21
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
22
|
+
var icons = require('@ant-design/icons');
|
|
23
|
+
var classNames2 = require('classnames');
|
|
24
|
+
var docxPreview = require('docx-preview');
|
|
25
|
+
var React3 = require('react');
|
|
24
26
|
var markdownItKatex = require('@traptitech/markdown-it-katex');
|
|
25
27
|
var parse = require('html-react-parser');
|
|
26
28
|
require('katex/dist/katex.min.css');
|
|
@@ -84,8 +86,6 @@ function _interopNamespace(e) {
|
|
|
84
86
|
return Object.freeze(n);
|
|
85
87
|
}
|
|
86
88
|
|
|
87
|
-
var classNames2__default = /*#__PURE__*/_interopDefault(classNames2);
|
|
88
|
-
var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
|
|
89
89
|
var copyToClipboard__default = /*#__PURE__*/_interopDefault(copyToClipboard);
|
|
90
90
|
var AES__default = /*#__PURE__*/_interopDefault(AES);
|
|
91
91
|
var encUtf8__default = /*#__PURE__*/_interopDefault(encUtf8);
|
|
@@ -98,6 +98,8 @@ var Decimal__default = /*#__PURE__*/_interopDefault(Decimal);
|
|
|
98
98
|
var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
|
|
99
99
|
var relativeTime__default = /*#__PURE__*/_interopDefault(relativeTime);
|
|
100
100
|
var axios__default = /*#__PURE__*/_interopDefault(axios);
|
|
101
|
+
var classNames2__default = /*#__PURE__*/_interopDefault(classNames2);
|
|
102
|
+
var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
|
|
101
103
|
var markdownItKatex__default = /*#__PURE__*/_interopDefault(markdownItKatex);
|
|
102
104
|
var parse__default = /*#__PURE__*/_interopDefault(parse);
|
|
103
105
|
var zh_CN__default = /*#__PURE__*/_interopDefault(zh_CN);
|
|
@@ -111,44 +113,7 @@ var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitiv
|
|
|
111
113
|
var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
|
|
112
114
|
var throttle__default = /*#__PURE__*/_interopDefault(throttle);
|
|
113
115
|
|
|
114
|
-
// src/
|
|
115
|
-
var styles_module_default = {
|
|
116
|
-
nsPreviewImage: "styles_module_nsPreviewImage",
|
|
117
|
-
nsPreviewPdf: "styles_module_nsPreviewPdf",
|
|
118
|
-
pdfToolbar: "styles_module_pdfToolbar",
|
|
119
|
-
nsPreviewPdfImage: "styles_module_nsPreviewPdfImage",
|
|
120
|
-
pdfImageNav: "styles_module_pdfImageNav",
|
|
121
|
-
pdfImageNavItem: "styles_module_pdfImageNavItem",
|
|
122
|
-
pdfImageNavItemImgWrapper: "styles_module_pdfImageNavItemImgWrapper",
|
|
123
|
-
pdfImageNavItemActive: "styles_module_pdfImageNavItemActive",
|
|
124
|
-
pdfImageNavItemImg: "styles_module_pdfImageNavItemImg",
|
|
125
|
-
pdfImageNavItemTip: "styles_module_pdfImageNavItemTip",
|
|
126
|
-
pdfImageBody: "styles_module_pdfImageBody",
|
|
127
|
-
pdfImageBodyToolbar: "styles_module_pdfImageBodyToolbar",
|
|
128
|
-
pdfImageBodyItem: "styles_module_pdfImageBodyItem",
|
|
129
|
-
pdfImageBodyItemInnerWrapper: "styles_module_pdfImageBodyItemInnerWrapper",
|
|
130
|
-
pdfImageBodyItemInner: "styles_module_pdfImageBodyItemInner",
|
|
131
|
-
pdfImageBodyItemActive: "styles_module_pdfImageBodyItemActive",
|
|
132
|
-
pdfImageBodyItemImg: "styles_module_pdfImageBodyItemImg",
|
|
133
|
-
nsPreviewVideo: "styles_module_nsPreviewVideo",
|
|
134
|
-
nsPreviewAudio: "styles_module_nsPreviewAudio",
|
|
135
|
-
nsPreviewDocx: "styles_module_nsPreviewDocx",
|
|
136
|
-
docxToolbar: "styles_module_docxToolbar",
|
|
137
|
-
docxContent: "styles_module_docxContent",
|
|
138
|
-
stateBody: "styles_module_stateBody",
|
|
139
|
-
pdfContainer: "styles_module_pdfContainer",
|
|
140
|
-
floatingToolbar: "styles_module_floatingToolbar",
|
|
141
|
-
divider: "styles_module_divider",
|
|
142
|
-
pdfBody: "styles_module_pdfBody",
|
|
143
|
-
pdfDocument: "styles_module_pdfDocument",
|
|
144
|
-
pdfPage: "styles_module_pdfPage"
|
|
145
|
-
};
|
|
146
|
-
var AudioPlayer_default = ({ fileUrl }) => {
|
|
147
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("audio", { controls: true, className: styles_module_default.nsPreviewAudio, children: [
|
|
148
|
-
/* @__PURE__ */ jsxRuntime.jsx("source", { src: fileUrl, type: "audio/mpeg" }),
|
|
149
|
-
"\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 audio \u6807\u7B7E\u3002"
|
|
150
|
-
] }, fileUrl);
|
|
151
|
-
};
|
|
116
|
+
// src/i18n/index.ts
|
|
152
117
|
|
|
153
118
|
// src/utils/is.ts
|
|
154
119
|
var toString = Object.prototype.toString;
|
|
@@ -483,7 +448,7 @@ var arrToObj = (arr = [], key) => {
|
|
|
483
448
|
});
|
|
484
449
|
return obj;
|
|
485
450
|
};
|
|
486
|
-
var setInterval2 = (fn,
|
|
451
|
+
var setInterval2 = (fn, t2) => {
|
|
487
452
|
let timer = null;
|
|
488
453
|
let running = true;
|
|
489
454
|
const loop = () => {
|
|
@@ -491,7 +456,7 @@ var setInterval2 = (fn, t) => {
|
|
|
491
456
|
if (!running) return;
|
|
492
457
|
await fn();
|
|
493
458
|
if (running) loop();
|
|
494
|
-
},
|
|
459
|
+
}, t2);
|
|
495
460
|
};
|
|
496
461
|
loop();
|
|
497
462
|
return {
|
|
@@ -515,9 +480,9 @@ var genNonDuplicateID = () => {
|
|
|
515
480
|
return v.toString(16);
|
|
516
481
|
});
|
|
517
482
|
};
|
|
518
|
-
var copyText = async (text, prompt
|
|
483
|
+
var copyText = async (text, prompt) => {
|
|
519
484
|
await copyToClipboard__default.default(text);
|
|
520
|
-
if (prompt) antd.message.success(prompt);
|
|
485
|
+
if (prompt !== "") antd.message.success(prompt || t("common.copySuccess"));
|
|
521
486
|
};
|
|
522
487
|
function formatNumberWithCommas(number) {
|
|
523
488
|
const numericValue = parseFloat(number);
|
|
@@ -604,7 +569,7 @@ var buildUrlParams = (obj, url, format = "repeat") => {
|
|
|
604
569
|
};
|
|
605
570
|
var downloadFile = (url, name) => {
|
|
606
571
|
const a = document.createElement("a");
|
|
607
|
-
a.download = name || "
|
|
572
|
+
a.download = name || t("common.defaultFileName");
|
|
608
573
|
a.href = url;
|
|
609
574
|
document.body.appendChild(a);
|
|
610
575
|
a.click();
|
|
@@ -961,7 +926,7 @@ var isExpire = (date) => {
|
|
|
961
926
|
};
|
|
962
927
|
var createCachedMessage = () => {
|
|
963
928
|
const messageCache = {};
|
|
964
|
-
return ({ title = "
|
|
929
|
+
return ({ title = t("common.defaultTitle"), content, type = "warning", duration = 3, onClose, isCache = true, isOnly = false }) => {
|
|
965
930
|
if (!content) return;
|
|
966
931
|
const cacheKey = isOnly ? "unique-message-key" : content;
|
|
967
932
|
const handleClose = () => {
|
|
@@ -1005,50 +970,72 @@ var cachedMessage = createCachedMessage();
|
|
|
1005
970
|
// src/utils/pattern.ts
|
|
1006
971
|
var RegMobile = {
|
|
1007
972
|
pattern: /^1[3-9]\d{9}$/,
|
|
1008
|
-
message
|
|
973
|
+
get message() {
|
|
974
|
+
return t("pattern.mobileInvalid");
|
|
975
|
+
}
|
|
1009
976
|
};
|
|
1010
977
|
var RegFixedTelePhone = {
|
|
1011
978
|
pattern: /^0\d{2,3}-\d{7,8}$/,
|
|
1012
|
-
message
|
|
979
|
+
get message() {
|
|
980
|
+
return t("pattern.phoneInvalid");
|
|
981
|
+
}
|
|
1013
982
|
};
|
|
1014
983
|
var RegTelePhone = {
|
|
1015
984
|
pattern: /^[\\+\-\\(\\)\\(\\)\d]{1,20}$/,
|
|
1016
|
-
message
|
|
985
|
+
get message() {
|
|
986
|
+
return t("pattern.phoneInvalid");
|
|
987
|
+
}
|
|
1017
988
|
};
|
|
1018
989
|
var RegTaxNo = {
|
|
1019
990
|
pattern: /^[A-Z0-9]{15}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/,
|
|
1020
|
-
message
|
|
991
|
+
get message() {
|
|
992
|
+
return t("pattern.taxNoInvalid");
|
|
993
|
+
}
|
|
1021
994
|
};
|
|
1022
995
|
var RegBankCardNo = {
|
|
1023
996
|
pattern: /^[0-9]*$/,
|
|
1024
|
-
message
|
|
997
|
+
get message() {
|
|
998
|
+
return t("pattern.bankCardInvalid");
|
|
999
|
+
}
|
|
1025
1000
|
};
|
|
1026
1001
|
var RegIdentityCardNo = {
|
|
1027
1002
|
pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
|
|
1028
|
-
message
|
|
1003
|
+
get message() {
|
|
1004
|
+
return t("pattern.idCardInvalid");
|
|
1005
|
+
}
|
|
1029
1006
|
};
|
|
1030
1007
|
var RegNumNo = {
|
|
1031
1008
|
pattern: /^[0-9]*$/,
|
|
1032
|
-
message
|
|
1009
|
+
get message() {
|
|
1010
|
+
return t("pattern.numberInvalid");
|
|
1011
|
+
}
|
|
1033
1012
|
};
|
|
1034
1013
|
var RegSmsCode = {
|
|
1035
1014
|
pattern: /^[0-9]{6}$/,
|
|
1036
|
-
message
|
|
1015
|
+
get message() {
|
|
1016
|
+
return t("pattern.smsCodeInvalid");
|
|
1017
|
+
}
|
|
1037
1018
|
};
|
|
1038
1019
|
var RegEmail = {
|
|
1039
1020
|
pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
|
|
1040
|
-
message
|
|
1021
|
+
get message() {
|
|
1022
|
+
return t("pattern.emailInvalid");
|
|
1023
|
+
}
|
|
1041
1024
|
};
|
|
1042
1025
|
var RegDetailAddress = {
|
|
1043
1026
|
pattern: /.*(街|路|村|乡|镇|道|巷|号).*/,
|
|
1044
|
-
message
|
|
1027
|
+
get message() {
|
|
1028
|
+
return t("pattern.addressInvalid");
|
|
1029
|
+
}
|
|
1045
1030
|
};
|
|
1046
1031
|
var RegPassword = {
|
|
1047
1032
|
pattern: /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,26}$/,
|
|
1048
|
-
message
|
|
1033
|
+
get message() {
|
|
1034
|
+
return t("pattern.passwordInvalid");
|
|
1035
|
+
}
|
|
1049
1036
|
};
|
|
1050
|
-
var PhoneOrMobileValidator = (errMessage
|
|
1051
|
-
validator: (_, value) => !value || RegFixedTelePhone.pattern.test(value) || RegMobile.pattern.test(value) ? Promise.resolve() : Promise.reject(new Error(errMessage))
|
|
1037
|
+
var PhoneOrMobileValidator = (errMessage) => ({
|
|
1038
|
+
validator: (_, value) => !value || RegFixedTelePhone.pattern.test(value) || RegMobile.pattern.test(value) ? Promise.resolve() : Promise.reject(new Error(errMessage || t("pattern.phoneOrMobileInvalid")))
|
|
1052
1039
|
});
|
|
1053
1040
|
var ThanNumValidator = ({
|
|
1054
1041
|
min,
|
|
@@ -1065,12 +1052,12 @@ var ThanNumValidator = ({
|
|
|
1065
1052
|
}
|
|
1066
1053
|
if (isNumberNoNaN(parseFloat(min))) {
|
|
1067
1054
|
if (!(Number(value) > Number(min) || equalMin && Number(value) === Number(min))) {
|
|
1068
|
-
return Promise.reject(new Error(minErrMessage || errMessage ||
|
|
1055
|
+
return Promise.reject(new Error(minErrMessage || errMessage || t(equalMin ? "lessThanOrEqual" : "lessThan", { value: min })));
|
|
1069
1056
|
}
|
|
1070
1057
|
}
|
|
1071
1058
|
if (isNumberNoNaN(parseFloat(max))) {
|
|
1072
1059
|
if (!(Number(value) < Number(max) || equalMax && Number(value) === Number(max))) {
|
|
1073
|
-
return Promise.reject(new Error(maxErrMessage || errMessage ||
|
|
1060
|
+
return Promise.reject(new Error(maxErrMessage || errMessage || t(equalMax ? "greaterThanOrEqual" : "greaterThan", { value: max })));
|
|
1074
1061
|
}
|
|
1075
1062
|
}
|
|
1076
1063
|
return Promise.resolve();
|
|
@@ -1090,17 +1077,17 @@ var ThanNumLengthValidator = ({
|
|
|
1090
1077
|
}
|
|
1091
1078
|
if (isNumber(length)) {
|
|
1092
1079
|
if (precision(value) > length) {
|
|
1093
|
-
return Promise.reject(new Error(lengthErrMessage ||
|
|
1080
|
+
return Promise.reject(new Error(lengthErrMessage || t("pattern.totalLengthExceed", { length })));
|
|
1094
1081
|
}
|
|
1095
1082
|
}
|
|
1096
1083
|
if (isNumber(integerLength)) {
|
|
1097
1084
|
if (precision(value) - decimalPlaces(value) > integerLength) {
|
|
1098
|
-
return Promise.reject(new Error(integerLengthErrMessage ||
|
|
1085
|
+
return Promise.reject(new Error(integerLengthErrMessage || t("pattern.integerLengthExceed", { length: integerLength })));
|
|
1099
1086
|
}
|
|
1100
1087
|
}
|
|
1101
1088
|
if (isNumber(decimalsLength)) {
|
|
1102
1089
|
if (decimalPlaces(value) > decimalsLength) {
|
|
1103
|
-
return Promise.reject(new Error(decimalsLengthErrMessage ||
|
|
1090
|
+
return Promise.reject(new Error(decimalsLengthErrMessage || t("pattern.decimalLengthExceed", { length: decimalsLength })));
|
|
1104
1091
|
}
|
|
1105
1092
|
}
|
|
1106
1093
|
return Promise.resolve();
|
|
@@ -1110,7 +1097,7 @@ var MultiEmailValidator = (max) => ({
|
|
|
1110
1097
|
validator: (_, value) => {
|
|
1111
1098
|
if (value) {
|
|
1112
1099
|
const emailArr = value.split(",").map((v) => v.trim()).filter((v) => v);
|
|
1113
|
-
if (emailArr.length > max) return Promise.reject(new Error(
|
|
1100
|
+
if (emailArr.length > max) return Promise.reject(new Error(t("pattern.maxEmailsExceed", { max })));
|
|
1114
1101
|
const noEmailArr = emailArr.filter((email) => !RegEmail.pattern.test(email));
|
|
1115
1102
|
if (noEmailArr.length) return Promise.reject(new Error(RegEmail.message));
|
|
1116
1103
|
}
|
|
@@ -1178,14 +1165,14 @@ function createRequest(config) {
|
|
|
1178
1165
|
return Promise.reject(err);
|
|
1179
1166
|
}
|
|
1180
1167
|
if (!err.response) {
|
|
1181
|
-
if (showError(err?.config?.showError)) cachedMessage({ content: "
|
|
1168
|
+
if (showError(err?.config?.showError)) cachedMessage({ content: t("request.networkError"), type: "error" });
|
|
1182
1169
|
} else {
|
|
1183
1170
|
switch (err.response?.status) {
|
|
1184
1171
|
case HttpStatus.UNAUTHORIZED:
|
|
1185
1172
|
if (showError(err?.config?.showError)) cachedMessage({ content: err.response?.data.message, type: "error" });
|
|
1186
1173
|
break;
|
|
1187
1174
|
default:
|
|
1188
|
-
if (showError(err?.config?.showError)) cachedMessage({ content: err.response?.data.message || "
|
|
1175
|
+
if (showError(err?.config?.showError)) cachedMessage({ content: err.response?.data.message || t("request.requestError"), type: "error" });
|
|
1189
1176
|
}
|
|
1190
1177
|
}
|
|
1191
1178
|
return Promise.reject(err);
|
|
@@ -1300,7 +1287,650 @@ function createTokenManager({ key, storage = localStorage }) {
|
|
|
1300
1287
|
clear: tokenManager.clear
|
|
1301
1288
|
};
|
|
1302
1289
|
}
|
|
1290
|
+
|
|
1291
|
+
// src/i18n/constants.ts
|
|
1292
|
+
var NS_COMMON = "common";
|
|
1293
|
+
|
|
1294
|
+
// src/i18n/zh-CN.ts
|
|
1295
|
+
var commonZhCN = {
|
|
1296
|
+
// 通用文案
|
|
1297
|
+
common: {
|
|
1298
|
+
copySuccess: "\u590D\u5236\u6210\u529F",
|
|
1299
|
+
confirm: "\u786E\u5B9A",
|
|
1300
|
+
cancel: "\u53D6\u6D88",
|
|
1301
|
+
download: "\u4E0B\u8F7D",
|
|
1302
|
+
save: "\u4FDD\u5B58",
|
|
1303
|
+
defaultFileName: "\u6587\u4EF6",
|
|
1304
|
+
defaultTitle: "\u63D0\u793A",
|
|
1305
|
+
loading: "\u52A0\u8F7D\u4E2D..."
|
|
1306
|
+
},
|
|
1307
|
+
// utils/request.ts
|
|
1308
|
+
request: {
|
|
1309
|
+
networkError: "\u7F51\u7EDC\u5F02\u5E38\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC",
|
|
1310
|
+
requestError: "\u8BF7\u6C42\u9519\u8BEF\uFF01"
|
|
1311
|
+
},
|
|
1312
|
+
// utils/pattern.ts — 验证消息
|
|
1313
|
+
pattern: {
|
|
1314
|
+
mobileInvalid: "\u624B\u673A\u53F7\u683C\u5F0F\u4E0D\u6B63\u786E\uFF01",
|
|
1315
|
+
phoneInvalid: "\u7535\u8BDD\u53F7\u7801\u683C\u5F0F\u4E0D\u6B63\u786E\uFF01",
|
|
1316
|
+
taxNoInvalid: "\u7A0E\u53F7\u683C\u5F0F\u6709\u8BEF\uFF01",
|
|
1317
|
+
bankCardInvalid: "\u94F6\u884C\u5361\u53F7\u683C\u5F0F\u6709\u8BEF\uFF01",
|
|
1318
|
+
idCardInvalid: "\u8EAB\u4EFD\u8BC1\u53F7\u683C\u5F0F\u6709\u8BEF\uFF01",
|
|
1319
|
+
numberInvalid: "\u683C\u5F0F\u6709\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165\uFF01",
|
|
1320
|
+
smsCodeInvalid: "\u9A8C\u8BC1\u7801\u4E3A6\u4F4D\u6570\u5B57",
|
|
1321
|
+
emailInvalid: "\u90AE\u7BB1\u683C\u5F0F\u6709\u8BEF\uFF01",
|
|
1322
|
+
addressInvalid: '\u5FC5\u987B\u5305\u542B"\u8857\u3001\u8DEF\u3001\u6751\u3001\u4E61\u3001\u9547\u3001\u9053\u3001\u5DF7\u3001\u53F7"\u7B49\u5173\u952E\u8BCD\u4E4B\u4E00',
|
|
1323
|
+
passwordInvalid: "\u5BC6\u7801\u4E3A8\u523026\u4F4D\u4E4B\u95F4\u6570\u5B57\u4E0E\u5B57\u6BCD\u7EC4\u5408",
|
|
1324
|
+
phoneOrMobileInvalid: "\u8054\u7CFB\u7535\u8BDD\u683C\u5F0F\u4E0D\u6B63\u786E",
|
|
1325
|
+
// 插值示例:{{value}} 会被替换为实际值
|
|
1326
|
+
lessThan: "\u4E0D\u80FD\u5C0F\u4E8E{{value}}",
|
|
1327
|
+
lessThanOrEqual: "\u4E0D\u80FD\u5C0F\u4E8E\u7B49\u4E8E{{value}}",
|
|
1328
|
+
greaterThan: "\u4E0D\u80FD\u5927\u4E8E{{value}}",
|
|
1329
|
+
greaterThanOrEqual: "\u4E0D\u80FD\u5927\u4E8E\u7B49\u4E8E{{value}}",
|
|
1330
|
+
totalLengthExceed: "\u603B\u4F4D\u6570\u4E0D\u80FD\u8D85\u8FC7{{length}}\u4F4D",
|
|
1331
|
+
integerLengthExceed: "\u6574\u6570\u4F4D\u4E0D\u80FD\u8D85\u8FC7{{length}}\u4F4D",
|
|
1332
|
+
decimalLengthExceed: "\u5C0F\u6570\u4F4D\u4E0D\u80FD\u8D85\u8FC7{{length}}\u4F4D",
|
|
1333
|
+
maxEmailsExceed: "\u6700\u591A\u8F93\u5165{{max}}\u4E2A\u90AE\u7BB1"
|
|
1334
|
+
},
|
|
1335
|
+
// utils/date.ts
|
|
1336
|
+
date: {
|
|
1337
|
+
yearMonthFormat: "YYYY\u5E74MM\u6708",
|
|
1338
|
+
yearMonthDayFormat: "YYYY\u5E74MM\u6708DD\u65E5"
|
|
1339
|
+
},
|
|
1340
|
+
// SpeechButton 语音按钮
|
|
1341
|
+
speechButton: {
|
|
1342
|
+
notSupported: "\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u8BED\u97F3\u8BC6\u522B",
|
|
1343
|
+
permissionDenied: "\u9EA6\u514B\u98CE\u6743\u9650\u5DF2\u62D2\u7EDD",
|
|
1344
|
+
stop: "\u505C\u6B62\u5F55\u97F3",
|
|
1345
|
+
start: "\u70B9\u51FB\u5F00\u59CB\u5F55\u97F3"
|
|
1346
|
+
},
|
|
1347
|
+
// MicroApp / Iframe
|
|
1348
|
+
microApp: {
|
|
1349
|
+
loading: "\u52A0\u8F7D\u4E2D..."
|
|
1350
|
+
},
|
|
1351
|
+
iframe: {
|
|
1352
|
+
loading: "\u52A0\u8F7D\u4E2D..."
|
|
1353
|
+
},
|
|
1354
|
+
// LazyComponent 延时加载组件
|
|
1355
|
+
lazyComponent: {
|
|
1356
|
+
unknownType: "\u672A\u77E5\u7C7B\u578B\uFF1A{{type}}",
|
|
1357
|
+
componentLoading: "\u7EC4\u4EF6\u52A0\u8F7D\u4E2D..."
|
|
1358
|
+
},
|
|
1359
|
+
// File 文件预览组件群
|
|
1360
|
+
filePreview: {
|
|
1361
|
+
title: "\u6587\u4EF6\u9884\u89C8",
|
|
1362
|
+
closePreview: "\u5173\u95ED\u9884\u89C8",
|
|
1363
|
+
previewImageAlt: "\u9884\u89C8\u56FE\u7247",
|
|
1364
|
+
previewNotSupported: "\u6682\u4E0D\u652F\u6301 {{suffix}} \u6587\u4EF6\u7684\u9884\u89C8",
|
|
1365
|
+
previewNotSupportedDownload: "{{suffix}} \u6587\u4EF6\u6682\u4E0D\u652F\u6301\u5728\u7EBF\u9884\u89C8\uFF0C\u8BF7\u4E0B\u8F7D\u6253\u5F00",
|
|
1366
|
+
previewGenerating: "\u9884\u89C8\u6587\u4EF6\u6B63\u5728\u751F\u6210\u4E2D...",
|
|
1367
|
+
audioNotSupported: "\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 audio \u6807\u7B7E\u3002",
|
|
1368
|
+
videoNotSupported: "\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 video \u6807\u7B7E\u3002",
|
|
1369
|
+
requestFailedWithStatus: "\u8BF7\u6C42\u5931\u8D25\uFF0C\u72B6\u6001\u7801: {{status}}",
|
|
1370
|
+
emptyResponse: "\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A",
|
|
1371
|
+
loadFileFailed: "\u52A0\u8F7D\u6587\u4EF6\u5931\u8D25",
|
|
1372
|
+
fileParseFailed: "\u52A0\u8F7D\u6216\u89E3\u6790\u6587\u4EF6\u5931\u8D25",
|
|
1373
|
+
fileUrlInvalid: "\u6587\u4EF6\u5730\u5740\u9519\u8BEF",
|
|
1374
|
+
htmlParseFailed: "\u52A0\u8F7D\u6216\u89E3\u6790 HTML \u5931\u8D25",
|
|
1375
|
+
docLoadFailed: "\u6587\u6863\u52A0\u8F7D\u5931\u8D25",
|
|
1376
|
+
pdfLoadFailed: "PDF \u52A0\u8F7D\u5931\u8D25",
|
|
1377
|
+
pdfParseFailed: "\u52A0\u8F7D\u6216\u89E3\u6790 pdf \u5931\u8D25",
|
|
1378
|
+
pdfUrlInvalid: "pdf\u5730\u5740\u9519\u8BEF",
|
|
1379
|
+
pdfPasswordInvalid: "\u5BC6\u7801\u65E0\u6548\u3002\u8BF7\u518D\u8BD5\u4E00\u6B21\uFF01",
|
|
1380
|
+
pdfPasswordPlaceholder: "\u8BF7\u8F93\u5165\u5BC6\u7801",
|
|
1381
|
+
pdfSubmit: "\u63D0 \u4EA4",
|
|
1382
|
+
pdfInvalidOrDamaged: "\u6587\u4EF6\u65E0\u6548\u6216\u5DF2\u635F\u574F",
|
|
1383
|
+
pdfFileNotFound: "\u6587\u4EF6\u4E0D\u5B58\u5728",
|
|
1384
|
+
pdfUnexpectedResponse: "\u610F\u5916\u7684\u670D\u52A1\u5668\u54CD\u5E94",
|
|
1385
|
+
pdfLoadDocumentFailed: "\u65E0\u6CD5\u52A0\u8F7D\u6587\u6863",
|
|
1386
|
+
zoomOut: "\u7F29\u5C0F",
|
|
1387
|
+
zoomIn: "\u653E\u5927",
|
|
1388
|
+
zoomReset: "\u8FD8\u539F",
|
|
1389
|
+
fitWidth: "\u9002\u5E94\u5BBD\u5EA6"
|
|
1390
|
+
},
|
|
1391
|
+
// MarkdownEditor 富文本编辑器
|
|
1392
|
+
markdownEditor: {
|
|
1393
|
+
mainArea: "\u4E3B\u5185\u5BB9\u533A\u57DF\uFF0C\u5F00\u59CB\u8F93\u5165\u6587\u672C...",
|
|
1394
|
+
unknown: "\u672A\u77E5",
|
|
1395
|
+
// 工具栏
|
|
1396
|
+
toolbar: {
|
|
1397
|
+
quote: "\u5F15\u7528\u9009\u4E2D\u6587\u672C",
|
|
1398
|
+
annotation: "\u6279\u6CE8",
|
|
1399
|
+
excerpt: "\u6458\u5F55\u7B14\u8BB0",
|
|
1400
|
+
undo: "\u64A4\u9500",
|
|
1401
|
+
redo: "\u91CD\u505A",
|
|
1402
|
+
alignLeft: "\u5DE6\u5BF9\u9F50",
|
|
1403
|
+
alignCenter: "\u5C45\u4E2D\u5BF9\u9F50",
|
|
1404
|
+
alignRight: "\u53F3\u5BF9\u9F50",
|
|
1405
|
+
alignJustify: "\u4E24\u7AEF\u5BF9\u9F50",
|
|
1406
|
+
bold: "\u7C97\u4F53",
|
|
1407
|
+
italic: "\u659C\u4F53",
|
|
1408
|
+
underline: "\u4E0B\u5212\u7EBF",
|
|
1409
|
+
strike: "\u5220\u9664\u7EBF",
|
|
1410
|
+
code: "\u4EE3\u7801",
|
|
1411
|
+
superscript: "\u4E0A\u89D2\u6807",
|
|
1412
|
+
subscript: "\u4E0B\u89D2\u6807",
|
|
1413
|
+
bulletList: "\u65E0\u5E8F\u5217\u8868",
|
|
1414
|
+
orderedList: "\u6709\u5E8F\u5217\u8868",
|
|
1415
|
+
taskList: "\u4EFB\u52A1\u5217\u8868",
|
|
1416
|
+
listOptions: "\u5217\u8868\u9009\u9879",
|
|
1417
|
+
list: "\u5217\u8868",
|
|
1418
|
+
blockquote: "\u5F15\u7528\u5757",
|
|
1419
|
+
codeBlock: "\u4EE3\u7801\u5757",
|
|
1420
|
+
heading: "\u6807\u9898",
|
|
1421
|
+
headingLevel: "\u6807\u9898 {{level}}",
|
|
1422
|
+
addImage: "\u6DFB\u52A0\u56FE\u7247",
|
|
1423
|
+
link: "\u94FE\u63A5",
|
|
1424
|
+
linkPlaceholder: "\u7C98\u8D34\u94FE\u63A5...",
|
|
1425
|
+
applyLink: "\u5E94\u7528\u94FE\u63A5",
|
|
1426
|
+
openInNewWindow: "\u5728\u65B0\u7A97\u53E3\u4E2D\u6253\u5F00",
|
|
1427
|
+
removeLink: "\u79FB\u9664\u94FE\u63A5"
|
|
1428
|
+
},
|
|
1429
|
+
// 高亮 / 背景色
|
|
1430
|
+
highlight: {
|
|
1431
|
+
toggle: "\u5207\u6362\u9AD8\u4EAE\u663E\u793A ({{color}})",
|
|
1432
|
+
label: "\u80CC\u666F\u8272",
|
|
1433
|
+
textLabel: "\u6587\u672C\u80CC\u666F\u8272",
|
|
1434
|
+
removeBackground: "\u79FB\u9664\u80CC\u666F",
|
|
1435
|
+
removeHighlight: "\u79FB\u9664\u9AD8\u4EAE",
|
|
1436
|
+
default: "\u9ED8\u8BA4\u80CC\u666F",
|
|
1437
|
+
gray: "\u7070\u8272\u80CC\u666F",
|
|
1438
|
+
brown: "\u68D5\u8272\u80CC\u666F",
|
|
1439
|
+
orange: "\u6A59\u8272\u80CC\u666F",
|
|
1440
|
+
yellow: "\u9EC4\u8272\u80CC\u666F",
|
|
1441
|
+
green: "\u7EFF\u8272\u80CC\u666F",
|
|
1442
|
+
blue: "\u84DD\u8272\u80CC\u666F",
|
|
1443
|
+
purple: "\u7D2B\u8272\u80CC\u666F",
|
|
1444
|
+
pink: "\u7C89\u8272\u80CC\u666F",
|
|
1445
|
+
red: "\u7EA2\u8272\u80CC\u666F"
|
|
1446
|
+
},
|
|
1447
|
+
// 批注
|
|
1448
|
+
annotation: {
|
|
1449
|
+
title: "\u6279\u6CE8",
|
|
1450
|
+
list: "\u6279\u6CE8\u5217\u8868",
|
|
1451
|
+
add: "\u6DFB\u52A0\u6279\u6CE8",
|
|
1452
|
+
content: "\u6279\u6CE8\u5185\u5BB9",
|
|
1453
|
+
required: "\u8BF7\u8F93\u5165\u6279\u6CE8\u5185\u5BB9",
|
|
1454
|
+
maxLength: "\u6279\u6CE8\u5185\u5BB9\u4E0D\u80FD\u8D85\u8FC7500\u4E2A\u5B57\u7B26",
|
|
1455
|
+
placeholder: "\u8BF7\u8F93\u5165\u60A8\u7684\u6279\u6CE8\u5185\u5BB9...",
|
|
1456
|
+
edit: "\u7F16\u8F91\u6279\u6CE8",
|
|
1457
|
+
delete: "\u5220\u9664\u6279\u6CE8",
|
|
1458
|
+
confirmDelete: "\u786E\u8BA4\u5220\u9664\u5F53\u524D\u6279\u6CE8\u5417?",
|
|
1459
|
+
empty: "\u6682\u65E0\u6279\u6CE8"
|
|
1460
|
+
},
|
|
1461
|
+
// 摘录
|
|
1462
|
+
collection: {
|
|
1463
|
+
title: "\u6458\u5F55",
|
|
1464
|
+
list: "\u6458\u5F55\u5217\u8868",
|
|
1465
|
+
delete: "\u5220\u9664\u6458\u5F55",
|
|
1466
|
+
confirmDelete: "\u786E\u8BA4\u5220\u9664\u5F53\u524D\u6458\u5F55\u5417?",
|
|
1467
|
+
empty: "\u6682\u65E0\u6458\u5F55"
|
|
1468
|
+
},
|
|
1469
|
+
// 文件 / 图片上传
|
|
1470
|
+
upload: {
|
|
1471
|
+
noFile: "\u672A\u63D0\u4F9B\u6587\u4EF6",
|
|
1472
|
+
canceled: "\u4E0A\u4F20\u5DF2\u53D6\u6D88",
|
|
1473
|
+
fileSizeExceeded: "\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u6700\u5927\u9650\u5236 ({{max}}MB)",
|
|
1474
|
+
undefined: "\u4E0A\u4F20\u529F\u80FD\u672A\u5B9A\u4E49",
|
|
1475
|
+
failedNoUrl: "\u4E0A\u4F20\u5931\u8D25\uFF1A\u672A\u8FD4\u56DEURL",
|
|
1476
|
+
failed: "\u4E0A\u4F20\u5931\u8D25",
|
|
1477
|
+
noFileToUpload: "\u6CA1\u6709\u6587\u4EF6\u53EF\u4E0A\u4F20",
|
|
1478
|
+
maxFileCount: "\u6700\u591A\u5141\u8BB8\u4E0A\u4F20 {{limit}} \u4E2A\u6587\u4EF6"
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
};
|
|
1482
|
+
|
|
1483
|
+
// src/i18n/en-US.ts
|
|
1484
|
+
var commonEnUS = {
|
|
1485
|
+
common: {
|
|
1486
|
+
copySuccess: "Copied successfully",
|
|
1487
|
+
confirm: "OK",
|
|
1488
|
+
cancel: "Cancel",
|
|
1489
|
+
download: "Download",
|
|
1490
|
+
save: "Save",
|
|
1491
|
+
defaultFileName: "file",
|
|
1492
|
+
defaultTitle: "Notice",
|
|
1493
|
+
loading: "Loading..."
|
|
1494
|
+
},
|
|
1495
|
+
request: {
|
|
1496
|
+
networkError: "Network error, please check your connection",
|
|
1497
|
+
requestError: "Request error!"
|
|
1498
|
+
},
|
|
1499
|
+
pattern: {
|
|
1500
|
+
mobileInvalid: "Invalid phone number!",
|
|
1501
|
+
phoneInvalid: "Invalid phone number!",
|
|
1502
|
+
taxNoInvalid: "Invalid tax number!",
|
|
1503
|
+
bankCardInvalid: "Invalid bank card number!",
|
|
1504
|
+
idCardInvalid: "Invalid ID card number!",
|
|
1505
|
+
numberInvalid: "Invalid format, please re-enter!",
|
|
1506
|
+
smsCodeInvalid: "SMS code must be 6 digits",
|
|
1507
|
+
emailInvalid: "Invalid email format!",
|
|
1508
|
+
addressInvalid: "Must contain one of: street, road, village, town, etc.",
|
|
1509
|
+
passwordInvalid: "Password must be 8-26 characters with letters and numbers",
|
|
1510
|
+
phoneOrMobileInvalid: "Invalid contact number",
|
|
1511
|
+
lessThan: "Cannot be less than {{value}}",
|
|
1512
|
+
lessThanOrEqual: "Cannot be less than or equal to {{value}}",
|
|
1513
|
+
greaterThan: "Cannot be greater than {{value}}",
|
|
1514
|
+
greaterThanOrEqual: "Cannot be greater than or equal to {{value}}",
|
|
1515
|
+
totalLengthExceed: "Total digits cannot exceed {{length}}",
|
|
1516
|
+
integerLengthExceed: "Integer digits cannot exceed {{length}}",
|
|
1517
|
+
decimalLengthExceed: "Decimal digits cannot exceed {{length}}",
|
|
1518
|
+
maxEmailsExceed: "Maximum {{max}} emails allowed"
|
|
1519
|
+
},
|
|
1520
|
+
date: {
|
|
1521
|
+
yearMonthFormat: "YYYY-MM",
|
|
1522
|
+
yearMonthDayFormat: "YYYY-MM-DD"
|
|
1523
|
+
},
|
|
1524
|
+
speechButton: {
|
|
1525
|
+
notSupported: "Speech recognition is not supported in this browser",
|
|
1526
|
+
permissionDenied: "Microphone permission denied",
|
|
1527
|
+
stop: "Stop Recording",
|
|
1528
|
+
start: "Click to Start Recording"
|
|
1529
|
+
},
|
|
1530
|
+
microApp: {
|
|
1531
|
+
loading: "Loading..."
|
|
1532
|
+
},
|
|
1533
|
+
iframe: {
|
|
1534
|
+
loading: "Loading..."
|
|
1535
|
+
},
|
|
1536
|
+
lazyComponent: {
|
|
1537
|
+
unknownType: "Unknown type: {{type}}",
|
|
1538
|
+
componentLoading: "Loading component..."
|
|
1539
|
+
},
|
|
1540
|
+
filePreview: {
|
|
1541
|
+
title: "File Preview",
|
|
1542
|
+
closePreview: "Close preview",
|
|
1543
|
+
previewImageAlt: "Preview image",
|
|
1544
|
+
previewNotSupported: "Preview of {{suffix}} files is not supported",
|
|
1545
|
+
previewNotSupportedDownload: "{{suffix}} files cannot be previewed online, please download and open",
|
|
1546
|
+
previewGenerating: "Preview file is being generated...",
|
|
1547
|
+
audioNotSupported: "Your browser does not support the audio tag.",
|
|
1548
|
+
videoNotSupported: "Your browser does not support the video tag.",
|
|
1549
|
+
requestFailedWithStatus: "Request failed, status code: {{status}}",
|
|
1550
|
+
emptyResponse: "Response content is empty",
|
|
1551
|
+
loadFileFailed: "Failed to load file",
|
|
1552
|
+
fileParseFailed: "Failed to load or parse file",
|
|
1553
|
+
fileUrlInvalid: "Invalid file URL",
|
|
1554
|
+
htmlParseFailed: "Failed to load or parse HTML",
|
|
1555
|
+
docLoadFailed: "Failed to load document",
|
|
1556
|
+
pdfLoadFailed: "Failed to load PDF",
|
|
1557
|
+
pdfParseFailed: "Failed to load or parse PDF",
|
|
1558
|
+
pdfUrlInvalid: "Invalid PDF URL",
|
|
1559
|
+
pdfPasswordInvalid: "Invalid password. Please try again!",
|
|
1560
|
+
pdfPasswordPlaceholder: "Please enter password",
|
|
1561
|
+
pdfSubmit: "Submit",
|
|
1562
|
+
pdfInvalidOrDamaged: "File is invalid or damaged",
|
|
1563
|
+
pdfFileNotFound: "File not found",
|
|
1564
|
+
pdfUnexpectedResponse: "Unexpected server response",
|
|
1565
|
+
pdfLoadDocumentFailed: "Unable to load document",
|
|
1566
|
+
zoomOut: "Zoom out",
|
|
1567
|
+
zoomIn: "Zoom in",
|
|
1568
|
+
zoomReset: "Reset",
|
|
1569
|
+
fitWidth: "Fit width"
|
|
1570
|
+
},
|
|
1571
|
+
markdownEditor: {
|
|
1572
|
+
mainArea: "Main content area, start typing...",
|
|
1573
|
+
unknown: "Unknown",
|
|
1574
|
+
toolbar: {
|
|
1575
|
+
quote: "Quote Selected Text",
|
|
1576
|
+
annotation: "Annotate",
|
|
1577
|
+
excerpt: "Excerpt Note",
|
|
1578
|
+
undo: "Undo",
|
|
1579
|
+
redo: "Redo",
|
|
1580
|
+
alignLeft: "Align Left",
|
|
1581
|
+
alignCenter: "Align Center",
|
|
1582
|
+
alignRight: "Align Right",
|
|
1583
|
+
alignJustify: "Justify",
|
|
1584
|
+
bold: "Bold",
|
|
1585
|
+
italic: "Italic",
|
|
1586
|
+
underline: "Underline",
|
|
1587
|
+
strike: "Strikethrough",
|
|
1588
|
+
code: "Code",
|
|
1589
|
+
superscript: "Superscript",
|
|
1590
|
+
subscript: "Subscript",
|
|
1591
|
+
bulletList: "Bullet List",
|
|
1592
|
+
orderedList: "Numbered List",
|
|
1593
|
+
taskList: "Task List",
|
|
1594
|
+
listOptions: "List Options",
|
|
1595
|
+
list: "List",
|
|
1596
|
+
blockquote: "Blockquote",
|
|
1597
|
+
codeBlock: "Code Block",
|
|
1598
|
+
heading: "Heading",
|
|
1599
|
+
headingLevel: "Heading {{level}}",
|
|
1600
|
+
addImage: "Add Image",
|
|
1601
|
+
link: "Link",
|
|
1602
|
+
linkPlaceholder: "Paste link...",
|
|
1603
|
+
applyLink: "Apply Link",
|
|
1604
|
+
openInNewWindow: "Open in New Window",
|
|
1605
|
+
removeLink: "Remove Link"
|
|
1606
|
+
},
|
|
1607
|
+
highlight: {
|
|
1608
|
+
toggle: "Toggle highlight ({{color}})",
|
|
1609
|
+
label: "Background color",
|
|
1610
|
+
textLabel: "Text background color",
|
|
1611
|
+
removeBackground: "Remove background",
|
|
1612
|
+
removeHighlight: "Remove highlight",
|
|
1613
|
+
default: "Default background",
|
|
1614
|
+
gray: "Gray background",
|
|
1615
|
+
brown: "Brown background",
|
|
1616
|
+
orange: "Orange background",
|
|
1617
|
+
yellow: "Yellow background",
|
|
1618
|
+
green: "Green background",
|
|
1619
|
+
blue: "Blue background",
|
|
1620
|
+
purple: "Purple background",
|
|
1621
|
+
pink: "Pink background",
|
|
1622
|
+
red: "Red background"
|
|
1623
|
+
},
|
|
1624
|
+
annotation: {
|
|
1625
|
+
title: "Annotations",
|
|
1626
|
+
list: "Annotations",
|
|
1627
|
+
add: "Add Annotation",
|
|
1628
|
+
content: "Annotation content",
|
|
1629
|
+
required: "Please enter annotation content",
|
|
1630
|
+
maxLength: "Annotation content cannot exceed 500 characters",
|
|
1631
|
+
placeholder: "Please enter your annotation...",
|
|
1632
|
+
edit: "Edit Annotation",
|
|
1633
|
+
delete: "Delete annotation",
|
|
1634
|
+
confirmDelete: "Delete this annotation?",
|
|
1635
|
+
empty: "No annotations"
|
|
1636
|
+
},
|
|
1637
|
+
collection: {
|
|
1638
|
+
title: "Excerpts",
|
|
1639
|
+
list: "Excerpts",
|
|
1640
|
+
delete: "Delete excerpt",
|
|
1641
|
+
confirmDelete: "Delete this excerpt?",
|
|
1642
|
+
empty: "No excerpts"
|
|
1643
|
+
},
|
|
1644
|
+
upload: {
|
|
1645
|
+
noFile: "No file provided",
|
|
1646
|
+
canceled: "Upload canceled",
|
|
1647
|
+
fileSizeExceeded: "File size exceeds the maximum limit ({{max}}MB)",
|
|
1648
|
+
undefined: "Upload function is not defined",
|
|
1649
|
+
failedNoUrl: "Upload failed: no URL returned",
|
|
1650
|
+
failed: "Upload failed",
|
|
1651
|
+
noFileToUpload: "No file to upload",
|
|
1652
|
+
maxFileCount: "A maximum of {{limit}} files can be uploaded"
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
};
|
|
1656
|
+
|
|
1657
|
+
// src/i18n/ja-JP.ts
|
|
1658
|
+
var commonJaJP = {
|
|
1659
|
+
// 共通文案
|
|
1660
|
+
common: {
|
|
1661
|
+
copySuccess: "\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",
|
|
1662
|
+
confirm: "OK",
|
|
1663
|
+
cancel: "\u30AD\u30E3\u30F3\u30BB\u30EB",
|
|
1664
|
+
download: "\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9",
|
|
1665
|
+
save: "\u4FDD\u5B58",
|
|
1666
|
+
defaultFileName: "\u30D5\u30A1\u30A4\u30EB",
|
|
1667
|
+
defaultTitle: "\u30D2\u30F3\u30C8",
|
|
1668
|
+
loading: "\u8AAD\u307F\u8FBC\u307F\u4E2D..."
|
|
1669
|
+
},
|
|
1670
|
+
// utils/request.ts
|
|
1671
|
+
request: {
|
|
1672
|
+
networkError: "\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
1673
|
+
requestError: "\u30EA\u30AF\u30A8\u30B9\u30C8\u30A8\u30E9\u30FC\uFF01"
|
|
1674
|
+
},
|
|
1675
|
+
// utils/pattern.ts — バリデーションメッセージ
|
|
1676
|
+
pattern: {
|
|
1677
|
+
mobileInvalid: "\u643A\u5E2F\u96FB\u8A71\u756A\u53F7\u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\uFF01",
|
|
1678
|
+
phoneInvalid: "\u96FB\u8A71\u756A\u53F7\u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\uFF01",
|
|
1679
|
+
taxNoInvalid: "\u7A0E\u756A\u53F7\u306E\u5F62\u5F0F\u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\uFF01",
|
|
1680
|
+
bankCardInvalid: "\u9280\u884C\u30AB\u30FC\u30C9\u756A\u53F7\u306E\u5F62\u5F0F\u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\uFF01",
|
|
1681
|
+
idCardInvalid: "\u8EAB\u5206\u8A3C\u660E\u66F8\u756A\u53F7\u306E\u5F62\u5F0F\u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\uFF01",
|
|
1682
|
+
numberInvalid: "\u5F62\u5F0F\u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\u3002\u518D\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF01",
|
|
1683
|
+
smsCodeInvalid: "\u8A8D\u8A3C\u30B3\u30FC\u30C9\u306F6\u6841\u306E\u6570\u5B57\u3067\u3059",
|
|
1684
|
+
emailInvalid: "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306E\u5F62\u5F0F\u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\uFF01",
|
|
1685
|
+
addressInvalid: "\u300C\u8857\u300D\u300C\u9053\u8DEF\u300D\u300C\u6751\u300D\u300C\u753A\u300D\u300C\u9053\u300D\u300C\u8DEF\u5730\u300D\u300C\u756A\u53F7\u300D\u306A\u3069\u306E\u30AD\u30FC\u30EF\u30FC\u30C9\u3092\u542B\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
1686
|
+
passwordInvalid: "\u30D1\u30B9\u30EF\u30FC\u30C9\u306F8\u301C26\u6587\u5B57\u306E\u82F1\u6570\u5B57\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059",
|
|
1687
|
+
phoneOrMobileInvalid: "\u9023\u7D61\u5148\u96FB\u8A71\u756A\u53F7\u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093",
|
|
1688
|
+
// 補間例:{{value}} は実際の値に置換されます
|
|
1689
|
+
lessThan: "{{value}}\u672A\u6E80\u306B\u3067\u304D\u307E\u305B\u3093",
|
|
1690
|
+
lessThanOrEqual: "{{value}}\u4EE5\u4E0B\u306B\u3067\u304D\u307E\u305B\u3093",
|
|
1691
|
+
greaterThan: "{{value}}\u3092\u8D85\u3048\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",
|
|
1692
|
+
greaterThanOrEqual: "{{value}}\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
1693
|
+
totalLengthExceed: "\u7DCF\u6841\u6570\u306F{{length}}\u6841\u3092\u8D85\u3048\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",
|
|
1694
|
+
integerLengthExceed: "\u6574\u6570\u90E8\u306F{{length}}\u6841\u3092\u8D85\u3048\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",
|
|
1695
|
+
decimalLengthExceed: "\u5C0F\u6570\u90E8\u306F{{length}}\u6841\u3092\u8D85\u3048\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",
|
|
1696
|
+
maxEmailsExceed: "\u6700\u5927{{max}}\u4EF6\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u307E\u3067\u5165\u529B\u3067\u304D\u307E\u3059"
|
|
1697
|
+
},
|
|
1698
|
+
// utils/date.ts
|
|
1699
|
+
date: {
|
|
1700
|
+
yearMonthFormat: "YYYY\u5E74MM\u6708",
|
|
1701
|
+
yearMonthDayFormat: "YYYY\u5E74MM\u6708DD\u65E5"
|
|
1702
|
+
},
|
|
1703
|
+
// SpeechButton 音声ボタン
|
|
1704
|
+
speechButton: {
|
|
1705
|
+
notSupported: "\u73FE\u5728\u306E\u30D6\u30E9\u30A6\u30B6\u306F\u97F3\u58F0\u8A8D\u8B58\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093",
|
|
1706
|
+
permissionDenied: "\u30DE\u30A4\u30AF\u306E\u6A29\u9650\u304C\u62D2\u5426\u3055\u308C\u307E\u3057\u305F",
|
|
1707
|
+
stop: "\u9332\u97F3\u3092\u505C\u6B62",
|
|
1708
|
+
start: "\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u9332\u97F3\u3092\u958B\u59CB"
|
|
1709
|
+
},
|
|
1710
|
+
// MicroApp / Iframe
|
|
1711
|
+
microApp: {
|
|
1712
|
+
loading: "\u8AAD\u307F\u8FBC\u307F\u4E2D..."
|
|
1713
|
+
},
|
|
1714
|
+
iframe: {
|
|
1715
|
+
loading: "\u8AAD\u307F\u8FBC\u307F\u4E2D..."
|
|
1716
|
+
},
|
|
1717
|
+
// LazyComponent 遅延読み込みコンポーネント
|
|
1718
|
+
lazyComponent: {
|
|
1719
|
+
unknownType: "\u4E0D\u660E\u306A\u30BF\u30A4\u30D7\uFF1A{{type}}",
|
|
1720
|
+
componentLoading: "\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D..."
|
|
1721
|
+
},
|
|
1722
|
+
// File ファイルプレビューコンポーネント群
|
|
1723
|
+
filePreview: {
|
|
1724
|
+
title: "\u30D5\u30A1\u30A4\u30EB\u30D7\u30EC\u30D3\u30E5\u30FC",
|
|
1725
|
+
closePreview: "\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u9589\u3058\u308B",
|
|
1726
|
+
previewImageAlt: "\u30D7\u30EC\u30D3\u30E5\u30FC\u753B\u50CF",
|
|
1727
|
+
previewNotSupported: "{{suffix}}\u30D5\u30A1\u30A4\u30EB\u306E\u30D7\u30EC\u30D3\u30E5\u30FC\u306B\u306F\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093",
|
|
1728
|
+
previewNotSupportedDownload: "{{suffix}}\u30D5\u30A1\u30A4\u30EB\u306F\u30AA\u30F3\u30E9\u30A4\u30F3\u30D7\u30EC\u30D3\u30E5\u30FC\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u3066\u958B\u3044\u3066\u304F\u3060\u3055\u3044",
|
|
1729
|
+
previewGenerating: "\u30D7\u30EC\u30D3\u30E5\u30FC\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u4E2D...",
|
|
1730
|
+
audioNotSupported: "\u304A\u4F7F\u3044\u306E\u30D6\u30E9\u30A6\u30B6\u306F audio \u30BF\u30B0\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002",
|
|
1731
|
+
videoNotSupported: "\u304A\u4F7F\u3044\u306E\u30D6\u30E9\u30A6\u30B6\u306F video \u30BF\u30B0\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002",
|
|
1732
|
+
requestFailedWithStatus: "\u30EA\u30AF\u30A8\u30B9\u30C8\u5931\u6557\u3001\u30B9\u30C6\u30FC\u30BF\u30B9\u30B3\u30FC\u30C9: {{status}}",
|
|
1733
|
+
emptyResponse: "\u8FD4\u4FE1\u5185\u5BB9\u304C\u7A7A\u3067\u3059",
|
|
1734
|
+
loadFileFailed: "\u30D5\u30A1\u30A4\u30EB\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
1735
|
+
fileParseFailed: "\u30D5\u30A1\u30A4\u30EB\u306E\u8AAD\u307F\u8FBC\u307F\u307E\u305F\u306F\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
1736
|
+
fileUrlInvalid: "\u30D5\u30A1\u30A4\u30EBURL\u304C\u4E0D\u6B63\u3067\u3059",
|
|
1737
|
+
htmlParseFailed: "HTML\u306E\u8AAD\u307F\u8FBC\u307F\u307E\u305F\u306F\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
1738
|
+
docLoadFailed: "\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
1739
|
+
pdfLoadFailed: "PDF\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
1740
|
+
pdfParseFailed: "PDF\u306E\u8AAD\u307F\u8FBC\u307F\u307E\u305F\u306F\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
1741
|
+
pdfUrlInvalid: "PDF\u306EURL\u304C\u4E0D\u6B63\u3067\u3059",
|
|
1742
|
+
pdfPasswordInvalid: "\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u7121\u52B9\u3067\u3059\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\uFF01",
|
|
1743
|
+
pdfPasswordPlaceholder: "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
1744
|
+
pdfSubmit: "\u9001 \u4FE1",
|
|
1745
|
+
pdfInvalidOrDamaged: "\u30D5\u30A1\u30A4\u30EB\u304C\u7121\u52B9\u307E\u305F\u306F\u7834\u640D\u3057\u3066\u3044\u307E\u3059",
|
|
1746
|
+
pdfFileNotFound: "\u30D5\u30A1\u30A4\u30EB\u304C\u5B58\u5728\u3057\u307E\u305B\u3093",
|
|
1747
|
+
pdfUnexpectedResponse: "\u4E88\u671F\u3057\u306A\u3044\u30B5\u30FC\u30D0\u30FC\u30EC\u30B9\u30DD\u30F3\u30B9",
|
|
1748
|
+
pdfLoadDocumentFailed: "\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093",
|
|
1749
|
+
zoomOut: "\u7E2E\u5C0F",
|
|
1750
|
+
zoomIn: "\u62E1\u5927",
|
|
1751
|
+
zoomReset: "\u5143\u306B\u623B\u3059",
|
|
1752
|
+
fitWidth: "\u5E45\u306B\u5408\u308F\u305B\u308B"
|
|
1753
|
+
},
|
|
1754
|
+
// MarkdownEditor リッチテキストエディタ
|
|
1755
|
+
markdownEditor: {
|
|
1756
|
+
mainArea: "\u30E1\u30A4\u30F3\u30B3\u30F3\u30C6\u30F3\u30C4\u30A8\u30EA\u30A2\u3001\u30C6\u30AD\u30B9\u30C8\u3092\u5165\u529B...",
|
|
1757
|
+
unknown: "\u4E0D\u660E",
|
|
1758
|
+
// ツールバー
|
|
1759
|
+
toolbar: {
|
|
1760
|
+
quote: "\u9078\u629E\u30C6\u30AD\u30B9\u30C8\u3092\u5F15\u7528",
|
|
1761
|
+
annotation: "\u6CE8\u91C8",
|
|
1762
|
+
excerpt: "\u629C\u7C8B\u30E1\u30E2",
|
|
1763
|
+
undo: "\u5143\u306B\u623B\u3059",
|
|
1764
|
+
redo: "\u3084\u308A\u76F4\u3059",
|
|
1765
|
+
alignLeft: "\u5DE6\u63C3\u3048",
|
|
1766
|
+
alignCenter: "\u4E2D\u592E\u63C3\u3048",
|
|
1767
|
+
alignRight: "\u53F3\u63C3\u3048",
|
|
1768
|
+
alignJustify: "\u4E21\u7AEF\u63C3\u3048",
|
|
1769
|
+
bold: "\u592A\u5B57",
|
|
1770
|
+
italic: "\u659C\u4F53",
|
|
1771
|
+
underline: "\u4E0B\u7DDA",
|
|
1772
|
+
strike: "\u53D6\u308A\u6D88\u3057\u7DDA",
|
|
1773
|
+
code: "\u30B3\u30FC\u30C9",
|
|
1774
|
+
superscript: "\u4E0A\u4ED8\u304D\u6587\u5B57",
|
|
1775
|
+
subscript: "\u4E0B\u4ED8\u304D\u6587\u5B57",
|
|
1776
|
+
bulletList: "\u7B87\u6761\u66F8\u304D",
|
|
1777
|
+
orderedList: "\u756A\u53F7\u4ED8\u304D\u30EA\u30B9\u30C8",
|
|
1778
|
+
taskList: "\u30BF\u30B9\u30AF\u30EA\u30B9\u30C8",
|
|
1779
|
+
listOptions: "\u30EA\u30B9\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3",
|
|
1780
|
+
list: "\u30EA\u30B9\u30C8",
|
|
1781
|
+
blockquote: "\u5F15\u7528\u30D6\u30ED\u30C3\u30AF",
|
|
1782
|
+
codeBlock: "\u30B3\u30FC\u30C9\u30D6\u30ED\u30C3\u30AF",
|
|
1783
|
+
heading: "\u898B\u51FA\u3057",
|
|
1784
|
+
headingLevel: "\u898B\u51FA\u3057 {{level}}",
|
|
1785
|
+
addImage: "\u753B\u50CF\u3092\u8FFD\u52A0",
|
|
1786
|
+
link: "\u30EA\u30F3\u30AF",
|
|
1787
|
+
linkPlaceholder: "\u30EA\u30F3\u30AF\u3092\u8CBC\u308A\u4ED8\u3051...",
|
|
1788
|
+
applyLink: "\u30EA\u30F3\u30AF\u3092\u9069\u7528",
|
|
1789
|
+
openInNewWindow: "\u65B0\u3057\u3044\u30A6\u30A3\u30F3\u30C9\u30A6\u3067\u958B\u304F",
|
|
1790
|
+
removeLink: "\u30EA\u30F3\u30AF\u3092\u524A\u9664"
|
|
1791
|
+
},
|
|
1792
|
+
// ハイライト / 背景色
|
|
1793
|
+
highlight: {
|
|
1794
|
+
toggle: "\u30CF\u30A4\u30E9\u30A4\u30C8\u8868\u793A\u3092\u5207\u308A\u66FF\u3048 ({{color}})",
|
|
1795
|
+
label: "\u80CC\u666F\u8272",
|
|
1796
|
+
textLabel: "\u30C6\u30AD\u30B9\u30C8\u80CC\u666F\u8272",
|
|
1797
|
+
removeBackground: "\u80CC\u666F\u3092\u524A\u9664",
|
|
1798
|
+
removeHighlight: "\u30CF\u30A4\u30E9\u30A4\u30C8\u3092\u524A\u9664",
|
|
1799
|
+
default: "\u30C7\u30D5\u30A9\u30EB\u30C8\u80CC\u666F",
|
|
1800
|
+
gray: "\u30B0\u30EC\u30FC\u80CC\u666F",
|
|
1801
|
+
brown: "\u30D6\u30E9\u30A6\u30F3\u80CC\u666F",
|
|
1802
|
+
orange: "\u30AA\u30EC\u30F3\u30B8\u80CC\u666F",
|
|
1803
|
+
yellow: "\u30A4\u30A8\u30ED\u30FC\u80CC\u666F",
|
|
1804
|
+
green: "\u30B0\u30EA\u30FC\u30F3\u80CC\u666F",
|
|
1805
|
+
blue: "\u30D6\u30EB\u30FC\u80CC\u666F",
|
|
1806
|
+
purple: "\u30D1\u30FC\u30D7\u30EB\u80CC\u666F",
|
|
1807
|
+
pink: "\u30D4\u30F3\u30AF\u80CC\u666F",
|
|
1808
|
+
red: "\u30EC\u30C3\u30C9\u80CC\u666F"
|
|
1809
|
+
},
|
|
1810
|
+
// 注釈
|
|
1811
|
+
annotation: {
|
|
1812
|
+
title: "\u6CE8\u91C8",
|
|
1813
|
+
list: "\u6CE8\u91C8\u30EA\u30B9\u30C8",
|
|
1814
|
+
add: "\u6CE8\u91C8\u3092\u8FFD\u52A0",
|
|
1815
|
+
content: "\u6CE8\u91C8\u5185\u5BB9",
|
|
1816
|
+
required: "\u6CE8\u91C8\u5185\u5BB9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
1817
|
+
maxLength: "\u6CE8\u91C8\u5185\u5BB9\u306F500\u6587\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
1818
|
+
placeholder: "\u6CE8\u91C8\u5185\u5BB9\u3092\u5165\u529B...",
|
|
1819
|
+
edit: "\u6CE8\u91C8\u3092\u7DE8\u96C6",
|
|
1820
|
+
delete: "\u6CE8\u91C8\u3092\u524A\u9664",
|
|
1821
|
+
confirmDelete: "\u3053\u306E\u6CE8\u91C8\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F",
|
|
1822
|
+
empty: "\u6CE8\u91C8\u306F\u3042\u308A\u307E\u305B\u3093"
|
|
1823
|
+
},
|
|
1824
|
+
// 抜粋
|
|
1825
|
+
collection: {
|
|
1826
|
+
title: "\u629C\u7C8B",
|
|
1827
|
+
list: "\u629C\u7C8B\u30EA\u30B9\u30C8",
|
|
1828
|
+
delete: "\u629C\u7C8B\u3092\u524A\u9664",
|
|
1829
|
+
confirmDelete: "\u3053\u306E\u629C\u7C8B\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F",
|
|
1830
|
+
empty: "\u629C\u7C8B\u306F\u3042\u308A\u307E\u305B\u3093"
|
|
1831
|
+
},
|
|
1832
|
+
// ファイル / 画像アップロード
|
|
1833
|
+
upload: {
|
|
1834
|
+
noFile: "\u30D5\u30A1\u30A4\u30EB\u304C\u63D0\u4F9B\u3055\u308C\u3066\u3044\u307E\u305B\u3093",
|
|
1835
|
+
canceled: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306F\u30AD\u30E3\u30F3\u30BB\u30EB\u3055\u308C\u307E\u3057\u305F",
|
|
1836
|
+
fileSizeExceeded: "\u30D5\u30A1\u30A4\u30EB\u30B5\u30A4\u30BA\u304C\u6700\u5927\u5236\u9650\u3092\u8D85\u3048\u3066\u3044\u307E\u3059 ({{max}}MB)",
|
|
1837
|
+
undefined: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u6A5F\u80FD\u304C\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u305B\u3093",
|
|
1838
|
+
failedNoUrl: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u5931\u6557\uFF1AURL\u304C\u8FD4\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
1839
|
+
failed: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
1840
|
+
noFileToUpload: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3059\u308B\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093",
|
|
1841
|
+
maxFileCount: "\u6700\u5927{{limit}}\u4EF6\u307E\u3067\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3067\u304D\u307E\u3059"
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
};
|
|
1845
|
+
|
|
1846
|
+
// src/i18n/index.ts
|
|
1847
|
+
var DEFAULT_LNG = "zh-CN";
|
|
1848
|
+
var LANG_KEY = "ns-lang";
|
|
1849
|
+
var langManager = createTokenManager({ key: LANG_KEY });
|
|
1850
|
+
function getLang() {
|
|
1851
|
+
return langManager.get() || DEFAULT_LNG;
|
|
1852
|
+
}
|
|
1853
|
+
var i18n = i18next.createInstance({
|
|
1854
|
+
lng: DEFAULT_LNG,
|
|
1855
|
+
fallbackLng: DEFAULT_LNG,
|
|
1856
|
+
defaultNS: NS_COMMON,
|
|
1857
|
+
interpolation: { escapeValue: false },
|
|
1858
|
+
resources: { [DEFAULT_LNG]: { [NS_COMMON]: commonZhCN } }
|
|
1859
|
+
}).use(reactI18next.initReactI18next);
|
|
1860
|
+
void i18n.init();
|
|
1861
|
+
function addBundledResource(lng, ns, res) {
|
|
1862
|
+
if (lng === DEFAULT_LNG && ns === NS_COMMON) return;
|
|
1863
|
+
i18n.addResourceBundle(lng, ns, res, true, true);
|
|
1864
|
+
}
|
|
1865
|
+
function initI18n(options = {}) {
|
|
1866
|
+
const { lng = getLang(), resources } = options;
|
|
1867
|
+
for (const [l, namespaces] of Object.entries(resources ?? {})) {
|
|
1868
|
+
for (const [ns, messages] of Object.entries(namespaces)) {
|
|
1869
|
+
i18n.addResourceBundle(l, ns, messages, true, true);
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
switchLang(lng);
|
|
1873
|
+
return i18n;
|
|
1874
|
+
}
|
|
1875
|
+
function switchLang(lng, reload = false) {
|
|
1876
|
+
langManager.set(lng);
|
|
1877
|
+
if (reload) {
|
|
1878
|
+
window?.top?.location.reload();
|
|
1879
|
+
} else {
|
|
1880
|
+
i18n.changeLanguage(lng);
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
function useTranslation(namespace) {
|
|
1884
|
+
return reactI18next.useTranslation(namespace, { useSuspense: false });
|
|
1885
|
+
}
|
|
1886
|
+
function getI18n() {
|
|
1887
|
+
return i18n;
|
|
1888
|
+
}
|
|
1889
|
+
function t(key, options) {
|
|
1890
|
+
return i18n.t(key, options);
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
// src/components/File/styles.module.less
|
|
1894
|
+
var styles_module_default = {
|
|
1895
|
+
nsPreviewImage: "styles_module_nsPreviewImage",
|
|
1896
|
+
nsPreviewPdf: "styles_module_nsPreviewPdf",
|
|
1897
|
+
pdfToolbar: "styles_module_pdfToolbar",
|
|
1898
|
+
nsPreviewPdfImage: "styles_module_nsPreviewPdfImage",
|
|
1899
|
+
pdfImageNav: "styles_module_pdfImageNav",
|
|
1900
|
+
pdfImageNavItem: "styles_module_pdfImageNavItem",
|
|
1901
|
+
pdfImageNavItemImgWrapper: "styles_module_pdfImageNavItemImgWrapper",
|
|
1902
|
+
pdfImageNavItemActive: "styles_module_pdfImageNavItemActive",
|
|
1903
|
+
pdfImageNavItemImg: "styles_module_pdfImageNavItemImg",
|
|
1904
|
+
pdfImageNavItemTip: "styles_module_pdfImageNavItemTip",
|
|
1905
|
+
pdfImageBody: "styles_module_pdfImageBody",
|
|
1906
|
+
pdfImageBodyToolbar: "styles_module_pdfImageBodyToolbar",
|
|
1907
|
+
pdfImageBodyItem: "styles_module_pdfImageBodyItem",
|
|
1908
|
+
pdfImageBodyItemInnerWrapper: "styles_module_pdfImageBodyItemInnerWrapper",
|
|
1909
|
+
pdfImageBodyItemInner: "styles_module_pdfImageBodyItemInner",
|
|
1910
|
+
pdfImageBodyItemActive: "styles_module_pdfImageBodyItemActive",
|
|
1911
|
+
pdfImageBodyItemImg: "styles_module_pdfImageBodyItemImg",
|
|
1912
|
+
nsPreviewVideo: "styles_module_nsPreviewVideo",
|
|
1913
|
+
nsPreviewAudio: "styles_module_nsPreviewAudio",
|
|
1914
|
+
nsPreviewDocx: "styles_module_nsPreviewDocx",
|
|
1915
|
+
docxToolbar: "styles_module_docxToolbar",
|
|
1916
|
+
docxContent: "styles_module_docxContent",
|
|
1917
|
+
stateBody: "styles_module_stateBody",
|
|
1918
|
+
pdfContainer: "styles_module_pdfContainer",
|
|
1919
|
+
floatingToolbar: "styles_module_floatingToolbar",
|
|
1920
|
+
divider: "styles_module_divider",
|
|
1921
|
+
pdfBody: "styles_module_pdfBody",
|
|
1922
|
+
pdfDocument: "styles_module_pdfDocument",
|
|
1923
|
+
pdfPage: "styles_module_pdfPage"
|
|
1924
|
+
};
|
|
1925
|
+
var AudioPlayer_default = ({ fileUrl }) => {
|
|
1926
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
1927
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("audio", { controls: true, className: styles_module_default.nsPreviewAudio, children: [
|
|
1928
|
+
/* @__PURE__ */ jsxRuntime.jsx("source", { src: fileUrl, type: "audio/mpeg" }),
|
|
1929
|
+
t2("filePreview.audioNotSupported")
|
|
1930
|
+
] }, fileUrl);
|
|
1931
|
+
};
|
|
1303
1932
|
var DocxPreview_default = ({ fileUrl, scale = 1 }) => {
|
|
1933
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
1304
1934
|
const containerRef = React3.useRef(null);
|
|
1305
1935
|
const [zoomRatio, setZoomRatio] = React3.useState(scale);
|
|
1306
1936
|
React3.useEffect(() => {
|
|
@@ -1323,7 +1953,7 @@ var DocxPreview_default = ({ fileUrl, scale = 1 }) => {
|
|
|
1323
1953
|
});
|
|
1324
1954
|
}).catch((err) => {
|
|
1325
1955
|
console.error("docx-preview \u6E32\u67D3\u5931\u8D25:", err);
|
|
1326
|
-
if (containerRef.current) containerRef.current.innerHTML =
|
|
1956
|
+
if (containerRef.current) containerRef.current.innerHTML = `<p class="text-center">${t2("filePreview.docLoadFailed")}</p>`;
|
|
1327
1957
|
});
|
|
1328
1958
|
}, [fileUrl]);
|
|
1329
1959
|
const zoomIn = () => setZoomRatio((z) => Math.min(z + 0.1, 3));
|
|
@@ -1333,9 +1963,9 @@ var DocxPreview_default = ({ fileUrl, scale = 1 }) => {
|
|
|
1333
1963
|
};
|
|
1334
1964
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames2__default.default(styles_module_default.nsPreviewDocx, "height-full", "width-full"), children: [
|
|
1335
1965
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 6, align: "center", className: styles_module_default.docxToolbar, children: [
|
|
1336
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomOut, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.MinusCircleOutlined, {}), title: "
|
|
1337
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomIn, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusCircleOutlined, {}), title: "
|
|
1338
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: resetZoom, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.RedoOutlined, {}), title: "
|
|
1966
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomOut, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.MinusCircleOutlined, {}), title: t2("filePreview.zoomOut") }),
|
|
1967
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomIn, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusCircleOutlined, {}), title: t2("filePreview.zoomIn") }),
|
|
1968
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: resetZoom, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.RedoOutlined, {}), title: t2("filePreview.zoomReset") })
|
|
1339
1969
|
] }),
|
|
1340
1970
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames2__default.default(styles_module_default.docxContent, "height-full", "scroll-fade-in"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1341
1971
|
"div",
|
|
@@ -1413,9 +2043,10 @@ var FileIcon_default = ({ suffix, fontSize = 22 }) => {
|
|
|
1413
2043
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: styles, children: Icon });
|
|
1414
2044
|
};
|
|
1415
2045
|
var VideoPlayer_default = ({ fileUrl }) => {
|
|
2046
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
1416
2047
|
return /* @__PURE__ */ jsxRuntime.jsxs("video", { controls: true, className: styles_module_default.nsPreviewVideo, children: [
|
|
1417
2048
|
/* @__PURE__ */ jsxRuntime.jsx("source", { src: fileUrl, type: "video/mp4" }),
|
|
1418
|
-
"
|
|
2049
|
+
t2("filePreview.videoNotSupported")
|
|
1419
2050
|
] }, fileUrl);
|
|
1420
2051
|
};
|
|
1421
2052
|
|
|
@@ -1428,6 +2059,7 @@ var baseComponentMap = {
|
|
|
1428
2059
|
};
|
|
1429
2060
|
var lazyCache = /* @__PURE__ */ new Map();
|
|
1430
2061
|
var LazyComponent_default = ({ type, customComponents, unknownContent, ...rest }) => {
|
|
2062
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
1431
2063
|
const loader2 = customComponents?.[type] || baseComponentMap[type];
|
|
1432
2064
|
const LazyComponent = React3.useMemo(() => {
|
|
1433
2065
|
if (!loader2) return null;
|
|
@@ -1437,11 +2069,11 @@ var LazyComponent_default = ({ type, customComponents, unknownContent, ...rest }
|
|
|
1437
2069
|
lazyCache.set(type, component);
|
|
1438
2070
|
return component;
|
|
1439
2071
|
}, [loader2]);
|
|
1440
|
-
if (!LazyComponent) return unknownContent || /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { title:
|
|
2072
|
+
if (!LazyComponent) return unknownContent || /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { title: t2("lazyComponent.unknownType", { type }), type: "warning" });
|
|
1441
2073
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1442
2074
|
React3.Suspense,
|
|
1443
2075
|
{
|
|
1444
|
-
fallback: /* @__PURE__ */ jsxRuntime.jsx(antd.Skeleton.Node, { active: true, className: styles_module_default2.skeleton, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Typography.Text, { type: "secondary", children: "
|
|
2076
|
+
fallback: /* @__PURE__ */ jsxRuntime.jsx(antd.Skeleton.Node, { active: true, className: styles_module_default2.skeleton, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Typography.Text, { type: "secondary", children: t2("lazyComponent.componentLoading") }) }),
|
|
1445
2077
|
children: /* @__PURE__ */ jsxRuntime.jsx(LazyComponent, { ...rest })
|
|
1446
2078
|
}
|
|
1447
2079
|
);
|
|
@@ -1553,18 +2185,27 @@ var RenderMarkdown_default = ({ content = "", searchValue, customComponents, ...
|
|
|
1553
2185
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ns-markdown", children: reactContent });
|
|
1554
2186
|
};
|
|
1555
2187
|
var MarkdownPreview_default = ({ fileUrl, searchValue, asPlainText }) => {
|
|
2188
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
1556
2189
|
const [content, setContent] = React3.useState("");
|
|
1557
2190
|
const [error, setError] = React3.useState("");
|
|
1558
2191
|
const fetchMarkdown = async () => {
|
|
1559
2192
|
const res = await fetch(fileUrl);
|
|
1560
2193
|
if (res.status !== 200) {
|
|
1561
|
-
throw new Error(
|
|
2194
|
+
throw new Error(t2("filePreview.requestFailedWithStatus", { status: res.status }));
|
|
1562
2195
|
}
|
|
1563
|
-
const
|
|
1564
|
-
|
|
1565
|
-
|
|
2196
|
+
const buffer = await res.arrayBuffer();
|
|
2197
|
+
let markdownText = "";
|
|
2198
|
+
try {
|
|
2199
|
+
const decoder = new TextDecoder("utf-8", { fatal: true });
|
|
2200
|
+
markdownText = decoder.decode(buffer);
|
|
2201
|
+
} catch (e) {
|
|
2202
|
+
const gbkDecoder = new TextDecoder("gbk");
|
|
2203
|
+
markdownText = gbkDecoder.decode(buffer);
|
|
2204
|
+
}
|
|
2205
|
+
if (!markdownText) {
|
|
2206
|
+
throw new Error(t2("filePreview.emptyResponse"));
|
|
1566
2207
|
}
|
|
1567
|
-
return
|
|
2208
|
+
return markdownText;
|
|
1568
2209
|
};
|
|
1569
2210
|
const init = async () => {
|
|
1570
2211
|
setContent("");
|
|
@@ -1574,10 +2215,10 @@ var MarkdownPreview_default = ({ fileUrl, searchValue, asPlainText }) => {
|
|
|
1574
2215
|
const content2 = await fetchMarkdown();
|
|
1575
2216
|
setContent(content2);
|
|
1576
2217
|
} catch {
|
|
1577
|
-
setError("
|
|
2218
|
+
setError(t2("filePreview.fileParseFailed"));
|
|
1578
2219
|
}
|
|
1579
2220
|
} else {
|
|
1580
|
-
setError("
|
|
2221
|
+
setError(t2("filePreview.fileUrlInvalid"));
|
|
1581
2222
|
}
|
|
1582
2223
|
};
|
|
1583
2224
|
React3.useEffect(() => {
|
|
@@ -2247,17 +2888,18 @@ var THUMB_IMG_HEIGHT = 514;
|
|
|
2247
2888
|
var MAIN_IMG_HEIGHT = 800;
|
|
2248
2889
|
var MAIN_IMG_WIDTH = 600;
|
|
2249
2890
|
var PdfImagePreview_default = ({ fileUrl, pageNo, scale = 1, isHasThumbnails = true, onSetPageNo }) => {
|
|
2891
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
2250
2892
|
const [images, setImages] = React3.useState([]);
|
|
2251
2893
|
const [currentIndex, setCurrentIndex, getCurrentIndex] = useRefState_default(0);
|
|
2252
2894
|
const [error, setError] = React3.useState("");
|
|
2253
2895
|
const fetchPdfImages = async () => {
|
|
2254
2896
|
const res = await fetch(fileUrl);
|
|
2255
2897
|
if (res.status !== 200) {
|
|
2256
|
-
throw new Error(
|
|
2898
|
+
throw new Error(t2("filePreview.requestFailedWithStatus", { status: res.status }));
|
|
2257
2899
|
}
|
|
2258
2900
|
const { data } = await res.json();
|
|
2259
2901
|
if (!data?.items?.length) {
|
|
2260
|
-
throw new Error("
|
|
2902
|
+
throw new Error(t2("filePreview.emptyResponse"));
|
|
2261
2903
|
}
|
|
2262
2904
|
setImages(data.items);
|
|
2263
2905
|
};
|
|
@@ -2269,10 +2911,10 @@ var PdfImagePreview_default = ({ fileUrl, pageNo, scale = 1, isHasThumbnails = t
|
|
|
2269
2911
|
try {
|
|
2270
2912
|
await fetchPdfImages();
|
|
2271
2913
|
} catch (error2) {
|
|
2272
|
-
setError("
|
|
2914
|
+
setError(t2("filePreview.pdfParseFailed"));
|
|
2273
2915
|
}
|
|
2274
2916
|
} else {
|
|
2275
|
-
setError("
|
|
2917
|
+
setError(t2("filePreview.pdfUrlInvalid"));
|
|
2276
2918
|
}
|
|
2277
2919
|
};
|
|
2278
2920
|
React3.useEffect(() => {
|
|
@@ -2412,9 +3054,9 @@ var PdfImagePreview_default = ({ fileUrl, pageNo, scale = 1, isHasThumbnails = t
|
|
|
2412
3054
|
) }) }),
|
|
2413
3055
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames2__default.default("height-full", styles_module_default.pdfImageBody), children: [
|
|
2414
3056
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 6, align: "center", className: styles_module_default.pdfImageBodyToolbar, children: [
|
|
2415
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomOut, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.MinusCircleOutlined, {}), title: "
|
|
2416
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomIn, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusCircleOutlined, {}), title: "
|
|
2417
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomFitWidth, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ColumnWidthOutlined, {}), title: "
|
|
3057
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomOut, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.MinusCircleOutlined, {}), title: t2("filePreview.zoomOut") }),
|
|
3058
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomIn, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusCircleOutlined, {}), title: t2("filePreview.zoomIn") }),
|
|
3059
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomFitWidth, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ColumnWidthOutlined, {}), title: t2("filePreview.fitWidth") })
|
|
2418
3060
|
] }),
|
|
2419
3061
|
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef, className: "height-full scroll-fade-in", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2420
3062
|
"div",
|
|
@@ -2462,6 +3104,7 @@ var ProtectedView = ({
|
|
|
2462
3104
|
verifyPassword,
|
|
2463
3105
|
onVerifyPasswordEnd
|
|
2464
3106
|
}) => {
|
|
3107
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
2465
3108
|
const [form] = antd.Form.useForm();
|
|
2466
3109
|
const onSubmit = () => {
|
|
2467
3110
|
form.validateFields().then((values) => {
|
|
@@ -2472,10 +3115,10 @@ var ProtectedView = ({
|
|
|
2472
3115
|
});
|
|
2473
3116
|
};
|
|
2474
3117
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "center", align: "center", className: "height-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: 300 }, children: [
|
|
2475
|
-
passwordStatus === core$1.PasswordStatus.WrongPassword && /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { title: "
|
|
3118
|
+
passwordStatus === core$1.PasswordStatus.WrongPassword && /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { title: t2("filePreview.pdfPasswordInvalid"), type: "error" }),
|
|
2476
3119
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Form, { form, size: "large", className: "m-t-24", children: [
|
|
2477
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { name: "password", rules: [{ required: true, message: "
|
|
2478
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "primary", onClick: onSubmit, children: "
|
|
3120
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { name: "password", rules: [{ required: true, message: t2("filePreview.pdfPasswordPlaceholder") }], children: /* @__PURE__ */ jsxRuntime.jsx(antd.Input.Password, { autoComplete: "new-password", placeholder: t2("filePreview.pdfPasswordPlaceholder") }) }),
|
|
3121
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "primary", onClick: onSubmit, children: t2("filePreview.pdfSubmit") }) })
|
|
2479
3122
|
] })
|
|
2480
3123
|
] }) });
|
|
2481
3124
|
};
|
|
@@ -2494,6 +3137,7 @@ var openLinksNewTabPlugin = () => {
|
|
|
2494
3137
|
};
|
|
2495
3138
|
};
|
|
2496
3139
|
var PdfPreview_default = ({ password, fileUrl, pageNo = 1, scale = 1, isHasThumbnails = true, onSetPassword, onSetPageNo }) => {
|
|
3140
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
2497
3141
|
const embedRef = React3.useRef(null);
|
|
2498
3142
|
const [sizes, setSizes] = React3.useState([0]);
|
|
2499
3143
|
const [docLoaded, setDocLoaded, getDocLoaded] = useRefState_default(false);
|
|
@@ -2567,19 +3211,19 @@ var PdfPreview_default = ({ password, fileUrl, pageNo = 1, scale = 1, isHasThumb
|
|
|
2567
3211
|
let message3 = "";
|
|
2568
3212
|
switch (error.name) {
|
|
2569
3213
|
case "InvalidPDFException":
|
|
2570
|
-
message3 = "
|
|
3214
|
+
message3 = t2("filePreview.pdfInvalidOrDamaged");
|
|
2571
3215
|
break;
|
|
2572
3216
|
case "MissingPDFException":
|
|
2573
|
-
message3 = "
|
|
3217
|
+
message3 = t2("filePreview.pdfFileNotFound");
|
|
2574
3218
|
break;
|
|
2575
3219
|
case "UnexpectedResponseException":
|
|
2576
|
-
message3 = "
|
|
3220
|
+
message3 = t2("filePreview.pdfUnexpectedResponse");
|
|
2577
3221
|
break;
|
|
2578
3222
|
// case 'CMapReaderFactory not initialized':
|
|
2579
3223
|
// message = '字体映射文件加载失败,请刷新页面重试'
|
|
2580
3224
|
// break
|
|
2581
3225
|
default:
|
|
2582
|
-
message3 = "
|
|
3226
|
+
message3 = t2("filePreview.pdfLoadDocumentFailed");
|
|
2583
3227
|
break;
|
|
2584
3228
|
}
|
|
2585
3229
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { className: "height-full", justify: "center", align: "center", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { title: message3, type: "error", showIcon: true }) });
|
|
@@ -2650,6 +3294,7 @@ var PdfPreview_default = ({ password, fileUrl, pageNo = 1, scale = 1, isHasThumb
|
|
|
2650
3294
|
] }) }) });
|
|
2651
3295
|
};
|
|
2652
3296
|
var FilePreview_default = ({ suffix, fileUrl, pdfParams, password, searchValue, emptyProps, onSetPassword }) => {
|
|
3297
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
2653
3298
|
const Preview = React3.useMemo(() => {
|
|
2654
3299
|
if (!fileUrl) {
|
|
2655
3300
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { ...emptyProps });
|
|
@@ -2659,7 +3304,7 @@ var FilePreview_default = ({ suffix, fileUrl, pdfParams, password, searchValue,
|
|
|
2659
3304
|
case "JPG":
|
|
2660
3305
|
case "JPEG":
|
|
2661
3306
|
case "GIF":
|
|
2662
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Image, { classNames: { root: styles_module_default.nsPreviewImage }, src: fileUrl, alt: "
|
|
3307
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Image, { classNames: { root: styles_module_default.nsPreviewImage }, src: fileUrl, alt: t2("filePreview.previewImageAlt") });
|
|
2663
3308
|
case "PDF":
|
|
2664
3309
|
return /* @__PURE__ */ jsxRuntime.jsx(PdfPreview_default, { fileUrl, ...pdfParams, password, onSetPassword });
|
|
2665
3310
|
case "PDF_IMG":
|
|
@@ -2679,11 +3324,25 @@ var FilePreview_default = ({ suffix, fileUrl, pdfParams, password, searchValue,
|
|
|
2679
3324
|
case "DOCX":
|
|
2680
3325
|
return /* @__PURE__ */ jsxRuntime.jsx(DocxPreview_default, { fileUrl });
|
|
2681
3326
|
default:
|
|
2682
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Result, { subTitle:
|
|
3327
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Result, { subTitle: t2("filePreview.previewNotSupported", { suffix: suffix || "" }) });
|
|
2683
3328
|
}
|
|
2684
3329
|
}, [suffix, fileUrl, pdfParams]);
|
|
2685
3330
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "center", align: "center", className: "height-full", children: Preview });
|
|
2686
3331
|
};
|
|
3332
|
+
var FilePreviewDrawer_default = ({ open, title, onClose, ...props }) => {
|
|
3333
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
3334
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3335
|
+
antd.Drawer,
|
|
3336
|
+
{
|
|
3337
|
+
title: title || t2("filePreview.title"),
|
|
3338
|
+
push: false,
|
|
3339
|
+
size: "100%",
|
|
3340
|
+
open,
|
|
3341
|
+
onClose,
|
|
3342
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(FilePreview_default, { ...props })
|
|
3343
|
+
}
|
|
3344
|
+
);
|
|
3345
|
+
};
|
|
2687
3346
|
Editor.loader.config({ monaco: monaco__namespace });
|
|
2688
3347
|
var getLanguage = (suffix) => {
|
|
2689
3348
|
switch (suffix.toLowerCase()) {
|
|
@@ -2723,6 +3382,7 @@ var getLanguage = (suffix) => {
|
|
|
2723
3382
|
}
|
|
2724
3383
|
};
|
|
2725
3384
|
var CodePreview = ({ fileUrl, suffix }) => {
|
|
3385
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
2726
3386
|
const [content, setContent] = React3.useState("");
|
|
2727
3387
|
const [error, setError] = React3.useState("");
|
|
2728
3388
|
const [loading, setLoading] = React3.useState(false);
|
|
@@ -2732,7 +3392,7 @@ var CodePreview = ({ fileUrl, suffix }) => {
|
|
|
2732
3392
|
};
|
|
2733
3393
|
const res = await fetch(fileUrl, { headers, signal });
|
|
2734
3394
|
if (res.status !== 200) {
|
|
2735
|
-
throw new Error(
|
|
3395
|
+
throw new Error(t2("filePreview.requestFailedWithStatus", { status: res.status }));
|
|
2736
3396
|
}
|
|
2737
3397
|
const buffer = await res.arrayBuffer();
|
|
2738
3398
|
let text = "";
|
|
@@ -2756,7 +3416,7 @@ var CodePreview = ({ fileUrl, suffix }) => {
|
|
|
2756
3416
|
await fetchContent(controller.signal);
|
|
2757
3417
|
} catch (error2) {
|
|
2758
3418
|
if (!controller.signal.aborted) {
|
|
2759
|
-
setError("
|
|
3419
|
+
setError(t2("filePreview.loadFileFailed"));
|
|
2760
3420
|
}
|
|
2761
3421
|
} finally {
|
|
2762
3422
|
if (!controller.signal.aborted) {
|
|
@@ -2796,7 +3456,7 @@ var CodePreview = ({ fileUrl, suffix }) => {
|
|
|
2796
3456
|
var CodePreview_default = CodePreview;
|
|
2797
3457
|
var { Text } = antd.Typography;
|
|
2798
3458
|
pdfjsLib__namespace.GlobalWorkerOptions.workerSrc = "https://unpkg.com/pdfjs-dist@5.4.296/legacy/build/pdf.worker.min.mjs";
|
|
2799
|
-
var MIN_SCALE = 0.
|
|
3459
|
+
var MIN_SCALE = 0.1;
|
|
2800
3460
|
var MAX_SCALE = 1.5;
|
|
2801
3461
|
var SCALE_STEP = 0.1;
|
|
2802
3462
|
var PdfPage = React3__namespace.default.memo(({ pdf, pageNumber, scale, scrollContainerRef, defaultSize }) => {
|
|
@@ -2906,6 +3566,7 @@ var PdfPage = React3__namespace.default.memo(({ pdf, pageNumber, scale, scrollCo
|
|
|
2906
3566
|
);
|
|
2907
3567
|
});
|
|
2908
3568
|
var DocumentPreview = ({ fileUrl, previewEnabled = true }) => {
|
|
3569
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
2909
3570
|
const [loading, setLoading] = React3.useState(false);
|
|
2910
3571
|
const [pdf, setPdf] = React3.useState(null);
|
|
2911
3572
|
const [numPages, setNumPages] = React3.useState(0);
|
|
@@ -2965,9 +3626,9 @@ var DocumentPreview = ({ fileUrl, previewEnabled = true }) => {
|
|
|
2965
3626
|
if (aborted) return;
|
|
2966
3627
|
const message3 = e?.message;
|
|
2967
3628
|
if (typeof message3 === "string" && message3.includes("cancelled")) ; else if (typeof message3 === "string" && message3.includes("(903)")) {
|
|
2968
|
-
setError("
|
|
3629
|
+
setError(t2("filePreview.previewGenerating"));
|
|
2969
3630
|
} else {
|
|
2970
|
-
setError(message3 || "
|
|
3631
|
+
setError(message3 || t2("filePreview.pdfLoadFailed"));
|
|
2971
3632
|
}
|
|
2972
3633
|
} finally {
|
|
2973
3634
|
if (!aborted) {
|
|
@@ -3072,7 +3733,7 @@ var DocumentPreview = ({ fileUrl, previewEnabled = true }) => {
|
|
|
3072
3733
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusOutlined, {}), size: "small", onClick: onZoomIn, disabled: scale >= MAX_SCALE })
|
|
3073
3734
|
] });
|
|
3074
3735
|
if (!previewEnabled) {
|
|
3075
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { className: styles_module_default.stateBody, children: "
|
|
3736
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { className: styles_module_default.stateBody, children: t2("filePreview.closePreview") });
|
|
3076
3737
|
}
|
|
3077
3738
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_module_default.pdfContainer, children: [
|
|
3078
3739
|
toolbar,
|
|
@@ -3081,6 +3742,7 @@ var DocumentPreview = ({ fileUrl, previewEnabled = true }) => {
|
|
|
3081
3742
|
};
|
|
3082
3743
|
var DocumentPreview_default = DocumentPreview;
|
|
3083
3744
|
var HtmlPreview = ({ fileUrl }) => {
|
|
3745
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
3084
3746
|
const [content, setContent] = React3.useState("");
|
|
3085
3747
|
const [error, setError] = React3.useState("");
|
|
3086
3748
|
const [loading, setLoading] = React3.useState(false);
|
|
@@ -3093,7 +3755,7 @@ var HtmlPreview = ({ fileUrl }) => {
|
|
|
3093
3755
|
signal
|
|
3094
3756
|
});
|
|
3095
3757
|
if (res.status !== 200) {
|
|
3096
|
-
throw new Error(
|
|
3758
|
+
throw new Error(t2("filePreview.requestFailedWithStatus", { status: res.status }));
|
|
3097
3759
|
}
|
|
3098
3760
|
const buffer = await res.arrayBuffer();
|
|
3099
3761
|
let htmlText = "";
|
|
@@ -3105,7 +3767,7 @@ var HtmlPreview = ({ fileUrl }) => {
|
|
|
3105
3767
|
htmlText = gbkDecoder.decode(buffer);
|
|
3106
3768
|
}
|
|
3107
3769
|
if (!htmlText) {
|
|
3108
|
-
throw new Error("
|
|
3770
|
+
throw new Error(t2("filePreview.emptyResponse"));
|
|
3109
3771
|
}
|
|
3110
3772
|
setContent(htmlText);
|
|
3111
3773
|
};
|
|
@@ -3120,7 +3782,7 @@ var HtmlPreview = ({ fileUrl }) => {
|
|
|
3120
3782
|
await fetchHtml(controller.signal);
|
|
3121
3783
|
} catch (error2) {
|
|
3122
3784
|
if (!controller.signal.aborted) {
|
|
3123
|
-
setError("
|
|
3785
|
+
setError(t2("filePreview.htmlParseFailed"));
|
|
3124
3786
|
}
|
|
3125
3787
|
} finally {
|
|
3126
3788
|
if (!controller.signal.aborted) {
|
|
@@ -3146,6 +3808,7 @@ var HtmlPreview = ({ fileUrl }) => {
|
|
|
3146
3808
|
};
|
|
3147
3809
|
var HtmlPreview_default = HtmlPreview;
|
|
3148
3810
|
var luyaFilePreview_default = ({ suffix, fileUrl, emptyProps, fileName }) => {
|
|
3811
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
3149
3812
|
const extension = suffix ? suffix : getFileSuffixName(fileName || "");
|
|
3150
3813
|
const Preview = React3.useMemo(() => {
|
|
3151
3814
|
if (!fileUrl) {
|
|
@@ -3161,7 +3824,7 @@ var luyaFilePreview_default = ({ suffix, fileUrl, emptyProps, fileName }) => {
|
|
|
3161
3824
|
case "SVG":
|
|
3162
3825
|
case "ICO":
|
|
3163
3826
|
case "TIFF":
|
|
3164
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Image, { classNames: { root: styles_module_default.nsPreviewImage }, src: fileUrl, alt: "
|
|
3827
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Image, { classNames: { root: styles_module_default.nsPreviewImage }, src: fileUrl, alt: t2("filePreview.previewImageAlt") });
|
|
3165
3828
|
case "DOC":
|
|
3166
3829
|
case "DOCX":
|
|
3167
3830
|
case "PDF":
|
|
@@ -3206,30 +3869,18 @@ var luyaFilePreview_default = ({ suffix, fileUrl, emptyProps, fileName }) => {
|
|
|
3206
3869
|
case "TXT":
|
|
3207
3870
|
return /* @__PURE__ */ jsxRuntime.jsx(MarkdownPreview_default, { fileUrl, asPlainText: true });
|
|
3208
3871
|
default:
|
|
3209
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Result, { subTitle:
|
|
3872
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Result, { subTitle: t2("filePreview.previewNotSupportedDownload", { suffix: suffix || "" }) });
|
|
3210
3873
|
}
|
|
3211
3874
|
}, [suffix, fileUrl, fileName]);
|
|
3212
3875
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "center", align: "center", className: "height-full p-t-16 p-b-16 p-l-16", children: Preview });
|
|
3213
3876
|
};
|
|
3214
|
-
var FilePreviewDrawer_default = ({ open, title = "\u6587\u4EF6\u9884\u89C8", onClose, ...props }) => {
|
|
3215
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3216
|
-
antd.Drawer,
|
|
3217
|
-
{
|
|
3218
|
-
title,
|
|
3219
|
-
push: false,
|
|
3220
|
-
size: "100%",
|
|
3221
|
-
open,
|
|
3222
|
-
onClose,
|
|
3223
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(FilePreview_default, { ...props })
|
|
3224
|
-
}
|
|
3225
|
-
);
|
|
3226
|
-
};
|
|
3227
3877
|
|
|
3228
3878
|
// src/components/MicroApp/styles.module.less
|
|
3229
3879
|
var styles_module_default3 = {
|
|
3230
3880
|
microApp: "styles_module_microApp"
|
|
3231
3881
|
};
|
|
3232
3882
|
var MicroApp_default = ({ name, url, className, onMounted, onError, data, ...rest }) => {
|
|
3883
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
3233
3884
|
const [loading, setLoading] = React3.useState(false);
|
|
3234
3885
|
React3.useEffect(() => {
|
|
3235
3886
|
setLoading(true);
|
|
@@ -3244,10 +3895,10 @@ var MicroApp_default = ({ name, url, className, onMounted, onError, data, ...res
|
|
|
3244
3895
|
};
|
|
3245
3896
|
const microAppData = React3.useMemo(() => {
|
|
3246
3897
|
const parentMainSource = window?.microApp?.getData?.()?.mainSource || [];
|
|
3247
|
-
return { mainSource: [...parentMainSource, name], ...data };
|
|
3898
|
+
return { [LANG_KEY]: getLang(), mainSource: [...parentMainSource, name], ...data };
|
|
3248
3899
|
}, [data, name]);
|
|
3249
3900
|
const TagName = microApp__default.default.tagName || "micro-app";
|
|
3250
|
-
return /* @__PURE__ */ jsxCustomEvent__default.default(antd.Spin, { spinning: loading, classNames: { root: "full-spin" }, description: "
|
|
3901
|
+
return /* @__PURE__ */ jsxCustomEvent__default.default(antd.Spin, { spinning: loading, classNames: { root: "full-spin" }, description: t2("microApp.loading") }, /* @__PURE__ */ jsxCustomEvent__default.default(
|
|
3251
3902
|
TagName,
|
|
3252
3903
|
{
|
|
3253
3904
|
name,
|
|
@@ -3336,10 +3987,12 @@ var styles_module_default4 = {
|
|
|
3336
3987
|
iframe: "styles_module_iframe"
|
|
3337
3988
|
};
|
|
3338
3989
|
var Iframe_default = React3.forwardRef(({ defaultMainSource, id, src, className, onLoad }, ref) => {
|
|
3990
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
3339
3991
|
const [loading, setLoading] = React3.useState(false);
|
|
3340
3992
|
const finalSrc = React3.useMemo(() => {
|
|
3341
|
-
|
|
3342
|
-
|
|
3993
|
+
const baseUrl = addUrlLastSlash(setUrlMainSource(src, location.href, defaultMainSource));
|
|
3994
|
+
return buildUrlParams({ v: Date.now(), [LANG_KEY]: getLang() }, baseUrl);
|
|
3995
|
+
}, [src, defaultMainSource]);
|
|
3343
3996
|
const onHandleLoad = () => {
|
|
3344
3997
|
setLoading(false);
|
|
3345
3998
|
onLoad?.();
|
|
@@ -3347,7 +4000,7 @@ var Iframe_default = React3.forwardRef(({ defaultMainSource, id, src, className,
|
|
|
3347
4000
|
React3.useEffect(() => {
|
|
3348
4001
|
setLoading(true);
|
|
3349
4002
|
}, [src]);
|
|
3350
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: loading, classNames: { root: "full-spin" }, description: "
|
|
4003
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: loading, classNames: { root: "full-spin" }, description: t2("iframe.loading"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3351
4004
|
"iframe",
|
|
3352
4005
|
{
|
|
3353
4006
|
id,
|
|
@@ -4027,24 +4680,37 @@ function useIsBreakpoint(mode = "max", breakpoint = 768) {
|
|
|
4027
4680
|
}
|
|
4028
4681
|
var { TextArea } = antd.Input;
|
|
4029
4682
|
var AnnotationModal_default = ({ visible, onCancel, onConfirm }) => {
|
|
4683
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
4030
4684
|
const [form] = antd.Form.useForm();
|
|
4031
4685
|
const handleOk = async () => {
|
|
4032
4686
|
const values = await form.validateFields();
|
|
4033
4687
|
onConfirm(values.content.trim());
|
|
4034
4688
|
onCancel();
|
|
4035
4689
|
};
|
|
4036
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4037
|
-
antd.
|
|
4690
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4691
|
+
antd.Modal,
|
|
4038
4692
|
{
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4693
|
+
title: t2("markdownEditor.annotation.add"),
|
|
4694
|
+
open: visible,
|
|
4695
|
+
onOk: handleOk,
|
|
4696
|
+
onCancel,
|
|
4697
|
+
destroyOnHidden: true,
|
|
4698
|
+
okText: t2("common.confirm"),
|
|
4699
|
+
cancelText: t2("common.cancel"),
|
|
4700
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Form, { form, layout: "vertical", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4701
|
+
antd.Form.Item,
|
|
4702
|
+
{
|
|
4703
|
+
name: "content",
|
|
4704
|
+
label: t2("markdownEditor.annotation.content"),
|
|
4705
|
+
rules: [
|
|
4706
|
+
{ whitespace: true, required: true, message: t2("markdownEditor.annotation.required") },
|
|
4707
|
+
{ max: 500, message: t2("markdownEditor.annotation.maxLength") }
|
|
4708
|
+
],
|
|
4709
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(TextArea, { rows: 4, placeholder: t2("markdownEditor.annotation.placeholder"), showCount: true, maxLength: 500 })
|
|
4710
|
+
}
|
|
4711
|
+
) })
|
|
4046
4712
|
}
|
|
4047
|
-
)
|
|
4713
|
+
);
|
|
4048
4714
|
};
|
|
4049
4715
|
|
|
4050
4716
|
// src/components/MarkdownEditor/annotation/constant.ts
|
|
@@ -4069,6 +4735,7 @@ var AnnotationSidebar_default = ({
|
|
|
4069
4735
|
annotationConfig,
|
|
4070
4736
|
onClose
|
|
4071
4737
|
}) => {
|
|
4738
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
4072
4739
|
const [form] = antd.Form.useForm();
|
|
4073
4740
|
const [editingId, setEditingId] = React3.useState();
|
|
4074
4741
|
const itemRefs = React3.useRef({});
|
|
@@ -4105,7 +4772,7 @@ var AnnotationSidebar_default = ({
|
|
|
4105
4772
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
|
|
4106
4773
|
/* @__PURE__ */ jsxRuntime.jsx(icons.MessageOutlined, {}),
|
|
4107
4774
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
4108
|
-
"
|
|
4775
|
+
t2("markdownEditor.annotation.title"),
|
|
4109
4776
|
annotations.length > 0 && `\uFF08${annotations.length}\uFF09`
|
|
4110
4777
|
] })
|
|
4111
4778
|
] }),
|
|
@@ -4140,15 +4807,15 @@ var AnnotationSidebar_default = ({
|
|
|
4140
4807
|
{
|
|
4141
4808
|
name: "content",
|
|
4142
4809
|
rules: [
|
|
4143
|
-
{ whitespace: true, required: true, message: "
|
|
4144
|
-
{ max: 500, message: "
|
|
4810
|
+
{ whitespace: true, required: true, message: t2("markdownEditor.annotation.required") },
|
|
4811
|
+
{ max: 500, message: t2("markdownEditor.annotation.maxLength") }
|
|
4145
4812
|
],
|
|
4146
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(TextArea2, { autoFocus: true, rows: 2, placeholder: "
|
|
4813
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(TextArea2, { autoFocus: true, rows: 2, placeholder: t2("markdownEditor.annotation.placeholder"), showCount: true, maxLength: 500 })
|
|
4147
4814
|
}
|
|
4148
4815
|
) }),
|
|
4149
4816
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
|
|
4150
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", type: "primary", onClick: handleSaveEdit, children: "
|
|
4151
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", onClick: handleCancelEdit, children: "
|
|
4817
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", type: "primary", onClick: handleSaveEdit, children: t2("common.save") }),
|
|
4818
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", onClick: handleCancelEdit, children: t2("common.cancel") })
|
|
4152
4819
|
] })
|
|
4153
4820
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, vertical: true, children: [
|
|
4154
4821
|
/* @__PURE__ */ jsxRuntime.jsx(Text2, { children: annotation.content }),
|
|
@@ -4158,7 +4825,7 @@ var AnnotationSidebar_default = ({
|
|
|
4158
4825
|
{
|
|
4159
4826
|
type: "text",
|
|
4160
4827
|
size: "small",
|
|
4161
|
-
title: "
|
|
4828
|
+
title: t2("markdownEditor.annotation.edit"),
|
|
4162
4829
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.EditOutlined, {}),
|
|
4163
4830
|
onClick: (e) => {
|
|
4164
4831
|
handleEdit(annotation);
|
|
@@ -4168,12 +4835,12 @@ var AnnotationSidebar_default = ({
|
|
|
4168
4835
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4169
4836
|
antd.Popconfirm,
|
|
4170
4837
|
{
|
|
4171
|
-
title: "
|
|
4172
|
-
okText: "
|
|
4173
|
-
cancelText: "
|
|
4174
|
-
description: "
|
|
4838
|
+
title: t2("common.defaultTitle"),
|
|
4839
|
+
okText: t2("common.confirm"),
|
|
4840
|
+
cancelText: t2("common.cancel"),
|
|
4841
|
+
description: t2("markdownEditor.annotation.confirmDelete"),
|
|
4175
4842
|
onConfirm: () => onDeleteAnnotation(annotation[ANNOTATION_ATTRS[0]]),
|
|
4176
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", size: "small", title: "
|
|
4843
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", size: "small", title: t2("markdownEditor.annotation.delete"), icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DeleteOutlined, {}) })
|
|
4177
4844
|
}
|
|
4178
4845
|
)
|
|
4179
4846
|
] })
|
|
@@ -4182,7 +4849,7 @@ var AnnotationSidebar_default = ({
|
|
|
4182
4849
|
}
|
|
4183
4850
|
)
|
|
4184
4851
|
}
|
|
4185
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, justify: "center", align: "center", className: "height-full", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: "
|
|
4852
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, justify: "center", align: "center", className: "height-full", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: t2("markdownEditor.annotation.empty") }) })
|
|
4186
4853
|
}
|
|
4187
4854
|
);
|
|
4188
4855
|
const container = annotationConfig?.getContainer?.();
|
|
@@ -4467,7 +5134,7 @@ var useAnnotations = (annotationConfig) => {
|
|
|
4467
5134
|
const id = genNonDuplicateID();
|
|
4468
5135
|
editor.current.chain().focus().setMark(ANNOTATION_KEY, {
|
|
4469
5136
|
"annotation-id": id,
|
|
4470
|
-
"user-name": annotationConfig?.user?.name || "
|
|
5137
|
+
"user-name": annotationConfig?.user?.name || t("markdownEditor.unknown"),
|
|
4471
5138
|
"user-id": annotationConfig?.user.id || "0000",
|
|
4472
5139
|
"update-time": getTimestamp(),
|
|
4473
5140
|
content
|
|
@@ -4749,6 +5416,7 @@ var collectionSidebar_default = ({
|
|
|
4749
5416
|
collectionConfig,
|
|
4750
5417
|
onClose
|
|
4751
5418
|
}) => {
|
|
5419
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
4752
5420
|
const itemRefs = React3.useRef({});
|
|
4753
5421
|
React3.useEffect(() => {
|
|
4754
5422
|
if (selectedCollectionId) {
|
|
@@ -4770,7 +5438,7 @@ var collectionSidebar_default = ({
|
|
|
4770
5438
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
|
|
4771
5439
|
/* @__PURE__ */ jsxRuntime.jsx(icons.BookOutlined, {}),
|
|
4772
5440
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
4773
|
-
"
|
|
5441
|
+
t2("markdownEditor.collection.title"),
|
|
4774
5442
|
collections.length > 0 && `\uFF08${collections.length}\uFF09`
|
|
4775
5443
|
] })
|
|
4776
5444
|
] }),
|
|
@@ -4813,12 +5481,12 @@ var collectionSidebar_default = ({
|
|
|
4813
5481
|
!disabled && selectedCollectionId === collection[COLLECTION_ATTRS[0]] && /* @__PURE__ */ jsxRuntime.jsx(antd.Space, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4814
5482
|
antd.Popconfirm,
|
|
4815
5483
|
{
|
|
4816
|
-
title: "
|
|
4817
|
-
okText: "
|
|
4818
|
-
cancelText: "
|
|
4819
|
-
description: "
|
|
5484
|
+
title: t2("common.defaultTitle"),
|
|
5485
|
+
okText: t2("common.confirm"),
|
|
5486
|
+
cancelText: t2("common.cancel"),
|
|
5487
|
+
description: t2("markdownEditor.collection.confirmDelete"),
|
|
4820
5488
|
onConfirm: () => onDeleteCollection(collection[COLLECTION_ATTRS[0]]),
|
|
4821
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", size: "small", title: "
|
|
5489
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", size: "small", title: t2("markdownEditor.collection.delete"), icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DeleteOutlined, {}) })
|
|
4822
5490
|
}
|
|
4823
5491
|
) })
|
|
4824
5492
|
] })
|
|
@@ -4827,7 +5495,7 @@ var collectionSidebar_default = ({
|
|
|
4827
5495
|
);
|
|
4828
5496
|
}
|
|
4829
5497
|
}
|
|
4830
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, justify: "center", align: "center", className: "height-full", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: "
|
|
5498
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, justify: "center", align: "center", className: "height-full", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: t2("markdownEditor.collection.empty") }) })
|
|
4831
5499
|
}
|
|
4832
5500
|
);
|
|
4833
5501
|
const container = collectionConfig?.getContainer?.();
|
|
@@ -4868,7 +5536,7 @@ var useCollections = (collectionConfig) => {
|
|
|
4868
5536
|
}
|
|
4869
5537
|
editor.current.chain().focus().setMark(COLLECTION_KEY, {
|
|
4870
5538
|
"collection-id": remoteId,
|
|
4871
|
-
"user-name": collectionConfig?.user?.name || "
|
|
5539
|
+
"user-name": collectionConfig?.user?.name || t("markdownEditor.unknown"),
|
|
4872
5540
|
"user-id": collectionConfig?.user.id || "0000",
|
|
4873
5541
|
"update-time": getTimestamp(),
|
|
4874
5542
|
"page-no": pageIndex
|
|
@@ -5417,6 +6085,7 @@ var BlockquoteButton = React3.forwardRef(
|
|
|
5417
6085
|
hideWhenUnavailable,
|
|
5418
6086
|
onToggled
|
|
5419
6087
|
});
|
|
6088
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
5420
6089
|
const handleClick = React3.useCallback(
|
|
5421
6090
|
(event) => {
|
|
5422
6091
|
onClick?.(event);
|
|
@@ -5440,7 +6109,7 @@ var BlockquoteButton = React3.forwardRef(
|
|
|
5440
6109
|
"data-disabled": !canToggle3,
|
|
5441
6110
|
"aria-label": label,
|
|
5442
6111
|
"aria-pressed": isActive,
|
|
5443
|
-
tooltip: "
|
|
6112
|
+
tooltip: t2("markdownEditor.toolbar.blockquote"),
|
|
5444
6113
|
onClick: handleClick,
|
|
5445
6114
|
...buttonProps,
|
|
5446
6115
|
ref,
|
|
@@ -5608,7 +6277,7 @@ function useBlockquote(config) {
|
|
|
5608
6277
|
isActive,
|
|
5609
6278
|
handleToggle,
|
|
5610
6279
|
canToggle: canToggle3,
|
|
5611
|
-
label: "
|
|
6280
|
+
label: t("markdownEditor.toolbar.blockquote"),
|
|
5612
6281
|
shortcutKeys: BLOCKQUOTE_SHORTCUT_KEY,
|
|
5613
6282
|
Icon: BlockquoteIcon
|
|
5614
6283
|
};
|
|
@@ -5643,6 +6312,7 @@ var CodeBlockButton = React3.forwardRef(
|
|
|
5643
6312
|
hideWhenUnavailable,
|
|
5644
6313
|
onToggled
|
|
5645
6314
|
});
|
|
6315
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
5646
6316
|
const handleClick = React3.useCallback(
|
|
5647
6317
|
(event) => {
|
|
5648
6318
|
onClick?.(event);
|
|
@@ -5666,7 +6336,7 @@ var CodeBlockButton = React3.forwardRef(
|
|
|
5666
6336
|
tabIndex: -1,
|
|
5667
6337
|
"aria-label": label,
|
|
5668
6338
|
"aria-pressed": isActive,
|
|
5669
|
-
tooltip: "
|
|
6339
|
+
tooltip: t2("markdownEditor.toolbar.codeBlock"),
|
|
5670
6340
|
onClick: handleClick,
|
|
5671
6341
|
...buttonProps,
|
|
5672
6342
|
ref,
|
|
@@ -5825,7 +6495,7 @@ function useCodeBlock(config) {
|
|
|
5825
6495
|
isActive,
|
|
5826
6496
|
handleToggle,
|
|
5827
6497
|
canToggle: canToggleState,
|
|
5828
|
-
label: "
|
|
6498
|
+
label: t("markdownEditor.toolbar.codeBlock"),
|
|
5829
6499
|
shortcutKeys: CODE_BLOCK_SHORTCUT_KEY,
|
|
5830
6500
|
Icon: CodeBlockIcon
|
|
5831
6501
|
};
|
|
@@ -5986,6 +6656,7 @@ var ColorHighlightButton = React3.forwardRef(
|
|
|
5986
6656
|
style,
|
|
5987
6657
|
...buttonProps
|
|
5988
6658
|
}, ref) => {
|
|
6659
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
5989
6660
|
const { editor } = useTiptapEditor(providedEditor);
|
|
5990
6661
|
const {
|
|
5991
6662
|
isVisible,
|
|
@@ -5997,7 +6668,7 @@ var ColorHighlightButton = React3.forwardRef(
|
|
|
5997
6668
|
} = useColorHighlight({
|
|
5998
6669
|
editor,
|
|
5999
6670
|
highlightColor,
|
|
6000
|
-
label: text ||
|
|
6671
|
+
label: text || t2("markdownEditor.highlight.toggle", { color: highlightColor }),
|
|
6001
6672
|
hideWhenUnavailable,
|
|
6002
6673
|
mode,
|
|
6003
6674
|
onApplied
|
|
@@ -6056,52 +6727,52 @@ ColorHighlightButton.displayName = "ColorHighlightButton";
|
|
|
6056
6727
|
var COLOR_HIGHLIGHT_SHORTCUT_KEY = "mod+shift+h";
|
|
6057
6728
|
var HIGHLIGHT_COLORS = [
|
|
6058
6729
|
{
|
|
6059
|
-
|
|
6730
|
+
labelKey: "markdownEditor.highlight.default",
|
|
6060
6731
|
value: "var(--tt-bg-color)",
|
|
6061
6732
|
border: "var(--tt-bg-color-contrast)"
|
|
6062
6733
|
},
|
|
6063
6734
|
{
|
|
6064
|
-
|
|
6735
|
+
labelKey: "markdownEditor.highlight.gray",
|
|
6065
6736
|
value: "var(--tt-color-highlight-gray)",
|
|
6066
6737
|
border: "var(--tt-color-highlight-gray-contrast)"
|
|
6067
6738
|
},
|
|
6068
6739
|
{
|
|
6069
|
-
|
|
6740
|
+
labelKey: "markdownEditor.highlight.brown",
|
|
6070
6741
|
value: "var(--tt-color-highlight-brown)",
|
|
6071
6742
|
border: "var(--tt-color-highlight-brown-contrast)"
|
|
6072
6743
|
},
|
|
6073
6744
|
{
|
|
6074
|
-
|
|
6745
|
+
labelKey: "markdownEditor.highlight.orange",
|
|
6075
6746
|
value: "var(--tt-color-highlight-orange)",
|
|
6076
6747
|
border: "var(--tt-color-highlight-orange-contrast)"
|
|
6077
6748
|
},
|
|
6078
6749
|
{
|
|
6079
|
-
|
|
6750
|
+
labelKey: "markdownEditor.highlight.yellow",
|
|
6080
6751
|
value: "var(--tt-color-highlight-yellow)",
|
|
6081
6752
|
border: "var(--tt-color-highlight-yellow-contrast)"
|
|
6082
6753
|
},
|
|
6083
6754
|
{
|
|
6084
|
-
|
|
6755
|
+
labelKey: "markdownEditor.highlight.green",
|
|
6085
6756
|
value: "var(--tt-color-highlight-green)",
|
|
6086
6757
|
border: "var(--tt-color-highlight-green-contrast)"
|
|
6087
6758
|
},
|
|
6088
6759
|
{
|
|
6089
|
-
|
|
6760
|
+
labelKey: "markdownEditor.highlight.blue",
|
|
6090
6761
|
value: "var(--tt-color-highlight-blue)",
|
|
6091
6762
|
border: "var(--tt-color-highlight-blue-contrast)"
|
|
6092
6763
|
},
|
|
6093
6764
|
{
|
|
6094
|
-
|
|
6765
|
+
labelKey: "markdownEditor.highlight.purple",
|
|
6095
6766
|
value: "var(--tt-color-highlight-purple)",
|
|
6096
6767
|
border: "var(--tt-color-highlight-purple-contrast)"
|
|
6097
6768
|
},
|
|
6098
6769
|
{
|
|
6099
|
-
|
|
6770
|
+
labelKey: "markdownEditor.highlight.pink",
|
|
6100
6771
|
value: "var(--tt-color-highlight-pink)",
|
|
6101
6772
|
border: "var(--tt-color-highlight-pink-contrast)"
|
|
6102
6773
|
},
|
|
6103
6774
|
{
|
|
6104
|
-
|
|
6775
|
+
labelKey: "markdownEditor.highlight.red",
|
|
6105
6776
|
value: "var(--tt-color-highlight-red)",
|
|
6106
6777
|
border: "var(--tt-color-highlight-red-contrast)"
|
|
6107
6778
|
}
|
|
@@ -6227,7 +6898,7 @@ function useColorHighlight(config) {
|
|
|
6227
6898
|
const handleRemoveHighlight = React3.useCallback(() => {
|
|
6228
6899
|
const success = removeHighlight(editor, mode);
|
|
6229
6900
|
if (success) {
|
|
6230
|
-
onApplied?.({ color: "", label: "
|
|
6901
|
+
onApplied?.({ color: "", label: t("markdownEditor.highlight.removeBackground"), mode });
|
|
6231
6902
|
}
|
|
6232
6903
|
return success;
|
|
6233
6904
|
}, [editor, onApplied, mode]);
|
|
@@ -6249,28 +6920,31 @@ function useColorHighlight(config) {
|
|
|
6249
6920
|
handleColorHighlight,
|
|
6250
6921
|
handleRemoveHighlight,
|
|
6251
6922
|
canColorHighlight: canColorHighlightState,
|
|
6252
|
-
label: label ||
|
|
6923
|
+
label: label || t("markdownEditor.highlight.label"),
|
|
6253
6924
|
shortcutKeys: COLOR_HIGHLIGHT_SHORTCUT_KEY,
|
|
6254
6925
|
Icon: HighlighterIcon,
|
|
6255
6926
|
mode
|
|
6256
6927
|
};
|
|
6257
6928
|
}
|
|
6258
|
-
var ColorHighlightPopoverButton = React3.forwardRef(({ className, children, ...props }, ref) =>
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
)
|
|
6929
|
+
var ColorHighlightPopoverButton = React3.forwardRef(({ className, children, ...props }, ref) => {
|
|
6930
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
6931
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6932
|
+
Button7,
|
|
6933
|
+
{
|
|
6934
|
+
type: "button",
|
|
6935
|
+
className,
|
|
6936
|
+
"data-style": "ghost",
|
|
6937
|
+
"data-appearance": "default",
|
|
6938
|
+
role: "button",
|
|
6939
|
+
tabIndex: -1,
|
|
6940
|
+
"aria-label": t2("markdownEditor.highlight.textLabel"),
|
|
6941
|
+
tooltip: t2("markdownEditor.highlight.label"),
|
|
6942
|
+
ref,
|
|
6943
|
+
...props,
|
|
6944
|
+
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(HighlighterIcon, { className: "tiptap-button-icon" })
|
|
6945
|
+
}
|
|
6946
|
+
);
|
|
6947
|
+
});
|
|
6274
6948
|
ColorHighlightPopoverButton.displayName = "ColorHighlightPopoverButton";
|
|
6275
6949
|
function ColorHighlightPopoverContent({
|
|
6276
6950
|
editor,
|
|
@@ -6285,9 +6959,10 @@ function ColorHighlightPopoverContent({
|
|
|
6285
6959
|
const { handleRemoveHighlight } = useColorHighlight({ editor });
|
|
6286
6960
|
const isMobile = useIsBreakpoint();
|
|
6287
6961
|
const containerRef = React3.useRef(null);
|
|
6962
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
6288
6963
|
const menuItems = React3.useMemo(
|
|
6289
|
-
() => [...colors, { label: "
|
|
6290
|
-
[colors]
|
|
6964
|
+
() => [...colors.map((c) => ({ ...c, label: t2(c.labelKey) })), { label: t2("markdownEditor.highlight.removeHighlight"), value: "none" }],
|
|
6965
|
+
[colors, t2]
|
|
6291
6966
|
);
|
|
6292
6967
|
const { selectedIndex } = useMenuNavigation({
|
|
6293
6968
|
containerRef,
|
|
@@ -6316,8 +6991,8 @@ function ColorHighlightPopoverContent({
|
|
|
6316
6991
|
{
|
|
6317
6992
|
editor,
|
|
6318
6993
|
highlightColor: color.value,
|
|
6319
|
-
tooltip: color.
|
|
6320
|
-
"aria-label": `${color.
|
|
6994
|
+
tooltip: t2(color.labelKey),
|
|
6995
|
+
"aria-label": `${t2(color.labelKey)} highlight color`,
|
|
6321
6996
|
tabIndex: index === selectedIndex ? 0 : -1,
|
|
6322
6997
|
"data-highlighted": selectedIndex === index
|
|
6323
6998
|
},
|
|
@@ -6328,8 +7003,8 @@ function ColorHighlightPopoverContent({
|
|
|
6328
7003
|
Button7,
|
|
6329
7004
|
{
|
|
6330
7005
|
onClick: handleRemoveHighlight,
|
|
6331
|
-
"aria-label": "
|
|
6332
|
-
tooltip: "
|
|
7006
|
+
"aria-label": t2("markdownEditor.highlight.removeBackground"),
|
|
7007
|
+
tooltip: t2("markdownEditor.highlight.removeBackground"),
|
|
6333
7008
|
tabIndex: selectedIndex === colors.length ? 0 : -1,
|
|
6334
7009
|
type: "button",
|
|
6335
7010
|
role: "menuitem",
|
|
@@ -6355,6 +7030,7 @@ function ColorHighlightPopover({
|
|
|
6355
7030
|
onApplied,
|
|
6356
7031
|
...props
|
|
6357
7032
|
}) {
|
|
7033
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
6358
7034
|
const { editor } = useTiptapEditor(providedEditor);
|
|
6359
7035
|
const [isOpen, setIsOpen] = React3.useState(false);
|
|
6360
7036
|
const { isVisible, canColorHighlight: canColorHighlight2, isActive, label, Icon } = useColorHighlight({
|
|
@@ -6377,7 +7053,7 @@ function ColorHighlightPopover({
|
|
|
6377
7053
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "tiptap-button-icon" })
|
|
6378
7054
|
}
|
|
6379
7055
|
) }),
|
|
6380
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { "aria-label": "
|
|
7056
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { "aria-label": t2("markdownEditor.highlight.label"), children: /* @__PURE__ */ jsxRuntime.jsx(ColorHighlightPopoverContent, { editor, colors }) })
|
|
6381
7057
|
] });
|
|
6382
7058
|
}
|
|
6383
7059
|
var ChevronDownIcon = React3.memo(({ className, ...props }) => {
|
|
@@ -6860,6 +7536,7 @@ var HeadingDropdownMenu = React3.forwardRef(
|
|
|
6860
7536
|
}, ref) => {
|
|
6861
7537
|
const { editor } = useTiptapEditor(providedEditor);
|
|
6862
7538
|
const [isOpen, setIsOpen] = React3.useState(false);
|
|
7539
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
6863
7540
|
const { isVisible, isActive, canToggle: canToggle3, Icon } = useHeadingDropdownMenu({
|
|
6864
7541
|
editor,
|
|
6865
7542
|
levels,
|
|
@@ -6889,7 +7566,7 @@ var HeadingDropdownMenu = React3.forwardRef(
|
|
|
6889
7566
|
"data-disabled": !canToggle3,
|
|
6890
7567
|
"aria-label": "Format text as heading",
|
|
6891
7568
|
"aria-pressed": isActive,
|
|
6892
|
-
tooltip: "
|
|
7569
|
+
tooltip: t2("markdownEditor.toolbar.heading"),
|
|
6893
7570
|
...buttonProps,
|
|
6894
7571
|
ref,
|
|
6895
7572
|
children: [
|
|
@@ -6903,10 +7580,10 @@ var HeadingDropdownMenu = React3.forwardRef(
|
|
|
6903
7580
|
{
|
|
6904
7581
|
editor,
|
|
6905
7582
|
level,
|
|
6906
|
-
text:
|
|
7583
|
+
text: t2("markdownEditor.toolbar.headingLevel", { level }),
|
|
6907
7584
|
showTooltip: false
|
|
6908
7585
|
}
|
|
6909
|
-
) },
|
|
7586
|
+
) }, level)) }) }) }) })
|
|
6910
7587
|
] });
|
|
6911
7588
|
}
|
|
6912
7589
|
);
|
|
@@ -6969,7 +7646,7 @@ function useHeadingDropdownMenu(config) {
|
|
|
6969
7646
|
isActive,
|
|
6970
7647
|
canToggle: canToggleState,
|
|
6971
7648
|
levels,
|
|
6972
|
-
label: "
|
|
7649
|
+
label: t("markdownEditor.toolbar.heading"),
|
|
6973
7650
|
Icon: activeLevel ? headingIcons[activeLevel] : HeadingIcon
|
|
6974
7651
|
};
|
|
6975
7652
|
}
|
|
@@ -7095,6 +7772,7 @@ function InputGroup({
|
|
|
7095
7772
|
}
|
|
7096
7773
|
var LinkButton = React3.forwardRef(
|
|
7097
7774
|
({ className, children, ...props }, ref) => {
|
|
7775
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
7098
7776
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7099
7777
|
Button7,
|
|
7100
7778
|
{
|
|
@@ -7103,8 +7781,8 @@ var LinkButton = React3.forwardRef(
|
|
|
7103
7781
|
"data-style": "ghost",
|
|
7104
7782
|
role: "button",
|
|
7105
7783
|
tabIndex: -1,
|
|
7106
|
-
"aria-label": "
|
|
7107
|
-
tooltip: "
|
|
7784
|
+
"aria-label": t2("markdownEditor.toolbar.link"),
|
|
7785
|
+
tooltip: t2("markdownEditor.toolbar.link"),
|
|
7108
7786
|
ref,
|
|
7109
7787
|
...props,
|
|
7110
7788
|
children: children || /* @__PURE__ */ jsxRuntime.jsx(LinkIcon, { className: "tiptap-button-icon" })
|
|
@@ -7122,6 +7800,7 @@ var LinkMain = ({
|
|
|
7122
7800
|
isActive
|
|
7123
7801
|
}) => {
|
|
7124
7802
|
const isMobile = useIsBreakpoint();
|
|
7803
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
7125
7804
|
const handleKeyDown = (event) => {
|
|
7126
7805
|
if (event.key === "Enter") {
|
|
7127
7806
|
event.preventDefault();
|
|
@@ -7145,7 +7824,7 @@ var LinkMain = ({
|
|
|
7145
7824
|
Input4,
|
|
7146
7825
|
{
|
|
7147
7826
|
type: "url",
|
|
7148
|
-
placeholder: "
|
|
7827
|
+
placeholder: t2("markdownEditor.toolbar.linkPlaceholder"),
|
|
7149
7828
|
value: url,
|
|
7150
7829
|
onChange: (e) => setUrl(e.target.value),
|
|
7151
7830
|
onKeyDown: handleKeyDown,
|
|
@@ -7160,7 +7839,7 @@ var LinkMain = ({
|
|
|
7160
7839
|
{
|
|
7161
7840
|
type: "button",
|
|
7162
7841
|
onClick: setLink,
|
|
7163
|
-
title: "
|
|
7842
|
+
title: t2("markdownEditor.toolbar.applyLink"),
|
|
7164
7843
|
disabled: !url && !isActive,
|
|
7165
7844
|
"data-style": "ghost",
|
|
7166
7845
|
children: /* @__PURE__ */ jsxRuntime.jsx(CornerDownLeftIcon, { className: "tiptap-button-icon" })
|
|
@@ -7173,7 +7852,7 @@ var LinkMain = ({
|
|
|
7173
7852
|
{
|
|
7174
7853
|
type: "button",
|
|
7175
7854
|
onClick: openLink,
|
|
7176
|
-
title: "
|
|
7855
|
+
title: t2("markdownEditor.toolbar.openInNewWindow"),
|
|
7177
7856
|
disabled: !url && !isActive,
|
|
7178
7857
|
"data-style": "ghost",
|
|
7179
7858
|
children: /* @__PURE__ */ jsxRuntime.jsx(ExternalLinkIcon, { className: "tiptap-button-icon" })
|
|
@@ -7184,7 +7863,7 @@ var LinkMain = ({
|
|
|
7184
7863
|
{
|
|
7185
7864
|
type: "button",
|
|
7186
7865
|
onClick: removeLink,
|
|
7187
|
-
title: "
|
|
7866
|
+
title: t2("markdownEditor.toolbar.removeLink"),
|
|
7188
7867
|
disabled: !url && !isActive,
|
|
7189
7868
|
"data-style": "ghost",
|
|
7190
7869
|
children: /* @__PURE__ */ jsxRuntime.jsx(TrashIcon, { className: "tiptap-button-icon" })
|
|
@@ -7698,10 +8377,10 @@ var listIcons = {
|
|
|
7698
8377
|
orderedList: ListOrderedIcon,
|
|
7699
8378
|
taskList: ListTodoIcon
|
|
7700
8379
|
};
|
|
7701
|
-
var
|
|
7702
|
-
bulletList: "
|
|
7703
|
-
orderedList: "
|
|
7704
|
-
taskList: "
|
|
8380
|
+
var listLabelKeys = {
|
|
8381
|
+
bulletList: "markdownEditor.toolbar.bulletList",
|
|
8382
|
+
orderedList: "markdownEditor.toolbar.orderedList",
|
|
8383
|
+
taskList: "markdownEditor.toolbar.taskList"
|
|
7705
8384
|
};
|
|
7706
8385
|
var LIST_SHORTCUT_KEYS = {
|
|
7707
8386
|
bulletList: "mod+shift+8",
|
|
@@ -7848,24 +8527,24 @@ function useList(config) {
|
|
|
7848
8527
|
isActive,
|
|
7849
8528
|
handleToggle,
|
|
7850
8529
|
canToggle: canToggle3,
|
|
7851
|
-
label:
|
|
8530
|
+
label: t(listLabelKeys[type]),
|
|
7852
8531
|
shortcutKeys: LIST_SHORTCUT_KEYS[type],
|
|
7853
8532
|
Icon: listIcons[type]
|
|
7854
8533
|
};
|
|
7855
8534
|
}
|
|
7856
8535
|
var listOptions = [
|
|
7857
8536
|
{
|
|
7858
|
-
|
|
8537
|
+
labelKey: "markdownEditor.toolbar.bulletList",
|
|
7859
8538
|
type: "bulletList",
|
|
7860
8539
|
icon: ListIcon
|
|
7861
8540
|
},
|
|
7862
8541
|
{
|
|
7863
|
-
|
|
8542
|
+
labelKey: "markdownEditor.toolbar.orderedList",
|
|
7864
8543
|
type: "orderedList",
|
|
7865
8544
|
icon: ListOrderedIcon
|
|
7866
8545
|
},
|
|
7867
8546
|
{
|
|
7868
|
-
|
|
8547
|
+
labelKey: "markdownEditor.toolbar.taskList",
|
|
7869
8548
|
type: "taskList",
|
|
7870
8549
|
icon: ListTodoIcon
|
|
7871
8550
|
}
|
|
@@ -7906,7 +8585,13 @@ function useListDropdownMenu(config) {
|
|
|
7906
8585
|
const { editor } = useTiptapEditor(providedEditor);
|
|
7907
8586
|
const [isVisible, setIsVisible] = React3.useState(true);
|
|
7908
8587
|
const listInSchema = types.some((type) => isNodeInSchema(type, editor));
|
|
7909
|
-
const filteredLists = React3.useMemo(
|
|
8588
|
+
const filteredLists = React3.useMemo(
|
|
8589
|
+
() => getFilteredListOptions(types).map((option) => ({
|
|
8590
|
+
...option,
|
|
8591
|
+
label: t(option.labelKey)
|
|
8592
|
+
})),
|
|
8593
|
+
[types]
|
|
8594
|
+
);
|
|
7910
8595
|
const canToggleAny = canToggleAnyList(editor, types);
|
|
7911
8596
|
const isAnyActive = isAnyListActive(editor, types);
|
|
7912
8597
|
const activeType = getActiveListType(editor, types);
|
|
@@ -7936,7 +8621,7 @@ function useListDropdownMenu(config) {
|
|
|
7936
8621
|
canToggle: canToggleAny,
|
|
7937
8622
|
types,
|
|
7938
8623
|
filteredLists,
|
|
7939
|
-
label: "
|
|
8624
|
+
label: t("markdownEditor.toolbar.list"),
|
|
7940
8625
|
Icon: activeList ? listIcons[activeList.type] : ListIcon
|
|
7941
8626
|
};
|
|
7942
8627
|
}
|
|
@@ -7950,6 +8635,7 @@ function ListDropdownMenu({
|
|
|
7950
8635
|
}) {
|
|
7951
8636
|
const { editor } = useTiptapEditor(providedEditor);
|
|
7952
8637
|
const [isOpen, setIsOpen] = React3.useState(false);
|
|
8638
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
7953
8639
|
const { filteredLists, canToggle: canToggle3, isActive, isVisible, Icon } = useListDropdownMenu({
|
|
7954
8640
|
editor,
|
|
7955
8641
|
types,
|
|
@@ -7976,8 +8662,8 @@ function ListDropdownMenu({
|
|
|
7976
8662
|
tabIndex: -1,
|
|
7977
8663
|
disabled: !canToggle3,
|
|
7978
8664
|
"data-disabled": !canToggle3,
|
|
7979
|
-
"aria-label": "
|
|
7980
|
-
tooltip: "
|
|
8665
|
+
"aria-label": t2("markdownEditor.toolbar.listOptions"),
|
|
8666
|
+
tooltip: t2("markdownEditor.toolbar.list"),
|
|
7981
8667
|
...props,
|
|
7982
8668
|
children: [
|
|
7983
8669
|
/* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "tiptap-button-icon" }),
|
|
@@ -8313,14 +8999,14 @@ var MARK_SHORTCUT_KEYS = {
|
|
|
8313
8999
|
superscript: "mod+.",
|
|
8314
9000
|
subscript: "mod+,"
|
|
8315
9001
|
};
|
|
8316
|
-
var
|
|
8317
|
-
bold: "
|
|
8318
|
-
italic: "
|
|
8319
|
-
underline: "
|
|
8320
|
-
strike: "
|
|
8321
|
-
code: "
|
|
8322
|
-
superscript: "
|
|
8323
|
-
subscript: "
|
|
9002
|
+
var MARK_ACTION_LABEL_KEYS = {
|
|
9003
|
+
bold: "markdownEditor.toolbar.bold",
|
|
9004
|
+
italic: "markdownEditor.toolbar.italic",
|
|
9005
|
+
underline: "markdownEditor.toolbar.underline",
|
|
9006
|
+
strike: "markdownEditor.toolbar.strike",
|
|
9007
|
+
code: "markdownEditor.toolbar.code",
|
|
9008
|
+
superscript: "markdownEditor.toolbar.superscript",
|
|
9009
|
+
subscript: "markdownEditor.toolbar.subscript"
|
|
8324
9010
|
};
|
|
8325
9011
|
function canToggleMark(editor, type) {
|
|
8326
9012
|
if (!editor || !editor.isEditable) return false;
|
|
@@ -8347,7 +9033,8 @@ function shouldShowButton6(props) {
|
|
|
8347
9033
|
return true;
|
|
8348
9034
|
}
|
|
8349
9035
|
function getFormattedMarkName(type) {
|
|
8350
|
-
|
|
9036
|
+
const labelKey = MARK_ACTION_LABEL_KEYS[type];
|
|
9037
|
+
return labelKey ? t(labelKey) : type.charAt(0).toUpperCase() + type.slice(1);
|
|
8351
9038
|
}
|
|
8352
9039
|
function useMark(config) {
|
|
8353
9040
|
const {
|
|
@@ -8657,11 +9344,11 @@ var textAlignIcons = {
|
|
|
8657
9344
|
right: AlignRightIcon,
|
|
8658
9345
|
justify: AlignJustifyIcon
|
|
8659
9346
|
};
|
|
8660
|
-
var
|
|
8661
|
-
left: "
|
|
8662
|
-
center: "
|
|
8663
|
-
right: "
|
|
8664
|
-
justify: "
|
|
9347
|
+
var textAlignLabelKeys = {
|
|
9348
|
+
left: "markdownEditor.toolbar.alignLeft",
|
|
9349
|
+
center: "markdownEditor.toolbar.alignCenter",
|
|
9350
|
+
right: "markdownEditor.toolbar.alignRight",
|
|
9351
|
+
justify: "markdownEditor.toolbar.alignJustify"
|
|
8665
9352
|
};
|
|
8666
9353
|
function canSetTextAlign(editor, align) {
|
|
8667
9354
|
if (!editor || !editor.isEditable) return false;
|
|
@@ -8729,7 +9416,7 @@ function useTextAlign(config) {
|
|
|
8729
9416
|
isActive,
|
|
8730
9417
|
handleTextAlign,
|
|
8731
9418
|
canAlign,
|
|
8732
|
-
label:
|
|
9419
|
+
label: t(textAlignLabelKeys[align]),
|
|
8733
9420
|
shortcutKeys: TEXT_ALIGN_SHORTCUT_KEYS[align],
|
|
8734
9421
|
Icon: textAlignIcons[align]
|
|
8735
9422
|
};
|
|
@@ -8854,9 +9541,9 @@ var UNDO_REDO_SHORTCUT_KEYS = {
|
|
|
8854
9541
|
undo: "mod+z",
|
|
8855
9542
|
redo: "mod+shift+z"
|
|
8856
9543
|
};
|
|
8857
|
-
var
|
|
8858
|
-
undo: "
|
|
8859
|
-
redo: "
|
|
9544
|
+
var historyActionLabelKeys = {
|
|
9545
|
+
undo: "markdownEditor.toolbar.undo",
|
|
9546
|
+
redo: "markdownEditor.toolbar.redo"
|
|
8860
9547
|
};
|
|
8861
9548
|
var historyIcons = {
|
|
8862
9549
|
undo: Undo2Icon,
|
|
@@ -8914,7 +9601,7 @@ function useUndoRedo(config) {
|
|
|
8914
9601
|
isVisible,
|
|
8915
9602
|
handleAction,
|
|
8916
9603
|
canExecute,
|
|
8917
|
-
label:
|
|
9604
|
+
label: t(historyActionLabelKeys[action]),
|
|
8918
9605
|
shortcutKeys: UNDO_REDO_SHORTCUT_KEYS[action],
|
|
8919
9606
|
Icon: historyIcons[action]
|
|
8920
9607
|
};
|
|
@@ -9177,6 +9864,7 @@ var MainToolbarContent = ({
|
|
|
9177
9864
|
isMobile,
|
|
9178
9865
|
isBubble
|
|
9179
9866
|
}) => {
|
|
9867
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
9180
9868
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9181
9869
|
/* @__PURE__ */ jsxRuntime.jsx(Spacer, {}),
|
|
9182
9870
|
!isBubble && tools.includes("undo-redo") && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -9186,9 +9874,9 @@ var MainToolbarContent = ({
|
|
|
9186
9874
|
] }),
|
|
9187
9875
|
/* @__PURE__ */ jsxRuntime.jsx(ToolbarSeparator, {})
|
|
9188
9876
|
] }),
|
|
9189
|
-
onQuote && /* @__PURE__ */ jsxRuntime.jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(QuoteIcon, {}), tooltip: "
|
|
9190
|
-
onCreateAnnotation && /* @__PURE__ */ jsxRuntime.jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(icons.MessageOutlined, {}), tooltip: "
|
|
9191
|
-
onCreateCollection && /* @__PURE__ */ jsxRuntime.jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(icons.BookOutlined, {}), tooltip: "
|
|
9877
|
+
onQuote && /* @__PURE__ */ jsxRuntime.jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(QuoteIcon, {}), tooltip: t2("markdownEditor.toolbar.quote"), onClick: onQuote, children: t2("markdownEditor.toolbar.quote") }) }),
|
|
9878
|
+
onCreateAnnotation && /* @__PURE__ */ jsxRuntime.jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(icons.MessageOutlined, {}), tooltip: t2("markdownEditor.toolbar.annotation"), onClick: onCreateAnnotation, children: t2("markdownEditor.toolbar.annotation") }) }),
|
|
9879
|
+
onCreateCollection && /* @__PURE__ */ jsxRuntime.jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(icons.BookOutlined, {}), tooltip: t2("markdownEditor.toolbar.excerpt"), onClick: onCreateCollection, children: t2("markdownEditor.toolbar.excerpt") }) }),
|
|
9192
9880
|
(tools.includes("heading") || tools.includes("list") || tools.includes("block")) && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9193
9881
|
/* @__PURE__ */ jsxRuntime.jsxs(ToolbarGroup, { children: [
|
|
9194
9882
|
tools.includes("heading") && /* @__PURE__ */ jsxRuntime.jsx(HeadingDropdownMenu, { levels: [1, 2, 3, 4], portal: isMobile }),
|
|
@@ -9429,9 +10117,9 @@ var SearchAndReplace = core.Extension.create({
|
|
|
9429
10117
|
addProseMirrorPlugins() {
|
|
9430
10118
|
const editor = this.editor;
|
|
9431
10119
|
const { searchResultClass, disableRegex } = this.options;
|
|
9432
|
-
const setLastSearchTerm = (
|
|
9433
|
-
const setLastCaseSensitive = (
|
|
9434
|
-
const setLastResultIndex = (
|
|
10120
|
+
const setLastSearchTerm = (t2) => editor.storage.searchAndReplace.lastSearchTerm = t2;
|
|
10121
|
+
const setLastCaseSensitive = (t2) => editor.storage.searchAndReplace.lastCaseSensitive = t2;
|
|
10122
|
+
const setLastResultIndex = (t2) => editor.storage.searchAndReplace.lastResultIndex = t2;
|
|
9435
10123
|
return [
|
|
9436
10124
|
new state.Plugin({
|
|
9437
10125
|
key: searchAndReplacePluginKey,
|
|
@@ -9532,6 +10220,7 @@ var MarkdownEditor_default = React3.forwardRef(
|
|
|
9532
10220
|
collectionConfig,
|
|
9533
10221
|
pageNoConfig
|
|
9534
10222
|
}, ref) => {
|
|
10223
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
9535
10224
|
const isMobile = useIsBreakpoint();
|
|
9536
10225
|
const lastContentRef = React3.useRef("");
|
|
9537
10226
|
const { setPageNoEditor, onPageChange } = usePageNo(pageNoConfig);
|
|
@@ -9568,7 +10257,7 @@ var MarkdownEditor_default = React3.forwardRef(
|
|
|
9568
10257
|
autocomplete: "off",
|
|
9569
10258
|
autocorrect: "off",
|
|
9570
10259
|
autocapitalize: "off",
|
|
9571
|
-
"aria-label": "
|
|
10260
|
+
"aria-label": t2("markdownEditor.mainArea")
|
|
9572
10261
|
}
|
|
9573
10262
|
},
|
|
9574
10263
|
extensions: [
|
|
@@ -9729,7 +10418,7 @@ var MarkdownEditor_default = React3.forwardRef(
|
|
|
9729
10418
|
antd.Button,
|
|
9730
10419
|
{
|
|
9731
10420
|
size: "small",
|
|
9732
|
-
title: "
|
|
10421
|
+
title: t2("markdownEditor.annotation.list"),
|
|
9733
10422
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.MessageOutlined, {}),
|
|
9734
10423
|
color: "primary",
|
|
9735
10424
|
variant: "text",
|
|
@@ -9741,15 +10430,15 @@ var MarkdownEditor_default = React3.forwardRef(
|
|
|
9741
10430
|
{
|
|
9742
10431
|
style: { gap: "2px" },
|
|
9743
10432
|
size: "small",
|
|
9744
|
-
title: "
|
|
10433
|
+
title: t2("markdownEditor.collection.list"),
|
|
9745
10434
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.BookOutlined, {}),
|
|
9746
10435
|
color: "primary",
|
|
9747
10436
|
variant: "text",
|
|
9748
10437
|
onClick: () => setShowCollection(!showCollection),
|
|
9749
|
-
children: "
|
|
10438
|
+
children: t2("markdownEditor.collection.title")
|
|
9750
10439
|
}
|
|
9751
10440
|
),
|
|
9752
|
-
onDownloadFile && /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", color: "primary", variant: "text", onClick: downloadFile2, children: "
|
|
10441
|
+
onDownloadFile && /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", color: "primary", variant: "text", onClick: downloadFile2, children: t2("common.download") }),
|
|
9753
10442
|
extraNav
|
|
9754
10443
|
] })
|
|
9755
10444
|
] }),
|
|
@@ -9922,6 +10611,7 @@ exports.FilePreview = FilePreview_default;
|
|
|
9922
10611
|
exports.FilePreviewDrawer = FilePreviewDrawer_default;
|
|
9923
10612
|
exports.HttpStatus = HttpStatus;
|
|
9924
10613
|
exports.Iframe = Iframe_default;
|
|
10614
|
+
exports.LANG_KEY = LANG_KEY;
|
|
9925
10615
|
exports.LazyComponent = LazyComponent_default;
|
|
9926
10616
|
exports.LuyaFilePreview = luyaFilePreview_default;
|
|
9927
10617
|
exports.MarkDrawing = MarkDrawing_default;
|
|
@@ -9931,6 +10621,7 @@ exports.MicroApp = MicroApp_default;
|
|
|
9931
10621
|
exports.MicroAppDrawer = Drawer_default;
|
|
9932
10622
|
exports.MicroAppWindow = Window_default;
|
|
9933
10623
|
exports.MultiEmailValidator = MultiEmailValidator;
|
|
10624
|
+
exports.NS_COMMON = NS_COMMON;
|
|
9934
10625
|
exports.PdfImagePreview = PdfImagePreview_default;
|
|
9935
10626
|
exports.PdfPreview = PdfPreview_default;
|
|
9936
10627
|
exports.PhoneOrMobileValidator = PhoneOrMobileValidator;
|
|
@@ -9952,6 +10643,7 @@ exports.ThanNumValidator = ThanNumValidator;
|
|
|
9952
10643
|
exports.UserAvatar = UserAvatar_default;
|
|
9953
10644
|
exports.VideoPlayer = VideoPlayer_default;
|
|
9954
10645
|
exports.absVal = absVal;
|
|
10646
|
+
exports.addBundledResource = addBundledResource;
|
|
9955
10647
|
exports.addUrlLastSlash = addUrlLastSlash;
|
|
9956
10648
|
exports.aesDecrypt = aesDecrypt;
|
|
9957
10649
|
exports.aesEncrypt = aesEncrypt;
|
|
@@ -9959,6 +10651,9 @@ exports.arrToObj = arrToObj;
|
|
|
9959
10651
|
exports.buildUrlParams = buildUrlParams;
|
|
9960
10652
|
exports.cachedMessage = cachedMessage;
|
|
9961
10653
|
exports.calculate = calculate;
|
|
10654
|
+
exports.commonEnUS = commonEnUS;
|
|
10655
|
+
exports.commonJaJP = commonJaJP;
|
|
10656
|
+
exports.commonZhCN = commonZhCN;
|
|
9962
10657
|
exports.compareNum = compareNum;
|
|
9963
10658
|
exports.convertCurrency = convertCurrency;
|
|
9964
10659
|
exports.convertNewlineToBr = convertNewlineToBr;
|
|
@@ -9986,6 +10681,8 @@ exports.getDeviceId = getDeviceId;
|
|
|
9986
10681
|
exports.getEndOfTimestamp = getEndOfTimestamp;
|
|
9987
10682
|
exports.getFileName = getFileName;
|
|
9988
10683
|
exports.getFileSuffixName = getFileSuffixName;
|
|
10684
|
+
exports.getI18n = getI18n;
|
|
10685
|
+
exports.getLang = getLang;
|
|
9989
10686
|
exports.getRowSpanCount = getRowSpanCount;
|
|
9990
10687
|
exports.getStartOfTimestamp = getStartOfTimestamp;
|
|
9991
10688
|
exports.getTimestamp = getTimestamp;
|
|
@@ -9993,6 +10690,7 @@ exports.getWebSocketUrl = getWebSocketUrl;
|
|
|
9993
10690
|
exports.htmlToMarkdown = htmlToMarkdown;
|
|
9994
10691
|
exports.htmlToText = htmlToText;
|
|
9995
10692
|
exports.importThirdPartyFile = importThirdPartyFile;
|
|
10693
|
+
exports.initI18n = initI18n;
|
|
9996
10694
|
exports.is = is;
|
|
9997
10695
|
exports.isArray = isArray;
|
|
9998
10696
|
exports.isBlob = isBlob;
|
|
@@ -10034,6 +10732,8 @@ exports.safeParseJson = safeParseJson;
|
|
|
10034
10732
|
exports.setInterval = setInterval2;
|
|
10035
10733
|
exports.setUrlMainSource = setUrlMainSource;
|
|
10036
10734
|
exports.shouldRender = shouldRender;
|
|
10735
|
+
exports.switchLang = switchLang;
|
|
10736
|
+
exports.t = t;
|
|
10037
10737
|
exports.times = times;
|
|
10038
10738
|
exports.toFixed = toFixed;
|
|
10039
10739
|
exports.transform = transform;
|
|
@@ -10048,6 +10748,7 @@ exports.useIframeRelayBridge = useIframeRelayBridge_default;
|
|
|
10048
10748
|
exports.useRefState = useRefState_default;
|
|
10049
10749
|
exports.useSyncInput = useSyncInput_default;
|
|
10050
10750
|
exports.useThrottle = useThrottle_default;
|
|
10751
|
+
exports.useTranslation = useTranslation;
|
|
10051
10752
|
exports.useWebSocket = useWebSocket_default;
|
|
10052
10753
|
//# sourceMappingURL=index.cjs.js.map
|
|
10053
10754
|
//# sourceMappingURL=index.cjs.js.map
|