preact-intlayer 8.4.0 → 8.4.2

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 (217) hide show
  1. package/dist/cjs/IntlayerNode.cjs +1 -1
  2. package/dist/cjs/IntlayerNode.cjs.map +1 -1
  3. package/dist/cjs/IntlayerProvider-sM1gzsx7.cjs +2 -0
  4. package/dist/cjs/IntlayerProvider-sM1gzsx7.cjs.map +1 -0
  5. package/dist/cjs/UI/ContentSelector.cjs +1 -1
  6. package/dist/cjs/UI/ContentSelector.cjs.map +1 -1
  7. package/dist/cjs/client/IntlayerProvider.cjs +1 -2
  8. package/dist/cjs/client/format/useCompact.cjs +1 -1
  9. package/dist/cjs/client/format/useCompact.cjs.map +1 -1
  10. package/dist/cjs/client/format/useCurrency.cjs +1 -1
  11. package/dist/cjs/client/format/useCurrency.cjs.map +1 -1
  12. package/dist/cjs/client/format/useDate.cjs +1 -1
  13. package/dist/cjs/client/format/useDate.cjs.map +1 -1
  14. package/dist/cjs/client/format/useIntl.cjs +1 -1
  15. package/dist/cjs/client/format/useIntl.cjs.map +1 -1
  16. package/dist/cjs/client/format/useList.cjs +1 -1
  17. package/dist/cjs/client/format/useList.cjs.map +1 -1
  18. package/dist/cjs/client/format/useNumber.cjs +1 -1
  19. package/dist/cjs/client/format/useNumber.cjs.map +1 -1
  20. package/dist/cjs/client/format/usePercentage.cjs +1 -1
  21. package/dist/cjs/client/format/usePercentage.cjs.map +1 -1
  22. package/dist/cjs/client/format/useRelativeTime.cjs +1 -1
  23. package/dist/cjs/client/format/useRelativeTime.cjs.map +1 -1
  24. package/dist/cjs/client/format/useUnit.cjs +1 -1
  25. package/dist/cjs/client/format/useUnit.cjs.map +1 -1
  26. package/dist/cjs/client/index.cjs +1 -1
  27. package/dist/cjs/client/t.cjs +1 -1
  28. package/dist/cjs/client/t.cjs.map +1 -1
  29. package/dist/cjs/client/useDictionary.cjs +1 -1
  30. package/dist/cjs/client/useDictionary.cjs.map +1 -1
  31. package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
  32. package/dist/cjs/client/useDictionaryAsync.cjs.map +1 -1
  33. package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
  34. package/dist/cjs/client/useDictionaryDynamic.cjs.map +1 -1
  35. package/dist/cjs/client/useIntlayer.cjs +1 -1
  36. package/dist/cjs/client/useIntlayer.cjs.map +1 -1
  37. package/dist/cjs/client/useLocale.cjs +1 -1
  38. package/dist/cjs/client/useLocale.cjs.map +1 -1
  39. package/dist/cjs/client/useLocaleBase.cjs +1 -1
  40. package/dist/cjs/client/useLocaleBase.cjs.map +1 -1
  41. package/dist/cjs/client/useLocaleStorage.cjs +1 -1
  42. package/dist/cjs/client/useLocaleStorage.cjs.map +1 -1
  43. package/dist/cjs/client/useTraduction.cjs +1 -1
  44. package/dist/cjs/client/useTraduction.cjs.map +1 -1
  45. package/dist/cjs/editor/ContentSelector.cjs +1 -1
  46. package/dist/cjs/editor/ContentSelector.cjs.map +1 -1
  47. package/dist/cjs/editor/EditorProvider.cjs +1 -2
  48. package/dist/cjs/editor/useEditor.cjs +1 -2
  49. package/dist/cjs/getDictionary.cjs +1 -1
  50. package/dist/cjs/getDictionary.cjs.map +1 -1
  51. package/dist/cjs/getIntlayer.cjs +1 -1
  52. package/dist/cjs/getIntlayer.cjs.map +1 -1
  53. package/dist/cjs/html/HTMLProvider.cjs +1 -1
  54. package/dist/cjs/html/HTMLProvider.cjs.map +1 -1
  55. package/dist/cjs/html/HTMLRenderer.cjs +1 -1
  56. package/dist/cjs/html/HTMLRenderer.cjs.map +1 -1
  57. package/dist/cjs/index.cjs +1 -1
  58. package/dist/cjs/markdown/MarkdownProvider.cjs +1 -1
  59. package/dist/cjs/markdown/MarkdownProvider.cjs.map +1 -1
  60. package/dist/cjs/markdown/MarkdownRenderer.cjs +1 -1
  61. package/dist/cjs/markdown/MarkdownRenderer.cjs.map +1 -1
  62. package/dist/cjs/markdown/MarkdownRendererPlugin.cjs +1 -1
  63. package/dist/cjs/markdown/MarkdownRendererPlugin.cjs.map +1 -1
  64. package/dist/cjs/markdown/compiler.cjs +1 -1
  65. package/dist/cjs/markdown/compiler.cjs.map +1 -1
  66. package/dist/cjs/markdown/index.cjs +1 -1
  67. package/dist/cjs/markdown/runtime.cjs +1 -1
  68. package/dist/cjs/markdown/runtime.cjs.map +1 -1
  69. package/dist/cjs/plugins.cjs +1 -1
  70. package/dist/cjs/plugins.cjs.map +1 -1
  71. package/dist/cjs/preactElement/renderPreactElement.cjs +1 -1
  72. package/dist/cjs/preactElement/renderPreactElement.cjs.map +1 -1
  73. package/dist/esm/IntlayerProvider-ClOcEK3A.mjs +2 -0
  74. package/dist/esm/IntlayerProvider-ClOcEK3A.mjs.map +1 -0
  75. package/dist/esm/client/IntlayerProvider.mjs +1 -2
  76. package/dist/esm/client/format/useCompact.mjs +1 -1
  77. package/dist/esm/client/format/useCompact.mjs.map +1 -1
  78. package/dist/esm/client/format/useCurrency.mjs +1 -1
  79. package/dist/esm/client/format/useCurrency.mjs.map +1 -1
  80. package/dist/esm/client/format/useDate.mjs +1 -1
  81. package/dist/esm/client/format/useDate.mjs.map +1 -1
  82. package/dist/esm/client/format/useIntl.mjs +1 -1
  83. package/dist/esm/client/format/useIntl.mjs.map +1 -1
  84. package/dist/esm/client/format/useList.mjs +1 -1
  85. package/dist/esm/client/format/useList.mjs.map +1 -1
  86. package/dist/esm/client/format/useNumber.mjs +1 -1
  87. package/dist/esm/client/format/useNumber.mjs.map +1 -1
  88. package/dist/esm/client/format/usePercentage.mjs +1 -1
  89. package/dist/esm/client/format/usePercentage.mjs.map +1 -1
  90. package/dist/esm/client/format/useRelativeTime.mjs +1 -1
  91. package/dist/esm/client/format/useRelativeTime.mjs.map +1 -1
  92. package/dist/esm/client/format/useUnit.mjs +1 -1
  93. package/dist/esm/client/format/useUnit.mjs.map +1 -1
  94. package/dist/esm/client/index.mjs +1 -1
  95. package/dist/esm/client/t.mjs +1 -1
  96. package/dist/esm/client/t.mjs.map +1 -1
  97. package/dist/esm/client/useDictionary.mjs +1 -1
  98. package/dist/esm/client/useDictionary.mjs.map +1 -1
  99. package/dist/esm/client/useDictionaryAsync.mjs +1 -1
  100. package/dist/esm/client/useDictionaryAsync.mjs.map +1 -1
  101. package/dist/esm/client/useDictionaryDynamic.mjs +1 -1
  102. package/dist/esm/client/useDictionaryDynamic.mjs.map +1 -1
  103. package/dist/esm/client/useIntlayer.mjs +1 -1
  104. package/dist/esm/client/useIntlayer.mjs.map +1 -1
  105. package/dist/esm/client/useLocale.mjs +1 -1
  106. package/dist/esm/client/useLocale.mjs.map +1 -1
  107. package/dist/esm/client/useLocaleBase.mjs +1 -1
  108. package/dist/esm/client/useLocaleBase.mjs.map +1 -1
  109. package/dist/esm/client/useTraduction.mjs +1 -1
  110. package/dist/esm/client/useTraduction.mjs.map +1 -1
  111. package/dist/esm/editor/ContentSelector.mjs +1 -1
  112. package/dist/esm/editor/ContentSelector.mjs.map +1 -1
  113. package/dist/esm/editor/EditorProvider.mjs +1 -2
  114. package/dist/esm/editor/useEditor.mjs +1 -2
  115. package/dist/esm/index.mjs +1 -1
  116. package/dist/esm/plugins.mjs +1 -1
  117. package/dist/esm/plugins.mjs.map +1 -1
  118. package/dist/types/HTMLProvider-8sO8DU8H.d.ts +18 -0
  119. package/dist/types/HTMLProvider-8sO8DU8H.d.ts.map +1 -0
  120. package/dist/types/HTMLRenderer-NNa_9oMD.d.ts +61 -0
  121. package/dist/types/HTMLRenderer-NNa_9oMD.d.ts.map +1 -0
  122. package/dist/types/IntlayerNode-CIzFHYnC.d.ts +23 -0
  123. package/dist/types/IntlayerNode-CIzFHYnC.d.ts.map +1 -0
  124. package/dist/types/IntlayerNode.d.ts +2 -23
  125. package/dist/types/IntlayerProvider-aV596OL4.d.ts +53 -0
  126. package/dist/types/IntlayerProvider-aV596OL4.d.ts.map +1 -0
  127. package/dist/types/MarkdownProvider-chUIO05u.d.ts +52 -0
  128. package/dist/types/MarkdownProvider-chUIO05u.d.ts.map +1 -0
  129. package/dist/types/MarkdownRenderer-BMhuurZW.d.ts +61 -0
  130. package/dist/types/MarkdownRenderer-BMhuurZW.d.ts.map +1 -0
  131. package/dist/types/MarkdownRendererPlugin-DFRVdHCA.d.ts +23 -0
  132. package/dist/types/MarkdownRendererPlugin-DFRVdHCA.d.ts.map +1 -0
  133. package/dist/types/client/IntlayerProvider.d.ts +2 -53
  134. package/dist/types/client/format/useIntl.d.ts +2 -82
  135. package/dist/types/client/format/useList.d.ts +5 -1
  136. package/dist/types/client/format/useList.d.ts.map +1 -1
  137. package/dist/types/client/index.d.ts +11 -11
  138. package/dist/types/client/t.d.ts +2 -13
  139. package/dist/types/client/useDictionary.d.ts +2 -16
  140. package/dist/types/client/useDictionaryAsync.d.ts +2 -13
  141. package/dist/types/client/useDictionaryDynamic.d.ts +2 -16
  142. package/dist/types/client/useIntlayer.d.ts +2 -28
  143. package/dist/types/client/useLoadDynamic.d.ts +2 -5
  144. package/dist/types/client/useLocale.d.ts +2 -43
  145. package/dist/types/client/useLocaleBase.d.ts +2 -16
  146. package/dist/types/client/useLocaleStorage.d.ts +2 -45
  147. package/dist/types/compiler-BB0gAVbe.d.ts +14 -0
  148. package/dist/types/compiler-BB0gAVbe.d.ts.map +1 -0
  149. package/dist/types/getDictionary.d.ts +1 -1
  150. package/dist/types/getIntlayer.d.ts +1 -1
  151. package/dist/types/html/HTMLProvider.d.ts +2 -18
  152. package/dist/types/html/HTMLRenderer.d.ts +2 -61
  153. package/dist/types/html/index.d.ts +2 -2
  154. package/dist/types/html/types.d.ts +2 -38
  155. package/dist/types/index.d.ts +19 -19
  156. package/dist/types/markdown/MarkdownProvider.d.ts +2 -52
  157. package/dist/types/markdown/MarkdownRenderer.d.ts +2 -61
  158. package/dist/types/markdown/MarkdownRendererPlugin.d.ts +2 -23
  159. package/dist/types/markdown/compiler.d.ts +2 -14
  160. package/dist/types/markdown/index.d.ts +5 -5
  161. package/dist/types/markdown/runtime.d.ts +2 -10
  162. package/dist/types/plugins-D6OB94dO.d.ts +95 -0
  163. package/dist/types/plugins-D6OB94dO.d.ts.map +1 -0
  164. package/dist/types/plugins.d.ts +2 -95
  165. package/dist/types/runtime-BMHAtT-R.d.ts +10 -0
  166. package/dist/types/runtime-BMHAtT-R.d.ts.map +1 -0
  167. package/dist/types/t-CalXqnSB.d.ts +13 -0
  168. package/dist/types/t-CalXqnSB.d.ts.map +1 -0
  169. package/dist/types/types-B3Kzdco6.d.ts +38 -0
  170. package/dist/types/types-B3Kzdco6.d.ts.map +1 -0
  171. package/dist/types/useDictionary-cjQAc1l1.d.ts +16 -0
  172. package/dist/types/useDictionary-cjQAc1l1.d.ts.map +1 -0
  173. package/dist/types/useDictionaryAsync-CDCcBnXn.d.ts +13 -0
  174. package/dist/types/useDictionaryAsync-CDCcBnXn.d.ts.map +1 -0
  175. package/dist/types/useDictionaryDynamic-BQgaM0vp.d.ts +16 -0
  176. package/dist/types/useDictionaryDynamic-BQgaM0vp.d.ts.map +1 -0
  177. package/dist/types/useIntl-DfzrSGu4.d.ts +26 -0
  178. package/dist/types/useIntl-DfzrSGu4.d.ts.map +1 -0
  179. package/dist/types/useIntlayer-BINmW9T1.d.ts +28 -0
  180. package/dist/types/useIntlayer-BINmW9T1.d.ts.map +1 -0
  181. package/dist/types/useLoadDynamic-DFXHehpF.d.ts +5 -0
  182. package/dist/types/useLoadDynamic-DFXHehpF.d.ts.map +1 -0
  183. package/dist/types/useLocale-BDQ4yLc5.d.ts +43 -0
  184. package/dist/types/useLocale-BDQ4yLc5.d.ts.map +1 -0
  185. package/dist/types/useLocaleBase-1L1RLyXD.d.ts +16 -0
  186. package/dist/types/useLocaleBase-1L1RLyXD.d.ts.map +1 -0
  187. package/dist/types/useLocaleStorage-BwH9gqN5.d.ts +45 -0
  188. package/dist/types/useLocaleStorage-BwH9gqN5.d.ts.map +1 -0
  189. package/package.json +7 -7
  190. package/dist/cjs/_virtual/_rolldown/runtime.cjs +0 -1
  191. package/dist/cjs/client/IntlayerProvider.cjs.map +0 -1
  192. package/dist/cjs/editor/EditorProvider.cjs.map +0 -1
  193. package/dist/cjs/editor/useEditor.cjs.map +0 -1
  194. package/dist/esm/client/IntlayerProvider.mjs.map +0 -1
  195. package/dist/esm/editor/EditorProvider.mjs.map +0 -1
  196. package/dist/esm/editor/useEditor.mjs.map +0 -1
  197. package/dist/types/IntlayerNode.d.ts.map +0 -1
  198. package/dist/types/client/IntlayerProvider.d.ts.map +0 -1
  199. package/dist/types/client/format/useIntl.d.ts.map +0 -1
  200. package/dist/types/client/t.d.ts.map +0 -1
  201. package/dist/types/client/useDictionary.d.ts.map +0 -1
  202. package/dist/types/client/useDictionaryAsync.d.ts.map +0 -1
  203. package/dist/types/client/useDictionaryDynamic.d.ts.map +0 -1
  204. package/dist/types/client/useIntlayer.d.ts.map +0 -1
  205. package/dist/types/client/useLoadDynamic.d.ts.map +0 -1
  206. package/dist/types/client/useLocale.d.ts.map +0 -1
  207. package/dist/types/client/useLocaleBase.d.ts.map +0 -1
  208. package/dist/types/client/useLocaleStorage.d.ts.map +0 -1
  209. package/dist/types/html/HTMLProvider.d.ts.map +0 -1
  210. package/dist/types/html/HTMLRenderer.d.ts.map +0 -1
  211. package/dist/types/html/types.d.ts.map +0 -1
  212. package/dist/types/markdown/MarkdownProvider.d.ts.map +0 -1
  213. package/dist/types/markdown/MarkdownRenderer.d.ts.map +0 -1
  214. package/dist/types/markdown/MarkdownRendererPlugin.d.ts.map +0 -1
  215. package/dist/types/markdown/compiler.d.ts.map +0 -1
  216. package/dist/types/markdown/runtime.d.ts.map +0 -1
  217. package/dist/types/plugins.d.ts.map +0 -1
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);let e=require(`preact`);const t=({children:t,value:n,additionalProps:r})=>{let i=(0,e.isValidElement)(t)?t:(0,e.h)(e.Fragment,{},t);return new Proxy(i,{get(e,t,i){return t===`value`?n:r&&Object.keys(r).includes(t)?r[t]:Reflect.get(e,t,i)}})};exports.renderIntlayerNode=t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./IntlayerProvider-sM1gzsx7.cjs`);let e=require(`preact`);const t=({children:t,value:n,additionalProps:r})=>{let i=(0,e.isValidElement)(t)?t:(0,e.h)(e.Fragment,{},t);return new Proxy(i,{get(e,t,i){return t===`value`?n:r&&Object.keys(r).includes(t)?r[t]:Reflect.get(e,t,i)}})};exports.renderIntlayerNode=t;
2
2
  //# sourceMappingURL=IntlayerNode.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerNode.cjs","names":["Fragment"],"sources":["../../src/IntlayerNode.tsx"],"sourcesContent":["import type { NodeProps } from '@intlayer/core/interpreter';\nimport type { ResolvedEditor } from '@intlayer/types/module_augmentation';\nimport {\n type ComponentChildren,\n Fragment,\n h,\n isValidElement,\n type VNode,\n} from 'preact';\n\nexport type IntlayerNode<\n T = NodeProps['children'],\n AdditionalProps = {},\n> = ResolvedEditor<T, VNode> & {\n value: T;\n} & AdditionalProps;\n\ntype RenderIntlayerNodeProps<T> = {\n value: T;\n children: ComponentChildren;\n additionalProps?: { [key: string]: any };\n};\n\nexport const renderIntlayerNode = <\n T extends number | string | boolean | undefined | null,\n>({\n children,\n value,\n additionalProps,\n}: RenderIntlayerNodeProps<T>): IntlayerNode<T> => {\n // If children is not a valid VNode, wrap it in a fragment\n const element: VNode<any> = isValidElement(children)\n ? children\n : h(Fragment, {}, children);\n\n // Return a Proxy that pretends to be the original element\n // but also has a .value getter.\n return new Proxy(element as VNode, {\n get(target, prop, receiver) {\n if (prop === 'value') {\n return value;\n }\n\n if (\n additionalProps &&\n Object.keys(additionalProps).includes(prop as string)\n ) {\n return additionalProps[prop as keyof typeof additionalProps];\n }\n\n return Reflect.get(target, prop, receiver);\n },\n }) as IntlayerNode<T>;\n};\n"],"mappings":"uIAuBA,MAAa,GAEX,CACA,WACA,QACA,qBACiD,CAEjD,IAAM,GAAA,EAAA,EAAA,gBAAqC,EAAS,CAChD,GAAA,EAAA,EAAA,GACEA,EAAAA,SAAU,EAAE,CAAE,EAAS,CAI7B,OAAO,IAAI,MAAM,EAAkB,CACjC,IAAI,EAAQ,EAAM,EAAU,CAY1B,OAXI,IAAS,QACJ,EAIP,GACA,OAAO,KAAK,EAAgB,CAAC,SAAS,EAAe,CAE9C,EAAgB,GAGlB,QAAQ,IAAI,EAAQ,EAAM,EAAS,EAE7C,CAAC"}
1
+ {"version":3,"file":"IntlayerNode.cjs","names":["Fragment"],"sources":["../../src/IntlayerNode.tsx"],"sourcesContent":["import type { NodeProps } from '@intlayer/core/interpreter';\nimport type { ResolvedEditor } from '@intlayer/types/module_augmentation';\nimport {\n type ComponentChildren,\n Fragment,\n h,\n isValidElement,\n type VNode,\n} from 'preact';\n\nexport type IntlayerNode<\n T = NodeProps['children'],\n AdditionalProps = {},\n> = ResolvedEditor<T, VNode> & {\n value: T;\n} & AdditionalProps;\n\ntype RenderIntlayerNodeProps<T> = {\n value: T;\n children: ComponentChildren;\n additionalProps?: { [key: string]: any };\n};\n\nexport const renderIntlayerNode = <\n T extends number | string | boolean | undefined | null,\n>({\n children,\n value,\n additionalProps,\n}: RenderIntlayerNodeProps<T>): IntlayerNode<T> => {\n // If children is not a valid VNode, wrap it in a fragment\n const element: VNode<any> = isValidElement(children)\n ? children\n : h(Fragment, {}, children);\n\n // Return a Proxy that pretends to be the original element\n // but also has a .value getter.\n return new Proxy(element as VNode, {\n get(target, prop, receiver) {\n if (prop === 'value') {\n return value;\n }\n\n if (\n additionalProps &&\n Object.keys(additionalProps).includes(prop as string)\n ) {\n return additionalProps[prop as keyof typeof additionalProps];\n }\n\n return Reflect.get(target, prop, receiver);\n },\n }) as IntlayerNode<T>;\n};\n"],"mappings":"sIAuBA,MAAa,GAEX,CACA,WACA,QACA,qBACiD,CAEjD,IAAM,GAAA,EAAA,EAAA,gBAAqC,EAAS,CAChD,GAAA,EAAA,EAAA,GACEA,EAAAA,SAAU,EAAE,CAAE,EAAS,CAI7B,OAAO,IAAI,MAAM,EAAkB,CACjC,IAAI,EAAQ,EAAM,EAAU,CAY1B,OAXI,IAAS,QACJ,EAIP,GACA,OAAO,KAAK,EAAgB,CAAC,SAAS,EAAe,CAE9C,EAAgB,GAGlB,QAAQ,IAAI,EAAQ,EAAM,EAAS,EAE7C,CAAC"}
@@ -0,0 +1,2 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require(`./client/useLocaleStorage.cjs`);let l=require(`@intlayer/config/built`);l=s(l);let u=require(`preact`),d=require(`@intlayer/editor/isEnabled`),f=require(`preact/hooks`),p=require(`preact/jsx-runtime`),m=require(`@intlayer/core/localization`);const h=()=>{let{locale:e}=(0,f.useContext)(_),t=(0,f.useRef)(null);(0,f.useEffect)(()=>{if(!(process.env.INTLAYER_EDITOR_ENABLED===`false`||!d.isEnabled))return import(`@intlayer/editor`).then(({initEditorClient:n})=>{let r=n();t.current=r,e&&r.currentLocale.set(e)}),()=>{t.current=null,import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})}},[]),(0,f.useEffect)(()=>{!e||!t.current||t.current.currentLocale.set(e)},[e])},g=({children:e})=>(h(),e),_=(0,u.createContext)({locale:c.localeInStorage??l.default?.internationalization?.defaultLocale,setLocale:()=>null}),v=()=>(0,f.useContext)(_),y=({locale:e,defaultLocale:t,children:n,setLocale:r,isCookieEnabled:i})=>{let{internationalization:a}=l.default??{},{defaultLocale:o,locales:s}=a??{},[u,d]=(0,f.useState)(e??c.localeInStorage??t??o);(0,f.useEffect)(()=>{e&&e!==u&&d(e)},[e,u,d]);let h=r??(e=>{if(u.toString()!==e.toString()){if(!s?.map(String).includes(e)){console.error(`Locale ${e} is not available`);return}d(e),c.setLocaleInStorage(e,i??!0)}}),g=(0,m.localeResolver)(e??u);return(0,p.jsx)(_.Provider,{value:{locale:g,setLocale:h,isCookieEnabled:i},children:n})},b=({children:e,...t})=>(0,p.jsxs)(y,{...t,children:[(0,p.jsx)(g,{}),e]});Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return _}});
2
+ //# sourceMappingURL=IntlayerProvider-sM1gzsx7.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IntlayerProvider-sM1gzsx7.cjs","names":["isEnabled","localeInStorage","configuration"],"sources":["../../src/editor/useEditor.tsx","../../src/editor/EditorProvider.tsx","../../src/client/IntlayerProvider.tsx"],"sourcesContent":["import type { EditorStateManager } from '@intlayer/editor';\nimport { isEnabled } from '@intlayer/editor/isEnabled';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { useContext, useEffect, useRef } from 'preact/hooks';\nimport { IntlayerClientContext } from '../client/IntlayerProvider';\n\n/**\n * Initialises the Intlayer editor client singleton when the editor is enabled.\n * Syncs the current locale from the Intlayer context into the editor manager so\n * the editor always knows which locale the app is displaying.\n */\nexport const useEditor = () => {\n const { locale } = useContext(IntlayerClientContext);\n const managerRef = useRef<EditorStateManager | null>(null);\n\n useEffect(() => {\n if (process.env.INTLAYER_EDITOR_ENABLED === 'false' || !isEnabled) return;\n\n import('@intlayer/editor').then(({ initEditorClient }) => {\n const manager = initEditorClient();\n managerRef.current = manager;\n\n if (locale) manager.currentLocale.set(locale as Locale);\n });\n\n return () => {\n managerRef.current = null;\n import('@intlayer/editor').then(({ stopEditorClient }) => {\n stopEditorClient();\n });\n };\n }, []);\n\n useEffect(() => {\n if (!locale || !managerRef.current) return;\n\n managerRef.current.currentLocale.set(locale as Locale);\n }, [locale]);\n};\n","import type { ComponentChild, FunctionComponent } from 'preact';\nimport { useEditor } from './useEditor';\n\nexport const EditorProvider: FunctionComponent<{\n children?: ComponentChild;\n}> = ({ children }) => {\n useEditor();\n\n return children;\n};\n","import configuration from '@intlayer/config/built';\nimport { localeResolver } from '@intlayer/core/localization';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport {\n type ComponentChild,\n createContext,\n type FunctionComponent,\n} from 'preact';\nimport { useContext, useEffect, useState } from 'preact/hooks';\nimport { EditorProvider } from '../editor/EditorProvider';\nimport { localeInStorage, setLocaleInStorage } from './useLocaleStorage';\n\ntype IntlayerValue = {\n locale: LocalesValues;\n setLocale: (newLocale: LocalesValues) => void;\n isCookieEnabled?: boolean;\n};\n\n/**\n * Context that store the current locale on the client side\n */\nexport const IntlayerClientContext = createContext<IntlayerValue>({\n locale: localeInStorage ?? configuration?.internationalization?.defaultLocale,\n setLocale: () => null,\n});\n\n/**\n * Hook that provides the current locale\n */\nexport const useIntlayerContext = () => useContext(IntlayerClientContext);\n\nexport type IntlayerProviderProps = {\n children?: ComponentChild;\n locale?: LocalesValues;\n defaultLocale?: LocalesValues;\n setLocale?: (locale: LocalesValues) => void;\n isCookieEnabled?: boolean;\n};\n\n/**\n * Provider that store the current locale on the client side\n */\nexport const IntlayerProviderContent: FunctionComponent<\n IntlayerProviderProps\n> = ({\n locale: localeProp,\n defaultLocale: defaultLocaleProp,\n children,\n setLocale: setLocaleProp,\n isCookieEnabled,\n}) => {\n const { internationalization } = configuration ?? {};\n const { defaultLocale: defaultLocaleConfig, locales: availableLocales } =\n internationalization ?? {};\n\n const defaultLocale =\n localeProp ?? localeInStorage ?? defaultLocaleProp ?? defaultLocaleConfig;\n\n const [currentLocale, setCurrentLocale] = useState<LocalesValues>(\n defaultLocale as LocalesValues\n );\n\n useEffect(() => {\n if (localeProp && localeProp !== currentLocale) {\n setCurrentLocale(localeProp);\n }\n }, [localeProp, currentLocale, setCurrentLocale]);\n\n const setLocaleBase = (newLocale: LocalesValues) => {\n if (currentLocale.toString() === newLocale.toString()) return;\n\n if (!availableLocales?.map(String).includes(newLocale)) {\n console.error(`Locale ${newLocale} is not available`);\n return;\n }\n\n setCurrentLocale(newLocale); // Update state\n setLocaleInStorage(newLocale, isCookieEnabled ?? true); // Optionally set cookie for persistence\n };\n\n const setLocale = setLocaleProp ?? setLocaleBase;\n\n const resolvedLocale = localeResolver(localeProp ?? currentLocale);\n\n return (\n <IntlayerClientContext.Provider\n value={{\n locale: resolvedLocale,\n setLocale,\n isCookieEnabled,\n }}\n >\n {children}\n </IntlayerClientContext.Provider>\n );\n};\n\n/**\n * Main provider for Intlayer in Preact applications.\n *\n * It provides the Intlayer context to your application, allowing the use\n * of hooks like `useIntlayer` and `useLocale`.\n *\n * @param props - The provider props.\n * @returns The provider component.\n *\n * @example\n * ```tsx\n * import { IntlayerProvider } from 'preact-intlayer';\n *\n * const App = () => (\n * <IntlayerProvider>\n * <MyComponent />\n * </IntlayerProvider>\n * );\n * ```\n */\nexport const IntlayerProvider: FunctionComponent<IntlayerProviderProps> = ({\n children,\n ...props\n}) => (\n <IntlayerProviderContent {...props}>\n <EditorProvider />\n {children}\n </IntlayerProviderContent>\n);\n"],"mappings":"iuBAWA,MAAa,MAAkB,CAC7B,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsB,EAAsB,CAC9C,GAAA,EAAA,EAAA,QAA+C,KAAK,EAE1D,EAAA,EAAA,eAAgB,CACV,aAAQ,IAAI,0BAA4B,SAAW,CAACA,EAAAA,WASxD,OAPA,OAAO,oBAAoB,MAAM,CAAE,sBAAuB,CACxD,IAAM,EAAU,GAAkB,CAClC,EAAW,QAAU,EAEjB,GAAQ,EAAQ,cAAc,IAAI,EAAiB,EACvD,KAEW,CACX,EAAW,QAAU,KACrB,OAAO,oBAAoB,MAAM,CAAE,sBAAuB,CACxD,GAAkB,EAClB,GAEH,EAAE,CAAC,EAEN,EAAA,EAAA,eAAgB,CACV,CAAC,GAAU,CAAC,EAAW,SAE3B,EAAW,QAAQ,cAAc,IAAI,EAAiB,EACrD,CAAC,EAAO,CAAC,EClCD,GAEP,CAAE,eACN,GAAW,CAEJ,GCaI,GAAA,EAAA,EAAA,eAAqD,CAChE,OAAQC,EAAAA,iBAAmBC,EAAAA,SAAe,sBAAsB,cAChE,cAAiB,KAClB,CAAC,CAKW,OAAA,EAAA,EAAA,YAAsC,EAAsB,CAa5D,GAER,CACH,OAAQ,EACR,cAAe,EACf,WACA,UAAW,EACX,qBACI,CACJ,GAAM,CAAE,wBAAyBA,EAAAA,SAAiB,EAAE,CAC9C,CAAE,cAAe,EAAqB,QAAS,GACnD,GAAwB,EAAE,CAKtB,CAAC,EAAe,IAAA,EAAA,EAAA,UAFpB,GAAcD,EAAAA,iBAAmB,GAAqB,EAIvD,EAED,EAAA,EAAA,eAAgB,CACV,GAAc,IAAe,GAC/B,EAAiB,EAAW,EAE7B,CAAC,EAAY,EAAe,EAAiB,CAAC,CAcjD,IAAM,EAAY,IAZK,GAA6B,CAC9C,KAAc,UAAU,GAAK,EAAU,UAAU,CAErD,IAAI,CAAC,GAAkB,IAAI,OAAO,CAAC,SAAS,EAAU,CAAE,CACtD,QAAQ,MAAM,UAAU,EAAU,mBAAmB,CACrD,OAGF,EAAiB,EAAU,CAC3B,EAAA,mBAAmB,EAAW,GAAmB,GAAK,IAKlD,GAAA,EAAA,EAAA,gBAAgC,GAAc,EAAc,CAElE,OACE,EAAA,EAAA,KAAC,EAAsB,SAAvB,CACE,MAAO,CACL,OAAQ,EACR,YACA,kBACD,CAEA,WAC8B,CAAA,EAwBxB,GAA8D,CACzE,WACA,GAAG,MAEH,EAAA,EAAA,MAAC,EAAD,CAAyB,GAAI,WAA7B,EACE,EAAA,EAAA,KAAC,EAAD,EAAkB,CAAA,CACjB,EACuB"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`preact/hooks`),t=require(`preact/jsx-runtime`);const n=({children:n,onPress:r,onHover:i,onUnhover:a,onClickOutside:o,pressDuration:s=250,isSelecting:c,...l})=>{let u=(0,e.useRef)(null),[d,f]=(0,e.useState)(!1),[p,m]=(0,e.useState)(c),h=(0,e.useRef)(null),g=typeof n==`string`,_=()=>{m(!0),r()},v=()=>{h.current=setTimeout(()=>{_()},s)},y=()=>{h.current&&=(clearTimeout(h.current),null)},b=()=>{y(),v()},x=()=>{f(!0),i?.()},S=()=>{d&&(f(!1),a?.()),y()},C=(0,e.useCallback)(e=>{u.current&&!u.current.contains(e.target)&&(m(!1),o?.())},[o]);return(0,e.useEffect)(()=>(document.addEventListener(`mousedown`,C),()=>{document.removeEventListener(`mousedown`,C)}),[C]),(0,t.jsx)(`span`,{style:{display:g?`inline`:`inline-block`,cursor:`pointer`,userSelect:`none`,borderRadius:`0.375rem`,outlineWidth:`2px`,outlineOffset:`4px`,outlineStyle:`solid`,outlineColor:c||p||d?`inherit`:`transparent`,transition:`all 100ms 50ms ease-in-out`},role:`button`,tabIndex:0,onKeyUp:()=>null,onClick:e=>{p&&(e.preventDefault(),e.stopPropagation())},onMouseDown:b,onMouseUp:S,onMouseLeave:S,onTouchStart:b,onTouchEnd:S,onTouchCancel:S,onBlur:()=>{m(!1)},onMouseEnter:x,ref:u,...l,children:n})};exports.ContentSelector=n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../IntlayerProvider-sM1gzsx7.cjs`);let e=require(`preact/hooks`),t=require(`preact/jsx-runtime`);const n=({children:n,onPress:r,onHover:i,onUnhover:a,onClickOutside:o,pressDuration:s=250,isSelecting:c,...l})=>{let u=(0,e.useRef)(null),[d,f]=(0,e.useState)(!1),[p,m]=(0,e.useState)(c),h=(0,e.useRef)(null),g=typeof n==`string`,_=()=>{m(!0),r()},v=()=>{h.current=setTimeout(()=>{_()},s)},y=()=>{h.current&&=(clearTimeout(h.current),null)},b=()=>{y(),v()},x=()=>{f(!0),i?.()},S=()=>{d&&(f(!1),a?.()),y()},C=(0,e.useCallback)(e=>{u.current&&!u.current.contains(e.target)&&(m(!1),o?.())},[o]);return(0,e.useEffect)(()=>(document.addEventListener(`mousedown`,C),()=>{document.removeEventListener(`mousedown`,C)}),[C]),(0,t.jsx)(`span`,{style:{display:g?`inline`:`inline-block`,cursor:`pointer`,userSelect:`none`,borderRadius:`0.375rem`,outlineWidth:`2px`,outlineOffset:`4px`,outlineStyle:`solid`,outlineColor:c||p||d?`inherit`:`transparent`,transition:`all 100ms 50ms ease-in-out`},role:`button`,tabIndex:0,onKeyUp:()=>null,onClick:e=>{p&&(e.preventDefault(),e.stopPropagation())},onMouseDown:b,onMouseUp:S,onMouseLeave:S,onTouchStart:b,onTouchEnd:S,onTouchCancel:S,onBlur:()=>{m(!1)},onMouseEnter:x,ref:u,...l,children:n})};exports.ContentSelector=n;
2
2
  //# sourceMappingURL=ContentSelector.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContentSelector.cjs","names":[],"sources":["../../../src/UI/ContentSelector.tsx"],"sourcesContent":["import type { FunctionalComponent, JSX } from 'preact';\nimport { useCallback, useEffect, useRef, useState } from 'preact/hooks';\n\nconst DEFAULT_PRESS_DETECT_DURATION = 250;\n\ntype ContentSelectorProps = {\n onPress: () => void;\n onHover?: () => void;\n onUnhover?: () => void;\n onClickOutside?: () => void;\n pressDuration?: number;\n isSelecting?: boolean;\n} & Omit<JSX.HTMLAttributes<HTMLDivElement>, 'content'>;\n\nexport const ContentSelector: FunctionalComponent<ContentSelectorProps> = ({\n children,\n onPress: onSelect,\n onHover,\n onUnhover,\n onClickOutside: onUnselect,\n pressDuration = DEFAULT_PRESS_DETECT_DURATION,\n isSelecting: isSelectingProp,\n ...props\n}) => {\n const divRef = useRef<HTMLDivElement>(null);\n const [isHovered, setIsHovered] = useState(false);\n const [isSelectingState, setIsSelectingState] = useState(isSelectingProp);\n const pressTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const isChildrenString = typeof children === 'string';\n\n const handleOnLongPress = () => {\n setIsSelectingState(true);\n onSelect();\n };\n\n const startPressTimer = () => {\n pressTimerRef.current = setTimeout(() => {\n handleOnLongPress();\n }, pressDuration);\n };\n\n const clearPressTimer = () => {\n if (pressTimerRef.current) {\n clearTimeout(pressTimerRef.current);\n pressTimerRef.current = null;\n }\n };\n\n const handleMouseDown = () => {\n clearPressTimer(); // Ensure any previous timer is cleared\n startPressTimer();\n };\n\n const handleMouseEnter = () => {\n setIsHovered(true);\n onHover?.();\n };\n\n const handleMouseUp = () => {\n if (isHovered) {\n setIsHovered(false);\n onUnhover?.();\n }\n clearPressTimer();\n };\n\n // Use useCallback to ensure the function identity remains stable\n const handleClickOutside = useCallback(\n (event: MouseEvent) => {\n if (divRef.current && !divRef.current.contains(event.target as Node)) {\n setIsSelectingState(false);\n onUnselect?.();\n }\n },\n [onUnselect]\n );\n\n useEffect(() => {\n // Attach click outside listener\n document.addEventListener('mousedown', handleClickOutside);\n\n return () => {\n // Cleanup\n document.removeEventListener('mousedown', handleClickOutside);\n // clearPressTimer(); // Ensure to clear the timer when component unmounts\n };\n }, [handleClickOutside]);\n\n const handleOnClick: JSX.MouseEventHandler<HTMLDivElement> = (e) => {\n if (isSelectingState) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const handleOnBlur = () => {\n // Stop editing when the element loses focus\n setIsSelectingState(false);\n };\n\n return (\n <span\n style={{\n display: isChildrenString ? 'inline' : 'inline-block',\n cursor: 'pointer',\n userSelect: 'none',\n borderRadius: '0.375rem',\n outlineWidth: '2px',\n outlineOffset: '4px',\n outlineStyle: 'solid',\n outlineColor:\n isSelectingProp || isSelectingState || isHovered\n ? 'inherit'\n : 'transparent',\n transition: 'all 100ms 50ms ease-in-out',\n }}\n role=\"button\"\n tabIndex={0}\n onKeyUp={() => null}\n onClick={handleOnClick}\n onMouseDown={handleMouseDown}\n onMouseUp={handleMouseUp}\n onMouseLeave={handleMouseUp}\n onTouchStart={handleMouseDown}\n onTouchEnd={handleMouseUp}\n onTouchCancel={handleMouseUp}\n onBlur={handleOnBlur}\n onMouseEnter={handleMouseEnter}\n ref={divRef}\n {...props}\n >\n {children}\n </span>\n );\n};\n"],"mappings":"8KAGA,MAWa,GAA8D,CACzE,WACA,QAAS,EACT,UACA,YACA,eAAgB,EAChB,gBAAgB,IAChB,YAAa,EACb,GAAG,KACC,CACJ,IAAM,GAAA,EAAA,EAAA,QAAgC,KAAK,CACrC,CAAC,EAAW,IAAA,EAAA,EAAA,UAAyB,GAAM,CAC3C,CAAC,EAAkB,IAAA,EAAA,EAAA,UAAgC,EAAgB,CACnE,GAAA,EAAA,EAAA,QAA6D,KAAK,CAClE,EAAmB,OAAO,GAAa,SAEvC,MAA0B,CAC9B,EAAoB,GAAK,CACzB,GAAU,EAGN,MAAwB,CAC5B,EAAc,QAAU,eAAiB,CACvC,GAAmB,EAClB,EAAc,EAGb,MAAwB,CAC5B,AAEE,EAAc,WADd,aAAa,EAAc,QAAQ,CACX,OAItB,MAAwB,CAC5B,GAAiB,CACjB,GAAiB,EAGb,MAAyB,CAC7B,EAAa,GAAK,CAClB,KAAW,EAGP,MAAsB,CACtB,IACF,EAAa,GAAM,CACnB,KAAa,EAEf,GAAiB,EAIb,GAAA,EAAA,EAAA,aACH,GAAsB,CACjB,EAAO,SAAW,CAAC,EAAO,QAAQ,SAAS,EAAM,OAAe,GAClE,EAAoB,GAAM,CAC1B,KAAc,GAGlB,CAAC,EAAW,CACb,CAyBD,OAvBA,EAAA,EAAA,gBAEE,SAAS,iBAAiB,YAAa,EAAmB,KAE7C,CAEX,SAAS,oBAAoB,YAAa,EAAmB,GAG9D,CAAC,EAAmB,CAAC,EAetB,EAAA,EAAA,KAAC,OAAD,CACE,MAAO,CACL,QAAS,EAAmB,SAAW,eACvC,OAAQ,UACR,WAAY,OACZ,aAAc,WACd,aAAc,MACd,cAAe,MACf,aAAc,QACd,aACE,GAAmB,GAAoB,EACnC,UACA,cACN,WAAY,6BACb,CACD,KAAK,SACL,SAAU,EACV,YAAe,KACf,QA/B0D,GAAM,CAC9D,IACF,EAAE,gBAAgB,CAClB,EAAE,iBAAiB,GA6BnB,YAAa,EACb,UAAW,EACX,aAAc,EACd,aAAc,EACd,WAAY,EACZ,cAAe,EACf,WA/BuB,CAEzB,EAAoB,GAAM,EA8BxB,aAAc,EACd,IAAK,EACL,GAAI,EAEH,WACI,CAAA"}
1
+ {"version":3,"file":"ContentSelector.cjs","names":[],"sources":["../../../src/UI/ContentSelector.tsx"],"sourcesContent":["import type { FunctionalComponent, JSX } from 'preact';\nimport { useCallback, useEffect, useRef, useState } from 'preact/hooks';\n\nconst DEFAULT_PRESS_DETECT_DURATION = 250;\n\ntype ContentSelectorProps = {\n onPress: () => void;\n onHover?: () => void;\n onUnhover?: () => void;\n onClickOutside?: () => void;\n pressDuration?: number;\n isSelecting?: boolean;\n} & Omit<JSX.HTMLAttributes<HTMLDivElement>, 'content'>;\n\nexport const ContentSelector: FunctionalComponent<ContentSelectorProps> = ({\n children,\n onPress: onSelect,\n onHover,\n onUnhover,\n onClickOutside: onUnselect,\n pressDuration = DEFAULT_PRESS_DETECT_DURATION,\n isSelecting: isSelectingProp,\n ...props\n}) => {\n const divRef = useRef<HTMLDivElement>(null);\n const [isHovered, setIsHovered] = useState(false);\n const [isSelectingState, setIsSelectingState] = useState(isSelectingProp);\n const pressTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const isChildrenString = typeof children === 'string';\n\n const handleOnLongPress = () => {\n setIsSelectingState(true);\n onSelect();\n };\n\n const startPressTimer = () => {\n pressTimerRef.current = setTimeout(() => {\n handleOnLongPress();\n }, pressDuration);\n };\n\n const clearPressTimer = () => {\n if (pressTimerRef.current) {\n clearTimeout(pressTimerRef.current);\n pressTimerRef.current = null;\n }\n };\n\n const handleMouseDown = () => {\n clearPressTimer(); // Ensure any previous timer is cleared\n startPressTimer();\n };\n\n const handleMouseEnter = () => {\n setIsHovered(true);\n onHover?.();\n };\n\n const handleMouseUp = () => {\n if (isHovered) {\n setIsHovered(false);\n onUnhover?.();\n }\n clearPressTimer();\n };\n\n // Use useCallback to ensure the function identity remains stable\n const handleClickOutside = useCallback(\n (event: MouseEvent) => {\n if (divRef.current && !divRef.current.contains(event.target as Node)) {\n setIsSelectingState(false);\n onUnselect?.();\n }\n },\n [onUnselect]\n );\n\n useEffect(() => {\n // Attach click outside listener\n document.addEventListener('mousedown', handleClickOutside);\n\n return () => {\n // Cleanup\n document.removeEventListener('mousedown', handleClickOutside);\n // clearPressTimer(); // Ensure to clear the timer when component unmounts\n };\n }, [handleClickOutside]);\n\n const handleOnClick: JSX.MouseEventHandler<HTMLDivElement> = (e) => {\n if (isSelectingState) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const handleOnBlur = () => {\n // Stop editing when the element loses focus\n setIsSelectingState(false);\n };\n\n return (\n <span\n style={{\n display: isChildrenString ? 'inline' : 'inline-block',\n cursor: 'pointer',\n userSelect: 'none',\n borderRadius: '0.375rem',\n outlineWidth: '2px',\n outlineOffset: '4px',\n outlineStyle: 'solid',\n outlineColor:\n isSelectingProp || isSelectingState || isHovered\n ? 'inherit'\n : 'transparent',\n transition: 'all 100ms 50ms ease-in-out',\n }}\n role=\"button\"\n tabIndex={0}\n onKeyUp={() => null}\n onClick={handleOnClick}\n onMouseDown={handleMouseDown}\n onMouseUp={handleMouseUp}\n onMouseLeave={handleMouseUp}\n onTouchStart={handleMouseDown}\n onTouchEnd={handleMouseUp}\n onTouchCancel={handleMouseUp}\n onBlur={handleOnBlur}\n onMouseEnter={handleMouseEnter}\n ref={divRef}\n {...props}\n >\n {children}\n </span>\n );\n};\n"],"mappings":"6KAGA,MAWa,GAA8D,CACzE,WACA,QAAS,EACT,UACA,YACA,eAAgB,EAChB,gBAAgB,IAChB,YAAa,EACb,GAAG,KACC,CACJ,IAAM,GAAA,EAAA,EAAA,QAAgC,KAAK,CACrC,CAAC,EAAW,IAAA,EAAA,EAAA,UAAyB,GAAM,CAC3C,CAAC,EAAkB,IAAA,EAAA,EAAA,UAAgC,EAAgB,CACnE,GAAA,EAAA,EAAA,QAA6D,KAAK,CAClE,EAAmB,OAAO,GAAa,SAEvC,MAA0B,CAC9B,EAAoB,GAAK,CACzB,GAAU,EAGN,MAAwB,CAC5B,EAAc,QAAU,eAAiB,CACvC,GAAmB,EAClB,EAAc,EAGb,MAAwB,CAC5B,AAEE,EAAc,WADd,aAAa,EAAc,QAAQ,CACX,OAItB,MAAwB,CAC5B,GAAiB,CACjB,GAAiB,EAGb,MAAyB,CAC7B,EAAa,GAAK,CAClB,KAAW,EAGP,MAAsB,CACtB,IACF,EAAa,GAAM,CACnB,KAAa,EAEf,GAAiB,EAIb,GAAA,EAAA,EAAA,aACH,GAAsB,CACjB,EAAO,SAAW,CAAC,EAAO,QAAQ,SAAS,EAAM,OAAe,GAClE,EAAoB,GAAM,CAC1B,KAAc,GAGlB,CAAC,EAAW,CACb,CAyBD,OAvBA,EAAA,EAAA,gBAEE,SAAS,iBAAiB,YAAa,EAAmB,KAE7C,CAEX,SAAS,oBAAoB,YAAa,EAAmB,GAG9D,CAAC,EAAmB,CAAC,EAetB,EAAA,EAAA,KAAC,OAAD,CACE,MAAO,CACL,QAAS,EAAmB,SAAW,eACvC,OAAQ,UACR,WAAY,OACZ,aAAc,WACd,aAAc,MACd,cAAe,MACf,aAAc,QACd,aACE,GAAmB,GAAoB,EACnC,UACA,cACN,WAAY,6BACb,CACD,KAAK,SACL,SAAU,EACV,YAAe,KACf,QA/B0D,GAAM,CAC9D,IACF,EAAE,gBAAgB,CAClB,EAAE,iBAAiB,GA6BnB,YAAa,EACb,UAAW,EACX,aAAc,EACd,aAAc,EACd,WAAY,EACZ,cAAe,EACf,WA/BuB,CAEzB,EAAoB,GAAM,EA8BxB,aAAc,EACd,IAAK,EACL,GAAI,EAEH,WACI,CAAA"}
@@ -1,2 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../editor/EditorProvider.cjs`),n=require(`./useLocaleStorage.cjs`);let r=require(`@intlayer/config/built`);r=e.__toESM(r);let i=require(`preact`),a=require(`preact/hooks`),o=require(`preact/jsx-runtime`),s=require(`@intlayer/core/localization`);const c=(0,i.createContext)({locale:n.localeInStorage??r.default?.internationalization?.defaultLocale,setLocale:()=>null}),l=()=>(0,a.useContext)(c),u=({locale:e,defaultLocale:t,children:i,setLocale:l,isCookieEnabled:u})=>{let{internationalization:d}=r.default??{},{defaultLocale:f,locales:p}=d??{},[m,h]=(0,a.useState)(e??n.localeInStorage??t??f);(0,a.useEffect)(()=>{e&&e!==m&&h(e)},[e,m,h]);let g=l??(e=>{if(m.toString()!==e.toString()){if(!p?.map(String).includes(e)){console.error(`Locale ${e} is not available`);return}h(e),n.setLocaleInStorage(e,u??!0)}}),_=(0,s.localeResolver)(e??m);return(0,o.jsx)(c.Provider,{value:{locale:_,setLocale:g,isCookieEnabled:u},children:i})},d=({children:e,...n})=>(0,o.jsxs)(u,{...n,children:[(0,o.jsx)(t.EditorProvider,{}),e]});exports.IntlayerClientContext=c,exports.IntlayerProvider=d,exports.IntlayerProviderContent=u,exports.useIntlayerContext=l;
2
- //# sourceMappingURL=IntlayerProvider.cjs.map
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../IntlayerProvider-sM1gzsx7.cjs`);exports.IntlayerClientContext=e.t,exports.IntlayerProvider=e.n,exports.IntlayerProviderContent=e.r,exports.useIntlayerContext=e.i;
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../IntlayerProvider.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=()=>{let{locale:r}=(0,t.useContext)(e.IntlayerClientContext);return(0,t.useCallback)((...e)=>(0,n.compact)(e[0],{...e[1],locale:e[1]?.locale??r}),[r])};exports.useCompact=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../IntlayerProvider-sM1gzsx7.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=()=>{let{locale:r}=(0,t.useContext)(e.t);return(0,t.useCallback)((...e)=>(0,n.compact)(e[0],{...e[1],locale:e[1]?.locale??r}),[r])};exports.useCompact=r;
2
2
  //# sourceMappingURL=useCompact.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCompact.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useCompact.ts"],"sourcesContent":["import { compact } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a compact number formatter\n * bound to the current application locale.\n *\n * @example\n * ```tsx\n * const formatCompact = useCompact();\n * formatCompact(1500); // \"1.5K\"\n * ```\n */\nexport const useCompact = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof compact>) =>\n compact(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":"mOAcA,MAAa,MAAmB,CAC9B,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,sBAAsB,CAEpD,OAAA,EAAA,EAAA,cACG,GAAG,KAAA,EAAA,EAAA,SACM,EAAK,GAAI,CACf,GAAG,EAAK,GACR,OAAQ,EAAK,IAAI,QAAU,EAC5B,CAAC,CACJ,CAAC,EAAO,CACT"}
1
+ {"version":3,"file":"useCompact.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useCompact.ts"],"sourcesContent":["import { compact } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a compact number formatter\n * bound to the current application locale.\n *\n * @example\n * ```tsx\n * const formatCompact = useCompact();\n * formatCompact(1500); // \"1.5K\"\n * ```\n */\nexport const useCompact = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof compact>) =>\n compact(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":"+LAcA,MAAa,MAAmB,CAC9B,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,EAAsB,CAEpD,OAAA,EAAA,EAAA,cACG,GAAG,KAAA,EAAA,EAAA,SACM,EAAK,GAAI,CACf,GAAG,EAAK,GACR,OAAQ,EAAK,IAAI,QAAU,EAC5B,CAAC,CACJ,CAAC,EAAO,CACT"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../IntlayerProvider.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=()=>{let{locale:r}=(0,t.useContext)(e.IntlayerClientContext);return(0,t.useCallback)((...e)=>(0,n.currency)(e[0],{...e[1],locale:e[1]?.locale??r}),[r])};exports.useCurrency=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../IntlayerProvider-sM1gzsx7.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=()=>{let{locale:r}=(0,t.useContext)(e.t);return(0,t.useCallback)((...e)=>(0,n.currency)(e[0],{...e[1],locale:e[1]?.locale??r}),[r])};exports.useCurrency=r;
2
2
  //# sourceMappingURL=useCurrency.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrency.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useCurrency.ts"],"sourcesContent":["import { currency } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a currency formatter\n * bound to the current application locale.\n *\n * @returns {(value: string | number, options?: CurrencyProps) => string}\n * A function to format numbers into localized currency strings.\n *\n * @example\n * ```tsx\n * const formatCurrency = useCurrency();\n *\n * formatCurrency(1500, { currency: \"USD\" });\n * // \"$1,500.00\"\n *\n * formatCurrency(1500, { currency: \"EUR\", locale: \"de-DE\" });\n * // \"1.500,00 €\"\n *\n * formatCurrency(9876543.21, {\n * currency: \"JPY\",\n * fractionDigits: 0,\n * });\n * // \"¥9,876,543\"\n * ```\n */\nexport const useCurrency = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof currency>) =>\n currency(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":"mOA4BA,MAAa,MAAoB,CAC/B,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,sBAAsB,CAEpD,OAAA,EAAA,EAAA,cACG,GAAG,KAAA,EAAA,EAAA,UACO,EAAK,GAAI,CAChB,GAAG,EAAK,GACR,OAAQ,EAAK,IAAI,QAAU,EAC5B,CAAC,CACJ,CAAC,EAAO,CACT"}
1
+ {"version":3,"file":"useCurrency.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useCurrency.ts"],"sourcesContent":["import { currency } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a currency formatter\n * bound to the current application locale.\n *\n * @returns {(value: string | number, options?: CurrencyProps) => string}\n * A function to format numbers into localized currency strings.\n *\n * @example\n * ```tsx\n * const formatCurrency = useCurrency();\n *\n * formatCurrency(1500, { currency: \"USD\" });\n * // \"$1,500.00\"\n *\n * formatCurrency(1500, { currency: \"EUR\", locale: \"de-DE\" });\n * // \"1.500,00 €\"\n *\n * formatCurrency(9876543.21, {\n * currency: \"JPY\",\n * fractionDigits: 0,\n * });\n * // \"¥9,876,543\"\n * ```\n */\nexport const useCurrency = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof currency>) =>\n currency(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":"+LA4BA,MAAa,MAAoB,CAC/B,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,EAAsB,CAEpD,OAAA,EAAA,EAAA,cACG,GAAG,KAAA,EAAA,EAAA,UACO,EAAK,GAAI,CAChB,GAAG,EAAK,GACR,OAAQ,EAAK,IAAI,QAAU,EAC5B,CAAC,CACJ,CAAC,EAAO,CACT"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../IntlayerProvider.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=()=>{let{locale:r}=(0,t.useContext)(e.IntlayerClientContext);return(...e)=>(0,n.date)(e[0],{...e[1],locale:e[1]?.locale??r})};exports.useDate=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../IntlayerProvider-sM1gzsx7.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=()=>{let{locale:r}=(0,t.useContext)(e.t);return(...e)=>(0,n.date)(e[0],{...e[1],locale:e[1]?.locale??r})};exports.useDate=r;
2
2
  //# sourceMappingURL=useDate.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDate.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useDate.ts"],"sourcesContent":["import { date } from '@intlayer/core/formatters';\nimport { useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a localized date/time formatter\n * bound to the current application locale.\n *\n * @returns {(date: Date | string | number, options?: DateProps) => string}\n * A function to format dates or timestamps into localized date/time strings.\n *\n * @example\n * ```tsx\n * const formatDate = useDate();\n *\n * formatDate(new Date(\"2025-01-01\"));\n * // \"Jan 1, 2025\"\n *\n * formatDate(\"2025-01-01T15:30:00Z\", {\n * dateStyle: \"full\",\n * timeStyle: \"short\",\n * });\n * // \"Wednesday, January 1, 2025 at 3:30 PM\"\n *\n * formatDate(1735689600000, { locale: \"fr-FR\", dateStyle: \"long\" });\n * // \"1 janvier 2025\"\n * ```\n *\n * @see createDate\n */\nexport const useDate = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return (...args: Parameters<typeof date>) =>\n date(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":"mOA8BA,MAAa,MAAgB,CAC3B,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,sBAAsB,CAEpD,OAAQ,GAAG,KAAA,EAAA,EAAA,MACJ,EAAK,GAAI,CACZ,GAAG,EAAK,GACR,OAAQ,EAAK,IAAI,QAAU,EAC5B,CAAC"}
1
+ {"version":3,"file":"useDate.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useDate.ts"],"sourcesContent":["import { date } from '@intlayer/core/formatters';\nimport { useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a localized date/time formatter\n * bound to the current application locale.\n *\n * @returns {(date: Date | string | number, options?: DateProps) => string}\n * A function to format dates or timestamps into localized date/time strings.\n *\n * @example\n * ```tsx\n * const formatDate = useDate();\n *\n * formatDate(new Date(\"2025-01-01\"));\n * // \"Jan 1, 2025\"\n *\n * formatDate(\"2025-01-01T15:30:00Z\", {\n * dateStyle: \"full\",\n * timeStyle: \"short\",\n * });\n * // \"Wednesday, January 1, 2025 at 3:30 PM\"\n *\n * formatDate(1735689600000, { locale: \"fr-FR\", dateStyle: \"long\" });\n * // \"1 janvier 2025\"\n * ```\n *\n * @see createDate\n */\nexport const useDate = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return (...args: Parameters<typeof date>) =>\n date(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":"+LA8BA,MAAa,MAAgB,CAC3B,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,EAAsB,CAEpD,OAAQ,GAAG,KAAA,EAAA,EAAA,MACJ,EAAK,GAAI,CACZ,GAAG,EAAK,GACR,OAAQ,EAAK,IAAI,QAAU,EAC5B,CAAC"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../IntlayerProvider.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=r=>{let{locale:i}=(0,t.useContext)(e.IntlayerClientContext),a=r??i;return(0,t.useMemo)(()=>(0,n.bindIntl)(a),[a])};exports.useIntl=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../IntlayerProvider-sM1gzsx7.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=r=>{let{locale:i}=(0,t.useContext)(e.t),a=r??i;return(0,t.useMemo)(()=>(0,n.bindIntl)(a),[a])};exports.useIntl=r;
2
2
  //# sourceMappingURL=useIntl.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIntl.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useIntl.ts"],"sourcesContent":["import { bindIntl } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * Preact client hook that provides a locale-bound `Intl` object.\n *\n * It acts exactly like the native `Intl` object, but acts as a proxy to:\n * 1. Inject the current locale automatically if none is provided.\n * 2. Use the performance-optimized `CachedIntl` under the hood.\n *\n * @example\n * ```tsx\n * const intl = useIntl(); // uses context locale\n *\n * // Standard API, but no need to pass locale as the first argument\n * const formatted = new intl.NumberFormat({\n * style: 'currency',\n * currency: 'USD'\n * }).format(123.45);\n * ```\n */\nexport const useIntl = (locale?: LocalesValues) => {\n const { locale: contextLocale } = useContext(IntlayerClientContext);\n const currentLocale = locale ?? contextLocale;\n\n return useMemo(() => bindIntl(currentLocale), [currentLocale]);\n};\n"],"mappings":"mOAuBA,MAAa,EAAW,GAA2B,CACjD,GAAM,CAAE,OAAQ,IAAA,EAAA,EAAA,YAA6BA,EAAAA,sBAAsB,CAC7D,EAAgB,GAAU,EAEhC,OAAA,EAAA,EAAA,cAAA,EAAA,EAAA,UAA8B,EAAc,CAAE,CAAC,EAAc,CAAC"}
1
+ {"version":3,"file":"useIntl.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useIntl.ts"],"sourcesContent":["import { bindIntl, type WrappedIntl } from '@intlayer/core/formatters';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * Preact client hook that provides a locale-bound `Intl` object.\n *\n * It acts exactly like the native `Intl` object, but acts as a proxy to:\n * 1. Inject the current locale automatically if none is provided.\n * 2. Use the performance-optimized `CachedIntl` under the hood.\n *\n * @example\n * ```tsx\n * const intl = useIntl(); // uses context locale\n *\n * // Standard API, but no need to pass locale as the first argument\n * const formatted = new intl.NumberFormat({\n * style: 'currency',\n * currency: 'USD'\n * }).format(123.45);\n * ```\n */\nexport const useIntl = (locale?: LocalesValues) => {\n const { locale: contextLocale } = useContext(IntlayerClientContext);\n const currentLocale = locale ?? contextLocale;\n\n return useMemo<WrappedIntl>(() => bindIntl(currentLocale), [currentLocale]);\n};\n"],"mappings":"+LAuBA,MAAa,EAAW,GAA2B,CACjD,GAAM,CAAE,OAAQ,IAAA,EAAA,EAAA,YAA6BA,EAAAA,EAAsB,CAC7D,EAAgB,GAAU,EAEhC,OAAA,EAAA,EAAA,cAAA,EAAA,EAAA,UAA2C,EAAc,CAAE,CAAC,EAAc,CAAC"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../IntlayerProvider.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=()=>{let{locale:r}=(0,t.useContext)(e.IntlayerClientContext);return(0,t.useCallback)((...e)=>(0,n.list)(e[0],{...e[1],locale:e[1]?.locale??r}),[r])};exports.useList=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../IntlayerProvider-sM1gzsx7.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=()=>{let{locale:r}=(0,t.useContext)(e.t);return(0,t.useCallback)((...e)=>(0,n.list)(e[0],{...e[1],locale:e[1]?.locale??r}),[r])};exports.useList=r;
2
2
  //# sourceMappingURL=useList.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useList.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useList.ts"],"sourcesContent":["import { list } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a list formatter\n * bound to the current application locale.\n *\n * @returns {(values: (string | number)[], options?: ListProps) => string}\n * A function to format arrays into localized list strings.\n *\n * @example\n * ```tsx\n * const formatList = useList();\n *\n * formatList(['apple', 'banana', 'orange']);\n * // \"apple, banana, and orange\"\n *\n * formatList(['red', 'green', 'blue'], { type: 'disjunction' });\n * // \"red, green, or blue\"\n *\n * formatList([1, 2, 3], { type: 'unit', locale: 'de-DE' });\n * // \"1, 2 und 3\"\n * ```\n */\nexport const useList = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof list>) =>\n list(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":"mOAyBA,MAAa,MAAgB,CAC3B,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,sBAAsB,CAEpD,OAAA,EAAA,EAAA,cACG,GAAG,KAAA,EAAA,EAAA,MACG,EAAK,GAAI,CACZ,GAAG,EAAK,GACR,OAAQ,EAAK,IAAI,QAAU,EAC5B,CAAC,CACJ,CAAC,EAAO,CACT"}
1
+ {"version":3,"file":"useList.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useList.ts"],"sourcesContent":["import { list } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a list formatter\n * bound to the current application locale.\n *\n * @returns {(values: (string | number)[], options?: ListProps) => string}\n * A function to format arrays into localized list strings.\n *\n * @example\n * ```tsx\n * const formatList = useList();\n *\n * formatList(['apple', 'banana', 'orange']);\n * // \"apple, banana, and orange\"\n *\n * formatList(['red', 'green', 'blue'], { type: 'disjunction' });\n * // \"red, green, or blue\"\n *\n * formatList([1, 2, 3], { type: 'unit', locale: 'de-DE' });\n * // \"1, 2 und 3\"\n * ```\n */\nexport const useList = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof list>) =>\n list(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":"+LAyBA,MAAa,MAAgB,CAC3B,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,EAAsB,CAEpD,OAAA,EAAA,EAAA,cACG,GAAG,KAAA,EAAA,EAAA,MACG,EAAK,GAAI,CACZ,GAAG,EAAK,GACR,OAAQ,EAAK,IAAI,QAAU,EAC5B,CAAC,CACJ,CAAC,EAAO,CACT"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../IntlayerProvider.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=()=>{let{locale:r}=(0,t.useContext)(e.IntlayerClientContext);return(0,t.useCallback)((...e)=>(0,n.number)(e[0],{...e[1],locale:e[1]?.locale??r}),[r])};exports.useNumber=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../IntlayerProvider-sM1gzsx7.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=()=>{let{locale:r}=(0,t.useContext)(e.t);return(0,t.useCallback)((...e)=>(0,n.number)(e[0],{...e[1],locale:e[1]?.locale??r}),[r])};exports.useNumber=r;
2
2
  //# sourceMappingURL=useNumber.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useNumber.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useNumber.ts"],"sourcesContent":["import { number } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a localized number formatter.\n *\n * Uses the current locale from {@link useLocaleBase} and returns\n * a function that can be used to format numbers consistently\n * according to the user's locale.\n *\n * @example\n * ```tsx\n * const formatNumber = useNumber();\n *\n * formatNumber(12345);\n * // e.g. \"12,345\" (en-US)\n * // e.g. \"12 345\" (fr-FR)\n *\n * formatNumber(0.75, { style: \"percent\" });\n * // e.g. \"75%\"\n * ```\n *\n * @returns {(value: string | number, options?: import(\"../createNumber\").NumberProps) => string}\n * A number formatting function bound to the active locale.\n */\nexport const useNumber = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof number>) =>\n number(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":"mOA0BA,MAAa,MAAkB,CAC7B,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,sBAAsB,CAEpD,OAAA,EAAA,EAAA,cACG,GAAG,KAAA,EAAA,EAAA,QACK,EAAK,GAAI,CACd,GAAG,EAAK,GACR,OAAQ,EAAK,IAAI,QAAU,EAC5B,CAAC,CACJ,CAAC,EAAO,CACT"}
1
+ {"version":3,"file":"useNumber.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useNumber.ts"],"sourcesContent":["import { number } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React client hook that provides a localized number formatter.\n *\n * Uses the current locale from {@link useLocaleBase} and returns\n * a function that can be used to format numbers consistently\n * according to the user's locale.\n *\n * @example\n * ```tsx\n * const formatNumber = useNumber();\n *\n * formatNumber(12345);\n * // e.g. \"12,345\" (en-US)\n * // e.g. \"12 345\" (fr-FR)\n *\n * formatNumber(0.75, { style: \"percent\" });\n * // e.g. \"75%\"\n * ```\n *\n * @returns {(value: string | number, options?: import(\"../createNumber\").NumberProps) => string}\n * A number formatting function bound to the active locale.\n */\nexport const useNumber = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof number>) =>\n number(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":"+LA0BA,MAAa,MAAkB,CAC7B,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,EAAsB,CAEpD,OAAA,EAAA,EAAA,cACG,GAAG,KAAA,EAAA,EAAA,QACK,EAAK,GAAI,CACd,GAAG,EAAK,GACR,OAAQ,EAAK,IAAI,QAAU,EAC5B,CAAC,CACJ,CAAC,EAAO,CACT"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../IntlayerProvider.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=()=>{let{locale:r}=(0,t.useContext)(e.IntlayerClientContext);return(0,t.useCallback)((...e)=>(0,n.percentage)(e[0],{...e[1],locale:e[1]?.locale??r}),[r])};exports.usePercentage=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../IntlayerProvider-sM1gzsx7.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=()=>{let{locale:r}=(0,t.useContext)(e.t);return(0,t.useCallback)((...e)=>(0,n.percentage)(e[0],{...e[1],locale:e[1]?.locale??r}),[r])};exports.usePercentage=r;
2
2
  //# sourceMappingURL=usePercentage.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePercentage.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/usePercentage.ts"],"sourcesContent":["import { percentage } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React hook to provide a percentage formatter function\n * based on the current application locale.\n *\n * This hook retrieves the active locale using {@link useLocaleBase}\n * and memoizes a `createPercentage` instance for that locale.\n *\n * @example\n * ```tsx\n * const formatPercentage = usePercentage();\n *\n * const result = formatPercentage(0.875, { maximumFractionDigits: 1 });\n * // \"87.5%\" (depending on locale)\n * ```\n *\n * @returns {(value: string | number, options?: Omit<PercentageOptions, \"value\">) => string}\n * A function that formats numbers or numeric strings into localized percentages.\n */\nexport const usePercentage = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof percentage>) =>\n percentage(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":"mOAsBA,MAAa,MAAsB,CACjC,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,sBAAsB,CAEpD,OAAA,EAAA,EAAA,cACG,GAAG,KAAA,EAAA,EAAA,YACS,EAAK,GAAI,CAClB,GAAG,EAAK,GACR,OAAQ,EAAK,IAAI,QAAU,EAC5B,CAAC,CACJ,CAAC,EAAO,CACT"}
1
+ {"version":3,"file":"usePercentage.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/usePercentage.ts"],"sourcesContent":["import { percentage } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React hook to provide a percentage formatter function\n * based on the current application locale.\n *\n * This hook retrieves the active locale using {@link useLocaleBase}\n * and memoizes a `createPercentage` instance for that locale.\n *\n * @example\n * ```tsx\n * const formatPercentage = usePercentage();\n *\n * const result = formatPercentage(0.875, { maximumFractionDigits: 1 });\n * // \"87.5%\" (depending on locale)\n * ```\n *\n * @returns {(value: string | number, options?: Omit<PercentageOptions, \"value\">) => string}\n * A function that formats numbers or numeric strings into localized percentages.\n */\nexport const usePercentage = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof percentage>) =>\n percentage(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":"+LAsBA,MAAa,MAAsB,CACjC,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,EAAsB,CAEpD,OAAA,EAAA,EAAA,cACG,GAAG,KAAA,EAAA,EAAA,YACS,EAAK,GAAI,CAClB,GAAG,EAAK,GACR,OAAQ,EAAK,IAAI,QAAU,EAC5B,CAAC,CACJ,CAAC,EAAO,CACT"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../IntlayerProvider.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=()=>{let{locale:r}=(0,t.useContext)(e.IntlayerClientContext);return(0,t.useCallback)((...e)=>(0,n.relativeTime)(e[0],e[1],{...e[2],locale:e[2]?.locale??r}),[r])};exports.useRelativeTime=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../IntlayerProvider-sM1gzsx7.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=()=>{let{locale:r}=(0,t.useContext)(e.t);return(0,t.useCallback)((...e)=>(0,n.relativeTime)(e[0],e[1],{...e[2],locale:e[2]?.locale??r}),[r])};exports.useRelativeTime=r;
2
2
  //# sourceMappingURL=useRelativeTime.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRelativeTime.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useRelativeTime.ts"],"sourcesContent":["import { relativeTime } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * Client-side React hook for accessing a localized relative time formatter.\n *\n * This hook:\n * - Reads the current locale from {@link useLocaleBase}.\n * - Creates a new relative time formatter with {@link createRelativeTime}.\n * - Returns a function that can format time differences into localized strings.\n *\n * Example:\n * ```tsx\n * const relativeTime = useRelativeTime();\n * const formatted = relativeTime(new Date(\"2024-08-01\"), new Date());\n * // e.g., \"2 weeks ago\"\n * ```\n *\n * @returns {ReturnType<typeof createRelativeTime>} A relative time formatting function\n * bound to the current client locale.\n */\nexport const useRelativeTime = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof relativeTime>) =>\n relativeTime(args[0], args[1], {\n ...args[2],\n locale: args[2]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":"mOAsBA,MAAa,MAAwB,CACnC,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,sBAAsB,CAEpD,OAAA,EAAA,EAAA,cACG,GAAG,KAAA,EAAA,EAAA,cACW,EAAK,GAAI,EAAK,GAAI,CAC7B,GAAG,EAAK,GACR,OAAQ,EAAK,IAAI,QAAU,EAC5B,CAAC,CACJ,CAAC,EAAO,CACT"}
1
+ {"version":3,"file":"useRelativeTime.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useRelativeTime.ts"],"sourcesContent":["import { relativeTime } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * Client-side React hook for accessing a localized relative time formatter.\n *\n * This hook:\n * - Reads the current locale from {@link useLocaleBase}.\n * - Creates a new relative time formatter with {@link createRelativeTime}.\n * - Returns a function that can format time differences into localized strings.\n *\n * Example:\n * ```tsx\n * const relativeTime = useRelativeTime();\n * const formatted = relativeTime(new Date(\"2024-08-01\"), new Date());\n * // e.g., \"2 weeks ago\"\n * ```\n *\n * @returns {ReturnType<typeof createRelativeTime>} A relative time formatting function\n * bound to the current client locale.\n */\nexport const useRelativeTime = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof relativeTime>) =>\n relativeTime(args[0], args[1], {\n ...args[2],\n locale: args[2]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":"+LAsBA,MAAa,MAAwB,CACnC,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,EAAsB,CAEpD,OAAA,EAAA,EAAA,cACG,GAAG,KAAA,EAAA,EAAA,cACW,EAAK,GAAI,EAAK,GAAI,CAC7B,GAAG,EAAK,GACR,OAAQ,EAAK,IAAI,QAAU,EAC5B,CAAC,CACJ,CAAC,EAAO,CACT"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../IntlayerProvider.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=()=>{let{locale:r}=(0,t.useContext)(e.IntlayerClientContext);return(0,t.useCallback)((...e)=>(0,n.units)(e[0],{...e[1],locale:e[1]?.locale??r}),[r])};exports.useUnit=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../IntlayerProvider-sM1gzsx7.cjs`);let t=require(`preact/hooks`),n=require(`@intlayer/core/formatters`);const r=()=>{let{locale:r}=(0,t.useContext)(e.t);return(0,t.useCallback)((...e)=>(0,n.units)(e[0],{...e[1],locale:e[1]?.locale??r}),[r])};exports.useUnit=r;
2
2
  //# sourceMappingURL=useUnit.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useUnit.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useUnit.ts"],"sourcesContent":["import { units } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React hook that provides a unit formatting function\n * based on the current locale from {@link useLocaleBase}.\n *\n * This hook wraps {@link createUnit} to return a formatter\n * that can convert values into human-readable localized units\n * (e.g., \"10 km\", \"5 lbs\").\n *\n * @example\n * ```tsx\n * const formatUnit = useUnit();\n * const distance = formatUnit(10, { unit: \"kilometer\" });\n * // \"10 km\" (depending on locale)\n * ```\n *\n * @returns {Function} A unit formatting function that accepts a value and optional formatting options.\n */\nexport const useUnit = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof units>) =>\n units(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":"mOAqBA,MAAa,MAAgB,CAC3B,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,sBAAsB,CAEpD,OAAA,EAAA,EAAA,cACG,GAAG,KAAA,EAAA,EAAA,OACI,EAAK,GAAI,CACb,GAAG,EAAK,GACR,OAAQ,EAAK,IAAI,QAAU,EAC5B,CAAC,CACJ,CAAC,EAAO,CACT"}
1
+ {"version":3,"file":"useUnit.cjs","names":["IntlayerClientContext"],"sources":["../../../../src/client/format/useUnit.ts"],"sourcesContent":["import { units } from '@intlayer/core/formatters';\nimport { useCallback, useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from '../IntlayerProvider';\n\n/**\n * React hook that provides a unit formatting function\n * based on the current locale from {@link useLocaleBase}.\n *\n * This hook wraps {@link createUnit} to return a formatter\n * that can convert values into human-readable localized units\n * (e.g., \"10 km\", \"5 lbs\").\n *\n * @example\n * ```tsx\n * const formatUnit = useUnit();\n * const distance = formatUnit(10, { unit: \"kilometer\" });\n * // \"10 km\" (depending on locale)\n * ```\n *\n * @returns {Function} A unit formatting function that accepts a value and optional formatting options.\n */\nexport const useUnit = () => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useCallback(\n (...args: Parameters<typeof units>) =>\n units(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n }),\n [locale]\n );\n};\n"],"mappings":"+LAqBA,MAAa,MAAgB,CAC3B,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,EAAsB,CAEpD,OAAA,EAAA,EAAA,cACG,GAAG,KAAA,EAAA,EAAA,OACI,EAAK,GAAI,CACb,GAAG,EAAK,GACR,OAAQ,EAAK,IAAI,QAAU,EAC5B,CAAC,CACJ,CAAC,EAAO,CACT"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./useLocaleStorage.cjs`),t=require(`./IntlayerProvider.cjs`),n=require(`./useLocale.cjs`),r=require(`./format/useIntl.cjs`),i=require(`./t.cjs`),a=require(`./useDictionary.cjs`),o=require(`./useDictionaryAsync.cjs`),s=require(`./useLoadDynamic.cjs`),c=require(`./useDictionaryDynamic.cjs`),l=require(`./useIntlayer.cjs`),u=require(`./useLocaleBase.cjs`);exports.IntlayerClientContext=t.IntlayerClientContext,exports.IntlayerProvider=t.IntlayerProvider,exports.IntlayerProviderContent=t.IntlayerProviderContent,exports.localeCookie=e.localeCookie,exports.localeInStorage=e.localeInStorage,exports.setLocaleCookie=e.setLocaleCookie,exports.setLocaleInStorage=e.setLocaleInStorage,exports.t=i.t,exports.useDictionary=a.useDictionary,exports.useDictionaryAsync=o.useDictionaryAsync,exports.useDictionaryDynamic=c.useDictionaryDynamic,exports.useIntl=r.useIntl,exports.useIntlayer=l.useIntlayer,exports.useIntlayerContext=t.useIntlayerContext,exports.useLoadDynamic=s.useLoadDynamic,exports.useLocale=n.useLocale,exports.useLocaleBase=u.useLocaleBase,exports.useLocaleCookie=e.useLocaleCookie,exports.useLocaleStorage=e.useLocaleStorage;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../IntlayerProvider-sM1gzsx7.cjs`),t=require(`./useLocaleStorage.cjs`),n=require(`./useLocale.cjs`),r=require(`./format/useIntl.cjs`),i=require(`./t.cjs`),a=require(`./useDictionary.cjs`),o=require(`./useDictionaryAsync.cjs`),s=require(`./useLoadDynamic.cjs`),c=require(`./useDictionaryDynamic.cjs`),l=require(`./useIntlayer.cjs`),u=require(`./useLocaleBase.cjs`);exports.IntlayerClientContext=e.t,exports.IntlayerProvider=e.n,exports.IntlayerProviderContent=e.r,exports.localeCookie=t.localeCookie,exports.localeInStorage=t.localeInStorage,exports.setLocaleCookie=t.setLocaleCookie,exports.setLocaleInStorage=t.setLocaleInStorage,exports.t=i.t,exports.useDictionary=a.useDictionary,exports.useDictionaryAsync=o.useDictionaryAsync,exports.useDictionaryDynamic=c.useDictionaryDynamic,exports.useIntl=r.useIntl,exports.useIntlayer=l.useIntlayer,exports.useIntlayerContext=e.i,exports.useLoadDynamic=s.useLoadDynamic,exports.useLocale=n.useLocale,exports.useLocaleBase=u.useLocaleBase,exports.useLocaleCookie=t.useLocaleCookie,exports.useLocaleStorage=t.useLocaleStorage;
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./IntlayerProvider.cjs`);let t=require(`@intlayer/core/interpreter`),n=require(`preact/hooks`);const r=(r,i)=>{let{locale:a}=(0,n.useContext)(e.IntlayerClientContext);return(0,t.getTranslation)(r,i??a)};exports.t=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../IntlayerProvider-sM1gzsx7.cjs`);let t=require(`@intlayer/core/interpreter`),n=require(`preact/hooks`);const r=(r,i)=>{let{locale:a}=(0,n.useContext)(e.t);return(0,t.getTranslation)(r,i??a)};exports.t=r;
2
2
  //# sourceMappingURL=t.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"t.cjs","names":["IntlayerClientContext"],"sources":["../../../src/client/t.ts"],"sourcesContent":["import { getTranslation } from '@intlayer/core/interpreter';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport type { StrictModeLocaleMap } from '@intlayer/types/module_augmentation';\nimport { useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\n\n/**\n * On the client side, this function returns the translation of the provided multilang content.\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const t = <Content = string>(\n multilangContent: StrictModeLocaleMap<Content>,\n locale?: Locale\n) => {\n const { locale: currentLocale } = useContext(IntlayerClientContext);\n const localeTarget = locale ?? currentLocale;\n\n return getTranslation<Content>(multilangContent, localeTarget);\n};\n"],"mappings":"gOAWA,MAAa,GACX,EACA,IACG,CACH,GAAM,CAAE,OAAQ,IAAA,EAAA,EAAA,YAA6BA,EAAAA,sBAAsB,CAGnE,OAAA,EAAA,EAAA,gBAA+B,EAFV,GAAU,EAE+B"}
1
+ {"version":3,"file":"t.cjs","names":["IntlayerClientContext"],"sources":["../../../src/client/t.ts"],"sourcesContent":["import { getTranslation } from '@intlayer/core/interpreter';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport type { StrictModeLocaleMap } from '@intlayer/types/module_augmentation';\nimport { useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\n\n/**\n * On the client side, this function returns the translation of the provided multilang content.\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const t = <Content = string>(\n multilangContent: StrictModeLocaleMap<Content>,\n locale?: Locale\n) => {\n const { locale: currentLocale } = useContext(IntlayerClientContext);\n const localeTarget = locale ?? currentLocale;\n\n return getTranslation<Content>(multilangContent, localeTarget);\n};\n"],"mappings":"6LAWA,MAAa,GACX,EACA,IACG,CACH,GAAM,CAAE,OAAQ,IAAA,EAAA,EAAA,YAA6BA,EAAAA,EAAsB,CAGnE,OAAA,EAAA,EAAA,gBAA+B,EAFV,GAAU,EAE+B"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./IntlayerProvider.cjs`),t=require(`../getDictionary.cjs`);let n=require(`preact/hooks`);const r=(r,i)=>{let{locale:a}=(0,n.useContext)(e.IntlayerClientContext);return(0,n.useMemo)(()=>t.getDictionary(r,i??a),[r.key,a,i])};exports.useDictionary=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../IntlayerProvider-sM1gzsx7.cjs`),t=require(`../getDictionary.cjs`);let n=require(`preact/hooks`);const r=(r,i)=>{let{locale:a}=(0,n.useContext)(e.t);return(0,n.useMemo)(()=>t.getDictionary(r,i??a),[r.key,a,i])};exports.useDictionary=r;
2
2
  //# sourceMappingURL=useDictionary.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionary.cjs","names":["IntlayerClientContext","getDictionary"],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { getDictionary } from '../getDictionary';\nimport { IntlayerClientContext } from './IntlayerProvider';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionary = <\n T extends Dictionary,\n L extends LocalesValues = DeclaredLocales,\n>(\n dictionary: T,\n locale?: L\n) => {\n const { locale: currentLocale } = useContext(IntlayerClientContext);\n\n return useMemo(() => {\n const localeTarget = locale ?? currentLocale;\n\n return getDictionary<T, L>(dictionary, localeTarget as L);\n }, [dictionary.key, currentLocale, locale]);\n};\n"],"mappings":"0NAcA,MAAa,GAIX,EACA,IACG,CACH,GAAM,CAAE,OAAQ,IAAA,EAAA,EAAA,YAA6BA,EAAAA,sBAAsB,CAEnE,OAAA,EAAA,EAAA,aAGSC,EAAAA,cAAoB,EAFN,GAAU,EAE0B,CACxD,CAAC,EAAW,IAAK,EAAe,EAAO,CAAC"}
1
+ {"version":3,"file":"useDictionary.cjs","names":["IntlayerClientContext","getDictionary"],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { getDictionary } from '../getDictionary';\nimport { IntlayerClientContext } from './IntlayerProvider';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionary = <\n T extends Dictionary,\n L extends LocalesValues = DeclaredLocales,\n>(\n dictionary: T,\n locale?: L\n) => {\n const { locale: currentLocale } = useContext(IntlayerClientContext);\n\n return useMemo(() => {\n const localeTarget = locale ?? currentLocale;\n\n return getDictionary<T, L>(dictionary, localeTarget as L);\n }, [dictionary.key, currentLocale, locale]);\n};\n"],"mappings":"uLAcA,MAAa,GAIX,EACA,IACG,CACH,GAAM,CAAE,OAAQ,IAAA,EAAA,EAAA,YAA6BA,EAAAA,EAAsB,CAEnE,OAAA,EAAA,EAAA,aAGSC,EAAAA,cAAoB,EAFN,GAAU,EAE0B,CACxD,CAAC,EAAW,IAAK,EAAe,EAAO,CAAC"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`./IntlayerProvider.cjs`),n=require(`./useDictionary.cjs`);let r=require(`@intlayer/config/built`);r=e.__toESM(r);let i=require(`preact/hooks`);const a=async(e,a)=>{let{locale:o}=(0,i.useContext)(t.IntlayerClientContext),s=(0,i.useMemo)(()=>a??o??r.default?.internationalization.defaultLocale,[o,a]);return n.useDictionary(await(0,i.useMemo)(async()=>await e[s]?.(),[e,s]),s)};exports.useDictionaryAsync=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../IntlayerProvider-sM1gzsx7.cjs`),t=require(`./useDictionary.cjs`);let n=require(`@intlayer/config/built`);n=e.s(n);let r=require(`preact/hooks`);const i=async(i,a)=>{let{locale:o}=(0,r.useContext)(e.t),s=(0,r.useMemo)(()=>a??o??n.default?.internationalization.defaultLocale,[o,a]);return t.useDictionary(await(0,r.useMemo)(async()=>await i[s]?.(),[i,s]),s)};exports.useDictionaryAsync=i;
2
2
  //# sourceMappingURL=useDictionaryAsync.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionaryAsync.cjs","names":["IntlayerClientContext","configuration","useDictionary"],"sources":["../../../src/client/useDictionaryAsync.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { useDictionary } from './useDictionary';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryAsync = async <T extends Dictionary>(\n dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,\n locale?: LocalesValues\n): Promise<T> => {\n const { locale: currentLocale } = useContext(IntlayerClientContext);\n\n const localeTarget = useMemo(\n () =>\n locale ??\n currentLocale ??\n configuration?.internationalization.defaultLocale,\n [currentLocale, locale]\n );\n\n const dictionary = await useMemo(\n async () =>\n (await dictionaryPromise[\n localeTarget as keyof typeof dictionaryPromise\n ]?.()) as T,\n [dictionaryPromise, localeTarget]\n );\n\n return useDictionary(dictionary, localeTarget) as any;\n};\n"],"mappings":"kRAeA,MAAa,EAAqB,MAChC,EACA,IACe,CACf,GAAM,CAAE,OAAQ,IAAA,EAAA,EAAA,YAA6BA,EAAAA,sBAAsB,CAE7D,GAAA,EAAA,EAAA,aAEF,GACA,GACAC,EAAAA,SAAe,qBAAqB,cACtC,CAAC,EAAe,EAAO,CACxB,CAUD,OAAOC,EAAAA,cARY,MAAA,EAAA,EAAA,SACjB,SACG,MAAM,EACL,MACG,CACP,CAAC,EAAmB,EAAa,CAClC,CAEgC,EAAa"}
1
+ {"version":3,"file":"useDictionaryAsync.cjs","names":["IntlayerClientContext","configuration","useDictionary"],"sources":["../../../src/client/useDictionaryAsync.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { useDictionary } from './useDictionary';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryAsync = async <T extends Dictionary>(\n dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,\n locale?: LocalesValues\n): Promise<T> => {\n const { locale: currentLocale } = useContext(IntlayerClientContext);\n\n const localeTarget = useMemo(\n () =>\n locale ??\n currentLocale ??\n configuration?.internationalization.defaultLocale,\n [currentLocale, locale]\n );\n\n const dictionary = await useMemo(\n async () =>\n (await dictionaryPromise[\n localeTarget as keyof typeof dictionaryPromise\n ]?.()) as T,\n [dictionaryPromise, localeTarget]\n );\n\n return useDictionary(dictionary, localeTarget) as any;\n};\n"],"mappings":"uOAeA,MAAa,EAAqB,MAChC,EACA,IACe,CACf,GAAM,CAAE,OAAQ,IAAA,EAAA,EAAA,YAA6BA,EAAAA,EAAsB,CAE7D,GAAA,EAAA,EAAA,aAEF,GACA,GACAC,EAAAA,SAAe,qBAAqB,cACtC,CAAC,EAAe,EAAO,CACxB,CAUD,OAAOC,EAAAA,cARY,MAAA,EAAA,EAAA,SACjB,SACG,MAAM,EACL,MACG,CACP,CAAC,EAAmB,EAAa,CAClC,CAEgC,EAAa"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./IntlayerProvider.cjs`),t=require(`./useDictionary.cjs`),n=require(`./useLoadDynamic.cjs`);let r=require(`preact/hooks`);const i=(i,a,o)=>{let{locale:s}=(0,r.useContext)(e.IntlayerClientContext),c=(0,r.useMemo)(()=>o??s,[s,o]);return t.useDictionary(n.useLoadDynamic(`${String(a)}.${c}`,i[c]?.()),c)};exports.useDictionaryDynamic=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../IntlayerProvider-sM1gzsx7.cjs`),t=require(`./useDictionary.cjs`),n=require(`./useLoadDynamic.cjs`);let r=require(`preact/hooks`);const i=(i,a,o)=>{let{locale:s}=(0,r.useContext)(e.t),c=(0,r.useMemo)(()=>o??s,[s,o]);return t.useDictionary(n.useLoadDynamic(`${String(a)}.${c}`,i[c]?.()),c)};exports.useDictionaryDynamic=i;
2
2
  //# sourceMappingURL=useDictionaryDynamic.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionaryDynamic.cjs","names":["IntlayerClientContext","useDictionary","useLoadDynamic"],"sources":["../../../src/client/useDictionaryDynamic.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DictionaryKeys,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { useDictionary } from './useDictionary';\nimport { useLoadDynamic } from './useLoadDynamic';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryDynamic = <\n T extends Dictionary,\n K extends DictionaryKeys,\n>(\n dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,\n key: K,\n locale?: LocalesValues\n) => {\n const { locale: currentLocale } = useContext(IntlayerClientContext);\n const localeTarget = useMemo(\n () => locale ?? currentLocale,\n [currentLocale, locale]\n );\n\n const dictionary = useLoadDynamic<T>(\n `${String(key)}.${localeTarget}`,\n (dictionaryPromise as any)[localeTarget]?.()\n ) as T;\n\n return useDictionary(dictionary, localeTarget);\n};\n"],"mappings":"2PAgBA,MAAa,GAIX,EACA,EACA,IACG,CACH,GAAM,CAAE,OAAQ,IAAA,EAAA,EAAA,YAA6BA,EAAAA,sBAAsB,CAC7D,GAAA,EAAA,EAAA,aACE,GAAU,EAChB,CAAC,EAAe,EAAO,CACxB,CAOD,OAAOC,EAAAA,cALYC,EAAAA,eACjB,GAAG,OAAO,EAAI,CAAC,GAAG,IACjB,EAA0B,MAAiB,CAC7C,CAEgC,EAAa"}
1
+ {"version":3,"file":"useDictionaryDynamic.cjs","names":["IntlayerClientContext","useDictionary","useLoadDynamic"],"sources":["../../../src/client/useDictionaryDynamic.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DictionaryKeys,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { useDictionary } from './useDictionary';\nimport { useLoadDynamic } from './useLoadDynamic';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryDynamic = <\n T extends Dictionary,\n K extends DictionaryKeys,\n>(\n dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,\n key: K,\n locale?: LocalesValues\n) => {\n const { locale: currentLocale } = useContext(IntlayerClientContext);\n const localeTarget = useMemo(\n () => locale ?? currentLocale,\n [currentLocale, locale]\n );\n\n const dictionary = useLoadDynamic<T>(\n `${String(key)}.${localeTarget}`,\n (dictionaryPromise as any)[localeTarget]?.()\n ) as T;\n\n return useDictionary(dictionary, localeTarget);\n};\n"],"mappings":"wNAgBA,MAAa,GAIX,EACA,EACA,IACG,CACH,GAAM,CAAE,OAAQ,IAAA,EAAA,EAAA,YAA6BA,EAAAA,EAAsB,CAC7D,GAAA,EAAA,EAAA,aACE,GAAU,EAChB,CAAC,EAAe,EAAO,CACxB,CAOD,OAAOC,EAAAA,cALYC,EAAAA,eACjB,GAAG,OAAO,EAAI,CAAC,GAAG,IACjB,EAA0B,MAAiB,CAC7C,CAEgC,EAAa"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./IntlayerProvider.cjs`),t=require(`../getIntlayer.cjs`);let n=require(`preact/hooks`);const r=(r,i)=>{let{locale:a}=(0,n.useContext)(e.IntlayerClientContext);return(0,n.useMemo)(()=>t.getIntlayer(r,i??a),[r,a,i])};exports.useIntlayer=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../IntlayerProvider-sM1gzsx7.cjs`),t=require(`../getIntlayer.cjs`);let n=require(`preact/hooks`);const r=(r,i)=>{let{locale:a}=(0,n.useContext)(e.t);return(0,n.useMemo)(()=>t.getIntlayer(r,i??a),[r,a,i])};exports.useIntlayer=r;
2
2
  //# sourceMappingURL=useIntlayer.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIntlayer.cjs","names":["IntlayerClientContext","getIntlayer"],"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":["import type {\n DictionaryKeys,\n DictionaryRegistryContent,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { getIntlayer } from '../getIntlayer';\nimport type { DeepTransformContent } from '../plugins';\nimport { IntlayerClientContext } from './IntlayerProvider';\n\n/**\n * Preact hook that picks one dictionary by its key and returns its content.\n *\n * If the locale is not provided, it will use the locale from the client context.\n *\n * @param key - The unique key of the dictionary to retrieve.\n * @param locale - Optional locale to override the current context locale.\n * @returns The transformed dictionary content.\n *\n * @example\n * ```tsx\n * import { useIntlayer } from 'preact-intlayer';\n *\n * const MyComponent = () => {\n * const content = useIntlayer('my-dictionary-key');\n *\n * return <div>{content.myField.value}</div>;\n * };\n * ```\n */\nexport const useIntlayer = <T extends DictionaryKeys, L extends LocalesValues>(\n key: T,\n locale?: L\n) => {\n const { locale: currentLocale } = useContext(IntlayerClientContext);\n\n return useMemo(() => {\n const localeTarget = locale ?? currentLocale;\n\n // @ts-ignore Type instantiation is excessively deep and possibly infinite\n return getIntlayer<T, L>(key, localeTarget as L) as DeepTransformContent<\n DictionaryRegistryContent<T>\n >;\n }, [key, currentLocale, locale]);\n};\n"],"mappings":"wNA8BA,MAAa,GACX,EACA,IACG,CACH,GAAM,CAAE,OAAQ,IAAA,EAAA,EAAA,YAA6BA,EAAAA,sBAAsB,CAEnE,OAAA,EAAA,EAAA,aAISC,EAAAA,YAAkB,EAHJ,GAAU,EAGiB,CAG/C,CAAC,EAAK,EAAe,EAAO,CAAC"}
1
+ {"version":3,"file":"useIntlayer.cjs","names":["IntlayerClientContext","getIntlayer"],"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":["import type {\n DictionaryKeys,\n DictionaryRegistryContent,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { getIntlayer } from '../getIntlayer';\nimport type { DeepTransformContent } from '../plugins';\nimport { IntlayerClientContext } from './IntlayerProvider';\n\n/**\n * Preact hook that picks one dictionary by its key and returns its content.\n *\n * If the locale is not provided, it will use the locale from the client context.\n *\n * @param key - The unique key of the dictionary to retrieve.\n * @param locale - Optional locale to override the current context locale.\n * @returns The transformed dictionary content.\n *\n * @example\n * ```tsx\n * import { useIntlayer } from 'preact-intlayer';\n *\n * const MyComponent = () => {\n * const content = useIntlayer('my-dictionary-key');\n *\n * return <div>{content.myField.value}</div>;\n * };\n * ```\n */\nexport const useIntlayer = <T extends DictionaryKeys, L extends LocalesValues>(\n key: T,\n locale?: L\n) => {\n const { locale: currentLocale } = useContext(IntlayerClientContext);\n\n return useMemo(() => {\n const localeTarget = locale ?? currentLocale;\n\n // @ts-ignore Type instantiation is excessively deep and possibly infinite\n return getIntlayer<T, L>(key, localeTarget as L) as DeepTransformContent<\n DictionaryRegistryContent<T>\n >;\n }, [key, currentLocale, locale]);\n};\n"],"mappings":"qLA8BA,MAAa,GACX,EACA,IACG,CACH,GAAM,CAAE,OAAQ,IAAA,EAAA,EAAA,YAA6BA,EAAAA,EAAsB,CAEnE,OAAA,EAAA,EAAA,aAISC,EAAAA,YAAkB,EAHJ,GAAU,EAGiB,CAG/C,CAAC,EAAK,EAAe,EAAO,CAAC"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`./useLocaleStorage.cjs`),n=require(`./IntlayerProvider.cjs`);let r=require(`@intlayer/config/built`);r=e.__toESM(r);let i=require(`preact/hooks`);const a=({isCookieEnabled:e,onLocaleChange:a}={})=>{let{defaultLocale:o,locales:s}=r.default?.internationalization??{},{locale:c,setLocale:l,isCookieEnabled:u}=(0,i.useContext)(n.IntlayerClientContext);return{locale:c,defaultLocale:o,availableLocales:s,setLocale:n=>{if(!s?.map(String).includes(n)){console.error(`Locale ${n} is not available`);return}l(n),t.setLocaleInStorage(n,e??u??!0),a?.(n)}}};exports.useLocale=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../IntlayerProvider-sM1gzsx7.cjs`),t=require(`./useLocaleStorage.cjs`);let n=require(`@intlayer/config/built`);n=e.s(n);let r=require(`preact/hooks`);const i=({isCookieEnabled:i,onLocaleChange:a}={})=>{let{defaultLocale:o,locales:s}=n.default?.internationalization??{},{locale:c,setLocale:l,isCookieEnabled:u}=(0,r.useContext)(e.t);return{locale:c,defaultLocale:o,availableLocales:s,setLocale:e=>{if(!s?.map(String).includes(e)){console.error(`Locale ${e} is not available`);return}l(e),t.setLocaleInStorage(e,i??u??!0),a?.(e)}}};exports.useLocale=i;
2
2
  //# sourceMappingURL=useLocale.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocale.cjs","names":["configuration","IntlayerClientContext"],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { setLocaleInStorage } from './useLocaleStorage';\n\ntype useLocaleProps = {\n isCookieEnabled?: boolean;\n onLocaleChange?: (locale: LocalesValues) => void;\n};\n\n/**\n * Preact hook to get the current locale and related locale management functions.\n *\n * @param props - Optional properties for the hook.\n * @returns An object containing the current locale, default locale, available locales, and a function to update the locale.\n *\n * @example\n * ```tsx\n * import { useLocale } from 'preact-intlayer';\n *\n * const LocaleSwitcher = () => {\n * const { locale, setLocale, availableLocales } = useLocale();\n *\n * return (\n * <select value={locale} onChange={(e) => setLocale(e.target.value)}>\n * {availableLocales.map((loc) => (\n * <option key={loc} value={loc}>{loc}</option>\n * ))}\n * </select>\n * );\n * };\n * ```\n */\nexport const useLocale = ({\n isCookieEnabled,\n onLocaleChange,\n}: useLocaleProps = {}) => {\n const { defaultLocale, locales: availableLocales } =\n configuration?.internationalization ?? {};\n\n const {\n locale,\n setLocale: setLocaleState,\n isCookieEnabled: isCookieEnabledContext,\n } = useContext(IntlayerClientContext);\n\n const setLocale = (locale: LocalesValues) => {\n if (!availableLocales?.map(String).includes(locale)) {\n console.error(`Locale ${locale} is not available`);\n return;\n }\n\n setLocaleState(locale);\n\n setLocaleInStorage(\n locale,\n isCookieEnabled ?? isCookieEnabledContext ?? true\n );\n\n onLocaleChange?.(locale);\n };\n\n return {\n locale, // Current locale\n defaultLocale, // Principal locale defined in config\n availableLocales, // List of the available locales defined in config\n setLocale, // Function to set the locale\n };\n};\n"],"mappings":"qRAkCA,MAAa,GAAa,CACxB,kBACA,kBACkB,EAAE,GAAK,CACzB,GAAM,CAAE,gBAAe,QAAS,GAC9BA,EAAAA,SAAe,sBAAwB,EAAE,CAErC,CACJ,SACA,UAAW,EACX,gBAAiB,IAAA,EAAA,EAAA,YACJC,EAAAA,sBAAsB,CAkBrC,MAAO,CACL,SACA,gBACA,mBACA,UApBiB,GAA0B,CAC3C,GAAI,CAAC,GAAkB,IAAI,OAAO,CAAC,SAAS,EAAO,CAAE,CACnD,QAAQ,MAAM,UAAU,EAAO,mBAAmB,CAClD,OAGF,EAAe,EAAO,CAEtB,EAAA,mBACE,EACA,GAAmB,GAA0B,GAC9C,CAED,IAAiB,EAAO,EAQzB"}
1
+ {"version":3,"file":"useLocale.cjs","names":["configuration","IntlayerClientContext"],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { setLocaleInStorage } from './useLocaleStorage';\n\ntype useLocaleProps = {\n isCookieEnabled?: boolean;\n onLocaleChange?: (locale: LocalesValues) => void;\n};\n\n/**\n * Preact hook to get the current locale and related locale management functions.\n *\n * @param props - Optional properties for the hook.\n * @returns An object containing the current locale, default locale, available locales, and a function to update the locale.\n *\n * @example\n * ```tsx\n * import { useLocale } from 'preact-intlayer';\n *\n * const LocaleSwitcher = () => {\n * const { locale, setLocale, availableLocales } = useLocale();\n *\n * return (\n * <select value={locale} onChange={(e) => setLocale(e.target.value)}>\n * {availableLocales.map((loc) => (\n * <option key={loc} value={loc}>{loc}</option>\n * ))}\n * </select>\n * );\n * };\n * ```\n */\nexport const useLocale = ({\n isCookieEnabled,\n onLocaleChange,\n}: useLocaleProps = {}) => {\n const { defaultLocale, locales: availableLocales } =\n configuration?.internationalization ?? {};\n\n const {\n locale,\n setLocale: setLocaleState,\n isCookieEnabled: isCookieEnabledContext,\n } = useContext(IntlayerClientContext);\n\n const setLocale = (locale: LocalesValues) => {\n if (!availableLocales?.map(String).includes(locale)) {\n console.error(`Locale ${locale} is not available`);\n return;\n }\n\n setLocaleState(locale);\n\n setLocaleInStorage(\n locale,\n isCookieEnabled ?? isCookieEnabledContext ?? true\n );\n\n onLocaleChange?.(locale);\n };\n\n return {\n locale, // Current locale\n defaultLocale, // Principal locale defined in config\n availableLocales, // List of the available locales defined in config\n setLocale, // Function to set the locale\n };\n};\n"],"mappings":"0OAkCA,MAAa,GAAa,CACxB,kBACA,kBACkB,EAAE,GAAK,CACzB,GAAM,CAAE,gBAAe,QAAS,GAC9BA,EAAAA,SAAe,sBAAwB,EAAE,CAErC,CACJ,SACA,UAAW,EACX,gBAAiB,IAAA,EAAA,EAAA,YACJC,EAAAA,EAAsB,CAkBrC,MAAO,CACL,SACA,gBACA,mBACA,UApBiB,GAA0B,CAC3C,GAAI,CAAC,GAAkB,IAAI,OAAO,CAAC,SAAS,EAAO,CAAE,CACnD,QAAQ,MAAM,UAAU,EAAO,mBAAmB,CAClD,OAGF,EAAe,EAAO,CAEtB,EAAA,mBACE,EACA,GAAmB,GAA0B,GAC9C,CAED,IAAiB,EAAO,EAQzB"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`./IntlayerProvider.cjs`);let n=require(`@intlayer/config/built`);n=e.__toESM(n);let r=require(`preact/hooks`);const{defaultLocale:i,locales:a}=n.default.internationalization,o=()=>{let{locale:e,setLocale:n}=(0,r.useContext)(t.IntlayerClientContext);return{locale:e,defaultLocale:i,availableLocales:a,setLocale:n}};exports.useLocaleBase=o;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../IntlayerProvider-sM1gzsx7.cjs`);let t=require(`@intlayer/config/built`);t=e.s(t);let n=require(`preact/hooks`);const{defaultLocale:r,locales:i}=t.default.internationalization,a=()=>{let{locale:t,setLocale:a}=(0,n.useContext)(e.t);return{locale:t,defaultLocale:r,availableLocales:i,setLocale:a}};exports.useLocaleBase=a;
2
2
  //# sourceMappingURL=useLocaleBase.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocaleBase.cjs","names":["configuration","IntlayerClientContext"],"sources":["../../../src/client/useLocaleBase.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport { useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\n\nconst { defaultLocale, locales: availableLocales } =\n configuration.internationalization;\n\n/**\n * On the client side, hook to get the current locale and all related fields\n */\nexport const useLocaleBase = () => {\n const { locale, setLocale } = useContext(IntlayerClientContext);\n\n return {\n locale, // Current locale\n defaultLocale, // Principal locale defined in config\n availableLocales, // List of the available locales defined in config\n setLocale, // Function to set the locale\n };\n};\n"],"mappings":"iPAIA,KAAM,CAAE,gBAAe,QAAS,GAC9BA,EAAAA,QAAc,qBAKH,MAAsB,CACjC,GAAM,CAAE,SAAQ,cAAA,EAAA,EAAA,YAAyBC,EAAAA,sBAAsB,CAE/D,MAAO,CACL,SACA,gBACA,mBACA,YACD"}
1
+ {"version":3,"file":"useLocaleBase.cjs","names":["configuration","IntlayerClientContext"],"sources":["../../../src/client/useLocaleBase.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport { useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\n\nconst { defaultLocale, locales: availableLocales } =\n configuration.internationalization;\n\n/**\n * On the client side, hook to get the current locale and all related fields\n */\nexport const useLocaleBase = () => {\n const { locale, setLocale } = useContext(IntlayerClientContext);\n\n return {\n locale, // Current locale\n defaultLocale, // Principal locale defined in config\n availableLocales, // List of the available locales defined in config\n setLocale, // Function to set the locale\n };\n};\n"],"mappings":"sMAIA,KAAM,CAAE,gBAAe,QAAS,GAC9BA,EAAAA,QAAc,qBAKH,MAAsB,CACjC,GAAM,CAAE,SAAQ,cAAA,EAAA,EAAA,YAAyBC,EAAAA,EAAsB,CAE/D,MAAO,CACL,SACA,gBACA,mBACA,YACD"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`preact/hooks`),t=require(`@intlayer/core/localization`),n=require(`@intlayer/core/utils`);const r=(0,n.getLocaleFromStorage)(t.localeStorageOptions),i=r,a=(e,r)=>(0,n.setLocaleInStorage)(e,{...t.localeStorageOptions,isCookieEnabled:r}),o=a,s=r=>(0,e.useMemo)(()=>(0,n.LocaleStorage)({...t.localeStorageOptions,isCookieEnabled:r}),[r]),c=e=>{let t=s(e);return{localeCookie:t.getLocale(),setLocaleCookie:t.setLocale}};exports.localeCookie=i,exports.localeInStorage=r,exports.setLocaleCookie=o,exports.setLocaleInStorage=a,exports.useLocaleCookie=c,exports.useLocaleStorage=s;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../IntlayerProvider-sM1gzsx7.cjs`);let e=require(`preact/hooks`),t=require(`@intlayer/core/localization`),n=require(`@intlayer/core/utils`);const r=(0,n.getLocaleFromStorage)(t.localeStorageOptions),i=r,a=(e,r)=>(0,n.setLocaleInStorage)(e,{...t.localeStorageOptions,isCookieEnabled:r}),o=a,s=r=>(0,e.useMemo)(()=>(0,n.LocaleStorage)({...t.localeStorageOptions,isCookieEnabled:r}),[r]),c=e=>{let t=s(e);return{localeCookie:t.getLocale(),setLocaleCookie:t.setLocale}};exports.localeCookie=i,exports.localeInStorage=r,exports.setLocaleCookie=o,exports.setLocaleInStorage=a,exports.useLocaleCookie=c,exports.useLocaleStorage=s;
2
2
  //# sourceMappingURL=useLocaleStorage.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocaleStorage.cjs","names":["localeStorageOptions"],"sources":["../../../src/client/useLocaleStorage.ts"],"sourcesContent":["import { localeStorageOptions } from '@intlayer/core/localization';\nimport {\n getLocaleFromStorage,\n LocaleStorage,\n setLocaleInStorage as setLocaleInStorageCore,\n} from '@intlayer/core/utils';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { useMemo } from 'preact/hooks';\n\n/**\n * Get the locale cookie\n */\nexport const localeInStorage = getLocaleFromStorage(localeStorageOptions);\n/**\n * @deprecated Use localeInStorage instead\n *\n * Get the locale cookie\n */\nexport const localeCookie = localeInStorage;\n\n/**\n * Set the locale cookie\n */\nexport const setLocaleInStorage = (\n locale: LocalesValues,\n isCookieEnabled: boolean\n) =>\n setLocaleInStorageCore(locale, {\n ...localeStorageOptions,\n isCookieEnabled,\n });\n\n/**\n * @deprecated Use setLocaleInStorage instead\n *\n * Set the locale cookie\n */\nexport const setLocaleCookie = setLocaleInStorage;\n\n/**\n * Hook that provides the locale storage and a function to set it\n */\nexport const useLocaleStorage = (isCookieEnabled?: boolean) =>\n useMemo(\n () =>\n LocaleStorage({\n ...localeStorageOptions,\n isCookieEnabled,\n }),\n [isCookieEnabled]\n );\n\n/**\n * @deprecated Use useLocaleStorage instead\n *\n * For GDPR compliance, use useLocaleStorage instead\n *\n * Hook that provides the locale cookie and a function to set it\n */\nexport const useLocaleCookie = (isCookieEnabled?: boolean) => {\n const storage = useLocaleStorage(isCookieEnabled);\n return {\n localeCookie: storage.getLocale(),\n setLocaleCookie: storage.setLocale,\n };\n};\n"],"mappings":"yNAYA,MAAa,GAAA,EAAA,EAAA,sBAAuCA,EAAAA,qBAAqB,CAM5D,EAAe,EAKf,GACX,EACA,KAAA,EAAA,EAAA,oBAEuB,EAAQ,CAC7B,GAAGA,EAAAA,qBACH,kBACD,CAAC,CAOS,EAAkB,EAKlB,EAAoB,IAAA,EAAA,EAAA,cAAA,EAAA,EAAA,eAGb,CACZ,GAAGA,EAAAA,qBACH,kBACD,CAAC,CACJ,CAAC,EAAgB,CAClB,CASU,EAAmB,GAA8B,CAC5D,IAAM,EAAU,EAAiB,EAAgB,CACjD,MAAO,CACL,aAAc,EAAQ,WAAW,CACjC,gBAAiB,EAAQ,UAC1B"}
1
+ {"version":3,"file":"useLocaleStorage.cjs","names":["localeStorageOptions"],"sources":["../../../src/client/useLocaleStorage.ts"],"sourcesContent":["import { localeStorageOptions } from '@intlayer/core/localization';\nimport {\n getLocaleFromStorage,\n LocaleStorage,\n setLocaleInStorage as setLocaleInStorageCore,\n} from '@intlayer/core/utils';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { useMemo } from 'preact/hooks';\n\n/**\n * Get the locale cookie\n */\nexport const localeInStorage = getLocaleFromStorage(localeStorageOptions);\n/**\n * @deprecated Use localeInStorage instead\n *\n * Get the locale cookie\n */\nexport const localeCookie = localeInStorage;\n\n/**\n * Set the locale cookie\n */\nexport const setLocaleInStorage = (\n locale: LocalesValues,\n isCookieEnabled: boolean\n) =>\n setLocaleInStorageCore(locale, {\n ...localeStorageOptions,\n isCookieEnabled,\n });\n\n/**\n * @deprecated Use setLocaleInStorage instead\n *\n * Set the locale cookie\n */\nexport const setLocaleCookie = setLocaleInStorage;\n\n/**\n * Hook that provides the locale storage and a function to set it\n */\nexport const useLocaleStorage = (isCookieEnabled?: boolean) =>\n useMemo(\n () =>\n LocaleStorage({\n ...localeStorageOptions,\n isCookieEnabled,\n }),\n [isCookieEnabled]\n );\n\n/**\n * @deprecated Use useLocaleStorage instead\n *\n * For GDPR compliance, use useLocaleStorage instead\n *\n * Hook that provides the locale cookie and a function to set it\n */\nexport const useLocaleCookie = (isCookieEnabled?: boolean) => {\n const storage = useLocaleStorage(isCookieEnabled);\n return {\n localeCookie: storage.getLocale(),\n setLocaleCookie: storage.setLocale,\n };\n};\n"],"mappings":"wNAYA,MAAa,GAAA,EAAA,EAAA,sBAAuCA,EAAAA,qBAAqB,CAM5D,EAAe,EAKf,GACX,EACA,KAAA,EAAA,EAAA,oBAEuB,EAAQ,CAC7B,GAAGA,EAAAA,qBACH,kBACD,CAAC,CAOS,EAAkB,EAKlB,EAAoB,IAAA,EAAA,EAAA,cAAA,EAAA,EAAA,eAGb,CACZ,GAAGA,EAAAA,qBACH,kBACD,CAAC,CACJ,CAAC,EAAgB,CAClB,CASU,EAAmB,GAA8B,CAC5D,IAAM,EAAU,EAAiB,EAAgB,CACjD,MAAO,CACL,aAAc,EAAQ,WAAW,CACjC,gBAAiB,EAAQ,UAC1B"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./IntlayerProvider.cjs`);let t=require(`@intlayer/core/interpreter`),n=require(`preact/hooks`);const r=r=>{let{locale:i}=(0,n.useContext)(e.IntlayerClientContext);return(0,n.useMemo)(()=>(0,t.getTranslation)(r,i),[r,i])};exports.useTranslation=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../IntlayerProvider-sM1gzsx7.cjs`);let t=require(`@intlayer/core/interpreter`),n=require(`preact/hooks`);const r=r=>{let{locale:i}=(0,n.useContext)(e.t);return(0,n.useMemo)(()=>(0,t.getTranslation)(r,i),[r,i])};exports.useTranslation=r;
2
2
  //# sourceMappingURL=useTraduction.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTraduction.cjs","names":["IntlayerClientContext"],"sources":["../../../src/client/useTraduction.ts"],"sourcesContent":["import { getTranslation } from '@intlayer/core/interpreter';\nimport type { StrictModeLocaleMap } from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\n\n/**\n * On the client side, Hook that picking one dictionary by its id and return the content.\n *\n * If not locale found, it will return the content related to the default locale.\n *\n * Return either the content editor, or the content itself depending on the configuration.\n *\n * Usage:\n *\n * ```tsx\n * const content = useTranslation<string>({\n * en: 'Hello',\n * fr: 'Bonjour',\n * }, 'fr');\n * // 'Bonjour'\n * ```\n *\n * Using TypeScript:\n * - this function will require each locale to be defined if defined in the project configuration.\n * - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.\n */\nexport const useTranslation = <Content = string>(\n languageContent: StrictModeLocaleMap<Content>\n): Content => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useMemo(\n () => getTranslation(languageContent, locale),\n [languageContent, locale]\n );\n};\n"],"mappings":"gOA0BA,MAAa,EACX,GACY,CACZ,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,sBAAsB,CAEpD,OAAA,EAAA,EAAA,cAAA,EAAA,EAAA,gBACuB,EAAiB,EAAO,CAC7C,CAAC,EAAiB,EAAO,CAC1B"}
1
+ {"version":3,"file":"useTraduction.cjs","names":["IntlayerClientContext"],"sources":["../../../src/client/useTraduction.ts"],"sourcesContent":["import { getTranslation } from '@intlayer/core/interpreter';\nimport type { StrictModeLocaleMap } from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\n\n/**\n * On the client side, Hook that picking one dictionary by its id and return the content.\n *\n * If not locale found, it will return the content related to the default locale.\n *\n * Return either the content editor, or the content itself depending on the configuration.\n *\n * Usage:\n *\n * ```tsx\n * const content = useTranslation<string>({\n * en: 'Hello',\n * fr: 'Bonjour',\n * }, 'fr');\n * // 'Bonjour'\n * ```\n *\n * Using TypeScript:\n * - this function will require each locale to be defined if defined in the project configuration.\n * - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.\n */\nexport const useTranslation = <Content = string>(\n languageContent: StrictModeLocaleMap<Content>\n): Content => {\n const { locale } = useContext(IntlayerClientContext);\n\n return useMemo(\n () => getTranslation(languageContent, locale),\n [languageContent, locale]\n );\n};\n"],"mappings":"6LA0BA,MAAa,EACX,GACY,CACZ,GAAM,CAAE,WAAA,EAAA,EAAA,YAAsBA,EAAAA,EAAsB,CAEpD,OAAA,EAAA,EAAA,cAAA,EAAA,EAAA,gBACuB,EAAiB,EAAO,CAC7C,CAAC,EAAiB,EAAO,CAC1B"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`@intlayer/editor/isEnabled`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`);const r=({children:r,dictionaryKey:i,keyPath:a})=>((0,t.useEffect)(()=>{!e.isEnabled||typeof window>`u`||import(`@intlayer/editor`).then(({defineIntlayerElements:e})=>{e()})},[e.isEnabled]),e.isEnabled?(0,n.jsx)(`intlayer-content-selector-wrapper`,{"key-path":JSON.stringify(a),"dictionary-key":i,children:r}):r);exports.ContentSelector=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../IntlayerProvider-sM1gzsx7.cjs`);let e=require(`@intlayer/editor/isEnabled`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`);const r=({children:r,dictionaryKey:i,keyPath:a})=>((0,t.useEffect)(()=>{process.env.INTLAYER_EDITOR_ENABLED===`false`||!e.isEnabled||typeof window>`u`||import(`@intlayer/editor`).then(({defineIntlayerElements:e})=>{e()})},[e.isEnabled]),e.isEnabled?(0,n.jsx)(`intlayer-content-selector-wrapper`,{"key-path":JSON.stringify(a),"dictionary-key":i,children:r}):r);exports.ContentSelector=r;
2
2
  //# sourceMappingURL=ContentSelector.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContentSelector.cjs","names":["isEnabled"],"sources":["../../../src/editor/ContentSelector.tsx"],"sourcesContent":["import type { NodeProps } from '@intlayer/core/interpreter';\nimport { isEnabled } from '@intlayer/editor/isEnabled';\nimport type { FunctionalComponent, HTMLAttributes } from 'preact';\nimport { useEffect } from 'preact/hooks';\n\n// JSX declaration for the Lit web component in Preact\ndeclare module 'preact' {\n namespace JSX {\n interface IntrinsicElements {\n 'intlayer-content-selector-wrapper': HTMLAttributes<HTMLElement> & {\n 'key-path'?: string;\n 'dictionary-key'?: string;\n };\n }\n }\n}\n\nexport type ContentSelectorWrapperProps = NodeProps &\n Omit<HTMLAttributes<HTMLDivElement>, 'children'>;\n\nexport const ContentSelector: FunctionalComponent<\n ContentSelectorWrapperProps\n> = ({ children, dictionaryKey, keyPath }) => {\n useEffect(() => {\n if (!isEnabled || typeof window === 'undefined') return;\n import('@intlayer/editor').then(({ defineIntlayerElements }) => {\n defineIntlayerElements();\n });\n }, [isEnabled]);\n\n if (!isEnabled) {\n return children;\n }\n\n return (\n <intlayer-content-selector-wrapper\n key-path={JSON.stringify(keyPath)}\n dictionary-key={dictionaryKey}\n >\n {children}\n </intlayer-content-selector-wrapper>\n );\n};\n"],"mappings":"sNAoBA,MAAa,GAER,CAAE,WAAU,gBAAe,eAC9B,EAAA,EAAA,eAAgB,CACV,CAACA,EAAAA,WAAa,OAAO,OAAW,KACpC,OAAO,oBAAoB,MAAM,CAAE,4BAA6B,CAC9D,GAAwB,EACxB,EACD,CAACA,EAAAA,UAAU,CAAC,CAEVA,EAAAA,WAKH,EAAA,EAAA,KAAC,oCAAD,CACE,WAAU,KAAK,UAAU,EAAQ,CACjC,iBAAgB,EAEf,WACiC,CAAA,CAT7B"}
1
+ {"version":3,"file":"ContentSelector.cjs","names":["isEnabled"],"sources":["../../../src/editor/ContentSelector.tsx"],"sourcesContent":["import type { NodeProps } from '@intlayer/core/interpreter';\nimport { isEnabled } from '@intlayer/editor/isEnabled';\nimport type { FunctionalComponent, HTMLAttributes } from 'preact';\nimport { useEffect } from 'preact/hooks';\n\n// JSX declaration for the Lit web component in Preact\ndeclare module 'preact' {\n namespace JSX {\n interface IntrinsicElements {\n 'intlayer-content-selector-wrapper': HTMLAttributes<HTMLElement> & {\n 'key-path'?: string;\n 'dictionary-key'?: string;\n };\n }\n }\n}\n\nexport type ContentSelectorWrapperProps = NodeProps &\n Omit<HTMLAttributes<HTMLDivElement>, 'children'>;\n\nexport const ContentSelector: FunctionalComponent<\n ContentSelectorWrapperProps\n> = ({ children, dictionaryKey, keyPath }) => {\n useEffect(() => {\n if (\n process.env.INTLAYER_EDITOR_ENABLED === 'false' ||\n !isEnabled ||\n typeof window === 'undefined'\n )\n return;\n import('@intlayer/editor').then(({ defineIntlayerElements }) => {\n defineIntlayerElements();\n });\n }, [isEnabled]);\n\n if (!isEnabled) {\n return children;\n }\n\n return (\n <intlayer-content-selector-wrapper\n key-path={JSON.stringify(keyPath)}\n dictionary-key={dictionaryKey}\n >\n {children}\n </intlayer-content-selector-wrapper>\n );\n};\n"],"mappings":"qNAoBA,MAAa,GAER,CAAE,WAAU,gBAAe,eAC9B,EAAA,EAAA,eAAgB,CAEZ,QAAQ,IAAI,0BAA4B,SACxC,CAACA,EAAAA,WACD,OAAO,OAAW,KAGpB,OAAO,oBAAoB,MAAM,CAAE,4BAA6B,CAC9D,GAAwB,EACxB,EACD,CAACA,EAAAA,UAAU,CAAC,CAEVA,EAAAA,WAKH,EAAA,EAAA,KAAC,oCAAD,CACE,WAAU,KAAK,UAAU,EAAQ,CACjC,iBAAgB,EAEf,WACiC,CAAA,CAT7B"}
@@ -1,2 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./useEditor.cjs`),t=({children:t})=>(e.useEditor(),t);exports.EditorProvider=t;
2
- //# sourceMappingURL=EditorProvider.cjs.map
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../IntlayerProvider-sM1gzsx7.cjs`);exports.EditorProvider=e.a;
@@ -1,2 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../client/IntlayerProvider.cjs`);let t=require(`@intlayer/editor/isEnabled`),n=require(`preact/hooks`);const r=()=>{let{locale:r}=(0,n.useContext)(e.IntlayerClientContext),i=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(t.isEnabled)return import(`@intlayer/editor`).then(({initEditorClient:e})=>{let t=e();i.current=t,r&&t.currentLocale.set(r)}),()=>{i.current=null,import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})}},[]),(0,n.useEffect)(()=>{!r||!i.current||i.current.currentLocale.set(r)},[r])};exports.useEditor=r;
2
- //# sourceMappingURL=useEditor.cjs.map
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../IntlayerProvider-sM1gzsx7.cjs`);exports.useEditor=e.o;
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);const e=require(`./plugins.cjs`);let t=require(`@intlayer/core/interpreter`);const n=(n,r)=>(0,t.getDictionary)(n,r,e.getPlugins(r));exports.getDictionary=n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./IntlayerProvider-sM1gzsx7.cjs`);const e=require(`./plugins.cjs`);let t=require(`@intlayer/core/interpreter`);const n=(n,r)=>(0,t.getDictionary)(n,r,e.getPlugins(r));exports.getDictionary=n;
2
2
  //# sourceMappingURL=getDictionary.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getDictionary.cjs","names":["getPlugins"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import { getDictionary as getDictionaryCore } from '@intlayer/core/interpreter';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\nexport const getDictionary = <\n T extends Dictionary,\n L extends LocalesValues = DeclaredLocales,\n>(\n dictionary: T,\n locale?: L\n): DeepTransformContent<T['content']> =>\n getDictionaryCore<T, L>(dictionary, locale, getPlugins(locale)) as any;\n"],"mappings":"4LAQA,MAAa,GAIX,EACA,KAAA,EAAA,EAAA,eAEwB,EAAY,EAAQA,EAAAA,WAAW,EAAO,CAAC"}
1
+ {"version":3,"file":"getDictionary.cjs","names":["getPlugins"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import { getDictionary as getDictionaryCore } from '@intlayer/core/interpreter';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\nexport const getDictionary = <\n T extends Dictionary,\n L extends LocalesValues = DeclaredLocales,\n>(\n dictionary: T,\n locale?: L\n): DeepTransformContent<T['content']> =>\n getDictionaryCore<T, L>(dictionary, locale, getPlugins(locale)) as any;\n"],"mappings":"2LAQA,MAAa,GAIX,EACA,KAAA,EAAA,EAAA,eAEwB,EAAY,EAAQA,EAAAA,WAAW,EAAO,CAAC"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);const e=require(`./plugins.cjs`);let t=require(`@intlayer/core/interpreter`);const n=(n,r)=>(0,t.getIntlayer)(n,r,e.getPlugins(r));exports.getIntlayer=n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./IntlayerProvider-sM1gzsx7.cjs`);const e=require(`./plugins.cjs`);let t=require(`@intlayer/core/interpreter`);const n=(n,r)=>(0,t.getIntlayer)(n,r,e.getPlugins(r));exports.getIntlayer=n;
2
2
  //# sourceMappingURL=getIntlayer.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getIntlayer.cjs","names":["getPlugins"],"sources":["../../src/getIntlayer.ts"],"sourcesContent":["import { getIntlayer as getIntlayerCore } from '@intlayer/core/interpreter';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionaryRegistryContent,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\nexport const getIntlayer = <\n T extends DictionaryKeys,\n L extends LocalesValues = DeclaredLocales,\n>(\n key: T,\n locale?: L\n) =>\n getIntlayerCore<T, L>(\n key,\n locale,\n getPlugins(locale)\n ) as DeepTransformContent<DictionaryRegistryContent<T>>;\n"],"mappings":"4LASA,MAAa,GAIX,EACA,KAAA,EAAA,EAAA,aAGE,EACA,EACAA,EAAAA,WAAW,EAAO,CACnB"}
1
+ {"version":3,"file":"getIntlayer.cjs","names":["getPlugins"],"sources":["../../src/getIntlayer.ts"],"sourcesContent":["import { getIntlayer as getIntlayerCore } from '@intlayer/core/interpreter';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionaryRegistryContent,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\nexport const getIntlayer = <\n T extends DictionaryKeys,\n L extends LocalesValues = DeclaredLocales,\n>(\n key: T,\n locale?: L\n) =>\n getIntlayerCore<T, L>(\n key,\n locale,\n getPlugins(locale)\n ) as DeepTransformContent<DictionaryRegistryContent<T>>;\n"],"mappings":"2LASA,MAAa,GAIX,EACA,KAAA,EAAA,EAAA,aAGE,EACA,EACAA,EAAAA,WAAW,EAAO,CACnB"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`);const r=(0,e.createContext)(void 0),i=()=>(0,t.useContext)(r),a=({children:e,components:t})=>(0,n.jsx)(r.Provider,{value:{components:t},children:e});exports.HTMLProvider=a,exports.useHTMLContext=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../IntlayerProvider-sM1gzsx7.cjs`);let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`);const r=(0,e.createContext)(void 0),i=()=>(0,t.useContext)(r),a=({children:e,components:t})=>(0,n.jsx)(r.Provider,{value:{components:t},children:e});exports.HTMLProvider=a,exports.useHTMLContext=i;
2
2
  //# sourceMappingURL=HTMLProvider.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"HTMLProvider.cjs","names":[],"sources":["../../../src/html/HTMLProvider.tsx"],"sourcesContent":["import {\n createContext,\n type FunctionalComponent,\n type RenderableProps,\n} from 'preact';\nimport { useContext } from 'preact/hooks';\nimport type { HTMLComponents } from './types';\n\ntype HTMLContextValue = {\n components?: HTMLComponents<'permissive', {}>;\n};\n\ntype HTMLProviderProps = RenderableProps<{\n /**\n * Component overrides for HTML tags.\n */\n components?: HTMLComponents<'permissive', {}>;\n}>;\n\nconst HTMLContext = createContext<HTMLContextValue | undefined>(undefined);\n\nexport const useHTMLContext = () => useContext(HTMLContext);\n\nexport const HTMLProvider: FunctionalComponent<HTMLProviderProps> = ({\n children,\n components,\n}) => (\n <HTMLContext.Provider value={{ components }}>{children}</HTMLContext.Provider>\n);\n"],"mappings":"kMAmBA,MAAM,GAAA,EAAA,EAAA,eAA0D,IAAA,GAAU,CAE7D,OAAA,EAAA,EAAA,YAAkC,EAAY,CAE9C,GAAwD,CACnE,WACA,iBAEA,EAAA,EAAA,KAAC,EAAY,SAAb,CAAsB,MAAO,CAAE,aAAY,CAAG,WAAgC,CAAA"}
1
+ {"version":3,"file":"HTMLProvider.cjs","names":[],"sources":["../../../src/html/HTMLProvider.tsx"],"sourcesContent":["import {\n createContext,\n type FunctionalComponent,\n type RenderableProps,\n} from 'preact';\nimport { useContext } from 'preact/hooks';\nimport type { HTMLComponents } from './types';\n\ntype HTMLContextValue = {\n components?: HTMLComponents<'permissive', {}>;\n};\n\ntype HTMLProviderProps = RenderableProps<{\n /**\n * Component overrides for HTML tags.\n */\n components?: HTMLComponents<'permissive', {}>;\n}>;\n\nconst HTMLContext = createContext<HTMLContextValue | undefined>(undefined);\n\nexport const useHTMLContext = () => useContext(HTMLContext);\n\nexport const HTMLProvider: FunctionalComponent<HTMLProviderProps> = ({\n children,\n components,\n}) => (\n <HTMLContext.Provider value={{ components }}>{children}</HTMLContext.Provider>\n);\n"],"mappings":"iMAmBA,MAAM,GAAA,EAAA,EAAA,eAA0D,IAAA,GAAU,CAE7D,OAAA,EAAA,EAAA,YAAkC,EAAY,CAE9C,GAAwD,CACnE,WACA,iBAEA,EAAA,EAAA,KAAC,EAAY,SAAb,CAAsB,MAAO,CAAE,aAAY,CAAG,WAAgC,CAAA"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./HTMLProvider.cjs`);let t=require(`@intlayer/core/interpreter`),n=require(`preact`),r=require(`@intlayer/core/transpiler`);const i=(()=>{let e={};for(let t of r.HTML_TAGS)e[t]=({children:e,...r})=>(0,n.h)(t,r,e);return e})(),a=(e,{components:r}={})=>{let a={...i,...r};return(0,n.h)(n.Fragment,null,(0,t.getHTML)(e,Object.fromEntries(Object.entries(a).filter(([,e])=>e).map(([e,t])=>[e,e=>(0,n.h)(t,e)]))))},o=({components:t}={})=>{let n=e.useHTMLContext();return e=>a(e,{components:{...n?.components,...t}})},s=({children:e=``,html:t,components:n})=>o({components:n})(e||t||``);exports.HTMLRenderer=s,exports.defaultHTMLComponents=i,exports.renderHTML=a,exports.useHTMLRenderer=o;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../IntlayerProvider-sM1gzsx7.cjs`);const e=require(`./HTMLProvider.cjs`);let t=require(`@intlayer/core/interpreter`),n=require(`preact`),r=require(`@intlayer/core/transpiler`);const i=(()=>{let e={};for(let t of r.HTML_TAGS)e[t]=({children:e,...r})=>(0,n.h)(t,r,e);return e})(),a=(e,{components:r}={})=>{let a={...i,...r};return(0,n.h)(n.Fragment,null,(0,t.getHTML)(e,Object.fromEntries(Object.entries(a).filter(([,e])=>e).map(([e,t])=>[e,e=>(0,n.h)(t,e)]))))},o=({components:t}={})=>{let n=e.useHTMLContext();return e=>a(e,{components:{...n?.components,...t}})},s=({children:e=``,html:t,components:n})=>o({components:n})(e||t||``);exports.HTMLRenderer=s,exports.defaultHTMLComponents=i,exports.renderHTML=a,exports.useHTMLRenderer=o;
2
2
  //# sourceMappingURL=HTMLRenderer.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"HTMLRenderer.cjs","names":["HTML_TAGS","Fragment","useHTMLContext"],"sources":["../../../src/html/HTMLRenderer.tsx"],"sourcesContent":["import { getHTML } from '@intlayer/core/interpreter';\nimport { HTML_TAGS } from '@intlayer/core/transpiler';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport { Fragment, type FunctionComponent, h, type JSX } from 'preact';\nimport { useHTMLContext } from './HTMLProvider';\nimport type { HTMLComponents } from './types';\n\n/**\n * Type for Preact HTML tag components.\n */\ntype HTMLTagComponent = (props: {\n children?: any;\n [key: string]: any;\n}) => JSX.Element;\n\nconst createDefaultHTMLComponents = (): Record<string, HTMLTagComponent> => {\n const components: Record<string, HTMLTagComponent> = {};\n\n for (const tag of HTML_TAGS) {\n components[tag] = ({ children, ...props }) =>\n h(tag as any, props, children);\n }\n\n return components;\n};\n\nexport const defaultHTMLComponents = createDefaultHTMLComponents();\n\nexport type RenderHTMLProps = {\n /**\n * Component overrides for HTML tags.\n * Allows you to customize how specific HTML elements are rendered.\n */\n components?: HTMLComponents<'permissive', {}>;\n};\n\n/**\n * Renders HTML-like content to JSX with the provided components.\n *\n * This function does not use context from HTMLProvider. Use `useHTMLRenderer`\n * hook if you want to leverage provider context.\n */\nexport const renderHTML = (\n content: string,\n { components }: RenderHTMLProps = {}\n): JSX.Element => {\n const mergedComponents = {\n ...defaultHTMLComponents,\n ...components,\n };\n\n // Wrap all components to ensure they are rendered via Preact's h\n const wrappedComponents = Object.fromEntries(\n Object.entries(mergedComponents)\n .filter(([, Component]) => Component)\n .map(([key, Component]) => [\n key,\n (props: any) => h(Component as any, props),\n ])\n );\n\n return h(Fragment, null, getHTML(content, wrappedComponents));\n};\n\n/**\n * Hook that returns a function to render HTML content.\n *\n * This hook considers the configuration from the `HTMLProvider` context if available,\n * falling back to the provided components.\n */\nexport const useHTMLRenderer = ({ components }: RenderHTMLProps = {}) => {\n const context = useHTMLContext();\n\n return (content: string) => {\n return renderHTML(content, {\n components: {\n ...context?.components,\n ...components,\n },\n });\n };\n};\n\nexport type HTMLRendererProps = RenderHTMLProps & {\n /**\n * The HTML content to render as a string.\n */\n children?: string;\n /**\n * Alias for children, used by the plugin.\n */\n html?: string;\n /**\n * Alias for components, used by the plugin.\n */\n components?: HTMLComponents<'permissive', {}>;\n dictionaryKey?: string;\n keyPath?: KeyPath[];\n};\n\n/**\n * Preact component that renders HTML-like content to JSX.\n */\nexport const HTMLRenderer: FunctionComponent<HTMLRendererProps> = ({\n children = '',\n html,\n components,\n}) => {\n const render = useHTMLRenderer({ components: components });\n const content = children || html || '';\n\n return render(content);\n};\n"],"mappings":"6PA0BA,MAAa,OAX+D,CAC1E,IAAM,EAA+C,EAAE,CAEvD,IAAK,IAAM,KAAOA,EAAAA,UAChB,EAAW,IAAQ,CAAE,WAAU,GAAG,MAAA,EAAA,EAAA,GAC9B,EAAY,EAAO,EAAS,CAGlC,OAAO,KAGyD,CAgBrD,GACX,EACA,CAAE,cAAgC,EAAE,GACpB,CAChB,IAAM,EAAmB,CACvB,GAAG,EACH,GAAG,EACJ,CAYD,OAAA,EAAA,EAAA,GAASC,EAAAA,SAAU,MAAA,EAAA,EAAA,SAAc,EATP,OAAO,YAC/B,OAAO,QAAQ,EAAiB,CAC7B,QAAQ,EAAG,KAAe,EAAU,CACpC,KAAK,CAAC,EAAK,KAAe,CACzB,EACC,IAAA,EAAA,EAAA,GAAiB,EAAkB,EAAM,CAC3C,CAAC,CACL,CAE2D,CAAC,EASlD,GAAmB,CAAE,cAAgC,EAAE,GAAK,CACvE,IAAM,EAAUC,EAAAA,gBAAgB,CAEhC,MAAQ,IACC,EAAW,EAAS,CACzB,WAAY,CACV,GAAG,GAAS,WACZ,GAAG,EACJ,CACF,CAAC,EAwBO,GAAsD,CACjE,WAAW,GACX,OACA,gBAEe,EAAgB,CAAc,aAAY,CAAC,CAC1C,GAAY,GAAQ,GAEd"}
1
+ {"version":3,"file":"HTMLRenderer.cjs","names":["HTML_TAGS","Fragment","useHTMLContext"],"sources":["../../../src/html/HTMLRenderer.tsx"],"sourcesContent":["import { getHTML } from '@intlayer/core/interpreter';\nimport { HTML_TAGS } from '@intlayer/core/transpiler';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport { Fragment, type FunctionComponent, h, type JSX } from 'preact';\nimport { useHTMLContext } from './HTMLProvider';\nimport type { HTMLComponents } from './types';\n\n/**\n * Type for Preact HTML tag components.\n */\ntype HTMLTagComponent = (props: {\n children?: any;\n [key: string]: any;\n}) => JSX.Element;\n\nconst createDefaultHTMLComponents = (): Record<string, HTMLTagComponent> => {\n const components: Record<string, HTMLTagComponent> = {};\n\n for (const tag of HTML_TAGS) {\n components[tag] = ({ children, ...props }) =>\n h(tag as any, props, children);\n }\n\n return components;\n};\n\nexport const defaultHTMLComponents = createDefaultHTMLComponents();\n\nexport type RenderHTMLProps = {\n /**\n * Component overrides for HTML tags.\n * Allows you to customize how specific HTML elements are rendered.\n */\n components?: HTMLComponents<'permissive', {}>;\n};\n\n/**\n * Renders HTML-like content to JSX with the provided components.\n *\n * This function does not use context from HTMLProvider. Use `useHTMLRenderer`\n * hook if you want to leverage provider context.\n */\nexport const renderHTML = (\n content: string,\n { components }: RenderHTMLProps = {}\n): JSX.Element => {\n const mergedComponents = {\n ...defaultHTMLComponents,\n ...components,\n };\n\n // Wrap all components to ensure they are rendered via Preact's h\n const wrappedComponents = Object.fromEntries(\n Object.entries(mergedComponents)\n .filter(([, Component]) => Component)\n .map(([key, Component]) => [\n key,\n (props: any) => h(Component as any, props),\n ])\n );\n\n return h(Fragment, null, getHTML(content, wrappedComponents));\n};\n\n/**\n * Hook that returns a function to render HTML content.\n *\n * This hook considers the configuration from the `HTMLProvider` context if available,\n * falling back to the provided components.\n */\nexport const useHTMLRenderer = ({ components }: RenderHTMLProps = {}) => {\n const context = useHTMLContext();\n\n return (content: string) => {\n return renderHTML(content, {\n components: {\n ...context?.components,\n ...components,\n },\n });\n };\n};\n\nexport type HTMLRendererProps = RenderHTMLProps & {\n /**\n * The HTML content to render as a string.\n */\n children?: string;\n /**\n * Alias for children, used by the plugin.\n */\n html?: string;\n /**\n * Alias for components, used by the plugin.\n */\n components?: HTMLComponents<'permissive', {}>;\n dictionaryKey?: string;\n keyPath?: KeyPath[];\n};\n\n/**\n * Preact component that renders HTML-like content to JSX.\n */\nexport const HTMLRenderer: FunctionComponent<HTMLRendererProps> = ({\n children = '',\n html,\n components,\n}) => {\n const render = useHTMLRenderer({ components: components });\n const content = children || html || '';\n\n return render(content);\n};\n"],"mappings":"4PA0BA,MAAa,OAX+D,CAC1E,IAAM,EAA+C,EAAE,CAEvD,IAAK,IAAM,KAAOA,EAAAA,UAChB,EAAW,IAAQ,CAAE,WAAU,GAAG,MAAA,EAAA,EAAA,GAC9B,EAAY,EAAO,EAAS,CAGlC,OAAO,KAGyD,CAgBrD,GACX,EACA,CAAE,cAAgC,EAAE,GACpB,CAChB,IAAM,EAAmB,CACvB,GAAG,EACH,GAAG,EACJ,CAYD,OAAA,EAAA,EAAA,GAASC,EAAAA,SAAU,MAAA,EAAA,EAAA,SAAc,EATP,OAAO,YAC/B,OAAO,QAAQ,EAAiB,CAC7B,QAAQ,EAAG,KAAe,EAAU,CACpC,KAAK,CAAC,EAAK,KAAe,CACzB,EACC,IAAA,EAAA,EAAA,GAAiB,EAAkB,EAAM,CAC3C,CAAC,CACL,CAE2D,CAAC,EASlD,GAAmB,CAAE,cAAgC,EAAE,GAAK,CACvE,IAAM,EAAUC,EAAAA,gBAAgB,CAEhC,MAAQ,IACC,EAAW,EAAS,CACzB,WAAY,CACV,GAAG,GAAS,WACZ,GAAG,EACJ,CACF,CAAC,EAwBO,GAAsD,CACjE,WAAW,GACX,OACA,gBAEe,EAAgB,CAAc,aAAY,CAAC,CAC1C,GAAY,GAAQ,GAEd"}