@intlayer/core 5.8.1-canary.0 → 6.0.0-canary.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.
Files changed (118) hide show
  1. package/dist/cjs/deepTranformPlugins/getFilterTranslationsOnlyContent.cjs +130 -0
  2. package/dist/cjs/deepTranformPlugins/getFilterTranslationsOnlyContent.cjs.map +1 -0
  3. package/dist/cjs/deepTranformPlugins/getFilteredLocalesContent.cjs +62 -0
  4. package/dist/cjs/deepTranformPlugins/getFilteredLocalesContent.cjs.map +1 -0
  5. package/dist/cjs/{interpreter/getContent → deepTranformPlugins}/getLocalisedContent.cjs +3 -3
  6. package/dist/cjs/deepTranformPlugins/getLocalisedContent.cjs.map +1 -0
  7. package/dist/cjs/deepTranformPlugins/getMissingLocalesContent.cjs +78 -0
  8. package/dist/cjs/deepTranformPlugins/getMissingLocalesContent.cjs.map +1 -0
  9. package/dist/cjs/deepTranformPlugins/getReplacedValuesContent.cjs +82 -0
  10. package/dist/cjs/deepTranformPlugins/getReplacedValuesContent.cjs.map +1 -0
  11. package/dist/cjs/deepTranformPlugins/index.cjs +31 -0
  12. package/dist/cjs/deepTranformPlugins/index.cjs.map +1 -0
  13. package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs +1 -1
  14. package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs.map +1 -1
  15. package/dist/cjs/dictionaryManipulator/getUnmergedDictionaryByKeyPath.cjs +52 -0
  16. package/dist/cjs/dictionaryManipulator/getUnmergedDictionaryByKeyPath.cjs.map +1 -0
  17. package/dist/cjs/dictionaryManipulator/index.cjs +9 -7
  18. package/dist/cjs/dictionaryManipulator/index.cjs.map +1 -1
  19. package/dist/cjs/index.cjs +2 -0
  20. package/dist/cjs/index.cjs.map +1 -1
  21. package/dist/cjs/interpreter/getContent/index.cjs +0 -2
  22. package/dist/cjs/interpreter/getContent/index.cjs.map +1 -1
  23. package/dist/cjs/interpreter/getContent/plugins.cjs +1 -1
  24. package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -1
  25. package/dist/cjs/interpreter/getIntlayer.cjs.map +1 -1
  26. package/dist/cjs/interpreter/getTranslation.cjs +3 -15
  27. package/dist/cjs/interpreter/getTranslation.cjs.map +1 -1
  28. package/dist/cjs/transpiler/enumeration/enumeration.cjs.map +1 -1
  29. package/dist/cjs/transpiler/file/file.cjs +4 -1
  30. package/dist/cjs/transpiler/file/file.cjs.map +1 -1
  31. package/dist/cjs/types/dictionary.cjs.map +1 -1
  32. package/dist/cjs/types/intlayer.cjs +35 -0
  33. package/dist/cjs/types/intlayer.cjs.map +1 -0
  34. package/dist/cjs/types/translation.cjs.map +1 -1
  35. package/dist/cjs/utils/intl.cjs +2 -15
  36. package/dist/cjs/utils/intl.cjs.map +1 -1
  37. package/dist/esm/deepTranformPlugins/getFilterTranslationsOnlyContent.mjs +95 -0
  38. package/dist/esm/deepTranformPlugins/getFilterTranslationsOnlyContent.mjs.map +1 -0
  39. package/dist/esm/deepTranformPlugins/getFilteredLocalesContent.mjs +40 -0
  40. package/dist/esm/deepTranformPlugins/getFilteredLocalesContent.mjs.map +1 -0
  41. package/dist/esm/{interpreter/getContent → deepTranformPlugins}/getLocalisedContent.mjs +3 -3
  42. package/dist/esm/deepTranformPlugins/getLocalisedContent.mjs.map +1 -0
  43. package/dist/esm/deepTranformPlugins/getMissingLocalesContent.mjs +43 -0
  44. package/dist/esm/deepTranformPlugins/getMissingLocalesContent.mjs.map +1 -0
  45. package/dist/esm/deepTranformPlugins/getReplacedValuesContent.mjs +60 -0
  46. package/dist/esm/deepTranformPlugins/getReplacedValuesContent.mjs.map +1 -0
  47. package/dist/esm/deepTranformPlugins/index.mjs +6 -0
  48. package/dist/esm/deepTranformPlugins/index.mjs.map +1 -0
  49. package/dist/esm/dictionaryManipulator/getNodeChildren.mjs +1 -1
  50. package/dist/esm/dictionaryManipulator/getNodeChildren.mjs.map +1 -1
  51. package/dist/esm/dictionaryManipulator/getUnmergedDictionaryByKeyPath.mjs +18 -0
  52. package/dist/esm/dictionaryManipulator/getUnmergedDictionaryByKeyPath.mjs.map +1 -0
  53. package/dist/esm/dictionaryManipulator/index.mjs +4 -3
  54. package/dist/esm/dictionaryManipulator/index.mjs.map +1 -1
  55. package/dist/esm/index.mjs +1 -0
  56. package/dist/esm/index.mjs.map +1 -1
  57. package/dist/esm/interpreter/getContent/index.mjs +0 -1
  58. package/dist/esm/interpreter/getContent/index.mjs.map +1 -1
  59. package/dist/esm/interpreter/getContent/plugins.mjs +1 -1
  60. package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -1
  61. package/dist/esm/interpreter/getIntlayer.mjs.map +1 -1
  62. package/dist/esm/interpreter/getTranslation.mjs +3 -5
  63. package/dist/esm/interpreter/getTranslation.mjs.map +1 -1
  64. package/dist/esm/transpiler/enumeration/enumeration.mjs.map +1 -1
  65. package/dist/esm/transpiler/file/file.mjs +5 -2
  66. package/dist/esm/transpiler/file/file.mjs.map +1 -1
  67. package/dist/esm/types/intlayer.mjs +13 -0
  68. package/dist/esm/types/intlayer.mjs.map +1 -0
  69. package/dist/esm/utils/intl.mjs +2 -5
  70. package/dist/esm/utils/intl.mjs.map +1 -1
  71. package/dist/types/deepTranformPlugins/getFilterTranslationsOnlyContent.d.ts +13 -0
  72. package/dist/types/deepTranformPlugins/getFilterTranslationsOnlyContent.d.ts.map +1 -0
  73. package/dist/types/deepTranformPlugins/getFilterTranslationsOnlyContent.test.d.ts +2 -0
  74. package/dist/types/deepTranformPlugins/getFilterTranslationsOnlyContent.test.d.ts.map +1 -0
  75. package/dist/types/deepTranformPlugins/getFilteredLocalesContent.d.ts +5 -0
  76. package/dist/types/deepTranformPlugins/getFilteredLocalesContent.d.ts.map +1 -0
  77. package/dist/types/{interpreter/getContent → deepTranformPlugins}/getLocalisedContent.d.ts +3 -3
  78. package/dist/types/deepTranformPlugins/getLocalisedContent.d.ts.map +1 -0
  79. package/dist/types/deepTranformPlugins/getMissingLocalesContent.d.ts +13 -0
  80. package/dist/types/deepTranformPlugins/getMissingLocalesContent.d.ts.map +1 -0
  81. package/dist/types/deepTranformPlugins/getMissingLocalesContent.test.d.ts +2 -0
  82. package/dist/types/deepTranformPlugins/getMissingLocalesContent.test.d.ts.map +1 -0
  83. package/dist/types/deepTranformPlugins/getReplacedValuesContent.d.ts +4 -0
  84. package/dist/types/deepTranformPlugins/getReplacedValuesContent.d.ts.map +1 -0
  85. package/dist/types/deepTranformPlugins/getReplacedValuesContent.test.d.ts +2 -0
  86. package/dist/types/deepTranformPlugins/getReplacedValuesContent.test.d.ts.map +1 -0
  87. package/dist/types/deepTranformPlugins/index.d.ts +6 -0
  88. package/dist/types/deepTranformPlugins/index.d.ts.map +1 -0
  89. package/dist/types/dictionaryManipulator/getNodeChildren.d.ts.map +1 -1
  90. package/dist/types/dictionaryManipulator/getUnmergedDictionaryByKeyPath.d.ts +4 -0
  91. package/dist/types/dictionaryManipulator/getUnmergedDictionaryByKeyPath.d.ts.map +1 -0
  92. package/dist/types/dictionaryManipulator/index.d.ts +4 -3
  93. package/dist/types/dictionaryManipulator/index.d.ts.map +1 -1
  94. package/dist/types/index.d.ts +1 -0
  95. package/dist/types/index.d.ts.map +1 -1
  96. package/dist/types/interpreter/getContent/index.d.ts +0 -1
  97. package/dist/types/interpreter/getContent/index.d.ts.map +1 -1
  98. package/dist/types/interpreter/getContent/plugins.d.ts +1 -1
  99. package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
  100. package/dist/types/interpreter/getIntlayer.d.ts +1 -1
  101. package/dist/types/interpreter/getIntlayer.d.ts.map +1 -1
  102. package/dist/types/interpreter/getTranslation.d.ts +1 -1
  103. package/dist/types/interpreter/getTranslation.d.ts.map +1 -1
  104. package/dist/types/transpiler/enumeration/enumeration.d.ts +3 -3
  105. package/dist/types/transpiler/enumeration/enumeration.d.ts.map +1 -1
  106. package/dist/types/transpiler/file/file.d.ts.map +1 -1
  107. package/dist/types/types/dictionary.d.ts +252 -2
  108. package/dist/types/types/dictionary.d.ts.map +1 -1
  109. package/dist/types/types/intlayer.d.ts +5 -0
  110. package/dist/types/types/intlayer.d.ts.map +1 -0
  111. package/dist/types/types/translation.d.ts +1 -2
  112. package/dist/types/types/translation.d.ts.map +1 -1
  113. package/dist/types/utils/intl.d.ts +1 -1
  114. package/dist/types/utils/intl.d.ts.map +1 -1
  115. package/package.json +13 -11
  116. package/dist/cjs/interpreter/getContent/getLocalisedContent.cjs.map +0 -1
  117. package/dist/esm/interpreter/getContent/getLocalisedContent.mjs.map +0 -1
  118. package/dist/types/interpreter/getContent/getLocalisedContent.d.ts.map +0 -1
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var getFilterTranslationsOnlyContent_exports = {};
30
+ __export(getFilterTranslationsOnlyContent_exports, {
31
+ filterTranslationsOnlyPlugin: () => filterTranslationsOnlyPlugin,
32
+ getFilterTranslationsOnlyContent: () => getFilterTranslationsOnlyContent
33
+ });
34
+ module.exports = __toCommonJS(getFilterTranslationsOnlyContent_exports);
35
+ var import_built = __toESM(require("@intlayer/config/built"));
36
+ var import_interpreter = require('../interpreter/index.cjs');
37
+ var import_deepTransform = require('../interpreter/getContent/deepTransform.cjs');
38
+ var import_types = require('../types/index.cjs');
39
+ const hasTranslationNodes = (node) => {
40
+ if (typeof node !== "object" || node === null) {
41
+ return false;
42
+ }
43
+ if (node?.nodeType === import_types.NodeType.Translation) {
44
+ return true;
45
+ }
46
+ if (Array.isArray(node)) {
47
+ return node.some(hasTranslationNodes);
48
+ }
49
+ return Object.values(node).some(hasTranslationNodes);
50
+ };
51
+ const filterTranslationsOnlyPlugin = (locale, fallback) => ({
52
+ id: "filter-translations-only-plugin",
53
+ canHandle: (node) => {
54
+ return typeof node === "object" && node !== null;
55
+ },
56
+ transform: (node, props, deepTransformNode2) => {
57
+ if (typeof node === "object" && node?.nodeType === import_types.NodeType.Translation) {
58
+ const result = structuredClone(
59
+ node[import_types.NodeType.Translation]
60
+ );
61
+ for (const key in result) {
62
+ const childProps = {
63
+ ...props,
64
+ children: result[key],
65
+ keyPath: [
66
+ ...props.keyPath,
67
+ { type: import_types.NodeType.Translation, key }
68
+ ]
69
+ };
70
+ result[key] = deepTransformNode2(
71
+ result[key],
72
+ {
73
+ ...childProps,
74
+ plugins: [
75
+ ...(props.plugins ?? []).filter(
76
+ (plugin) => plugin.id !== "filter-translations-only-plugin"
77
+ )
78
+ ]
79
+ }
80
+ );
81
+ }
82
+ return (0, import_interpreter.getTranslation)(result, locale, fallback);
83
+ } else if (typeof node === "object" && node !== null && !Array.isArray(node) && !node?.nodeType) {
84
+ const result = {};
85
+ for (const key in node) {
86
+ if (hasTranslationNodes(node[key])) {
87
+ const childProps = {
88
+ ...props,
89
+ children: node[key],
90
+ keyPath: [
91
+ ...props.keyPath,
92
+ { type: import_types.NodeType.Object, key }
93
+ ]
94
+ };
95
+ result[key] = deepTransformNode2(node[key], childProps);
96
+ }
97
+ }
98
+ return result;
99
+ } else if (Array.isArray(node)) {
100
+ return node.map((child, index) => {
101
+ const childProps = {
102
+ ...props,
103
+ children: child,
104
+ keyPath: [
105
+ ...props.keyPath,
106
+ { type: import_types.NodeType.Array, key: index }
107
+ ]
108
+ };
109
+ return deepTransformNode2(child, childProps);
110
+ });
111
+ }
112
+ return "to remove from the object";
113
+ }
114
+ });
115
+ const getFilterTranslationsOnlyContent = (node, locale = import_built.default?.internationalization.defaultLocale, nodeProps, fallback) => {
116
+ const plugins = [
117
+ filterTranslationsOnlyPlugin(locale, fallback),
118
+ ...nodeProps.plugins ?? []
119
+ ];
120
+ return (0, import_deepTransform.deepTransformNode)(node, {
121
+ ...nodeProps,
122
+ plugins
123
+ });
124
+ };
125
+ // Annotate the CommonJS export names for ESM import in node:
126
+ 0 && (module.exports = {
127
+ filterTranslationsOnlyPlugin,
128
+ getFilterTranslationsOnlyContent
129
+ });
130
+ //# sourceMappingURL=getFilterTranslationsOnlyContent.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/deepTranformPlugins/getFilterTranslationsOnlyContent.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { Locales, LocalesValues } from '@intlayer/config/client';\nimport { getTranslation } from '../interpreter';\nimport { deepTransformNode } from '../interpreter/getContent/deepTransform';\nimport {\n type DeepTransformContent,\n type NodeProps,\n type Plugins,\n} from '../interpreter/getContent/plugins';\nimport { TranslationContent } from '../transpiler';\nimport { KeyPath, NodeType, type ContentNode } from '../types';\n\n/**\n * Helper function to check if a node or its children contain translation nodes\n */\nconst hasTranslationNodes = (node: any): boolean => {\n if (typeof node !== 'object' || node === null) {\n return false;\n }\n\n if (node?.nodeType === NodeType.Translation) {\n return true;\n }\n\n if (Array.isArray(node)) {\n return node.some(hasTranslationNodes);\n }\n\n return Object.values(node).some(hasTranslationNodes);\n};\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const filterTranslationsOnlyPlugin = (\n locale: LocalesValues,\n fallback?: LocalesValues\n): Plugins => ({\n id: 'filter-translations-only-plugin',\n canHandle: (node: ContentNode) => {\n // Only handle objects and arrays, not primitives\n return typeof node === 'object' && node !== null;\n },\n transform: (node: ContentNode, props, deepTransformNode) => {\n if (typeof node === 'object' && node?.nodeType === NodeType.Translation) {\n const result = structuredClone(\n (node as TranslationContent)[NodeType.Translation]\n );\n\n for (const key in result) {\n const childProps = {\n ...props,\n children: result[key as unknown as keyof typeof result],\n keyPath: [\n ...props.keyPath,\n { type: NodeType.Translation, key } as KeyPath,\n ],\n };\n result[key as unknown as keyof typeof result] = deepTransformNode(\n result[key as unknown as keyof typeof result],\n {\n ...childProps,\n plugins: [\n ...(props.plugins ?? ([] as Plugins[])).filter(\n (plugin) => plugin.id !== 'filter-translations-only-plugin'\n ),\n ],\n }\n );\n }\n return getTranslation(result, locale, fallback);\n } else if (\n typeof node === 'object' &&\n node !== null &&\n !Array.isArray(node) &&\n !node?.nodeType\n ) {\n // For regular objects, filter out properties that don't contain translations\n const result: Record<string, any> = {};\n for (const key in node as any) {\n if (hasTranslationNodes(node[key])) {\n const childProps = {\n ...props,\n children: node[key],\n keyPath: [\n ...props.keyPath,\n { type: NodeType.Object, key } as KeyPath,\n ],\n };\n result[key] = deepTransformNode(node[key], childProps);\n }\n }\n return result;\n } else if (Array.isArray(node)) {\n // For arrays, keep all items but transform them\n return node.map((child, index) => {\n const childProps = {\n ...props,\n children: child,\n keyPath: [\n ...props.keyPath,\n { type: NodeType.Array, key: index } as KeyPath,\n ],\n };\n return deepTransformNode(child, childProps);\n });\n }\n\n return 'to remove from the object';\n },\n});\n\n/**\n * Return the content of a node with only the translation plugin.\n *\n * @param node The node to transform.\n * @param locale The locale to use if your transformers need it (e.g. for translations).\n */\nexport const getFilterTranslationsOnlyContent = <\n T extends ContentNode,\n L extends LocalesValues = Locales,\n>(\n node: T,\n locale: L = configuration?.internationalization.defaultLocale as L,\n nodeProps: NodeProps,\n fallback?: LocalesValues\n) => {\n const plugins: Plugins[] = [\n filterTranslationsOnlyPlugin(locale, fallback),\n ...(nodeProps.plugins ?? []),\n ];\n\n return deepTransformNode(node, {\n ...nodeProps,\n plugins,\n }) as DeepTransformContent<T>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B;AAE1B,yBAA+B;AAC/B,2BAAkC;AAOlC,mBAAoD;AAKpD,MAAM,sBAAsB,CAAC,SAAuB;AAClD,MAAI,OAAO,SAAS,YAAY,SAAS,MAAM;AAC7C,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,aAAa,sBAAS,aAAa;AAC3C,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,WAAO,KAAK,KAAK,mBAAmB;AAAA,EACtC;AAEA,SAAO,OAAO,OAAO,IAAI,EAAE,KAAK,mBAAmB;AACrD;AAGO,MAAM,+BAA+B,CAC1C,QACA,cACa;AAAA,EACb,IAAI;AAAA,EACJ,WAAW,CAAC,SAAsB;AAEhC,WAAO,OAAO,SAAS,YAAY,SAAS;AAAA,EAC9C;AAAA,EACA,WAAW,CAAC,MAAmB,OAAOA,uBAAsB;AAC1D,QAAI,OAAO,SAAS,YAAY,MAAM,aAAa,sBAAS,aAAa;AACvE,YAAM,SAAS;AAAA,QACZ,KAA4B,sBAAS,WAAW;AAAA,MACnD;AAEA,iBAAW,OAAO,QAAQ;AACxB,cAAM,aAAa;AAAA,UACjB,GAAG;AAAA,UACH,UAAU,OAAO,GAAqC;AAAA,UACtD,SAAS;AAAA,YACP,GAAG,MAAM;AAAA,YACT,EAAE,MAAM,sBAAS,aAAa,IAAI;AAAA,UACpC;AAAA,QACF;AACA,eAAO,GAAqC,IAAIA;AAAA,UAC9C,OAAO,GAAqC;AAAA,UAC5C;AAAA,YACE,GAAG;AAAA,YACH,SAAS;AAAA,cACP,IAAI,MAAM,WAAY,CAAC,GAAiB;AAAA,gBACtC,CAAC,WAAW,OAAO,OAAO;AAAA,cAC5B;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AACA,iBAAO,mCAAe,QAAQ,QAAQ,QAAQ;AAAA,IAChD,WACE,OAAO,SAAS,YAChB,SAAS,QACT,CAAC,MAAM,QAAQ,IAAI,KACnB,CAAC,MAAM,UACP;AAEA,YAAM,SAA8B,CAAC;AACrC,iBAAW,OAAO,MAAa;AAC7B,YAAI,oBAAoB,KAAK,GAAG,CAAC,GAAG;AAClC,gBAAM,aAAa;AAAA,YACjB,GAAG;AAAA,YACH,UAAU,KAAK,GAAG;AAAA,YAClB,SAAS;AAAA,cACP,GAAG,MAAM;AAAA,cACT,EAAE,MAAM,sBAAS,QAAQ,IAAI;AAAA,YAC/B;AAAA,UACF;AACA,iBAAO,GAAG,IAAIA,mBAAkB,KAAK,GAAG,GAAG,UAAU;AAAA,QACvD;AAAA,MACF;AACA,aAAO;AAAA,IACT,WAAW,MAAM,QAAQ,IAAI,GAAG;AAE9B,aAAO,KAAK,IAAI,CAAC,OAAO,UAAU;AAChC,cAAM,aAAa;AAAA,UACjB,GAAG;AAAA,UACH,UAAU;AAAA,UACV,SAAS;AAAA,YACP,GAAG,MAAM;AAAA,YACT,EAAE,MAAM,sBAAS,OAAO,KAAK,MAAM;AAAA,UACrC;AAAA,QACF;AACA,eAAOA,mBAAkB,OAAO,UAAU;AAAA,MAC5C,CAAC;AAAA,IACH;AAEA,WAAO;AAAA,EACT;AACF;AAQO,MAAM,mCAAmC,CAI9C,MACA,SAAY,aAAAC,SAAe,qBAAqB,eAChD,WACA,aACG;AACH,QAAM,UAAqB;AAAA,IACzB,6BAA6B,QAAQ,QAAQ;AAAA,IAC7C,GAAI,UAAU,WAAW,CAAC;AAAA,EAC5B;AAEA,aAAO,wCAAkB,MAAM;AAAA,IAC7B,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;","names":["deepTransformNode","configuration"]}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var getFilteredLocalesContent_exports = {};
20
+ __export(getFilteredLocalesContent_exports, {
21
+ getFilteredLocalesContent: () => getFilteredLocalesContent
22
+ });
23
+ module.exports = __toCommonJS(getFilteredLocalesContent_exports);
24
+ var import_interpreter = require('../interpreter/index.cjs');
25
+ var import_types = require('../types/index.cjs');
26
+ const filterTranlationsPlugin = (locales) => ({
27
+ id: "filter-translations-plugin",
28
+ canHandle: (node) => typeof node === "object" && node?.nodeType === import_types.NodeType.Translation,
29
+ transform: (node, props, deepTransformNode2) => {
30
+ const translationMap = node.translation;
31
+ const filteredTranslationMap = Object.fromEntries(
32
+ Object.entries(translationMap).filter(
33
+ ([key]) => locales.includes(key)
34
+ )
35
+ );
36
+ return {
37
+ ...node,
38
+ translation: deepTransformNode2(filteredTranslationMap, {
39
+ ...props,
40
+ keyPath: [
41
+ ...props.keyPath,
42
+ { type: import_types.NodeType.Object, key: import_types.NodeType.Translation }
43
+ ]
44
+ })
45
+ };
46
+ }
47
+ });
48
+ const getFilteredLocalesContent = (node, locale, nodeProps) => {
49
+ const plugins = [
50
+ filterTranlationsPlugin(locale),
51
+ ...nodeProps.plugins ?? []
52
+ ];
53
+ return (0, import_interpreter.deepTransformNode)(node, {
54
+ ...nodeProps,
55
+ plugins
56
+ });
57
+ };
58
+ // Annotate the CommonJS export names for ESM import in node:
59
+ 0 && (module.exports = {
60
+ getFilteredLocalesContent
61
+ });
62
+ //# sourceMappingURL=getFilteredLocalesContent.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/deepTranformPlugins/getFilteredLocalesContent.ts"],"sourcesContent":["import type { Locales, LocalesValues } from '@intlayer/config/client';\nimport {\n type NodeProps,\n type Plugins,\n deepTransformNode,\n} from '../interpreter';\nimport { type ContentNode, NodeType } from '../types';\n\nconst filterTranlationsPlugin = (\n locales: LocalesValues[] | LocalesValues\n): Plugins => ({\n id: 'filter-translations-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Translation,\n transform: (node, props, deepTransformNode) => {\n const translationMap = node.translation as Record<Locales, string>;\n\n const filteredTranslationMap = Object.fromEntries(\n Object.entries(translationMap).filter(([key]) =>\n locales.includes(key as Locales)\n )\n );\n\n return {\n ...node,\n translation: deepTransformNode(filteredTranslationMap, {\n ...props,\n keyPath: [\n ...props.keyPath,\n { type: NodeType.Object, key: NodeType.Translation },\n ],\n }),\n };\n },\n});\n\nexport const getFilteredLocalesContent = (\n node: ContentNode,\n locale: LocalesValues | LocalesValues[],\n nodeProps: NodeProps\n) => {\n const plugins: Plugins[] = [\n filterTranlationsPlugin(locale),\n ...(nodeProps.plugins ?? []),\n ];\n\n return deepTransformNode(node, {\n ...nodeProps,\n plugins,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,yBAIO;AACP,mBAA2C;AAE3C,MAAM,0BAA0B,CAC9B,aACa;AAAA,EACb,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAAY,MAAM,aAAa,sBAAS;AAAA,EAC1D,WAAW,CAAC,MAAM,OAAOA,uBAAsB;AAC7C,UAAM,iBAAiB,KAAK;AAE5B,UAAM,yBAAyB,OAAO;AAAA,MACpC,OAAO,QAAQ,cAAc,EAAE;AAAA,QAAO,CAAC,CAAC,GAAG,MACzC,QAAQ,SAAS,GAAc;AAAA,MACjC;AAAA,IACF;AAEA,WAAO;AAAA,MACL,GAAG;AAAA,MACH,aAAaA,mBAAkB,wBAAwB;AAAA,QACrD,GAAG;AAAA,QACH,SAAS;AAAA,UACP,GAAG,MAAM;AAAA,UACT,EAAE,MAAM,sBAAS,QAAQ,KAAK,sBAAS,YAAY;AAAA,QACrD;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEO,MAAM,4BAA4B,CACvC,MACA,QACA,cACG;AACH,QAAM,UAAqB;AAAA,IACzB,wBAAwB,MAAM;AAAA,IAC9B,GAAI,UAAU,WAAW,CAAC;AAAA,EAC5B;AAEA,aAAO,sCAAkB,MAAM;AAAA,IAC7B,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;","names":["deepTransformNode"]}
@@ -32,9 +32,9 @@ __export(getLocalisedContent_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(getLocalisedContent_exports);
34
34
  var import_built = __toESM(require("@intlayer/config/built"));
35
- var import_deepTransform = require('./deepTransform.cjs');
36
- var import_plugins = require('./plugins.cjs');
37
- const getLocalisedContent = (node, locale = import_built.default?.internationalization.defaultLocale, nodeProps, fallback = false) => {
35
+ var import_deepTransform = require('../interpreter/getContent/deepTransform.cjs');
36
+ var import_plugins = require('../interpreter/getContent/plugins.cjs');
37
+ const getLocalisedContent = (node, locale = import_built.default?.internationalization.defaultLocale, nodeProps, fallback) => {
38
38
  const plugins = [
39
39
  (0, import_plugins.translationPlugin)(locale, fallback),
40
40
  ...nodeProps.plugins ?? []
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/deepTranformPlugins/getLocalisedContent.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { Locales, LocalesValues } from '@intlayer/config/client';\nimport { deepTransformNode } from '../interpreter/getContent/deepTransform';\nimport {\n translationPlugin,\n type DeepTransformContent,\n type NodeProps,\n type Plugins,\n} from '../interpreter/getContent/plugins';\nimport type { ContentNode } from '../types';\n\n/**\n * Transforms a node in a single pass, applying each plugin as needed.\n * In comparison to `getContent`, this function will only apply the translation plugin.\n * It will not transform enumerations, insertions, or other content types.\n *\n * @param node The node to transform.\n * @param locale The locale to use if your transformers need it (e.g. for translations).\n */\nexport const getLocalisedContent = <\n T extends ContentNode,\n L extends LocalesValues = Locales,\n>(\n node: T,\n locale: L = configuration?.internationalization.defaultLocale as L,\n nodeProps: NodeProps,\n fallback?: LocalesValues // fallback mean that if field is not translated, it will use the default locale\n) => {\n const plugins: Plugins[] = [\n translationPlugin(locale, fallback),\n ...(nodeProps.plugins ?? []),\n ];\n\n return deepTransformNode(node, {\n ...nodeProps,\n plugins,\n }) as DeepTransformContent<T>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B;AAE1B,2BAAkC;AAClC,qBAKO;AAWA,MAAM,sBAAsB,CAIjC,MACA,SAAY,aAAAA,SAAe,qBAAqB,eAChD,WACA,aACG;AACH,QAAM,UAAqB;AAAA,QACzB,kCAAkB,QAAQ,QAAQ;AAAA,IAClC,GAAI,UAAU,WAAW,CAAC;AAAA,EAC5B;AAEA,aAAO,wCAAkB,MAAM;AAAA,IAC7B,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;","names":["configuration"]}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var getMissingLocalesContent_exports = {};
30
+ __export(getMissingLocalesContent_exports, {
31
+ checkMissingLocalesPlugin: () => checkMissingLocalesPlugin,
32
+ getMissingLocalesContent: () => getMissingLocalesContent
33
+ });
34
+ module.exports = __toCommonJS(getMissingLocalesContent_exports);
35
+ var import_built = __toESM(require("@intlayer/config/built"));
36
+ var import_deepTransform = require('../interpreter/getContent/deepTransform.cjs');
37
+ var import_types = require('../types/index.cjs');
38
+ const checkMissingLocalesPlugin = (locales, onMissingLocale) => ({
39
+ id: "check-missing-locales-plugin",
40
+ canHandle: (node) => typeof node === "object" && node?.nodeType === import_types.NodeType.Translation,
41
+ transform: (node, props, deepTransformNode2) => {
42
+ for (const locale of locales) {
43
+ if (!node[import_types.NodeType.Translation][locale]) {
44
+ onMissingLocale(locale);
45
+ }
46
+ }
47
+ const translations = node[import_types.NodeType.Translation];
48
+ for (const key in translations) {
49
+ const child = translations[key];
50
+ deepTransformNode2(child, {
51
+ ...props,
52
+ children: child
53
+ });
54
+ }
55
+ return node;
56
+ }
57
+ });
58
+ const getMissingLocalesContent = (node, locales = import_built.default?.internationalization.locales, nodeProps) => {
59
+ const missingLocales = /* @__PURE__ */ new Set();
60
+ const plugins = [
61
+ checkMissingLocalesPlugin(
62
+ locales,
63
+ (locale) => missingLocales.add(locale)
64
+ ),
65
+ ...nodeProps.plugins ?? []
66
+ ];
67
+ (0, import_deepTransform.deepTransformNode)(node, {
68
+ ...nodeProps,
69
+ plugins
70
+ });
71
+ return Array.from(missingLocales);
72
+ };
73
+ // Annotate the CommonJS export names for ESM import in node:
74
+ 0 && (module.exports = {
75
+ checkMissingLocalesPlugin,
76
+ getMissingLocalesContent
77
+ });
78
+ //# sourceMappingURL=getMissingLocalesContent.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/deepTranformPlugins/getMissingLocalesContent.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { Locales, LocalesValues } from '@intlayer/config/client';\nimport { deepTransformNode } from '../interpreter/getContent/deepTransform';\nimport {\n type DeepTransformContent,\n type NodeProps,\n type Plugins,\n} from '../interpreter/getContent/plugins';\nimport { TranslationContent } from '../transpiler';\nimport { NodeType, type ContentNode } from '../types';\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const checkMissingLocalesPlugin = (\n locales: Locales[],\n onMissingLocale: (locale: Locales) => void\n): Plugins => ({\n id: 'check-missing-locales-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Translation,\n transform: (node: TranslationContent, props, deepTransformNode) => {\n for (const locale of locales) {\n if (\n !node[NodeType.Translation][\n locale as keyof (typeof node)[NodeType.Translation]\n ]\n ) {\n onMissingLocale(locale);\n }\n }\n\n // Continue traversal inside the translation values, but avoid re-applying this plugin on the same node\n const translations = node[NodeType.Translation] as Record<string, any>;\n for (const key in translations) {\n const child = translations[key];\n deepTransformNode(child, {\n ...props,\n children: child,\n });\n }\n\n // Return the original node; the return value is ignored by the caller\n return node;\n },\n});\n\n/**\n * Return the content of a node with only the translation plugin.\n *\n * @param node The node to transform.\n * @param locales The locales to check for missing translations.\n */\nexport const getMissingLocalesContent = <T extends ContentNode>(\n node: T,\n locales: LocalesValues[] = configuration?.internationalization.locales,\n nodeProps: NodeProps\n): Locales[] => {\n const missingLocales = new Set<Locales>();\n\n const plugins: Plugins[] = [\n checkMissingLocalesPlugin(locales as Locales[], (locale) =>\n missingLocales.add(locale)\n ),\n ...(nodeProps.plugins ?? []),\n ];\n\n deepTransformNode(node, {\n ...nodeProps,\n plugins,\n }) as DeepTransformContent<T>;\n\n return Array.from(missingLocales);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B;AAE1B,2BAAkC;AAOlC,mBAA2C;AAGpC,MAAM,4BAA4B,CACvC,SACA,qBACa;AAAA,EACb,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAAY,MAAM,aAAa,sBAAS;AAAA,EAC1D,WAAW,CAAC,MAA0B,OAAOA,uBAAsB;AACjE,eAAW,UAAU,SAAS;AAC5B,UACE,CAAC,KAAK,sBAAS,WAAW,EACxB,MACF,GACA;AACA,wBAAgB,MAAM;AAAA,MACxB;AAAA,IACF;AAGA,UAAM,eAAe,KAAK,sBAAS,WAAW;AAC9C,eAAW,OAAO,cAAc;AAC9B,YAAM,QAAQ,aAAa,GAAG;AAC9B,MAAAA,mBAAkB,OAAO;AAAA,QACvB,GAAG;AAAA,QACH,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAGA,WAAO;AAAA,EACT;AACF;AAQO,MAAM,2BAA2B,CACtC,MACA,UAA2B,aAAAC,SAAe,qBAAqB,SAC/D,cACc;AACd,QAAM,iBAAiB,oBAAI,IAAa;AAExC,QAAM,UAAqB;AAAA,IACzB;AAAA,MAA0B;AAAA,MAAsB,CAAC,WAC/C,eAAe,IAAI,MAAM;AAAA,IAC3B;AAAA,IACA,GAAI,UAAU,WAAW,CAAC;AAAA,EAC5B;AAEA,8CAAkB,MAAM;AAAA,IACtB,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AAED,SAAO,MAAM,KAAK,cAAc;AAClC;","names":["deepTransformNode","configuration"]}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var getReplacedValuesContent_exports = {};
20
+ __export(getReplacedValuesContent_exports, {
21
+ getReplacedValuesContent: () => getReplacedValuesContent
22
+ });
23
+ module.exports = __toCommonJS(getReplacedValuesContent_exports);
24
+ var import_interpreter = require('../interpreter/index.cjs');
25
+ const replaceValuesPlugin = (value) => ({
26
+ id: "replace-values-plugin",
27
+ canHandle: (node) => typeof node === "string" || typeof node === "number" || typeof node === "boolean",
28
+ transform: () => value
29
+ });
30
+ const skipTypedNodePlugin = {
31
+ id: "skip-typed-node-plugin",
32
+ canHandle: (node) => typeof node === "object" && typeof node?.nodeType === "string",
33
+ transform: (node, props, deepTransformNode2) => {
34
+ const nodeType = node.nodeType;
35
+ const result = structuredClone(
36
+ node[nodeType]
37
+ );
38
+ if (typeof result !== "object" || result === null) {
39
+ const transformedResult = deepTransformNode2(result, {
40
+ ...props,
41
+ children: result,
42
+ keyPath: [
43
+ ...props.keyPath,
44
+ { type: nodeType, key: nodeType }
45
+ ]
46
+ });
47
+ return {
48
+ ...node,
49
+ [nodeType]: transformedResult
50
+ };
51
+ }
52
+ for (const key in result) {
53
+ const childProps = {
54
+ ...props,
55
+ children: result[key],
56
+ keyPath: [...props.keyPath, { type: nodeType, key }]
57
+ };
58
+ result[key] = deepTransformNode2(
59
+ result[key],
60
+ childProps
61
+ );
62
+ }
63
+ return { ...node, [nodeType]: result };
64
+ }
65
+ };
66
+ const getReplacedValuesContent = (node, value, nodeProps) => {
67
+ const plugins = [
68
+ skipTypedNodePlugin,
69
+ replaceValuesPlugin(value),
70
+ ...nodeProps.plugins ?? []
71
+ ];
72
+ const JSONNode = JSON.parse(JSON.stringify(node));
73
+ return (0, import_interpreter.deepTransformNode)(JSONNode, {
74
+ ...nodeProps,
75
+ plugins
76
+ });
77
+ };
78
+ // Annotate the CommonJS export names for ESM import in node:
79
+ 0 && (module.exports = {
80
+ getReplacedValuesContent
81
+ });
82
+ //# sourceMappingURL=getReplacedValuesContent.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/deepTranformPlugins/getReplacedValuesContent.ts"],"sourcesContent":["import {\n deepTransformNode,\n type NodeProps,\n type Plugins,\n} from '../interpreter';\nimport { KeyPath, NodeType, TypedNode, type ContentNode } from '../types';\n\nconst replaceValuesPlugin = (value: string | number | boolean): Plugins => ({\n id: 'replace-values-plugin',\n canHandle: (node) =>\n typeof node === 'string' ||\n typeof node === 'number' ||\n typeof node === 'boolean',\n transform: () => value,\n});\n\nconst skipTypedNodePlugin: Plugins = {\n id: 'skip-typed-node-plugin',\n canHandle: (node) =>\n typeof node === 'object' && typeof node?.nodeType === 'string',\n transform: (node: TypedNode, props, deepTransformNode) => {\n const nodeType = node.nodeType as NodeType;\n const result = structuredClone(\n node[nodeType as unknown as keyof TypedNode] as any\n );\n\n // If the result is a primitive value (string, number, boolean),\n // we need to transform it directly instead of iterating over its properties\n if (typeof result !== 'object' || result === null) {\n const transformedResult = deepTransformNode(result, {\n ...props,\n children: result,\n keyPath: [\n ...props.keyPath,\n { type: nodeType, key: nodeType } as KeyPath,\n ],\n });\n return {\n ...node,\n [nodeType as unknown as keyof TypedNode]: transformedResult,\n };\n }\n\n // For objects and arrays, iterate over their properties\n for (const key in result) {\n const childProps = {\n ...props,\n children: result[key as unknown as keyof typeof result],\n keyPath: [...props.keyPath, { type: nodeType, key } as KeyPath],\n };\n result[key as unknown as keyof typeof result] = deepTransformNode(\n result[key as unknown as keyof typeof result],\n childProps\n );\n }\n\n return { ...node, [nodeType as unknown as keyof TypedNode]: result };\n },\n};\n\nexport const getReplacedValuesContent = (\n node: ContentNode,\n value: string | number | boolean,\n nodeProps: NodeProps\n) => {\n const plugins: Plugins[] = [\n skipTypedNodePlugin,\n replaceValuesPlugin(value),\n ...(nodeProps.plugins ?? []),\n ];\n\n const JSONNode = JSON.parse(JSON.stringify(node));\n\n return deepTransformNode(JSONNode, {\n ...nodeProps,\n plugins,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAIO;AAGP,MAAM,sBAAsB,CAAC,WAA+C;AAAA,EAC1E,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAChB,OAAO,SAAS,YAChB,OAAO,SAAS;AAAA,EAClB,WAAW,MAAM;AACnB;AAEA,MAAM,sBAA+B;AAAA,EACnC,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAAY,OAAO,MAAM,aAAa;AAAA,EACxD,WAAW,CAAC,MAAiB,OAAOA,uBAAsB;AACxD,UAAM,WAAW,KAAK;AACtB,UAAM,SAAS;AAAA,MACb,KAAK,QAAsC;AAAA,IAC7C;AAIA,QAAI,OAAO,WAAW,YAAY,WAAW,MAAM;AACjD,YAAM,oBAAoBA,mBAAkB,QAAQ;AAAA,QAClD,GAAG;AAAA,QACH,UAAU;AAAA,QACV,SAAS;AAAA,UACP,GAAG,MAAM;AAAA,UACT,EAAE,MAAM,UAAU,KAAK,SAAS;AAAA,QAClC;AAAA,MACF,CAAC;AACD,aAAO;AAAA,QACL,GAAG;AAAA,QACH,CAAC,QAAsC,GAAG;AAAA,MAC5C;AAAA,IACF;AAGA,eAAW,OAAO,QAAQ;AACxB,YAAM,aAAa;AAAA,QACjB,GAAG;AAAA,QACH,UAAU,OAAO,GAAqC;AAAA,QACtD,SAAS,CAAC,GAAG,MAAM,SAAS,EAAE,MAAM,UAAU,IAAI,CAAY;AAAA,MAChE;AACA,aAAO,GAAqC,IAAIA;AAAA,QAC9C,OAAO,GAAqC;AAAA,QAC5C;AAAA,MACF;AAAA,IACF;AAEA,WAAO,EAAE,GAAG,MAAM,CAAC,QAAsC,GAAG,OAAO;AAAA,EACrE;AACF;AAEO,MAAM,2BAA2B,CACtC,MACA,OACA,cACG;AACH,QAAM,UAAqB;AAAA,IACzB;AAAA,IACA,oBAAoB,KAAK;AAAA,IACzB,GAAI,UAAU,WAAW,CAAC;AAAA,EAC5B;AAEA,QAAM,WAAW,KAAK,MAAM,KAAK,UAAU,IAAI,CAAC;AAEhD,aAAO,sCAAkB,UAAU;AAAA,IACjC,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;","names":["deepTransformNode"]}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var deepTranformPlugins_exports = {};
17
+ module.exports = __toCommonJS(deepTranformPlugins_exports);
18
+ __reExport(deepTranformPlugins_exports, require('./getFilteredLocalesContent.cjs'), module.exports);
19
+ __reExport(deepTranformPlugins_exports, require('./getFilterTranslationsOnlyContent.cjs'), module.exports);
20
+ __reExport(deepTranformPlugins_exports, require('./getLocalisedContent.cjs'), module.exports);
21
+ __reExport(deepTranformPlugins_exports, require('./getMissingLocalesContent.cjs'), module.exports);
22
+ __reExport(deepTranformPlugins_exports, require('./getReplacedValuesContent.cjs'), module.exports);
23
+ // Annotate the CommonJS export names for ESM import in node:
24
+ 0 && (module.exports = {
25
+ ...require('./getFilteredLocalesContent.cjs'),
26
+ ...require('./getFilterTranslationsOnlyContent.cjs'),
27
+ ...require('./getLocalisedContent.cjs'),
28
+ ...require('./getMissingLocalesContent.cjs'),
29
+ ...require('./getReplacedValuesContent.cjs')
30
+ });
31
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/deepTranformPlugins/index.ts"],"sourcesContent":["export * from './getFilteredLocalesContent';\nexport * from './getFilterTranslationsOnlyContent';\nexport * from './getLocalisedContent';\nexport * from './getMissingLocalesContent';\nexport * from './getReplacedValuesContent';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wCAAc,wCAAd;AACA,wCAAc,+CADd;AAEA,wCAAc,kCAFd;AAGA,wCAAc,uCAHd;AAIA,wCAAc,uCAJd;","names":[]}
@@ -35,7 +35,7 @@ const getNodeChildren = (section) => {
35
35
  if (typeof section?.nodeType === "string") {
36
36
  const typedNode = section;
37
37
  const content = typedNode[typedNode.nodeType];
38
- if (typedNode.nodeType === import_types.NodeType.Translation || typedNode.nodeType === import_types.NodeType.Enumeration || typedNode.nodeType === import_types.NodeType.Condition || typedNode.nodeType === import_types.NodeType.Insertion || typedNode.nodeType === import_types.NodeType.File) {
38
+ if (typedNode.nodeType === import_types.NodeType.Translation || typedNode.nodeType === import_types.NodeType.Enumeration || typedNode.nodeType === import_types.NodeType.Condition || typedNode.nodeType === import_types.NodeType.Insertion || typedNode.nodeType === import_types.NodeType.Gender || typedNode.nodeType === import_types.NodeType.File || typedNode.nodeType === import_types.NodeType.Markdown) {
39
39
  const firstKey = Object.keys(content)[0];
40
40
  return content[firstKey];
41
41
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/dictionaryManipulator/getNodeChildren.ts"],"sourcesContent":["import { type ContentNode, type TypedNode, NodeType } from '../types';\n\nexport const getNodeChildren = (section: ContentNode): ContentNode => {\n if (typeof section === 'string') {\n return section;\n }\n if (typeof section === 'number') {\n return section;\n }\n if (typeof section === 'boolean') {\n return section;\n }\n if (typeof (section as TypedNode)?.nodeType === 'string') {\n const typedNode = section as TypedNode;\n const content = typedNode[typedNode.nodeType as keyof TypedNode];\n\n if (\n typedNode.nodeType === NodeType.Translation ||\n typedNode.nodeType === NodeType.Enumeration ||\n typedNode.nodeType === NodeType.Condition ||\n typedNode.nodeType === NodeType.Insertion ||\n typedNode.nodeType === NodeType.File\n ) {\n const firstKey = Object.keys(content)[0] as keyof typeof content;\n return content[firstKey] as ContentNode;\n }\n\n if (typedNode.nodeType === NodeType.Nested) {\n return undefined;\n }\n\n return content;\n }\n\n if (!section || typeof section !== 'object') {\n return section;\n }\n\n if (Array.isArray(section)) {\n return (section as ContentNode[])[0];\n }\n\n return section;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2D;AAEpD,MAAM,kBAAkB,CAAC,YAAsC;AACpE,MAAI,OAAO,YAAY,UAAU;AAC/B,WAAO;AAAA,EACT;AACA,MAAI,OAAO,YAAY,UAAU;AAC/B,WAAO;AAAA,EACT;AACA,MAAI,OAAO,YAAY,WAAW;AAChC,WAAO;AAAA,EACT;AACA,MAAI,OAAQ,SAAuB,aAAa,UAAU;AACxD,UAAM,YAAY;AAClB,UAAM,UAAU,UAAU,UAAU,QAA2B;AAE/D,QACE,UAAU,aAAa,sBAAS,eAChC,UAAU,aAAa,sBAAS,eAChC,UAAU,aAAa,sBAAS,aAChC,UAAU,aAAa,sBAAS,aAChC,UAAU,aAAa,sBAAS,MAChC;AACA,YAAM,WAAW,OAAO,KAAK,OAAO,EAAE,CAAC;AACvC,aAAO,QAAQ,QAAQ;AAAA,IACzB;AAEA,QAAI,UAAU,aAAa,sBAAS,QAAQ;AAC1C,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,WAAW,OAAO,YAAY,UAAU;AAC3C,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,QAAQ,OAAO,GAAG;AAC1B,WAAQ,QAA0B,CAAC;AAAA,EACrC;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/dictionaryManipulator/getNodeChildren.ts"],"sourcesContent":["import { type ContentNode, type TypedNode, NodeType } from '../types';\n\nexport const getNodeChildren = (section: ContentNode): ContentNode => {\n if (typeof section === 'string') {\n return section;\n }\n if (typeof section === 'number') {\n return section;\n }\n if (typeof section === 'boolean') {\n return section;\n }\n if (typeof (section as TypedNode)?.nodeType === 'string') {\n const typedNode = section as TypedNode;\n const content = typedNode[typedNode.nodeType as keyof TypedNode];\n\n if (\n typedNode.nodeType === NodeType.Translation ||\n typedNode.nodeType === NodeType.Enumeration ||\n typedNode.nodeType === NodeType.Condition ||\n typedNode.nodeType === NodeType.Insertion ||\n typedNode.nodeType === NodeType.Gender ||\n typedNode.nodeType === NodeType.File ||\n typedNode.nodeType === NodeType.Markdown\n ) {\n const firstKey = Object.keys(content)[0] as keyof typeof content;\n return content[firstKey] as ContentNode;\n }\n\n if (typedNode.nodeType === NodeType.Nested) {\n return undefined;\n }\n\n return content;\n }\n\n if (!section || typeof section !== 'object') {\n return section;\n }\n\n if (Array.isArray(section)) {\n return (section as ContentNode[])[0];\n }\n\n return section;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2D;AAEpD,MAAM,kBAAkB,CAAC,YAAsC;AACpE,MAAI,OAAO,YAAY,UAAU;AAC/B,WAAO;AAAA,EACT;AACA,MAAI,OAAO,YAAY,UAAU;AAC/B,WAAO;AAAA,EACT;AACA,MAAI,OAAO,YAAY,WAAW;AAChC,WAAO;AAAA,EACT;AACA,MAAI,OAAQ,SAAuB,aAAa,UAAU;AACxD,UAAM,YAAY;AAClB,UAAM,UAAU,UAAU,UAAU,QAA2B;AAE/D,QACE,UAAU,aAAa,sBAAS,eAChC,UAAU,aAAa,sBAAS,eAChC,UAAU,aAAa,sBAAS,aAChC,UAAU,aAAa,sBAAS,aAChC,UAAU,aAAa,sBAAS,UAChC,UAAU,aAAa,sBAAS,QAChC,UAAU,aAAa,sBAAS,UAChC;AACA,YAAM,WAAW,OAAO,KAAK,OAAO,EAAE,CAAC;AACvC,aAAO,QAAQ,QAAQ;AAAA,IACzB;AAEA,QAAI,UAAU,aAAa,sBAAS,QAAQ;AAC1C,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,WAAW,OAAO,YAAY,UAAU;AAC3C,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,QAAQ,OAAO,GAAG;AAC1B,WAAQ,QAA0B,CAAC;AAAA,EACrC;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var getUnmergedDictionaryByKeyPath_exports = {};
30
+ __export(getUnmergedDictionaryByKeyPath_exports, {
31
+ getUnmergedDictionaryByKeyPath: () => getUnmergedDictionaryByKeyPath
32
+ });
33
+ module.exports = __toCommonJS(getUnmergedDictionaryByKeyPath_exports);
34
+ var import_unmerged_dictionaries_entry = __toESM(require("@intlayer/unmerged-dictionaries-entry"));
35
+ var import_getContentNodeByKeyPath = require('./getContentNodeByKeyPath.cjs');
36
+ const getUnmergedDictionaryByKeyPath = (dictionaryKey, keyPath, dictionariesRecord = import_unmerged_dictionaries_entry.default) => {
37
+ const unmergedEntries = dictionariesRecord?.[dictionaryKey];
38
+ if (!unmergedEntries) {
39
+ return null;
40
+ }
41
+ for (const dictionary of unmergedEntries) {
42
+ const content = (0, import_getContentNodeByKeyPath.getContentNodeByKeyPath)(dictionary.content, keyPath);
43
+ if (content) {
44
+ return dictionary;
45
+ }
46
+ }
47
+ };
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ getUnmergedDictionaryByKeyPath
51
+ });
52
+ //# sourceMappingURL=getUnmergedDictionaryByKeyPath.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/dictionaryManipulator/getUnmergedDictionaryByKeyPath.ts"],"sourcesContent":["import unmergedDictionary from '@intlayer/unmerged-dictionaries-entry';\nimport { type KeyPath } from '../types';\nimport { getContentNodeByKeyPath } from './getContentNodeByKeyPath';\n\nexport const getUnmergedDictionaryByKeyPath = (\n dictionaryKey: string,\n keyPath: KeyPath[],\n dictionariesRecord: keyof typeof unmergedDictionary = unmergedDictionary\n) => {\n const unmergedEntries = dictionariesRecord?.[dictionaryKey];\n\n if (!unmergedEntries) {\n return null;\n }\n\n for (const dictionary of unmergedEntries) {\n const content = getContentNodeByKeyPath(dictionary.content, keyPath);\n\n if (content) {\n return dictionary;\n }\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yCAA+B;AAE/B,qCAAwC;AAEjC,MAAM,iCAAiC,CAC5C,eACA,SACA,qBAAsD,mCAAAA,YACnD;AACH,QAAM,kBAAkB,qBAAqB,aAAa;AAE1D,MAAI,CAAC,iBAAiB;AACpB,WAAO;AAAA,EACT;AAEA,aAAW,cAAc,iBAAiB;AACxC,UAAM,cAAU,wDAAwB,WAAW,SAAS,OAAO;AAEnE,QAAI,SAAS;AACX,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["unmergedDictionary"]}
@@ -17,23 +17,25 @@ var dictionaryManipulator_exports = {};
17
17
  module.exports = __toCommonJS(dictionaryManipulator_exports);
18
18
  __reExport(dictionaryManipulator_exports, require('./editDictionaryByKeyPath.cjs'), module.exports);
19
19
  __reExport(dictionaryManipulator_exports, require('./getContentNodeByKeyPath.cjs'), module.exports);
20
+ __reExport(dictionaryManipulator_exports, require('./getDefaultNode.cjs'), module.exports);
21
+ __reExport(dictionaryManipulator_exports, require('./getEmptyNode.cjs'), module.exports);
20
22
  __reExport(dictionaryManipulator_exports, require('./getNodeChildren.cjs'), module.exports);
23
+ __reExport(dictionaryManipulator_exports, require('./getNodeType.cjs'), module.exports);
24
+ __reExport(dictionaryManipulator_exports, require('./getUnmergedDictionaryByKeyPath.cjs'), module.exports);
21
25
  __reExport(dictionaryManipulator_exports, require('./removeContentNodeByKeyPath.cjs'), module.exports);
22
26
  __reExport(dictionaryManipulator_exports, require('./renameContentNodeByKeyPath.cjs'), module.exports);
23
- __reExport(dictionaryManipulator_exports, require('./getNodeType.cjs'), module.exports);
24
27
  __reExport(dictionaryManipulator_exports, require('./updateNodeChildren.cjs'), module.exports);
25
- __reExport(dictionaryManipulator_exports, require('./getDefaultNode.cjs'), module.exports);
26
- __reExport(dictionaryManipulator_exports, require('./getEmptyNode.cjs'), module.exports);
27
28
  // Annotate the CommonJS export names for ESM import in node:
28
29
  0 && (module.exports = {
29
30
  ...require('./editDictionaryByKeyPath.cjs'),
30
31
  ...require('./getContentNodeByKeyPath.cjs'),
32
+ ...require('./getDefaultNode.cjs'),
33
+ ...require('./getEmptyNode.cjs'),
31
34
  ...require('./getNodeChildren.cjs'),
35
+ ...require('./getNodeType.cjs'),
36
+ ...require('./getUnmergedDictionaryByKeyPath.cjs'),
32
37
  ...require('./removeContentNodeByKeyPath.cjs'),
33
38
  ...require('./renameContentNodeByKeyPath.cjs'),
34
- ...require('./getNodeType.cjs'),
35
- ...require('./updateNodeChildren.cjs'),
36
- ...require('./getDefaultNode.cjs'),
37
- ...require('./getEmptyNode.cjs')
39
+ ...require('./updateNodeChildren.cjs')
38
40
  });
39
41
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/dictionaryManipulator/index.ts"],"sourcesContent":["export * from './editDictionaryByKeyPath';\nexport * from './getContentNodeByKeyPath';\nexport * from './getNodeChildren';\nexport * from './removeContentNodeByKeyPath';\nexport * from './renameContentNodeByKeyPath';\nexport * from './getNodeType';\nexport * from './updateNodeChildren';\nexport * from './getDefaultNode';\nexport * from './getEmptyNode';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0CAAc,sCAAd;AACA,0CAAc,sCADd;AAEA,0CAAc,8BAFd;AAGA,0CAAc,yCAHd;AAIA,0CAAc,yCAJd;AAKA,0CAAc,0BALd;AAMA,0CAAc,iCANd;AAOA,0CAAc,6BAPd;AAQA,0CAAc,2BARd;","names":[]}
1
+ {"version":3,"sources":["../../../src/dictionaryManipulator/index.ts"],"sourcesContent":["export * from './editDictionaryByKeyPath';\nexport * from './getContentNodeByKeyPath';\nexport * from './getDefaultNode';\nexport * from './getEmptyNode';\nexport * from './getNodeChildren';\nexport * from './getNodeType';\nexport * from './getUnmergedDictionaryByKeyPath';\nexport * from './removeContentNodeByKeyPath';\nexport * from './renameContentNodeByKeyPath';\nexport * from './updateNodeChildren';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0CAAc,sCAAd;AACA,0CAAc,sCADd;AAEA,0CAAc,6BAFd;AAGA,0CAAc,2BAHd;AAIA,0CAAc,8BAJd;AAKA,0CAAc,0BALd;AAMA,0CAAc,6CANd;AAOA,0CAAc,yCAPd;AAQA,0CAAc,yCARd;AASA,0CAAc,iCATd;","names":[]}
@@ -15,6 +15,7 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
15
15
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
16
  var index_exports = {};
17
17
  module.exports = __toCommonJS(index_exports);
18
+ __reExport(index_exports, require('./deepTranformPlugins/index.cjs'), module.exports);
18
19
  __reExport(index_exports, require('./dictionaryManipulator/index.cjs'), module.exports);
19
20
  __reExport(index_exports, require('./formatters/index.cjs'), module.exports);
20
21
  __reExport(index_exports, require('./interpreter/index.cjs'), module.exports);
@@ -27,6 +28,7 @@ __reExport(index_exports, require('./utils/isSameKeyPath.cjs'), module.exports);
27
28
  __reExport(index_exports, require('./utils/isValidReactElement.cjs'), module.exports);
28
29
  // Annotate the CommonJS export names for ESM import in node:
29
30
  0 && (module.exports = {
31
+ ...require('./deepTranformPlugins/index.cjs'),
30
32
  ...require('./dictionaryManipulator/index.cjs'),
31
33
  ...require('./formatters/index.cjs'),
32
34
  ...require('./interpreter/index.cjs'),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './dictionaryManipulator/index';\nexport * from './formatters/index';\nexport * from './interpreter/index';\nexport * from './localization/index';\nexport * from './transpiler/index';\nexport * from './types/index';\nexport * from './utils/checkIsURLAbsolute';\nexport * from './utils/intl';\nexport * from './utils/isSameKeyPath';\nexport * from './utils/isValidReactElement';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,0CAAd;AACA,0BAAc,+BADd;AAEA,0BAAc,gCAFd;AAGA,0BAAc,iCAHd;AAIA,0BAAc,+BAJd;AAKA,0BAAc,0BALd;AAMA,0BAAc,uCANd;AAOA,0BAAc,yBAPd;AAQA,0BAAc,kCARd;AASA,0BAAc,wCATd;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './deepTranformPlugins';\nexport * from './dictionaryManipulator/index';\nexport * from './formatters/index';\nexport * from './interpreter/index';\nexport * from './localization/index';\nexport * from './transpiler/index';\nexport * from './types/index';\nexport * from './utils/checkIsURLAbsolute';\nexport * from './utils/intl';\nexport * from './utils/isSameKeyPath';\nexport * from './utils/isValidReactElement';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,kCAAd;AACA,0BAAc,0CADd;AAEA,0BAAc,+BAFd;AAGA,0BAAc,gCAHd;AAIA,0BAAc,iCAJd;AAKA,0BAAc,+BALd;AAMA,0BAAc,0BANd;AAOA,0BAAc,uCAPd;AAQA,0BAAc,yBARd;AASA,0BAAc,kCATd;AAUA,0BAAc,wCAVd;","names":[]}
@@ -17,13 +17,11 @@ var getContent_exports = {};
17
17
  module.exports = __toCommonJS(getContent_exports);
18
18
  __reExport(getContent_exports, require('./deepTransform.cjs'), module.exports);
19
19
  __reExport(getContent_exports, require('./getContent.cjs'), module.exports);
20
- __reExport(getContent_exports, require('./getLocalisedContent.cjs'), module.exports);
21
20
  __reExport(getContent_exports, require('./plugins.cjs'), module.exports);
22
21
  // Annotate the CommonJS export names for ESM import in node:
23
22
  0 && (module.exports = {
24
23
  ...require('./deepTransform.cjs'),
25
24
  ...require('./getContent.cjs'),
26
- ...require('./getLocalisedContent.cjs'),
27
25
  ...require('./plugins.cjs')
28
26
  });
29
27
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/interpreter/getContent/index.ts"],"sourcesContent":["export * from './deepTransform';\nexport * from './getContent';\nexport * from './getLocalisedContent';\nexport * from './plugins';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAc,4BAAd;AACA,+BAAc,yBADd;AAEA,+BAAc,kCAFd;AAGA,+BAAc,sBAHd;","names":[]}
1
+ {"version":3,"sources":["../../../../src/interpreter/getContent/index.ts"],"sourcesContent":["export * from './deepTransform';\nexport * from './getContent';\nexport * from './plugins';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAc,4BAAd;AACA,+BAAc,yBADd;AAEA,+BAAc,sBAFd;","names":[]}
@@ -34,7 +34,7 @@ var import_getGender = require('../getGender.cjs');
34
34
  var import_getInsertion = require('../getInsertion.cjs');
35
35
  var import_getNesting = require('../getNesting.cjs');
36
36
  var import_getTranslation = require('../getTranslation.cjs');
37
- const translationPlugin = (locale, fallback = true) => ({
37
+ const translationPlugin = (locale, fallback) => ({
38
38
  id: "translation-plugin",
39
39
  canHandle: (node) => typeof node === "object" && node?.nodeType === import_types.NodeType.Translation,
40
40
  transform: (node, props, deepTransformNode) => {