lit-intlayer 9.5.9 → 9.5.10

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 (53) hide show
  1. package/dist/cjs/client/IntlayerBinding.cjs +1 -1
  2. package/dist/cjs/client/index.cjs +1 -1
  3. package/dist/cjs/client/installIntlayer.cjs +1 -1
  4. package/dist/cjs/client/useDictionary.cjs +1 -1
  5. package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
  6. package/dist/cjs/client/useIntlayer.cjs +1 -1
  7. package/dist/cjs/client/useLocale.cjs +1 -1
  8. package/dist/cjs/client/useLocaleStorage.cjs +1 -1
  9. package/dist/cjs/client/useRewriteURL.cjs +1 -1
  10. package/dist/cjs/editor/useEditor.cjs +1 -1
  11. package/dist/cjs/format/useCompact.cjs +1 -1
  12. package/dist/cjs/format/useCurrency.cjs +1 -1
  13. package/dist/cjs/format/useDate.cjs +1 -1
  14. package/dist/cjs/format/useIntl.cjs +1 -1
  15. package/dist/cjs/format/useList.cjs +1 -1
  16. package/dist/cjs/format/useNumber.cjs +1 -1
  17. package/dist/cjs/format/usePercentage.cjs +1 -1
  18. package/dist/cjs/format/useRelativeTime.cjs +1 -1
  19. package/dist/cjs/format/useUnit.cjs +1 -1
  20. package/dist/cjs/index.cjs +1 -1
  21. package/dist/cjs/plugins.cjs +1 -1
  22. package/dist/cjs/renderIntlayerNode.cjs +1 -1
  23. package/dist/esm/client/IntlayerBinding.mjs +1 -1
  24. package/dist/esm/client/index.mjs +9 -9
  25. package/dist/esm/client/installIntlayer.mjs +1 -1
  26. package/dist/esm/client/useDictionary.mjs +1 -1
  27. package/dist/esm/client/useDictionaryDynamic.mjs +1 -1
  28. package/dist/esm/client/useIntlayer.mjs +1 -1
  29. package/dist/esm/client/useLocale.mjs +1 -1
  30. package/dist/esm/client/useLocaleStorage.mjs +10 -10
  31. package/dist/esm/client/useRewriteURL.mjs +1 -1
  32. package/dist/esm/editor/useEditor.mjs +1 -1
  33. package/dist/esm/format/useCompact.mjs +1 -1
  34. package/dist/esm/format/useCurrency.mjs +1 -1
  35. package/dist/esm/format/useDate.mjs +1 -1
  36. package/dist/esm/format/useIntl.mjs +1 -1
  37. package/dist/esm/format/useList.mjs +1 -1
  38. package/dist/esm/format/useNumber.mjs +1 -1
  39. package/dist/esm/format/usePercentage.mjs +1 -1
  40. package/dist/esm/format/useRelativeTime.mjs +1 -1
  41. package/dist/esm/format/useUnit.mjs +1 -1
  42. package/dist/esm/index.mjs +12 -12
  43. package/dist/esm/plugins.mjs +49 -47
  44. package/dist/esm/renderIntlayerNode.mjs +15 -25
  45. package/dist/{installIntlayer-DT6bzUDN.mjs → installIntlayer-fyL4SuHX.mjs} +19 -18
  46. package/dist/installIntlayer-tZQDhvqk.js +1 -0
  47. package/dist/types/client/installIntlayer.d.ts.map +1 -1
  48. package/dist/types/client/useLocaleStorage.d.ts +14 -4
  49. package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
  50. package/dist/types/plugins.d.ts.map +1 -1
  51. package/dist/types/renderIntlayerNode.d.ts.map +1 -1
  52. package/package.json +9 -9
  53. package/dist/installIntlayer-DOvWQYtw.js +0 -1
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js");var t=class{host;unsubscribeLocale=null;onConnect;onDisconnect;constructor(e,t,n){this.host=e,this.onConnect=t,this.onDisconnect=n,this.host.addController(this)}hostConnected(){let t=e.r();this.unsubscribeLocale=t.subscribe(()=>{this.host.requestUpdate()}),this.onConnect?.()}hostDisconnected(){this.unsubscribeLocale?.(),this.unsubscribeLocale=null,this.onDisconnect?.()}};exports.IntlayerBinding=t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js");var t=class{host;unsubscribeLocale=null;onConnect;onDisconnect;constructor(e,t,n){this.host=e,this.onConnect=t,this.onDisconnect=n,this.host.addController(this)}hostConnected(){let t=e.r();this.unsubscribeLocale=t.subscribe(()=>{this.host.requestUpdate()}),this.onConnect?.()}hostDisconnected(){this.unsubscribeLocale?.(),this.unsubscribeLocale=null,this.onDisconnect?.()}};exports.IntlayerBinding=t;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js"),t=require("./IntlayerBinding.cjs"),n=require("./useDictionary.cjs"),r=require("./useDictionaryDynamic.cjs"),i=require("./useIntlayer.cjs"),a=require("./useLocaleStorage.cjs"),o=require("./useLocale.cjs"),s=require("./useRewriteURL.cjs");exports.IntlayerBinding=t.IntlayerBinding,exports.IntlayerClient=e.t,exports.LocaleController=o.LocaleController,exports.createIntlayerClient=e.n,exports.getIntlayerClient=e.r,exports.installIntlayer=e.i,exports.localeCookie=a.localeCookie,exports.localeInStorage=a.localeInStorage,exports.setLocaleCookie=a.setLocaleCookie,exports.setLocaleInStorage=a.setLocaleInStorage,exports.useDictionary=n.useDictionary,exports.useDictionaryDynamic=r.useDictionaryDynamic,exports.useIntlayer=i.useIntlayer,exports.useLocale=o.useLocale,exports.useLocaleCookie=a.useLocaleCookie,exports.useLocaleStorage=a.useLocaleStorage,exports.useRewriteURL=s.useRewriteURL;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js"),t=require("./useLocaleStorage.cjs"),n=require("./IntlayerBinding.cjs"),r=require("./useDictionary.cjs"),i=require("./useDictionaryDynamic.cjs"),a=require("./useIntlayer.cjs"),o=require("./useLocale.cjs"),s=require("./useRewriteURL.cjs");exports.IntlayerBinding=n.IntlayerBinding,exports.IntlayerClient=e.t,exports.LocaleController=o.LocaleController,exports.createIntlayerClient=e.n,exports.getIntlayerClient=e.r,exports.getLocaleInStorage=t.getLocaleInStorage,exports.installIntlayer=e.i,exports.localeCookie=t.localeCookie,exports.localeInStorage=t.localeInStorage,exports.setLocaleCookie=t.setLocaleCookie,exports.setLocaleInStorage=t.setLocaleInStorage,exports.useDictionary=r.useDictionary,exports.useDictionaryDynamic=i.useDictionaryDynamic,exports.useIntlayer=a.useIntlayer,exports.useLocale=o.useLocale,exports.useLocaleCookie=t.useLocaleCookie,exports.useLocaleStorage=t.useLocaleStorage,exports.useRewriteURL=s.useRewriteURL;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js");exports.IntlayerClient=e.t,exports.createIntlayerClient=e.n,exports.getIntlayerClient=e.r,exports.installIntlayer=e.i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js");exports.IntlayerClient=e.t,exports.createIntlayerClient=e.n,exports.getIntlayerClient=e.r,exports.installIntlayer=e.i;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js"),t=require("../getDictionary.cjs"),n=require("./IntlayerBinding.cjs");let r=require("@intlayer/config/built"),i=require("@intlayer/core/dictionaryManipulator");var a=(a,o)=>{let s=e.r(),c=process.env.INTLAYER_DICTIONARY_SELECTOR!==`false`&&typeof o==`object`&&o?o.locale:o,l=e=>process.env.INTLAYER_DICTIONARY_SELECTOR===`false`?t.getDictionary(a,e):t.getDictionary(a,(0,i.resolveDictionaryArgument)({localeOrSelector:o,contextLocale:e,contextVariant:s.variant,dictionaryKey:a.key})),u=l(c??s.locale??r.internationalization.defaultLocale);s.subscribe(e=>{u=l(c??e)});let d,f=new Proxy({},{get(e,t){if(t===`observe`)return d;if(t===Symbol.toPrimitive)return()=>u?.[Symbol.toPrimitive]?.()??``;if(t===`toString`)return()=>String(u?.toString?.()??``);if(t!==`then`&&u!=null)return u[t]}});return d=e=>(new n.IntlayerBinding(e),f),f};exports.useDictionary=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js"),t=require("../getDictionary.cjs"),n=require("./IntlayerBinding.cjs");let r=require("@intlayer/config/built"),i=require("@intlayer/core/dictionaryManipulator");var a=(a,o)=>{let s=e.r(),c=process.env.INTLAYER_DICTIONARY_SELECTOR!==`false`&&typeof o==`object`&&o?o.locale:o,l=e=>process.env.INTLAYER_DICTIONARY_SELECTOR===`false`?t.getDictionary(a,e):t.getDictionary(a,(0,i.resolveDictionaryArgument)({localeOrSelector:o,contextLocale:e,contextVariant:s.variant,dictionaryKey:a.key})),u=l(c??s.locale??r.internationalization.defaultLocale);s.subscribe(e=>{u=l(c??e)});let d,f=new Proxy({},{get(e,t){if(t===`observe`)return d;if(t===Symbol.toPrimitive)return()=>u?.[Symbol.toPrimitive]?.()??``;if(t===`toString`)return()=>String(u?.toString?.()??``);if(t!==`then`&&u!=null)return u[t]}});return d=e=>(new n.IntlayerBinding(e),f),f};exports.useDictionary=a;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js"),t=require("../getDictionary.cjs"),n=require("./IntlayerBinding.cjs");let r=require("@intlayer/config/built"),i=require("@intlayer/core/dictionaryManipulator");var a=new Map,o=async(e,t)=>{if(!t)return;if(a.has(e))return a.get(e);let n=await t();return a.set(e,n),n},s=new Proxy(()=>{},{get:(e,t)=>{if(t===Symbol.toPrimitive||t===`toString`)return()=>``;if(t!==`then`&&!(typeof t==`string`&&t.startsWith(`_$`))&&t!==`nodeType`&&t!==Symbol.iterator)return s},apply:()=>s,construct:()=>({})}),c=(c,l,u)=>{let d=e.r(),f=process.env.INTLAYER_DICTIONARY_SELECTOR!==`false`&&(0,i.isQualifiedDynamicLoaderMap)(c),{locale:p,selector:m}=process.env.INTLAYER_DICTIONARY_SELECTOR===`false`?{locale:u,selector:void 0}:(0,i.parseDictionarySelector)((0,i.resolveDictionaryArgument)({localeOrSelector:u,contextLocale:d.locale,contextVariant:d.variant,dictionaryKey:String(l)})),h=()=>p??d.locale??r.internationalization.defaultLocale,g,_=new Set,v=()=>{for(let e of _)e()},y=e=>{if(f){(0,i.resolveQualifiedDynamicContentAsync)({loaderMap:c,key:String(l),locale:e,selector:m,transform:n=>t.getDictionary(n,e)}).then(e=>{g=e,v()});return}let n=`${String(l)}.${e}`,r=(0,i.getPreloadedDictionary)(c,e);if(r){a.set(n,r),g=t.getDictionary(r,e),v();return}let s=c[e];o(n,s).then(n=>{n&&(g=t.getDictionary(n,e),v())})};y(h()),d.subscribe(e=>{y(p??e)});let b,x=new Proxy({},{get(e,t){if(t===`observe`)return b;if(t===Symbol.toPrimitive)return()=>void 0;if(t===`toString`)return()=>``;if(t!==`then`)return g==null?s:g[t]}});return b=e=>{let t=()=>e.requestUpdate();return _.add(t),new n.IntlayerBinding(e,()=>{g!=null&&e.requestUpdate()},()=>{_.delete(t)}),x},x};exports.useDictionaryDynamic=c;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js"),t=require("../getDictionary.cjs"),n=require("./IntlayerBinding.cjs");let r=require("@intlayer/config/built"),i=require("@intlayer/core/dictionaryManipulator");var a=new Map,o=async(e,t)=>{if(!t)return;if(a.has(e))return a.get(e);let n=await t();return a.set(e,n),n},s=new Proxy(()=>{},{get:(e,t)=>{if(t===Symbol.toPrimitive||t===`toString`)return()=>``;if(t!==`then`&&!(typeof t==`string`&&t.startsWith(`_$`))&&t!==`nodeType`&&t!==Symbol.iterator)return s},apply:()=>s,construct:()=>({})}),c=(c,l,u)=>{let d=e.r(),f=process.env.INTLAYER_DICTIONARY_SELECTOR!==`false`&&(0,i.isQualifiedDynamicLoaderMap)(c),{locale:p,selector:m}=process.env.INTLAYER_DICTIONARY_SELECTOR===`false`?{locale:u,selector:void 0}:(0,i.parseDictionarySelector)((0,i.resolveDictionaryArgument)({localeOrSelector:u,contextLocale:d.locale,contextVariant:d.variant,dictionaryKey:String(l)})),h=()=>p??d.locale??r.internationalization.defaultLocale,g,_=new Set,v=()=>{for(let e of _)e()},y=e=>{if(f){(0,i.resolveQualifiedDynamicContentAsync)({loaderMap:c,key:String(l),locale:e,selector:m,transform:n=>t.getDictionary(n,e)}).then(e=>{g=e,v()});return}let n=`${String(l)}.${e}`,r=(0,i.getPreloadedDictionary)(c,e);if(r){a.set(n,r),g=t.getDictionary(r,e),v();return}let s=c[e];o(n,s).then(n=>{n&&(g=t.getDictionary(n,e),v())})};y(h()),d.subscribe(e=>{y(p??e)});let b,x=new Proxy({},{get(e,t){if(t===`observe`)return b;if(t===Symbol.toPrimitive)return()=>void 0;if(t===`toString`)return()=>``;if(t!==`then`)return g==null?s:g[t]}});return b=e=>{let t=()=>e.requestUpdate();return _.add(t),new n.IntlayerBinding(e,()=>{g!=null&&e.requestUpdate()},()=>{_.delete(t)}),x},x};exports.useDictionaryDynamic=c;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js"),t=require("../getIntlayer.cjs"),n=require("./IntlayerBinding.cjs");let r=require("@intlayer/config/built"),i=require("@intlayer/core/dictionaryManipulator");var a=(a,o)=>{let s=e.r(),c=process.env.INTLAYER_DICTIONARY_SELECTOR!==`false`&&typeof o==`object`&&o?o.locale:o,l=e=>process.env.INTLAYER_DICTIONARY_SELECTOR===`false`?t.getIntlayer(a,e):t.getIntlayer(a,(0,i.resolveDictionaryArgument)({localeOrSelector:o,contextLocale:e,contextVariant:s.variant,dictionaryKey:a})),u,d,f=!1,p=new Proxy({},{get(e,t){if(t===`observe`)return e=>(new n.IntlayerBinding(e),p);if(t===Symbol.toPrimitive||t===`toString`)return()=>``;if(t===`then`||typeof t==`symbol`||typeof t==`string`&&t.startsWith(`_$`))return;let i=c??s.locale??r.internationalization.defaultLocale;if((!f||u!==i)&&(d=l(i),u=i,f=!0),d!=null)return d[t]}});return p};exports.useIntlayer=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js"),t=require("../getIntlayer.cjs"),n=require("./IntlayerBinding.cjs");let r=require("@intlayer/config/built"),i=require("@intlayer/core/dictionaryManipulator");var a=(a,o)=>{let s=e.r(),c=process.env.INTLAYER_DICTIONARY_SELECTOR!==`false`&&typeof o==`object`&&o?o.locale:o,l=e=>process.env.INTLAYER_DICTIONARY_SELECTOR===`false`?t.getIntlayer(a,e):t.getIntlayer(a,(0,i.resolveDictionaryArgument)({localeOrSelector:o,contextLocale:e,contextVariant:s.variant,dictionaryKey:a})),u,d,f=!1,p=new Proxy({},{get(e,t){if(t===`observe`)return e=>(new n.IntlayerBinding(e),p);if(t===Symbol.toPrimitive||t===`toString`)return()=>``;if(t===`then`||typeof t==`symbol`||typeof t==`string`&&t.startsWith(`_$`))return;let i=c??s.locale??r.internationalization.defaultLocale;if((!f||u!==i)&&(d=l(i),u=i,f=!0),d!=null)return d[t]}});return p};exports.useIntlayer=a;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js"),t=require("./useLocaleStorage.cjs");let n=require("@intlayer/config/built");var r=class{host;_isCookieEnabled;_onLocaleChange;_unsubscribe=null;locale;defaultLocale;availableLocales;constructor(t,r={}){this.host=t,this._isCookieEnabled=r.isCookieEnabled,this._onLocaleChange=r.onLocaleChange;let i=e.r(),{defaultLocale:a,locales:o}=n.internationalization??{};this.locale=i.locale,this.defaultLocale=a,this.availableLocales=o??[],t.addController(this)}setLocale=n=>{if(!this.availableLocales.map(String).includes(n)){console.error(`Locale "${n}" is not available.`);return}let r=e.r();r.setLocale(n),t.setLocaleInStorage(n,this._isCookieEnabled??r.isCookieEnabled??!0),this._onLocaleChange?.(n)};hostConnected(){let t=e.r();this._unsubscribe=t.subscribe(e=>{this.locale=e,this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},i=(e,t={})=>new r(e,t);exports.LocaleController=r,exports.useLocale=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js"),t=require("./useLocaleStorage.cjs");let n=require("@intlayer/config/built");var r=class{host;_isCookieEnabled;_onLocaleChange;_unsubscribe=null;locale;defaultLocale;availableLocales;constructor(t,r={}){this.host=t,this._isCookieEnabled=r.isCookieEnabled,this._onLocaleChange=r.onLocaleChange;let i=e.r(),{defaultLocale:a,locales:o}=n.internationalization??{};this.locale=i.locale,this.defaultLocale=a,this.availableLocales=o??[],t.addController(this)}setLocale=n=>{if(!this.availableLocales.map(String).includes(n)){console.error(`Locale "${n}" is not available.`);return}let r=e.r();r.setLocale(n),t.setLocaleInStorage(n,this._isCookieEnabled??r.isCookieEnabled??!0),this._onLocaleChange?.(n)};hostConnected(){let t=e.r();this._unsubscribe=t.subscribe(e=>{this.locale=e,this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},i=(e,t={})=>new r(e,t);exports.LocaleController=r,exports.useLocale=i;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/utils");var t=(0,e.getLocaleFromStorageClient)(e.localeStorageOptions),n=t,r=(t,n)=>(0,e.setLocaleInStorageClient)(t,{...e.localeStorageOptions,isCookieEnabled:n}),i=r,a=t=>{let n=(0,e.LocaleStorageClient)({...e.localeStorageOptions,isCookieEnabled:t});return{localeStorage:n.getLocale(),setLocaleStorage:n.setLocale}},o=a;exports.localeCookie=n,exports.localeInStorage=t,exports.setLocaleCookie=i,exports.setLocaleInStorage=r,exports.useLocaleCookie=o,exports.useLocaleStorage=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/utils");var t=e.getCachedLocaleFromStorageClient,n=(0,e.getLocaleFromStorageClient)(e.localeStorageOptions),r=n,i=(t,n)=>(0,e.setLocaleInStorageClient)(t,{...e.localeStorageOptions,isCookieEnabled:n}),a=i,o=t=>{let n=(0,e.LocaleStorageClient)({...e.localeStorageOptions,isCookieEnabled:t});return{localeStorage:n.getLocale(),setLocaleStorage:n.setLocale}},s=o;exports.getLocaleInStorage=t,exports.localeCookie=r,exports.localeInStorage=n,exports.setLocaleCookie=a,exports.setLocaleInStorage=i,exports.useLocaleCookie=s,exports.useLocaleStorage=o;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js");let t=require("@intlayer/config/built"),n=require("@intlayer/core/localization");var r=class{_host;_unsubscribe=null;constructor(e){this._host=e,e.addController(this)}_rewrite(e){let r=t.routing?.rewrite;if(typeof window>`u`||!r)return;let i=window.location.pathname,a=(0,n.getRewritePath)(i,e,r);a&&a!==i&&window.history.replaceState(window.history.state,``,a+window.location.search+window.location.hash)}hostConnected(){let t=e.r();this._rewrite(t.locale),this._unsubscribe=t.subscribe(e=>{this._rewrite(e)})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},i=e=>{new r(e)};exports.useRewriteURL=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js");let t=require("@intlayer/config/built"),n=require("@intlayer/core/localization");var r=class{_host;_unsubscribe=null;constructor(e){this._host=e,e.addController(this)}_rewrite(e){let r=t.routing?.rewrite;if(typeof window>`u`||!r)return;let i=window.location.pathname,a=(0,n.getRewritePath)(i,e,r);a&&a!==i&&window.history.replaceState(window.history.state,``,a+window.location.search+window.location.hash)}hostConnected(){let t=e.r();this._rewrite(t.locale),this._unsubscribe=t.subscribe(e=>{this._rewrite(e)})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},i=e=>{new r(e)};exports.useRewriteURL=i;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js");exports.useEditor=e.a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js");exports.useEditor=e.a;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.compact)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.compact)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useCompact=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.compact)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.compact)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useCompact=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.currency)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.currency)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useCurrency=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.currency)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.currency)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useCurrency=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>{let n=typeof e[1]==`string`?{...t.presets[e[1]],locale:r.locale}:{...e[1],locale:e[1]?.locale??r.locale};return(0,t.date)(e[0],n)},n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>{let r=typeof n[1]==`string`?{...t.presets[n[1]],locale:e}:{...n[1],locale:n[1]?.locale??e};return(0,t.date)(n[0],r)},this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useDate=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>{let n=typeof e[1]==`string`?{...t.presets[e[1]],locale:r.locale}:{...e[1],locale:e[1]?.locale??r.locale};return(0,t.date)(e[0],n)},n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>{let r=typeof n[1]==`string`?{...t.presets[n[1]],locale:e}:{...n[1],locale:n[1]?.locale??e};return(0,t.date)(n[0],r)},this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useDate=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js");let t=require("@intlayer/core/utils");var n=class{host;_overrideLocale;_unsubscribe=null;value;constructor(n,r){this.host=n,this._overrideLocale=r;let i=e.r();this.value=(0,t.bindIntl)(this._overrideLocale??i.locale),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(0,t.bindIntl)(this._overrideLocale??e),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=(e,t)=>new n(e,t);exports.useIntl=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js");let t=require("@intlayer/core/utils");var n=class{host;_overrideLocale;_unsubscribe=null;value;constructor(n,r){this.host=n,this._overrideLocale=r;let i=e.r();this.value=(0,t.bindIntl)(this._overrideLocale??i.locale),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(0,t.bindIntl)(this._overrideLocale??e),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=(e,t)=>new n(e,t);exports.useIntl=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.list)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.list)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useList=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.list)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.list)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useList=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.number)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.number)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useNumber=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.number)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.number)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useNumber=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.percentage)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.percentage)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.usePercentage=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.percentage)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.percentage)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.usePercentage=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.relativeTime)(e[0],e[1],{...e[2],locale:e[2]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.relativeTime)(n[0],n[1],{...n[2],locale:n[2]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useRelativeTime=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.relativeTime)(e[0],e[1],{...e[2],locale:e[2]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.relativeTime)(n[0],n[1],{...n[2],locale:n[2]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useRelativeTime=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.units)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.units)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useUnit=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-tZQDhvqk.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.units)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.units)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useUnit=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../installIntlayer-DOvWQYtw.js"),t=require("./plugins.cjs"),n=require("./getDictionary.cjs"),r=require("./getIntlayer.cjs"),i=require("./client/IntlayerBinding.cjs"),a=require("./client/useDictionary.cjs"),o=require("./client/useDictionaryDynamic.cjs"),s=require("./client/useIntlayer.cjs"),c=require("./client/useLocaleStorage.cjs"),l=require("./client/useLocale.cjs"),u=require("./client/useRewriteURL.cjs");require("./client/index.cjs"),exports.IntlayerBinding=i.IntlayerBinding,exports.IntlayerClient=e.t,exports.LocaleController=l.LocaleController,exports.createIntlayerClient=e.n,exports.getDictionary=n.getDictionary,exports.getIntlayer=r.getIntlayer,exports.getIntlayerClient=e.r,exports.getPlugins=t.getPlugins,exports.htmlPlugin=t.htmlPlugin,exports.insertionPlugin=t.insertionPlugin,exports.installIntlayer=e.i,exports.intlayerNodePlugins=t.intlayerNodePlugins,exports.localeCookie=c.localeCookie,exports.localeInStorage=c.localeInStorage,exports.markdownPlugin=t.markdownPlugin,exports.markdownStringPlugin=t.markdownStringPlugin,exports.setLocaleCookie=c.setLocaleCookie,exports.setLocaleInStorage=c.setLocaleInStorage,exports.useDictionary=a.useDictionary,exports.useDictionaryDynamic=o.useDictionaryDynamic,exports.useEditor=e.a,exports.useIntlayer=s.useIntlayer,exports.useLocale=l.useLocale,exports.useLocaleCookie=c.useLocaleCookie,exports.useLocaleStorage=c.useLocaleStorage,exports.useRewriteURL=u.useRewriteURL;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../installIntlayer-tZQDhvqk.js"),t=require("./client/useLocaleStorage.cjs"),n=require("./plugins.cjs"),r=require("./getDictionary.cjs"),i=require("./getIntlayer.cjs"),a=require("./client/IntlayerBinding.cjs"),o=require("./client/useDictionary.cjs"),s=require("./client/useDictionaryDynamic.cjs"),c=require("./client/useIntlayer.cjs"),l=require("./client/useLocale.cjs"),u=require("./client/useRewriteURL.cjs");require("./client/index.cjs"),exports.IntlayerBinding=a.IntlayerBinding,exports.IntlayerClient=e.t,exports.LocaleController=l.LocaleController,exports.createIntlayerClient=e.n,exports.getDictionary=r.getDictionary,exports.getIntlayer=i.getIntlayer,exports.getIntlayerClient=e.r,exports.getLocaleInStorage=t.getLocaleInStorage,exports.getPlugins=n.getPlugins,exports.htmlPlugin=n.htmlPlugin,exports.insertionPlugin=n.insertionPlugin,exports.installIntlayer=e.i,exports.intlayerNodePlugins=n.intlayerNodePlugins,exports.localeCookie=t.localeCookie,exports.localeInStorage=t.localeInStorage,exports.markdownPlugin=n.markdownPlugin,exports.markdownStringPlugin=n.markdownStringPlugin,exports.setLocaleCookie=t.setLocaleCookie,exports.setLocaleInStorage=t.setLocaleInStorage,exports.useDictionary=o.useDictionary,exports.useDictionaryDynamic=s.useDictionaryDynamic,exports.useEditor=e.a,exports.useIntlayer=c.useIntlayer,exports.useLocale=l.useLocale,exports.useLocaleCookie=t.useLocaleCookie,exports.useLocaleStorage=t.useLocaleStorage,exports.useRewriteURL=u.useRewriteURL;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});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,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));const c=require("../installIntlayer-DOvWQYtw.js"),l=require("./markdown/runtime.cjs"),u=require("./renderIntlayerNode.cjs");let d=require("@intlayer/core/interpreter"),f=require("@intlayer/config/built"),p=require("@intlayer/core/markdown"),m=require("@intlayer/types/nodeType");m=s(m);let h=require("lit/directives/unsafe-html.js"),g=require("lit/static-html.js");var _=(e=``,t={})=>(0,p.compileWithOptions)(e,l.default,t),v=(e,t,n={})=>{let r=typeof e==`string`?(0,h.unsafeHTML)(e):e;return new Proxy(r,{get(e,r,i){if(r===`value`||r===`raw`)return t;if(r===`toString`||r===Symbol.toPrimitive)return()=>t;if(r!==Symbol.iterator)return r===`__update`?()=>{}:r===`isJSX`?!0:r in n?n[r]:Reflect.get(e,r,i)}})},y=e=>e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`),b=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),x={id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(e,{children:t,keyPath:n,dictionaryKey:r,...i})=>{if(process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled){let e=String(t??``);return v(`<intlayer-content-selector-wrapper key-path="${y(JSON.stringify(n??[]))}" dictionary-key="${y(String(r??``))}">${b(e)}</intlayer-content-selector-wrapper>`,e)}return u.renderIntlayerNode({...i,value:t,children:t})}},S=process.env.INTLAYER_NODE_TYPE_INSERTION===`false`?d.fallbackPlugin:{id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===m.INSERTION,transform:(e,t,n)=>{let r=[...t.keyPath,{type:m.INSERTION}],i=e[m.INSERTION],a={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`||(0,d.isInterpolableWrapperNode)(e),transform:(e,n,r)=>{if((0,d.isInterpolableWrapperNode)(e))return i=>(0,d.transformInterpolableNode)(e,i,n,t.plugins,r);let i=r(e,{...n,children:e,plugins:(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)});return e=>{let a=(0,d.splitInsertionTemplate)(i,e),o=a.isSimple?a.parts:a.parts.join(``);return r(o,{...n,plugins:t.plugins,children:o})}}},o=n(i,{...t,children:i,keyPath:r,plugins:[a,...t.plugins??[]]});return(0,d.resolveInsertedSelector)(i,o)}},C=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?d.fallbackPlugin:{id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,t,n)=>{let{plugins:r,...i}=t,{keyPath:a,dictionaryKey:o}=i,s=n((0,p.getMarkdownMetadata)(e)??{},{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>u.renderIntlayerNode({...n,value:t,children:e})}],dictionaryKey:i.dictionaryKey,keyPath:[]}),c=_(e),l=t=>{let n=_(e,{components:t});return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?v(`<intlayer-content-selector-wrapper key-path="${y(JSON.stringify(a??[]))}" dictionary-key="${y(String(o??``))}">${n}</intlayer-content-selector-wrapper>`,e):v(n,e)};return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?v(`<intlayer-content-selector-wrapper key-path="${y(JSON.stringify(a??[]))}" dictionary-key="${y(String(o??``))}">${c}</intlayer-content-selector-wrapper>`,e,{metadata:s,use:l}):v(c,e,{metadata:s,use:l})}},w=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?d.fallbackPlugin:{id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===m.MARKDOWN,transform:(e,t,n)=>{let r=[...t.keyPath,{type:m.MARKDOWN}],i=e[m.MARKDOWN];return n(i,{...t,children:i,keyPath:r,plugins:[C,...t.plugins??[]]})}},T=process.env.INTLAYER_NODE_TYPE_HTML===`false`?d.fallbackPlugin:{id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===m.HTML,transform:(e,t)=>{let n=e[m.HTML],{keyPath:r,dictionaryKey:i}=t,a=(e={})=>{let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e).map(([e,t])=>[e,e=>t(e)])),a=new Proxy(t,{get(e,t){if(typeof t==`string`&&t in e)return e[t];if(typeof t==`string`&&/^[a-z][a-z0-9]*$/.test(t))return e=>g.html`<${(0,g.unsafeStatic)(t)} ...${e}>${e.children}</${(0,g.unsafeStatic)(t)}>`}}),o=(0,d.getHTML)(n,a);return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?v(`<intlayer-content-selector-wrapper key-path="${y(JSON.stringify(r??[]))}" dictionary-key="${y(String(i??``))}">${o}</intlayer-content-selector-wrapper>`,n):v(o,n)};return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?v(`<intlayer-content-selector-wrapper key-path="${y(JSON.stringify(r??[]))}" dictionary-key="${y(String(i??``))}">${n}</intlayer-content-selector-wrapper>`,n,{use:a}):v(n,n,{use:a})}},E=new Map,D=(e,t=!0)=>{let n=e??(typeof window<`u`&&c.r()?.locale)??f.internationalization.defaultLocale,r=`${n}_${t}`;if(E.has(r))return E.get(r);let i=[(0,d.translationPlugin)(e??f.internationalization.defaultLocale,t?f.internationalization.defaultLocale:void 0),d.enumerationPlugin,(0,d.pluralPlugin)(n),d.conditionPlugin,(0,d.nestedPlugin)(n),d.filePlugin,d.genderPlugin,d.selectPlugin,x,S,w,T];return E.set(r,i),i};exports.getPlugins=D,exports.htmlPlugin=T,exports.insertionPlugin=S,exports.intlayerNodePlugins=x,exports.markdownPlugin=w,exports.markdownStringPlugin=C;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});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,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));const c=require("../installIntlayer-tZQDhvqk.js"),l=require("./markdown/runtime.cjs"),u=require("./renderIntlayerNode.cjs");let d=require("@intlayer/core/interpreter"),f=require("@intlayer/config/built"),p=require("@intlayer/core/markdown"),m=require("@intlayer/core/utils"),h=require("@intlayer/types/nodeType");h=s(h);let g=require("lit/directives/unsafe-html.js"),_=require("lit/static-html.js");var v=(e=``,t={})=>(0,p.compileWithOptions)(e,l.default,t),y=(e,t,n={})=>{let r=typeof e==`string`?(0,g.unsafeHTML)(e):e,i=Array.isArray(r),a=Object.assign(i?[...r]:{...r},n,{value:t,raw:t,[Symbol.iterator]:void 0,__update:()=>{},isJSX:!0});return Object.setPrototypeOf(a,(0,m.getIntlayerNodePrototype)(t,i?Array.prototype:Object.prototype))},b=e=>e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`),x=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),S={id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(e,{children:t,keyPath:n,dictionaryKey:r})=>{if(process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled){let e=String(t??``);return y(`<intlayer-content-selector-wrapper key-path="${b(JSON.stringify(n??[]))}" dictionary-key="${b(String(r??``))}">${x(e)}</intlayer-content-selector-wrapper>`,e)}return u.renderIntlayerNode({value:t,children:t})}},C=process.env.INTLAYER_NODE_TYPE_INSERTION===`false`?d.fallbackPlugin:{id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.INSERTION,transform:(e,t,n)=>{let r=[...t.keyPath,{type:h.INSERTION}],i=e[h.INSERTION],a={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`||(0,d.isInterpolableWrapperNode)(e),transform:(e,n,r)=>{if((0,d.isInterpolableWrapperNode)(e))return i=>(0,d.transformInterpolableNode)(e,i,n,t.plugins,r);let i=r(e,{...n,children:e,plugins:(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)});return e=>{let a=(0,d.splitInsertionTemplate)(i,e),o=a.isSimple?a.parts:a.parts.join(``);return r(o,{...n,plugins:t.plugins,children:o})}}},o=n(i,{...t,children:i,keyPath:r,plugins:[a,...t.plugins??[]]});return(0,d.resolveInsertedSelector)(i,o)}},w=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?d.fallbackPlugin:{id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,t,n)=>{let{plugins:r,...i}=t,{keyPath:a,dictionaryKey:o}=i,s=n((0,p.getMarkdownMetadata)(e)??{},{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>u.renderIntlayerNode({...n,value:t,children:e})}],dictionaryKey:i.dictionaryKey,keyPath:[]}),c=v(e),l=t=>{let n=v(e,{components:t});return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?y(`<intlayer-content-selector-wrapper key-path="${b(JSON.stringify(a??[]))}" dictionary-key="${b(String(o??``))}">${n}</intlayer-content-selector-wrapper>`,e):y(n,e)};return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?y(`<intlayer-content-selector-wrapper key-path="${b(JSON.stringify(a??[]))}" dictionary-key="${b(String(o??``))}">${c}</intlayer-content-selector-wrapper>`,e,{metadata:s,use:l}):y(c,e,{metadata:s,use:l})}},T=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?d.fallbackPlugin:{id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.MARKDOWN,transform:(e,t,n)=>{let r=[...t.keyPath,{type:h.MARKDOWN}],i=e[h.MARKDOWN];return n(i,{...t,children:i,keyPath:r,plugins:[w,...t.plugins??[]]})}},E=process.env.INTLAYER_NODE_TYPE_HTML===`false`?d.fallbackPlugin:{id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.HTML,transform:(e,t)=>{let n=e[h.HTML],{keyPath:r,dictionaryKey:i}=t,a=(e={})=>{let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e).map(([e,t])=>[e,e=>t(e)])),a=new Proxy(t,{get(e,t){if(typeof t==`string`&&t in e)return e[t];if(typeof t==`string`&&/^[a-z][a-z0-9]*$/.test(t))return e=>_.html`<${(0,_.unsafeStatic)(t)} ...${e}>${e.children}</${(0,_.unsafeStatic)(t)}>`}}),o=(0,d.getHTML)(n,a);return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?y(`<intlayer-content-selector-wrapper key-path="${b(JSON.stringify(r??[]))}" dictionary-key="${b(String(i??``))}">${o}</intlayer-content-selector-wrapper>`,n):y(o,n)};return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?y(`<intlayer-content-selector-wrapper key-path="${b(JSON.stringify(r??[]))}" dictionary-key="${b(String(i??``))}">${n}</intlayer-content-selector-wrapper>`,n,{use:a}):y(n,n,{use:a})}},D=new Map,O=(e,t=!0)=>{let n=e??(typeof window<`u`&&c.r()?.locale)??f.internationalization.defaultLocale,r=`${n}_${t}`;if(D.has(r))return D.get(r);let i=[S,(0,d.translationPlugin)(e??f.internationalization.defaultLocale,t?f.internationalization.defaultLocale:void 0),d.enumerationPlugin,(0,d.pluralPlugin)(n),d.conditionPlugin,(0,d.nestedPlugin)(n),d.filePlugin,d.genderPlugin,d.selectPlugin,C,T,E].filter(e=>e!==d.fallbackPlugin);return D.set(r,i),i};exports.getPlugins=O,exports.htmlPlugin=E,exports.insertionPlugin=C,exports.intlayerNodePlugins=S,exports.markdownPlugin=T,exports.markdownStringPlugin=w;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=({value:e,additionalProps:t={}})=>{let n=e,r={toString:()=>String(n??``),valueOf:()=>n,[Symbol.toPrimitive]:()=>n,[Symbol.iterator]:void 0,toJSON:()=>n,get raw(){return n},set raw(e){n=e},get value(){return n},__update(e){n=e?.raw??e?.value??e},isJSX:!0,...t};if(n!=null){let e=Object(n),t=Object.getPrototypeOf(e);for(let i of Object.getOwnPropertyNames(t)){if(i===`constructor`||i in r)continue;let t=e[i];typeof t==`function`&&Object.defineProperty(r,i,{value:t.bind(n),writable:!0,configurable:!0})}}return r};exports.renderIntlayerNode=e;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/utils");var t=({value:t,additionalProps:n={}})=>{let r=t;return{__proto__:(0,e.getIntlayerNodePrototype)(t),toString:()=>String(r??``),valueOf:()=>r,[Symbol.toPrimitive]:()=>r,[Symbol.iterator]:void 0,toJSON:()=>r,get raw(){return r},set raw(e){r=e},get value(){return r},__update(e){r=e?.raw??e?.value??e},isJSX:!0,...n}};exports.renderIntlayerNode=t;
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { r as e } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  //#region src/client/IntlayerBinding.ts
3
3
  var t = class {
4
4
  host;
@@ -1,9 +1,9 @@
1
- import { i as e, n as t, r as n, t as r } from "../../installIntlayer-DT6bzUDN.mjs";
2
- import { IntlayerBinding as i } from "./IntlayerBinding.mjs";
3
- import { useDictionary as a } from "./useDictionary.mjs";
4
- import { useDictionaryDynamic as o } from "./useDictionaryDynamic.mjs";
5
- import { useIntlayer as s } from "./useIntlayer.mjs";
6
- import { localeCookie as c, localeInStorage as l, setLocaleCookie as u, setLocaleInStorage as d, useLocaleCookie as f, useLocaleStorage as p } from "./useLocaleStorage.mjs";
7
- import { LocaleController as m, useLocale as h } from "./useLocale.mjs";
8
- import { useRewriteURL as g } from "./useRewriteURL.mjs";
9
- export { i as IntlayerBinding, r as IntlayerClient, m as LocaleController, t as createIntlayerClient, n as getIntlayerClient, e as installIntlayer, c as localeCookie, l as localeInStorage, u as setLocaleCookie, d as setLocaleInStorage, a as useDictionary, o as useDictionaryDynamic, s as useIntlayer, h as useLocale, f as useLocaleCookie, p as useLocaleStorage, g as useRewriteURL };
1
+ import { i as e, n as t, r as n, t as r } from "../../installIntlayer-fyL4SuHX.mjs";
2
+ import { getLocaleInStorage as i, localeCookie as a, localeInStorage as o, setLocaleCookie as s, setLocaleInStorage as c, useLocaleCookie as l, useLocaleStorage as u } from "./useLocaleStorage.mjs";
3
+ import { IntlayerBinding as d } from "./IntlayerBinding.mjs";
4
+ import { useDictionary as f } from "./useDictionary.mjs";
5
+ import { useDictionaryDynamic as p } from "./useDictionaryDynamic.mjs";
6
+ import { useIntlayer as m } from "./useIntlayer.mjs";
7
+ import { LocaleController as h, useLocale as g } from "./useLocale.mjs";
8
+ import { useRewriteURL as _ } from "./useRewriteURL.mjs";
9
+ export { d as IntlayerBinding, r as IntlayerClient, h as LocaleController, t as createIntlayerClient, n as getIntlayerClient, i as getLocaleInStorage, e as installIntlayer, a as localeCookie, o as localeInStorage, s as setLocaleCookie, c as setLocaleInStorage, f as useDictionary, p as useDictionaryDynamic, m as useIntlayer, g as useLocale, l as useLocaleCookie, u as useLocaleStorage, _ as useRewriteURL };
@@ -1,2 +1,2 @@
1
- import { i as e, n as t, r as n, t as r } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { i as e, n as t, r as n, t as r } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  export { r as IntlayerClient, t as createIntlayerClient, n as getIntlayerClient, e as installIntlayer };
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { r as e } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  import { getDictionary as t } from "../getDictionary.mjs";
3
3
  import { IntlayerBinding as n } from "./IntlayerBinding.mjs";
4
4
  import { internationalization as r } from "@intlayer/config/built";
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { r as e } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  import { getDictionary as t } from "../getDictionary.mjs";
3
3
  import { IntlayerBinding as n } from "./IntlayerBinding.mjs";
4
4
  import { internationalization as r } from "@intlayer/config/built";
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { r as e } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  import { getIntlayer as t } from "../getIntlayer.mjs";
3
3
  import { IntlayerBinding as n } from "./IntlayerBinding.mjs";
4
4
  import { internationalization as r } from "@intlayer/config/built";
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { r as e } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  import { setLocaleInStorage as t } from "./useLocaleStorage.mjs";
3
3
  import { internationalization as n } from "@intlayer/config/built";
4
4
  //#region src/client/useLocale.ts
@@ -1,17 +1,17 @@
1
- import { LocaleStorageClient as e, getLocaleFromStorageClient as t, localeStorageOptions as n, setLocaleInStorageClient as r } from "@intlayer/core/utils";
1
+ import { LocaleStorageClient as e, getCachedLocaleFromStorageClient as t, getLocaleFromStorageClient as n, localeStorageOptions as r, setLocaleInStorageClient as i } from "@intlayer/core/utils";
2
2
  //#region src/client/useLocaleStorage.ts
3
- var i = t(n), a = i, o = (e, t) => r(e, {
4
- ...n,
3
+ var a = t, o = /* @__PURE__ */ n(r), s = o, c = (e, t) => i(e, {
4
+ ...r,
5
5
  isCookieEnabled: t
6
- }), s = o, c = (t) => {
7
- let r = e({
8
- ...n,
6
+ }), l = c, u = (t) => {
7
+ let n = e({
8
+ ...r,
9
9
  isCookieEnabled: t
10
10
  });
11
11
  return {
12
- localeStorage: r.getLocale(),
13
- setLocaleStorage: r.setLocale
12
+ localeStorage: n.getLocale(),
13
+ setLocaleStorage: n.setLocale
14
14
  };
15
- }, l = c;
15
+ }, d = u;
16
16
  //#endregion
17
- export { a as localeCookie, i as localeInStorage, s as setLocaleCookie, o as setLocaleInStorage, l as useLocaleCookie, c as useLocaleStorage };
17
+ export { a as getLocaleInStorage, s as localeCookie, o as localeInStorage, l as setLocaleCookie, c as setLocaleInStorage, d as useLocaleCookie, u as useLocaleStorage };
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { r as e } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  import { routing as t } from "@intlayer/config/built";
3
3
  import { getRewritePath as n } from "@intlayer/core/localization";
4
4
  //#region src/client/useRewriteURL.ts
@@ -1,2 +1,2 @@
1
- import { a as e } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { a as e } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  export { e as useEditor };
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { r as e } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  import { compact as t } from "@intlayer/core/formatters";
3
3
  //#region src/format/useCompact.ts
4
4
  var n = class {
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { r as e } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  import { currency as t } from "@intlayer/core/formatters";
3
3
  //#region src/format/useCurrency.ts
4
4
  var n = class {
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { r as e } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  import { date as t, presets as n } from "@intlayer/core/formatters";
3
3
  //#region src/format/useDate.ts
4
4
  var r = class {
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { r as e } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  import { bindIntl as t } from "@intlayer/core/utils";
3
3
  //#region src/format/useIntl.ts
4
4
  var n = class {
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { r as e } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  import { list as t } from "@intlayer/core/formatters";
3
3
  //#region src/format/useList.ts
4
4
  var n = class {
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { r as e } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  import { number as t } from "@intlayer/core/formatters";
3
3
  //#region src/format/useNumber.ts
4
4
  var n = class {
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { r as e } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  import { percentage as t } from "@intlayer/core/formatters";
3
3
  //#region src/format/usePercentage.ts
4
4
  var n = class {
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { r as e } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  import { relativeTime as t } from "@intlayer/core/formatters";
3
3
  //#region src/format/useRelativeTime.ts
4
4
  var n = class {
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DT6bzUDN.mjs";
1
+ import { r as e } from "../../installIntlayer-fyL4SuHX.mjs";
2
2
  import { units as t } from "@intlayer/core/formatters";
3
3
  //#region src/format/useUnit.ts
4
4
  var n = class {
@@ -1,13 +1,13 @@
1
- import { a as e, i as t, n, r, t as i } from "../installIntlayer-DT6bzUDN.mjs";
2
- import { getPlugins as a, htmlPlugin as o, insertionPlugin as s, intlayerNodePlugins as c, markdownPlugin as l, markdownStringPlugin as u } from "./plugins.mjs";
3
- import { getDictionary as d } from "./getDictionary.mjs";
4
- import { getIntlayer as f } from "./getIntlayer.mjs";
5
- import { IntlayerBinding as p } from "./client/IntlayerBinding.mjs";
6
- import { useDictionary as m } from "./client/useDictionary.mjs";
7
- import { useDictionaryDynamic as h } from "./client/useDictionaryDynamic.mjs";
8
- import { useIntlayer as g } from "./client/useIntlayer.mjs";
9
- import { localeCookie as _, localeInStorage as v, setLocaleCookie as y, setLocaleInStorage as b, useLocaleCookie as x, useLocaleStorage as S } from "./client/useLocaleStorage.mjs";
10
- import { LocaleController as C, useLocale as w } from "./client/useLocale.mjs";
11
- import { useRewriteURL as T } from "./client/useRewriteURL.mjs";
1
+ import { a as e, i as t, n, r, t as i } from "../installIntlayer-fyL4SuHX.mjs";
2
+ import { getLocaleInStorage as a, localeCookie as o, localeInStorage as s, setLocaleCookie as c, setLocaleInStorage as l, useLocaleCookie as u, useLocaleStorage as d } from "./client/useLocaleStorage.mjs";
3
+ import { getPlugins as f, htmlPlugin as p, insertionPlugin as m, intlayerNodePlugins as h, markdownPlugin as g, markdownStringPlugin as _ } from "./plugins.mjs";
4
+ import { getDictionary as v } from "./getDictionary.mjs";
5
+ import { getIntlayer as y } from "./getIntlayer.mjs";
6
+ import { IntlayerBinding as b } from "./client/IntlayerBinding.mjs";
7
+ import { useDictionary as x } from "./client/useDictionary.mjs";
8
+ import { useDictionaryDynamic as S } from "./client/useDictionaryDynamic.mjs";
9
+ import { useIntlayer as C } from "./client/useIntlayer.mjs";
10
+ import { LocaleController as w, useLocale as T } from "./client/useLocale.mjs";
11
+ import { useRewriteURL as E } from "./client/useRewriteURL.mjs";
12
12
  import "./client/index.mjs";
13
- export { p as IntlayerBinding, i as IntlayerClient, C as LocaleController, n as createIntlayerClient, d as getDictionary, f as getIntlayer, r as getIntlayerClient, a as getPlugins, o as htmlPlugin, s as insertionPlugin, t as installIntlayer, c as intlayerNodePlugins, _ as localeCookie, v as localeInStorage, l as markdownPlugin, u as markdownStringPlugin, y as setLocaleCookie, b as setLocaleInStorage, m as useDictionary, h as useDictionaryDynamic, e as useEditor, g as useIntlayer, w as useLocale, x as useLocaleCookie, S as useLocaleStorage, T as useRewriteURL };
13
+ export { b as IntlayerBinding, i as IntlayerClient, w as LocaleController, n as createIntlayerClient, v as getDictionary, y as getIntlayer, r as getIntlayerClient, a as getLocaleInStorage, f as getPlugins, p as htmlPlugin, m as insertionPlugin, t as installIntlayer, h as intlayerNodePlugins, o as localeCookie, s as localeInStorage, g as markdownPlugin, _ as markdownStringPlugin, c as setLocaleCookie, l as setLocaleInStorage, x as useDictionary, S as useDictionaryDynamic, e as useEditor, C as useIntlayer, T as useLocale, u as useLocaleCookie, d as useLocaleStorage, E as useRewriteURL };
@@ -1,39 +1,41 @@
1
- import { r as e } from "../installIntlayer-DT6bzUDN.mjs";
1
+ import { r as e } from "../installIntlayer-fyL4SuHX.mjs";
2
2
  import t from "./markdown/runtime.mjs";
3
3
  import { renderIntlayerNode as n } from "./renderIntlayerNode.mjs";
4
4
  import { conditionPlugin as r, enumerationPlugin as i, fallbackPlugin as a, filePlugin as o, genderPlugin as s, getHTML as c, isInterpolableWrapperNode as l, nestedPlugin as u, pluralPlugin as d, resolveInsertedSelector as f, selectPlugin as p, splitInsertionTemplate as m, transformInterpolableNode as h, translationPlugin as g } from "@intlayer/core/interpreter";
5
5
  import { editor as _, internationalization as v } from "@intlayer/config/built";
6
6
  import { compileWithOptions as y, getMarkdownMetadata as b } from "@intlayer/core/markdown";
7
- import * as x from "@intlayer/types/nodeType";
8
- import { unsafeHTML as S } from "lit/directives/unsafe-html.js";
9
- import { html as C, unsafeStatic as w } from "lit/static-html.js";
7
+ import { getIntlayerNodePrototype as x } from "@intlayer/core/utils";
8
+ import * as S from "@intlayer/types/nodeType";
9
+ import { unsafeHTML as C } from "lit/directives/unsafe-html.js";
10
+ import { html as w, unsafeStatic as T } from "lit/static-html.js";
10
11
  //#region src/plugins.ts
11
- var T = (e = "", n = {}) => y(e, t, n), E = (e, t, n = {}) => {
12
- let r = typeof e == "string" ? S(e) : e;
13
- return new Proxy(r, { get(e, r, i) {
14
- if (r === "value" || r === "raw") return t;
15
- if (r === "toString" || r === Symbol.toPrimitive) return () => t;
16
- if (r !== Symbol.iterator) return r === "__update" ? () => {} : r === "isJSX" ? !0 : r in n ? n[r] : Reflect.get(e, r, i);
17
- } });
18
- }, D = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;"), O = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), k = {
12
+ var E = (e = "", n = {}) => y(e, t, n), D = (e, t, n = {}) => {
13
+ let r = typeof e == "string" ? C(e) : e, i = Array.isArray(r), a = Object.assign(i ? [...r] : { ...r }, n, {
14
+ value: t,
15
+ raw: t,
16
+ [Symbol.iterator]: void 0,
17
+ __update: () => {},
18
+ isJSX: !0
19
+ });
20
+ return Object.setPrototypeOf(a, x(t, i ? Array.prototype : Object.prototype));
21
+ }, O = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;"), k = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), A = {
19
22
  id: "intlayer-node-plugin",
20
23
  canHandle: (e) => typeof e == "bigint" || typeof e == "string" || typeof e == "number",
21
- transform: (e, { children: t, keyPath: r, dictionaryKey: i, ...a }) => {
24
+ transform: (e, { children: t, keyPath: r, dictionaryKey: i }) => {
22
25
  if (process.env.INTLAYER_EDITOR_ENABLED !== "false" && _.enabled) {
23
26
  let e = String(t ?? "");
24
- return E(`<intlayer-content-selector-wrapper key-path="${D(JSON.stringify(r ?? []))}" dictionary-key="${D(String(i ?? ""))}">${O(e)}</intlayer-content-selector-wrapper>`, e);
27
+ return D(`<intlayer-content-selector-wrapper key-path="${O(JSON.stringify(r ?? []))}" dictionary-key="${O(String(i ?? ""))}">${k(e)}</intlayer-content-selector-wrapper>`, e);
25
28
  }
26
29
  return n({
27
- ...a,
28
30
  value: t,
29
31
  children: t
30
32
  });
31
33
  }
32
- }, A = process.env.INTLAYER_NODE_TYPE_INSERTION === "false" ? a : {
34
+ }, j = process.env.INTLAYER_NODE_TYPE_INSERTION === "false" ? a : {
33
35
  id: "insertion-plugin",
34
- canHandle: (e) => typeof e == "object" && e?.nodeType === x.INSERTION,
36
+ canHandle: (e) => typeof e == "object" && e?.nodeType === S.INSERTION,
35
37
  transform: (e, t, n) => {
36
- let r = [...t.keyPath, { type: x.INSERTION }], i = e[x.INSERTION], a = {
38
+ let r = [...t.keyPath, { type: S.INSERTION }], i = e[S.INSERTION], a = {
37
39
  id: "insertion-string-plugin",
38
40
  canHandle: (e) => typeof e == "string" || l(e),
39
41
  transform: (e, n, r) => {
@@ -60,7 +62,7 @@ var T = (e = "", n = {}) => y(e, t, n), E = (e, t, n = {}) => {
60
62
  });
61
63
  return f(i, o);
62
64
  }
63
- }, j = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? a : {
65
+ }, M = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? a : {
64
66
  id: "markdown-string-plugin",
65
67
  canHandle: (e) => typeof e == "string",
66
68
  transform: (e, t, r) => {
@@ -76,61 +78,61 @@ var T = (e = "", n = {}) => y(e, t, n), E = (e, t, n = {}) => {
76
78
  }],
77
79
  dictionaryKey: a.dictionaryKey,
78
80
  keyPath: []
79
- }), l = T(e), u = (t) => {
80
- let n = T(e, { components: t });
81
- return process.env.INTLAYER_EDITOR_ENABLED !== "false" && _.enabled ? E(`<intlayer-content-selector-wrapper key-path="${D(JSON.stringify(o ?? []))}" dictionary-key="${D(String(s ?? ""))}">${n}</intlayer-content-selector-wrapper>`, e) : E(n, e);
81
+ }), l = E(e), u = (t) => {
82
+ let n = E(e, { components: t });
83
+ return process.env.INTLAYER_EDITOR_ENABLED !== "false" && _.enabled ? D(`<intlayer-content-selector-wrapper key-path="${O(JSON.stringify(o ?? []))}" dictionary-key="${O(String(s ?? ""))}">${n}</intlayer-content-selector-wrapper>`, e) : D(n, e);
82
84
  };
83
- return process.env.INTLAYER_EDITOR_ENABLED !== "false" && _.enabled ? E(`<intlayer-content-selector-wrapper key-path="${D(JSON.stringify(o ?? []))}" dictionary-key="${D(String(s ?? ""))}">${l}</intlayer-content-selector-wrapper>`, e, {
85
+ return process.env.INTLAYER_EDITOR_ENABLED !== "false" && _.enabled ? D(`<intlayer-content-selector-wrapper key-path="${O(JSON.stringify(o ?? []))}" dictionary-key="${O(String(s ?? ""))}">${l}</intlayer-content-selector-wrapper>`, e, {
84
86
  metadata: c,
85
87
  use: u
86
- }) : E(l, e, {
88
+ }) : D(l, e, {
87
89
  metadata: c,
88
90
  use: u
89
91
  });
90
92
  }
91
- }, M = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? a : {
93
+ }, N = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? a : {
92
94
  id: "markdown-plugin",
93
- canHandle: (e) => typeof e == "object" && e?.nodeType === x.MARKDOWN,
95
+ canHandle: (e) => typeof e == "object" && e?.nodeType === S.MARKDOWN,
94
96
  transform: (e, t, n) => {
95
- let r = [...t.keyPath, { type: x.MARKDOWN }], i = e[x.MARKDOWN];
97
+ let r = [...t.keyPath, { type: S.MARKDOWN }], i = e[S.MARKDOWN];
96
98
  return n(i, {
97
99
  ...t,
98
100
  children: i,
99
101
  keyPath: r,
100
- plugins: [j, ...t.plugins ?? []]
102
+ plugins: [M, ...t.plugins ?? []]
101
103
  });
102
104
  }
103
- }, N = process.env.INTLAYER_NODE_TYPE_HTML === "false" ? a : {
105
+ }, P = process.env.INTLAYER_NODE_TYPE_HTML === "false" ? a : {
104
106
  id: "html-plugin",
105
- canHandle: (e) => typeof e == "object" && e?.nodeType === x.HTML,
107
+ canHandle: (e) => typeof e == "object" && e?.nodeType === S.HTML,
106
108
  transform: (e, t) => {
107
- let n = e[x.HTML], { keyPath: r, dictionaryKey: i } = t, a = (e = {}) => {
109
+ let n = e[S.HTML], { keyPath: r, dictionaryKey: i } = t, a = (e = {}) => {
108
110
  let t = Object.fromEntries(Object.entries(e).filter(([, e]) => e).map(([e, t]) => [e, (e) => t(e)])), a = new Proxy(t, { get(e, t) {
109
111
  if (typeof t == "string" && t in e) return e[t];
110
- if (typeof t == "string" && /^[a-z][a-z0-9]*$/.test(t)) return (e) => C`<${w(t)} ...${e}>${e.children}</${w(t)}>`;
112
+ if (typeof t == "string" && /^[a-z][a-z0-9]*$/.test(t)) return (e) => w`<${T(t)} ...${e}>${e.children}</${T(t)}>`;
111
113
  } }), o = c(n, a);
112
- return process.env.INTLAYER_EDITOR_ENABLED !== "false" && _.enabled ? E(`<intlayer-content-selector-wrapper key-path="${D(JSON.stringify(r ?? []))}" dictionary-key="${D(String(i ?? ""))}">${o}</intlayer-content-selector-wrapper>`, n) : E(o, n);
114
+ return process.env.INTLAYER_EDITOR_ENABLED !== "false" && _.enabled ? D(`<intlayer-content-selector-wrapper key-path="${O(JSON.stringify(r ?? []))}" dictionary-key="${O(String(i ?? ""))}">${o}</intlayer-content-selector-wrapper>`, n) : D(o, n);
113
115
  };
114
- return process.env.INTLAYER_EDITOR_ENABLED !== "false" && _.enabled ? E(`<intlayer-content-selector-wrapper key-path="${D(JSON.stringify(r ?? []))}" dictionary-key="${D(String(i ?? ""))}">${n}</intlayer-content-selector-wrapper>`, n, { use: a }) : E(n, n, { use: a });
116
+ return process.env.INTLAYER_EDITOR_ENABLED !== "false" && _.enabled ? D(`<intlayer-content-selector-wrapper key-path="${O(JSON.stringify(r ?? []))}" dictionary-key="${O(String(i ?? ""))}">${n}</intlayer-content-selector-wrapper>`, n, { use: a }) : D(n, n, { use: a });
115
117
  }
116
- }, P = /* @__PURE__ */ new Map(), F = (t, n = !0) => {
117
- let a = t ?? (typeof window < "u" && e()?.locale) ?? v.defaultLocale, c = `${a}_${n}`;
118
- if (P.has(c)) return P.get(c);
119
- let l = [
118
+ }, F = /* @__PURE__ */ new Map(), I = (t, n = !0) => {
119
+ let c = t ?? (typeof window < "u" && e()?.locale) ?? v.defaultLocale, l = `${c}_${n}`;
120
+ if (F.has(l)) return F.get(l);
121
+ let f = [
122
+ A,
120
123
  g(t ?? v.defaultLocale, n ? v.defaultLocale : void 0),
121
124
  i,
122
- d(a),
125
+ d(c),
123
126
  r,
124
- u(a),
127
+ u(c),
125
128
  o,
126
129
  s,
127
130
  p,
128
- k,
129
- A,
130
- M,
131
- N
132
- ];
133
- return P.set(c, l), l;
131
+ j,
132
+ N,
133
+ P
134
+ ].filter((e) => e !== a);
135
+ return F.set(l, f), f;
134
136
  };
135
137
  //#endregion
136
- export { F as getPlugins, N as htmlPlugin, A as insertionPlugin, k as intlayerNodePlugins, M as markdownPlugin, j as markdownStringPlugin };
138
+ export { I as getPlugins, P as htmlPlugin, j as insertionPlugin, A as intlayerNodePlugins, N as markdownPlugin, M as markdownStringPlugin };
@@ -1,39 +1,29 @@
1
+ import { getIntlayerNodePrototype as e } from "@intlayer/core/utils";
1
2
  //#region src/renderIntlayerNode.ts
2
- var e = ({ value: e, additionalProps: t = {} }) => {
3
- let n = e, r = {
4
- toString: () => String(n ?? ""),
5
- valueOf: () => n,
6
- [Symbol.toPrimitive]: () => n,
3
+ var t = ({ value: t, additionalProps: n = {} }) => {
4
+ let r = t;
5
+ return {
6
+ __proto__: e(t),
7
+ toString: () => String(r ?? ""),
8
+ valueOf: () => r,
9
+ [Symbol.toPrimitive]: () => r,
7
10
  [Symbol.iterator]: void 0,
8
- toJSON: () => n,
11
+ toJSON: () => r,
9
12
  get raw() {
10
- return n;
13
+ return r;
11
14
  },
12
15
  set raw(e) {
13
- n = e;
16
+ r = e;
14
17
  },
15
18
  get value() {
16
- return n;
19
+ return r;
17
20
  },
18
21
  __update(e) {
19
- n = e?.raw ?? e?.value ?? e;
22
+ r = e?.raw ?? e?.value ?? e;
20
23
  },
21
24
  isJSX: !0,
22
- ...t
25
+ ...n
23
26
  };
24
- if (n != null) {
25
- let e = Object(n), t = Object.getPrototypeOf(e);
26
- for (let i of Object.getOwnPropertyNames(t)) {
27
- if (i === "constructor" || i in r) continue;
28
- let t = e[i];
29
- typeof t == "function" && Object.defineProperty(r, i, {
30
- value: t.bind(n),
31
- writable: !0,
32
- configurable: !0
33
- });
34
- }
35
- }
36
- return r;
37
27
  };
38
28
  //#endregion
39
- export { e as renderIntlayerNode };
29
+ export { t as renderIntlayerNode };
@@ -1,8 +1,9 @@
1
- import { internationalization as e } from "@intlayer/config/built";
2
- import { setIntlayerIdentifier as t } from "@intlayer/config/client";
3
- import { isEnabled as n } from "@intlayer/editor/isEnabled";
1
+ import { getLocaleInStorage as e } from "./esm/client/useLocaleStorage.mjs";
2
+ import { internationalization as t } from "@intlayer/config/built";
3
+ import { setIntlayerIdentifier as n } from "@intlayer/config/client";
4
+ import { isEnabled as r } from "@intlayer/editor/isEnabled";
4
5
  //#region src/editor/useEditor.ts
5
- var r = class {
6
+ var i = class {
6
7
  host;
7
8
  _stopped = !1;
8
9
  _unsubscribeLocale = null;
@@ -10,9 +11,9 @@ var r = class {
10
11
  this.host = e, e.addController(this);
11
12
  }
12
13
  hostConnected() {
13
- this._stopped = !1, process.env.INTLAYER_EDITOR_ENABLED !== "false" && n && import("@intlayer/editor").then(({ initEditorClient: e }) => {
14
+ this._stopped = !1, process.env.INTLAYER_EDITOR_ENABLED !== "false" && r && import("@intlayer/editor").then(({ initEditorClient: e }) => {
14
15
  if (this._stopped) return;
15
- let t = e(), n = c();
16
+ let t = e(), n = l();
16
17
  t.currentLocale.set(n.locale), this._unsubscribeLocale = n.subscribe((e) => {
17
18
  t.currentLocale.set(e);
18
19
  });
@@ -24,13 +25,13 @@ var r = class {
24
25
  }).catch(() => {});
25
26
  }
26
27
  };
27
- function i(e) {
28
- if (process.env.INTLAYER_EDITOR_ENABLED === "false" || !n) return e ? void 0 : () => {};
28
+ function a(e) {
29
+ if (process.env.INTLAYER_EDITOR_ENABLED === "false" || !r) return e ? void 0 : () => {};
29
30
  if (!e) {
30
31
  let e = !1, t = null;
31
32
  return import("@intlayer/editor").then(({ initEditorClient: n }) => {
32
33
  if (e) return;
33
- let r = n(), i = c();
34
+ let r = n(), i = l();
34
35
  r.currentLocale.set(i.locale), t = i.subscribe((e) => {
35
36
  r.currentLocale.set(e);
36
37
  });
@@ -40,18 +41,18 @@ function i(e) {
40
41
  }).catch(() => {});
41
42
  };
42
43
  }
43
- new r(e);
44
+ new i(e);
44
45
  }
45
46
  //#endregion
46
47
  //#region src/client/installIntlayer.ts
47
- var a = class {
48
+ var o = class {
48
49
  _locale;
49
50
  _variant;
50
51
  _listeners = /* @__PURE__ */ new Set();
51
52
  isCookieEnabled;
52
- constructor(n, r = !0, i) {
53
- let { defaultLocale: a } = e ?? {};
54
- t(), this._locale = n ?? a, this._variant = i, this.isCookieEnabled = r;
53
+ constructor(r, i = !0, a) {
54
+ let { defaultLocale: o } = t ?? {};
55
+ n(), this._locale = r ?? e() ?? o, this._variant = a, this.isCookieEnabled = i;
55
56
  }
56
57
  get locale() {
57
58
  return this._locale;
@@ -72,9 +73,9 @@ var a = class {
72
73
  this._listeners.delete(e);
73
74
  };
74
75
  }
75
- }, o = null, s = (e, t = !0, n) => o || (o = new a(e, t, n), o), c = () => (o ||= new a(), o), l = ({ locale: e, isCookieEnabled: t, variant: n } = {}) => {
76
- let r = s(e, t, n);
77
- return i(), r;
76
+ }, s = null, c = (e, t = !0, n) => s || (s = new o(e, t, n), s), l = () => (s ||= new o(), s), u = ({ locale: e, isCookieEnabled: t, variant: n } = {}) => {
77
+ let r = c(e, t, n);
78
+ return a(), r;
78
79
  };
79
80
  //#endregion
80
- export { i as a, l as i, s as n, c as r, a as t };
81
+ export { a, u as i, c as n, l as r, o as t };
@@ -0,0 +1 @@
1
+ const e=require("./cjs/client/useLocaleStorage.cjs");let t=require("@intlayer/config/built"),n=require("@intlayer/config/client"),r=require("@intlayer/editor/isEnabled");var i=class{host;_stopped=!1;_unsubscribeLocale=null;constructor(e){this.host=e,e.addController(this)}hostConnected(){this._stopped=!1,process.env.INTLAYER_EDITOR_ENABLED!==`false`&&r.isEnabled&&import(`@intlayer/editor`).then(({initEditorClient:e})=>{if(this._stopped)return;let t=e(),n=l();t.currentLocale.set(n.locale),this._unsubscribeLocale=n.subscribe(e=>{t.currentLocale.set(e)})}).catch(()=>{})}hostDisconnected(){this._stopped=!0,this._unsubscribeLocale?.(),this._unsubscribeLocale=null,import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()}).catch(()=>{})}};function a(e){if(process.env.INTLAYER_EDITOR_ENABLED===`false`||!r.isEnabled)return e?void 0:()=>{};if(!e){let e=!1,t=null;return import(`@intlayer/editor`).then(({initEditorClient:n})=>{if(e)return;let r=n(),i=l();r.currentLocale.set(i.locale),t=i.subscribe(e=>{r.currentLocale.set(e)})}).catch(()=>{}),()=>{e=!0,t?.(),import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()}).catch(()=>{})}}new i(e)}var o=class{_locale;_variant;_listeners=new Set;isCookieEnabled;constructor(r,i=!0,a){let{defaultLocale:o}=t.internationalization??{};(0,n.setIntlayerIdentifier)(),this._locale=r??e.getLocaleInStorage()??o,this._variant=a,this.isCookieEnabled=i}get locale(){return this._locale}get variant(){return this._variant}setLocale(e){this._locale=e;for(let t of this._listeners)t(e)}setVariant(e){this._variant=e;for(let e of this._listeners)e(this._locale)}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}},s=null,c=(e,t=!0,n)=>s||(s=new o(e,t,n),s),l=()=>(s||=new o,s),u=({locale:e,isCookieEnabled:t,variant:n}={})=>{let r=c(e,t,n);return a(),r};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
@@ -1 +1 @@
1
- {"version":3,"file":"installIntlayer.d.ts","sourceRoot":"","sources":["../../../src/client/installIntlayer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAG7C,KAAK,cAAc,GAAG,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;AAEtD,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,UAAU,CAAkC;IACpD,eAAe,EAAE,OAAO,CAAC;gBAGvB,MAAM,CAAC,EAAE,aAAa,EACtB,eAAe,UAAO,EACtB,OAAO,CAAC,EAAE,eAAe;IAY3B,IAAI,MAAM,IAAI,aAAa,CAE1B;IAED;;;OAGG;IACH,IAAI,OAAO,IAAI,eAAe,GAAG,SAAS,CAEzC;IAED,SAAS,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI;IAOzC,UAAU,CAAC,UAAU,EAAE,eAAe,GAAG,SAAS,GAAG,IAAI;IAOzD,SAAS,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,IAAI;CAMhD;AAOD;;G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MAAM,iBAAiB,QAAO,cAKpC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,eAAe,GAAI,wCAI7B;IACD,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,eAAe,CAAC;CACtB,KAAG,cAMR,CAAC"}
@@ -1,12 +1,22 @@
1
1
  import { LocalesValues } from '@intlayer/types/module_augmentation';
2
+ /**
3
+ * Reads the locale persisted in the browser storage (cookie, localStorage…).
4
+ *
5
+ * Unlike `localeInStorage`, read on first call rather than at import, then
6
+ * cached until the next `setLocaleInStorage`. Never cached on the server.
7
+ */
8
+ export declare const getLocaleInStorage: () => import('@intlayer/types').Locale | undefined;
2
9
  /**
3
10
  * Get the current locale from storage (cookie or localStorage).
11
+ *
12
+ * Read once at import time; marked pure so bundlers drop the read when nothing
13
+ * imports it.
4
14
  */
5
- export declare const localeInStorage: import('intlayer').Locale;
15
+ export declare const localeInStorage: import('@intlayer/types').Locale;
6
16
  /**
7
17
  * @deprecated Use localeInStorage instead.
8
18
  */
9
- export declare const localeCookie: import('intlayer').Locale;
19
+ export declare const localeCookie: import('@intlayer/types').Locale;
10
20
  /**
11
21
  * Persist the locale to storage (cookie and/or localStorage).
12
22
  */
@@ -19,14 +29,14 @@ export declare const setLocaleCookie: (locale: LocalesValues, isCookieEnabled: b
19
29
  * Returns the current locale from storage and a setter.
20
30
  */
21
31
  export declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
22
- localeStorage: import('intlayer').Locale;
32
+ localeStorage: import('@intlayer/types').Locale;
23
33
  setLocaleStorage: (locale: LocalesValues) => void;
24
34
  };
25
35
  /**
26
36
  * @deprecated Use useLocaleStorage instead.
27
37
  */
28
38
  export declare const useLocaleCookie: (isCookieEnabled?: boolean) => {
29
- localeStorage: import('intlayer').Locale;
39
+ localeStorage: import('@intlayer/types').Locale;
30
40
  setLocaleStorage: (locale: LocalesValues) => void;
31
41
  };
32
42
  //# sourceMappingURL=useLocaleStorage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocaleStorage.d.ts","sourceRoot":"","sources":["../../../src/client/useLocaleStorage.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,eAAe,2BAAmD,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,YAAY,2BAAkB,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,aAAa,EACrB,iBAAiB,OAAO,SAKtB,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,eAAe,WAXlB,aAAa,mBACJ,OAAO,SAUuB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,kBAAkB,OAAO;;;CAUzD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,qBAfuB,OAAO;;;CAeX,CAAC"}
1
+ {"version":3,"file":"useLocaleStorage.d.ts","sourceRoot":"","sources":["../../../src/client/useLocaleStorage.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEzE;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,oDAAmC,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,eAAe,kCACsC,CAAC;AAEnE;;GAEG;AACH,eAAO,MAAM,YAAY,kCAAkB,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,aAAa,EACrB,iBAAiB,OAAO,SAKtB,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,eAAe,WAXlB,aAAa,mBACJ,OAAO,SAUuB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,kBAAkB,OAAO;;;CAUzD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,qBAf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CACF,GACC,CAAC,CAAC;AAEJ,eAAO,MAAM,kBAAkB,GAC7B,CAAC,EACD,6BAGC;IACD,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,KAAG,YAAY,CAAC,CAAC,CAuCjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lit-intlayer",
3
- "version": "9.5.9",
3
+ "version": "9.5.10",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Lit applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -104,11 +104,11 @@
104
104
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
105
105
  },
106
106
  "dependencies": {
107
- "@intlayer/api": "9.5.9",
108
- "@intlayer/config": "9.5.9",
109
- "@intlayer/core": "9.5.9",
110
- "@intlayer/editor": "9.5.9",
111
- "@intlayer/types": "9.5.9"
107
+ "@intlayer/api": "9.5.10",
108
+ "@intlayer/config": "9.5.10",
109
+ "@intlayer/core": "9.5.10",
110
+ "@intlayer/editor": "9.5.10",
111
+ "@intlayer/types": "9.5.10"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@types/node": "^22",
@@ -120,12 +120,12 @@
120
120
  "rimraf": "6.1.3",
121
121
  "tsdown": "0.23.0",
122
122
  "typescript": "7.0.2",
123
- "vite": "8.3.0",
123
+ "vite": "8.3.1",
124
124
  "vite-plugin-dts": "5.1.1",
125
- "vitest": "5.0.1"
125
+ "vitest": "5.0.2"
126
126
  },
127
127
  "peerDependencies": {
128
- "intlayer": "9.5.9",
128
+ "intlayer": "9.5.10",
129
129
  "lit": ">=3.0.0"
130
130
  },
131
131
  "peerDependenciesMeta": {
@@ -1 +0,0 @@
1
- let e=require("@intlayer/config/built"),t=require("@intlayer/config/client"),n=require("@intlayer/editor/isEnabled");var r=class{host;_stopped=!1;_unsubscribeLocale=null;constructor(e){this.host=e,e.addController(this)}hostConnected(){this._stopped=!1,process.env.INTLAYER_EDITOR_ENABLED!==`false`&&n.isEnabled&&import(`@intlayer/editor`).then(({initEditorClient:e})=>{if(this._stopped)return;let t=e(),n=c();t.currentLocale.set(n.locale),this._unsubscribeLocale=n.subscribe(e=>{t.currentLocale.set(e)})}).catch(()=>{})}hostDisconnected(){this._stopped=!0,this._unsubscribeLocale?.(),this._unsubscribeLocale=null,import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()}).catch(()=>{})}};function i(e){if(process.env.INTLAYER_EDITOR_ENABLED===`false`||!n.isEnabled)return e?void 0:()=>{};if(!e){let e=!1,t=null;return import(`@intlayer/editor`).then(({initEditorClient:n})=>{if(e)return;let r=n(),i=c();r.currentLocale.set(i.locale),t=i.subscribe(e=>{r.currentLocale.set(e)})}).catch(()=>{}),()=>{e=!0,t?.(),import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()}).catch(()=>{})}}new r(e)}var a=class{_locale;_variant;_listeners=new Set;isCookieEnabled;constructor(n,r=!0,i){let{defaultLocale:a}=e.internationalization??{};(0,t.setIntlayerIdentifier)(),this._locale=n??a,this._variant=i,this.isCookieEnabled=r}get locale(){return this._locale}get variant(){return this._variant}setLocale(e){this._locale=e;for(let t of this._listeners)t(e)}setVariant(e){this._variant=e;for(let e of this._listeners)e(this._locale)}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}},o=null,s=(e,t=!0,n)=>o||(o=new a(e,t,n),o),c=()=>(o||=new a,o),l=({locale:e,isCookieEnabled:t,variant:n}={})=>{let r=s(e,t,n);return i(),r};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});