angular-intlayer 9.0.0-canary.8 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/dist/cjs/UI/IntlayerNode.component.cjs +4 -5
  2. package/dist/cjs/UI/IntlayerNode.component.cjs.map +1 -1
  3. package/dist/cjs/_virtual/{_@oxc-project_runtime@0.127.0/helpers → _@oxc-project_runtime@0.140.0/helpers/esm}/decorate.cjs +2 -2
  4. package/dist/{esm/_virtual/_@oxc-project_runtime@0.127.0/helpers/decorateMetadata.mjs → cjs/_virtual/_@oxc-project_runtime@0.140.0/helpers/esm/decorateMetadata.cjs} +3 -2
  5. package/dist/cjs/analytics/exposureSink.cjs +27 -0
  6. package/dist/cjs/analytics/exposureSink.cjs.map +1 -0
  7. package/dist/cjs/analytics/index.cjs +9 -0
  8. package/dist/cjs/analytics/useAnalytics.cjs +84 -0
  9. package/dist/cjs/analytics/useAnalytics.cjs.map +1 -0
  10. package/dist/cjs/analytics/useConversion.cjs +36 -0
  11. package/dist/cjs/analytics/useConversion.cjs.map +1 -0
  12. package/dist/cjs/analytics/useExperiment.cjs +69 -0
  13. package/dist/cjs/analytics/useExperiment.cjs.map +1 -0
  14. package/dist/cjs/client/installIntlayer.cjs +9 -4
  15. package/dist/cjs/client/installIntlayer.cjs.map +1 -1
  16. package/dist/cjs/client/intlayerToken.cjs +0 -1
  17. package/dist/cjs/client/intlayerToken.cjs.map +1 -1
  18. package/dist/cjs/client/useDictionary.cjs +0 -1
  19. package/dist/cjs/client/useDictionary.cjs.map +1 -1
  20. package/dist/cjs/client/useDictionaryAsync.cjs +0 -1
  21. package/dist/cjs/client/useDictionaryAsync.cjs.map +1 -1
  22. package/dist/cjs/client/useDictionaryDynamic.cjs +0 -1
  23. package/dist/cjs/client/useDictionaryDynamic.cjs.map +1 -1
  24. package/dist/cjs/client/useIntlayer.cjs +0 -1
  25. package/dist/cjs/client/useIntlayer.cjs.map +1 -1
  26. package/dist/cjs/client/useLoadDynamic.cjs +0 -1
  27. package/dist/cjs/client/useLoadDynamic.cjs.map +1 -1
  28. package/dist/cjs/client/useLocale.cjs +0 -1
  29. package/dist/cjs/client/useLocale.cjs.map +1 -1
  30. package/dist/cjs/client/useLocaleStorage.cjs +0 -1
  31. package/dist/cjs/client/useLocaleStorage.cjs.map +1 -1
  32. package/dist/cjs/client/usePathname.cjs +0 -1
  33. package/dist/cjs/client/usePathname.cjs.map +1 -1
  34. package/dist/cjs/editor/ContentSelector.component.cjs +5 -6
  35. package/dist/cjs/editor/ContentSelector.component.cjs.map +1 -1
  36. package/dist/cjs/editor/EditorProvider.component.cjs +4 -5
  37. package/dist/cjs/editor/EditorProvider.component.cjs.map +1 -1
  38. package/dist/cjs/editor/useEditor.cjs +0 -1
  39. package/dist/cjs/editor/useEditor.cjs.map +1 -1
  40. package/dist/cjs/esbuild/plugin.cjs +19 -12
  41. package/dist/cjs/esbuild/plugin.cjs.map +1 -1
  42. package/dist/cjs/format/useCompact.cjs +0 -1
  43. package/dist/cjs/format/useCompact.cjs.map +1 -1
  44. package/dist/cjs/format/useCurrency.cjs +0 -1
  45. package/dist/cjs/format/useCurrency.cjs.map +1 -1
  46. package/dist/cjs/format/useDate.cjs +0 -1
  47. package/dist/cjs/format/useDate.cjs.map +1 -1
  48. package/dist/cjs/format/useIntl.cjs +0 -1
  49. package/dist/cjs/format/useIntl.cjs.map +1 -1
  50. package/dist/cjs/format/useList.cjs +0 -1
  51. package/dist/cjs/format/useList.cjs.map +1 -1
  52. package/dist/cjs/format/useNumber.cjs +0 -1
  53. package/dist/cjs/format/useNumber.cjs.map +1 -1
  54. package/dist/cjs/format/usePercentage.cjs +0 -1
  55. package/dist/cjs/format/usePercentage.cjs.map +1 -1
  56. package/dist/cjs/format/useRelativeTime.cjs +0 -1
  57. package/dist/cjs/format/useRelativeTime.cjs.map +1 -1
  58. package/dist/cjs/format/useUnit.cjs +0 -1
  59. package/dist/cjs/format/useUnit.cjs.map +1 -1
  60. package/dist/cjs/getDictionary.cjs +0 -1
  61. package/dist/cjs/getDictionary.cjs.map +1 -1
  62. package/dist/cjs/getIntlayer.cjs +0 -1
  63. package/dist/cjs/getIntlayer.cjs.map +1 -1
  64. package/dist/cjs/html/installIntlayerHTML.cjs +2 -3
  65. package/dist/cjs/html/installIntlayerHTML.cjs.map +1 -1
  66. package/dist/cjs/index.cjs +7 -0
  67. package/dist/cjs/markdown/installIntlayerMarkdown.cjs +2 -3
  68. package/dist/cjs/markdown/installIntlayerMarkdown.cjs.map +1 -1
  69. package/dist/cjs/plugins.cjs +29 -16
  70. package/dist/cjs/plugins.cjs.map +1 -1
  71. package/dist/cjs/renderIntlayerNode.cjs.map +1 -1
  72. package/dist/cjs/webpack/mergeConfig.cjs +1 -2
  73. package/dist/cjs/webpack/mergeConfig.cjs.map +1 -1
  74. package/dist/esm/UI/IntlayerNode.component.mjs +2 -2
  75. package/dist/esm/UI/IntlayerNode.component.mjs.map +1 -1
  76. package/dist/esm/_virtual/{_@oxc-project_runtime@0.127.0/helpers → _@oxc-project_runtime@0.140.0/helpers/esm}/decorate.mjs +2 -2
  77. package/dist/{cjs/_virtual/_@oxc-project_runtime@0.127.0/helpers/decorateMetadata.cjs → esm/_virtual/_@oxc-project_runtime@0.140.0/helpers/esm/decorateMetadata.mjs} +2 -3
  78. package/dist/esm/analytics/exposureSink.mjs +24 -0
  79. package/dist/esm/analytics/exposureSink.mjs.map +1 -0
  80. package/dist/esm/analytics/index.mjs +5 -0
  81. package/dist/esm/analytics/useAnalytics.mjs +82 -0
  82. package/dist/esm/analytics/useAnalytics.mjs.map +1 -0
  83. package/dist/esm/analytics/useConversion.mjs +35 -0
  84. package/dist/esm/analytics/useConversion.mjs.map +1 -0
  85. package/dist/esm/analytics/useExperiment.mjs +68 -0
  86. package/dist/esm/analytics/useExperiment.mjs.map +1 -0
  87. package/dist/esm/client/installIntlayer.mjs +9 -4
  88. package/dist/esm/client/installIntlayer.mjs.map +1 -1
  89. package/dist/esm/client/intlayerToken.mjs.map +1 -1
  90. package/dist/esm/client/useDictionary.mjs.map +1 -1
  91. package/dist/esm/client/useDictionaryAsync.mjs.map +1 -1
  92. package/dist/esm/client/useDictionaryDynamic.mjs.map +1 -1
  93. package/dist/esm/client/useIntlayer.mjs.map +1 -1
  94. package/dist/esm/client/useLoadDynamic.mjs.map +1 -1
  95. package/dist/esm/client/useLocale.mjs.map +1 -1
  96. package/dist/esm/client/useLocaleStorage.mjs.map +1 -1
  97. package/dist/esm/client/usePathname.mjs.map +1 -1
  98. package/dist/esm/editor/ContentSelector.component.mjs +2 -2
  99. package/dist/esm/editor/ContentSelector.component.mjs.map +1 -1
  100. package/dist/esm/editor/EditorProvider.component.mjs +2 -2
  101. package/dist/esm/editor/EditorProvider.component.mjs.map +1 -1
  102. package/dist/esm/editor/useEditor.mjs.map +1 -1
  103. package/dist/esm/esbuild/plugin.mjs +16 -8
  104. package/dist/esm/esbuild/plugin.mjs.map +1 -1
  105. package/dist/esm/format/useCompact.mjs.map +1 -1
  106. package/dist/esm/format/useCurrency.mjs.map +1 -1
  107. package/dist/esm/format/useDate.mjs.map +1 -1
  108. package/dist/esm/format/useIntl.mjs.map +1 -1
  109. package/dist/esm/format/useList.mjs.map +1 -1
  110. package/dist/esm/format/useNumber.mjs.map +1 -1
  111. package/dist/esm/format/usePercentage.mjs.map +1 -1
  112. package/dist/esm/format/useRelativeTime.mjs.map +1 -1
  113. package/dist/esm/format/useUnit.mjs.map +1 -1
  114. package/dist/esm/getDictionary.mjs.map +1 -1
  115. package/dist/esm/getIntlayer.mjs.map +1 -1
  116. package/dist/esm/html/installIntlayerHTML.mjs +1 -1
  117. package/dist/esm/html/installIntlayerHTML.mjs.map +1 -1
  118. package/dist/esm/index.mjs +4 -1
  119. package/dist/esm/markdown/installIntlayerMarkdown.mjs +1 -1
  120. package/dist/esm/markdown/installIntlayerMarkdown.mjs.map +1 -1
  121. package/dist/esm/plugins.mjs +30 -17
  122. package/dist/esm/plugins.mjs.map +1 -1
  123. package/dist/esm/renderIntlayerNode.mjs.map +1 -1
  124. package/dist/esm/webpack/mergeConfig.mjs.map +1 -1
  125. package/dist/types/UI/IntlayerNode.component.d.ts +0 -1
  126. package/dist/types/UI/IntlayerNode.component.d.ts.map +1 -1
  127. package/dist/types/analytics/exposureSink.d.ts +32 -0
  128. package/dist/types/analytics/exposureSink.d.ts.map +1 -0
  129. package/dist/types/analytics/index.d.ts +4 -0
  130. package/dist/types/analytics/useAnalytics.d.ts +36 -0
  131. package/dist/types/analytics/useAnalytics.d.ts.map +1 -0
  132. package/dist/types/analytics/useConversion.d.ts +38 -0
  133. package/dist/types/analytics/useConversion.d.ts.map +1 -0
  134. package/dist/types/analytics/useExperiment.d.ts +47 -0
  135. package/dist/types/analytics/useExperiment.d.ts.map +1 -0
  136. package/dist/types/client/installIntlayer.d.ts +2 -4
  137. package/dist/types/client/installIntlayer.d.ts.map +1 -1
  138. package/dist/types/client/intlayerToken.d.ts +1 -3
  139. package/dist/types/client/intlayerToken.d.ts.map +1 -1
  140. package/dist/types/client/useDictionary.d.ts +0 -1
  141. package/dist/types/client/useDictionary.d.ts.map +1 -1
  142. package/dist/types/client/useDictionaryAsync.d.ts +1 -3
  143. package/dist/types/client/useDictionaryAsync.d.ts.map +1 -1
  144. package/dist/types/client/useDictionaryDynamic.d.ts +1 -3
  145. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
  146. package/dist/types/client/useIntlayer.d.ts +0 -1
  147. package/dist/types/client/useIntlayer.d.ts.map +1 -1
  148. package/dist/types/client/useLoadDynamic.d.ts.map +1 -1
  149. package/dist/types/client/useLocale.d.ts +1 -5
  150. package/dist/types/client/useLocale.d.ts.map +1 -1
  151. package/dist/types/client/useLocaleStorage.d.ts +5 -7
  152. package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
  153. package/dist/types/client/usePathname.d.ts +0 -1
  154. package/dist/types/client/usePathname.d.ts.map +1 -1
  155. package/dist/types/editor/ContentSelector.component.d.ts.map +1 -1
  156. package/dist/types/editor/EditorProvider.component.d.ts.map +1 -1
  157. package/dist/types/editor/useEditor.d.ts +1 -3
  158. package/dist/types/editor/useEditor.d.ts.map +1 -1
  159. package/dist/types/esbuild/plugin.d.ts +2 -2
  160. package/dist/types/esbuild/plugin.d.ts.map +1 -1
  161. package/dist/types/format/useCompact.d.ts +2 -5
  162. package/dist/types/format/useCompact.d.ts.map +1 -1
  163. package/dist/types/format/useCurrency.d.ts +2 -5
  164. package/dist/types/format/useCurrency.d.ts.map +1 -1
  165. package/dist/types/format/useDate.d.ts +3 -7
  166. package/dist/types/format/useDate.d.ts.map +1 -1
  167. package/dist/types/format/useIntl.d.ts +1 -3
  168. package/dist/types/format/useIntl.d.ts.map +1 -1
  169. package/dist/types/format/useList.d.ts +5 -8
  170. package/dist/types/format/useList.d.ts.map +1 -1
  171. package/dist/types/format/useNumber.d.ts +2 -5
  172. package/dist/types/format/useNumber.d.ts.map +1 -1
  173. package/dist/types/format/usePercentage.d.ts +2 -5
  174. package/dist/types/format/usePercentage.d.ts.map +1 -1
  175. package/dist/types/format/useRelativeTime.d.ts +2 -5
  176. package/dist/types/format/useRelativeTime.d.ts.map +1 -1
  177. package/dist/types/format/useUnit.d.ts +2 -5
  178. package/dist/types/format/useUnit.d.ts.map +1 -1
  179. package/dist/types/getDictionary.d.ts +0 -1
  180. package/dist/types/getDictionary.d.ts.map +1 -1
  181. package/dist/types/getIntlayer.d.ts +0 -1
  182. package/dist/types/getIntlayer.d.ts.map +1 -1
  183. package/dist/types/html/installIntlayerHTML.d.ts +0 -1
  184. package/dist/types/html/installIntlayerHTML.d.ts.map +1 -1
  185. package/dist/types/index.d.ts +7 -2
  186. package/dist/types/index.d.ts.map +1 -1
  187. package/dist/types/markdown/installIntlayerMarkdown.d.ts +0 -1
  188. package/dist/types/markdown/installIntlayerMarkdown.d.ts.map +1 -1
  189. package/dist/types/plugins.d.ts +0 -1
  190. package/dist/types/plugins.d.ts.map +1 -1
  191. package/dist/types/renderIntlayerNode.d.ts +1 -6
  192. package/dist/types/renderIntlayerNode.d.ts.map +1 -1
  193. package/dist/types/webpack/mergeConfig.d.ts +1 -1
  194. package/dist/types/webpack/mergeConfig.d.ts.map +1 -1
  195. package/package.json +15 -12
  196. package/dist/types/intlayer/dist/types/index.d.ts +0 -4
@@ -1 +1 @@
1
- {"version":3,"file":"usePathname.cjs","names":["DestroyRef"],"sources":["../../../src/client/usePathname.ts"],"sourcesContent":["import {\n computed,\n DestroyRef,\n inject,\n type Signal,\n signal,\n} from '@angular/core';\nimport { getPathWithoutLocale } from '@intlayer/core/localization';\n\n/**\n * Angular hook that returns a signal containing the current pathname with\n * the locale segment removed.\n *\n * Reacts to browser back/forward navigation via the `popstate` event.\n * Uses `DestroyRef` to clean up the event listener when the component is destroyed.\n * Falls back to an empty string during server-side rendering.\n *\n * @returns A signal containing the current pathname without the locale prefix.\n *\n * @example\n * ```ts\n * import { Component } from '@angular/core';\n * import { usePathname } from 'angular-intlayer';\n *\n * @Component({\n * standalone: true,\n * selector: 'app-nav-item',\n * template: `\n * <a [class.active]=\"pathname() === '/dashboard'\" href=\"/dashboard\">\n * Dashboard\n * </a>\n * `,\n * })\n * export class NavItem {\n * readonly pathname = usePathname();\n * }\n * ```\n */\nexport const usePathname = (): Signal<string> => {\n const destroyRef = inject(DestroyRef);\n\n const rawPathname = signal<string>(\n typeof window !== 'undefined' ? window.location.pathname : ''\n );\n\n if (typeof window !== 'undefined') {\n const handleLocationChange = (): void => {\n rawPathname.set(window.location.pathname);\n };\n\n window.addEventListener('popstate', handleLocationChange);\n\n destroyRef.onDestroy(() => {\n window.removeEventListener('popstate', handleLocationChange);\n });\n }\n\n return computed(() => getPathWithoutLocale(rawPathname()));\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,MAAa,oBAAoC;CAC/C,MAAM,uCAAoBA,yBAAW;CAErC,MAAM,wCACJ,OAAO,WAAW,cAAc,OAAO,SAAS,WAAW,GAC5D;AAED,KAAI,OAAO,WAAW,aAAa;EACjC,MAAM,6BAAmC;AACvC,eAAY,IAAI,OAAO,SAAS,SAAS;;AAG3C,SAAO,iBAAiB,YAAY,qBAAqB;AAEzD,aAAW,gBAAgB;AACzB,UAAO,oBAAoB,YAAY,qBAAqB;IAC5D;;AAGJ,gGAA2C,aAAa,CAAC,CAAC"}
1
+ {"version":3,"file":"usePathname.cjs","names":["DestroyRef"],"sources":["../../../src/client/usePathname.ts"],"sourcesContent":["import {\n computed,\n DestroyRef,\n inject,\n type Signal,\n signal,\n} from '@angular/core';\nimport { getPathWithoutLocale } from '@intlayer/core/localization';\n\n/**\n * Angular hook that returns a signal containing the current pathname with\n * the locale segment removed.\n *\n * Reacts to browser back/forward navigation via the `popstate` event.\n * Uses `DestroyRef` to clean up the event listener when the component is destroyed.\n * Falls back to an empty string during server-side rendering.\n *\n * @returns A signal containing the current pathname without the locale prefix.\n *\n * @example\n * ```ts\n * import { Component } from '@angular/core';\n * import { usePathname } from 'angular-intlayer';\n *\n * @Component({\n * standalone: true,\n * selector: 'app-nav-item',\n * template: `\n * <a [class.active]=\"pathname() === '/dashboard'\" href=\"/dashboard\">\n * Dashboard\n * </a>\n * `,\n * })\n * export class NavItem {\n * readonly pathname = usePathname();\n * }\n * ```\n */\nexport const usePathname = (): Signal<string> => {\n const destroyRef = inject(DestroyRef);\n\n const rawPathname = signal<string>(\n typeof window !== 'undefined' ? window.location.pathname : ''\n );\n\n if (typeof window !== 'undefined') {\n const handleLocationChange = (): void => {\n rawPathname.set(window.location.pathname);\n };\n\n window.addEventListener('popstate', handleLocationChange);\n\n destroyRef.onDestroy(() => {\n window.removeEventListener('popstate', handleLocationChange);\n });\n }\n\n return computed(() => getPathWithoutLocale(rawPathname()));\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,MAAa,oBAAoC;CAC/C,MAAM,uCAAoBA,wBAAU;CAEpC,MAAM,wCACJ,OAAO,WAAW,cAAc,OAAO,SAAS,WAAW,EAC7D;CAEA,IAAI,OAAO,WAAW,aAAa;EACjC,MAAM,6BAAmC;GACvC,YAAY,IAAI,OAAO,SAAS,QAAQ;EAC1C;EAEA,OAAO,iBAAiB,YAAY,oBAAoB;EAExD,WAAW,gBAAgB;GACzB,OAAO,oBAAoB,YAAY,oBAAoB;EAC7D,CAAC;CACH;CAEA,+FAA2C,YAAY,CAAC,CAAC;AAC3D"}
@@ -1,7 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
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');
2
+ const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.140.0/helpers/esm/decorateMetadata.cjs');
3
+ const require_decorate = require('../_virtual/_@oxc-project_runtime@0.140.0/helpers/esm/decorate.cjs');
5
4
  let _angular_core = require("@angular/core");
6
5
 
7
6
  //#region src/editor/ContentSelector.component.ts
@@ -12,9 +11,9 @@ let ContentSelectorWrapperComponent = class ContentSelectorWrapperComponent {
12
11
  return JSON.stringify(this.keyPath);
13
12
  }
14
13
  };
15
- require_decorate.__decorate([(0, _angular_core.Input)(), require_decorateMetadata.__decorateMetadata("design:type", String)], ContentSelectorWrapperComponent.prototype, "dictionaryKey", void 0);
16
- require_decorate.__decorate([(0, _angular_core.Input)(), require_decorateMetadata.__decorateMetadata("design:type", Array)], ContentSelectorWrapperComponent.prototype, "keyPath", void 0);
17
- ContentSelectorWrapperComponent = require_decorate.__decorate([(0, _angular_core.Component)({
14
+ require_decorate.default([(0, _angular_core.Input)(), require_decorateMetadata.default("design:type", String)], ContentSelectorWrapperComponent.prototype, "dictionaryKey", void 0);
15
+ require_decorate.default([(0, _angular_core.Input)(), require_decorateMetadata.default("design:type", Array)], ContentSelectorWrapperComponent.prototype, "keyPath", void 0);
16
+ ContentSelectorWrapperComponent = require_decorate.default([(0, _angular_core.Component)({
18
17
  selector: "app-content-selector-wrapper",
19
18
  standalone: true,
20
19
  schemas: [_angular_core.CUSTOM_ELEMENTS_SCHEMA],
@@ -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;AAChB,SAAO,KAAK,UAAU,KAAK,QAAQ;;;uDAJ7B;uDACA;4FAfC;CACT,UAAU;CACV,YAAY;CACZ,SAAS,CAACA,qCAAuB;CACjC,UAAU;;;;;;;;CAQX,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,IAAM,kCAAN,MAAM,gCAAgC;CAC3C,AAAS;CACT,AAAS;CAET,IAAI,cAAc;EAChB,OAAO,KAAK,UAAU,KAAK,OAAO;CACpC;AACF;mDANS;mDACA;yFAfE;CACT,UAAU;CACV,YAAY;CACZ,SAAS,CAACA,oCAAsB;CAChC,UAAU;;;;;;;;AAQZ,CAAC"}
@@ -1,7 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
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');
2
+ const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.140.0/helpers/esm/decorateMetadata.cjs');
3
+ const require_decorate = require('../_virtual/_@oxc-project_runtime@0.140.0/helpers/esm/decorate.cjs');
5
4
  const require_editor_useEditor = require('./useEditor.cjs');
6
5
  let _angular_core = require("@angular/core");
7
6
 
@@ -11,11 +10,11 @@ let EditorProviderComponent = class EditorProviderComponent {
11
10
  require_editor_useEditor.useEditor();
12
11
  }
13
12
  };
14
- EditorProviderComponent = require_decorate.__decorate([(0, _angular_core.Component)({
13
+ EditorProviderComponent = require_decorate.default([(0, _angular_core.Component)({
15
14
  selector: "intlayer-editor-provider",
16
15
  standalone: true,
17
16
  template: `<ng-content />`
18
- }), require_decorateMetadata.__decorateMetadata("design:paramtypes", [])], EditorProviderComponent);
17
+ }), require_decorateMetadata.default("design:paramtypes", [])], EditorProviderComponent);
19
18
 
20
19
  //#endregion
21
20
  Object.defineProperty(exports, 'EditorProviderComponent', {
@@ -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;AACZ,sCAAW;;;oFAPJ;CACT,UAAU;CACV,YAAY;CACZ,UAAU;CACX,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,IAAM,0BAAN,MAAM,wBAAwB;CACnC,cAAc;EACZ,mCAAU;CACZ;AACF;iFATW;CACT,UAAU;CACV,YAAY;CACZ,UAAU;AACZ,CAAC"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
4
3
  let _angular_core = require("@angular/core");
5
4
  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;AACnE,KAAI,QAAQ,IAAI,4BAA4B,WAAW,CAACA,qCAAW;CAEnE,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
+ {"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,4BAA4B,WAAW,CAACA,sCAAW;CAEnE,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,mBAAmB,CAAC,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,mBAAmB,CAAC,MAAM,EAAE,uBAAuB;GACxD,iBAAiB;EACnB,CAAC;CACH,CAAC;AACH;;;;;;;;;;;;;;;;;;AAmBA,MAAa,yBAAyB,0DACR,UAAU,MAAM,CAAC"}
@@ -1,14 +1,13 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  let node_path = require("node:path");
4
- let _intlayer_config_node = require("@intlayer/config/node");
5
- let _intlayer_config_utils = require("@intlayer/config/utils");
6
- let _intlayer_chokidar_build = require("@intlayer/chokidar/build");
7
- let _intlayer_chokidar_cli = require("@intlayer/chokidar/cli");
8
- let _intlayer_chokidar_watcher = require("@intlayer/chokidar/watcher");
9
3
  let _intlayer_config_envVars = require("@intlayer/config/envVars");
10
4
  let _intlayer_config_logger = require("@intlayer/config/logger");
5
+ let _intlayer_config_node = require("@intlayer/config/node");
6
+ let _intlayer_config_utils = require("@intlayer/config/utils");
11
7
  let _intlayer_dictionaries_entry = require("@intlayer/dictionaries-entry");
8
+ let _intlayer_engine_build = require("@intlayer/engine/build");
9
+ let _intlayer_engine_cli = require("@intlayer/engine/cli");
10
+ let _intlayer_engine_watcher = require("@intlayer/engine/watcher");
12
11
 
13
12
  //#region src/esbuild/plugin.ts
14
13
  /**
@@ -48,7 +47,7 @@ const intlayerEsbuildPlugin = (options) => {
48
47
  baseDir,
49
48
  ...options?.configOptions
50
49
  });
51
- (0, _intlayer_chokidar_cli.logConfigDetails)({
50
+ (0, _intlayer_engine_cli.logConfigDetails)({
52
51
  baseDir,
53
52
  ...options?.configOptions
54
53
  });
@@ -61,16 +60,24 @@ const intlayerEsbuildPlugin = (options) => {
61
60
  const nodeEnvDefine = build.initialOptions.define?.["process.env.NODE_ENV"];
62
61
  const isProduction = nodeEnvDefine === "\"production\"" || nodeEnvDefine === "'production'" || build.initialOptions.minify === true || build.initialOptions.define?.["ngDevMode"] === "false";
63
62
  if (isProduction) isBuildMode = true;
63
+ const wrapKey = (key) => `process.env.${key}`;
64
+ const wrapValue = (value) => `"${value}"`;
64
65
  const envVars = {
65
- INTLAYER: "true",
66
- NODE_ENV: isProduction ? "production" : "development"
66
+ "process.env": "{}",
67
+ [wrapKey("INTLAYER")]: wrapValue("true"),
68
+ [wrapKey("NODE_ENV")]: wrapValue(isProduction ? "production" : "development"),
69
+ ...(0, _intlayer_config_envVars.getConfigEnvVars)(config, wrapKey, wrapValue)
67
70
  };
68
71
  if (isProduction) {
69
72
  const dictionaries = (0, _intlayer_dictionaries_entry.getDictionaries)(config);
70
73
  if (Object.keys(dictionaries).length === 0) appLogger("No dictionaries found. Please check your configuration.", { isVerbose: true });
71
74
  const unusedNodeTypes = await (0, _intlayer_config_utils.getUnusedNodeTypesAsync)(dictionaries);
72
- Object.assign(envVars, (0, _intlayer_config_envVars.formatNodeTypeToEnvVar)(unusedNodeTypes), (0, _intlayer_config_envVars.getConfigEnvVars)(config));
75
+ Object.assign(envVars, (0, _intlayer_config_envVars.formatNodeTypeToEnvVar)(unusedNodeTypes, wrapKey, wrapValue), (0, _intlayer_config_envVars.formatDictionarySelectorEnvVar)((0, _intlayer_config_utils.getHasDictionarySelector)(dictionaries), wrapKey, wrapValue));
73
76
  }
77
+ build.initialOptions.define = {
78
+ ...envVars,
79
+ ...build.initialOptions.define ?? {}
80
+ };
74
81
  build.initialOptions.alias = {
75
82
  ...alias,
76
83
  ...build.initialOptions.alias ?? {}
@@ -79,7 +86,7 @@ const intlayerEsbuildPlugin = (options) => {
79
86
  const escapedFrom = from.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
80
87
  build.onResolve({ filter: new RegExp(`^${escapedFrom}$`) }, () => ({ path: to }));
81
88
  }
82
- if (!preparePromise) preparePromise = (0, _intlayer_chokidar_build.prepareIntlayer)(config, {
89
+ if (!preparePromise) preparePromise = (0, _intlayer_engine_build.prepareIntlayer)(config, {
83
90
  clean: isProduction,
84
91
  cacheTimeoutMs: isProduction ? 1e3 * 30 : 1e3 * 60 * 60,
85
92
  env: isProduction ? "prod" : "dev"
@@ -88,7 +95,7 @@ const intlayerEsbuildPlugin = (options) => {
88
95
  build.onStart(async () => {
89
96
  if ((options?.watch ?? !isBuildMode) && !watcherStarted) {
90
97
  watcherStarted = true;
91
- await (0, _intlayer_chokidar_watcher.watch)({ configuration: config });
98
+ await (0, _intlayer_engine_watcher.watch)({ configuration: config });
92
99
  }
93
100
  });
94
101
  }
@@ -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;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
+ {"version":3,"file":"plugin.cjs","names":[],"sources":["../../../src/esbuild/plugin.ts"],"sourcesContent":["import { join } from 'node:path';\nimport {\n formatDictionarySelectorEnvVar,\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 {\n getAlias,\n getHasDictionarySelector,\n getUnusedNodeTypesAsync,\n} from '@intlayer/config/utils';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport { prepareIntlayer } from '@intlayer/engine/build';\nimport { logConfigDetails } from '@intlayer/engine/cli';\nimport { watch } from '@intlayer/engine/watcher';\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 wrapKey = (key: string) => `process.env.${key}`;\n const wrapValue = (value: string) => `\"${value}\"`;\n\n const envVars: Record<string, string> = {\n // Catch-all so that any `process.env.*` read NOT covered by a specific\n // key below resolves to `undefined` instead of dereferencing a bare\n // `process`, which is not defined in browser bundles and throws\n // `process is not defined`. esbuild resolves the most specific define\n // first, so the keys below keep their tree-shaking effect.\n 'process.env': '{}',\n [wrapKey('INTLAYER')]: wrapValue('true'),\n [wrapKey('NODE_ENV')]: wrapValue(\n isProduction ? 'production' : 'development'\n ),\n // Tree shaking flags derived from the config (routing / storage /\n // editor). Emitted in every mode so behaviour is consistent in dev.\n ...getConfigEnvVars(config, wrapKey, wrapValue),\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 // Tree shaking based on unused node types\n formatNodeTypeToEnvVar(unusedNodeTypes, wrapKey, wrapValue),\n // Tree shaking the dictionary selector logic\n // (collections / variants)\n formatDictionarySelectorEnvVar(\n getHasDictionarySelector(dictionaries),\n wrapKey,\n wrapValue\n )\n );\n }\n\n // Existing defines (Angular's own, or the user's angular.json `define`\n // block) take precedence over the Intlayer ones.\n build.initialOptions.define = {\n ...envVars,\n ...(build.initialOptions.define ?? {}),\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,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,2CAAiB;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,WAAW,QAAgB,eAAe;GAChD,MAAM,aAAa,UAAkB,IAAI,MAAM;GAE/C,MAAM,UAAkC;IAMtC,eAAe;KACd,QAAQ,UAAU,IAAI,UAAU,MAAM;KACtC,QAAQ,UAAU,IAAI,UACrB,eAAe,eAAe,aAChC;IAGA,kDAAoB,QAAQ,SAAS,SAAS;GAChD;GAEA,IAAI,cAAc;IAChB,MAAM,iEAA+B,MAAM;IAC3C,IAAI,OAAO,KAAK,YAAY,CAAC,CAAC,WAAW,GACvC,UAAU,2DAA2D,EACnE,WAAW,KACb,CAAC;IAGH,MAAM,kBAAkB,0DAA8B,YAAY;IAClE,OAAO,OACL,8DAEuB,iBAAiB,SAAS,SAAS,qHAI/B,YAAY,GACrC,SACA,SACF,CACF;GACF;GAIA,MAAM,eAAe,SAAS;IAC5B,GAAG;IACH,GAAI,MAAM,eAAe,UAAU,CAAC;GACtC;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,6DAAiC,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,0CAAY,EAAE,eAAe,OAAQ,CAAC;IACxC;GACF,CAAC;EACH;CACF;AACF"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
4
3
  let _angular_core = require("@angular/core");
5
4
  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,4CAAe;AAEvC,2CAEK,GAAG,gDACM,KAAK,IAAI;EACf,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,QAAQ;EAC7C,CAAC,CACP"}
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,EAAE,EAAE,UAAU,SAAS,OAAO;CAC7C,CAAC,CACP;AACF"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
4
3
  let _angular_core = require("@angular/core");
5
4
  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,4CAAe;AAEvC,2CAEK,GAAG,iDACO,KAAK,IAAI;EAChB,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,QAAQ;EAC7C,CAAC,CACP"}
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,EAAE,EAAE,UAAU,SAAS,OAAO;CAC7C,CAAC,CACP;AACF"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
4
3
  let _angular_core = require("@angular/core");
5
4
  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,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
+ {"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,EAAE,EAAE,UAAU;EAAO;EAEtD,2CAAY,KAAK,IAAI,OAAqC;CAC5D,CAAC;AACH"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
4
3
  let _angular_core = require("@angular/core");
5
4
  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,4CAAe;AAEvC,0CAAmC;AAGjC,iDAFsB,UAAU,SAAS,QAAQ,CAEnB;GAC9B"}
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,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
4
3
  let _angular_core = require("@angular/core");
5
4
  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,4CAAe;AAEvC,2CAEK,GAAG,6CACG,KAAK,IAAI;EACZ,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,QAAQ;EAC7C,CAAC,CACP"}
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,EAAE,EAAE,UAAU,SAAS,OAAO;CAC7C,CAAC,CACP;AACF"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
4
3
  let _angular_core = require("@angular/core");
5
4
  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,4CAAe;AAEvC,2CAEK,GAAG,+CACK,KAAK,IAAI;EACd,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,QAAQ;EAC7C,CAAC,CACP"}
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,EAAE,EAAE,UAAU,SAAS,OAAO;CAC7C,CAAC,CACP;AACF"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
4
3
  let _angular_core = require("@angular/core");
5
4
  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,4CAAe;AAEvC,2CAEK,GAAG,mDACS,KAAK,IAAI;EAClB,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,QAAQ;EAC7C,CAAC,CACP"}
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,EAAE,EAAE,UAAU,SAAS,OAAO;CAC7C,CAAC,CACP;AACF"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
4
3
  let _angular_core = require("@angular/core");
5
4
  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,4CAAe;AAEvC,2CAEK,GAAG,qDACW,KAAK,IAAI,KAAK,IAAI;EAC7B,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,QAAQ;EAC7C,CAAC,CACP"}
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,EAAE,EAAE,UAAU,SAAS,OAAO;CAC7C,CAAC,CACP;AACF"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_client_intlayerToken = require('../client/intlayerToken.cjs');
4
3
  let _angular_core = require("@angular/core");
5
4
  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,4CAAe;AAEvC,2CAEK,GAAG,8CACI,KAAK,IAAI;EACb,GAAG,KAAK;EACR,QAAQ,KAAK,IAAI,UAAU,SAAS,QAAQ;EAC7C,CAAC,CACP"}
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,EAAE,EAAE,UAAU,SAAS,OAAO;CAC7C,CAAC,CACP;AACF"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
2
  const require_plugins = require('./plugins.cjs');
4
3
  let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
5
4
 
@@ -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 {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Transforms a dictionary (or qualified dictionary group) and returns its\n * content for the given locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends\n | LocalesValues\n | DictionarySelectorForGroup<T> = DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n> => {\n const locale = (\n typeof localeOrSelector === 'object' && localeOrSelector !== null\n ? localeOrSelector.locale\n : localeOrSelector\n ) as LocalesValues | undefined;\n\n return getDictionaryCore(\n dictionary,\n localeOrSelector,\n getPlugins(locale)\n ) as any;\n};\n"],"mappings":";;;;;;;;;;;AAmBA,MAAa,iBAMX,YACA,qBAIG;AAOH,sDACE,YACA,kBACAA,2BARA,OAAO,qBAAqB,YAAY,qBAAqB,OACzD,iBAAiB,SACjB,iBAMc,CACnB"}
1
+ {"version":3,"file":"getDictionary.cjs","names":["getPlugins"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import { getDictionary as getDictionaryCore } from '@intlayer/core/interpreter';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Transforms a dictionary (or qualified dictionary group) and returns its\n * content for the given locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends\n | LocalesValues\n | DictionarySelectorForGroup<T> = DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n> => {\n const locale = (\n typeof localeOrSelector === 'object' && localeOrSelector !== null\n ? localeOrSelector.locale\n : localeOrSelector\n ) as LocalesValues | undefined;\n\n return getDictionaryCore(\n dictionary,\n localeOrSelector,\n getPlugins(locale)\n ) as any;\n};\n"],"mappings":";;;;;;;;;;AAmBA,MAAa,iBAMX,YACA,qBAIG;CAOH,qDACE,YACA,kBACAA,2BARA,OAAO,qBAAqB,YAAY,qBAAqB,OACzD,iBAAiB,SACjB,gBAMa,CACnB;AACF"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
2
  const require_plugins = require('./plugins.cjs');
4
3
  let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
5
4
 
@@ -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 DictionaryRegistryResult,\n DictionarySelectorForKey,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Picks one dictionary by its key and returns its content for the given\n * locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getIntlayer = <\n const T extends DictionaryKeys,\n const A extends LocalesValues | DictionarySelectorForKey<T> = DeclaredLocales,\n>(\n key: T,\n localeOrSelector?: A\n): DeepTransformContent<\n DictionaryRegistryResult<T, A>,\n ExtractSelectorLocale<A>\n> => {\n const locale = (\n typeof localeOrSelector === 'object' && localeOrSelector !== null\n ? localeOrSelector.locale\n : localeOrSelector\n ) as LocalesValues | undefined;\n\n return getIntlayerCore(key, localeOrSelector, getPlugins(locale)) as any;\n};\n"],"mappings":";;;;;;;;;;;AAgBA,MAAa,eAIX,KACA,qBAIG;AAOH,oDAAuB,KAAK,kBAAkBA,2BAL5C,OAAO,qBAAqB,YAAY,qBAAqB,OACzD,iBAAiB,SACjB,iBAG0D,CAAC"}
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 DictionaryRegistryResult,\n DictionarySelectorForKey,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Picks one dictionary by its key and returns its content for the given\n * locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getIntlayer = <\n const T extends DictionaryKeys,\n const A extends LocalesValues | DictionarySelectorForKey<T> = DeclaredLocales,\n>(\n key: T,\n localeOrSelector?: A\n): DeepTransformContent<\n DictionaryRegistryResult<T, A>,\n ExtractSelectorLocale<A>\n> => {\n const locale = (\n typeof localeOrSelector === 'object' && localeOrSelector !== null\n ? localeOrSelector.locale\n : localeOrSelector\n ) as LocalesValues | undefined;\n\n return getIntlayerCore(key, localeOrSelector, getPlugins(locale)) as any;\n};\n"],"mappings":";;;;;;;;;;AAgBA,MAAa,eAIX,KACA,qBAIG;CAOH,mDAAuB,KAAK,kBAAkBA,2BAL5C,OAAO,qBAAqB,YAAY,qBAAqB,OACzD,iBAAiB,SACjB,gBAGyD,CAAC;AAClE"}
@@ -1,6 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- const require_decorate = require('../_virtual/_@oxc-project_runtime@0.127.0/helpers/decorate.cjs');
2
+ const require_decorate = require('../_virtual/_@oxc-project_runtime@0.140.0/helpers/esm/decorate.cjs');
4
3
  let _angular_core = require("@angular/core");
5
4
 
6
5
  //#region src/html/installIntlayerHTML.ts
@@ -24,7 +23,7 @@ let IntlayerHTMLService = class IntlayerHTMLService {
24
23
  return this.htmlProvider.renderHTML(html, overrides);
25
24
  }
26
25
  };
27
- IntlayerHTMLService = require_decorate.__decorate([(0, _angular_core.Injectable)({ providedIn: "root" })], IntlayerHTMLService);
26
+ IntlayerHTMLService = require_decorate.default([(0, _angular_core.Injectable)({ providedIn: "root" })], IntlayerHTMLService);
28
27
  /**
29
28
  * Function to inject HTML provider
30
29
  */
@@ -1 +1 @@
1
- {"version":3,"file":"installIntlayerHTML.cjs","names":["InjectionToken"],"sources":["../../../src/html/installIntlayerHTML.ts"],"sourcesContent":["import {\n Injectable,\n InjectionToken,\n inject,\n type TemplateRef,\n} from '@angular/core';\n\nexport const INTLAYER_HTML_TOKEN = new InjectionToken<IntlayerHTMLProvider>(\n 'intlayerHTML'\n);\n\ntype RenderHTMLOptions = {\n components?: any;\n wrapper?: string;\n options?: any;\n};\n\ntype RenderHTMLFunction = (\n html: string,\n overrides?: any | RenderHTMLOptions\n) => string | TemplateRef<any> | Promise<string | TemplateRef<any>>;\n\nexport type IntlayerHTMLProvider = {\n renderHTML: RenderHTMLFunction;\n};\n\n/**\n * Default HTML renderer. In Angular, we often just use [innerHTML],\n * but this service provides a unified API.\n */\nconst defaultHTMLRenderer: RenderHTMLFunction = (html: string) => html;\n\n/**\n * Create IntlayerHTML provider configuration\n */\nexport const createIntlayerHTMLProvider = (\n renderHTML: RenderHTMLFunction = defaultHTMLRenderer\n) => ({\n provide: INTLAYER_HTML_TOKEN,\n useValue: {\n renderHTML,\n } as IntlayerHTMLProvider,\n});\n\n/**\n * Injectable service for HTML rendering\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class IntlayerHTMLService {\n private htmlProvider = inject(INTLAYER_HTML_TOKEN, {\n optional: true,\n });\n\n renderHTML(\n html: string,\n overrides?: any\n ): string | TemplateRef<any> | Promise<string | TemplateRef<any>> {\n if (!this.htmlProvider) {\n return html;\n }\n return this.htmlProvider.renderHTML(html, overrides);\n }\n}\n\n/**\n * Function to inject HTML provider\n */\nexport const useHTML = (): IntlayerHTMLProvider => {\n const htmlProvider = inject(INTLAYER_HTML_TOKEN, { optional: true });\n\n if (!htmlProvider) {\n return {\n renderHTML: defaultHTMLRenderer,\n };\n }\n\n return htmlProvider;\n};\n"],"mappings":";;;;;;AAOA,MAAa,sBAAsB,IAAIA,6BACrC,eACD;;;;;AAqBD,MAAM,uBAA2C,SAAiB;;;;AAKlE,MAAa,8BACX,aAAiC,yBAC7B;CACJ,SAAS;CACT,UAAU,EACR,YACD;CACF;AAQM,gCAAM,oBAAoB;CAC/B,AAAQ,yCAAsB,qBAAqB,EACjD,UAAU,MACX,CAAC;CAEF,WACE,MACA,WACgE;AAChE,MAAI,CAAC,KAAK,aACR,QAAO;AAET,SAAO,KAAK,aAAa,WAAW,MAAM,UAAU;;;iFAf5C,EACV,YAAY,QACb,CAAC;;;;AAoBF,MAAa,gBAAsC;CACjD,MAAM,yCAAsB,qBAAqB,EAAE,UAAU,MAAM,CAAC;AAEpE,KAAI,CAAC,aACH,QAAO,EACL,YAAY,qBACb;AAGH,QAAO"}
1
+ {"version":3,"file":"installIntlayerHTML.cjs","names":["InjectionToken"],"sources":["../../../src/html/installIntlayerHTML.ts"],"sourcesContent":["import {\n Injectable,\n InjectionToken,\n inject,\n type TemplateRef,\n} from '@angular/core';\n\nexport const INTLAYER_HTML_TOKEN = new InjectionToken<IntlayerHTMLProvider>(\n 'intlayerHTML'\n);\n\ntype RenderHTMLOptions = {\n components?: any;\n wrapper?: string;\n options?: any;\n};\n\ntype RenderHTMLFunction = (\n html: string,\n overrides?: any | RenderHTMLOptions\n) => string | TemplateRef<any> | Promise<string | TemplateRef<any>>;\n\nexport type IntlayerHTMLProvider = {\n renderHTML: RenderHTMLFunction;\n};\n\n/**\n * Default HTML renderer. In Angular, we often just use [innerHTML],\n * but this service provides a unified API.\n */\nconst defaultHTMLRenderer: RenderHTMLFunction = (html: string) => html;\n\n/**\n * Create IntlayerHTML provider configuration\n */\nexport const createIntlayerHTMLProvider = (\n renderHTML: RenderHTMLFunction = defaultHTMLRenderer\n) => ({\n provide: INTLAYER_HTML_TOKEN,\n useValue: {\n renderHTML,\n } as IntlayerHTMLProvider,\n});\n\n/**\n * Injectable service for HTML rendering\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class IntlayerHTMLService {\n private htmlProvider = inject(INTLAYER_HTML_TOKEN, {\n optional: true,\n });\n\n renderHTML(\n html: string,\n overrides?: any\n ): string | TemplateRef<any> | Promise<string | TemplateRef<any>> {\n if (!this.htmlProvider) {\n return html;\n }\n return this.htmlProvider.renderHTML(html, overrides);\n }\n}\n\n/**\n * Function to inject HTML provider\n */\nexport const useHTML = (): IntlayerHTMLProvider => {\n const htmlProvider = inject(INTLAYER_HTML_TOKEN, { optional: true });\n\n if (!htmlProvider) {\n return {\n renderHTML: defaultHTMLRenderer,\n };\n }\n\n return htmlProvider;\n};\n"],"mappings":";;;;;AAOA,MAAa,sBAAsB,IAAIA,6BACrC,cACF;;;;;AAqBA,MAAM,uBAA2C,SAAiB;;;;AAKlE,MAAa,8BACX,aAAiC,yBAC7B;CACJ,SAAS;CACT,UAAU,EACR,WACF;AACF;AAQO,IAAM,sBAAN,MAAM,oBAAoB;CAC/B,AAAQ,yCAAsB,qBAAqB,EACjD,UAAU,KACZ,CAAC;CAED,WACE,MACA,WACgE;EAChE,IAAI,CAAC,KAAK,cACR,OAAO;EAET,OAAO,KAAK,aAAa,WAAW,MAAM,SAAS;CACrD;AACF;8EAjBY,EACV,YAAY,OACd,CAAC;;;;AAoBD,MAAa,gBAAsC;CACjD,MAAM,yCAAsB,qBAAqB,EAAE,UAAU,KAAK,CAAC;CAEnE,IAAI,CAAC,cACH,OAAO,EACL,YAAY,oBACd;CAGF,OAAO;AACT"}
@@ -3,6 +3,9 @@ const require_plugins = require('./plugins.cjs');
3
3
  const require_getIntlayer = require('./getIntlayer.cjs');
4
4
  const require_getDictionary = require('./getDictionary.cjs');
5
5
  const require_client_intlayerToken = require('./client/intlayerToken.cjs');
6
+ const require_analytics_useAnalytics = require('./analytics/useAnalytics.cjs');
7
+ const require_analytics_useConversion = require('./analytics/useConversion.cjs');
8
+ const require_analytics_useExperiment = require('./analytics/useExperiment.cjs');
6
9
  const require_client_installIntlayer = require('./client/installIntlayer.cjs');
7
10
  const require_client_useDictionary = require('./client/useDictionary.cjs');
8
11
  const require_client_useDictionaryAsync = require('./client/useDictionaryAsync.cjs');
@@ -33,9 +36,13 @@ exports.isUpdatableNode = require_client_useIntlayer.isUpdatableNode;
33
36
  exports.markdownPlugin = require_plugins.markdownPlugin;
34
37
  exports.markdownStringPlugin = require_plugins.markdownStringPlugin;
35
38
  exports.provideIntlayer = require_client_installIntlayer.provideIntlayer;
39
+ exports.provideIntlayerAnalytics = require_analytics_useAnalytics.provideIntlayerAnalytics;
40
+ exports.useAnalytics = require_analytics_useAnalytics.useAnalytics;
41
+ exports.useConversion = require_analytics_useConversion.useConversion;
36
42
  exports.useDictionary = require_client_useDictionary.useDictionary;
37
43
  exports.useDictionaryAsync = require_client_useDictionaryAsync.useDictionaryAsync;
38
44
  exports.useDictionaryDynamic = require_client_useDictionaryDynamic.useDictionaryDynamic;
45
+ exports.useExperiment = require_analytics_useExperiment.useExperiment;
39
46
  exports.useIntlayer = require_client_useIntlayer.useIntlayer;
40
47
  exports.useLoadDynamic = require_client_useLoadDynamic.useLoadDynamic;
41
48
  exports.useLocale = require_client_useLocale.useLocale;
@@ -1,6 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- const require_decorate = require('../_virtual/_@oxc-project_runtime@0.127.0/helpers/decorate.cjs');
2
+ const require_decorate = require('../_virtual/_@oxc-project_runtime@0.140.0/helpers/esm/decorate.cjs');
4
3
  let _intlayer_core_markdown = require("@intlayer/core/markdown");
5
4
  let _angular_core = require("@angular/core");
6
5
 
@@ -132,7 +131,7 @@ let IntlayerMarkdownService = class IntlayerMarkdownService {
132
131
  return this.markdownProvider.renderMarkdown(markdown, overrides);
133
132
  }
134
133
  };
135
- IntlayerMarkdownService = require_decorate.__decorate([(0, _angular_core.Injectable)({ providedIn: "root" })], IntlayerMarkdownService);
134
+ IntlayerMarkdownService = require_decorate.default([(0, _angular_core.Injectable)({ providedIn: "root" })], IntlayerMarkdownService);
136
135
  /**
137
136
  * Reads the active markdown provider from the current Angular injector context.
138
137
  * Returns a fallback object that uses the built-in HTML string renderer when
@@ -1 +1 @@
1
- {"version":3,"file":"installIntlayerMarkdown.cjs","names":["InjectionToken"],"sources":["../../../src/markdown/installIntlayerMarkdown.ts"],"sourcesContent":["import {\n Injectable,\n InjectionToken,\n inject,\n type TemplateRef,\n} from '@angular/core';\nimport type {\n MarkdownContext,\n MarkdownRuntime,\n ParsedMarkdown,\n} from '@intlayer/core/markdown';\nimport {\n type CompileOptions,\n compile,\n parseMarkdown as coreParseMarkdown,\n renderMarkdownAst as coreRenderMarkdownAst,\n} from '@intlayer/core/markdown';\n\n/**\n * Options accepted by `compileMarkdown` and `parseMarkdown` to customise\n * rendering behaviour (custom components, sanitizer, slugify, rule hooks, …).\n */\nexport type MarkdownRendererOptions = CompileOptions;\n\n/**\n * Angular `InjectionToken` used to provide a custom markdown renderer via the\n * DI system. Use `createIntlayerMarkdownProvider` to create the provider value\n * and register it in a module or component's `providers` array.\n */\nexport const INTLAYER_MARKDOWN_TOKEN =\n new InjectionToken<IntlayerMarkdownProvider>('intlayerMarkdown');\n\ntype RenderMarkdownOptions = {\n components?: any;\n wrapper?: string;\n options?: any;\n};\n\ntype RenderMarkdownFunction = (\n markdown: string | ParsedMarkdown,\n overrides?: any | RenderMarkdownOptions\n) => string | TemplateRef<any> | Promise<string | TemplateRef<any>>;\n\nexport type IntlayerMarkdownProvider = {\n renderMarkdown: RenderMarkdownFunction;\n};\n\n// Minimal runtime to generate HTML strings\nexport const htmlRuntime: MarkdownRuntime = {\n createElement: (tag: string | any, props: any, ...children: any[]) => {\n if (typeof tag !== 'string') {\n // Handle non-string tags if necessary (e.g. components), or fallback to div\n if (tag === htmlRuntime.Fragment) {\n return children.join('');\n }\n return '';\n }\n\n const attrs = props\n ? Object.entries(props)\n .map(([k, v]) => {\n if (k === 'key' || v === undefined || v === null) return '';\n const key = k === 'className' ? 'class' : k;\n return `${key}=\"${String(v).replace(/\"/g, '&quot;')}\"`;\n })\n .filter(Boolean)\n .join(' ')\n : '';\n\n const childrenStr = children.join('');\n const voidTags = [\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n ];\n\n if (voidTags.includes(tag)) {\n return `<${tag} ${attrs} />`;\n }\n\n return `<${tag}${attrs ? ` ${attrs}` : ''}>${childrenStr}</${tag}>`;\n },\n cloneElement: (element: any, _props: any) => element, // Not really supported for strings\n Fragment: Symbol('Fragment'),\n};\n\n/**\n * Intermediate AST produced by `parseMarkdown`.\n * Pass this to `compileMarkdown` to skip re-parsing when the same content is\n * rendered multiple times.\n */\nexport type { ParsedMarkdown };\n\n/**\n * **Step 1 of 2 — parse only.**\n * Converts a raw markdown string into a `ParsedMarkdown` AST without rendering\n * any HTML. Use this when you need to:\n * - Cache the parsed result and render it several times with different options.\n * - Inspect or transform the AST before rendering.\n * - Defer the render step to a later point.\n *\n * @param markdown - The markdown source string.\n * @param options - Options that affect parsing.\n * @returns A `ParsedMarkdown` AST ready to be passed to `compileMarkdown`.\n *\n * @example\n * ```ts\n * const ast = parseMarkdown('# Hello **world**');\n * const html = compileMarkdown(ast);\n * ```\n */\nexport const parseMarkdown = (\n markdown: string = '',\n options: any = {}\n): ParsedMarkdown => {\n const {\n components,\n namedCodesToUnicode,\n sanitizer,\n slugify,\n ...compilerOptions\n } = options;\n\n const ctx: MarkdownContext<any> = {\n runtime: htmlRuntime,\n components,\n namedCodesToUnicode,\n sanitizer: sanitizer as any,\n slugify,\n };\n\n return coreParseMarkdown(markdown, ctx, compilerOptions);\n};\n\n/**\n * **Steps 1 + 2 — parse and render in one shot.**\n * Accepts a raw markdown string or a pre-parsed `ParsedMarkdown` AST and\n * returns an HTML string. Use with Angular's `[innerHTML]` binding or\n * `IntlayerMarkdownService.renderMarkdown`.\n *\n * @param input - Markdown string or pre-parsed AST.\n * @param options - Rendering options (components, sanitizer, slugify, …).\n * @returns An HTML string representing the rendered markdown.\n *\n * @example\n * ```ts\n * const html = compileMarkdown('# Hello **world**');\n * ```\n */\nexport const compileMarkdown = (\n input: string | ParsedMarkdown = '',\n options: any = {}\n): string => {\n if (typeof input === 'string') {\n return compile(input, { ...options, runtime: htmlRuntime }) as string;\n }\n\n const {\n components,\n namedCodesToUnicode,\n sanitizer,\n slugify,\n ...compilerOptions\n } = options;\n\n const ctx: MarkdownContext<any> = {\n runtime: htmlRuntime,\n components,\n namedCodesToUnicode,\n sanitizer: sanitizer as any,\n slugify,\n };\n\n return coreRenderMarkdownAst(input, ctx, compilerOptions) as string;\n};\n\n/**\n * Default markdown renderer that converts markdown to HTML string\n */\nconst defaultMarkdownRenderer: RenderMarkdownFunction = (\n markdown: string | ParsedMarkdown\n) => compileMarkdown(markdown) as string;\n\n/**\n * Returns an Angular `Provider` object that registers a custom markdown render\n * function under `INTLAYER_MARKDOWN_TOKEN`. Pass the returned provider to a\n * module or component's `providers` array.\n *\n * @param renderMarkdown - Custom render function. Defaults to the built-in\n * HTML string renderer when omitted.\n *\n * @example\n * ```ts\n * // app.module.ts\n * @NgModule({\n * providers: [createIntlayerMarkdownProvider(myCustomRenderer)],\n * })\n * export class AppModule {}\n * ```\n */\nexport const createIntlayerMarkdownProvider = (\n renderMarkdown: RenderMarkdownFunction = defaultMarkdownRenderer\n) => ({\n provide: INTLAYER_MARKDOWN_TOKEN,\n useValue: {\n renderMarkdown,\n } as IntlayerMarkdownProvider,\n});\n\n/**\n * Angular injectable service that wraps the active markdown renderer. Inject\n * this service anywhere in your app to call `renderMarkdown` without touching\n * the DI token directly. Falls back to returning the raw markdown string when\n * no provider is registered.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * export class MyComponent {\n * private markdownService = inject(IntlayerMarkdownService);\n *\n * get html() {\n * return this.markdownService.renderMarkdown('# Hello');\n * }\n * }\n * ```\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class IntlayerMarkdownService {\n private markdownProvider = inject(INTLAYER_MARKDOWN_TOKEN, {\n optional: true,\n });\n\n renderMarkdown(\n markdown: string | ParsedMarkdown,\n overrides?: any\n ): string | TemplateRef<any> | Promise<string | TemplateRef<any>> {\n if (!this.markdownProvider) {\n return typeof markdown === 'string' ? markdown : ''; // Fallback to returning markdown as is\n }\n return this.markdownProvider.renderMarkdown(markdown, overrides);\n }\n}\n\n/**\n * Reads the active markdown provider from the current Angular injector context.\n * Returns a fallback object that uses the built-in HTML string renderer when\n * `createIntlayerMarkdownProvider` has not been registered.\n *\n * @returns An `IntlayerMarkdownProvider` with a `renderMarkdown` method.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * export class MyComponent {\n * private markdown = useMarkdown();\n *\n * get html() {\n * return this.markdown.renderMarkdown('# Hello');\n * }\n * }\n * ```\n */\nexport const useMarkdown = (): IntlayerMarkdownProvider => {\n const markdownProvider = inject(INTLAYER_MARKDOWN_TOKEN, { optional: true });\n\n if (!markdownProvider) {\n return {\n renderMarkdown: defaultMarkdownRenderer,\n };\n }\n\n return markdownProvider;\n};\n"],"mappings":";;;;;;;;;;;;AA6BA,MAAa,0BACX,IAAIA,6BAAyC,mBAAmB;AAkBlE,MAAa,cAA+B;CAC1C,gBAAgB,KAAmB,OAAY,GAAG,aAAoB;AACpE,MAAI,OAAO,QAAQ,UAAU;AAE3B,OAAI,QAAQ,YAAY,SACtB,QAAO,SAAS,KAAK,GAAG;AAE1B,UAAO;;EAGT,MAAM,QAAQ,QACV,OAAO,QAAQ,MAAM,CAClB,KAAK,CAAC,GAAG,OAAO;AACf,OAAI,MAAM,SAAS,MAAM,UAAa,MAAM,KAAM,QAAO;AAEzD,UAAO,GADK,MAAM,cAAc,UAAU,EAC5B,IAAI,OAAO,EAAE,CAAC,QAAQ,MAAM,SAAS,CAAC;IACpD,CACD,OAAO,QAAQ,CACf,KAAK,IAAI,GACZ;EAEJ,MAAM,cAAc,SAAS,KAAK,GAAG;AAkBrC,MAAI;GAhBF;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GAGU,CAAC,SAAS,IAAI,CACxB,QAAO,IAAI,IAAI,GAAG,MAAM;AAG1B,SAAO,IAAI,MAAM,QAAQ,IAAI,UAAU,GAAG,GAAG,YAAY,IAAI,IAAI;;CAEnE,eAAe,SAAc,WAAgB;CAC7C,UAAU,OAAO,WAAW;CAC7B;;;;;;;;;;;;;;;;;;;AA2BD,MAAa,iBACX,WAAmB,IACnB,UAAe,EAAE,KACE;CACnB,MAAM,EACJ,YACA,qBACA,WACA,SACA,GAAG,oBACD;AAUJ,mDAAyB,UAAU;EAPjC,SAAS;EACT;EACA;EACW;EACX;EAGoC,EAAE,gBAAgB;;;;;;;;;;;;;;;;;AAkB1D,MAAa,mBACX,QAAiC,IACjC,UAAe,EAAE,KACN;AACX,KAAI,OAAO,UAAU,SACnB,6CAAe,OAAO;EAAE,GAAG;EAAS,SAAS;EAAa,CAAC;CAG7D,MAAM,EACJ,YACA,qBACA,WACA,SACA,GAAG,oBACD;AAUJ,uDAA6B,OAAO;EAPlC,SAAS;EACT;EACA;EACW;EACX;EAGqC,EAAE,gBAAgB;;;;;AAM3D,MAAM,2BACJ,aACG,gBAAgB,SAAS;;;;;;;;;;;;;;;;;;AAmB9B,MAAa,kCACX,iBAAyC,6BACrC;CACJ,SAAS;CACT,UAAU,EACR,gBACD;CACF;AAuBM,oCAAM,wBAAwB;CACnC,AAAQ,6CAA0B,yBAAyB,EACzD,UAAU,MACX,CAAC;CAEF,eACE,UACA,WACgE;AAChE,MAAI,CAAC,KAAK,iBACR,QAAO,OAAO,aAAa,WAAW,WAAW;AAEnD,SAAO,KAAK,iBAAiB,eAAe,UAAU,UAAU;;;qFAfxD,EACV,YAAY,QACb,CAAC;;;;;;;;;;;;;;;;;;;;AAoCF,MAAa,oBAA8C;CACzD,MAAM,6CAA0B,yBAAyB,EAAE,UAAU,MAAM,CAAC;AAE5E,KAAI,CAAC,iBACH,QAAO,EACL,gBAAgB,yBACjB;AAGH,QAAO"}
1
+ {"version":3,"file":"installIntlayerMarkdown.cjs","names":["InjectionToken"],"sources":["../../../src/markdown/installIntlayerMarkdown.ts"],"sourcesContent":["import {\n Injectable,\n InjectionToken,\n inject,\n type TemplateRef,\n} from '@angular/core';\nimport type {\n MarkdownContext,\n MarkdownRuntime,\n ParsedMarkdown,\n} from '@intlayer/core/markdown';\nimport {\n type CompileOptions,\n compile,\n parseMarkdown as coreParseMarkdown,\n renderMarkdownAst as coreRenderMarkdownAst,\n} from '@intlayer/core/markdown';\n\n/**\n * Options accepted by `compileMarkdown` and `parseMarkdown` to customise\n * rendering behaviour (custom components, sanitizer, slugify, rule hooks, …).\n */\nexport type MarkdownRendererOptions = CompileOptions;\n\n/**\n * Angular `InjectionToken` used to provide a custom markdown renderer via the\n * DI system. Use `createIntlayerMarkdownProvider` to create the provider value\n * and register it in a module or component's `providers` array.\n */\nexport const INTLAYER_MARKDOWN_TOKEN =\n new InjectionToken<IntlayerMarkdownProvider>('intlayerMarkdown');\n\ntype RenderMarkdownOptions = {\n components?: any;\n wrapper?: string;\n options?: any;\n};\n\ntype RenderMarkdownFunction = (\n markdown: string | ParsedMarkdown,\n overrides?: any | RenderMarkdownOptions\n) => string | TemplateRef<any> | Promise<string | TemplateRef<any>>;\n\nexport type IntlayerMarkdownProvider = {\n renderMarkdown: RenderMarkdownFunction;\n};\n\n// Minimal runtime to generate HTML strings\nexport const htmlRuntime: MarkdownRuntime = {\n createElement: (tag: string | any, props: any, ...children: any[]) => {\n if (typeof tag !== 'string') {\n // Handle non-string tags if necessary (e.g. components), or fallback to div\n if (tag === htmlRuntime.Fragment) {\n return children.join('');\n }\n return '';\n }\n\n const attrs = props\n ? Object.entries(props)\n .map(([k, v]) => {\n if (k === 'key' || v === undefined || v === null) return '';\n const key = k === 'className' ? 'class' : k;\n return `${key}=\"${String(v).replace(/\"/g, '&quot;')}\"`;\n })\n .filter(Boolean)\n .join(' ')\n : '';\n\n const childrenStr = children.join('');\n const voidTags = [\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n ];\n\n if (voidTags.includes(tag)) {\n return `<${tag} ${attrs} />`;\n }\n\n return `<${tag}${attrs ? ` ${attrs}` : ''}>${childrenStr}</${tag}>`;\n },\n cloneElement: (element: any, _props: any) => element, // Not really supported for strings\n Fragment: Symbol('Fragment'),\n};\n\n/**\n * Intermediate AST produced by `parseMarkdown`.\n * Pass this to `compileMarkdown` to skip re-parsing when the same content is\n * rendered multiple times.\n */\nexport type { ParsedMarkdown };\n\n/**\n * **Step 1 of 2 — parse only.**\n * Converts a raw markdown string into a `ParsedMarkdown` AST without rendering\n * any HTML. Use this when you need to:\n * - Cache the parsed result and render it several times with different options.\n * - Inspect or transform the AST before rendering.\n * - Defer the render step to a later point.\n *\n * @param markdown - The markdown source string.\n * @param options - Options that affect parsing.\n * @returns A `ParsedMarkdown` AST ready to be passed to `compileMarkdown`.\n *\n * @example\n * ```ts\n * const ast = parseMarkdown('# Hello **world**');\n * const html = compileMarkdown(ast);\n * ```\n */\nexport const parseMarkdown = (\n markdown: string = '',\n options: any = {}\n): ParsedMarkdown => {\n const {\n components,\n namedCodesToUnicode,\n sanitizer,\n slugify,\n ...compilerOptions\n } = options;\n\n const ctx: MarkdownContext<any> = {\n runtime: htmlRuntime,\n components,\n namedCodesToUnicode,\n sanitizer: sanitizer as any,\n slugify,\n };\n\n return coreParseMarkdown(markdown, ctx, compilerOptions);\n};\n\n/**\n * **Steps 1 + 2 — parse and render in one shot.**\n * Accepts a raw markdown string or a pre-parsed `ParsedMarkdown` AST and\n * returns an HTML string. Use with Angular's `[innerHTML]` binding or\n * `IntlayerMarkdownService.renderMarkdown`.\n *\n * @param input - Markdown string or pre-parsed AST.\n * @param options - Rendering options (components, sanitizer, slugify, …).\n * @returns An HTML string representing the rendered markdown.\n *\n * @example\n * ```ts\n * const html = compileMarkdown('# Hello **world**');\n * ```\n */\nexport const compileMarkdown = (\n input: string | ParsedMarkdown = '',\n options: any = {}\n): string => {\n if (typeof input === 'string') {\n return compile(input, { ...options, runtime: htmlRuntime }) as string;\n }\n\n const {\n components,\n namedCodesToUnicode,\n sanitizer,\n slugify,\n ...compilerOptions\n } = options;\n\n const ctx: MarkdownContext<any> = {\n runtime: htmlRuntime,\n components,\n namedCodesToUnicode,\n sanitizer: sanitizer as any,\n slugify,\n };\n\n return coreRenderMarkdownAst(input, ctx, compilerOptions) as string;\n};\n\n/**\n * Default markdown renderer that converts markdown to HTML string\n */\nconst defaultMarkdownRenderer: RenderMarkdownFunction = (\n markdown: string | ParsedMarkdown\n) => compileMarkdown(markdown) as string;\n\n/**\n * Returns an Angular `Provider` object that registers a custom markdown render\n * function under `INTLAYER_MARKDOWN_TOKEN`. Pass the returned provider to a\n * module or component's `providers` array.\n *\n * @param renderMarkdown - Custom render function. Defaults to the built-in\n * HTML string renderer when omitted.\n *\n * @example\n * ```ts\n * // app.module.ts\n * @NgModule({\n * providers: [createIntlayerMarkdownProvider(myCustomRenderer)],\n * })\n * export class AppModule {}\n * ```\n */\nexport const createIntlayerMarkdownProvider = (\n renderMarkdown: RenderMarkdownFunction = defaultMarkdownRenderer\n) => ({\n provide: INTLAYER_MARKDOWN_TOKEN,\n useValue: {\n renderMarkdown,\n } as IntlayerMarkdownProvider,\n});\n\n/**\n * Angular injectable service that wraps the active markdown renderer. Inject\n * this service anywhere in your app to call `renderMarkdown` without touching\n * the DI token directly. Falls back to returning the raw markdown string when\n * no provider is registered.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * export class MyComponent {\n * private markdownService = inject(IntlayerMarkdownService);\n *\n * get html() {\n * return this.markdownService.renderMarkdown('# Hello');\n * }\n * }\n * ```\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class IntlayerMarkdownService {\n private markdownProvider = inject(INTLAYER_MARKDOWN_TOKEN, {\n optional: true,\n });\n\n renderMarkdown(\n markdown: string | ParsedMarkdown,\n overrides?: any\n ): string | TemplateRef<any> | Promise<string | TemplateRef<any>> {\n if (!this.markdownProvider) {\n return typeof markdown === 'string' ? markdown : ''; // Fallback to returning markdown as is\n }\n return this.markdownProvider.renderMarkdown(markdown, overrides);\n }\n}\n\n/**\n * Reads the active markdown provider from the current Angular injector context.\n * Returns a fallback object that uses the built-in HTML string renderer when\n * `createIntlayerMarkdownProvider` has not been registered.\n *\n * @returns An `IntlayerMarkdownProvider` with a `renderMarkdown` method.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * export class MyComponent {\n * private markdown = useMarkdown();\n *\n * get html() {\n * return this.markdown.renderMarkdown('# Hello');\n * }\n * }\n * ```\n */\nexport const useMarkdown = (): IntlayerMarkdownProvider => {\n const markdownProvider = inject(INTLAYER_MARKDOWN_TOKEN, { optional: true });\n\n if (!markdownProvider) {\n return {\n renderMarkdown: defaultMarkdownRenderer,\n };\n }\n\n return markdownProvider;\n};\n"],"mappings":";;;;;;;;;;;AA6BA,MAAa,0BACX,IAAIA,6BAAyC,kBAAkB;AAkBjE,MAAa,cAA+B;CAC1C,gBAAgB,KAAmB,OAAY,GAAG,aAAoB;EACpE,IAAI,OAAO,QAAQ,UAAU;GAE3B,IAAI,QAAQ,YAAY,UACtB,OAAO,SAAS,KAAK,EAAE;GAEzB,OAAO;EACT;EAEA,MAAM,QAAQ,QACV,OAAO,QAAQ,KAAK,CAAC,CAClB,KAAK,CAAC,GAAG,OAAO;GACf,IAAI,MAAM,SAAS,MAAM,UAAa,MAAM,MAAM,OAAO;GAEzD,OAAO,GADK,MAAM,cAAc,UAAU,EAC5B,IAAI,OAAO,CAAC,CAAC,CAAC,QAAQ,MAAM,QAAQ,EAAE;EACtD,CAAC,CAAC,CACD,OAAO,OAAO,CAAC,CACf,KAAK,GAAG,IACX;EAEJ,MAAM,cAAc,SAAS,KAAK,EAAE;EAkBpC,IAAI;GAhBF;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EAGS,CAAC,CAAC,SAAS,GAAG,GACvB,OAAO,IAAI,IAAI,GAAG,MAAM;EAG1B,OAAO,IAAI,MAAM,QAAQ,IAAI,UAAU,GAAG,GAAG,YAAY,IAAI,IAAI;CACnE;CACA,eAAe,SAAc,WAAgB;CAC7C,UAAU,OAAO,UAAU;AAC7B;;;;;;;;;;;;;;;;;;;AA2BA,MAAa,iBACX,WAAmB,IACnB,UAAe,CAAC,MACG;CACnB,MAAM,EACJ,YACA,qBACA,WACA,SACA,GAAG,oBACD;CAUJ,kDAAyB,UAAU;EAPjC,SAAS;EACT;EACA;EACW;EACX;CAGmC,GAAG,eAAe;AACzD;;;;;;;;;;;;;;;;AAiBA,MAAa,mBACX,QAAiC,IACjC,UAAe,CAAC,MACL;CACX,IAAI,OAAO,UAAU,UACnB,4CAAe,OAAO;EAAE,GAAG;EAAS,SAAS;CAAY,CAAC;CAG5D,MAAM,EACJ,YACA,qBACA,WACA,SACA,GAAG,oBACD;CAUJ,sDAA6B,OAAO;EAPlC,SAAS;EACT;EACA;EACW;EACX;CAGoC,GAAG,eAAe;AAC1D;;;;AAKA,MAAM,2BACJ,aACG,gBAAgB,QAAQ;;;;;;;;;;;;;;;;;;AAmB7B,MAAa,kCACX,iBAAyC,6BACrC;CACJ,SAAS;CACT,UAAU,EACR,eACF;AACF;AAuBO,IAAM,0BAAN,MAAM,wBAAwB;CACnC,AAAQ,6CAA0B,yBAAyB,EACzD,UAAU,KACZ,CAAC;CAED,eACE,UACA,WACgE;EAChE,IAAI,CAAC,KAAK,kBACR,OAAO,OAAO,aAAa,WAAW,WAAW;EAEnD,OAAO,KAAK,iBAAiB,eAAe,UAAU,SAAS;CACjE;AACF;kFAjBY,EACV,YAAY,OACd,CAAC;;;;;;;;;;;;;;;;;;;;AAoCD,MAAa,oBAA8C;CACzD,MAAM,6CAA0B,yBAAyB,EAAE,UAAU,KAAK,CAAC;CAE3E,IAAI,CAAC,kBACH,OAAO,EACL,gBAAgB,wBAClB;CAGF,OAAO;AACT"}