@zero-library/common 3.1.7 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1030 -254
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +680 -35
- package/dist/index.d.ts +680 -35
- package/dist/index.esm.js +1015 -255
- package/dist/index.esm.js.map +1 -1
- package/package.json +7 -4
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,17 @@ 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 enUS = require('antd/locale/en_US');
|
|
22
|
+
var jaJP = require('antd/locale/ja_JP');
|
|
23
|
+
var zhCN = require('antd/locale/zh_CN');
|
|
24
|
+
require('dayjs/locale/en');
|
|
25
|
+
require('dayjs/locale/ja');
|
|
26
|
+
require('dayjs/locale/zh-cn');
|
|
27
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
28
|
+
var icons = require('@ant-design/icons');
|
|
29
|
+
var classNames2 = require('classnames');
|
|
30
|
+
var docxPreview = require('docx-preview');
|
|
31
|
+
var React3 = require('react');
|
|
24
32
|
var markdownItKatex = require('@traptitech/markdown-it-katex');
|
|
25
33
|
var parse = require('html-react-parser');
|
|
26
34
|
require('katex/dist/katex.min.css');
|
|
@@ -84,8 +92,6 @@ function _interopNamespace(e) {
|
|
|
84
92
|
return Object.freeze(n);
|
|
85
93
|
}
|
|
86
94
|
|
|
87
|
-
var classNames2__default = /*#__PURE__*/_interopDefault(classNames2);
|
|
88
|
-
var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
|
|
89
95
|
var copyToClipboard__default = /*#__PURE__*/_interopDefault(copyToClipboard);
|
|
90
96
|
var AES__default = /*#__PURE__*/_interopDefault(AES);
|
|
91
97
|
var encUtf8__default = /*#__PURE__*/_interopDefault(encUtf8);
|
|
@@ -98,6 +104,11 @@ var Decimal__default = /*#__PURE__*/_interopDefault(Decimal);
|
|
|
98
104
|
var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
|
|
99
105
|
var relativeTime__default = /*#__PURE__*/_interopDefault(relativeTime);
|
|
100
106
|
var axios__default = /*#__PURE__*/_interopDefault(axios);
|
|
107
|
+
var enUS__default = /*#__PURE__*/_interopDefault(enUS);
|
|
108
|
+
var jaJP__default = /*#__PURE__*/_interopDefault(jaJP);
|
|
109
|
+
var zhCN__default = /*#__PURE__*/_interopDefault(zhCN);
|
|
110
|
+
var classNames2__default = /*#__PURE__*/_interopDefault(classNames2);
|
|
111
|
+
var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
|
|
101
112
|
var markdownItKatex__default = /*#__PURE__*/_interopDefault(markdownItKatex);
|
|
102
113
|
var parse__default = /*#__PURE__*/_interopDefault(parse);
|
|
103
114
|
var zh_CN__default = /*#__PURE__*/_interopDefault(zh_CN);
|
|
@@ -111,44 +122,7 @@ var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitiv
|
|
|
111
122
|
var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
|
|
112
123
|
var throttle__default = /*#__PURE__*/_interopDefault(throttle);
|
|
113
124
|
|
|
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
|
-
};
|
|
125
|
+
// src/i18n/index.ts
|
|
152
126
|
|
|
153
127
|
// src/utils/is.ts
|
|
154
128
|
var toString = Object.prototype.toString;
|
|
@@ -483,7 +457,7 @@ var arrToObj = (arr = [], key) => {
|
|
|
483
457
|
});
|
|
484
458
|
return obj;
|
|
485
459
|
};
|
|
486
|
-
var setInterval2 = (fn,
|
|
460
|
+
var setInterval2 = (fn, t2) => {
|
|
487
461
|
let timer = null;
|
|
488
462
|
let running = true;
|
|
489
463
|
const loop = () => {
|
|
@@ -491,7 +465,7 @@ var setInterval2 = (fn, t) => {
|
|
|
491
465
|
if (!running) return;
|
|
492
466
|
await fn();
|
|
493
467
|
if (running) loop();
|
|
494
|
-
},
|
|
468
|
+
}, t2);
|
|
495
469
|
};
|
|
496
470
|
loop();
|
|
497
471
|
return {
|
|
@@ -515,9 +489,9 @@ var genNonDuplicateID = () => {
|
|
|
515
489
|
return v.toString(16);
|
|
516
490
|
});
|
|
517
491
|
};
|
|
518
|
-
var copyText = async (text, prompt
|
|
492
|
+
var copyText = async (text, prompt) => {
|
|
519
493
|
await copyToClipboard__default.default(text);
|
|
520
|
-
if (prompt) antd.message.success(prompt);
|
|
494
|
+
if (prompt !== "") antd.message.success(prompt || t("common.copySuccess"));
|
|
521
495
|
};
|
|
522
496
|
function formatNumberWithCommas(number) {
|
|
523
497
|
const numericValue = parseFloat(number);
|
|
@@ -604,7 +578,7 @@ var buildUrlParams = (obj, url, format = "repeat") => {
|
|
|
604
578
|
};
|
|
605
579
|
var downloadFile = (url, name) => {
|
|
606
580
|
const a = document.createElement("a");
|
|
607
|
-
a.download = name || "
|
|
581
|
+
a.download = name || t("common.defaultFileName");
|
|
608
582
|
a.href = url;
|
|
609
583
|
document.body.appendChild(a);
|
|
610
584
|
a.click();
|
|
@@ -961,7 +935,7 @@ var isExpire = (date) => {
|
|
|
961
935
|
};
|
|
962
936
|
var createCachedMessage = () => {
|
|
963
937
|
const messageCache = {};
|
|
964
|
-
return ({ title = "
|
|
938
|
+
return ({ title = t("common.defaultTitle"), content, type = "warning", duration = 3, onClose, isCache = true, isOnly = false }) => {
|
|
965
939
|
if (!content) return;
|
|
966
940
|
const cacheKey = isOnly ? "unique-message-key" : content;
|
|
967
941
|
const handleClose = () => {
|
|
@@ -1005,50 +979,72 @@ var cachedMessage = createCachedMessage();
|
|
|
1005
979
|
// src/utils/pattern.ts
|
|
1006
980
|
var RegMobile = {
|
|
1007
981
|
pattern: /^1[3-9]\d{9}$/,
|
|
1008
|
-
message
|
|
982
|
+
get message() {
|
|
983
|
+
return t("pattern.mobileInvalid");
|
|
984
|
+
}
|
|
1009
985
|
};
|
|
1010
986
|
var RegFixedTelePhone = {
|
|
1011
987
|
pattern: /^0\d{2,3}-\d{7,8}$/,
|
|
1012
|
-
message
|
|
988
|
+
get message() {
|
|
989
|
+
return t("pattern.phoneInvalid");
|
|
990
|
+
}
|
|
1013
991
|
};
|
|
1014
992
|
var RegTelePhone = {
|
|
1015
993
|
pattern: /^[\\+\-\\(\\)\\(\\)\d]{1,20}$/,
|
|
1016
|
-
message
|
|
994
|
+
get message() {
|
|
995
|
+
return t("pattern.phoneInvalid");
|
|
996
|
+
}
|
|
1017
997
|
};
|
|
1018
998
|
var RegTaxNo = {
|
|
1019
999
|
pattern: /^[A-Z0-9]{15}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/,
|
|
1020
|
-
message
|
|
1000
|
+
get message() {
|
|
1001
|
+
return t("pattern.taxNoInvalid");
|
|
1002
|
+
}
|
|
1021
1003
|
};
|
|
1022
1004
|
var RegBankCardNo = {
|
|
1023
1005
|
pattern: /^[0-9]*$/,
|
|
1024
|
-
message
|
|
1006
|
+
get message() {
|
|
1007
|
+
return t("pattern.bankCardInvalid");
|
|
1008
|
+
}
|
|
1025
1009
|
};
|
|
1026
1010
|
var RegIdentityCardNo = {
|
|
1027
1011
|
pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
|
|
1028
|
-
message
|
|
1012
|
+
get message() {
|
|
1013
|
+
return t("pattern.idCardInvalid");
|
|
1014
|
+
}
|
|
1029
1015
|
};
|
|
1030
1016
|
var RegNumNo = {
|
|
1031
1017
|
pattern: /^[0-9]*$/,
|
|
1032
|
-
message
|
|
1018
|
+
get message() {
|
|
1019
|
+
return t("pattern.numberInvalid");
|
|
1020
|
+
}
|
|
1033
1021
|
};
|
|
1034
1022
|
var RegSmsCode = {
|
|
1035
1023
|
pattern: /^[0-9]{6}$/,
|
|
1036
|
-
message
|
|
1024
|
+
get message() {
|
|
1025
|
+
return t("pattern.smsCodeInvalid");
|
|
1026
|
+
}
|
|
1037
1027
|
};
|
|
1038
1028
|
var RegEmail = {
|
|
1039
1029
|
pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
|
|
1040
|
-
message
|
|
1030
|
+
get message() {
|
|
1031
|
+
return t("pattern.emailInvalid");
|
|
1032
|
+
}
|
|
1041
1033
|
};
|
|
1042
1034
|
var RegDetailAddress = {
|
|
1043
1035
|
pattern: /.*(街|路|村|乡|镇|道|巷|号).*/,
|
|
1044
|
-
message
|
|
1036
|
+
get message() {
|
|
1037
|
+
return t("pattern.addressInvalid");
|
|
1038
|
+
}
|
|
1045
1039
|
};
|
|
1046
1040
|
var RegPassword = {
|
|
1047
1041
|
pattern: /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,26}$/,
|
|
1048
|
-
message
|
|
1042
|
+
get message() {
|
|
1043
|
+
return t("pattern.passwordInvalid");
|
|
1044
|
+
}
|
|
1049
1045
|
};
|
|
1050
|
-
var PhoneOrMobileValidator = (errMessage
|
|
1051
|
-
validator: (_, value) => !value || RegFixedTelePhone.pattern.test(value) || RegMobile.pattern.test(value) ? Promise.resolve() : Promise.reject(new Error(errMessage))
|
|
1046
|
+
var PhoneOrMobileValidator = (errMessage) => ({
|
|
1047
|
+
validator: (_, value) => !value || RegFixedTelePhone.pattern.test(value) || RegMobile.pattern.test(value) ? Promise.resolve() : Promise.reject(new Error(errMessage || t("pattern.phoneOrMobileInvalid")))
|
|
1052
1048
|
});
|
|
1053
1049
|
var ThanNumValidator = ({
|
|
1054
1050
|
min,
|
|
@@ -1065,12 +1061,12 @@ var ThanNumValidator = ({
|
|
|
1065
1061
|
}
|
|
1066
1062
|
if (isNumberNoNaN(parseFloat(min))) {
|
|
1067
1063
|
if (!(Number(value) > Number(min) || equalMin && Number(value) === Number(min))) {
|
|
1068
|
-
return Promise.reject(new Error(minErrMessage || errMessage ||
|
|
1064
|
+
return Promise.reject(new Error(minErrMessage || errMessage || t(equalMin ? "lessThanOrEqual" : "lessThan", { value: min })));
|
|
1069
1065
|
}
|
|
1070
1066
|
}
|
|
1071
1067
|
if (isNumberNoNaN(parseFloat(max))) {
|
|
1072
1068
|
if (!(Number(value) < Number(max) || equalMax && Number(value) === Number(max))) {
|
|
1073
|
-
return Promise.reject(new Error(maxErrMessage || errMessage ||
|
|
1069
|
+
return Promise.reject(new Error(maxErrMessage || errMessage || t(equalMax ? "greaterThanOrEqual" : "greaterThan", { value: max })));
|
|
1074
1070
|
}
|
|
1075
1071
|
}
|
|
1076
1072
|
return Promise.resolve();
|
|
@@ -1090,17 +1086,17 @@ var ThanNumLengthValidator = ({
|
|
|
1090
1086
|
}
|
|
1091
1087
|
if (isNumber(length)) {
|
|
1092
1088
|
if (precision(value) > length) {
|
|
1093
|
-
return Promise.reject(new Error(lengthErrMessage ||
|
|
1089
|
+
return Promise.reject(new Error(lengthErrMessage || t("pattern.totalLengthExceed", { length })));
|
|
1094
1090
|
}
|
|
1095
1091
|
}
|
|
1096
1092
|
if (isNumber(integerLength)) {
|
|
1097
1093
|
if (precision(value) - decimalPlaces(value) > integerLength) {
|
|
1098
|
-
return Promise.reject(new Error(integerLengthErrMessage ||
|
|
1094
|
+
return Promise.reject(new Error(integerLengthErrMessage || t("pattern.integerLengthExceed", { length: integerLength })));
|
|
1099
1095
|
}
|
|
1100
1096
|
}
|
|
1101
1097
|
if (isNumber(decimalsLength)) {
|
|
1102
1098
|
if (decimalPlaces(value) > decimalsLength) {
|
|
1103
|
-
return Promise.reject(new Error(decimalsLengthErrMessage ||
|
|
1099
|
+
return Promise.reject(new Error(decimalsLengthErrMessage || t("pattern.decimalLengthExceed", { length: decimalsLength })));
|
|
1104
1100
|
}
|
|
1105
1101
|
}
|
|
1106
1102
|
return Promise.resolve();
|
|
@@ -1110,7 +1106,7 @@ var MultiEmailValidator = (max) => ({
|
|
|
1110
1106
|
validator: (_, value) => {
|
|
1111
1107
|
if (value) {
|
|
1112
1108
|
const emailArr = value.split(",").map((v) => v.trim()).filter((v) => v);
|
|
1113
|
-
if (emailArr.length > max) return Promise.reject(new Error(
|
|
1109
|
+
if (emailArr.length > max) return Promise.reject(new Error(t("pattern.maxEmailsExceed", { max })));
|
|
1114
1110
|
const noEmailArr = emailArr.filter((email) => !RegEmail.pattern.test(email));
|
|
1115
1111
|
if (noEmailArr.length) return Promise.reject(new Error(RegEmail.message));
|
|
1116
1112
|
}
|
|
@@ -1178,14 +1174,14 @@ function createRequest(config) {
|
|
|
1178
1174
|
return Promise.reject(err);
|
|
1179
1175
|
}
|
|
1180
1176
|
if (!err.response) {
|
|
1181
|
-
if (showError(err?.config?.showError)) cachedMessage({ content: "
|
|
1177
|
+
if (showError(err?.config?.showError)) cachedMessage({ content: t("request.networkError"), type: "error" });
|
|
1182
1178
|
} else {
|
|
1183
1179
|
switch (err.response?.status) {
|
|
1184
1180
|
case HttpStatus.UNAUTHORIZED:
|
|
1185
1181
|
if (showError(err?.config?.showError)) cachedMessage({ content: err.response?.data.message, type: "error" });
|
|
1186
1182
|
break;
|
|
1187
1183
|
default:
|
|
1188
|
-
if (showError(err?.config?.showError)) cachedMessage({ content: err.response?.data.message || "
|
|
1184
|
+
if (showError(err?.config?.showError)) cachedMessage({ content: err.response?.data.message || t("request.requestError"), type: "error" });
|
|
1189
1185
|
}
|
|
1190
1186
|
}
|
|
1191
1187
|
return Promise.reject(err);
|
|
@@ -1300,7 +1296,722 @@ function createTokenManager({ key, storage = localStorage }) {
|
|
|
1300
1296
|
clear: tokenManager.clear
|
|
1301
1297
|
};
|
|
1302
1298
|
}
|
|
1299
|
+
|
|
1300
|
+
// src/i18n/constants.ts
|
|
1301
|
+
var NS_COMMON = "common";
|
|
1302
|
+
|
|
1303
|
+
// src/i18n/zh-CN.ts
|
|
1304
|
+
var commonZhCN = {
|
|
1305
|
+
// 通用文案
|
|
1306
|
+
common: {
|
|
1307
|
+
copySuccess: "\u590D\u5236\u6210\u529F",
|
|
1308
|
+
confirm: "\u786E\u5B9A",
|
|
1309
|
+
cancel: "\u53D6\u6D88",
|
|
1310
|
+
download: "\u4E0B\u8F7D",
|
|
1311
|
+
save: "\u4FDD\u5B58",
|
|
1312
|
+
defaultFileName: "\u6587\u4EF6",
|
|
1313
|
+
defaultTitle: "\u63D0\u793A",
|
|
1314
|
+
loading: "\u52A0\u8F7D\u4E2D...",
|
|
1315
|
+
// 以下为多模块共用词条(重复3次以上提取至此)
|
|
1316
|
+
enter: "\u8FDB\u5165\u5E94\u7528",
|
|
1317
|
+
applicationCenter: "\u5E94\u7528\u4E2D\u5FC3",
|
|
1318
|
+
subscribeSuccess: "\u8BA2\u9605\u6210\u529F",
|
|
1319
|
+
subscribeConfirm: "\u662F\u5426\u8BA2\u9605{{name}}\uFF1F",
|
|
1320
|
+
installConfirm: "\u662F\u5426{{action}}{{name}}\uFF1F",
|
|
1321
|
+
prompt: "\u63D0\u793A",
|
|
1322
|
+
dynamicNews: "\u52A8\u6001\u6D88\u606F",
|
|
1323
|
+
noDynamicNews: "\u6682\u65E0\u52A8\u6001\u6D88\u606F"
|
|
1324
|
+
},
|
|
1325
|
+
// utils/request.ts
|
|
1326
|
+
request: {
|
|
1327
|
+
networkError: "\u7F51\u7EDC\u5F02\u5E38\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC",
|
|
1328
|
+
requestError: "\u8BF7\u6C42\u9519\u8BEF\uFF01"
|
|
1329
|
+
},
|
|
1330
|
+
// utils/pattern.ts — 验证消息
|
|
1331
|
+
pattern: {
|
|
1332
|
+
mobileInvalid: "\u624B\u673A\u53F7\u683C\u5F0F\u4E0D\u6B63\u786E\uFF01",
|
|
1333
|
+
phoneInvalid: "\u7535\u8BDD\u53F7\u7801\u683C\u5F0F\u4E0D\u6B63\u786E\uFF01",
|
|
1334
|
+
taxNoInvalid: "\u7A0E\u53F7\u683C\u5F0F\u6709\u8BEF\uFF01",
|
|
1335
|
+
bankCardInvalid: "\u94F6\u884C\u5361\u53F7\u683C\u5F0F\u6709\u8BEF\uFF01",
|
|
1336
|
+
idCardInvalid: "\u8EAB\u4EFD\u8BC1\u53F7\u683C\u5F0F\u6709\u8BEF\uFF01",
|
|
1337
|
+
numberInvalid: "\u683C\u5F0F\u6709\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165\uFF01",
|
|
1338
|
+
smsCodeInvalid: "\u9A8C\u8BC1\u7801\u4E3A6\u4F4D\u6570\u5B57",
|
|
1339
|
+
emailInvalid: "\u90AE\u7BB1\u683C\u5F0F\u6709\u8BEF\uFF01",
|
|
1340
|
+
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',
|
|
1341
|
+
passwordInvalid: "\u5BC6\u7801\u4E3A8\u523026\u4F4D\u4E4B\u95F4\u6570\u5B57\u4E0E\u5B57\u6BCD\u7EC4\u5408",
|
|
1342
|
+
phoneOrMobileInvalid: "\u8054\u7CFB\u7535\u8BDD\u683C\u5F0F\u4E0D\u6B63\u786E",
|
|
1343
|
+
// 插值示例:{{value}} 会被替换为实际值
|
|
1344
|
+
lessThan: "\u4E0D\u80FD\u5C0F\u4E8E{{value}}",
|
|
1345
|
+
lessThanOrEqual: "\u4E0D\u80FD\u5C0F\u4E8E\u7B49\u4E8E{{value}}",
|
|
1346
|
+
greaterThan: "\u4E0D\u80FD\u5927\u4E8E{{value}}",
|
|
1347
|
+
greaterThanOrEqual: "\u4E0D\u80FD\u5927\u4E8E\u7B49\u4E8E{{value}}",
|
|
1348
|
+
totalLengthExceed: "\u603B\u4F4D\u6570\u4E0D\u80FD\u8D85\u8FC7{{length}}\u4F4D",
|
|
1349
|
+
integerLengthExceed: "\u6574\u6570\u4F4D\u4E0D\u80FD\u8D85\u8FC7{{length}}\u4F4D",
|
|
1350
|
+
decimalLengthExceed: "\u5C0F\u6570\u4F4D\u4E0D\u80FD\u8D85\u8FC7{{length}}\u4F4D",
|
|
1351
|
+
maxEmailsExceed: "\u6700\u591A\u8F93\u5165{{max}}\u4E2A\u90AE\u7BB1"
|
|
1352
|
+
},
|
|
1353
|
+
// utils/date.ts
|
|
1354
|
+
date: {
|
|
1355
|
+
yearMonthFormat: "YYYY\u5E74MM\u6708",
|
|
1356
|
+
yearMonthDayFormat: "YYYY\u5E74MM\u6708DD\u65E5"
|
|
1357
|
+
},
|
|
1358
|
+
// SpeechButton 语音按钮
|
|
1359
|
+
speechButton: {
|
|
1360
|
+
notSupported: "\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u8BED\u97F3\u8BC6\u522B",
|
|
1361
|
+
permissionDenied: "\u9EA6\u514B\u98CE\u6743\u9650\u5DF2\u62D2\u7EDD",
|
|
1362
|
+
stop: "\u505C\u6B62\u5F55\u97F3",
|
|
1363
|
+
start: "\u70B9\u51FB\u5F00\u59CB\u5F55\u97F3"
|
|
1364
|
+
},
|
|
1365
|
+
// MicroApp / Iframe
|
|
1366
|
+
microApp: {
|
|
1367
|
+
loading: "\u52A0\u8F7D\u4E2D..."
|
|
1368
|
+
},
|
|
1369
|
+
iframe: {
|
|
1370
|
+
loading: "\u52A0\u8F7D\u4E2D..."
|
|
1371
|
+
},
|
|
1372
|
+
// LazyComponent 延时加载组件
|
|
1373
|
+
lazyComponent: {
|
|
1374
|
+
unknownType: "\u672A\u77E5\u7C7B\u578B\uFF1A{{type}}",
|
|
1375
|
+
componentLoading: "\u7EC4\u4EF6\u52A0\u8F7D\u4E2D..."
|
|
1376
|
+
},
|
|
1377
|
+
// File 文件预览组件群
|
|
1378
|
+
filePreview: {
|
|
1379
|
+
title: "\u6587\u4EF6\u9884\u89C8",
|
|
1380
|
+
closePreview: "\u5173\u95ED\u9884\u89C8",
|
|
1381
|
+
htmlPreviewTitle: "HTML \u9884\u89C8",
|
|
1382
|
+
previewImageAlt: "\u9884\u89C8\u56FE\u7247",
|
|
1383
|
+
previewNotSupported: "\u6682\u4E0D\u652F\u6301 {{suffix}} \u6587\u4EF6\u7684\u9884\u89C8",
|
|
1384
|
+
previewNotSupportedDownload: "{{suffix}} \u6587\u4EF6\u6682\u4E0D\u652F\u6301\u5728\u7EBF\u9884\u89C8\uFF0C\u8BF7\u4E0B\u8F7D\u6253\u5F00",
|
|
1385
|
+
previewGenerating: "\u9884\u89C8\u6587\u4EF6\u6B63\u5728\u751F\u6210\u4E2D...",
|
|
1386
|
+
audioNotSupported: "\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 audio \u6807\u7B7E\u3002",
|
|
1387
|
+
videoNotSupported: "\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 video \u6807\u7B7E\u3002",
|
|
1388
|
+
requestFailedWithStatus: "\u8BF7\u6C42\u5931\u8D25\uFF0C\u72B6\u6001\u7801: {{status}}",
|
|
1389
|
+
emptyResponse: "\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A",
|
|
1390
|
+
loadFileFailed: "\u52A0\u8F7D\u6587\u4EF6\u5931\u8D25",
|
|
1391
|
+
fileParseFailed: "\u52A0\u8F7D\u6216\u89E3\u6790\u6587\u4EF6\u5931\u8D25",
|
|
1392
|
+
fileUrlInvalid: "\u6587\u4EF6\u5730\u5740\u9519\u8BEF",
|
|
1393
|
+
htmlParseFailed: "\u52A0\u8F7D\u6216\u89E3\u6790 HTML \u5931\u8D25",
|
|
1394
|
+
docLoadFailed: "\u6587\u6863\u52A0\u8F7D\u5931\u8D25",
|
|
1395
|
+
pdfLoadFailed: "PDF \u52A0\u8F7D\u5931\u8D25",
|
|
1396
|
+
pdfParseFailed: "\u52A0\u8F7D\u6216\u89E3\u6790 pdf \u5931\u8D25",
|
|
1397
|
+
pdfUrlInvalid: "pdf\u5730\u5740\u9519\u8BEF",
|
|
1398
|
+
pdfPasswordInvalid: "\u5BC6\u7801\u65E0\u6548\u3002\u8BF7\u518D\u8BD5\u4E00\u6B21\uFF01",
|
|
1399
|
+
pdfPasswordPlaceholder: "\u8BF7\u8F93\u5165\u5BC6\u7801",
|
|
1400
|
+
pdfSubmit: "\u63D0 \u4EA4",
|
|
1401
|
+
pdfInvalidOrDamaged: "\u6587\u4EF6\u65E0\u6548\u6216\u5DF2\u635F\u574F",
|
|
1402
|
+
pdfFileNotFound: "\u6587\u4EF6\u4E0D\u5B58\u5728",
|
|
1403
|
+
pdfUnexpectedResponse: "\u610F\u5916\u7684\u670D\u52A1\u5668\u54CD\u5E94",
|
|
1404
|
+
pdfLoadDocumentFailed: "\u65E0\u6CD5\u52A0\u8F7D\u6587\u6863",
|
|
1405
|
+
zoomOut: "\u7F29\u5C0F",
|
|
1406
|
+
zoomIn: "\u653E\u5927",
|
|
1407
|
+
zoomReset: "\u8FD8\u539F",
|
|
1408
|
+
fitWidth: "\u9002\u5E94\u5BBD\u5EA6"
|
|
1409
|
+
},
|
|
1410
|
+
// MarkdownEditor 富文本编辑器
|
|
1411
|
+
markdownEditor: {
|
|
1412
|
+
mainArea: "\u4E3B\u5185\u5BB9\u533A\u57DF\uFF0C\u5F00\u59CB\u8F93\u5165\u6587\u672C...",
|
|
1413
|
+
unknown: "\u672A\u77E5",
|
|
1414
|
+
// 工具栏
|
|
1415
|
+
toolbar: {
|
|
1416
|
+
toolbarAria: "\u7F16\u8F91\u5668\u5DE5\u5177\u680F",
|
|
1417
|
+
quote: "\u5F15\u7528\u9009\u4E2D\u6587\u672C",
|
|
1418
|
+
annotation: "\u6279\u6CE8",
|
|
1419
|
+
excerpt: "\u6458\u5F55\u7B14\u8BB0",
|
|
1420
|
+
undo: "\u64A4\u9500",
|
|
1421
|
+
redo: "\u91CD\u505A",
|
|
1422
|
+
alignLeft: "\u5DE6\u5BF9\u9F50",
|
|
1423
|
+
alignCenter: "\u5C45\u4E2D\u5BF9\u9F50",
|
|
1424
|
+
alignRight: "\u53F3\u5BF9\u9F50",
|
|
1425
|
+
alignJustify: "\u4E24\u7AEF\u5BF9\u9F50",
|
|
1426
|
+
bold: "\u7C97\u4F53",
|
|
1427
|
+
italic: "\u659C\u4F53",
|
|
1428
|
+
underline: "\u4E0B\u5212\u7EBF",
|
|
1429
|
+
strike: "\u5220\u9664\u7EBF",
|
|
1430
|
+
code: "\u4EE3\u7801",
|
|
1431
|
+
superscript: "\u4E0A\u89D2\u6807",
|
|
1432
|
+
subscript: "\u4E0B\u89D2\u6807",
|
|
1433
|
+
bulletList: "\u65E0\u5E8F\u5217\u8868",
|
|
1434
|
+
orderedList: "\u6709\u5E8F\u5217\u8868",
|
|
1435
|
+
taskList: "\u4EFB\u52A1\u5217\u8868",
|
|
1436
|
+
listOptions: "\u5217\u8868\u9009\u9879",
|
|
1437
|
+
list: "\u5217\u8868",
|
|
1438
|
+
blockquote: "\u5F15\u7528\u5757",
|
|
1439
|
+
codeBlock: "\u4EE3\u7801\u5757",
|
|
1440
|
+
heading: "\u6807\u9898",
|
|
1441
|
+
headingLevel: "\u6807\u9898 {{level}}",
|
|
1442
|
+
addImage: "\u6DFB\u52A0\u56FE\u7247",
|
|
1443
|
+
link: "\u94FE\u63A5",
|
|
1444
|
+
linkPlaceholder: "\u7C98\u8D34\u94FE\u63A5...",
|
|
1445
|
+
applyLink: "\u5E94\u7528\u94FE\u63A5",
|
|
1446
|
+
openInNewWindow: "\u5728\u65B0\u7A97\u53E3\u4E2D\u6253\u5F00",
|
|
1447
|
+
removeLink: "\u79FB\u9664\u94FE\u63A5"
|
|
1448
|
+
},
|
|
1449
|
+
// 高亮 / 背景色
|
|
1450
|
+
highlight: {
|
|
1451
|
+
toggle: "\u5207\u6362\u9AD8\u4EAE\u663E\u793A ({{color}})",
|
|
1452
|
+
label: "\u80CC\u666F\u8272",
|
|
1453
|
+
textLabel: "\u6587\u672C\u80CC\u666F\u8272",
|
|
1454
|
+
colorOptionAria: "{{label}} \u9AD8\u4EAE\u989C\u8272",
|
|
1455
|
+
removeBackground: "\u79FB\u9664\u80CC\u666F",
|
|
1456
|
+
removeHighlight: "\u79FB\u9664\u9AD8\u4EAE",
|
|
1457
|
+
default: "\u9ED8\u8BA4\u80CC\u666F",
|
|
1458
|
+
gray: "\u7070\u8272\u80CC\u666F",
|
|
1459
|
+
brown: "\u68D5\u8272\u80CC\u666F",
|
|
1460
|
+
orange: "\u6A59\u8272\u80CC\u666F",
|
|
1461
|
+
yellow: "\u9EC4\u8272\u80CC\u666F",
|
|
1462
|
+
green: "\u7EFF\u8272\u80CC\u666F",
|
|
1463
|
+
blue: "\u84DD\u8272\u80CC\u666F",
|
|
1464
|
+
purple: "\u7D2B\u8272\u80CC\u666F",
|
|
1465
|
+
pink: "\u7C89\u8272\u80CC\u666F",
|
|
1466
|
+
red: "\u7EA2\u8272\u80CC\u666F"
|
|
1467
|
+
},
|
|
1468
|
+
// 批注
|
|
1469
|
+
annotation: {
|
|
1470
|
+
title: "\u6279\u6CE8",
|
|
1471
|
+
list: "\u6279\u6CE8\u5217\u8868",
|
|
1472
|
+
add: "\u6DFB\u52A0\u6279\u6CE8",
|
|
1473
|
+
content: "\u6279\u6CE8\u5185\u5BB9",
|
|
1474
|
+
required: "\u8BF7\u8F93\u5165\u6279\u6CE8\u5185\u5BB9",
|
|
1475
|
+
maxLength: "\u6279\u6CE8\u5185\u5BB9\u4E0D\u80FD\u8D85\u8FC7500\u4E2A\u5B57\u7B26",
|
|
1476
|
+
placeholder: "\u8BF7\u8F93\u5165\u60A8\u7684\u6279\u6CE8\u5185\u5BB9...",
|
|
1477
|
+
edit: "\u7F16\u8F91\u6279\u6CE8",
|
|
1478
|
+
delete: "\u5220\u9664\u6279\u6CE8",
|
|
1479
|
+
confirmDelete: "\u786E\u8BA4\u5220\u9664\u5F53\u524D\u6279\u6CE8\u5417?",
|
|
1480
|
+
empty: "\u6682\u65E0\u6279\u6CE8"
|
|
1481
|
+
},
|
|
1482
|
+
// 摘录
|
|
1483
|
+
collection: {
|
|
1484
|
+
title: "\u6458\u5F55",
|
|
1485
|
+
list: "\u6458\u5F55\u5217\u8868",
|
|
1486
|
+
delete: "\u5220\u9664\u6458\u5F55",
|
|
1487
|
+
confirmDelete: "\u786E\u8BA4\u5220\u9664\u5F53\u524D\u6458\u5F55\u5417?",
|
|
1488
|
+
empty: "\u6682\u65E0\u6458\u5F55"
|
|
1489
|
+
},
|
|
1490
|
+
// 文件 / 图片上传
|
|
1491
|
+
themeToggle: {
|
|
1492
|
+
switchToLight: "\u5207\u6362\u5230\u6D45\u8272\u6A21\u5F0F",
|
|
1493
|
+
switchToDark: "\u5207\u6362\u5230\u6DF1\u8272\u6A21\u5F0F"
|
|
1494
|
+
},
|
|
1495
|
+
upload: {
|
|
1496
|
+
clickToUpload: "\u70B9\u51FB\u4E0A\u4F20",
|
|
1497
|
+
dragAndDrop: "\u6216\u62D6\u62FD\u5230\u6B64\u5904",
|
|
1498
|
+
maxFileHint: "\u6700\u591A {{limit}} \u4E2A\u6587\u4EF6\uFF0C\u6BCF\u4E2A {{size}}MB",
|
|
1499
|
+
noFile: "\u672A\u63D0\u4F9B\u6587\u4EF6",
|
|
1500
|
+
canceled: "\u4E0A\u4F20\u5DF2\u53D6\u6D88",
|
|
1501
|
+
fileSizeExceeded: "\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u6700\u5927\u9650\u5236 ({{max}}MB)",
|
|
1502
|
+
undefined: "\u4E0A\u4F20\u529F\u80FD\u672A\u5B9A\u4E49",
|
|
1503
|
+
failedNoUrl: "\u4E0A\u4F20\u5931\u8D25\uFF1A\u672A\u8FD4\u56DEURL",
|
|
1504
|
+
failed: "\u4E0A\u4F20\u5931\u8D25",
|
|
1505
|
+
noFileToUpload: "\u6CA1\u6709\u6587\u4EF6\u53EF\u4E0A\u4F20",
|
|
1506
|
+
maxFileCount: "\u6700\u591A\u5141\u8BB8\u4E0A\u4F20 {{limit}} \u4E2A\u6587\u4EF6"
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
};
|
|
1510
|
+
|
|
1511
|
+
// src/i18n/en-US.ts
|
|
1512
|
+
var commonEnUS = {
|
|
1513
|
+
common: {
|
|
1514
|
+
copySuccess: "Copied successfully",
|
|
1515
|
+
confirm: "OK",
|
|
1516
|
+
cancel: "Cancel",
|
|
1517
|
+
download: "Download",
|
|
1518
|
+
save: "Save",
|
|
1519
|
+
defaultFileName: "file",
|
|
1520
|
+
defaultTitle: "Notice",
|
|
1521
|
+
loading: "Loading...",
|
|
1522
|
+
// Shared keys (extracted from duplicates ≥ 3)
|
|
1523
|
+
enter: "Enter App",
|
|
1524
|
+
applicationCenter: "App Center",
|
|
1525
|
+
subscribeSuccess: "Subscribed successfully",
|
|
1526
|
+
subscribeConfirm: "Subscribe to {{name}}?",
|
|
1527
|
+
installConfirm: "{{action}} {{name}}?",
|
|
1528
|
+
prompt: "Prompt",
|
|
1529
|
+
dynamicNews: "Activity Feed",
|
|
1530
|
+
noDynamicNews: "No recent activity"
|
|
1531
|
+
},
|
|
1532
|
+
request: {
|
|
1533
|
+
networkError: "Network error, please check your connection",
|
|
1534
|
+
requestError: "Request error!"
|
|
1535
|
+
},
|
|
1536
|
+
pattern: {
|
|
1537
|
+
mobileInvalid: "Invalid phone number!",
|
|
1538
|
+
phoneInvalid: "Invalid phone number!",
|
|
1539
|
+
taxNoInvalid: "Invalid tax number!",
|
|
1540
|
+
bankCardInvalid: "Invalid bank card number!",
|
|
1541
|
+
idCardInvalid: "Invalid ID card number!",
|
|
1542
|
+
numberInvalid: "Invalid format, please re-enter!",
|
|
1543
|
+
smsCodeInvalid: "SMS code must be 6 digits",
|
|
1544
|
+
emailInvalid: "Invalid email format!",
|
|
1545
|
+
addressInvalid: "Must contain one of: street, road, village, town, etc.",
|
|
1546
|
+
passwordInvalid: "Password must be 8-26 characters with letters and numbers",
|
|
1547
|
+
phoneOrMobileInvalid: "Invalid contact number",
|
|
1548
|
+
lessThan: "Cannot be less than {{value}}",
|
|
1549
|
+
lessThanOrEqual: "Cannot be less than or equal to {{value}}",
|
|
1550
|
+
greaterThan: "Cannot be greater than {{value}}",
|
|
1551
|
+
greaterThanOrEqual: "Cannot be greater than or equal to {{value}}",
|
|
1552
|
+
totalLengthExceed: "Total digits cannot exceed {{length}}",
|
|
1553
|
+
integerLengthExceed: "Integer digits cannot exceed {{length}}",
|
|
1554
|
+
decimalLengthExceed: "Decimal digits cannot exceed {{length}}",
|
|
1555
|
+
maxEmailsExceed: "Maximum {{max}} emails allowed"
|
|
1556
|
+
},
|
|
1557
|
+
date: {
|
|
1558
|
+
yearMonthFormat: "YYYY-MM",
|
|
1559
|
+
yearMonthDayFormat: "YYYY-MM-DD"
|
|
1560
|
+
},
|
|
1561
|
+
speechButton: {
|
|
1562
|
+
notSupported: "Speech recognition is not supported in this browser",
|
|
1563
|
+
permissionDenied: "Microphone permission denied",
|
|
1564
|
+
stop: "Stop Recording",
|
|
1565
|
+
start: "Click to Start Recording"
|
|
1566
|
+
},
|
|
1567
|
+
microApp: {
|
|
1568
|
+
loading: "Loading..."
|
|
1569
|
+
},
|
|
1570
|
+
iframe: {
|
|
1571
|
+
loading: "Loading..."
|
|
1572
|
+
},
|
|
1573
|
+
lazyComponent: {
|
|
1574
|
+
unknownType: "Unknown type: {{type}}",
|
|
1575
|
+
componentLoading: "Loading component..."
|
|
1576
|
+
},
|
|
1577
|
+
filePreview: {
|
|
1578
|
+
title: "File Preview",
|
|
1579
|
+
closePreview: "Close preview",
|
|
1580
|
+
htmlPreviewTitle: "HTML Preview",
|
|
1581
|
+
previewImageAlt: "Preview image",
|
|
1582
|
+
previewNotSupported: "Preview of {{suffix}} files is not supported",
|
|
1583
|
+
previewNotSupportedDownload: "{{suffix}} files cannot be previewed online, please download and open",
|
|
1584
|
+
previewGenerating: "Preview file is being generated...",
|
|
1585
|
+
audioNotSupported: "Your browser does not support the audio tag.",
|
|
1586
|
+
videoNotSupported: "Your browser does not support the video tag.",
|
|
1587
|
+
requestFailedWithStatus: "Request failed, status code: {{status}}",
|
|
1588
|
+
emptyResponse: "Response content is empty",
|
|
1589
|
+
loadFileFailed: "Failed to load file",
|
|
1590
|
+
fileParseFailed: "Failed to load or parse file",
|
|
1591
|
+
fileUrlInvalid: "Invalid file URL",
|
|
1592
|
+
htmlParseFailed: "Failed to load or parse HTML",
|
|
1593
|
+
docLoadFailed: "Failed to load document",
|
|
1594
|
+
pdfLoadFailed: "Failed to load PDF",
|
|
1595
|
+
pdfParseFailed: "Failed to load or parse PDF",
|
|
1596
|
+
pdfUrlInvalid: "Invalid PDF URL",
|
|
1597
|
+
pdfPasswordInvalid: "Invalid password. Please try again!",
|
|
1598
|
+
pdfPasswordPlaceholder: "Please enter password",
|
|
1599
|
+
pdfSubmit: "Submit",
|
|
1600
|
+
pdfInvalidOrDamaged: "File is invalid or damaged",
|
|
1601
|
+
pdfFileNotFound: "File not found",
|
|
1602
|
+
pdfUnexpectedResponse: "Unexpected server response",
|
|
1603
|
+
pdfLoadDocumentFailed: "Unable to load document",
|
|
1604
|
+
zoomOut: "Zoom out",
|
|
1605
|
+
zoomIn: "Zoom in",
|
|
1606
|
+
zoomReset: "Reset",
|
|
1607
|
+
fitWidth: "Fit width"
|
|
1608
|
+
},
|
|
1609
|
+
markdownEditor: {
|
|
1610
|
+
mainArea: "Main content area, start typing...",
|
|
1611
|
+
unknown: "Unknown",
|
|
1612
|
+
toolbar: {
|
|
1613
|
+
toolbarAria: "Editor toolbar",
|
|
1614
|
+
quote: "Quote Selected Text",
|
|
1615
|
+
annotation: "Annotate",
|
|
1616
|
+
excerpt: "Excerpt Note",
|
|
1617
|
+
undo: "Undo",
|
|
1618
|
+
redo: "Redo",
|
|
1619
|
+
alignLeft: "Align Left",
|
|
1620
|
+
alignCenter: "Align Center",
|
|
1621
|
+
alignRight: "Align Right",
|
|
1622
|
+
alignJustify: "Justify",
|
|
1623
|
+
bold: "Bold",
|
|
1624
|
+
italic: "Italic",
|
|
1625
|
+
underline: "Underline",
|
|
1626
|
+
strike: "Strikethrough",
|
|
1627
|
+
code: "Code",
|
|
1628
|
+
superscript: "Superscript",
|
|
1629
|
+
subscript: "Subscript",
|
|
1630
|
+
bulletList: "Bullet List",
|
|
1631
|
+
orderedList: "Numbered List",
|
|
1632
|
+
taskList: "Task List",
|
|
1633
|
+
listOptions: "List Options",
|
|
1634
|
+
list: "List",
|
|
1635
|
+
blockquote: "Blockquote",
|
|
1636
|
+
codeBlock: "Code Block",
|
|
1637
|
+
heading: "Heading",
|
|
1638
|
+
headingLevel: "Heading {{level}}",
|
|
1639
|
+
addImage: "Add Image",
|
|
1640
|
+
link: "Link",
|
|
1641
|
+
linkPlaceholder: "Paste link...",
|
|
1642
|
+
applyLink: "Apply Link",
|
|
1643
|
+
openInNewWindow: "Open in New Window",
|
|
1644
|
+
removeLink: "Remove Link"
|
|
1645
|
+
},
|
|
1646
|
+
highlight: {
|
|
1647
|
+
toggle: "Toggle highlight ({{color}})",
|
|
1648
|
+
label: "Background color",
|
|
1649
|
+
textLabel: "Text background color",
|
|
1650
|
+
colorOptionAria: "{{label}} highlight color",
|
|
1651
|
+
removeBackground: "Remove background",
|
|
1652
|
+
removeHighlight: "Remove highlight",
|
|
1653
|
+
default: "Default background",
|
|
1654
|
+
gray: "Gray background",
|
|
1655
|
+
brown: "Brown background",
|
|
1656
|
+
orange: "Orange background",
|
|
1657
|
+
yellow: "Yellow background",
|
|
1658
|
+
green: "Green background",
|
|
1659
|
+
blue: "Blue background",
|
|
1660
|
+
purple: "Purple background",
|
|
1661
|
+
pink: "Pink background",
|
|
1662
|
+
red: "Red background"
|
|
1663
|
+
},
|
|
1664
|
+
annotation: {
|
|
1665
|
+
title: "Annotations",
|
|
1666
|
+
list: "Annotations",
|
|
1667
|
+
add: "Add Annotation",
|
|
1668
|
+
content: "Annotation content",
|
|
1669
|
+
required: "Please enter annotation content",
|
|
1670
|
+
maxLength: "Annotation content cannot exceed 500 characters",
|
|
1671
|
+
placeholder: "Please enter your annotation...",
|
|
1672
|
+
edit: "Edit Annotation",
|
|
1673
|
+
delete: "Delete annotation",
|
|
1674
|
+
confirmDelete: "Delete this annotation?",
|
|
1675
|
+
empty: "No annotations"
|
|
1676
|
+
},
|
|
1677
|
+
collection: {
|
|
1678
|
+
title: "Excerpts",
|
|
1679
|
+
list: "Excerpts",
|
|
1680
|
+
delete: "Delete excerpt",
|
|
1681
|
+
confirmDelete: "Delete this excerpt?",
|
|
1682
|
+
empty: "No excerpts"
|
|
1683
|
+
},
|
|
1684
|
+
themeToggle: {
|
|
1685
|
+
switchToLight: "Switch to light mode",
|
|
1686
|
+
switchToDark: "Switch to dark mode"
|
|
1687
|
+
},
|
|
1688
|
+
upload: {
|
|
1689
|
+
clickToUpload: "Click to upload",
|
|
1690
|
+
dragAndDrop: "or drag and drop",
|
|
1691
|
+
maxFileHint: "Maximum {{limit}} files, {{size}}MB each",
|
|
1692
|
+
noFile: "No file provided",
|
|
1693
|
+
canceled: "Upload canceled",
|
|
1694
|
+
fileSizeExceeded: "File size exceeds the maximum limit ({{max}}MB)",
|
|
1695
|
+
undefined: "Upload function is not defined",
|
|
1696
|
+
failedNoUrl: "Upload failed: no URL returned",
|
|
1697
|
+
failed: "Upload failed",
|
|
1698
|
+
noFileToUpload: "No file to upload",
|
|
1699
|
+
maxFileCount: "A maximum of {{limit}} files can be uploaded"
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
};
|
|
1703
|
+
|
|
1704
|
+
// src/i18n/ja-JP.ts
|
|
1705
|
+
var commonJaJP = {
|
|
1706
|
+
// 共通文案
|
|
1707
|
+
common: {
|
|
1708
|
+
copySuccess: "\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",
|
|
1709
|
+
confirm: "OK",
|
|
1710
|
+
cancel: "\u30AD\u30E3\u30F3\u30BB\u30EB",
|
|
1711
|
+
download: "\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9",
|
|
1712
|
+
save: "\u4FDD\u5B58",
|
|
1713
|
+
defaultFileName: "\u30D5\u30A1\u30A4\u30EB",
|
|
1714
|
+
defaultTitle: "\u30D2\u30F3\u30C8",
|
|
1715
|
+
loading: "\u8AAD\u307F\u8FBC\u307F\u4E2D...",
|
|
1716
|
+
// 共通キー(3回以上重複のため抽出)
|
|
1717
|
+
enter: "\u30A2\u30D7\u30EA\u306B\u5165\u308B",
|
|
1718
|
+
applicationCenter: "\u30A2\u30D7\u30EA\u30BB\u30F3\u30BF\u30FC",
|
|
1719
|
+
subscribeSuccess: "\u30B5\u30D6\u30B9\u30AF\u6210\u529F",
|
|
1720
|
+
subscribeConfirm: "{{name}}\u3092\u30B5\u30D6\u30B9\u30AF\u3057\u307E\u3059\u304B\uFF1F",
|
|
1721
|
+
installConfirm: "{{name}}\u3092{{action}}\u3057\u307E\u3059\u304B\uFF1F",
|
|
1722
|
+
prompt: "\u30D2\u30F3\u30C8",
|
|
1723
|
+
dynamicNews: "\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3",
|
|
1724
|
+
noDynamicNews: "\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u306A\u3057"
|
|
1725
|
+
},
|
|
1726
|
+
// utils/request.ts
|
|
1727
|
+
request: {
|
|
1728
|
+
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",
|
|
1729
|
+
requestError: "\u30EA\u30AF\u30A8\u30B9\u30C8\u30A8\u30E9\u30FC\uFF01"
|
|
1730
|
+
},
|
|
1731
|
+
// utils/pattern.ts — バリデーションメッセージ
|
|
1732
|
+
pattern: {
|
|
1733
|
+
mobileInvalid: "\u643A\u5E2F\u96FB\u8A71\u756A\u53F7\u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\uFF01",
|
|
1734
|
+
phoneInvalid: "\u96FB\u8A71\u756A\u53F7\u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\uFF01",
|
|
1735
|
+
taxNoInvalid: "\u7A0E\u756A\u53F7\u306E\u5F62\u5F0F\u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\uFF01",
|
|
1736
|
+
bankCardInvalid: "\u9280\u884C\u30AB\u30FC\u30C9\u756A\u53F7\u306E\u5F62\u5F0F\u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\uFF01",
|
|
1737
|
+
idCardInvalid: "\u8EAB\u5206\u8A3C\u660E\u66F8\u756A\u53F7\u306E\u5F62\u5F0F\u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\uFF01",
|
|
1738
|
+
numberInvalid: "\u5F62\u5F0F\u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\u3002\u518D\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF01",
|
|
1739
|
+
smsCodeInvalid: "\u8A8D\u8A3C\u30B3\u30FC\u30C9\u306F6\u6841\u306E\u6570\u5B57\u3067\u3059",
|
|
1740
|
+
emailInvalid: "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306E\u5F62\u5F0F\u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\uFF01",
|
|
1741
|
+
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",
|
|
1742
|
+
passwordInvalid: "\u30D1\u30B9\u30EF\u30FC\u30C9\u306F8\u301C26\u6587\u5B57\u306E\u82F1\u6570\u5B57\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059",
|
|
1743
|
+
phoneOrMobileInvalid: "\u9023\u7D61\u5148\u96FB\u8A71\u756A\u53F7\u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093",
|
|
1744
|
+
// 補間例:{{value}} は実際の値に置換されます
|
|
1745
|
+
lessThan: "{{value}}\u672A\u6E80\u306B\u3067\u304D\u307E\u305B\u3093",
|
|
1746
|
+
lessThanOrEqual: "{{value}}\u4EE5\u4E0B\u306B\u3067\u304D\u307E\u305B\u3093",
|
|
1747
|
+
greaterThan: "{{value}}\u3092\u8D85\u3048\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",
|
|
1748
|
+
greaterThanOrEqual: "{{value}}\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
1749
|
+
totalLengthExceed: "\u7DCF\u6841\u6570\u306F{{length}}\u6841\u3092\u8D85\u3048\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",
|
|
1750
|
+
integerLengthExceed: "\u6574\u6570\u90E8\u306F{{length}}\u6841\u3092\u8D85\u3048\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",
|
|
1751
|
+
decimalLengthExceed: "\u5C0F\u6570\u90E8\u306F{{length}}\u6841\u3092\u8D85\u3048\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",
|
|
1752
|
+
maxEmailsExceed: "\u6700\u5927{{max}}\u4EF6\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u307E\u3067\u5165\u529B\u3067\u304D\u307E\u3059"
|
|
1753
|
+
},
|
|
1754
|
+
// utils/date.ts
|
|
1755
|
+
date: {
|
|
1756
|
+
yearMonthFormat: "YYYY\u5E74MM\u6708",
|
|
1757
|
+
yearMonthDayFormat: "YYYY\u5E74MM\u6708DD\u65E5"
|
|
1758
|
+
},
|
|
1759
|
+
// SpeechButton 音声ボタン
|
|
1760
|
+
speechButton: {
|
|
1761
|
+
notSupported: "\u73FE\u5728\u306E\u30D6\u30E9\u30A6\u30B6\u306F\u97F3\u58F0\u8A8D\u8B58\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093",
|
|
1762
|
+
permissionDenied: "\u30DE\u30A4\u30AF\u306E\u6A29\u9650\u304C\u62D2\u5426\u3055\u308C\u307E\u3057\u305F",
|
|
1763
|
+
stop: "\u9332\u97F3\u3092\u505C\u6B62",
|
|
1764
|
+
start: "\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u9332\u97F3\u3092\u958B\u59CB"
|
|
1765
|
+
},
|
|
1766
|
+
// MicroApp / Iframe
|
|
1767
|
+
microApp: {
|
|
1768
|
+
loading: "\u8AAD\u307F\u8FBC\u307F\u4E2D..."
|
|
1769
|
+
},
|
|
1770
|
+
iframe: {
|
|
1771
|
+
loading: "\u8AAD\u307F\u8FBC\u307F\u4E2D..."
|
|
1772
|
+
},
|
|
1773
|
+
// LazyComponent 遅延読み込みコンポーネント
|
|
1774
|
+
lazyComponent: {
|
|
1775
|
+
unknownType: "\u4E0D\u660E\u306A\u30BF\u30A4\u30D7\uFF1A{{type}}",
|
|
1776
|
+
componentLoading: "\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D..."
|
|
1777
|
+
},
|
|
1778
|
+
// File ファイルプレビューコンポーネント群
|
|
1779
|
+
filePreview: {
|
|
1780
|
+
title: "\u30D5\u30A1\u30A4\u30EB\u30D7\u30EC\u30D3\u30E5\u30FC",
|
|
1781
|
+
closePreview: "\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u9589\u3058\u308B",
|
|
1782
|
+
htmlPreviewTitle: "HTML \u30D7\u30EC\u30D3\u30E5\u30FC",
|
|
1783
|
+
previewImageAlt: "\u30D7\u30EC\u30D3\u30E5\u30FC\u753B\u50CF",
|
|
1784
|
+
previewNotSupported: "{{suffix}}\u30D5\u30A1\u30A4\u30EB\u306E\u30D7\u30EC\u30D3\u30E5\u30FC\u306B\u306F\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093",
|
|
1785
|
+
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",
|
|
1786
|
+
previewGenerating: "\u30D7\u30EC\u30D3\u30E5\u30FC\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u4E2D...",
|
|
1787
|
+
audioNotSupported: "\u304A\u4F7F\u3044\u306E\u30D6\u30E9\u30A6\u30B6\u306F audio \u30BF\u30B0\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002",
|
|
1788
|
+
videoNotSupported: "\u304A\u4F7F\u3044\u306E\u30D6\u30E9\u30A6\u30B6\u306F video \u30BF\u30B0\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002",
|
|
1789
|
+
requestFailedWithStatus: "\u30EA\u30AF\u30A8\u30B9\u30C8\u5931\u6557\u3001\u30B9\u30C6\u30FC\u30BF\u30B9\u30B3\u30FC\u30C9: {{status}}",
|
|
1790
|
+
emptyResponse: "\u8FD4\u4FE1\u5185\u5BB9\u304C\u7A7A\u3067\u3059",
|
|
1791
|
+
loadFileFailed: "\u30D5\u30A1\u30A4\u30EB\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
1792
|
+
fileParseFailed: "\u30D5\u30A1\u30A4\u30EB\u306E\u8AAD\u307F\u8FBC\u307F\u307E\u305F\u306F\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
1793
|
+
fileUrlInvalid: "\u30D5\u30A1\u30A4\u30EBURL\u304C\u4E0D\u6B63\u3067\u3059",
|
|
1794
|
+
htmlParseFailed: "HTML\u306E\u8AAD\u307F\u8FBC\u307F\u307E\u305F\u306F\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
1795
|
+
docLoadFailed: "\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
1796
|
+
pdfLoadFailed: "PDF\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
1797
|
+
pdfParseFailed: "PDF\u306E\u8AAD\u307F\u8FBC\u307F\u307E\u305F\u306F\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
1798
|
+
pdfUrlInvalid: "PDF\u306EURL\u304C\u4E0D\u6B63\u3067\u3059",
|
|
1799
|
+
pdfPasswordInvalid: "\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u7121\u52B9\u3067\u3059\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\uFF01",
|
|
1800
|
+
pdfPasswordPlaceholder: "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
1801
|
+
pdfSubmit: "\u9001 \u4FE1",
|
|
1802
|
+
pdfInvalidOrDamaged: "\u30D5\u30A1\u30A4\u30EB\u304C\u7121\u52B9\u307E\u305F\u306F\u7834\u640D\u3057\u3066\u3044\u307E\u3059",
|
|
1803
|
+
pdfFileNotFound: "\u30D5\u30A1\u30A4\u30EB\u304C\u5B58\u5728\u3057\u307E\u305B\u3093",
|
|
1804
|
+
pdfUnexpectedResponse: "\u4E88\u671F\u3057\u306A\u3044\u30B5\u30FC\u30D0\u30FC\u30EC\u30B9\u30DD\u30F3\u30B9",
|
|
1805
|
+
pdfLoadDocumentFailed: "\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093",
|
|
1806
|
+
zoomOut: "\u7E2E\u5C0F",
|
|
1807
|
+
zoomIn: "\u62E1\u5927",
|
|
1808
|
+
zoomReset: "\u5143\u306B\u623B\u3059",
|
|
1809
|
+
fitWidth: "\u5E45\u306B\u5408\u308F\u305B\u308B"
|
|
1810
|
+
},
|
|
1811
|
+
// MarkdownEditor リッチテキストエディタ
|
|
1812
|
+
markdownEditor: {
|
|
1813
|
+
mainArea: "\u30E1\u30A4\u30F3\u30B3\u30F3\u30C6\u30F3\u30C4\u30A8\u30EA\u30A2\u3001\u30C6\u30AD\u30B9\u30C8\u3092\u5165\u529B...",
|
|
1814
|
+
unknown: "\u4E0D\u660E",
|
|
1815
|
+
// ツールバー
|
|
1816
|
+
toolbar: {
|
|
1817
|
+
toolbarAria: "\u30A8\u30C7\u30A3\u30BF\u30FC\u30C4\u30FC\u30EB\u30D0\u30FC",
|
|
1818
|
+
quote: "\u9078\u629E\u30C6\u30AD\u30B9\u30C8\u3092\u5F15\u7528",
|
|
1819
|
+
annotation: "\u6CE8\u91C8",
|
|
1820
|
+
excerpt: "\u629C\u7C8B\u30E1\u30E2",
|
|
1821
|
+
undo: "\u5143\u306B\u623B\u3059",
|
|
1822
|
+
redo: "\u3084\u308A\u76F4\u3059",
|
|
1823
|
+
alignLeft: "\u5DE6\u63C3\u3048",
|
|
1824
|
+
alignCenter: "\u4E2D\u592E\u63C3\u3048",
|
|
1825
|
+
alignRight: "\u53F3\u63C3\u3048",
|
|
1826
|
+
alignJustify: "\u4E21\u7AEF\u63C3\u3048",
|
|
1827
|
+
bold: "\u592A\u5B57",
|
|
1828
|
+
italic: "\u659C\u4F53",
|
|
1829
|
+
underline: "\u4E0B\u7DDA",
|
|
1830
|
+
strike: "\u53D6\u308A\u6D88\u3057\u7DDA",
|
|
1831
|
+
code: "\u30B3\u30FC\u30C9",
|
|
1832
|
+
superscript: "\u4E0A\u4ED8\u304D\u6587\u5B57",
|
|
1833
|
+
subscript: "\u4E0B\u4ED8\u304D\u6587\u5B57",
|
|
1834
|
+
bulletList: "\u7B87\u6761\u66F8\u304D",
|
|
1835
|
+
orderedList: "\u756A\u53F7\u4ED8\u304D\u30EA\u30B9\u30C8",
|
|
1836
|
+
taskList: "\u30BF\u30B9\u30AF\u30EA\u30B9\u30C8",
|
|
1837
|
+
listOptions: "\u30EA\u30B9\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3",
|
|
1838
|
+
list: "\u30EA\u30B9\u30C8",
|
|
1839
|
+
blockquote: "\u5F15\u7528\u30D6\u30ED\u30C3\u30AF",
|
|
1840
|
+
codeBlock: "\u30B3\u30FC\u30C9\u30D6\u30ED\u30C3\u30AF",
|
|
1841
|
+
heading: "\u898B\u51FA\u3057",
|
|
1842
|
+
headingLevel: "\u898B\u51FA\u3057 {{level}}",
|
|
1843
|
+
addImage: "\u753B\u50CF\u3092\u8FFD\u52A0",
|
|
1844
|
+
link: "\u30EA\u30F3\u30AF",
|
|
1845
|
+
linkPlaceholder: "\u30EA\u30F3\u30AF\u3092\u8CBC\u308A\u4ED8\u3051...",
|
|
1846
|
+
applyLink: "\u30EA\u30F3\u30AF\u3092\u9069\u7528",
|
|
1847
|
+
openInNewWindow: "\u65B0\u3057\u3044\u30A6\u30A3\u30F3\u30C9\u30A6\u3067\u958B\u304F",
|
|
1848
|
+
removeLink: "\u30EA\u30F3\u30AF\u3092\u524A\u9664"
|
|
1849
|
+
},
|
|
1850
|
+
// ハイライト / 背景色
|
|
1851
|
+
highlight: {
|
|
1852
|
+
toggle: "\u30CF\u30A4\u30E9\u30A4\u30C8\u8868\u793A\u3092\u5207\u308A\u66FF\u3048 ({{color}})",
|
|
1853
|
+
label: "\u80CC\u666F\u8272",
|
|
1854
|
+
textLabel: "\u30C6\u30AD\u30B9\u30C8\u80CC\u666F\u8272",
|
|
1855
|
+
colorOptionAria: "{{label}} \u306E\u30CF\u30A4\u30E9\u30A4\u30C8\u8272",
|
|
1856
|
+
removeBackground: "\u80CC\u666F\u3092\u524A\u9664",
|
|
1857
|
+
removeHighlight: "\u30CF\u30A4\u30E9\u30A4\u30C8\u3092\u524A\u9664",
|
|
1858
|
+
default: "\u30C7\u30D5\u30A9\u30EB\u30C8\u80CC\u666F",
|
|
1859
|
+
gray: "\u30B0\u30EC\u30FC\u80CC\u666F",
|
|
1860
|
+
brown: "\u30D6\u30E9\u30A6\u30F3\u80CC\u666F",
|
|
1861
|
+
orange: "\u30AA\u30EC\u30F3\u30B8\u80CC\u666F",
|
|
1862
|
+
yellow: "\u30A4\u30A8\u30ED\u30FC\u80CC\u666F",
|
|
1863
|
+
green: "\u30B0\u30EA\u30FC\u30F3\u80CC\u666F",
|
|
1864
|
+
blue: "\u30D6\u30EB\u30FC\u80CC\u666F",
|
|
1865
|
+
purple: "\u30D1\u30FC\u30D7\u30EB\u80CC\u666F",
|
|
1866
|
+
pink: "\u30D4\u30F3\u30AF\u80CC\u666F",
|
|
1867
|
+
red: "\u30EC\u30C3\u30C9\u80CC\u666F"
|
|
1868
|
+
},
|
|
1869
|
+
// 注釈
|
|
1870
|
+
annotation: {
|
|
1871
|
+
title: "\u6CE8\u91C8",
|
|
1872
|
+
list: "\u6CE8\u91C8\u30EA\u30B9\u30C8",
|
|
1873
|
+
add: "\u6CE8\u91C8\u3092\u8FFD\u52A0",
|
|
1874
|
+
content: "\u6CE8\u91C8\u5185\u5BB9",
|
|
1875
|
+
required: "\u6CE8\u91C8\u5185\u5BB9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
1876
|
+
maxLength: "\u6CE8\u91C8\u5185\u5BB9\u306F500\u6587\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
1877
|
+
placeholder: "\u6CE8\u91C8\u5185\u5BB9\u3092\u5165\u529B...",
|
|
1878
|
+
edit: "\u6CE8\u91C8\u3092\u7DE8\u96C6",
|
|
1879
|
+
delete: "\u6CE8\u91C8\u3092\u524A\u9664",
|
|
1880
|
+
confirmDelete: "\u3053\u306E\u6CE8\u91C8\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F",
|
|
1881
|
+
empty: "\u6CE8\u91C8\u306F\u3042\u308A\u307E\u305B\u3093"
|
|
1882
|
+
},
|
|
1883
|
+
// 抜粋
|
|
1884
|
+
collection: {
|
|
1885
|
+
title: "\u629C\u7C8B",
|
|
1886
|
+
list: "\u629C\u7C8B\u30EA\u30B9\u30C8",
|
|
1887
|
+
delete: "\u629C\u7C8B\u3092\u524A\u9664",
|
|
1888
|
+
confirmDelete: "\u3053\u306E\u629C\u7C8B\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F",
|
|
1889
|
+
empty: "\u629C\u7C8B\u306F\u3042\u308A\u307E\u305B\u3093"
|
|
1890
|
+
},
|
|
1891
|
+
// ファイル / 画像アップロード
|
|
1892
|
+
themeToggle: {
|
|
1893
|
+
switchToLight: "\u30E9\u30A4\u30C8\u30E2\u30FC\u30C9\u306B\u5207\u308A\u66FF\u3048",
|
|
1894
|
+
switchToDark: "\u30C0\u30FC\u30AF\u30E2\u30FC\u30C9\u306B\u5207\u308A\u66FF\u3048"
|
|
1895
|
+
},
|
|
1896
|
+
upload: {
|
|
1897
|
+
clickToUpload: "\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",
|
|
1898
|
+
dragAndDrop: "\u307E\u305F\u306F\u30C9\u30E9\u30C3\u30B0\uFF06\u30C9\u30ED\u30C3\u30D7",
|
|
1899
|
+
maxFileHint: "\u6700\u5927 {{limit}} \u4EF6\u3001\u5404 {{size}}MB \u307E\u3067",
|
|
1900
|
+
noFile: "\u30D5\u30A1\u30A4\u30EB\u304C\u63D0\u4F9B\u3055\u308C\u3066\u3044\u307E\u305B\u3093",
|
|
1901
|
+
canceled: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306F\u30AD\u30E3\u30F3\u30BB\u30EB\u3055\u308C\u307E\u3057\u305F",
|
|
1902
|
+
fileSizeExceeded: "\u30D5\u30A1\u30A4\u30EB\u30B5\u30A4\u30BA\u304C\u6700\u5927\u5236\u9650\u3092\u8D85\u3048\u3066\u3044\u307E\u3059 ({{max}}MB)",
|
|
1903
|
+
undefined: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u6A5F\u80FD\u304C\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u305B\u3093",
|
|
1904
|
+
failedNoUrl: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u5931\u6557\uFF1AURL\u304C\u8FD4\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
1905
|
+
failed: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
1906
|
+
noFileToUpload: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3059\u308B\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093",
|
|
1907
|
+
maxFileCount: "\u6700\u5927{{limit}}\u4EF6\u307E\u3067\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3067\u304D\u307E\u3059"
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
};
|
|
1911
|
+
var antdLocaleMap = {
|
|
1912
|
+
"zh-CN": zhCN__default.default,
|
|
1913
|
+
"en-US": enUS__default.default,
|
|
1914
|
+
"ja-JP": jaJP__default.default
|
|
1915
|
+
};
|
|
1916
|
+
var dayjsLocaleMap = {
|
|
1917
|
+
"zh-CN": "zh-cn",
|
|
1918
|
+
"en-US": "en",
|
|
1919
|
+
"ja-JP": "ja"
|
|
1920
|
+
};
|
|
1921
|
+
var LocaleProvider = ({ children, ...rest }) => {
|
|
1922
|
+
const lang = getLang();
|
|
1923
|
+
dayjs__default.default.locale(dayjsLocaleMap[lang]);
|
|
1924
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.ConfigProvider, { locale: antdLocaleMap[lang], ...rest, children });
|
|
1925
|
+
};
|
|
1926
|
+
|
|
1927
|
+
// src/i18n/index.ts
|
|
1928
|
+
var DEFAULT_LNG = "zh-CN";
|
|
1929
|
+
var LANG_KEY = "ns-lang";
|
|
1930
|
+
var langManager = createTokenManager({ key: LANG_KEY });
|
|
1931
|
+
function getLang() {
|
|
1932
|
+
return langManager.get() || DEFAULT_LNG;
|
|
1933
|
+
}
|
|
1934
|
+
var i18n = i18next.createInstance({
|
|
1935
|
+
lng: DEFAULT_LNG,
|
|
1936
|
+
fallbackLng: DEFAULT_LNG,
|
|
1937
|
+
defaultNS: NS_COMMON,
|
|
1938
|
+
interpolation: { escapeValue: false },
|
|
1939
|
+
resources: { [DEFAULT_LNG]: { [NS_COMMON]: commonZhCN } }
|
|
1940
|
+
}).use(reactI18next.initReactI18next);
|
|
1941
|
+
void i18n.init();
|
|
1942
|
+
function addBundledResource(lng, ns, res) {
|
|
1943
|
+
if (lng === DEFAULT_LNG && ns === NS_COMMON) return;
|
|
1944
|
+
i18n.addResourceBundle(lng, ns, res, true, true);
|
|
1945
|
+
}
|
|
1946
|
+
function initI18n(options = {}) {
|
|
1947
|
+
const { lng = getLang(), resources } = options;
|
|
1948
|
+
for (const [l, namespaces] of Object.entries(resources ?? {})) {
|
|
1949
|
+
for (const [ns, messages] of Object.entries(namespaces)) {
|
|
1950
|
+
i18n.addResourceBundle(l, ns, messages, true, true);
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
switchLang(lng);
|
|
1954
|
+
return i18n;
|
|
1955
|
+
}
|
|
1956
|
+
function switchLang(lng, reload = false) {
|
|
1957
|
+
langManager.set(lng);
|
|
1958
|
+
if (reload) {
|
|
1959
|
+
window?.top?.location.reload();
|
|
1960
|
+
} else {
|
|
1961
|
+
i18n.changeLanguage(lng);
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
function useTranslation(namespace) {
|
|
1965
|
+
return reactI18next.useTranslation(namespace, { useSuspense: false });
|
|
1966
|
+
}
|
|
1967
|
+
function getI18n() {
|
|
1968
|
+
return i18n;
|
|
1969
|
+
}
|
|
1970
|
+
function t(key, options) {
|
|
1971
|
+
return i18n.t(key, options);
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
// src/components/File/styles.module.less
|
|
1975
|
+
var styles_module_default = {
|
|
1976
|
+
nsPreviewImage: "styles_module_nsPreviewImage",
|
|
1977
|
+
nsPreviewPdf: "styles_module_nsPreviewPdf",
|
|
1978
|
+
pdfToolbar: "styles_module_pdfToolbar",
|
|
1979
|
+
nsPreviewPdfImage: "styles_module_nsPreviewPdfImage",
|
|
1980
|
+
pdfImageNav: "styles_module_pdfImageNav",
|
|
1981
|
+
pdfImageNavItem: "styles_module_pdfImageNavItem",
|
|
1982
|
+
pdfImageNavItemImgWrapper: "styles_module_pdfImageNavItemImgWrapper",
|
|
1983
|
+
pdfImageNavItemActive: "styles_module_pdfImageNavItemActive",
|
|
1984
|
+
pdfImageNavItemImg: "styles_module_pdfImageNavItemImg",
|
|
1985
|
+
pdfImageNavItemTip: "styles_module_pdfImageNavItemTip",
|
|
1986
|
+
pdfImageBody: "styles_module_pdfImageBody",
|
|
1987
|
+
pdfImageBodyToolbar: "styles_module_pdfImageBodyToolbar",
|
|
1988
|
+
pdfImageBodyItem: "styles_module_pdfImageBodyItem",
|
|
1989
|
+
pdfImageBodyItemInnerWrapper: "styles_module_pdfImageBodyItemInnerWrapper",
|
|
1990
|
+
pdfImageBodyItemInner: "styles_module_pdfImageBodyItemInner",
|
|
1991
|
+
pdfImageBodyItemActive: "styles_module_pdfImageBodyItemActive",
|
|
1992
|
+
pdfImageBodyItemImg: "styles_module_pdfImageBodyItemImg",
|
|
1993
|
+
nsPreviewVideo: "styles_module_nsPreviewVideo",
|
|
1994
|
+
nsPreviewAudio: "styles_module_nsPreviewAudio",
|
|
1995
|
+
nsPreviewDocx: "styles_module_nsPreviewDocx",
|
|
1996
|
+
docxToolbar: "styles_module_docxToolbar",
|
|
1997
|
+
docxContent: "styles_module_docxContent",
|
|
1998
|
+
stateBody: "styles_module_stateBody",
|
|
1999
|
+
pdfContainer: "styles_module_pdfContainer",
|
|
2000
|
+
floatingToolbar: "styles_module_floatingToolbar",
|
|
2001
|
+
divider: "styles_module_divider",
|
|
2002
|
+
pdfBody: "styles_module_pdfBody",
|
|
2003
|
+
pdfDocument: "styles_module_pdfDocument",
|
|
2004
|
+
pdfPage: "styles_module_pdfPage"
|
|
2005
|
+
};
|
|
2006
|
+
var AudioPlayer_default = ({ fileUrl }) => {
|
|
2007
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
2008
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("audio", { controls: true, className: styles_module_default.nsPreviewAudio, children: [
|
|
2009
|
+
/* @__PURE__ */ jsxRuntime.jsx("source", { src: fileUrl, type: "audio/mpeg" }),
|
|
2010
|
+
t2("filePreview.audioNotSupported")
|
|
2011
|
+
] }, fileUrl);
|
|
2012
|
+
};
|
|
1303
2013
|
var DocxPreview_default = ({ fileUrl, scale = 1 }) => {
|
|
2014
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
1304
2015
|
const containerRef = React3.useRef(null);
|
|
1305
2016
|
const [zoomRatio, setZoomRatio] = React3.useState(scale);
|
|
1306
2017
|
React3.useEffect(() => {
|
|
@@ -1323,7 +2034,7 @@ var DocxPreview_default = ({ fileUrl, scale = 1 }) => {
|
|
|
1323
2034
|
});
|
|
1324
2035
|
}).catch((err) => {
|
|
1325
2036
|
console.error("docx-preview \u6E32\u67D3\u5931\u8D25:", err);
|
|
1326
|
-
if (containerRef.current) containerRef.current.innerHTML =
|
|
2037
|
+
if (containerRef.current) containerRef.current.innerHTML = `<p class="text-center">${t2("filePreview.docLoadFailed")}</p>`;
|
|
1327
2038
|
});
|
|
1328
2039
|
}, [fileUrl]);
|
|
1329
2040
|
const zoomIn = () => setZoomRatio((z) => Math.min(z + 0.1, 3));
|
|
@@ -1333,9 +2044,9 @@ var DocxPreview_default = ({ fileUrl, scale = 1 }) => {
|
|
|
1333
2044
|
};
|
|
1334
2045
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames2__default.default(styles_module_default.nsPreviewDocx, "height-full", "width-full"), children: [
|
|
1335
2046
|
/* @__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: "
|
|
2047
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomOut, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.MinusCircleOutlined, {}), title: t2("filePreview.zoomOut") }),
|
|
2048
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomIn, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusCircleOutlined, {}), title: t2("filePreview.zoomIn") }),
|
|
2049
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: resetZoom, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.RedoOutlined, {}), title: t2("filePreview.zoomReset") })
|
|
1339
2050
|
] }),
|
|
1340
2051
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames2__default.default(styles_module_default.docxContent, "height-full", "scroll-fade-in"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1341
2052
|
"div",
|
|
@@ -1413,9 +2124,10 @@ var FileIcon_default = ({ suffix, fontSize = 22 }) => {
|
|
|
1413
2124
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: styles, children: Icon });
|
|
1414
2125
|
};
|
|
1415
2126
|
var VideoPlayer_default = ({ fileUrl }) => {
|
|
2127
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
1416
2128
|
return /* @__PURE__ */ jsxRuntime.jsxs("video", { controls: true, className: styles_module_default.nsPreviewVideo, children: [
|
|
1417
2129
|
/* @__PURE__ */ jsxRuntime.jsx("source", { src: fileUrl, type: "video/mp4" }),
|
|
1418
|
-
"
|
|
2130
|
+
t2("filePreview.videoNotSupported")
|
|
1419
2131
|
] }, fileUrl);
|
|
1420
2132
|
};
|
|
1421
2133
|
|
|
@@ -1428,6 +2140,7 @@ var baseComponentMap = {
|
|
|
1428
2140
|
};
|
|
1429
2141
|
var lazyCache = /* @__PURE__ */ new Map();
|
|
1430
2142
|
var LazyComponent_default = ({ type, customComponents, unknownContent, ...rest }) => {
|
|
2143
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
1431
2144
|
const loader2 = customComponents?.[type] || baseComponentMap[type];
|
|
1432
2145
|
const LazyComponent = React3.useMemo(() => {
|
|
1433
2146
|
if (!loader2) return null;
|
|
@@ -1437,11 +2150,11 @@ var LazyComponent_default = ({ type, customComponents, unknownContent, ...rest }
|
|
|
1437
2150
|
lazyCache.set(type, component);
|
|
1438
2151
|
return component;
|
|
1439
2152
|
}, [loader2]);
|
|
1440
|
-
if (!LazyComponent) return unknownContent || /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { title:
|
|
2153
|
+
if (!LazyComponent) return unknownContent || /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { title: t2("lazyComponent.unknownType", { type }), type: "warning" });
|
|
1441
2154
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1442
2155
|
React3.Suspense,
|
|
1443
2156
|
{
|
|
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: "
|
|
2157
|
+
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
2158
|
children: /* @__PURE__ */ jsxRuntime.jsx(LazyComponent, { ...rest })
|
|
1446
2159
|
}
|
|
1447
2160
|
);
|
|
@@ -1553,12 +2266,13 @@ var RenderMarkdown_default = ({ content = "", searchValue, customComponents, ...
|
|
|
1553
2266
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ns-markdown", children: reactContent });
|
|
1554
2267
|
};
|
|
1555
2268
|
var MarkdownPreview_default = ({ fileUrl, searchValue, asPlainText }) => {
|
|
2269
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
1556
2270
|
const [content, setContent] = React3.useState("");
|
|
1557
2271
|
const [error, setError] = React3.useState("");
|
|
1558
2272
|
const fetchMarkdown = async () => {
|
|
1559
2273
|
const res = await fetch(fileUrl);
|
|
1560
2274
|
if (res.status !== 200) {
|
|
1561
|
-
throw new Error(
|
|
2275
|
+
throw new Error(t2("filePreview.requestFailedWithStatus", { status: res.status }));
|
|
1562
2276
|
}
|
|
1563
2277
|
const buffer = await res.arrayBuffer();
|
|
1564
2278
|
let markdownText = "";
|
|
@@ -1570,7 +2284,7 @@ var MarkdownPreview_default = ({ fileUrl, searchValue, asPlainText }) => {
|
|
|
1570
2284
|
markdownText = gbkDecoder.decode(buffer);
|
|
1571
2285
|
}
|
|
1572
2286
|
if (!markdownText) {
|
|
1573
|
-
throw new Error("
|
|
2287
|
+
throw new Error(t2("filePreview.emptyResponse"));
|
|
1574
2288
|
}
|
|
1575
2289
|
return markdownText;
|
|
1576
2290
|
};
|
|
@@ -1582,10 +2296,10 @@ var MarkdownPreview_default = ({ fileUrl, searchValue, asPlainText }) => {
|
|
|
1582
2296
|
const content2 = await fetchMarkdown();
|
|
1583
2297
|
setContent(content2);
|
|
1584
2298
|
} catch {
|
|
1585
|
-
setError("
|
|
2299
|
+
setError(t2("filePreview.fileParseFailed"));
|
|
1586
2300
|
}
|
|
1587
2301
|
} else {
|
|
1588
|
-
setError("
|
|
2302
|
+
setError(t2("filePreview.fileUrlInvalid"));
|
|
1589
2303
|
}
|
|
1590
2304
|
};
|
|
1591
2305
|
React3.useEffect(() => {
|
|
@@ -2255,17 +2969,18 @@ var THUMB_IMG_HEIGHT = 514;
|
|
|
2255
2969
|
var MAIN_IMG_HEIGHT = 800;
|
|
2256
2970
|
var MAIN_IMG_WIDTH = 600;
|
|
2257
2971
|
var PdfImagePreview_default = ({ fileUrl, pageNo, scale = 1, isHasThumbnails = true, onSetPageNo }) => {
|
|
2972
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
2258
2973
|
const [images, setImages] = React3.useState([]);
|
|
2259
2974
|
const [currentIndex, setCurrentIndex, getCurrentIndex] = useRefState_default(0);
|
|
2260
2975
|
const [error, setError] = React3.useState("");
|
|
2261
2976
|
const fetchPdfImages = async () => {
|
|
2262
2977
|
const res = await fetch(fileUrl);
|
|
2263
2978
|
if (res.status !== 200) {
|
|
2264
|
-
throw new Error(
|
|
2979
|
+
throw new Error(t2("filePreview.requestFailedWithStatus", { status: res.status }));
|
|
2265
2980
|
}
|
|
2266
2981
|
const { data } = await res.json();
|
|
2267
2982
|
if (!data?.items?.length) {
|
|
2268
|
-
throw new Error("
|
|
2983
|
+
throw new Error(t2("filePreview.emptyResponse"));
|
|
2269
2984
|
}
|
|
2270
2985
|
setImages(data.items);
|
|
2271
2986
|
};
|
|
@@ -2277,10 +2992,10 @@ var PdfImagePreview_default = ({ fileUrl, pageNo, scale = 1, isHasThumbnails = t
|
|
|
2277
2992
|
try {
|
|
2278
2993
|
await fetchPdfImages();
|
|
2279
2994
|
} catch (error2) {
|
|
2280
|
-
setError("
|
|
2995
|
+
setError(t2("filePreview.pdfParseFailed"));
|
|
2281
2996
|
}
|
|
2282
2997
|
} else {
|
|
2283
|
-
setError("
|
|
2998
|
+
setError(t2("filePreview.pdfUrlInvalid"));
|
|
2284
2999
|
}
|
|
2285
3000
|
};
|
|
2286
3001
|
React3.useEffect(() => {
|
|
@@ -2420,9 +3135,9 @@ var PdfImagePreview_default = ({ fileUrl, pageNo, scale = 1, isHasThumbnails = t
|
|
|
2420
3135
|
) }) }),
|
|
2421
3136
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames2__default.default("height-full", styles_module_default.pdfImageBody), children: [
|
|
2422
3137
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 6, align: "center", className: styles_module_default.pdfImageBodyToolbar, children: [
|
|
2423
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomOut, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.MinusCircleOutlined, {}), title: "
|
|
2424
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomIn, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusCircleOutlined, {}), title: "
|
|
2425
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomFitWidth, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ColumnWidthOutlined, {}), title: "
|
|
3138
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomOut, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.MinusCircleOutlined, {}), title: t2("filePreview.zoomOut") }),
|
|
3139
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomIn, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusCircleOutlined, {}), title: t2("filePreview.zoomIn") }),
|
|
3140
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomFitWidth, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ColumnWidthOutlined, {}), title: t2("filePreview.fitWidth") })
|
|
2426
3141
|
] }),
|
|
2427
3142
|
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef, className: "height-full scroll-fade-in", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2428
3143
|
"div",
|
|
@@ -2470,6 +3185,7 @@ var ProtectedView = ({
|
|
|
2470
3185
|
verifyPassword,
|
|
2471
3186
|
onVerifyPasswordEnd
|
|
2472
3187
|
}) => {
|
|
3188
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
2473
3189
|
const [form] = antd.Form.useForm();
|
|
2474
3190
|
const onSubmit = () => {
|
|
2475
3191
|
form.validateFields().then((values) => {
|
|
@@ -2480,10 +3196,10 @@ var ProtectedView = ({
|
|
|
2480
3196
|
});
|
|
2481
3197
|
};
|
|
2482
3198
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "center", align: "center", className: "height-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: 300 }, children: [
|
|
2483
|
-
passwordStatus === core$1.PasswordStatus.WrongPassword && /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { title: "
|
|
3199
|
+
passwordStatus === core$1.PasswordStatus.WrongPassword && /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { title: t2("filePreview.pdfPasswordInvalid"), type: "error" }),
|
|
2484
3200
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Form, { form, size: "large", className: "m-t-24", children: [
|
|
2485
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { name: "password", rules: [{ required: true, message: "
|
|
2486
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "primary", onClick: onSubmit, children: "
|
|
3201
|
+
/* @__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") }) }),
|
|
3202
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "primary", onClick: onSubmit, children: t2("filePreview.pdfSubmit") }) })
|
|
2487
3203
|
] })
|
|
2488
3204
|
] }) });
|
|
2489
3205
|
};
|
|
@@ -2502,6 +3218,7 @@ var openLinksNewTabPlugin = () => {
|
|
|
2502
3218
|
};
|
|
2503
3219
|
};
|
|
2504
3220
|
var PdfPreview_default = ({ password, fileUrl, pageNo = 1, scale = 1, isHasThumbnails = true, onSetPassword, onSetPageNo }) => {
|
|
3221
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
2505
3222
|
const embedRef = React3.useRef(null);
|
|
2506
3223
|
const [sizes, setSizes] = React3.useState([0]);
|
|
2507
3224
|
const [docLoaded, setDocLoaded, getDocLoaded] = useRefState_default(false);
|
|
@@ -2575,19 +3292,19 @@ var PdfPreview_default = ({ password, fileUrl, pageNo = 1, scale = 1, isHasThumb
|
|
|
2575
3292
|
let message3 = "";
|
|
2576
3293
|
switch (error.name) {
|
|
2577
3294
|
case "InvalidPDFException":
|
|
2578
|
-
message3 = "
|
|
3295
|
+
message3 = t2("filePreview.pdfInvalidOrDamaged");
|
|
2579
3296
|
break;
|
|
2580
3297
|
case "MissingPDFException":
|
|
2581
|
-
message3 = "
|
|
3298
|
+
message3 = t2("filePreview.pdfFileNotFound");
|
|
2582
3299
|
break;
|
|
2583
3300
|
case "UnexpectedResponseException":
|
|
2584
|
-
message3 = "
|
|
3301
|
+
message3 = t2("filePreview.pdfUnexpectedResponse");
|
|
2585
3302
|
break;
|
|
2586
3303
|
// case 'CMapReaderFactory not initialized':
|
|
2587
3304
|
// message = '字体映射文件加载失败,请刷新页面重试'
|
|
2588
3305
|
// break
|
|
2589
3306
|
default:
|
|
2590
|
-
message3 = "
|
|
3307
|
+
message3 = t2("filePreview.pdfLoadDocumentFailed");
|
|
2591
3308
|
break;
|
|
2592
3309
|
}
|
|
2593
3310
|
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 }) });
|
|
@@ -2658,6 +3375,7 @@ var PdfPreview_default = ({ password, fileUrl, pageNo = 1, scale = 1, isHasThumb
|
|
|
2658
3375
|
] }) }) });
|
|
2659
3376
|
};
|
|
2660
3377
|
var FilePreview_default = ({ suffix, fileUrl, pdfParams, password, searchValue, emptyProps, onSetPassword }) => {
|
|
3378
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
2661
3379
|
const Preview = React3.useMemo(() => {
|
|
2662
3380
|
if (!fileUrl) {
|
|
2663
3381
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { ...emptyProps });
|
|
@@ -2667,7 +3385,7 @@ var FilePreview_default = ({ suffix, fileUrl, pdfParams, password, searchValue,
|
|
|
2667
3385
|
case "JPG":
|
|
2668
3386
|
case "JPEG":
|
|
2669
3387
|
case "GIF":
|
|
2670
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Image, { classNames: { root: styles_module_default.nsPreviewImage }, src: fileUrl, alt: "
|
|
3388
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Image, { classNames: { root: styles_module_default.nsPreviewImage }, src: fileUrl, alt: t2("filePreview.previewImageAlt") });
|
|
2671
3389
|
case "PDF":
|
|
2672
3390
|
return /* @__PURE__ */ jsxRuntime.jsx(PdfPreview_default, { fileUrl, ...pdfParams, password, onSetPassword });
|
|
2673
3391
|
case "PDF_IMG":
|
|
@@ -2687,11 +3405,25 @@ var FilePreview_default = ({ suffix, fileUrl, pdfParams, password, searchValue,
|
|
|
2687
3405
|
case "DOCX":
|
|
2688
3406
|
return /* @__PURE__ */ jsxRuntime.jsx(DocxPreview_default, { fileUrl });
|
|
2689
3407
|
default:
|
|
2690
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Result, { subTitle:
|
|
3408
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Result, { subTitle: t2("filePreview.previewNotSupported", { suffix: suffix || "" }) });
|
|
2691
3409
|
}
|
|
2692
3410
|
}, [suffix, fileUrl, pdfParams]);
|
|
2693
3411
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "center", align: "center", className: "height-full", children: Preview });
|
|
2694
3412
|
};
|
|
3413
|
+
var FilePreviewDrawer_default = ({ open, title, onClose, ...props }) => {
|
|
3414
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
3415
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3416
|
+
antd.Drawer,
|
|
3417
|
+
{
|
|
3418
|
+
title: title || t2("filePreview.title"),
|
|
3419
|
+
push: false,
|
|
3420
|
+
size: "100%",
|
|
3421
|
+
open,
|
|
3422
|
+
onClose,
|
|
3423
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(FilePreview_default, { ...props })
|
|
3424
|
+
}
|
|
3425
|
+
);
|
|
3426
|
+
};
|
|
2695
3427
|
Editor.loader.config({ monaco: monaco__namespace });
|
|
2696
3428
|
var getLanguage = (suffix) => {
|
|
2697
3429
|
switch (suffix.toLowerCase()) {
|
|
@@ -2731,6 +3463,7 @@ var getLanguage = (suffix) => {
|
|
|
2731
3463
|
}
|
|
2732
3464
|
};
|
|
2733
3465
|
var CodePreview = ({ fileUrl, suffix }) => {
|
|
3466
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
2734
3467
|
const [content, setContent] = React3.useState("");
|
|
2735
3468
|
const [error, setError] = React3.useState("");
|
|
2736
3469
|
const [loading, setLoading] = React3.useState(false);
|
|
@@ -2740,7 +3473,7 @@ var CodePreview = ({ fileUrl, suffix }) => {
|
|
|
2740
3473
|
};
|
|
2741
3474
|
const res = await fetch(fileUrl, { headers, signal });
|
|
2742
3475
|
if (res.status !== 200) {
|
|
2743
|
-
throw new Error(
|
|
3476
|
+
throw new Error(t2("filePreview.requestFailedWithStatus", { status: res.status }));
|
|
2744
3477
|
}
|
|
2745
3478
|
const buffer = await res.arrayBuffer();
|
|
2746
3479
|
let text = "";
|
|
@@ -2764,7 +3497,7 @@ var CodePreview = ({ fileUrl, suffix }) => {
|
|
|
2764
3497
|
await fetchContent(controller.signal);
|
|
2765
3498
|
} catch (error2) {
|
|
2766
3499
|
if (!controller.signal.aborted) {
|
|
2767
|
-
setError("
|
|
3500
|
+
setError(t2("filePreview.loadFileFailed"));
|
|
2768
3501
|
}
|
|
2769
3502
|
} finally {
|
|
2770
3503
|
if (!controller.signal.aborted) {
|
|
@@ -2914,6 +3647,7 @@ var PdfPage = React3__namespace.default.memo(({ pdf, pageNumber, scale, scrollCo
|
|
|
2914
3647
|
);
|
|
2915
3648
|
});
|
|
2916
3649
|
var DocumentPreview = ({ fileUrl, previewEnabled = true }) => {
|
|
3650
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
2917
3651
|
const [loading, setLoading] = React3.useState(false);
|
|
2918
3652
|
const [pdf, setPdf] = React3.useState(null);
|
|
2919
3653
|
const [numPages, setNumPages] = React3.useState(0);
|
|
@@ -2973,9 +3707,9 @@ var DocumentPreview = ({ fileUrl, previewEnabled = true }) => {
|
|
|
2973
3707
|
if (aborted) return;
|
|
2974
3708
|
const message3 = e?.message;
|
|
2975
3709
|
if (typeof message3 === "string" && message3.includes("cancelled")) ; else if (typeof message3 === "string" && message3.includes("(903)")) {
|
|
2976
|
-
setError("
|
|
3710
|
+
setError(t2("filePreview.previewGenerating"));
|
|
2977
3711
|
} else {
|
|
2978
|
-
setError(message3 || "
|
|
3712
|
+
setError(message3 || t2("filePreview.pdfLoadFailed"));
|
|
2979
3713
|
}
|
|
2980
3714
|
} finally {
|
|
2981
3715
|
if (!aborted) {
|
|
@@ -3080,7 +3814,7 @@ var DocumentPreview = ({ fileUrl, previewEnabled = true }) => {
|
|
|
3080
3814
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusOutlined, {}), size: "small", onClick: onZoomIn, disabled: scale >= MAX_SCALE })
|
|
3081
3815
|
] });
|
|
3082
3816
|
if (!previewEnabled) {
|
|
3083
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { className: styles_module_default.stateBody, children: "
|
|
3817
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { className: styles_module_default.stateBody, children: t2("filePreview.closePreview") });
|
|
3084
3818
|
}
|
|
3085
3819
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_module_default.pdfContainer, children: [
|
|
3086
3820
|
toolbar,
|
|
@@ -3089,6 +3823,7 @@ var DocumentPreview = ({ fileUrl, previewEnabled = true }) => {
|
|
|
3089
3823
|
};
|
|
3090
3824
|
var DocumentPreview_default = DocumentPreview;
|
|
3091
3825
|
var HtmlPreview = ({ fileUrl }) => {
|
|
3826
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
3092
3827
|
const [content, setContent] = React3.useState("");
|
|
3093
3828
|
const [error, setError] = React3.useState("");
|
|
3094
3829
|
const [loading, setLoading] = React3.useState(false);
|
|
@@ -3101,7 +3836,7 @@ var HtmlPreview = ({ fileUrl }) => {
|
|
|
3101
3836
|
signal
|
|
3102
3837
|
});
|
|
3103
3838
|
if (res.status !== 200) {
|
|
3104
|
-
throw new Error(
|
|
3839
|
+
throw new Error(t2("filePreview.requestFailedWithStatus", { status: res.status }));
|
|
3105
3840
|
}
|
|
3106
3841
|
const buffer = await res.arrayBuffer();
|
|
3107
3842
|
let htmlText = "";
|
|
@@ -3113,7 +3848,7 @@ var HtmlPreview = ({ fileUrl }) => {
|
|
|
3113
3848
|
htmlText = gbkDecoder.decode(buffer);
|
|
3114
3849
|
}
|
|
3115
3850
|
if (!htmlText) {
|
|
3116
|
-
throw new Error("
|
|
3851
|
+
throw new Error(t2("filePreview.emptyResponse"));
|
|
3117
3852
|
}
|
|
3118
3853
|
setContent(htmlText);
|
|
3119
3854
|
};
|
|
@@ -3128,7 +3863,7 @@ var HtmlPreview = ({ fileUrl }) => {
|
|
|
3128
3863
|
await fetchHtml(controller.signal);
|
|
3129
3864
|
} catch (error2) {
|
|
3130
3865
|
if (!controller.signal.aborted) {
|
|
3131
|
-
setError("
|
|
3866
|
+
setError(t2("filePreview.htmlParseFailed"));
|
|
3132
3867
|
}
|
|
3133
3868
|
} finally {
|
|
3134
3869
|
if (!controller.signal.aborted) {
|
|
@@ -3148,12 +3883,13 @@ var HtmlPreview = ({ fileUrl }) => {
|
|
|
3148
3883
|
srcDoc: content,
|
|
3149
3884
|
style: { width: "100%", height: "100%", border: "none" },
|
|
3150
3885
|
sandbox: "allow-scripts allow-same-origin allow-popups allow-forms",
|
|
3151
|
-
title: "
|
|
3886
|
+
title: t2("filePreview.htmlPreviewTitle")
|
|
3152
3887
|
}
|
|
3153
3888
|
) : null });
|
|
3154
3889
|
};
|
|
3155
3890
|
var HtmlPreview_default = HtmlPreview;
|
|
3156
3891
|
var luyaFilePreview_default = ({ suffix, fileUrl, emptyProps, fileName }) => {
|
|
3892
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
3157
3893
|
const extension = suffix ? suffix : getFileSuffixName(fileName || "");
|
|
3158
3894
|
const Preview = React3.useMemo(() => {
|
|
3159
3895
|
if (!fileUrl) {
|
|
@@ -3169,7 +3905,7 @@ var luyaFilePreview_default = ({ suffix, fileUrl, emptyProps, fileName }) => {
|
|
|
3169
3905
|
case "SVG":
|
|
3170
3906
|
case "ICO":
|
|
3171
3907
|
case "TIFF":
|
|
3172
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Image, { classNames: { root: styles_module_default.nsPreviewImage }, src: fileUrl, alt: "
|
|
3908
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Image, { classNames: { root: styles_module_default.nsPreviewImage }, src: fileUrl, alt: t2("filePreview.previewImageAlt") });
|
|
3173
3909
|
case "DOC":
|
|
3174
3910
|
case "DOCX":
|
|
3175
3911
|
case "PDF":
|
|
@@ -3214,30 +3950,18 @@ var luyaFilePreview_default = ({ suffix, fileUrl, emptyProps, fileName }) => {
|
|
|
3214
3950
|
case "TXT":
|
|
3215
3951
|
return /* @__PURE__ */ jsxRuntime.jsx(MarkdownPreview_default, { fileUrl, asPlainText: true });
|
|
3216
3952
|
default:
|
|
3217
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Result, { subTitle:
|
|
3953
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Result, { subTitle: t2("filePreview.previewNotSupportedDownload", { suffix: suffix || "" }) });
|
|
3218
3954
|
}
|
|
3219
3955
|
}, [suffix, fileUrl, fileName]);
|
|
3220
3956
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "center", align: "center", className: "height-full p-t-16 p-b-16 p-l-16", children: Preview });
|
|
3221
3957
|
};
|
|
3222
|
-
var FilePreviewDrawer_default = ({ open, title = "\u6587\u4EF6\u9884\u89C8", onClose, ...props }) => {
|
|
3223
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3224
|
-
antd.Drawer,
|
|
3225
|
-
{
|
|
3226
|
-
title,
|
|
3227
|
-
push: false,
|
|
3228
|
-
size: "100%",
|
|
3229
|
-
open,
|
|
3230
|
-
onClose,
|
|
3231
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(FilePreview_default, { ...props })
|
|
3232
|
-
}
|
|
3233
|
-
);
|
|
3234
|
-
};
|
|
3235
3958
|
|
|
3236
3959
|
// src/components/MicroApp/styles.module.less
|
|
3237
3960
|
var styles_module_default3 = {
|
|
3238
3961
|
microApp: "styles_module_microApp"
|
|
3239
3962
|
};
|
|
3240
3963
|
var MicroApp_default = ({ name, url, className, onMounted, onError, data, ...rest }) => {
|
|
3964
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
3241
3965
|
const [loading, setLoading] = React3.useState(false);
|
|
3242
3966
|
React3.useEffect(() => {
|
|
3243
3967
|
setLoading(true);
|
|
@@ -3252,10 +3976,10 @@ var MicroApp_default = ({ name, url, className, onMounted, onError, data, ...res
|
|
|
3252
3976
|
};
|
|
3253
3977
|
const microAppData = React3.useMemo(() => {
|
|
3254
3978
|
const parentMainSource = window?.microApp?.getData?.()?.mainSource || [];
|
|
3255
|
-
return { mainSource: [...parentMainSource, name], ...data };
|
|
3979
|
+
return { [LANG_KEY]: getLang(), mainSource: [...parentMainSource, name], ...data };
|
|
3256
3980
|
}, [data, name]);
|
|
3257
3981
|
const TagName = microApp__default.default.tagName || "micro-app";
|
|
3258
|
-
return /* @__PURE__ */ jsxCustomEvent__default.default(antd.Spin, { spinning: loading, classNames: { root: "full-spin" }, description: "
|
|
3982
|
+
return /* @__PURE__ */ jsxCustomEvent__default.default(antd.Spin, { spinning: loading, classNames: { root: "full-spin" }, description: t2("microApp.loading") }, /* @__PURE__ */ jsxCustomEvent__default.default(
|
|
3259
3983
|
TagName,
|
|
3260
3984
|
{
|
|
3261
3985
|
name,
|
|
@@ -3344,10 +4068,12 @@ var styles_module_default4 = {
|
|
|
3344
4068
|
iframe: "styles_module_iframe"
|
|
3345
4069
|
};
|
|
3346
4070
|
var Iframe_default = React3.forwardRef(({ defaultMainSource, id, src, className, onLoad }, ref) => {
|
|
4071
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
3347
4072
|
const [loading, setLoading] = React3.useState(false);
|
|
3348
4073
|
const finalSrc = React3.useMemo(() => {
|
|
3349
|
-
|
|
3350
|
-
|
|
4074
|
+
const baseUrl = addUrlLastSlash(setUrlMainSource(src, location.href, defaultMainSource));
|
|
4075
|
+
return buildUrlParams({ v: Date.now(), [LANG_KEY]: getLang() }, baseUrl);
|
|
4076
|
+
}, [src, defaultMainSource]);
|
|
3351
4077
|
const onHandleLoad = () => {
|
|
3352
4078
|
setLoading(false);
|
|
3353
4079
|
onLoad?.();
|
|
@@ -3355,7 +4081,7 @@ var Iframe_default = React3.forwardRef(({ defaultMainSource, id, src, className,
|
|
|
3355
4081
|
React3.useEffect(() => {
|
|
3356
4082
|
setLoading(true);
|
|
3357
4083
|
}, [src]);
|
|
3358
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: loading, classNames: { root: "full-spin" }, description: "
|
|
4084
|
+
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(
|
|
3359
4085
|
"iframe",
|
|
3360
4086
|
{
|
|
3361
4087
|
id,
|
|
@@ -4035,24 +4761,37 @@ function useIsBreakpoint(mode = "max", breakpoint = 768) {
|
|
|
4035
4761
|
}
|
|
4036
4762
|
var { TextArea } = antd.Input;
|
|
4037
4763
|
var AnnotationModal_default = ({ visible, onCancel, onConfirm }) => {
|
|
4764
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
4038
4765
|
const [form] = antd.Form.useForm();
|
|
4039
4766
|
const handleOk = async () => {
|
|
4040
4767
|
const values = await form.validateFields();
|
|
4041
4768
|
onConfirm(values.content.trim());
|
|
4042
4769
|
onCancel();
|
|
4043
4770
|
};
|
|
4044
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4045
|
-
antd.
|
|
4771
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4772
|
+
antd.Modal,
|
|
4046
4773
|
{
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4774
|
+
title: t2("markdownEditor.annotation.add"),
|
|
4775
|
+
open: visible,
|
|
4776
|
+
onOk: handleOk,
|
|
4777
|
+
onCancel,
|
|
4778
|
+
destroyOnHidden: true,
|
|
4779
|
+
okText: t2("common.confirm"),
|
|
4780
|
+
cancelText: t2("common.cancel"),
|
|
4781
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Form, { form, layout: "vertical", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4782
|
+
antd.Form.Item,
|
|
4783
|
+
{
|
|
4784
|
+
name: "content",
|
|
4785
|
+
label: t2("markdownEditor.annotation.content"),
|
|
4786
|
+
rules: [
|
|
4787
|
+
{ whitespace: true, required: true, message: t2("markdownEditor.annotation.required") },
|
|
4788
|
+
{ max: 500, message: t2("markdownEditor.annotation.maxLength") }
|
|
4789
|
+
],
|
|
4790
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(TextArea, { rows: 4, placeholder: t2("markdownEditor.annotation.placeholder"), showCount: true, maxLength: 500 })
|
|
4791
|
+
}
|
|
4792
|
+
) })
|
|
4054
4793
|
}
|
|
4055
|
-
)
|
|
4794
|
+
);
|
|
4056
4795
|
};
|
|
4057
4796
|
|
|
4058
4797
|
// src/components/MarkdownEditor/annotation/constant.ts
|
|
@@ -4077,6 +4816,7 @@ var AnnotationSidebar_default = ({
|
|
|
4077
4816
|
annotationConfig,
|
|
4078
4817
|
onClose
|
|
4079
4818
|
}) => {
|
|
4819
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
4080
4820
|
const [form] = antd.Form.useForm();
|
|
4081
4821
|
const [editingId, setEditingId] = React3.useState();
|
|
4082
4822
|
const itemRefs = React3.useRef({});
|
|
@@ -4113,7 +4853,7 @@ var AnnotationSidebar_default = ({
|
|
|
4113
4853
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
|
|
4114
4854
|
/* @__PURE__ */ jsxRuntime.jsx(icons.MessageOutlined, {}),
|
|
4115
4855
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
4116
|
-
"
|
|
4856
|
+
t2("markdownEditor.annotation.title"),
|
|
4117
4857
|
annotations.length > 0 && `\uFF08${annotations.length}\uFF09`
|
|
4118
4858
|
] })
|
|
4119
4859
|
] }),
|
|
@@ -4148,15 +4888,15 @@ var AnnotationSidebar_default = ({
|
|
|
4148
4888
|
{
|
|
4149
4889
|
name: "content",
|
|
4150
4890
|
rules: [
|
|
4151
|
-
{ whitespace: true, required: true, message: "
|
|
4152
|
-
{ max: 500, message: "
|
|
4891
|
+
{ whitespace: true, required: true, message: t2("markdownEditor.annotation.required") },
|
|
4892
|
+
{ max: 500, message: t2("markdownEditor.annotation.maxLength") }
|
|
4153
4893
|
],
|
|
4154
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(TextArea2, { autoFocus: true, rows: 2, placeholder: "
|
|
4894
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(TextArea2, { autoFocus: true, rows: 2, placeholder: t2("markdownEditor.annotation.placeholder"), showCount: true, maxLength: 500 })
|
|
4155
4895
|
}
|
|
4156
4896
|
) }),
|
|
4157
4897
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
|
|
4158
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", type: "primary", onClick: handleSaveEdit, children: "
|
|
4159
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", onClick: handleCancelEdit, children: "
|
|
4898
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", type: "primary", onClick: handleSaveEdit, children: t2("common.save") }),
|
|
4899
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", onClick: handleCancelEdit, children: t2("common.cancel") })
|
|
4160
4900
|
] })
|
|
4161
4901
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, vertical: true, children: [
|
|
4162
4902
|
/* @__PURE__ */ jsxRuntime.jsx(Text2, { children: annotation.content }),
|
|
@@ -4166,7 +4906,7 @@ var AnnotationSidebar_default = ({
|
|
|
4166
4906
|
{
|
|
4167
4907
|
type: "text",
|
|
4168
4908
|
size: "small",
|
|
4169
|
-
title: "
|
|
4909
|
+
title: t2("markdownEditor.annotation.edit"),
|
|
4170
4910
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.EditOutlined, {}),
|
|
4171
4911
|
onClick: (e) => {
|
|
4172
4912
|
handleEdit(annotation);
|
|
@@ -4176,12 +4916,12 @@ var AnnotationSidebar_default = ({
|
|
|
4176
4916
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4177
4917
|
antd.Popconfirm,
|
|
4178
4918
|
{
|
|
4179
|
-
title: "
|
|
4180
|
-
okText: "
|
|
4181
|
-
cancelText: "
|
|
4182
|
-
description: "
|
|
4919
|
+
title: t2("common.defaultTitle"),
|
|
4920
|
+
okText: t2("common.confirm"),
|
|
4921
|
+
cancelText: t2("common.cancel"),
|
|
4922
|
+
description: t2("markdownEditor.annotation.confirmDelete"),
|
|
4183
4923
|
onConfirm: () => onDeleteAnnotation(annotation[ANNOTATION_ATTRS[0]]),
|
|
4184
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", size: "small", title: "
|
|
4924
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", size: "small", title: t2("markdownEditor.annotation.delete"), icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DeleteOutlined, {}) })
|
|
4185
4925
|
}
|
|
4186
4926
|
)
|
|
4187
4927
|
] })
|
|
@@ -4190,7 +4930,7 @@ var AnnotationSidebar_default = ({
|
|
|
4190
4930
|
}
|
|
4191
4931
|
)
|
|
4192
4932
|
}
|
|
4193
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, justify: "center", align: "center", className: "height-full", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: "
|
|
4933
|
+
) : /* @__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") }) })
|
|
4194
4934
|
}
|
|
4195
4935
|
);
|
|
4196
4936
|
const container = annotationConfig?.getContainer?.();
|
|
@@ -4475,7 +5215,7 @@ var useAnnotations = (annotationConfig) => {
|
|
|
4475
5215
|
const id = genNonDuplicateID();
|
|
4476
5216
|
editor.current.chain().focus().setMark(ANNOTATION_KEY, {
|
|
4477
5217
|
"annotation-id": id,
|
|
4478
|
-
"user-name": annotationConfig?.user?.name || "
|
|
5218
|
+
"user-name": annotationConfig?.user?.name || t("markdownEditor.unknown"),
|
|
4479
5219
|
"user-id": annotationConfig?.user.id || "0000",
|
|
4480
5220
|
"update-time": getTimestamp(),
|
|
4481
5221
|
content
|
|
@@ -4757,6 +5497,7 @@ var collectionSidebar_default = ({
|
|
|
4757
5497
|
collectionConfig,
|
|
4758
5498
|
onClose
|
|
4759
5499
|
}) => {
|
|
5500
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
4760
5501
|
const itemRefs = React3.useRef({});
|
|
4761
5502
|
React3.useEffect(() => {
|
|
4762
5503
|
if (selectedCollectionId) {
|
|
@@ -4778,7 +5519,7 @@ var collectionSidebar_default = ({
|
|
|
4778
5519
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
|
|
4779
5520
|
/* @__PURE__ */ jsxRuntime.jsx(icons.BookOutlined, {}),
|
|
4780
5521
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
4781
|
-
"
|
|
5522
|
+
t2("markdownEditor.collection.title"),
|
|
4782
5523
|
collections.length > 0 && `\uFF08${collections.length}\uFF09`
|
|
4783
5524
|
] })
|
|
4784
5525
|
] }),
|
|
@@ -4821,12 +5562,12 @@ var collectionSidebar_default = ({
|
|
|
4821
5562
|
!disabled && selectedCollectionId === collection[COLLECTION_ATTRS[0]] && /* @__PURE__ */ jsxRuntime.jsx(antd.Space, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4822
5563
|
antd.Popconfirm,
|
|
4823
5564
|
{
|
|
4824
|
-
title: "
|
|
4825
|
-
okText: "
|
|
4826
|
-
cancelText: "
|
|
4827
|
-
description: "
|
|
5565
|
+
title: t2("common.defaultTitle"),
|
|
5566
|
+
okText: t2("common.confirm"),
|
|
5567
|
+
cancelText: t2("common.cancel"),
|
|
5568
|
+
description: t2("markdownEditor.collection.confirmDelete"),
|
|
4828
5569
|
onConfirm: () => onDeleteCollection(collection[COLLECTION_ATTRS[0]]),
|
|
4829
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", size: "small", title: "
|
|
5570
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", size: "small", title: t2("markdownEditor.collection.delete"), icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DeleteOutlined, {}) })
|
|
4830
5571
|
}
|
|
4831
5572
|
) })
|
|
4832
5573
|
] })
|
|
@@ -4835,7 +5576,7 @@ var collectionSidebar_default = ({
|
|
|
4835
5576
|
);
|
|
4836
5577
|
}
|
|
4837
5578
|
}
|
|
4838
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, justify: "center", align: "center", className: "height-full", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: "
|
|
5579
|
+
) : /* @__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") }) })
|
|
4839
5580
|
}
|
|
4840
5581
|
);
|
|
4841
5582
|
const container = collectionConfig?.getContainer?.();
|
|
@@ -4876,7 +5617,7 @@ var useCollections = (collectionConfig) => {
|
|
|
4876
5617
|
}
|
|
4877
5618
|
editor.current.chain().focus().setMark(COLLECTION_KEY, {
|
|
4878
5619
|
"collection-id": remoteId,
|
|
4879
|
-
"user-name": collectionConfig?.user?.name || "
|
|
5620
|
+
"user-name": collectionConfig?.user?.name || t("markdownEditor.unknown"),
|
|
4880
5621
|
"user-id": collectionConfig?.user.id || "0000",
|
|
4881
5622
|
"update-time": getTimestamp(),
|
|
4882
5623
|
"page-no": pageIndex
|
|
@@ -5336,13 +6077,14 @@ var Toolbar = React3.forwardRef(
|
|
|
5336
6077
|
({ children, className, variant = "fixed", ...props }, ref) => {
|
|
5337
6078
|
const toolbarRef = React3.useRef(null);
|
|
5338
6079
|
const composedRef = useComposedRef(toolbarRef, ref);
|
|
6080
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
5339
6081
|
useToolbarNavigation(toolbarRef);
|
|
5340
6082
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5341
6083
|
"div",
|
|
5342
6084
|
{
|
|
5343
6085
|
ref: composedRef,
|
|
5344
6086
|
role: "toolbar",
|
|
5345
|
-
"aria-label": "toolbar",
|
|
6087
|
+
"aria-label": t2("markdownEditor.toolbar.toolbarAria"),
|
|
5346
6088
|
"data-variant": variant,
|
|
5347
6089
|
className: cn("tiptap-toolbar", className),
|
|
5348
6090
|
...props,
|
|
@@ -5425,6 +6167,7 @@ var BlockquoteButton = React3.forwardRef(
|
|
|
5425
6167
|
hideWhenUnavailable,
|
|
5426
6168
|
onToggled
|
|
5427
6169
|
});
|
|
6170
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
5428
6171
|
const handleClick = React3.useCallback(
|
|
5429
6172
|
(event) => {
|
|
5430
6173
|
onClick?.(event);
|
|
@@ -5448,7 +6191,7 @@ var BlockquoteButton = React3.forwardRef(
|
|
|
5448
6191
|
"data-disabled": !canToggle3,
|
|
5449
6192
|
"aria-label": label,
|
|
5450
6193
|
"aria-pressed": isActive,
|
|
5451
|
-
tooltip: "
|
|
6194
|
+
tooltip: t2("markdownEditor.toolbar.blockquote"),
|
|
5452
6195
|
onClick: handleClick,
|
|
5453
6196
|
...buttonProps,
|
|
5454
6197
|
ref,
|
|
@@ -5616,7 +6359,7 @@ function useBlockquote(config) {
|
|
|
5616
6359
|
isActive,
|
|
5617
6360
|
handleToggle,
|
|
5618
6361
|
canToggle: canToggle3,
|
|
5619
|
-
label: "
|
|
6362
|
+
label: t("markdownEditor.toolbar.blockquote"),
|
|
5620
6363
|
shortcutKeys: BLOCKQUOTE_SHORTCUT_KEY,
|
|
5621
6364
|
Icon: BlockquoteIcon
|
|
5622
6365
|
};
|
|
@@ -5651,6 +6394,7 @@ var CodeBlockButton = React3.forwardRef(
|
|
|
5651
6394
|
hideWhenUnavailable,
|
|
5652
6395
|
onToggled
|
|
5653
6396
|
});
|
|
6397
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
5654
6398
|
const handleClick = React3.useCallback(
|
|
5655
6399
|
(event) => {
|
|
5656
6400
|
onClick?.(event);
|
|
@@ -5674,7 +6418,7 @@ var CodeBlockButton = React3.forwardRef(
|
|
|
5674
6418
|
tabIndex: -1,
|
|
5675
6419
|
"aria-label": label,
|
|
5676
6420
|
"aria-pressed": isActive,
|
|
5677
|
-
tooltip: "
|
|
6421
|
+
tooltip: t2("markdownEditor.toolbar.codeBlock"),
|
|
5678
6422
|
onClick: handleClick,
|
|
5679
6423
|
...buttonProps,
|
|
5680
6424
|
ref,
|
|
@@ -5833,7 +6577,7 @@ function useCodeBlock(config) {
|
|
|
5833
6577
|
isActive,
|
|
5834
6578
|
handleToggle,
|
|
5835
6579
|
canToggle: canToggleState,
|
|
5836
|
-
label: "
|
|
6580
|
+
label: t("markdownEditor.toolbar.codeBlock"),
|
|
5837
6581
|
shortcutKeys: CODE_BLOCK_SHORTCUT_KEY,
|
|
5838
6582
|
Icon: CodeBlockIcon
|
|
5839
6583
|
};
|
|
@@ -5994,6 +6738,7 @@ var ColorHighlightButton = React3.forwardRef(
|
|
|
5994
6738
|
style,
|
|
5995
6739
|
...buttonProps
|
|
5996
6740
|
}, ref) => {
|
|
6741
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
5997
6742
|
const { editor } = useTiptapEditor(providedEditor);
|
|
5998
6743
|
const {
|
|
5999
6744
|
isVisible,
|
|
@@ -6005,7 +6750,7 @@ var ColorHighlightButton = React3.forwardRef(
|
|
|
6005
6750
|
} = useColorHighlight({
|
|
6006
6751
|
editor,
|
|
6007
6752
|
highlightColor,
|
|
6008
|
-
label: text ||
|
|
6753
|
+
label: text || t2("markdownEditor.highlight.toggle", { color: highlightColor }),
|
|
6009
6754
|
hideWhenUnavailable,
|
|
6010
6755
|
mode,
|
|
6011
6756
|
onApplied
|
|
@@ -6064,52 +6809,52 @@ ColorHighlightButton.displayName = "ColorHighlightButton";
|
|
|
6064
6809
|
var COLOR_HIGHLIGHT_SHORTCUT_KEY = "mod+shift+h";
|
|
6065
6810
|
var HIGHLIGHT_COLORS = [
|
|
6066
6811
|
{
|
|
6067
|
-
|
|
6812
|
+
labelKey: "markdownEditor.highlight.default",
|
|
6068
6813
|
value: "var(--tt-bg-color)",
|
|
6069
6814
|
border: "var(--tt-bg-color-contrast)"
|
|
6070
6815
|
},
|
|
6071
6816
|
{
|
|
6072
|
-
|
|
6817
|
+
labelKey: "markdownEditor.highlight.gray",
|
|
6073
6818
|
value: "var(--tt-color-highlight-gray)",
|
|
6074
6819
|
border: "var(--tt-color-highlight-gray-contrast)"
|
|
6075
6820
|
},
|
|
6076
6821
|
{
|
|
6077
|
-
|
|
6822
|
+
labelKey: "markdownEditor.highlight.brown",
|
|
6078
6823
|
value: "var(--tt-color-highlight-brown)",
|
|
6079
6824
|
border: "var(--tt-color-highlight-brown-contrast)"
|
|
6080
6825
|
},
|
|
6081
6826
|
{
|
|
6082
|
-
|
|
6827
|
+
labelKey: "markdownEditor.highlight.orange",
|
|
6083
6828
|
value: "var(--tt-color-highlight-orange)",
|
|
6084
6829
|
border: "var(--tt-color-highlight-orange-contrast)"
|
|
6085
6830
|
},
|
|
6086
6831
|
{
|
|
6087
|
-
|
|
6832
|
+
labelKey: "markdownEditor.highlight.yellow",
|
|
6088
6833
|
value: "var(--tt-color-highlight-yellow)",
|
|
6089
6834
|
border: "var(--tt-color-highlight-yellow-contrast)"
|
|
6090
6835
|
},
|
|
6091
6836
|
{
|
|
6092
|
-
|
|
6837
|
+
labelKey: "markdownEditor.highlight.green",
|
|
6093
6838
|
value: "var(--tt-color-highlight-green)",
|
|
6094
6839
|
border: "var(--tt-color-highlight-green-contrast)"
|
|
6095
6840
|
},
|
|
6096
6841
|
{
|
|
6097
|
-
|
|
6842
|
+
labelKey: "markdownEditor.highlight.blue",
|
|
6098
6843
|
value: "var(--tt-color-highlight-blue)",
|
|
6099
6844
|
border: "var(--tt-color-highlight-blue-contrast)"
|
|
6100
6845
|
},
|
|
6101
6846
|
{
|
|
6102
|
-
|
|
6847
|
+
labelKey: "markdownEditor.highlight.purple",
|
|
6103
6848
|
value: "var(--tt-color-highlight-purple)",
|
|
6104
6849
|
border: "var(--tt-color-highlight-purple-contrast)"
|
|
6105
6850
|
},
|
|
6106
6851
|
{
|
|
6107
|
-
|
|
6852
|
+
labelKey: "markdownEditor.highlight.pink",
|
|
6108
6853
|
value: "var(--tt-color-highlight-pink)",
|
|
6109
6854
|
border: "var(--tt-color-highlight-pink-contrast)"
|
|
6110
6855
|
},
|
|
6111
6856
|
{
|
|
6112
|
-
|
|
6857
|
+
labelKey: "markdownEditor.highlight.red",
|
|
6113
6858
|
value: "var(--tt-color-highlight-red)",
|
|
6114
6859
|
border: "var(--tt-color-highlight-red-contrast)"
|
|
6115
6860
|
}
|
|
@@ -6235,7 +6980,7 @@ function useColorHighlight(config) {
|
|
|
6235
6980
|
const handleRemoveHighlight = React3.useCallback(() => {
|
|
6236
6981
|
const success = removeHighlight(editor, mode);
|
|
6237
6982
|
if (success) {
|
|
6238
|
-
onApplied?.({ color: "", label: "
|
|
6983
|
+
onApplied?.({ color: "", label: t("markdownEditor.highlight.removeBackground"), mode });
|
|
6239
6984
|
}
|
|
6240
6985
|
return success;
|
|
6241
6986
|
}, [editor, onApplied, mode]);
|
|
@@ -6257,28 +7002,31 @@ function useColorHighlight(config) {
|
|
|
6257
7002
|
handleColorHighlight,
|
|
6258
7003
|
handleRemoveHighlight,
|
|
6259
7004
|
canColorHighlight: canColorHighlightState,
|
|
6260
|
-
label: label ||
|
|
7005
|
+
label: label || t("markdownEditor.highlight.label"),
|
|
6261
7006
|
shortcutKeys: COLOR_HIGHLIGHT_SHORTCUT_KEY,
|
|
6262
7007
|
Icon: HighlighterIcon,
|
|
6263
7008
|
mode
|
|
6264
7009
|
};
|
|
6265
7010
|
}
|
|
6266
|
-
var ColorHighlightPopoverButton = React3.forwardRef(({ className, children, ...props }, ref) =>
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
)
|
|
7011
|
+
var ColorHighlightPopoverButton = React3.forwardRef(({ className, children, ...props }, ref) => {
|
|
7012
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
7013
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7014
|
+
Button7,
|
|
7015
|
+
{
|
|
7016
|
+
type: "button",
|
|
7017
|
+
className,
|
|
7018
|
+
"data-style": "ghost",
|
|
7019
|
+
"data-appearance": "default",
|
|
7020
|
+
role: "button",
|
|
7021
|
+
tabIndex: -1,
|
|
7022
|
+
"aria-label": t2("markdownEditor.highlight.textLabel"),
|
|
7023
|
+
tooltip: t2("markdownEditor.highlight.label"),
|
|
7024
|
+
ref,
|
|
7025
|
+
...props,
|
|
7026
|
+
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(HighlighterIcon, { className: "tiptap-button-icon" })
|
|
7027
|
+
}
|
|
7028
|
+
);
|
|
7029
|
+
});
|
|
6282
7030
|
ColorHighlightPopoverButton.displayName = "ColorHighlightPopoverButton";
|
|
6283
7031
|
function ColorHighlightPopoverContent({
|
|
6284
7032
|
editor,
|
|
@@ -6293,9 +7041,10 @@ function ColorHighlightPopoverContent({
|
|
|
6293
7041
|
const { handleRemoveHighlight } = useColorHighlight({ editor });
|
|
6294
7042
|
const isMobile = useIsBreakpoint();
|
|
6295
7043
|
const containerRef = React3.useRef(null);
|
|
7044
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
6296
7045
|
const menuItems = React3.useMemo(
|
|
6297
|
-
() => [...colors, { label: "
|
|
6298
|
-
[colors]
|
|
7046
|
+
() => [...colors.map((c) => ({ ...c, label: t2(c.labelKey) })), { label: t2("markdownEditor.highlight.removeHighlight"), value: "none" }],
|
|
7047
|
+
[colors, t2]
|
|
6299
7048
|
);
|
|
6300
7049
|
const { selectedIndex } = useMenuNavigation({
|
|
6301
7050
|
containerRef,
|
|
@@ -6324,8 +7073,8 @@ function ColorHighlightPopoverContent({
|
|
|
6324
7073
|
{
|
|
6325
7074
|
editor,
|
|
6326
7075
|
highlightColor: color.value,
|
|
6327
|
-
tooltip: color.
|
|
6328
|
-
"aria-label":
|
|
7076
|
+
tooltip: t2(color.labelKey),
|
|
7077
|
+
"aria-label": t2("markdownEditor.highlight.colorOptionAria", { label: t2(color.labelKey) }),
|
|
6329
7078
|
tabIndex: index === selectedIndex ? 0 : -1,
|
|
6330
7079
|
"data-highlighted": selectedIndex === index
|
|
6331
7080
|
},
|
|
@@ -6336,8 +7085,8 @@ function ColorHighlightPopoverContent({
|
|
|
6336
7085
|
Button7,
|
|
6337
7086
|
{
|
|
6338
7087
|
onClick: handleRemoveHighlight,
|
|
6339
|
-
"aria-label": "
|
|
6340
|
-
tooltip: "
|
|
7088
|
+
"aria-label": t2("markdownEditor.highlight.removeBackground"),
|
|
7089
|
+
tooltip: t2("markdownEditor.highlight.removeBackground"),
|
|
6341
7090
|
tabIndex: selectedIndex === colors.length ? 0 : -1,
|
|
6342
7091
|
type: "button",
|
|
6343
7092
|
role: "menuitem",
|
|
@@ -6363,6 +7112,7 @@ function ColorHighlightPopover({
|
|
|
6363
7112
|
onApplied,
|
|
6364
7113
|
...props
|
|
6365
7114
|
}) {
|
|
7115
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
6366
7116
|
const { editor } = useTiptapEditor(providedEditor);
|
|
6367
7117
|
const [isOpen, setIsOpen] = React3.useState(false);
|
|
6368
7118
|
const { isVisible, canColorHighlight: canColorHighlight2, isActive, label, Icon } = useColorHighlight({
|
|
@@ -6385,7 +7135,7 @@ function ColorHighlightPopover({
|
|
|
6385
7135
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "tiptap-button-icon" })
|
|
6386
7136
|
}
|
|
6387
7137
|
) }),
|
|
6388
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { "aria-label": "
|
|
7138
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { "aria-label": t2("markdownEditor.highlight.label"), children: /* @__PURE__ */ jsxRuntime.jsx(ColorHighlightPopoverContent, { editor, colors }) })
|
|
6389
7139
|
] });
|
|
6390
7140
|
}
|
|
6391
7141
|
var ChevronDownIcon = React3.memo(({ className, ...props }) => {
|
|
@@ -6868,6 +7618,7 @@ var HeadingDropdownMenu = React3.forwardRef(
|
|
|
6868
7618
|
}, ref) => {
|
|
6869
7619
|
const { editor } = useTiptapEditor(providedEditor);
|
|
6870
7620
|
const [isOpen, setIsOpen] = React3.useState(false);
|
|
7621
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
6871
7622
|
const { isVisible, isActive, canToggle: canToggle3, Icon } = useHeadingDropdownMenu({
|
|
6872
7623
|
editor,
|
|
6873
7624
|
levels,
|
|
@@ -6895,9 +7646,9 @@ var HeadingDropdownMenu = React3.forwardRef(
|
|
|
6895
7646
|
tabIndex: -1,
|
|
6896
7647
|
disabled: !canToggle3,
|
|
6897
7648
|
"data-disabled": !canToggle3,
|
|
6898
|
-
"aria-label": "
|
|
7649
|
+
"aria-label": t2("markdownEditor.toolbar.heading"),
|
|
6899
7650
|
"aria-pressed": isActive,
|
|
6900
|
-
tooltip: "
|
|
7651
|
+
tooltip: t2("markdownEditor.toolbar.heading"),
|
|
6901
7652
|
...buttonProps,
|
|
6902
7653
|
ref,
|
|
6903
7654
|
children: [
|
|
@@ -6911,10 +7662,10 @@ var HeadingDropdownMenu = React3.forwardRef(
|
|
|
6911
7662
|
{
|
|
6912
7663
|
editor,
|
|
6913
7664
|
level,
|
|
6914
|
-
text:
|
|
7665
|
+
text: t2("markdownEditor.toolbar.headingLevel", { level }),
|
|
6915
7666
|
showTooltip: false
|
|
6916
7667
|
}
|
|
6917
|
-
) },
|
|
7668
|
+
) }, level)) }) }) }) })
|
|
6918
7669
|
] });
|
|
6919
7670
|
}
|
|
6920
7671
|
);
|
|
@@ -6977,7 +7728,7 @@ function useHeadingDropdownMenu(config) {
|
|
|
6977
7728
|
isActive,
|
|
6978
7729
|
canToggle: canToggleState,
|
|
6979
7730
|
levels,
|
|
6980
|
-
label: "
|
|
7731
|
+
label: t("markdownEditor.toolbar.heading"),
|
|
6981
7732
|
Icon: activeLevel ? headingIcons[activeLevel] : HeadingIcon
|
|
6982
7733
|
};
|
|
6983
7734
|
}
|
|
@@ -7103,6 +7854,7 @@ function InputGroup({
|
|
|
7103
7854
|
}
|
|
7104
7855
|
var LinkButton = React3.forwardRef(
|
|
7105
7856
|
({ className, children, ...props }, ref) => {
|
|
7857
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
7106
7858
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7107
7859
|
Button7,
|
|
7108
7860
|
{
|
|
@@ -7111,8 +7863,8 @@ var LinkButton = React3.forwardRef(
|
|
|
7111
7863
|
"data-style": "ghost",
|
|
7112
7864
|
role: "button",
|
|
7113
7865
|
tabIndex: -1,
|
|
7114
|
-
"aria-label": "
|
|
7115
|
-
tooltip: "
|
|
7866
|
+
"aria-label": t2("markdownEditor.toolbar.link"),
|
|
7867
|
+
tooltip: t2("markdownEditor.toolbar.link"),
|
|
7116
7868
|
ref,
|
|
7117
7869
|
...props,
|
|
7118
7870
|
children: children || /* @__PURE__ */ jsxRuntime.jsx(LinkIcon, { className: "tiptap-button-icon" })
|
|
@@ -7130,6 +7882,7 @@ var LinkMain = ({
|
|
|
7130
7882
|
isActive
|
|
7131
7883
|
}) => {
|
|
7132
7884
|
const isMobile = useIsBreakpoint();
|
|
7885
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
7133
7886
|
const handleKeyDown = (event) => {
|
|
7134
7887
|
if (event.key === "Enter") {
|
|
7135
7888
|
event.preventDefault();
|
|
@@ -7153,7 +7906,7 @@ var LinkMain = ({
|
|
|
7153
7906
|
Input4,
|
|
7154
7907
|
{
|
|
7155
7908
|
type: "url",
|
|
7156
|
-
placeholder: "
|
|
7909
|
+
placeholder: t2("markdownEditor.toolbar.linkPlaceholder"),
|
|
7157
7910
|
value: url,
|
|
7158
7911
|
onChange: (e) => setUrl(e.target.value),
|
|
7159
7912
|
onKeyDown: handleKeyDown,
|
|
@@ -7168,7 +7921,7 @@ var LinkMain = ({
|
|
|
7168
7921
|
{
|
|
7169
7922
|
type: "button",
|
|
7170
7923
|
onClick: setLink,
|
|
7171
|
-
title: "
|
|
7924
|
+
title: t2("markdownEditor.toolbar.applyLink"),
|
|
7172
7925
|
disabled: !url && !isActive,
|
|
7173
7926
|
"data-style": "ghost",
|
|
7174
7927
|
children: /* @__PURE__ */ jsxRuntime.jsx(CornerDownLeftIcon, { className: "tiptap-button-icon" })
|
|
@@ -7181,7 +7934,7 @@ var LinkMain = ({
|
|
|
7181
7934
|
{
|
|
7182
7935
|
type: "button",
|
|
7183
7936
|
onClick: openLink,
|
|
7184
|
-
title: "
|
|
7937
|
+
title: t2("markdownEditor.toolbar.openInNewWindow"),
|
|
7185
7938
|
disabled: !url && !isActive,
|
|
7186
7939
|
"data-style": "ghost",
|
|
7187
7940
|
children: /* @__PURE__ */ jsxRuntime.jsx(ExternalLinkIcon, { className: "tiptap-button-icon" })
|
|
@@ -7192,7 +7945,7 @@ var LinkMain = ({
|
|
|
7192
7945
|
{
|
|
7193
7946
|
type: "button",
|
|
7194
7947
|
onClick: removeLink,
|
|
7195
|
-
title: "
|
|
7948
|
+
title: t2("markdownEditor.toolbar.removeLink"),
|
|
7196
7949
|
disabled: !url && !isActive,
|
|
7197
7950
|
"data-style": "ghost",
|
|
7198
7951
|
children: /* @__PURE__ */ jsxRuntime.jsx(TrashIcon, { className: "tiptap-button-icon" })
|
|
@@ -7706,10 +8459,10 @@ var listIcons = {
|
|
|
7706
8459
|
orderedList: ListOrderedIcon,
|
|
7707
8460
|
taskList: ListTodoIcon
|
|
7708
8461
|
};
|
|
7709
|
-
var
|
|
7710
|
-
bulletList: "
|
|
7711
|
-
orderedList: "
|
|
7712
|
-
taskList: "
|
|
8462
|
+
var listLabelKeys = {
|
|
8463
|
+
bulletList: "markdownEditor.toolbar.bulletList",
|
|
8464
|
+
orderedList: "markdownEditor.toolbar.orderedList",
|
|
8465
|
+
taskList: "markdownEditor.toolbar.taskList"
|
|
7713
8466
|
};
|
|
7714
8467
|
var LIST_SHORTCUT_KEYS = {
|
|
7715
8468
|
bulletList: "mod+shift+8",
|
|
@@ -7856,24 +8609,24 @@ function useList(config) {
|
|
|
7856
8609
|
isActive,
|
|
7857
8610
|
handleToggle,
|
|
7858
8611
|
canToggle: canToggle3,
|
|
7859
|
-
label:
|
|
8612
|
+
label: t(listLabelKeys[type]),
|
|
7860
8613
|
shortcutKeys: LIST_SHORTCUT_KEYS[type],
|
|
7861
8614
|
Icon: listIcons[type]
|
|
7862
8615
|
};
|
|
7863
8616
|
}
|
|
7864
8617
|
var listOptions = [
|
|
7865
8618
|
{
|
|
7866
|
-
|
|
8619
|
+
labelKey: "markdownEditor.toolbar.bulletList",
|
|
7867
8620
|
type: "bulletList",
|
|
7868
8621
|
icon: ListIcon
|
|
7869
8622
|
},
|
|
7870
8623
|
{
|
|
7871
|
-
|
|
8624
|
+
labelKey: "markdownEditor.toolbar.orderedList",
|
|
7872
8625
|
type: "orderedList",
|
|
7873
8626
|
icon: ListOrderedIcon
|
|
7874
8627
|
},
|
|
7875
8628
|
{
|
|
7876
|
-
|
|
8629
|
+
labelKey: "markdownEditor.toolbar.taskList",
|
|
7877
8630
|
type: "taskList",
|
|
7878
8631
|
icon: ListTodoIcon
|
|
7879
8632
|
}
|
|
@@ -7914,7 +8667,13 @@ function useListDropdownMenu(config) {
|
|
|
7914
8667
|
const { editor } = useTiptapEditor(providedEditor);
|
|
7915
8668
|
const [isVisible, setIsVisible] = React3.useState(true);
|
|
7916
8669
|
const listInSchema = types.some((type) => isNodeInSchema(type, editor));
|
|
7917
|
-
const filteredLists = React3.useMemo(
|
|
8670
|
+
const filteredLists = React3.useMemo(
|
|
8671
|
+
() => getFilteredListOptions(types).map((option) => ({
|
|
8672
|
+
...option,
|
|
8673
|
+
label: t(option.labelKey)
|
|
8674
|
+
})),
|
|
8675
|
+
[types]
|
|
8676
|
+
);
|
|
7918
8677
|
const canToggleAny = canToggleAnyList(editor, types);
|
|
7919
8678
|
const isAnyActive = isAnyListActive(editor, types);
|
|
7920
8679
|
const activeType = getActiveListType(editor, types);
|
|
@@ -7944,7 +8703,7 @@ function useListDropdownMenu(config) {
|
|
|
7944
8703
|
canToggle: canToggleAny,
|
|
7945
8704
|
types,
|
|
7946
8705
|
filteredLists,
|
|
7947
|
-
label: "
|
|
8706
|
+
label: t("markdownEditor.toolbar.list"),
|
|
7948
8707
|
Icon: activeList ? listIcons[activeList.type] : ListIcon
|
|
7949
8708
|
};
|
|
7950
8709
|
}
|
|
@@ -7958,6 +8717,7 @@ function ListDropdownMenu({
|
|
|
7958
8717
|
}) {
|
|
7959
8718
|
const { editor } = useTiptapEditor(providedEditor);
|
|
7960
8719
|
const [isOpen, setIsOpen] = React3.useState(false);
|
|
8720
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
7961
8721
|
const { filteredLists, canToggle: canToggle3, isActive, isVisible, Icon } = useListDropdownMenu({
|
|
7962
8722
|
editor,
|
|
7963
8723
|
types,
|
|
@@ -7984,8 +8744,8 @@ function ListDropdownMenu({
|
|
|
7984
8744
|
tabIndex: -1,
|
|
7985
8745
|
disabled: !canToggle3,
|
|
7986
8746
|
"data-disabled": !canToggle3,
|
|
7987
|
-
"aria-label": "
|
|
7988
|
-
tooltip: "
|
|
8747
|
+
"aria-label": t2("markdownEditor.toolbar.listOptions"),
|
|
8748
|
+
tooltip: t2("markdownEditor.toolbar.list"),
|
|
7989
8749
|
...props,
|
|
7990
8750
|
children: [
|
|
7991
8751
|
/* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "tiptap-button-icon" }),
|
|
@@ -8321,14 +9081,14 @@ var MARK_SHORTCUT_KEYS = {
|
|
|
8321
9081
|
superscript: "mod+.",
|
|
8322
9082
|
subscript: "mod+,"
|
|
8323
9083
|
};
|
|
8324
|
-
var
|
|
8325
|
-
bold: "
|
|
8326
|
-
italic: "
|
|
8327
|
-
underline: "
|
|
8328
|
-
strike: "
|
|
8329
|
-
code: "
|
|
8330
|
-
superscript: "
|
|
8331
|
-
subscript: "
|
|
9084
|
+
var MARK_ACTION_LABEL_KEYS = {
|
|
9085
|
+
bold: "markdownEditor.toolbar.bold",
|
|
9086
|
+
italic: "markdownEditor.toolbar.italic",
|
|
9087
|
+
underline: "markdownEditor.toolbar.underline",
|
|
9088
|
+
strike: "markdownEditor.toolbar.strike",
|
|
9089
|
+
code: "markdownEditor.toolbar.code",
|
|
9090
|
+
superscript: "markdownEditor.toolbar.superscript",
|
|
9091
|
+
subscript: "markdownEditor.toolbar.subscript"
|
|
8332
9092
|
};
|
|
8333
9093
|
function canToggleMark(editor, type) {
|
|
8334
9094
|
if (!editor || !editor.isEditable) return false;
|
|
@@ -8355,7 +9115,8 @@ function shouldShowButton6(props) {
|
|
|
8355
9115
|
return true;
|
|
8356
9116
|
}
|
|
8357
9117
|
function getFormattedMarkName(type) {
|
|
8358
|
-
|
|
9118
|
+
const labelKey = MARK_ACTION_LABEL_KEYS[type];
|
|
9119
|
+
return labelKey ? t(labelKey) : type.charAt(0).toUpperCase() + type.slice(1);
|
|
8359
9120
|
}
|
|
8360
9121
|
function useMark(config) {
|
|
8361
9122
|
const {
|
|
@@ -8665,11 +9426,11 @@ var textAlignIcons = {
|
|
|
8665
9426
|
right: AlignRightIcon,
|
|
8666
9427
|
justify: AlignJustifyIcon
|
|
8667
9428
|
};
|
|
8668
|
-
var
|
|
8669
|
-
left: "
|
|
8670
|
-
center: "
|
|
8671
|
-
right: "
|
|
8672
|
-
justify: "
|
|
9429
|
+
var textAlignLabelKeys = {
|
|
9430
|
+
left: "markdownEditor.toolbar.alignLeft",
|
|
9431
|
+
center: "markdownEditor.toolbar.alignCenter",
|
|
9432
|
+
right: "markdownEditor.toolbar.alignRight",
|
|
9433
|
+
justify: "markdownEditor.toolbar.alignJustify"
|
|
8673
9434
|
};
|
|
8674
9435
|
function canSetTextAlign(editor, align) {
|
|
8675
9436
|
if (!editor || !editor.isEditable) return false;
|
|
@@ -8737,7 +9498,7 @@ function useTextAlign(config) {
|
|
|
8737
9498
|
isActive,
|
|
8738
9499
|
handleTextAlign,
|
|
8739
9500
|
canAlign,
|
|
8740
|
-
label:
|
|
9501
|
+
label: t(textAlignLabelKeys[align]),
|
|
8741
9502
|
shortcutKeys: TEXT_ALIGN_SHORTCUT_KEYS[align],
|
|
8742
9503
|
Icon: textAlignIcons[align]
|
|
8743
9504
|
};
|
|
@@ -8862,9 +9623,9 @@ var UNDO_REDO_SHORTCUT_KEYS = {
|
|
|
8862
9623
|
undo: "mod+z",
|
|
8863
9624
|
redo: "mod+shift+z"
|
|
8864
9625
|
};
|
|
8865
|
-
var
|
|
8866
|
-
undo: "
|
|
8867
|
-
redo: "
|
|
9626
|
+
var historyActionLabelKeys = {
|
|
9627
|
+
undo: "markdownEditor.toolbar.undo",
|
|
9628
|
+
redo: "markdownEditor.toolbar.redo"
|
|
8868
9629
|
};
|
|
8869
9630
|
var historyIcons = {
|
|
8870
9631
|
undo: Undo2Icon,
|
|
@@ -8922,7 +9683,7 @@ function useUndoRedo(config) {
|
|
|
8922
9683
|
isVisible,
|
|
8923
9684
|
handleAction,
|
|
8924
9685
|
canExecute,
|
|
8925
|
-
label:
|
|
9686
|
+
label: t(historyActionLabelKeys[action]),
|
|
8926
9687
|
shortcutKeys: UNDO_REDO_SHORTCUT_KEYS[action],
|
|
8927
9688
|
Icon: historyIcons[action]
|
|
8928
9689
|
};
|
|
@@ -9185,6 +9946,7 @@ var MainToolbarContent = ({
|
|
|
9185
9946
|
isMobile,
|
|
9186
9947
|
isBubble
|
|
9187
9948
|
}) => {
|
|
9949
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
9188
9950
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9189
9951
|
/* @__PURE__ */ jsxRuntime.jsx(Spacer, {}),
|
|
9190
9952
|
!isBubble && tools.includes("undo-redo") && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -9194,9 +9956,9 @@ var MainToolbarContent = ({
|
|
|
9194
9956
|
] }),
|
|
9195
9957
|
/* @__PURE__ */ jsxRuntime.jsx(ToolbarSeparator, {})
|
|
9196
9958
|
] }),
|
|
9197
|
-
onQuote && /* @__PURE__ */ jsxRuntime.jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(QuoteIcon, {}), tooltip: "
|
|
9198
|
-
onCreateAnnotation && /* @__PURE__ */ jsxRuntime.jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(icons.MessageOutlined, {}), tooltip: "
|
|
9199
|
-
onCreateCollection && /* @__PURE__ */ jsxRuntime.jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(icons.BookOutlined, {}), tooltip: "
|
|
9959
|
+
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") }) }),
|
|
9960
|
+
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") }) }),
|
|
9961
|
+
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") }) }),
|
|
9200
9962
|
(tools.includes("heading") || tools.includes("list") || tools.includes("block")) && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9201
9963
|
/* @__PURE__ */ jsxRuntime.jsxs(ToolbarGroup, { children: [
|
|
9202
9964
|
tools.includes("heading") && /* @__PURE__ */ jsxRuntime.jsx(HeadingDropdownMenu, { levels: [1, 2, 3, 4], portal: isMobile }),
|
|
@@ -9437,9 +10199,9 @@ var SearchAndReplace = core.Extension.create({
|
|
|
9437
10199
|
addProseMirrorPlugins() {
|
|
9438
10200
|
const editor = this.editor;
|
|
9439
10201
|
const { searchResultClass, disableRegex } = this.options;
|
|
9440
|
-
const setLastSearchTerm = (
|
|
9441
|
-
const setLastCaseSensitive = (
|
|
9442
|
-
const setLastResultIndex = (
|
|
10202
|
+
const setLastSearchTerm = (t2) => editor.storage.searchAndReplace.lastSearchTerm = t2;
|
|
10203
|
+
const setLastCaseSensitive = (t2) => editor.storage.searchAndReplace.lastCaseSensitive = t2;
|
|
10204
|
+
const setLastResultIndex = (t2) => editor.storage.searchAndReplace.lastResultIndex = t2;
|
|
9443
10205
|
return [
|
|
9444
10206
|
new state.Plugin({
|
|
9445
10207
|
key: searchAndReplacePluginKey,
|
|
@@ -9540,6 +10302,7 @@ var MarkdownEditor_default = React3.forwardRef(
|
|
|
9540
10302
|
collectionConfig,
|
|
9541
10303
|
pageNoConfig
|
|
9542
10304
|
}, ref) => {
|
|
10305
|
+
const { t: t2 } = useTranslation(NS_COMMON);
|
|
9543
10306
|
const isMobile = useIsBreakpoint();
|
|
9544
10307
|
const lastContentRef = React3.useRef("");
|
|
9545
10308
|
const { setPageNoEditor, onPageChange } = usePageNo(pageNoConfig);
|
|
@@ -9576,7 +10339,7 @@ var MarkdownEditor_default = React3.forwardRef(
|
|
|
9576
10339
|
autocomplete: "off",
|
|
9577
10340
|
autocorrect: "off",
|
|
9578
10341
|
autocapitalize: "off",
|
|
9579
|
-
"aria-label": "
|
|
10342
|
+
"aria-label": t2("markdownEditor.mainArea")
|
|
9580
10343
|
}
|
|
9581
10344
|
},
|
|
9582
10345
|
extensions: [
|
|
@@ -9737,7 +10500,7 @@ var MarkdownEditor_default = React3.forwardRef(
|
|
|
9737
10500
|
antd.Button,
|
|
9738
10501
|
{
|
|
9739
10502
|
size: "small",
|
|
9740
|
-
title: "
|
|
10503
|
+
title: t2("markdownEditor.annotation.list"),
|
|
9741
10504
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.MessageOutlined, {}),
|
|
9742
10505
|
color: "primary",
|
|
9743
10506
|
variant: "text",
|
|
@@ -9749,15 +10512,15 @@ var MarkdownEditor_default = React3.forwardRef(
|
|
|
9749
10512
|
{
|
|
9750
10513
|
style: { gap: "2px" },
|
|
9751
10514
|
size: "small",
|
|
9752
|
-
title: "
|
|
10515
|
+
title: t2("markdownEditor.collection.list"),
|
|
9753
10516
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.BookOutlined, {}),
|
|
9754
10517
|
color: "primary",
|
|
9755
10518
|
variant: "text",
|
|
9756
10519
|
onClick: () => setShowCollection(!showCollection),
|
|
9757
|
-
children: "
|
|
10520
|
+
children: t2("markdownEditor.collection.title")
|
|
9758
10521
|
}
|
|
9759
10522
|
),
|
|
9760
|
-
onDownloadFile && /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", color: "primary", variant: "text", onClick: downloadFile2, children: "
|
|
10523
|
+
onDownloadFile && /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", color: "primary", variant: "text", onClick: downloadFile2, children: t2("common.download") }),
|
|
9761
10524
|
extraNav
|
|
9762
10525
|
] })
|
|
9763
10526
|
] }),
|
|
@@ -9930,7 +10693,9 @@ exports.FilePreview = FilePreview_default;
|
|
|
9930
10693
|
exports.FilePreviewDrawer = FilePreviewDrawer_default;
|
|
9931
10694
|
exports.HttpStatus = HttpStatus;
|
|
9932
10695
|
exports.Iframe = Iframe_default;
|
|
10696
|
+
exports.LANG_KEY = LANG_KEY;
|
|
9933
10697
|
exports.LazyComponent = LazyComponent_default;
|
|
10698
|
+
exports.LocaleProvider = LocaleProvider;
|
|
9934
10699
|
exports.LuyaFilePreview = luyaFilePreview_default;
|
|
9935
10700
|
exports.MarkDrawing = MarkDrawing_default;
|
|
9936
10701
|
exports.MarkdownEditor = MarkdownEditor_default;
|
|
@@ -9939,6 +10704,7 @@ exports.MicroApp = MicroApp_default;
|
|
|
9939
10704
|
exports.MicroAppDrawer = Drawer_default;
|
|
9940
10705
|
exports.MicroAppWindow = Window_default;
|
|
9941
10706
|
exports.MultiEmailValidator = MultiEmailValidator;
|
|
10707
|
+
exports.NS_COMMON = NS_COMMON;
|
|
9942
10708
|
exports.PdfImagePreview = PdfImagePreview_default;
|
|
9943
10709
|
exports.PdfPreview = PdfPreview_default;
|
|
9944
10710
|
exports.PhoneOrMobileValidator = PhoneOrMobileValidator;
|
|
@@ -9960,6 +10726,7 @@ exports.ThanNumValidator = ThanNumValidator;
|
|
|
9960
10726
|
exports.UserAvatar = UserAvatar_default;
|
|
9961
10727
|
exports.VideoPlayer = VideoPlayer_default;
|
|
9962
10728
|
exports.absVal = absVal;
|
|
10729
|
+
exports.addBundledResource = addBundledResource;
|
|
9963
10730
|
exports.addUrlLastSlash = addUrlLastSlash;
|
|
9964
10731
|
exports.aesDecrypt = aesDecrypt;
|
|
9965
10732
|
exports.aesEncrypt = aesEncrypt;
|
|
@@ -9967,6 +10734,9 @@ exports.arrToObj = arrToObj;
|
|
|
9967
10734
|
exports.buildUrlParams = buildUrlParams;
|
|
9968
10735
|
exports.cachedMessage = cachedMessage;
|
|
9969
10736
|
exports.calculate = calculate;
|
|
10737
|
+
exports.commonEnUS = commonEnUS;
|
|
10738
|
+
exports.commonJaJP = commonJaJP;
|
|
10739
|
+
exports.commonZhCN = commonZhCN;
|
|
9970
10740
|
exports.compareNum = compareNum;
|
|
9971
10741
|
exports.convertCurrency = convertCurrency;
|
|
9972
10742
|
exports.convertNewlineToBr = convertNewlineToBr;
|
|
@@ -9994,6 +10764,8 @@ exports.getDeviceId = getDeviceId;
|
|
|
9994
10764
|
exports.getEndOfTimestamp = getEndOfTimestamp;
|
|
9995
10765
|
exports.getFileName = getFileName;
|
|
9996
10766
|
exports.getFileSuffixName = getFileSuffixName;
|
|
10767
|
+
exports.getI18n = getI18n;
|
|
10768
|
+
exports.getLang = getLang;
|
|
9997
10769
|
exports.getRowSpanCount = getRowSpanCount;
|
|
9998
10770
|
exports.getStartOfTimestamp = getStartOfTimestamp;
|
|
9999
10771
|
exports.getTimestamp = getTimestamp;
|
|
@@ -10001,6 +10773,7 @@ exports.getWebSocketUrl = getWebSocketUrl;
|
|
|
10001
10773
|
exports.htmlToMarkdown = htmlToMarkdown;
|
|
10002
10774
|
exports.htmlToText = htmlToText;
|
|
10003
10775
|
exports.importThirdPartyFile = importThirdPartyFile;
|
|
10776
|
+
exports.initI18n = initI18n;
|
|
10004
10777
|
exports.is = is;
|
|
10005
10778
|
exports.isArray = isArray;
|
|
10006
10779
|
exports.isBlob = isBlob;
|
|
@@ -10042,6 +10815,8 @@ exports.safeParseJson = safeParseJson;
|
|
|
10042
10815
|
exports.setInterval = setInterval2;
|
|
10043
10816
|
exports.setUrlMainSource = setUrlMainSource;
|
|
10044
10817
|
exports.shouldRender = shouldRender;
|
|
10818
|
+
exports.switchLang = switchLang;
|
|
10819
|
+
exports.t = t;
|
|
10045
10820
|
exports.times = times;
|
|
10046
10821
|
exports.toFixed = toFixed;
|
|
10047
10822
|
exports.transform = transform;
|
|
@@ -10056,6 +10831,7 @@ exports.useIframeRelayBridge = useIframeRelayBridge_default;
|
|
|
10056
10831
|
exports.useRefState = useRefState_default;
|
|
10057
10832
|
exports.useSyncInput = useSyncInput_default;
|
|
10058
10833
|
exports.useThrottle = useThrottle_default;
|
|
10834
|
+
exports.useTranslation = useTranslation;
|
|
10059
10835
|
exports.useWebSocket = useWebSocket_default;
|
|
10060
10836
|
//# sourceMappingURL=index.cjs.js.map
|
|
10061
10837
|
//# sourceMappingURL=index.cjs.js.map
|