angular-intlayer 8.4.0-canary.0 → 8.4.1

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 (112) hide show
  1. package/dist/cjs/ContentSelector.component-Dfy-4WRH.cjs +9 -0
  2. package/dist/cjs/ContentSelector.component-Dfy-4WRH.cjs.map +1 -0
  3. package/dist/cjs/{_virtual/_rolldown/runtime.cjs → chunk-Bmb41Sf3.cjs} +1 -1
  4. package/dist/cjs/client/installIntlayer.cjs +1 -1
  5. package/dist/cjs/client/installIntlayer.cjs.map +1 -1
  6. package/dist/cjs/client/useDictionary.cjs +1 -1
  7. package/dist/cjs/client/useDictionary.cjs.map +1 -1
  8. package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
  9. package/dist/cjs/client/useDictionaryAsync.cjs.map +1 -1
  10. package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
  11. package/dist/cjs/client/useDictionaryDynamic.cjs.map +1 -1
  12. package/dist/cjs/client/useIntl.cjs +1 -1
  13. package/dist/cjs/client/useIntl.cjs.map +1 -1
  14. package/dist/cjs/client/useIntlayer.cjs +1 -1
  15. package/dist/cjs/client/useIntlayer.cjs.map +1 -1
  16. package/dist/cjs/client/useLoadDynamic.cjs +1 -1
  17. package/dist/cjs/client/useLoadDynamic.cjs.map +1 -1
  18. package/dist/cjs/client/useLocale.cjs +1 -1
  19. package/dist/cjs/client/useLocale.cjs.map +1 -1
  20. package/dist/cjs/client/useLocaleStorage.cjs +1 -1
  21. package/dist/cjs/client/useLocaleStorage.cjs.map +1 -1
  22. package/dist/{esm/_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.mjs → cjs/decorate-B_4qGGx3.cjs} +1 -1
  23. package/dist/cjs/editor/ContentSelector.component.cjs +1 -9
  24. package/dist/cjs/editor/useEditor.cjs +1 -1
  25. package/dist/cjs/editor/useEditor.cjs.map +1 -1
  26. package/dist/cjs/getDictionary.cjs +1 -1
  27. package/dist/cjs/getDictionary.cjs.map +1 -1
  28. package/dist/cjs/getIntlayer.cjs +1 -1
  29. package/dist/cjs/getIntlayer.cjs.map +1 -1
  30. package/dist/cjs/index.cjs +1 -1
  31. package/dist/cjs/markdown/installIntlayerMarkdown.cjs +1 -1
  32. package/dist/cjs/markdown/installIntlayerMarkdown.cjs.map +1 -1
  33. package/dist/cjs/plugins.cjs +1 -1
  34. package/dist/cjs/plugins.cjs.map +1 -1
  35. package/dist/cjs/webpack/mergeConfig.cjs +1 -1
  36. package/dist/cjs/webpack/mergeConfig.cjs.map +1 -1
  37. package/dist/esm/ContentSelector.component-B9Uvy9gY.mjs +9 -0
  38. package/dist/esm/ContentSelector.component-B9Uvy9gY.mjs.map +1 -0
  39. package/dist/esm/client/installIntlayer.mjs +1 -1
  40. package/dist/esm/client/installIntlayer.mjs.map +1 -1
  41. package/dist/esm/client/useIntl.mjs.map +1 -1
  42. package/dist/{cjs/_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.cjs → esm/decorate-EVKP5RjP.mjs} +1 -1
  43. package/dist/esm/editor/ContentSelector.component.mjs +1 -9
  44. package/dist/esm/editor/useEditor.mjs +1 -1
  45. package/dist/esm/editor/useEditor.mjs.map +1 -1
  46. package/dist/esm/index.mjs +1 -1
  47. package/dist/esm/markdown/installIntlayerMarkdown.mjs +1 -1
  48. package/dist/esm/markdown/installIntlayerMarkdown.mjs.map +1 -1
  49. package/dist/esm/plugins.mjs +1 -1
  50. package/dist/esm/plugins.mjs.map +1 -1
  51. package/dist/types/client/index.d.ts +8 -8
  52. package/dist/types/client/installIntlayer.d.ts +2 -50
  53. package/dist/types/client/useDictionary.d.ts +2 -10
  54. package/dist/types/client/useDictionaryAsync.d.ts +2 -14
  55. package/dist/types/client/useDictionaryDynamic.d.ts +2 -17
  56. package/dist/types/client/useIntl.d.ts +2 -89
  57. package/dist/types/client/useIntlayer.d.ts +2 -38
  58. package/dist/types/client/useLoadDynamic.d.ts +2 -11
  59. package/dist/types/client/useLocale.d.ts +2 -48
  60. package/dist/types/getDictionary-DDjZzxAC.d.ts +9 -0
  61. package/dist/types/getDictionary-DDjZzxAC.d.ts.map +1 -0
  62. package/dist/types/getDictionary.d.ts +2 -9
  63. package/dist/types/getIntlayer-CWM6qsJJ.d.ts +8 -0
  64. package/dist/types/getIntlayer-CWM6qsJJ.d.ts.map +1 -0
  65. package/dist/types/getIntlayer.d.ts +2 -8
  66. package/dist/types/index-Cf8zm5QQ.d.ts +1 -0
  67. package/dist/types/index-D5QAgZ5v.d.ts +22 -0
  68. package/dist/types/index-D5QAgZ5v.d.ts.map +1 -0
  69. package/dist/types/index.d.ts +13 -21
  70. package/dist/types/installIntlayer-Ce7kST5N.d.ts +50 -0
  71. package/dist/types/installIntlayer-Ce7kST5N.d.ts.map +1 -0
  72. package/dist/types/installIntlayerMarkdown-BIU3FTDH.d.ts +36 -0
  73. package/dist/types/installIntlayerMarkdown-BIU3FTDH.d.ts.map +1 -0
  74. package/dist/types/markdown/index.d.ts +1 -1
  75. package/dist/types/markdown/installIntlayerMarkdown.d.ts +2 -36
  76. package/dist/types/plugins-C_v3w-vC.d.ts +89 -0
  77. package/dist/types/plugins-C_v3w-vC.d.ts.map +1 -0
  78. package/dist/types/plugins.d.ts +2 -89
  79. package/dist/types/useDictionary-Dq9yu0X_.d.ts +10 -0
  80. package/dist/types/useDictionary-Dq9yu0X_.d.ts.map +1 -0
  81. package/dist/types/useDictionaryAsync-BYUsr8w4.d.ts +14 -0
  82. package/dist/types/useDictionaryAsync-BYUsr8w4.d.ts.map +1 -0
  83. package/dist/types/useIntl-CHizZCR2.d.ts +33 -0
  84. package/dist/types/useIntl-CHizZCR2.d.ts.map +1 -0
  85. package/dist/types/useIntlayer-m3n_upwm.d.ts +38 -0
  86. package/dist/types/useIntlayer-m3n_upwm.d.ts.map +1 -0
  87. package/dist/types/useLoadDynamic-C4pltPcC.d.ts +11 -0
  88. package/dist/types/useLoadDynamic-C4pltPcC.d.ts.map +1 -0
  89. package/dist/types/useLocale-BzfAmXlx.d.ts +48 -0
  90. package/dist/types/useLocale-BzfAmXlx.d.ts.map +1 -0
  91. package/dist/types/webpack/index.d.ts +5 -2
  92. package/dist/types/webpack/index.d.ts.map +1 -0
  93. package/dist/types/webpack/mergeConfig.d.ts +2 -5
  94. package/package.json +8 -8
  95. package/dist/cjs/_virtual/_@oxc-project_runtime@0.115.0/helpers/decorateMetadata.cjs +0 -1
  96. package/dist/cjs/editor/ContentSelector.component.cjs.map +0 -1
  97. package/dist/esm/_virtual/_@oxc-project_runtime@0.115.0/helpers/decorateMetadata.mjs +0 -1
  98. package/dist/esm/editor/ContentSelector.component.mjs.map +0 -1
  99. package/dist/types/client/installIntlayer.d.ts.map +0 -1
  100. package/dist/types/client/useDictionary.d.ts.map +0 -1
  101. package/dist/types/client/useDictionaryAsync.d.ts.map +0 -1
  102. package/dist/types/client/useDictionaryDynamic.d.ts.map +0 -1
  103. package/dist/types/client/useIntl.d.ts.map +0 -1
  104. package/dist/types/client/useIntlayer.d.ts.map +0 -1
  105. package/dist/types/client/useLoadDynamic.d.ts.map +0 -1
  106. package/dist/types/client/useLocale.d.ts.map +0 -1
  107. package/dist/types/getDictionary.d.ts.map +0 -1
  108. package/dist/types/getIntlayer.d.ts.map +0 -1
  109. package/dist/types/index.d.ts.map +0 -1
  110. package/dist/types/markdown/installIntlayerMarkdown.d.ts.map +0 -1
  111. package/dist/types/plugins.d.ts.map +0 -1
  112. package/dist/types/webpack/mergeConfig.d.ts.map +0 -1
@@ -1 +1 @@
1
- import{INTLAYER_MARKDOWN_TOKEN as e,IntlayerMarkdownService as t,createIntlayerMarkdownProvider as n,htmlRuntime as r,useMarkdown as i}from"./markdown/installIntlayerMarkdown.mjs";import{getPlugins as a,htmlPlugin as o,insertionPlugin as s,intlayerNodePlugins as c,markdownPlugin as l,markdownStringPlugin as u}from"./plugins.mjs";import{getIntlayer as d}from"./getIntlayer.mjs";import{getDictionary as f}from"./getDictionary.mjs";import{INTLAYER_TOKEN as p,IntlayerProvider as m,createIntlayerClient as h,installIntlayer as g,provideIntlayer as _}from"./client/installIntlayer.mjs";import{useDictionary as v}from"./client/useDictionary.mjs";import{useDictionaryAsync as y}from"./client/useDictionaryAsync.mjs";import{useLoadDynamic as b}from"./client/useLoadDynamic.mjs";import{useDictionaryDynamic as x}from"./client/useDictionaryDynamic.mjs";import{useIntl as S}from"./client/useIntl.mjs";import{isUpdatableNode as C,useIntlayer as w}from"./client/useIntlayer.mjs";import{useLocale as T}from"./client/useLocale.mjs";export{e as INTLAYER_MARKDOWN_TOKEN,p as INTLAYER_TOKEN,t as IntlayerMarkdownService,m as IntlayerProvider,h as createIntlayerClient,n as createIntlayerMarkdownProvider,f as getDictionary,d as getIntlayer,a as getPlugins,o as htmlPlugin,r as htmlRuntime,s as insertionPlugin,g as installIntlayer,c as intlayerNodePlugins,C as isUpdatableNode,l as markdownPlugin,u as markdownStringPlugin,_ as provideIntlayer,v as useDictionary,y as useDictionaryAsync,x as useDictionaryDynamic,S as useIntl,w as useIntlayer,b as useLoadDynamic,T as useLocale,i as useMarkdown};
1
+ import{INTLAYER_MARKDOWN_TOKEN as e,IntlayerMarkdownService as t,createIntlayerMarkdownProvider as n,htmlRuntime as r,useMarkdown as i}from"./markdown/installIntlayerMarkdown.mjs";import{getPlugins as a,htmlPlugin as o,insertionPlugin as s,intlayerNodePlugins as c,markdownPlugin as l,markdownStringPlugin as u}from"./plugins.mjs";import{getIntlayer as d}from"./getIntlayer.mjs";import{getDictionary as f}from"./getDictionary.mjs";import{INTLAYER_TOKEN as p,IntlayerProvider as m,createIntlayerClient as h,installIntlayer as g,provideIntlayer as _}from"./client/installIntlayer.mjs";import{useDictionary as v}from"./client/useDictionary.mjs";import{useDictionaryAsync as y}from"./client/useDictionaryAsync.mjs";import{useLoadDynamic as b}from"./client/useLoadDynamic.mjs";import{useDictionaryDynamic as x}from"./client/useDictionaryDynamic.mjs";import{useIntl as S}from"./client/useIntl.mjs";import{isUpdatableNode as C,useIntlayer as w}from"./client/useIntlayer.mjs";import{useLocale as T}from"./client/useLocale.mjs";import"./client/index.mjs";import"./markdown/index.mjs";export{e as INTLAYER_MARKDOWN_TOKEN,p as INTLAYER_TOKEN,t as IntlayerMarkdownService,m as IntlayerProvider,h as createIntlayerClient,n as createIntlayerMarkdownProvider,f as getDictionary,d as getIntlayer,a as getPlugins,o as htmlPlugin,r as htmlRuntime,s as insertionPlugin,g as installIntlayer,c as intlayerNodePlugins,C as isUpdatableNode,l as markdownPlugin,u as markdownStringPlugin,_ as provideIntlayer,v as useDictionary,y as useDictionaryAsync,x as useDictionaryDynamic,S as useIntl,w as useIntlayer,b as useLoadDynamic,T as useLocale,i as useMarkdown};
@@ -1,2 +1,2 @@
1
- import{__decorate as e}from"../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.mjs";import{compile as t}from"@intlayer/core/markdown";import{Injectable as n,InjectionToken as r,inject as i}from"@angular/core";const a=new r(`intlayerMarkdown`),o={createElement:(e,t,...n)=>{if(typeof e!=`string`)return e===o.Fragment?n.join(``):``;let r=t?Object.entries(t).map(([e,t])=>e===`key`||t==null?``:`${e===`className`?`class`:e}="${String(t).replace(/"/g,`&quot;`)}"`).filter(Boolean).join(` `):``,i=n.join(``);return[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(e)?`<${e} ${r} />`:`<${e}${r?` ${r}`:``}>${i}</${e}>`},cloneElement:(e,t)=>e,Fragment:Symbol(`Fragment`)},s=e=>t(e,{runtime:o}),c=(e=s)=>({provide:a,useValue:{renderMarkdown:e}});let l=class{markdownProvider=i(a,{optional:!0});renderMarkdown(e,t){return this.markdownProvider?this.markdownProvider.renderMarkdown(e,t):e}};l=e([n({providedIn:`root`})],l);const u=()=>i(a,{optional:!0})||{renderMarkdown:s};export{a as INTLAYER_MARKDOWN_TOKEN,l as IntlayerMarkdownService,c as createIntlayerMarkdownProvider,o as htmlRuntime,u as useMarkdown};
1
+ import{t as e}from"../decorate-EVKP5RjP.mjs";import{compile as t}from"@intlayer/core/markdown";import{Injectable as n,InjectionToken as r,inject as i}from"@angular/core";const a=new r(`intlayerMarkdown`),o={createElement:(e,t,...n)=>{if(typeof e!=`string`)return e===o.Fragment?n.join(``):``;let r=t?Object.entries(t).map(([e,t])=>e===`key`||t==null?``:`${e===`className`?`class`:e}="${String(t).replace(/"/g,`&quot;`)}"`).filter(Boolean).join(` `):``,i=n.join(``);return[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(e)?`<${e} ${r} />`:`<${e}${r?` ${r}`:``}>${i}</${e}>`},cloneElement:(e,t)=>e,Fragment:Symbol(`Fragment`)},s=e=>t(e,{runtime:o}),c=(e=s)=>({provide:a,useValue:{renderMarkdown:e}});let l=class{markdownProvider=i(a,{optional:!0});renderMarkdown(e,t){return this.markdownProvider?this.markdownProvider.renderMarkdown(e,t):e}};l=e([n({providedIn:`root`})],l);const u=()=>i(a,{optional:!0})||{renderMarkdown:s};export{a as INTLAYER_MARKDOWN_TOKEN,l as IntlayerMarkdownService,c as createIntlayerMarkdownProvider,o as htmlRuntime,u as useMarkdown};
2
2
  //# sourceMappingURL=installIntlayerMarkdown.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"installIntlayerMarkdown.mjs","names":[],"sources":["../../../src/markdown/installIntlayerMarkdown.ts"],"sourcesContent":["import {\n Injectable,\n InjectionToken,\n inject,\n type TemplateRef,\n} from '@angular/core';\nimport type { MarkdownRuntime } from '@intlayer/core/markdown';\nimport { compile } from '@intlayer/core/markdown';\n\nexport const INTLAYER_MARKDOWN_TOKEN =\n new InjectionToken<IntlayerMarkdownProvider>('intlayerMarkdown');\n\ntype RenderMarkdownOptions = {\n components?: any;\n wrapper?: any;\n options?: any;\n};\n\ntype RenderMarkdownFunction = (\n markdown: string,\n overrides?: any | RenderMarkdownOptions\n) => 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 * Default markdown renderer that converts markdown to HTML string\n */\nconst defaultMarkdownRenderer: RenderMarkdownFunction = (markdown: string) =>\n compile(markdown, { runtime: htmlRuntime }) as string;\n\n/**\n * Create IntlayerMarkdown provider configuration\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 * Injectable service for markdown rendering\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class IntlayerMarkdownService {\n private markdownProvider = inject(INTLAYER_MARKDOWN_TOKEN, {\n optional: true,\n });\n\n renderMarkdown(markdown: string, overrides?: any): string | TemplateRef<any> {\n if (!this.markdownProvider) {\n return markdown; // Fallback to returning markdown as is\n }\n return this.markdownProvider.renderMarkdown(markdown, overrides);\n }\n}\n\n/**\n * Function to inject markdown provider\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":"yNASA,MAAa,EACX,IAAI,EAAyC,mBAAmB,CAkBrD,EAA+B,CAC1C,eAAgB,EAAmB,EAAY,GAAG,IAAoB,CACpE,GAAI,OAAO,GAAQ,SAKjB,OAHI,IAAQ,EAAY,SACf,EAAS,KAAK,GAAG,CAEnB,GAGT,IAAM,EAAQ,EACV,OAAO,QAAQ,EAAM,CAClB,KAAK,CAAC,EAAG,KACJ,IAAM,OAAS,GAAyB,KAAa,GAElD,GADK,IAAM,YAAc,QAAU,EAC5B,IAAI,OAAO,EAAE,CAAC,QAAQ,KAAM,SAAS,CAAC,GACpD,CACD,OAAO,QAAQ,CACf,KAAK,IAAI,CACZ,GAEE,EAAc,EAAS,KAAK,GAAG,CAsBrC,MArBiB,CACf,OACA,OACA,KACA,MACA,QACA,KACA,MACA,QACA,OACA,OACA,QACA,SACA,QACA,MACD,CAEY,SAAS,EAAI,CACjB,IAAI,EAAI,GAAG,EAAM,KAGnB,IAAI,IAAM,EAAQ,IAAI,IAAU,GAAG,GAAG,EAAY,IAAI,EAAI,IAEnE,cAAe,EAAc,IAAgB,EAC7C,SAAU,OAAO,WAAW,CAC7B,CAKK,EAAmD,GACvD,EAAQ,EAAU,CAAE,QAAS,EAAa,CAAC,CAKhC,GACX,EAAyC,KACrC,CACJ,QAAS,EACT,SAAU,CACR,iBACD,CACF,EAQM,IAAA,EAAA,KAA8B,CACnC,iBAA2B,EAAO,EAAyB,CACzD,SAAU,GACX,CAAC,CAEF,eAAe,EAAkB,EAA4C,CAI3E,OAHK,KAAK,iBAGH,KAAK,iBAAiB,eAAe,EAAU,EAAU,CAFvD,SAVZ,EAAW,CACV,WAAY,OACb,CAAC,CAAA,CAAA,EAAA,CAiBF,MAAa,MACc,EAAO,EAAyB,CAAE,SAAU,GAAM,CAAC,EAGnE,CACL,eAAgB,EACjB"}
1
+ {"version":3,"file":"installIntlayerMarkdown.mjs","names":[],"sources":["../../../src/markdown/installIntlayerMarkdown.ts"],"sourcesContent":["import {\n Injectable,\n InjectionToken,\n inject,\n type TemplateRef,\n} from '@angular/core';\nimport type { MarkdownRuntime } from '@intlayer/core/markdown';\nimport { compile } from '@intlayer/core/markdown';\n\nexport const INTLAYER_MARKDOWN_TOKEN =\n new InjectionToken<IntlayerMarkdownProvider>('intlayerMarkdown');\n\ntype RenderMarkdownOptions = {\n components?: any;\n wrapper?: any;\n options?: any;\n};\n\ntype RenderMarkdownFunction = (\n markdown: string,\n overrides?: any | RenderMarkdownOptions\n) => 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 * Default markdown renderer that converts markdown to HTML string\n */\nconst defaultMarkdownRenderer: RenderMarkdownFunction = (markdown: string) =>\n compile(markdown, { runtime: htmlRuntime }) as string;\n\n/**\n * Create IntlayerMarkdown provider configuration\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 * Injectable service for markdown rendering\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class IntlayerMarkdownService {\n private markdownProvider = inject(INTLAYER_MARKDOWN_TOKEN, {\n optional: true,\n });\n\n renderMarkdown(markdown: string, overrides?: any): string | TemplateRef<any> {\n if (!this.markdownProvider) {\n return markdown; // Fallback to returning markdown as is\n }\n return this.markdownProvider.renderMarkdown(markdown, overrides);\n }\n}\n\n/**\n * Function to inject markdown provider\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":"0KASA,MAAa,EACX,IAAI,EAAyC,mBAAmB,CAkBrD,EAA+B,CAC1C,eAAgB,EAAmB,EAAY,GAAG,IAAoB,CACpE,GAAI,OAAO,GAAQ,SAKjB,OAHI,IAAQ,EAAY,SACf,EAAS,KAAK,GAAG,CAEnB,GAGT,IAAM,EAAQ,EACV,OAAO,QAAQ,EAAM,CAClB,KAAK,CAAC,EAAG,KACJ,IAAM,OAAS,GAAyB,KAAa,GAElD,GADK,IAAM,YAAc,QAAU,EAC5B,IAAI,OAAO,EAAE,CAAC,QAAQ,KAAM,SAAS,CAAC,GACpD,CACD,OAAO,QAAQ,CACf,KAAK,IAAI,CACZ,GAEE,EAAc,EAAS,KAAK,GAAG,CAsBrC,MArBiB,CACf,OACA,OACA,KACA,MACA,QACA,KACA,MACA,QACA,OACA,OACA,QACA,SACA,QACA,MACD,CAEY,SAAS,EAAI,CACjB,IAAI,EAAI,GAAG,EAAM,KAGnB,IAAI,IAAM,EAAQ,IAAI,IAAU,GAAG,GAAG,EAAY,IAAI,EAAI,IAEnE,cAAe,EAAc,IAAgB,EAC7C,SAAU,OAAO,WAAW,CAC7B,CAKK,EAAmD,GACvD,EAAQ,EAAU,CAAE,QAAS,EAAa,CAAC,CAKhC,GACX,EAAyC,KACrC,CACJ,QAAS,EACT,SAAU,CACR,iBACD,CACF,EAQM,IAAA,EAAA,KAA8B,CACnC,iBAA2B,EAAO,EAAyB,CACzD,SAAU,GACX,CAAC,CAEF,eAAe,EAAkB,EAA4C,CAI3E,OAHK,KAAK,iBAGH,KAAK,iBAAiB,eAAe,EAAU,EAAU,CAFvD,SAVZ,EAAW,CACV,WAAY,OACb,CAAC,CAAA,CAAA,EAAA,CAiBF,MAAa,MACc,EAAO,EAAyB,CAAE,SAAU,GAAM,CAAC,EAGnE,CACL,eAAgB,EACjB"}
@@ -1,2 +1,2 @@
1
- import{renderIntlayerNode as e}from"./renderIntlayerNode.mjs";import{ContentSelectorWrapperComponent as t}from"./editor/ContentSelector.component.mjs";import{htmlRuntime as n,useMarkdown as r}from"./markdown/installIntlayerMarkdown.mjs";import{conditionPlugin as i,enumerationPlugin as a,filePlugin as o,genderPlugin as s,nestedPlugin as c,translationPlugin as l}from"@intlayer/core/interpreter";import u from"@intlayer/config/built";import{compile as d,getMarkdownMetadata as f}from"@intlayer/core/markdown";import{NodeType as p}from"@intlayer/types/nodeType";const m=(e,t)=>({...e,createElement:(n,r,...i)=>{let a=t?.[n];if(a){let t={...r,...a},o=r?.class||r?.className,s=a.class||a.className;return o&&s&&(t.class=`${o} ${s}`,t.className=void 0),e.createElement(n,t,...i)}return e.createElement(n,r,...i)}}),h={id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(n,{children:r,...i})=>e({...i,value:r,children:()=>({component:u?.editor.enabled?t:r,props:{dictionaryKey:i.dictionaryKey,keyPath:i.keyPath},children:r})})},g={id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(i,a,o)=>{let{plugins:s,...c}=a,l=o(f(i),{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>e({...n,value:t,children:i})}],dictionaryKey:c.dictionaryKey,keyPath:[]}),u=n=>e({...c,value:i,children:()=>({component:t,props:{dictionaryKey:c.dictionaryKey,keyPath:c.keyPath,...n},children:()=>{let{renderMarkdown:e}=r();return e(i,n)}}),additionalProps:{metadata:l}}),p=(e,t)=>new Proxy(e,{get(e,r,a){return r===`value`?i:r===`metadata`?l:r===`toString`||r===Symbol.toPrimitive?()=>d(i,{runtime:t?m(n,t):n}):r===`use`?e=>{let n={...t,...e};return p(u(n),n)}:Reflect.get(e,r,a)}});return p(u())}},_={id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===p.Markdown,transform:(e,t,n)=>{let r=[...t.keyPath,{type:p.Markdown}],i=e[p.Markdown];return n(i,{...t,children:i,keyPath:r,plugins:[g,...t.plugins??[]]})}},v={id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===p.HTML,transform:(r,i)=>{let a=r[p.HTML],{plugins:o,...s}=i,c=n=>e({...s,value:a,children:()=>({component:t,props:{dictionaryKey:s.dictionaryKey,keyPath:s.keyPath,...n},children:a})}),l=(e,t)=>new Proxy(e,{get(e,r,i){return r===`value`?a:r===`toString`||r===Symbol.toPrimitive?()=>!t||typeof t==`object`&&Object.keys(t).length===0?String(a):d(a,{runtime:m(n,t)}):r===`use`?e=>{let n={...t,...e};return l(c(n),n)}:Reflect.get(e,r,i)}});return l(c())}},y={id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===p.Insertion,transform:(t,n)=>{let{plugins:r,...i}=n,a=(e={})=>{let n=t.insertion;return e&&Object.entries(e).forEach(([e,t])=>{n=n.replace(RegExp(`{{\\s*${e}\\s*}}`,`g`),String(t))}),n};return e({...i,value:a,children:a})}},b=(e,t=!0)=>[l(e??u.internationalization.defaultLocale,t?u.internationalization.defaultLocale:void 0),a,i,c(e??u.internationalization.defaultLocale),o,s,h,_,v,y];export{b as getPlugins,v as htmlPlugin,y as insertionPlugin,h as intlayerNodePlugins,_ as markdownPlugin,g as markdownStringPlugin};
1
+ import{renderIntlayerNode as e}from"./renderIntlayerNode.mjs";import{t}from"./ContentSelector.component-B9Uvy9gY.mjs";import{htmlRuntime as n,useMarkdown as r}from"./markdown/installIntlayerMarkdown.mjs";import{conditionPlugin as i,enumerationPlugin as a,filePlugin as o,genderPlugin as s,nestedPlugin as c,translationPlugin as l}from"@intlayer/core/interpreter";import u from"@intlayer/config/built";import{compile as d,getMarkdownMetadata as f}from"@intlayer/core/markdown";import{NodeType as p}from"@intlayer/types/nodeType";const m=(e,t)=>({...e,createElement:(n,r,...i)=>{let a=t?.[n];if(a){let t={...r,...a},o=r?.class||r?.className,s=a.class||a.className;return o&&s&&(t.class=`${o} ${s}`,t.className=void 0),e.createElement(n,t,...i)}return e.createElement(n,r,...i)}}),h={id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(n,{children:r,...i})=>e({...i,value:r,children:()=>({component:u?.editor.enabled?t:r,props:{dictionaryKey:i.dictionaryKey,keyPath:i.keyPath},children:r})})},g={id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(i,a,o)=>{let{plugins:s,...c}=a,l=o(f(i),{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>e({...n,value:t,children:i})}],dictionaryKey:c.dictionaryKey,keyPath:[]}),u=n=>e({...c,value:i,children:()=>({component:t,props:{dictionaryKey:c.dictionaryKey,keyPath:c.keyPath,...n},children:()=>{let{renderMarkdown:e}=r();return e(i,n)}}),additionalProps:{metadata:l}}),p=(e,t)=>new Proxy(e,{get(e,r,a){return r===`value`?i:r===`metadata`?l:r===`toString`||r===Symbol.toPrimitive?()=>d(i,{runtime:t?m(n,t):n}):r===`use`?e=>{let n={...t,...e};return p(u(n),n)}:Reflect.get(e,r,a)}});return p(u())}},_={id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===p.Markdown,transform:(e,t,n)=>{let r=[...t.keyPath,{type:p.Markdown}],i=e[p.Markdown];return n(i,{...t,children:i,keyPath:r,plugins:[g,...t.plugins??[]]})}},v={id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===p.HTML,transform:(r,i)=>{let a=r[p.HTML],{plugins:o,...s}=i,c=n=>e({...s,value:a,children:()=>({component:t,props:{dictionaryKey:s.dictionaryKey,keyPath:s.keyPath,...n},children:a})}),l=(e,t)=>new Proxy(e,{get(e,r,i){return r===`value`?a:r===`toString`||r===Symbol.toPrimitive?()=>!t||typeof t==`object`&&Object.keys(t).length===0?String(a):d(a,{runtime:m(n,t)}):r===`use`?e=>{let n={...t,...e};return l(c(n),n)}:Reflect.get(e,r,i)}});return l(c())}},y={id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===p.Insertion,transform:(t,n)=>{let{plugins:r,...i}=n,a=(e={})=>{let n=t.insertion;return e&&Object.entries(e).forEach(([e,t])=>{n=n.replace(RegExp(`{{\\s*${e}\\s*}}`,`g`),String(t))}),n};return e({...i,value:a,children:a})}},b=(e,t=!0)=>[l(e??u.internationalization.defaultLocale,t?u.internationalization.defaultLocale:void 0),a,i,c(e??u.internationalization.defaultLocale),o,s,h,_,v,y];export{b as getPlugins,v as htmlPlugin,y as insertionPlugin,h as intlayerNodePlugins,_ as markdownPlugin,g as markdownStringPlugin};
2
2
  //# sourceMappingURL=plugins.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.mjs","names":[],"sources":["../../src/plugins.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport {\n conditionPlugin,\n type DeepTransformContent as DeepTransformContentCore,\n enumerationPlugin,\n filePlugin,\n genderPlugin,\n type IInterpreterPluginState as IInterpreterPluginStateCore,\n nestedPlugin,\n type Plugins,\n translationPlugin,\n} from '@intlayer/core/interpreter';\nimport {\n compile,\n getMarkdownMetadata,\n type MarkdownContent,\n} from '@intlayer/core/markdown';\nimport type { HTMLContent, InsertionContent } from '@intlayer/core/transpiler';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { NodeType } from '@intlayer/types/nodeType';\nimport { ContentSelectorWrapperComponent } from './editor/ContentSelector.component';\nimport { htmlRuntime, useMarkdown } from './markdown/installIntlayerMarkdown';\nimport { renderIntlayerNode } from './renderIntlayerNode';\n\n/** ---------------------------------------------\n * UTILS\n * --------------------------------------------- */\n\nconst createRuntimeWithOverides = (baseRuntime: any, overrides: any) => ({\n ...baseRuntime,\n createElement: (tag: string, props: any, ...children: any[]) => {\n const override = overrides?.[tag];\n\n if (override) {\n const newProps = { ...props, ...override };\n\n // Merge class attributes intelligently\n const originalClass = props?.class || props?.className;\n const overrideClass = override.class || override.className;\n\n if (originalClass && overrideClass) {\n newProps.class = `${originalClass} ${overrideClass}`;\n newProps.className = undefined;\n }\n\n return baseRuntime.createElement(tag, newProps, ...children);\n }\n\n return baseRuntime.createElement(tag, props, ...children);\n },\n});\n\n/** ---------------------------------------------\n * INTLAYER NODE PLUGIN\n * --------------------------------------------- */\n\nexport type IntlayerNodeCond<T> = T extends number | string\n ? IntlayerNode<T>\n : never;\n\nexport interface IntlayerNode<T, P = {}> {\n value: T;\n children?: any;\n additionalProps?: P;\n}\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const intlayerNodePlugins: Plugins = {\n id: 'intlayer-node-plugin',\n canHandle: (node) =>\n typeof node === 'bigint' ||\n typeof node === 'string' ||\n typeof node === 'number',\n transform: (_node, { children, ...rest }) =>\n renderIntlayerNode({\n ...rest,\n value: children,\n children: () => ({\n component: configuration?.editor.enabled\n ? ContentSelectorWrapperComponent\n : children,\n props: {\n dictionaryKey: rest.dictionaryKey,\n keyPath: rest.keyPath,\n },\n children: children,\n }),\n }),\n};\n\n/**\n * MARKDOWN PLUGIN\n */\n\nexport type MarkdownStringCond<T> = T extends string\n ? IntlayerNode<string, { metadata: DeepTransformContent<string> }>\n : never;\n\n/** Markdown string plugin. Replaces string node with a component that render the markdown. */\nexport const markdownStringPlugin: Plugins = {\n id: 'markdown-string-plugin',\n canHandle: (node) => typeof node === 'string',\n transform: (node: string, props, deepTransformNode) => {\n const {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n } = props;\n\n const metadata = getMarkdownMetadata(node);\n\n const metadataPlugins: Plugins = {\n id: 'markdown-metadata-plugin',\n canHandle: (metadataNode) =>\n typeof metadataNode === 'string' ||\n typeof metadataNode === 'number' ||\n typeof metadataNode === 'boolean' ||\n !metadataNode,\n transform: (metadataNode, props) =>\n renderIntlayerNode({\n ...props,\n value: metadataNode,\n children: node,\n }),\n };\n\n // Transform metadata while keeping the same structure\n const metadataNodes = deepTransformNode(metadata, {\n plugins: [metadataPlugins],\n dictionaryKey: rest.dictionaryKey,\n keyPath: [],\n });\n\n const render = (components?: any) =>\n renderIntlayerNode({\n ...rest,\n value: node,\n children: () => ({\n component: ContentSelectorWrapperComponent,\n props: {\n dictionaryKey: rest.dictionaryKey,\n keyPath: rest.keyPath,\n ...components,\n },\n children: () => {\n const { renderMarkdown } = useMarkdown();\n return renderMarkdown(node, components);\n },\n }),\n additionalProps: {\n metadata: metadataNodes,\n },\n });\n\n const createProxy = (element: any, components?: any) =>\n new Proxy(element, {\n get(target, prop, receiver) {\n if (prop === 'value') {\n return node;\n }\n if (prop === 'metadata') {\n return metadataNodes;\n }\n\n if (prop === 'toString') {\n return () => {\n const runtime = components\n ? createRuntimeWithOverides(htmlRuntime, components)\n : htmlRuntime;\n return compile(node, {\n runtime,\n }) as string;\n };\n }\n\n if (prop === Symbol.toPrimitive) {\n return () => {\n const runtime = components\n ? createRuntimeWithOverides(htmlRuntime, components)\n : htmlRuntime;\n return compile(node, {\n runtime,\n }) as string;\n };\n }\n\n if (prop === 'use') {\n return (newComponents?: any) => {\n const mergedComponents = { ...components, ...newComponents };\n return createProxy(render(mergedComponents), mergedComponents);\n };\n }\n\n return Reflect.get(target, prop, receiver);\n },\n }) as any;\n\n return createProxy(render() as any);\n },\n};\n\nexport type MarkdownCond<T, _S, _L extends LocalesValues> = T extends {\n nodeType: NodeType | string;\n [NodeType.Markdown]: infer M;\n tags?: infer U;\n metadata?: infer V;\n}\n ? IntlayerNode<\n M,\n {\n use: (components?: Record<keyof U, any>) => any;\n metadata: DeepTransformContent<V>;\n }\n >\n : never;\n\nexport const markdownPlugin: Plugins = {\n id: 'markdown-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Markdown,\n transform: (node: MarkdownContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeType.Markdown,\n },\n ];\n\n const children = node[NodeType.Markdown];\n\n return deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [markdownStringPlugin, ...(props.plugins ?? [])],\n });\n },\n};\n\n/** ---------------------------------------------\n * HTML PLUGIN\n * --------------------------------------------- */\n\n/**\n * HTML conditional type.\n *\n * This ensures type safety:\n * - `html('<div>Hello <CustomComponent /></div>').use({ CustomComponent: ... })` - optional but typed\n */\nexport type HTMLPluginCond<T, _S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeType.HTML]: infer I;\n tags?: infer U;\n}\n ? IntlayerNode<\n I,\n {\n use: (components?: Record<keyof U, any>) => any;\n }\n >\n : never;\n\n/** HTML plugin. Replaces node with a function that takes components => IntlayerNode. */\nexport const htmlPlugin: Plugins = {\n id: 'html-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.HTML,\n\n transform: (node: HTMLContent<string>, props) => {\n const html = node[NodeType.HTML];\n const { plugins, ...rest } = props;\n\n // Type-safe render function that accepts properly typed components\n const render = (userComponents?: any) =>\n renderIntlayerNode({\n ...rest,\n value: html,\n children: () => ({\n component: ContentSelectorWrapperComponent,\n props: {\n dictionaryKey: rest.dictionaryKey,\n keyPath: rest.keyPath,\n ...userComponents,\n },\n children: html,\n }),\n });\n\n const createProxy = (element: any, components?: any) =>\n new Proxy(element, {\n get(target, prop, receiver) {\n if (prop === 'value') {\n return html;\n }\n\n if (prop === 'toString') {\n return () => {\n if (\n !components ||\n (typeof components === 'object' &&\n Object.keys(components).length === 0)\n ) {\n return String(html);\n }\n const runtime = createRuntimeWithOverides(\n htmlRuntime,\n components\n );\n return compile(html, {\n runtime,\n }) as string;\n };\n }\n\n if (prop === Symbol.toPrimitive) {\n return () => {\n if (\n !components ||\n (typeof components === 'object' &&\n Object.keys(components).length === 0)\n ) {\n return String(html);\n }\n const runtime = createRuntimeWithOverides(\n htmlRuntime,\n components\n );\n return compile(html, {\n runtime,\n }) as string;\n };\n }\n\n if (prop === 'use') {\n // Return a properly typed function based on custom components\n return (userComponents?: any) => {\n const mergedComponents = { ...components, ...userComponents };\n return createProxy(render(mergedComponents), mergedComponents);\n };\n }\n\n return Reflect.get(target, prop, receiver);\n },\n }) as any;\n\n return createProxy(render() as any);\n },\n};\n\n/** ---------------------------------------------\n * INSERTION PLUGIN\n * --------------------------------------------- */\n\n/**\n * Insertion conditional type.\n */\nexport type InsertionPluginCond<T> = T extends {\n nodeType: NodeType | string;\n [NodeType.Insertion]: infer _I;\n}\n ? (args: Record<string, string | number>) => string\n : never;\n\nexport const insertionPlugin: Plugins = {\n id: 'insertion-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Insertion,\n transform: (node: InsertionContent, props) => {\n const { plugins, ...rest } = props;\n\n // Return a function that performs the interpolation\n const render = (args: Record<string, string | number> = {}) => {\n let text = node.insertion as string;\n if (args) {\n Object.entries(args).forEach(([key, value]) => {\n text = text.replace(\n new RegExp(`{{\\\\s*${key}\\\\s*}}`, 'g'),\n String(value)\n );\n });\n }\n return text;\n };\n\n return renderIntlayerNode({\n ...rest,\n value: render as any,\n children: render,\n });\n },\n};\n\nexport interface IInterpreterPluginAngular<T, S, L extends LocalesValues> {\n angularIntlayerNode: IntlayerNodeCond<T>;\n angularMarkdown: MarkdownCond<T, S, L>;\n angularHtml: HTMLPluginCond<T, S, L>;\n angularInsertion: InsertionPluginCond<T>;\n}\n\n/**\n * Insert this type as param of `DeepTransformContent` to avoid `intlayer` package pollution.\n *\n * Otherwise the the `angular-intlayer` plugins will override the types of `intlayer` functions.\n */\nexport type IInterpreterPluginState = Omit<\n IInterpreterPluginStateCore,\n 'insertion' // Remove insertion type from core package\n> & {\n angularIntlayerNode: true;\n angularMarkdown: true;\n angularHtml: true;\n angularInsertion: true;\n};\n\nexport type DeepTransformContent<\n T,\n L extends LocalesValues = DeclaredLocales,\n> = DeepTransformContentCore<T, IInterpreterPluginState, L>;\n\n/**\n * Get the plugins array for Angular content transformation.\n * This function is used by both getIntlayer and getDictionary to ensure consistent plugin configuration.\n */\nexport const getPlugins = (\n locale?: LocalesValues,\n fallback: boolean = true\n): Plugins[] => [\n translationPlugin(\n locale ?? configuration.internationalization.defaultLocale,\n fallback ? configuration.internationalization.defaultLocale : undefined\n ),\n enumerationPlugin,\n conditionPlugin,\n nestedPlugin(locale ?? configuration.internationalization.defaultLocale),\n filePlugin,\n genderPlugin,\n intlayerNodePlugins,\n markdownPlugin,\n htmlPlugin,\n insertionPlugin,\n];\n"],"mappings":"ijBAgCA,MAAM,GAA6B,EAAkB,KAAoB,CACvE,GAAG,EACH,eAAgB,EAAa,EAAY,GAAG,IAAoB,CAC9D,IAAM,EAAW,IAAY,GAE7B,GAAI,EAAU,CACZ,IAAM,EAAW,CAAE,GAAG,EAAO,GAAG,EAAU,CAGpC,EAAgB,GAAO,OAAS,GAAO,UACvC,EAAgB,EAAS,OAAS,EAAS,UAOjD,OALI,GAAiB,IACnB,EAAS,MAAQ,GAAG,EAAc,GAAG,IACrC,EAAS,UAAY,IAAA,IAGhB,EAAY,cAAc,EAAK,EAAU,GAAG,EAAS,CAG9D,OAAO,EAAY,cAAc,EAAK,EAAO,GAAG,EAAS,EAE5D,EAiBY,EAA+B,CAC1C,GAAI,uBACJ,UAAY,GACV,OAAO,GAAS,UAChB,OAAO,GAAS,UAChB,OAAO,GAAS,SAClB,WAAY,EAAO,CAAE,WAAU,GAAG,KAChC,EAAmB,CACjB,GAAG,EACH,MAAO,EACP,cAAiB,CACf,UAAW,GAAe,OAAO,QAC7B,EACA,EACJ,MAAO,CACL,cAAe,EAAK,cACpB,QAAS,EAAK,QACf,CACS,WACX,EACF,CAAC,CACL,CAWY,EAAgC,CAC3C,GAAI,yBACJ,UAAY,GAAS,OAAO,GAAS,SACrC,WAAY,EAAc,EAAO,IAAsB,CACrD,GAAM,CACJ,UACA,GAAG,GACD,EAoBE,EAAgB,EAlBL,EAAoB,EAAK,CAkBQ,CAChD,QAAS,CAjBsB,CAC/B,GAAI,2BACJ,UAAY,GACV,OAAO,GAAiB,UACxB,OAAO,GAAiB,UACxB,OAAO,GAAiB,WACxB,CAAC,EACH,WAAY,EAAc,IACxB,EAAmB,CACjB,GAAG,EACH,MAAO,EACP,SAAU,EACX,CAAC,CACL,CAI2B,CAC1B,cAAe,EAAK,cACpB,QAAS,EAAE,CACZ,CAAC,CAEI,EAAU,GACd,EAAmB,CACjB,GAAG,EACH,MAAO,EACP,cAAiB,CACf,UAAW,EACX,MAAO,CACL,cAAe,EAAK,cACpB,QAAS,EAAK,QACd,GAAG,EACJ,CACD,aAAgB,CACd,GAAM,CAAE,kBAAmB,GAAa,CACxC,OAAO,EAAe,EAAM,EAAW,EAE1C,EACD,gBAAiB,CACf,SAAU,EACX,CACF,CAAC,CAEE,GAAe,EAAc,IACjC,IAAI,MAAM,EAAS,CACjB,IAAI,EAAQ,EAAM,EAAU,CAqC1B,OApCI,IAAS,QACJ,EAEL,IAAS,WACJ,EAGL,IAAS,YAWT,IAAS,OAAO,gBAKT,EAAQ,EAAM,CACnB,QAJc,EACZ,EAA0B,EAAa,EAAW,CAClD,EAGH,CAAC,CAIF,IAAS,MACH,GAAwB,CAC9B,IAAM,EAAmB,CAAE,GAAG,EAAY,GAAG,EAAe,CAC5D,OAAO,EAAY,EAAO,EAAiB,CAAE,EAAiB,EAI3D,QAAQ,IAAI,EAAQ,EAAM,EAAS,EAE7C,CAAC,CAEJ,OAAO,EAAY,GAAQ,CAAQ,EAEtC,CAiBY,EAA0B,CACrC,GAAI,kBACJ,UAAY,GACV,OAAO,GAAS,UAAY,GAAM,WAAa,EAAS,SAC1D,WAAY,EAAuB,EAAO,IAAsB,CAC9D,IAAM,EAAwB,CAC5B,GAAG,EAAM,QACT,CACE,KAAM,EAAS,SAChB,CACF,CAEK,EAAW,EAAK,EAAS,UAE/B,OAAO,EAAkB,EAAU,CACjC,GAAG,EACH,WACA,QAAS,EACT,QAAS,CAAC,EAAsB,GAAI,EAAM,SAAW,EAAE,CAAE,CAC1D,CAAC,EAEL,CA0BY,EAAsB,CACjC,GAAI,cACJ,UAAY,GACV,OAAO,GAAS,UAAY,GAAM,WAAa,EAAS,KAE1D,WAAY,EAA2B,IAAU,CAC/C,IAAM,EAAO,EAAK,EAAS,MACrB,CAAE,UAAS,GAAG,GAAS,EAGvB,EAAU,GACd,EAAmB,CACjB,GAAG,EACH,MAAO,EACP,cAAiB,CACf,UAAW,EACX,MAAO,CACL,cAAe,EAAK,cACpB,QAAS,EAAK,QACd,GAAG,EACJ,CACD,SAAU,EACX,EACF,CAAC,CAEE,GAAe,EAAc,IACjC,IAAI,MAAM,EAAS,CACjB,IAAI,EAAQ,EAAM,EAAU,CAmD1B,OAlDI,IAAS,QACJ,EAGL,IAAS,YAmBT,IAAS,OAAO,gBAGd,CAAC,GACA,OAAO,GAAe,UACrB,OAAO,KAAK,EAAW,CAAC,SAAW,EAE9B,OAAO,EAAK,CAMd,EAAQ,EAAM,CACnB,QALc,EACd,EACA,EACD,CAGA,CAAC,CAIF,IAAS,MAEH,GAAyB,CAC/B,IAAM,EAAmB,CAAE,GAAG,EAAY,GAAG,EAAgB,CAC7D,OAAO,EAAY,EAAO,EAAiB,CAAE,EAAiB,EAI3D,QAAQ,IAAI,EAAQ,EAAM,EAAS,EAE7C,CAAC,CAEJ,OAAO,EAAY,GAAQ,CAAQ,EAEtC,CAgBY,EAA2B,CACtC,GAAI,mBACJ,UAAY,GACV,OAAO,GAAS,UAAY,GAAM,WAAa,EAAS,UAC1D,WAAY,EAAwB,IAAU,CAC5C,GAAM,CAAE,UAAS,GAAG,GAAS,EAGvB,GAAU,EAAwC,EAAE,GAAK,CAC7D,IAAI,EAAO,EAAK,UAShB,OARI,GACF,OAAO,QAAQ,EAAK,CAAC,SAAS,CAAC,EAAK,KAAW,CAC7C,EAAO,EAAK,QACN,OAAO,SAAS,EAAI,QAAS,IAAI,CACrC,OAAO,EAAM,CACd,EACD,CAEG,GAGT,OAAO,EAAmB,CACxB,GAAG,EACH,MAAO,EACP,SAAU,EACX,CAAC,EAEL,CAiCY,GACX,EACA,EAAoB,KACN,CACd,EACE,GAAU,EAAc,qBAAqB,cAC7C,EAAW,EAAc,qBAAqB,cAAgB,IAAA,GAC/D,CACD,EACA,EACA,EAAa,GAAU,EAAc,qBAAqB,cAAc,CACxE,EACA,EACA,EACA,EACA,EACA,EACD"}
1
+ {"version":3,"file":"plugins.mjs","names":[],"sources":["../../src/plugins.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport {\n conditionPlugin,\n type DeepTransformContent as DeepTransformContentCore,\n enumerationPlugin,\n filePlugin,\n genderPlugin,\n type IInterpreterPluginState as IInterpreterPluginStateCore,\n nestedPlugin,\n type Plugins,\n translationPlugin,\n} from '@intlayer/core/interpreter';\nimport {\n compile,\n getMarkdownMetadata,\n type MarkdownContent,\n} from '@intlayer/core/markdown';\nimport type { HTMLContent, InsertionContent } from '@intlayer/core/transpiler';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { NodeType } from '@intlayer/types/nodeType';\nimport { ContentSelectorWrapperComponent } from './editor/ContentSelector.component';\nimport { htmlRuntime, useMarkdown } from './markdown/installIntlayerMarkdown';\nimport { renderIntlayerNode } from './renderIntlayerNode';\n\n/** ---------------------------------------------\n * UTILS\n * --------------------------------------------- */\n\nconst createRuntimeWithOverides = (baseRuntime: any, overrides: any) => ({\n ...baseRuntime,\n createElement: (tag: string, props: any, ...children: any[]) => {\n const override = overrides?.[tag];\n\n if (override) {\n const newProps = { ...props, ...override };\n\n // Merge class attributes intelligently\n const originalClass = props?.class || props?.className;\n const overrideClass = override.class || override.className;\n\n if (originalClass && overrideClass) {\n newProps.class = `${originalClass} ${overrideClass}`;\n newProps.className = undefined;\n }\n\n return baseRuntime.createElement(tag, newProps, ...children);\n }\n\n return baseRuntime.createElement(tag, props, ...children);\n },\n});\n\n/** ---------------------------------------------\n * INTLAYER NODE PLUGIN\n * --------------------------------------------- */\n\nexport type IntlayerNodeCond<T> = T extends number | string\n ? IntlayerNode<T>\n : never;\n\nexport interface IntlayerNode<T, P = {}> {\n value: T;\n children?: any;\n additionalProps?: P;\n}\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const intlayerNodePlugins: Plugins = {\n id: 'intlayer-node-plugin',\n canHandle: (node) =>\n typeof node === 'bigint' ||\n typeof node === 'string' ||\n typeof node === 'number',\n transform: (_node, { children, ...rest }) =>\n renderIntlayerNode({\n ...rest,\n value: children,\n children: () => ({\n component: configuration?.editor.enabled\n ? ContentSelectorWrapperComponent\n : children,\n props: {\n dictionaryKey: rest.dictionaryKey,\n keyPath: rest.keyPath,\n },\n children: children,\n }),\n }),\n};\n\n/**\n * MARKDOWN PLUGIN\n */\n\nexport type MarkdownStringCond<T> = T extends string\n ? IntlayerNode<string, { metadata: DeepTransformContent<string> }>\n : never;\n\n/** Markdown string plugin. Replaces string node with a component that render the markdown. */\nexport const markdownStringPlugin: Plugins = {\n id: 'markdown-string-plugin',\n canHandle: (node) => typeof node === 'string',\n transform: (node: string, props, deepTransformNode) => {\n const {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n } = props;\n\n const metadata = getMarkdownMetadata(node);\n\n const metadataPlugins: Plugins = {\n id: 'markdown-metadata-plugin',\n canHandle: (metadataNode) =>\n typeof metadataNode === 'string' ||\n typeof metadataNode === 'number' ||\n typeof metadataNode === 'boolean' ||\n !metadataNode,\n transform: (metadataNode, props) =>\n renderIntlayerNode({\n ...props,\n value: metadataNode,\n children: node,\n }),\n };\n\n // Transform metadata while keeping the same structure\n const metadataNodes = deepTransformNode(metadata, {\n plugins: [metadataPlugins],\n dictionaryKey: rest.dictionaryKey,\n keyPath: [],\n });\n\n const render = (components?: any) =>\n renderIntlayerNode({\n ...rest,\n value: node,\n children: () => ({\n component: ContentSelectorWrapperComponent,\n props: {\n dictionaryKey: rest.dictionaryKey,\n keyPath: rest.keyPath,\n ...components,\n },\n children: () => {\n const { renderMarkdown } = useMarkdown();\n return renderMarkdown(node, components);\n },\n }),\n additionalProps: {\n metadata: metadataNodes,\n },\n });\n\n const createProxy = (element: any, components?: any) =>\n new Proxy(element, {\n get(target, prop, receiver) {\n if (prop === 'value') {\n return node;\n }\n if (prop === 'metadata') {\n return metadataNodes;\n }\n\n if (prop === 'toString') {\n return () => {\n const runtime = components\n ? createRuntimeWithOverides(htmlRuntime, components)\n : htmlRuntime;\n return compile(node, {\n runtime,\n }) as string;\n };\n }\n\n if (prop === Symbol.toPrimitive) {\n return () => {\n const runtime = components\n ? createRuntimeWithOverides(htmlRuntime, components)\n : htmlRuntime;\n return compile(node, {\n runtime,\n }) as string;\n };\n }\n\n if (prop === 'use') {\n return (newComponents?: any) => {\n const mergedComponents = { ...components, ...newComponents };\n return createProxy(render(mergedComponents), mergedComponents);\n };\n }\n\n return Reflect.get(target, prop, receiver);\n },\n }) as any;\n\n return createProxy(render() as any);\n },\n};\n\nexport type MarkdownCond<T, _S, _L extends LocalesValues> = T extends {\n nodeType: NodeType | string;\n [NodeType.Markdown]: infer M;\n tags?: infer U;\n metadata?: infer V;\n}\n ? IntlayerNode<\n M,\n {\n use: (components?: Record<keyof U, any>) => any;\n metadata: DeepTransformContent<V>;\n }\n >\n : never;\n\nexport const markdownPlugin: Plugins = {\n id: 'markdown-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Markdown,\n transform: (node: MarkdownContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeType.Markdown,\n },\n ];\n\n const children = node[NodeType.Markdown];\n\n return deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [markdownStringPlugin, ...(props.plugins ?? [])],\n });\n },\n};\n\n/** ---------------------------------------------\n * HTML PLUGIN\n * --------------------------------------------- */\n\n/**\n * HTML conditional type.\n *\n * This ensures type safety:\n * - `html('<div>Hello <CustomComponent /></div>').use({ CustomComponent: ... })` - optional but typed\n */\nexport type HTMLPluginCond<T, _S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeType.HTML]: infer I;\n tags?: infer U;\n}\n ? IntlayerNode<\n I,\n {\n use: (components?: Record<keyof U, any>) => any;\n }\n >\n : never;\n\n/** HTML plugin. Replaces node with a function that takes components => IntlayerNode. */\nexport const htmlPlugin: Plugins = {\n id: 'html-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.HTML,\n\n transform: (node: HTMLContent<string>, props) => {\n const html = node[NodeType.HTML];\n const { plugins, ...rest } = props;\n\n // Type-safe render function that accepts properly typed components\n const render = (userComponents?: any) =>\n renderIntlayerNode({\n ...rest,\n value: html,\n children: () => ({\n component: ContentSelectorWrapperComponent,\n props: {\n dictionaryKey: rest.dictionaryKey,\n keyPath: rest.keyPath,\n ...userComponents,\n },\n children: html,\n }),\n });\n\n const createProxy = (element: any, components?: any) =>\n new Proxy(element, {\n get(target, prop, receiver) {\n if (prop === 'value') {\n return html;\n }\n\n if (prop === 'toString') {\n return () => {\n if (\n !components ||\n (typeof components === 'object' &&\n Object.keys(components).length === 0)\n ) {\n return String(html);\n }\n const runtime = createRuntimeWithOverides(\n htmlRuntime,\n components\n );\n return compile(html, {\n runtime,\n }) as string;\n };\n }\n\n if (prop === Symbol.toPrimitive) {\n return () => {\n if (\n !components ||\n (typeof components === 'object' &&\n Object.keys(components).length === 0)\n ) {\n return String(html);\n }\n const runtime = createRuntimeWithOverides(\n htmlRuntime,\n components\n );\n return compile(html, {\n runtime,\n }) as string;\n };\n }\n\n if (prop === 'use') {\n // Return a properly typed function based on custom components\n return (userComponents?: any) => {\n const mergedComponents = { ...components, ...userComponents };\n return createProxy(render(mergedComponents), mergedComponents);\n };\n }\n\n return Reflect.get(target, prop, receiver);\n },\n }) as any;\n\n return createProxy(render() as any);\n },\n};\n\n/** ---------------------------------------------\n * INSERTION PLUGIN\n * --------------------------------------------- */\n\n/**\n * Insertion conditional type.\n */\nexport type InsertionPluginCond<T> = T extends {\n nodeType: NodeType | string;\n [NodeType.Insertion]: infer _I;\n}\n ? (args: Record<string, string | number>) => string\n : never;\n\nexport const insertionPlugin: Plugins = {\n id: 'insertion-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Insertion,\n transform: (node: InsertionContent, props) => {\n const { plugins, ...rest } = props;\n\n // Return a function that performs the interpolation\n const render = (args: Record<string, string | number> = {}) => {\n let text = node.insertion as string;\n if (args) {\n Object.entries(args).forEach(([key, value]) => {\n text = text.replace(\n new RegExp(`{{\\\\s*${key}\\\\s*}}`, 'g'),\n String(value)\n );\n });\n }\n return text;\n };\n\n return renderIntlayerNode({\n ...rest,\n value: render as any,\n children: render,\n });\n },\n};\n\nexport interface IInterpreterPluginAngular<T, S, L extends LocalesValues> {\n angularIntlayerNode: IntlayerNodeCond<T>;\n angularMarkdown: MarkdownCond<T, S, L>;\n angularHtml: HTMLPluginCond<T, S, L>;\n angularInsertion: InsertionPluginCond<T>;\n}\n\n/**\n * Insert this type as param of `DeepTransformContent` to avoid `intlayer` package pollution.\n *\n * Otherwise the the `angular-intlayer` plugins will override the types of `intlayer` functions.\n */\nexport type IInterpreterPluginState = Omit<\n IInterpreterPluginStateCore,\n 'insertion' // Remove insertion type from core package\n> & {\n angularIntlayerNode: true;\n angularMarkdown: true;\n angularHtml: true;\n angularInsertion: true;\n};\n\nexport type DeepTransformContent<\n T,\n L extends LocalesValues = DeclaredLocales,\n> = DeepTransformContentCore<T, IInterpreterPluginState, L>;\n\n/**\n * Get the plugins array for Angular content transformation.\n * This function is used by both getIntlayer and getDictionary to ensure consistent plugin configuration.\n */\nexport const getPlugins = (\n locale?: LocalesValues,\n fallback: boolean = true\n): Plugins[] => [\n translationPlugin(\n locale ?? configuration.internationalization.defaultLocale,\n fallback ? configuration.internationalization.defaultLocale : undefined\n ),\n enumerationPlugin,\n conditionPlugin,\n nestedPlugin(locale ?? configuration.internationalization.defaultLocale),\n filePlugin,\n genderPlugin,\n intlayerNodePlugins,\n markdownPlugin,\n htmlPlugin,\n insertionPlugin,\n];\n"],"mappings":"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"}
@@ -1,9 +1,9 @@
1
- import { INTLAYER_TOKEN, IntlayerProvider, createIntlayerClient, installIntlayer, provideIntlayer } from "./installIntlayer.js";
2
- import { useDictionary } from "./useDictionary.js";
3
- import { useDictionaryAsync } from "./useDictionaryAsync.js";
4
- import { useDictionaryDynamic } from "./useDictionaryDynamic.js";
5
- import { useIntl } from "./useIntl.js";
6
- import { isUpdatableNode, useIntlayer } from "./useIntlayer.js";
7
- import { useLoadDynamic } from "./useLoadDynamic.js";
8
- import { useLocale } from "./useLocale.js";
1
+ import { a as provideIntlayer, i as installIntlayer, n as IntlayerProvider, r as createIntlayerClient, t as INTLAYER_TOKEN } from "../installIntlayer-Ce7kST5N.js";
2
+ import { t as useDictionary } from "../useDictionary-Dq9yu0X_.js";
3
+ import { t as useDictionaryAsync } from "../useDictionaryAsync-BYUsr8w4.js";
4
+ import { t as useDictionaryDynamic } from "../index-D5QAgZ5v.js";
5
+ import { t as useIntl } from "../useIntl-CHizZCR2.js";
6
+ import { n as useIntlayer, t as isUpdatableNode } from "../useIntlayer-m3n_upwm.js";
7
+ import { t as useLoadDynamic } from "../useLoadDynamic-C4pltPcC.js";
8
+ import { t as useLocale } from "../useLocale-BzfAmXlx.js";
9
9
  export { INTLAYER_TOKEN, IntlayerProvider, createIntlayerClient, installIntlayer, isUpdatableNode, provideIntlayer, useDictionary, useDictionaryAsync, useDictionaryDynamic, useIntl, useIntlayer, useLoadDynamic, useLocale };
@@ -1,50 +1,2 @@
1
- import * as _angular_core0 from "@angular/core";
2
- import { InjectionToken, Signal } from "@angular/core";
3
- import { LocalesValues } from "@intlayer/types/module_augmentation";
4
-
5
- //#region src/client/installIntlayer.d.ts
6
- declare const INTLAYER_TOKEN: InjectionToken<IntlayerProvider>;
7
- declare class IntlayerProvider {
8
- isCookieEnabled: _angular_core0.WritableSignal<boolean>;
9
- private _locale;
10
- readonly locale: Signal<LocalesValues>;
11
- setLocale: (locale: LocalesValues) => void;
12
- }
13
- /**
14
- * Create and return a single IntlayerProvider instance
15
- */
16
- declare const createIntlayerClient: (locale?: LocalesValues, isCookieEnabled?: boolean) => IntlayerProvider;
17
- /**
18
- * Provides Intlayer to your Angular application.
19
- *
20
- * This function should be used in your application's provider list (e.g., in `app.config.ts`)
21
- * to initialize the Intlayer service.
22
- *
23
- * @param locale - Initial locale to use.
24
- * @param isCookieEnabled - Whether to store the locale in cookies.
25
- * @returns A provider configuration for Intlayer.
26
- *
27
- * @example
28
- * ```ts
29
- * // app.config.ts
30
- * import { ApplicationConfig } from '@angular/core';
31
- * import { provideIntlayer } from 'angular-intlayer';
32
- *
33
- * export const appConfig: ApplicationConfig = {
34
- * providers: [
35
- * provideIntlayer({ locale: 'en' }),
36
- * ],
37
- * };
38
- * ```
39
- */
40
- declare const provideIntlayer: (locale?: LocalesValues, isCookieEnabled?: boolean) => {
41
- provide: InjectionToken<IntlayerProvider>;
42
- useValue: IntlayerProvider;
43
- };
44
- /**
45
- * Helper to install the Intlayer provider.
46
- */
47
- declare const installIntlayer: (locale?: LocalesValues, isCookieEnabled?: boolean) => IntlayerProvider;
48
- //#endregion
49
- export { INTLAYER_TOKEN, IntlayerProvider, createIntlayerClient, installIntlayer, provideIntlayer };
50
- //# sourceMappingURL=installIntlayer.d.ts.map
1
+ import { a as provideIntlayer, i as installIntlayer, n as IntlayerProvider, r as createIntlayerClient, t as INTLAYER_TOKEN } from "../installIntlayer-Ce7kST5N.js";
2
+ export { INTLAYER_TOKEN, IntlayerProvider, createIntlayerClient, installIntlayer, provideIntlayer };
@@ -1,10 +1,2 @@
1
- import { DeepTransformContent } from "../plugins.js";
2
- import { Signal } from "@angular/core";
3
- import { LocalesValues } from "@intlayer/types/module_augmentation";
4
- import { Dictionary } from "@intlayer/types/dictionary";
5
-
6
- //#region src/client/useDictionary.d.ts
7
- declare const useDictionary: <T extends Dictionary>(dictionary: T, locale?: LocalesValues) => Signal<DeepTransformContent<T["content"]>>;
8
- //#endregion
9
- export { useDictionary };
10
- //# sourceMappingURL=useDictionary.d.ts.map
1
+ import { t as useDictionary } from "../useDictionary-Dq9yu0X_.js";
2
+ export { useDictionary };
@@ -1,14 +1,2 @@
1
- import * as _angular_core0 from "@angular/core";
2
- import { LocalesValues, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
3
- import { Dictionary } from "@intlayer/types/dictionary";
4
-
5
- //#region src/client/useDictionaryAsync.d.ts
6
- /**
7
- * On the server side, Hook that transform a dictionary and return the content
8
- *
9
- * If the locale is not provided, it will use the locale from the client context
10
- */
11
- declare const useDictionaryAsync: <T extends Dictionary>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, locale?: LocalesValues) => Promise<_angular_core0.Signal<any>>;
12
- //#endregion
13
- export { useDictionaryAsync };
14
- //# sourceMappingURL=useDictionaryAsync.d.ts.map
1
+ import { t as useDictionaryAsync } from "../useDictionaryAsync-BYUsr8w4.js";
2
+ export { useDictionaryAsync };
@@ -1,17 +1,2 @@
1
- import { IInterpreterPluginState as IInterpreterPluginState$1 } from "../plugins.js";
2
- import * as _angular_core0 from "@angular/core";
3
- import { DictionaryKeys, LocalesValues, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
4
- import { Dictionary } from "@intlayer/types/dictionary";
5
- import * as _intlayer_core_interpreter0 from "@intlayer/core/interpreter";
6
- import * as _intlayer_types_allLocales0 from "@intlayer/types/allLocales";
7
-
8
- //#region src/client/useDictionaryDynamic.d.ts
9
- /**
10
- * On the server side, Hook that transform a dictionary and return the content
11
- *
12
- * If the locale is not provided, it will use the locale from the client context
13
- */
14
- declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => _angular_core0.Signal<_intlayer_core_interpreter0.DeepTransformContent<T["content"], IInterpreterPluginState$1, _intlayer_types_allLocales0.Locale>>;
15
- //#endregion
16
- export { useDictionaryDynamic };
17
- //# sourceMappingURL=useDictionaryDynamic.d.ts.map
1
+ import { t as useDictionaryDynamic } from "../index-D5QAgZ5v.js";
2
+ export { useDictionaryDynamic };
@@ -1,89 +1,2 @@
1
- import * as _angular_core0 from "@angular/core";
2
- import { LocalesValues } from "@intlayer/types/module_augmentation";
3
-
4
- //#region src/client/useIntl.d.ts
5
- /**
6
- * Angular composable that provides a locale-bound `Intl` object.
7
- *
8
- * It acts exactly like the native `Intl` object, but acts as a proxy to:
9
- * 1. Inject the current locale automatically if none is provided.
10
- * 2. Use the performance-optimized `CachedIntl` under the hood.
11
- *
12
- * @example
13
- * ```typescript
14
- * import { Component, computed } from '@angular/core';
15
- * import { useIntl } from 'angular-intlayer';
16
- *
17
- * @Component({ ... })
18
- * export class MyComponent {
19
- * intl = useIntl();
20
- * formattedPrice = computed(() =>
21
- * new this.intl().NumberFormat({
22
- * style: 'currency',
23
- * currency: 'USD'
24
- * }).format(123.45)
25
- * );
26
- * }
27
- * ```
28
- */
29
- declare const useIntl: (locale?: LocalesValues) => _angular_core0.Signal<{
30
- Collator: {
31
- new (locales?: LocalesValues, options?: Intl.CollatorOptions): Intl.Collator;
32
- new (options?: Intl.CollatorOptions & {
33
- locale?: LocalesValues;
34
- }): Intl.Collator;
35
- };
36
- NumberFormat: {
37
- new (locales?: LocalesValues, options?: Intl.NumberFormatOptions): Intl.NumberFormat;
38
- new (options?: Intl.NumberFormatOptions & {
39
- locale?: LocalesValues;
40
- }): Intl.NumberFormat;
41
- };
42
- DateTimeFormat: {
43
- new (locales?: LocalesValues, options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
44
- new (options?: Intl.DateTimeFormatOptions & {
45
- locale?: LocalesValues;
46
- }): Intl.DateTimeFormat;
47
- };
48
- getCanonicalLocales: typeof Intl.getCanonicalLocales;
49
- readonly PluralRules: {
50
- new (locales?: LocalesValues, options?: Intl.PluralRulesOptions): Intl.PluralRules;
51
- new (options?: Intl.PluralRulesOptions & {
52
- locale?: LocalesValues;
53
- }): Intl.PluralRules;
54
- };
55
- readonly RelativeTimeFormat: {
56
- new (locales?: LocalesValues, options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat;
57
- new (options?: Intl.RelativeTimeFormatOptions & {
58
- locale?: LocalesValues;
59
- }): Intl.RelativeTimeFormat;
60
- };
61
- readonly Locale: {
62
- new (locales?: LocalesValues, options?: Intl.LocaleOptions): Intl.Locale;
63
- new (options?: Intl.LocaleOptions & {
64
- locale?: LocalesValues;
65
- }): Intl.Locale;
66
- };
67
- readonly DisplayNames: {
68
- new (locales?: LocalesValues, options?: Intl.DisplayNamesOptions): Intl.DisplayNames;
69
- new (options?: Intl.DisplayNamesOptions & {
70
- locale?: LocalesValues;
71
- }): Intl.DisplayNames;
72
- };
73
- readonly ListFormat: {
74
- new (locales?: LocalesValues, options?: Intl.ListFormatOptions): Intl.ListFormat;
75
- new (options?: Intl.ListFormatOptions & {
76
- locale?: LocalesValues;
77
- }): Intl.ListFormat;
78
- };
79
- supportedValuesOf: typeof Intl.supportedValuesOf;
80
- readonly Segmenter: {
81
- new (locales?: LocalesValues, options?: Intl.SegmenterOptions): Intl.Segmenter;
82
- new (options?: Intl.SegmenterOptions & {
83
- locale?: LocalesValues;
84
- }): Intl.Segmenter;
85
- };
86
- }>;
87
- //#endregion
88
- export { useIntl };
89
- //# sourceMappingURL=useIntl.d.ts.map
1
+ import { t as useIntl } from "../useIntl-CHizZCR2.js";
2
+ export { useIntl };
@@ -1,38 +1,2 @@
1
- import { DeepTransformContent } from "../plugins.js";
2
- import { Signal } from "@angular/core";
3
- import { DictionaryKeys, DictionaryRegistryContent, LocalesValues } from "@intlayer/types/module_augmentation";
4
-
5
- //#region src/client/useIntlayer.d.ts
6
- /** guard utility - true only for objects generated by `renderIntlayerNode()` */
7
- declare const isUpdatableNode: (val: unknown) => val is {
8
- __update: (n: unknown) => void;
9
- };
10
- /**
11
- * Angular hook that picks one dictionary by its key and returns its reactive content.
12
- *
13
- * It utilizes Angular signals to provide deep reactivity, ensuring your components
14
- * update automatically when the locale changes.
15
- *
16
- * @param key - The unique key of the dictionary to retrieve.
17
- * @param locale - Optional locale to override the current context locale.
18
- * @returns The transformed dictionary content.
19
- *
20
- * @example
21
- * ```ts
22
- * import { Component } from '@angular/core';
23
- * import { useIntlayer } from 'angular-intlayer';
24
- *
25
- * @Component({
26
- * standalone: true,
27
- * selector: 'app-my-component',
28
- * template: `<div>{{ content().myField.value }}</div>`,
29
- * })
30
- * export class MyComponent {
31
- * content = useIntlayer('my-dictionary-key');
32
- * }
33
- * ```
34
- */
35
- declare const useIntlayer: <T extends DictionaryKeys, L extends LocalesValues>(key: T, locale?: LocalesValues) => Signal<DeepTransformContent<DictionaryRegistryContent<T>>>;
36
- //#endregion
37
- export { isUpdatableNode, useIntlayer };
38
- //# sourceMappingURL=useIntlayer.d.ts.map
1
+ import { n as useIntlayer, t as isUpdatableNode } from "../useIntlayer-m3n_upwm.js";
2
+ export { isUpdatableNode, useIntlayer };
@@ -1,11 +1,2 @@
1
- //#region src/client/useLoadDynamic.d.ts
2
- /**
3
- * A "synchronous" loader for a dynamically‐imported JSON (or anything).
4
- *
5
- * - Immediately returns a reactive signal so that Angular can properly track changes.
6
- * - When the Promise resolves, it replaces the signal's value with the real data.
7
- */
8
- declare const useLoadDynamic: <T extends Record<string, any>>(key: string, promise: Promise<T>) => T;
9
- //#endregion
10
- export { useLoadDynamic };
11
- //# sourceMappingURL=useLoadDynamic.d.ts.map
1
+ import { t as useLoadDynamic } from "../useLoadDynamic-C4pltPcC.js";
2
+ export { useLoadDynamic };
@@ -1,48 +1,2 @@
1
- import * as _angular_core0 from "@angular/core";
2
- import { LocalesValues } from "@intlayer/types/module_augmentation";
3
- import * as _intlayer_types_allLocales0 from "@intlayer/types/allLocales";
4
-
5
- //#region src/client/useLocale.d.ts
6
- type useLocaleProps = {
7
- isCookieEnabled?: boolean;
8
- onLocaleChange?: (locale: LocalesValues) => void;
9
- };
10
- /**
11
- * Angular hook to manage the current locale and related functions.
12
- *
13
- * @param props - Optional configuration for locale management.
14
- * @returns An object containing the current locale (signal), default locale, available locales, and a function to update the locale.
15
- *
16
- * @example
17
- * ```ts
18
- * import { Component } from '@angular/core';
19
- * import { useLocale } from 'angular-intlayer';
20
- *
21
- * @Component({
22
- * standalone: true,
23
- * selector: 'app-locale-switcher',
24
- * template: `
25
- * <select [value]="locale()" (change)="setLocale($any($event.target).value)">
26
- * @for (loc of availableLocales; track loc) {
27
- * <option [value]="loc">{{ loc }}</option>
28
- * }
29
- * </select>
30
- * `,
31
- * })
32
- * export class LocaleSwitcher {
33
- * const { locale, setLocale, availableLocales } = useLocale();
34
- * }
35
- * ```
36
- */
37
- declare const useLocale: ({
38
- isCookieEnabled,
39
- onLocaleChange
40
- }?: useLocaleProps) => {
41
- locale: _angular_core0.Signal<"af" | "af-ZA" | "sq" | "sq-AL" | "am" | "am-ET" | "ar" | "ar-DZ" | "ar-BH" | "ar-TD" | "ar-KM" | "ar-DJ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MR" | "ar-MA" | "ar-OM" | "ar-PS" | "ar-QA" | "ar-SA" | "ar-SO" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-AE" | "ar-YE" | "hy" | "hy-AM" | "az" | "az-AZ" | "eu" | "eu-ES" | "be" | "be-BY" | "bn" | "bn-BD" | "bn-IN" | "bn-MM" | "bs" | "bs-BA" | "bg" | "bg-BG" | "my" | "my-MM" | "ca" | "ca-ES" | "zh" | "zh-HK" | "zh-MO" | "zh-Hans" | "zh-CN" | "zh-SG" | "zh-TW" | "zh-Hant" | "hr" | "hr-BA" | "hr-HR" | "cs" | "cs-CZ" | "da" | "da-DK" | "dv" | "dv-MV" | "nl" | "nl-BE" | "nl-NL" | "en" | "en-AU" | "en-BZ" | "en-BW" | "en-CA" | "en-CB" | "en-GH" | "en-HK" | "en-IN" | "en-IE" | "en-JM" | "en-KE" | "en-MY" | "en-NZ" | "en-NG" | "en-PK" | "en-PH" | "en-SG" | "en-ZA" | "en-TZ" | "en-TT" | "en-UG" | "en-GB" | "en-US" | "en-ZW" | "eo" | "et" | "et-EE" | "fo" | "fo-FO" | "fa" | "fa-IR" | "fi" | "fi-FI" | "fr" | "fr-BE" | "fr-CA" | "fr-FR" | "fr-LU" | "fr-MC" | "fr-CH" | "mk" | "mk-MK" | "gl" | "gl-ES" | "ka" | "ka-GE" | "de" | "de-AT" | "de-DE" | "de-LI" | "de-LU" | "de-CH" | "el" | "el-GR" | "gu" | "gu-IN" | "he" | "he-IL" | "hi" | "hi-IN" | "hu" | "hu-HU" | "is" | "is-IS" | "id" | "id-ID" | "ga" | "ga-IE" | "it" | "it-IT" | "it-CH" | "ja" | "ja-JP" | "kn" | "kn-IN" | "kk" | "kk-KZ" | "km" | "km-KH" | "kok" | "kok-IN" | "ko" | "ko-KR" | "ku" | "ku-TR" | "ky" | "ky-KG" | "lo" | "lo-LA" | "lv" | "lv-LV" | "lt" | "lt-LT" | "dsb" | "dsb-DE" | "mg-MG" | "ms" | "ml" | "ml-IN" | "ms-BN" | "ms-MY" | "mt" | "mt-MT" | "mi" | "mi-NZ" | "mr" | "mr-IN" | "mn" | "mn-MN" | "ne" | "ne-NP" | "ns" | "ns-ZA" | "no" | "nb" | "nb-NO" | "nn" | "nn-NO" | "ps" | "ps-AR" | "pl" | "pl-PL" | "pt" | "pt-BR" | "pt-CV" | "pt-GW" | "pt-MO" | "pt-MZ" | "pt-PT" | "pt-ST" | "pt-TL" | "pa" | "pa-IN" | "qu" | "qu-BO" | "qu-EC" | "qu-PE" | "ro" | "ro-MD" | "ro-RO" | "rm" | "rm-CH" | "ru" | "ru-MD" | "ru-RU" | "se" | "se-FI" | "se-NO" | "se-SE" | "sa" | "sa-IN" | "gd" | "gd-GB" | "sr-Cyrl" | "sr-BA" | "sr-RS" | "sr" | "sr-SP" | "si" | "si-LK" | "sk" | "sk-SK" | "sl" | "sl-SI" | "es" | "es-AR" | "es-BO" | "es-CL" | "es-CO" | "es-CR" | "es-CU" | "es-DO" | "es-EC" | "es-SV" | "es-GT" | "es-HN" | "es-MX" | "es-NI" | "es-PA" | "es-PY" | "es-PE" | "es-PR" | "es-ES" | "es-US" | "es-UY" | "es-VE" | "sw" | "sw-KE" | "sv" | "sv-FI" | "sv-SE" | "syr" | "syr-SY" | "tl" | "tl-PH" | "ta" | "ta-IN" | "tt" | "tt-RU" | "te" | "te-IN" | "th" | "th-TH" | "ts" | "tn" | "tn-ZA" | "tr" | "tr-TR" | "uk" | "uk-UA" | "hsb" | "hsb-DE" | "ur" | "ur-PK" | "uz" | "uz-UZ" | "ve" | "ve-ZA" | "vi" | "vi-VN" | "cy" | "cy-GB" | "xh" | "xh-ZA" | "yi" | "yi-001" | "yo" | "yo-NG" | "zu" | "zu-ZA" | (string & {})>;
42
- defaultLocale: _intlayer_types_allLocales0.Locale;
43
- availableLocales: _intlayer_types_allLocales0.Locale[];
44
- setLocale: (newLocale: LocalesValues) => void;
45
- };
46
- //#endregion
47
- export { useLocale };
48
- //# sourceMappingURL=useLocale.d.ts.map
1
+ import { t as useLocale } from "../useLocale-BzfAmXlx.js";
2
+ export { useLocale };
@@ -0,0 +1,9 @@
1
+ import { DeclaredLocales, LocalesValues } from "@intlayer/types/module_augmentation";
2
+ import { Dictionary } from "@intlayer/types/dictionary";
3
+ import * as _intlayer_core_interpreter0 from "@intlayer/core/interpreter";
4
+
5
+ //#region src/getDictionary.d.ts
6
+ declare const getDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => _intlayer_core_interpreter0.DeepTransformContent<T["content"], _intlayer_core_interpreter0.IInterpreterPluginState, L>;
7
+ //#endregion
8
+ export { getDictionary as t };
9
+ //# sourceMappingURL=getDictionary-DDjZzxAC.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDictionary-DDjZzxAC.d.ts","names":[],"sources":["../../src/getDictionary.ts"],"mappings":";;;;;cAQa,aAAA,aACD,UAAA,YACA,aAAA,GAAgB,eAAA,EAE1B,UAAA,EAAY,CAAA,EACZ,MAAA,GAAS,CAAA,KAAC,2BAAA,CAAA,oBAAA,CAAA,CAAA,aAAA,2BAAA,CAAA,uBAAA,EAAA,CAAA"}
@@ -1,9 +1,2 @@
1
- import { DeclaredLocales, LocalesValues } from "@intlayer/types/module_augmentation";
2
- import { Dictionary } from "@intlayer/types/dictionary";
3
- import * as _intlayer_core_interpreter0 from "@intlayer/core/interpreter";
4
-
5
- //#region src/getDictionary.d.ts
6
- declare const getDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => _intlayer_core_interpreter0.DeepTransformContent<T["content"], _intlayer_core_interpreter0.IInterpreterPluginState, L>;
7
- //#endregion
8
- export { getDictionary };
9
- //# sourceMappingURL=getDictionary.d.ts.map
1
+ import { t as getDictionary } from "./getDictionary-DDjZzxAC.js";
2
+ export { getDictionary };
@@ -0,0 +1,8 @@
1
+ import { t as DeepTransformContent } from "./plugins-C_v3w-vC.js";
2
+ import { DeclaredLocales, DictionaryKeys, DictionaryRegistryContent, LocalesValues } from "@intlayer/types/module_augmentation";
3
+
4
+ //#region src/getIntlayer.d.ts
5
+ declare const getIntlayer: <T extends DictionaryKeys, L extends LocalesValues = DeclaredLocales>(key: T, locale?: L) => DeepTransformContent<DictionaryRegistryContent<T>>;
6
+ //#endregion
7
+ export { getIntlayer as t };
8
+ //# sourceMappingURL=getIntlayer-CWM6qsJJ.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getIntlayer-CWM6qsJJ.d.ts","names":[],"sources":["../../src/getIntlayer.ts"],"mappings":";;;;cASa,WAAA,aACD,cAAA,YACA,aAAA,GAAgB,eAAA,EAE1B,GAAA,EAAK,CAAA,EACL,MAAA,GAAS,CAAA,KAMJ,oBAAA,CAAqB,yBAAA,CAA0B,CAAA"}
@@ -1,8 +1,2 @@
1
- import { DeepTransformContent } from "./plugins.js";
2
- import { DeclaredLocales, DictionaryKeys, DictionaryRegistryContent, LocalesValues } from "@intlayer/types/module_augmentation";
3
-
4
- //#region src/getIntlayer.d.ts
5
- declare const getIntlayer: <T extends DictionaryKeys, L extends LocalesValues = DeclaredLocales>(key: T, locale?: L) => DeepTransformContent<DictionaryRegistryContent<T>>;
6
- //#endregion
7
- export { getIntlayer };
8
- //# sourceMappingURL=getIntlayer.d.ts.map
1
+ import { t as getIntlayer } from "./getIntlayer-CWM6qsJJ.js";
2
+ export { getIntlayer };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,22 @@
1
+ import { i as IInterpreterPluginState$1, r as IInterpreterPluginAngular } from "./plugins-C_v3w-vC.js";
2
+ import * as _angular_core0 from "@angular/core";
3
+ import { DictionaryKeys, LocalesValues, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
4
+ import { Dictionary } from "@intlayer/types/dictionary";
5
+ import * as _intlayer_core_interpreter0 from "@intlayer/core/interpreter";
6
+ import * as _intlayer_types_allLocales0 from "@intlayer/types/allLocales";
7
+
8
+ //#region src/index.d.ts
9
+ declare module '@intlayer/core/interpreter' {
10
+ interface IInterpreterPlugin<T, S, L extends LocalesValues> extends IInterpreterPluginAngular<T, S, L> {}
11
+ }
12
+ //#endregion
13
+ //#region src/client/useDictionaryDynamic.d.ts
14
+ /**
15
+ * On the server side, Hook that transform a dictionary and return the content
16
+ *
17
+ * If the locale is not provided, it will use the locale from the client context
18
+ */
19
+ declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => _angular_core0.Signal<_intlayer_core_interpreter0.DeepTransformContent<T["content"], IInterpreterPluginState$1, _intlayer_types_allLocales0.Locale>>;
20
+ //#endregion
21
+ export { useDictionaryDynamic as t };
22
+ //# sourceMappingURL=index-D5QAgZ5v.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-D5QAgZ5v.d.ts","names":[],"sources":["../../src/index.ts","../../src/client/useDictionaryDynamic.ts"],"mappings":";;;;;;;;;YAIY,kBAAA,iBAAmC,aAAA,UACnC,yBAAA,CAA0B,CAAA,EAAG,CAAA,EAAG,CAAA;AAAA;;;;;;;;cCU/B,oBAAA,aACD,UAAA,YACA,cAAA,EAEV,iBAAA,EAAmB,mBAAA,OAA0B,OAAA,CAAQ,CAAA,IACrD,GAAA,EAAK,CAAA,EACL,MAAA,GAAS,aAAA,KAAa,cAAA,CAAA,MAAA,CAAA,2BAAA,CAAA,oBAAA,CAAA,CAAA,aAAA,yBAAA,EAAA,2BAAA,CAAA,MAAA"}
@@ -1,21 +1,13 @@
1
- import { INTLAYER_TOKEN, IntlayerProvider, createIntlayerClient, installIntlayer, provideIntlayer } from "./client/installIntlayer.js";
2
- import { DeepTransformContent, HTMLPluginCond, IInterpreterPluginAngular, IInterpreterPluginState, InsertionPluginCond, IntlayerNode, IntlayerNodeCond, MarkdownCond, MarkdownStringCond, getPlugins, htmlPlugin, insertionPlugin, intlayerNodePlugins, markdownPlugin, markdownStringPlugin } from "./plugins.js";
3
- import { useDictionary } from "./client/useDictionary.js";
4
- import { useDictionaryAsync } from "./client/useDictionaryAsync.js";
5
- import { getDictionary } from "./getDictionary.js";
6
- import { getIntlayer } from "./getIntlayer.js";
7
- import { INTLAYER_MARKDOWN_TOKEN, IntlayerMarkdownProvider, IntlayerMarkdownService, createIntlayerMarkdownProvider, htmlRuntime, useMarkdown } from "./markdown/installIntlayerMarkdown.js";
8
- import { useDictionaryDynamic } from "./client/useDictionaryDynamic.js";
9
- import { useIntl } from "./client/useIntl.js";
10
- import { isUpdatableNode, useIntlayer } from "./client/useIntlayer.js";
11
- import { useLoadDynamic } from "./client/useLoadDynamic.js";
12
- import { useLocale } from "./client/useLocale.js";
13
- import { LocalesValues } from "@intlayer/types/module_augmentation";
14
-
15
- //#region src/index.d.ts
16
- declare module '@intlayer/core/interpreter' {
17
- interface IInterpreterPlugin<T, S, L extends LocalesValues> extends IInterpreterPluginAngular<T, S, L> {}
18
- }
19
- //#endregion
20
- export { DeepTransformContent, HTMLPluginCond, IInterpreterPluginAngular, IInterpreterPluginState, INTLAYER_MARKDOWN_TOKEN, INTLAYER_TOKEN, InsertionPluginCond, IntlayerMarkdownProvider, IntlayerMarkdownService, IntlayerNode, IntlayerNodeCond, IntlayerProvider, MarkdownCond, MarkdownStringCond, createIntlayerClient, createIntlayerMarkdownProvider, getDictionary, getIntlayer, getPlugins, htmlPlugin, htmlRuntime, insertionPlugin, installIntlayer, intlayerNodePlugins, isUpdatableNode, markdownPlugin, markdownStringPlugin, provideIntlayer, useDictionary, useDictionaryAsync, useDictionaryDynamic, useIntl, useIntlayer, useLoadDynamic, useLocale, useMarkdown };
21
- //# sourceMappingURL=index.d.ts.map
1
+ import { a as provideIntlayer, i as installIntlayer, n as IntlayerProvider, r as createIntlayerClient, t as INTLAYER_TOKEN } from "./installIntlayer-Ce7kST5N.js";
2
+ import { a as InsertionPluginCond, c as MarkdownCond, d as htmlPlugin, f as insertionPlugin, h as markdownStringPlugin, i as IInterpreterPluginState, l as MarkdownStringCond, m as markdownPlugin, n as HTMLPluginCond, o as IntlayerNode, p as intlayerNodePlugins, r as IInterpreterPluginAngular, s as IntlayerNodeCond, t as DeepTransformContent, u as getPlugins } from "./plugins-C_v3w-vC.js";
3
+ import { t as useDictionary } from "./useDictionary-Dq9yu0X_.js";
4
+ import { t as useDictionaryAsync } from "./useDictionaryAsync-BYUsr8w4.js";
5
+ import { t as getDictionary } from "./getDictionary-DDjZzxAC.js";
6
+ import { t as getIntlayer } from "./getIntlayer-CWM6qsJJ.js";
7
+ import { a as htmlRuntime, i as createIntlayerMarkdownProvider, n as IntlayerMarkdownProvider, o as useMarkdown, r as IntlayerMarkdownService, t as INTLAYER_MARKDOWN_TOKEN } from "./installIntlayerMarkdown-BIU3FTDH.js";
8
+ import { t as useDictionaryDynamic } from "./index-D5QAgZ5v.js";
9
+ import { t as useIntl } from "./useIntl-CHizZCR2.js";
10
+ import { n as useIntlayer, t as isUpdatableNode } from "./useIntlayer-m3n_upwm.js";
11
+ import { t as useLoadDynamic } from "./useLoadDynamic-C4pltPcC.js";
12
+ import { t as useLocale } from "./useLocale-BzfAmXlx.js";
13
+ export { DeepTransformContent, HTMLPluginCond, IInterpreterPluginAngular, IInterpreterPluginState, INTLAYER_MARKDOWN_TOKEN, INTLAYER_TOKEN, InsertionPluginCond, IntlayerMarkdownProvider, IntlayerMarkdownService, IntlayerNode, IntlayerNodeCond, IntlayerProvider, MarkdownCond, MarkdownStringCond, createIntlayerClient, createIntlayerMarkdownProvider, getDictionary, getIntlayer, getPlugins, htmlPlugin, htmlRuntime, insertionPlugin, installIntlayer, intlayerNodePlugins, isUpdatableNode, markdownPlugin, markdownStringPlugin, provideIntlayer, useDictionary, useDictionaryAsync, useDictionaryDynamic, useIntl, useIntlayer, useLoadDynamic, useLocale, useMarkdown };