vanilla-intlayer 8.7.11 → 8.7.13
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 +27 -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/index.cjs +1 -1
- package/dist/cjs/markdown/compiler.cjs +1 -1
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/editor/useEditor.d.ts +19 -0
- 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-DIY78OKJ.mjs → installIntlayer-C99qMzFH.mjs} +8 -8
- package/dist/installIntlayer-CxkE8IxM.js +1 -0
- package/dist/plugins-Bp8aaTny.js +1 -0
- package/package.json +8 -8
- package/dist/installIntlayer-D8FS6Sbw.js +0 -1
- package/dist/plugins-BQfWXdY-.js +0 -1
- package/dist/types/editor/useEditor.d.ts +0 -1
- /package/dist/{types/client → client}/index.d.ts +0 -0
- /package/dist/{types/client → client}/installIntlayer.d.ts +0 -0
- /package/dist/{types/client → client}/useDictionary.d.ts +0 -0
- /package/dist/{types/client → client}/useDictionaryDynamic.d.ts +0 -0
- /package/dist/{types/client → client}/useIntlayer.d.ts +0 -0
- /package/dist/{types/client → client}/useLocale.d.ts +0 -0
- /package/dist/{types/client → client}/useLocaleStorage.d.ts +0 -0
- /package/dist/{types/client → client}/useRewriteURL.d.ts +0 -0
- /package/dist/{types/format → format}/index.d.ts +0 -0
- /package/dist/{types/format → format}/useCompact.d.ts +0 -0
- /package/dist/{types/format → format}/useCurrency.d.ts +0 -0
- /package/dist/{types/format → format}/useDate.d.ts +0 -0
- /package/dist/{types/format → format}/useIntl.d.ts +0 -0
- /package/dist/{types/format → format}/useList.d.ts +0 -0
- /package/dist/{types/format → format}/useNumber.d.ts +0 -0
- /package/dist/{types/format → format}/usePercentage.d.ts +0 -0
- /package/dist/{types/format → format}/useRelativeTime.d.ts +0 -0
- /package/dist/{types/format → format}/useUnit.d.ts +0 -0
- /package/dist/{types/getDictionary.d.ts → getDictionary.d.ts} +0 -0
- /package/dist/{types/getIntlayer.d.ts → getIntlayer.d.ts} +0 -0
- /package/dist/{types/html → html}/HTMLRenderer.d.ts +0 -0
- /package/dist/{types/html → html}/index.d.ts +0 -0
- /package/dist/{types/html → html}/installIntlayerHTML.d.ts +0 -0
- /package/dist/{types/html → html}/types.d.ts +0 -0
- /package/dist/{types/index.d.ts → index.d.ts} +0 -0
- /package/dist/{types/markdown → markdown}/MarkdownRenderer.d.ts +0 -0
- /package/dist/{types/markdown → markdown}/compiler.d.ts +0 -0
- /package/dist/{types/markdown → markdown}/index.d.ts +0 -0
- /package/dist/{types/markdown → markdown}/installIntlayerMarkdown.d.ts +0 -0
- /package/dist/{types/markdown → markdown}/runtime.d.ts +0 -0
- /package/dist/{types/plugins.d.ts → plugins.d.ts} +0 -0
- /package/dist/{types/renderIntlayerNode.d.ts → renderIntlayerNode.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -190,7 +190,22 @@ Explore our comprehensive documentation to get started with Intlayer and learn h
|
|
|
190
190
|
<li><a href="https://intlayer.org/doc/environment/vite-and-react" rel=''>Vite + React</a></li>
|
|
191
191
|
<li><a href="https://intlayer.org/doc/environment/vite-and-react" rel=''>Vite + React using Compiler</a></li>
|
|
192
192
|
<li><a href="https://intlayer.org/doc/environment/vite-and-react/compiler" rel=''>React-router-v7</a></li>
|
|
193
|
-
<li><a href="https://intlayer.org/doc/environment/
|
|
193
|
+
<li><a href="https://intlayer.org/doc/environment/tanstack-start" rel=''>Tanstack start</a>
|
|
194
|
+
<ul>
|
|
195
|
+
<li><a href="https://intlayer.org/doc/environment/tanstack-start/solid" rel=''>Solid</a></li>
|
|
196
|
+
</ul>
|
|
197
|
+
</li>
|
|
198
|
+
<li><a href="https://intlayer.org/doc/environment/astro" rel=''>Astro</a>
|
|
199
|
+
<ul>
|
|
200
|
+
<li><a href="https://intlayer.org/doc/environment/astro/react" rel=''>React</a></li>
|
|
201
|
+
<li><a href="https://intlayer.org/doc/environment/astro/vue" rel=''>Vue</a></li>
|
|
202
|
+
<li><a href="https://intlayer.org/doc/environment/astro/svelte" rel=''>Svelte</a></li>
|
|
203
|
+
<li><a href="https://intlayer.org/doc/environment/astro/solid" rel=''>Solid</a></li>
|
|
204
|
+
<li><a href="https://intlayer.org/doc/environment/astro/vanilla" rel=''>Vanilla JS</a></li>
|
|
205
|
+
<li><a href="https://intlayer.org/doc/environment/astro/lit" rel=''>Lit</a></li>
|
|
206
|
+
</ul>
|
|
207
|
+
</li>
|
|
208
|
+
|
|
194
209
|
<li><a href="https://intlayer.org/doc/environment/react-native-and-expo" rel=''>React Native</a></li>
|
|
195
210
|
<li><a href="https://intlayer.org/doc/environment/vite-and-svelte" rel=''>Vite + Svelte</a></li>
|
|
196
211
|
<li><a href="https://intlayer.org/doc/environment/sveltekit" rel=''>SvelteKit</a></li>
|
|
@@ -212,6 +227,17 @@ Explore our comprehensive documentation to get started with Intlayer and learn h
|
|
|
212
227
|
</ul>
|
|
213
228
|
</details>
|
|
214
229
|
|
|
230
|
+
<details>
|
|
231
|
+
<summary style="font-size:16px; font-weight:bold;">📊 Benchmark</summary>
|
|
232
|
+
<ul>
|
|
233
|
+
<li><a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/benchmark/nextjs.md" rel=''>Next.js</a></li>
|
|
234
|
+
<li><a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/benchmark/tanstack.md" rel=''>TanStack Start</a></li>
|
|
235
|
+
<li><a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/benchmark/vue.md" rel=''>Vue</a></li>
|
|
236
|
+
<li><a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/benchmark/solid.md" rel=''>Solid</a></li>
|
|
237
|
+
<li><a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/benchmark/svelte.md" rel=''>Svelte</a></li>
|
|
238
|
+
</ul>
|
|
239
|
+
</details>
|
|
240
|
+
|
|
215
241
|
<details>
|
|
216
242
|
<summary style="font-size:16px; font-weight:bold;">📰 Blog</summary>
|
|
217
243
|
<ul>
|
|
@@ -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-CxkE8IxM.js`),t=require(`./useDictionary.cjs`),n=require(`./useDictionaryDynamic.cjs`),r=require(`./useIntlayer.cjs`),i=require(`./useLocaleStorage.cjs`),a=require(`./useLocale.cjs`),o=require(`./useRewriteURL.cjs`);exports.IntlayerClient=e.t,exports.createIntlayerClient=e.n,exports.getIntlayerClient=e.r,exports.installIntlayer=e.i,exports.localeCookie=i.localeCookie,exports.localeInStorage=i.localeInStorage,exports.setLocaleCookie=i.setLocaleCookie,exports.setLocaleInStorage=i.setLocaleInStorage,exports.useDictionary=t.useDictionary,exports.useDictionaryDynamic=n.useDictionaryDynamic,exports.useIntlayer=r.useIntlayer,exports.useLocale=a.useLocale,exports.useLocaleCookie=i.useLocaleCookie,exports.useLocaleStorage=i.useLocaleStorage,exports.useRewriteURL=o.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-CxkE8IxM.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(`../getDictionary.cjs`),t=require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../getDictionary.cjs`),t=require(`../../installIntlayer-CxkE8IxM.js`);var n=(n,r)=>{let i=t.r(),a=e.getDictionary(n,r??i.locale);return a.onChange=t=>(i.subscribe(i=>{t(e.getDictionary(n,r??i))}),a),a};exports.useDictionary=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-Bp8aaTny.js`);const e=require(`../getDictionary.cjs`),t=require(`../../installIntlayer-CxkE8IxM.js`);let n=require(`@intlayer/config/built`);var r=new Map,i=new Map,a=(e,t)=>{if(r.has(e))return Promise.resolve();if(i.has(e))return i.get(e);let n=t().then(t=>{r.set(e,t),i.delete(e)});return i.set(e,n),n},o=(i,o,s)=>{let c=t.r(),l=s??c.locale??n.internationalization.defaultLocale,u=`${String(o)}.${l}`,d=i[l],f=r.get(u);if(f){let t=e.getDictionary(f,l);return t.onChange=n=>(c.subscribe(t=>{let s=`${String(o)}.${t}`,c=i[t];c&&a(s,c).then(()=>{let i=r.get(s);i&&n(e.getDictionary(i,t))})}),t),t}d&&a(u,d).then(()=>{c.notify()});let p=new Proxy(()=>{},{get:(e,t)=>{if(t===Symbol.toPrimitive||t===`toString`||t===`valueOf`)return()=>``;if(t!==`then`)return t===`onChange`?e=>p:p},apply:()=>p});return p};exports.useDictionaryDynamic=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../getIntlayer.cjs`),t=require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../getIntlayer.cjs`),t=require(`../../installIntlayer-CxkE8IxM.js`);var n=(n,r)=>{let i=t.r(),a=e.getIntlayer(n,r??i.locale);return a.onChange=t=>(i.subscribe(i=>{t(e.getIntlayer(n,r??i))}),a),a};exports.useIntlayer=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-Bp8aaTny.js`);const e=require(`../../installIntlayer-CxkE8IxM.js`),t=require(`./useLocaleStorage.cjs`);let n=require(`@intlayer/config/built`);var r=(r={})=>{let i=e.r(),{defaultLocale:a,locales:o}=n.internationalization??{};return{locale:i.locale,defaultLocale:a,availableLocales:o??[],setLocale:e=>{if(!(o??[]).map(String).includes(e)){console.error(`Locale "${e}" is not available.`);return}i.setLocale(e),t.setLocaleInStorage(e,r.isCookieEnabled??i.isCookieEnabled??!0),r.onLocaleChange?.(e)},subscribe:e=>i.subscribe(e)}};exports.useLocale=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-Bp8aaTny.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=o;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`}),require(`../../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-Bp8aaTny.js`);const e=require(`../../installIntlayer-CxkE8IxM.js`);let t=require(`@intlayer/config/built`),n=require(`@intlayer/core/localization`);var r=e=>{if(typeof window>`u`||!t.routing?.rewrite)return;let r=window.location.pathname,i=(0,n.getRewritePath)(r,e,t.routing?.rewrite);i&&i!==r&&window.history.replaceState(window.history.state,``,i+window.location.search+window.location.hash)},i=()=>{let t=e.r();return r(t.locale),t.subscribe(e=>{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-CxkE8IxM.js`);exports.useEditor=e.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-Bp8aaTny.js`);const e=require(`../../installIntlayer-CxkE8IxM.js`);let t=require(`@intlayer/core/formatters`);var n=()=>{let n=e.r();return(...e)=>(0,t.compact)(e[0],{...e[1],locale:e[1]?.locale??n.locale})};exports.useCompact=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-Bp8aaTny.js`);const e=require(`../../installIntlayer-CxkE8IxM.js`);let t=require(`@intlayer/core/formatters`);var n=()=>{let n=e.r();return(...e)=>(0,t.currency)(e[0],{...e[1],locale:e[1]?.locale??n.locale})};exports.useCurrency=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-Bp8aaTny.js`);const e=require(`../../installIntlayer-CxkE8IxM.js`);let t=require(`@intlayer/core/formatters`);var n=()=>{let n=e.r();return(...e)=>{let r=typeof e[1]==`string`?{...t.presets[e[1]],locale:n.locale}:{...e[1],locale:e[1]?.locale??n.locale};return(0,t.date)(e[0],r)}};exports.useDate=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-Bp8aaTny.js`);const e=require(`../../installIntlayer-CxkE8IxM.js`);let t=require(`@intlayer/core/utils`);var n=n=>{let r=e.r();return{intl:(0,t.bindIntl)(n??r.locale),subscribe:e=>r.subscribe(r=>{e((0,t.bindIntl)(n??r))})}};exports.useIntl=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-Bp8aaTny.js`);const e=require(`../../installIntlayer-CxkE8IxM.js`);let t=require(`@intlayer/core/formatters`);var n=()=>{let n=e.r();return(...e)=>(0,t.list)(e[0],{...e[1],locale:e[1]?.locale??n.locale})};exports.useList=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-Bp8aaTny.js`);const e=require(`../../installIntlayer-CxkE8IxM.js`);let t=require(`@intlayer/core/formatters`);var n=()=>{let n=e.r();return(...e)=>(0,t.number)(e[0],{...e[1],locale:e[1]?.locale??n.locale})};exports.useNumber=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-Bp8aaTny.js`);const e=require(`../../installIntlayer-CxkE8IxM.js`);let t=require(`@intlayer/core/formatters`);var n=()=>{let n=e.r();return(...e)=>(0,t.percentage)(e[0],{...e[1],locale:e[1]?.locale??n.locale})};exports.usePercentage=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-Bp8aaTny.js`);const e=require(`../../installIntlayer-CxkE8IxM.js`);let t=require(`@intlayer/core/formatters`);var n=()=>{let n=e.r();return(...e)=>(0,t.relativeTime)(e[0],e[1],{...e[2],locale:e[2]?.locale??n.locale})};exports.useRelativeTime=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-Bp8aaTny.js`);const e=require(`../../installIntlayer-CxkE8IxM.js`);let t=require(`@intlayer/core/formatters`);var n=()=>{let n=e.r();return(...e)=>(0,t.units)(e[0],{...e[1],locale:e[1]?.locale??n.locale})};exports.useUnit=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../plugins-Bp8aaTny.js`);let t=require(`@intlayer/core/interpreter`);var n=(n,r)=>(0,t.getDictionary)(n,r,e.t(r));exports.getDictionary=n;
|
package/dist/cjs/getIntlayer.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../plugins-Bp8aaTny.js`);let t=require(`@intlayer/core/interpreter`);var n=(n,r)=>(0,t.getIntlayer)(n,r,e.t(r));exports.getIntlayer=n;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../plugins-Bp8aaTny.js`),t=require(`./getIntlayer.cjs`),n=require(`./getDictionary.cjs`),r=require(`../installIntlayer-CxkE8IxM.js`),i=require(`./client/useDictionary.cjs`),a=require(`./client/useDictionaryDynamic.cjs`),o=require(`./client/useIntlayer.cjs`),s=require(`./client/useLocaleStorage.cjs`),c=require(`./client/useLocale.cjs`),l=require(`./client/useRewriteURL.cjs`);require(`./client/index.cjs`),exports.IntlayerClient=r.t,exports.createIntlayerClient=r.n,exports.getDictionary=n.getDictionary,exports.getIntlayer=t.getIntlayer,exports.getIntlayerClient=r.r,exports.getPlugins=e.t,exports.htmlPlugin=e.n,exports.insertionPlugin=e.r,exports.installIntlayer=r.i,exports.intlayerNodePlugins=e.i,exports.localeCookie=s.localeCookie,exports.localeInStorage=s.localeInStorage,exports.markdownPlugin=e.a,exports.markdownStringPlugin=e.o,exports.setLocaleCookie=s.setLocaleCookie,exports.setLocaleInStorage=s.setLocaleInStorage,exports.useDictionary=i.useDictionary,exports.useDictionaryDynamic=a.useDictionaryDynamic,exports.useEditor=r.a,exports.useIntlayer=o.useIntlayer,exports.useLocale=c.useLocale,exports.useLocaleCookie=s.useLocaleCookie,exports.useLocaleStorage=s.useLocaleStorage,exports.useRewriteURL=l.useRewriteURL;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../plugins-Bp8aaTny.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(`../plugins-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../plugins-Bp8aaTny.js`);exports.getPlugins=e.t,exports.htmlPlugin=e.n,exports.insertionPlugin=e.r,exports.intlayerNodePlugins=e.i,exports.markdownPlugin=e.a,exports.markdownStringPlugin=e.o;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Initialises the Intlayer visual editor client.
|
|
3
|
+
*
|
|
4
|
+
* Does nothing when `INTLAYER_EDITOR_ENABLED` is `"false"` or the editor
|
|
5
|
+
* package reports that it is disabled.
|
|
6
|
+
*
|
|
7
|
+
* Call this once at application startup.
|
|
8
|
+
*
|
|
9
|
+
* @returns A cleanup function that stops the editor.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { installIntlayer, useEditor } from 'vanilla-intlayer';
|
|
14
|
+
*
|
|
15
|
+
* installIntlayer('en');
|
|
16
|
+
* const stopEditor = useEditor();
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const useEditor: () => (() => void);
|
|
@@ -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-C99qMzFH.mjs";
|
|
2
2
|
import { useDictionary as i } from "./useDictionary.mjs";
|
|
3
3
|
import { useDictionaryDynamic as a } from "./useDictionaryDynamic.mjs";
|
|
4
4
|
import { useIntlayer as o } from "./useIntlayer.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-C99qMzFH.mjs";
|
|
2
2
|
export { r as IntlayerClient, t as createIntlayerClient, n as getIntlayerClient, e as installIntlayer };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDictionary as e } from "../getDictionary.mjs";
|
|
2
|
-
import { r as t } from "../../installIntlayer-
|
|
2
|
+
import { r as t } from "../../installIntlayer-C99qMzFH.mjs";
|
|
3
3
|
//#region src/client/useDictionary.ts
|
|
4
4
|
var n = (n, r) => {
|
|
5
5
|
let i = t(), a = e(n, r ?? i.locale);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDictionary as e } from "../getDictionary.mjs";
|
|
2
|
-
import { r as t } from "../../installIntlayer-
|
|
2
|
+
import { r as t } from "../../installIntlayer-C99qMzFH.mjs";
|
|
3
3
|
import { internationalization as n } from "@intlayer/config/built";
|
|
4
4
|
//#region src/client/useDictionaryDynamic.ts
|
|
5
5
|
var r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = (e, t) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getIntlayer as e } from "../getIntlayer.mjs";
|
|
2
|
-
import { r as t } from "../../installIntlayer-
|
|
2
|
+
import { r as t } from "../../installIntlayer-C99qMzFH.mjs";
|
|
3
3
|
//#region src/client/useIntlayer.ts
|
|
4
4
|
var n = (n, r) => {
|
|
5
5
|
let i = t(), a = e(n, r ?? i.locale);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as e } from "../../installIntlayer-
|
|
1
|
+
import { r as e } from "../../installIntlayer-C99qMzFH.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-C99qMzFH.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-C99qMzFH.mjs";
|
|
2
2
|
export { e as useEditor };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getPlugins as e, htmlPlugin as t, insertionPlugin as n, intlayerNodePlugins as r, markdownPlugin as i, markdownStringPlugin as a } from "./plugins.mjs";
|
|
2
2
|
import { getIntlayer as o } from "./getIntlayer.mjs";
|
|
3
3
|
import { getDictionary as s } from "./getDictionary.mjs";
|
|
4
|
-
import { a as c, i as l, n as u, r as d, t as f } from "../installIntlayer-
|
|
4
|
+
import { a as c, i as l, n as u, r as d, t as f } from "../installIntlayer-C99qMzFH.mjs";
|
|
5
5
|
import { useDictionary as p } from "./client/useDictionary.mjs";
|
|
6
6
|
import { useDictionaryDynamic as m } from "./client/useDictionaryDynamic.mjs";
|
|
7
7
|
import { useIntlayer as h } from "./client/useIntlayer.mjs";
|
package/dist/esm/plugins.mjs
CHANGED
|
@@ -4,12 +4,12 @@ import { editor as u, internationalization as d } from "@intlayer/config/built";
|
|
|
4
4
|
import { compileWithOptions as f, getMarkdownMetadata as p } from "@intlayer/core/markdown";
|
|
5
5
|
import * as m from "@intlayer/types/nodeType";
|
|
6
6
|
//#region src/plugins.ts
|
|
7
|
-
var h =
|
|
7
|
+
var h = (e) => e.replace(/&/g, "&").replace(/"/g, """), g = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), _ = {
|
|
8
8
|
id: "intlayer-node-plugin",
|
|
9
9
|
canHandle: (e) => typeof e == "bigint" || typeof e == "string" || typeof e == "number",
|
|
10
10
|
transform: (t, { children: n, keyPath: r, dictionaryKey: i, ...a }) => {
|
|
11
|
-
if (
|
|
12
|
-
let t = String(n ?? ""), o = JSON.stringify(r ?? []), s = String(i ?? ""), c = `<intlayer-content-selector-wrapper key-path="${
|
|
11
|
+
if (process.env.INTLAYER_EDITOR_ENABLED !== "false" && u.enabled) {
|
|
12
|
+
let t = String(n ?? ""), o = JSON.stringify(r ?? []), s = String(i ?? ""), c = `<intlayer-content-selector-wrapper key-path="${h(o)}" dictionary-key="${h(s)}">${g(t)}</intlayer-content-selector-wrapper>`;
|
|
13
13
|
return e({
|
|
14
14
|
...a,
|
|
15
15
|
value: n,
|
|
@@ -28,7 +28,7 @@ var h = process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE === "false", g = process.en
|
|
|
28
28
|
children: n
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
},
|
|
31
|
+
}, v = process.env.INTLAYER_NODE_TYPE_INSERTION === "false" ? r : {
|
|
32
32
|
id: "insertion-plugin",
|
|
33
33
|
canHandle: (e) => typeof e == "object" && e?.nodeType === m.INSERTION,
|
|
34
34
|
transform: (e, t, n) => {
|
|
@@ -61,7 +61,7 @@ var h = process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE === "false", g = process.en
|
|
|
61
61
|
return typeof n == "function" ? n(e) : n;
|
|
62
62
|
} : o;
|
|
63
63
|
}
|
|
64
|
-
},
|
|
64
|
+
}, y = {
|
|
65
65
|
createElement: (e, t, ...n) => {
|
|
66
66
|
let r = Object.entries(t || {}).filter(([e]) => e !== "children" && e !== "key" && e !== "_innerHTML").map(([e, t]) => `${e}="${t}"`).join(" "), i = t?._innerHTML, a = i === void 0 ? n.flat(Infinity).join("") : i;
|
|
67
67
|
return `<${e}${r ? ` ${r}` : ""}>${a}</${e}>`;
|
|
@@ -71,7 +71,7 @@ var h = process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE === "false", g = process.en
|
|
|
71
71
|
for (let [e, r] of Object.entries(t)) e === "className" ? n.class = r : e === "htmlFor" ? n.for = r : e === "dangerouslySetInnerHTML" && r?.__html ? n._innerHTML = r.__html : n[e] = r;
|
|
72
72
|
return n;
|
|
73
73
|
}
|
|
74
|
-
},
|
|
74
|
+
}, b = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? r : {
|
|
75
75
|
id: "markdown-string-plugin",
|
|
76
76
|
canHandle: (e) => typeof e == "string",
|
|
77
77
|
transform: (t, n, r) => {
|
|
@@ -88,18 +88,18 @@ var h = process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE === "false", g = process.en
|
|
|
88
88
|
dictionaryKey: a.dictionaryKey,
|
|
89
89
|
keyPath: []
|
|
90
90
|
}), s = (e = {}) => f(t, {
|
|
91
|
-
...
|
|
91
|
+
...y,
|
|
92
92
|
createElement: (t, n, ...r) => {
|
|
93
93
|
let i = e[t];
|
|
94
94
|
return typeof i == "function" ? i({
|
|
95
95
|
...n,
|
|
96
96
|
children: r.join("")
|
|
97
|
-
}) :
|
|
97
|
+
}) : y.createElement(t, n, ...r);
|
|
98
98
|
}
|
|
99
99
|
}, {}), c = s(), l = t;
|
|
100
|
-
if (
|
|
100
|
+
if (process.env.INTLAYER_EDITOR_ENABLED !== "false" && u.enabled) {
|
|
101
101
|
let e = JSON.stringify(n.keyPath ?? []), t = String(n.dictionaryKey ?? "");
|
|
102
|
-
l = `<intlayer-content-selector-wrapper key-path="${
|
|
102
|
+
l = `<intlayer-content-selector-wrapper key-path="${h(e)}" dictionary-key="${h(t)}">${g(c)}</intlayer-content-selector-wrapper>`;
|
|
103
103
|
}
|
|
104
104
|
return e({
|
|
105
105
|
...n,
|
|
@@ -111,7 +111,7 @@ var h = process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE === "false", g = process.en
|
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
},
|
|
114
|
+
}, x = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? r : {
|
|
115
115
|
id: "markdown-plugin",
|
|
116
116
|
canHandle: (e) => typeof e == "object" && e?.nodeType === m.MARKDOWN,
|
|
117
117
|
transform: (e, t, n) => {
|
|
@@ -120,10 +120,10 @@ var h = process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE === "false", g = process.en
|
|
|
120
120
|
...t,
|
|
121
121
|
children: i,
|
|
122
122
|
keyPath: r,
|
|
123
|
-
plugins: [
|
|
123
|
+
plugins: [b, ...t.plugins ?? []]
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
|
-
},
|
|
126
|
+
}, S = process.env.INTLAYER_NODE_TYPE_HTML === "false" ? r : {
|
|
127
127
|
id: "html-plugin",
|
|
128
128
|
canHandle: (e) => typeof e == "object" && e?.nodeType === m.HTML,
|
|
129
129
|
transform: (t, n) => {
|
|
@@ -146,9 +146,9 @@ var h = process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE === "false", g = process.en
|
|
|
146
146
|
} }));
|
|
147
147
|
return Array.isArray(t) ? t.join("") : t;
|
|
148
148
|
}, a = i(), s = r;
|
|
149
|
-
if (
|
|
149
|
+
if (process.env.INTLAYER_EDITOR_ENABLED !== "false" && u.enabled) {
|
|
150
150
|
let e = JSON.stringify(n.keyPath ?? []), t = String(n.dictionaryKey ?? "");
|
|
151
|
-
s = `<intlayer-content-selector-wrapper key-path="${
|
|
151
|
+
s = `<intlayer-content-selector-wrapper key-path="${h(e)}" dictionary-key="${h(t)}">${g(a)}</intlayer-content-selector-wrapper>`;
|
|
152
152
|
}
|
|
153
153
|
return e({
|
|
154
154
|
...n,
|
|
@@ -157,9 +157,9 @@ var h = process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE === "false", g = process.en
|
|
|
157
157
|
additionalProps: { use: (e) => i(e) }
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
|
-
},
|
|
160
|
+
}, C = /* @__PURE__ */ new Map(), w = (e, r = !0) => {
|
|
161
161
|
let o = `${e ?? d.defaultLocale}_${r}`;
|
|
162
|
-
if (
|
|
162
|
+
if (C.has(o)) return C.get(o);
|
|
163
163
|
let c = [
|
|
164
164
|
l(e ?? d.defaultLocale, r ? d.defaultLocale : void 0),
|
|
165
165
|
n,
|
|
@@ -167,12 +167,12 @@ var h = process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE === "false", g = process.en
|
|
|
167
167
|
s(e ?? d.defaultLocale),
|
|
168
168
|
i,
|
|
169
169
|
a,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
170
|
+
_,
|
|
171
|
+
v,
|
|
172
|
+
x,
|
|
173
|
+
S
|
|
174
174
|
];
|
|
175
|
-
return
|
|
175
|
+
return C.set(o, c), c;
|
|
176
176
|
};
|
|
177
177
|
//#endregion
|
|
178
|
-
export {
|
|
178
|
+
export { w as getPlugins, S as htmlPlugin, v as insertionPlugin, _ as intlayerNodePlugins, x as markdownPlugin, b as markdownStringPlugin };
|
|
@@ -2,12 +2,12 @@ import { internationalization as e } from "@intlayer/config/built";
|
|
|
2
2
|
import { setIntlayerIdentifier as t } from "@intlayer/config/client";
|
|
3
3
|
import { isEnabled as n } from "@intlayer/editor/isEnabled";
|
|
4
4
|
//#region src/editor/useEditor.ts
|
|
5
|
-
var r =
|
|
6
|
-
if (
|
|
5
|
+
var r = () => {
|
|
6
|
+
if (process.env.INTLAYER_EDITOR_ENABLED === "false" || !n) return () => {};
|
|
7
7
|
let e = null, t = !1;
|
|
8
8
|
return import("@intlayer/editor").then(({ initEditorClient: n }) => {
|
|
9
9
|
if (t) return;
|
|
10
|
-
let r = n(), i =
|
|
10
|
+
let r = n(), i = s();
|
|
11
11
|
r.currentLocale.set(i.locale), e = i.subscribe((e) => {
|
|
12
12
|
r.currentLocale.set(e);
|
|
13
13
|
});
|
|
@@ -16,7 +16,7 @@ var r = process.env.INTLAYER_EDITOR_ENABLED === "false", i = () => {
|
|
|
16
16
|
e();
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
|
-
},
|
|
19
|
+
}, i = class {
|
|
20
20
|
_locale;
|
|
21
21
|
_listeners = /* @__PURE__ */ new Set();
|
|
22
22
|
isCookieEnabled;
|
|
@@ -39,9 +39,9 @@ var r = process.env.INTLAYER_EDITOR_ENABLED === "false", i = () => {
|
|
|
39
39
|
notify() {
|
|
40
40
|
for (let e of this._listeners) e(this._locale);
|
|
41
41
|
}
|
|
42
|
-
},
|
|
43
|
-
let n =
|
|
44
|
-
return
|
|
42
|
+
}, a = null, o = (e, t = !0) => a || (a = new i(e, t), a), s = () => (a ||= new i(), a), c = ({ locale: e, isCookieEnabled: t } = {}) => {
|
|
43
|
+
let n = o(e, t);
|
|
44
|
+
return r(), n;
|
|
45
45
|
};
|
|
46
46
|
//#endregion
|
|
47
|
-
export {
|
|
47
|
+
export { r as a, c as i, o as n, s as r, i as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./plugins-Bp8aaTny.js`);let e=require(`@intlayer/config/built`),t=require(`@intlayer/config/client`),n=require(`@intlayer/editor/isEnabled`);var r=()=>{if(process.env.INTLAYER_EDITOR_ENABLED===`false`||!n.isEnabled)return()=>{};let e=null,t=!1;return import(`@intlayer/editor`).then(({initEditorClient:n})=>{if(t)return;let r=n(),i=s();r.currentLocale.set(i.locale),e=i.subscribe(e=>{r.currentLocale.set(e)})}),()=>{t=!0,e?.(),import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})}},i=class{_locale;_listeners=new Set;isCookieEnabled;constructor(n,r=!0){let{defaultLocale:i}=e.internationalization??{};(0,t.setIntlayerIdentifier)(),this._locale=n??i,this.isCookieEnabled=r}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)}}notify(){for(let e of this._listeners)e(this._locale)}},a=null,o=(e,t=!0)=>a||(a=new i(e,t),a),s=()=>(a||=new i,a),c=({locale:e,isCookieEnabled:t}={})=>{let n=o(e,t);return r(),n};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
|
|
@@ -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));const c=require(`./cjs/renderIntlayerNode.cjs`);let l=require(`@intlayer/core/interpreter`),u=require(`@intlayer/config/built`),d=require(`@intlayer/core/markdown`),f=require(`@intlayer/types/nodeType`);f=s(f);var p=e=>e.replace(/&/g,`&`).replace(/"/g,`"`),m=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),h={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`&&u.editor.enabled){let e=String(t??``),a=JSON.stringify(n??[]),o=String(r??``),s=`<intlayer-content-selector-wrapper key-path="${p(a)}" dictionary-key="${p(o)}">${m(e)}</intlayer-content-selector-wrapper>`;return c.renderIntlayerNode({...i,value:t,children:s,keyPath:n,dictionaryKey:r,additionalProps:{toElement:()=>{let t=document.createElement(`intlayer-content-selector-wrapper`);return t.setAttribute(`key-path`,a),t.setAttribute(`dictionary-key`,o),t.textContent=e,t}}})}return c.renderIntlayerNode({...i,value:t,children:t})}},g=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`,transform:(e,n,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 typeof i==`object`&&i&&`nodeType`in i&&[f.ENUMERATION,f.CONDITION].includes(i.nodeType)?e=>t=>{let n=o(t);return typeof n==`function`?n(e):n}:o}},_={createElement:(e,t,...n)=>{let r=Object.entries(t||{}).filter(([e])=>e!==`children`&&e!==`key`&&e!==`_innerHTML`).map(([e,t])=>`${e}="${t}"`).join(` `),i=t?._innerHTML,a=i===void 0?n.flat(1/0).join(``):i;return`<${e}${r?` ${r}`:``}>${a}</${e}>`},normalizeProps:(e,t)=>{let n={};for(let[e,r]of Object.entries(t))e===`className`?n.class=r:e===`htmlFor`?n.for=r:e===`dangerouslySetInnerHTML`&&r?.__html?n._innerHTML=r.__html:n[e]=r;return n}},v=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,a=n((0,d.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:[]}),o=(t={})=>(0,d.compileWithOptions)(e,{..._,createElement:(e,n,...r)=>{let i=t[e];return typeof i==`function`?i({...n,children:r.join(``)}):_.createElement(e,n,...r)}},{}),s=o(),l=e;if(process.env.INTLAYER_EDITOR_ENABLED!==`false`&&u.editor.enabled){let e=JSON.stringify(t.keyPath??[]),n=String(t.dictionaryKey??``);l=`<intlayer-content-selector-wrapper key-path="${p(e)}" dictionary-key="${p(n)}">${m(s)}</intlayer-content-selector-wrapper>`}return c.renderIntlayerNode({...t,value:s,children:l,additionalProps:{metadata:a,use:e=>o(e)}})}},y=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:[v,...t.plugins??[]]})}},b=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],r=(e={})=>{let t=(0,l.getHTML)(n,new Proxy(e,{get(e,t){if(typeof t==`string`&&t in e){let n=e[t];return e=>{let t=Array.isArray(e.children)?e.children.join(``):e.children;return n({...e,children:t})}}if(typeof t==`string`&&/^[a-z][a-z0-9]*$/.test(t))return e=>{let n=Object.entries(e).filter(([e])=>e!==`children`&&e!==`key`).map(([e,t])=>`${e}="${t}"`).join(` `),r=Array.isArray(e.children)?e.children.join(``):e.children;return`<${t}${n?` ${n}`:``}>${r}</${t}>`}}}));return Array.isArray(t)?t.join(``):t},i=r(),a=n;if(process.env.INTLAYER_EDITOR_ENABLED!==`false`&&u.editor.enabled){let e=JSON.stringify(t.keyPath??[]),n=String(t.dictionaryKey??``);a=`<intlayer-content-selector-wrapper key-path="${p(e)}" dictionary-key="${p(n)}">${m(i)}</intlayer-content-selector-wrapper>`}return c.renderIntlayerNode({...t,value:i,children:a,additionalProps:{use:e=>r(e)}})}},x=new Map,S=(e,t=!0)=>{let n=`${e??u.internationalization.defaultLocale}_${t}`;if(x.has(n))return x.get(n);let r=[(0,l.translationPlugin)(e??u.internationalization.defaultLocale,t?u.internationalization.defaultLocale:void 0),l.enumerationPlugin,l.conditionPlugin,(0,l.nestedPlugin)(e??u.internationalization.defaultLocale),l.filePlugin,l.genderPlugin,h,g,y,b];return x.set(n,r),r};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return S}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vanilla-intlayer",
|
|
3
|
-
"version": "8.7.
|
|
3
|
+
"version": "8.7.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Vanilla JS, HTML, and PHP applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -101,11 +101,11 @@
|
|
|
101
101
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@intlayer/api": "8.7.
|
|
105
|
-
"@intlayer/config": "8.7.
|
|
106
|
-
"@intlayer/core": "8.7.
|
|
107
|
-
"@intlayer/editor": "8.7.
|
|
108
|
-
"@intlayer/types": "8.7.
|
|
104
|
+
"@intlayer/api": "8.7.13",
|
|
105
|
+
"@intlayer/config": "8.7.13",
|
|
106
|
+
"@intlayer/core": "8.7.13",
|
|
107
|
+
"@intlayer/editor": "8.7.13",
|
|
108
|
+
"@intlayer/types": "8.7.13"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
111
|
"@types/node": "25.6.0",
|
|
@@ -117,11 +117,11 @@
|
|
|
117
117
|
"tsdown": "0.21.10",
|
|
118
118
|
"typescript": "6.0.3",
|
|
119
119
|
"vite": "8.0.10",
|
|
120
|
-
"vite-plugin-dts": "
|
|
120
|
+
"vite-plugin-dts": "5.0.0",
|
|
121
121
|
"vitest": "4.1.5"
|
|
122
122
|
},
|
|
123
123
|
"peerDependencies": {
|
|
124
|
-
"intlayer": "8.7.
|
|
124
|
+
"intlayer": "8.7.13"
|
|
125
125
|
},
|
|
126
126
|
"peerDependenciesMeta": {
|
|
127
127
|
"intlayer": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./plugins-BQfWXdY-.js`);let e=require(`@intlayer/config/built`),t=require(`@intlayer/config/client`),n=require(`@intlayer/editor/isEnabled`);var r=process.env.INTLAYER_EDITOR_ENABLED===`false`,i=()=>{if(r||!n.isEnabled)return()=>{};let e=null,t=!1;return import(`@intlayer/editor`).then(({initEditorClient:n})=>{if(t)return;let r=n(),i=c();r.currentLocale.set(i.locale),e=i.subscribe(e=>{r.currentLocale.set(e)})}),()=>{t=!0,e?.(),import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})}},a=class{_locale;_listeners=new Set;isCookieEnabled;constructor(n,r=!0){let{defaultLocale:i}=e.internationalization??{};(0,t.setIntlayerIdentifier)(),this._locale=n??i,this.isCookieEnabled=r}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)}}notify(){for(let e of this._listeners)e(this._locale)}},o=null,s=(e,t=!0)=>o||(o=new a(e,t),o),c=()=>(o||=new a,o),l=({locale:e,isCookieEnabled:t}={})=>{let n=s(e,t);return i(),n};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}});
|
package/dist/plugins-BQfWXdY-.js
DELETED
|
@@ -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));const c=require(`./cjs/renderIntlayerNode.cjs`);let l=require(`@intlayer/core/interpreter`),u=require(`@intlayer/config/built`),d=require(`@intlayer/core/markdown`),f=require(`@intlayer/types/nodeType`);f=s(f);var p=process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE===`false`,m=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`,h=process.env.INTLAYER_NODE_TYPE_HTML===`false`,g=process.env.INTLAYER_NODE_TYPE_INSERTION===`false`,_=process.env.INTLAYER_EDITOR_ENABLED===`false`,v=e=>e.replace(/&/g,`&`).replace(/"/g,`"`),y=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),b=p?l.fallbackPlugin:{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(!_&&u.editor.enabled){let e=String(t??``),a=JSON.stringify(n??[]),o=String(r??``),s=`<intlayer-content-selector-wrapper key-path="${v(a)}" dictionary-key="${v(o)}">${y(e)}</intlayer-content-selector-wrapper>`;return c.renderIntlayerNode({...i,value:t,children:s,keyPath:n,dictionaryKey:r,additionalProps:{toElement:()=>{let t=document.createElement(`intlayer-content-selector-wrapper`);return t.setAttribute(`key-path`,a),t.setAttribute(`dictionary-key`,o),t.textContent=e,t}}})}return c.renderIntlayerNode({...i,value:t,children:t})}},x=g?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`,transform:(e,n,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 typeof i==`object`&&i&&`nodeType`in i&&[f.ENUMERATION,f.CONDITION].includes(i.nodeType)?e=>t=>{let n=o(t);return typeof n==`function`?n(e):n}:o}},S={createElement:(e,t,...n)=>{let r=Object.entries(t||{}).filter(([e])=>e!==`children`&&e!==`key`&&e!==`_innerHTML`).map(([e,t])=>`${e}="${t}"`).join(` `),i=t?._innerHTML,a=i===void 0?n.flat(1/0).join(``):i;return`<${e}${r?` ${r}`:``}>${a}</${e}>`},normalizeProps:(e,t)=>{let n={};for(let[e,r]of Object.entries(t))e===`className`?n.class=r:e===`htmlFor`?n.for=r:e===`dangerouslySetInnerHTML`&&r?.__html?n._innerHTML=r.__html:n[e]=r;return n}},C=m?l.fallbackPlugin:{id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,t,n)=>{let{plugins:r,...i}=t,a=n((0,d.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:[]}),o=(t={})=>(0,d.compileWithOptions)(e,{...S,createElement:(e,n,...r)=>{let i=t[e];return typeof i==`function`?i({...n,children:r.join(``)}):S.createElement(e,n,...r)}},{}),s=o(),l=e;if(!_&&u.editor.enabled){let e=JSON.stringify(t.keyPath??[]),n=String(t.dictionaryKey??``);l=`<intlayer-content-selector-wrapper key-path="${v(e)}" dictionary-key="${v(n)}">${y(s)}</intlayer-content-selector-wrapper>`}return c.renderIntlayerNode({...t,value:s,children:l,additionalProps:{metadata:a,use:e=>o(e)}})}},w=m?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:[C,...t.plugins??[]]})}},T=h?l.fallbackPlugin:{id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===f.HTML,transform:(e,t)=>{let n=e[f.HTML],r=(e={})=>{let t=(0,l.getHTML)(n,new Proxy(e,{get(e,t){if(typeof t==`string`&&t in e){let n=e[t];return e=>{let t=Array.isArray(e.children)?e.children.join(``):e.children;return n({...e,children:t})}}if(typeof t==`string`&&/^[a-z][a-z0-9]*$/.test(t))return e=>{let n=Object.entries(e).filter(([e])=>e!==`children`&&e!==`key`).map(([e,t])=>`${e}="${t}"`).join(` `),r=Array.isArray(e.children)?e.children.join(``):e.children;return`<${t}${n?` ${n}`:``}>${r}</${t}>`}}}));return Array.isArray(t)?t.join(``):t},i=r(),a=n;if(!_&&u.editor.enabled){let e=JSON.stringify(t.keyPath??[]),n=String(t.dictionaryKey??``);a=`<intlayer-content-selector-wrapper key-path="${v(e)}" dictionary-key="${v(n)}">${y(i)}</intlayer-content-selector-wrapper>`}return c.renderIntlayerNode({...t,value:i,children:a,additionalProps:{use:e=>r(e)}})}},E=new Map,D=(e,t=!0)=>{let n=`${e??u.internationalization.defaultLocale}_${t}`;if(E.has(n))return E.get(n);let r=[(0,l.translationPlugin)(e??u.internationalization.defaultLocale,t?u.internationalization.defaultLocale:void 0),l.enumerationPlugin,l.conditionPlugin,(0,l.nestedPlugin)(e??u.internationalization.defaultLocale),l.filePlugin,l.genderPlugin,b,x,w,T];return E.set(n,r),r};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return D}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useEditor: () => (() => void);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|