angular-intlayer 9.7.1 → 9.7.3

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 (34) hide show
  1. package/dist/cjs/UI/IntlayerNode.component.cjs +7 -3
  2. package/dist/cjs/UI/IntlayerNode.component.cjs.map +1 -1
  3. package/dist/cjs/_virtual/{_@oxc-project_runtime@0.156.0 → _@oxc-project_runtime@0.157.0}/helpers/esm/decorate.cjs +1 -1
  4. package/dist/cjs/_virtual/{_@oxc-project_runtime@0.156.0 → _@oxc-project_runtime@0.157.0}/helpers/esm/decorateMetadata.cjs +1 -1
  5. package/dist/cjs/client/useDictionary.cjs.map +1 -1
  6. package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
  7. package/dist/cjs/editor/ContentSelector.component.cjs +2 -2
  8. package/dist/cjs/editor/EditorProvider.component.cjs +2 -2
  9. package/dist/cjs/getDictionary.cjs.map +1 -1
  10. package/dist/cjs/html/installIntlayerHTML.cjs +1 -1
  11. package/dist/cjs/index.cjs +1 -1
  12. package/dist/cjs/markdown/installIntlayerMarkdown.cjs +1 -1
  13. package/dist/esm/UI/IntlayerNode.component.mjs +7 -3
  14. package/dist/esm/UI/IntlayerNode.component.mjs.map +1 -1
  15. package/dist/esm/_virtual/{_@oxc-project_runtime@0.156.0 → _@oxc-project_runtime@0.157.0}/helpers/esm/decorate.mjs +1 -1
  16. package/dist/esm/_virtual/{_@oxc-project_runtime@0.156.0 → _@oxc-project_runtime@0.157.0}/helpers/esm/decorateMetadata.mjs +1 -1
  17. package/dist/esm/client/useDictionary.mjs.map +1 -1
  18. package/dist/esm/client/useDictionaryDynamic.mjs +1 -1
  19. package/dist/esm/editor/ContentSelector.component.mjs +2 -2
  20. package/dist/esm/editor/EditorProvider.component.mjs +2 -2
  21. package/dist/esm/getDictionary.mjs.map +1 -1
  22. package/dist/esm/html/installIntlayerHTML.mjs +1 -1
  23. package/dist/esm/index.mjs +1 -1
  24. package/dist/esm/markdown/installIntlayerMarkdown.mjs +1 -1
  25. package/dist/types/UI/IntlayerNode.component.d.ts.map +1 -1
  26. package/dist/types/client/intlayerToken.d.ts +1 -1
  27. package/dist/types/client/useDictionary.d.ts +1 -1
  28. package/dist/types/client/useDictionary.d.ts.map +1 -1
  29. package/dist/types/client/useIntlayer.d.ts +1 -1
  30. package/dist/types/client/useLocale.d.ts +1 -1
  31. package/dist/types/getDictionary.d.ts.map +1 -1
  32. package/dist/types/index.d.ts +3 -3
  33. package/dist/types/index.d.ts.map +1 -1
  34. package/package.json +55 -55
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_decorateMetadata = require("../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorateMetadata.cjs");
3
- const require_decorate = require("../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.cjs");
2
+ const require_decorateMetadata = require("../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/decorateMetadata.cjs");
3
+ const require_decorate = require("../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/decorate.cjs");
4
4
  let _angular_core = require("@angular/core");
5
5
 
6
6
  // src/UI/IntlayerNode.component.ts
@@ -39,7 +39,11 @@ IntlayerNodeComponent = require_decorate.default([(0, _angular_core.Component)({
39
39
  selector: "intlayer-node",
40
40
  standalone: true,
41
41
  template: `<ng-container #anchor></ng-container>`,
42
- styles: [`:host { display: contents; }`]
42
+ styles: [`
43
+ :host {
44
+ display: contents;
45
+ }
46
+ `]
43
47
  })], IntlayerNodeComponent);
44
48
 
45
49
  Object.defineProperty(exports, "IntlayerNodeComponent", {
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerNode.component.cjs","names":["inject","ViewContainerRef","ElementRef","ChangeDetectorRef","Input","Component"],"sources":["../../../src/UI/IntlayerNode.component.ts"],"sourcesContent":["import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n inject,\n type OnChanges,\n type SimpleChanges,\n type Type,\n ViewContainerRef,\n} from '@angular/core';\n\n/**\n * A transparent host element that renders Intlayer content nodes.\n *\n * `display: contents` makes the `<intlayer-node>` element invisible in the\n * layout — its children appear as if they were direct children of the parent,\n * so placing this component inside `<h1>`, `<p>`, etc. does not break the\n * document structure.\n *\n * ### Usage\n * ```html\n * <h1><intlayer-node [node]=\"content().title\"></intlayer-node></h1>\n * ```\n */\n@Component({\n selector: 'intlayer-node',\n standalone: true,\n // The ng-content slot is the anchor point for ViewContainerRef.\n // Wrapping text renders directly inside this host thanks to display:contents.\n template: `<ng-container #anchor></ng-container>`,\n // display:contents collapses the host box so it is layout-transparent.\n styles: [`:host { display: contents; }`],\n})\nexport class IntlayerNodeComponent implements OnChanges {\n @Input() node: any;\n\n private vcr = inject(ViewContainerRef);\n private elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private cdr = inject(ChangeDetectorRef);\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['node']) {\n this.render();\n }\n }\n\n private render() {\n // Clear previously created views / text nodes\n this.vcr.clear();\n const host = this.elRef.nativeElement;\n // Remove any raw text nodes we injected directly on previous renders\n host.childNodes.forEach((n) => {\n if (n.nodeType === Node.TEXT_NODE) n.parentNode?.removeChild(n);\n });\n\n if (!this.node) return;\n\n // The node returned by the Angular plugin is a Proxy whose `.children`\n // property is a function returning component info (editor on) or the raw\n // value (editor off).\n const nodeInfo =\n typeof this.node?.children === 'function'\n ? this.node.children()\n : this.node;\n\n if (nodeInfo?.component && typeof nodeInfo.component !== 'string') {\n // ── Editor enabled path: create the ContentSelectorWrapper component ──\n const componentRef = this.vcr.createComponent(\n nodeInfo.component as Type<any>\n );\n\n if (nodeInfo.props) {\n for (const [key, value] of Object.entries(nodeInfo.props)) {\n (componentRef.instance as any)[key] = value;\n }\n }\n\n if (nodeInfo.children) {\n const content = nodeInfo.children;\n if (typeof content === 'string' || typeof content === 'number') {\n componentRef.location.nativeElement.appendChild(\n document.createTextNode(String(content))\n );\n }\n }\n\n this.cdr.markForCheck();\n } else {\n // ── Editor disabled path: render plain text inside the host ──────────\n const text =\n this.node?.value ?? this.node?.toString?.() ?? String(this.node);\n // Append a text node directly inside the host element.\n // Because the host has `display: contents`, this text is layout-wise a\n // direct child of the surrounding element (e.g. <h1>).\n host.appendChild(document.createTextNode(text));\n }\n }\n}\n"],"mappings":";;;;;;AAkCO,IAAM,wBAAN,MAAM,sBAA2C;CACtD,AAAS;CAET,AAAQ,UAAMA,sBAAOC,8BAAgB;CACrC,AAAQ,YAAQD,sBAAgCE,wBAAU;CAC1D,AAAQ,UAAMF,sBAAOG,+BAAiB;CAEtC,YAAY,SAA8B;EACxC,IAAI,QAAQ,SACV,KAAK,OAAO;CAEhB;CAEA,AAAQ,SAAS;EAEf,KAAK,IAAI,MAAM;EACf,MAAM,OAAO,KAAK,MAAM;EAExB,KAAK,WAAW,SAAS,MAAM;GAC7B,IAAI,EAAE,aAAa,KAAK,WAAW,EAAE,YAAY,YAAY,CAAC;EAChE,CAAC;EAED,IAAI,CAAC,KAAK,MAAM;EAKhB,MAAM,WACJ,OAAO,KAAK,MAAM,aAAa,aAC3B,KAAK,KAAK,SAAS,IACnB,KAAK;EAEX,IAAI,UAAU,aAAa,OAAO,SAAS,cAAc,UAAU;GAEjE,MAAM,eAAe,KAAK,IAAI,gBAC5B,SAAS,SACX;GAEA,IAAI,SAAS,OACX,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,SAAS,KAAK,GACtD,AAAC,aAAa,SAAiB,OAAO;GAI1C,IAAI,SAAS,UAAU;IACrB,MAAM,UAAU,SAAS;IACzB,IAAI,OAAO,YAAY,YAAY,OAAO,YAAY,UACpD,aAAa,SAAS,cAAc,YAClC,SAAS,eAAe,OAAO,OAAO,CAAC,CACzC;GAEJ;GAEA,KAAK,IAAI,aAAa;EACxB,OAAO;GAEL,MAAM,OACJ,KAAK,MAAM,SAAS,KAAK,MAAM,WAAW,KAAK,OAAO,KAAK,IAAI;GAIjE,KAAK,YAAY,SAAS,eAAe,IAAI,CAAC;EAChD;CACF;AACF;8BA/DGC,qBAAM;sDAVRC,yBAAU;CACT,UAAU;CACV,YAAY;CAGZ,UAAU;CAEV,QAAQ,CAAC,8BAA8B;AACzC,CAAC"}
1
+ {"version":3,"file":"IntlayerNode.component.cjs","names":["inject","ViewContainerRef","ElementRef","ChangeDetectorRef","Input","Component"],"sources":["../../../src/UI/IntlayerNode.component.ts"],"sourcesContent":["import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n inject,\n type OnChanges,\n type SimpleChanges,\n type Type,\n ViewContainerRef,\n} from '@angular/core';\n\n/**\n * A transparent host element that renders Intlayer content nodes.\n *\n * `display: contents` makes the `<intlayer-node>` element invisible in the\n * layout — its children appear as if they were direct children of the parent,\n * so placing this component inside `<h1>`, `<p>`, etc. does not break the\n * document structure.\n *\n * ### Usage\n * ```html\n * <h1><intlayer-node [node]=\"content().title\"></intlayer-node></h1>\n * ```\n */\n@Component({\n selector: 'intlayer-node',\n standalone: true,\n // The ng-content slot is the anchor point for ViewContainerRef.\n // Wrapping text renders directly inside this host thanks to display:contents.\n template: `<ng-container #anchor></ng-container>`,\n // display:contents collapses the host box so it is layout-transparent.\n styles: [\n `\n :host {\n display: contents;\n }\n `,\n ],\n})\nexport class IntlayerNodeComponent implements OnChanges {\n @Input() node: any;\n\n private vcr = inject(ViewContainerRef);\n private elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private cdr = inject(ChangeDetectorRef);\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['node']) {\n this.render();\n }\n }\n\n private render() {\n // Clear previously created views / text nodes\n this.vcr.clear();\n const host = this.elRef.nativeElement;\n // Remove any raw text nodes we injected directly on previous renders\n host.childNodes.forEach((n) => {\n if (n.nodeType === Node.TEXT_NODE) n.parentNode?.removeChild(n);\n });\n\n if (!this.node) return;\n\n // The node returned by the Angular plugin is a Proxy whose `.children`\n // property is a function returning component info (editor on) or the raw\n // value (editor off).\n const nodeInfo =\n typeof this.node?.children === 'function'\n ? this.node.children()\n : this.node;\n\n if (nodeInfo?.component && typeof nodeInfo.component !== 'string') {\n // ── Editor enabled path: create the ContentSelectorWrapper component ──\n const componentRef = this.vcr.createComponent(\n nodeInfo.component as Type<any>\n );\n\n if (nodeInfo.props) {\n for (const [key, value] of Object.entries(nodeInfo.props)) {\n (componentRef.instance as any)[key] = value;\n }\n }\n\n if (nodeInfo.children) {\n const content = nodeInfo.children;\n if (typeof content === 'string' || typeof content === 'number') {\n componentRef.location.nativeElement.appendChild(\n document.createTextNode(String(content))\n );\n }\n }\n\n this.cdr.markForCheck();\n } else {\n // ── Editor disabled path: render plain text inside the host ──────────\n const text =\n this.node?.value ?? this.node?.toString?.() ?? String(this.node);\n // Append a text node directly inside the host element.\n // Because the host has `display: contents`, this text is layout-wise a\n // direct child of the surrounding element (e.g. <h1>).\n host.appendChild(document.createTextNode(text));\n }\n }\n}\n"],"mappings":";;;;;;AAwCO,IAAM,wBAAN,MAAM,sBAA2C;CACtD,AAAS;CAET,AAAQ,UAAMA,sBAAOC,8BAAgB;CACrC,AAAQ,YAAQD,sBAAgCE,wBAAU;CAC1D,AAAQ,UAAMF,sBAAOG,+BAAiB;CAEtC,YAAY,SAA8B;EACxC,IAAI,QAAQ,SACV,KAAK,OAAO;CAEhB;CAEA,AAAQ,SAAS;EAEf,KAAK,IAAI,MAAM;EACf,MAAM,OAAO,KAAK,MAAM;EAExB,KAAK,WAAW,SAAS,MAAM;GAC7B,IAAI,EAAE,aAAa,KAAK,WAAW,EAAE,YAAY,YAAY,CAAC;EAChE,CAAC;EAED,IAAI,CAAC,KAAK,MAAM;EAKhB,MAAM,WACJ,OAAO,KAAK,MAAM,aAAa,aAC3B,KAAK,KAAK,SAAS,IACnB,KAAK;EAEX,IAAI,UAAU,aAAa,OAAO,SAAS,cAAc,UAAU;GAEjE,MAAM,eAAe,KAAK,IAAI,gBAC5B,SAAS,SACX;GAEA,IAAI,SAAS,OACX,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,SAAS,KAAK,GACtD,AAAC,aAAa,SAAiB,OAAO;GAI1C,IAAI,SAAS,UAAU;IACrB,MAAM,UAAU,SAAS;IACzB,IAAI,OAAO,YAAY,YAAY,OAAO,YAAY,UACpD,aAAa,SAAS,cAAc,YAClC,SAAS,eAAe,OAAO,OAAO,CAAC,CACzC;GAEJ;GAEA,KAAK,IAAI,aAAa;EACxB,OAAO;GAEL,MAAM,OACJ,KAAK,MAAM,SAAS,KAAK,MAAM,WAAW,KAAK,OAAO,KAAK,IAAI;GAIjE,KAAK,YAAY,SAAS,eAAe,IAAI,CAAC;EAChD;CACF;AACF;8BA/DGC,qBAAM;sDAhBRC,yBAAU;CACT,UAAU;CACV,YAAY;CAGZ,UAAU;CAEV,QAAQ,CACN;;;;KAKF;AACF,CAAC"}
@@ -1,4 +1,4 @@
1
- // \0@oxc-project+runtime@0.156.0/helpers/esm/decorate.js
1
+ // \0@oxc-project+runtime@0.157.0/helpers/esm/decorate.js
2
2
  function __decorate(decorators, target, key, desc) {
3
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1,4 +1,4 @@
1
- // \0@oxc-project+runtime@0.156.0/helpers/esm/decorateMetadata.js
1
+ // \0@oxc-project+runtime@0.157.0/helpers/esm/decorateMetadata.js
2
2
  function __decorateMetadata(k, v) {
3
3
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
4
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionary.cjs","names":["inject","INTLAYER_TOKEN","computed","getDictionary","resolveDictionaryArgument"],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport { resolveDictionaryArgument } from '@intlayer/core/dictionaryManipulator';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { getDictionary } from '../getDictionary';\nimport type { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\n\n/**\n * Angular hook that transforms a dictionary (or qualified dictionary group)\n * and returns its reactive content for the given locale or selector.\n */\nexport const useDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends\n | LocalesValues\n | DictionarySelectorForGroup<T> = DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): Signal<\n DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n >\n> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n /** a *stable* reactive dictionary object */\n const content = computed(() => {\n const currentLocale = intlayer?.locale();\n\n if (process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false') {\n // Layers the provider's locale and variant under the call-site argument.\n // This is also the seam the build-time optimize transform lands on, which\n // rewrites `useIntlayer('key', selector)` into `useDictionary(dict, …)`.\n return getDictionary(\n dictionary,\n resolveDictionaryArgument({\n localeOrSelector,\n contextLocale: currentLocale,\n contextVariant: intlayer?.variant?.(),\n dictionaryKey: dictionary.key,\n }) as A\n ) as any;\n }\n\n return getDictionary(\n dictionary,\n (localeOrSelector ?? currentLocale) as A\n ) as any;\n });\n\n return content; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;;;;;;AAqBA,MAAa,iBAMX,YACA,qBAMG;CACH,MAAM,eAAWA,sBAAyBC,2CAAc;CA2BxD,WAxBgBC,8BAAe;EAC7B,MAAM,gBAAgB,UAAU,OAAO;EAEvC,IAAI,QAAQ,IAAI,iCAAiC,SAI/C,OAAOC,oCACL,gBACAC,gEAA0B;GACxB;GACA,eAAe;GACf,gBAAgB,UAAU,UAAU;GACpC,eAAe,WAAW;EAC5B,CAAC,CACH;EAGF,OAAOD,oCACL,YACC,oBAAoB,aACvB;CACF,CAEa;AACf"}
1
+ {"version":3,"file":"useDictionary.cjs","names":["inject","INTLAYER_TOKEN","computed","getDictionary","resolveDictionaryArgument"],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport { resolveDictionaryArgument } from '@intlayer/core/dictionaryManipulator';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { getDictionary } from '../getDictionary';\nimport type { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\n\n/**\n * Angular hook that transforms a dictionary (or qualified dictionary group)\n * and returns its reactive content for the given locale or selector.\n */\nexport const useDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends LocalesValues | DictionarySelectorForGroup<T> =\n DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): Signal<\n DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n >\n> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n /** a *stable* reactive dictionary object */\n const content = computed(() => {\n const currentLocale = intlayer?.locale();\n\n if (process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false') {\n // Layers the provider's locale and variant under the call-site argument.\n // This is also the seam the build-time optimize transform lands on, which\n // rewrites `useIntlayer('key', selector)` into `useDictionary(dict, …)`.\n return getDictionary(\n dictionary,\n resolveDictionaryArgument({\n localeOrSelector,\n contextLocale: currentLocale,\n contextVariant: intlayer?.variant?.(),\n dictionaryKey: dictionary.key,\n }) as A\n ) as any;\n }\n\n return getDictionary(\n dictionary,\n (localeOrSelector ?? currentLocale) as A\n ) as any;\n });\n\n return content; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;;;;;;AAqBA,MAAa,iBAKX,YACA,qBAMG;CACH,MAAM,eAAWA,sBAAyBC,2CAAc;CA2BxD,WAxBgBC,8BAAe;EAC7B,MAAM,gBAAgB,UAAU,OAAO;EAEvC,IAAI,QAAQ,IAAI,iCAAiC,SAI/C,OAAOC,oCACL,gBACAC,gEAA0B;GACxB;GACA,eAAe;GACf,gBAAgB,UAAU,UAAU;GACpC,eAAe,WAAW;EAC5B,CAAC,CACH;EAGF,OAAOD,oCACL,YACC,oBAAoB,aACvB;CACF,CAEa;AACf"}
@@ -6,8 +6,8 @@ const require_client_intlayerToken = require("./intlayerToken.cjs");
6
6
  const require_client_useDictionary = require("./useDictionary.cjs");
7
7
  const require_client_useLoadDynamic = require("./useLoadDynamic.cjs");
8
8
  let _angular_core = require("@angular/core");
9
- let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
10
9
  let _intlayer_core_dictionaryManipulator = require("@intlayer/core/dictionaryManipulator");
10
+ let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
11
11
 
12
12
  // src/client/useDictionaryDynamic.ts
13
13
  /**
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_decorateMetadata = require("../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorateMetadata.cjs");
3
- const require_decorate = require("../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.cjs");
2
+ const require_decorateMetadata = require("../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/decorateMetadata.cjs");
3
+ const require_decorate = require("../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/decorate.cjs");
4
4
  let _angular_core = require("@angular/core");
5
5
 
6
6
  // src/editor/ContentSelector.component.ts
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_editor_useEditor = require("./useEditor.cjs");
3
- const require_decorateMetadata = require("../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorateMetadata.cjs");
4
- const require_decorate = require("../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.cjs");
3
+ const require_decorateMetadata = require("../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/decorateMetadata.cjs");
4
+ const require_decorate = require("../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/decorate.cjs");
5
5
  let _angular_core = require("@angular/core");
6
6
 
7
7
  // src/editor/EditorProvider.component.ts
@@ -1 +1 @@
1
- {"version":3,"file":"getDictionary.cjs","names":["getDictionaryCore","getPlugins"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import { getDictionary as getDictionaryCore } from '@intlayer/core/interpreter';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Transforms a dictionary (or qualified dictionary group) and returns its\n * content for the given locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends\n | LocalesValues\n | DictionarySelectorForGroup<T> = DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n> => {\n const locale = (\n typeof localeOrSelector === 'object' && localeOrSelector !== null\n ? localeOrSelector.locale\n : localeOrSelector\n ) as LocalesValues | undefined;\n\n return getDictionaryCore(\n dictionary,\n localeOrSelector,\n getPlugins(locale)\n ) as any;\n};\n"],"mappings":";;;;;;;;;;AAmBA,MAAa,iBAMX,YACA,qBAIG;CACH,MAAM,SACJ,OAAO,qBAAqB,YAAY,qBAAqB,OACzD,iBAAiB,SACjB;CAGN,WAAOA,0CACL,YACA,kBACAC,2BAAW,MAAM,CACnB;AACF"}
1
+ {"version":3,"file":"getDictionary.cjs","names":["getDictionaryCore","getPlugins"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import { getDictionary as getDictionaryCore } from '@intlayer/core/interpreter';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Transforms a dictionary (or qualified dictionary group) and returns its\n * content for the given locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends LocalesValues | DictionarySelectorForGroup<T> =\n DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n> => {\n const locale = (\n typeof localeOrSelector === 'object' && localeOrSelector !== null\n ? localeOrSelector.locale\n : localeOrSelector\n ) as LocalesValues | undefined;\n\n return getDictionaryCore(\n dictionary,\n localeOrSelector,\n getPlugins(locale)\n ) as any;\n};\n"],"mappings":";;;;;;;;;;AAmBA,MAAa,iBAKX,YACA,qBAIG;CACH,MAAM,SACJ,OAAO,qBAAqB,YAAY,qBAAqB,OACzD,iBAAiB,SACjB;CAGN,WAAOA,0CACL,YACA,kBACAC,2BAAW,MAAM,CACnB;AACF"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_decorate = require("../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.cjs");
2
+ const require_decorate = require("../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/decorate.cjs");
3
3
  let _angular_core = require("@angular/core");
4
4
 
5
5
  // src/html/installIntlayerHTML.ts
@@ -1,10 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_getDictionary = require("./getDictionary.cjs");
3
2
  const require_client_intlayerToken = require("./client/intlayerToken.cjs");
4
3
  const require_analytics_useAnalytics = require("./analytics/useAnalytics.cjs");
5
4
  const require_analytics_useConversion = require("./analytics/useConversion.cjs");
6
5
  const require_analytics_useExperiment = require("./analytics/useExperiment.cjs");
7
6
  const require_client_installIntlayer = require("./client/installIntlayer.cjs");
7
+ const require_getDictionary = require("./getDictionary.cjs");
8
8
  const require_getIntlayer = require("./getIntlayer.cjs");
9
9
  const require_client_useDictionary = require("./client/useDictionary.cjs");
10
10
  const require_client_useDictionaryAsync = require("./client/useDictionaryAsync.cjs");
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_decorate = require("../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.cjs");
2
+ const require_decorate = require("../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/decorate.cjs");
3
3
  let _angular_core = require("@angular/core");
4
4
  let _intlayer_core_markdown = require("@intlayer/core/markdown");
5
5
 
@@ -1,5 +1,5 @@
1
- import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorateMetadata.mjs";
2
- import __decorate from "../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.mjs";
1
+ import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/decorateMetadata.mjs";
2
+ import __decorate from "../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/decorate.mjs";
3
3
  import { ChangeDetectorRef, Component, ElementRef, Input, ViewContainerRef, inject } from "@angular/core";
4
4
 
5
5
  // src/UI/IntlayerNode.component.ts
@@ -38,7 +38,11 @@ IntlayerNodeComponent = __decorate([Component({
38
38
  selector: "intlayer-node",
39
39
  standalone: true,
40
40
  template: `<ng-container #anchor></ng-container>`,
41
- styles: [`:host { display: contents; }`]
41
+ styles: [`
42
+ :host {
43
+ display: contents;
44
+ }
45
+ `]
42
46
  })], IntlayerNodeComponent);
43
47
 
44
48
  export { IntlayerNodeComponent };
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerNode.component.mjs","names":[],"sources":["../../../src/UI/IntlayerNode.component.ts"],"sourcesContent":["import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n inject,\n type OnChanges,\n type SimpleChanges,\n type Type,\n ViewContainerRef,\n} from '@angular/core';\n\n/**\n * A transparent host element that renders Intlayer content nodes.\n *\n * `display: contents` makes the `<intlayer-node>` element invisible in the\n * layout — its children appear as if they were direct children of the parent,\n * so placing this component inside `<h1>`, `<p>`, etc. does not break the\n * document structure.\n *\n * ### Usage\n * ```html\n * <h1><intlayer-node [node]=\"content().title\"></intlayer-node></h1>\n * ```\n */\n@Component({\n selector: 'intlayer-node',\n standalone: true,\n // The ng-content slot is the anchor point for ViewContainerRef.\n // Wrapping text renders directly inside this host thanks to display:contents.\n template: `<ng-container #anchor></ng-container>`,\n // display:contents collapses the host box so it is layout-transparent.\n styles: [`:host { display: contents; }`],\n})\nexport class IntlayerNodeComponent implements OnChanges {\n @Input() node: any;\n\n private vcr = inject(ViewContainerRef);\n private elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private cdr = inject(ChangeDetectorRef);\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['node']) {\n this.render();\n }\n }\n\n private render() {\n // Clear previously created views / text nodes\n this.vcr.clear();\n const host = this.elRef.nativeElement;\n // Remove any raw text nodes we injected directly on previous renders\n host.childNodes.forEach((n) => {\n if (n.nodeType === Node.TEXT_NODE) n.parentNode?.removeChild(n);\n });\n\n if (!this.node) return;\n\n // The node returned by the Angular plugin is a Proxy whose `.children`\n // property is a function returning component info (editor on) or the raw\n // value (editor off).\n const nodeInfo =\n typeof this.node?.children === 'function'\n ? this.node.children()\n : this.node;\n\n if (nodeInfo?.component && typeof nodeInfo.component !== 'string') {\n // ── Editor enabled path: create the ContentSelectorWrapper component ──\n const componentRef = this.vcr.createComponent(\n nodeInfo.component as Type<any>\n );\n\n if (nodeInfo.props) {\n for (const [key, value] of Object.entries(nodeInfo.props)) {\n (componentRef.instance as any)[key] = value;\n }\n }\n\n if (nodeInfo.children) {\n const content = nodeInfo.children;\n if (typeof content === 'string' || typeof content === 'number') {\n componentRef.location.nativeElement.appendChild(\n document.createTextNode(String(content))\n );\n }\n }\n\n this.cdr.markForCheck();\n } else {\n // ── Editor disabled path: render plain text inside the host ──────────\n const text =\n this.node?.value ?? this.node?.toString?.() ?? String(this.node);\n // Append a text node directly inside the host element.\n // Because the host has `display: contents`, this text is layout-wise a\n // direct child of the surrounding element (e.g. <h1>).\n host.appendChild(document.createTextNode(text));\n }\n }\n}\n"],"mappings":";;;;;AAkCO,IAAM,wBAAN,MAAM,sBAA2C;CACtD,AAAS;CAET,AAAQ,MAAM,OAAO,gBAAgB;CACrC,AAAQ,QAAQ,OAAgC,UAAU;CAC1D,AAAQ,MAAM,OAAO,iBAAiB;CAEtC,YAAY,SAA8B;EACxC,IAAI,QAAQ,SACV,KAAK,OAAO;CAEhB;CAEA,AAAQ,SAAS;EAEf,KAAK,IAAI,MAAM;EACf,MAAM,OAAO,KAAK,MAAM;EAExB,KAAK,WAAW,SAAS,MAAM;GAC7B,IAAI,EAAE,aAAa,KAAK,WAAW,EAAE,YAAY,YAAY,CAAC;EAChE,CAAC;EAED,IAAI,CAAC,KAAK,MAAM;EAKhB,MAAM,WACJ,OAAO,KAAK,MAAM,aAAa,aAC3B,KAAK,KAAK,SAAS,IACnB,KAAK;EAEX,IAAI,UAAU,aAAa,OAAO,SAAS,cAAc,UAAU;GAEjE,MAAM,eAAe,KAAK,IAAI,gBAC5B,SAAS,SACX;GAEA,IAAI,SAAS,OACX,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,SAAS,KAAK,GACtD,AAAC,aAAa,SAAiB,OAAO;GAI1C,IAAI,SAAS,UAAU;IACrB,MAAM,UAAU,SAAS;IACzB,IAAI,OAAO,YAAY,YAAY,OAAO,YAAY,UACpD,aAAa,SAAS,cAAc,YAClC,SAAS,eAAe,OAAO,OAAO,CAAC,CACzC;GAEJ;GAEA,KAAK,IAAI,aAAa;EACxB,OAAO;GAEL,MAAM,OACJ,KAAK,MAAM,SAAS,KAAK,MAAM,WAAW,KAAK,OAAO,KAAK,IAAI;GAIjE,KAAK,YAAY,SAAS,eAAe,IAAI,CAAC;EAChD;CACF;AACF;YA/DG,MAAM;oCAVR,UAAU;CACT,UAAU;CACV,YAAY;CAGZ,UAAU;CAEV,QAAQ,CAAC,8BAA8B;AACzC,CAAC"}
1
+ {"version":3,"file":"IntlayerNode.component.mjs","names":[],"sources":["../../../src/UI/IntlayerNode.component.ts"],"sourcesContent":["import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n inject,\n type OnChanges,\n type SimpleChanges,\n type Type,\n ViewContainerRef,\n} from '@angular/core';\n\n/**\n * A transparent host element that renders Intlayer content nodes.\n *\n * `display: contents` makes the `<intlayer-node>` element invisible in the\n * layout — its children appear as if they were direct children of the parent,\n * so placing this component inside `<h1>`, `<p>`, etc. does not break the\n * document structure.\n *\n * ### Usage\n * ```html\n * <h1><intlayer-node [node]=\"content().title\"></intlayer-node></h1>\n * ```\n */\n@Component({\n selector: 'intlayer-node',\n standalone: true,\n // The ng-content slot is the anchor point for ViewContainerRef.\n // Wrapping text renders directly inside this host thanks to display:contents.\n template: `<ng-container #anchor></ng-container>`,\n // display:contents collapses the host box so it is layout-transparent.\n styles: [\n `\n :host {\n display: contents;\n }\n `,\n ],\n})\nexport class IntlayerNodeComponent implements OnChanges {\n @Input() node: any;\n\n private vcr = inject(ViewContainerRef);\n private elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private cdr = inject(ChangeDetectorRef);\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['node']) {\n this.render();\n }\n }\n\n private render() {\n // Clear previously created views / text nodes\n this.vcr.clear();\n const host = this.elRef.nativeElement;\n // Remove any raw text nodes we injected directly on previous renders\n host.childNodes.forEach((n) => {\n if (n.nodeType === Node.TEXT_NODE) n.parentNode?.removeChild(n);\n });\n\n if (!this.node) return;\n\n // The node returned by the Angular plugin is a Proxy whose `.children`\n // property is a function returning component info (editor on) or the raw\n // value (editor off).\n const nodeInfo =\n typeof this.node?.children === 'function'\n ? this.node.children()\n : this.node;\n\n if (nodeInfo?.component && typeof nodeInfo.component !== 'string') {\n // ── Editor enabled path: create the ContentSelectorWrapper component ──\n const componentRef = this.vcr.createComponent(\n nodeInfo.component as Type<any>\n );\n\n if (nodeInfo.props) {\n for (const [key, value] of Object.entries(nodeInfo.props)) {\n (componentRef.instance as any)[key] = value;\n }\n }\n\n if (nodeInfo.children) {\n const content = nodeInfo.children;\n if (typeof content === 'string' || typeof content === 'number') {\n componentRef.location.nativeElement.appendChild(\n document.createTextNode(String(content))\n );\n }\n }\n\n this.cdr.markForCheck();\n } else {\n // ── Editor disabled path: render plain text inside the host ──────────\n const text =\n this.node?.value ?? this.node?.toString?.() ?? String(this.node);\n // Append a text node directly inside the host element.\n // Because the host has `display: contents`, this text is layout-wise a\n // direct child of the surrounding element (e.g. <h1>).\n host.appendChild(document.createTextNode(text));\n }\n }\n}\n"],"mappings":";;;;;AAwCO,IAAM,wBAAN,MAAM,sBAA2C;CACtD,AAAS;CAET,AAAQ,MAAM,OAAO,gBAAgB;CACrC,AAAQ,QAAQ,OAAgC,UAAU;CAC1D,AAAQ,MAAM,OAAO,iBAAiB;CAEtC,YAAY,SAA8B;EACxC,IAAI,QAAQ,SACV,KAAK,OAAO;CAEhB;CAEA,AAAQ,SAAS;EAEf,KAAK,IAAI,MAAM;EACf,MAAM,OAAO,KAAK,MAAM;EAExB,KAAK,WAAW,SAAS,MAAM;GAC7B,IAAI,EAAE,aAAa,KAAK,WAAW,EAAE,YAAY,YAAY,CAAC;EAChE,CAAC;EAED,IAAI,CAAC,KAAK,MAAM;EAKhB,MAAM,WACJ,OAAO,KAAK,MAAM,aAAa,aAC3B,KAAK,KAAK,SAAS,IACnB,KAAK;EAEX,IAAI,UAAU,aAAa,OAAO,SAAS,cAAc,UAAU;GAEjE,MAAM,eAAe,KAAK,IAAI,gBAC5B,SAAS,SACX;GAEA,IAAI,SAAS,OACX,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,SAAS,KAAK,GACtD,AAAC,aAAa,SAAiB,OAAO;GAI1C,IAAI,SAAS,UAAU;IACrB,MAAM,UAAU,SAAS;IACzB,IAAI,OAAO,YAAY,YAAY,OAAO,YAAY,UACpD,aAAa,SAAS,cAAc,YAClC,SAAS,eAAe,OAAO,OAAO,CAAC,CACzC;GAEJ;GAEA,KAAK,IAAI,aAAa;EACxB,OAAO;GAEL,MAAM,OACJ,KAAK,MAAM,SAAS,KAAK,MAAM,WAAW,KAAK,OAAO,KAAK,IAAI;GAIjE,KAAK,YAAY,SAAS,eAAe,IAAI,CAAC;EAChD;CACF;AACF;YA/DG,MAAM;oCAhBR,UAAU;CACT,UAAU;CACV,YAAY;CAGZ,UAAU;CAEV,QAAQ,CACN;;;;KAKF;AACF,CAAC"}
@@ -1,4 +1,4 @@
1
- // \0@oxc-project+runtime@0.156.0/helpers/esm/decorate.js
1
+ // \0@oxc-project+runtime@0.157.0/helpers/esm/decorate.js
2
2
  function __decorate(decorators, target, key, desc) {
3
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1,4 +1,4 @@
1
- // \0@oxc-project+runtime@0.156.0/helpers/esm/decorateMetadata.js
1
+ // \0@oxc-project+runtime@0.157.0/helpers/esm/decorateMetadata.js
2
2
  function __decorateMetadata(k, v) {
3
3
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
4
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionary.mjs","names":[],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport { resolveDictionaryArgument } from '@intlayer/core/dictionaryManipulator';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { getDictionary } from '../getDictionary';\nimport type { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\n\n/**\n * Angular hook that transforms a dictionary (or qualified dictionary group)\n * and returns its reactive content for the given locale or selector.\n */\nexport const useDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends\n | LocalesValues\n | DictionarySelectorForGroup<T> = DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): Signal<\n DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n >\n> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n /** a *stable* reactive dictionary object */\n const content = computed(() => {\n const currentLocale = intlayer?.locale();\n\n if (process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false') {\n // Layers the provider's locale and variant under the call-site argument.\n // This is also the seam the build-time optimize transform lands on, which\n // rewrites `useIntlayer('key', selector)` into `useDictionary(dict, …)`.\n return getDictionary(\n dictionary,\n resolveDictionaryArgument({\n localeOrSelector,\n contextLocale: currentLocale,\n contextVariant: intlayer?.variant?.(),\n dictionaryKey: dictionary.key,\n }) as A\n ) as any;\n }\n\n return getDictionary(\n dictionary,\n (localeOrSelector ?? currentLocale) as A\n ) as any;\n });\n\n return content; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;;;;;AAqBA,MAAa,iBAMX,YACA,qBAMG;CACH,MAAM,WAAW,OAAyB,cAAc;CA2BxD,OAxBgB,eAAe;EAC7B,MAAM,gBAAgB,UAAU,OAAO;EAEvC,IAAI,QAAQ,IAAI,iCAAiC,SAI/C,OAAO,cACL,YACA,0BAA0B;GACxB;GACA,eAAe;GACf,gBAAgB,UAAU,UAAU;GACpC,eAAe,WAAW;EAC5B,CAAC,CACH;EAGF,OAAO,cACL,YACC,oBAAoB,aACvB;CACF,CAEa;AACf"}
1
+ {"version":3,"file":"useDictionary.mjs","names":[],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport { resolveDictionaryArgument } from '@intlayer/core/dictionaryManipulator';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { getDictionary } from '../getDictionary';\nimport type { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\n\n/**\n * Angular hook that transforms a dictionary (or qualified dictionary group)\n * and returns its reactive content for the given locale or selector.\n */\nexport const useDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends LocalesValues | DictionarySelectorForGroup<T> =\n DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): Signal<\n DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n >\n> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n /** a *stable* reactive dictionary object */\n const content = computed(() => {\n const currentLocale = intlayer?.locale();\n\n if (process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false') {\n // Layers the provider's locale and variant under the call-site argument.\n // This is also the seam the build-time optimize transform lands on, which\n // rewrites `useIntlayer('key', selector)` into `useDictionary(dict, …)`.\n return getDictionary(\n dictionary,\n resolveDictionaryArgument({\n localeOrSelector,\n contextLocale: currentLocale,\n contextVariant: intlayer?.variant?.(),\n dictionaryKey: dictionary.key,\n }) as A\n ) as any;\n }\n\n return getDictionary(\n dictionary,\n (localeOrSelector ?? currentLocale) as A\n ) as any;\n });\n\n return content; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;;;;;AAqBA,MAAa,iBAKX,YACA,qBAMG;CACH,MAAM,WAAW,OAAyB,cAAc;CA2BxD,OAxBgB,eAAe;EAC7B,MAAM,gBAAgB,UAAU,OAAO;EAEvC,IAAI,QAAQ,IAAI,iCAAiC,SAI/C,OAAO,cACL,YACA,0BAA0B;GACxB;GACA,eAAe;GACf,gBAAgB,UAAU,UAAU;GACpC,eAAe,WAAW;EAC5B,CAAC,CACH;EAGF,OAAO,cACL,YACC,oBAAoB,aACvB;CACF,CAEa;AACf"}
@@ -5,8 +5,8 @@ import { INTLAYER_TOKEN } from "./intlayerToken.mjs";
5
5
  import { useDictionary } from "./useDictionary.mjs";
6
6
  import { useLoadDynamic } from "./useLoadDynamic.mjs";
7
7
  import { computed, inject, signal } from "@angular/core";
8
- import { resolveInterpreterLocale } from "@intlayer/core/interpreter";
9
8
  import { getPreloadedDictionary, isQualifiedDynamicLoaderMap, parseDictionarySelector, resolveDictionaryArgument, resolveQualifiedDynamicContentAsync } from "@intlayer/core/dictionaryManipulator";
9
+ import { resolveInterpreterLocale } from "@intlayer/core/interpreter";
10
10
 
11
11
  // src/client/useDictionaryDynamic.ts
12
12
  /**
@@ -1,5 +1,5 @@
1
- import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorateMetadata.mjs";
2
- import __decorate from "../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.mjs";
1
+ import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/decorateMetadata.mjs";
2
+ import __decorate from "../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/decorate.mjs";
3
3
  import { CUSTOM_ELEMENTS_SCHEMA, Component, Input } from "@angular/core";
4
4
 
5
5
  // src/editor/ContentSelector.component.ts
@@ -1,6 +1,6 @@
1
1
  import { useEditor } from "./useEditor.mjs";
2
- import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorateMetadata.mjs";
3
- import __decorate from "../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.mjs";
2
+ import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/decorateMetadata.mjs";
3
+ import __decorate from "../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/decorate.mjs";
4
4
  import { Component } from "@angular/core";
5
5
 
6
6
  // src/editor/EditorProvider.component.ts
@@ -1 +1 @@
1
- {"version":3,"file":"getDictionary.mjs","names":["getDictionaryCore"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import { getDictionary as getDictionaryCore } from '@intlayer/core/interpreter';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Transforms a dictionary (or qualified dictionary group) and returns its\n * content for the given locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends\n | LocalesValues\n | DictionarySelectorForGroup<T> = DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n> => {\n const locale = (\n typeof localeOrSelector === 'object' && localeOrSelector !== null\n ? localeOrSelector.locale\n : localeOrSelector\n ) as LocalesValues | undefined;\n\n return getDictionaryCore(\n dictionary,\n localeOrSelector,\n getPlugins(locale)\n ) as any;\n};\n"],"mappings":";;;;;;;;;AAmBA,MAAa,iBAMX,YACA,qBAIG;CACH,MAAM,SACJ,OAAO,qBAAqB,YAAY,qBAAqB,OACzD,iBAAiB,SACjB;CAGN,OAAOA,gBACL,YACA,kBACA,WAAW,MAAM,CACnB;AACF"}
1
+ {"version":3,"file":"getDictionary.mjs","names":["getDictionaryCore"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import { getDictionary as getDictionaryCore } from '@intlayer/core/interpreter';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Transforms a dictionary (or qualified dictionary group) and returns its\n * content for the given locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends LocalesValues | DictionarySelectorForGroup<T> =\n DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n> => {\n const locale = (\n typeof localeOrSelector === 'object' && localeOrSelector !== null\n ? localeOrSelector.locale\n : localeOrSelector\n ) as LocalesValues | undefined;\n\n return getDictionaryCore(\n dictionary,\n localeOrSelector,\n getPlugins(locale)\n ) as any;\n};\n"],"mappings":";;;;;;;;;AAmBA,MAAa,iBAKX,YACA,qBAIG;CACH,MAAM,SACJ,OAAO,qBAAqB,YAAY,qBAAqB,OACzD,iBAAiB,SACjB;CAGN,OAAOA,gBACL,YACA,kBACA,WAAW,MAAM,CACnB;AACF"}
@@ -1,4 +1,4 @@
1
- import __decorate from "../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.mjs";
1
+ import __decorate from "../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/decorate.mjs";
2
2
  import { Injectable, InjectionToken, inject } from "@angular/core";
3
3
 
4
4
  // src/html/installIntlayerHTML.ts
@@ -1,9 +1,9 @@
1
- import { getDictionary } from "./getDictionary.mjs";
2
1
  import { INTLAYER_TOKEN, IntlayerProvider, createIntlayerClient } from "./client/intlayerToken.mjs";
3
2
  import { provideIntlayerAnalytics, useAnalytics } from "./analytics/useAnalytics.mjs";
4
3
  import { useConversion } from "./analytics/useConversion.mjs";
5
4
  import { useExperiment } from "./analytics/useExperiment.mjs";
6
5
  import { installIntlayer, provideIntlayer } from "./client/installIntlayer.mjs";
6
+ import { getDictionary } from "./getDictionary.mjs";
7
7
  import { getIntlayer } from "./getIntlayer.mjs";
8
8
  import { useDictionary } from "./client/useDictionary.mjs";
9
9
  import { useDictionaryAsync } from "./client/useDictionaryAsync.mjs";
@@ -1,4 +1,4 @@
1
- import __decorate from "../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.mjs";
1
+ import __decorate from "../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/decorate.mjs";
2
2
  import { Injectable, InjectionToken, inject } from "@angular/core";
3
3
  import { compile, parseMarkdown as parseMarkdown$1, renderMarkdownAst } from "@intlayer/core/markdown";
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerNode.component.d.ts","names":[],"sources":["../../../src/UI/IntlayerNode.component.ts"],"mappings":";;;;;;;;;;;;;;qBAkCa,iCAAiC;EACnC;UAED;UACA;UACA;EAER,YAAY,SAAS;UAMb"}
1
+ {"version":3,"file":"IntlayerNode.component.d.ts","names":[],"sources":["../../../src/UI/IntlayerNode.component.ts"],"mappings":";;;;;;;;;;;;;;qBAwCa,iCAAiC;EACnC;UAED;UACA;UACA;EAER,YAAY,SAAS;UAMb"}
@@ -1,5 +1,5 @@
1
- import { InjectionToken, Signal } from "@angular/core";
2
1
  import { LocalesValues, ProviderVariant } from "@intlayer/types/module_augmentation";
2
+ import { InjectionToken, Signal } from "@angular/core";
3
3
  export declare class IntlayerProvider {
4
4
  isCookieEnabled: import("@angular/core").WritableSignal<boolean>;
5
5
  private _locale;
@@ -1,6 +1,6 @@
1
1
  import { DeepTransformContent } from "../plugins.js";
2
- import { Signal } from "@angular/core";
3
2
  import { DeclaredLocales, ExtractSelectorLocale, LocalesValues } from "@intlayer/types/module_augmentation";
3
+ import { Signal } from "@angular/core";
4
4
  import { Dictionary, DictionarySelectorForGroup, QualifiedDictionaryGroup, ResolveQualifiedDictionaryContent } from "@intlayer/types/dictionary";
5
5
  /**
6
6
  * Angular hook that transforms a dictionary (or qualified dictionary group)
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../../src/client/useDictionary.ts"],"mappings":";;;;;;;;qBAqBa,sBACL,UAAU,aAAa,gCACvB,UACF,gBACA,2BAA2B,KAAK,iBAAe,YAEvC,GAAC,mBACM,MAClB,OACD,qBACE,kCAAkC,GAAG,IACrC,sBAAsB"}
1
+ {"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../../src/client/useDictionary.ts"],"mappings":";;;;;;;;qBAqBa,sBACL,UAAU,aAAa,gCACvB,UAAU,gBAAgB,2BAA2B,KACzD,iBAAe,YAEL,GAAC,mBACM,MAClB,OACD,qBACE,kCAAkC,GAAG,IACrC,sBAAsB"}
@@ -1,6 +1,6 @@
1
1
  import { DeepTransformContent } from "../plugins.js";
2
- import { Signal } from "@angular/core";
3
2
  import { DeclaredLocales, DictionaryKeys, DictionaryRegistryResult, DictionarySelectorForKey, ExtractSelectorLocale, LocalesValues } from "@intlayer/types/module_augmentation";
3
+ import { Signal } from "@angular/core";
4
4
  /** guard utility - true only for objects generated by `renderIntlayerNode()` */
5
5
  export declare const isUpdatableNode: (val: unknown) => val is {
6
6
  __update: (n: unknown) => void;
@@ -1,5 +1,5 @@
1
- import { Signal } from "@angular/core";
2
1
  import { DeclaredLocales, LocalesValues } from "@intlayer/types/module_augmentation";
2
+ import { Signal } from "@angular/core";
3
3
  export type UseLocaleProps = {
4
4
  isCookieEnabled?: boolean;
5
5
  onLocaleChange?: (locale: DeclaredLocales) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"getDictionary.d.ts","names":[],"sources":["../../src/getDictionary.ts"],"mappings":";;;;;;;;qBAmBa,sBACL,UAAU,aAAa,gCACvB,UACF,gBACA,2BAA2B,KAAK,iBAAe,YAEvC,GAAC,mBACM,MAClB,qBACD,kCAAkC,GAAG,IACrC,sBAAsB"}
1
+ {"version":3,"file":"getDictionary.d.ts","names":[],"sources":["../../src/getDictionary.ts"],"mappings":";;;;;;;;qBAmBa,sBACL,UAAU,aAAa,gCACvB,UAAU,gBAAgB,2BAA2B,KACzD,iBAAe,YAEL,GAAC,mBACM,MAClB,qBACD,kCAAkC,GAAG,IACrC,sBAAsB"}
@@ -1,4 +1,4 @@
1
- import { IntlayerNodeComponent } from "./UI/IntlayerNode.component.js";
1
+ import { IntlayerNode } from "./renderIntlayerNode.js";
2
2
  import { DeepTransformContent, HTMLPluginCond, IInterpreterPluginAngular, IInterpreterPluginState, InsertionPluginCond, IntlayerNodeCond, MarkdownCond, MarkdownStringCond, getPlugins, htmlPlugin, insertionPlugin, intlayerNodePlugins, markdownPlugin, markdownStringPlugin } from "./plugins.js";
3
3
  import { INTLAYER_TOKEN, IntlayerProvider, createIntlayerClient } from "./client/intlayerToken.js";
4
4
  import { provideIntlayerAnalytics, useAnalytics } from "./analytics/useAnalytics.js";
@@ -6,8 +6,6 @@ import { ConversionParams, useConversion } from "./analytics/useConversion.js";
6
6
  import { ExperimentState, useExperiment } from "./analytics/useExperiment.js";
7
7
  import "./analytics/index.js";
8
8
  import { installIntlayer, provideIntlayer } from "./client/installIntlayer.js";
9
- import { IntlayerNode } from "./renderIntlayerNode.js";
10
- import "./client/index.js";
11
9
  import { useDictionary } from "./client/useDictionary.js";
12
10
  import { useDictionaryAsync } from "./client/useDictionaryAsync.js";
13
11
  import { useDictionaryDynamic } from "./client/useDictionaryDynamic.js";
@@ -15,8 +13,10 @@ import { isUpdatableNode, useIntlayer } from "./client/useIntlayer.js";
15
13
  import { useLoadDynamic } from "./client/useLoadDynamic.js";
16
14
  import { UseLocaleProps, UseLocaleResult, useLocale } from "./client/useLocale.js";
17
15
  import { usePathname } from "./client/usePathname.js";
16
+ import "./client/index.js";
18
17
  import { getDictionary } from "./getDictionary.js";
19
18
  import { getIntlayer } from "./getIntlayer.js";
19
+ import { IntlayerNodeComponent } from "./UI/IntlayerNode.component.js";
20
20
  import "./UI/index.js";
21
21
  import { LocalesValues } from "@intlayer/types/module_augmentation";
22
22
  declare module '@intlayer/core/interpreter' {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;YAIY,mBAAmB,GAAG,GAAG,UAAU,uBACnC,0BAA0B,GAAG,GAAG"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;YAIY,mBACR,GACA,GACA,UAAU,uBACF,0BAA0B,GAAG,GAAG"}
package/package.json CHANGED
@@ -1,25 +1,21 @@
1
1
  {
2
2
  "name": "angular-intlayer",
3
- "version": "9.7.1",
3
+ "version": "9.7.3",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Angular applications with type-safe multilingual content management.",
6
6
  "keywords": [
7
- "intlayer",
7
+ "angular",
8
8
  "data",
9
+ "i18n",
9
10
  "internationalization",
11
+ "intlayer",
10
12
  "multilingual",
11
- "i18n",
12
- "typescript",
13
- "angular"
13
+ "typescript"
14
14
  ],
15
15
  "homepage": "https://intlayer.org",
16
16
  "bugs": {
17
17
  "url": "https://github.com/aymericzip/intlayer/issues"
18
18
  },
19
- "repository": {
20
- "type": "git",
21
- "url": "git+https://github.com/aymericzip/intlayer.git"
22
- },
23
19
  "license": "Apache-2.0",
24
20
  "author": {
25
21
  "name": "Aymeric PINEAU",
@@ -32,7 +28,43 @@
32
28
  "url": "https://github.com/aymericzip"
33
29
  }
34
30
  ],
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/aymericzip/intlayer.git"
34
+ },
35
+ "files": [
36
+ "./dist",
37
+ "./package.json"
38
+ ],
35
39
  "sideEffects": false,
40
+ "main": "dist/cjs/index.cjs",
41
+ "module": "dist/esm/index.mjs",
42
+ "types": "dist/types/index.d.ts",
43
+ "typesVersions": {
44
+ "*": {
45
+ ".": [
46
+ "./dist/types/index.d.ts"
47
+ ],
48
+ "format": [
49
+ "./dist/types/format/index.d.ts"
50
+ ],
51
+ "html": [
52
+ "./dist/types/html/index.d.ts"
53
+ ],
54
+ "markdown": [
55
+ "./dist/types/markdown/index.d.ts"
56
+ ],
57
+ "webpack": [
58
+ "./dist/types/webpack/index.d.ts"
59
+ ],
60
+ "esbuild": [
61
+ "./dist/types/esbuild/index.d.ts"
62
+ ],
63
+ "package.json": [
64
+ "./package.json"
65
+ ]
66
+ }
67
+ },
36
68
  "exports": {
37
69
  ".": {
38
70
  "types": "./dist/types/index.d.ts",
@@ -66,47 +98,15 @@
66
98
  },
67
99
  "./package.json": "./package.json"
68
100
  },
69
- "main": "dist/cjs/index.cjs",
70
- "module": "dist/esm/index.mjs",
71
- "types": "dist/types/index.d.ts",
72
- "typesVersions": {
73
- "*": {
74
- ".": [
75
- "./dist/types/index.d.ts"
76
- ],
77
- "format": [
78
- "./dist/types/format/index.d.ts"
79
- ],
80
- "html": [
81
- "./dist/types/html/index.d.ts"
82
- ],
83
- "markdown": [
84
- "./dist/types/markdown/index.d.ts"
85
- ],
86
- "webpack": [
87
- "./dist/types/webpack/index.d.ts"
88
- ],
89
- "esbuild": [
90
- "./dist/types/esbuild/index.d.ts"
91
- ],
92
- "package.json": [
93
- "./package.json"
94
- ]
95
- }
96
- },
97
- "files": [
98
- "./dist",
99
- "./package.json"
100
- ],
101
101
  "scripts": {
102
102
  "build": "bun --bun tsdown --config tsdown.config.ts",
103
103
  "build:ci": "bun --bun tsdown --config tsdown.config.ts",
104
104
  "clean": "bun --bun rimraf ./dist .turbo",
105
105
  "dev": "bun --bun tsdown --config tsdown.config.ts --watch",
106
- "format": "bun --bun biome format . --check",
107
- "format:fix": "bun --bun biome format --write .",
108
- "lint": "bun --bun biome lint .",
109
- "lint:fix": "bun --bun biome lint --write .",
106
+ "format": "oxfmt --check .",
107
+ "format:fix": "oxfmt .",
108
+ "lint": "oxlint .",
109
+ "lint:fix": "oxlint --fix .",
110
110
  "prepublish": "cp -f ../../README.md ./README.md",
111
111
  "publish": "bun publish || true",
112
112
  "publish:canary": "bun publish --access public --tag canary || true",
@@ -120,13 +120,13 @@
120
120
  "@babel/core": "^8.0.1",
121
121
  "@babel/plugin-syntax-import-attributes": "7.29.7",
122
122
  "@babel/preset-env": "8.0.7",
123
- "@intlayer/config": "9.7.1",
124
- "@intlayer/core": "9.7.1",
125
- "@intlayer/dictionaries-entry": "9.7.1",
126
- "@intlayer/editor": "9.7.1",
127
- "@intlayer/engine": "9.7.1",
128
- "@intlayer/types": "9.7.1",
129
- "@intlayer/webpack": "9.7.1",
123
+ "@intlayer/config": "9.7.3",
124
+ "@intlayer/core": "9.7.3",
125
+ "@intlayer/dictionaries-entry": "9.7.3",
126
+ "@intlayer/editor": "9.7.3",
127
+ "@intlayer/engine": "9.7.3",
128
+ "@intlayer/types": "9.7.3",
129
+ "@intlayer/webpack": "9.7.3",
130
130
  "babel-loader": "10.1.1",
131
131
  "defu": "6.1.7"
132
132
  },
@@ -139,8 +139,8 @@
139
139
  "@utils/ts-config-types": "1.0.4",
140
140
  "@utils/tsdown-config": "1.0.4",
141
141
  "esbuild": "0.28.2",
142
- "rimraf": "6.1.3",
143
- "tsdown": "0.23.4",
142
+ "rimraf": "6.1.4",
143
+ "tsdown": "0.23.7",
144
144
  "typescript": "7.0.2",
145
145
  "vitest": "5.1.0"
146
146
  },
@@ -156,7 +156,7 @@
156
156
  }
157
157
  },
158
158
  "optionalDependencies": {
159
- "@intlayer/analytics": "9.7.1"
159
+ "@intlayer/analytics": "9.7.3"
160
160
  },
161
161
  "engines": {
162
162
  "node": ">=14.18"