@zero-library/common 3.1.7 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,11 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var icons = require('@ant-design/icons');
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/components/File/styles.module.less
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, t) => {
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
- }, t);
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 = "\u590D\u5236\u6210\u529F") => {
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 || "\u6587\u4EF6";
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 = "\u63D0\u793A", content, type = "warning", duration = 3, onClose, isCache = true, isOnly = false }) => {
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: "\u624B\u673A\u53F7\u683C\u5F0F\u4E0D\u6B63\u786E\uFF01"
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: "\u7535\u8BDD\u53F7\u7801\u683C\u5F0F\u4E0D\u6B63\u786E\uFF01"
988
+ get message() {
989
+ return t("pattern.phoneInvalid");
990
+ }
1013
991
  };
1014
992
  var RegTelePhone = {
1015
993
  pattern: /^[\\+\-\\(\\)\\(\\)\d]{1,20}$/,
1016
- message: "\u7535\u8BDD\u53F7\u7801\u683C\u5F0F\u4E0D\u6B63\u786E\uFF01"
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: "\u7A0E\u53F7\u683C\u5F0F\u6709\u8BEF\uFF01"
1000
+ get message() {
1001
+ return t("pattern.taxNoInvalid");
1002
+ }
1021
1003
  };
1022
1004
  var RegBankCardNo = {
1023
1005
  pattern: /^[0-9]*$/,
1024
- message: "\u94F6\u884C\u5361\u53F7\u683C\u5F0F\u6709\u8BEF\uFF01"
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: "\u8EAB\u4EFD\u8BC1\u53F7\u683C\u5F0F\u6709\u8BEF\uFF01"
1012
+ get message() {
1013
+ return t("pattern.idCardInvalid");
1014
+ }
1029
1015
  };
1030
1016
  var RegNumNo = {
1031
1017
  pattern: /^[0-9]*$/,
1032
- message: "\u683C\u5F0F\u6709\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165\uFF01"
1018
+ get message() {
1019
+ return t("pattern.numberInvalid");
1020
+ }
1033
1021
  };
1034
1022
  var RegSmsCode = {
1035
1023
  pattern: /^[0-9]{6}$/,
1036
- message: "\u9A8C\u8BC1\u7801\u4E3A6\u4F4D\u6570\u5B57"
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: "\u90AE\u7BB1\u683C\u5F0F\u6709\u8BEF\uFF01"
1030
+ get message() {
1031
+ return t("pattern.emailInvalid");
1032
+ }
1041
1033
  };
1042
1034
  var RegDetailAddress = {
1043
1035
  pattern: /.*(街|路|村|乡|镇|道|巷|号).*/,
1044
- message: "\u5FC5\u987B\u5305\u542B\u201C\u8857\u3001\u8DEF\u3001\u6751\u3001\u4E61\u3001\u9547\u3001\u9053\u3001\u5DF7\u3001\u53F7\u201D\u7B49\u5173\u952E\u8BCD\u4E4B\u4E00"
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: "\u5BC6\u7801\u4E3A8\u523026\u4F4D\u4E4B\u95F4\u6570\u5B57\u4E0E\u5B57\u6BCD\u7EC4\u5408"
1042
+ get message() {
1043
+ return t("pattern.passwordInvalid");
1044
+ }
1049
1045
  };
1050
- var PhoneOrMobileValidator = (errMessage = "\u8054\u7CFB\u7535\u8BDD\u683C\u5F0F\u4E0D\u6B63\u786E") => ({
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 || `\u4E0D\u80FD\u5C0F\u4E8E${equalMin ? "" : "\u7B49\u4E8E"}${min}`));
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 || `\u4E0D\u80FD\u5927\u4E8E${equalMax ? "" : "\u7B49\u4E8E"}${max}`));
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 || `\u603B\u4F4D\u6570\u4E0D\u80FD\u8D85\u8FC7${length}\u4F4D`));
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 || `\u6574\u6570\u4F4D\u4E0D\u80FD\u8D85\u8FC7${integerLength}\u4F4D`));
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 || `\u5C0F\u6570\u4F4D\u4E0D\u80FD\u8D85\u8FC7${decimalsLength}\u4F4D`));
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(`\u6700\u591A\u8F93\u5165${max}\u4E2A\u90AE\u7BB1`));
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: "\u7F51\u7EDC\u5F02\u5E38\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC", type: "error" });
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 || "\u8BF7\u6C42\u9519\u8BEF\uFF01", type: "error" });
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,692 @@ 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
+ previewImageAlt: "\u9884\u89C8\u56FE\u7247",
1382
+ previewNotSupported: "\u6682\u4E0D\u652F\u6301 {{suffix}} \u6587\u4EF6\u7684\u9884\u89C8",
1383
+ previewNotSupportedDownload: "{{suffix}} \u6587\u4EF6\u6682\u4E0D\u652F\u6301\u5728\u7EBF\u9884\u89C8\uFF0C\u8BF7\u4E0B\u8F7D\u6253\u5F00",
1384
+ previewGenerating: "\u9884\u89C8\u6587\u4EF6\u6B63\u5728\u751F\u6210\u4E2D...",
1385
+ audioNotSupported: "\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 audio \u6807\u7B7E\u3002",
1386
+ videoNotSupported: "\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 video \u6807\u7B7E\u3002",
1387
+ requestFailedWithStatus: "\u8BF7\u6C42\u5931\u8D25\uFF0C\u72B6\u6001\u7801: {{status}}",
1388
+ emptyResponse: "\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A",
1389
+ loadFileFailed: "\u52A0\u8F7D\u6587\u4EF6\u5931\u8D25",
1390
+ fileParseFailed: "\u52A0\u8F7D\u6216\u89E3\u6790\u6587\u4EF6\u5931\u8D25",
1391
+ fileUrlInvalid: "\u6587\u4EF6\u5730\u5740\u9519\u8BEF",
1392
+ htmlParseFailed: "\u52A0\u8F7D\u6216\u89E3\u6790 HTML \u5931\u8D25",
1393
+ docLoadFailed: "\u6587\u6863\u52A0\u8F7D\u5931\u8D25",
1394
+ pdfLoadFailed: "PDF \u52A0\u8F7D\u5931\u8D25",
1395
+ pdfParseFailed: "\u52A0\u8F7D\u6216\u89E3\u6790 pdf \u5931\u8D25",
1396
+ pdfUrlInvalid: "pdf\u5730\u5740\u9519\u8BEF",
1397
+ pdfPasswordInvalid: "\u5BC6\u7801\u65E0\u6548\u3002\u8BF7\u518D\u8BD5\u4E00\u6B21\uFF01",
1398
+ pdfPasswordPlaceholder: "\u8BF7\u8F93\u5165\u5BC6\u7801",
1399
+ pdfSubmit: "\u63D0 \u4EA4",
1400
+ pdfInvalidOrDamaged: "\u6587\u4EF6\u65E0\u6548\u6216\u5DF2\u635F\u574F",
1401
+ pdfFileNotFound: "\u6587\u4EF6\u4E0D\u5B58\u5728",
1402
+ pdfUnexpectedResponse: "\u610F\u5916\u7684\u670D\u52A1\u5668\u54CD\u5E94",
1403
+ pdfLoadDocumentFailed: "\u65E0\u6CD5\u52A0\u8F7D\u6587\u6863",
1404
+ zoomOut: "\u7F29\u5C0F",
1405
+ zoomIn: "\u653E\u5927",
1406
+ zoomReset: "\u8FD8\u539F",
1407
+ fitWidth: "\u9002\u5E94\u5BBD\u5EA6"
1408
+ },
1409
+ // MarkdownEditor 富文本编辑器
1410
+ markdownEditor: {
1411
+ mainArea: "\u4E3B\u5185\u5BB9\u533A\u57DF\uFF0C\u5F00\u59CB\u8F93\u5165\u6587\u672C...",
1412
+ unknown: "\u672A\u77E5",
1413
+ // 工具栏
1414
+ toolbar: {
1415
+ quote: "\u5F15\u7528\u9009\u4E2D\u6587\u672C",
1416
+ annotation: "\u6279\u6CE8",
1417
+ excerpt: "\u6458\u5F55\u7B14\u8BB0",
1418
+ undo: "\u64A4\u9500",
1419
+ redo: "\u91CD\u505A",
1420
+ alignLeft: "\u5DE6\u5BF9\u9F50",
1421
+ alignCenter: "\u5C45\u4E2D\u5BF9\u9F50",
1422
+ alignRight: "\u53F3\u5BF9\u9F50",
1423
+ alignJustify: "\u4E24\u7AEF\u5BF9\u9F50",
1424
+ bold: "\u7C97\u4F53",
1425
+ italic: "\u659C\u4F53",
1426
+ underline: "\u4E0B\u5212\u7EBF",
1427
+ strike: "\u5220\u9664\u7EBF",
1428
+ code: "\u4EE3\u7801",
1429
+ superscript: "\u4E0A\u89D2\u6807",
1430
+ subscript: "\u4E0B\u89D2\u6807",
1431
+ bulletList: "\u65E0\u5E8F\u5217\u8868",
1432
+ orderedList: "\u6709\u5E8F\u5217\u8868",
1433
+ taskList: "\u4EFB\u52A1\u5217\u8868",
1434
+ listOptions: "\u5217\u8868\u9009\u9879",
1435
+ list: "\u5217\u8868",
1436
+ blockquote: "\u5F15\u7528\u5757",
1437
+ codeBlock: "\u4EE3\u7801\u5757",
1438
+ heading: "\u6807\u9898",
1439
+ headingLevel: "\u6807\u9898 {{level}}",
1440
+ addImage: "\u6DFB\u52A0\u56FE\u7247",
1441
+ link: "\u94FE\u63A5",
1442
+ linkPlaceholder: "\u7C98\u8D34\u94FE\u63A5...",
1443
+ applyLink: "\u5E94\u7528\u94FE\u63A5",
1444
+ openInNewWindow: "\u5728\u65B0\u7A97\u53E3\u4E2D\u6253\u5F00",
1445
+ removeLink: "\u79FB\u9664\u94FE\u63A5"
1446
+ },
1447
+ // 高亮 / 背景色
1448
+ highlight: {
1449
+ toggle: "\u5207\u6362\u9AD8\u4EAE\u663E\u793A ({{color}})",
1450
+ label: "\u80CC\u666F\u8272",
1451
+ textLabel: "\u6587\u672C\u80CC\u666F\u8272",
1452
+ removeBackground: "\u79FB\u9664\u80CC\u666F",
1453
+ removeHighlight: "\u79FB\u9664\u9AD8\u4EAE",
1454
+ default: "\u9ED8\u8BA4\u80CC\u666F",
1455
+ gray: "\u7070\u8272\u80CC\u666F",
1456
+ brown: "\u68D5\u8272\u80CC\u666F",
1457
+ orange: "\u6A59\u8272\u80CC\u666F",
1458
+ yellow: "\u9EC4\u8272\u80CC\u666F",
1459
+ green: "\u7EFF\u8272\u80CC\u666F",
1460
+ blue: "\u84DD\u8272\u80CC\u666F",
1461
+ purple: "\u7D2B\u8272\u80CC\u666F",
1462
+ pink: "\u7C89\u8272\u80CC\u666F",
1463
+ red: "\u7EA2\u8272\u80CC\u666F"
1464
+ },
1465
+ // 批注
1466
+ annotation: {
1467
+ title: "\u6279\u6CE8",
1468
+ list: "\u6279\u6CE8\u5217\u8868",
1469
+ add: "\u6DFB\u52A0\u6279\u6CE8",
1470
+ content: "\u6279\u6CE8\u5185\u5BB9",
1471
+ required: "\u8BF7\u8F93\u5165\u6279\u6CE8\u5185\u5BB9",
1472
+ maxLength: "\u6279\u6CE8\u5185\u5BB9\u4E0D\u80FD\u8D85\u8FC7500\u4E2A\u5B57\u7B26",
1473
+ placeholder: "\u8BF7\u8F93\u5165\u60A8\u7684\u6279\u6CE8\u5185\u5BB9...",
1474
+ edit: "\u7F16\u8F91\u6279\u6CE8",
1475
+ delete: "\u5220\u9664\u6279\u6CE8",
1476
+ confirmDelete: "\u786E\u8BA4\u5220\u9664\u5F53\u524D\u6279\u6CE8\u5417?",
1477
+ empty: "\u6682\u65E0\u6279\u6CE8"
1478
+ },
1479
+ // 摘录
1480
+ collection: {
1481
+ title: "\u6458\u5F55",
1482
+ list: "\u6458\u5F55\u5217\u8868",
1483
+ delete: "\u5220\u9664\u6458\u5F55",
1484
+ confirmDelete: "\u786E\u8BA4\u5220\u9664\u5F53\u524D\u6458\u5F55\u5417?",
1485
+ empty: "\u6682\u65E0\u6458\u5F55"
1486
+ },
1487
+ // 文件 / 图片上传
1488
+ upload: {
1489
+ noFile: "\u672A\u63D0\u4F9B\u6587\u4EF6",
1490
+ canceled: "\u4E0A\u4F20\u5DF2\u53D6\u6D88",
1491
+ fileSizeExceeded: "\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u6700\u5927\u9650\u5236 ({{max}}MB)",
1492
+ undefined: "\u4E0A\u4F20\u529F\u80FD\u672A\u5B9A\u4E49",
1493
+ failedNoUrl: "\u4E0A\u4F20\u5931\u8D25\uFF1A\u672A\u8FD4\u56DEURL",
1494
+ failed: "\u4E0A\u4F20\u5931\u8D25",
1495
+ noFileToUpload: "\u6CA1\u6709\u6587\u4EF6\u53EF\u4E0A\u4F20",
1496
+ maxFileCount: "\u6700\u591A\u5141\u8BB8\u4E0A\u4F20 {{limit}} \u4E2A\u6587\u4EF6"
1497
+ }
1498
+ }
1499
+ };
1500
+
1501
+ // src/i18n/en-US.ts
1502
+ var commonEnUS = {
1503
+ common: {
1504
+ copySuccess: "Copied successfully",
1505
+ confirm: "OK",
1506
+ cancel: "Cancel",
1507
+ download: "Download",
1508
+ save: "Save",
1509
+ defaultFileName: "file",
1510
+ defaultTitle: "Notice",
1511
+ loading: "Loading...",
1512
+ // Shared keys (extracted from duplicates ≥ 3)
1513
+ enter: "Enter App",
1514
+ applicationCenter: "App Center",
1515
+ subscribeSuccess: "Subscribed successfully",
1516
+ subscribeConfirm: "Subscribe to {{name}}?",
1517
+ installConfirm: "{{action}} {{name}}?",
1518
+ prompt: "Prompt",
1519
+ dynamicNews: "Activity Feed",
1520
+ noDynamicNews: "No recent activity"
1521
+ },
1522
+ request: {
1523
+ networkError: "Network error, please check your connection",
1524
+ requestError: "Request error!"
1525
+ },
1526
+ pattern: {
1527
+ mobileInvalid: "Invalid phone number!",
1528
+ phoneInvalid: "Invalid phone number!",
1529
+ taxNoInvalid: "Invalid tax number!",
1530
+ bankCardInvalid: "Invalid bank card number!",
1531
+ idCardInvalid: "Invalid ID card number!",
1532
+ numberInvalid: "Invalid format, please re-enter!",
1533
+ smsCodeInvalid: "SMS code must be 6 digits",
1534
+ emailInvalid: "Invalid email format!",
1535
+ addressInvalid: "Must contain one of: street, road, village, town, etc.",
1536
+ passwordInvalid: "Password must be 8-26 characters with letters and numbers",
1537
+ phoneOrMobileInvalid: "Invalid contact number",
1538
+ lessThan: "Cannot be less than {{value}}",
1539
+ lessThanOrEqual: "Cannot be less than or equal to {{value}}",
1540
+ greaterThan: "Cannot be greater than {{value}}",
1541
+ greaterThanOrEqual: "Cannot be greater than or equal to {{value}}",
1542
+ totalLengthExceed: "Total digits cannot exceed {{length}}",
1543
+ integerLengthExceed: "Integer digits cannot exceed {{length}}",
1544
+ decimalLengthExceed: "Decimal digits cannot exceed {{length}}",
1545
+ maxEmailsExceed: "Maximum {{max}} emails allowed"
1546
+ },
1547
+ date: {
1548
+ yearMonthFormat: "YYYY-MM",
1549
+ yearMonthDayFormat: "YYYY-MM-DD"
1550
+ },
1551
+ speechButton: {
1552
+ notSupported: "Speech recognition is not supported in this browser",
1553
+ permissionDenied: "Microphone permission denied",
1554
+ stop: "Stop Recording",
1555
+ start: "Click to Start Recording"
1556
+ },
1557
+ microApp: {
1558
+ loading: "Loading..."
1559
+ },
1560
+ iframe: {
1561
+ loading: "Loading..."
1562
+ },
1563
+ lazyComponent: {
1564
+ unknownType: "Unknown type: {{type}}",
1565
+ componentLoading: "Loading component..."
1566
+ },
1567
+ filePreview: {
1568
+ title: "File Preview",
1569
+ closePreview: "Close preview",
1570
+ previewImageAlt: "Preview image",
1571
+ previewNotSupported: "Preview of {{suffix}} files is not supported",
1572
+ previewNotSupportedDownload: "{{suffix}} files cannot be previewed online, please download and open",
1573
+ previewGenerating: "Preview file is being generated...",
1574
+ audioNotSupported: "Your browser does not support the audio tag.",
1575
+ videoNotSupported: "Your browser does not support the video tag.",
1576
+ requestFailedWithStatus: "Request failed, status code: {{status}}",
1577
+ emptyResponse: "Response content is empty",
1578
+ loadFileFailed: "Failed to load file",
1579
+ fileParseFailed: "Failed to load or parse file",
1580
+ fileUrlInvalid: "Invalid file URL",
1581
+ htmlParseFailed: "Failed to load or parse HTML",
1582
+ docLoadFailed: "Failed to load document",
1583
+ pdfLoadFailed: "Failed to load PDF",
1584
+ pdfParseFailed: "Failed to load or parse PDF",
1585
+ pdfUrlInvalid: "Invalid PDF URL",
1586
+ pdfPasswordInvalid: "Invalid password. Please try again!",
1587
+ pdfPasswordPlaceholder: "Please enter password",
1588
+ pdfSubmit: "Submit",
1589
+ pdfInvalidOrDamaged: "File is invalid or damaged",
1590
+ pdfFileNotFound: "File not found",
1591
+ pdfUnexpectedResponse: "Unexpected server response",
1592
+ pdfLoadDocumentFailed: "Unable to load document",
1593
+ zoomOut: "Zoom out",
1594
+ zoomIn: "Zoom in",
1595
+ zoomReset: "Reset",
1596
+ fitWidth: "Fit width"
1597
+ },
1598
+ markdownEditor: {
1599
+ mainArea: "Main content area, start typing...",
1600
+ unknown: "Unknown",
1601
+ toolbar: {
1602
+ quote: "Quote Selected Text",
1603
+ annotation: "Annotate",
1604
+ excerpt: "Excerpt Note",
1605
+ undo: "Undo",
1606
+ redo: "Redo",
1607
+ alignLeft: "Align Left",
1608
+ alignCenter: "Align Center",
1609
+ alignRight: "Align Right",
1610
+ alignJustify: "Justify",
1611
+ bold: "Bold",
1612
+ italic: "Italic",
1613
+ underline: "Underline",
1614
+ strike: "Strikethrough",
1615
+ code: "Code",
1616
+ superscript: "Superscript",
1617
+ subscript: "Subscript",
1618
+ bulletList: "Bullet List",
1619
+ orderedList: "Numbered List",
1620
+ taskList: "Task List",
1621
+ listOptions: "List Options",
1622
+ list: "List",
1623
+ blockquote: "Blockquote",
1624
+ codeBlock: "Code Block",
1625
+ heading: "Heading",
1626
+ headingLevel: "Heading {{level}}",
1627
+ addImage: "Add Image",
1628
+ link: "Link",
1629
+ linkPlaceholder: "Paste link...",
1630
+ applyLink: "Apply Link",
1631
+ openInNewWindow: "Open in New Window",
1632
+ removeLink: "Remove Link"
1633
+ },
1634
+ highlight: {
1635
+ toggle: "Toggle highlight ({{color}})",
1636
+ label: "Background color",
1637
+ textLabel: "Text background color",
1638
+ removeBackground: "Remove background",
1639
+ removeHighlight: "Remove highlight",
1640
+ default: "Default background",
1641
+ gray: "Gray background",
1642
+ brown: "Brown background",
1643
+ orange: "Orange background",
1644
+ yellow: "Yellow background",
1645
+ green: "Green background",
1646
+ blue: "Blue background",
1647
+ purple: "Purple background",
1648
+ pink: "Pink background",
1649
+ red: "Red background"
1650
+ },
1651
+ annotation: {
1652
+ title: "Annotations",
1653
+ list: "Annotations",
1654
+ add: "Add Annotation",
1655
+ content: "Annotation content",
1656
+ required: "Please enter annotation content",
1657
+ maxLength: "Annotation content cannot exceed 500 characters",
1658
+ placeholder: "Please enter your annotation...",
1659
+ edit: "Edit Annotation",
1660
+ delete: "Delete annotation",
1661
+ confirmDelete: "Delete this annotation?",
1662
+ empty: "No annotations"
1663
+ },
1664
+ collection: {
1665
+ title: "Excerpts",
1666
+ list: "Excerpts",
1667
+ delete: "Delete excerpt",
1668
+ confirmDelete: "Delete this excerpt?",
1669
+ empty: "No excerpts"
1670
+ },
1671
+ upload: {
1672
+ noFile: "No file provided",
1673
+ canceled: "Upload canceled",
1674
+ fileSizeExceeded: "File size exceeds the maximum limit ({{max}}MB)",
1675
+ undefined: "Upload function is not defined",
1676
+ failedNoUrl: "Upload failed: no URL returned",
1677
+ failed: "Upload failed",
1678
+ noFileToUpload: "No file to upload",
1679
+ maxFileCount: "A maximum of {{limit}} files can be uploaded"
1680
+ }
1681
+ }
1682
+ };
1683
+
1684
+ // src/i18n/ja-JP.ts
1685
+ var commonJaJP = {
1686
+ // 共通文案
1687
+ common: {
1688
+ copySuccess: "\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",
1689
+ confirm: "OK",
1690
+ cancel: "\u30AD\u30E3\u30F3\u30BB\u30EB",
1691
+ download: "\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9",
1692
+ save: "\u4FDD\u5B58",
1693
+ defaultFileName: "\u30D5\u30A1\u30A4\u30EB",
1694
+ defaultTitle: "\u30D2\u30F3\u30C8",
1695
+ loading: "\u8AAD\u307F\u8FBC\u307F\u4E2D...",
1696
+ // 共通キー(3回以上重複のため抽出)
1697
+ enter: "\u30A2\u30D7\u30EA\u306B\u5165\u308B",
1698
+ applicationCenter: "\u30A2\u30D7\u30EA\u30BB\u30F3\u30BF\u30FC",
1699
+ subscribeSuccess: "\u30B5\u30D6\u30B9\u30AF\u6210\u529F",
1700
+ subscribeConfirm: "{{name}}\u3092\u30B5\u30D6\u30B9\u30AF\u3057\u307E\u3059\u304B\uFF1F",
1701
+ installConfirm: "{{name}}\u3092{{action}}\u3057\u307E\u3059\u304B\uFF1F",
1702
+ prompt: "\u30D2\u30F3\u30C8",
1703
+ dynamicNews: "\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3",
1704
+ noDynamicNews: "\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u306A\u3057"
1705
+ },
1706
+ // utils/request.ts
1707
+ request: {
1708
+ 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",
1709
+ requestError: "\u30EA\u30AF\u30A8\u30B9\u30C8\u30A8\u30E9\u30FC\uFF01"
1710
+ },
1711
+ // utils/pattern.ts — バリデーションメッセージ
1712
+ pattern: {
1713
+ mobileInvalid: "\u643A\u5E2F\u96FB\u8A71\u756A\u53F7\u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\uFF01",
1714
+ phoneInvalid: "\u96FB\u8A71\u756A\u53F7\u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\uFF01",
1715
+ taxNoInvalid: "\u7A0E\u756A\u53F7\u306E\u5F62\u5F0F\u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\uFF01",
1716
+ bankCardInvalid: "\u9280\u884C\u30AB\u30FC\u30C9\u756A\u53F7\u306E\u5F62\u5F0F\u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\uFF01",
1717
+ idCardInvalid: "\u8EAB\u5206\u8A3C\u660E\u66F8\u756A\u53F7\u306E\u5F62\u5F0F\u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\uFF01",
1718
+ numberInvalid: "\u5F62\u5F0F\u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\u3002\u518D\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF01",
1719
+ smsCodeInvalid: "\u8A8D\u8A3C\u30B3\u30FC\u30C9\u306F6\u6841\u306E\u6570\u5B57\u3067\u3059",
1720
+ emailInvalid: "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306E\u5F62\u5F0F\u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\uFF01",
1721
+ 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",
1722
+ passwordInvalid: "\u30D1\u30B9\u30EF\u30FC\u30C9\u306F8\u301C26\u6587\u5B57\u306E\u82F1\u6570\u5B57\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059",
1723
+ phoneOrMobileInvalid: "\u9023\u7D61\u5148\u96FB\u8A71\u756A\u53F7\u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093",
1724
+ // 補間例:{{value}} は実際の値に置換されます
1725
+ lessThan: "{{value}}\u672A\u6E80\u306B\u3067\u304D\u307E\u305B\u3093",
1726
+ lessThanOrEqual: "{{value}}\u4EE5\u4E0B\u306B\u3067\u304D\u307E\u305B\u3093",
1727
+ greaterThan: "{{value}}\u3092\u8D85\u3048\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",
1728
+ greaterThanOrEqual: "{{value}}\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
1729
+ totalLengthExceed: "\u7DCF\u6841\u6570\u306F{{length}}\u6841\u3092\u8D85\u3048\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",
1730
+ integerLengthExceed: "\u6574\u6570\u90E8\u306F{{length}}\u6841\u3092\u8D85\u3048\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",
1731
+ decimalLengthExceed: "\u5C0F\u6570\u90E8\u306F{{length}}\u6841\u3092\u8D85\u3048\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",
1732
+ maxEmailsExceed: "\u6700\u5927{{max}}\u4EF6\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u307E\u3067\u5165\u529B\u3067\u304D\u307E\u3059"
1733
+ },
1734
+ // utils/date.ts
1735
+ date: {
1736
+ yearMonthFormat: "YYYY\u5E74MM\u6708",
1737
+ yearMonthDayFormat: "YYYY\u5E74MM\u6708DD\u65E5"
1738
+ },
1739
+ // SpeechButton 音声ボタン
1740
+ speechButton: {
1741
+ notSupported: "\u73FE\u5728\u306E\u30D6\u30E9\u30A6\u30B6\u306F\u97F3\u58F0\u8A8D\u8B58\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093",
1742
+ permissionDenied: "\u30DE\u30A4\u30AF\u306E\u6A29\u9650\u304C\u62D2\u5426\u3055\u308C\u307E\u3057\u305F",
1743
+ stop: "\u9332\u97F3\u3092\u505C\u6B62",
1744
+ start: "\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u9332\u97F3\u3092\u958B\u59CB"
1745
+ },
1746
+ // MicroApp / Iframe
1747
+ microApp: {
1748
+ loading: "\u8AAD\u307F\u8FBC\u307F\u4E2D..."
1749
+ },
1750
+ iframe: {
1751
+ loading: "\u8AAD\u307F\u8FBC\u307F\u4E2D..."
1752
+ },
1753
+ // LazyComponent 遅延読み込みコンポーネント
1754
+ lazyComponent: {
1755
+ unknownType: "\u4E0D\u660E\u306A\u30BF\u30A4\u30D7\uFF1A{{type}}",
1756
+ componentLoading: "\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D..."
1757
+ },
1758
+ // File ファイルプレビューコンポーネント群
1759
+ filePreview: {
1760
+ title: "\u30D5\u30A1\u30A4\u30EB\u30D7\u30EC\u30D3\u30E5\u30FC",
1761
+ closePreview: "\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u9589\u3058\u308B",
1762
+ previewImageAlt: "\u30D7\u30EC\u30D3\u30E5\u30FC\u753B\u50CF",
1763
+ previewNotSupported: "{{suffix}}\u30D5\u30A1\u30A4\u30EB\u306E\u30D7\u30EC\u30D3\u30E5\u30FC\u306B\u306F\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093",
1764
+ 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",
1765
+ previewGenerating: "\u30D7\u30EC\u30D3\u30E5\u30FC\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u4E2D...",
1766
+ audioNotSupported: "\u304A\u4F7F\u3044\u306E\u30D6\u30E9\u30A6\u30B6\u306F audio \u30BF\u30B0\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002",
1767
+ videoNotSupported: "\u304A\u4F7F\u3044\u306E\u30D6\u30E9\u30A6\u30B6\u306F video \u30BF\u30B0\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002",
1768
+ requestFailedWithStatus: "\u30EA\u30AF\u30A8\u30B9\u30C8\u5931\u6557\u3001\u30B9\u30C6\u30FC\u30BF\u30B9\u30B3\u30FC\u30C9: {{status}}",
1769
+ emptyResponse: "\u8FD4\u4FE1\u5185\u5BB9\u304C\u7A7A\u3067\u3059",
1770
+ loadFileFailed: "\u30D5\u30A1\u30A4\u30EB\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
1771
+ fileParseFailed: "\u30D5\u30A1\u30A4\u30EB\u306E\u8AAD\u307F\u8FBC\u307F\u307E\u305F\u306F\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
1772
+ fileUrlInvalid: "\u30D5\u30A1\u30A4\u30EBURL\u304C\u4E0D\u6B63\u3067\u3059",
1773
+ htmlParseFailed: "HTML\u306E\u8AAD\u307F\u8FBC\u307F\u307E\u305F\u306F\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
1774
+ docLoadFailed: "\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
1775
+ pdfLoadFailed: "PDF\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
1776
+ pdfParseFailed: "PDF\u306E\u8AAD\u307F\u8FBC\u307F\u307E\u305F\u306F\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
1777
+ pdfUrlInvalid: "PDF\u306EURL\u304C\u4E0D\u6B63\u3067\u3059",
1778
+ pdfPasswordInvalid: "\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u7121\u52B9\u3067\u3059\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\uFF01",
1779
+ pdfPasswordPlaceholder: "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
1780
+ pdfSubmit: "\u9001 \u4FE1",
1781
+ pdfInvalidOrDamaged: "\u30D5\u30A1\u30A4\u30EB\u304C\u7121\u52B9\u307E\u305F\u306F\u7834\u640D\u3057\u3066\u3044\u307E\u3059",
1782
+ pdfFileNotFound: "\u30D5\u30A1\u30A4\u30EB\u304C\u5B58\u5728\u3057\u307E\u305B\u3093",
1783
+ pdfUnexpectedResponse: "\u4E88\u671F\u3057\u306A\u3044\u30B5\u30FC\u30D0\u30FC\u30EC\u30B9\u30DD\u30F3\u30B9",
1784
+ pdfLoadDocumentFailed: "\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093",
1785
+ zoomOut: "\u7E2E\u5C0F",
1786
+ zoomIn: "\u62E1\u5927",
1787
+ zoomReset: "\u5143\u306B\u623B\u3059",
1788
+ fitWidth: "\u5E45\u306B\u5408\u308F\u305B\u308B"
1789
+ },
1790
+ // MarkdownEditor リッチテキストエディタ
1791
+ markdownEditor: {
1792
+ mainArea: "\u30E1\u30A4\u30F3\u30B3\u30F3\u30C6\u30F3\u30C4\u30A8\u30EA\u30A2\u3001\u30C6\u30AD\u30B9\u30C8\u3092\u5165\u529B...",
1793
+ unknown: "\u4E0D\u660E",
1794
+ // ツールバー
1795
+ toolbar: {
1796
+ quote: "\u9078\u629E\u30C6\u30AD\u30B9\u30C8\u3092\u5F15\u7528",
1797
+ annotation: "\u6CE8\u91C8",
1798
+ excerpt: "\u629C\u7C8B\u30E1\u30E2",
1799
+ undo: "\u5143\u306B\u623B\u3059",
1800
+ redo: "\u3084\u308A\u76F4\u3059",
1801
+ alignLeft: "\u5DE6\u63C3\u3048",
1802
+ alignCenter: "\u4E2D\u592E\u63C3\u3048",
1803
+ alignRight: "\u53F3\u63C3\u3048",
1804
+ alignJustify: "\u4E21\u7AEF\u63C3\u3048",
1805
+ bold: "\u592A\u5B57",
1806
+ italic: "\u659C\u4F53",
1807
+ underline: "\u4E0B\u7DDA",
1808
+ strike: "\u53D6\u308A\u6D88\u3057\u7DDA",
1809
+ code: "\u30B3\u30FC\u30C9",
1810
+ superscript: "\u4E0A\u4ED8\u304D\u6587\u5B57",
1811
+ subscript: "\u4E0B\u4ED8\u304D\u6587\u5B57",
1812
+ bulletList: "\u7B87\u6761\u66F8\u304D",
1813
+ orderedList: "\u756A\u53F7\u4ED8\u304D\u30EA\u30B9\u30C8",
1814
+ taskList: "\u30BF\u30B9\u30AF\u30EA\u30B9\u30C8",
1815
+ listOptions: "\u30EA\u30B9\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3",
1816
+ list: "\u30EA\u30B9\u30C8",
1817
+ blockquote: "\u5F15\u7528\u30D6\u30ED\u30C3\u30AF",
1818
+ codeBlock: "\u30B3\u30FC\u30C9\u30D6\u30ED\u30C3\u30AF",
1819
+ heading: "\u898B\u51FA\u3057",
1820
+ headingLevel: "\u898B\u51FA\u3057 {{level}}",
1821
+ addImage: "\u753B\u50CF\u3092\u8FFD\u52A0",
1822
+ link: "\u30EA\u30F3\u30AF",
1823
+ linkPlaceholder: "\u30EA\u30F3\u30AF\u3092\u8CBC\u308A\u4ED8\u3051...",
1824
+ applyLink: "\u30EA\u30F3\u30AF\u3092\u9069\u7528",
1825
+ openInNewWindow: "\u65B0\u3057\u3044\u30A6\u30A3\u30F3\u30C9\u30A6\u3067\u958B\u304F",
1826
+ removeLink: "\u30EA\u30F3\u30AF\u3092\u524A\u9664"
1827
+ },
1828
+ // ハイライト / 背景色
1829
+ highlight: {
1830
+ toggle: "\u30CF\u30A4\u30E9\u30A4\u30C8\u8868\u793A\u3092\u5207\u308A\u66FF\u3048 ({{color}})",
1831
+ label: "\u80CC\u666F\u8272",
1832
+ textLabel: "\u30C6\u30AD\u30B9\u30C8\u80CC\u666F\u8272",
1833
+ removeBackground: "\u80CC\u666F\u3092\u524A\u9664",
1834
+ removeHighlight: "\u30CF\u30A4\u30E9\u30A4\u30C8\u3092\u524A\u9664",
1835
+ default: "\u30C7\u30D5\u30A9\u30EB\u30C8\u80CC\u666F",
1836
+ gray: "\u30B0\u30EC\u30FC\u80CC\u666F",
1837
+ brown: "\u30D6\u30E9\u30A6\u30F3\u80CC\u666F",
1838
+ orange: "\u30AA\u30EC\u30F3\u30B8\u80CC\u666F",
1839
+ yellow: "\u30A4\u30A8\u30ED\u30FC\u80CC\u666F",
1840
+ green: "\u30B0\u30EA\u30FC\u30F3\u80CC\u666F",
1841
+ blue: "\u30D6\u30EB\u30FC\u80CC\u666F",
1842
+ purple: "\u30D1\u30FC\u30D7\u30EB\u80CC\u666F",
1843
+ pink: "\u30D4\u30F3\u30AF\u80CC\u666F",
1844
+ red: "\u30EC\u30C3\u30C9\u80CC\u666F"
1845
+ },
1846
+ // 注釈
1847
+ annotation: {
1848
+ title: "\u6CE8\u91C8",
1849
+ list: "\u6CE8\u91C8\u30EA\u30B9\u30C8",
1850
+ add: "\u6CE8\u91C8\u3092\u8FFD\u52A0",
1851
+ content: "\u6CE8\u91C8\u5185\u5BB9",
1852
+ required: "\u6CE8\u91C8\u5185\u5BB9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
1853
+ maxLength: "\u6CE8\u91C8\u5185\u5BB9\u306F500\u6587\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
1854
+ placeholder: "\u6CE8\u91C8\u5185\u5BB9\u3092\u5165\u529B...",
1855
+ edit: "\u6CE8\u91C8\u3092\u7DE8\u96C6",
1856
+ delete: "\u6CE8\u91C8\u3092\u524A\u9664",
1857
+ confirmDelete: "\u3053\u306E\u6CE8\u91C8\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F",
1858
+ empty: "\u6CE8\u91C8\u306F\u3042\u308A\u307E\u305B\u3093"
1859
+ },
1860
+ // 抜粋
1861
+ collection: {
1862
+ title: "\u629C\u7C8B",
1863
+ list: "\u629C\u7C8B\u30EA\u30B9\u30C8",
1864
+ delete: "\u629C\u7C8B\u3092\u524A\u9664",
1865
+ confirmDelete: "\u3053\u306E\u629C\u7C8B\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F",
1866
+ empty: "\u629C\u7C8B\u306F\u3042\u308A\u307E\u305B\u3093"
1867
+ },
1868
+ // ファイル / 画像アップロード
1869
+ upload: {
1870
+ noFile: "\u30D5\u30A1\u30A4\u30EB\u304C\u63D0\u4F9B\u3055\u308C\u3066\u3044\u307E\u305B\u3093",
1871
+ canceled: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306F\u30AD\u30E3\u30F3\u30BB\u30EB\u3055\u308C\u307E\u3057\u305F",
1872
+ fileSizeExceeded: "\u30D5\u30A1\u30A4\u30EB\u30B5\u30A4\u30BA\u304C\u6700\u5927\u5236\u9650\u3092\u8D85\u3048\u3066\u3044\u307E\u3059 ({{max}}MB)",
1873
+ undefined: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u6A5F\u80FD\u304C\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u305B\u3093",
1874
+ failedNoUrl: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u5931\u6557\uFF1AURL\u304C\u8FD4\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F",
1875
+ failed: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
1876
+ noFileToUpload: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3059\u308B\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093",
1877
+ maxFileCount: "\u6700\u5927{{limit}}\u4EF6\u307E\u3067\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3067\u304D\u307E\u3059"
1878
+ }
1879
+ }
1880
+ };
1881
+ var antdLocaleMap = {
1882
+ "zh-CN": zhCN__default.default,
1883
+ "en-US": enUS__default.default,
1884
+ "ja-JP": jaJP__default.default
1885
+ };
1886
+ var dayjsLocaleMap = {
1887
+ "zh-CN": "zh-cn",
1888
+ "en-US": "en",
1889
+ "ja-JP": "ja"
1890
+ };
1891
+ var LocaleProvider = ({ children, ...rest }) => {
1892
+ const lang = getLang();
1893
+ dayjs__default.default.locale(dayjsLocaleMap[lang]);
1894
+ return /* @__PURE__ */ jsxRuntime.jsx(antd.ConfigProvider, { locale: antdLocaleMap[lang], ...rest, children });
1895
+ };
1896
+
1897
+ // src/i18n/index.ts
1898
+ var DEFAULT_LNG = "zh-CN";
1899
+ var LANG_KEY = "ns-lang";
1900
+ var langManager = createTokenManager({ key: LANG_KEY });
1901
+ function getLang() {
1902
+ return langManager.get() || DEFAULT_LNG;
1903
+ }
1904
+ var i18n = i18next.createInstance({
1905
+ lng: DEFAULT_LNG,
1906
+ fallbackLng: DEFAULT_LNG,
1907
+ defaultNS: NS_COMMON,
1908
+ interpolation: { escapeValue: false },
1909
+ resources: { [DEFAULT_LNG]: { [NS_COMMON]: commonZhCN } }
1910
+ }).use(reactI18next.initReactI18next);
1911
+ void i18n.init();
1912
+ function addBundledResource(lng, ns, res) {
1913
+ if (lng === DEFAULT_LNG && ns === NS_COMMON) return;
1914
+ i18n.addResourceBundle(lng, ns, res, true, true);
1915
+ }
1916
+ function initI18n(options = {}) {
1917
+ const { lng = getLang(), resources } = options;
1918
+ for (const [l, namespaces] of Object.entries(resources ?? {})) {
1919
+ for (const [ns, messages] of Object.entries(namespaces)) {
1920
+ i18n.addResourceBundle(l, ns, messages, true, true);
1921
+ }
1922
+ }
1923
+ switchLang(lng);
1924
+ return i18n;
1925
+ }
1926
+ function switchLang(lng, reload = false) {
1927
+ langManager.set(lng);
1928
+ if (reload) {
1929
+ window?.top?.location.reload();
1930
+ } else {
1931
+ i18n.changeLanguage(lng);
1932
+ }
1933
+ }
1934
+ function useTranslation(namespace) {
1935
+ return reactI18next.useTranslation(namespace, { useSuspense: false });
1936
+ }
1937
+ function getI18n() {
1938
+ return i18n;
1939
+ }
1940
+ function t(key, options) {
1941
+ return i18n.t(key, options);
1942
+ }
1943
+
1944
+ // src/components/File/styles.module.less
1945
+ var styles_module_default = {
1946
+ nsPreviewImage: "styles_module_nsPreviewImage",
1947
+ nsPreviewPdf: "styles_module_nsPreviewPdf",
1948
+ pdfToolbar: "styles_module_pdfToolbar",
1949
+ nsPreviewPdfImage: "styles_module_nsPreviewPdfImage",
1950
+ pdfImageNav: "styles_module_pdfImageNav",
1951
+ pdfImageNavItem: "styles_module_pdfImageNavItem",
1952
+ pdfImageNavItemImgWrapper: "styles_module_pdfImageNavItemImgWrapper",
1953
+ pdfImageNavItemActive: "styles_module_pdfImageNavItemActive",
1954
+ pdfImageNavItemImg: "styles_module_pdfImageNavItemImg",
1955
+ pdfImageNavItemTip: "styles_module_pdfImageNavItemTip",
1956
+ pdfImageBody: "styles_module_pdfImageBody",
1957
+ pdfImageBodyToolbar: "styles_module_pdfImageBodyToolbar",
1958
+ pdfImageBodyItem: "styles_module_pdfImageBodyItem",
1959
+ pdfImageBodyItemInnerWrapper: "styles_module_pdfImageBodyItemInnerWrapper",
1960
+ pdfImageBodyItemInner: "styles_module_pdfImageBodyItemInner",
1961
+ pdfImageBodyItemActive: "styles_module_pdfImageBodyItemActive",
1962
+ pdfImageBodyItemImg: "styles_module_pdfImageBodyItemImg",
1963
+ nsPreviewVideo: "styles_module_nsPreviewVideo",
1964
+ nsPreviewAudio: "styles_module_nsPreviewAudio",
1965
+ nsPreviewDocx: "styles_module_nsPreviewDocx",
1966
+ docxToolbar: "styles_module_docxToolbar",
1967
+ docxContent: "styles_module_docxContent",
1968
+ stateBody: "styles_module_stateBody",
1969
+ pdfContainer: "styles_module_pdfContainer",
1970
+ floatingToolbar: "styles_module_floatingToolbar",
1971
+ divider: "styles_module_divider",
1972
+ pdfBody: "styles_module_pdfBody",
1973
+ pdfDocument: "styles_module_pdfDocument",
1974
+ pdfPage: "styles_module_pdfPage"
1975
+ };
1976
+ var AudioPlayer_default = ({ fileUrl }) => {
1977
+ const { t: t2 } = useTranslation(NS_COMMON);
1978
+ return /* @__PURE__ */ jsxRuntime.jsxs("audio", { controls: true, className: styles_module_default.nsPreviewAudio, children: [
1979
+ /* @__PURE__ */ jsxRuntime.jsx("source", { src: fileUrl, type: "audio/mpeg" }),
1980
+ t2("filePreview.audioNotSupported")
1981
+ ] }, fileUrl);
1982
+ };
1303
1983
  var DocxPreview_default = ({ fileUrl, scale = 1 }) => {
1984
+ const { t: t2 } = useTranslation(NS_COMMON);
1304
1985
  const containerRef = React3.useRef(null);
1305
1986
  const [zoomRatio, setZoomRatio] = React3.useState(scale);
1306
1987
  React3.useEffect(() => {
@@ -1323,7 +2004,7 @@ var DocxPreview_default = ({ fileUrl, scale = 1 }) => {
1323
2004
  });
1324
2005
  }).catch((err) => {
1325
2006
  console.error("docx-preview \u6E32\u67D3\u5931\u8D25:", err);
1326
- if (containerRef.current) containerRef.current.innerHTML = '<p class="text-center">\u6587\u6863\u52A0\u8F7D\u5931\u8D25</p>';
2007
+ if (containerRef.current) containerRef.current.innerHTML = `<p class="text-center">${t2("filePreview.docLoadFailed")}</p>`;
1327
2008
  });
1328
2009
  }, [fileUrl]);
1329
2010
  const zoomIn = () => setZoomRatio((z) => Math.min(z + 0.1, 3));
@@ -1333,9 +2014,9 @@ var DocxPreview_default = ({ fileUrl, scale = 1 }) => {
1333
2014
  };
1334
2015
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames2__default.default(styles_module_default.nsPreviewDocx, "height-full", "width-full"), children: [
1335
2016
  /* @__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: "\u7F29\u5C0F" }),
1337
- /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomIn, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusCircleOutlined, {}), title: "\u653E\u5927" }),
1338
- /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: resetZoom, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.RedoOutlined, {}), title: "\u8FD8\u539F" })
2017
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomOut, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.MinusCircleOutlined, {}), title: t2("filePreview.zoomOut") }),
2018
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomIn, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusCircleOutlined, {}), title: t2("filePreview.zoomIn") }),
2019
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: resetZoom, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.RedoOutlined, {}), title: t2("filePreview.zoomReset") })
1339
2020
  ] }),
1340
2021
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames2__default.default(styles_module_default.docxContent, "height-full", "scroll-fade-in"), children: /* @__PURE__ */ jsxRuntime.jsx(
1341
2022
  "div",
@@ -1413,9 +2094,10 @@ var FileIcon_default = ({ suffix, fontSize = 22 }) => {
1413
2094
  return /* @__PURE__ */ jsxRuntime.jsx("span", { style: styles, children: Icon });
1414
2095
  };
1415
2096
  var VideoPlayer_default = ({ fileUrl }) => {
2097
+ const { t: t2 } = useTranslation(NS_COMMON);
1416
2098
  return /* @__PURE__ */ jsxRuntime.jsxs("video", { controls: true, className: styles_module_default.nsPreviewVideo, children: [
1417
2099
  /* @__PURE__ */ jsxRuntime.jsx("source", { src: fileUrl, type: "video/mp4" }),
1418
- "\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 video \u6807\u7B7E\u3002"
2100
+ t2("filePreview.videoNotSupported")
1419
2101
  ] }, fileUrl);
1420
2102
  };
1421
2103
 
@@ -1428,6 +2110,7 @@ var baseComponentMap = {
1428
2110
  };
1429
2111
  var lazyCache = /* @__PURE__ */ new Map();
1430
2112
  var LazyComponent_default = ({ type, customComponents, unknownContent, ...rest }) => {
2113
+ const { t: t2 } = useTranslation(NS_COMMON);
1431
2114
  const loader2 = customComponents?.[type] || baseComponentMap[type];
1432
2115
  const LazyComponent = React3.useMemo(() => {
1433
2116
  if (!loader2) return null;
@@ -1437,11 +2120,11 @@ var LazyComponent_default = ({ type, customComponents, unknownContent, ...rest }
1437
2120
  lazyCache.set(type, component);
1438
2121
  return component;
1439
2122
  }, [loader2]);
1440
- if (!LazyComponent) return unknownContent || /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { title: `\u672A\u77E5\u7C7B\u578B\uFF1A${type}`, type: "warning" });
2123
+ if (!LazyComponent) return unknownContent || /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { title: t2("lazyComponent.unknownType", { type }), type: "warning" });
1441
2124
  return /* @__PURE__ */ jsxRuntime.jsx(
1442
2125
  React3.Suspense,
1443
2126
  {
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: "\u7EC4\u4EF6\u52A0\u8F7D\u4E2D..." }) }),
2127
+ 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
2128
  children: /* @__PURE__ */ jsxRuntime.jsx(LazyComponent, { ...rest })
1446
2129
  }
1447
2130
  );
@@ -1553,12 +2236,13 @@ var RenderMarkdown_default = ({ content = "", searchValue, customComponents, ...
1553
2236
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ns-markdown", children: reactContent });
1554
2237
  };
1555
2238
  var MarkdownPreview_default = ({ fileUrl, searchValue, asPlainText }) => {
2239
+ const { t: t2 } = useTranslation(NS_COMMON);
1556
2240
  const [content, setContent] = React3.useState("");
1557
2241
  const [error, setError] = React3.useState("");
1558
2242
  const fetchMarkdown = async () => {
1559
2243
  const res = await fetch(fileUrl);
1560
2244
  if (res.status !== 200) {
1561
- throw new Error(`\u8BF7\u6C42\u5931\u8D25\uFF0C\u72B6\u6001\u7801: ${res.status}`);
2245
+ throw new Error(t2("filePreview.requestFailedWithStatus", { status: res.status }));
1562
2246
  }
1563
2247
  const buffer = await res.arrayBuffer();
1564
2248
  let markdownText = "";
@@ -1570,7 +2254,7 @@ var MarkdownPreview_default = ({ fileUrl, searchValue, asPlainText }) => {
1570
2254
  markdownText = gbkDecoder.decode(buffer);
1571
2255
  }
1572
2256
  if (!markdownText) {
1573
- throw new Error("\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A");
2257
+ throw new Error(t2("filePreview.emptyResponse"));
1574
2258
  }
1575
2259
  return markdownText;
1576
2260
  };
@@ -1582,10 +2266,10 @@ var MarkdownPreview_default = ({ fileUrl, searchValue, asPlainText }) => {
1582
2266
  const content2 = await fetchMarkdown();
1583
2267
  setContent(content2);
1584
2268
  } catch {
1585
- setError("\u52A0\u8F7D\u6216\u89E3\u6790\u6587\u4EF6\u5931\u8D25");
2269
+ setError(t2("filePreview.fileParseFailed"));
1586
2270
  }
1587
2271
  } else {
1588
- setError("\u6587\u4EF6\u5730\u5740\u9519\u8BEF");
2272
+ setError(t2("filePreview.fileUrlInvalid"));
1589
2273
  }
1590
2274
  };
1591
2275
  React3.useEffect(() => {
@@ -2255,17 +2939,18 @@ var THUMB_IMG_HEIGHT = 514;
2255
2939
  var MAIN_IMG_HEIGHT = 800;
2256
2940
  var MAIN_IMG_WIDTH = 600;
2257
2941
  var PdfImagePreview_default = ({ fileUrl, pageNo, scale = 1, isHasThumbnails = true, onSetPageNo }) => {
2942
+ const { t: t2 } = useTranslation(NS_COMMON);
2258
2943
  const [images, setImages] = React3.useState([]);
2259
2944
  const [currentIndex, setCurrentIndex, getCurrentIndex] = useRefState_default(0);
2260
2945
  const [error, setError] = React3.useState("");
2261
2946
  const fetchPdfImages = async () => {
2262
2947
  const res = await fetch(fileUrl);
2263
2948
  if (res.status !== 200) {
2264
- throw new Error(`\u8BF7\u6C42\u5931\u8D25\uFF0C\u72B6\u6001\u7801: ${res.status}`);
2949
+ throw new Error(t2("filePreview.requestFailedWithStatus", { status: res.status }));
2265
2950
  }
2266
2951
  const { data } = await res.json();
2267
2952
  if (!data?.items?.length) {
2268
- throw new Error("\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A");
2953
+ throw new Error(t2("filePreview.emptyResponse"));
2269
2954
  }
2270
2955
  setImages(data.items);
2271
2956
  };
@@ -2277,10 +2962,10 @@ var PdfImagePreview_default = ({ fileUrl, pageNo, scale = 1, isHasThumbnails = t
2277
2962
  try {
2278
2963
  await fetchPdfImages();
2279
2964
  } catch (error2) {
2280
- setError("\u52A0\u8F7D\u6216\u89E3\u6790 pdf \u5931\u8D25");
2965
+ setError(t2("filePreview.pdfParseFailed"));
2281
2966
  }
2282
2967
  } else {
2283
- setError("pdf\u5730\u5740\u9519\u8BEF");
2968
+ setError(t2("filePreview.pdfUrlInvalid"));
2284
2969
  }
2285
2970
  };
2286
2971
  React3.useEffect(() => {
@@ -2420,9 +3105,9 @@ var PdfImagePreview_default = ({ fileUrl, pageNo, scale = 1, isHasThumbnails = t
2420
3105
  ) }) }),
2421
3106
  /* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames2__default.default("height-full", styles_module_default.pdfImageBody), children: [
2422
3107
  /* @__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: "\u7F29\u5C0F" }),
2424
- /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomIn, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusCircleOutlined, {}), title: "\u653E\u5927" }),
2425
- /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomFitWidth, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ColumnWidthOutlined, {}), title: "\u9002\u5E94\u5BBD\u5EA6" })
3108
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomOut, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.MinusCircleOutlined, {}), title: t2("filePreview.zoomOut") }),
3109
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomIn, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusCircleOutlined, {}), title: t2("filePreview.zoomIn") }),
3110
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomFitWidth, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ColumnWidthOutlined, {}), title: t2("filePreview.fitWidth") })
2426
3111
  ] }),
2427
3112
  /* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef, className: "height-full scroll-fade-in", children: /* @__PURE__ */ jsxRuntime.jsx(
2428
3113
  "div",
@@ -2470,6 +3155,7 @@ var ProtectedView = ({
2470
3155
  verifyPassword,
2471
3156
  onVerifyPasswordEnd
2472
3157
  }) => {
3158
+ const { t: t2 } = useTranslation(NS_COMMON);
2473
3159
  const [form] = antd.Form.useForm();
2474
3160
  const onSubmit = () => {
2475
3161
  form.validateFields().then((values) => {
@@ -2480,10 +3166,10 @@ var ProtectedView = ({
2480
3166
  });
2481
3167
  };
2482
3168
  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: "\u5BC6\u7801\u65E0\u6548\u3002\u8BF7\u518D\u8BD5\u4E00\u6B21\uFF01", type: "error" }),
3169
+ passwordStatus === core$1.PasswordStatus.WrongPassword && /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { title: t2("filePreview.pdfPasswordInvalid"), type: "error" }),
2484
3170
  /* @__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: "\u8BF7\u8F93\u5165\u5BC6\u7801" }], children: /* @__PURE__ */ jsxRuntime.jsx(antd.Input.Password, { autoComplete: "new-password", placeholder: "\u8BF7\u8F93\u5165\u5BC6\u7801" }) }),
2486
- /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "primary", onClick: onSubmit, children: "\u63D0 \u4EA4" }) })
3171
+ /* @__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") }) }),
3172
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "primary", onClick: onSubmit, children: t2("filePreview.pdfSubmit") }) })
2487
3173
  ] })
2488
3174
  ] }) });
2489
3175
  };
@@ -2502,6 +3188,7 @@ var openLinksNewTabPlugin = () => {
2502
3188
  };
2503
3189
  };
2504
3190
  var PdfPreview_default = ({ password, fileUrl, pageNo = 1, scale = 1, isHasThumbnails = true, onSetPassword, onSetPageNo }) => {
3191
+ const { t: t2 } = useTranslation(NS_COMMON);
2505
3192
  const embedRef = React3.useRef(null);
2506
3193
  const [sizes, setSizes] = React3.useState([0]);
2507
3194
  const [docLoaded, setDocLoaded, getDocLoaded] = useRefState_default(false);
@@ -2575,19 +3262,19 @@ var PdfPreview_default = ({ password, fileUrl, pageNo = 1, scale = 1, isHasThumb
2575
3262
  let message3 = "";
2576
3263
  switch (error.name) {
2577
3264
  case "InvalidPDFException":
2578
- message3 = "\u6587\u4EF6\u65E0\u6548\u6216\u5DF2\u635F\u574F";
3265
+ message3 = t2("filePreview.pdfInvalidOrDamaged");
2579
3266
  break;
2580
3267
  case "MissingPDFException":
2581
- message3 = "\u6587\u4EF6\u4E0D\u5B58\u5728";
3268
+ message3 = t2("filePreview.pdfFileNotFound");
2582
3269
  break;
2583
3270
  case "UnexpectedResponseException":
2584
- message3 = "\u610F\u5916\u7684\u670D\u52A1\u5668\u54CD\u5E94";
3271
+ message3 = t2("filePreview.pdfUnexpectedResponse");
2585
3272
  break;
2586
3273
  // case 'CMapReaderFactory not initialized':
2587
3274
  // message = '字体映射文件加载失败,请刷新页面重试'
2588
3275
  // break
2589
3276
  default:
2590
- message3 = "\u65E0\u6CD5\u52A0\u8F7D\u6587\u6863";
3277
+ message3 = t2("filePreview.pdfLoadDocumentFailed");
2591
3278
  break;
2592
3279
  }
2593
3280
  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 +3345,7 @@ var PdfPreview_default = ({ password, fileUrl, pageNo = 1, scale = 1, isHasThumb
2658
3345
  ] }) }) });
2659
3346
  };
2660
3347
  var FilePreview_default = ({ suffix, fileUrl, pdfParams, password, searchValue, emptyProps, onSetPassword }) => {
3348
+ const { t: t2 } = useTranslation(NS_COMMON);
2661
3349
  const Preview = React3.useMemo(() => {
2662
3350
  if (!fileUrl) {
2663
3351
  return /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { ...emptyProps });
@@ -2667,7 +3355,7 @@ var FilePreview_default = ({ suffix, fileUrl, pdfParams, password, searchValue,
2667
3355
  case "JPG":
2668
3356
  case "JPEG":
2669
3357
  case "GIF":
2670
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Image, { classNames: { root: styles_module_default.nsPreviewImage }, src: fileUrl, alt: "\u9884\u89C8\u56FE\u7247" });
3358
+ return /* @__PURE__ */ jsxRuntime.jsx(antd.Image, { classNames: { root: styles_module_default.nsPreviewImage }, src: fileUrl, alt: t2("filePreview.previewImageAlt") });
2671
3359
  case "PDF":
2672
3360
  return /* @__PURE__ */ jsxRuntime.jsx(PdfPreview_default, { fileUrl, ...pdfParams, password, onSetPassword });
2673
3361
  case "PDF_IMG":
@@ -2687,11 +3375,25 @@ var FilePreview_default = ({ suffix, fileUrl, pdfParams, password, searchValue,
2687
3375
  case "DOCX":
2688
3376
  return /* @__PURE__ */ jsxRuntime.jsx(DocxPreview_default, { fileUrl });
2689
3377
  default:
2690
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Result, { subTitle: `\u6682\u4E0D\u652F\u6301 ${suffix || ""} \u6587\u4EF6\u7684\u9884\u89C8` });
3378
+ return /* @__PURE__ */ jsxRuntime.jsx(antd.Result, { subTitle: t2("filePreview.previewNotSupported", { suffix: suffix || "" }) });
2691
3379
  }
2692
3380
  }, [suffix, fileUrl, pdfParams]);
2693
3381
  return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "center", align: "center", className: "height-full", children: Preview });
2694
3382
  };
3383
+ var FilePreviewDrawer_default = ({ open, title, onClose, ...props }) => {
3384
+ const { t: t2 } = useTranslation(NS_COMMON);
3385
+ return /* @__PURE__ */ jsxRuntime.jsx(
3386
+ antd.Drawer,
3387
+ {
3388
+ title: title || t2("filePreview.title"),
3389
+ push: false,
3390
+ size: "100%",
3391
+ open,
3392
+ onClose,
3393
+ children: /* @__PURE__ */ jsxRuntime.jsx(FilePreview_default, { ...props })
3394
+ }
3395
+ );
3396
+ };
2695
3397
  Editor.loader.config({ monaco: monaco__namespace });
2696
3398
  var getLanguage = (suffix) => {
2697
3399
  switch (suffix.toLowerCase()) {
@@ -2731,6 +3433,7 @@ var getLanguage = (suffix) => {
2731
3433
  }
2732
3434
  };
2733
3435
  var CodePreview = ({ fileUrl, suffix }) => {
3436
+ const { t: t2 } = useTranslation(NS_COMMON);
2734
3437
  const [content, setContent] = React3.useState("");
2735
3438
  const [error, setError] = React3.useState("");
2736
3439
  const [loading, setLoading] = React3.useState(false);
@@ -2740,7 +3443,7 @@ var CodePreview = ({ fileUrl, suffix }) => {
2740
3443
  };
2741
3444
  const res = await fetch(fileUrl, { headers, signal });
2742
3445
  if (res.status !== 200) {
2743
- throw new Error(`\u8BF7\u6C42\u5931\u8D25\uFF0C\u72B6\u6001\u7801: ${res.status}`);
3446
+ throw new Error(t2("filePreview.requestFailedWithStatus", { status: res.status }));
2744
3447
  }
2745
3448
  const buffer = await res.arrayBuffer();
2746
3449
  let text = "";
@@ -2764,7 +3467,7 @@ var CodePreview = ({ fileUrl, suffix }) => {
2764
3467
  await fetchContent(controller.signal);
2765
3468
  } catch (error2) {
2766
3469
  if (!controller.signal.aborted) {
2767
- setError("\u52A0\u8F7D\u6587\u4EF6\u5931\u8D25");
3470
+ setError(t2("filePreview.loadFileFailed"));
2768
3471
  }
2769
3472
  } finally {
2770
3473
  if (!controller.signal.aborted) {
@@ -2804,7 +3507,7 @@ var CodePreview = ({ fileUrl, suffix }) => {
2804
3507
  var CodePreview_default = CodePreview;
2805
3508
  var { Text } = antd.Typography;
2806
3509
  pdfjsLib__namespace.GlobalWorkerOptions.workerSrc = "https://unpkg.com/pdfjs-dist@5.4.296/legacy/build/pdf.worker.min.mjs";
2807
- var MIN_SCALE = 0.1;
3510
+ var MIN_SCALE = 0.6;
2808
3511
  var MAX_SCALE = 1.5;
2809
3512
  var SCALE_STEP = 0.1;
2810
3513
  var PdfPage = React3__namespace.default.memo(({ pdf, pageNumber, scale, scrollContainerRef, defaultSize }) => {
@@ -2914,6 +3617,7 @@ var PdfPage = React3__namespace.default.memo(({ pdf, pageNumber, scale, scrollCo
2914
3617
  );
2915
3618
  });
2916
3619
  var DocumentPreview = ({ fileUrl, previewEnabled = true }) => {
3620
+ const { t: t2 } = useTranslation(NS_COMMON);
2917
3621
  const [loading, setLoading] = React3.useState(false);
2918
3622
  const [pdf, setPdf] = React3.useState(null);
2919
3623
  const [numPages, setNumPages] = React3.useState(0);
@@ -2973,9 +3677,9 @@ var DocumentPreview = ({ fileUrl, previewEnabled = true }) => {
2973
3677
  if (aborted) return;
2974
3678
  const message3 = e?.message;
2975
3679
  if (typeof message3 === "string" && message3.includes("cancelled")) ; else if (typeof message3 === "string" && message3.includes("(903)")) {
2976
- setError("\u9884\u89C8\u6587\u4EF6\u6B63\u5728\u751F\u6210\u4E2D...");
3680
+ setError(t2("filePreview.previewGenerating"));
2977
3681
  } else {
2978
- setError(message3 || "PDF \u52A0\u8F7D\u5931\u8D25");
3682
+ setError(message3 || t2("filePreview.pdfLoadFailed"));
2979
3683
  }
2980
3684
  } finally {
2981
3685
  if (!aborted) {
@@ -3080,7 +3784,7 @@ var DocumentPreview = ({ fileUrl, previewEnabled = true }) => {
3080
3784
  /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusOutlined, {}), size: "small", onClick: onZoomIn, disabled: scale >= MAX_SCALE })
3081
3785
  ] });
3082
3786
  if (!previewEnabled) {
3083
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { className: styles_module_default.stateBody, children: "\u5173\u95ED\u9884\u89C8" });
3787
+ return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { className: styles_module_default.stateBody, children: t2("filePreview.closePreview") });
3084
3788
  }
3085
3789
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_module_default.pdfContainer, children: [
3086
3790
  toolbar,
@@ -3089,6 +3793,7 @@ var DocumentPreview = ({ fileUrl, previewEnabled = true }) => {
3089
3793
  };
3090
3794
  var DocumentPreview_default = DocumentPreview;
3091
3795
  var HtmlPreview = ({ fileUrl }) => {
3796
+ const { t: t2 } = useTranslation(NS_COMMON);
3092
3797
  const [content, setContent] = React3.useState("");
3093
3798
  const [error, setError] = React3.useState("");
3094
3799
  const [loading, setLoading] = React3.useState(false);
@@ -3101,7 +3806,7 @@ var HtmlPreview = ({ fileUrl }) => {
3101
3806
  signal
3102
3807
  });
3103
3808
  if (res.status !== 200) {
3104
- throw new Error(`\u8BF7\u6C42\u5931\u8D25\uFF0C\u72B6\u6001\u7801: ${res.status}`);
3809
+ throw new Error(t2("filePreview.requestFailedWithStatus", { status: res.status }));
3105
3810
  }
3106
3811
  const buffer = await res.arrayBuffer();
3107
3812
  let htmlText = "";
@@ -3113,7 +3818,7 @@ var HtmlPreview = ({ fileUrl }) => {
3113
3818
  htmlText = gbkDecoder.decode(buffer);
3114
3819
  }
3115
3820
  if (!htmlText) {
3116
- throw new Error("\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A");
3821
+ throw new Error(t2("filePreview.emptyResponse"));
3117
3822
  }
3118
3823
  setContent(htmlText);
3119
3824
  };
@@ -3128,7 +3833,7 @@ var HtmlPreview = ({ fileUrl }) => {
3128
3833
  await fetchHtml(controller.signal);
3129
3834
  } catch (error2) {
3130
3835
  if (!controller.signal.aborted) {
3131
- setError("\u52A0\u8F7D\u6216\u89E3\u6790 HTML \u5931\u8D25");
3836
+ setError(t2("filePreview.htmlParseFailed"));
3132
3837
  }
3133
3838
  } finally {
3134
3839
  if (!controller.signal.aborted) {
@@ -3154,6 +3859,7 @@ var HtmlPreview = ({ fileUrl }) => {
3154
3859
  };
3155
3860
  var HtmlPreview_default = HtmlPreview;
3156
3861
  var luyaFilePreview_default = ({ suffix, fileUrl, emptyProps, fileName }) => {
3862
+ const { t: t2 } = useTranslation(NS_COMMON);
3157
3863
  const extension = suffix ? suffix : getFileSuffixName(fileName || "");
3158
3864
  const Preview = React3.useMemo(() => {
3159
3865
  if (!fileUrl) {
@@ -3169,7 +3875,7 @@ var luyaFilePreview_default = ({ suffix, fileUrl, emptyProps, fileName }) => {
3169
3875
  case "SVG":
3170
3876
  case "ICO":
3171
3877
  case "TIFF":
3172
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Image, { classNames: { root: styles_module_default.nsPreviewImage }, src: fileUrl, alt: "\u9884\u89C8\u56FE\u7247" });
3878
+ return /* @__PURE__ */ jsxRuntime.jsx(antd.Image, { classNames: { root: styles_module_default.nsPreviewImage }, src: fileUrl, alt: t2("filePreview.previewImageAlt") });
3173
3879
  case "DOC":
3174
3880
  case "DOCX":
3175
3881
  case "PDF":
@@ -3214,30 +3920,18 @@ var luyaFilePreview_default = ({ suffix, fileUrl, emptyProps, fileName }) => {
3214
3920
  case "TXT":
3215
3921
  return /* @__PURE__ */ jsxRuntime.jsx(MarkdownPreview_default, { fileUrl, asPlainText: true });
3216
3922
  default:
3217
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Result, { subTitle: `${suffix || ""} \u6587\u4EF6\u6682\u4E0D\u652F\u6301\u5728\u7EBF\u9884\u89C8\uFF0C\u8BF7\u4E0B\u8F7D\u6253\u5F00` });
3923
+ return /* @__PURE__ */ jsxRuntime.jsx(antd.Result, { subTitle: t2("filePreview.previewNotSupportedDownload", { suffix: suffix || "" }) });
3218
3924
  }
3219
3925
  }, [suffix, fileUrl, fileName]);
3220
3926
  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
3927
  };
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
3928
 
3236
3929
  // src/components/MicroApp/styles.module.less
3237
3930
  var styles_module_default3 = {
3238
3931
  microApp: "styles_module_microApp"
3239
3932
  };
3240
3933
  var MicroApp_default = ({ name, url, className, onMounted, onError, data, ...rest }) => {
3934
+ const { t: t2 } = useTranslation(NS_COMMON);
3241
3935
  const [loading, setLoading] = React3.useState(false);
3242
3936
  React3.useEffect(() => {
3243
3937
  setLoading(true);
@@ -3252,10 +3946,10 @@ var MicroApp_default = ({ name, url, className, onMounted, onError, data, ...res
3252
3946
  };
3253
3947
  const microAppData = React3.useMemo(() => {
3254
3948
  const parentMainSource = window?.microApp?.getData?.()?.mainSource || [];
3255
- return { mainSource: [...parentMainSource, name], ...data };
3949
+ return { [LANG_KEY]: getLang(), mainSource: [...parentMainSource, name], ...data };
3256
3950
  }, [data, name]);
3257
3951
  const TagName = microApp__default.default.tagName || "micro-app";
3258
- return /* @__PURE__ */ jsxCustomEvent__default.default(antd.Spin, { spinning: loading, classNames: { root: "full-spin" }, description: "\u52A0\u8F7D\u4E2D..." }, /* @__PURE__ */ jsxCustomEvent__default.default(
3952
+ return /* @__PURE__ */ jsxCustomEvent__default.default(antd.Spin, { spinning: loading, classNames: { root: "full-spin" }, description: t2("microApp.loading") }, /* @__PURE__ */ jsxCustomEvent__default.default(
3259
3953
  TagName,
3260
3954
  {
3261
3955
  name,
@@ -3344,10 +4038,12 @@ var styles_module_default4 = {
3344
4038
  iframe: "styles_module_iframe"
3345
4039
  };
3346
4040
  var Iframe_default = React3.forwardRef(({ defaultMainSource, id, src, className, onLoad }, ref) => {
4041
+ const { t: t2 } = useTranslation(NS_COMMON);
3347
4042
  const [loading, setLoading] = React3.useState(false);
3348
4043
  const finalSrc = React3.useMemo(() => {
3349
- return buildUrlParams({ v: Date.now() }, addUrlLastSlash(setUrlMainSource(src, location.href, defaultMainSource)));
3350
- }, [src]);
4044
+ const baseUrl = addUrlLastSlash(setUrlMainSource(src, location.href, defaultMainSource));
4045
+ return buildUrlParams({ v: Date.now(), [LANG_KEY]: getLang() }, baseUrl);
4046
+ }, [src, defaultMainSource]);
3351
4047
  const onHandleLoad = () => {
3352
4048
  setLoading(false);
3353
4049
  onLoad?.();
@@ -3355,7 +4051,7 @@ var Iframe_default = React3.forwardRef(({ defaultMainSource, id, src, className,
3355
4051
  React3.useEffect(() => {
3356
4052
  setLoading(true);
3357
4053
  }, [src]);
3358
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: loading, classNames: { root: "full-spin" }, description: "\u52A0\u8F7D\u4E2D...", children: /* @__PURE__ */ jsxRuntime.jsx(
4054
+ 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
4055
  "iframe",
3360
4056
  {
3361
4057
  id,
@@ -4035,24 +4731,37 @@ function useIsBreakpoint(mode = "max", breakpoint = 768) {
4035
4731
  }
4036
4732
  var { TextArea } = antd.Input;
4037
4733
  var AnnotationModal_default = ({ visible, onCancel, onConfirm }) => {
4734
+ const { t: t2 } = useTranslation(NS_COMMON);
4038
4735
  const [form] = antd.Form.useForm();
4039
4736
  const handleOk = async () => {
4040
4737
  const values = await form.validateFields();
4041
4738
  onConfirm(values.content.trim());
4042
4739
  onCancel();
4043
4740
  };
4044
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Modal, { title: "\u6DFB\u52A0\u6279\u6CE8", open: visible, onOk: handleOk, onCancel, destroyOnHidden: true, okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Form, { form, layout: "vertical", children: /* @__PURE__ */ jsxRuntime.jsx(
4045
- antd.Form.Item,
4741
+ return /* @__PURE__ */ jsxRuntime.jsx(
4742
+ antd.Modal,
4046
4743
  {
4047
- name: "content",
4048
- label: "\u6279\u6CE8\u5185\u5BB9",
4049
- rules: [
4050
- { whitespace: true, required: true, message: "\u8BF7\u8F93\u5165\u6279\u6CE8\u5185\u5BB9" },
4051
- { max: 500, message: "\u6279\u6CE8\u5185\u5BB9\u4E0D\u80FD\u8D85\u8FC7500\u4E2A\u5B57\u7B26" }
4052
- ],
4053
- children: /* @__PURE__ */ jsxRuntime.jsx(TextArea, { rows: 4, placeholder: "\u8BF7\u8F93\u5165\u60A8\u7684\u6279\u6CE8\u5185\u5BB9...", showCount: true, maxLength: 500 })
4744
+ title: t2("markdownEditor.annotation.add"),
4745
+ open: visible,
4746
+ onOk: handleOk,
4747
+ onCancel,
4748
+ destroyOnHidden: true,
4749
+ okText: t2("common.confirm"),
4750
+ cancelText: t2("common.cancel"),
4751
+ children: /* @__PURE__ */ jsxRuntime.jsx(antd.Form, { form, layout: "vertical", children: /* @__PURE__ */ jsxRuntime.jsx(
4752
+ antd.Form.Item,
4753
+ {
4754
+ name: "content",
4755
+ label: t2("markdownEditor.annotation.content"),
4756
+ rules: [
4757
+ { whitespace: true, required: true, message: t2("markdownEditor.annotation.required") },
4758
+ { max: 500, message: t2("markdownEditor.annotation.maxLength") }
4759
+ ],
4760
+ children: /* @__PURE__ */ jsxRuntime.jsx(TextArea, { rows: 4, placeholder: t2("markdownEditor.annotation.placeholder"), showCount: true, maxLength: 500 })
4761
+ }
4762
+ ) })
4054
4763
  }
4055
- ) }) });
4764
+ );
4056
4765
  };
4057
4766
 
4058
4767
  // src/components/MarkdownEditor/annotation/constant.ts
@@ -4077,6 +4786,7 @@ var AnnotationSidebar_default = ({
4077
4786
  annotationConfig,
4078
4787
  onClose
4079
4788
  }) => {
4789
+ const { t: t2 } = useTranslation(NS_COMMON);
4080
4790
  const [form] = antd.Form.useForm();
4081
4791
  const [editingId, setEditingId] = React3.useState();
4082
4792
  const itemRefs = React3.useRef({});
@@ -4113,7 +4823,7 @@ var AnnotationSidebar_default = ({
4113
4823
  /* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
4114
4824
  /* @__PURE__ */ jsxRuntime.jsx(icons.MessageOutlined, {}),
4115
4825
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
4116
- "\u6279\u6CE8",
4826
+ t2("markdownEditor.annotation.title"),
4117
4827
  annotations.length > 0 && `\uFF08${annotations.length}\uFF09`
4118
4828
  ] })
4119
4829
  ] }),
@@ -4148,15 +4858,15 @@ var AnnotationSidebar_default = ({
4148
4858
  {
4149
4859
  name: "content",
4150
4860
  rules: [
4151
- { whitespace: true, required: true, message: "\u8BF7\u8F93\u5165\u6279\u6CE8\u5185\u5BB9" },
4152
- { max: 500, message: "\u6279\u6CE8\u5185\u5BB9\u4E0D\u80FD\u8D85\u8FC7500\u4E2A\u5B57\u7B26" }
4861
+ { whitespace: true, required: true, message: t2("markdownEditor.annotation.required") },
4862
+ { max: 500, message: t2("markdownEditor.annotation.maxLength") }
4153
4863
  ],
4154
- children: /* @__PURE__ */ jsxRuntime.jsx(TextArea2, { autoFocus: true, rows: 2, placeholder: "\u8BF7\u8F93\u5165\u60A8\u7684\u6279\u6CE8\u5185\u5BB9...", showCount: true, maxLength: 500 })
4864
+ children: /* @__PURE__ */ jsxRuntime.jsx(TextArea2, { autoFocus: true, rows: 2, placeholder: t2("markdownEditor.annotation.placeholder"), showCount: true, maxLength: 500 })
4155
4865
  }
4156
4866
  ) }),
4157
4867
  /* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
4158
- /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", type: "primary", onClick: handleSaveEdit, children: "\u4FDD\u5B58" }),
4159
- /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", onClick: handleCancelEdit, children: "\u53D6\u6D88" })
4868
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", type: "primary", onClick: handleSaveEdit, children: t2("common.save") }),
4869
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", onClick: handleCancelEdit, children: t2("common.cancel") })
4160
4870
  ] })
4161
4871
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, vertical: true, children: [
4162
4872
  /* @__PURE__ */ jsxRuntime.jsx(Text2, { children: annotation.content }),
@@ -4166,7 +4876,7 @@ var AnnotationSidebar_default = ({
4166
4876
  {
4167
4877
  type: "text",
4168
4878
  size: "small",
4169
- title: "\u7F16\u8F91\u6279\u6CE8",
4879
+ title: t2("markdownEditor.annotation.edit"),
4170
4880
  icon: /* @__PURE__ */ jsxRuntime.jsx(icons.EditOutlined, {}),
4171
4881
  onClick: (e) => {
4172
4882
  handleEdit(annotation);
@@ -4176,12 +4886,12 @@ var AnnotationSidebar_default = ({
4176
4886
  /* @__PURE__ */ jsxRuntime.jsx(
4177
4887
  antd.Popconfirm,
4178
4888
  {
4179
- title: "\u63D0\u793A",
4180
- okText: "\u786E\u5B9A",
4181
- cancelText: "\u53D6\u6D88",
4182
- description: "\u786E\u8BA4\u5220\u9664\u5F53\u524D\u6279\u6CE8\u5417?",
4889
+ title: t2("common.defaultTitle"),
4890
+ okText: t2("common.confirm"),
4891
+ cancelText: t2("common.cancel"),
4892
+ description: t2("markdownEditor.annotation.confirmDelete"),
4183
4893
  onConfirm: () => onDeleteAnnotation(annotation[ANNOTATION_ATTRS[0]]),
4184
- children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", size: "small", title: "\u5220\u9664\u6279\u6CE8", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DeleteOutlined, {}) })
4894
+ children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", size: "small", title: t2("markdownEditor.annotation.delete"), icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DeleteOutlined, {}) })
4185
4895
  }
4186
4896
  )
4187
4897
  ] })
@@ -4190,7 +4900,7 @@ var AnnotationSidebar_default = ({
4190
4900
  }
4191
4901
  )
4192
4902
  }
4193
- ) : /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, justify: "center", align: "center", className: "height-full", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: "\u6682\u65E0\u6279\u6CE8" }) })
4903
+ ) : /* @__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
4904
  }
4195
4905
  );
4196
4906
  const container = annotationConfig?.getContainer?.();
@@ -4475,7 +5185,7 @@ var useAnnotations = (annotationConfig) => {
4475
5185
  const id = genNonDuplicateID();
4476
5186
  editor.current.chain().focus().setMark(ANNOTATION_KEY, {
4477
5187
  "annotation-id": id,
4478
- "user-name": annotationConfig?.user?.name || "\u672A\u77E5",
5188
+ "user-name": annotationConfig?.user?.name || t("markdownEditor.unknown"),
4479
5189
  "user-id": annotationConfig?.user.id || "0000",
4480
5190
  "update-time": getTimestamp(),
4481
5191
  content
@@ -4757,6 +5467,7 @@ var collectionSidebar_default = ({
4757
5467
  collectionConfig,
4758
5468
  onClose
4759
5469
  }) => {
5470
+ const { t: t2 } = useTranslation(NS_COMMON);
4760
5471
  const itemRefs = React3.useRef({});
4761
5472
  React3.useEffect(() => {
4762
5473
  if (selectedCollectionId) {
@@ -4778,7 +5489,7 @@ var collectionSidebar_default = ({
4778
5489
  /* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
4779
5490
  /* @__PURE__ */ jsxRuntime.jsx(icons.BookOutlined, {}),
4780
5491
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
4781
- "\u6458\u5F55",
5492
+ t2("markdownEditor.collection.title"),
4782
5493
  collections.length > 0 && `\uFF08${collections.length}\uFF09`
4783
5494
  ] })
4784
5495
  ] }),
@@ -4821,12 +5532,12 @@ var collectionSidebar_default = ({
4821
5532
  !disabled && selectedCollectionId === collection[COLLECTION_ATTRS[0]] && /* @__PURE__ */ jsxRuntime.jsx(antd.Space, { children: /* @__PURE__ */ jsxRuntime.jsx(
4822
5533
  antd.Popconfirm,
4823
5534
  {
4824
- title: "\u63D0\u793A",
4825
- okText: "\u786E\u5B9A",
4826
- cancelText: "\u53D6\u6D88",
4827
- description: "\u786E\u8BA4\u5220\u9664\u5F53\u524D\u6458\u5F55\u5417?",
5535
+ title: t2("common.defaultTitle"),
5536
+ okText: t2("common.confirm"),
5537
+ cancelText: t2("common.cancel"),
5538
+ description: t2("markdownEditor.collection.confirmDelete"),
4828
5539
  onConfirm: () => onDeleteCollection(collection[COLLECTION_ATTRS[0]]),
4829
- children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", size: "small", title: "\u5220\u9664\u6458\u5F55", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DeleteOutlined, {}) })
5540
+ children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", size: "small", title: t2("markdownEditor.collection.delete"), icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DeleteOutlined, {}) })
4830
5541
  }
4831
5542
  ) })
4832
5543
  ] })
@@ -4835,7 +5546,7 @@ var collectionSidebar_default = ({
4835
5546
  );
4836
5547
  }
4837
5548
  }
4838
- ) : /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, justify: "center", align: "center", className: "height-full", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: "\u6682\u65E0\u6458\u5F55" }) })
5549
+ ) : /* @__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
5550
  }
4840
5551
  );
4841
5552
  const container = collectionConfig?.getContainer?.();
@@ -4876,7 +5587,7 @@ var useCollections = (collectionConfig) => {
4876
5587
  }
4877
5588
  editor.current.chain().focus().setMark(COLLECTION_KEY, {
4878
5589
  "collection-id": remoteId,
4879
- "user-name": collectionConfig?.user?.name || "\u672A\u77E5",
5590
+ "user-name": collectionConfig?.user?.name || t("markdownEditor.unknown"),
4880
5591
  "user-id": collectionConfig?.user.id || "0000",
4881
5592
  "update-time": getTimestamp(),
4882
5593
  "page-no": pageIndex
@@ -5425,6 +6136,7 @@ var BlockquoteButton = React3.forwardRef(
5425
6136
  hideWhenUnavailable,
5426
6137
  onToggled
5427
6138
  });
6139
+ const { t: t2 } = useTranslation(NS_COMMON);
5428
6140
  const handleClick = React3.useCallback(
5429
6141
  (event) => {
5430
6142
  onClick?.(event);
@@ -5448,7 +6160,7 @@ var BlockquoteButton = React3.forwardRef(
5448
6160
  "data-disabled": !canToggle3,
5449
6161
  "aria-label": label,
5450
6162
  "aria-pressed": isActive,
5451
- tooltip: "\u5F15\u7528\u5757",
6163
+ tooltip: t2("markdownEditor.toolbar.blockquote"),
5452
6164
  onClick: handleClick,
5453
6165
  ...buttonProps,
5454
6166
  ref,
@@ -5616,7 +6328,7 @@ function useBlockquote(config) {
5616
6328
  isActive,
5617
6329
  handleToggle,
5618
6330
  canToggle: canToggle3,
5619
- label: "\u5F15\u7528\u5757",
6331
+ label: t("markdownEditor.toolbar.blockquote"),
5620
6332
  shortcutKeys: BLOCKQUOTE_SHORTCUT_KEY,
5621
6333
  Icon: BlockquoteIcon
5622
6334
  };
@@ -5651,6 +6363,7 @@ var CodeBlockButton = React3.forwardRef(
5651
6363
  hideWhenUnavailable,
5652
6364
  onToggled
5653
6365
  });
6366
+ const { t: t2 } = useTranslation(NS_COMMON);
5654
6367
  const handleClick = React3.useCallback(
5655
6368
  (event) => {
5656
6369
  onClick?.(event);
@@ -5674,7 +6387,7 @@ var CodeBlockButton = React3.forwardRef(
5674
6387
  tabIndex: -1,
5675
6388
  "aria-label": label,
5676
6389
  "aria-pressed": isActive,
5677
- tooltip: "\u4EE3\u7801\u5757",
6390
+ tooltip: t2("markdownEditor.toolbar.codeBlock"),
5678
6391
  onClick: handleClick,
5679
6392
  ...buttonProps,
5680
6393
  ref,
@@ -5833,7 +6546,7 @@ function useCodeBlock(config) {
5833
6546
  isActive,
5834
6547
  handleToggle,
5835
6548
  canToggle: canToggleState,
5836
- label: "\u4EE3\u7801\u5757",
6549
+ label: t("markdownEditor.toolbar.codeBlock"),
5837
6550
  shortcutKeys: CODE_BLOCK_SHORTCUT_KEY,
5838
6551
  Icon: CodeBlockIcon
5839
6552
  };
@@ -5994,6 +6707,7 @@ var ColorHighlightButton = React3.forwardRef(
5994
6707
  style,
5995
6708
  ...buttonProps
5996
6709
  }, ref) => {
6710
+ const { t: t2 } = useTranslation(NS_COMMON);
5997
6711
  const { editor } = useTiptapEditor(providedEditor);
5998
6712
  const {
5999
6713
  isVisible,
@@ -6005,7 +6719,7 @@ var ColorHighlightButton = React3.forwardRef(
6005
6719
  } = useColorHighlight({
6006
6720
  editor,
6007
6721
  highlightColor,
6008
- label: text || `\u5207\u6362\u9AD8\u4EAE\u663E\u793A (${highlightColor})`,
6722
+ label: text || t2("markdownEditor.highlight.toggle", { color: highlightColor }),
6009
6723
  hideWhenUnavailable,
6010
6724
  mode,
6011
6725
  onApplied
@@ -6064,52 +6778,52 @@ ColorHighlightButton.displayName = "ColorHighlightButton";
6064
6778
  var COLOR_HIGHLIGHT_SHORTCUT_KEY = "mod+shift+h";
6065
6779
  var HIGHLIGHT_COLORS = [
6066
6780
  {
6067
- label: "\u9ED8\u8BA4\u80CC\u666F",
6781
+ labelKey: "markdownEditor.highlight.default",
6068
6782
  value: "var(--tt-bg-color)",
6069
6783
  border: "var(--tt-bg-color-contrast)"
6070
6784
  },
6071
6785
  {
6072
- label: "\u7070\u8272\u80CC\u666F",
6786
+ labelKey: "markdownEditor.highlight.gray",
6073
6787
  value: "var(--tt-color-highlight-gray)",
6074
6788
  border: "var(--tt-color-highlight-gray-contrast)"
6075
6789
  },
6076
6790
  {
6077
- label: "\u68D5\u8272\u80CC\u666F",
6791
+ labelKey: "markdownEditor.highlight.brown",
6078
6792
  value: "var(--tt-color-highlight-brown)",
6079
6793
  border: "var(--tt-color-highlight-brown-contrast)"
6080
6794
  },
6081
6795
  {
6082
- label: "\u6A59\u8272\u80CC\u666F",
6796
+ labelKey: "markdownEditor.highlight.orange",
6083
6797
  value: "var(--tt-color-highlight-orange)",
6084
6798
  border: "var(--tt-color-highlight-orange-contrast)"
6085
6799
  },
6086
6800
  {
6087
- label: "\u9EC4\u8272\u80CC\u666F",
6801
+ labelKey: "markdownEditor.highlight.yellow",
6088
6802
  value: "var(--tt-color-highlight-yellow)",
6089
6803
  border: "var(--tt-color-highlight-yellow-contrast)"
6090
6804
  },
6091
6805
  {
6092
- label: "\u7EFF\u8272\u80CC\u666F",
6806
+ labelKey: "markdownEditor.highlight.green",
6093
6807
  value: "var(--tt-color-highlight-green)",
6094
6808
  border: "var(--tt-color-highlight-green-contrast)"
6095
6809
  },
6096
6810
  {
6097
- label: "\u84DD\u8272\u80CC\u666F",
6811
+ labelKey: "markdownEditor.highlight.blue",
6098
6812
  value: "var(--tt-color-highlight-blue)",
6099
6813
  border: "var(--tt-color-highlight-blue-contrast)"
6100
6814
  },
6101
6815
  {
6102
- label: "\u7D2B\u8272\u80CC\u666F",
6816
+ labelKey: "markdownEditor.highlight.purple",
6103
6817
  value: "var(--tt-color-highlight-purple)",
6104
6818
  border: "var(--tt-color-highlight-purple-contrast)"
6105
6819
  },
6106
6820
  {
6107
- label: "\u7C89\u8272\u80CC\u666F",
6821
+ labelKey: "markdownEditor.highlight.pink",
6108
6822
  value: "var(--tt-color-highlight-pink)",
6109
6823
  border: "var(--tt-color-highlight-pink-contrast)"
6110
6824
  },
6111
6825
  {
6112
- label: "\u7EA2\u8272\u80CC\u666F",
6826
+ labelKey: "markdownEditor.highlight.red",
6113
6827
  value: "var(--tt-color-highlight-red)",
6114
6828
  border: "var(--tt-color-highlight-red-contrast)"
6115
6829
  }
@@ -6235,7 +6949,7 @@ function useColorHighlight(config) {
6235
6949
  const handleRemoveHighlight = React3.useCallback(() => {
6236
6950
  const success = removeHighlight(editor, mode);
6237
6951
  if (success) {
6238
- onApplied?.({ color: "", label: "\u79FB\u9664\u80CC\u666F", mode });
6952
+ onApplied?.({ color: "", label: t("markdownEditor.highlight.removeBackground"), mode });
6239
6953
  }
6240
6954
  return success;
6241
6955
  }, [editor, onApplied, mode]);
@@ -6257,28 +6971,31 @@ function useColorHighlight(config) {
6257
6971
  handleColorHighlight,
6258
6972
  handleRemoveHighlight,
6259
6973
  canColorHighlight: canColorHighlightState,
6260
- label: label || `\u80CC\u666F\u8272`,
6974
+ label: label || t("markdownEditor.highlight.label"),
6261
6975
  shortcutKeys: COLOR_HIGHLIGHT_SHORTCUT_KEY,
6262
6976
  Icon: HighlighterIcon,
6263
6977
  mode
6264
6978
  };
6265
6979
  }
6266
- var ColorHighlightPopoverButton = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
6267
- Button7,
6268
- {
6269
- type: "button",
6270
- className,
6271
- "data-style": "ghost",
6272
- "data-appearance": "default",
6273
- role: "button",
6274
- tabIndex: -1,
6275
- "aria-label": "\u6587\u672C\u80CC\u666F\u8272",
6276
- tooltip: "\u80CC\u666F\u8272",
6277
- ref,
6278
- ...props,
6279
- children: children ?? /* @__PURE__ */ jsxRuntime.jsx(HighlighterIcon, { className: "tiptap-button-icon" })
6280
- }
6281
- ));
6980
+ var ColorHighlightPopoverButton = React3.forwardRef(({ className, children, ...props }, ref) => {
6981
+ const { t: t2 } = useTranslation(NS_COMMON);
6982
+ return /* @__PURE__ */ jsxRuntime.jsx(
6983
+ Button7,
6984
+ {
6985
+ type: "button",
6986
+ className,
6987
+ "data-style": "ghost",
6988
+ "data-appearance": "default",
6989
+ role: "button",
6990
+ tabIndex: -1,
6991
+ "aria-label": t2("markdownEditor.highlight.textLabel"),
6992
+ tooltip: t2("markdownEditor.highlight.label"),
6993
+ ref,
6994
+ ...props,
6995
+ children: children ?? /* @__PURE__ */ jsxRuntime.jsx(HighlighterIcon, { className: "tiptap-button-icon" })
6996
+ }
6997
+ );
6998
+ });
6282
6999
  ColorHighlightPopoverButton.displayName = "ColorHighlightPopoverButton";
6283
7000
  function ColorHighlightPopoverContent({
6284
7001
  editor,
@@ -6293,9 +7010,10 @@ function ColorHighlightPopoverContent({
6293
7010
  const { handleRemoveHighlight } = useColorHighlight({ editor });
6294
7011
  const isMobile = useIsBreakpoint();
6295
7012
  const containerRef = React3.useRef(null);
7013
+ const { t: t2 } = useTranslation(NS_COMMON);
6296
7014
  const menuItems = React3.useMemo(
6297
- () => [...colors, { label: "\u79FB\u9664\u9AD8\u4EAE", value: "none" }],
6298
- [colors]
7015
+ () => [...colors.map((c) => ({ ...c, label: t2(c.labelKey) })), { label: t2("markdownEditor.highlight.removeHighlight"), value: "none" }],
7016
+ [colors, t2]
6299
7017
  );
6300
7018
  const { selectedIndex } = useMenuNavigation({
6301
7019
  containerRef,
@@ -6324,8 +7042,8 @@ function ColorHighlightPopoverContent({
6324
7042
  {
6325
7043
  editor,
6326
7044
  highlightColor: color.value,
6327
- tooltip: color.label,
6328
- "aria-label": `${color.label} highlight color`,
7045
+ tooltip: t2(color.labelKey),
7046
+ "aria-label": `${t2(color.labelKey)} highlight color`,
6329
7047
  tabIndex: index === selectedIndex ? 0 : -1,
6330
7048
  "data-highlighted": selectedIndex === index
6331
7049
  },
@@ -6336,8 +7054,8 @@ function ColorHighlightPopoverContent({
6336
7054
  Button7,
6337
7055
  {
6338
7056
  onClick: handleRemoveHighlight,
6339
- "aria-label": "\u79FB\u9664\u80CC\u666F",
6340
- tooltip: "\u79FB\u9664\u80CC\u666F",
7057
+ "aria-label": t2("markdownEditor.highlight.removeBackground"),
7058
+ tooltip: t2("markdownEditor.highlight.removeBackground"),
6341
7059
  tabIndex: selectedIndex === colors.length ? 0 : -1,
6342
7060
  type: "button",
6343
7061
  role: "menuitem",
@@ -6363,6 +7081,7 @@ function ColorHighlightPopover({
6363
7081
  onApplied,
6364
7082
  ...props
6365
7083
  }) {
7084
+ const { t: t2 } = useTranslation(NS_COMMON);
6366
7085
  const { editor } = useTiptapEditor(providedEditor);
6367
7086
  const [isOpen, setIsOpen] = React3.useState(false);
6368
7087
  const { isVisible, canColorHighlight: canColorHighlight2, isActive, label, Icon } = useColorHighlight({
@@ -6385,7 +7104,7 @@ function ColorHighlightPopover({
6385
7104
  children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "tiptap-button-icon" })
6386
7105
  }
6387
7106
  ) }),
6388
- /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { "aria-label": "\u80CC\u666F\u8272", children: /* @__PURE__ */ jsxRuntime.jsx(ColorHighlightPopoverContent, { editor, colors }) })
7107
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { "aria-label": t2("markdownEditor.highlight.label"), children: /* @__PURE__ */ jsxRuntime.jsx(ColorHighlightPopoverContent, { editor, colors }) })
6389
7108
  ] });
6390
7109
  }
6391
7110
  var ChevronDownIcon = React3.memo(({ className, ...props }) => {
@@ -6868,6 +7587,7 @@ var HeadingDropdownMenu = React3.forwardRef(
6868
7587
  }, ref) => {
6869
7588
  const { editor } = useTiptapEditor(providedEditor);
6870
7589
  const [isOpen, setIsOpen] = React3.useState(false);
7590
+ const { t: t2 } = useTranslation(NS_COMMON);
6871
7591
  const { isVisible, isActive, canToggle: canToggle3, Icon } = useHeadingDropdownMenu({
6872
7592
  editor,
6873
7593
  levels,
@@ -6897,7 +7617,7 @@ var HeadingDropdownMenu = React3.forwardRef(
6897
7617
  "data-disabled": !canToggle3,
6898
7618
  "aria-label": "Format text as heading",
6899
7619
  "aria-pressed": isActive,
6900
- tooltip: "\u6807\u9898",
7620
+ tooltip: t2("markdownEditor.toolbar.heading"),
6901
7621
  ...buttonProps,
6902
7622
  ref,
6903
7623
  children: [
@@ -6911,10 +7631,10 @@ var HeadingDropdownMenu = React3.forwardRef(
6911
7631
  {
6912
7632
  editor,
6913
7633
  level,
6914
- text: `\u6807\u9898 ${level}`,
7634
+ text: t2("markdownEditor.toolbar.headingLevel", { level }),
6915
7635
  showTooltip: false
6916
7636
  }
6917
- ) }, `\u6807\u9898 ${level}`)) }) }) }) })
7637
+ ) }, level)) }) }) }) })
6918
7638
  ] });
6919
7639
  }
6920
7640
  );
@@ -6977,7 +7697,7 @@ function useHeadingDropdownMenu(config) {
6977
7697
  isActive,
6978
7698
  canToggle: canToggleState,
6979
7699
  levels,
6980
- label: "\u6807\u9898",
7700
+ label: t("markdownEditor.toolbar.heading"),
6981
7701
  Icon: activeLevel ? headingIcons[activeLevel] : HeadingIcon
6982
7702
  };
6983
7703
  }
@@ -7103,6 +7823,7 @@ function InputGroup({
7103
7823
  }
7104
7824
  var LinkButton = React3.forwardRef(
7105
7825
  ({ className, children, ...props }, ref) => {
7826
+ const { t: t2 } = useTranslation(NS_COMMON);
7106
7827
  return /* @__PURE__ */ jsxRuntime.jsx(
7107
7828
  Button7,
7108
7829
  {
@@ -7111,8 +7832,8 @@ var LinkButton = React3.forwardRef(
7111
7832
  "data-style": "ghost",
7112
7833
  role: "button",
7113
7834
  tabIndex: -1,
7114
- "aria-label": "\u94FE\u63A5",
7115
- tooltip: "\u94FE\u63A5",
7835
+ "aria-label": t2("markdownEditor.toolbar.link"),
7836
+ tooltip: t2("markdownEditor.toolbar.link"),
7116
7837
  ref,
7117
7838
  ...props,
7118
7839
  children: children || /* @__PURE__ */ jsxRuntime.jsx(LinkIcon, { className: "tiptap-button-icon" })
@@ -7130,6 +7851,7 @@ var LinkMain = ({
7130
7851
  isActive
7131
7852
  }) => {
7132
7853
  const isMobile = useIsBreakpoint();
7854
+ const { t: t2 } = useTranslation(NS_COMMON);
7133
7855
  const handleKeyDown = (event) => {
7134
7856
  if (event.key === "Enter") {
7135
7857
  event.preventDefault();
@@ -7153,7 +7875,7 @@ var LinkMain = ({
7153
7875
  Input4,
7154
7876
  {
7155
7877
  type: "url",
7156
- placeholder: "\u7C98\u8D34\u94FE\u63A5...",
7878
+ placeholder: t2("markdownEditor.toolbar.linkPlaceholder"),
7157
7879
  value: url,
7158
7880
  onChange: (e) => setUrl(e.target.value),
7159
7881
  onKeyDown: handleKeyDown,
@@ -7168,7 +7890,7 @@ var LinkMain = ({
7168
7890
  {
7169
7891
  type: "button",
7170
7892
  onClick: setLink,
7171
- title: "\u5E94\u7528\u94FE\u63A5",
7893
+ title: t2("markdownEditor.toolbar.applyLink"),
7172
7894
  disabled: !url && !isActive,
7173
7895
  "data-style": "ghost",
7174
7896
  children: /* @__PURE__ */ jsxRuntime.jsx(CornerDownLeftIcon, { className: "tiptap-button-icon" })
@@ -7181,7 +7903,7 @@ var LinkMain = ({
7181
7903
  {
7182
7904
  type: "button",
7183
7905
  onClick: openLink,
7184
- title: "\u5728\u65B0\u7A97\u53E3\u4E2D\u6253\u5F00",
7906
+ title: t2("markdownEditor.toolbar.openInNewWindow"),
7185
7907
  disabled: !url && !isActive,
7186
7908
  "data-style": "ghost",
7187
7909
  children: /* @__PURE__ */ jsxRuntime.jsx(ExternalLinkIcon, { className: "tiptap-button-icon" })
@@ -7192,7 +7914,7 @@ var LinkMain = ({
7192
7914
  {
7193
7915
  type: "button",
7194
7916
  onClick: removeLink,
7195
- title: "\u79FB\u9664\u94FE\u63A5",
7917
+ title: t2("markdownEditor.toolbar.removeLink"),
7196
7918
  disabled: !url && !isActive,
7197
7919
  "data-style": "ghost",
7198
7920
  children: /* @__PURE__ */ jsxRuntime.jsx(TrashIcon, { className: "tiptap-button-icon" })
@@ -7706,10 +8428,10 @@ var listIcons = {
7706
8428
  orderedList: ListOrderedIcon,
7707
8429
  taskList: ListTodoIcon
7708
8430
  };
7709
- var listLabels = {
7710
- bulletList: "\u65E0\u5E8F\u5217\u8868",
7711
- orderedList: "\u6709\u5E8F\u5217\u8868",
7712
- taskList: "\u4EFB\u52A1\u5217\u8868"
8431
+ var listLabelKeys = {
8432
+ bulletList: "markdownEditor.toolbar.bulletList",
8433
+ orderedList: "markdownEditor.toolbar.orderedList",
8434
+ taskList: "markdownEditor.toolbar.taskList"
7713
8435
  };
7714
8436
  var LIST_SHORTCUT_KEYS = {
7715
8437
  bulletList: "mod+shift+8",
@@ -7856,24 +8578,24 @@ function useList(config) {
7856
8578
  isActive,
7857
8579
  handleToggle,
7858
8580
  canToggle: canToggle3,
7859
- label: listLabels[type],
8581
+ label: t(listLabelKeys[type]),
7860
8582
  shortcutKeys: LIST_SHORTCUT_KEYS[type],
7861
8583
  Icon: listIcons[type]
7862
8584
  };
7863
8585
  }
7864
8586
  var listOptions = [
7865
8587
  {
7866
- label: "\u65E0\u5E8F\u5217\u8868",
8588
+ labelKey: "markdownEditor.toolbar.bulletList",
7867
8589
  type: "bulletList",
7868
8590
  icon: ListIcon
7869
8591
  },
7870
8592
  {
7871
- label: "\u6709\u5E8F\u5217\u8868",
8593
+ labelKey: "markdownEditor.toolbar.orderedList",
7872
8594
  type: "orderedList",
7873
8595
  icon: ListOrderedIcon
7874
8596
  },
7875
8597
  {
7876
- label: "\u4EFB\u52A1\u5217\u8868",
8598
+ labelKey: "markdownEditor.toolbar.taskList",
7877
8599
  type: "taskList",
7878
8600
  icon: ListTodoIcon
7879
8601
  }
@@ -7914,7 +8636,13 @@ function useListDropdownMenu(config) {
7914
8636
  const { editor } = useTiptapEditor(providedEditor);
7915
8637
  const [isVisible, setIsVisible] = React3.useState(true);
7916
8638
  const listInSchema = types.some((type) => isNodeInSchema(type, editor));
7917
- const filteredLists = React3.useMemo(() => getFilteredListOptions(types), [types]);
8639
+ const filteredLists = React3.useMemo(
8640
+ () => getFilteredListOptions(types).map((option) => ({
8641
+ ...option,
8642
+ label: t(option.labelKey)
8643
+ })),
8644
+ [types]
8645
+ );
7918
8646
  const canToggleAny = canToggleAnyList(editor, types);
7919
8647
  const isAnyActive = isAnyListActive(editor, types);
7920
8648
  const activeType = getActiveListType(editor, types);
@@ -7944,7 +8672,7 @@ function useListDropdownMenu(config) {
7944
8672
  canToggle: canToggleAny,
7945
8673
  types,
7946
8674
  filteredLists,
7947
- label: "List",
8675
+ label: t("markdownEditor.toolbar.list"),
7948
8676
  Icon: activeList ? listIcons[activeList.type] : ListIcon
7949
8677
  };
7950
8678
  }
@@ -7958,6 +8686,7 @@ function ListDropdownMenu({
7958
8686
  }) {
7959
8687
  const { editor } = useTiptapEditor(providedEditor);
7960
8688
  const [isOpen, setIsOpen] = React3.useState(false);
8689
+ const { t: t2 } = useTranslation(NS_COMMON);
7961
8690
  const { filteredLists, canToggle: canToggle3, isActive, isVisible, Icon } = useListDropdownMenu({
7962
8691
  editor,
7963
8692
  types,
@@ -7984,8 +8713,8 @@ function ListDropdownMenu({
7984
8713
  tabIndex: -1,
7985
8714
  disabled: !canToggle3,
7986
8715
  "data-disabled": !canToggle3,
7987
- "aria-label": "\u5217\u8868\u9009\u9879",
7988
- tooltip: "\u5217\u8868",
8716
+ "aria-label": t2("markdownEditor.toolbar.listOptions"),
8717
+ tooltip: t2("markdownEditor.toolbar.list"),
7989
8718
  ...props,
7990
8719
  children: [
7991
8720
  /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "tiptap-button-icon" }),
@@ -8321,14 +9050,14 @@ var MARK_SHORTCUT_KEYS = {
8321
9050
  superscript: "mod+.",
8322
9051
  subscript: "mod+,"
8323
9052
  };
8324
- var MARK_ACTION_LABELS = {
8325
- bold: "\u7C97\u4F53",
8326
- italic: "\u659C\u4F53",
8327
- underline: "\u4E0B\u5212\u7EBF",
8328
- strike: "\u5220\u9664\u7EBF",
8329
- code: "\u4EE3\u7801",
8330
- superscript: "\u4E0A\u89D2\u6807",
8331
- subscript: "\u4E0B\u89D2\u6807"
9053
+ var MARK_ACTION_LABEL_KEYS = {
9054
+ bold: "markdownEditor.toolbar.bold",
9055
+ italic: "markdownEditor.toolbar.italic",
9056
+ underline: "markdownEditor.toolbar.underline",
9057
+ strike: "markdownEditor.toolbar.strike",
9058
+ code: "markdownEditor.toolbar.code",
9059
+ superscript: "markdownEditor.toolbar.superscript",
9060
+ subscript: "markdownEditor.toolbar.subscript"
8332
9061
  };
8333
9062
  function canToggleMark(editor, type) {
8334
9063
  if (!editor || !editor.isEditable) return false;
@@ -8355,7 +9084,8 @@ function shouldShowButton6(props) {
8355
9084
  return true;
8356
9085
  }
8357
9086
  function getFormattedMarkName(type) {
8358
- return MARK_ACTION_LABELS[type] || type.charAt(0).toUpperCase() + type.slice(1);
9087
+ const labelKey = MARK_ACTION_LABEL_KEYS[type];
9088
+ return labelKey ? t(labelKey) : type.charAt(0).toUpperCase() + type.slice(1);
8359
9089
  }
8360
9090
  function useMark(config) {
8361
9091
  const {
@@ -8665,11 +9395,11 @@ var textAlignIcons = {
8665
9395
  right: AlignRightIcon,
8666
9396
  justify: AlignJustifyIcon
8667
9397
  };
8668
- var textAlignLabels = {
8669
- left: "\u5DE6\u5BF9\u9F50",
8670
- center: "\u5C45\u4E2D\u5BF9\u9F50",
8671
- right: "\u53F3\u5BF9\u9F50",
8672
- justify: "\u4E24\u7AEF\u5BF9\u9F50"
9398
+ var textAlignLabelKeys = {
9399
+ left: "markdownEditor.toolbar.alignLeft",
9400
+ center: "markdownEditor.toolbar.alignCenter",
9401
+ right: "markdownEditor.toolbar.alignRight",
9402
+ justify: "markdownEditor.toolbar.alignJustify"
8673
9403
  };
8674
9404
  function canSetTextAlign(editor, align) {
8675
9405
  if (!editor || !editor.isEditable) return false;
@@ -8737,7 +9467,7 @@ function useTextAlign(config) {
8737
9467
  isActive,
8738
9468
  handleTextAlign,
8739
9469
  canAlign,
8740
- label: textAlignLabels[align],
9470
+ label: t(textAlignLabelKeys[align]),
8741
9471
  shortcutKeys: TEXT_ALIGN_SHORTCUT_KEYS[align],
8742
9472
  Icon: textAlignIcons[align]
8743
9473
  };
@@ -8862,9 +9592,9 @@ var UNDO_REDO_SHORTCUT_KEYS = {
8862
9592
  undo: "mod+z",
8863
9593
  redo: "mod+shift+z"
8864
9594
  };
8865
- var historyActionLabels = {
8866
- undo: "\u64A4\u9500",
8867
- redo: "\u91CD\u505A"
9595
+ var historyActionLabelKeys = {
9596
+ undo: "markdownEditor.toolbar.undo",
9597
+ redo: "markdownEditor.toolbar.redo"
8868
9598
  };
8869
9599
  var historyIcons = {
8870
9600
  undo: Undo2Icon,
@@ -8922,7 +9652,7 @@ function useUndoRedo(config) {
8922
9652
  isVisible,
8923
9653
  handleAction,
8924
9654
  canExecute,
8925
- label: historyActionLabels[action],
9655
+ label: t(historyActionLabelKeys[action]),
8926
9656
  shortcutKeys: UNDO_REDO_SHORTCUT_KEYS[action],
8927
9657
  Icon: historyIcons[action]
8928
9658
  };
@@ -9185,6 +9915,7 @@ var MainToolbarContent = ({
9185
9915
  isMobile,
9186
9916
  isBubble
9187
9917
  }) => {
9918
+ const { t: t2 } = useTranslation(NS_COMMON);
9188
9919
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9189
9920
  /* @__PURE__ */ jsxRuntime.jsx(Spacer, {}),
9190
9921
  !isBubble && tools.includes("undo-redo") && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -9194,9 +9925,9 @@ var MainToolbarContent = ({
9194
9925
  ] }),
9195
9926
  /* @__PURE__ */ jsxRuntime.jsx(ToolbarSeparator, {})
9196
9927
  ] }),
9197
- onQuote && /* @__PURE__ */ jsxRuntime.jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(QuoteIcon, {}), tooltip: "\u5F15\u7528\u9009\u4E2D\u6587\u672C", onClick: onQuote, children: "\u5F15\u7528" }) }),
9198
- onCreateAnnotation && /* @__PURE__ */ jsxRuntime.jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(icons.MessageOutlined, {}), tooltip: "\u6279\u6CE8", onClick: onCreateAnnotation, children: "\u6279\u6CE8" }) }),
9199
- onCreateCollection && /* @__PURE__ */ jsxRuntime.jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(icons.BookOutlined, {}), tooltip: "\u6458\u5F55\u7B14\u8BB0", onClick: onCreateCollection, children: "\u6458\u5F55" }) }),
9928
+ 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") }) }),
9929
+ 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") }) }),
9930
+ 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
9931
  (tools.includes("heading") || tools.includes("list") || tools.includes("block")) && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9201
9932
  /* @__PURE__ */ jsxRuntime.jsxs(ToolbarGroup, { children: [
9202
9933
  tools.includes("heading") && /* @__PURE__ */ jsxRuntime.jsx(HeadingDropdownMenu, { levels: [1, 2, 3, 4], portal: isMobile }),
@@ -9437,9 +10168,9 @@ var SearchAndReplace = core.Extension.create({
9437
10168
  addProseMirrorPlugins() {
9438
10169
  const editor = this.editor;
9439
10170
  const { searchResultClass, disableRegex } = this.options;
9440
- const setLastSearchTerm = (t) => editor.storage.searchAndReplace.lastSearchTerm = t;
9441
- const setLastCaseSensitive = (t) => editor.storage.searchAndReplace.lastCaseSensitive = t;
9442
- const setLastResultIndex = (t) => editor.storage.searchAndReplace.lastResultIndex = t;
10171
+ const setLastSearchTerm = (t2) => editor.storage.searchAndReplace.lastSearchTerm = t2;
10172
+ const setLastCaseSensitive = (t2) => editor.storage.searchAndReplace.lastCaseSensitive = t2;
10173
+ const setLastResultIndex = (t2) => editor.storage.searchAndReplace.lastResultIndex = t2;
9443
10174
  return [
9444
10175
  new state.Plugin({
9445
10176
  key: searchAndReplacePluginKey,
@@ -9540,6 +10271,7 @@ var MarkdownEditor_default = React3.forwardRef(
9540
10271
  collectionConfig,
9541
10272
  pageNoConfig
9542
10273
  }, ref) => {
10274
+ const { t: t2 } = useTranslation(NS_COMMON);
9543
10275
  const isMobile = useIsBreakpoint();
9544
10276
  const lastContentRef = React3.useRef("");
9545
10277
  const { setPageNoEditor, onPageChange } = usePageNo(pageNoConfig);
@@ -9576,7 +10308,7 @@ var MarkdownEditor_default = React3.forwardRef(
9576
10308
  autocomplete: "off",
9577
10309
  autocorrect: "off",
9578
10310
  autocapitalize: "off",
9579
- "aria-label": "\u4E3B\u5185\u5BB9\u533A\u57DF\uFF0C\u5F00\u59CB\u8F93\u5165\u6587\u672C..."
10311
+ "aria-label": t2("markdownEditor.mainArea")
9580
10312
  }
9581
10313
  },
9582
10314
  extensions: [
@@ -9737,7 +10469,7 @@ var MarkdownEditor_default = React3.forwardRef(
9737
10469
  antd.Button,
9738
10470
  {
9739
10471
  size: "small",
9740
- title: "\u6279\u6CE8\u5217\u8868",
10472
+ title: t2("markdownEditor.annotation.list"),
9741
10473
  icon: /* @__PURE__ */ jsxRuntime.jsx(icons.MessageOutlined, {}),
9742
10474
  color: "primary",
9743
10475
  variant: "text",
@@ -9749,15 +10481,15 @@ var MarkdownEditor_default = React3.forwardRef(
9749
10481
  {
9750
10482
  style: { gap: "2px" },
9751
10483
  size: "small",
9752
- title: "\u6458\u5F55\u5217\u8868",
10484
+ title: t2("markdownEditor.collection.list"),
9753
10485
  icon: /* @__PURE__ */ jsxRuntime.jsx(icons.BookOutlined, {}),
9754
10486
  color: "primary",
9755
10487
  variant: "text",
9756
10488
  onClick: () => setShowCollection(!showCollection),
9757
- children: "\u6458\u5F55"
10489
+ children: t2("markdownEditor.collection.title")
9758
10490
  }
9759
10491
  ),
9760
- onDownloadFile && /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", color: "primary", variant: "text", onClick: downloadFile2, children: "\u4E0B\u8F7D" }),
10492
+ onDownloadFile && /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", color: "primary", variant: "text", onClick: downloadFile2, children: t2("common.download") }),
9761
10493
  extraNav
9762
10494
  ] })
9763
10495
  ] }),
@@ -9930,7 +10662,9 @@ exports.FilePreview = FilePreview_default;
9930
10662
  exports.FilePreviewDrawer = FilePreviewDrawer_default;
9931
10663
  exports.HttpStatus = HttpStatus;
9932
10664
  exports.Iframe = Iframe_default;
10665
+ exports.LANG_KEY = LANG_KEY;
9933
10666
  exports.LazyComponent = LazyComponent_default;
10667
+ exports.LocaleProvider = LocaleProvider;
9934
10668
  exports.LuyaFilePreview = luyaFilePreview_default;
9935
10669
  exports.MarkDrawing = MarkDrawing_default;
9936
10670
  exports.MarkdownEditor = MarkdownEditor_default;
@@ -9939,6 +10673,7 @@ exports.MicroApp = MicroApp_default;
9939
10673
  exports.MicroAppDrawer = Drawer_default;
9940
10674
  exports.MicroAppWindow = Window_default;
9941
10675
  exports.MultiEmailValidator = MultiEmailValidator;
10676
+ exports.NS_COMMON = NS_COMMON;
9942
10677
  exports.PdfImagePreview = PdfImagePreview_default;
9943
10678
  exports.PdfPreview = PdfPreview_default;
9944
10679
  exports.PhoneOrMobileValidator = PhoneOrMobileValidator;
@@ -9960,6 +10695,7 @@ exports.ThanNumValidator = ThanNumValidator;
9960
10695
  exports.UserAvatar = UserAvatar_default;
9961
10696
  exports.VideoPlayer = VideoPlayer_default;
9962
10697
  exports.absVal = absVal;
10698
+ exports.addBundledResource = addBundledResource;
9963
10699
  exports.addUrlLastSlash = addUrlLastSlash;
9964
10700
  exports.aesDecrypt = aesDecrypt;
9965
10701
  exports.aesEncrypt = aesEncrypt;
@@ -9967,6 +10703,9 @@ exports.arrToObj = arrToObj;
9967
10703
  exports.buildUrlParams = buildUrlParams;
9968
10704
  exports.cachedMessage = cachedMessage;
9969
10705
  exports.calculate = calculate;
10706
+ exports.commonEnUS = commonEnUS;
10707
+ exports.commonJaJP = commonJaJP;
10708
+ exports.commonZhCN = commonZhCN;
9970
10709
  exports.compareNum = compareNum;
9971
10710
  exports.convertCurrency = convertCurrency;
9972
10711
  exports.convertNewlineToBr = convertNewlineToBr;
@@ -9994,6 +10733,8 @@ exports.getDeviceId = getDeviceId;
9994
10733
  exports.getEndOfTimestamp = getEndOfTimestamp;
9995
10734
  exports.getFileName = getFileName;
9996
10735
  exports.getFileSuffixName = getFileSuffixName;
10736
+ exports.getI18n = getI18n;
10737
+ exports.getLang = getLang;
9997
10738
  exports.getRowSpanCount = getRowSpanCount;
9998
10739
  exports.getStartOfTimestamp = getStartOfTimestamp;
9999
10740
  exports.getTimestamp = getTimestamp;
@@ -10001,6 +10742,7 @@ exports.getWebSocketUrl = getWebSocketUrl;
10001
10742
  exports.htmlToMarkdown = htmlToMarkdown;
10002
10743
  exports.htmlToText = htmlToText;
10003
10744
  exports.importThirdPartyFile = importThirdPartyFile;
10745
+ exports.initI18n = initI18n;
10004
10746
  exports.is = is;
10005
10747
  exports.isArray = isArray;
10006
10748
  exports.isBlob = isBlob;
@@ -10042,6 +10784,8 @@ exports.safeParseJson = safeParseJson;
10042
10784
  exports.setInterval = setInterval2;
10043
10785
  exports.setUrlMainSource = setUrlMainSource;
10044
10786
  exports.shouldRender = shouldRender;
10787
+ exports.switchLang = switchLang;
10788
+ exports.t = t;
10045
10789
  exports.times = times;
10046
10790
  exports.toFixed = toFixed;
10047
10791
  exports.transform = transform;
@@ -10056,6 +10800,7 @@ exports.useIframeRelayBridge = useIframeRelayBridge_default;
10056
10800
  exports.useRefState = useRefState_default;
10057
10801
  exports.useSyncInput = useSyncInput_default;
10058
10802
  exports.useThrottle = useThrottle_default;
10803
+ exports.useTranslation = useTranslation;
10059
10804
  exports.useWebSocket = useWebSocket_default;
10060
10805
  //# sourceMappingURL=index.cjs.js.map
10061
10806
  //# sourceMappingURL=index.cjs.js.map