lit-intlayer 9.9.1 → 9.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/getDictionary.cjs +1 -1
- package/dist/cjs/getIntlayer.cjs +1 -1
- package/dist/cjs/html/HTMLRenderer.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/markdown/MarkdownRenderer.cjs +1 -1
- package/dist/cjs/markdown/compiler.cjs +1 -1
- package/dist/cjs/plugins.cjs +3 -3
- package/dist/esm/client/IntlayerBinding.mjs +7 -7
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/installIntlayer.mjs +1 -1
- package/dist/esm/client/useDictionary.mjs +5 -5
- package/dist/esm/client/useDictionaryDynamic.mjs +6 -6
- package/dist/esm/client/useIntlayer.mjs +5 -5
- package/dist/esm/client/useLocale.mjs +14 -14
- package/dist/esm/client/useRewriteURL.mjs +8 -8
- package/dist/esm/editor/useEditor.mjs +1 -1
- package/dist/esm/format/useCompact.mjs +10 -10
- package/dist/esm/format/useCurrency.mjs +10 -10
- package/dist/esm/format/useDate.mjs +15 -15
- package/dist/esm/format/useIntl.mjs +7 -7
- package/dist/esm/format/useList.mjs +10 -10
- package/dist/esm/format/useNumber.mjs +10 -10
- package/dist/esm/format/usePercentage.mjs +10 -10
- package/dist/esm/format/useRelativeTime.mjs +10 -10
- package/dist/esm/format/useUnit.mjs +10 -10
- package/dist/esm/getDictionary.mjs +3 -3
- package/dist/esm/getIntlayer.mjs +3 -3
- package/dist/esm/html/HTMLRenderer.mjs +9 -9
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/markdown/MarkdownRenderer.mjs +13 -13
- package/dist/esm/markdown/compiler.mjs +10 -10
- package/dist/esm/markdown/runtime.mjs +1 -1
- package/dist/esm/plugins.mjs +62 -62
- package/dist/{installIntlayer-Btnci_ES.js → installIntlayer-CFvvijL7.js} +1 -1
- package/dist/{installIntlayer-Dvl7Prhw.mjs → installIntlayer-CTpPd7yz.mjs} +15 -15
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/dictionaryManipulator");const t=require("../../installIntlayer-CFvvijL7.js");var n=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 e=t.r();this.unsubscribeLocale=e.subscribe(()=>{this.host.requestUpdate()}),this.onConnect?.()}hostDisconnected(){this.unsubscribeLocale?.(),this.unsubscribeLocale=null,this.onDisconnect?.()}},r=r=>{let i=t.r(),a=new Set,o,s,c,l=!1,u=()=>{if(!l||s!==i.locale||c!==i.variant){l=!0,s=i.locale,c=i.variant;let e=r({contextLocale:i.locale,contextVariant:i.variant},e=>{o={content:e};for(let e of a)e.requestUpdate()});e&&(o=e)}return o};u();let d=new Proxy({},{get(t,r){if(r===`observe`)return e=>(a.add(e),new n(e,()=>{o&&e.requestUpdate()},()=>a.delete(e)),d);if(r===`then`||typeof r==`string`&&r.startsWith(`_$`))return;let i=u();if(!i)return e.loadingContentPlaceholder[r];let s=i.content;return r===Symbol.toPrimitive?()=>s?.[Symbol.toPrimitive]?.()??``:r===`toString`?()=>String(s?.toString?.()??``):s?.[r]}});return d};exports.IntlayerBinding=n,exports.createContentProxy=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./IntlayerBinding.cjs"),t=require("../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./IntlayerBinding.cjs"),t=require("../../installIntlayer-CFvvijL7.js"),n=require("./useDictionary.cjs"),r=require("./useDictionaryDynamic.cjs"),i=require("./useIntlayer.cjs"),a=require("./useLocale.cjs"),o=require("./useLocaleStorage.cjs"),s=require("./useRewriteURL.cjs");exports.IntlayerBinding=e.IntlayerBinding,exports.IntlayerClient=t.t,exports.LocaleController=a.LocaleController,exports.createContentProxy=e.createContentProxy,exports.createIntlayerClient=t.n,exports.getIntlayerClient=t.r,exports.getLocaleInStorage=o.getLocaleInStorage,exports.installIntlayer=t.i,exports.localeCookie=o.localeCookie,exports.localeInStorage=o.localeInStorage,exports.setLocaleCookie=o.setLocaleCookie,exports.setLocaleInStorage=o.setLocaleInStorage,exports.useDictionary=n.useDictionary,exports.useDictionaryDynamic=r.useDictionaryDynamic,exports.useIntlayer=i.useIntlayer,exports.useLocale=a.useLocale,exports.useLocaleCookie=o.useLocaleCookie,exports.useLocaleStorage=o.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-CFvvijL7.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`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/dictionaryManipulator");const t=require("../getDictionary.cjs"),n=require("./IntlayerBinding.cjs");var r=(r,i)=>n.createContentProxy(({contextLocale:n,contextVariant:a})=>({content:process.env.INTLAYER_DICTIONARY_SELECTOR===`false`?t.getDictionary(r,i??n):t.getDictionary(r,(0,e.resolveDictionaryArgument)({localeOrSelector:i,contextLocale:n,contextVariant:a,dictionaryKey:r.key}))}));exports.useDictionary=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/dictionaryManipulator");const t=require("../getDictionary.cjs"),n=require("./IntlayerBinding.cjs");var r=(0,e.createDynamicContentStore)((e,n)=>t.getDictionary(e,n)),i=(e,t,i)=>{let a=r.createReader(e,String(t));return n.createContentProxy(({contextLocale:e,contextVariant:t},n)=>a({localeOrSelector:i,contextLocale:e,contextVariant:t},n))};exports.useDictionaryDynamic=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/dictionaryManipulator");const t=require("../getIntlayer.cjs"),n=require("./IntlayerBinding.cjs");var r=(r,i)=>n.createContentProxy(({contextLocale:n,contextVariant:a})=>({content:process.env.INTLAYER_DICTIONARY_SELECTOR===`false`?t.getIntlayer(r,i??n):t.getIntlayer(r,(0,e.resolveDictionaryArgument)({localeOrSelector:i,contextLocale:n,contextVariant:a,dictionaryKey:r}))}));exports.useIntlayer=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/config/built");const t=require("../../installIntlayer-CFvvijL7.js"),n=require("./useLocaleStorage.cjs");var r=class{host;_isCookieEnabled;_onLocaleChange;_unsubscribe=null;locale;defaultLocale;availableLocales;constructor(n,r={}){this.host=n,this._isCookieEnabled=r.isCookieEnabled,this._onLocaleChange=r.onLocaleChange;let i=t.r(),{defaultLocale:a,locales:o}=e.internationalization??{};this.locale=i.locale,this.defaultLocale=a,this.availableLocales=o??[],n.addController(this)}setLocale=e=>{if(!this.availableLocales.map(String).includes(e)){console.error(`Locale "${e}" is not available.`);return}let r=t.r();r.setLocale(e),n.setLocaleInStorage(e,this._isCookieEnabled??r.isCookieEnabled??!0),this._onLocaleChange?.(e)};hostConnected(){let e=t.r();this._unsubscribe=e.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`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/config/built"),t=require("@intlayer/core/localization");const n=require("../../installIntlayer-CFvvijL7.js");var r=class{_host;_unsubscribe=null;constructor(e){this._host=e,e.addController(this)}_rewrite(n){let r=e.routing?.rewrite;if(typeof window>`u`||!r)return;let i=window.location.pathname,a=(0,t.getRewritePath)(i,n,r);a&&a!==i&&window.history.replaceState(window.history.state,``,a+window.location.search+window.location.hash)}hostConnected(){let e=n.r();this._rewrite(e.locale),this._unsubscribe=e.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-CFvvijL7.js");exports.useEditor=e.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/formatters");const t=require("../../installIntlayer-CFvvijL7.js");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=t.r();this.value=(...t)=>(0,e.compact)(t[0],{...t[1],locale:t[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=t.r();this._unsubscribe=n.subscribe(t=>{this.value=(...n)=>(0,e.compact)(n[0],{...n[1],locale:n[1]?.locale??t}),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`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/formatters");const t=require("../../installIntlayer-CFvvijL7.js");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=t.r();this.value=(...t)=>(0,e.currency)(t[0],{...t[1],locale:t[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=t.r();this._unsubscribe=n.subscribe(t=>{this.value=(...n)=>(0,e.currency)(n[0],{...n[1],locale:n[1]?.locale??t}),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`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/formatters");const t=require("../../installIntlayer-CFvvijL7.js");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=t.r();this.value=(...t)=>{let n=typeof t[1]==`string`?{...e.presets[t[1]],locale:r.locale}:{...t[1],locale:t[1]?.locale??r.locale};return(0,e.date)(t[0],n)},n.addController(this)}hostConnected(){let n=t.r();this._unsubscribe=n.subscribe(t=>{this.value=(...n)=>{let r=typeof n[1]==`string`?{...e.presets[n[1]],locale:t}:{...n[1],locale:n[1]?.locale??t};return(0,e.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`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/utils");const t=require("../../installIntlayer-CFvvijL7.js");var n=class{host;_overrideLocale;_unsubscribe=null;value;constructor(n,r){this.host=n,this._overrideLocale=r;let i=t.r();this.value=(0,e.bindIntl)(this._overrideLocale??i.locale),n.addController(this)}hostConnected(){let n=t.r();this._unsubscribe=n.subscribe(t=>{this.value=(0,e.bindIntl)(this._overrideLocale??t),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`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/formatters");const t=require("../../installIntlayer-CFvvijL7.js");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=t.r();this.value=(...t)=>(0,e.list)(t[0],{...t[1],locale:t[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=t.r();this._unsubscribe=n.subscribe(t=>{this.value=(...n)=>(0,e.list)(n[0],{...n[1],locale:n[1]?.locale??t}),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`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/formatters");const t=require("../../installIntlayer-CFvvijL7.js");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=t.r();this.value=(...t)=>(0,e.number)(t[0],{...t[1],locale:t[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=t.r();this._unsubscribe=n.subscribe(t=>{this.value=(...n)=>(0,e.number)(n[0],{...n[1],locale:n[1]?.locale??t}),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`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/formatters");const t=require("../../installIntlayer-CFvvijL7.js");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=t.r();this.value=(...t)=>(0,e.percentage)(t[0],{...t[1],locale:t[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=t.r();this._unsubscribe=n.subscribe(t=>{this.value=(...n)=>(0,e.percentage)(n[0],{...n[1],locale:n[1]?.locale??t}),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`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/formatters");const t=require("../../installIntlayer-CFvvijL7.js");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=t.r();this.value=(...t)=>(0,e.relativeTime)(t[0],t[1],{...t[2],locale:t[2]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=t.r();this._unsubscribe=n.subscribe(t=>{this.value=(...n)=>(0,e.relativeTime)(n[0],n[1],{...n[2],locale:n[2]?.locale??t}),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`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/formatters");const t=require("../../installIntlayer-CFvvijL7.js");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=t.r();this.value=(...t)=>(0,e.units)(t[0],{...t[1],locale:t[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=t.r();this._unsubscribe=n.subscribe(t=>{this.value=(...n)=>(0,e.units)(n[0],{...n[1],locale:n[1]?.locale??t}),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`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/interpreter");const t=require("./plugins.cjs");var n=(n,r)=>{let i=typeof r==`object`&&r?r.locale:r;return(0,e.getDictionary)(n,r,t.getPlugins(i))};exports.getDictionary=n;
|
package/dist/cjs/getIntlayer.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/interpreter");const t=require("./plugins.cjs");var n=(n,r)=>{let i=typeof r==`object`&&r?r.locale:r;return(0,e.getIntlayer)(n,r,t.getPlugins(i))};exports.getIntlayer=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("lit"),t=require("lit/directives/unsafe-html.js");const n=require("./installIntlayerHTML.cjs");var r=(e,t={})=>e,i=({components:e}={})=>{let t=n.useHTML();return n=>t.renderHTML(n,{components:e})},a=class extends e.LitElement{static properties={content:{type:String},components:{attribute:!1}};content=``;components;createRenderRoot(){return this}render(){if(!this.content)return e.nothing;let n=i({components:this.components});return e.html`${(0,t.unsafeHTML)(n(this.content))}`}};customElements.get(`intlayer-html-renderer`)||customElements.define(`intlayer-html-renderer`,a),exports.HTMLRenderer=a,exports.renderHTML=r,exports.useHTMLRenderer=i;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./client/useLocaleStorage.cjs"),t=require("../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./client/useLocaleStorage.cjs"),t=require("../installIntlayer-CFvvijL7.js"),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("./plugins.cjs"),c=require("./client/useIntlayer.cjs"),l=require("./client/useLocale.cjs"),u=require("./client/useRewriteURL.cjs");require("./client/index.cjs"),exports.IntlayerBinding=i.IntlayerBinding,exports.IntlayerClient=t.t,exports.LocaleController=l.LocaleController,exports.createContentProxy=i.createContentProxy,exports.createIntlayerClient=t.n,exports.getDictionary=n.getDictionary,exports.getIntlayer=r.getIntlayer,exports.getIntlayerClient=t.r,exports.getLocaleInStorage=e.getLocaleInStorage,exports.getPlugins=s.getPlugins,exports.htmlPlugin=s.htmlPlugin,exports.insertionPlugin=s.insertionPlugin,exports.installIntlayer=t.i,exports.intlayerNodePlugins=s.intlayerNodePlugins,exports.localeCookie=e.localeCookie,exports.localeInStorage=e.localeInStorage,exports.markdownPlugin=s.markdownPlugin,exports.markdownStringPlugin=s.markdownStringPlugin,exports.setLocaleCookie=e.setLocaleCookie,exports.setLocaleInStorage=e.setLocaleInStorage,exports.useDictionary=a.useDictionary,exports.useDictionaryDynamic=o.useDictionaryDynamic,exports.useEditor=t.a,exports.useIntlayer=c.useIntlayer,exports.useLocale=l.useLocale,exports.useLocaleCookie=e.useLocaleCookie,exports.useLocaleStorage=e.useLocaleStorage,exports.useRewriteURL=u.useRewriteURL;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("lit"),t=require("lit/directives/unsafe-html.js");const n=require("./compiler.cjs"),r=require("./installIntlayerMarkdown.cjs");var i=(e,{forceBlock:t,forceInline:r,preserveFrontmatter:i,tagfilter:a}={})=>n.compileMarkdown(e,{forceBlock:t,forceInline:r,preserveFrontmatter:i,tagfilter:a}),a=(e={})=>{let t=r.useMarkdown();return n=>t.renderMarkdown(n,{forceBlock:e.forceBlock,forceInline:e.forceInline,preserveFrontmatter:e.preserveFrontmatter,tagfilter:e.tagfilter},e.components,e.wrapper)},o=class extends e.LitElement{static properties={content:{type:[String,Object]},forceBlock:{type:Boolean},forceInline:{type:Boolean},preserveFrontmatter:{type:Boolean},tagfilter:{type:Boolean},renderMarkdown:{attribute:!1}};content=``;forceBlock;forceInline;preserveFrontmatter;tagfilter;renderMarkdownFn;createRenderRoot(){return this}render(){if(!this.content)return e.nothing;let n;return n=this.renderMarkdownFn?this.renderMarkdownFn(this.content,{forceBlock:this.forceBlock,forceInline:this.forceInline,preserveFrontmatter:this.preserveFrontmatter,tagfilter:this.tagfilter},void 0,void 0):a({forceBlock:this.forceBlock,forceInline:this.forceInline,preserveFrontmatter:this.preserveFrontmatter,tagfilter:this.tagfilter})(this.content),e.html`${(0,t.unsafeHTML)(n)}`}};customElements.get(`intlayer-markdown-renderer`)||customElements.define(`intlayer-markdown-renderer`,o),exports.MarkdownRenderer=o,exports.renderMarkdown=i,exports.useMarkdownRenderer=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@intlayer/core/markdown");const t=require("./runtime.cjs");var n=(n=``,r={})=>{let{components:i,namedCodesToUnicode:a,sanitizer:o,slugify:s,...c}=r;return(0,e.parseMarkdown)(n,{runtime:t.default,components:i,namedCodesToUnicode:a,sanitizer:o,slugify:s},c)},r=(n=``,r={})=>{if(typeof n==`string`)return(0,e.compileWithOptions)(n,t.default,r);let{components:i,namedCodesToUnicode:a,sanitizer:o,slugify:s,...c}=r;return(0,e.renderMarkdownAst)(n,{runtime:t.default,components:i,namedCodesToUnicode:a,sanitizer:o,slugify:s},c)};exports.compileMarkdown=r,exports.parseMarkdown=n;
|
package/dist/cjs/plugins.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
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));
|
|
2
|
-
>${e.children}</${(0,
|
|
3
|
-
>`}}),o=(0,
|
|
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));let c=require("@intlayer/config/built"),l=require("@intlayer/core/interpreter"),u=require("@intlayer/core/markdown"),d=require("@intlayer/core/utils"),f=require("@intlayer/types/nodeType"),p=require("lit/directives/unsafe-html.js"),m=require("lit/static-html.js");const h=require("../installIntlayer-CFvvijL7.js"),g=require("./markdown/runtime.cjs"),_=require("./renderIntlayerNode.cjs");f=s(f);var v=(e=``,t={})=>(0,u.compileWithOptions)(e,g.default,t),y=(e,t,n={})=>{let r=typeof e==`string`?(0,p.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,d.getIntlayerNodePrototype)(t,i?Array.prototype:Object.prototype))},b=e=>e.replace(/&/g,`&`).replace(/"/g,`"`),x=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),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`&&c.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 _.renderIntlayerNode({value:t,children:t})}},C=process.env.INTLAYER_NODE_TYPE_INSERTION===`false`?l.fallbackPlugin:{id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===f.INSERTION,transform:(e,t,n)=>{let r=[...t.keyPath,{type:f.INSERTION}],i=e[f.INSERTION],a={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`||(0,l.isInterpolableWrapperNode)(e),transform:(e,n,r)=>{if((0,l.isInterpolableWrapperNode)(e))return i=>(0,l.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,l.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,l.resolveInsertedSelector)(i,o)}},w=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?l.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,u.getMarkdownMetadata)(e)??{},{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>_.renderIntlayerNode({...n,value:t,children:e})}],dictionaryKey:i.dictionaryKey,keyPath:[]}),l=v(e),d=t=>{let n=v(e,{components:t});return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&c.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`&&c.editor.enabled?y(`<intlayer-content-selector-wrapper key-path="${b(JSON.stringify(a??[]))}" dictionary-key="${b(String(o??``))}">${l}</intlayer-content-selector-wrapper>`,e,{metadata:s,use:d}):y(l,e,{metadata:s,use:d})}},T=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?l.fallbackPlugin:{id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===f.MARKDOWN,transform:(e,t,n)=>{let r=[...t.keyPath,{type:f.MARKDOWN}],i=e[f.MARKDOWN];return n(i,{...t,children:i,keyPath:r,plugins:[w,...t.plugins??[]]})}},E=process.env.INTLAYER_NODE_TYPE_HTML===`false`?l.fallbackPlugin:{id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===f.HTML,transform:(e,t)=>{let n=e[f.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=>m.html`<${(0,m.unsafeStatic)(t)} ...${e}
|
|
2
|
+
>${e.children}</${(0,m.unsafeStatic)(t)}
|
|
3
|
+
>`}}),o=(0,l.getHTML)(n,a);return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&c.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`&&c.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`&&h.r()?.locale)??(0,l.resolveInterpreterLocale)(),r=`${n}_${t}`;if(D.has(r))return D.get(r);let i=[S,(0,l.translationPlugin)(n,t?c.internationalization.defaultLocale:void 0),l.enumerationPlugin,(0,l.pluralPlugin)(n),l.conditionPlugin,(0,l.nestedPlugin)(n),l.filePlugin,l.genderPlugin,l.selectPlugin,C,T,E].filter(e=>e!==l.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,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { loadingContentPlaceholder as e } from "@intlayer/core/dictionaryManipulator";
|
|
2
|
+
import { r as t } from "../../installIntlayer-CTpPd7yz.mjs";
|
|
3
3
|
// src/client/IntlayerBinding.ts
|
|
4
4
|
var n = class {
|
|
5
5
|
host;
|
|
@@ -10,8 +10,8 @@ var n = class {
|
|
|
10
10
|
this.host = e, this.onConnect = t, this.onDisconnect = n, this.host.addController(this);
|
|
11
11
|
}
|
|
12
12
|
hostConnected() {
|
|
13
|
-
let
|
|
14
|
-
this.unsubscribeLocale =
|
|
13
|
+
let e = t();
|
|
14
|
+
this.unsubscribeLocale = e.subscribe(() => {
|
|
15
15
|
this.host.requestUpdate();
|
|
16
16
|
}), this.onConnect?.();
|
|
17
17
|
}
|
|
@@ -19,7 +19,7 @@ var n = class {
|
|
|
19
19
|
this.unsubscribeLocale?.(), this.unsubscribeLocale = null, this.onDisconnect?.();
|
|
20
20
|
}
|
|
21
21
|
}, r = (r) => {
|
|
22
|
-
let i =
|
|
22
|
+
let i = t(), a = /* @__PURE__ */ new Set(), o, s, c, l = !1, u = () => {
|
|
23
23
|
if (!l || s !== i.locale || c !== i.variant) {
|
|
24
24
|
l = !0, s = i.locale, c = i.variant;
|
|
25
25
|
let e = r({
|
|
@@ -34,13 +34,13 @@ var n = class {
|
|
|
34
34
|
return o;
|
|
35
35
|
};
|
|
36
36
|
u();
|
|
37
|
-
let d = new Proxy({}, { get(
|
|
37
|
+
let d = new Proxy({}, { get(t, r) {
|
|
38
38
|
if (r === "observe") return (e) => (a.add(e), new n(e, () => {
|
|
39
39
|
o && e.requestUpdate();
|
|
40
40
|
}, () => a.delete(e)), d);
|
|
41
41
|
if (r === "then" || typeof r == "string" && r.startsWith("_$")) return;
|
|
42
42
|
let i = u();
|
|
43
|
-
if (!i) return
|
|
43
|
+
if (!i) return e[r];
|
|
44
44
|
let s = i.content;
|
|
45
45
|
return r === Symbol.toPrimitive ? () => s?.[Symbol.toPrimitive]?.() ?? "" : r === "toString" ? () => String(s?.toString?.() ?? "") : s?.[r];
|
|
46
46
|
} });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IntlayerBinding as e, createContentProxy as t } from "./IntlayerBinding.mjs";
|
|
2
|
-
import { i as n, n as r, r as i, t as a } from "../../installIntlayer-
|
|
2
|
+
import { i as n, n as r, r as i, t as a } from "../../installIntlayer-CTpPd7yz.mjs";
|
|
3
3
|
import { useDictionary as o } from "./useDictionary.mjs";
|
|
4
4
|
import { useDictionaryDynamic as s } from "./useDictionaryDynamic.mjs";
|
|
5
5
|
import { useIntlayer as c } from "./useIntlayer.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as IntlayerClient, n as createIntlayerClient, r as getIntlayerClient, i as installIntlayer } from "../../installIntlayer-
|
|
1
|
+
export { t as IntlayerClient, n as createIntlayerClient, r as getIntlayerClient, i as installIntlayer } from "../../installIntlayer-CTpPd7yz.mjs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { resolveDictionaryArgument as e } from "@intlayer/core/dictionaryManipulator";
|
|
2
|
+
import { getDictionary as t } from "../getDictionary.mjs";
|
|
3
|
+
import { createContentProxy as n } from "./IntlayerBinding.mjs";
|
|
4
4
|
// src/client/useDictionary.ts
|
|
5
|
-
var r = (r, i) =>
|
|
5
|
+
var r = (r, i) => n(({ contextLocale: n, contextVariant: a }) => ({ content: process.env.INTLAYER_DICTIONARY_SELECTOR === "false" ? t(r, i ?? n) : t(r, e({
|
|
6
6
|
localeOrSelector: i,
|
|
7
|
-
contextLocale:
|
|
7
|
+
contextLocale: n,
|
|
8
8
|
contextVariant: a,
|
|
9
9
|
dictionaryKey: r.key
|
|
10
10
|
})) }));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { createDynamicContentStore as e } from "@intlayer/core/dictionaryManipulator";
|
|
2
|
+
import { getDictionary as t } from "../getDictionary.mjs";
|
|
3
|
+
import { createContentProxy as n } from "./IntlayerBinding.mjs";
|
|
4
4
|
// src/client/useDictionaryDynamic.ts
|
|
5
|
-
var r =
|
|
6
|
-
let a = r.createReader(e, String(
|
|
7
|
-
return
|
|
5
|
+
var r = e((e, n) => t(e, n)), i = (e, t, i) => {
|
|
6
|
+
let a = r.createReader(e, String(t));
|
|
7
|
+
return n(({ contextLocale: e, contextVariant: t }, n) => a({
|
|
8
8
|
localeOrSelector: i,
|
|
9
9
|
contextLocale: e,
|
|
10
10
|
contextVariant: t
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { resolveDictionaryArgument as e } from "@intlayer/core/dictionaryManipulator";
|
|
2
|
+
import { getIntlayer as t } from "../getIntlayer.mjs";
|
|
3
|
+
import { createContentProxy as n } from "./IntlayerBinding.mjs";
|
|
4
4
|
// src/client/useIntlayer.ts
|
|
5
|
-
var r = (r, i) =>
|
|
5
|
+
var r = (r, i) => n(({ contextLocale: n, contextVariant: a }) => ({ content: process.env.INTLAYER_DICTIONARY_SELECTOR === "false" ? t(r, i ?? n) : t(r, e({
|
|
6
6
|
localeOrSelector: i,
|
|
7
|
-
contextLocale:
|
|
7
|
+
contextLocale: n,
|
|
8
8
|
contextVariant: a,
|
|
9
9
|
dictionaryKey: r
|
|
10
10
|
})) }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { internationalization as e } from "@intlayer/config/built";
|
|
2
|
+
import { r as t } from "../../installIntlayer-CTpPd7yz.mjs";
|
|
3
|
+
import { setLocaleInStorage as n } from "./useLocaleStorage.mjs";
|
|
4
4
|
// src/client/useLocale.ts
|
|
5
5
|
var r = class {
|
|
6
6
|
host;
|
|
@@ -10,22 +10,22 @@ var r = class {
|
|
|
10
10
|
locale;
|
|
11
11
|
defaultLocale;
|
|
12
12
|
availableLocales;
|
|
13
|
-
constructor(
|
|
14
|
-
this.host =
|
|
15
|
-
let i =
|
|
16
|
-
this.locale = i.locale, this.defaultLocale = a, this.availableLocales = o ?? [],
|
|
13
|
+
constructor(n, r = {}) {
|
|
14
|
+
this.host = n, this._isCookieEnabled = r.isCookieEnabled, this._onLocaleChange = r.onLocaleChange;
|
|
15
|
+
let i = t(), { defaultLocale: a, locales: o } = e ?? {};
|
|
16
|
+
this.locale = i.locale, this.defaultLocale = a, this.availableLocales = o ?? [], n.addController(this);
|
|
17
17
|
}
|
|
18
|
-
setLocale = (
|
|
19
|
-
if (!this.availableLocales.map(String).includes(
|
|
20
|
-
console.error(`Locale "${
|
|
18
|
+
setLocale = (e) => {
|
|
19
|
+
if (!this.availableLocales.map(String).includes(e)) {
|
|
20
|
+
console.error(`Locale "${e}" is not available.`);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
let r =
|
|
24
|
-
r.setLocale(
|
|
23
|
+
let r = t();
|
|
24
|
+
r.setLocale(e), n(e, this._isCookieEnabled ?? r.isCookieEnabled ?? !0), this._onLocaleChange?.(e);
|
|
25
25
|
};
|
|
26
26
|
hostConnected() {
|
|
27
|
-
let
|
|
28
|
-
this._unsubscribe =
|
|
27
|
+
let e = t();
|
|
28
|
+
this._unsubscribe = e.subscribe((e) => {
|
|
29
29
|
this.locale = e, this.host.requestUpdate();
|
|
30
30
|
});
|
|
31
31
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { routing as e } from "@intlayer/config/built";
|
|
2
|
+
import { getRewritePath as t } from "@intlayer/core/localization";
|
|
3
|
+
import { r as n } from "../../installIntlayer-CTpPd7yz.mjs";
|
|
4
4
|
// src/client/useRewriteURL.ts
|
|
5
5
|
var r = class {
|
|
6
6
|
_host;
|
|
@@ -8,15 +8,15 @@ var r = class {
|
|
|
8
8
|
constructor(e) {
|
|
9
9
|
this._host = e, e.addController(this);
|
|
10
10
|
}
|
|
11
|
-
_rewrite(
|
|
12
|
-
let r =
|
|
11
|
+
_rewrite(n) {
|
|
12
|
+
let r = e?.rewrite;
|
|
13
13
|
if (typeof window > "u" || !r) return;
|
|
14
|
-
let i = window.location.pathname, a =
|
|
14
|
+
let i = window.location.pathname, a = t(i, n, r);
|
|
15
15
|
a && a !== i && window.history.replaceState(window.history.state, "", a + window.location.search + window.location.hash);
|
|
16
16
|
}
|
|
17
17
|
hostConnected() {
|
|
18
|
-
let
|
|
19
|
-
this._rewrite(
|
|
18
|
+
let e = n();
|
|
19
|
+
this._rewrite(e.locale), this._unsubscribe = e.subscribe((e) => {
|
|
20
20
|
this._rewrite(e);
|
|
21
21
|
});
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as useEditor } from "../../installIntlayer-
|
|
1
|
+
export { a as useEditor } from "../../installIntlayer-CTpPd7yz.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { compact as e } from "@intlayer/core/formatters";
|
|
2
|
+
import { r as t } from "../../installIntlayer-CTpPd7yz.mjs";
|
|
3
3
|
// src/format/useCompact.ts
|
|
4
4
|
var n = class {
|
|
5
5
|
host;
|
|
@@ -7,18 +7,18 @@ var n = class {
|
|
|
7
7
|
value;
|
|
8
8
|
constructor(n) {
|
|
9
9
|
this.host = n;
|
|
10
|
-
let r =
|
|
11
|
-
this.value = (...
|
|
12
|
-
...
|
|
13
|
-
locale:
|
|
10
|
+
let r = t();
|
|
11
|
+
this.value = (...t) => e(t[0], {
|
|
12
|
+
...t[1],
|
|
13
|
+
locale: t[1]?.locale ?? r.locale
|
|
14
14
|
}), n.addController(this);
|
|
15
15
|
}
|
|
16
16
|
hostConnected() {
|
|
17
|
-
let n =
|
|
18
|
-
this._unsubscribe = n.subscribe((
|
|
19
|
-
this.value = (...n) =>
|
|
17
|
+
let n = t();
|
|
18
|
+
this._unsubscribe = n.subscribe((t) => {
|
|
19
|
+
this.value = (...n) => e(n[0], {
|
|
20
20
|
...n[1],
|
|
21
|
-
locale: n[1]?.locale ??
|
|
21
|
+
locale: n[1]?.locale ?? t
|
|
22
22
|
}), this.host.requestUpdate();
|
|
23
23
|
});
|
|
24
24
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { currency as e } from "@intlayer/core/formatters";
|
|
2
|
+
import { r as t } from "../../installIntlayer-CTpPd7yz.mjs";
|
|
3
3
|
// src/format/useCurrency.ts
|
|
4
4
|
var n = class {
|
|
5
5
|
host;
|
|
@@ -7,18 +7,18 @@ var n = class {
|
|
|
7
7
|
value;
|
|
8
8
|
constructor(n) {
|
|
9
9
|
this.host = n;
|
|
10
|
-
let r =
|
|
11
|
-
this.value = (...
|
|
12
|
-
...
|
|
13
|
-
locale:
|
|
10
|
+
let r = t();
|
|
11
|
+
this.value = (...t) => e(t[0], {
|
|
12
|
+
...t[1],
|
|
13
|
+
locale: t[1]?.locale ?? r.locale
|
|
14
14
|
}), n.addController(this);
|
|
15
15
|
}
|
|
16
16
|
hostConnected() {
|
|
17
|
-
let n =
|
|
18
|
-
this._unsubscribe = n.subscribe((
|
|
19
|
-
this.value = (...n) =>
|
|
17
|
+
let n = t();
|
|
18
|
+
this._unsubscribe = n.subscribe((t) => {
|
|
19
|
+
this.value = (...n) => e(n[0], {
|
|
20
20
|
...n[1],
|
|
21
|
-
locale: n[1]?.locale ??
|
|
21
|
+
locale: n[1]?.locale ?? t
|
|
22
22
|
}), this.host.requestUpdate();
|
|
23
23
|
});
|
|
24
24
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { date as e, presets as t } from "@intlayer/core/formatters";
|
|
2
|
+
import { r as n } from "../../installIntlayer-CTpPd7yz.mjs";
|
|
3
3
|
// src/format/useDate.ts
|
|
4
4
|
var r = class {
|
|
5
5
|
host;
|
|
@@ -7,30 +7,30 @@ var r = class {
|
|
|
7
7
|
value;
|
|
8
8
|
constructor(r) {
|
|
9
9
|
this.host = r;
|
|
10
|
-
let i =
|
|
11
|
-
this.value = (...
|
|
12
|
-
let r = typeof
|
|
13
|
-
...n[
|
|
10
|
+
let i = n();
|
|
11
|
+
this.value = (...n) => {
|
|
12
|
+
let r = typeof n[1] == "string" ? {
|
|
13
|
+
...t[n[1]],
|
|
14
14
|
locale: i.locale
|
|
15
15
|
} : {
|
|
16
|
-
...
|
|
17
|
-
locale:
|
|
16
|
+
...n[1],
|
|
17
|
+
locale: n[1]?.locale ?? i.locale
|
|
18
18
|
};
|
|
19
|
-
return
|
|
19
|
+
return e(n[0], r);
|
|
20
20
|
}, r.addController(this);
|
|
21
21
|
}
|
|
22
22
|
hostConnected() {
|
|
23
|
-
let r =
|
|
24
|
-
this._unsubscribe = r.subscribe((
|
|
23
|
+
let r = n();
|
|
24
|
+
this._unsubscribe = r.subscribe((n) => {
|
|
25
25
|
this.value = (...r) => {
|
|
26
26
|
let i = typeof r[1] == "string" ? {
|
|
27
|
-
...
|
|
28
|
-
locale:
|
|
27
|
+
...t[r[1]],
|
|
28
|
+
locale: n
|
|
29
29
|
} : {
|
|
30
30
|
...r[1],
|
|
31
|
-
locale: r[1]?.locale ??
|
|
31
|
+
locale: r[1]?.locale ?? n
|
|
32
32
|
};
|
|
33
|
-
return
|
|
33
|
+
return e(r[0], i);
|
|
34
34
|
}, this.host.requestUpdate();
|
|
35
35
|
});
|
|
36
36
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { bindIntl as e } from "@intlayer/core/utils";
|
|
2
|
+
import { r as t } from "../../installIntlayer-CTpPd7yz.mjs";
|
|
3
3
|
// src/format/useIntl.ts
|
|
4
4
|
var n = class {
|
|
5
5
|
host;
|
|
@@ -8,13 +8,13 @@ var n = class {
|
|
|
8
8
|
value;
|
|
9
9
|
constructor(n, r) {
|
|
10
10
|
this.host = n, this._overrideLocale = r;
|
|
11
|
-
let i =
|
|
12
|
-
this.value =
|
|
11
|
+
let i = t();
|
|
12
|
+
this.value = e(this._overrideLocale ?? i.locale), n.addController(this);
|
|
13
13
|
}
|
|
14
14
|
hostConnected() {
|
|
15
|
-
let n =
|
|
16
|
-
this._unsubscribe = n.subscribe((
|
|
17
|
-
this.value =
|
|
15
|
+
let n = t();
|
|
16
|
+
this._unsubscribe = n.subscribe((t) => {
|
|
17
|
+
this.value = e(this._overrideLocale ?? t), this.host.requestUpdate();
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
hostDisconnected() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { list as e } from "@intlayer/core/formatters";
|
|
2
|
+
import { r as t } from "../../installIntlayer-CTpPd7yz.mjs";
|
|
3
3
|
// src/format/useList.ts
|
|
4
4
|
var n = class {
|
|
5
5
|
host;
|
|
@@ -7,18 +7,18 @@ var n = class {
|
|
|
7
7
|
value;
|
|
8
8
|
constructor(n) {
|
|
9
9
|
this.host = n;
|
|
10
|
-
let r =
|
|
11
|
-
this.value = (...
|
|
12
|
-
...
|
|
13
|
-
locale:
|
|
10
|
+
let r = t();
|
|
11
|
+
this.value = (...t) => e(t[0], {
|
|
12
|
+
...t[1],
|
|
13
|
+
locale: t[1]?.locale ?? r.locale
|
|
14
14
|
}), n.addController(this);
|
|
15
15
|
}
|
|
16
16
|
hostConnected() {
|
|
17
|
-
let n =
|
|
18
|
-
this._unsubscribe = n.subscribe((
|
|
19
|
-
this.value = (...n) =>
|
|
17
|
+
let n = t();
|
|
18
|
+
this._unsubscribe = n.subscribe((t) => {
|
|
19
|
+
this.value = (...n) => e(n[0], {
|
|
20
20
|
...n[1],
|
|
21
|
-
locale: n[1]?.locale ??
|
|
21
|
+
locale: n[1]?.locale ?? t
|
|
22
22
|
}), this.host.requestUpdate();
|
|
23
23
|
});
|
|
24
24
|
}
|