@vocab/core 1.6.4 → 1.6.5-fix-messageformat-import-20250923014407

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.
Files changed (68) hide show
  1. package/dist/chunk-nOFOJqeH.js +30 -0
  2. package/dist/icu-handler-BSMqopEQ.js +29 -0
  3. package/dist/icu-handler-BSMqopEQ.js.map +1 -0
  4. package/dist/icu-handler-ckZzFRyo.mjs +22 -0
  5. package/dist/icu-handler-ckZzFRyo.mjs.map +1 -0
  6. package/dist/icu-handler.d.mts +7 -0
  7. package/dist/icu-handler.d.ts +7 -0
  8. package/dist/icu-handler.js +3 -0
  9. package/dist/icu-handler.mjs +3 -0
  10. package/dist/index.d.mts +53 -0
  11. package/dist/index.d.ts +53 -0
  12. package/dist/index.js +679 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/index.mjs +660 -0
  15. package/dist/index.mjs.map +1 -0
  16. package/dist/runtime.d.mts +8 -0
  17. package/dist/runtime.d.ts +8 -0
  18. package/dist/runtime.js +13 -0
  19. package/dist/runtime.js.map +1 -0
  20. package/dist/runtime.mjs +12 -0
  21. package/dist/runtime.mjs.map +1 -0
  22. package/dist/translation-file-BEIJ1-3N.js +34 -0
  23. package/dist/translation-file-BEIJ1-3N.js.map +1 -0
  24. package/dist/translation-file-CAOIsAU9.d.mts +7 -0
  25. package/dist/translation-file-DQOiWtfV.d.ts +7 -0
  26. package/dist/translation-file-Dn19n2oY.mjs +28 -0
  27. package/dist/translation-file-Dn19n2oY.mjs.map +1 -0
  28. package/dist/translation-file.d.mts +3 -0
  29. package/dist/translation-file.d.ts +3 -0
  30. package/dist/translation-file.js +3 -0
  31. package/dist/translation-file.mjs +3 -0
  32. package/dist/types-DFxEF4pq.d.mts +146 -0
  33. package/dist/types-Di9uIscO.d.ts +146 -0
  34. package/package.json +15 -25
  35. package/README.md +0 -827
  36. package/dist/declarations/src/compile.d.ts +0 -6
  37. package/dist/declarations/src/config.d.ts +0 -4
  38. package/dist/declarations/src/icu-handler.d.ts +0 -2
  39. package/dist/declarations/src/index.d.ts +0 -6
  40. package/dist/declarations/src/load-translations.d.ts +0 -32
  41. package/dist/declarations/src/runtime.d.ts +0 -3
  42. package/dist/declarations/src/translation-file.d.ts +0 -2
  43. package/dist/declarations/src/types.d.ts +0 -143
  44. package/dist/declarations/src/utils.d.ts +0 -26
  45. package/dist/declarations/src/validate/index.d.ts +0 -3
  46. package/dist/vocab-core.cjs.d.ts +0 -2
  47. package/dist/vocab-core.cjs.dev.js +0 -893
  48. package/dist/vocab-core.cjs.js +0 -7
  49. package/dist/vocab-core.cjs.prod.js +0 -893
  50. package/dist/vocab-core.esm.js +0 -866
  51. package/icu-handler/dist/vocab-core-icu-handler.cjs.d.ts +0 -2
  52. package/icu-handler/dist/vocab-core-icu-handler.cjs.dev.js +0 -31
  53. package/icu-handler/dist/vocab-core-icu-handler.cjs.js +0 -7
  54. package/icu-handler/dist/vocab-core-icu-handler.cjs.prod.js +0 -31
  55. package/icu-handler/dist/vocab-core-icu-handler.esm.js +0 -23
  56. package/icu-handler/package.json +0 -4
  57. package/runtime/dist/vocab-core-runtime.cjs.d.ts +0 -2
  58. package/runtime/dist/vocab-core-runtime.cjs.dev.js +0 -15
  59. package/runtime/dist/vocab-core-runtime.cjs.js +0 -7
  60. package/runtime/dist/vocab-core-runtime.cjs.prod.js +0 -15
  61. package/runtime/dist/vocab-core-runtime.esm.js +0 -10
  62. package/runtime/package.json +0 -4
  63. package/translation-file/dist/vocab-core-translation-file.cjs.d.ts +0 -2
  64. package/translation-file/dist/vocab-core-translation-file.cjs.dev.js +0 -35
  65. package/translation-file/dist/vocab-core-translation-file.cjs.js +0 -7
  66. package/translation-file/dist/vocab-core-translation-file.cjs.prod.js +0 -35
  67. package/translation-file/dist/vocab-core-translation-file.esm.js +0 -31
  68. package/translation-file/package.json +0 -4
@@ -1,2 +0,0 @@
1
- export * from "../../dist/declarations/src/icu-handler.js";
2
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidm9jYWItY29yZS1pY3UtaGFuZGxlci5janMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL2Rpc3QvZGVjbGFyYXRpb25zL3NyYy9pY3UtaGFuZGxlci5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=
@@ -1,31 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var IntlMessageFormat = require('intl-messageformat');
6
-
7
- function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
8
-
9
- var IntlMessageFormat__default = /*#__PURE__*/_interopDefault(IntlMessageFormat);
10
-
11
- const moduleCache = new WeakMap();
12
- const getParsedICUMessages = (m, locale) => {
13
- const moduleCachedResult = moduleCache.get(m);
14
- if (moduleCachedResult && moduleCachedResult[locale]) {
15
- return moduleCachedResult[locale];
16
- }
17
- const parsedICUMessages = {};
18
- for (const translation of Object.keys(m)) {
19
- const intlMessageFormat = new IntlMessageFormat__default["default"](m[translation], locale);
20
- parsedICUMessages[translation] = {
21
- format: params => intlMessageFormat.format(params)
22
- };
23
- }
24
- moduleCache.set(m, {
25
- ...moduleCachedResult,
26
- [locale]: parsedICUMessages
27
- });
28
- return parsedICUMessages;
29
- };
30
-
31
- exports.getParsedICUMessages = getParsedICUMessages;
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- if (process.env.NODE_ENV === "production") {
4
- module.exports = require("./vocab-core-icu-handler.cjs.prod.js");
5
- } else {
6
- module.exports = require("./vocab-core-icu-handler.cjs.dev.js");
7
- }
@@ -1,31 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var IntlMessageFormat = require('intl-messageformat');
6
-
7
- function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
8
-
9
- var IntlMessageFormat__default = /*#__PURE__*/_interopDefault(IntlMessageFormat);
10
-
11
- const moduleCache = new WeakMap();
12
- const getParsedICUMessages = (m, locale) => {
13
- const moduleCachedResult = moduleCache.get(m);
14
- if (moduleCachedResult && moduleCachedResult[locale]) {
15
- return moduleCachedResult[locale];
16
- }
17
- const parsedICUMessages = {};
18
- for (const translation of Object.keys(m)) {
19
- const intlMessageFormat = new IntlMessageFormat__default["default"](m[translation], locale);
20
- parsedICUMessages[translation] = {
21
- format: params => intlMessageFormat.format(params)
22
- };
23
- }
24
- moduleCache.set(m, {
25
- ...moduleCachedResult,
26
- [locale]: parsedICUMessages
27
- });
28
- return parsedICUMessages;
29
- };
30
-
31
- exports.getParsedICUMessages = getParsedICUMessages;
@@ -1,23 +0,0 @@
1
- import IntlMessageFormat from 'intl-messageformat';
2
-
3
- const moduleCache = new WeakMap();
4
- const getParsedICUMessages = (m, locale) => {
5
- const moduleCachedResult = moduleCache.get(m);
6
- if (moduleCachedResult && moduleCachedResult[locale]) {
7
- return moduleCachedResult[locale];
8
- }
9
- const parsedICUMessages = {};
10
- for (const translation of Object.keys(m)) {
11
- const intlMessageFormat = new IntlMessageFormat(m[translation], locale);
12
- parsedICUMessages[translation] = {
13
- format: params => intlMessageFormat.format(params)
14
- };
15
- }
16
- moduleCache.set(m, {
17
- ...moduleCachedResult,
18
- [locale]: parsedICUMessages
19
- });
20
- return parsedICUMessages;
21
- };
22
-
23
- export { getParsedICUMessages };
@@ -1,4 +0,0 @@
1
- {
2
- "main": "dist/vocab-core-icu-handler.cjs.js",
3
- "module": "dist/vocab-core-icu-handler.esm.js"
4
- }
@@ -1,2 +0,0 @@
1
- export * from "../../dist/declarations/src/runtime.js";
2
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidm9jYWItY29yZS1ydW50aW1lLmNqcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vZGlzdC9kZWNsYXJhdGlvbnMvc3JjL3J1bnRpbWUuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9
@@ -1,15 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var icuHandler_dist_vocabCoreIcuHandler = require('../../icu-handler/dist/vocab-core-icu-handler.cjs.dev.js');
6
- var translationFile_dist_vocabCoreTranslationFile = require('../../translation-file/dist/vocab-core-translation-file.cjs.dev.js');
7
- require('intl-messageformat');
8
-
9
- const createLanguage = module => ({
10
- getValue: locale => icuHandler_dist_vocabCoreIcuHandler.getParsedICUMessages(module, locale),
11
- load: () => Promise.resolve()
12
- });
13
-
14
- exports.createTranslationFile = translationFile_dist_vocabCoreTranslationFile.createTranslationFile;
15
- exports.createLanguage = createLanguage;
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- if (process.env.NODE_ENV === "production") {
4
- module.exports = require("./vocab-core-runtime.cjs.prod.js");
5
- } else {
6
- module.exports = require("./vocab-core-runtime.cjs.dev.js");
7
- }
@@ -1,15 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var icuHandler_dist_vocabCoreIcuHandler = require('../../icu-handler/dist/vocab-core-icu-handler.cjs.prod.js');
6
- var translationFile_dist_vocabCoreTranslationFile = require('../../translation-file/dist/vocab-core-translation-file.cjs.prod.js');
7
- require('intl-messageformat');
8
-
9
- const createLanguage = module => ({
10
- getValue: locale => icuHandler_dist_vocabCoreIcuHandler.getParsedICUMessages(module, locale),
11
- load: () => Promise.resolve()
12
- });
13
-
14
- exports.createTranslationFile = translationFile_dist_vocabCoreTranslationFile.createTranslationFile;
15
- exports.createLanguage = createLanguage;
@@ -1,10 +0,0 @@
1
- import { getParsedICUMessages } from '../../icu-handler/dist/vocab-core-icu-handler.esm.js';
2
- export { createTranslationFile } from '../../translation-file/dist/vocab-core-translation-file.esm.js';
3
- import 'intl-messageformat';
4
-
5
- const createLanguage = module => ({
6
- getValue: locale => getParsedICUMessages(module, locale),
7
- load: () => Promise.resolve()
8
- });
9
-
10
- export { createLanguage };
@@ -1,4 +0,0 @@
1
- {
2
- "main": "dist/vocab-core-runtime.cjs.js",
3
- "module": "dist/vocab-core-runtime.esm.js"
4
- }
@@ -1,2 +0,0 @@
1
- export * from "../../dist/declarations/src/translation-file.js";
2
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidm9jYWItY29yZS10cmFuc2xhdGlvbi1maWxlLmNqcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vZGlzdC9kZWNsYXJhdGlvbnMvc3JjL3RyYW5zbGF0aW9uLWZpbGUuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9
@@ -1,35 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- function createTranslationFile(translationsByLanguage) {
6
- function getByLanguage(language) {
7
- const translationModule = translationsByLanguage[language];
8
- if (!translationModule) {
9
- throw new Error(`Attempted to retrieve translations for unknown language "${language}"`);
10
- }
11
- return translationModule;
12
- }
13
- return {
14
- getLoadedMessages(language, locale) {
15
- const translationModule = getByLanguage(language);
16
- return translationModule.getValue(locale || language) || null;
17
- },
18
- getMessages(language, locale) {
19
- const translationModule = getByLanguage(language);
20
- return translationModule.load().then(() => {
21
- const result = translationModule.getValue(locale || language);
22
- if (!result) {
23
- throw new Error(`Unable to find translations for ${language} after attempting to load. Module may have failed to load or an internal error may have occurred.`);
24
- }
25
- return result;
26
- });
27
- },
28
- load(language) {
29
- const translationModule = getByLanguage(language);
30
- return translationModule.load();
31
- }
32
- };
33
- }
34
-
35
- exports.createTranslationFile = createTranslationFile;
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- if (process.env.NODE_ENV === "production") {
4
- module.exports = require("./vocab-core-translation-file.cjs.prod.js");
5
- } else {
6
- module.exports = require("./vocab-core-translation-file.cjs.dev.js");
7
- }
@@ -1,35 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- function createTranslationFile(translationsByLanguage) {
6
- function getByLanguage(language) {
7
- const translationModule = translationsByLanguage[language];
8
- if (!translationModule) {
9
- throw new Error(`Attempted to retrieve translations for unknown language "${language}"`);
10
- }
11
- return translationModule;
12
- }
13
- return {
14
- getLoadedMessages(language, locale) {
15
- const translationModule = getByLanguage(language);
16
- return translationModule.getValue(locale || language) || null;
17
- },
18
- getMessages(language, locale) {
19
- const translationModule = getByLanguage(language);
20
- return translationModule.load().then(() => {
21
- const result = translationModule.getValue(locale || language);
22
- if (!result) {
23
- throw new Error(`Unable to find translations for ${language} after attempting to load. Module may have failed to load or an internal error may have occurred.`);
24
- }
25
- return result;
26
- });
27
- },
28
- load(language) {
29
- const translationModule = getByLanguage(language);
30
- return translationModule.load();
31
- }
32
- };
33
- }
34
-
35
- exports.createTranslationFile = createTranslationFile;
@@ -1,31 +0,0 @@
1
- function createTranslationFile(translationsByLanguage) {
2
- function getByLanguage(language) {
3
- const translationModule = translationsByLanguage[language];
4
- if (!translationModule) {
5
- throw new Error(`Attempted to retrieve translations for unknown language "${language}"`);
6
- }
7
- return translationModule;
8
- }
9
- return {
10
- getLoadedMessages(language, locale) {
11
- const translationModule = getByLanguage(language);
12
- return translationModule.getValue(locale || language) || null;
13
- },
14
- getMessages(language, locale) {
15
- const translationModule = getByLanguage(language);
16
- return translationModule.load().then(() => {
17
- const result = translationModule.getValue(locale || language);
18
- if (!result) {
19
- throw new Error(`Unable to find translations for ${language} after attempting to load. Module may have failed to load or an internal error may have occurred.`);
20
- }
21
- return result;
22
- });
23
- },
24
- load(language) {
25
- const translationModule = getByLanguage(language);
26
- return translationModule.load();
27
- }
28
- };
29
- }
30
-
31
- export { createTranslationFile };
@@ -1,4 +0,0 @@
1
- {
2
- "main": "dist/vocab-core-translation-file.cjs.js",
3
- "module": "dist/vocab-core-translation-file.esm.js"
4
- }