lit-intlayer 8.6.2 → 8.6.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/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/useLocaleStorage.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 +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 +23 -23
- package/dist/{installIntlayer-3Fpy-rFd.mjs → installIntlayer-CyAs4nGc.mjs} +12 -12
- package/dist/installIntlayer-Dyc602Pv.js +1 -0
- package/dist/types/plugins.d.ts +1 -0
- package/package.json +7 -7
- package/dist/installIntlayer-BvRKKBhO.js +0 -1
|
@@ -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-Dyc602Pv.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(){this.unsubscribeLocale=e.r().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-Dyc602Pv.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-Dyc602Pv.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-Dyc602Pv.js`),t=require(`../getDictionary.cjs`),n=require(`./IntlayerBinding.cjs`);let r=require(`@intlayer/config/built`);r=e.o(r);var i=(i,a)=>{let o=e.r(),s=t.getDictionary(i,a??o.locale??r.default.internationalization.defaultLocale);o.subscribe(e=>{s=t.getDictionary(i,a??e)});let c,l=new Proxy({},{get(e,t){if(t===`observe`)return c;if(t===Symbol.toPrimitive)return()=>s[Symbol.toPrimitive]?.()??``;if(t===`toString`)return()=>String(s.toString?.()??``);if(t!==`then`)return s[t]}});return c=e=>(new n.IntlayerBinding(e),l),l};exports.useDictionary=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-Dyc602Pv.js`),t=require(`../getDictionary.cjs`),n=require(`./IntlayerBinding.cjs`);let r=require(`@intlayer/config/built`);r=e.o(r);var i=new Map,a=async(e,t)=>{if(!t)return;if(i.has(e))return i.get(e);let n=await t();return i.set(e,n),n},o=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 o},apply:()=>o,construct:()=>({})}),s=(i,s,c)=>{let l=e.r(),u=()=>c??l.locale??r.default.internationalization.defaultLocale,d,f=new Set,p=e=>{let n=`${String(s)}.${e}`,r=i[e];a(n,r).then(n=>{if(n){d=t.getDictionary(n,e);for(let e of f)e()}})};p(u()),l.subscribe(e=>{p(c??e)});let m,h=new Proxy({},{get(e,t){if(t===`observe`)return m;if(t===Symbol.toPrimitive)return()=>void 0;if(t===`toString`)return()=>``;if(t!==`then`)return d===void 0?o:d[t]}});return m=e=>{let t=()=>e.requestUpdate();return f.add(t),new n.IntlayerBinding(e,()=>{d!==void 0&&e.requestUpdate()},()=>{f.delete(t)}),h},h};exports.useDictionaryDynamic=s;
|
|
@@ -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-Dyc602Pv.js`),t=require(`../getIntlayer.cjs`),n=require(`./IntlayerBinding.cjs`);let r=require(`@intlayer/config/built`);r=e.o(r);var i=(i,a)=>{let o=e.r(),s,c=null,l=new Proxy({},{get(e,u){if(u===`observe`)return e=>(new n.IntlayerBinding(e),l);if(u===Symbol.toPrimitive||u===`toString`)return()=>``;if(u===`then`||typeof u==`symbol`||typeof u==`string`&&u.startsWith(`_$`))return;let d=a??o.locale??r.default.internationalization.defaultLocale;return(s!==d||c===null)&&(c=t.getIntlayer(i,d),s=d),c[u]}});return l};exports.useIntlayer=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-Dyc602Pv.js`),t=require(`./useLocaleStorage.cjs`);let n=require(`@intlayer/config/built`);n=e.o(n);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.default?.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(){this._unsubscribe=e.r().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`}),require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../installIntlayer-Dyc602Pv.js`);let e=require(`@intlayer/core/localization`),t=require(`@intlayer/core/utils`);var n=(0,t.getLocaleFromStorageClient)(e.localeStorageOptions),r=n,i=(n,r)=>(0,t.setLocaleInStorageClient)(n,{...e.localeStorageOptions,isCookieEnabled:r}),a=i,o=n=>{let r=(0,t.LocaleStorageClient)({...e.localeStorageOptions,isCookieEnabled:n});return{localeStorage:r.getLocale(),setLocaleStorage:r.setLocale}},s=e=>{let t=o(e);return{localeCookie:t.localeStorage,setLocaleCookie:t.setLocaleStorage}};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-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../installIntlayer-Dyc602Pv.js`);let t=require(`@intlayer/config/built`);t=e.o(t);let n=require(`@intlayer/core/localization`);var r=class{host;_unsubscribe=null;constructor(e){this.host=e,e.addController(this)}_rewrite(e){let r=t.default?.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-Dyc602Pv.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-Dyc602Pv.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(){this._unsubscribe=e.r().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-Dyc602Pv.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(){this._unsubscribe=e.r().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-Dyc602Pv.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(){this._unsubscribe=e.r().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-Dyc602Pv.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(){this._unsubscribe=e.r().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-Dyc602Pv.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(){this._unsubscribe=e.r().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-Dyc602Pv.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(){this._unsubscribe=e.r().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-Dyc602Pv.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(){this._unsubscribe=e.r().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-Dyc602Pv.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(){this._unsubscribe=e.r().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-Dyc602Pv.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(){this._unsubscribe=e.r().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`}),require(`../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../installIntlayer-Dyc602Pv.js`);const e=require(`./plugins.cjs`);let t=require(`@intlayer/core/interpreter`);var n=(n,r)=>(0,t.getDictionary)(n,r,e.getPlugins(r));exports.getDictionary=n;
|
package/dist/cjs/getIntlayer.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../installIntlayer-Dyc602Pv.js`);const e=require(`./plugins.cjs`);let t=require(`@intlayer/core/interpreter`);var n=(n,r)=>(0,t.getIntlayer)(n,r,e.getPlugins(r));exports.getIntlayer=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../installIntlayer-Dyc602Pv.js`);const e=require(`./installIntlayerHTML.cjs`);let t=require(`lit/directives/unsafe-html.js`),n=require(`lit`);var r=(e,t={})=>e,i=({components:t}={})=>{let n=e.useHTML();return e=>n.renderHTML(e,{components:t})},a=class extends n.LitElement{static properties={content:{type:String},components:{attribute:!1}};content=``;components;createRenderRoot(){return this}render(){return this.content?n.html`${(0,t.unsafeHTML)(i({components:this.components})(this.content))}`:n.nothing}};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(`../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../installIntlayer-Dyc602Pv.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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../installIntlayer-Dyc602Pv.js`);const e=require(`./compiler.cjs`),t=require(`./installIntlayerMarkdown.cjs`);let n=require(`lit/directives/unsafe-html.js`),r=require(`lit`);var i=(t,{forceBlock:n,forceInline:r,preserveFrontmatter:i,tagfilter:a}={})=>e.compileMarkdown(t,{forceBlock:n,forceInline:r,preserveFrontmatter:i,tagfilter:a}),a=(e={})=>{let n=t.useMarkdown();return t=>n.renderMarkdown(t,{forceBlock:e.forceBlock,forceInline:e.forceInline,preserveFrontmatter:e.preserveFrontmatter,tagfilter:e.tagfilter},e.components,e.wrapper)},o=class extends r.LitElement{static properties={content:{type:String},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 r.nothing;let e;return e=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),r.html`${(0,n.unsafeHTML)(e)}`}};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`}),require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../installIntlayer-Dyc602Pv.js`);const e=require(`./runtime.cjs`);let t=require(`@intlayer/core/markdown`);var n=(n=``,r={})=>(0,t.compileWithOptions)(n,e.default,r),r=n,i=n;exports.RuleType=t.RuleType,exports.compile=i,exports.compileMarkdown=n,exports.compiler=r,exports.sanitizer=t.sanitizer,exports.slugify=t.slugify;
|
package/dist/cjs/plugins.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-Dyc602Pv.js`),t=require(`./markdown/runtime.cjs`),n=require(`./renderIntlayerNode.cjs`);let r=require(`@intlayer/core/interpreter`),i=require(`@intlayer/config/built`);i=e.o(i);let a=require(`@intlayer/core/markdown`),o=require(`@intlayer/types/nodeType`);o=e.o(o);let s=require(`lit/directives/unsafe-html.js`),c=require(`lit/static-html.js`);var l=process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE===`false`,u=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`,d=process.env.INTLAYER_NODE_TYPE_HTML===`false`,f=process.env.INTLAYER_NODE_TYPE_INSERTION===`false`,p=process.env.INTLAYER_EDITOR_ENABLED===`false`,m=(e=``,n={})=>(0,a.compileWithOptions)(e,t.default,n),h=(e,t,n={})=>{let r=typeof e==`string`?(0,s.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)}})},g=e=>e.replace(/&/g,`&`).replace(/"/g,`"`),_=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),v=l?r.fallbackPlugin:{id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(e,{children:t,keyPath:r,dictionaryKey:a,...o})=>{if(!p&&i.default.editor.enabled){let e=String(t??``);return h(`<intlayer-content-selector-wrapper key-path="${g(JSON.stringify(r??[]))}" dictionary-key="${g(String(a??``))}">${_(e)}</intlayer-content-selector-wrapper>`,e)}return n.renderIntlayerNode({...o,value:t,children:t})}},y=f?r.fallbackPlugin:{id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===o.INSERTION,transform:(e,t,n)=>{let i=[...t.keyPath,{type:o.INSERTION}],a=e[o.INSERTION],s={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,n,i)=>{let a=i(e,{...n,children:e,plugins:(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)});return e=>{let o=(0,r.splitInsertionTemplate)(a,e),s=o.isSimple?o.parts:o.parts.join(``);return i(s,{...n,plugins:t.plugins,children:s})}}},c=n(a,{...t,children:a,keyPath:i,plugins:[s,...t.plugins??[]]});return typeof a==`object`&&a&&`nodeType`in a&&[o.ENUMERATION,o.CONDITION].includes(a.nodeType)?e=>t=>{let n=c(t);return typeof n==`function`?n(e):n}:c}},b=u?r.fallbackPlugin:{id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,t,r)=>{let{plugins:o,...s}=t,{keyPath:c,dictionaryKey:l}=s,u=r((0,a.getMarkdownMetadata)(e)??{},{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,r)=>n.renderIntlayerNode({...r,value:t,children:e})}],dictionaryKey:s.dictionaryKey,keyPath:[]}),d=m(e),f=t=>{let n=m(e,{components:t});return!p&&i.default.editor.enabled?h(`<intlayer-content-selector-wrapper key-path="${g(JSON.stringify(c??[]))}" dictionary-key="${g(String(l??``))}">${n}</intlayer-content-selector-wrapper>`,e):h(n,e)};return!p&&i.default.editor.enabled?h(`<intlayer-content-selector-wrapper key-path="${g(JSON.stringify(c??[]))}" dictionary-key="${g(String(l??``))}">${d}</intlayer-content-selector-wrapper>`,e,{metadata:u,use:f}):h(d,e,{metadata:u,use:f})}},x=u?r.fallbackPlugin:{id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===o.MARKDOWN,transform:(e,t,n)=>{let r=[...t.keyPath,{type:o.MARKDOWN}],i=e[o.MARKDOWN];return n(i,{...t,children:i,keyPath:r,plugins:[b,...t.plugins??[]]})}},S=d?r.fallbackPlugin:{id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===o.HTML,transform:(e,t)=>{let n=e[o.HTML],{keyPath:a,dictionaryKey:s}=t,l=(e={})=>{let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e).map(([e,t])=>[e,e=>t(e)])),o=(0,r.getHTML)(n,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=>c.html`<${(0,c.unsafeStatic)(t)} ...${e}>${e.children}</${(0,c.unsafeStatic)(t)}>`}}));return!p&&i.default.editor.enabled?h(`<intlayer-content-selector-wrapper key-path="${g(JSON.stringify(a??[]))}" dictionary-key="${g(String(s??``))}">${o}</intlayer-content-selector-wrapper>`,n):h(o,n)};return!p&&i.default.editor.enabled?h(`<intlayer-content-selector-wrapper key-path="${g(JSON.stringify(a??[]))}" dictionary-key="${g(String(s??``))}">${n}</intlayer-content-selector-wrapper>`,n,{use:l}):h(n,n,{use:l})}},C=(t,n=!0)=>{let a=t??(typeof window<`u`&&e.r()?.locale)??i.default.internationalization.defaultLocale;return[(0,r.translationPlugin)(a,n?i.default.internationalization.defaultLocale:void 0),r.enumerationPlugin,r.conditionPlugin,(0,r.nestedPlugin)(a),r.filePlugin,r.genderPlugin,v,y,x,S].filter(Boolean)};exports.getPlugins=C,exports.htmlPlugin=S,exports.insertionPlugin=y,exports.intlayerNodePlugins=v,exports.markdownPlugin=x,exports.markdownStringPlugin=b;
|
|
@@ -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-CyAs4nGc.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-CyAs4nGc.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-CyAs4nGc.mjs";
|
|
2
2
|
import { getDictionary as t } from "../getDictionary.mjs";
|
|
3
3
|
import { IntlayerBinding as n } from "./IntlayerBinding.mjs";
|
|
4
4
|
import r from "@intlayer/config/built";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as e } from "../../installIntlayer-
|
|
1
|
+
import { r as e } from "../../installIntlayer-CyAs4nGc.mjs";
|
|
2
2
|
import { getDictionary as t } from "../getDictionary.mjs";
|
|
3
3
|
import { IntlayerBinding as n } from "./IntlayerBinding.mjs";
|
|
4
4
|
import r from "@intlayer/config/built";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as e } from "../../installIntlayer-
|
|
1
|
+
import { r as e } from "../../installIntlayer-CyAs4nGc.mjs";
|
|
2
2
|
import { getIntlayer as t } from "../getIntlayer.mjs";
|
|
3
3
|
import { IntlayerBinding as n } from "./IntlayerBinding.mjs";
|
|
4
4
|
import r from "@intlayer/config/built";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as e } from "../../installIntlayer-
|
|
1
|
+
import { r as e } from "../../installIntlayer-CyAs4nGc.mjs";
|
|
2
2
|
import 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-CyAs4nGc.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-CyAs4nGc.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 { getDictionary as d } from "./getDictionary.mjs";
|
|
4
4
|
import { getIntlayer as f } from "./getIntlayer.mjs";
|
package/dist/esm/plugins.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as e } from "../installIntlayer-
|
|
1
|
+
import { r as e } from "../installIntlayer-CyAs4nGc.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, nestedPlugin as l, splitInsertionTemplate as u, translationPlugin as d } from "@intlayer/core/interpreter";
|
|
@@ -8,20 +8,20 @@ import * as h from "@intlayer/types/nodeType";
|
|
|
8
8
|
import { unsafeHTML as g } from "lit/directives/unsafe-html.js";
|
|
9
9
|
import { html as _, unsafeStatic as v } from "lit/static-html.js";
|
|
10
10
|
//#region src/plugins.ts
|
|
11
|
-
var y = (e = "", n = {}) => p(e, t, n),
|
|
11
|
+
var y = process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE === "false", b = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false", x = process.env.INTLAYER_NODE_TYPE_HTML === "false", S = process.env.INTLAYER_NODE_TYPE_INSERTION === "false", C = process.env.INTLAYER_EDITOR_ENABLED === "false", w = (e = "", n = {}) => p(e, t, n), T = (e, t, n = {}) => {
|
|
12
12
|
let r = typeof e == "string" ? g(e) : e;
|
|
13
13
|
return new Proxy(r, { get(e, r, i) {
|
|
14
14
|
if (r === "value" || r === "raw") return t;
|
|
15
15
|
if (r === "toString" || r === Symbol.toPrimitive) return () => t;
|
|
16
16
|
if (r !== Symbol.iterator) return r === "__update" ? () => {} : r === "isJSX" ? !0 : r in n ? n[r] : Reflect.get(e, r, i);
|
|
17
17
|
} });
|
|
18
|
-
},
|
|
18
|
+
}, E = (e) => e.replace(/&/g, "&").replace(/"/g, """), D = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), O = y ? a : {
|
|
19
19
|
id: "intlayer-node-plugin",
|
|
20
20
|
canHandle: (e) => typeof e == "bigint" || typeof e == "string" || typeof e == "number",
|
|
21
21
|
transform: (e, { children: t, keyPath: r, dictionaryKey: i, ...a }) => {
|
|
22
|
-
if (f.editor.enabled) {
|
|
22
|
+
if (!C && f.editor.enabled) {
|
|
23
23
|
let e = String(t ?? "");
|
|
24
|
-
return
|
|
24
|
+
return T(`<intlayer-content-selector-wrapper key-path="${E(JSON.stringify(r ?? []))}" dictionary-key="${E(String(i ?? ""))}">${D(e)}</intlayer-content-selector-wrapper>`, e);
|
|
25
25
|
}
|
|
26
26
|
return n({
|
|
27
27
|
...a,
|
|
@@ -29,7 +29,7 @@ var y = (e = "", n = {}) => p(e, t, n), b = (e, t, n = {}) => {
|
|
|
29
29
|
children: t
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
},
|
|
32
|
+
}, k = S ? a : {
|
|
33
33
|
id: "insertion-plugin",
|
|
34
34
|
canHandle: (e) => typeof e == "object" && e?.nodeType === h.INSERTION,
|
|
35
35
|
transform: (e, t, n) => {
|
|
@@ -62,7 +62,7 @@ var y = (e = "", n = {}) => p(e, t, n), b = (e, t, n = {}) => {
|
|
|
62
62
|
return typeof n == "function" ? n(e) : n;
|
|
63
63
|
} : o;
|
|
64
64
|
}
|
|
65
|
-
},
|
|
65
|
+
}, A = b ? a : {
|
|
66
66
|
id: "markdown-string-plugin",
|
|
67
67
|
canHandle: (e) => typeof e == "string",
|
|
68
68
|
transform: (e, t, r) => {
|
|
@@ -78,19 +78,19 @@ var y = (e = "", n = {}) => p(e, t, n), b = (e, t, n = {}) => {
|
|
|
78
78
|
}],
|
|
79
79
|
dictionaryKey: a.dictionaryKey,
|
|
80
80
|
keyPath: []
|
|
81
|
-
}), l =
|
|
82
|
-
let n =
|
|
83
|
-
return f.editor.enabled ?
|
|
81
|
+
}), l = w(e), u = (t) => {
|
|
82
|
+
let n = w(e, { components: t });
|
|
83
|
+
return !C && f.editor.enabled ? T(`<intlayer-content-selector-wrapper key-path="${E(JSON.stringify(o ?? []))}" dictionary-key="${E(String(s ?? ""))}">${n}</intlayer-content-selector-wrapper>`, e) : T(n, e);
|
|
84
84
|
};
|
|
85
|
-
return f.editor.enabled ?
|
|
85
|
+
return !C && f.editor.enabled ? T(`<intlayer-content-selector-wrapper key-path="${E(JSON.stringify(o ?? []))}" dictionary-key="${E(String(s ?? ""))}">${l}</intlayer-content-selector-wrapper>`, e, {
|
|
86
86
|
metadata: c,
|
|
87
87
|
use: u
|
|
88
|
-
}) :
|
|
88
|
+
}) : T(l, e, {
|
|
89
89
|
metadata: c,
|
|
90
90
|
use: u
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
-
},
|
|
93
|
+
}, j = b ? a : {
|
|
94
94
|
id: "markdown-plugin",
|
|
95
95
|
canHandle: (e) => typeof e == "object" && e?.nodeType === h.MARKDOWN,
|
|
96
96
|
transform: (e, t, n) => {
|
|
@@ -99,10 +99,10 @@ var y = (e = "", n = {}) => p(e, t, n), b = (e, t, n = {}) => {
|
|
|
99
99
|
...t,
|
|
100
100
|
children: i,
|
|
101
101
|
keyPath: r,
|
|
102
|
-
plugins: [
|
|
102
|
+
plugins: [A, ...t.plugins ?? []]
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
|
-
},
|
|
105
|
+
}, M = x ? a : {
|
|
106
106
|
id: "html-plugin",
|
|
107
107
|
canHandle: (e) => typeof e == "object" && e?.nodeType === h.HTML,
|
|
108
108
|
transform: (e, t) => {
|
|
@@ -111,11 +111,11 @@ var y = (e = "", n = {}) => p(e, t, n), b = (e, t, n = {}) => {
|
|
|
111
111
|
if (typeof t == "string" && t in e) return e[t];
|
|
112
112
|
if (typeof t == "string" && /^[a-z][a-z0-9]*$/.test(t)) return (e) => _`<${v(t)} ...${e}>${e.children}</${v(t)}>`;
|
|
113
113
|
} }));
|
|
114
|
-
return f.editor.enabled ?
|
|
114
|
+
return !C && f.editor.enabled ? T(`<intlayer-content-selector-wrapper key-path="${E(JSON.stringify(r ?? []))}" dictionary-key="${E(String(i ?? ""))}">${a}</intlayer-content-selector-wrapper>`, n) : T(a, n);
|
|
115
115
|
};
|
|
116
|
-
return f.editor.enabled ?
|
|
116
|
+
return !C && f.editor.enabled ? T(`<intlayer-content-selector-wrapper key-path="${E(JSON.stringify(r ?? []))}" dictionary-key="${E(String(i ?? ""))}">${n}</intlayer-content-selector-wrapper>`, n, { use: a }) : T(n, n, { use: a });
|
|
117
117
|
}
|
|
118
|
-
},
|
|
118
|
+
}, N = (t, n = !0) => {
|
|
119
119
|
let a = t ?? (typeof window < "u" && e()?.locale) ?? f.internationalization.defaultLocale;
|
|
120
120
|
return [
|
|
121
121
|
d(a, n ? f.internationalization.defaultLocale : void 0),
|
|
@@ -124,11 +124,11 @@ var y = (e = "", n = {}) => p(e, t, n), b = (e, t, n = {}) => {
|
|
|
124
124
|
l(a),
|
|
125
125
|
o,
|
|
126
126
|
s,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
O,
|
|
128
|
+
k,
|
|
129
|
+
j,
|
|
130
|
+
M
|
|
131
131
|
].filter(Boolean);
|
|
132
132
|
};
|
|
133
133
|
//#endregion
|
|
134
|
-
export {
|
|
134
|
+
export { N as getPlugins, M as htmlPlugin, k as insertionPlugin, O as intlayerNodePlugins, j as markdownPlugin, A as markdownStringPlugin };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "@intlayer/config/built";
|
|
2
2
|
import { isEnabled as t } from "@intlayer/editor/isEnabled";
|
|
3
3
|
//#region src/editor/useEditor.ts
|
|
4
|
-
var n = class {
|
|
4
|
+
var n = process.env.INTLAYER_EDITOR_ENABLED === "false", r = class {
|
|
5
5
|
host;
|
|
6
6
|
_stopped = !1;
|
|
7
7
|
_unsubscribeLocale = null;
|
|
@@ -9,9 +9,9 @@ var n = class {
|
|
|
9
9
|
this.host = e, e.addController(this);
|
|
10
10
|
}
|
|
11
11
|
hostConnected() {
|
|
12
|
-
this._stopped = !1, t && import("@intlayer/editor").then(({ initEditorClient: e }) => {
|
|
12
|
+
this._stopped = !1, !(n || !t) && import("@intlayer/editor").then(({ initEditorClient: e }) => {
|
|
13
13
|
if (this._stopped) return;
|
|
14
|
-
let t = e(), n =
|
|
14
|
+
let t = e(), n = c();
|
|
15
15
|
t.currentLocale.set(n.locale), this._unsubscribeLocale = n.subscribe((e) => {
|
|
16
16
|
t.currentLocale.set(e);
|
|
17
17
|
});
|
|
@@ -23,13 +23,13 @@ var n = class {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
function
|
|
27
|
-
if (!t) return e ? void 0 : () => {};
|
|
26
|
+
function i(e) {
|
|
27
|
+
if (n || !t) return e ? void 0 : () => {};
|
|
28
28
|
if (!e) {
|
|
29
29
|
let e = !1, t = null;
|
|
30
30
|
return import("@intlayer/editor").then(({ initEditorClient: n }) => {
|
|
31
31
|
if (e) return;
|
|
32
|
-
let r = n(), i =
|
|
32
|
+
let r = n(), i = c();
|
|
33
33
|
r.currentLocale.set(i.locale), t = i.subscribe((e) => {
|
|
34
34
|
r.currentLocale.set(e);
|
|
35
35
|
});
|
|
@@ -39,11 +39,11 @@ function r(e) {
|
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
new
|
|
42
|
+
new r(e);
|
|
43
43
|
}
|
|
44
44
|
//#endregion
|
|
45
45
|
//#region src/client/installIntlayer.ts
|
|
46
|
-
var
|
|
46
|
+
var a = class {
|
|
47
47
|
_locale;
|
|
48
48
|
_listeners = /* @__PURE__ */ new Set();
|
|
49
49
|
isCookieEnabled;
|
|
@@ -63,9 +63,9 @@ var i = class {
|
|
|
63
63
|
this._listeners.delete(e);
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
},
|
|
67
|
-
let n =
|
|
68
|
-
return
|
|
66
|
+
}, o = null, s = (e, t = !0) => o || (o = new a(e, t), o), c = () => (o ||= new a(), o), l = ({ locale: e, isCookieEnabled: t } = {}) => {
|
|
67
|
+
let n = s(e, t);
|
|
68
|
+
return i(), n;
|
|
69
69
|
};
|
|
70
70
|
//#endregion
|
|
71
|
-
export {
|
|
71
|
+
export { i as a, l as i, s as n, c as r, a as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@intlayer/config/built`);c=s(c);let l=require(`@intlayer/editor/isEnabled`);var u=process.env.INTLAYER_EDITOR_ENABLED===`false`,d=class{host;_stopped=!1;_unsubscribeLocale=null;constructor(e){this.host=e,e.addController(this)}hostConnected(){this._stopped=!1,!(u||!l.isEnabled)&&import(`@intlayer/editor`).then(({initEditorClient:e})=>{if(this._stopped)return;let t=e(),n=g();t.currentLocale.set(n.locale),this._unsubscribeLocale=n.subscribe(e=>{t.currentLocale.set(e)})})}hostDisconnected(){this._stopped=!0,this._unsubscribeLocale?.(),this._unsubscribeLocale=null,import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})}};function f(e){if(u||!l.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=g();r.currentLocale.set(i.locale),t=i.subscribe(e=>{r.currentLocale.set(e)})}),()=>{e=!0,t?.(),import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})}}new d(e)}var p=class{_locale;_listeners=new Set;isCookieEnabled;constructor(e,t=!0){let{defaultLocale:n}=c.default.internationalization??{};this._locale=e??n,this.isCookieEnabled=t}get locale(){return this._locale}setLocale(e){this._locale=e;for(let t of this._listeners)t(e)}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}},m=null,h=(e,t=!0)=>m||(m=new p(e,t),m),g=()=>(m||=new p,m),_=({locale:e,isCookieEnabled:t}={})=>{let n=h(e,t);return f(),n};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
|
package/dist/types/plugins.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export type MarkdownStringCond<T> = T extends string ? IntlayerNode<string, {
|
|
|
35
35
|
/** Returns the raw markdown string; render with compileMarkdown() or <intlayer-markdown>. */
|
|
36
36
|
use: (components?: HTMLComponents<'permissive', {}>) => string;
|
|
37
37
|
}> : never;
|
|
38
|
+
/** Markdown string plugin. Replaces string node with a component that render the markdown. */
|
|
38
39
|
export declare const markdownStringPlugin: Plugins;
|
|
39
40
|
export type MarkdownCond<T> = T extends {
|
|
40
41
|
nodeType: NodeType | string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lit-intlayer",
|
|
3
|
-
"version": "8.6.
|
|
3
|
+
"version": "8.6.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Lit applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -103,11 +103,11 @@
|
|
|
103
103
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"@intlayer/api": "8.6.
|
|
107
|
-
"@intlayer/config": "8.6.
|
|
108
|
-
"@intlayer/core": "8.6.
|
|
109
|
-
"@intlayer/editor": "8.6.
|
|
110
|
-
"@intlayer/types": "8.6.
|
|
106
|
+
"@intlayer/api": "8.6.3",
|
|
107
|
+
"@intlayer/config": "8.6.3",
|
|
108
|
+
"@intlayer/core": "8.6.3",
|
|
109
|
+
"@intlayer/editor": "8.6.3",
|
|
110
|
+
"@intlayer/types": "8.6.3"
|
|
111
111
|
},
|
|
112
112
|
"devDependencies": {
|
|
113
113
|
"@types/node": "25.5.0",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"vitest": "4.1.2"
|
|
124
124
|
},
|
|
125
125
|
"peerDependencies": {
|
|
126
|
-
"intlayer": "8.6.
|
|
126
|
+
"intlayer": "8.6.3",
|
|
127
127
|
"lit": ">=3.0.0"
|
|
128
128
|
},
|
|
129
129
|
"peerDependenciesMeta": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@intlayer/config/built`);c=s(c);let l=require(`@intlayer/editor/isEnabled`);var u=class{host;_stopped=!1;_unsubscribeLocale=null;constructor(e){this.host=e,e.addController(this)}hostConnected(){this._stopped=!1,l.isEnabled&&import(`@intlayer/editor`).then(({initEditorClient:e})=>{if(this._stopped)return;let t=e(),n=h();t.currentLocale.set(n.locale),this._unsubscribeLocale=n.subscribe(e=>{t.currentLocale.set(e)})})}hostDisconnected(){this._stopped=!0,this._unsubscribeLocale?.(),this._unsubscribeLocale=null,import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})}};function d(e){if(!l.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=h();r.currentLocale.set(i.locale),t=i.subscribe(e=>{r.currentLocale.set(e)})}),()=>{e=!0,t?.(),import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})}}new u(e)}var f=class{_locale;_listeners=new Set;isCookieEnabled;constructor(e,t=!0){let{defaultLocale:n}=c.default.internationalization??{};this._locale=e??n,this.isCookieEnabled=t}get locale(){return this._locale}setLocale(e){this._locale=e;for(let t of this._listeners)t(e)}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}},p=null,m=(e,t=!0)=>p||(p=new f(e,t),p),h=()=>(p||=new f,p),g=({locale:e,isCookieEnabled:t}={})=>{let n=m(e,t);return d(),n};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
|