vue-intlayer 8.5.1 → 8.6.0
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/ContentSelector-BbioElre.js +1 -0
- package/dist/ContentSelector-U91_pPOg.mjs +25 -0
- 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/useDictionaryAsync.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/editor/ContentSelector.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/html/HTMLRenderer.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/plugins.cjs +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/useDictionaryAsync.mjs +1 -1
- package/dist/esm/client/useIntlayer.mjs +1 -1
- package/dist/esm/client/useLocale.mjs +1 -1
- package/dist/esm/client/useLocaleStorage.mjs +1 -1
- package/dist/esm/editor/ContentSelector.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/html/HTMLRenderer.mjs +12 -6
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/plugins.mjs +65 -68
- package/dist/{installIntlayer-2WeJUqHz.js → installIntlayer-DKwCX9In.js} +1 -1
- package/dist/{installIntlayer-CWrg7I9r.mjs → installIntlayer-DMhYsAX1.mjs} +12 -12
- package/dist/types/format/useNumber.d.ts +1 -1
- package/dist/types/format/usePercentage.d.ts +1 -1
- package/dist/types/markdown/MarkdownRenderer.d.ts +6 -6
- package/dist/types/plugins.d.ts +3 -0
- package/package.json +10 -10
- package/dist/ContentSelector-CUggT4wa.mjs +0 -25
- package/dist/ContentSelector-CghEoylg.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-C91j1N6u.js`);let e=require(`vue`),t=require(`@intlayer/editor/isEnabled`);var n=(0,e.defineComponent)({name:`ContentSelector`,props:{dictionaryKey:{type:String,required:!0},keyPath:{type:Array,required:!0}},setup(n,{slots:r}){return()=>t.isEnabled?(0,e.h)(`intlayer-content-selector-wrapper`,{"key-path":JSON.stringify(n.keyPath),"dictionary-key":n.dictionaryKey},r.default?.()):r.default?.()}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineComponent as e, h as t } from "vue";
|
|
2
|
+
import { isEnabled as n } from "@intlayer/editor/isEnabled";
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region src/editor/ContentSelector.vue
|
|
5
|
+
var r = e({
|
|
6
|
+
name: "ContentSelector",
|
|
7
|
+
props: {
|
|
8
|
+
dictionaryKey: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: !0
|
|
11
|
+
},
|
|
12
|
+
keyPath: {
|
|
13
|
+
type: Array,
|
|
14
|
+
required: !0
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
setup(e, { slots: r }) {
|
|
18
|
+
return () => n ? t("intlayer-content-selector-wrapper", {
|
|
19
|
+
"key-path": JSON.stringify(e.keyPath),
|
|
20
|
+
"dictionary-key": e.dictionaryKey
|
|
21
|
+
}, r.default?.()) : r.default?.();
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { r as 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-DKwCX9In.js`),t=require(`./useDictionary.cjs`),n=require(`./useDictionaryAsync.cjs`),r=require(`./useDictionaryDynamic.cjs`),i=require(`./useIntlayer.cjs`),a=require(`./useLoadDynamic.cjs`),o=require(`./useLocale.cjs`),s=require(`./useRewriteURL.cjs`);exports.INTLAYER_SYMBOL=e.t,exports.atPath=t.atPath,exports.createIntlayerClient=e.n,exports.createIntlayerLeafProxy=t.createIntlayerLeafProxy,exports.installIntlayer=e.r,exports.intlayer=e.i,exports.isComponentLike=t.isComponentLike,exports.isIntlayerNode=t.isIntlayerNode,exports.isObjectLike=t.isObjectLike,exports.toComponent=t.toComponent,exports.useDictionary=t.useDictionary,exports.useDictionaryAsync=n.useDictionaryAsync,exports.useDictionaryDynamic=r.useDictionaryDynamic,exports.useIntlayer=i.useIntlayer,exports.useLoadDynamic=a.useLoadDynamic,exports.useLocale=o.useLocale,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-DKwCX9In.js`);exports.INTLAYER_SYMBOL=e.t,exports.createIntlayerClient=e.n,exports.installIntlayer=e.r,exports.intlayer=e.i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../chunk-C91j1N6u.js`),t=require(`../getDictionary.cjs`),n=require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../chunk-C91j1N6u.js`),t=require(`../getDictionary.cjs`),n=require(`../../installIntlayer-DKwCX9In.js`);let r=require(`@intlayer/config/built`);r=e.t(r);let i=require(`vue`);var a=(e,t)=>t.reduce((e,t)=>e?.[t],e),o=e=>typeof e==`object`&&!!e,s=e=>typeof e==`function`||o(e)&&(`render`in e||`setup`in e),c=e=>e!=null&&(typeof e==`object`||typeof e==`function`)&&`__update`in e&&`render`in e&&`raw`in e,l=e=>(0,i.markRaw)((0,i.defineComponent)({name:`IntlayerLeaf`,setup(){return()=>{let t=e();return t==null?null:s(t)?(0,i.h)(t):Array.isArray(t)?(0,i.h)(`span`,t):t}}})),u=e=>new Proxy({},{get(t,n){let r=e.value;if(n===`__v_isRef`)return!0;if(n===`value`)return r??``;if(n===`$raw`)return e;if(n===`__v_skip`)return!0;if(n===`c`||n===`asComponent`)return l(()=>e.value);if(r==null)return n===Symbol.toPrimitive||n===`toString`?()=>``:void 0;let i=r[n];return typeof i==`function`?i.bind(r):i},ownKeys(){let t=e.value;return typeof t==`object`&&t?Reflect.ownKeys(t):[]},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}}),d=(e,d)=>{let f=(0,i.getCurrentInstance)()?(0,i.inject)(n.t):void 0,p=(0,i.isRef)(f?.locale)?f.locale:(0,i.ref)(f?.locale??r.default.internationalization.defaultLocale),m=(0,i.computed)(()=>(d===void 0?void 0:(0,i.toValue)(d))??p.value),h=(0,i.shallowRef)({});(0,i.watch)([()=>(0,i.toValue)(e),()=>m.value],([e,n])=>{h.value=t.getDictionary(e,n)},{immediate:!0,flush:`sync`});let g=e=>new Proxy({},{get(t,n,r){if(n===`__v_isRef`)return!0;let d=(0,i.computed)(()=>a(h.value,e));if(n===`value`)return d.value??``;if(n===`then`)return;if(n===`c`||n===`asComponent`)return l(()=>d.value);if(n===`$raw`)return d;if(n===Symbol.toPrimitive)return()=>d.value;let f=e.concat(n),p=a(h.value,f);if(p===void 0||o(p)&&!s(p))return g(f);if(c(p))return u((0,i.computed)(()=>a(h.value,f)));let m=(0,i.computed)(()=>a(h.value,f));return new Proxy(m,{get(e,t,n){return t===`value`?e.value??``:Reflect.get(e,t,n)}})},ownKeys(){let t=a(h.value,e);return o(t)?Reflect.ownKeys(t):[]},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return g([])};exports.atPath=a,exports.createIntlayerLeafProxy=u,exports.isComponentLike=s,exports.isIntlayerNode=c,exports.isObjectLike=o,exports.toComponent=l,exports.useDictionary=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../chunk-C91j1N6u.js`),t=require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../chunk-C91j1N6u.js`),t=require(`../../installIntlayer-DKwCX9In.js`),n=require(`./useDictionary.cjs`);let r=require(`@intlayer/config/built`);r=e.t(r);let i=require(`vue`);var a=async(e,a)=>{let o=(0,i.inject)(t.t),s=(0,i.computed)(()=>a??o?.locale?.value??r.default?.internationalization.defaultLocale),c=(0,i.ref)(await e[s.value]?.());return(0,i.watch)(()=>s.value,async t=>{let n=await e[t]?.();n&&(c.value=n)}),n.useDictionary(c,s)};exports.useDictionaryAsync=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../chunk-C91j1N6u.js`),t=require(`../getIntlayer.cjs`),n=require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../chunk-C91j1N6u.js`),t=require(`../getIntlayer.cjs`),n=require(`../../installIntlayer-DKwCX9In.js`),r=require(`./useDictionary.cjs`);let i=require(`@intlayer/config/built`);i=e.t(i);let a=require(`vue`);var o=(e,o)=>{let s=(0,a.inject)(n.t),c=(0,a.isRef)(s?.locale)?s.locale:(0,a.ref)(s?.locale??i.default.internationalization.defaultLocale),l=(0,a.computed)(()=>(o===void 0?void 0:(0,a.toValue)(o))??c.value),u=(0,a.shallowRef)({});(0,a.watch)([()=>(0,a.toValue)(e),()=>l.value],([e,n])=>{u.value=t.getIntlayer(e,n)},{immediate:!0,flush:`sync`});let d=new Map,f=e=>{let t=e.join(`.`);if(d.has(t))return d.get(t);let n=(0,a.computed)(()=>r.atPath(u.value,e)),i=new Proxy({},{get(t,i,o){if(typeof i==`symbol`||typeof i==`string`&&(i.startsWith(`__`)||i.startsWith(`$`)))return i===`__v_isRef`?!0:i===`then`?void 0:Reflect.get(t,i,o);if(i===`value`)return n.value??``;if(i===`c`||i===`asComponent`)return r.toComponent(()=>n.value);if(i===`$raw`)return n;if(i===Symbol.toPrimitive)return()=>String(n.value??``);let s=e.concat(i),c=r.atPath(u.value,s);if(c===void 0||r.isObjectLike(c)&&!r.isComponentLike(c))return f(s);if(r.isIntlayerNode(c))return r.createIntlayerLeafProxy((0,a.computed)(()=>r.atPath(u.value,s)));let l=(0,a.computed)(()=>r.atPath(u.value,s));return new Proxy(l,{get(e,t,n){return t===`value`?e.value??``:t===`__v_isRef`?!0:Reflect.get(e,t,n)}})},ownKeys(){let t=r.atPath(u.value,e);return r.isObjectLike(t)?Reflect.ownKeys(t):[]},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return d.set(t,i),i};return f([])};exports.useIntlayer=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../chunk-C91j1N6u.js`),t=require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../chunk-C91j1N6u.js`),t=require(`../../installIntlayer-DKwCX9In.js`),n=require(`./useLocaleStorage.cjs`);let r=require(`@intlayer/config/built`);r=e.t(r);let i=require(`vue`);var a=({isCookieEnabled:e,onLocaleChange:a}={})=>{let{defaultLocale:o,locales:s}=r.default?.internationalization??{},c=(0,i.inject)(t.t);return{locale:(0,i.computed)(()=>c?.locale?.value??o),defaultLocale:o,availableLocales:s,setLocale:t=>{if(!s?.map(String).includes(t)){console.error(`Locale ${t} is not available`);return}c&&c.setLocale(t),n.setLocaleInStorage(t,e??c?.isCookieEnabled??!0),a?.(t)}}};exports.useLocale=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);let e=require(`vue`),t=require(`@intlayer/core/localization`),n=require(`@intlayer/core/utils`);var r=(0,n.
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);let e=require(`vue`),t=require(`@intlayer/core/localization`),n=require(`@intlayer/core/utils`);var r=(0,n.getLocaleFromStorageClient)(t.localeStorageOptions),i=r,a=(e,r)=>(0,n.setLocaleInStorageClient)(e,{...t.localeStorageOptions,isCookieEnabled:r}),o=a,s=r=>{let i=(0,n.LocaleStorageClient)({...t.localeStorageOptions,isCookieEnabled:r});return{localeStorage:(0,e.computed)(()=>i.getLocale()),setLocaleStorage:i.setLocale}},c=e=>{let t=s(e);return{localeCookie:t.localeStorage,setLocaleCookie:t.setLocaleStorage}};exports.localeCookie=i,exports.localeInStorage=r,exports.setLocaleCookie=o,exports.setLocaleInStorage=a,exports.useLocaleCookie=c,exports.useLocaleStorage=s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../../ContentSelector-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../../ContentSelector-BbioElre.js`);exports.default=e.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-DKwCX9In.js`);exports.useEditor=e.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-DKwCX9In.js`);let t=require(`vue`),n=require(`@intlayer/core/formatters`);var r=()=>{let r=(0,t.inject)(e.t);return(0,t.computed)(()=>{let e=r.locale.value;return(...t)=>(0,n.compact)(t[0],{...t[1],locale:t[1]?.locale??e})})};exports.useCompact=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-DKwCX9In.js`);let t=require(`vue`),n=require(`@intlayer/core/formatters`);var r=()=>{let r=(0,t.inject)(e.t);return(0,t.computed)(()=>{let e=r.locale.value;return(...t)=>(0,n.currency)(t[0],{...t[1],locale:t[1]?.locale??e})})};exports.useCurrency=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-DKwCX9In.js`);let t=require(`vue`),n=require(`@intlayer/core/formatters`);var r=()=>{let r=(0,t.inject)(e.t);return(0,t.computed)(()=>{let e=r.locale.value;return(...t)=>{let r=typeof t[1]==`string`?{...n.presets[t[1]],locale:e}:{...t[1],locale:t[1]?.locale??e};return(0,n.date)(t[0],r)}})};exports.useDate=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-DKwCX9In.js`);let t=require(`vue`),n=require(`@intlayer/core/utils`);var r=r=>{let i=(0,t.inject)(e.t);return(0,t.computed)(()=>(0,n.bindIntl)(r??i.locale.value))};exports.useIntl=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-DKwCX9In.js`);let t=require(`vue`),n=require(`@intlayer/core/formatters`);var r=()=>{let r=(0,t.inject)(e.t);return(0,t.computed)(()=>{let e=r.locale.value;return(...t)=>(0,n.list)(t[0],{...t[1],locale:t[1]?.locale??e})})};exports.useList=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-DKwCX9In.js`);let t=require(`vue`),n=require(`@intlayer/core/formatters`);var r=()=>{let r=(0,t.inject)(e.t);return(0,t.computed)(()=>{let e=r.locale.value;return(...t)=>(0,n.number)(t[0],{...t[1],locale:t[1]?.locale??e})})};exports.useNumber=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-DKwCX9In.js`);let t=require(`vue`),n=require(`@intlayer/core/formatters`);var r=()=>{let r=(0,t.inject)(e.t);return(0,t.computed)(()=>{let e=r.locale.value;return(...t)=>(0,n.percentage)(t[0],{...t[1],locale:t[1]?.locale??e})})};exports.usePercentage=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-DKwCX9In.js`);let t=require(`vue`),n=require(`@intlayer/core/formatters`);var r=()=>{let r=(0,t.inject)(e.t);return(0,t.computed)(()=>{let e=r.locale.value;return(...t)=>(0,n.relativeTime)(t[0],t[1],{...t[2],locale:t[2]?.locale??e})})};exports.useRelativeTime=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../installIntlayer-DKwCX9In.js`);let t=require(`vue`),n=require(`@intlayer/core/formatters`);var r=()=>{let r=(0,t.inject)(e.t);return(0,t.computed)(()=>{let e=r.locale.value;return(...t)=>(0,n.units)(t[0],{...t[1],locale:t[1]?.locale??e})})};exports.useUnit=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`./installIntlayerHTML.cjs`);let t=require(`@intlayer/core/interpreter`),n=require(`vue`);var r=(e,{components:
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`./installIntlayerHTML.cjs`);let t=require(`@intlayer/core/interpreter`),n=require(`vue`);var r=(e,{components:r={}}={})=>{let i=Object.fromEntries(Object.entries(r).filter(([,e])=>e).map(([e,t])=>[e,e=>(0,n.h)(t,e,e?.children)]));return(0,t.getHTML)(e,new Proxy(i,{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=>(0,n.h)(t,e,e?.children)}}))},i=({components:t}={})=>{let n=e.useHTML();return e=>n?n.renderHTML(e,{components:t}):r(e,{components:t})},a=(0,n.defineComponent)({name:`HTMLRenderer`,props:{content:{type:String,required:!0},components:{type:Object,default:void 0}},setup(e){let t=i({components:e.components});return()=>t(e.content)}});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(`./plugins.cjs`),t=require(`./getDictionary.cjs`),n=require(`./getIntlayer.cjs`),r=require(`../installIntlayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./plugins.cjs`),t=require(`./getDictionary.cjs`),n=require(`./getIntlayer.cjs`),r=require(`../installIntlayer-DKwCX9In.js`),i=require(`./client/useDictionary.cjs`),a=require(`./client/useDictionaryAsync.cjs`),o=require(`./client/useDictionaryDynamic.cjs`),s=require(`./client/useIntlayer.cjs`),c=require(`./client/useLoadDynamic.cjs`),l=require(`./client/useLocale.cjs`),u=require(`./client/useRewriteURL.cjs`);require(`./client/index.cjs`),exports.INTLAYER_SYMBOL=r.t,exports.atPath=i.atPath,exports.createIntlayerClient=r.n,exports.createIntlayerLeafProxy=i.createIntlayerLeafProxy,exports.getDictionary=t.getDictionary,exports.getIntlayer=n.getIntlayer,exports.getPlugins=e.getPlugins,exports.htmlPlugin=e.htmlPlugin,exports.insertionPlugin=e.insertionPlugin,exports.installIntlayer=r.r,exports.intlayer=r.i,exports.intlayerNodePlugins=e.intlayerNodePlugins,exports.isComponentLike=i.isComponentLike,exports.isIntlayerNode=i.isIntlayerNode,exports.isObjectLike=i.isObjectLike,exports.markdownPlugin=e.markdownPlugin,exports.markdownStringPlugin=e.markdownStringPlugin,exports.toComponent=i.toComponent,exports.useDictionary=i.useDictionary,exports.useDictionaryAsync=a.useDictionaryAsync,exports.useDictionaryDynamic=o.useDictionaryDynamic,exports.useEditor=r.a,exports.useIntlayer=s.useIntlayer,exports.useLoadDynamic=c.useLoadDynamic,exports.useLocale=l.useLocale,exports.useRewriteURL=u.useRewriteURL;
|
package/dist/cjs/plugins.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-C91j1N6u.js`),t=require(`../ContentSelector-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-C91j1N6u.js`),t=require(`../ContentSelector-BbioElre.js`),n=require(`./html/HTMLRenderer.cjs`),r=require(`./markdown/installIntlayerMarkdown.cjs`),i=require(`./renderIntlayerNode.cjs`);let a=require(`@intlayer/core/interpreter`),o=require(`@intlayer/config/built`);o=e.t(o);let s=require(`@intlayer/core/markdown`),c=require(`@intlayer/types/nodeType`);c=e.t(c);let l=require(`vue`);var u={id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(e,{children:n,...r})=>{let a=e=>i.renderIntlayerNode({...r,value:e,children:o.default.editor.enabled?()=>(0,l.h)(t.t,{dictionaryKey:r.dictionaryKey,keyPath:r.keyPath},{default:()=>typeof e==`function`?e():e}):e}),s=a(n);if(typeof n!=`function`)return s;let c=(...e)=>a(n(...e));Object.setPrototypeOf(c,Object.getPrototypeOf(s));for(let e of Object.getOwnPropertyNames(s)){let t=Object.getOwnPropertyDescriptor(s,e);t&&Object.defineProperty(c,e,t)}for(let e of Object.getOwnPropertySymbols(s)){let t=Object.getOwnPropertyDescriptor(s,e);t&&Object.defineProperty(c,e,t)}return(0,l.markRaw)(c)}},d=(e,t)=>{let n=new Map,r={};for(let[e,i]of Object.entries(t))typeof i==`string`||typeof i==`number`?r[e]=i:(n.set(e,i),r[e]=`__VNODE_${e}__`);let i=(0,a.splitInsertionTemplate)(e,r);if(n.size>0){let e=[];if(i.isSimple){let t=i.parts,r=0;for(let[i]of n){let a=`__VNODE_${i}__`,o=t.indexOf(a);o!==-1&&(o>r&&e.push(t.substring(r,o)),e.push(n.get(i)),r=o+a.length)}return r<t.length&&e.push(t.substring(r)),(0,l.h)(l.Fragment,null,...e)}else return i.parts.forEach(t=>{if(typeof t==`string`){let r=t;for(let[t]of n){let i=`__VNODE_${t}__`,a=r.indexOf(i);a!==-1&&(a>0&&e.push(r.substring(0,a)),e.push(n.get(t)),r=r.substring(a+i.length))}r.length>0&&e.push(r)}else e.push(t)}),(0,l.h)(l.Fragment,null,...e)}return i.isSimple?i.parts:(0,l.h)(l.Fragment,null,i.parts)},f={id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===c.INSERTION,transform:(e,t,n)=>{let r=[...t.keyPath,{type:c.INSERTION}],i=e[c.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=d(i,e);return r(a,{...n,plugins:t.plugins,children:a})}}};return n(i,{...t,children:i,keyPath:r,plugins:[a,...t.plugins??[]]})}},p={id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,n,a)=>{let{plugins:o,...c}=n,u=a((0,s.getMarkdownMetadata)(e)??{},{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>i.renderIntlayerNode({...n,value:t,children:e})}],dictionaryKey:c.dictionaryKey,keyPath:[]}),d=a=>i.renderIntlayerNode({...n,value:e,children:()=>(0,l.h)(t.t,{dictionaryKey:c.dictionaryKey,keyPath:c.keyPath},{default:()=>{let{renderMarkdown:t,components:n}=r.useMarkdown();return t(e,void 0,{...n??{},...a??{}})}}),additionalProps:{metadata:u,use:e=>d(e)}});return d()}},m={id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===c.MARKDOWN,transform:(e,t,n)=>{let r=[...t.keyPath,{type:c.MARKDOWN}],i=e[c.MARKDOWN];return n(i,{...t,children:i,keyPath:r,plugins:[p,...t.plugins??[]]})}},h={id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===c.HTML,transform:(e,t)=>{let r=e[c.HTML];e.tags;let a=(e={})=>{let o=n.renderHTML(r,{components:e});return i.renderIntlayerNode({...t,value:r,children:o,additionalProps:{use:e=>a(e)}})};return a()}},g=(e,t=!0)=>[(0,a.translationPlugin)(e??o.default.internationalization.defaultLocale,t?o.default.internationalization.defaultLocale:void 0),a.enumerationPlugin,a.conditionPlugin,(0,a.nestedPlugin)(e??o.default.internationalization.defaultLocale),a.filePlugin,a.genderPlugin,u,f,m,h];exports.getPlugins=g,exports.htmlPlugin=h,exports.insertionPlugin=f,exports.intlayerNodePlugins=u,exports.markdownPlugin=m,exports.markdownStringPlugin=p;
|
|
@@ -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-DMhYsAX1.mjs";
|
|
2
2
|
import { atPath as i, createIntlayerLeafProxy as a, isComponentLike as o, isIntlayerNode as s, isObjectLike as c, toComponent as l, useDictionary as u } from "./useDictionary.mjs";
|
|
3
3
|
import { useDictionaryAsync as d } from "./useDictionaryAsync.mjs";
|
|
4
4
|
import { useDictionaryDynamic as f } 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-DMhYsAX1.mjs";
|
|
2
2
|
export { r as INTLAYER_SYMBOL, t as createIntlayerClient, n as installIntlayer, e as intlayer };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDictionary as e } from "../getDictionary.mjs";
|
|
2
|
-
import { t } from "../../installIntlayer-
|
|
2
|
+
import { t } from "../../installIntlayer-DMhYsAX1.mjs";
|
|
3
3
|
import n from "@intlayer/config/built";
|
|
4
4
|
import { computed as r, defineComponent as i, getCurrentInstance as a, h as o, inject as s, isRef as c, markRaw as l, ref as u, shallowRef as d, toValue as f, watch as p } from "vue";
|
|
5
5
|
//#region src/client/useDictionary.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../installIntlayer-
|
|
1
|
+
import { t as e } from "../../installIntlayer-DMhYsAX1.mjs";
|
|
2
2
|
import { useDictionary as t } from "./useDictionary.mjs";
|
|
3
3
|
import n from "@intlayer/config/built";
|
|
4
4
|
import { computed as r, inject as i, ref as a, watch as o } from "vue";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getIntlayer as e } from "../getIntlayer.mjs";
|
|
2
|
-
import { t } from "../../installIntlayer-
|
|
2
|
+
import { t } from "../../installIntlayer-DMhYsAX1.mjs";
|
|
3
3
|
import { atPath as n, createIntlayerLeafProxy as r, isComponentLike as i, isIntlayerNode as a, isObjectLike as o, toComponent as s } from "./useDictionary.mjs";
|
|
4
4
|
import c from "@intlayer/config/built";
|
|
5
5
|
import { computed as l, inject as u, isRef as d, ref as f, shallowRef as p, toValue as m, watch as h } from "vue";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../installIntlayer-
|
|
1
|
+
import { t as e } from "../../installIntlayer-DMhYsAX1.mjs";
|
|
2
2
|
import { setLocaleInStorage as t } from "./useLocaleStorage.mjs";
|
|
3
3
|
import n from "@intlayer/config/built";
|
|
4
4
|
import { computed as r, inject as i } from "vue";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed as e } from "vue";
|
|
2
2
|
import { localeStorageOptions as t } from "@intlayer/core/localization";
|
|
3
|
-
import {
|
|
3
|
+
import { LocaleStorageClient as n, getLocaleFromStorageClient as r, setLocaleInStorageClient as i } from "@intlayer/core/utils";
|
|
4
4
|
//#region src/client/useLocaleStorage.ts
|
|
5
5
|
var a = r(t), o = a, s = (e, n) => i(e, {
|
|
6
6
|
...t,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../ContentSelector-
|
|
1
|
+
import { t as e } from "../../ContentSelector-U91_pPOg.mjs";
|
|
2
2
|
export { e as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e } from "../../installIntlayer-
|
|
1
|
+
import { a as e } from "../../installIntlayer-DMhYsAX1.mjs";
|
|
2
2
|
export { e as useEditor };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../installIntlayer-
|
|
1
|
+
import { t as e } from "../../installIntlayer-DMhYsAX1.mjs";
|
|
2
2
|
import { computed as t, inject as n } from "vue";
|
|
3
3
|
import { compact as r } from "@intlayer/core/formatters";
|
|
4
4
|
//#region src/format/useCompact.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../installIntlayer-
|
|
1
|
+
import { t as e } from "../../installIntlayer-DMhYsAX1.mjs";
|
|
2
2
|
import { computed as t, inject as n } from "vue";
|
|
3
3
|
import { currency as r } from "@intlayer/core/formatters";
|
|
4
4
|
//#region src/format/useCurrency.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../installIntlayer-
|
|
1
|
+
import { t as e } from "../../installIntlayer-DMhYsAX1.mjs";
|
|
2
2
|
import { computed as t, inject as n } from "vue";
|
|
3
3
|
import { date as r, presets as i } from "@intlayer/core/formatters";
|
|
4
4
|
//#region src/format/useDate.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../installIntlayer-
|
|
1
|
+
import { t as e } from "../../installIntlayer-DMhYsAX1.mjs";
|
|
2
2
|
import { computed as t, inject as n } from "vue";
|
|
3
3
|
import { percentage as r } from "@intlayer/core/formatters";
|
|
4
4
|
//#region src/format/usePercentage.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../installIntlayer-
|
|
1
|
+
import { t as e } from "../../installIntlayer-DMhYsAX1.mjs";
|
|
2
2
|
import { computed as t, inject as n } from "vue";
|
|
3
3
|
import { relativeTime as r } from "@intlayer/core/formatters";
|
|
4
4
|
//#region src/format/useRelativeTime.ts
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { useHTML as e } from "./installIntlayerHTML.mjs";
|
|
2
2
|
import { getHTML as t } from "@intlayer/core/interpreter";
|
|
3
|
-
import { defineComponent as n } from "vue";
|
|
3
|
+
import { defineComponent as n, h as r } from "vue";
|
|
4
4
|
//#region src/html/HTMLRenderer.ts
|
|
5
|
-
var
|
|
5
|
+
var i = (e, { components: n = {} } = {}) => {
|
|
6
|
+
let i = Object.fromEntries(Object.entries(n).filter(([, e]) => e).map(([e, t]) => [e, (e) => r(t, e, e?.children)]));
|
|
7
|
+
return t(e, new Proxy(i, { get(e, t) {
|
|
8
|
+
if (typeof t == "string" && t in e) return e[t];
|
|
9
|
+
if (typeof t == "string" && /^[a-z][a-z0-9]*$/.test(t)) return (e) => r(t, e, e?.children);
|
|
10
|
+
} }));
|
|
11
|
+
}, a = ({ components: t } = {}) => {
|
|
6
12
|
let n = e();
|
|
7
|
-
return (e) => n ? n.renderHTML(e, { components: t }) :
|
|
8
|
-
},
|
|
13
|
+
return (e) => n ? n.renderHTML(e, { components: t }) : i(e, { components: t });
|
|
14
|
+
}, o = n({
|
|
9
15
|
name: "HTMLRenderer",
|
|
10
16
|
props: {
|
|
11
17
|
content: {
|
|
@@ -18,9 +24,9 @@ var r = (e, { components: n } = {}) => t(e, n), i = ({ components: t } = {}) =>
|
|
|
18
24
|
}
|
|
19
25
|
},
|
|
20
26
|
setup(e) {
|
|
21
|
-
let t =
|
|
27
|
+
let t = a({ components: e.components });
|
|
22
28
|
return () => t(e.content);
|
|
23
29
|
}
|
|
24
30
|
});
|
|
25
31
|
//#endregion
|
|
26
|
-
export {
|
|
32
|
+
export { o as HTMLRenderer, i as renderHTML, a as useHTMLRenderer };
|
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 { getDictionary as o } from "./getDictionary.mjs";
|
|
3
3
|
import { getIntlayer as s } from "./getIntlayer.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-DMhYsAX1.mjs";
|
|
5
5
|
import { atPath as p, createIntlayerLeafProxy as m, isComponentLike as h, isIntlayerNode as g, isObjectLike as _, toComponent as v, useDictionary as y } from "./client/useDictionary.mjs";
|
|
6
6
|
import { useDictionaryAsync as b } from "./client/useDictionaryAsync.mjs";
|
|
7
7
|
import { useDictionaryDynamic as x } from "./client/useDictionaryDynamic.mjs";
|
package/dist/esm/plugins.mjs
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import { t as e } from "../ContentSelector-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { t as e } from "../ContentSelector-U91_pPOg.mjs";
|
|
2
|
+
import { renderHTML as t } from "./html/HTMLRenderer.mjs";
|
|
3
|
+
import { useMarkdown as n } from "./markdown/installIntlayerMarkdown.mjs";
|
|
4
|
+
import { renderIntlayerNode as r } from "./renderIntlayerNode.mjs";
|
|
5
|
+
import { conditionPlugin as i, enumerationPlugin as a, filePlugin as o, genderPlugin as s, nestedPlugin as c, splitInsertionTemplate as l, translationPlugin as u } from "@intlayer/core/interpreter";
|
|
5
6
|
import d from "@intlayer/config/built";
|
|
6
7
|
import { getMarkdownMetadata as f } from "@intlayer/core/markdown";
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import * as h from "@intlayer/types/nodeType";
|
|
10
|
-
import { Fragment as g, h as _, markRaw as v } from "vue";
|
|
8
|
+
import * as p from "@intlayer/types/nodeType";
|
|
9
|
+
import { Fragment as m, h, markRaw as g } from "vue";
|
|
11
10
|
//#region src/plugins.ts
|
|
12
|
-
var
|
|
11
|
+
var _ = {
|
|
13
12
|
id: "intlayer-node-plugin",
|
|
14
13
|
canHandle: (e) => typeof e == "bigint" || typeof e == "string" || typeof e == "number",
|
|
15
|
-
transform: (t, { children:
|
|
16
|
-
let a = (t) =>
|
|
14
|
+
transform: (t, { children: n, ...i }) => {
|
|
15
|
+
let a = (t) => r({
|
|
17
16
|
...i,
|
|
18
17
|
value: t,
|
|
19
|
-
children:
|
|
18
|
+
children: d.editor.enabled ? () => h(e, {
|
|
20
19
|
dictionaryKey: i.dictionaryKey,
|
|
21
20
|
keyPath: i.keyPath
|
|
22
21
|
}, { default: () => typeof t == "function" ? t() : t }) : t
|
|
23
|
-
}), o = a(
|
|
24
|
-
if (typeof
|
|
25
|
-
let s = (...e) => a(
|
|
22
|
+
}), o = a(n);
|
|
23
|
+
if (typeof n != "function") return o;
|
|
24
|
+
let s = (...e) => a(n(...e));
|
|
26
25
|
Object.setPrototypeOf(s, Object.getPrototypeOf(o));
|
|
27
26
|
for (let e of Object.getOwnPropertyNames(o)) {
|
|
28
27
|
let t = Object.getOwnPropertyDescriptor(o, e);
|
|
@@ -32,9 +31,9 @@ var y = {
|
|
|
32
31
|
let t = Object.getOwnPropertyDescriptor(o, e);
|
|
33
32
|
t && Object.defineProperty(s, e, t);
|
|
34
33
|
}
|
|
35
|
-
return
|
|
34
|
+
return g(s);
|
|
36
35
|
}
|
|
37
|
-
},
|
|
36
|
+
}, v = (e, t) => {
|
|
38
37
|
let n = /* @__PURE__ */ new Map(), r = {};
|
|
39
38
|
for (let [e, i] of Object.entries(t)) typeof i == "string" || typeof i == "number" ? r[e] = i : (n.set(e, i), r[e] = `__VNODE_${e}__`);
|
|
40
39
|
let i = l(e, r);
|
|
@@ -46,7 +45,7 @@ var y = {
|
|
|
46
45
|
let a = `__VNODE_${i}__`, o = t.indexOf(a);
|
|
47
46
|
o !== -1 && (o > r && e.push(t.substring(r, o)), e.push(n.get(i)), r = o + a.length);
|
|
48
47
|
}
|
|
49
|
-
return r < t.length && e.push(t.substring(r)),
|
|
48
|
+
return r < t.length && e.push(t.substring(r)), h(m, null, ...e);
|
|
50
49
|
} else return i.parts.forEach((t) => {
|
|
51
50
|
if (typeof t == "string") {
|
|
52
51
|
let r = t;
|
|
@@ -56,14 +55,14 @@ var y = {
|
|
|
56
55
|
}
|
|
57
56
|
r.length > 0 && e.push(r);
|
|
58
57
|
} else e.push(t);
|
|
59
|
-
}),
|
|
58
|
+
}), h(m, null, ...e);
|
|
60
59
|
}
|
|
61
|
-
return i.isSimple ? i.parts :
|
|
62
|
-
},
|
|
60
|
+
return i.isSimple ? i.parts : h(m, null, i.parts);
|
|
61
|
+
}, y = {
|
|
63
62
|
id: "insertion-plugin",
|
|
64
|
-
canHandle: (e) => typeof e == "object" && e?.nodeType ===
|
|
63
|
+
canHandle: (e) => typeof e == "object" && e?.nodeType === p.INSERTION,
|
|
65
64
|
transform: (e, t, n) => {
|
|
66
|
-
let r = [...t.keyPath, { type:
|
|
65
|
+
let r = [...t.keyPath, { type: p.INSERTION }], i = e[p.INSERTION], a = {
|
|
67
66
|
id: "insertion-string-plugin",
|
|
68
67
|
canHandle: (e) => typeof e == "string",
|
|
69
68
|
transform: (e, n, r) => {
|
|
@@ -73,7 +72,7 @@ var y = {
|
|
|
73
72
|
plugins: [...(t.plugins ?? []).filter((e) => e.id !== "intlayer-node-plugin")]
|
|
74
73
|
});
|
|
75
74
|
return (e) => {
|
|
76
|
-
let a =
|
|
75
|
+
let a = v(i, e);
|
|
77
76
|
return r(a, {
|
|
78
77
|
...n,
|
|
79
78
|
plugins: t.plugins,
|
|
@@ -89,84 +88,82 @@ var y = {
|
|
|
89
88
|
plugins: [a, ...t.plugins ?? []]
|
|
90
89
|
});
|
|
91
90
|
}
|
|
92
|
-
},
|
|
91
|
+
}, b = {
|
|
93
92
|
id: "markdown-string-plugin",
|
|
94
93
|
canHandle: (e) => typeof e == "string",
|
|
95
|
-
transform: (
|
|
96
|
-
let { plugins: o, ...s } = i, c = a(f(
|
|
94
|
+
transform: (t, i, a) => {
|
|
95
|
+
let { plugins: o, ...s } = i, c = a(f(t) ?? {}, {
|
|
97
96
|
plugins: [{
|
|
98
97
|
id: "markdown-metadata-plugin",
|
|
99
98
|
canHandle: (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" || !e,
|
|
100
|
-
transform: (e,
|
|
101
|
-
...
|
|
99
|
+
transform: (e, n) => r({
|
|
100
|
+
...n,
|
|
102
101
|
value: e,
|
|
103
|
-
children:
|
|
102
|
+
children: t
|
|
104
103
|
})
|
|
105
104
|
}],
|
|
106
105
|
dictionaryKey: s.dictionaryKey,
|
|
107
106
|
keyPath: []
|
|
108
|
-
}), l = (a) =>
|
|
107
|
+
}), l = (a) => r({
|
|
109
108
|
...i,
|
|
110
|
-
value:
|
|
111
|
-
children: () =>
|
|
109
|
+
value: t,
|
|
110
|
+
children: () => h(e, {
|
|
112
111
|
dictionaryKey: s.dictionaryKey,
|
|
113
112
|
keyPath: s.keyPath
|
|
114
113
|
}, { default: () => {
|
|
115
|
-
let { renderMarkdown: e, components:
|
|
116
|
-
return e(
|
|
117
|
-
...
|
|
114
|
+
let { renderMarkdown: e, components: r } = n();
|
|
115
|
+
return e(t, void 0, {
|
|
116
|
+
...r ?? {},
|
|
118
117
|
...a ?? {}
|
|
119
118
|
});
|
|
120
119
|
} }),
|
|
121
|
-
additionalProps: {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
120
|
+
additionalProps: {
|
|
121
|
+
metadata: c,
|
|
122
|
+
use: (e) => l(e)
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return l();
|
|
126
126
|
}
|
|
127
|
-
},
|
|
127
|
+
}, x = {
|
|
128
128
|
id: "markdown-plugin",
|
|
129
|
-
canHandle: (e) => typeof e == "object" && e?.nodeType ===
|
|
129
|
+
canHandle: (e) => typeof e == "object" && e?.nodeType === p.MARKDOWN,
|
|
130
130
|
transform: (e, t, n) => {
|
|
131
|
-
let r = [...t.keyPath, { type:
|
|
131
|
+
let r = [...t.keyPath, { type: p.MARKDOWN }], i = e[p.MARKDOWN];
|
|
132
132
|
return n(i, {
|
|
133
133
|
...t,
|
|
134
134
|
children: i,
|
|
135
135
|
keyPath: r,
|
|
136
|
-
plugins: [
|
|
136
|
+
plugins: [b, ...t.plugins ?? []]
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
|
-
},
|
|
140
|
-
let e = {};
|
|
141
|
-
for (let t of p) e[t] = ({ children: e, ...n }) => _(t, n, e);
|
|
142
|
-
return e;
|
|
143
|
-
}, T = null, E = () => (T ||= w(), T), D = {
|
|
139
|
+
}, S = {
|
|
144
140
|
id: "html-plugin",
|
|
145
|
-
canHandle: (e) => typeof e == "object" && e?.nodeType ===
|
|
146
|
-
transform: (e,
|
|
147
|
-
let
|
|
141
|
+
canHandle: (e) => typeof e == "object" && e?.nodeType === p.HTML,
|
|
142
|
+
transform: (e, n) => {
|
|
143
|
+
let i = e[p.HTML];
|
|
148
144
|
e.tags;
|
|
149
|
-
let
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
145
|
+
let a = (e = {}) => {
|
|
146
|
+
let o = t(i, { components: e });
|
|
147
|
+
return r({
|
|
148
|
+
...n,
|
|
149
|
+
value: i,
|
|
150
|
+
children: o,
|
|
151
|
+
additionalProps: { use: (e) => a(e) }
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
return a();
|
|
158
155
|
}
|
|
159
|
-
},
|
|
156
|
+
}, C = (e, t = !0) => [
|
|
160
157
|
u(e ?? d.internationalization.defaultLocale, t ? d.internationalization.defaultLocale : void 0),
|
|
158
|
+
a,
|
|
161
159
|
i,
|
|
162
|
-
r,
|
|
163
160
|
c(e ?? d.internationalization.defaultLocale),
|
|
164
|
-
a,
|
|
165
161
|
o,
|
|
162
|
+
s,
|
|
163
|
+
_,
|
|
166
164
|
y,
|
|
167
165
|
x,
|
|
168
|
-
|
|
169
|
-
D
|
|
166
|
+
S
|
|
170
167
|
];
|
|
171
168
|
//#endregion
|
|
172
|
-
export {
|
|
169
|
+
export { C as getPlugins, S as htmlPlugin, y as insertionPlugin, _ as intlayerNodePlugins, x as markdownPlugin, b as markdownStringPlugin };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-C91j1N6u.js`);let t=require(`@intlayer/config/built`);t=e.t(t);let n=require(
|
|
1
|
+
const e=require(`./chunk-C91j1N6u.js`);let t=require(`@intlayer/config/built`);t=e.t(t);let n=require(`vue`),r=require(`@intlayer/editor/isEnabled`);var i=e=>{let t=null,r=!1;return import(`@intlayer/editor`).then(({initEditorClient:i})=>{if(r)return;let a=i();e&&(t=(0,n.watchEffect)(()=>{let t=e.value;t&&a.currentLocale.set(t)}))}),()=>{r=!0,t?.(),import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})}},a=e=>{if(process.env.INTLAYER_EDITOR_ENABLED===`false`||!r.isEnabled)return;if(e){let t=null;e.mixin({inject:{_intlayerClient:{from:o,default:null}},mounted(){if(this.$parent!==null)return;let e=this._intlayerClient;t=i(e?.locale)},unmounted(){this.$parent===null&&t?.()}});return}let t=(0,n.inject)(o),a=null;(0,n.onMounted)(()=>{a=i(t?.locale)}),(0,n.onUnmounted)(()=>{a?.()})},o=Symbol(`intlayer`),s=null,c=(e,r=!0)=>{if(s)return s;let{defaultLocale:i}=t.default.internationalization??{},a=(0,n.ref)(e??i);return s={locale:(0,n.readonly)(a),setLocale:e=>{a.value=e},isCookieEnabled:r},s},l=(e,t)=>{let{locale:n,isCookieEnabled:r}=t??{},i=c(n,r);return e.provide(o,i),a(e),e},u={install:l};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import e from "@intlayer/config/built";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { inject as t, onMounted as n, onUnmounted as r, readonly as i, ref as a, watchEffect as o } from "vue";
|
|
3
|
+
import { isEnabled as s } from "@intlayer/editor/isEnabled";
|
|
4
4
|
//#region src/editor/useEditor.ts
|
|
5
5
|
var c = (e) => {
|
|
6
6
|
let t = null, n = !1;
|
|
7
7
|
return import("@intlayer/editor").then(({ initEditorClient: r }) => {
|
|
8
8
|
if (n) return;
|
|
9
9
|
let i = r();
|
|
10
|
-
e && (t =
|
|
10
|
+
e && (t = o(() => {
|
|
11
11
|
let t = e.value;
|
|
12
12
|
t && i.currentLocale.set(t);
|
|
13
13
|
}));
|
|
@@ -17,7 +17,7 @@ var c = (e) => {
|
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
19
|
}, l = (e) => {
|
|
20
|
-
if (process.env.INTLAYER_EDITOR_ENABLED === "false" || !
|
|
20
|
+
if (process.env.INTLAYER_EDITOR_ENABLED === "false" || !s) return;
|
|
21
21
|
if (e) {
|
|
22
22
|
let t = null;
|
|
23
23
|
e.mixin({
|
|
@@ -36,19 +36,19 @@ var c = (e) => {
|
|
|
36
36
|
});
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}),
|
|
43
|
-
|
|
39
|
+
let i = t(u), a = null;
|
|
40
|
+
n(() => {
|
|
41
|
+
a = c(i?.locale);
|
|
42
|
+
}), r(() => {
|
|
43
|
+
a?.();
|
|
44
44
|
});
|
|
45
45
|
}, u = Symbol("intlayer"), d = null, f = (t, n = !0) => {
|
|
46
46
|
if (d) return d;
|
|
47
|
-
let { defaultLocale: r } = e.internationalization ?? {},
|
|
47
|
+
let { defaultLocale: r } = e.internationalization ?? {}, o = a(t ?? r);
|
|
48
48
|
return d = {
|
|
49
|
-
locale:
|
|
49
|
+
locale: i(o),
|
|
50
50
|
setLocale: (e) => {
|
|
51
|
-
|
|
51
|
+
o.value = e;
|
|
52
52
|
},
|
|
53
53
|
isCookieEnabled: n
|
|
54
54
|
}, d;
|
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
* // e.g. "75%"
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
export declare const useNumber: () => import('vue').ComputedRef<(value: string | number,
|
|
20
|
+
export declare const useNumber: () => import('vue').ComputedRef<(value: string | number, args_1?: (Intl.NumberFormatOptions & {
|
|
21
21
|
locale?: import('intlayer').LocalesValues;
|
|
22
22
|
}) | undefined) => string>;
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
* formatPercentage(0.237, { minimumFractionDigits: 1 }); // "23.7%"
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
export declare const usePercentage: () => import('vue').ComputedRef<(value: string | number,
|
|
14
|
+
export declare const usePercentage: () => import('vue').ComputedRef<(value: string | number, args_1?: (Intl.NumberFormatOptions & {
|
|
15
15
|
locale?: import('intlayer').LocalesValues;
|
|
16
16
|
}) | undefined) => string>;
|
|
@@ -95,11 +95,6 @@ export declare const MarkdownRenderer: import('vue').DefineComponent<import('vue
|
|
|
95
95
|
default: undefined;
|
|
96
96
|
};
|
|
97
97
|
}>> & Readonly<{}>, {
|
|
98
|
-
forceBlock: boolean;
|
|
99
|
-
forceInline: boolean;
|
|
100
|
-
wrapper: string | Component;
|
|
101
|
-
preserveFrontmatter: boolean;
|
|
102
|
-
tagfilter: boolean;
|
|
103
98
|
components: {} & {
|
|
104
99
|
object?: ((props: import('vue').HTMLAttributes & import('vue').AllowedComponentProps & import('vue').VNodeProps & {
|
|
105
100
|
children?: any;
|
|
@@ -406,6 +401,11 @@ export declare const MarkdownRenderer: import('vue').DefineComponent<import('vue
|
|
|
406
401
|
children?: any;
|
|
407
402
|
}) => import('vue').VNode | import('vue').VNode[];
|
|
408
403
|
};
|
|
409
|
-
renderMarkdown: RenderMarkdownFunction;
|
|
410
404
|
content: string;
|
|
405
|
+
forceBlock: boolean;
|
|
406
|
+
forceInline: boolean;
|
|
407
|
+
wrapper: string | Component;
|
|
408
|
+
preserveFrontmatter: boolean;
|
|
409
|
+
tagfilter: boolean;
|
|
410
|
+
renderMarkdown: RenderMarkdownFunction;
|
|
411
411
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
package/dist/types/plugins.d.ts
CHANGED
|
@@ -43,6 +43,9 @@ export type MarkdownCond<T> = T extends {
|
|
|
43
43
|
metadata: DeepTransformContent<U>;
|
|
44
44
|
} : never;
|
|
45
45
|
export declare const markdownPlugin: Plugins;
|
|
46
|
+
/** ---------------------------------------------
|
|
47
|
+
* HTML PLUGIN
|
|
48
|
+
* --------------------------------------------- */
|
|
46
49
|
export type HTMLPluginCond<T> = T extends {
|
|
47
50
|
nodeType: NodeType | string;
|
|
48
51
|
[NodeTypes.HTML]: infer I;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-intlayer",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Vue applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -102,11 +102,11 @@
|
|
|
102
102
|
"typecheck": "vue-tsc --noEmit --project tsconfig.types.json"
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|
|
105
|
-
"@intlayer/api": "8.
|
|
106
|
-
"@intlayer/config": "8.
|
|
107
|
-
"@intlayer/core": "8.
|
|
108
|
-
"@intlayer/editor": "8.
|
|
109
|
-
"@intlayer/types": "8.
|
|
105
|
+
"@intlayer/api": "8.6.0",
|
|
106
|
+
"@intlayer/config": "8.6.0",
|
|
107
|
+
"@intlayer/core": "8.6.0",
|
|
108
|
+
"@intlayer/editor": "8.6.0",
|
|
109
|
+
"@intlayer/types": "8.6.0"
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
112
|
"@types/node": "25.5.0",
|
|
@@ -117,15 +117,15 @@
|
|
|
117
117
|
"ajv": "8.18.0",
|
|
118
118
|
"fast-glob": "3.3.3",
|
|
119
119
|
"rimraf": "6.1.3",
|
|
120
|
-
"tsdown": "0.21.
|
|
120
|
+
"tsdown": "0.21.7",
|
|
121
121
|
"typescript": "6.0.2",
|
|
122
|
-
"vite": "8.0.
|
|
122
|
+
"vite": "8.0.3",
|
|
123
123
|
"vite-plugin-dts": "4.5.4",
|
|
124
|
-
"vitest": "4.1.
|
|
124
|
+
"vitest": "4.1.2",
|
|
125
125
|
"vue-tsc": "3.1.5"
|
|
126
126
|
},
|
|
127
127
|
"peerDependencies": {
|
|
128
|
-
"intlayer": "8.
|
|
128
|
+
"intlayer": "8.6.0",
|
|
129
129
|
"vue": ">=3.0.0"
|
|
130
130
|
},
|
|
131
131
|
"peerDependenciesMeta": {
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { isEnabled as e } from "@intlayer/editor/isEnabled";
|
|
2
|
-
import { defineComponent as t, h as n } from "vue";
|
|
3
|
-
//#endregion
|
|
4
|
-
//#region src/editor/ContentSelector.vue
|
|
5
|
-
var r = t({
|
|
6
|
-
name: "ContentSelector",
|
|
7
|
-
props: {
|
|
8
|
-
dictionaryKey: {
|
|
9
|
-
type: String,
|
|
10
|
-
required: !0
|
|
11
|
-
},
|
|
12
|
-
keyPath: {
|
|
13
|
-
type: Array,
|
|
14
|
-
required: !0
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
setup(t, { slots: r }) {
|
|
18
|
-
return () => e ? n("intlayer-content-selector-wrapper", {
|
|
19
|
-
"key-path": JSON.stringify(t.keyPath),
|
|
20
|
-
"dictionary-key": t.dictionaryKey
|
|
21
|
-
}, r.default?.()) : r.default?.();
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
//#endregion
|
|
25
|
-
export { r as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./chunk-C91j1N6u.js`);let e=require(`@intlayer/editor/isEnabled`),t=require(`vue`);var n=(0,t.defineComponent)({name:`ContentSelector`,props:{dictionaryKey:{type:String,required:!0},keyPath:{type:Array,required:!0}},setup(n,{slots:r}){return()=>e.isEnabled?(0,t.h)(`intlayer-content-selector-wrapper`,{"key-path":JSON.stringify(n.keyPath),"dictionary-key":n.dictionaryKey},r.default?.()):r.default?.()}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|