lit-intlayer 9.5.1 → 9.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/client/IntlayerBinding.cjs +1 -1
- package/dist/cjs/client/index.cjs +1 -1
- package/dist/cjs/client/installIntlayer.cjs +1 -1
- package/dist/cjs/client/useDictionary.cjs +1 -1
- package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/client/useLocale.cjs +1 -1
- package/dist/cjs/client/useRewriteURL.cjs +1 -1
- package/dist/cjs/editor/useEditor.cjs +1 -1
- package/dist/cjs/format/useCompact.cjs +1 -1
- package/dist/cjs/format/useCurrency.cjs +1 -1
- package/dist/cjs/format/useDate.cjs +1 -1
- package/dist/cjs/format/useIntl.cjs +1 -1
- package/dist/cjs/format/useList.cjs +1 -1
- package/dist/cjs/format/useNumber.cjs +1 -1
- package/dist/cjs/format/usePercentage.cjs +1 -1
- package/dist/cjs/format/useRelativeTime.cjs +1 -1
- package/dist/cjs/format/useUnit.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/esm/client/IntlayerBinding.mjs +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/installIntlayer.mjs +1 -1
- package/dist/esm/client/useDictionary.mjs +1 -1
- package/dist/esm/client/useDictionaryDynamic.mjs +1 -1
- package/dist/esm/client/useIntlayer.mjs +1 -1
- package/dist/esm/client/useLocale.mjs +1 -1
- package/dist/esm/client/useRewriteURL.mjs +1 -1
- package/dist/esm/editor/useEditor.mjs +1 -1
- package/dist/esm/format/useCompact.mjs +1 -1
- package/dist/esm/format/useCurrency.mjs +1 -1
- package/dist/esm/format/useDate.mjs +1 -1
- package/dist/esm/format/useIntl.mjs +1 -1
- package/dist/esm/format/useList.mjs +1 -1
- package/dist/esm/format/useNumber.mjs +1 -1
- package/dist/esm/format/usePercentage.mjs +1 -1
- package/dist/esm/format/useRelativeTime.mjs +1 -1
- package/dist/esm/format/useUnit.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/plugins.mjs +1 -1
- package/dist/installIntlayer-DOvWQYtw.js +1 -0
- package/dist/{installIntlayer-BANc5sF6.mjs → installIntlayer-DT6bzUDN.mjs} +1 -1
- package/package.json +9 -9
- package/dist/installIntlayer-oiUYUnN4.js +0 -1
package/README.md
CHANGED
|
@@ -328,4 +328,4 @@ Contribute on [GitHub](https://github.com/aymericzip/intlayer), [GitLab](https:/
|
|
|
328
328
|
|
|
329
329
|
If you like Intlayer, give us a ⭐ on GitHub. It helps others discover the project! [See why GitHub Stars matter](https://github.com/aymericzip/intlayer/blob/main/CONTRIBUTING.md#why-github-stars-matter-).
|
|
330
330
|
|
|
331
|
-
[](https://
|
|
331
|
+
[](https://star-history.com/#aymericzip/intlayer&Date)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DOvWQYtw.js");exports.useEditor=e.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-
|
|
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;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../installIntlayer-DOvWQYtw.js"),t=require("./plugins.cjs"),n=require("./getIntlayer.cjs"),r=require("./getDictionary.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=r.getDictionary,exports.getIntlayer=n.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;
|
package/dist/cjs/plugins.cjs
CHANGED
|
@@ -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("./renderIntlayerNode.cjs"),l=require("../installIntlayer-
|
|
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("./renderIntlayerNode.cjs"),l=require("../installIntlayer-DOvWQYtw.js"),u=require("./markdown/runtime.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,u.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,`&`).replace(/"/g,`"`),b=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),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 c.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 typeof i==`object`&&i&&`nodeType`in i&&[m.ENUMERATION,m.CONDITION].includes(i.nodeType)?e=>t=>{let n=o(t);return typeof n==`function`?n(e):n}: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)=>c.renderIntlayerNode({...n,value:t,children:e})}],dictionaryKey:i.dictionaryKey,keyPath:[]}),l=_(e),u=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??``))}">${l}</intlayer-content-selector-wrapper>`,e,{metadata:s,use:u}):v(l,e,{metadata:s,use:u})}},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`&&l.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,4 +1,4 @@
|
|
|
1
|
-
import { i as e, n as t, r as n, t as r } from "../../installIntlayer-
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "../../installIntlayer-DT6bzUDN.mjs";
|
|
2
2
|
import { IntlayerBinding as i } from "./IntlayerBinding.mjs";
|
|
3
3
|
import { useDictionary as a } from "./useDictionary.mjs";
|
|
4
4
|
import { useDictionaryDynamic as o } from "./useDictionaryDynamic.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as e, n as t, r as n, t as r } from "../../installIntlayer-
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "../../installIntlayer-DT6bzUDN.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-
|
|
1
|
+
import { r as e } from "../../installIntlayer-DT6bzUDN.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-
|
|
1
|
+
import { r as e } from "../../installIntlayer-DT6bzUDN.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-
|
|
1
|
+
import { r as e } from "../../installIntlayer-DT6bzUDN.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-
|
|
1
|
+
import { r as e } from "../../installIntlayer-DT6bzUDN.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,4 +1,4 @@
|
|
|
1
|
-
import { r as e } from "../../installIntlayer-
|
|
1
|
+
import { r as e } from "../../installIntlayer-DT6bzUDN.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-
|
|
1
|
+
import { a as e } from "../../installIntlayer-DT6bzUDN.mjs";
|
|
2
2
|
export { e as useEditor };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, i as t, n, r, t as i } from "../installIntlayer-
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "../installIntlayer-DT6bzUDN.mjs";
|
|
2
2
|
import { getPlugins as a, htmlPlugin as o, insertionPlugin as s, intlayerNodePlugins as c, markdownPlugin as l, markdownStringPlugin as u } from "./plugins.mjs";
|
|
3
3
|
import { getIntlayer as d } from "./getIntlayer.mjs";
|
|
4
4
|
import { getDictionary as f } from "./getDictionary.mjs";
|
package/dist/esm/plugins.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { renderIntlayerNode as e } from "./renderIntlayerNode.mjs";
|
|
2
|
-
import { r as t } from "../installIntlayer-
|
|
2
|
+
import { r as t } from "../installIntlayer-DT6bzUDN.mjs";
|
|
3
3
|
import n from "./markdown/runtime.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, selectPlugin as f, splitInsertionTemplate as p, transformInterpolableNode as m, translationPlugin as h } from "@intlayer/core/interpreter";
|
|
5
5
|
import { editor as g, internationalization as _ } from "@intlayer/config/built";
|
|
@@ -0,0 +1 @@
|
|
|
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}});
|
|
@@ -10,7 +10,7 @@ var r = class {
|
|
|
10
10
|
this.host = e, e.addController(this);
|
|
11
11
|
}
|
|
12
12
|
hostConnected() {
|
|
13
|
-
this._stopped = !1,
|
|
13
|
+
this._stopped = !1, process.env.INTLAYER_EDITOR_ENABLED !== "false" && n && import("@intlayer/editor").then(({ initEditorClient: e }) => {
|
|
14
14
|
if (this._stopped) return;
|
|
15
15
|
let t = e(), n = c();
|
|
16
16
|
t.currentLocale.set(n.locale), this._unsubscribeLocale = n.subscribe((e) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lit-intlayer",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Lit applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -103,14 +103,14 @@
|
|
|
103
103
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"@intlayer/api": "9.5.
|
|
107
|
-
"@intlayer/config": "9.5.
|
|
108
|
-
"@intlayer/core": "9.5.
|
|
109
|
-
"@intlayer/editor": "9.5.
|
|
110
|
-
"@intlayer/types": "9.5.
|
|
106
|
+
"@intlayer/api": "9.5.3",
|
|
107
|
+
"@intlayer/config": "9.5.3",
|
|
108
|
+
"@intlayer/core": "9.5.3",
|
|
109
|
+
"@intlayer/editor": "9.5.3",
|
|
110
|
+
"@intlayer/types": "9.5.3"
|
|
111
111
|
},
|
|
112
112
|
"devDependencies": {
|
|
113
|
-
"@types/node": "
|
|
113
|
+
"@types/node": "^22",
|
|
114
114
|
"@typescript/typescript6": "^6.0.2",
|
|
115
115
|
"@utils/ts-config": "1.0.4",
|
|
116
116
|
"@utils/ts-config-types": "1.0.4",
|
|
@@ -119,12 +119,12 @@
|
|
|
119
119
|
"rimraf": "6.1.3",
|
|
120
120
|
"tsdown": "0.23.0",
|
|
121
121
|
"typescript": "7.0.2",
|
|
122
|
-
"vite": "8.
|
|
122
|
+
"vite": "8.3.0",
|
|
123
123
|
"vite-plugin-dts": "5.1.0",
|
|
124
124
|
"vitest": "5.0.0"
|
|
125
125
|
},
|
|
126
126
|
"peerDependencies": {
|
|
127
|
-
"intlayer": "9.5.
|
|
127
|
+
"intlayer": "9.5.3",
|
|
128
128
|
"lit": ">=3.0.0"
|
|
129
129
|
},
|
|
130
130
|
"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}});
|