@pisell/core 1.0.61 → 1.0.62

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.
@@ -37,20 +37,22 @@ var import_utils = require("@pisell/utils");
37
37
  var import_en = __toESM(require("./en"));
38
38
  var import_zh_CN = __toESM(require("./zh-CN"));
39
39
  var import_zh_HK = __toESM(require("./zh-HK"));
40
+ var import_ja = __toESM(require("./ja"));
41
+ var import_pt = __toESM(require("./pt"));
40
42
  var import_original = __toESM(require("./original"));
41
43
  var Locales = class {
42
44
  app;
43
45
  // 当前语言 本地语言 > 英文语言包
44
46
  locale = import_en.default.locale;
45
47
  // 语言包
46
- library = [import_original.default, import_en.default, import_zh_CN.default, import_zh_HK.default].reduce((pre, cur) => {
48
+ library = [import_original.default, import_en.default, import_zh_CN.default, import_zh_HK.default, import_ja.default, import_pt.default].reduce((pre, cur) => {
47
49
  pre[cur.locale] = cur;
48
50
  return pre;
49
51
  }, {});
50
52
  constructor(app, options) {
51
53
  this.app = app;
52
54
  this.locale = (options == null ? void 0 : options.locale) || this.app.storage.getStorage("locale") || import_en.default.locale;
53
- this.library = (options == null ? void 0 : options.library) || [import_original.default, import_en.default, import_zh_CN.default, import_zh_HK.default].reduce((pre, cur) => {
55
+ this.library = (options == null ? void 0 : options.library) || [import_original.default, import_en.default, import_zh_CN.default, import_zh_HK.default, import_ja.default, import_pt.default].reduce((pre, cur) => {
54
56
  pre[cur.locale] = cur;
55
57
  return pre;
56
58
  }, {});
@@ -69,8 +71,8 @@ var Locales = class {
69
71
  }
70
72
  };
71
73
  getText = (id, locale) => {
72
- var _a;
73
- return ((_a = this.getCurrentTexts(locale)) == null ? void 0 : _a[id]) || id;
74
+ var _a, _b;
75
+ return ((_a = this.getCurrentTexts(locale)) == null ? void 0 : _a[id]) || ((_b = this.getCurrentTexts("en")) == null ? void 0 : _b[id]) || id;
74
76
  };
75
77
  isCN = () => {
76
78
  let locale = this.getLocale();
@@ -130,7 +132,7 @@ var Locales = class {
130
132
  if (typeof text === "string") {
131
133
  return text;
132
134
  }
133
- return text[primary] || text["original"] || text["en"] || text["zh-CN"] || text["zh-HK"];
135
+ return text[primary] || text["original"] || text["en"] || text["zh-CN"] || text["zh-HK"] || text["ja"] || text["pt"];
134
136
  };
135
137
  getLibraryByData = (data) => {
136
138
  return data.reduce((pre, next) => {
@@ -0,0 +1,3 @@
1
+ import { LibraryItem } from './type';
2
+ declare const _default: LibraryItem;
3
+ export default _default;
@@ -0,0 +1,29 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/locales/ja.ts
20
+ var ja_exports = {};
21
+ __export(ja_exports, {
22
+ default: () => ja_default
23
+ });
24
+ module.exports = __toCommonJS(ja_exports);
25
+ var ja_default = {
26
+ "locale": "ja",
27
+ "name": "japanese",
28
+ "translations": {}
29
+ };
@@ -0,0 +1,3 @@
1
+ import { LibraryItem } from './type';
2
+ declare const _default: LibraryItem;
3
+ export default _default;
@@ -0,0 +1,29 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/locales/pt.ts
20
+ var pt_exports = {};
21
+ __export(pt_exports, {
22
+ default: () => pt_default
23
+ });
24
+ module.exports = __toCommonJS(pt_exports);
25
+ var pt_default = {
26
+ "locale": "pt",
27
+ "name": "portuguese",
28
+ "translations": {}
29
+ };
@@ -20,7 +20,7 @@ export declare class RouterManager {
20
20
  get(name: string): RouteType;
21
21
  has(name: string): boolean;
22
22
  remove(name: string): void;
23
- renderComponent(item: RouteType, children?: React.ReactNode): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
23
+ renderComponent(item: RouteType, children?: React.ReactNode): string | number | boolean | JSX.Element | React.ReactFragment | null | undefined;
24
24
  getPageByRoute(route: string): ApplicationInterface | undefined;
25
25
  getRouterComponent({ fallback }: {
26
26
  fallback?: React.ReactNode;
@@ -108,7 +108,7 @@ export declare class TasksManager {
108
108
  */
109
109
  getQueueStatus(module: string, queueId: string): {
110
110
  isRunning: boolean;
111
- status: "uncompleted" | "completed";
111
+ status: "completed" | "uncompleted";
112
112
  progress: {
113
113
  total: number;
114
114
  completed: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/core",
3
- "version": "1.0.61",
3
+ "version": "1.0.62",
4
4
  "sideEffects": false,
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",