angular-intlayer 8.12.1 → 8.12.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 (142) hide show
  1. package/dist/cjs/UI/IntlayerNode.component.cjs +3 -2
  2. package/dist/cjs/UI/IntlayerNode.component.cjs.map +1 -1
  3. package/dist/cjs/_virtual/{_@oxc-project_runtime@0.132.0 → _@oxc-project_runtime@0.127.0}/helpers/decorate.cjs +1 -1
  4. package/dist/cjs/_virtual/{_@oxc-project_runtime@0.132.0 → _@oxc-project_runtime@0.127.0}/helpers/decorateMetadata.cjs +1 -1
  5. package/dist/cjs/client/installIntlayer.cjs.map +1 -1
  6. package/dist/cjs/client/intlayerToken.cjs +1 -0
  7. package/dist/cjs/client/intlayerToken.cjs.map +1 -1
  8. package/dist/cjs/client/useDictionary.cjs +1 -0
  9. package/dist/cjs/client/useDictionary.cjs.map +1 -1
  10. package/dist/cjs/client/useDictionaryAsync.cjs +1 -0
  11. package/dist/cjs/client/useDictionaryAsync.cjs.map +1 -1
  12. package/dist/cjs/client/useDictionaryDynamic.cjs +1 -0
  13. package/dist/cjs/client/useDictionaryDynamic.cjs.map +1 -1
  14. package/dist/cjs/client/useIntlayer.cjs +1 -0
  15. package/dist/cjs/client/useIntlayer.cjs.map +1 -1
  16. package/dist/cjs/client/useLoadDynamic.cjs +1 -0
  17. package/dist/cjs/client/useLoadDynamic.cjs.map +1 -1
  18. package/dist/cjs/client/useLocale.cjs +1 -0
  19. package/dist/cjs/client/useLocale.cjs.map +1 -1
  20. package/dist/cjs/client/useLocaleStorage.cjs +1 -0
  21. package/dist/cjs/client/useLocaleStorage.cjs.map +1 -1
  22. package/dist/cjs/editor/ContentSelector.component.cjs +3 -2
  23. package/dist/cjs/editor/ContentSelector.component.cjs.map +1 -1
  24. package/dist/cjs/editor/EditorProvider.component.cjs +3 -2
  25. package/dist/cjs/editor/EditorProvider.component.cjs.map +1 -1
  26. package/dist/cjs/editor/useEditor.cjs +1 -0
  27. package/dist/cjs/editor/useEditor.cjs.map +1 -1
  28. package/dist/cjs/esbuild/plugin.cjs +3 -2
  29. package/dist/cjs/esbuild/plugin.cjs.map +1 -1
  30. package/dist/cjs/format/useCompact.cjs +1 -0
  31. package/dist/cjs/format/useCompact.cjs.map +1 -1
  32. package/dist/cjs/format/useCurrency.cjs +1 -0
  33. package/dist/cjs/format/useCurrency.cjs.map +1 -1
  34. package/dist/cjs/format/useDate.cjs +1 -0
  35. package/dist/cjs/format/useDate.cjs.map +1 -1
  36. package/dist/cjs/format/useIntl.cjs +1 -0
  37. package/dist/cjs/format/useIntl.cjs.map +1 -1
  38. package/dist/cjs/format/useList.cjs +1 -0
  39. package/dist/cjs/format/useList.cjs.map +1 -1
  40. package/dist/cjs/format/useNumber.cjs +1 -0
  41. package/dist/cjs/format/useNumber.cjs.map +1 -1
  42. package/dist/cjs/format/usePercentage.cjs +1 -0
  43. package/dist/cjs/format/usePercentage.cjs.map +1 -1
  44. package/dist/cjs/format/useRelativeTime.cjs +1 -0
  45. package/dist/cjs/format/useRelativeTime.cjs.map +1 -1
  46. package/dist/cjs/format/useUnit.cjs +1 -0
  47. package/dist/cjs/format/useUnit.cjs.map +1 -1
  48. package/dist/cjs/getDictionary.cjs +1 -0
  49. package/dist/cjs/getDictionary.cjs.map +1 -1
  50. package/dist/cjs/getIntlayer.cjs +1 -0
  51. package/dist/cjs/getIntlayer.cjs.map +1 -1
  52. package/dist/cjs/html/installIntlayerHTML.cjs +2 -1
  53. package/dist/cjs/html/installIntlayerHTML.cjs.map +1 -1
  54. package/dist/cjs/markdown/installIntlayerMarkdown.cjs +72 -3
  55. package/dist/cjs/markdown/installIntlayerMarkdown.cjs.map +1 -1
  56. package/dist/cjs/plugins.cjs.map +1 -1
  57. package/dist/cjs/renderIntlayerNode.cjs.map +1 -1
  58. package/dist/cjs/webpack/mergeConfig.cjs +1 -0
  59. package/dist/cjs/webpack/mergeConfig.cjs.map +1 -1
  60. package/dist/esm/UI/IntlayerNode.component.mjs +2 -2
  61. package/dist/esm/UI/IntlayerNode.component.mjs.map +1 -1
  62. package/dist/esm/_virtual/{_@oxc-project_runtime@0.132.0 → _@oxc-project_runtime@0.127.0}/helpers/decorate.mjs +1 -1
  63. package/dist/esm/_virtual/{_@oxc-project_runtime@0.132.0 → _@oxc-project_runtime@0.127.0}/helpers/decorateMetadata.mjs +1 -1
  64. package/dist/esm/client/installIntlayer.mjs.map +1 -1
  65. package/dist/esm/client/intlayerToken.mjs.map +1 -1
  66. package/dist/esm/client/useDictionary.mjs.map +1 -1
  67. package/dist/esm/client/useDictionaryAsync.mjs.map +1 -1
  68. package/dist/esm/client/useDictionaryDynamic.mjs.map +1 -1
  69. package/dist/esm/client/useIntlayer.mjs.map +1 -1
  70. package/dist/esm/client/useLoadDynamic.mjs.map +1 -1
  71. package/dist/esm/client/useLocale.mjs.map +1 -1
  72. package/dist/esm/client/useLocaleStorage.mjs.map +1 -1
  73. package/dist/esm/editor/ContentSelector.component.mjs +2 -2
  74. package/dist/esm/editor/ContentSelector.component.mjs.map +1 -1
  75. package/dist/esm/editor/EditorProvider.component.mjs +2 -2
  76. package/dist/esm/editor/EditorProvider.component.mjs.map +1 -1
  77. package/dist/esm/editor/useEditor.mjs.map +1 -1
  78. package/dist/esm/esbuild/plugin.mjs +2 -2
  79. package/dist/esm/esbuild/plugin.mjs.map +1 -1
  80. package/dist/esm/format/useCompact.mjs.map +1 -1
  81. package/dist/esm/format/useCurrency.mjs.map +1 -1
  82. package/dist/esm/format/useDate.mjs.map +1 -1
  83. package/dist/esm/format/useIntl.mjs.map +1 -1
  84. package/dist/esm/format/useList.mjs.map +1 -1
  85. package/dist/esm/format/useNumber.mjs.map +1 -1
  86. package/dist/esm/format/usePercentage.mjs.map +1 -1
  87. package/dist/esm/format/useRelativeTime.mjs.map +1 -1
  88. package/dist/esm/format/useUnit.mjs.map +1 -1
  89. package/dist/esm/getDictionary.mjs.map +1 -1
  90. package/dist/esm/getIntlayer.mjs.map +1 -1
  91. package/dist/esm/html/installIntlayerHTML.mjs +1 -1
  92. package/dist/esm/html/installIntlayerHTML.mjs.map +1 -1
  93. package/dist/esm/markdown/installIntlayerMarkdown.mjs +71 -3
  94. package/dist/esm/markdown/installIntlayerMarkdown.mjs.map +1 -1
  95. package/dist/esm/plugins.mjs.map +1 -1
  96. package/dist/esm/renderIntlayerNode.mjs.map +1 -1
  97. package/dist/esm/webpack/mergeConfig.mjs.map +1 -1
  98. package/dist/types/UI/IntlayerNode.component.d.ts.map +1 -1
  99. package/dist/types/client/installIntlayer.d.ts +3 -2
  100. package/dist/types/client/installIntlayer.d.ts.map +1 -1
  101. package/dist/types/client/intlayerToken.d.ts +2 -1
  102. package/dist/types/client/intlayerToken.d.ts.map +1 -1
  103. package/dist/types/client/useDictionaryAsync.d.ts +2 -1
  104. package/dist/types/client/useDictionaryAsync.d.ts.map +1 -1
  105. package/dist/types/client/useDictionaryDynamic.d.ts +5 -3
  106. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
  107. package/dist/types/client/useIntlayer.d.ts.map +1 -1
  108. package/dist/types/client/useLocale.d.ts.map +1 -1
  109. package/dist/types/client/useLocaleStorage.d.ts +5 -5
  110. package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
  111. package/dist/types/editor/useEditor.d.ts +2 -1
  112. package/dist/types/editor/useEditor.d.ts.map +1 -1
  113. package/dist/types/esbuild/plugin.d.ts.map +1 -1
  114. package/dist/types/format/useCompact.d.ts +4 -3
  115. package/dist/types/format/useCompact.d.ts.map +1 -1
  116. package/dist/types/format/useCurrency.d.ts +4 -3
  117. package/dist/types/format/useCurrency.d.ts.map +1 -1
  118. package/dist/types/format/useDate.d.ts +6 -4
  119. package/dist/types/format/useDate.d.ts.map +1 -1
  120. package/dist/types/format/useIntl.d.ts +2 -1
  121. package/dist/types/format/useIntl.d.ts.map +1 -1
  122. package/dist/types/format/useList.d.ts +4 -3
  123. package/dist/types/format/useList.d.ts.map +1 -1
  124. package/dist/types/format/useNumber.d.ts +4 -3
  125. package/dist/types/format/useNumber.d.ts.map +1 -1
  126. package/dist/types/format/usePercentage.d.ts +4 -3
  127. package/dist/types/format/usePercentage.d.ts.map +1 -1
  128. package/dist/types/format/useRelativeTime.d.ts +4 -3
  129. package/dist/types/format/useRelativeTime.d.ts.map +1 -1
  130. package/dist/types/format/useUnit.d.ts +4 -3
  131. package/dist/types/format/useUnit.d.ts.map +1 -1
  132. package/dist/types/getDictionary.d.ts +2 -1
  133. package/dist/types/getDictionary.d.ts.map +1 -1
  134. package/dist/types/html/installIntlayerHTML.d.ts.map +1 -1
  135. package/dist/types/markdown/index.d.ts +2 -2
  136. package/dist/types/markdown/installIntlayerMarkdown.d.ts +93 -5
  137. package/dist/types/markdown/installIntlayerMarkdown.d.ts.map +1 -1
  138. package/dist/types/plugins.d.ts.map +1 -1
  139. package/dist/types/renderIntlayerNode.d.ts.map +1 -1
  140. package/dist/types/webpack/mergeConfig.d.ts.map +1 -1
  141. package/package.json +13 -13
  142. package/dist/types/intlayer/dist/types/index.d.ts +0 -4
@@ -1,6 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.132.0/helpers/decorateMetadata.cjs');
3
- const require_decorate = require('../_virtual/_@oxc-project_runtime@0.132.0/helpers/decorate.cjs');
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.127.0/helpers/decorateMetadata.cjs');
4
+ const require_decorate = require('../_virtual/_@oxc-project_runtime@0.127.0/helpers/decorate.cjs');
4
5
  let _angular_core = require("@angular/core");
5
6
 
6
7
  //#region src/UI/IntlayerNode.component.ts
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerNode.component.cjs","names":["ViewContainerRef","ElementRef","ChangeDetectorRef"],"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,kCAAM,sBAA2C;CACtD,AAAS;CAET,AAAQ,gCAAaA,8BAAgB;CACrC,AAAQ,kCAAwCC,wBAAU;CAC1D,AAAQ,gCAAaC,+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;sDA/DS;kFAVE;CACT,UAAU;CACV,YAAY;CAGZ,UAAU;CAEV,QAAQ,CAAC,8BAA8B;AACzC,CAAC"}
1
+ {"version":3,"file":"IntlayerNode.component.cjs","names":["ViewContainerRef","ElementRef","ChangeDetectorRef"],"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,kCAAM,sBAA2C;CACtD,AAAS;CAET,AAAQ,gCAAaA,+BAAiB;CACtC,AAAQ,kCAAwCC,yBAAW;CAC3D,AAAQ,gCAAaC,gCAAkB;CAEvC,YAAY,SAA8B;AACxC,MAAI,QAAQ,QACV,MAAK,QAAQ;;CAIjB,AAAQ,SAAS;AAEf,OAAK,IAAI,OAAO;EAChB,MAAM,OAAO,KAAK,MAAM;AAExB,OAAK,WAAW,SAAS,MAAM;AAC7B,OAAI,EAAE,aAAa,KAAK,UAAW,GAAE,YAAY,YAAY,EAAE;IAC/D;AAEF,MAAI,CAAC,KAAK,KAAM;EAKhB,MAAM,WACJ,OAAO,KAAK,MAAM,aAAa,aAC3B,KAAK,KAAK,UAAU,GACpB,KAAK;AAEX,MAAI,UAAU,aAAa,OAAO,SAAS,cAAc,UAAU;GAEjE,MAAM,eAAe,KAAK,IAAI,gBAC5B,SAAS,UACV;AAED,OAAI,SAAS,MACX,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,SAAS,MAAM,CACvD,CAAC,aAAa,SAAiB,OAAO;AAI1C,OAAI,SAAS,UAAU;IACrB,MAAM,UAAU,SAAS;AACzB,QAAI,OAAO,YAAY,YAAY,OAAO,YAAY,SACpD,cAAa,SAAS,cAAc,YAClC,SAAS,eAAe,OAAO,QAAQ,CAAC,CACzC;;AAIL,QAAK,IAAI,cAAc;SAClB;GAEL,MAAM,OACJ,KAAK,MAAM,SAAS,KAAK,MAAM,YAAY,IAAI,OAAO,KAAK,KAAK;AAIlE,QAAK,YAAY,SAAS,eAAe,KAAK,CAAC;;;;uDA5D3C;kFAVC;CACT,UAAU;CACV,YAAY;CAGZ,UAAU;CAEV,QAAQ,CAAC,+BAA+B;CACzC,CAAC"}
@@ -1,5 +1,5 @@
1
1
 
2
- //#region \0@oxc-project+runtime@0.132.0/helpers/decorate.js
2
+ //#region \0@oxc-project+runtime@0.127.0/helpers/decorate.js
3
3
  function __decorate(decorators, target, key, desc) {
4
4
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5
5
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1,5 +1,5 @@
1
1
 
2
- //#region \0@oxc-project+runtime@0.132.0/helpers/decorateMetadata.js
2
+ //#region \0@oxc-project+runtime@0.127.0/helpers/decorateMetadata.js
3
3
  function __decorateMetadata(k, v) {
4
4
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"installIntlayer.cjs","names":["INTLAYER_TOKEN","provideIntlayerEditor","createIntlayerClient"],"sources":["../../../src/client/installIntlayer.ts"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { provideIntlayerEditor } from '../editor/useEditor';\nimport {\n createIntlayerClient,\n INTLAYER_TOKEN,\n IntlayerProvider,\n} from './intlayerToken';\n\nexport { createIntlayerClient, INTLAYER_TOKEN, IntlayerProvider };\n\n/**\n * Provides Intlayer to your Angular application.\n *\n * Registers the Intlayer locale token **and** automatically starts the Intlayer\n * editor client (when the editor is enabled) via `provideAppInitializer`.\n *\n * This is the recommended way to set up Intlayer in `app.config.ts`.\n *\n * @param locale - Initial locale to use.\n * @param isCookieEnabled - Whether to store the locale in cookies.\n * @returns An array of Angular providers for Intlayer.\n *\n * @example\n * ```ts\n * // app.config.ts\n * import { ApplicationConfig } from '@angular/core';\n * import { provideIntlayer } from 'angular-intlayer';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [provideIntlayer()],\n * };\n * ```\n */\nexport const provideIntlayer = (\n locale?: LocalesValues,\n isCookieEnabled = true\n) => {\n const client = installIntlayer(locale, isCookieEnabled);\n\n return [\n { provide: INTLAYER_TOKEN, useValue: client },\n provideIntlayerEditor(client),\n ];\n};\n\n/**\n * Helper to install the Intlayer provider.\n */\nexport const installIntlayer = (\n locale?: LocalesValues,\n isCookieEnabled = true\n) => {\n return createIntlayerClient(locale, isCookieEnabled);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAa,mBACX,QACA,kBAAkB,SACf;CACH,MAAM,SAAS,gBAAgB,QAAQ,eAAe;CAEtD,OAAO,CACL;EAAE,SAASA;EAAgB,UAAU;CAAO,GAC5CC,+CAAsB,MAAM,CAC9B;AACF;;;;AAKA,MAAa,mBACX,QACA,kBAAkB,SACf;CACH,OAAOC,kDAAqB,QAAQ,eAAe;AACrD"}
1
+ {"version":3,"file":"installIntlayer.cjs","names":["INTLAYER_TOKEN","provideIntlayerEditor","createIntlayerClient"],"sources":["../../../src/client/installIntlayer.ts"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { provideIntlayerEditor } from '../editor/useEditor';\nimport {\n createIntlayerClient,\n INTLAYER_TOKEN,\n IntlayerProvider,\n} from './intlayerToken';\n\nexport { createIntlayerClient, INTLAYER_TOKEN, IntlayerProvider };\n\n/**\n * Provides Intlayer to your Angular application.\n *\n * Registers the Intlayer locale token **and** automatically starts the Intlayer\n * editor client (when the editor is enabled) via `provideAppInitializer`.\n *\n * This is the recommended way to set up Intlayer in `app.config.ts`.\n *\n * @param locale - Initial locale to use.\n * @param isCookieEnabled - Whether to store the locale in cookies.\n * @returns An array of Angular providers for Intlayer.\n *\n * @example\n * ```ts\n * // app.config.ts\n * import { ApplicationConfig } from '@angular/core';\n * import { provideIntlayer } from 'angular-intlayer';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [provideIntlayer()],\n * };\n * ```\n */\nexport const provideIntlayer = (\n locale?: LocalesValues,\n isCookieEnabled = true\n) => {\n const client = installIntlayer(locale, isCookieEnabled);\n\n return [\n { provide: INTLAYER_TOKEN, useValue: client },\n provideIntlayerEditor(client),\n ];\n};\n\n/**\n * Helper to install the Intlayer provider.\n */\nexport const installIntlayer = (\n locale?: LocalesValues,\n isCookieEnabled = true\n) => {\n return createIntlayerClient(locale, isCookieEnabled);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAa,mBACX,QACA,kBAAkB,SACf;CACH,MAAM,SAAS,gBAAgB,QAAQ,gBAAgB;AAEvD,QAAO,CACL;EAAE,SAASA;EAAgB,UAAU;EAAQ,EAC7CC,+CAAsB,OAAO,CAC9B;;;;;AAMH,MAAa,mBACX,QACA,kBAAkB,SACf;AACH,QAAOC,kDAAqB,QAAQ,gBAAgB"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  let _intlayer_config_built = require("@intlayer/config/built");
3
4
  let _angular_core = require("@angular/core");
4
5
  let _intlayer_config_client = require("@intlayer/config/client");
@@ -1 +1 @@
1
- {"version":3,"file":"intlayerToken.cjs","names":["internationalization","InjectionToken"],"sources":["../../../src/client/intlayerToken.ts"],"sourcesContent":["import { InjectionToken, type Signal, signal } from '@angular/core';\nimport { internationalization } from '@intlayer/config/built';\nimport { setIntlayerIdentifier } from '@intlayer/config/client';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\nexport class IntlayerProvider {\n isCookieEnabled = signal(true);\n private _locale = signal<LocalesValues>(\n internationalization.defaultLocale as LocalesValues\n );\n\n readonly locale: Signal<LocalesValues> = this._locale.asReadonly();\n\n constructor() {\n setIntlayerIdentifier();\n }\n\n setLocale = (locale: LocalesValues) => {\n this._locale.set(locale);\n };\n}\n\nexport const INTLAYER_TOKEN = new InjectionToken<IntlayerProvider>('intlayer');\n\n/**\n * Singleton instance\n */\nlet instance: IntlayerProvider | null = null;\n\n/**\n * Create and return a single IntlayerProvider instance\n */\nexport const createIntlayerClient = (\n locale?: LocalesValues,\n isCookieEnabled = true\n): IntlayerProvider => {\n if (instance) return instance;\n\n instance = new IntlayerProvider();\n\n if (locale) {\n instance.setLocale(locale);\n }\n instance.isCookieEnabled.set(isCookieEnabled);\n\n return instance;\n};\n"],"mappings":";;;;;;AAKA,IAAa,mBAAb,MAA8B;CAC5B,4CAAyB,IAAI;CAC7B,AAAQ,oCACNA,4CAAqB,aACvB;CAEA,AAAS,SAAgC,KAAK,QAAQ,WAAW;CAEjE,cAAc;EACZ,mDAAsB;CACxB;CAEA,aAAa,WAA0B;EACrC,KAAK,QAAQ,IAAI,MAAM;CACzB;AACF;AAEA,MAAa,iBAAiB,IAAIC,6BAAiC,UAAU;;;;AAK7E,IAAI,WAAoC;;;;AAKxC,MAAa,wBACX,QACA,kBAAkB,SACG;CACrB,IAAI,UAAU,OAAO;CAErB,WAAW,IAAI,iBAAiB;CAEhC,IAAI,QACF,SAAS,UAAU,MAAM;CAE3B,SAAS,gBAAgB,IAAI,eAAe;CAE5C,OAAO;AACT"}
1
+ {"version":3,"file":"intlayerToken.cjs","names":["internationalization","InjectionToken"],"sources":["../../../src/client/intlayerToken.ts"],"sourcesContent":["import { InjectionToken, type Signal, signal } from '@angular/core';\nimport { internationalization } from '@intlayer/config/built';\nimport { setIntlayerIdentifier } from '@intlayer/config/client';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\nexport class IntlayerProvider {\n isCookieEnabled = signal(true);\n private _locale = signal<LocalesValues>(\n internationalization.defaultLocale as LocalesValues\n );\n\n readonly locale: Signal<LocalesValues> = this._locale.asReadonly();\n\n constructor() {\n setIntlayerIdentifier();\n }\n\n setLocale = (locale: LocalesValues) => {\n this._locale.set(locale);\n };\n}\n\nexport const INTLAYER_TOKEN = new InjectionToken<IntlayerProvider>('intlayer');\n\n/**\n * Singleton instance\n */\nlet instance: IntlayerProvider | null = null;\n\n/**\n * Create and return a single IntlayerProvider instance\n */\nexport const createIntlayerClient = (\n locale?: LocalesValues,\n isCookieEnabled = true\n): IntlayerProvider => {\n if (instance) return instance;\n\n instance = new IntlayerProvider();\n\n if (locale) {\n instance.setLocale(locale);\n }\n instance.isCookieEnabled.set(isCookieEnabled);\n\n return instance;\n};\n"],"mappings":";;;;;;;AAKA,IAAa,mBAAb,MAA8B;CAC5B,4CAAyB,KAAK;CAC9B,AAAQ,oCACNA,4CAAqB,cACtB;CAED,AAAS,SAAgC,KAAK,QAAQ,YAAY;CAElE,cAAc;AACZ,sDAAuB;;CAGzB,aAAa,WAA0B;AACrC,OAAK,QAAQ,IAAI,OAAO;;;AAI5B,MAAa,iBAAiB,IAAIC,6BAAiC,WAAW;;;;AAK9E,IAAI,WAAoC;;;;AAKxC,MAAa,wBACX,QACA,kBAAkB,SACG;AACrB,KAAI,SAAU,QAAO;AAErB,YAAW,IAAI,kBAAkB;AAEjC,KAAI,OACF,UAAS,UAAU,OAAO;AAE5B,UAAS,gBAAgB,IAAI,gBAAgB;AAE7C,QAAO"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_getDictionary = require('../getDictionary.cjs');
3
4
  const require_client_intlayerToken = require('./intlayerToken.cjs');
4
5
  let _angular_core = require("@angular/core");
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionary.cjs","names":["INTLAYER_TOKEN","getDictionary"],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getDictionary } from '../getDictionary';\nimport type { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\n\nexport const useDictionary = <const T extends Dictionary>(\n dictionary: T,\n locale?: LocalesValues\n): Signal<DeepTransformContent<T['content']>> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n const localeTarget = computed(() => locale ?? intlayer?.locale());\n\n /** a *stable* reactive dictionary object */\n const content = computed(\n () => getDictionary<T, LocalesValues>(dictionary, localeTarget()) as any\n );\n\n return content; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;AAOA,MAAa,iBACX,YACA,WAC+C;CAC/C,MAAM,qCAAoCA,2CAAc;CAExD,MAAM,iDAA8B,UAAU,UAAU,OAAO,CAAC;CAOhE,yCAHQC,oCAAgC,YAAY,aAAa,CAAC,CAGrD;AACf"}
1
+ {"version":3,"file":"useDictionary.cjs","names":["INTLAYER_TOKEN","getDictionary"],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getDictionary } from '../getDictionary';\nimport type { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\n\nexport const useDictionary = <const T extends Dictionary>(\n dictionary: T,\n locale?: LocalesValues\n): Signal<DeepTransformContent<T['content']>> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n const localeTarget = computed(() => locale ?? intlayer?.locale());\n\n /** a *stable* reactive dictionary object */\n const content = computed(\n () => getDictionary<T, LocalesValues>(dictionary, localeTarget()) as any\n );\n\n return content; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;;AAOA,MAAa,iBACX,YACA,WAC+C;CAC/C,MAAM,qCAAoCA,4CAAe;CAEzD,MAAM,iDAA8B,UAAU,UAAU,QAAQ,CAAC;AAOjE,0CAHQC,oCAAgC,YAAY,cAAc,CAAC,CAGrD"}
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
4
5
  const require_client_intlayerToken = require('./intlayerToken.cjs');
5
6
  const require_client_useDictionary = require('./useDictionary.cjs');
6
7
  let _intlayer_config_built = require("@intlayer/config/built");
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionaryAsync.cjs","names":["INTLAYER_TOKEN","internationalization","useDictionary"],"sources":["../../../src/client/useDictionaryAsync.ts"],"sourcesContent":["'use client';\n\nimport { computed, inject } from '@angular/core';\nimport { internationalization } from '@intlayer/config/built';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\nimport { useDictionary } from './useDictionary';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryAsync = async <const T extends Dictionary>(\n dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,\n locale?: LocalesValues\n) => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n const localeTarget = computed(\n () => locale ?? intlayer?.locale() ?? internationalization.defaultLocale\n );\n\n const dictionary = await (dictionaryPromise as any)[localeTarget()]?.();\n\n return useDictionary(dictionary, localeTarget() as any);\n};\n"],"mappings":";;;;;;;;;;;;;;AAiBA,MAAa,qBAAqB,OAChC,mBACA,WACG;CACH,MAAM,qCAAoCA,2CAAc;CAExD,MAAM,iDACE,UAAU,UAAU,OAAO,KAAKC,4CAAqB,aAC7D;CAIA,OAAOC,2CAAc,MAFK,kBAA0B,aAAa,KAAK,GAErC,aAAa,CAAQ;AACxD"}
1
+ {"version":3,"file":"useDictionaryAsync.cjs","names":["INTLAYER_TOKEN","internationalization","useDictionary"],"sources":["../../../src/client/useDictionaryAsync.ts"],"sourcesContent":["'use client';\n\nimport { computed, inject } from '@angular/core';\nimport { internationalization } from '@intlayer/config/built';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\nimport { useDictionary } from './useDictionary';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryAsync = async <const T extends Dictionary>(\n dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,\n locale?: LocalesValues\n) => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n const localeTarget = computed(\n () => locale ?? intlayer?.locale() ?? internationalization.defaultLocale\n );\n\n const dictionary = await (dictionaryPromise as any)[localeTarget()]?.();\n\n return useDictionary(dictionary, localeTarget() as any);\n};\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,MAAa,qBAAqB,OAChC,mBACA,WACG;CACH,MAAM,qCAAoCA,4CAAe;CAEzD,MAAM,iDACE,UAAU,UAAU,QAAQ,IAAIC,4CAAqB,cAC5D;AAID,QAAOC,2CAAc,MAFK,kBAA0B,cAAc,KAAK,EAEtC,cAAc,CAAQ"}
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
4
5
  const require_client_intlayerToken = require('./intlayerToken.cjs');
5
6
  const require_client_useDictionary = require('./useDictionary.cjs');
6
7
  const require_client_useLoadDynamic = require('./useLoadDynamic.cjs');
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionaryDynamic.cjs","names":["INTLAYER_TOKEN","internationalization","useDictionary","useLoadDynamic"],"sources":["../../../src/client/useDictionaryDynamic.ts"],"sourcesContent":["'use client';\n\nimport { computed, inject } from '@angular/core';\nimport { internationalization } from '@intlayer/config/built';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DictionaryKeys,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\nimport { useDictionary } from './useDictionary';\nimport { useLoadDynamic } from './useLoadDynamic';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryDynamic = <\n const T extends Dictionary,\n const K extends DictionaryKeys,\n>(\n dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,\n key: K,\n locale?: LocalesValues\n) => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n const localeTarget = computed(\n () => locale ?? intlayer?.locale() ?? internationalization.defaultLocale\n );\n\n const dictionary = useLoadDynamic<T>(\n `${String(key)}.${localeTarget()}`,\n (dictionaryPromise as any)[localeTarget()]?.()\n ) as T;\n\n return useDictionary(dictionary, localeTarget() as any);\n};\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAa,wBAIX,mBACA,KACA,WACG;CACH,MAAM,qCAAoCA,2CAAc;CAExD,MAAM,iDACE,UAAU,UAAU,OAAO,KAAKC,4CAAqB,aAC7D;CAOA,OAAOC,2CALYC,6CACjB,GAAG,OAAO,GAAG,EAAE,GAAG,aAAa,KAC9B,kBAA0B,aAAa,KAAK,CAGjB,GAAG,aAAa,CAAQ;AACxD"}
1
+ {"version":3,"file":"useDictionaryDynamic.cjs","names":["INTLAYER_TOKEN","internationalization","useDictionary","useLoadDynamic"],"sources":["../../../src/client/useDictionaryDynamic.ts"],"sourcesContent":["'use client';\n\nimport { computed, inject } from '@angular/core';\nimport { internationalization } from '@intlayer/config/built';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DictionaryKeys,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\nimport { useDictionary } from './useDictionary';\nimport { useLoadDynamic } from './useLoadDynamic';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryDynamic = <\n const T extends Dictionary,\n const K extends DictionaryKeys,\n>(\n dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,\n key: K,\n locale?: LocalesValues\n) => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n const localeTarget = computed(\n () => locale ?? intlayer?.locale() ?? internationalization.defaultLocale\n );\n\n const dictionary = useLoadDynamic<T>(\n `${String(key)}.${localeTarget()}`,\n (dictionaryPromise as any)[localeTarget()]?.()\n ) as T;\n\n return useDictionary(dictionary, localeTarget() as any);\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,MAAa,wBAIX,mBACA,KACA,WACG;CACH,MAAM,qCAAoCA,4CAAe;CAEzD,MAAM,iDACE,UAAU,UAAU,QAAQ,IAAIC,4CAAqB,cAC5D;AAOD,QAAOC,2CALYC,6CACjB,GAAG,OAAO,IAAI,CAAC,GAAG,cAAc,IAC/B,kBAA0B,cAAc,KAAK,CAGjB,EAAE,cAAc,CAAQ"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_getIntlayer = require('../getIntlayer.cjs');
3
4
  const require_client_intlayerToken = require('./intlayerToken.cjs');
4
5
  let _angular_core = require("@angular/core");
@@ -1 +1 @@
1
- {"version":3,"file":"useIntlayer.cjs","names":["INTLAYER_TOKEN","getIntlayer"],"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport type {\n DictionaryKeys,\n DictionaryRegistryContent,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { getIntlayer } from '../getIntlayer';\nimport type { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\n\n/** guard utility - true only for objects generated by `renderIntlayerNode()` */\nexport const isUpdatableNode = (\n val: unknown\n): val is { __update: (n: unknown) => void } =>\n !!val &&\n typeof val === 'object' &&\n typeof (val as any).__update === 'function';\n\n/**\n * Angular hook that picks one dictionary by its key and returns its reactive content.\n *\n * It utilizes Angular signals to provide deep reactivity, ensuring your components\n * update automatically when the locale changes.\n *\n * @param key - The unique key of the dictionary to retrieve.\n * @param locale - Optional locale to override the current context locale.\n * @returns The transformed dictionary content.\n *\n * @example\n * ```ts\n * import { Component } from '@angular/core';\n * import { useIntlayer } from 'angular-intlayer';\n *\n * @Component({\n * standalone: true,\n * selector: 'app-my-component',\n * template: `<div>{{ content().myField.value }}</div>`,\n * })\n * export class MyComponent {\n * content = useIntlayer('my-dictionary-key');\n * }\n * ```\n */\nexport const useIntlayer = <\n const T extends DictionaryKeys,\n const L extends LocalesValues,\n>(\n key: T,\n locale?: LocalesValues\n): Signal<DeepTransformContent<DictionaryRegistryContent<T>>> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN)!;\n\n /** which locale should we use right now? */\n const localeTarget = computed(() => locale ?? intlayer.locale());\n\n /** a *stable* reactive dictionary object */\n // @ts-ignore Type instantiation is excessively deep and possibly infinite\n const content = computed(\n () => getIntlayer<T, L>(key, localeTarget() as L) as any\n );\n\n return content; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;;AAWA,MAAa,mBACX,QAEA,CAAC,CAAC,OACF,OAAO,QAAQ,YACf,OAAQ,IAAY,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BnC,MAAa,eAIX,KACA,WAC+D;CAC/D,MAAM,qCAAoCA,2CAAc;;CAGxD,MAAM,iDAA8B,UAAU,SAAS,OAAO,CAAC;CAQ/D,yCAHQC,gCAAkB,KAAK,aAAa,CAAM,CAGrC;AACf"}
1
+ {"version":3,"file":"useIntlayer.cjs","names":["INTLAYER_TOKEN","getIntlayer"],"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport type {\n DictionaryKeys,\n DictionaryRegistryContent,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { getIntlayer } from '../getIntlayer';\nimport type { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\n\n/** guard utility - true only for objects generated by `renderIntlayerNode()` */\nexport const isUpdatableNode = (\n val: unknown\n): val is { __update: (n: unknown) => void } =>\n !!val &&\n typeof val === 'object' &&\n typeof (val as any).__update === 'function';\n\n/**\n * Angular hook that picks one dictionary by its key and returns its reactive content.\n *\n * It utilizes Angular signals to provide deep reactivity, ensuring your components\n * update automatically when the locale changes.\n *\n * @param key - The unique key of the dictionary to retrieve.\n * @param locale - Optional locale to override the current context locale.\n * @returns The transformed dictionary content.\n *\n * @example\n * ```ts\n * import { Component } from '@angular/core';\n * import { useIntlayer } from 'angular-intlayer';\n *\n * @Component({\n * standalone: true,\n * selector: 'app-my-component',\n * template: `<div>{{ content().myField.value }}</div>`,\n * })\n * export class MyComponent {\n * content = useIntlayer('my-dictionary-key');\n * }\n * ```\n */\nexport const useIntlayer = <\n const T extends DictionaryKeys,\n const L extends LocalesValues,\n>(\n key: T,\n locale?: LocalesValues\n): Signal<DeepTransformContent<DictionaryRegistryContent<T>>> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN)!;\n\n /** which locale should we use right now? */\n const localeTarget = computed(() => locale ?? intlayer.locale());\n\n /** a *stable* reactive dictionary object */\n // @ts-ignore Type instantiation is excessively deep and possibly infinite\n const content = computed(\n () => getIntlayer<T, L>(key, localeTarget() as L) as any\n );\n\n return content; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;;;AAWA,MAAa,mBACX,QAEA,CAAC,CAAC,OACF,OAAO,QAAQ,YACf,OAAQ,IAAY,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BnC,MAAa,eAIX,KACA,WAC+D;CAC/D,MAAM,qCAAoCA,4CAAe;;CAGzD,MAAM,iDAA8B,UAAU,SAAS,QAAQ,CAAC;AAQhE,0CAHQC,gCAAkB,KAAK,cAAc,CAAM,CAGrC"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  let _angular_core = require("@angular/core");
3
4
 
4
5
  //#region src/client/useLoadDynamic.ts
@@ -1 +1 @@
1
- {"version":3,"file":"useLoadDynamic.cjs","names":[],"sources":["../../../src/client/useLoadDynamic.ts"],"sourcesContent":["import { signal } from '@angular/core';\n\n/**\n * A \"synchronous\" loader for a dynamically‐imported JSON (or anything).\n *\n * - Immediately returns a reactive signal so that Angular can properly track changes.\n * - When the Promise resolves, it replaces the signal's value with the real data.\n */\nexport const useLoadDynamic = <T extends Record<string, any>>(\n key: string,\n promise: Promise<T>\n): T => {\n // A module‐level cache of Promises, so we only import once per key.\n const cache: Map<string, Promise<T>> = (useLoadDynamic as any)._cache ||\n ((useLoadDynamic as any)._cache = new Map());\n\n // Hold the \"current\" value as a reactive signal\n // This starts as an empty object but Angular can track changes to it\n const container = signal({} as T);\n\n if (!cache.has(key)) {\n // Kick off the dynamic import & cache it\n const p = promise.then((real) => {\n // As soon as the import resolves, update the signal with the real data\n container.set(real);\n return real;\n });\n cache.set(key, p);\n } else {\n // If it's already in flight (or done), hook into it so that the container still updates\n cache.get(key)?.then((real) => {\n container.set(real);\n });\n }\n\n // Return the current signal value directly - Angular can track all changes to it\n return container();\n};\n"],"mappings":";;;;;;;;;;AAQA,MAAa,kBACX,KACA,YACM;CAEN,MAAM,QAAkC,eAAuB,WAC9D,AAAC,eAAuB,yBAAS,IAAI,IAAI;CAI1C,MAAM,sCAAmB,CAAC,CAAM;CAEhC,IAAI,CAAC,MAAM,IAAI,GAAG,GAAG;EAEnB,MAAM,IAAI,QAAQ,MAAM,SAAS;GAE/B,UAAU,IAAI,IAAI;GAClB,OAAO;EACT,CAAC;EACD,MAAM,IAAI,KAAK,CAAC;CAClB,OAEE,MAAM,IAAI,GAAG,GAAG,MAAM,SAAS;EAC7B,UAAU,IAAI,IAAI;CACpB,CAAC;CAIH,OAAO,UAAU;AACnB"}
1
+ {"version":3,"file":"useLoadDynamic.cjs","names":[],"sources":["../../../src/client/useLoadDynamic.ts"],"sourcesContent":["import { signal } from '@angular/core';\n\n/**\n * A \"synchronous\" loader for a dynamically‐imported JSON (or anything).\n *\n * - Immediately returns a reactive signal so that Angular can properly track changes.\n * - When the Promise resolves, it replaces the signal's value with the real data.\n */\nexport const useLoadDynamic = <T extends Record<string, any>>(\n key: string,\n promise: Promise<T>\n): T => {\n // A module‐level cache of Promises, so we only import once per key.\n const cache: Map<string, Promise<T>> = (useLoadDynamic as any)._cache ||\n ((useLoadDynamic as any)._cache = new Map());\n\n // Hold the \"current\" value as a reactive signal\n // This starts as an empty object but Angular can track changes to it\n const container = signal({} as T);\n\n if (!cache.has(key)) {\n // Kick off the dynamic import & cache it\n const p = promise.then((real) => {\n // As soon as the import resolves, update the signal with the real data\n container.set(real);\n return real;\n });\n cache.set(key, p);\n } else {\n // If it's already in flight (or done), hook into it so that the container still updates\n cache.get(key)?.then((real) => {\n container.set(real);\n });\n }\n\n // Return the current signal value directly - Angular can track all changes to it\n return container();\n};\n"],"mappings":";;;;;;;;;;;AAQA,MAAa,kBACX,KACA,YACM;CAEN,MAAM,QAAkC,eAAuB,WAC9D,AAAC,eAAuB,yBAAS,IAAI,KAAK;CAI3C,MAAM,sCAAmB,EAAE,CAAM;AAEjC,KAAI,CAAC,MAAM,IAAI,IAAI,EAAE;EAEnB,MAAM,IAAI,QAAQ,MAAM,SAAS;AAE/B,aAAU,IAAI,KAAK;AACnB,UAAO;IACP;AACF,QAAM,IAAI,KAAK,EAAE;OAGjB,OAAM,IAAI,IAAI,EAAE,MAAM,SAAS;AAC7B,YAAU,IAAI,KAAK;GACnB;AAIJ,QAAO,WAAW"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_client_intlayerToken = require('./intlayerToken.cjs');
3
4
  const require_client_useLocaleStorage = require('./useLocaleStorage.cjs');
4
5
  let _intlayer_config_built = require("@intlayer/config/built");
@@ -1 +1 @@
1
- {"version":3,"file":"useLocale.cjs","names":["internationalization","INTLAYER_TOKEN"],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport { internationalization } from '@intlayer/config/built';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\nimport { setLocaleInStorage } from './useLocaleStorage';\n\nexport type UseLocaleProps = {\n isCookieEnabled?: boolean;\n onLocaleChange?: (locale: DeclaredLocales) => void;\n};\n\nexport type UseLocaleResult = {\n locale: Signal<DeclaredLocales>;\n defaultLocale: DeclaredLocales;\n availableLocales: DeclaredLocales[];\n setLocale: (locale: LocalesValues) => void;\n};\n\n/**\n * Angular hook to manage the current locale and related functions.\n *\n * @param props - Optional configuration for locale management.\n * @returns An object containing the current locale (signal), default locale, available locales, and a function to update the locale.\n *\n * @example\n * ```ts\n * import { Component } from '@angular/core';\n * import { useLocale } from 'angular-intlayer';\n *\n * @Component({\n * standalone: true,\n * selector: 'app-locale-switcher',\n * template: `\n * <select [value]=\"locale()\" (change)=\"setLocale($any($event.target).value)\">\n * @for (loc of availableLocales; track loc) {\n * <option [value]=\"loc\">{{ loc }}</option>\n * }\n * </select>\n * `,\n * })\n * export class LocaleSwitcher {\n * const { locale, setLocale, availableLocales } = useLocale();\n * }\n * ```\n */\nexport const useLocale = ({\n isCookieEnabled,\n onLocaleChange,\n}: UseLocaleProps = {}): UseLocaleResult => {\n const { defaultLocale, locales: availableLocales } =\n internationalization ?? {};\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n // Create a reactive reference for the locale\n const locale = computed(\n () => (intlayer?.locale() ?? defaultLocale) as DeclaredLocales\n );\n const isCookieEnabledContext = computed(\n () => intlayer?.isCookieEnabled() ?? true\n );\n\n const setLocale = (newLocale: LocalesValues) => {\n if (!availableLocales?.map(String).includes(newLocale)) {\n console.error(`Locale ${newLocale} is not available`);\n return;\n }\n\n if (intlayer) {\n intlayer.setLocale(newLocale);\n }\n setLocaleInStorage(\n newLocale,\n isCookieEnabled ?? isCookieEnabledContext() ?? true\n );\n onLocaleChange?.(newLocale as DeclaredLocales);\n };\n\n return {\n locale, // Current locale\n defaultLocale, // Principal locale defined in config\n availableLocales, // List of the available locales defined in config\n setLocale, // Function to set the locale\n } as UseLocaleResult;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAa,aAAa,EACxB,iBACA,mBACkB,CAAC,MAAuB;CAC1C,MAAM,EAAE,eAAe,SAAS,qBAC9BA,+CAAwB,CAAC;CAC3B,MAAM,qCAAoCC,2CAAc;CAGxD,MAAM,2CACG,UAAU,OAAO,KAAK,aAC/B;CACA,MAAM,2DACE,UAAU,gBAAgB,KAAK,IACvC;CAEA,MAAM,aAAa,cAA6B;EAC9C,IAAI,CAAC,kBAAkB,IAAI,MAAM,EAAE,SAAS,SAAS,GAAG;GACtD,QAAQ,MAAM,UAAU,UAAU,kBAAkB;GACpD;EACF;EAEA,IAAI,UACF,SAAS,UAAU,SAAS;EAE9B,mDACE,WACA,mBAAmB,uBAAuB,KAAK,IACjD;EACA,iBAAiB,SAA4B;CAC/C;CAEA,OAAO;EACL;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"useLocale.cjs","names":["internationalization","INTLAYER_TOKEN"],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport { internationalization } from '@intlayer/config/built';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\nimport { setLocaleInStorage } from './useLocaleStorage';\n\nexport type UseLocaleProps = {\n isCookieEnabled?: boolean;\n onLocaleChange?: (locale: DeclaredLocales) => void;\n};\n\nexport type UseLocaleResult = {\n locale: Signal<DeclaredLocales>;\n defaultLocale: DeclaredLocales;\n availableLocales: DeclaredLocales[];\n setLocale: (locale: LocalesValues) => void;\n};\n\n/**\n * Angular hook to manage the current locale and related functions.\n *\n * @param props - Optional configuration for locale management.\n * @returns An object containing the current locale (signal), default locale, available locales, and a function to update the locale.\n *\n * @example\n * ```ts\n * import { Component } from '@angular/core';\n * import { useLocale } from 'angular-intlayer';\n *\n * @Component({\n * standalone: true,\n * selector: 'app-locale-switcher',\n * template: `\n * <select [value]=\"locale()\" (change)=\"setLocale($any($event.target).value)\">\n * @for (loc of availableLocales; track loc) {\n * <option [value]=\"loc\">{{ loc }}</option>\n * }\n * </select>\n * `,\n * })\n * export class LocaleSwitcher {\n * const { locale, setLocale, availableLocales } = useLocale();\n * }\n * ```\n */\nexport const useLocale = ({\n isCookieEnabled,\n onLocaleChange,\n}: UseLocaleProps = {}): UseLocaleResult => {\n const { defaultLocale, locales: availableLocales } =\n internationalization ?? {};\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n // Create a reactive reference for the locale\n const locale = computed(\n () => (intlayer?.locale() ?? defaultLocale) as DeclaredLocales\n );\n const isCookieEnabledContext = computed(\n () => intlayer?.isCookieEnabled() ?? true\n );\n\n const setLocale = (newLocale: LocalesValues) => {\n if (!availableLocales?.map(String).includes(newLocale)) {\n console.error(`Locale ${newLocale} is not available`);\n return;\n }\n\n if (intlayer) {\n intlayer.setLocale(newLocale);\n }\n setLocaleInStorage(\n newLocale,\n isCookieEnabled ?? isCookieEnabledContext() ?? true\n );\n onLocaleChange?.(newLocale as DeclaredLocales);\n };\n\n return {\n locale, // Current locale\n defaultLocale, // Principal locale defined in config\n availableLocales, // List of the available locales defined in config\n setLocale, // Function to set the locale\n } as UseLocaleResult;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAa,aAAa,EACxB,iBACA,mBACkB,EAAE,KAAsB;CAC1C,MAAM,EAAE,eAAe,SAAS,qBAC9BA,+CAAwB,EAAE;CAC5B,MAAM,qCAAoCC,4CAAe;CAGzD,MAAM,2CACG,UAAU,QAAQ,IAAI,cAC9B;CACD,MAAM,2DACE,UAAU,iBAAiB,IAAI,KACtC;CAED,MAAM,aAAa,cAA6B;AAC9C,MAAI,CAAC,kBAAkB,IAAI,OAAO,CAAC,SAAS,UAAU,EAAE;AACtD,WAAQ,MAAM,UAAU,UAAU,mBAAmB;AACrD;;AAGF,MAAI,SACF,UAAS,UAAU,UAAU;AAE/B,qDACE,WACA,mBAAmB,wBAAwB,IAAI,KAChD;AACD,mBAAiB,UAA6B;;AAGhD,QAAO;EACL;EACA;EACA;EACA;EACD"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  let _intlayer_core_utils = require("@intlayer/core/utils");
3
4
 
4
5
  //#region src/client/useLocaleStorage.ts
@@ -1 +1 @@
1
- {"version":3,"file":"useLocaleStorage.cjs","names":["localeStorageOptions"],"sources":["../../../src/client/useLocaleStorage.ts"],"sourcesContent":["import {\n getLocaleFromStorageClient,\n LocaleStorageClient,\n localeStorageOptions,\n setLocaleInStorageClient as setLocaleInStorageCore,\n} from '@intlayer/core/utils';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\n/**\n * Get the locale cookie\n */\n/**\n * Get the locale cookie\n */\nexport const localeInStorage = getLocaleFromStorageClient(localeStorageOptions);\n/**\n * @deprecated Use localeInStorage instead\n *\n * Get the locale cookie\n */\nexport const localeCookie = localeInStorage;\n\n/**\n * Set the locale cookie\n */\nexport const setLocaleInStorage = (\n locale: LocalesValues,\n isCookieEnabled: boolean\n) =>\n setLocaleInStorageCore(locale, {\n ...localeStorageOptions,\n isCookieEnabled,\n });\n\n/**\n * @deprecated Use setLocaleInStorage instead\n *\n * Set the locale cookie\n */\nexport const setLocaleCookie = setLocaleInStorage;\n\n/**\n * Hook that provides the locale storage and a function to set it\n */\nexport const useLocaleStorage = (isCookieEnabled?: boolean) =>\n LocaleStorageClient({\n ...localeStorageOptions,\n isCookieEnabled,\n });\n\n/**\n * @deprecated Use useLocaleStorage instead\n *\n * For GDPR compliance, use useLocaleStorage instead\n *\n * Hook that provides the locale cookie and a function to set it\n */\nexport const useLocaleCookie = (isCookieEnabled?: boolean) => {\n const storage = useLocaleStorage(isCookieEnabled);\n\n return {\n localeCookie: storage.getLocale(),\n setLocaleCookie: storage.setLocale,\n };\n};\n"],"mappings":";;;;;;;;;;AAcA,MAAa,uEAA6CA,yCAAoB;;;;;;AAM9E,MAAa,eAAe;;;;AAK5B,MAAa,sBACX,QACA,uEAEuB,QAAQ;CAC7B,GAAGA;CACH;AACF,CAAC;;;;;;AAOH,MAAa,kBAAkB;;;;AAK/B,MAAa,oBAAoB,kEACX;CAClB,GAAGA;CACH;AACF,CAAC;;;;;;;;AASH,MAAa,mBAAmB,oBAA8B;CAC5D,MAAM,UAAU,iBAAiB,eAAe;CAEhD,OAAO;EACL,cAAc,QAAQ,UAAU;EAChC,iBAAiB,QAAQ;CAC3B;AACF"}
1
+ {"version":3,"file":"useLocaleStorage.cjs","names":["localeStorageOptions"],"sources":["../../../src/client/useLocaleStorage.ts"],"sourcesContent":["import {\n getLocaleFromStorageClient,\n LocaleStorageClient,\n localeStorageOptions,\n setLocaleInStorageClient as setLocaleInStorageCore,\n} from '@intlayer/core/utils';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\n/**\n * Get the locale cookie\n */\n/**\n * Get the locale cookie\n */\nexport const localeInStorage = getLocaleFromStorageClient(localeStorageOptions);\n/**\n * @deprecated Use localeInStorage instead\n *\n * Get the locale cookie\n */\nexport const localeCookie = localeInStorage;\n\n/**\n * Set the locale cookie\n */\nexport const setLocaleInStorage = (\n locale: LocalesValues,\n isCookieEnabled: boolean\n) =>\n setLocaleInStorageCore(locale, {\n ...localeStorageOptions,\n isCookieEnabled,\n });\n\n/**\n * @deprecated Use setLocaleInStorage instead\n *\n * Set the locale cookie\n */\nexport const setLocaleCookie = setLocaleInStorage;\n\n/**\n * Hook that provides the locale storage and a function to set it\n */\nexport const useLocaleStorage = (isCookieEnabled?: boolean) =>\n LocaleStorageClient({\n ...localeStorageOptions,\n isCookieEnabled,\n });\n\n/**\n * @deprecated Use useLocaleStorage instead\n *\n * For GDPR compliance, use useLocaleStorage instead\n *\n * Hook that provides the locale cookie and a function to set it\n */\nexport const useLocaleCookie = (isCookieEnabled?: boolean) => {\n const storage = useLocaleStorage(isCookieEnabled);\n\n return {\n localeCookie: storage.getLocale(),\n setLocaleCookie: storage.setLocale,\n };\n};\n"],"mappings":";;;;;;;;;;;AAcA,MAAa,uEAA6CA,0CAAqB;;;;;;AAM/E,MAAa,eAAe;;;;AAK5B,MAAa,sBACX,QACA,uEAEuB,QAAQ;CAC7B,GAAGA;CACH;CACD,CAAC;;;;;;AAOJ,MAAa,kBAAkB;;;;AAK/B,MAAa,oBAAoB,kEACX;CAClB,GAAGA;CACH;CACD,CAAC;;;;;;;;AASJ,MAAa,mBAAmB,oBAA8B;CAC5D,MAAM,UAAU,iBAAiB,gBAAgB;AAEjD,QAAO;EACL,cAAc,QAAQ,WAAW;EACjC,iBAAiB,QAAQ;EAC1B"}
@@ -1,6 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.132.0/helpers/decorateMetadata.cjs');
3
- const require_decorate = require('../_virtual/_@oxc-project_runtime@0.132.0/helpers/decorate.cjs');
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.127.0/helpers/decorateMetadata.cjs');
4
+ const require_decorate = require('../_virtual/_@oxc-project_runtime@0.127.0/helpers/decorate.cjs');
4
5
  let _angular_core = require("@angular/core");
5
6
 
6
7
  //#region src/editor/ContentSelector.component.ts
@@ -1 +1 @@
1
- {"version":3,"file":"ContentSelector.component.cjs","names":["CUSTOM_ELEMENTS_SCHEMA"],"sources":["../../../src/editor/ContentSelector.component.ts"],"sourcesContent":["import { Component, CUSTOM_ELEMENTS_SCHEMA, Input } from '@angular/core';\n\n@Component({\n selector: 'app-content-selector-wrapper',\n standalone: true,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `\n <intlayer-content-selector-wrapper\n [attr.key-path]=\"keyPathJson\"\n [attr.dictionary-key]=\"dictionaryKey\"\n >\n <ng-content></ng-content>\n </intlayer-content-selector-wrapper>\n `,\n})\nexport class ContentSelectorWrapperComponent {\n @Input() dictionaryKey!: string;\n @Input() keyPath!: any[];\n\n get keyPathJson() {\n return JSON.stringify(this.keyPath);\n }\n}\n"],"mappings":";;;;;;AAeO,4CAAM,gCAAgC;CAC3C,AAAS;CACT,AAAS;CAET,IAAI,cAAc;EAChB,OAAO,KAAK,UAAU,KAAK,OAAO;CACpC;AACF;sDANS;sDACA;4FAfE;CACT,UAAU;CACV,YAAY;CACZ,SAAS,CAACA,oCAAsB;CAChC,UAAU;;;;;;;;AAQZ,CAAC"}
1
+ {"version":3,"file":"ContentSelector.component.cjs","names":["CUSTOM_ELEMENTS_SCHEMA"],"sources":["../../../src/editor/ContentSelector.component.ts"],"sourcesContent":["import { Component, CUSTOM_ELEMENTS_SCHEMA, Input } from '@angular/core';\n\n@Component({\n selector: 'app-content-selector-wrapper',\n standalone: true,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `\n <intlayer-content-selector-wrapper\n [attr.key-path]=\"keyPathJson\"\n [attr.dictionary-key]=\"dictionaryKey\"\n >\n <ng-content></ng-content>\n </intlayer-content-selector-wrapper>\n `,\n})\nexport class ContentSelectorWrapperComponent {\n @Input() dictionaryKey!: string;\n @Input() keyPath!: any[];\n\n get keyPathJson() {\n return JSON.stringify(this.keyPath);\n }\n}\n"],"mappings":";;;;;;;AAeO,4CAAM,gCAAgC;CAC3C,AAAS;CACT,AAAS;CAET,IAAI,cAAc;AAChB,SAAO,KAAK,UAAU,KAAK,QAAQ;;;uDAJ7B;uDACA;4FAfC;CACT,UAAU;CACV,YAAY;CACZ,SAAS,CAACA,qCAAuB;CACjC,UAAU;;;;;;;;CAQX,CAAC"}
@@ -1,6 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.132.0/helpers/decorateMetadata.cjs');
3
- const require_decorate = require('../_virtual/_@oxc-project_runtime@0.132.0/helpers/decorate.cjs');
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.127.0/helpers/decorateMetadata.cjs');
4
+ const require_decorate = require('../_virtual/_@oxc-project_runtime@0.127.0/helpers/decorate.cjs');
4
5
  const require_editor_useEditor = require('./useEditor.cjs');
5
6
  let _angular_core = require("@angular/core");
6
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"EditorProvider.component.cjs","names":[],"sources":["../../../src/editor/EditorProvider.component.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { useEditor } from './useEditor';\n\n/**\n * Drop-in Angular equivalent of React's `EditorProvider`.\n *\n * Wrap your root component (or any subtree) with this component to automatically\n * start the Intlayer editor client. The editor will be started on mount and\n * stopped when this component is destroyed.\n *\n * @example\n * ```html\n * <!-- app.component.html -->\n * <intlayer-editor-provider>\n * <router-outlet />\n * </intlayer-editor-provider>\n * ```\n *\n * ```ts\n * // app.component.ts\n * import { EditorProviderComponent } from 'angular-intlayer';\n *\n * @Component({\n * imports: [EditorProviderComponent],\n * …\n * })\n * export class AppComponent {}\n * ```\n */\n@Component({\n selector: 'intlayer-editor-provider',\n standalone: true,\n template: `<ng-content />`,\n})\nexport class EditorProviderComponent {\n constructor() {\n useEditor();\n }\n}\n"],"mappings":";;;;;;;AAkCO,oCAAM,wBAAwB;CACnC,cAAc;EACZ,mCAAU;CACZ;AACF;oFATW;CACT,UAAU;CACV,YAAY;CACZ,UAAU;AACZ,CAAC"}
1
+ {"version":3,"file":"EditorProvider.component.cjs","names":[],"sources":["../../../src/editor/EditorProvider.component.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { useEditor } from './useEditor';\n\n/**\n * Drop-in Angular equivalent of React's `EditorProvider`.\n *\n * Wrap your root component (or any subtree) with this component to automatically\n * start the Intlayer editor client. The editor will be started on mount and\n * stopped when this component is destroyed.\n *\n * @example\n * ```html\n * <!-- app.component.html -->\n * <intlayer-editor-provider>\n * <router-outlet />\n * </intlayer-editor-provider>\n * ```\n *\n * ```ts\n * // app.component.ts\n * import { EditorProviderComponent } from 'angular-intlayer';\n *\n * @Component({\n * imports: [EditorProviderComponent],\n * …\n * })\n * export class AppComponent {}\n * ```\n */\n@Component({\n selector: 'intlayer-editor-provider',\n standalone: true,\n template: `<ng-content />`,\n})\nexport class EditorProviderComponent {\n constructor() {\n useEditor();\n }\n}\n"],"mappings":";;;;;;;;AAkCO,oCAAM,wBAAwB;CACnC,cAAc;AACZ,sCAAW;;;oFAPJ;CACT,UAAU;CACV,YAAY;CACZ,UAAU;CACX,CAAC"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
3
4
  let _angular_core = require("@angular/core");
4
5
  let _intlayer_editor_isEnabled = require("@intlayer/editor/isEnabled");
@@ -1 +1 @@
1
- {"version":3,"file":"useEditor.cjs","names":["isEnabled","DestroyRef","Injector","INTLAYER_TOKEN"],"sources":["../../../src/editor/useEditor.ts"],"sourcesContent":["import {\n DestroyRef,\n effect,\n Injector,\n inject,\n provideAppInitializer,\n runInInjectionContext,\n signal,\n} from '@angular/core';\nimport type { EditorStateManager } from '@intlayer/editor';\nimport { isEnabled } from '@intlayer/editor/isEnabled';\nimport type { Locale } from '@intlayer/types/allLocales';\n// Import from the standalone token file to avoid a circular dependency:\n// installIntlayer.ts → useEditor.ts → ../client → installIntlayer.ts\nimport { INTLAYER_TOKEN, type IntlayerProvider } from '../client/intlayerToken';\n\n/**\n * Initialises the Intlayer editor client singleton when the editor is enabled.\n * Syncs the current locale from the provided Intlayer client into the editor\n * manager so the editor always knows which locale the app is displaying.\n *\n * Must be called inside an Angular injection context (e.g. a component\n * constructor, `provideAppInitializer`, or `runInInjectionContext`).\n *\n * @param client - The IntlayerProvider instance to sync locale from.\n * When omitted the function injects `INTLAYER_TOKEN` from the DI tree,\n * so it still works when called directly from a component.\n */\nexport const useEditor = (client?: IntlayerProvider | null): void => {\n if (process.env['INTLAYER_EDITOR_ENABLED'] === 'false' || !isEnabled) return;\n\n const destroyRef = inject(DestroyRef, { optional: true });\n const injector = inject(Injector);\n\n // Resolve the client: use the passed-in reference or fall back to injection.\n const resolvedClient =\n client ??\n inject<IntlayerProvider>(INTLAYER_TOKEN, { optional: true } as any);\n\n // `manager` signal is set once the async import resolves.\n // Using a signal lets an `effect()` react to it becoming available.\n const manager = signal<EditorStateManager | null>(null);\n\n // Guard: prevents the async callback from acting after the view is destroyed.\n let stopped = false;\n\n // Initialise the editor client\n import('@intlayer/editor').then(({ initEditorClient }) => {\n if (stopped) return;\n manager.set(initEditorClient());\n });\n\n // Keep the editor locale in sync with the Angular locale signal\n const effectRef = runInInjectionContext(injector, () =>\n effect(() => {\n const m = manager();\n const locale = resolvedClient?.locale();\n if (m && locale) m.currentLocale.set(locale as Locale);\n })\n );\n\n // Tear down on destroy\n destroyRef?.onDestroy(() => {\n stopped = true;\n effectRef.destroy();\n manager.set(null);\n import('@intlayer/editor').then(({ stopEditorClient }) => {\n stopEditorClient();\n });\n });\n};\n\n/**\n * Angular provider that wires `useEditor` into the application initialisation\n * phase via `provideAppInitializer`.\n *\n * `provideIntlayer()` already calls this internally, so you only need this\n * function when you want to manage providers individually.\n *\n * @example\n * ```ts\n * // app.config.ts\n * import { provideIntlayer, provideIntlayerEditor } from 'angular-intlayer';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [provideIntlayer(), provideIntlayerEditor()],\n * };\n * ```\n */\nexport const provideIntlayerEditor = (client?: IntlayerProvider | null) =>\n provideAppInitializer(() => useEditor(client));\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4BA,MAAa,aAAa,WAA2C;CACnE,IAAI,QAAQ,IAAI,+BAA+B,WAAW,CAACA,sCAAW;CAEtE,MAAM,uCAAoBC,0BAAY,EAAE,UAAU,KAAK,CAAC;CACxD,MAAM,qCAAkBC,sBAAQ;CAGhC,MAAM,iBACJ,oCACyBC,6CAAgB,EAAE,UAAU,KAAK,CAAQ;CAIpE,MAAM,oCAA4C,IAAI;CAGtD,IAAI,UAAU;CAGd,OAAO,oBAAoB,MAAM,EAAE,uBAAuB;EACxD,IAAI,SAAS;EACb,QAAQ,IAAI,iBAAiB,CAAC;CAChC,CAAC;CAGD,MAAM,qDAAkC,gDACzB;EACX,MAAM,IAAI,QAAQ;EAClB,MAAM,SAAS,gBAAgB,OAAO;EACtC,IAAI,KAAK,QAAQ,EAAE,cAAc,IAAI,MAAgB;CACvD,CAAC,CACH;CAGA,YAAY,gBAAgB;EAC1B,UAAU;EACV,UAAU,QAAQ;EAClB,QAAQ,IAAI,IAAI;EAChB,OAAO,oBAAoB,MAAM,EAAE,uBAAuB;GACxD,iBAAiB;EACnB,CAAC;CACH,CAAC;AACH;;;;;;;;;;;;;;;;;;AAmBA,MAAa,yBAAyB,0DACR,UAAU,MAAM,CAAC"}
1
+ {"version":3,"file":"useEditor.cjs","names":["isEnabled","DestroyRef","Injector","INTLAYER_TOKEN"],"sources":["../../../src/editor/useEditor.ts"],"sourcesContent":["import {\n DestroyRef,\n effect,\n Injector,\n inject,\n provideAppInitializer,\n runInInjectionContext,\n signal,\n} from '@angular/core';\nimport type { EditorStateManager } from '@intlayer/editor';\nimport { isEnabled } from '@intlayer/editor/isEnabled';\nimport type { Locale } from '@intlayer/types/allLocales';\n// Import from the standalone token file to avoid a circular dependency:\n// installIntlayer.ts → useEditor.ts → ../client → installIntlayer.ts\nimport { INTLAYER_TOKEN, type IntlayerProvider } from '../client/intlayerToken';\n\n/**\n * Initialises the Intlayer editor client singleton when the editor is enabled.\n * Syncs the current locale from the provided Intlayer client into the editor\n * manager so the editor always knows which locale the app is displaying.\n *\n * Must be called inside an Angular injection context (e.g. a component\n * constructor, `provideAppInitializer`, or `runInInjectionContext`).\n *\n * @param client - The IntlayerProvider instance to sync locale from.\n * When omitted the function injects `INTLAYER_TOKEN` from the DI tree,\n * so it still works when called directly from a component.\n */\nexport const useEditor = (client?: IntlayerProvider | null): void => {\n if (process.env['INTLAYER_EDITOR_ENABLED'] === 'false' || !isEnabled) return;\n\n const destroyRef = inject(DestroyRef, { optional: true });\n const injector = inject(Injector);\n\n // Resolve the client: use the passed-in reference or fall back to injection.\n const resolvedClient =\n client ??\n inject<IntlayerProvider>(INTLAYER_TOKEN, { optional: true } as any);\n\n // `manager` signal is set once the async import resolves.\n // Using a signal lets an `effect()` react to it becoming available.\n const manager = signal<EditorStateManager | null>(null);\n\n // Guard: prevents the async callback from acting after the view is destroyed.\n let stopped = false;\n\n // Initialise the editor client\n import('@intlayer/editor').then(({ initEditorClient }) => {\n if (stopped) return;\n manager.set(initEditorClient());\n });\n\n // Keep the editor locale in sync with the Angular locale signal\n const effectRef = runInInjectionContext(injector, () =>\n effect(() => {\n const m = manager();\n const locale = resolvedClient?.locale();\n if (m && locale) m.currentLocale.set(locale as Locale);\n })\n );\n\n // Tear down on destroy\n destroyRef?.onDestroy(() => {\n stopped = true;\n effectRef.destroy();\n manager.set(null);\n import('@intlayer/editor').then(({ stopEditorClient }) => {\n stopEditorClient();\n });\n });\n};\n\n/**\n * Angular provider that wires `useEditor` into the application initialisation\n * phase via `provideAppInitializer`.\n *\n * `provideIntlayer()` already calls this internally, so you only need this\n * function when you want to manage providers individually.\n *\n * @example\n * ```ts\n * // app.config.ts\n * import { provideIntlayer, provideIntlayerEditor } from 'angular-intlayer';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [provideIntlayer(), provideIntlayerEditor()],\n * };\n * ```\n */\nexport const provideIntlayerEditor = (client?: IntlayerProvider | null) =>\n provideAppInitializer(() => useEditor(client));\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA4BA,MAAa,aAAa,WAA2C;AACnE,KAAI,QAAQ,IAAI,+BAA+B,WAAW,CAACA,qCAAW;CAEtE,MAAM,uCAAoBC,0BAAY,EAAE,UAAU,MAAM,CAAC;CACzD,MAAM,qCAAkBC,uBAAS;CAGjC,MAAM,iBACJ,oCACyBC,6CAAgB,EAAE,UAAU,MAAM,CAAQ;CAIrE,MAAM,oCAA4C,KAAK;CAGvD,IAAI,UAAU;AAGd,QAAO,oBAAoB,MAAM,EAAE,uBAAuB;AACxD,MAAI,QAAS;AACb,UAAQ,IAAI,kBAAkB,CAAC;GAC/B;CAGF,MAAM,qDAAkC,gDACzB;EACX,MAAM,IAAI,SAAS;EACnB,MAAM,SAAS,gBAAgB,QAAQ;AACvC,MAAI,KAAK,OAAQ,GAAE,cAAc,IAAI,OAAiB;GACtD,CACH;AAGD,aAAY,gBAAgB;AAC1B,YAAU;AACV,YAAU,SAAS;AACnB,UAAQ,IAAI,KAAK;AACjB,SAAO,oBAAoB,MAAM,EAAE,uBAAuB;AACxD,qBAAkB;IAClB;GACF;;;;;;;;;;;;;;;;;;;AAoBJ,MAAa,yBAAyB,0DACR,UAAU,OAAO,CAAC"}
@@ -1,12 +1,13 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  let node_path = require("node:path");
4
+ let _intlayer_config_node = require("@intlayer/config/node");
5
+ let _intlayer_config_utils = require("@intlayer/config/utils");
3
6
  let _intlayer_chokidar_build = require("@intlayer/chokidar/build");
4
7
  let _intlayer_chokidar_cli = require("@intlayer/chokidar/cli");
5
8
  let _intlayer_chokidar_watcher = require("@intlayer/chokidar/watcher");
6
9
  let _intlayer_config_envVars = require("@intlayer/config/envVars");
7
10
  let _intlayer_config_logger = require("@intlayer/config/logger");
8
- let _intlayer_config_node = require("@intlayer/config/node");
9
- let _intlayer_config_utils = require("@intlayer/config/utils");
10
11
  let _intlayer_dictionaries_entry = require("@intlayer/dictionaries-entry");
11
12
 
12
13
  //#region src/esbuild/plugin.ts
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs","names":[],"sources":["../../../src/esbuild/plugin.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { prepareIntlayer } from '@intlayer/chokidar/build';\nimport { logConfigDetails } from '@intlayer/chokidar/cli';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport {\n formatNodeTypeToEnvVar,\n getConfigEnvVars,\n} from '@intlayer/config/envVars';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\nimport { getAlias, getUnusedNodeTypesAsync } from '@intlayer/config/utils';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\n\n// Minimal subset of the esbuild Plugin interface to avoid a hard dependency on\n// the `esbuild` package for type resolution. The shape is compatible with\n// esbuild >=0.17, `@angular-builders/custom-esbuild`, and NX esbuild builders.\nexport interface EsbuildPluginBuild {\n initialOptions: {\n alias?: Record<string, string>;\n define?: Record<string, string>;\n minify?: boolean;\n watch?: unknown;\n /** Absolute working directory of the esbuild context (set by Angular's builder). */\n absWorkingDir?: string;\n };\n onStart(callback: () => void | Promise<void>): void;\n /** Intercept module resolution — works even for imports inside node_modules. */\n onResolve(\n options: { filter: RegExp; namespace?: string },\n callback: (args: {\n path: string;\n importer: string;\n namespace: string;\n resolveDir: string;\n }) => { path: string; namespace?: string } | null | undefined\n ): void;\n}\n\nexport interface EsbuildPlugin {\n name: string;\n setup(build: EsbuildPluginBuild): void | Promise<void>;\n}\n\nexport type IntlayerEsbuildPluginOptions = {\n configOptions?: GetConfigurationOptions;\n /**\n * Whether to start the Intlayer file watcher for dictionary regeneration.\n * - `true`: always start the watcher (useful for `ng serve`)\n * - `false`: never start the watcher (useful for `ng build`)\n * - `undefined` (default): auto-detect based on the build context\n * (skips the watcher when a production build is detected)\n */\n watch?: boolean;\n};\n\n/**\n * esbuild plugin that integrates Intlayer into the Angular (or any esbuild-based) build process.\n *\n * Handles:\n * 1. Injecting `alias` entries so `@intlayer/dictionaries-entry` etc. resolve to\n * the generated files under `.intlayer/`.\n * 2. Defining `process.env.*` tree-shaking constants for production builds.\n * 3. Running `prepareIntlayer` (dictionary generation) before the first build.\n * 4. Starting the chokidar file-watcher in dev / serve mode.\n *\n * Compatible with:\n * - `@angular-builders/custom-esbuild` (`application` or `browser-esbuild` builder)\n * - NX `@nx/angular:browser-esbuild`\n * - Any raw esbuild setup that accepts the standard `Plugin` interface\n *\n * @example\n * ```ts\n * // esbuild.plugins.ts (referenced from angular.json \"plugins\" option)\n * import { intlayerEsbuildPlugin } from 'angular-intlayer/esbuild';\n * export default [intlayerEsbuildPlugin()];\n * ```\n */\nexport const intlayerEsbuildPlugin = (\n options?: IntlayerEsbuildPluginOptions\n): EsbuildPlugin => {\n // All Node.js-heavy initialization (getConfiguration, getAlias, …) is deferred\n // into setup() so it runs in esbuild's Node.js context, not at module-evaluation\n // time. @angular/build loads the plugin file through Vite's SSR module runner\n // (ESM) where CommonJS globals like __filename are undefined. Calling\n // getConfiguration() here would trigger: buildSync → worker threads →\n // __filename → ReferenceError, crashing the plugin before setup() ever runs.\n let config: ReturnType<typeof getConfiguration> | null = null;\n let alias: Record<string, string> | null = null;\n\n // Shared across parallel setup() calls (Angular spawns one per bundle context).\n let preparePromise: Promise<void> | null = null;\n let watcherStarted = false;\n // Once any esbuild context (browser or server) detects a production build,\n // suppress the watcher for all contexts so `ng build` can exit cleanly.\n let isBuildMode = false;\n\n return {\n name: 'intlayer',\n\n async setup(build) {\n if (!config) {\n const baseDir =\n build.initialOptions.absWorkingDir ??\n options?.configOptions?.baseDir ??\n process.cwd();\n\n config = getConfiguration({ baseDir, ...options?.configOptions });\n logConfigDetails({ baseDir, ...options?.configOptions });\n\n alias = getAlias({\n configuration: config,\n formatter: (value: string) => join(config!.system.baseDir, value),\n });\n }\n\n const appLogger = getAppLogger(config);\n const nodeEnvDefine =\n build.initialOptions.define?.['process.env.NODE_ENV'];\n\n // Angular's esbuild builder doesn't set `minify` or `process.env.NODE_ENV`\n // on initialOptions — it handles optimisation through its own pipeline.\n // Instead, Angular defines `ngDevMode` as `\"false\"` in production builds.\n const isProduction =\n nodeEnvDefine === '\"production\"' ||\n nodeEnvDefine === \"'production'\" ||\n build.initialOptions.minify === true ||\n build.initialOptions.define?.['ngDevMode'] === 'false';\n\n if (isProduction) {\n isBuildMode = true;\n }\n\n const envVars: Record<string, string> = {\n INTLAYER: 'true',\n NODE_ENV: isProduction ? 'production' : 'development',\n };\n\n if (isProduction) {\n const dictionaries = getDictionaries(config);\n if (Object.keys(dictionaries).length === 0) {\n appLogger('No dictionaries found. Please check your configuration.', {\n isVerbose: true,\n });\n }\n\n const unusedNodeTypes = await getUnusedNodeTypesAsync(dictionaries);\n Object.assign(\n envVars,\n formatNodeTypeToEnvVar(unusedNodeTypes),\n getConfigEnvVars(config)\n );\n }\n\n build.initialOptions.alias = {\n ...alias,\n ...(build.initialOptions.alias ?? {}),\n };\n\n for (const [from, to] of Object.entries(alias!)) {\n const escapedFrom = from.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\n build.onResolve({ filter: new RegExp(`^${escapedFrom}$`) }, () => ({\n path: to,\n }));\n }\n\n if (!preparePromise) {\n preparePromise = prepareIntlayer(config, {\n clean: isProduction,\n cacheTimeoutMs: isProduction ? 1000 * 30 : 1000 * 60 * 60,\n env: isProduction ? 'prod' : 'dev',\n });\n }\n\n await preparePromise;\n\n build.onStart(async () => {\n // Determine whether the watcher should run:\n // 1. Explicit option from the caller takes precedence\n // 2. If any esbuild context detected a production build, skip\n // 3. esbuild's own watch mode is a positive signal\n const shouldWatch = options?.watch ?? !isBuildMode;\n\n if (shouldWatch && !watcherStarted) {\n watcherStarted = true;\n\n await watch({ configuration: config! });\n }\n });\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiFA,MAAa,yBACX,YACkB;CAOlB,IAAI,SAAqD;CACzD,IAAI,QAAuC;CAG3C,IAAI,iBAAuC;CAC3C,IAAI,iBAAiB;CAGrB,IAAI,cAAc;CAElB,OAAO;EACL,MAAM;EAEN,MAAM,MAAM,OAAO;GACjB,IAAI,CAAC,QAAQ;IACX,MAAM,UACJ,MAAM,eAAe,iBACrB,SAAS,eAAe,WACxB,QAAQ,IAAI;IAEd,qDAA0B;KAAE;KAAS,GAAG,SAAS;IAAc,CAAC;IAChE,6CAAiB;KAAE;KAAS,GAAG,SAAS;IAAc,CAAC;IAEvD,6CAAiB;KACf,eAAe;KACf,YAAY,8BAAuB,OAAQ,OAAO,SAAS,KAAK;IAClE,CAAC;GACH;GAEA,MAAM,sDAAyB,MAAM;GACrC,MAAM,gBACJ,MAAM,eAAe,SAAS;GAKhC,MAAM,eACJ,kBAAkB,oBAClB,kBAAkB,kBAClB,MAAM,eAAe,WAAW,QAChC,MAAM,eAAe,SAAS,iBAAiB;GAEjD,IAAI,cACF,cAAc;GAGhB,MAAM,UAAkC;IACtC,UAAU;IACV,UAAU,eAAe,eAAe;GAC1C;GAEA,IAAI,cAAc;IAChB,MAAM,iEAA+B,MAAM;IAC3C,IAAI,OAAO,KAAK,YAAY,EAAE,WAAW,GACvC,UAAU,2DAA2D,EACnE,WAAW,KACb,CAAC;IAGH,MAAM,kBAAkB,0DAA8B,YAAY;IAClE,OAAO,OACL,8DACuB,eAAe,kDACrB,MAAM,CACzB;GACF;GAEA,MAAM,eAAe,QAAQ;IAC3B,GAAG;IACH,GAAI,MAAM,eAAe,SAAS,CAAC;GACrC;GAEA,KAAK,MAAM,CAAC,MAAM,OAAO,OAAO,QAAQ,KAAM,GAAG;IAC/C,MAAM,cAAc,KAAK,QAAQ,uBAAuB,MAAM;IAE9D,MAAM,UAAU,EAAE,QAAQ,IAAI,OAAO,IAAI,YAAY,EAAE,EAAE,UAAU,EACjE,MAAM,GACR,EAAE;GACJ;GAEA,IAAI,CAAC,gBACH,+DAAiC,QAAQ;IACvC,OAAO;IACP,gBAAgB,eAAe,MAAO,KAAK,MAAO,KAAK;IACvD,KAAK,eAAe,SAAS;GAC/B,CAAC;GAGH,MAAM;GAEN,MAAM,QAAQ,YAAY;IAOxB,KAFoB,SAAS,SAAS,CAAC,gBAEpB,CAAC,gBAAgB;KAClC,iBAAiB;KAEjB,4CAAY,EAAE,eAAe,OAAQ,CAAC;IACxC;GACF,CAAC;EACH;CACF;AACF"}
1
+ {"version":3,"file":"plugin.cjs","names":[],"sources":["../../../src/esbuild/plugin.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { prepareIntlayer } from '@intlayer/chokidar/build';\nimport { logConfigDetails } from '@intlayer/chokidar/cli';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport {\n formatNodeTypeToEnvVar,\n getConfigEnvVars,\n} from '@intlayer/config/envVars';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\nimport { getAlias, getUnusedNodeTypesAsync } from '@intlayer/config/utils';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\n\n// Minimal subset of the esbuild Plugin interface to avoid a hard dependency on\n// the `esbuild` package for type resolution. The shape is compatible with\n// esbuild >=0.17, `@angular-builders/custom-esbuild`, and NX esbuild builders.\nexport interface EsbuildPluginBuild {\n initialOptions: {\n alias?: Record<string, string>;\n define?: Record<string, string>;\n minify?: boolean;\n watch?: unknown;\n /** Absolute working directory of the esbuild context (set by Angular's builder). */\n absWorkingDir?: string;\n };\n onStart(callback: () => void | Promise<void>): void;\n /** Intercept module resolution — works even for imports inside node_modules. */\n onResolve(\n options: { filter: RegExp; namespace?: string },\n callback: (args: {\n path: string;\n importer: string;\n namespace: string;\n resolveDir: string;\n }) => { path: string; namespace?: string } | null | undefined\n ): void;\n}\n\nexport interface EsbuildPlugin {\n name: string;\n setup(build: EsbuildPluginBuild): void | Promise<void>;\n}\n\nexport type IntlayerEsbuildPluginOptions = {\n configOptions?: GetConfigurationOptions;\n /**\n * Whether to start the Intlayer file watcher for dictionary regeneration.\n * - `true`: always start the watcher (useful for `ng serve`)\n * - `false`: never start the watcher (useful for `ng build`)\n * - `undefined` (default): auto-detect based on the build context\n * (skips the watcher when a production build is detected)\n */\n watch?: boolean;\n};\n\n/**\n * esbuild plugin that integrates Intlayer into the Angular (or any esbuild-based) build process.\n *\n * Handles:\n * 1. Injecting `alias` entries so `@intlayer/dictionaries-entry` etc. resolve to\n * the generated files under `.intlayer/`.\n * 2. Defining `process.env.*` tree-shaking constants for production builds.\n * 3. Running `prepareIntlayer` (dictionary generation) before the first build.\n * 4. Starting the chokidar file-watcher in dev / serve mode.\n *\n * Compatible with:\n * - `@angular-builders/custom-esbuild` (`application` or `browser-esbuild` builder)\n * - NX `@nx/angular:browser-esbuild`\n * - Any raw esbuild setup that accepts the standard `Plugin` interface\n *\n * @example\n * ```ts\n * // esbuild.plugins.ts (referenced from angular.json \"plugins\" option)\n * import { intlayerEsbuildPlugin } from 'angular-intlayer/esbuild';\n * export default [intlayerEsbuildPlugin()];\n * ```\n */\nexport const intlayerEsbuildPlugin = (\n options?: IntlayerEsbuildPluginOptions\n): EsbuildPlugin => {\n // All Node.js-heavy initialization (getConfiguration, getAlias, …) is deferred\n // into setup() so it runs in esbuild's Node.js context, not at module-evaluation\n // time. @angular/build loads the plugin file through Vite's SSR module runner\n // (ESM) where CommonJS globals like __filename are undefined. Calling\n // getConfiguration() here would trigger: buildSync → worker threads →\n // __filename → ReferenceError, crashing the plugin before setup() ever runs.\n let config: ReturnType<typeof getConfiguration> | null = null;\n let alias: Record<string, string> | null = null;\n\n // Shared across parallel setup() calls (Angular spawns one per bundle context).\n let preparePromise: Promise<void> | null = null;\n let watcherStarted = false;\n // Once any esbuild context (browser or server) detects a production build,\n // suppress the watcher for all contexts so `ng build` can exit cleanly.\n let isBuildMode = false;\n\n return {\n name: 'intlayer',\n\n async setup(build) {\n if (!config) {\n const baseDir =\n build.initialOptions.absWorkingDir ??\n options?.configOptions?.baseDir ??\n process.cwd();\n\n config = getConfiguration({ baseDir, ...options?.configOptions });\n logConfigDetails({ baseDir, ...options?.configOptions });\n\n alias = getAlias({\n configuration: config,\n formatter: (value: string) => join(config!.system.baseDir, value),\n });\n }\n\n const appLogger = getAppLogger(config);\n const nodeEnvDefine =\n build.initialOptions.define?.['process.env.NODE_ENV'];\n\n // Angular's esbuild builder doesn't set `minify` or `process.env.NODE_ENV`\n // on initialOptions — it handles optimisation through its own pipeline.\n // Instead, Angular defines `ngDevMode` as `\"false\"` in production builds.\n const isProduction =\n nodeEnvDefine === '\"production\"' ||\n nodeEnvDefine === \"'production'\" ||\n build.initialOptions.minify === true ||\n build.initialOptions.define?.['ngDevMode'] === 'false';\n\n if (isProduction) {\n isBuildMode = true;\n }\n\n const envVars: Record<string, string> = {\n INTLAYER: 'true',\n NODE_ENV: isProduction ? 'production' : 'development',\n };\n\n if (isProduction) {\n const dictionaries = getDictionaries(config);\n if (Object.keys(dictionaries).length === 0) {\n appLogger('No dictionaries found. Please check your configuration.', {\n isVerbose: true,\n });\n }\n\n const unusedNodeTypes = await getUnusedNodeTypesAsync(dictionaries);\n Object.assign(\n envVars,\n formatNodeTypeToEnvVar(unusedNodeTypes),\n getConfigEnvVars(config)\n );\n }\n\n build.initialOptions.alias = {\n ...alias,\n ...(build.initialOptions.alias ?? {}),\n };\n\n for (const [from, to] of Object.entries(alias!)) {\n const escapedFrom = from.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\n build.onResolve({ filter: new RegExp(`^${escapedFrom}$`) }, () => ({\n path: to,\n }));\n }\n\n if (!preparePromise) {\n preparePromise = prepareIntlayer(config, {\n clean: isProduction,\n cacheTimeoutMs: isProduction ? 1000 * 30 : 1000 * 60 * 60,\n env: isProduction ? 'prod' : 'dev',\n });\n }\n\n await preparePromise;\n\n build.onStart(async () => {\n // Determine whether the watcher should run:\n // 1. Explicit option from the caller takes precedence\n // 2. If any esbuild context detected a production build, skip\n // 3. esbuild's own watch mode is a positive signal\n const shouldWatch = options?.watch ?? !isBuildMode;\n\n if (shouldWatch && !watcherStarted) {\n watcherStarted = true;\n\n await watch({ configuration: config! });\n }\n });\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiFA,MAAa,yBACX,YACkB;CAOlB,IAAI,SAAqD;CACzD,IAAI,QAAuC;CAG3C,IAAI,iBAAuC;CAC3C,IAAI,iBAAiB;CAGrB,IAAI,cAAc;AAElB,QAAO;EACL,MAAM;EAEN,MAAM,MAAM,OAAO;AACjB,OAAI,CAAC,QAAQ;IACX,MAAM,UACJ,MAAM,eAAe,iBACrB,SAAS,eAAe,WACxB,QAAQ,KAAK;AAEf,yDAA0B;KAAE;KAAS,GAAG,SAAS;KAAe,CAAC;AACjE,iDAAiB;KAAE;KAAS,GAAG,SAAS;KAAe,CAAC;AAExD,iDAAiB;KACf,eAAe;KACf,YAAY,8BAAuB,OAAQ,OAAO,SAAS,MAAM;KAClE,CAAC;;GAGJ,MAAM,sDAAyB,OAAO;GACtC,MAAM,gBACJ,MAAM,eAAe,SAAS;GAKhC,MAAM,eACJ,kBAAkB,oBAClB,kBAAkB,kBAClB,MAAM,eAAe,WAAW,QAChC,MAAM,eAAe,SAAS,iBAAiB;AAEjD,OAAI,aACF,eAAc;GAGhB,MAAM,UAAkC;IACtC,UAAU;IACV,UAAU,eAAe,eAAe;IACzC;AAED,OAAI,cAAc;IAChB,MAAM,iEAA+B,OAAO;AAC5C,QAAI,OAAO,KAAK,aAAa,CAAC,WAAW,EACvC,WAAU,2DAA2D,EACnE,WAAW,MACZ,CAAC;IAGJ,MAAM,kBAAkB,0DAA8B,aAAa;AACnE,WAAO,OACL,8DACuB,gBAAgB,iDACtB,OAAO,CACzB;;AAGH,SAAM,eAAe,QAAQ;IAC3B,GAAG;IACH,GAAI,MAAM,eAAe,SAAS,EAAE;IACrC;AAED,QAAK,MAAM,CAAC,MAAM,OAAO,OAAO,QAAQ,MAAO,EAAE;IAC/C,MAAM,cAAc,KAAK,QAAQ,uBAAuB,OAAO;AAE/D,UAAM,UAAU,EAAE,QAAQ,IAAI,OAAO,IAAI,YAAY,GAAG,EAAE,SAAS,EACjE,MAAM,IACP,EAAE;;AAGL,OAAI,CAAC,eACH,gEAAiC,QAAQ;IACvC,OAAO;IACP,gBAAgB,eAAe,MAAO,KAAK,MAAO,KAAK;IACvD,KAAK,eAAe,SAAS;IAC9B,CAAC;AAGJ,SAAM;AAEN,SAAM,QAAQ,YAAY;AAOxB,SAFoB,SAAS,SAAS,CAAC,gBAEpB,CAAC,gBAAgB;AAClC,sBAAiB;AAEjB,iDAAY,EAAE,eAAe,QAAS,CAAC;;KAEzC;;EAEL"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
3
4
  let _angular_core = require("@angular/core");
4
5
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
@@ -1 +1 @@
1
- {"version":3,"file":"useCompact.cjs","names":["INTLAYER_TOKEN"],"sources":["../../../src/format/useCompact.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { compact } from '@intlayer/core/formatters';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\nexport const useCompact = () => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed(\n () =>\n (...args: Parameters<typeof compact>) =>\n compact(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? intlayer.locale(),\n })\n );\n};\n"],"mappings":";;;;;;AAIA,MAAa,mBAAmB;CAC9B,MAAM,qCAAkBA,2CAAc;CAEtC,0CAEK,GAAG,gDACM,KAAK,IAAI;EACf,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,OAAO;CAC7C,CAAC,CACP;AACF"}
1
+ {"version":3,"file":"useCompact.cjs","names":["INTLAYER_TOKEN"],"sources":["../../../src/format/useCompact.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { compact } from '@intlayer/core/formatters';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\nexport const useCompact = () => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed(\n () =>\n (...args: Parameters<typeof compact>) =>\n compact(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? intlayer.locale(),\n })\n );\n};\n"],"mappings":";;;;;;;AAIA,MAAa,mBAAmB;CAC9B,MAAM,qCAAkBA,4CAAe;AAEvC,2CAEK,GAAG,gDACM,KAAK,IAAI;EACf,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,QAAQ;EAC7C,CAAC,CACP"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
3
4
  let _angular_core = require("@angular/core");
4
5
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrency.cjs","names":["INTLAYER_TOKEN"],"sources":["../../../src/format/useCurrency.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { currency } from '@intlayer/core/formatters';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\nexport const useCurrency = () => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed(\n () =>\n (...args: Parameters<typeof currency>) =>\n currency(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? intlayer.locale(),\n })\n );\n};\n"],"mappings":";;;;;;AAIA,MAAa,oBAAoB;CAC/B,MAAM,qCAAkBA,2CAAc;CAEtC,0CAEK,GAAG,iDACO,KAAK,IAAI;EAChB,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,OAAO;CAC7C,CAAC,CACP;AACF"}
1
+ {"version":3,"file":"useCurrency.cjs","names":["INTLAYER_TOKEN"],"sources":["../../../src/format/useCurrency.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { currency } from '@intlayer/core/formatters';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\nexport const useCurrency = () => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed(\n () =>\n (...args: Parameters<typeof currency>) =>\n currency(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? intlayer.locale(),\n })\n );\n};\n"],"mappings":";;;;;;;AAIA,MAAa,oBAAoB;CAC/B,MAAM,qCAAkBA,4CAAe;AAEvC,2CAEK,GAAG,iDACO,KAAK,IAAI;EAChB,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,QAAQ;EAC7C,CAAC,CACP"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
3
4
  let _angular_core = require("@angular/core");
4
5
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
@@ -1 +1 @@
1
- {"version":3,"file":"useDate.cjs","names":["INTLAYER_TOKEN","presets"],"sources":["../../../src/format/useDate.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { date, presets } from '@intlayer/core/formatters';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\n/**\n * Angular client hook that provides a localized date/time formatter.\n */\nexport const useDate = () => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed(() => (...args: Parameters<typeof date>) => {\n const locale = intlayer.locale();\n const options =\n typeof args[1] === 'string'\n ? { ...presets[args[1]], locale }\n : { ...args[1], locale: args[1]?.locale ?? locale };\n\n return date(args[0], options as Parameters<typeof date>[1]);\n });\n};\n"],"mappings":";;;;;;;;;AAOA,MAAa,gBAAgB;CAC3B,MAAM,qCAAkBA,2CAAc;CAEtC,0CAAuB,GAAG,SAAkC;EAC1D,MAAM,SAAS,SAAS,OAAO;EAC/B,MAAM,UACJ,OAAO,KAAK,OAAO,WACf;GAAE,GAAGC,kCAAQ,KAAK;GAAK;EAAO,IAC9B;GAAE,GAAG,KAAK;GAAI,QAAQ,KAAK,IAAI,UAAU;EAAO;EAEtD,2CAAY,KAAK,IAAI,OAAqC;CAC5D,CAAC;AACH"}
1
+ {"version":3,"file":"useDate.cjs","names":["INTLAYER_TOKEN","presets"],"sources":["../../../src/format/useDate.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { date, presets } from '@intlayer/core/formatters';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\n/**\n * Angular client hook that provides a localized date/time formatter.\n */\nexport const useDate = () => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed(() => (...args: Parameters<typeof date>) => {\n const locale = intlayer.locale();\n const options =\n typeof args[1] === 'string'\n ? { ...presets[args[1]], locale }\n : { ...args[1], locale: args[1]?.locale ?? locale };\n\n return date(args[0], options as Parameters<typeof date>[1]);\n });\n};\n"],"mappings":";;;;;;;;;;AAOA,MAAa,gBAAgB;CAC3B,MAAM,qCAAkBA,4CAAe;AAEvC,2CAAuB,GAAG,SAAkC;EAC1D,MAAM,SAAS,SAAS,QAAQ;EAChC,MAAM,UACJ,OAAO,KAAK,OAAO,WACf;GAAE,GAAGC,kCAAQ,KAAK;GAAK;GAAQ,GAC/B;GAAE,GAAG,KAAK;GAAI,QAAQ,KAAK,IAAI,UAAU;GAAQ;AAEvD,6CAAY,KAAK,IAAI,QAAsC;GAC3D"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
3
4
  let _angular_core = require("@angular/core");
4
5
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
@@ -1 +1 @@
1
- {"version":3,"file":"useIntl.cjs","names":["INTLAYER_TOKEN"],"sources":["../../../src/format/useIntl.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { bindIntl, type WrappedIntl } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\n/**\n * Angular composable that provides a locale-bound `Intl` object as a Signal.\n */\nexport const useIntl = (locale?: LocalesValues) => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed<WrappedIntl>(() => {\n const currentLocale = locale ?? intlayer.locale();\n\n return bindIntl(currentLocale);\n });\n};\n"],"mappings":";;;;;;;;;AAQA,MAAa,WAAW,WAA2B;CACjD,MAAM,qCAAkBA,2CAAc;CAEtC,yCAAmC;EAGjC,+CAFsB,UAAU,SAAS,OAAO,CAEnB;CAC/B,CAAC;AACH"}
1
+ {"version":3,"file":"useIntl.cjs","names":["INTLAYER_TOKEN"],"sources":["../../../src/format/useIntl.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { bindIntl, type WrappedIntl } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\n/**\n * Angular composable that provides a locale-bound `Intl` object as a Signal.\n */\nexport const useIntl = (locale?: LocalesValues) => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed<WrappedIntl>(() => {\n const currentLocale = locale ?? intlayer.locale();\n\n return bindIntl(currentLocale);\n });\n};\n"],"mappings":";;;;;;;;;;AAQA,MAAa,WAAW,WAA2B;CACjD,MAAM,qCAAkBA,4CAAe;AAEvC,0CAAmC;AAGjC,iDAFsB,UAAU,SAAS,QAAQ,CAEnB;GAC9B"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
3
4
  let _angular_core = require("@angular/core");
4
5
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
@@ -1 +1 @@
1
- {"version":3,"file":"useList.cjs","names":["INTLAYER_TOKEN"],"sources":["../../../src/format/useList.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { list } from '@intlayer/core/formatters';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\nexport const useList = () => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed(\n () =>\n (...args: Parameters<typeof list>) =>\n list(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? intlayer.locale(),\n })\n );\n};\n"],"mappings":";;;;;;AAIA,MAAa,gBAAgB;CAC3B,MAAM,qCAAkBA,2CAAc;CAEtC,0CAEK,GAAG,6CACG,KAAK,IAAI;EACZ,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,OAAO;CAC7C,CAAC,CACP;AACF"}
1
+ {"version":3,"file":"useList.cjs","names":["INTLAYER_TOKEN"],"sources":["../../../src/format/useList.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { list } from '@intlayer/core/formatters';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\nexport const useList = () => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed(\n () =>\n (...args: Parameters<typeof list>) =>\n list(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? intlayer.locale(),\n })\n );\n};\n"],"mappings":";;;;;;;AAIA,MAAa,gBAAgB;CAC3B,MAAM,qCAAkBA,4CAAe;AAEvC,2CAEK,GAAG,6CACG,KAAK,IAAI;EACZ,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,QAAQ;EAC7C,CAAC,CACP"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
3
4
  let _angular_core = require("@angular/core");
4
5
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
@@ -1 +1 @@
1
- {"version":3,"file":"useNumber.cjs","names":["INTLAYER_TOKEN"],"sources":["../../../src/format/useNumber.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { number } from '@intlayer/core/formatters';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\n/**\n * Angular client hook that provides a localized number formatter.\n */\nexport const useNumber = () => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed(\n () =>\n (...args: Parameters<typeof number>) =>\n number(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? intlayer.locale(),\n })\n );\n};\n"],"mappings":";;;;;;;;;AAOA,MAAa,kBAAkB;CAC7B,MAAM,qCAAkBA,2CAAc;CAEtC,0CAEK,GAAG,+CACK,KAAK,IAAI;EACd,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,OAAO;CAC7C,CAAC,CACP;AACF"}
1
+ {"version":3,"file":"useNumber.cjs","names":["INTLAYER_TOKEN"],"sources":["../../../src/format/useNumber.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { number } from '@intlayer/core/formatters';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\n/**\n * Angular client hook that provides a localized number formatter.\n */\nexport const useNumber = () => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed(\n () =>\n (...args: Parameters<typeof number>) =>\n number(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? intlayer.locale(),\n })\n );\n};\n"],"mappings":";;;;;;;;;;AAOA,MAAa,kBAAkB;CAC7B,MAAM,qCAAkBA,4CAAe;AAEvC,2CAEK,GAAG,+CACK,KAAK,IAAI;EACd,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,QAAQ;EAC7C,CAAC,CACP"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
3
4
  let _angular_core = require("@angular/core");
4
5
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
@@ -1 +1 @@
1
- {"version":3,"file":"usePercentage.cjs","names":["INTLAYER_TOKEN"],"sources":["../../../src/format/usePercentage.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { percentage } from '@intlayer/core/formatters';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\nexport const usePercentage = () => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed(\n () =>\n (...args: Parameters<typeof percentage>) =>\n percentage(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? intlayer.locale(),\n })\n );\n};\n"],"mappings":";;;;;;AAIA,MAAa,sBAAsB;CACjC,MAAM,qCAAkBA,2CAAc;CAEtC,0CAEK,GAAG,mDACS,KAAK,IAAI;EAClB,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,OAAO;CAC7C,CAAC,CACP;AACF"}
1
+ {"version":3,"file":"usePercentage.cjs","names":["INTLAYER_TOKEN"],"sources":["../../../src/format/usePercentage.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { percentage } from '@intlayer/core/formatters';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\nexport const usePercentage = () => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed(\n () =>\n (...args: Parameters<typeof percentage>) =>\n percentage(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? intlayer.locale(),\n })\n );\n};\n"],"mappings":";;;;;;;AAIA,MAAa,sBAAsB;CACjC,MAAM,qCAAkBA,4CAAe;AAEvC,2CAEK,GAAG,mDACS,KAAK,IAAI;EAClB,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,QAAQ;EAC7C,CAAC,CACP"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
3
4
  let _angular_core = require("@angular/core");
4
5
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
@@ -1 +1 @@
1
- {"version":3,"file":"useRelativeTime.cjs","names":["INTLAYER_TOKEN"],"sources":["../../../src/format/useRelativeTime.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { relativeTime } from '@intlayer/core/formatters';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\nexport const useRelativeTime = () => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed(\n () =>\n (...args: Parameters<typeof relativeTime>) =>\n relativeTime(args[0], args[1], {\n ...args[2],\n locale: args[2]?.locale ?? intlayer.locale(),\n })\n );\n};\n"],"mappings":";;;;;;AAIA,MAAa,wBAAwB;CACnC,MAAM,qCAAkBA,2CAAc;CAEtC,0CAEK,GAAG,qDACW,KAAK,IAAI,KAAK,IAAI;EAC7B,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,OAAO;CAC7C,CAAC,CACP;AACF"}
1
+ {"version":3,"file":"useRelativeTime.cjs","names":["INTLAYER_TOKEN"],"sources":["../../../src/format/useRelativeTime.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { relativeTime } from '@intlayer/core/formatters';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\nexport const useRelativeTime = () => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed(\n () =>\n (...args: Parameters<typeof relativeTime>) =>\n relativeTime(args[0], args[1], {\n ...args[2],\n locale: args[2]?.locale ?? intlayer.locale(),\n })\n );\n};\n"],"mappings":";;;;;;;AAIA,MAAa,wBAAwB;CACnC,MAAM,qCAAkBA,4CAAe;AAEvC,2CAEK,GAAG,qDACW,KAAK,IAAI,KAAK,IAAI;EAC7B,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,QAAQ;EAC7C,CAAC,CACP"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
3
4
  let _angular_core = require("@angular/core");
4
5
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
@@ -1 +1 @@
1
- {"version":3,"file":"useUnit.cjs","names":["INTLAYER_TOKEN"],"sources":["../../../src/format/useUnit.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { units } from '@intlayer/core/formatters';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\nexport const useUnit = () => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed(\n () =>\n (...args: Parameters<typeof units>) =>\n units(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? intlayer.locale(),\n })\n );\n};\n"],"mappings":";;;;;;AAIA,MAAa,gBAAgB;CAC3B,MAAM,qCAAkBA,2CAAc;CAEtC,0CAEK,GAAG,8CACI,KAAK,IAAI;EACb,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,OAAO;CAC7C,CAAC,CACP;AACF"}
1
+ {"version":3,"file":"useUnit.cjs","names":["INTLAYER_TOKEN"],"sources":["../../../src/format/useUnit.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { units } from '@intlayer/core/formatters';\nimport { INTLAYER_TOKEN } from '../client/installIntlayer';\n\nexport const useUnit = () => {\n const intlayer = inject(INTLAYER_TOKEN);\n\n return computed(\n () =>\n (...args: Parameters<typeof units>) =>\n units(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? intlayer.locale(),\n })\n );\n};\n"],"mappings":";;;;;;;AAIA,MAAa,gBAAgB;CAC3B,MAAM,qCAAkBA,4CAAe;AAEvC,2CAEK,GAAG,8CACI,KAAK,IAAI;EACb,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,QAAQ;EAC7C,CAAC,CACP"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
3
  const require_plugins = require('./plugins.cjs');
3
4
  let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
4
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"getDictionary.cjs","names":["getPlugins"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import { getDictionary as getDictionaryCore } from '@intlayer/core/interpreter';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { getPlugins } from './plugins';\n\nexport const getDictionary = <\n const T extends Dictionary,\n const L extends LocalesValues = DeclaredLocales,\n>(\n dictionary: T,\n locale?: L\n) => getDictionaryCore<T, L>(dictionary, locale, getPlugins(locale));\n"],"mappings":";;;;;AAQA,MAAa,iBAIX,YACA,yDAC2B,YAAY,QAAQA,2BAAW,MAAM,CAAC"}
1
+ {"version":3,"file":"getDictionary.cjs","names":["getPlugins"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import { getDictionary as getDictionaryCore } from '@intlayer/core/interpreter';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { getPlugins } from './plugins';\n\nexport const getDictionary = <\n const T extends Dictionary,\n const L extends LocalesValues = DeclaredLocales,\n>(\n dictionary: T,\n locale?: L\n) => getDictionaryCore<T, L>(dictionary, locale, getPlugins(locale));\n"],"mappings":";;;;;;AAQA,MAAa,iBAIX,YACA,yDAC2B,YAAY,QAAQA,2BAAW,OAAO,CAAC"}
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
3
  const require_plugins = require('./plugins.cjs');
3
4
  let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
4
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"getIntlayer.cjs","names":["getPlugins"],"sources":["../../src/getIntlayer.ts"],"sourcesContent":["import { getIntlayer as getIntlayerCore } from '@intlayer/core/interpreter';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionaryRegistryContent,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\nexport const getIntlayer = <\n const T extends DictionaryKeys,\n const L extends LocalesValues = DeclaredLocales,\n>(\n key: T,\n locale?: L\n) =>\n getIntlayerCore<T, L>(\n key,\n locale,\n getPlugins(locale)\n ) as DeepTransformContent<DictionaryRegistryContent<T>>;\n"],"mappings":";;;;;AASA,MAAa,eAIX,KACA,uDAGE,KACA,QACAA,2BAAW,MAAM,CACnB"}
1
+ {"version":3,"file":"getIntlayer.cjs","names":["getPlugins"],"sources":["../../src/getIntlayer.ts"],"sourcesContent":["import { getIntlayer as getIntlayerCore } from '@intlayer/core/interpreter';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionaryRegistryContent,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\nexport const getIntlayer = <\n const T extends DictionaryKeys,\n const L extends LocalesValues = DeclaredLocales,\n>(\n key: T,\n locale?: L\n) =>\n getIntlayerCore<T, L>(\n key,\n locale,\n getPlugins(locale)\n ) as DeepTransformContent<DictionaryRegistryContent<T>>;\n"],"mappings":";;;;;;AASA,MAAa,eAIX,KACA,uDAGE,KACA,QACAA,2BAAW,OAAO,CACnB"}