@cloudtower/parrot 0.19.2 → 0.20.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/esm/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import i18next from 'i18next';
2
+ import merge from 'lodash.merge';
2
3
 
3
4
  var _action_$1 = "Action";
4
5
  var action$1 = "Action";
@@ -213,10 +214,9 @@ var __spreadValues = (a, b) => {
213
214
  }
214
215
  return a;
215
216
  };
216
- const parrotI18n = i18next.createInstance({
217
+ const defaultOptions = {
217
218
  lng: "zh-CN",
218
219
  fallbackLng: "en-US",
219
- debug: true,
220
220
  interpolation: {
221
221
  prefix: "{",
222
222
  suffix: "}"
@@ -229,9 +229,10 @@ const parrotI18n = i18next.createInstance({
229
229
  translation: __spreadValues({}, locales["zh-CN"])
230
230
  }
231
231
  }
232
- });
233
- const initParrotI18n = () => {
234
- parrotI18n.init({});
232
+ };
233
+ const parrotI18n = i18next.createInstance(defaultOptions);
234
+ const initParrotI18n = (options, callback) => {
235
+ parrotI18n.init(merge(defaultOptions, options), callback);
235
236
  };
236
237
 
237
238
  export { initParrotI18n, locales, parrotI18n };
@@ -6157,7 +6157,7 @@ var drawChart = (function (exports) {
6157
6157
  </script>
6158
6158
  <script>
6159
6159
  /*<!--*/
6160
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"name":"locales","children":[{"name":"en-US","children":[{"uid":"82f7-24","name":"common.json"},{"uid":"82f7-26","name":"components.json"},{"uid":"82f7-28","name":"metric.json"},{"uid":"82f7-30","name":"index.ts"}]},{"name":"zh-CN","children":[{"uid":"82f7-32","name":"common.json"},{"uid":"82f7-34","name":"components.json"},{"uid":"82f7-36","name":"metric.json"},{"uid":"82f7-38","name":"index.ts"}]},{"uid":"82f7-40","name":"index.ts"}]},{"uid":"82f7-42","name":"parrotI18n.ts"},{"uid":"82f7-44","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"82f7-24":{"renderedLength":1259,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-23"},"82f7-26":{"renderedLength":808,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-25"},"82f7-28":{"renderedLength":165,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-27"},"82f7-30":{"renderedLength":88,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-29"},"82f7-32":{"renderedLength":1159,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-31"},"82f7-34":{"renderedLength":756,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-33"},"82f7-36":{"renderedLength":157,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-35"},"82f7-38":{"renderedLength":52,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-37"},"82f7-40":{"renderedLength":59,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-39"},"82f7-42":{"renderedLength":1076,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-41"},"82f7-44":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-43"}},"nodeMetas":{"82f7-23":{"id":"/src/locales/en-US/common.json","moduleParts":{"index.js":"82f7-24"},"imported":[],"importedBy":[{"uid":"82f7-29"}]},"82f7-25":{"id":"/src/locales/en-US/components.json","moduleParts":{"index.js":"82f7-26"},"imported":[],"importedBy":[{"uid":"82f7-29"}]},"82f7-27":{"id":"/src/locales/en-US/metric.json","moduleParts":{"index.js":"82f7-28"},"imported":[],"importedBy":[{"uid":"82f7-29"}]},"82f7-29":{"id":"/src/locales/en-US/index.ts","moduleParts":{"index.js":"82f7-30"},"imported":[{"uid":"82f7-23"},{"uid":"82f7-25"},{"uid":"82f7-27"}],"importedBy":[{"uid":"82f7-39"}]},"82f7-31":{"id":"/src/locales/zh-CN/common.json","moduleParts":{"index.js":"82f7-32"},"imported":[],"importedBy":[{"uid":"82f7-37"}]},"82f7-33":{"id":"/src/locales/zh-CN/components.json","moduleParts":{"index.js":"82f7-34"},"imported":[],"importedBy":[{"uid":"82f7-37"}]},"82f7-35":{"id":"/src/locales/zh-CN/metric.json","moduleParts":{"index.js":"82f7-36"},"imported":[],"importedBy":[{"uid":"82f7-37"}]},"82f7-37":{"id":"/src/locales/zh-CN/index.ts","moduleParts":{"index.js":"82f7-38"},"imported":[{"uid":"82f7-31"},{"uid":"82f7-33"},{"uid":"82f7-35"}],"importedBy":[{"uid":"82f7-39"}]},"82f7-39":{"id":"/src/locales/index.ts","moduleParts":{"index.js":"82f7-40"},"imported":[{"uid":"82f7-29"},{"uid":"82f7-37"}],"importedBy":[{"uid":"82f7-43"},{"uid":"82f7-41"}]},"82f7-41":{"id":"/src/parrotI18n.ts","moduleParts":{"index.js":"82f7-42"},"imported":[{"uid":"82f7-45"},{"uid":"82f7-39"}],"importedBy":[{"uid":"82f7-43"}]},"82f7-43":{"id":"/src/index.ts","moduleParts":{"index.js":"82f7-44"},"imported":[{"uid":"82f7-39"},{"uid":"82f7-41"}],"importedBy":[],"isEntry":true},"82f7-45":{"id":"i18next","moduleParts":{},"imported":[],"importedBy":[{"uid":"82f7-41"}],"isExternal":true}},"env":{"rollup":"3.12.1"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
6160
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"name":"locales","children":[{"name":"en-US","children":[{"uid":"a298-25","name":"common.json"},{"uid":"a298-27","name":"components.json"},{"uid":"a298-29","name":"metric.json"},{"uid":"a298-31","name":"index.ts"}]},{"name":"zh-CN","children":[{"uid":"a298-33","name":"common.json"},{"uid":"a298-35","name":"components.json"},{"uid":"a298-37","name":"metric.json"},{"uid":"a298-39","name":"index.ts"}]},{"uid":"a298-41","name":"index.ts"}]},{"uid":"a298-43","name":"parrotI18n.ts"},{"uid":"a298-45","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"a298-25":{"renderedLength":1259,"gzipLength":0,"brotliLength":0,"metaUid":"a298-24"},"a298-27":{"renderedLength":808,"gzipLength":0,"brotliLength":0,"metaUid":"a298-26"},"a298-29":{"renderedLength":165,"gzipLength":0,"brotliLength":0,"metaUid":"a298-28"},"a298-31":{"renderedLength":88,"gzipLength":0,"brotliLength":0,"metaUid":"a298-30"},"a298-33":{"renderedLength":1159,"gzipLength":0,"brotliLength":0,"metaUid":"a298-32"},"a298-35":{"renderedLength":756,"gzipLength":0,"brotliLength":0,"metaUid":"a298-34"},"a298-37":{"renderedLength":157,"gzipLength":0,"brotliLength":0,"metaUid":"a298-36"},"a298-39":{"renderedLength":52,"gzipLength":0,"brotliLength":0,"metaUid":"a298-38"},"a298-41":{"renderedLength":59,"gzipLength":0,"brotliLength":0,"metaUid":"a298-40"},"a298-43":{"renderedLength":1155,"gzipLength":0,"brotliLength":0,"metaUid":"a298-42"},"a298-45":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"a298-44"}},"nodeMetas":{"a298-24":{"id":"/src/locales/en-US/common.json","moduleParts":{"index.js":"a298-25"},"imported":[],"importedBy":[{"uid":"a298-30"}]},"a298-26":{"id":"/src/locales/en-US/components.json","moduleParts":{"index.js":"a298-27"},"imported":[],"importedBy":[{"uid":"a298-30"}]},"a298-28":{"id":"/src/locales/en-US/metric.json","moduleParts":{"index.js":"a298-29"},"imported":[],"importedBy":[{"uid":"a298-30"}]},"a298-30":{"id":"/src/locales/en-US/index.ts","moduleParts":{"index.js":"a298-31"},"imported":[{"uid":"a298-24"},{"uid":"a298-26"},{"uid":"a298-28"}],"importedBy":[{"uid":"a298-40"}]},"a298-32":{"id":"/src/locales/zh-CN/common.json","moduleParts":{"index.js":"a298-33"},"imported":[],"importedBy":[{"uid":"a298-38"}]},"a298-34":{"id":"/src/locales/zh-CN/components.json","moduleParts":{"index.js":"a298-35"},"imported":[],"importedBy":[{"uid":"a298-38"}]},"a298-36":{"id":"/src/locales/zh-CN/metric.json","moduleParts":{"index.js":"a298-37"},"imported":[],"importedBy":[{"uid":"a298-38"}]},"a298-38":{"id":"/src/locales/zh-CN/index.ts","moduleParts":{"index.js":"a298-39"},"imported":[{"uid":"a298-32"},{"uid":"a298-34"},{"uid":"a298-36"}],"importedBy":[{"uid":"a298-40"}]},"a298-40":{"id":"/src/locales/index.ts","moduleParts":{"index.js":"a298-41"},"imported":[{"uid":"a298-30"},{"uid":"a298-38"}],"importedBy":[{"uid":"a298-44"},{"uid":"a298-42"}]},"a298-42":{"id":"/src/parrotI18n.ts","moduleParts":{"index.js":"a298-43"},"imported":[{"uid":"a298-46"},{"uid":"a298-47"},{"uid":"a298-40"}],"importedBy":[{"uid":"a298-44"}]},"a298-44":{"id":"/src/index.ts","moduleParts":{"index.js":"a298-45"},"imported":[{"uid":"a298-40"},{"uid":"a298-42"}],"importedBy":[],"isEntry":true},"a298-46":{"id":"i18next","moduleParts":{},"imported":[],"importedBy":[{"uid":"a298-42"}],"isExternal":true},"a298-47":{"id":"lodash.merge","moduleParts":{},"imported":[],"importedBy":[{"uid":"a298-42"}],"isExternal":true}},"env":{"rollup":"3.15.0"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
6161
6161
 
6162
6162
  const run = () => {
6163
6163
  const width = window.innerWidth;
@@ -1,3 +1,4 @@
1
+ import { Callback, InitOptions } from "i18next";
1
2
  declare const parrotI18n: import("i18next").i18n;
2
3
  export default parrotI18n;
3
- export declare const initParrotI18n: () => void;
4
+ export declare const initParrotI18n: (options?: InitOptions, callback?: Callback | undefined) => void;
package/dist/umd/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('i18next')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'i18next'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.index = {}, global.i18next));
5
- })(this, (function (exports, i18next) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('i18next'), require('lodash.merge')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'i18next', 'lodash.merge'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.index = {}, global.i18next, global.merge));
5
+ })(this, (function (exports, i18next, merge) { 'use strict';
6
6
 
7
7
  var _action_$1 = "Action";
8
8
  var action$1 = "Action";
@@ -217,10 +217,9 @@
217
217
  }
218
218
  return a;
219
219
  };
220
- const parrotI18n = i18next.createInstance({
220
+ const defaultOptions = {
221
221
  lng: "zh-CN",
222
222
  fallbackLng: "en-US",
223
- debug: true,
224
223
  interpolation: {
225
224
  prefix: "{",
226
225
  suffix: "}"
@@ -233,9 +232,10 @@
233
232
  translation: __spreadValues({}, locales["zh-CN"])
234
233
  }
235
234
  }
236
- });
237
- const initParrotI18n = () => {
238
- parrotI18n.init({});
235
+ };
236
+ const parrotI18n = i18next.createInstance(defaultOptions);
237
+ const initParrotI18n = (options, callback) => {
238
+ parrotI18n.init(merge(defaultOptions, options), callback);
239
239
  };
240
240
 
241
241
  exports.initParrotI18n = initParrotI18n;
@@ -6157,7 +6157,7 @@ var drawChart = (function (exports) {
6157
6157
  </script>
6158
6158
  <script>
6159
6159
  /*<!--*/
6160
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"name":"locales","children":[{"name":"en-US","children":[{"uid":"82f7-1","name":"common.json"},{"uid":"82f7-3","name":"components.json"},{"uid":"82f7-5","name":"metric.json"},{"uid":"82f7-7","name":"index.ts"}]},{"name":"zh-CN","children":[{"uid":"82f7-9","name":"common.json"},{"uid":"82f7-11","name":"components.json"},{"uid":"82f7-13","name":"metric.json"},{"uid":"82f7-15","name":"index.ts"}]},{"uid":"82f7-17","name":"index.ts"}]},{"uid":"82f7-19","name":"parrotI18n.ts"},{"uid":"82f7-21","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"82f7-1":{"renderedLength":1363,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-0"},"82f7-3":{"renderedLength":862,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-2"},"82f7-5":{"renderedLength":181,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-4"},"82f7-7":{"renderedLength":98,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-6"},"82f7-9":{"renderedLength":1263,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-8"},"82f7-11":{"renderedLength":810,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-10"},"82f7-13":{"renderedLength":173,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-12"},"82f7-15":{"renderedLength":62,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-14"},"82f7-17":{"renderedLength":67,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-16"},"82f7-19":{"renderedLength":1148,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-18"},"82f7-21":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"82f7-20"}},"nodeMetas":{"82f7-0":{"id":"/src/locales/en-US/common.json","moduleParts":{"index.js":"82f7-1"},"imported":[],"importedBy":[{"uid":"82f7-6"}]},"82f7-2":{"id":"/src/locales/en-US/components.json","moduleParts":{"index.js":"82f7-3"},"imported":[],"importedBy":[{"uid":"82f7-6"}]},"82f7-4":{"id":"/src/locales/en-US/metric.json","moduleParts":{"index.js":"82f7-5"},"imported":[],"importedBy":[{"uid":"82f7-6"}]},"82f7-6":{"id":"/src/locales/en-US/index.ts","moduleParts":{"index.js":"82f7-7"},"imported":[{"uid":"82f7-0"},{"uid":"82f7-2"},{"uid":"82f7-4"}],"importedBy":[{"uid":"82f7-16"}]},"82f7-8":{"id":"/src/locales/zh-CN/common.json","moduleParts":{"index.js":"82f7-9"},"imported":[],"importedBy":[{"uid":"82f7-14"}]},"82f7-10":{"id":"/src/locales/zh-CN/components.json","moduleParts":{"index.js":"82f7-11"},"imported":[],"importedBy":[{"uid":"82f7-14"}]},"82f7-12":{"id":"/src/locales/zh-CN/metric.json","moduleParts":{"index.js":"82f7-13"},"imported":[],"importedBy":[{"uid":"82f7-14"}]},"82f7-14":{"id":"/src/locales/zh-CN/index.ts","moduleParts":{"index.js":"82f7-15"},"imported":[{"uid":"82f7-8"},{"uid":"82f7-10"},{"uid":"82f7-12"}],"importedBy":[{"uid":"82f7-16"}]},"82f7-16":{"id":"/src/locales/index.ts","moduleParts":{"index.js":"82f7-17"},"imported":[{"uid":"82f7-6"},{"uid":"82f7-14"}],"importedBy":[{"uid":"82f7-20"},{"uid":"82f7-18"}]},"82f7-18":{"id":"/src/parrotI18n.ts","moduleParts":{"index.js":"82f7-19"},"imported":[{"uid":"82f7-22"},{"uid":"82f7-16"}],"importedBy":[{"uid":"82f7-20"}]},"82f7-20":{"id":"/src/index.ts","moduleParts":{"index.js":"82f7-21"},"imported":[{"uid":"82f7-16"},{"uid":"82f7-18"}],"importedBy":[],"isEntry":true},"82f7-22":{"id":"i18next","moduleParts":{},"imported":[],"importedBy":[{"uid":"82f7-18"}],"isExternal":true}},"env":{"rollup":"3.12.1"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
6160
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"name":"locales","children":[{"name":"en-US","children":[{"uid":"a298-1","name":"common.json"},{"uid":"a298-3","name":"components.json"},{"uid":"a298-5","name":"metric.json"},{"uid":"a298-7","name":"index.ts"}]},{"name":"zh-CN","children":[{"uid":"a298-9","name":"common.json"},{"uid":"a298-11","name":"components.json"},{"uid":"a298-13","name":"metric.json"},{"uid":"a298-15","name":"index.ts"}]},{"uid":"a298-17","name":"index.ts"}]},{"uid":"a298-19","name":"parrotI18n.ts"},{"uid":"a298-21","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"a298-1":{"renderedLength":1363,"gzipLength":0,"brotliLength":0,"metaUid":"a298-0"},"a298-3":{"renderedLength":862,"gzipLength":0,"brotliLength":0,"metaUid":"a298-2"},"a298-5":{"renderedLength":181,"gzipLength":0,"brotliLength":0,"metaUid":"a298-4"},"a298-7":{"renderedLength":98,"gzipLength":0,"brotliLength":0,"metaUid":"a298-6"},"a298-9":{"renderedLength":1263,"gzipLength":0,"brotliLength":0,"metaUid":"a298-8"},"a298-11":{"renderedLength":810,"gzipLength":0,"brotliLength":0,"metaUid":"a298-10"},"a298-13":{"renderedLength":173,"gzipLength":0,"brotliLength":0,"metaUid":"a298-12"},"a298-15":{"renderedLength":62,"gzipLength":0,"brotliLength":0,"metaUid":"a298-14"},"a298-17":{"renderedLength":67,"gzipLength":0,"brotliLength":0,"metaUid":"a298-16"},"a298-19":{"renderedLength":1227,"gzipLength":0,"brotliLength":0,"metaUid":"a298-18"},"a298-21":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"a298-20"}},"nodeMetas":{"a298-0":{"id":"/src/locales/en-US/common.json","moduleParts":{"index.js":"a298-1"},"imported":[],"importedBy":[{"uid":"a298-6"}]},"a298-2":{"id":"/src/locales/en-US/components.json","moduleParts":{"index.js":"a298-3"},"imported":[],"importedBy":[{"uid":"a298-6"}]},"a298-4":{"id":"/src/locales/en-US/metric.json","moduleParts":{"index.js":"a298-5"},"imported":[],"importedBy":[{"uid":"a298-6"}]},"a298-6":{"id":"/src/locales/en-US/index.ts","moduleParts":{"index.js":"a298-7"},"imported":[{"uid":"a298-0"},{"uid":"a298-2"},{"uid":"a298-4"}],"importedBy":[{"uid":"a298-16"}]},"a298-8":{"id":"/src/locales/zh-CN/common.json","moduleParts":{"index.js":"a298-9"},"imported":[],"importedBy":[{"uid":"a298-14"}]},"a298-10":{"id":"/src/locales/zh-CN/components.json","moduleParts":{"index.js":"a298-11"},"imported":[],"importedBy":[{"uid":"a298-14"}]},"a298-12":{"id":"/src/locales/zh-CN/metric.json","moduleParts":{"index.js":"a298-13"},"imported":[],"importedBy":[{"uid":"a298-14"}]},"a298-14":{"id":"/src/locales/zh-CN/index.ts","moduleParts":{"index.js":"a298-15"},"imported":[{"uid":"a298-8"},{"uid":"a298-10"},{"uid":"a298-12"}],"importedBy":[{"uid":"a298-16"}]},"a298-16":{"id":"/src/locales/index.ts","moduleParts":{"index.js":"a298-17"},"imported":[{"uid":"a298-6"},{"uid":"a298-14"}],"importedBy":[{"uid":"a298-20"},{"uid":"a298-18"}]},"a298-18":{"id":"/src/parrotI18n.ts","moduleParts":{"index.js":"a298-19"},"imported":[{"uid":"a298-22"},{"uid":"a298-23"},{"uid":"a298-16"}],"importedBy":[{"uid":"a298-20"}]},"a298-20":{"id":"/src/index.ts","moduleParts":{"index.js":"a298-21"},"imported":[{"uid":"a298-16"},{"uid":"a298-18"}],"importedBy":[],"isEntry":true},"a298-22":{"id":"i18next","moduleParts":{},"imported":[],"importedBy":[{"uid":"a298-18"}],"isExternal":true},"a298-23":{"id":"lodash.merge","moduleParts":{},"imported":[],"importedBy":[{"uid":"a298-18"}],"isExternal":true}},"env":{"rollup":"3.15.0"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
6161
6161
 
6162
6162
  const run = () => {
6163
6163
  const width = window.innerWidth;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudtower/parrot",
3
- "version": "0.19.2",
3
+ "version": "0.20.0",
4
4
  "description": "i18n modules for cloudtower sparrow and eagle",
5
5
  "keywords": [
6
6
  "i18n",
@@ -22,10 +22,12 @@
22
22
  "lint": "eslint src --ext .ts --quiet"
23
23
  },
24
24
  "dependencies": {
25
- "i18next": "21.10.0"
25
+ "i18next": "21.10.0",
26
+ "lodash.merge": "^4.6.2"
26
27
  },
27
28
  "devDependencies": {
28
29
  "@rollup/plugin-json": "^6.0.0",
30
+ "@types/lodash.merge": "^4.6.7",
29
31
  "ejs": "^3.1.8",
30
32
  "rollup": "^3.12.1",
31
33
  "rollup-plugin-esbuild": "5.0.0",
@@ -33,5 +35,5 @@
33
35
  "rollup-plugin-visualizer": "5.9.0",
34
36
  "typescript": "^4.8.4"
35
37
  },
36
- "gitHead": "e782bae31c2ea4542bf5b398e0c86a7afbdc73c5"
38
+ "gitHead": "e3a803d7fb86a5a26f4eee65e8ac53549fae0919"
37
39
  }