solid-intlayer 8.2.3 → 8.3.0-canary.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.
Files changed (47) hide show
  1. package/dist/cjs/client/getBrowserLocale.cjs +1 -1
  2. package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -1
  3. package/dist/cjs/editor/contexts/EditedContentContext.cjs +1 -1
  4. package/dist/cjs/editor/index.cjs +1 -1
  5. package/dist/cjs/getDictionary.cjs +1 -1
  6. package/dist/cjs/getIntlayer.cjs +1 -1
  7. package/dist/cjs/markdown/MarkdownProvider.cjs +1 -1
  8. package/dist/cjs/markdown/MarkdownRenderer.cjs +1 -1
  9. package/dist/cjs/plugins.cjs +1 -1
  10. package/dist/esm/client/getBrowserLocale.mjs +21 -20
  11. package/dist/esm/editor/ContentSelectorWrapper.mjs +4 -3
  12. package/dist/esm/editor/contexts/EditedContentContext.mjs +1 -1
  13. package/dist/esm/editor/index.mjs +1 -1
  14. package/dist/esm/getDictionary.mjs +1 -1
  15. package/dist/esm/getIntlayer.mjs +1 -1
  16. package/dist/esm/markdown/MarkdownProvider.mjs +25 -30
  17. package/dist/esm/markdown/MarkdownRenderer.mjs +34 -41
  18. package/dist/esm/plugins.mjs +2 -2
  19. package/dist/plugins-Da2V8QmE.js +1 -0
  20. package/dist/{plugins-BDLeP00w.mjs → plugins-qgberWhD.mjs} +14 -12
  21. package/dist/types/client/IntlayerProvider.d.ts +1 -1
  22. package/dist/types/client/format/useIntl.d.ts +1 -1
  23. package/dist/types/client/getBrowserLocale.d.ts +1 -1
  24. package/dist/types/client/t.d.ts +1 -1
  25. package/dist/types/client/useContent.d.ts +2 -2
  26. package/dist/types/client/useDictionary.d.ts +2 -1
  27. package/dist/types/client/useDictionaryAsync.d.ts +2 -1
  28. package/dist/types/client/useDictionaryDynamic.d.ts +3 -2
  29. package/dist/types/client/useIntlayer.d.ts +1 -1
  30. package/dist/types/client/useLocale.d.ts +1 -1
  31. package/dist/types/client/useLocaleBase.d.ts +1 -1
  32. package/dist/types/client/useLocaleStorage.d.ts +5 -5
  33. package/dist/types/client/useTraduction.d.ts +1 -1
  34. package/dist/types/editor/contexts/ConfigurationContext.d.ts +1 -1
  35. package/dist/types/editor/contexts/DictionariesRecordContext.d.ts +1 -1
  36. package/dist/types/editor/contexts/EditedContentContext.d.ts +3 -1
  37. package/dist/types/editor/contexts/FocusDictionaryContext.d.ts +1 -1
  38. package/dist/types/editor/useEditedContentRenderer.d.ts +2 -1
  39. package/dist/types/getDictionary.d.ts +2 -1
  40. package/dist/types/getIntlayer.d.ts +1 -1
  41. package/dist/types/html/HTMLRenderer.d.ts +1 -1
  42. package/dist/types/index.d.ts +1 -1
  43. package/dist/types/markdown/MarkdownProvider.d.ts +7 -5
  44. package/dist/types/markdown/MarkdownRenderer.d.ts +2 -2
  45. package/dist/types/plugins.d.ts +2 -1
  46. package/package.json +15 -15
  47. package/dist/plugins-BNX3Lsth.js +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/config/built"),s=require("@intlayer/core/localization"),y=require("@intlayer/types");var d=(e=>(e.Querystring="querystring",e.Storage="storage",e.Navigator="navigator",e.HtmlTag="htmlTag",e))(d||{});const v=()=>({order:["querystring","storage","navigator","htmlTag"],lookupQuerystring:"locale",htmlTag:typeof document<"u"?document.documentElement:null}),h=(e,a)=>{const r={},f={querystring:()=>{if(typeof window>"u")return;const t=window.location.search||"",n=new URLSearchParams(t).get(a.lookupQuerystring??"");n&&(r.querystring=n)},storage:()=>{if(typeof window>"u")return;const t=s.getLocaleFromStorage({getCookie:o=>{try{const n=document.cookie.split(";"),i=`${o}=`,u=n.find(m=>m.trim().startsWith(i));if(u)return u.split("=")[1].trim()}catch{}},getSessionStorage:o=>{try{return window.sessionStorage.getItem(o)??void 0}catch{}},getLocaleStorage:o=>{try{return window.localStorage.getItem(o)??void 0}catch{}}});t&&(r.storage=t)},navigator:()=>{if(typeof navigator>"u")return;const{internationalization:t}=l,o=navigator.languages??[navigator.language],n=s.localeDetector({"accept-language":o.join(",")},t.locales,t.defaultLocale);n&&(r.navigator=n)},htmlTag:()=>{const t=a.htmlTag;if(t&&typeof t.getAttribute=="function"){const o=t.getAttribute("lang");if(o){const{internationalization:n}=l,i=s.localeDetector({"accept-language":o},n.locales,n.defaultLocale);r.htmlTag=i}}}};return e.forEach(t=>{f[t]?.()}),r},p=(e,a)=>{const{internationalization:r}=l;for(const g of a){const c=e[g];if(c&&r.locales.includes(c))return c}return r?.defaultLocale??y.Locales.ENGLISH},w=(e={})=>{const a={...v(),...e},r=h(a.order??[],a);return p(r,a.order??[])};exports.LanguageDetector=d;exports.getBrowserLocale=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/config/built"),u=require("@intlayer/core/localization"),y=require("@intlayer/core/utils"),p=require("@intlayer/types/locales");function v(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const c=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,c.get?c:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const h=v(p);var d=(t=>(t.Querystring="querystring",t.Storage="storage",t.Navigator="navigator",t.HtmlTag="htmlTag",t))(d||{});const S=()=>({order:["querystring","storage","navigator","htmlTag"],lookupQuerystring:"locale",htmlTag:typeof document<"u"?document.documentElement:null}),w=(t,r)=>{const e={},f={querystring:()=>{if(typeof window>"u")return;const o=window.location.search||"",a=new URLSearchParams(o).get(r.lookupQuerystring??"");a&&(e.querystring=a)},storage:()=>{if(typeof window>"u")return;const o=y.getLocaleFromStorage({getCookie:n=>{try{const a=document.cookie.split(";"),s=`${n}=`,g=a.find(m=>m.trim().startsWith(s));if(g)return g.split("=")[1].trim()}catch{}},getSessionStorage:n=>{try{return window.sessionStorage.getItem(n)??void 0}catch{}},getLocaleStorage:n=>{try{return window.localStorage.getItem(n)??void 0}catch{}}});o&&(e.storage=o)},navigator:()=>{if(typeof navigator>"u")return;const{internationalization:o}=l,n=navigator.languages??[navigator.language],a=u.localeDetector({"accept-language":n.join(",")},o.locales,o.defaultLocale);a&&(e.navigator=a)},htmlTag:()=>{const o=r.htmlTag;if(o&&typeof o.getAttribute=="function"){const n=o.getAttribute("lang");if(n){const{internationalization:a}=l,s=u.localeDetector({"accept-language":n},a.locales,a.defaultLocale);e.htmlTag=s}}}};return t.forEach(o=>{f[o]?.()}),e},T=(t,r)=>{const{internationalization:e}=l;for(const c of r){const i=t[c];if(i&&e.locales.includes(i))return i}return e?.defaultLocale??h.ENGLISH},b=(t={})=>{const r={...S(),...t},e=w(r.order??[],r);return T(e,r.order??[])};exports.LanguageDetector=d;exports.getBrowserLocale=b;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("solid-js/web");require("@intlayer/core/utils");require("@intlayer/types");require("solid-js");require("@intlayer/core/formatters");require("../client/IntlayerProvider.cjs");require("@intlayer/config/built");require("@intlayer/core/localization");require("@intlayer/core/interpreter");const e=require("../../plugins-BNX3Lsth.js");require("../client/useLocaleStorage.cjs");require("../client/useLocaleBase.cjs");require("../UI/ContentSelector.cjs");require("@intlayer/editor");require("./contexts/ConfigurationContext.cjs");require("./contexts/DictionariesRecordContext.cjs");require("./contexts/EditedContentContext.cjs");require("./contexts/EditorEnabledContext.cjs");require("./contexts/CommunicatorContext.cjs");require("./contexts/FocusDictionaryContext.cjs");exports.ContentSelectorRenderer=e.ContentSelectorRenderer;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("solid-js/web");require("@intlayer/core/utils");require("@intlayer/types/nodeType");require("solid-js");require("@intlayer/core/formatters");require("../client/IntlayerProvider.cjs");require("@intlayer/config/built");require("@intlayer/core/localization");require("@intlayer/types/locales");require("@intlayer/core/interpreter");const e=require("../../plugins-Da2V8QmE.js");require("../client/useLocaleStorage.cjs");require("../client/useLocaleBase.cjs");require("../UI/ContentSelector.cjs");require("@intlayer/editor");require("./contexts/ConfigurationContext.cjs");require("./contexts/DictionariesRecordContext.cjs");require("./contexts/EditedContentContext.cjs");require("./contexts/EditorEnabledContext.cjs");require("./contexts/CommunicatorContext.cjs");require("./contexts/FocusDictionaryContext.cjs");exports.ContentSelectorRenderer=e.ContentSelectorRenderer;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("solid-js/web"),l=require("@intlayer/core/dictionaryManipulator"),g=require("@intlayer/editor"),T=require("@intlayer/types"),f=require("solid-js"),R=require("./DictionariesRecordContext.cjs"),_=require("./useCrossFrameMessageListener.cjs"),$=require("./useCrossFrameState.cjs"),P=f.createContext(void 0),j=C=>_.useCrossFrameMessageListener(`${g.MessageKey.INTLAYER_EDITED_CONTENT_CHANGED}/post`,C),k=C=>_.useCrossFrameMessageListener(`${g.MessageKey.INTLAYER_EDITED_CONTENT_CHANGED}/get`,C),m=f.createContext(void 0),v=C=>{const{localeDictionaries:a}=R.useDictionariesRecord(),[D,r]=$.useCrossFrameState(g.MessageKey.INTLAYER_EDITED_CONTENT_CHANGED),S=t=>{if(typeof t=="function")r(n=>{const e=n?.[Object.keys(n||{})[0]],s=t(e);return{...n,[s.key]:s}});else{const n=t;r(e=>({...e,[n.key]:n}))}},A=(t,n)=>{r(e=>({...e,[t]:{...e?.[t],content:n}}))},p=(t,n,e=[],s=!0)=>{r(d=>{const u=a[t]?.content,o=structuredClone(d?.[t]?.content??u);let c=e;if(!s){let E=0;const G=e.slice(0,-1),N=e[e.length-1];let h=N.key;for(;typeof l.getContentNodeByKeyPath(o,c)<"u";)E++,h=E===0?N.key:`${N.key} (${E})`,c=[...G,{...N,key:h}]}const i=l.editDictionaryByKeyPath(o,c,n);return{...d,[t]:{...d?.[t],content:i}}})},q=(t,n,e=[])=>{r(s=>{const d=a[t]?.content,u=structuredClone(s?.[t]?.content??d),o=l.renameContentNodeByKeyPath(u,n,e);return{...s,[t]:{...s?.[t],content:o}}})},M=(t,n)=>{r(e=>{const s=a[t]?.content,d=structuredClone(e?.[t]?.content??s),u=structuredClone(d),o=n.slice(0,-1),c=n[n.length-1]?.key;if(c){const i=l.getContentNodeByKeyPath(u,o.filter(E=>E.type!==T.NodeType.Translation));i&&typeof i=="object"&&c in i&&delete i[c]}return{...e,[t]:{...e?.[t],content:u}}})},b=t=>{r(n=>{const e={...n};return delete e[t],e})},F=t=>{r(n=>({...n,[t]:{...n?.[t],content:{}}}))},I=()=>{r({})},L=(t,n)=>{const e=D();if(!e)return;const s=n.filter(o=>o.type!==T.NodeType.Translation);if(t.includes(":local:")||t.includes(":remote:")){const o=e?.[t]?.content??{};return l.getContentNodeByKeyPath(o,s)}const u=Object.keys(e).filter(o=>o.startsWith(`${t}:`));for(const o of u){const c=e?.[o]?.content??{},i=l.getContentNodeByKeyPath(c,s);if(i)return i}},w={editedContent:D()},B={setEditedContentState:r,setEditedDictionary:S,setEditedContent:A,addEditedContent:p,renameEditedContent:q,removeEditedContent:M,restoreEditedContent:b,clearEditedDictionaryContent:F,clearEditedContent:I,getEditedContentValue:L};return y.createComponent(P.Provider,{value:w,get children(){return y.createComponent(m.Provider,{value:B,get children(){return C.children}})}})},x=()=>f.useContext(m),H=()=>{const C=x(),a=f.useContext(P);if(!a)throw new Error("useEditedContent must be used within a EditedContentProvider");return{...a,...C}};exports.EditedContentProvider=v;exports.useEditedContent=H;exports.useEditedContentActions=x;exports.useGetEditedContentState=k;exports.usePostEditedContentState=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("solid-js/web"),l=require("@intlayer/core/dictionaryManipulator"),g=require("@intlayer/editor"),y=require("@intlayer/types/nodeType"),f=require("solid-js"),R=require("./DictionariesRecordContext.cjs"),_=require("./useCrossFrameMessageListener.cjs"),$=require("./useCrossFrameState.cjs"),P=f.createContext(void 0),j=C=>_.useCrossFrameMessageListener(`${g.MessageKey.INTLAYER_EDITED_CONTENT_CHANGED}/post`,C),k=C=>_.useCrossFrameMessageListener(`${g.MessageKey.INTLAYER_EDITED_CONTENT_CHANGED}/get`,C),m=f.createContext(void 0),v=C=>{const{localeDictionaries:a}=R.useDictionariesRecord(),[D,r]=$.useCrossFrameState(g.MessageKey.INTLAYER_EDITED_CONTENT_CHANGED),S=t=>{if(typeof t=="function")r(n=>{const e=n?.[Object.keys(n||{})[0]],s=t(e);return{...n,[s.key]:s}});else{const n=t;r(e=>({...e,[n.key]:n}))}},A=(t,n)=>{r(e=>({...e,[t]:{...e?.[t],content:n}}))},p=(t,n,e=[],s=!0)=>{r(d=>{const u=a[t]?.content,o=structuredClone(d?.[t]?.content??u);let c=e;if(!s){let E=0;const G=e.slice(0,-1),N=e[e.length-1];let h=N.key;for(;typeof l.getContentNodeByKeyPath(o,c)<"u";)E++,h=E===0?N.key:`${N.key} (${E})`,c=[...G,{...N,key:h}]}const i=l.editDictionaryByKeyPath(o,c,n);return{...d,[t]:{...d?.[t],content:i}}})},q=(t,n,e=[])=>{r(s=>{const d=a[t]?.content,u=structuredClone(s?.[t]?.content??d),o=l.renameContentNodeByKeyPath(u,n,e);return{...s,[t]:{...s?.[t],content:o}}})},M=(t,n)=>{r(e=>{const s=a[t]?.content,d=structuredClone(e?.[t]?.content??s),u=structuredClone(d),o=n.slice(0,-1),c=n[n.length-1]?.key;if(c){const i=l.getContentNodeByKeyPath(u,o.filter(E=>E.type!==y.NodeType.Translation));i&&typeof i=="object"&&c in i&&delete i[c]}return{...e,[t]:{...e?.[t],content:u}}})},b=t=>{r(n=>{const e={...n};return delete e[t],e})},F=t=>{r(n=>({...n,[t]:{...n?.[t],content:{}}}))},I=()=>{r({})},L=(t,n)=>{const e=D();if(!e)return;const s=n.filter(o=>o.type!==y.NodeType.Translation);if(t.includes(":local:")||t.includes(":remote:")){const o=e?.[t]?.content??{};return l.getContentNodeByKeyPath(o,s)}const u=Object.keys(e).filter(o=>o.startsWith(`${t}:`));for(const o of u){const c=e?.[o]?.content??{},i=l.getContentNodeByKeyPath(c,s);if(i)return i}},w={editedContent:D()},B={setEditedContentState:r,setEditedDictionary:S,setEditedContent:A,addEditedContent:p,renameEditedContent:q,removeEditedContent:M,restoreEditedContent:b,clearEditedDictionaryContent:F,clearEditedContent:I,getEditedContentValue:L};return T.createComponent(P.Provider,{value:w,get children(){return T.createComponent(m.Provider,{value:B,get children(){return C.children}})}})},x=()=>f.useContext(m),H=()=>{const C=x(),a=f.useContext(P);if(!a)throw new Error("useEditedContent must be used within a EditedContentProvider");return{...a,...C}};exports.EditedContentProvider=v;exports.useEditedContent=H;exports.useEditedContentActions=x;exports.useGetEditedContentState=k;exports.usePostEditedContentState=j;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../plugins-BNX3Lsth.js");exports.ContentSelectorRenderer=e.ContentSelectorRenderer;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../plugins-Da2V8QmE.js");exports.ContentSelectorRenderer=e.ContentSelectorRenderer;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@intlayer/core/interpreter"),e=require("../plugins-BNX3Lsth.js"),l=(t,i,n)=>{const r=[e.intlayerNodePlugins,e.solidNodePlugins,e.insertionPlugin,e.markdownPlugin,e.htmlPlugin,...n??[]];return o.getDictionary(t,i,r)};exports.getDictionary=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@intlayer/core/interpreter"),e=require("../plugins-Da2V8QmE.js"),l=(t,i,n)=>{const r=[e.intlayerNodePlugins,e.solidNodePlugins,e.insertionPlugin,e.markdownPlugin,e.htmlPlugin,...n??[]];return o.getDictionary(t,i,r)};exports.getDictionary=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/core/interpreter"),e=require("../plugins-BNX3Lsth.js"),o=(t,n,r)=>{const i=[e.intlayerNodePlugins,e.solidNodePlugins,e.insertionPlugin,e.markdownPlugin,e.htmlPlugin,...r??[]];return l.getIntlayer(t,n,i)};exports.getIntlayer=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/core/interpreter"),e=require("../plugins-Da2V8QmE.js"),o=(t,n,r)=>{const i=[e.intlayerNodePlugins,e.solidNodePlugins,e.insertionPlugin,e.markdownPlugin,e.htmlPlugin,...r??[]];return l.getIntlayer(t,n,i)};exports.getIntlayer=o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("solid-js/web"),o=require("solid-js"),f=require("./compiler.cjs"),t=o.createContext(),M=e=>{const a=(n,r)=>{if(e.renderMarkdown)return e.renderMarkdown(n,r);const c=r&&typeof r=="object"&&("components"in r||"wrapper"in r||"forceBlock"in r||"preserveFrontmatter"in r||"tagfilter"in r),{components:l,wrapper:i,forceBlock:w,preserveFrontmatter:d,tagfilter:s,...m}=c?r:{components:r},u=l||m,k={forceBlock:w??e.forceBlock,preserveFrontmatter:d??e.preserveFrontmatter,tagfilter:s??e.tagfilter,wrapper:i||e.wrapper,components:{...e.components,...u}};return f.compileMarkdown(n,k)};return p.createComponent(t.Provider,{value:{renderMarkdown:a},get children(){return e.children}})},g=()=>{const e=o.useContext(t);if(!e)throw new Error("useMarkdown must be used within a MarkdownProvider. To fix this error, wrap your component with <MarkdownProvider>.");return e};exports.MarkdownContext=t;exports.MarkdownProvider=M;exports.useMarkdown=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("solid-js/web"),d=require("solid-js"),u=require("./compiler.cjs"),n=d.createContext(),k=e=>{const c=(o,r,a,t)=>{if(e.renderMarkdown)return e.renderMarkdown(o,r,a,t);const w={forceBlock:r?.forceBlock??e.forceBlock,preserveFrontmatter:r?.preserveFrontmatter??e.preserveFrontmatter,tagfilter:r?.tagfilter??e.tagfilter,wrapper:t||e.wrapper,forceWrapper:!!(t||e.wrapper),components:{...e.components,...a??{}}};return u.compileMarkdown(o,w)};return i.createComponent(n.Provider,{get value(){return{components:e.components,renderMarkdown:c}},get children(){return e.children}})},l=()=>{const e=d.useContext(n);if(!e)throw new Error("useMarkdown must be used within a MarkdownProvider. To fix this error, wrap your component with <MarkdownProvider>.");return e};exports.MarkdownContext=n;exports.MarkdownProvider=k;exports.useMarkdown=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("@intlayer/core/dictionaryManipulator"),l=require("@intlayer/core/markdown"),n=require("solid-js"),o=require("../editor/useEditedContentRenderer.cjs"),m=require("./compiler.cjs"),a=require("./MarkdownProvider.cjs"),c=(e,r={})=>m.compileMarkdown(e,r),h=(e={})=>{const r=n.useContext(a.MarkdownContext);return t=>r?r.renderMarkdown(t,e):c(t,e)},C=e=>{const{renderMarkdown:r}=a.useMarkdown(),t=n.createMemo(()=>o.useEditedContentRenderer({dictionaryKey:e.dictionaryKey,keyPath:e.keyPath,children:e.children})),d=()=>typeof t()=="string"?t():e.children,{dictionaryKey:P,keyPath:K,locale:g,children:q,components:i,wrapper:k,forceBlock:s,preserveFrontmatter:M,tagfilter:u,...y}=e;return r(d(),{components:i,wrapper:k,forceBlock:s,preserveFrontmatter:M,tagfilter:u,...y})},R=e=>{const r=n.createMemo(()=>o.useEditedContentRenderer({dictionaryKey:e.dictionaryKey,keyPath:e.keyPath,children:e.children})),t=n.createMemo(()=>l.getMarkdownMetadata(r()));return n.createMemo(()=>w.getContentNodeByKeyPath(t(),e.metadataKeyPath))()};exports.MarkdownMetadataRenderer=R;exports.MarkdownRenderer=C;exports.renderMarkdown=c;exports.useMarkdownRenderer=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@intlayer/core/dictionaryManipulator"),k=require("@intlayer/core/markdown"),n=require("solid-js"),d=require("../editor/useEditedContentRenderer.cjs"),M=require("./compiler.cjs"),a=require("./MarkdownProvider.cjs"),c=(e,t={})=>M.compileMarkdown(e,t),u=(e={})=>{const t=n.useContext(a.MarkdownContext);return r=>t?t.renderMarkdown(r,{forceBlock:e.forceBlock,preserveFrontmatter:e.preserveFrontmatter,tagfilter:e.tagfilter},e.components,e.wrapper):c(r,e)},l=e=>{const t=n.useContext(a.MarkdownContext),{renderMarkdown:r}=a.useMarkdown(),o=n.createMemo(()=>d.useEditedContentRenderer({dictionaryKey:e.dictionaryKey,keyPath:e.keyPath,children:e.children}));return r(typeof o()=="string"?o():e.children,{forceBlock:e.forceBlock,preserveFrontmatter:e.preserveFrontmatter,tagfilter:e.tagfilter},{...t?.components??{},...e.components??{}},e.wrapper)},s=e=>{const t=n.createMemo(()=>d.useEditedContentRenderer({dictionaryKey:e.dictionaryKey,keyPath:e.keyPath,children:e.children})),r=n.createMemo(()=>k.getMarkdownMetadata(t()));return n.createMemo(()=>i.getContentNodeByKeyPath(r(),e.metadataKeyPath))()};exports.MarkdownMetadataRenderer=s;exports.MarkdownRenderer=l;exports.renderMarkdown=c;exports.useMarkdownRenderer=u;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("solid-js/web");require("@intlayer/core/interpreter");require("@intlayer/core/markdown");require("@intlayer/core/transpiler");require("@intlayer/types");const e=require("../plugins-BNX3Lsth.js");require("./editor/useEditedContentRenderer.cjs");require("./IntlayerNode.cjs");require("./markdown/MarkdownProvider.cjs");require("./markdown/MarkdownRenderer.cjs");require("./solidElement/renderSolidElement.cjs");exports.htmlPlugin=e.htmlPlugin;exports.insertionPlugin=e.insertionPlugin;exports.intlayerNodePlugins=e.intlayerNodePlugins;exports.markdownPlugin=e.markdownPlugin;exports.markdownStringPlugin=e.markdownStringPlugin;exports.solidNodePlugins=e.solidNodePlugins;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("solid-js/web");require("@intlayer/core/interpreter");require("@intlayer/core/markdown");require("@intlayer/core/transpiler");require("@intlayer/types/nodeType");const e=require("../plugins-Da2V8QmE.js");require("./editor/useEditedContentRenderer.cjs");require("./IntlayerNode.cjs");require("./markdown/MarkdownProvider.cjs");require("./markdown/MarkdownRenderer.cjs");require("./solidElement/renderSolidElement.cjs");exports.htmlPlugin=e.htmlPlugin;exports.insertionPlugin=e.insertionPlugin;exports.intlayerNodePlugins=e.intlayerNodePlugins;exports.markdownPlugin=e.markdownPlugin;exports.markdownStringPlugin=e.markdownStringPlugin;exports.solidNodePlugins=e.solidNodePlugins;
@@ -1,7 +1,8 @@
1
1
  import s from "@intlayer/config/built";
2
- import { localeDetector as u, getLocaleFromStorage as m } from "@intlayer/core/localization";
3
- import { Locales as p } from "@intlayer/types";
4
- var v = /* @__PURE__ */ ((e) => (e.Querystring = "querystring", e.Storage = "storage", e.Navigator = "navigator", e.HtmlTag = "htmlTag", e))(v || {});
2
+ import { localeDetector as u } from "@intlayer/core/localization";
3
+ import { getLocaleFromStorage as m } from "@intlayer/core/utils";
4
+ import * as p from "@intlayer/types/locales";
5
+ var v = /* @__PURE__ */ ((o) => (o.Querystring = "querystring", o.Storage = "storage", o.Navigator = "navigator", o.HtmlTag = "htmlTag", o))(v || {});
5
6
  const h = () => ({
6
7
  order: [
7
8
  "querystring",
@@ -12,7 +13,7 @@ const h = () => ({
12
13
  ],
13
14
  lookupQuerystring: "locale",
14
15
  htmlTag: typeof document < "u" ? document.documentElement : null
15
- }), y = (e, a) => {
16
+ }), y = (o, a) => {
16
17
  const r = {}, d = {
17
18
  querystring: () => {
18
19
  if (typeof window > "u") return;
@@ -22,23 +23,23 @@ const h = () => ({
22
23
  storage: () => {
23
24
  if (typeof window > "u") return;
24
25
  const t = m({
25
- getCookie: (o) => {
26
+ getCookie: (e) => {
26
27
  try {
27
- const n = document.cookie.split(";"), i = `${o}=`, g = n.find((f) => f.trim().startsWith(i));
28
+ const n = document.cookie.split(";"), i = `${e}=`, g = n.find((f) => f.trim().startsWith(i));
28
29
  if (g)
29
30
  return g.split("=")[1].trim();
30
31
  } catch {
31
32
  }
32
33
  },
33
- getSessionStorage: (o) => {
34
+ getSessionStorage: (e) => {
34
35
  try {
35
- return window.sessionStorage.getItem(o) ?? void 0;
36
+ return window.sessionStorage.getItem(e) ?? void 0;
36
37
  } catch {
37
38
  }
38
39
  },
39
- getLocaleStorage: (o) => {
40
+ getLocaleStorage: (e) => {
40
41
  try {
41
- return window.localStorage.getItem(o) ?? void 0;
42
+ return window.localStorage.getItem(e) ?? void 0;
42
43
  } catch {
43
44
  }
44
45
  }
@@ -49,43 +50,43 @@ const h = () => ({
49
50
  if (typeof navigator > "u") return;
50
51
  const {
51
52
  internationalization: t
52
- } = s, o = navigator.languages ?? [navigator.language], n = u({
53
- "accept-language": o.join(",")
53
+ } = s, e = navigator.languages ?? [navigator.language], n = u({
54
+ "accept-language": e.join(",")
54
55
  }, t.locales, t.defaultLocale);
55
56
  n && (r.navigator = n);
56
57
  },
57
58
  htmlTag: () => {
58
59
  const t = a.htmlTag;
59
60
  if (t && typeof t.getAttribute == "function") {
60
- const o = t.getAttribute("lang");
61
- if (o) {
61
+ const e = t.getAttribute("lang");
62
+ if (e) {
62
63
  const {
63
64
  internationalization: n
64
65
  } = s, i = u({
65
- "accept-language": o
66
+ "accept-language": e
66
67
  }, n.locales, n.defaultLocale);
67
68
  r.htmlTag = i;
68
69
  }
69
70
  }
70
71
  }
71
72
  };
72
- return e.forEach((t) => {
73
+ return o.forEach((t) => {
73
74
  d[t]?.();
74
75
  }), r;
75
- }, w = (e, a) => {
76
+ }, w = (o, a) => {
76
77
  const {
77
78
  internationalization: r
78
79
  } = s;
79
80
  for (const l of a) {
80
- const c = e[l];
81
+ const c = o[l];
81
82
  if (c && r.locales.includes(c))
82
83
  return c;
83
84
  }
84
85
  return r?.defaultLocale ?? p.ENGLISH;
85
- }, q = (e = {}) => {
86
+ }, q = (o = {}) => {
86
87
  const a = {
87
88
  ...h(),
88
- ...e
89
+ ...o
89
90
  }, r = y(a.order ?? [], a);
90
91
  return w(r, a.order ?? []);
91
92
  };
@@ -1,13 +1,14 @@
1
1
  import "solid-js/web";
2
2
  import "@intlayer/core/utils";
3
- import "@intlayer/types";
3
+ import "@intlayer/types/nodeType";
4
4
  import "solid-js";
5
5
  import "@intlayer/core/formatters";
6
6
  import "../client/IntlayerProvider.mjs";
7
7
  import "@intlayer/config/built";
8
8
  import "@intlayer/core/localization";
9
+ import "@intlayer/types/locales";
9
10
  import "@intlayer/core/interpreter";
10
- import { C as j } from "../../plugins-BDLeP00w.mjs";
11
+ import { C as k } from "../../plugins-qgberWhD.mjs";
11
12
  import "../client/useLocaleStorage.mjs";
12
13
  import "../client/useLocaleBase.mjs";
13
14
  import "../UI/ContentSelector.mjs";
@@ -19,5 +20,5 @@ import "./contexts/EditorEnabledContext.mjs";
19
20
  import "./contexts/CommunicatorContext.mjs";
20
21
  import "./contexts/FocusDictionaryContext.mjs";
21
22
  export {
22
- j as ContentSelectorRenderer
23
+ k as ContentSelectorRenderer
23
24
  };
@@ -1,7 +1,7 @@
1
1
  import { createComponent as h } from "solid-js/web";
2
2
  import { getContentNodeByKeyPath as f, renameContentNodeByKeyPath as j, editDictionaryByKeyPath as B } from "@intlayer/core/dictionaryManipulator";
3
3
  import { MessageKey as m } from "@intlayer/editor";
4
- import { NodeType as T } from "@intlayer/types";
4
+ import { NodeType as T } from "@intlayer/types/nodeType";
5
5
  import { createContext as g, useContext as p } from "solid-js";
6
6
  import { useDictionariesRecord as H } from "./DictionariesRecordContext.mjs";
7
7
  import { useCrossFrameMessageListener as _ } from "./useCrossFrameMessageListener.mjs";
@@ -1,4 +1,4 @@
1
- import { C as o } from "../../plugins-BDLeP00w.mjs";
1
+ import { C as o } from "../../plugins-qgberWhD.mjs";
2
2
  export {
3
3
  o as ContentSelectorRenderer
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import { getDictionary as s } from "@intlayer/core/interpreter";
2
- import { i as r, s as a, a as e, m as g, h as l } from "../plugins-BDLeP00w.mjs";
2
+ import { i as r, s as a, a as e, m as g, h as l } from "../plugins-qgberWhD.mjs";
3
3
  const c = (i, n, o) => {
4
4
  const t = [
5
5
  r,
@@ -1,5 +1,5 @@
1
1
  import { getIntlayer as r } from "@intlayer/core/interpreter";
2
- import { i as a, s as e, a as l, m as o, h as g } from "../plugins-BDLeP00w.mjs";
2
+ import { i as a, s as e, a as l, m as o, h as g } from "../plugins-qgberWhD.mjs";
3
3
  const P = (n, t, s) => {
4
4
  const i = [
5
5
  a,
@@ -1,47 +1,42 @@
1
- import { createComponent as k } from "solid-js/web";
2
- import { createContext as s, useContext as u } from "solid-js";
3
- import { compileMarkdown as M } from "./compiler.mjs";
4
- const o = s(), x = (r) => {
5
- const n = (e, t) => {
1
+ import { createComponent as m } from "solid-js/web";
2
+ import { createContext as w, useContext as i } from "solid-js";
3
+ import { compileMarkdown as f } from "./compiler.mjs";
4
+ const a = w(), M = (r) => {
5
+ const c = (n, e, o, t) => {
6
6
  if (r.renderMarkdown)
7
- return r.renderMarkdown(e, t);
8
- const a = t && typeof t == "object" && ("components" in t || "wrapper" in t || "forceBlock" in t || "preserveFrontmatter" in t || "tagfilter" in t), {
9
- components: c,
10
- wrapper: m,
11
- forceBlock: l,
12
- preserveFrontmatter: i,
13
- tagfilter: w,
14
- ...p
15
- } = a ? t : {
16
- components: t
17
- }, f = c || p, d = {
18
- forceBlock: l ?? r.forceBlock,
19
- preserveFrontmatter: i ?? r.preserveFrontmatter,
20
- tagfilter: w ?? r.tagfilter,
21
- wrapper: m || r.wrapper,
7
+ return r.renderMarkdown(n, e, o, t);
8
+ const d = {
9
+ forceBlock: e?.forceBlock ?? r.forceBlock,
10
+ preserveFrontmatter: e?.preserveFrontmatter ?? r.preserveFrontmatter,
11
+ tagfilter: e?.tagfilter ?? r.tagfilter,
12
+ wrapper: t || r.wrapper,
13
+ forceWrapper: !!(t || r.wrapper),
22
14
  components: {
23
15
  ...r.components,
24
- ...f
16
+ ...o ?? {}
25
17
  }
26
18
  };
27
- return M(e, d);
19
+ return f(n, d);
28
20
  };
29
- return k(o.Provider, {
30
- value: {
31
- renderMarkdown: n
21
+ return m(a.Provider, {
22
+ get value() {
23
+ return {
24
+ components: r.components,
25
+ renderMarkdown: c
26
+ };
32
27
  },
33
28
  get children() {
34
29
  return r.children;
35
30
  }
36
31
  });
37
- }, C = () => {
38
- const r = u(o);
32
+ }, s = () => {
33
+ const r = i(a);
39
34
  if (!r)
40
35
  throw new Error("useMarkdown must be used within a MarkdownProvider. To fix this error, wrap your component with <MarkdownProvider>.");
41
36
  return r;
42
37
  };
43
38
  export {
44
- o as MarkdownContext,
45
- x as MarkdownProvider,
46
- C as useMarkdown
39
+ a as MarkdownContext,
40
+ M as MarkdownProvider,
41
+ s as useMarkdown
47
42
  };
@@ -1,50 +1,43 @@
1
- import { getContentNodeByKeyPath as M } from "@intlayer/core/dictionaryManipulator";
2
- import { getMarkdownMetadata as h } from "@intlayer/core/markdown";
3
- import { createMemo as n, useContext as l } from "solid-js";
4
- import { useEditedContentRenderer as a } from "../editor/useEditedContentRenderer.mjs";
5
- import { compileMarkdown as s } from "./compiler.mjs";
6
- import { useMarkdown as w, MarkdownContext as f } from "./MarkdownProvider.mjs";
7
- const u = (e, t = {}) => s(e, t), N = (e = {}) => {
8
- const t = l(f);
9
- return (r) => t ? t.renderMarkdown(r, e) : u(r, e);
10
- }, T = (e) => {
11
- const {
12
- renderMarkdown: t
13
- } = w(), r = n(() => a({
1
+ import { getContentNodeByKeyPath as m } from "@intlayer/core/dictionaryManipulator";
2
+ import { getMarkdownMetadata as i } from "@intlayer/core/markdown";
3
+ import { useContext as a, createMemo as n } from "solid-js";
4
+ import { useEditedContentRenderer as d } from "../editor/useEditedContentRenderer.mjs";
5
+ import { compileMarkdown as k } from "./compiler.mjs";
6
+ import { MarkdownContext as c, useMarkdown as f } from "./MarkdownProvider.mjs";
7
+ const l = (e, t = {}) => k(e, t), g = (e = {}) => {
8
+ const t = a(c);
9
+ return (r) => t ? t.renderMarkdown(r, {
10
+ forceBlock: e.forceBlock,
11
+ preserveFrontmatter: e.preserveFrontmatter,
12
+ tagfilter: e.tagfilter
13
+ }, e.components, e.wrapper) : l(r, e);
14
+ }, x = (e) => {
15
+ const t = a(c), {
16
+ renderMarkdown: r
17
+ } = f(), o = n(() => d({
14
18
  dictionaryKey: e.dictionaryKey,
15
19
  keyPath: e.keyPath,
16
20
  children: e.children
17
- })), o = () => typeof r() == "string" ? r() : e.children, {
18
- dictionaryKey: C,
19
- keyPath: K,
20
- locale: P,
21
- children: x,
22
- components: d,
23
- wrapper: c,
24
- forceBlock: i,
25
- preserveFrontmatter: m,
26
- tagfilter: y,
27
- ...k
28
- } = e;
29
- return t(o(), {
30
- components: d,
31
- wrapper: c,
32
- forceBlock: i,
33
- preserveFrontmatter: m,
34
- tagfilter: y,
35
- ...k
36
- });
37
- }, b = (e) => {
38
- const t = n(() => a({
21
+ }));
22
+ return r(typeof o() == "string" ? o() : e.children, {
23
+ forceBlock: e.forceBlock,
24
+ preserveFrontmatter: e.preserveFrontmatter,
25
+ tagfilter: e.tagfilter
26
+ }, {
27
+ ...t?.components ?? {},
28
+ ...e.components ?? {}
29
+ }, e.wrapper);
30
+ }, K = (e) => {
31
+ const t = n(() => d({
39
32
  dictionaryKey: e.dictionaryKey,
40
33
  keyPath: e.keyPath,
41
34
  children: e.children
42
- })), r = n(() => h(t()));
43
- return n(() => M(r(), e.metadataKeyPath))();
35
+ })), r = n(() => i(t()));
36
+ return n(() => m(r(), e.metadataKeyPath))();
44
37
  };
45
38
  export {
46
- b as MarkdownMetadataRenderer,
47
- T as MarkdownRenderer,
48
- u as renderMarkdown,
49
- N as useMarkdownRenderer
39
+ K as MarkdownMetadataRenderer,
40
+ x as MarkdownRenderer,
41
+ l as renderMarkdown,
42
+ g as useMarkdownRenderer
50
43
  };
@@ -2,8 +2,8 @@ import "solid-js/web";
2
2
  import "@intlayer/core/interpreter";
3
3
  import "@intlayer/core/markdown";
4
4
  import "@intlayer/core/transpiler";
5
- import "@intlayer/types";
6
- import { h as P, a as d, i as e, m as h, b as k, s as w } from "../plugins-BDLeP00w.mjs";
5
+ import "@intlayer/types/nodeType";
6
+ import { h as P, a as d, i as e, m as h, b as k, s as w } from "../plugins-qgberWhD.mjs";
7
7
  import "./editor/useEditedContentRenderer.mjs";
8
8
  import "./IntlayerNode.mjs";
9
9
  import "./markdown/MarkdownProvider.mjs";
@@ -0,0 +1 @@
1
+ "use strict";const r=require("solid-js/web"),h=require("@intlayer/core/interpreter"),w=require("@intlayer/core/markdown"),T=require("@intlayer/core/transpiler"),d=require("@intlayer/types/nodeType"),N=require("@intlayer/core/utils"),f=require("solid-js");require("@intlayer/core/formatters");const M=require("./cjs/client/IntlayerProvider.cjs");require("@intlayer/config/built");require("@intlayer/core/localization");require("@intlayer/types/locales");const S=require("./cjs/editor/useEditedContentRenderer.cjs"),m=require("./cjs/IntlayerNode.cjs");require("./cjs/markdown/MarkdownProvider.cjs");const P=require("./cjs/markdown/MarkdownRenderer.cjs"),H=require("./cjs/solidElement/renderSolidElement.cjs");require("./cjs/client/useLocaleStorage.cjs");require("./cjs/client/useLocaleBase.cjs");const I=require("./cjs/UI/ContentSelector.cjs");require("@intlayer/editor");require("./cjs/editor/contexts/ConfigurationContext.cjs");require("./cjs/editor/contexts/DictionariesRecordContext.cjs");require("./cjs/editor/contexts/EditedContentContext.cjs");const b=require("./cjs/editor/contexts/EditorEnabledContext.cjs");require("./cjs/editor/contexts/CommunicatorContext.cjs");const K=require("./cjs/editor/contexts/FocusDictionaryContext.cjs"),_=e=>{const{focusedContent:n,setFocusedContent:t}=K.useFocusDictionary(),l=f.createMemo(()=>e.keyPath.filter(a=>a.type!==d.NodeType.Translation)),o=()=>t({dictionaryKey:e.dictionaryKey,keyPath:l()}),c=f.createMemo(()=>(n?.dictionaryKey===e.dictionaryKey&&(n?.keyPath?.length??0)>0&&N.isSameKeyPath(n?.keyPath??[],l()))??!1);return r.createComponent(I.ContentSelector,{onPress:o,get isSelecting(){return c()},get children(){return e.children}})},y=e=>{const{enabled:n}=b.useEditorEnabled(),{disableEditor:t}=M.useIntlayerContext();return n()&&!t?r.createComponent(_,r.mergeProps(e,{get children(){return e.children}})):e.children},E={id:"intlayer-node-plugin",canHandle:e=>typeof e=="bigint"||typeof e=="string"||typeof e=="number",transform:(e,{plugins:n,...t})=>m.renderIntlayerNode({...t,value:t.children,children:r.createComponent(y,r.mergeProps(t,{get children(){return r.createComponent(S.EditedContentRenderer,r.mergeProps(t,{get children(){return t.children}}))}}))})},R={id:"solid-node-plugin",canHandle:e=>typeof e=="object"&&e?.props!==void 0||typeof Node<"u"&&e instanceof Node,transform:(e,{plugins:n,...t})=>m.renderIntlayerNode({...t,value:"[[solid-element]]",children:r.createComponent(y,r.mergeProps(t,{get children(){return typeof Node<"u"&&e instanceof Node?e:H.renderSolidElement(e)}}))})},v=(e,n)=>{const t=h.splitInsertionTemplate(e,n);return t.isSimple,t.parts},x={id:"insertion-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===d.NodeType.Insertion,transform:(e,n,t)=>{const l=[...n.keyPath,{type:d.NodeType.Insertion}],o=e[d.NodeType.Insertion];return t(o,{...n,children:o,keyPath:l,plugins:[{id:"insertion-string-plugin",canHandle:a=>typeof a=="string",transform:(a,u,g)=>{const p=g(a,{...u,children:a,plugins:[...(n.plugins??[]).filter(i=>i.id!=="intlayer-node-plugin")]});return i=>{const s=v(p,i);return g(s,{...u,plugins:n.plugins,children:s})}}},...n.plugins??[]]})}},q={id:"markdown-string-plugin",canHandle:e=>typeof e=="string",transform:(e,n,t)=>{const{plugins:l,...o}=n,c=w.getMarkdownMetadata(e),u=t(c,{plugins:[{id:"markdown-metadata-plugin",canHandle:i=>typeof i=="string"||typeof i=="number"||typeof i=="boolean"||!i,transform:(i,s)=>m.renderIntlayerNode({...s,value:i,children:r.createComponent(y,r.mergeProps(o,{get children(){return r.createComponent(P.MarkdownMetadataRenderer,r.mergeProps(o,{get metadataKeyPath(){return s.keyPath},children:e}))}}))})}],dictionaryKey:o.dictionaryKey,keyPath:[]}),g=i=>m.renderIntlayerNode({...n,value:e,children:r.createComponent(y,r.mergeProps(o,{get children(){return r.createComponent(P.MarkdownRenderer,r.mergeProps(o,{components:i,children:e}))}})),additionalProps:{metadata:u}}),p=g();return new Proxy(p,{get(i,s,k){return s==="value"?e:s==="metadata"?u:s==="use"?C=>g(C):Reflect.get(i,s,k)}})}},L={id:"markdown-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===d.NodeType.Markdown,transform:(e,n,t)=>{const l=[...n.keyPath,{type:d.NodeType.Markdown}],o=e[d.NodeType.Markdown];return t(o,{...n,children:o,keyPath:l,plugins:[q,...n.plugins??[]]})}},j=()=>{const e={};for(const n of T.HTML_TAGS)e[n]=({children:t,...l})=>r.createComponent(r.Dynamic,r.mergeProps({component:n},l,{children:t}));return e},D=j(),F={id:"html-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===d.NodeType.HTML,transform:e=>{const n=e[d.NodeType.HTML],t=c=>{const a={...D,...c};return h.getHTML(n,a)},o=[t()];return new Proxy(o,{get(c,a,u){return a==="value"?n:a==="use"?g=>t(g):Reflect.get(c,a,u)}})}};exports.ContentSelectorRenderer=y;exports.htmlPlugin=F;exports.insertionPlugin=x;exports.intlayerNodePlugins=E;exports.markdownPlugin=L;exports.markdownStringPlugin=q;exports.solidNodePlugins=R;
@@ -2,13 +2,14 @@ import { createComponent as s, mergeProps as c, Dynamic as w } from "solid-js/we
2
2
  import { getHTML as M, splitInsertionTemplate as H } from "@intlayer/core/interpreter";
3
3
  import { getMarkdownMetadata as C } from "@intlayer/core/markdown";
4
4
  import { HTML_TAGS as S } from "@intlayer/core/transpiler";
5
- import { NodeType as d } from "@intlayer/types";
5
+ import { NodeType as d } from "@intlayer/types/nodeType";
6
6
  import { isSameKeyPath as T } from "@intlayer/core/utils";
7
7
  import { createMemo as h } from "solid-js";
8
8
  import "@intlayer/core/formatters";
9
9
  import { useIntlayerContext as b } from "./esm/client/IntlayerProvider.mjs";
10
10
  import "@intlayer/config/built";
11
11
  import "@intlayer/core/localization";
12
+ import "@intlayer/types/locales";
12
13
  import { EditedContentRenderer as K } from "./esm/editor/useEditedContentRenderer.mjs";
13
14
  import { renderIntlayerNode as f } from "./esm/IntlayerNode.mjs";
14
15
  import "./esm/markdown/MarkdownProvider.mjs";
@@ -52,7 +53,7 @@ const j = (e) => {
52
53
  return e.children;
53
54
  }
54
55
  })) : e.children;
55
- }, me = {
56
+ }, ue = {
56
57
  id: "intlayer-node-plugin",
57
58
  canHandle: (e) => typeof e == "bigint" || typeof e == "string" || typeof e == "number",
58
59
  transform: (e, {
@@ -72,7 +73,7 @@ const j = (e) => {
72
73
  }
73
74
  }))
74
75
  })
75
- }, ue = {
76
+ }, ge = {
76
77
  id: "solid-node-plugin",
77
78
  canHandle: (e) => typeof e == "object" && e?.props !== void 0 || typeof Node < "u" && e instanceof Node,
78
79
  transform: (e, {
@@ -91,7 +92,7 @@ const j = (e) => {
91
92
  }, x = (e, t) => {
92
93
  const n = H(e, t);
93
94
  return n.isSimple, n.parts;
94
- }, ge = {
95
+ }, fe = {
95
96
  id: "insertion-plugin",
96
97
  canHandle: (e) => typeof e == "object" && e?.nodeType === d.Insertion,
97
98
  transform: (e, t, n) => {
@@ -157,7 +158,8 @@ const j = (e) => {
157
158
  value: e,
158
159
  children: s(y, c(r, {
159
160
  get children() {
160
- return s(I, c(r, i, {
161
+ return s(I, c(r, {
162
+ components: i,
161
163
  children: e
162
164
  }));
163
165
  }
@@ -172,7 +174,7 @@ const j = (e) => {
172
174
  }
173
175
  });
174
176
  }
175
- }, fe = {
177
+ }, ye = {
176
178
  id: "markdown-plugin",
177
179
  canHandle: (e) => typeof e == "object" && e?.nodeType === d.Markdown,
178
180
  transform: (e, t, n) => {
@@ -198,7 +200,7 @@ const j = (e) => {
198
200
  children: n
199
201
  }));
200
202
  return e;
201
- }, F = A(), ye = {
203
+ }, F = A(), pe = {
202
204
  id: "html-plugin",
203
205
  canHandle: (e) => typeof e == "object" && e?.nodeType === d.HTML,
204
206
  transform: (e) => {
@@ -218,10 +220,10 @@ const j = (e) => {
218
220
  };
219
221
  export {
220
222
  y as C,
221
- ge as a,
223
+ fe as a,
222
224
  D as b,
223
- ye as h,
224
- me as i,
225
- fe as m,
226
- ue as s
225
+ pe as h,
226
+ ue as i,
227
+ ye as m,
228
+ ge as s
227
229
  };
@@ -1,4 +1,4 @@
1
- import { LocalesValues } from '@intlayer/types';
1
+ import { LocalesValues } from '@intlayer/types/module_augmentation';
2
2
  import { Component, ParentProps } from 'solid-js';
3
3
  type IntlayerValue = {
4
4
  locale: () => LocalesValues;
@@ -1,4 +1,4 @@
1
- import { LocalesValues } from '@intlayer/types';
1
+ import { LocalesValues } from '@intlayer/types/module_augmentation';
2
2
  /**
3
3
  * Solid client hook that provides a locale-bound `Intl` object.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { Locale } from '@intlayer/types';
1
+ import { Locale } from '@intlayer/types/allLocales';
2
2
  export declare enum LanguageDetector {
3
3
  Querystring = "querystring",
4
4
  Storage = "storage",
@@ -1,4 +1,4 @@
1
- import { LocalesValues, StrictModeLocaleMap } from '@intlayer/types';
1
+ import { LocalesValues, StrictModeLocaleMap } from '@intlayer/types/module_augmentation';
2
2
  /**
3
3
  * On the client side, this function returns the translation of the provided multilang content.
4
4
  *
@@ -1,9 +1,9 @@
1
- import { StrictModeLocaleMap } from '@intlayer/types';
1
+ import { StrictModeLocaleMap } from '@intlayer/types/module_augmentation';
2
2
  /**
3
3
  * On the client side, hook to get the translation content based on the locale
4
4
  */
5
5
  export declare const useContent: <Content>(languageContent: StrictModeLocaleMap<Content>) => {
6
- locale: import('@intlayer/types').Locale;
6
+ locale: import('intlayer').Locale;
7
7
  content: Content;
8
8
  t: <Content_1 = string>(languageContent: StrictModeLocaleMap<Content_1>) => Content_1;
9
9
  };
@@ -1,4 +1,5 @@
1
- import { DeclaredLocales, Dictionary, LocalesValues } from '@intlayer/types';
1
+ import { DeclaredLocales, LocalesValues } from '@intlayer/types/module_augmentation';
2
+ import { Dictionary } from '@intlayer/types/dictionary';
2
3
  import { Accessor } from 'solid-js';
3
4
  import { DeepTransformContent } from '../plugins';
4
5
  /**
@@ -1,4 +1,5 @@
1
- import { DeclaredLocales, Dictionary, LocalesValues, StrictModeLocaleMap } from '@intlayer/types';
1
+ import { DeclaredLocales, LocalesValues, StrictModeLocaleMap } from '@intlayer/types/module_augmentation';
2
+ import { Dictionary } from '@intlayer/types/dictionary';
2
3
  /**
3
4
  * On the server side, Hook that transform a dictionary and return the content
4
5
  *
@@ -1,7 +1,8 @@
1
- import { Dictionary, DictionaryKeys, LocalesValues, StrictModeLocaleMap } from '@intlayer/types';
1
+ import { Dictionary } from '@intlayer/types/dictionary';
2
+ import { DictionaryKeys, LocalesValues, StrictModeLocaleMap } from '@intlayer/types/module_augmentation';
2
3
  /**
3
4
  * On the server side, Hook that transform a dictionary and return the content
4
5
  *
5
6
  * If the locale is not provided, it will use the locale from the client context
6
7
  */
7
- export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => import('solid-js').Accessor<import('@intlayer/core/interpreter').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState, (string & {}) | "af" | "af-ZA" | "ar" | "ar-AE" | "ar-BH" | "ar-DZ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MA" | "ar-OM" | "ar-QA" | "ar-SA" | "ar-SY" | "ar-TN" | "ar-YE" | "az" | "az-AZ" | "be" | "be-BY" | "bg" | "bg-BG" | "bs" | "bs-BA" | "ca" | "ca-ES" | "cs" | "cs-CZ" | "cy" | "cy-GB" | "da" | "da-DK" | "de" | "de-AT" | "de-CH" | "de-DE" | "de-LI" | "de-LU" | "dv" | "dv-MV" | "el" | "el-GR" | "en" | "en-AU" | "en-BZ" | "en-CA" | "en-CB" | "en-GB" | "en-IE" | "en-JM" | "en-NZ" | "en-PH" | "en-TT" | "en-US" | "en-ZA" | "en-ZW" | "eo" | "es" | "es-AR" | "es-BO" | "es-CL" | "es-CO" | "es-CR" | "es-DO" | "es-EC" | "es-ES" | "es-GT" | "es-HN" | "es-MX" | "es-NI" | "es-PA" | "es-PE" | "es-PR" | "es-PY" | "es-SV" | "es-UY" | "es-VE" | "et" | "et-EE" | "eu" | "eu-ES" | "fa" | "fa-IR" | "fi" | "fi-FI" | "fo" | "fo-FO" | "fr" | "fr-BE" | "fr-CA" | "fr-CH" | "fr-FR" | "fr-LU" | "fr-MC" | "ga" | "ga-IE" | "gd" | "gd-GB" | "gl" | "gl-ES" | "gu" | "gu-IN" | "he" | "he-IL" | "hi" | "hi-IN" | "hr" | "hr-BA" | "hr-HR" | "hu" | "hu-HU" | "hy" | "hy-AM" | "id" | "id-ID" | "is" | "is-IS" | "it" | "it-CH" | "it-IT" | "ja" | "ja-JP" | "ka" | "ka-GE" | "kk" | "kk-KZ" | "kn" | "kn-IN" | "ko" | "ko-KR" | "kok" | "kok-IN" | "ku" | "ku-TR" | "ky" | "ky-KG" | "lt" | "lt-LT" | "lv" | "lv-LV" | "mi" | "mi-NZ" | "mk" | "mk-MK" | "mn" | "mn-MN" | "mr" | "mr-IN" | "ms" | "ms-BN" | "ms-MY" | "mt" | "mt-MT" | "ml" | "ml-IN" | "no" | "nb" | "nb-NO" | "nl" | "nl-BE" | "nl-NL" | "nn" | "nn-NO" | "ns" | "ns-ZA" | "pa" | "pa-IN" | "pl" | "pl-PL" | "ps" | "ps-AR" | "pt" | "pt-BR" | "pt-PT" | "qu" | "qu-BO" | "qu-EC" | "qu-PE" | "ro" | "ro-RO" | "ro-MD" | "rm" | "rm-CH" | "ru" | "ru-RU" | "ru-MD" | "sa" | "sa-IN" | "se" | "se-FI" | "se-NO" | "se-SE" | "hsb" | "hsb-DE" | "dsb" | "dsb-DE" | "sk" | "sk-SK" | "sl" | "sl-SI" | "sq" | "sq-AL" | "sr" | "sr-BA" | "sr-SP" | "sv" | "sv-FI" | "sv-SE" | "sw" | "sw-KE" | "syr" | "syr-SY" | "ta" | "ta-IN" | "te" | "te-IN" | "th" | "th-TH" | "tl" | "tl-PH" | "tn" | "tn-ZA" | "tr" | "tr-TR" | "tt" | "tt-RU" | "ts" | "uk" | "uk-UA" | "ur" | "ur-PK" | "uz" | "uz-UZ" | "vi" | "vi-VN" | "ve" | "ve-ZA" | "xh" | "xh-ZA" | "zh" | "zh-Hans" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-SG" | "zh-Hant" | "zu" | "zu-ZA" | "bn" | "bn-BD" | "bn-IN" | "bn-MM" | "my" | "my-MM" | "km" | "km-KH" | "lo" | "lo-LA" | "yo" | "yo-NG" | "yi" | "yi-001" | "am" | "am-ET" | "ne" | "ne-NP" | "si" | "si-LK" | "sr-Cyrl" | "sr-RS" | "en-IN" | "en-SG" | "en-HK" | "en-NG" | "en-PK" | "en-MY" | "en-BW" | "en-KE" | "en-TZ" | "en-GH" | "en-UG" | "es-CU" | "es-US" | "pt-GW" | "pt-MZ" | "pt-ST" | "pt-CV" | "pt-TL" | "pt-MO" | "zh-TW" | "ar-MR" | "ar-PS" | "ar-SD" | "ar-DJ" | "ar-SO" | "ar-TD" | "ar-KM" | "mg-MG">>;
8
+ export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => import('solid-js').Accessor<import('@intlayer/core/interpreter').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState, (string & {}) | "af" | "af-ZA" | "sq" | "sq-AL" | "am" | "am-ET" | "ar" | "ar-DZ" | "ar-BH" | "ar-TD" | "ar-KM" | "ar-DJ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MR" | "ar-MA" | "ar-OM" | "ar-PS" | "ar-QA" | "ar-SA" | "ar-SO" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-AE" | "ar-YE" | "hy" | "hy-AM" | "az" | "az-AZ" | "eu" | "eu-ES" | "be" | "be-BY" | "bn" | "bn-BD" | "bn-IN" | "bn-MM" | "bs" | "bs-BA" | "bg" | "bg-BG" | "my" | "my-MM" | "ca" | "ca-ES" | "zh" | "zh-HK" | "zh-MO" | "zh-Hans" | "zh-CN" | "zh-SG" | "zh-TW" | "zh-Hant" | "hr" | "hr-BA" | "hr-HR" | "cs" | "cs-CZ" | "da" | "da-DK" | "dv" | "dv-MV" | "nl" | "nl-BE" | "nl-NL" | "en" | "en-AU" | "en-BZ" | "en-BW" | "en-CA" | "en-CB" | "en-GH" | "en-HK" | "en-IN" | "en-IE" | "en-JM" | "en-KE" | "en-MY" | "en-NZ" | "en-NG" | "en-PK" | "en-PH" | "en-SG" | "en-ZA" | "en-TZ" | "en-TT" | "en-UG" | "en-GB" | "en-US" | "en-ZW" | "eo" | "et" | "et-EE" | "fo" | "fo-FO" | "fa" | "fa-IR" | "fi" | "fi-FI" | "fr" | "fr-BE" | "fr-CA" | "fr-FR" | "fr-LU" | "fr-MC" | "fr-CH" | "mk" | "mk-MK" | "gl" | "gl-ES" | "ka" | "ka-GE" | "de" | "de-AT" | "de-DE" | "de-LI" | "de-LU" | "de-CH" | "el" | "el-GR" | "gu" | "gu-IN" | "he" | "he-IL" | "hi" | "hi-IN" | "hu" | "hu-HU" | "is" | "is-IS" | "id" | "id-ID" | "ga" | "ga-IE" | "it" | "it-IT" | "it-CH" | "ja" | "ja-JP" | "kn" | "kn-IN" | "kk" | "kk-KZ" | "km" | "km-KH" | "kok" | "kok-IN" | "ko" | "ko-KR" | "ku" | "ku-TR" | "ky" | "ky-KG" | "lo" | "lo-LA" | "lv" | "lv-LV" | "lt" | "lt-LT" | "dsb" | "dsb-DE" | "mg-MG" | "ms" | "ml" | "ml-IN" | "ms-BN" | "ms-MY" | "mt" | "mt-MT" | "mi" | "mi-NZ" | "mr" | "mr-IN" | "mn" | "mn-MN" | "ne" | "ne-NP" | "ns" | "ns-ZA" | "no" | "nb" | "nb-NO" | "nn" | "nn-NO" | "ps" | "ps-AR" | "pl" | "pl-PL" | "pt" | "pt-BR" | "pt-CV" | "pt-GW" | "pt-MO" | "pt-MZ" | "pt-PT" | "pt-ST" | "pt-TL" | "pa" | "pa-IN" | "qu" | "qu-BO" | "qu-EC" | "qu-PE" | "ro" | "ro-MD" | "ro-RO" | "rm" | "rm-CH" | "ru" | "ru-MD" | "ru-RU" | "se" | "se-FI" | "se-NO" | "se-SE" | "sa" | "sa-IN" | "gd" | "gd-GB" | "sr-Cyrl" | "sr-BA" | "sr-RS" | "sr" | "sr-SP" | "si" | "si-LK" | "sk" | "sk-SK" | "sl" | "sl-SI" | "es" | "es-AR" | "es-BO" | "es-CL" | "es-CO" | "es-CR" | "es-CU" | "es-DO" | "es-EC" | "es-SV" | "es-GT" | "es-HN" | "es-MX" | "es-NI" | "es-PA" | "es-PY" | "es-PE" | "es-PR" | "es-ES" | "es-US" | "es-UY" | "es-VE" | "sw" | "sw-KE" | "sv" | "sv-FI" | "sv-SE" | "syr" | "syr-SY" | "tl" | "tl-PH" | "ta" | "ta-IN" | "tt" | "tt-RU" | "te" | "te-IN" | "th" | "th-TH" | "ts" | "tn" | "tn-ZA" | "tr" | "tr-TR" | "uk" | "uk-UA" | "hsb" | "hsb-DE" | "ur" | "ur-PK" | "uz" | "uz-UZ" | "ve" | "ve-ZA" | "vi" | "vi-VN" | "cy" | "cy-GB" | "xh" | "xh-ZA" | "yi" | "yi-001" | "yo" | "yo-NG" | "zu" | "zu-ZA">>;
@@ -1,4 +1,4 @@
1
- import { DeclaredLocales, DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types';
1
+ import { DeclaredLocales, DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types/module_augmentation';
2
2
  import { Accessor } from 'solid-js';
3
3
  import { DeepTransformContent } from '../plugins';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { DeclaredLocales, LocalesValues } from '@intlayer/types';
1
+ import { DeclaredLocales, LocalesValues } from '@intlayer/types/module_augmentation';
2
2
  import { Accessor } from 'solid-js';
3
3
  type useLocaleProps = {
4
4
  isCookieEnabled?: boolean;
@@ -1,4 +1,4 @@
1
- import { DeclaredLocales, LocalesValues } from '@intlayer/types';
1
+ import { DeclaredLocales, LocalesValues } from '@intlayer/types/module_augmentation';
2
2
  type UseLocaleBaseResult = {
3
3
  locale: DeclaredLocales;
4
4
  defaultLocale: DeclaredLocales;
@@ -1,14 +1,14 @@
1
- import { LocalesValues } from '@intlayer/types';
1
+ import { LocalesValues } from '@intlayer/types/module_augmentation';
2
2
  /**
3
3
  * Get the locale cookie
4
4
  */
5
- export declare const localeInStorage: import('@intlayer/types').Locale | undefined;
5
+ export declare const localeInStorage: import('intlayer').Locale | undefined;
6
6
  /**
7
7
  * @deprecated Use localeInStorage instead
8
8
  *
9
9
  * Get the locale cookie
10
10
  */
11
- export declare const localeCookie: import('@intlayer/types').Locale | undefined;
11
+ export declare const localeCookie: import('intlayer').Locale | undefined;
12
12
  /**
13
13
  * Set the locale cookie
14
14
  */
@@ -23,7 +23,7 @@ export declare const setLocaleCookie: (locale: LocalesValues, isCookieEnabled?:
23
23
  * Hook that provides the locale storage and a function to set it
24
24
  */
25
25
  export declare const useLocaleStorage: (isCookieEnabled?: boolean) => import('solid-js').Accessor<{
26
- getLocale: () => import('@intlayer/types').Locale;
26
+ getLocale: () => import('intlayer').Locale;
27
27
  setLocale: (locale: LocalesValues) => void;
28
28
  }>;
29
29
  /**
@@ -34,6 +34,6 @@ export declare const useLocaleStorage: (isCookieEnabled?: boolean) => import('so
34
34
  * Hook that provides the locale cookie and a function to set it
35
35
  */
36
36
  export declare const useLocaleCookie: (isCookieEnabled?: boolean) => {
37
- localeCookie: import('@intlayer/types').Locale;
37
+ localeCookie: import('intlayer').Locale;
38
38
  setLocaleCookie: (locale: LocalesValues) => void;
39
39
  };
@@ -1,4 +1,4 @@
1
- import { StrictModeLocaleMap } from '@intlayer/types';
1
+ import { StrictModeLocaleMap } from '@intlayer/types/module_augmentation';
2
2
  /**
3
3
  * On the client side, Hook that picking one dictionary by its id and return the content.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { IntlayerConfig } from '@intlayer/types';
1
+ import { IntlayerConfig } from '@intlayer/types/config';
2
2
  import { Component, ParentProps } from 'solid-js';
3
3
  export declare const useConfigurationState: () => [import('solid-js').Accessor<IntlayerConfig>, (value: IntlayerConfig | ((prev: IntlayerConfig) => IntlayerConfig)) => void, () => void];
4
4
  export type ConfigurationProviderProps = ParentProps<{
@@ -1,4 +1,4 @@
1
- import { Dictionary } from '@intlayer/types';
1
+ import { Dictionary } from '@intlayer/types/dictionary';
2
2
  import { Component, ParentProps, Setter } from 'solid-js';
3
3
  export type DictionaryContent = Record<Dictionary['key'], Dictionary>;
4
4
  type DictionariesRecordActionsContextType = {
@@ -1,4 +1,6 @@
1
- import { ContentNode, Dictionary, KeyPath, LocalDictionaryId } from '@intlayer/types';
1
+ import { LocalDictionaryId } from '@intlayer/types/dictionary';
2
+ import { KeyPath } from '@intlayer/types/keyPath';
3
+ import { ContentNode, Dictionary } from 'intlayer';
2
4
  import { Component, ParentProps } from 'solid-js';
3
5
  export declare const usePostEditedContentState: <S>(onEventTriggered?: (data: S) => void) => (data?: S | undefined) => void;
4
6
  export declare const useGetEditedContentState: <S>(onEventTriggered?: (data: S) => void) => (data?: S | undefined) => void;
@@ -1,4 +1,4 @@
1
- import { KeyPath } from '@intlayer/types';
1
+ import { KeyPath } from '@intlayer/types/keyPath';
2
2
  import { Component, ParentProps, Setter } from 'solid-js';
3
3
  type DictionaryPath = string;
4
4
  export type FileContent = {
@@ -1,4 +1,5 @@
1
- import { KeyPath, Locale } from '@intlayer/types';
1
+ import { Locale } from '@intlayer/types/allLocales';
2
+ import { KeyPath } from '@intlayer/types/keyPath';
2
3
  import { Component } from 'solid-js';
3
4
  type EditedContentRendererProps = {
4
5
  dictionaryKey: string;
@@ -1,4 +1,5 @@
1
1
  import { Plugins } from '@intlayer/core/interpreter';
2
- import { DeclaredLocales, Dictionary, LocalesValues } from '@intlayer/types';
2
+ import { Dictionary } from '@intlayer/types/dictionary';
3
+ import { DeclaredLocales, LocalesValues } from '@intlayer/types/module_augmentation';
3
4
  import { DeepTransformContent } from './plugins';
4
5
  export declare const getDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L, additionalPlugins?: Plugins[]) => DeepTransformContent<T["content"], L>;
@@ -1,4 +1,4 @@
1
1
  import { Plugins } from '@intlayer/core/interpreter';
2
- import { DeclaredLocales, DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types';
2
+ import { DeclaredLocales, DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types/module_augmentation';
3
3
  import { DeepTransformContent } from './plugins';
4
4
  export declare const getIntlayer: <T extends DictionaryKeys, L extends LocalesValues = DeclaredLocales>(key: T, locale?: L, additionalPlugins?: Plugins[]) => DeepTransformContent<DictionaryRegistryContent<T>, L>;
@@ -1,4 +1,4 @@
1
- import { KeyPath } from '@intlayer/types';
1
+ import { KeyPath } from '@intlayer/types/keyPath';
2
2
  import { Component, JSX } from 'solid-js';
3
3
  import { HTMLComponents } from './types';
4
4
  type HTMLTagComponent = (props: {
@@ -1,4 +1,4 @@
1
- import { LocalesValues } from '@intlayer/types';
1
+ import { LocalesValues } from '@intlayer/types/module_augmentation';
2
2
  import { IInterpreterPluginSolid } from './plugins';
3
3
  declare module '@intlayer/core/interpreter' {
4
4
  interface IInterpreterPlugin<T, S, L extends LocalesValues> extends IInterpreterPluginSolid<T, S, L> {
@@ -1,14 +1,16 @@
1
1
  import { Component, JSXElement, ParentProps } from 'solid-js';
2
2
  import { HTMLComponents } from '../html/types';
3
- type RenderMarkdownOptions = {
4
- components?: HTMLComponents<'permissive', {}>;
5
- wrapper?: any;
3
+ export type MarkdownProviderOptions = {
4
+ /** Forces the compiler to always output content with a block-level wrapper. */
6
5
  forceBlock?: boolean;
6
+ /** Whether to preserve frontmatter in the markdown content. */
7
7
  preserveFrontmatter?: boolean;
8
+ /** Whether to use the GitHub Tag Filter. */
8
9
  tagfilter?: boolean;
9
10
  };
10
11
  type MarkdownProviderValue = {
11
- renderMarkdown: (content: string, overrides?: HTMLComponents<'permissive', {}> | RenderMarkdownOptions) => JSXElement;
12
+ components?: HTMLComponents<'permissive', {}>;
13
+ renderMarkdown: (content: string, options?: MarkdownProviderOptions, components?: HTMLComponents<'permissive', {}>, wrapper?: any) => JSXElement;
12
14
  };
13
15
  export declare const MarkdownContext: import('solid-js').Context<MarkdownProviderValue | undefined>;
14
16
  export type MarkdownProviderProps = ParentProps<{
@@ -17,7 +19,7 @@ export type MarkdownProviderProps = ParentProps<{
17
19
  forceBlock?: boolean;
18
20
  preserveFrontmatter?: boolean;
19
21
  tagfilter?: boolean;
20
- renderMarkdown?: (content: string, overrides?: HTMLComponents<'permissive', {}> | RenderMarkdownOptions) => JSXElement;
22
+ renderMarkdown?: (content: string, options?: MarkdownProviderOptions, components?: HTMLComponents<'permissive', {}>, wrapper?: any) => JSXElement;
21
23
  }>;
22
24
  export declare const MarkdownProvider: Component<MarkdownProviderProps>;
23
25
  export declare const useMarkdown: () => MarkdownProviderValue;
@@ -1,4 +1,5 @@
1
- import { KeyPath, LocalesValues } from '@intlayer/types';
1
+ import { KeyPath } from '@intlayer/types/keyPath';
2
+ import { LocalesValues } from '@intlayer/types/module_augmentation';
2
3
  import { Component, JSX } from 'solid-js';
3
4
  import { HTMLComponents } from '../html/types';
4
5
  type RenderMarkdownOptions = {
@@ -15,7 +16,6 @@ type MarkdownRendererProps = RenderMarkdownOptions & {
15
16
  keyPath: KeyPath[];
16
17
  locale?: LocalesValues;
17
18
  children: string;
18
- [key: string]: any;
19
19
  };
20
20
  export declare const MarkdownRenderer: Component<MarkdownRendererProps>;
21
21
  type MarkdownMetadataRendererProps = MarkdownRendererProps & {
@@ -1,5 +1,6 @@
1
1
  import { DeepTransformContent as DeepTransformContentCore, IInterpreterPluginState as IInterpreterPluginStateCore, Plugins } from '@intlayer/core/interpreter';
2
- import { DeclaredLocales, LocalesValues, NodeType } from '@intlayer/types';
2
+ import { DeclaredLocales, LocalesValues } from '@intlayer/types/module_augmentation';
3
+ import { NodeType } from '@intlayer/types/nodeType';
3
4
  import { JSX } from 'solid-js';
4
5
  import { HTMLComponents } from './html/types';
5
6
  import { IntlayerNode } from './IntlayerNode';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-intlayer",
3
- "version": "8.2.3",
3
+ "version": "8.3.0-canary.0",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Solid applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -58,29 +58,29 @@
58
58
  "scripts": {
59
59
  "build": "vite build",
60
60
  "build:ci": "vite build",
61
- "clean": "rimraf ./dist .turbo",
61
+ "clean": "bun --bun rimraf ./dist .turbo",
62
62
  "dev": "vite build --watch",
63
- "format": "biome format . --check",
64
- "format:fix": "biome format --write .",
65
- "lint": "biome lint .",
66
- "lint:fix": "biome lint --write .",
63
+ "format": "bun --bun biome format . --check",
64
+ "format:fix": "bun --bun biome format --write .",
65
+ "lint": "bun --bun biome lint .",
66
+ "lint:fix": "bun --bun biome lint --write .",
67
67
  "prepublish": "cp -f ../../README.md ./README.md",
68
68
  "publish": "bun publish || true",
69
69
  "publish:canary": "bun publish --access public --tag canary || true",
70
70
  "publish:latest": "bun publish --access public --tag latest || true",
71
- "test": "vitest run",
72
- "test:watch": "vitest",
71
+ "test": "bun --bun vitest run",
72
+ "test:watch": "bun --bun vitest",
73
73
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
74
74
  },
75
75
  "dependencies": {
76
- "@intlayer/api": "8.2.3",
77
- "@intlayer/config": "8.2.3",
78
- "@intlayer/core": "8.2.3",
79
- "@intlayer/editor": "8.2.3",
80
- "@intlayer/types": "8.2.3"
76
+ "@intlayer/api": "8.3.0-canary.0",
77
+ "@intlayer/config": "8.3.0-canary.0",
78
+ "@intlayer/core": "8.3.0-canary.0",
79
+ "@intlayer/editor": "8.3.0-canary.0",
80
+ "@intlayer/types": "8.3.0-canary.0"
81
81
  },
82
82
  "devDependencies": {
83
- "@intlayer/unmerged-dictionaries-entry": "8.2.3",
83
+ "@intlayer/unmerged-dictionaries-entry": "8.3.0-canary.0",
84
84
  "@solidjs/testing-library": "0.8.10",
85
85
  "@testing-library/jest-dom": "6.9.1",
86
86
  "@testing-library/user-event": "14.6.1",
@@ -90,7 +90,7 @@
90
90
  "@utils/tsdown-config": "1.0.4",
91
91
  "jsdom": "28.1.0",
92
92
  "rimraf": "6.1.3",
93
- "tsdown": "0.21.0",
93
+ "tsdown": "0.21.1",
94
94
  "typescript": "5.9.3",
95
95
  "vite": "7.3.1",
96
96
  "vite-plugin-dts": "4.5.4",
@@ -1 +0,0 @@
1
- "use strict";const r=require("solid-js/web"),h=require("@intlayer/core/interpreter"),w=require("@intlayer/core/markdown"),T=require("@intlayer/core/transpiler"),d=require("@intlayer/types"),N=require("@intlayer/core/utils"),f=require("solid-js");require("@intlayer/core/formatters");const M=require("./cjs/client/IntlayerProvider.cjs");require("@intlayer/config/built");require("@intlayer/core/localization");const S=require("./cjs/editor/useEditedContentRenderer.cjs"),m=require("./cjs/IntlayerNode.cjs");require("./cjs/markdown/MarkdownProvider.cjs");const P=require("./cjs/markdown/MarkdownRenderer.cjs"),H=require("./cjs/solidElement/renderSolidElement.cjs");require("./cjs/client/useLocaleStorage.cjs");require("./cjs/client/useLocaleBase.cjs");const I=require("./cjs/UI/ContentSelector.cjs");require("@intlayer/editor");require("./cjs/editor/contexts/ConfigurationContext.cjs");require("./cjs/editor/contexts/DictionariesRecordContext.cjs");require("./cjs/editor/contexts/EditedContentContext.cjs");const b=require("./cjs/editor/contexts/EditorEnabledContext.cjs");require("./cjs/editor/contexts/CommunicatorContext.cjs");const K=require("./cjs/editor/contexts/FocusDictionaryContext.cjs"),_=e=>{const{focusedContent:n,setFocusedContent:t}=K.useFocusDictionary(),l=f.createMemo(()=>e.keyPath.filter(a=>a.type!==d.NodeType.Translation)),o=()=>t({dictionaryKey:e.dictionaryKey,keyPath:l()}),c=f.createMemo(()=>(n?.dictionaryKey===e.dictionaryKey&&(n?.keyPath?.length??0)>0&&N.isSameKeyPath(n?.keyPath??[],l()))??!1);return r.createComponent(I.ContentSelector,{onPress:o,get isSelecting(){return c()},get children(){return e.children}})},y=e=>{const{enabled:n}=b.useEditorEnabled(),{disableEditor:t}=M.useIntlayerContext();return n()&&!t?r.createComponent(_,r.mergeProps(e,{get children(){return e.children}})):e.children},E={id:"intlayer-node-plugin",canHandle:e=>typeof e=="bigint"||typeof e=="string"||typeof e=="number",transform:(e,{plugins:n,...t})=>m.renderIntlayerNode({...t,value:t.children,children:r.createComponent(y,r.mergeProps(t,{get children(){return r.createComponent(S.EditedContentRenderer,r.mergeProps(t,{get children(){return t.children}}))}}))})},R={id:"solid-node-plugin",canHandle:e=>typeof e=="object"&&e?.props!==void 0||typeof Node<"u"&&e instanceof Node,transform:(e,{plugins:n,...t})=>m.renderIntlayerNode({...t,value:"[[solid-element]]",children:r.createComponent(y,r.mergeProps(t,{get children(){return typeof Node<"u"&&e instanceof Node?e:H.renderSolidElement(e)}}))})},v=(e,n)=>{const t=h.splitInsertionTemplate(e,n);return t.isSimple,t.parts},x={id:"insertion-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===d.NodeType.Insertion,transform:(e,n,t)=>{const l=[...n.keyPath,{type:d.NodeType.Insertion}],o=e[d.NodeType.Insertion];return t(o,{...n,children:o,keyPath:l,plugins:[{id:"insertion-string-plugin",canHandle:a=>typeof a=="string",transform:(a,u,g)=>{const p=g(a,{...u,children:a,plugins:[...(n.plugins??[]).filter(i=>i.id!=="intlayer-node-plugin")]});return i=>{const s=v(p,i);return g(s,{...u,plugins:n.plugins,children:s})}}},...n.plugins??[]]})}},k={id:"markdown-string-plugin",canHandle:e=>typeof e=="string",transform:(e,n,t)=>{const{plugins:l,...o}=n,c=w.getMarkdownMetadata(e),u=t(c,{plugins:[{id:"markdown-metadata-plugin",canHandle:i=>typeof i=="string"||typeof i=="number"||typeof i=="boolean"||!i,transform:(i,s)=>m.renderIntlayerNode({...s,value:i,children:r.createComponent(y,r.mergeProps(o,{get children(){return r.createComponent(P.MarkdownMetadataRenderer,r.mergeProps(o,{get metadataKeyPath(){return s.keyPath},children:e}))}}))})}],dictionaryKey:o.dictionaryKey,keyPath:[]}),g=i=>m.renderIntlayerNode({...n,value:e,children:r.createComponent(y,r.mergeProps(o,{get children(){return r.createComponent(P.MarkdownRenderer,r.mergeProps(o,i,{children:e}))}})),additionalProps:{metadata:u}}),p=g();return new Proxy(p,{get(i,s,q){return s==="value"?e:s==="metadata"?u:s==="use"?C=>g(C):Reflect.get(i,s,q)}})}},L={id:"markdown-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===d.NodeType.Markdown,transform:(e,n,t)=>{const l=[...n.keyPath,{type:d.NodeType.Markdown}],o=e[d.NodeType.Markdown];return t(o,{...n,children:o,keyPath:l,plugins:[k,...n.plugins??[]]})}},j=()=>{const e={};for(const n of T.HTML_TAGS)e[n]=({children:t,...l})=>r.createComponent(r.Dynamic,r.mergeProps({component:n},l,{children:t}));return e},D=j(),F={id:"html-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===d.NodeType.HTML,transform:e=>{const n=e[d.NodeType.HTML],t=c=>{const a={...D,...c};return h.getHTML(n,a)},o=[t()];return new Proxy(o,{get(c,a,u){return a==="value"?n:a==="use"?g=>t(g):Reflect.get(c,a,u)}})}};exports.ContentSelectorRenderer=y;exports.htmlPlugin=F;exports.insertionPlugin=x;exports.intlayerNodePlugins=E;exports.markdownPlugin=L;exports.markdownStringPlugin=k;exports.solidNodePlugins=R;