solid-intlayer 9.5.11 → 9.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.
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./IntlayerProvider.cjs"),t=require("./useDictionary.cjs");let n=require("@intlayer/config/built"),r=require("solid-js");var i=async(i,a)=>{let{locale:o}=(0,r.useContext)(e.IntlayerClientContext)??{},s=n.internationalization.defaultLocale,c=a??o()??s,l=await i[c]?.();return t.useDictionary(l,c)};exports.useDictionaryAsync=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./IntlayerProvider.cjs"),t=require("./useDictionary.cjs");let n=require("@intlayer/core/interpreter"),r=require("solid-js");var i=async(i,a)=>{let{locale:o}=(0,r.useContext)(e.IntlayerClientContext)??{},s=a??o()??(0,n.resolveInterpreterLocale)(),c=await i[s]?.();return t.useDictionary(c,s)};exports.useDictionaryAsync=i;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../getDictionary.cjs"),t=require("./IntlayerProvider.cjs"),n=require("./useLoadDynamic.cjs"),r=require("./useDictionary.cjs");let i=require("@intlayer/config/built"),a=require("solid-js"),o=require("@intlayer/core/dictionaryManipulator");var s=(s,c,l)=>{let u=(0,a.useContext)(t.IntlayerClientContext)??{},{locale:d}=u,f=i.internationalization.defaultLocale,p=String(c);if(process.env.INTLAYER_DICTIONARY_SELECTOR!==`false`&&(0,o.isQualifiedDynamicLoaderMap)(s)){let{locale:t,selector:i}=(0,o.parseDictionarySelector)(l),c=()=>(0,o.parseDictionarySelector)((0,o.resolveDictionaryArgument)({localeOrSelector:l,contextLocale:d?.(),contextVariant:u.variant?.(),dictionaryKey:p})).selector,m=s[o.QUALIFIER_DYNAMIC_TYPES_KEY].includes(`item`)&&i?.item===void 0,h=()=>t??d?.()??f;if(!m){let e=n.useLoadDynamic(()=>{let e=h();return{cacheKey:`${p}.${e}.${(0,o.getDictionarySelectorCacheKey)(c())}`,locale:e}},({locale:e})=>(0,o.resolveQualifiedDynamicContentAsync)({loaderMap:s,key:p,locale:e,selector:c(),transform:e=>e}).then(e=>Array.isArray(e)?e[0]:e));return r.useDictionary(e,t)}let[g]=(0,a.createResource)(()=>({locale:h(),selector:c()}),({locale:e,selector:t})=>(0,o.resolveQualifiedDynamicContentAsync)({loaderMap:s,key:p,locale:e,selector:t,transform:e=>e})),_=(0,a.createMemo)(()=>{let t=g(),n=h();return Array.isArray(t)?t.map(t=>e.getDictionary(t,n)):[]});return(0,a.createRenderEffect)(()=>{g()}),new Proxy(_,{get(e,t){return e()?.[t]},apply(e){return e()}})}let m=s,h=l,g=()=>h??d?.()??f,_=()=>{let e=g();return{cacheKey:`${p}.${e}`,locale:e}},v=({locale:e})=>{let t=m[e];return t?t():Promise.reject(Error(`No dynamic dictionary loader found for key "${p}" and locale "${e}".`))},y=(0,o.getPreloadedDictionary)(m,g());y&&n.seedDynamicValue(_(),y);let b=n.useLoadDynamic(_,v);return r.useDictionary(b,h)};exports.useDictionaryDynamic=s;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../getDictionary.cjs"),t=require("./IntlayerProvider.cjs"),n=require("./useLoadDynamic.cjs"),r=require("./useDictionary.cjs");let i=require("@intlayer/core/interpreter"),a=require("solid-js"),o=require("@intlayer/core/dictionaryManipulator");var s=(s,c,l)=>{let u=(0,a.useContext)(t.IntlayerClientContext)??{},{locale:d}=u,f=String(c);if(process.env.INTLAYER_DICTIONARY_SELECTOR!==`false`&&(0,o.isQualifiedDynamicLoaderMap)(s)){let{locale:t,selector:c}=(0,o.parseDictionarySelector)(l),p=()=>(0,o.parseDictionarySelector)((0,o.resolveDictionaryArgument)({localeOrSelector:l,contextLocale:d?.(),contextVariant:u.variant?.(),dictionaryKey:f})).selector,m=s[o.QUALIFIER_DYNAMIC_TYPES_KEY].includes(`item`)&&c?.item===void 0,h=()=>t??d?.()??(0,i.resolveInterpreterLocale)();if(!m){let e=n.useLoadDynamic(()=>{let e=h();return{cacheKey:`${f}.${e}.${(0,o.getDictionarySelectorCacheKey)(p())}`,locale:e}},({locale:e})=>(0,o.resolveQualifiedDynamicContentAsync)({loaderMap:s,key:f,locale:e,selector:p(),transform:e=>e}).then(e=>Array.isArray(e)?e[0]:e));return r.useDictionary(e,t)}let[g]=(0,a.createResource)(()=>({locale:h(),selector:p()}),({locale:e,selector:t})=>(0,o.resolveQualifiedDynamicContentAsync)({loaderMap:s,key:f,locale:e,selector:t,transform:e=>e})),_=(0,a.createMemo)(()=>{let t=g(),n=h();return Array.isArray(t)?t.map(t=>e.getDictionary(t,n)):[]});return(0,a.createRenderEffect)(()=>{g()}),new Proxy(_,{get(e,t){return e()?.[t]},apply(e){return e()}})}let p=s,m=l,h=()=>m??d?.()??(0,i.resolveInterpreterLocale)(),g=()=>{let e=h();return{cacheKey:`${f}.${e}`,locale:e}},_=({locale:e})=>{let t=p[e];return t?t():Promise.reject(Error(`No dynamic dictionary loader found for key "${f}" and locale "${e}".`))},v=(0,o.getPreloadedDictionary)(p,h());v&&n.seedDynamicValue(g(),v);let y=n.useLoadDynamic(g,_);return r.useDictionary(y,m)};exports.useDictionaryDynamic=s;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));const c=require("./analytics/exposureSink.cjs"),l=require("./IntlayerNode.cjs"),u=require("./solidElement/renderSolidElement.cjs");let d=require("@intlayer/core/interpreter"),f=require("solid-js/web"),p=require("@intlayer/config/built"),m=require("@intlayer/core/markdown"),h=require("@intlayer/types/nodeType");h=s(h);let g=require("solid-js");var _=process.env.INTLAYER_EDITOR_ENABLED===`false`?null:(0,g.lazy)(()=>Promise.resolve().then(()=>require("./editor/ContentSelector.cjs")).then(e=>({default:e.ContentSelector}))),v=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?null:Promise.resolve().then(()=>require("./markdown/MarkdownRenderer.cjs")).then(e=>({MarkdownRenderer:e.MarkdownRenderer,MarkdownMetadataRenderer:e.MarkdownMetadataRenderer})),y=process.env.INTLAYER_NODE_TYPE_HTML===`false`?null:Promise.resolve().then(()=>require("./html/HTMLRenderer.cjs")).then(e=>e.HTMLRenderer);v?.catch(()=>{}),y?.catch(()=>{});var b={id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(e,t)=>{if(process.env.INTLAYER_ANALYTICS_ENABLED!==`false`&&c.reportExposure({dictionaryKey:t.dictionaryKey,keyPath:t.keyPath,locale:t.locale,nodeType:`text`}),process.env.INTLAYER_EDITOR_ENABLED!==`false`&&p.editor.enabled){let{plugins:e,...n}=t;return l.renderIntlayerNode({value:n.children,children:(0,f.createComponent)(g.Suspense,{get fallback(){return n.children},get children(){return(0,f.createComponent)(_,(0,f.mergeProps)(n,{get children(){return n.children}}))}})})}return l.renderIntlayerNode({value:t.children,children:t.children})}},x=process.env.INTLAYER_NODE_TYPE_SOLID_NODE===`false`?d.fallbackPlugin:{id:`solid-node-plugin`,canHandle:e=>typeof e==`object`&&e?.props!==void 0||typeof Node<`u`&&e instanceof Node,transform:(e,{plugins:t,...n})=>(process.env.INTLAYER_ANALYTICS_ENABLED!==`false`&&c.reportExposure({dictionaryKey:n.dictionaryKey,keyPath:n.keyPath,locale:n.locale,nodeType:`solid-node`}),l.renderIntlayerNode({...n,value:`[[solid-element]]`,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&p.editor.enabled?(0,f.createComponent)(g.Suspense,{get fallback(){return typeof Node<`u`&&e instanceof Node?e:u.renderSolidElement(e)},get children(){return(0,f.createComponent)(_,(0,f.mergeProps)(n,{get children(){return typeof Node<`u`&&e instanceof Node?e:u.renderSolidElement(e)}}))}}):typeof Node<`u`&&e instanceof Node?e:u.renderSolidElement(e)}))},S=(e,t)=>{let n=(0,d.splitInsertionTemplate)(e,t);return n.isSimple,n.parts},C=process.env.INTLAYER_NODE_TYPE_INSERTION===`false`?d.fallbackPlugin:{id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.INSERTION,transform:(e,t,n)=>{let r=[...t.keyPath,{type:h.INSERTION}],i=e[h.INSERTION];return e=>{let a={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`||(0,d.isInterpolableWrapperNode)(e),transform:(n,r,i)=>{if((0,d.isInterpolableWrapperNode)(n))return(0,d.transformInterpolableNode)(n,e,r,t.plugins,i);let a=S(i(n,{...r,children:n,plugins:[...(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)]}),e);return i(a,{...r,plugins:t.plugins,children:a})}},o=n(i,{...t,children:i,keyPath:r,plugins:[a,...t.plugins??[]]});return(0,d.bindInsertedValues)(i,o,e,!0)}}},w=(0,g.lazy)(()=>v.then(e=>({default:e.MarkdownRenderer}))),T=(0,g.lazy)(()=>v.then(e=>({default:e.MarkdownMetadataRenderer}))),E=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?d.fallbackPlugin:{id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,t,n)=>{let{plugins:r,...i}=t,a=n((0,m.getMarkdownMetadata)(e)??{},{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>l.renderIntlayerNode({...n,value:t,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&p.editor.enabled?(0,f.createComponent)(g.Suspense,{get children(){return(0,f.createComponent)(_,(0,f.mergeProps)(i,{get children(){return(0,f.createComponent)(T,(0,f.mergeProps)(i,{get metadataKeyPath(){return n.keyPath},children:e}))}}))}}):(0,f.createComponent)(T,(0,f.mergeProps)(i,{get metadataKeyPath(){return n.keyPath},children:e}))})}],dictionaryKey:i.dictionaryKey,keyPath:[]}),o=n=>l.renderIntlayerNode({...t,value:e,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&p.editor.enabled?(0,f.createComponent)(g.Suspense,{get children(){return(0,f.createComponent)(_,(0,f.mergeProps)(i,{get children(){return(0,f.createComponent)(w,(0,f.mergeProps)(i,{components:n,children:e}))}}))}}):(0,f.createComponent)(w,(0,f.mergeProps)(i,{components:n,children:e})),additionalProps:{metadata:a,use:o}});return o()}},D=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?d.fallbackPlugin:{id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.MARKDOWN,transform:(e,t,n)=>{let r=[...t.keyPath,{type:h.MARKDOWN}],i=e[h.MARKDOWN];return n(i,{...t,children:i,keyPath:r,plugins:[E,...t.plugins??[]]})}},O=(0,g.lazy)(()=>y.then(e=>({default:e}))),k=process.env.INTLAYER_NODE_TYPE_HTML===`false`?d.fallbackPlugin:{id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.HTML,transform:(e,t)=>{let n=e[h.HTML],{plugins:r,children:i,...a}=t,o=e=>l.renderIntlayerNode({...a,value:n,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&p.editor.enabled?(0,f.createComponent)(g.Suspense,{get children(){return(0,f.createComponent)(_,(0,f.mergeProps)(a,{get children(){return(0,f.createComponent)(O,(0,f.mergeProps)(a,{html:n,components:e}))}}))}}):(0,f.createComponent)(O,(0,f.mergeProps)(a,{html:n,components:e})),additionalProps:{use:o}});return o()}},A=new Map,j=(e,t=!0)=>{let n=`${e??p.internationalization.defaultLocale}_${t}`;if(A.has(n))return A.get(n);let r=[b,(0,d.translationPlugin)(e??p.internationalization.defaultLocale,t?p.internationalization.defaultLocale:void 0),d.enumerationPlugin,(0,d.pluralPlugin)(e??p.internationalization.defaultLocale),d.conditionPlugin,(0,d.nestedPlugin)(e??p.internationalization.defaultLocale),d.filePlugin,d.genderPlugin,d.selectPlugin,x,C,D,k].filter(e=>e!==d.fallbackPlugin);return A.set(n,r),r};exports.getPlugins=j,exports.htmlPlugin=k,exports.insertionPlugin=C,exports.intlayerNodePlugins=b,exports.markdownPlugin=D,exports.markdownStringPlugin=E,exports.solidNodePlugins=x;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));const c=require("./analytics/exposureSink.cjs"),l=require("./IntlayerNode.cjs"),u=require("./solidElement/renderSolidElement.cjs");let d=require("@intlayer/core/interpreter"),f=require("solid-js/web"),p=require("@intlayer/config/built"),m=require("@intlayer/core/markdown"),h=require("@intlayer/types/nodeType");h=s(h);let g=require("solid-js");var _=process.env.INTLAYER_EDITOR_ENABLED===`false`?null:(0,g.lazy)(()=>Promise.resolve().then(()=>require("./editor/ContentSelector.cjs")).then(e=>({default:e.ContentSelector}))),v=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?null:Promise.resolve().then(()=>require("./markdown/MarkdownRenderer.cjs")).then(e=>({MarkdownRenderer:e.MarkdownRenderer,MarkdownMetadataRenderer:e.MarkdownMetadataRenderer})),y=process.env.INTLAYER_NODE_TYPE_HTML===`false`?null:Promise.resolve().then(()=>require("./html/HTMLRenderer.cjs")).then(e=>e.HTMLRenderer);v?.catch(()=>{}),y?.catch(()=>{});var b={id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(e,t)=>{if(process.env.INTLAYER_ANALYTICS_ENABLED!==`false`&&c.reportExposure({dictionaryKey:t.dictionaryKey,keyPath:t.keyPath,locale:t.locale,nodeType:`text`}),process.env.INTLAYER_EDITOR_ENABLED!==`false`&&p.editor.enabled){let{plugins:e,...n}=t;return l.renderIntlayerNode({value:n.children,children:(0,f.createComponent)(g.Suspense,{get fallback(){return n.children},get children(){return(0,f.createComponent)(_,(0,f.mergeProps)(n,{get children(){return n.children}}))}})})}return l.renderIntlayerNode({value:t.children,children:t.children})}},x=process.env.INTLAYER_NODE_TYPE_SOLID_NODE===`false`?d.fallbackPlugin:{id:`solid-node-plugin`,canHandle:e=>typeof e==`object`&&e?.props!==void 0||typeof Node<`u`&&e instanceof Node,transform:(e,{plugins:t,...n})=>(process.env.INTLAYER_ANALYTICS_ENABLED!==`false`&&c.reportExposure({dictionaryKey:n.dictionaryKey,keyPath:n.keyPath,locale:n.locale,nodeType:`solid-node`}),l.renderIntlayerNode({...n,value:`[[solid-element]]`,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&p.editor.enabled?(0,f.createComponent)(g.Suspense,{get fallback(){return typeof Node<`u`&&e instanceof Node?e:u.renderSolidElement(e)},get children(){return(0,f.createComponent)(_,(0,f.mergeProps)(n,{get children(){return typeof Node<`u`&&e instanceof Node?e:u.renderSolidElement(e)}}))}}):typeof Node<`u`&&e instanceof Node?e:u.renderSolidElement(e)}))},S=(e,t)=>{let n=(0,d.splitInsertionTemplate)(e,t);return n.isSimple,n.parts},C=process.env.INTLAYER_NODE_TYPE_INSERTION===`false`?d.fallbackPlugin:{id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.INSERTION,transform:(e,t,n)=>{let r=[...t.keyPath,{type:h.INSERTION}],i=e[h.INSERTION];return e=>{let a={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`||(0,d.isInterpolableWrapperNode)(e),transform:(n,r,i)=>{if((0,d.isInterpolableWrapperNode)(n))return(0,d.transformInterpolableNode)(n,e,r,t.plugins,i);let a=S(i(n,{...r,children:n,plugins:[...(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)]}),e);return i(a,{...r,plugins:t.plugins,children:a})}},o=n(i,{...t,children:i,keyPath:r,plugins:[a,...t.plugins??[]]});return(0,d.bindInsertedValues)(i,o,e,!0)}}},w=(0,g.lazy)(()=>v.then(e=>({default:e.MarkdownRenderer}))),T=(0,g.lazy)(()=>v.then(e=>({default:e.MarkdownMetadataRenderer}))),E=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?d.fallbackPlugin:{id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,t,n)=>{let{plugins:r,...i}=t,a=n((0,m.getMarkdownMetadata)(e)??{},{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>l.renderIntlayerNode({...n,value:t,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&p.editor.enabled?(0,f.createComponent)(g.Suspense,{get children(){return(0,f.createComponent)(_,(0,f.mergeProps)(i,{get children(){return(0,f.createComponent)(T,(0,f.mergeProps)(i,{get metadataKeyPath(){return n.keyPath},children:e}))}}))}}):(0,f.createComponent)(T,(0,f.mergeProps)(i,{get metadataKeyPath(){return n.keyPath},children:e}))})}],dictionaryKey:i.dictionaryKey,keyPath:[]}),o=n=>l.renderIntlayerNode({...t,value:e,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&p.editor.enabled?(0,f.createComponent)(g.Suspense,{get children(){return(0,f.createComponent)(_,(0,f.mergeProps)(i,{get children(){return(0,f.createComponent)(w,(0,f.mergeProps)(i,{components:n,children:e}))}}))}}):(0,f.createComponent)(w,(0,f.mergeProps)(i,{components:n,children:e})),additionalProps:{metadata:a,use:o}});return o()}},D=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?d.fallbackPlugin:{id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.MARKDOWN,transform:(e,t,n)=>{let r=[...t.keyPath,{type:h.MARKDOWN}],i=e[h.MARKDOWN];return n(i,{...t,children:i,keyPath:r,plugins:[E,...t.plugins??[]]})}},O=(0,g.lazy)(()=>y.then(e=>({default:e}))),k=process.env.INTLAYER_NODE_TYPE_HTML===`false`?d.fallbackPlugin:{id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.HTML,transform:(e,t)=>{let n=e[h.HTML],{plugins:r,children:i,...a}=t,o=e=>l.renderIntlayerNode({...a,value:n,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&p.editor.enabled?(0,f.createComponent)(g.Suspense,{get children(){return(0,f.createComponent)(_,(0,f.mergeProps)(a,{get children(){return(0,f.createComponent)(O,(0,f.mergeProps)(a,{html:n,components:e}))}}))}}):(0,f.createComponent)(O,(0,f.mergeProps)(a,{html:n,components:e})),additionalProps:{use:o}});return o()}},A=new Map,j=(e,t=!0)=>{let n=(0,d.resolveInterpreterLocale)(e),r=`${n}_${t}`;if(A.has(r))return A.get(r);let i=[b,(0,d.translationPlugin)(n,t?p.internationalization.defaultLocale:void 0),d.enumerationPlugin,(0,d.pluralPlugin)(n),d.conditionPlugin,(0,d.nestedPlugin)(n),d.filePlugin,d.genderPlugin,d.selectPlugin,x,C,D,k].filter(e=>e!==d.fallbackPlugin);return A.set(r,i),i};exports.getPlugins=j,exports.htmlPlugin=k,exports.insertionPlugin=C,exports.intlayerNodePlugins=b,exports.markdownPlugin=D,exports.markdownStringPlugin=E,exports.solidNodePlugins=x;
@@ -1,11 +1,11 @@
1
1
  import { IntlayerClientContext as e } from "./IntlayerProvider.mjs";
2
2
  import { useDictionary as t } from "./useDictionary.mjs";
3
- import { internationalization as n } from "@intlayer/config/built";
3
+ import { resolveInterpreterLocale as n } from "@intlayer/core/interpreter";
4
4
  import { useContext as r } from "solid-js";
5
5
  //#region src/client/useDictionaryAsync.ts
6
6
  var i = async (i, a) => {
7
- let { locale: o } = r(e) ?? {}, s = n.defaultLocale, c = a ?? o() ?? s, l = await i[c]?.();
8
- return t(l, c);
7
+ let { locale: o } = r(e) ?? {}, s = a ?? o() ?? n(), c = await i[s]?.();
8
+ return t(c, s);
9
9
  };
10
10
  //#endregion
11
11
  export { i as useDictionaryAsync };
@@ -2,51 +2,51 @@ import { getDictionary as e } from "../getDictionary.mjs";
2
2
  import { IntlayerClientContext as t } from "./IntlayerProvider.mjs";
3
3
  import { seedDynamicValue as n, useLoadDynamic as r } from "./useLoadDynamic.mjs";
4
4
  import { useDictionary as i } from "./useDictionary.mjs";
5
- import { internationalization as a } from "@intlayer/config/built";
5
+ import { resolveInterpreterLocale as a } from "@intlayer/core/interpreter";
6
6
  import { createMemo as o, createRenderEffect as s, createResource as c, useContext as l } from "solid-js";
7
7
  import { QUALIFIER_DYNAMIC_TYPES_KEY as u, getDictionarySelectorCacheKey as d, getPreloadedDictionary as f, isQualifiedDynamicLoaderMap as p, parseDictionarySelector as m, resolveDictionaryArgument as h, resolveQualifiedDynamicContentAsync as g } from "@intlayer/core/dictionaryManipulator";
8
8
  //#region src/client/useDictionaryDynamic.ts
9
9
  var _ = (_, v, y) => {
10
- let b = l(t) ?? {}, { locale: x } = b, S = a.defaultLocale, C = String(v);
10
+ let b = l(t) ?? {}, { locale: x } = b, S = String(v);
11
11
  if (process.env.INTLAYER_DICTIONARY_SELECTOR !== "false" && p(_)) {
12
- let { locale: t, selector: n } = m(y), a = () => m(h({
12
+ let { locale: t, selector: n } = m(y), l = () => m(h({
13
13
  localeOrSelector: y,
14
14
  contextLocale: x?.(),
15
15
  contextVariant: b.variant?.(),
16
- dictionaryKey: C
17
- })).selector, l = _[u].includes("item") && n?.item === void 0, f = () => t ?? x?.() ?? S;
18
- if (!l) {
16
+ dictionaryKey: S
17
+ })).selector, f = _[u].includes("item") && n?.item === void 0, p = () => t ?? x?.() ?? a();
18
+ if (!f) {
19
19
  let e = r(() => {
20
- let e = f();
20
+ let e = p();
21
21
  return {
22
- cacheKey: `${C}.${e}.${d(a())}`,
22
+ cacheKey: `${S}.${e}.${d(l())}`,
23
23
  locale: e
24
24
  };
25
25
  }, ({ locale: e }) => g({
26
26
  loaderMap: _,
27
- key: C,
27
+ key: S,
28
28
  locale: e,
29
- selector: a(),
29
+ selector: l(),
30
30
  transform: (e) => e
31
31
  }).then((e) => Array.isArray(e) ? e[0] : e));
32
32
  return i(e, t);
33
33
  }
34
- let [p] = c(() => ({
35
- locale: f(),
36
- selector: a()
34
+ let [v] = c(() => ({
35
+ locale: p(),
36
+ selector: l()
37
37
  }), ({ locale: e, selector: t }) => g({
38
38
  loaderMap: _,
39
- key: C,
39
+ key: S,
40
40
  locale: e,
41
41
  selector: t,
42
42
  transform: (e) => e
43
- })), v = o(() => {
44
- let t = p(), n = f();
43
+ })), C = o(() => {
44
+ let t = v(), n = p();
45
45
  return Array.isArray(t) ? t.map((t) => e(t, n)) : [];
46
46
  });
47
47
  return s(() => {
48
- p();
49
- }), new Proxy(v, {
48
+ v();
49
+ }), new Proxy(C, {
50
50
  get(e, t) {
51
51
  return e()?.[t];
52
52
  },
@@ -55,19 +55,19 @@ var _ = (_, v, y) => {
55
55
  }
56
56
  });
57
57
  }
58
- let w = _, T = y, E = () => T ?? x?.() ?? S, D = () => {
59
- let e = E();
58
+ let C = _, w = y, T = () => w ?? x?.() ?? a(), E = () => {
59
+ let e = T();
60
60
  return {
61
- cacheKey: `${C}.${e}`,
61
+ cacheKey: `${S}.${e}`,
62
62
  locale: e
63
63
  };
64
- }, O = ({ locale: e }) => {
65
- let t = w[e];
66
- return t ? t() : Promise.reject(/* @__PURE__ */ Error(`No dynamic dictionary loader found for key "${C}" and locale "${e}".`));
67
- }, k = f(w, E());
68
- k && n(D(), k);
69
- let A = r(D, O);
70
- return i(A, T);
64
+ }, D = ({ locale: e }) => {
65
+ let t = C[e];
66
+ return t ? t() : Promise.reject(/* @__PURE__ */ Error(`No dynamic dictionary loader found for key "${S}" and locale "${e}".`));
67
+ }, O = f(C, T());
68
+ O && n(E(), O);
69
+ let k = r(E, D);
70
+ return i(k, w);
71
71
  };
72
72
  //#endregion
73
73
  export { _ as useDictionaryDynamic };
@@ -1,19 +1,19 @@
1
1
  import { reportExposure as e } from "./analytics/exposureSink.mjs";
2
2
  import { renderIntlayerNode as t } from "./IntlayerNode.mjs";
3
3
  import { renderSolidElement as n } from "./solidElement/renderSolidElement.mjs";
4
- import { bindInsertedValues as r, conditionPlugin as i, enumerationPlugin as a, fallbackPlugin as o, filePlugin as s, genderPlugin as c, isInterpolableWrapperNode as l, nestedPlugin as u, pluralPlugin as d, selectPlugin as f, splitInsertionTemplate as p, transformInterpolableNode as m, translationPlugin as h } from "@intlayer/core/interpreter";
5
- import { createComponent as g, mergeProps as _ } from "solid-js/web";
6
- import { editor as v, internationalization as y } from "@intlayer/config/built";
7
- import { getMarkdownMetadata as b } from "@intlayer/core/markdown";
8
- import * as x from "@intlayer/types/nodeType";
9
- import { Suspense as S, lazy as C } from "solid-js";
4
+ import { bindInsertedValues as r, conditionPlugin as i, enumerationPlugin as a, fallbackPlugin as o, filePlugin as s, genderPlugin as c, isInterpolableWrapperNode as l, nestedPlugin as u, pluralPlugin as d, resolveInterpreterLocale as f, selectPlugin as p, splitInsertionTemplate as m, transformInterpolableNode as h, translationPlugin as g } from "@intlayer/core/interpreter";
5
+ import { createComponent as _, mergeProps as v } from "solid-js/web";
6
+ import { editor as y, internationalization as b } from "@intlayer/config/built";
7
+ import { getMarkdownMetadata as x } from "@intlayer/core/markdown";
8
+ import * as S from "@intlayer/types/nodeType";
9
+ import { Suspense as C, lazy as w } from "solid-js";
10
10
  //#region src/plugins.tsx
11
- var w = process.env.INTLAYER_EDITOR_ENABLED === "false" ? null : C(() => import("./editor/ContentSelector.mjs").then((e) => ({ default: e.ContentSelector }))), T = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? null : import("./markdown/MarkdownRenderer.mjs").then((e) => ({
11
+ var T = process.env.INTLAYER_EDITOR_ENABLED === "false" ? null : w(() => import("./editor/ContentSelector.mjs").then((e) => ({ default: e.ContentSelector }))), E = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? null : import("./markdown/MarkdownRenderer.mjs").then((e) => ({
12
12
  MarkdownRenderer: e.MarkdownRenderer,
13
13
  MarkdownMetadataRenderer: e.MarkdownMetadataRenderer
14
- })), E = process.env.INTLAYER_NODE_TYPE_HTML === "false" ? null : import("./html/HTMLRenderer.mjs").then((e) => e.HTMLRenderer);
15
- T?.catch(() => {}), E?.catch(() => {});
16
- var D = {
14
+ })), D = process.env.INTLAYER_NODE_TYPE_HTML === "false" ? null : import("./html/HTMLRenderer.mjs").then((e) => e.HTMLRenderer);
15
+ E?.catch(() => {}), D?.catch(() => {});
16
+ var O = {
17
17
  id: "intlayer-node-plugin",
18
18
  canHandle: (e) => typeof e == "bigint" || typeof e == "string" || typeof e == "number",
19
19
  transform: (n, r) => {
@@ -22,16 +22,16 @@ var D = {
22
22
  keyPath: r.keyPath,
23
23
  locale: r.locale,
24
24
  nodeType: "text"
25
- }), process.env.INTLAYER_EDITOR_ENABLED !== "false" && v.enabled) {
25
+ }), process.env.INTLAYER_EDITOR_ENABLED !== "false" && y.enabled) {
26
26
  let { plugins: e, ...n } = r;
27
27
  return t({
28
28
  value: n.children,
29
- children: g(S, {
29
+ children: _(C, {
30
30
  get fallback() {
31
31
  return n.children;
32
32
  },
33
33
  get children() {
34
- return g(w, _(n, { get children() {
34
+ return _(T, v(n, { get children() {
35
35
  return n.children;
36
36
  } }));
37
37
  }
@@ -43,7 +43,7 @@ var D = {
43
43
  children: r.children
44
44
  });
45
45
  }
46
- }, O = process.env.INTLAYER_NODE_TYPE_SOLID_NODE === "false" ? o : {
46
+ }, k = process.env.INTLAYER_NODE_TYPE_SOLID_NODE === "false" ? o : {
47
47
  id: "solid-node-plugin",
48
48
  canHandle: (e) => typeof e == "object" && e?.props !== void 0 || typeof Node < "u" && e instanceof Node,
49
49
  transform: (r, { plugins: i, ...a }) => (process.env.INTLAYER_ANALYTICS_ENABLED !== "false" && e({
@@ -54,32 +54,32 @@ var D = {
54
54
  }), t({
55
55
  ...a,
56
56
  value: "[[solid-element]]",
57
- children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && v.enabled ? g(S, {
57
+ children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && y.enabled ? _(C, {
58
58
  get fallback() {
59
59
  return typeof Node < "u" && r instanceof Node ? r : n(r);
60
60
  },
61
61
  get children() {
62
- return g(w, _(a, { get children() {
62
+ return _(T, v(a, { get children() {
63
63
  return typeof Node < "u" && r instanceof Node ? r : n(r);
64
64
  } }));
65
65
  }
66
66
  }) : typeof Node < "u" && r instanceof Node ? r : n(r)
67
67
  }))
68
- }, k = (e, t) => {
69
- let n = p(e, t);
68
+ }, A = (e, t) => {
69
+ let n = m(e, t);
70
70
  return n.isSimple, n.parts;
71
- }, A = process.env.INTLAYER_NODE_TYPE_INSERTION === "false" ? o : {
71
+ }, j = process.env.INTLAYER_NODE_TYPE_INSERTION === "false" ? o : {
72
72
  id: "insertion-plugin",
73
- canHandle: (e) => typeof e == "object" && e?.nodeType === x.INSERTION,
73
+ canHandle: (e) => typeof e == "object" && e?.nodeType === S.INSERTION,
74
74
  transform: (e, t, n) => {
75
- let i = [...t.keyPath, { type: x.INSERTION }], a = e[x.INSERTION];
75
+ let i = [...t.keyPath, { type: S.INSERTION }], a = e[S.INSERTION];
76
76
  return (e) => {
77
77
  let o = {
78
78
  id: "insertion-string-plugin",
79
79
  canHandle: (e) => typeof e == "string" || l(e),
80
80
  transform: (n, r, i) => {
81
- if (l(n)) return m(n, e, r, t.plugins, i);
82
- let a = k(i(n, {
81
+ if (l(n)) return h(n, e, r, t.plugins, i);
82
+ let a = A(i(n, {
83
83
  ...r,
84
84
  children: n,
85
85
  plugins: [...(t.plugins ?? []).filter((e) => e.id !== "intlayer-node-plugin")]
@@ -99,27 +99,27 @@ var D = {
99
99
  return r(a, s, e, !0);
100
100
  };
101
101
  }
102
- }, j = C(() => T.then((e) => ({ default: e.MarkdownRenderer }))), M = C(() => T.then((e) => ({ default: e.MarkdownMetadataRenderer }))), N = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? o : {
102
+ }, M = w(() => E.then((e) => ({ default: e.MarkdownRenderer }))), N = w(() => E.then((e) => ({ default: e.MarkdownMetadataRenderer }))), P = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? o : {
103
103
  id: "markdown-string-plugin",
104
104
  canHandle: (e) => typeof e == "string",
105
105
  transform: (e, n, r) => {
106
- let { plugins: i, ...a } = n, o = r(b(e) ?? {}, {
106
+ let { plugins: i, ...a } = n, o = r(x(e) ?? {}, {
107
107
  plugins: [{
108
108
  id: "markdown-metadata-plugin",
109
109
  canHandle: (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" || !e,
110
110
  transform: (n, r) => t({
111
111
  ...r,
112
112
  value: n,
113
- children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && v.enabled ? g(S, { get children() {
114
- return g(w, _(a, { get children() {
115
- return g(M, _(a, {
113
+ children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && y.enabled ? _(C, { get children() {
114
+ return _(T, v(a, { get children() {
115
+ return _(N, v(a, {
116
116
  get metadataKeyPath() {
117
117
  return r.keyPath;
118
118
  },
119
119
  children: e
120
120
  }));
121
121
  } }));
122
- } }) : g(M, _(a, {
122
+ } }) : _(N, v(a, {
123
123
  get metadataKeyPath() {
124
124
  return r.keyPath;
125
125
  },
@@ -132,14 +132,14 @@ var D = {
132
132
  }), s = (r) => t({
133
133
  ...n,
134
134
  value: e,
135
- children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && v.enabled ? g(S, { get children() {
136
- return g(w, _(a, { get children() {
137
- return g(j, _(a, {
135
+ children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && y.enabled ? _(C, { get children() {
136
+ return _(T, v(a, { get children() {
137
+ return _(M, v(a, {
138
138
  components: r,
139
139
  children: e
140
140
  }));
141
141
  } }));
142
- } }) : g(j, _(a, {
142
+ } }) : _(M, v(a, {
143
143
  components: r,
144
144
  children: e
145
145
  })),
@@ -150,33 +150,33 @@ var D = {
150
150
  });
151
151
  return s();
152
152
  }
153
- }, P = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? o : {
153
+ }, F = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? o : {
154
154
  id: "markdown-plugin",
155
- canHandle: (e) => typeof e == "object" && e?.nodeType === x.MARKDOWN,
155
+ canHandle: (e) => typeof e == "object" && e?.nodeType === S.MARKDOWN,
156
156
  transform: (e, t, n) => {
157
- let r = [...t.keyPath, { type: x.MARKDOWN }], i = e[x.MARKDOWN];
157
+ let r = [...t.keyPath, { type: S.MARKDOWN }], i = e[S.MARKDOWN];
158
158
  return n(i, {
159
159
  ...t,
160
160
  children: i,
161
161
  keyPath: r,
162
- plugins: [N, ...t.plugins ?? []]
162
+ plugins: [P, ...t.plugins ?? []]
163
163
  });
164
164
  }
165
- }, F = C(() => E.then((e) => ({ default: e }))), I = process.env.INTLAYER_NODE_TYPE_HTML === "false" ? o : {
165
+ }, I = w(() => D.then((e) => ({ default: e }))), L = process.env.INTLAYER_NODE_TYPE_HTML === "false" ? o : {
166
166
  id: "html-plugin",
167
- canHandle: (e) => typeof e == "object" && e?.nodeType === x.HTML,
167
+ canHandle: (e) => typeof e == "object" && e?.nodeType === S.HTML,
168
168
  transform: (e, n) => {
169
- let r = e[x.HTML], { plugins: i, children: a, ...o } = n, s = (e) => t({
169
+ let r = e[S.HTML], { plugins: i, children: a, ...o } = n, s = (e) => t({
170
170
  ...o,
171
171
  value: r,
172
- children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && v.enabled ? g(S, { get children() {
173
- return g(w, _(o, { get children() {
174
- return g(F, _(o, {
172
+ children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && y.enabled ? _(C, { get children() {
173
+ return _(T, v(o, { get children() {
174
+ return _(I, v(o, {
175
175
  html: r,
176
176
  components: e
177
177
  }));
178
178
  } }));
179
- } }) : g(F, _(o, {
179
+ } }) : _(I, v(o, {
180
180
  html: r,
181
181
  components: e
182
182
  })),
@@ -184,25 +184,25 @@ var D = {
184
184
  });
185
185
  return s();
186
186
  }
187
- }, L = /* @__PURE__ */ new Map(), R = (e, t = !0) => {
188
- let n = `${e ?? y.defaultLocale}_${t}`;
189
- if (L.has(n)) return L.get(n);
190
- let r = [
191
- D,
192
- h(e ?? y.defaultLocale, t ? y.defaultLocale : void 0),
187
+ }, R = /* @__PURE__ */ new Map(), z = (e, t = !0) => {
188
+ let n = f(e), r = `${n}_${t}`;
189
+ if (R.has(r)) return R.get(r);
190
+ let l = [
191
+ O,
192
+ g(n, t ? b.defaultLocale : void 0),
193
193
  a,
194
- d(e ?? y.defaultLocale),
194
+ d(n),
195
195
  i,
196
- u(e ?? y.defaultLocale),
196
+ u(n),
197
197
  s,
198
198
  c,
199
- f,
200
- O,
201
- A,
202
- P,
203
- I
199
+ p,
200
+ k,
201
+ j,
202
+ F,
203
+ L
204
204
  ].filter((e) => e !== o);
205
- return L.set(n, r), r;
205
+ return R.set(r, l), l;
206
206
  };
207
207
  //#endregion
208
- export { R as getPlugins, I as htmlPlugin, A as insertionPlugin, D as intlayerNodePlugins, P as markdownPlugin, N as markdownStringPlugin, O as solidNodePlugins };
208
+ export { z as getPlugins, L as htmlPlugin, j as insertionPlugin, O as intlayerNodePlugins, F as markdownPlugin, P as markdownStringPlugin, k as solidNodePlugins };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-intlayer",
3
- "version": "9.5.11",
3
+ "version": "9.6.0",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Solid applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -114,11 +114,11 @@
114
114
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
115
115
  },
116
116
  "dependencies": {
117
- "@intlayer/api": "9.5.11",
118
- "@intlayer/config": "9.5.11",
119
- "@intlayer/core": "9.5.11",
120
- "@intlayer/editor": "9.5.11",
121
- "@intlayer/types": "9.5.11"
117
+ "@intlayer/api": "9.6.0",
118
+ "@intlayer/config": "9.6.0",
119
+ "@intlayer/core": "9.6.0",
120
+ "@intlayer/editor": "9.6.0",
121
+ "@intlayer/types": "9.6.0"
122
122
  },
123
123
  "devDependencies": {
124
124
  "@solidjs/testing-library": "0.8.10",
@@ -136,13 +136,13 @@
136
136
  "vite": "8.3.1",
137
137
  "vite-plugin-dts": "5.1.1",
138
138
  "vite-plugin-solid": "2.11.14",
139
- "vitest": "5.0.2"
139
+ "vitest": "5.0.3"
140
140
  },
141
141
  "peerDependencies": {
142
142
  "solid-js": ">=1.0.0"
143
143
  },
144
144
  "optionalDependencies": {
145
- "@intlayer/analytics": "9.5.11"
145
+ "@intlayer/analytics": "9.6.0"
146
146
  },
147
147
  "engines": {
148
148
  "node": ">=14.18"