@i18n-micro/solid 1.1.1 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +305 -0
- package/dist/index.mjs +31 -31
- package/dist/index.mjs.map +1 -1
- package/package.json +41 -9
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("@i18n-micro/core"),r=require("solid-js/web"),l=require("solid-js"),te=require("@solidjs/router"),T=l.createContext(),j=l.createContext(),N=l.createContext(),E=l.createContext(),S=()=>{const n=l.useContext(T);if(!n)throw new Error("[i18n-micro] I18nContext not found. Make sure I18nProvider is used.");return n},O=()=>{const n=l.useContext(j);if(!n)throw new Error("[i18n-micro] I18nLocalesContext not found. Make sure I18nLocalesContext is provided.");return n},W=()=>{const n=l.useContext(N);if(!n)throw new Error("[i18n-micro] I18nDefaultLocaleContext not found. Make sure I18nDefaultLocaleContext is provided.");return n},_=()=>l.useContext(E);var re=r.template("<div>");const ne=n=>{const e=S(),[t,a]=l.splitProps(n,["prefix","groupClass"]),o=(m,h)=>{const u=e.t(`${t.prefix}.${m}`,h,void 0,e.getRoute());return typeof u=="string"?u:String(u)};return(()=>{var m=re();return r.spread(m,r.mergeProps({get class(){return["i18n-group",t.groupClass].filter(Boolean).join(" ")}},a),!1,!0),r.insert(m,(()=>{var h=r.memo(()=>typeof n.children=="function");return()=>h()?n.children({prefix:t.prefix,t:o}):n.children})()),m})()};var oe=r.template('<a target=_blank rel="noopener noreferrer">'),ae=r.template("<a>");const se=n=>{const e=_(),t=S(),[a,o]=l.splitProps(n,["to","localeRoute","activeStyle","style","children"]),h=e?.getCurrentPathAccessor,u=l.createMemo(()=>{const d=t.localeAccessor();let g;if(a.localeRoute){const L=a.localeRoute(a.to,d);g=typeof L=="string"?L:L?.path||"/"}else if(e?.resolvePath){const L=e.resolvePath(a.to,d);g=typeof L=="string"?L:L?.path||"/"}else typeof a.to=="string"?g=a.to:g=a.to?.path||"/";return g}),s=l.createMemo(()=>typeof a.to=="string"?/^(?:https?:\/\/|\/\/|[a-zA-Z0-9-]+\.[a-zA-Z]{2,})|tel:|mailto:/.test(a.to):!1),c=l.createMemo(()=>{if(s())return!1;const d=h?h():e?e.getCurrentPath():typeof window<"u"?window.location.pathname:"/",g=u(),L=d==="/"?"/":d.replace(/\/$/,""),A=g==="/"?"/":g.replace(/\/$/,"");return L===A}),i=l.createMemo(()=>{const d=a.style||{},L=c()?a.activeStyle||{}:{};return{...typeof d=="object"?d:{},...typeof L=="object"?L:{}}}),y=e?.linkComponent;return s()?(()=>{var d=oe();return r.spread(d,r.mergeProps({get href(){return r.memo(()=>typeof a.to=="string")()?a.to:""},get style(){return i()}},o),!1,!0),r.insert(d,()=>a.children),d})():y?r.createComponent(y,r.mergeProps({get href(){return u()},get style(){return i()}},o,{get children(){return a.children}})):(()=>{var d=ae();return r.spread(d,r.mergeProps({get href(){return u()},get style(){return i()}},o,{onClick:g=>{e&&!s()&&(g.preventDefault(),e.push({path:u()}))}}),!1,!0),r.insert(d,()=>a.children),d})()};var ce=r.template("<div class=i18n-switcher-wrapper><button type=button class=i18n-switcher-button aria-haspopup=true><span></span><span>▼"),le=r.template("<ul class=i18n-switcher-dropdown>"),ie=r.template("<li><a>");const ue=n=>{const e=S(),t=_(),a=O(),[o,m]=l.splitProps(n,["locales","currentLocale","getLocaleName","switchLocale","localeRoute","customLabels","customWrapperStyle","customButtonStyle","customDropdownStyle","customItemStyle","customLinkStyle","customActiveLinkStyle","customDisabledLinkStyle","customIconStyle"]),[h,u]=l.createSignal(!1);let s;const c=l.createMemo(()=>o.locales||a||[]),i=l.createMemo(()=>o.currentLocale!==void 0?typeof o.currentLocale=="function"?o.currentLocale():o.currentLocale:e.localeAccessor()),y=l.createMemo(()=>o.getLocaleName?o.getLocaleName()||null:c().find(v=>v.code===e.localeAccessor())?.displayName||null),d=p=>{p&&(p.stopPropagation(),p.preventDefault()),u(!h())},g=p=>o.customLabels?.[p.code]||p.displayName||p.code,L=l.createMemo(()=>{const p=c().find(v=>v.code===i());return p?g(p):y()||i()}),A=async p=>{if(u(!1),o.switchLocale){o.switchLocale(p);return}if(e.locale=p,!t)return;const v=t,C=v.getCurrentPathAccessor?v.getCurrentPathAccessor():t.getCurrentPath(),x=o.localeRoute?(()=>{const f=o.localeRoute(C,p);return typeof f=="string"?f:f.path||"/"})():t?.resolvePath?(()=>{const f=t.resolvePath(C,p);return typeof f=="string"?f:f.path||"/"})():C;t.push({path:x})},H={position:"relative",display:"inline-block","vertical-align":"middle"},G={padding:"4px 12px","font-size":"16px",cursor:"pointer","background-color":"#fff",border:"1px solid #333",transition:"background-color 0.3s ease",display:"flex","align-items":"center","justify-content":"space-between"},Z={position:"absolute",top:"100%",left:"0","z-index":1e3,"background-color":"#fff",border:"1px solid #333","list-style":"none",padding:"0",margin:"4px 0 0 0","min-width":"150px","box-shadow":"0 2px 8px rgba(0,0,0,0.15)"},J={margin:"0",padding:"0"},K={display:"block",padding:"8px 12px",color:"#333","text-decoration":"none",transition:"background-color 0.3s ease",cursor:"pointer"},Q={"font-weight":"bold",color:"#007bff"},U={"margin-left":"8px",display:"inline-block",transition:"transform 0.3s ease"},X={transform:"rotate(180deg)"},V=p=>{if(!h())return;const v=p.target;if(!v||!s)return;const C=s.contains(v),x=v.closest(".i18n-switcher-button")!==null;!C&&!x&&u(!1)};return l.onMount(()=>{document.addEventListener("click",V)}),l.onCleanup(()=>{document.removeEventListener("click",V)}),(()=>{var p=ce(),v=p.firstChild,C=v.firstChild,x=C.nextSibling;return r.use(f=>{s=f},p),r.spread(p,r.mergeProps({get style(){return{...H,...o.customWrapperStyle}}},m),!1,!0),v.$$click=f=>{f.preventDefault(),f.stopPropagation(),d(f)},r.insert(C,L),r.insert(p,(()=>{var f=r.memo(()=>!!h());return()=>f()&&(()=>{var R=le();return r.insert(R,()=>c().map(b=>{const w=b.code===i(),B=t,$=B?.getCurrentPathAccessor?B.getCurrentPathAccessor():t?.getCurrentPath()||(typeof window<"u"?window.location.pathname:"/"),D=o.localeRoute?o.localeRoute($,b.code):t?.resolvePath?t.resolvePath($,b.code):$,q=typeof D=="string"?D:D?.path||"#";return(()=>{var M=ie(),k=M.firstChild;return k.$$click=P=>{P.preventDefault(),P.stopPropagation(),A(b.code)},r.setAttribute(k,"href",typeof q=="string"?q:"#"),r.insert(k,()=>g(b)),r.effect(P=>{var Y={...J,...o.customItemStyle},z=`switcher-locale-${b.code}`,ee={...K,...w?Q:{},...o.customLinkStyle,...w?o.customActiveLinkStyle:{}};return P.e=r.style(M,Y,P.e),z!==P.t&&r.className(k,P.t=z),P.a=r.style(k,ee,P.a),P},{e:void 0,t:void 0,a:void 0}),M})()})),r.effect(b=>r.style(R,{...Z,...o.customDropdownStyle},b)),R})()})(),null),r.effect(f=>{var R={...G,...o.customButtonStyle},b=h(),w={...U,...h()?X:{},...o.customIconStyle};return f.e=r.style(v,R,f.e),b!==f.t&&r.setAttribute(v,"aria-expanded",f.t=b),f.a=r.style(x,w,f.a),f},{e:void 0,t:void 0,a:void 0}),p})()};r.delegateEvents(["click"]);const de=n=>{const e=S(),[t,a]=l.splitProps(n,["keypath","params","tag","plural","defaultValue","html","hideIfEmpty","customPluralRule","number","date","relativeDate"]),o=l.createMemo(()=>{const h=e.localeAccessor(),u=e.routeAccessor();if(t.number!==void 0){const c=Number(t.number),i=e.tn(c),y=e.t(t.keypath,{number:i,...t.params||{}},void 0,u);return typeof y=="string"?y:String(y)}if(t.date!==void 0){const c=e.td(t.date),i=e.t(t.keypath,{date:c,...t.params||{}},void 0,u);return typeof i=="string"?i:String(i)}if(t.relativeDate!==void 0){const c=e.tdr(t.relativeDate),i=e.t(t.keypath,{relativeDate:c,...t.params||{}},void 0,u);return typeof i=="string"?i:String(i)}if(t.plural!==void 0){const c=Number.parseInt(t.plural.toString(),10);return t.customPluralRule?t.customPluralRule(t.keypath,c,t.params||{},h,(y,d,g)=>e.t(y,d,g,u))||"":e.tc(t.keypath,{count:c,...t.params||{}},t.defaultValue)}const s=(e.t(t.keypath,t.params,t.defaultValue,u)??"").toString();return t.hideIfEmpty&&!s.trim()?t.defaultValue||"":s});if(t.html)return r.createComponent(r.Dynamic,r.mergeProps({get component(){return t.tag||"span"}},a,{get innerHTML(){return o()}}));const m=o();return t.hideIfEmpty&&!m.trim()?t.defaultValue?r.createComponent(r.Dynamic,r.mergeProps({get component(){return t.tag||"span"}},a,{get children(){return t.defaultValue}})):null:r.createComponent(r.Dynamic,r.mergeProps({get component(){return t.tag||"span"}},a,{children:m}))},pe=n=>{const e=n.children;return r.createComponent(T.Provider,{get value(){return n.i18n},get children(){return[r.memo(()=>r.memo(()=>!!n.locales)()&&r.createComponent(j.Provider,{get value(){return n.locales},get children(){return[r.memo(()=>r.memo(()=>!!n.defaultLocale)()&&r.createComponent(N.Provider,{get value(){return n.defaultLocale},get children(){return[r.memo(()=>r.memo(()=>!!n.routingStrategy)()&&r.createComponent(E.Provider,{get value(){return n.routingStrategy},children:e})),r.memo(()=>!n.routingStrategy&&e)]}})),r.memo(()=>!n.defaultLocale&&e)]}})),r.memo(()=>!n.locales&&e)]}})};class F extends I.BaseI18n{_locale;_setLocale;_fallbackLocale;_currentRoute;_setRoute;storage;listeners=new Set;constructor(e){const t={translations:new Map};super({storage:t,plural:e.plural,missingWarn:e.missingWarn,missingHandler:e.missingHandler}),this.storage=t;const[a,o]=l.createSignal(e.locale),[m]=l.createSignal(e.fallbackLocale||e.locale),[h,u]=l.createSignal("general");if(this._locale=a,this._setLocale=o,this._fallbackLocale=m,this._currentRoute=h,this._setRoute=u,e.messages)for(const[s,c]of Object.entries(e.messages))this.addTranslations(s,c)}getLocale(){return this._locale()}getFallbackLocale(){return this._fallbackLocale()}getRoute(){return this._currentRoute()}set locale(e){this._setLocale(e),this.notifyListeners()}get locale(){return this._locale()}get localeAccessor(){return this._locale}get fallbackLocale(){return this._fallbackLocale()}get currentRoute(){return this._currentRoute()}get routeAccessor(){return this._currentRoute}setRoute(e){this._setRoute(e),this.notifyListeners()}addTranslations(e,t,a=!0){super.loadTranslationsCore(e,t,a),this.notifyListeners()}addRouteTranslations(e,t,a,o=!0){super.loadRouteTranslationsCore(e,t,a,o),this.notifyListeners()}clearCache(){super.clearCache(),this.notifyListeners()}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notifyListeners(){this.listeners.forEach(e=>e())}}function fe(n){return new F(n)}function me(n,e,t,a){const o=n.map(s=>s.code),[m,h]=l.createSignal(a.pathname);l.createEffect(()=>{h(a.pathname)});const u=(s,c)=>{const y=(typeof s=="string"?s:s.path||"/").split("/").filter(Boolean);y.length>0&&o.includes(y[0])&&y.shift();const d=`/${y.join("/")}`;return c===e?d:`/${c}${d==="/"?"":d}`};return{getCurrentPath:()=>m(),getCurrentPathAccessor:m,push:s=>{t(s.path)},replace:s=>{t(s.path,{replace:!0})},resolvePath:(s,c)=>u(s,c),getRoute:()=>({fullPath:m(),query:{}}),linkComponent:(s=>{const{href:c,children:i,class:y,style:d,...g}=s;return r.createComponent(te.A,r.mergeProps({href:c,class:y,style:d},g,{children:i}))})}}function he(n){const e=S(),t=_(),a=O(),o=W(),m=n?.locales||a,h=n?.defaultLocale||o,u=(s,c)=>t?.resolvePath?t.resolvePath(s,c||e.getLocale()):s;return{instance:e,locale:l.createMemo(()=>e.localeAccessor()),getLocales:()=>m,defaultLocale:()=>h,getLocaleName:()=>m.find(c=>c.code===e.localeAccessor())?.displayName||null,localeRoute:u,localePath:(s,c)=>{const i=u(s,c);return typeof i=="string"?i:i.path||"/"},switchLocale:s=>{if(e.locale=s,t){const c=t.getCurrentPath(),i=u(c,s);t.push(typeof i=="string"?{path:i}:{path:i.path||"/"})}},t:e.t.bind(e),ts:e.ts.bind(e),tc:e.tc.bind(e),tn:e.tn.bind(e),td:e.td.bind(e),tdr:e.tdr.bind(e),has:e.has.bind(e),setRoute:e.setRoute.bind(e),getRoute:e.getRoute.bind(e),getLocale:()=>e.getLocale(),addTranslations:e.addTranslations.bind(e),addRouteTranslations:e.addRouteTranslations.bind(e),clearCache:e.clearCache.bind(e)}}Object.defineProperty(exports,"FormatService",{enumerable:!0,get:()=>I.FormatService});Object.defineProperty(exports,"defaultPlural",{enumerable:!0,get:()=>I.defaultPlural});Object.defineProperty(exports,"interpolate",{enumerable:!0,get:()=>I.interpolate});exports.I18nContext=T;exports.I18nDefaultLocaleContext=N;exports.I18nGroup=ne;exports.I18nLink=se;exports.I18nLocalesContext=j;exports.I18nProvider=pe;exports.I18nRouterContext=E;exports.I18nSwitcher=ue;exports.I18nT=de;exports.SolidI18n=F;exports.createI18n=fe;exports.createSolidRouterAdapter=me;exports.useI18n=he;exports.useI18nContext=S;exports.useI18nDefaultLocale=W;exports.useI18nLocales=O;exports.useI18nRouter=_;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("@i18n-micro/core"),r=require("solid-js/web"),l=require("solid-js"),te=require("@solidjs/router"),T=l.createContext(),j=l.createContext(),N=l.createContext(),E=l.createContext(),S=()=>{const n=l.useContext(T);if(!n)throw new Error("[i18n-micro] I18nContext not found. Make sure I18nProvider is used.");return n},O=()=>{const n=l.useContext(j);if(!n)throw new Error("[i18n-micro] I18nLocalesContext not found. Make sure I18nLocalesContext is provided.");return n},W=()=>{const n=l.useContext(N);if(!n)throw new Error("[i18n-micro] I18nDefaultLocaleContext not found. Make sure I18nDefaultLocaleContext is provided.");return n},_=()=>l.useContext(E);var re=r.template("<div>");const ne=n=>{const e=S(),[t,a]=l.splitProps(n,["prefix","groupClass"]),o=(m,h)=>{const u=e.t(`${t.prefix}.${m}`,h,void 0,e.getRoute());return typeof u=="string"?u:String(u)};return(()=>{var m=re();return r.spread(m,r.mergeProps({get class(){return["i18n-group",t.groupClass].filter(Boolean).join(" ")}},a),!1,!0),r.insert(m,(()=>{var h=r.memo(()=>typeof n.children=="function");return()=>h()?n.children({prefix:t.prefix,t:o}):n.children})()),m})()};var oe=r.template('<a target=_blank rel="noopener noreferrer">'),ae=r.template("<a>");const se=n=>{const e=_(),t=S(),[a,o]=l.splitProps(n,["to","localeRoute","activeStyle","style","children"]),h=e?.getCurrentPathAccessor,u=l.createMemo(()=>{const d=t.localeAccessor();let g;if(a.localeRoute){const L=a.localeRoute(a.to,d);g=typeof L=="string"?L:L?.path||"/"}else if(e?.resolvePath){const L=e.resolvePath(a.to,d);g=typeof L=="string"?L:L?.path||"/"}else typeof a.to=="string"?g=a.to:g=a.to?.path||"/";return g}),s=l.createMemo(()=>typeof a.to=="string"?/^(?:https?:\/\/|\/\/|[a-zA-Z0-9-]+\.[a-zA-Z]{2,})|tel:|mailto:/.test(a.to):!1),c=l.createMemo(()=>{if(s())return!1;const d=h?h():e?e.getCurrentPath():typeof window<"u"?window.location.pathname:"/",g=u(),L=d==="/"?"/":d.replace(/\/$/,""),A=g==="/"?"/":g.replace(/\/$/,"");return L===A}),i=l.createMemo(()=>{const d=a.style||{},L=c()?a.activeStyle||{}:{};return{...typeof d=="object"?d:{},...typeof L=="object"?L:{}}}),y=e?.linkComponent;return s()?(()=>{var d=oe();return r.spread(d,r.mergeProps({get href(){return r.memo(()=>typeof a.to=="string")()?a.to:""},get style(){return i()}},o),!1,!0),r.insert(d,()=>a.children),d})():y?r.createComponent(y,r.mergeProps({get href(){return u()},get style(){return i()}},o,{get children(){return a.children}})):(()=>{var d=ae();return r.spread(d,r.mergeProps({get href(){return u()},get style(){return i()}},o,{onClick:g=>{e&&!s()&&(g.preventDefault(),e.push({path:u()}))}}),!1,!0),r.insert(d,()=>a.children),d})()};var ce=r.template("<div class=i18n-switcher-wrapper><button type=button class=i18n-switcher-button aria-haspopup=true><span></span><span>▼"),le=r.template("<ul class=i18n-switcher-dropdown>"),ie=r.template("<li><a>");const ue=n=>{const e=S(),t=_(),a=O(),[o,m]=l.splitProps(n,["locales","currentLocale","getLocaleName","switchLocale","localeRoute","customLabels","customWrapperStyle","customButtonStyle","customDropdownStyle","customItemStyle","customLinkStyle","customActiveLinkStyle","customDisabledLinkStyle","customIconStyle"]),[h,u]=l.createSignal(!1);let s;const c=l.createMemo(()=>o.locales||a||[]),i=l.createMemo(()=>o.currentLocale!==void 0?typeof o.currentLocale=="function"?o.currentLocale():o.currentLocale:e.localeAccessor()),y=l.createMemo(()=>o.getLocaleName?o.getLocaleName()||null:c().find(v=>v.code===e.localeAccessor())?.displayName||null),d=p=>{p&&(p.stopPropagation(),p.preventDefault()),u(!h())},g=p=>o.customLabels?.[p.code]||p.displayName||p.code,L=l.createMemo(()=>{const p=c().find(v=>v.code===i());return p?g(p):y()||i()}),A=async p=>{if(u(!1),o.switchLocale){o.switchLocale(p);return}if(e.locale=p,!t)return;const v=t,C=v.getCurrentPathAccessor?v.getCurrentPathAccessor():t.getCurrentPath(),x=o.localeRoute?(()=>{const f=o.localeRoute(C,p);return typeof f=="string"?f:f.path||"/"})():t?.resolvePath?(()=>{const f=t.resolvePath(C,p);return typeof f=="string"?f:f.path||"/"})():C;t.push({path:x})},H={position:"relative",display:"inline-block","vertical-align":"middle"},G={padding:"4px 12px","font-size":"16px",cursor:"pointer","background-color":"#fff",border:"1px solid #333",transition:"background-color 0.3s ease",display:"flex","align-items":"center","justify-content":"space-between"},Z={position:"absolute",top:"100%",left:"0","z-index":1e3,"background-color":"#fff",border:"1px solid #333","list-style":"none",padding:"0",margin:"4px 0 0 0","min-width":"150px","box-shadow":"0 2px 8px rgba(0,0,0,0.15)"},J={margin:"0",padding:"0"},K={display:"block",padding:"8px 12px",color:"#333","text-decoration":"none",transition:"background-color 0.3s ease",cursor:"pointer"},Q={"font-weight":"bold",color:"#007bff"},U={"margin-left":"8px",display:"inline-block",transition:"transform 0.3s ease"},X={transform:"rotate(180deg)"},V=p=>{if(!h())return;const v=p.target;if(!v||!s)return;const C=s.contains(v),x=v.closest(".i18n-switcher-button")!==null;!C&&!x&&u(!1)};return l.onMount(()=>{document.addEventListener("click",V)}),l.onCleanup(()=>{document.removeEventListener("click",V)}),(()=>{var p=ce(),v=p.firstChild,C=v.firstChild,x=C.nextSibling;return r.use(f=>{s=f},p),r.spread(p,r.mergeProps({get style(){return{...H,...o.customWrapperStyle}}},m),!1,!0),v.$$click=f=>{f.preventDefault(),f.stopPropagation(),d(f)},r.insert(C,L),r.insert(p,(()=>{var f=r.memo(()=>!!h());return()=>f()&&(()=>{var R=le();return r.insert(R,()=>c().map(b=>{const w=b.code===i(),B=t,$=B?.getCurrentPathAccessor?B.getCurrentPathAccessor():t?.getCurrentPath()||(typeof window<"u"?window.location.pathname:"/"),D=o.localeRoute?o.localeRoute($,b.code):t?.resolvePath?t.resolvePath($,b.code):$,q=typeof D=="string"?D:D?.path||"#";return(()=>{var M=ie(),k=M.firstChild;return k.$$click=P=>{P.preventDefault(),P.stopPropagation(),A(b.code)},r.setAttribute(k,"href",typeof q=="string"?q:"#"),r.insert(k,()=>g(b)),r.effect(P=>{var Y={...J,...o.customItemStyle},z=`switcher-locale-${b.code}`,ee={...K,...w?Q:{},...o.customLinkStyle,...w?o.customActiveLinkStyle:{}};return P.e=r.style(M,Y,P.e),z!==P.t&&r.className(k,P.t=z),P.a=r.style(k,ee,P.a),P},{e:void 0,t:void 0,a:void 0}),M})()})),r.effect(b=>r.style(R,{...Z,...o.customDropdownStyle},b)),R})()})(),null),r.effect(f=>{var R={...G,...o.customButtonStyle},b=h(),w={...U,...h()?X:{},...o.customIconStyle};return f.e=r.style(v,R,f.e),b!==f.t&&r.setAttribute(v,"aria-expanded",f.t=b),f.a=r.style(x,w,f.a),f},{e:void 0,t:void 0,a:void 0}),p})()};r.delegateEvents(["click"]);const de=n=>{const e=S(),[t,a]=l.splitProps(n,["keypath","params","tag","plural","defaultValue","html","hideIfEmpty","customPluralRule","number","date","relativeDate"]),o=l.createMemo(()=>{const h=e.localeAccessor(),u=e.routeAccessor();if(t.number!==void 0){const c=Number(t.number),i=e.tn(c),y=e.t(t.keypath,{number:i,...t.params||{}},void 0,u);return typeof y=="string"?y:String(y)}if(t.date!==void 0){const c=e.td(t.date),i=e.t(t.keypath,{date:c,...t.params||{}},void 0,u);return typeof i=="string"?i:String(i)}if(t.relativeDate!==void 0){const c=e.tdr(t.relativeDate),i=e.t(t.keypath,{relativeDate:c,...t.params||{}},void 0,u);return typeof i=="string"?i:String(i)}if(t.plural!==void 0){const c=Number.parseInt(t.plural.toString(),10);return t.customPluralRule?t.customPluralRule(t.keypath,c,t.params||{},h,(y,d,g)=>e.t(y,d,g,u))||"":e.tc(t.keypath,{count:c,...t.params||{}},t.defaultValue)}const s=(e.t(t.keypath,t.params,t.defaultValue,u)??"").toString();return t.hideIfEmpty&&!s.trim()?t.defaultValue||"":s});if(t.html)return r.createComponent(r.Dynamic,r.mergeProps({get component(){return t.tag||"span"}},a,{get innerHTML(){return o()}}));const m=o();return t.hideIfEmpty&&!m.trim()?t.defaultValue?r.createComponent(r.Dynamic,r.mergeProps({get component(){return t.tag||"span"}},a,{get children(){return t.defaultValue}})):null:r.createComponent(r.Dynamic,r.mergeProps({get component(){return t.tag||"span"}},a,{children:m}))},pe=n=>{const e=n.children;return r.createComponent(T.Provider,{get value(){return n.i18n},get children(){return[r.memo(()=>r.memo(()=>!!n.locales)()&&r.createComponent(j.Provider,{get value(){return n.locales},get children(){return[r.memo(()=>r.memo(()=>!!n.defaultLocale)()&&r.createComponent(N.Provider,{get value(){return n.defaultLocale},get children(){return[r.memo(()=>r.memo(()=>!!n.routingStrategy)()&&r.createComponent(E.Provider,{get value(){return n.routingStrategy},children:e})),r.memo(()=>!n.routingStrategy&&e)]}})),r.memo(()=>!n.defaultLocale&&e)]}})),r.memo(()=>!n.locales&&e)]}})};class F extends I.BaseI18n{_locale;_setLocale;_fallbackLocale;_currentRoute;_setRoute;storage;listeners=new Set;constructor(e){const t={translations:new Map};super({storage:t,plural:e.plural,missingWarn:e.missingWarn,missingHandler:e.missingHandler}),this.storage=t;const[a,o]=l.createSignal(e.locale),[m]=l.createSignal(e.fallbackLocale||e.locale),[h,u]=l.createSignal("index");if(this._locale=a,this._setLocale=o,this._fallbackLocale=m,this._currentRoute=h,this._setRoute=u,e.messages)for(const[s,c]of Object.entries(e.messages))this.addTranslations(s,c)}getLocale(){return this._locale()}getFallbackLocale(){return this._fallbackLocale()}getRoute(){return this._currentRoute()}set locale(e){this._setLocale(e),this.notifyListeners()}get locale(){return this._locale()}get localeAccessor(){return this._locale}get fallbackLocale(){return this._fallbackLocale()}get currentRoute(){return this._currentRoute()}get routeAccessor(){return this._currentRoute}setRoute(e){this._setRoute(e),this.notifyListeners()}addTranslations(e,t,a=!0){super.loadTranslationsCore(e,t,a),this.notifyListeners()}addRouteTranslations(e,t,a,o=!0){super.loadRouteTranslationsCore(e,t,a,o),this.notifyListeners()}clearCache(){super.clearCache(),this.notifyListeners()}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notifyListeners(){this.listeners.forEach(e=>e())}}function fe(n){return new F(n)}function me(n,e,t,a){const o=n.map(s=>s.code),[m,h]=l.createSignal(a.pathname);l.createEffect(()=>{h(a.pathname)});const u=(s,c)=>{const y=(typeof s=="string"?s:s.path||"/").split("/").filter(Boolean);y.length>0&&o.includes(y[0])&&y.shift();const d=`/${y.join("/")}`;return c===e?d:`/${c}${d==="/"?"":d}`};return{getCurrentPath:()=>m(),getCurrentPathAccessor:m,push:s=>{t(s.path)},replace:s=>{t(s.path,{replace:!0})},resolvePath:(s,c)=>u(s,c),getRoute:()=>({fullPath:m(),query:{}}),linkComponent:(s=>{const{href:c,children:i,class:y,style:d,...g}=s;return r.createComponent(te.A,r.mergeProps({href:c,class:y,style:d},g,{children:i}))})}}function he(n){const e=S(),t=_(),a=O(),o=W(),m=n?.locales||a,h=n?.defaultLocale||o,u=(s,c)=>t?.resolvePath?t.resolvePath(s,c||e.getLocale()):s;return{instance:e,locale:l.createMemo(()=>e.localeAccessor()),getLocales:()=>m,defaultLocale:()=>h,getLocaleName:()=>m.find(c=>c.code===e.localeAccessor())?.displayName||null,localeRoute:u,localePath:(s,c)=>{const i=u(s,c);return typeof i=="string"?i:i.path||"/"},switchLocale:s=>{if(e.locale=s,t){const c=t.getCurrentPath(),i=u(c,s);t.push(typeof i=="string"?{path:i}:{path:i.path||"/"})}},t:e.t.bind(e),ts:e.ts.bind(e),tc:e.tc.bind(e),tn:e.tn.bind(e),td:e.td.bind(e),tdr:e.tdr.bind(e),has:e.has.bind(e),setRoute:e.setRoute.bind(e),getRoute:e.getRoute.bind(e),getLocale:()=>e.getLocale(),addTranslations:e.addTranslations.bind(e),addRouteTranslations:e.addRouteTranslations.bind(e),clearCache:e.clearCache.bind(e)}}Object.defineProperty(exports,"FormatService",{enumerable:!0,get:()=>I.FormatService});Object.defineProperty(exports,"defaultPlural",{enumerable:!0,get:()=>I.defaultPlural});Object.defineProperty(exports,"interpolate",{enumerable:!0,get:()=>I.interpolate});exports.I18nContext=T;exports.I18nDefaultLocaleContext=N;exports.I18nGroup=ne;exports.I18nLink=se;exports.I18nLocalesContext=j;exports.I18nProvider=pe;exports.I18nRouterContext=E;exports.I18nSwitcher=ue;exports.I18nT=de;exports.SolidI18n=F;exports.createI18n=fe;exports.createSolidRouterAdapter=me;exports.useI18n=he;exports.useI18nContext=S;exports.useI18nDefaultLocale=W;exports.useI18nLocales=O;exports.useI18nRouter=_;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/injection.ts","../src/components/I18nGroup.tsx","../src/components/I18nLink.tsx","../src/components/I18nSwitcher.tsx","../src/components/I18nT.tsx","../src/context.tsx","../src/i18n.ts","../src/router/adapter.tsx","../src/use-i18n.ts"],"sourcesContent":["import type { Locale } from '@i18n-micro/types'\nimport { createContext, useContext } from 'solid-js'\nimport type { SolidI18n } from './i18n'\nimport type { I18nRoutingStrategy } from './router/types'\n\n// Context keys (analogous to Vue's InjectionKey)\nexport const I18nContext = createContext<SolidI18n>()\nexport const I18nLocalesContext = createContext<Locale[]>()\nexport const I18nDefaultLocaleContext = createContext<string>()\nexport const I18nRouterContext = createContext<I18nRoutingStrategy | undefined>()\n\n// Helper hooks (analogous to Vue's inject)\nexport const useI18nContext = () => {\n const context = useContext(I18nContext)\n if (!context) {\n throw new Error('[i18n-micro] I18nContext not found. Make sure I18nProvider is used.')\n }\n return context\n}\n\nexport const useI18nLocales = () => {\n const context = useContext(I18nLocalesContext)\n if (!context) {\n throw new Error('[i18n-micro] I18nLocalesContext not found. Make sure I18nLocalesContext is provided.')\n }\n return context\n}\n\nexport const useI18nDefaultLocale = () => {\n const context = useContext(I18nDefaultLocaleContext)\n if (!context) {\n throw new Error('[i18n-micro] I18nDefaultLocaleContext not found. Make sure I18nDefaultLocaleContext is provided.')\n }\n return context\n}\n\nexport const useI18nRouter = () => {\n return useContext(I18nRouterContext)\n}\n","// @ts-nocheck\n\nimport type { TranslationKey } from '@i18n-micro/types'\nimport { type Component, type JSX, splitProps } from 'solid-js'\nimport { useI18nContext } from '../injection'\n\ninterface I18nGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {\n prefix: string\n groupClass?: string\n}\n\nexport const I18nGroup: Component<I18nGroupProps> = (props): JSX.Element => {\n const i18n = useI18nContext()\n const [local, others] = splitProps(props, ['prefix', 'groupClass'])\n\n const translate = (key: string, params?: Record<string, string | number | boolean>): string => {\n // Use type assertion for dynamic keys with prefix\n // The developer is responsible for ensuring the key exists\n const result = i18n.t(`${local.prefix}.${key}` as TranslationKey, params, undefined, i18n.getRoute())\n return typeof result === 'string' ? result : String(result)\n }\n\n return (\n // @ts-expect-error - Type conflict with Vue JSX in monorepo\n (\n <div class={['i18n-group', local.groupClass].filter(Boolean).join(' ')} {...(others as unknown as JSX.HTMLAttributes<HTMLDivElement>)}>\n {typeof props.children === 'function'\n ? (\n props.children as (props: {\n prefix: string\n t: (key: string, params?: Record<string, string | number | boolean>) => string\n }) => JSX.Element\n )({ prefix: local.prefix, t: translate })\n : props.children}\n </div>\n ) as unknown as JSX.Element\n )\n}\n","// @ts-nocheck\nimport { type Accessor, type Component, createMemo, type JSX, splitProps } from 'solid-js'\nimport { useI18nContext, useI18nRouter } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\n\ninterface I18nLinkProps extends JSX.AnchorHTMLAttributes<HTMLAnchorElement> {\n to: string | { path?: string }\n localeRoute?: (to: string | { path?: string }, locale?: string) => string | { path?: string }\n activeStyle?: JSX.CSSProperties\n}\n\nexport const I18nLink: Component<I18nLinkProps> = (props): JSX.Element => {\n const router = useI18nRouter()\n const i18n = useI18nContext()\n // Разделяем пропсы: явно выделяем style, чтобы объединить его с activeStyle\n const [local, others] = splitProps(props, ['to', 'localeRoute', 'activeStyle', 'style', 'children'])\n\n // 1. Получаем accessor для текущего пути из роутера\n const extendedRouter = router as I18nRoutingStrategy & { getCurrentPathAccessor?: Accessor<string> }\n const pathnameAccessor = extendedRouter?.getCurrentPathAccessor\n\n // 2. Вычисление целевого пути (href) - реактивно отслеживает изменения локали\n const targetPath = createMemo(() => {\n // Используем реактивный accessor для отслеживания изменений локали\n const currentLocale = i18n.localeAccessor()\n let result: string\n if (local.localeRoute) {\n const res = local.localeRoute(local.to, currentLocale)\n result = typeof res === 'string' ? res : res?.path || '/'\n } else if (router?.resolvePath) {\n const res = router.resolvePath(local.to, currentLocale)\n result = typeof res === 'string' ? res : res?.path || '/'\n } else if (typeof local.to === 'string') {\n result = local.to\n } else {\n result = (local.to as { path?: string })?.path || '/'\n }\n return result\n })\n\n // 3. Проверка на внешнюю ссылку\n const isExternal = createMemo(() => {\n if (typeof local.to === 'string') {\n return /^(?:https?:\\/\\/|\\/\\/|[a-zA-Z0-9-]+\\.[a-zA-Z]{2,})|tel:|mailto:/.test(local.to)\n }\n return false\n })\n\n // 4. Вычисление активного состояния\n // Важно: вызываем pathnameAccessor() внутри createMemo для правильного отслеживания изменений\n const isActive = createMemo(() => {\n if (isExternal()) {\n return false\n }\n\n // Получаем текущий путь - вызываем accessor внутри createMemo для реактивности\n const current = pathnameAccessor\n ? pathnameAccessor() // Вызов accessor внутри createMemo отслеживает изменения\n : router\n ? router.getCurrentPath()\n : typeof window !== 'undefined'\n ? window.location.pathname\n : '/'\n const target = targetPath()\n\n // Нормализация для сравнения (убираем слэш в конце, если это не корень)\n const normCurrent = current === '/' ? '/' : current.replace(/\\/$/, '')\n const normTarget = target === '/' ? '/' : target.replace(/\\/$/, '')\n\n return normCurrent === normTarget\n })\n\n // 5. Объединение стилей - используем isActive напрямую для реактивности\n const mergedStyle = createMemo(() => {\n const baseStyle = local.style || {}\n // Вызываем isActive() внутри createMemo для отслеживания изменений\n const active = isActive()\n const activeStyle = active ? local.activeStyle || {} : {}\n\n // SolidJS умеет работать с объектами стилей корректно при слиянии\n return {\n ...(typeof baseStyle === 'object' ? baseStyle : {}),\n ...(typeof activeStyle === 'object' ? activeStyle : {}),\n } as JSX.CSSProperties\n })\n\n // Используем linkComponent из роутера, если доступен\n const LinkComponent = router?.linkComponent\n\n if (isExternal()) {\n return (\n // @ts-expect-error - Type conflict with Vue JSX\n (\n <a\n href={typeof local.to === 'string' ? local.to : ''}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={mergedStyle()}\n {...(others as unknown as JSX.AnchorHTMLAttributes<HTMLAnchorElement>)}\n >\n {local.children}\n </a>\n ) as unknown as JSX.Element\n )\n }\n\n // Если есть linkComponent из роутера (например, A из @solidjs/router), используем его\n if (LinkComponent) {\n return (\n // @ts-expect-error - Type conflict with router component types\n (\n <LinkComponent href={targetPath()} style={mergedStyle()} {...(others as unknown as Record<string, unknown>)}>\n {local.children}\n </LinkComponent>\n ) as unknown as JSX.Element\n )\n }\n\n // Fallback на нативный <a> с onClick обработчиком\n return (\n // @ts-expect-error - Type conflict with Vue JSX\n (\n <a\n href={targetPath()}\n style={mergedStyle()}\n {...(others as unknown as JSX.AnchorHTMLAttributes<HTMLAnchorElement>)}\n onClick={(e: MouseEvent) => {\n if (router && !isExternal()) {\n e.preventDefault()\n router.push({ path: targetPath() })\n }\n }}\n >\n {local.children}\n </a>\n ) as unknown as JSX.Element\n )\n}\n","// @ts-nocheck\n\nimport type { Locale } from '@i18n-micro/types'\nimport { type Accessor, type Component, createMemo, createSignal, type JSX, onCleanup, onMount, splitProps } from 'solid-js'\nimport { useI18nContext, useI18nLocales, useI18nRouter } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\n\ninterface I18nSwitcherProps extends JSX.HTMLAttributes<HTMLDivElement> {\n locales?: Locale[]\n currentLocale?: string | (() => string)\n getLocaleName?: () => string | null\n switchLocale?: (locale: string) => void\n localeRoute?: (to: string | { path?: string }, locale?: string) => string | { path?: string }\n customLabels?: Record<string, string>\n customWrapperStyle?: JSX.CSSProperties\n customButtonStyle?: JSX.CSSProperties\n customDropdownStyle?: JSX.CSSProperties\n customItemStyle?: JSX.CSSProperties\n customLinkStyle?: JSX.CSSProperties\n customActiveLinkStyle?: JSX.CSSProperties\n customDisabledLinkStyle?: JSX.CSSProperties\n customIconStyle?: JSX.CSSProperties\n}\n\nexport const I18nSwitcher: Component<I18nSwitcherProps> = (props): JSX.Element => {\n const i18n = useI18nContext()\n const router = useI18nRouter()\n const injectedLocales = useI18nLocales()\n\n const [local, others] = splitProps(props, [\n 'locales',\n 'currentLocale',\n 'getLocaleName',\n 'switchLocale',\n 'localeRoute',\n 'customLabels',\n 'customWrapperStyle',\n 'customButtonStyle',\n 'customDropdownStyle',\n 'customItemStyle',\n 'customLinkStyle',\n 'customActiveLinkStyle',\n 'customDisabledLinkStyle',\n 'customIconStyle',\n ])\n\n const [dropdownOpen, setDropdownOpen] = createSignal(false)\n let wrapperRef: HTMLDivElement | undefined\n\n const locales = createMemo(() => local.locales || injectedLocales || [])\n const currentLocale = createMemo(() => {\n if (local.currentLocale !== undefined) {\n return typeof local.currentLocale === 'function' ? local.currentLocale() : local.currentLocale\n }\n // Используем реактивный accessor для отслеживания изменений\n return i18n.localeAccessor()\n })\n const currentLocaleName = createMemo(() => {\n if (local.getLocaleName) {\n return local.getLocaleName() || null\n }\n // Используем реактивный accessor для отслеживания изменений\n const current = locales().find((l) => l.code === i18n.localeAccessor())\n return current?.displayName || null\n })\n\n const toggleDropdown = (event?: Event) => {\n if (event) {\n event.stopPropagation()\n event.preventDefault()\n }\n setDropdownOpen(!dropdownOpen())\n }\n\n const localeLabel = (localeItem: Locale): string => {\n const current = local.customLabels?.[localeItem.code] || localeItem.displayName\n return current || localeItem.code\n }\n\n const currentLocaleLabel = createMemo(() => {\n const current = locales().find((l) => l.code === currentLocale())\n return current ? localeLabel(current) : currentLocaleName() || currentLocale()\n })\n\n const handleSwitchLocale = async (code: string) => {\n setDropdownOpen(false)\n\n if (local.switchLocale) {\n local.switchLocale(code)\n return\n }\n\n i18n.locale = code\n\n if (!router) {\n return\n }\n\n // Используем accessor напрямую, если доступен, иначе fallback на getCurrentPath()\n const extendedRouter = router as I18nRoutingStrategy & { getCurrentPathAccessor?: Accessor<string> }\n const currentPath = extendedRouter.getCurrentPathAccessor ? extendedRouter.getCurrentPathAccessor() : router.getCurrentPath()\n const newPath = local.localeRoute\n ? (() => {\n const res = local.localeRoute(currentPath, code)\n return typeof res === 'string' ? res : res.path || '/'\n })()\n : router?.resolvePath\n ? (() => {\n const res = router.resolvePath(currentPath, code)\n return typeof res === 'string' ? res : res.path || '/'\n })()\n : currentPath\n\n router.push({ path: newPath })\n }\n\n // Default Styles\n const wrapperStyle: JSX.CSSProperties = {\n position: 'relative',\n display: 'inline-block',\n 'vertical-align': 'middle',\n }\n\n const buttonStyle: JSX.CSSProperties = {\n padding: '4px 12px',\n 'font-size': '16px',\n cursor: 'pointer',\n 'background-color': '#fff',\n border: '1px solid #333',\n transition: 'background-color 0.3s ease',\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'space-between',\n }\n\n const dropdownStyle: JSX.CSSProperties = {\n position: 'absolute',\n top: '100%',\n left: '0',\n 'z-index': 1000,\n 'background-color': '#fff',\n border: '1px solid #333',\n 'list-style': 'none',\n padding: '0',\n margin: '4px 0 0 0',\n 'min-width': '150px',\n 'box-shadow': '0 2px 8px rgba(0,0,0,0.15)',\n }\n\n const itemStyle: JSX.CSSProperties = {\n margin: '0',\n padding: '0',\n }\n\n const linkStyle: JSX.CSSProperties = {\n display: 'block',\n padding: '8px 12px',\n color: '#333',\n 'text-decoration': 'none',\n transition: 'background-color 0.3s ease',\n cursor: 'pointer',\n }\n\n const activeLinkStyle: JSX.CSSProperties = {\n 'font-weight': 'bold',\n color: '#007bff',\n }\n\n const iconStyle: JSX.CSSProperties = {\n 'margin-left': '8px',\n display: 'inline-block',\n transition: 'transform 0.3s ease',\n }\n\n const openIconStyle: JSX.CSSProperties = {\n transform: 'rotate(180deg)',\n }\n\n const handleClickOutside = (event: MouseEvent) => {\n if (!dropdownOpen()) return\n\n const target = event.target as HTMLElement\n if (!target || !wrapperRef) return\n\n const isClickInside = wrapperRef.contains(target)\n const isButtonClick = target.closest('.i18n-switcher-button') !== null\n\n if (!isClickInside && !isButtonClick) {\n setDropdownOpen(false)\n }\n }\n\n onMount(() => {\n document.addEventListener('click', handleClickOutside)\n })\n\n onCleanup(() => {\n document.removeEventListener('click', handleClickOutside)\n })\n\n return (\n <div\n // @ts-expect-error - ref type conflict with Vue JSX\n ref={(el: HTMLDivElement) => {\n wrapperRef = el\n }}\n class=\"i18n-switcher-wrapper\"\n style={{ ...wrapperStyle, ...local.customWrapperStyle }}\n {...(others as unknown as JSX.HTMLAttributes<HTMLDivElement>)}\n >\n <button\n type=\"button\"\n class=\"i18n-switcher-button\"\n style={{ ...buttonStyle, ...local.customButtonStyle }}\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n toggleDropdown(e)\n }}\n aria-haspopup=\"true\"\n aria-expanded={dropdownOpen()}\n >\n <span>{currentLocaleLabel()}</span>\n <span\n style={{\n ...iconStyle,\n ...(dropdownOpen() ? openIconStyle : {}),\n ...local.customIconStyle,\n }}\n >\n ▼\n </span>\n </button>\n\n {dropdownOpen() && (\n <ul class=\"i18n-switcher-dropdown\" style={{ ...dropdownStyle, ...local.customDropdownStyle }}>\n {locales().map((localeItem) => {\n const isActive = localeItem.code === currentLocale()\n // Используем accessor для реактивного отслеживания пути\n const extendedRouter = router as I18nRoutingStrategy & { getCurrentPathAccessor?: Accessor<string> }\n const currentPath = extendedRouter?.getCurrentPathAccessor\n ? extendedRouter.getCurrentPathAccessor()\n : router?.getCurrentPath() || (typeof window !== 'undefined' ? window.location.pathname : '/')\n const result = local.localeRoute\n ? local.localeRoute(currentPath, localeItem.code)\n : router?.resolvePath\n ? router.resolvePath(currentPath, localeItem.code)\n : currentPath\n const routeTo = typeof result === 'string' ? result : result?.path || '#'\n\n return (\n <li style={{ ...itemStyle, ...local.customItemStyle }}>\n <a\n class={`switcher-locale-${localeItem.code}`}\n href={typeof routeTo === 'string' ? routeTo : '#'}\n style={{\n ...linkStyle,\n ...(isActive ? activeLinkStyle : {}),\n ...local.customLinkStyle,\n ...(isActive ? local.customActiveLinkStyle : {}),\n }}\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n handleSwitchLocale(localeItem.code)\n }}\n >\n {localeLabel(localeItem)}\n </a>\n </li>\n )\n })}\n </ul>\n )}\n </div>\n ) as unknown as JSX.Element\n}\n","// @ts-nocheck\n\nimport type { PluralFunc, TranslationKey } from '@i18n-micro/types'\nimport { type Component, createMemo, type JSX, splitProps } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { useI18nContext } from '../injection'\n\ninterface I18nTProps extends JSX.HTMLAttributes<HTMLElement> {\n keypath: TranslationKey\n params?: Record<string, string | number | boolean>\n tag?: string\n plural?: number | string\n defaultValue?: string\n html?: boolean\n hideIfEmpty?: boolean\n customPluralRule?: PluralFunc\n number?: number | string\n date?: Date | string | number\n relativeDate?: Date | string | number\n}\n\nexport const I18nT: Component<I18nTProps> = (props): JSX.Element => {\n const i18n = useI18nContext()\n const [local, others] = splitProps(props, [\n 'keypath',\n 'params',\n 'tag',\n 'plural',\n 'defaultValue',\n 'html',\n 'hideIfEmpty',\n 'customPluralRule',\n 'number',\n 'date',\n 'relativeDate',\n ])\n\n // Используем createMemo для реактивности (отслеживает изменения локали и роута)\n // В Solid мемо автоматически отслеживает зависимости при использовании в JSX\n const translation = createMemo(() => {\n // Отслеживаем изменения локали и роута через accessors\n const locale = i18n.localeAccessor()\n const route = i18n.routeAccessor()\n\n // Handle number formatting\n if (local.number !== undefined) {\n const numberValue = Number(local.number)\n const formattedNumber = i18n.tn(numberValue)\n const result = i18n.t(local.keypath, { number: formattedNumber, ...(local.params || {}) }, undefined, route)\n return typeof result === 'string' ? result : String(result)\n }\n\n // Handle date formatting\n if (local.date !== undefined) {\n const formattedDate = i18n.td(local.date)\n const result = i18n.t(local.keypath, { date: formattedDate, ...(local.params || {}) }, undefined, route)\n return typeof result === 'string' ? result : String(result)\n }\n\n // Handle relative date formatting\n if (local.relativeDate !== undefined) {\n const formattedRelativeDate = i18n.tdr(local.relativeDate)\n const result = i18n.t(local.keypath, { relativeDate: formattedRelativeDate, ...(local.params || {}) }, undefined, route)\n return typeof result === 'string' ? result : String(result)\n }\n\n // Handle pluralization\n if (local.plural !== undefined) {\n const count = Number.parseInt(local.plural.toString(), 10)\n if (local.customPluralRule) {\n const translationResult = local.customPluralRule(\n local.keypath,\n count,\n local.params || {},\n locale,\n (k: TranslationKey, p?: Record<string, string | number | boolean>, dv?: string) => i18n.t(k, p, dv, route),\n )\n return translationResult || ''\n } else {\n return i18n.tc(local.keypath, { count, ...(local.params || {}) }, local.defaultValue)\n }\n }\n\n // Regular translation\n const translationResult = (i18n.t(local.keypath, local.params, local.defaultValue, route) ?? '').toString()\n\n if (local.hideIfEmpty && !translationResult.trim()) {\n return local.defaultValue || ''\n }\n\n return translationResult\n })\n\n // Если html=true, используем innerHTML и не рендерим children\n if (local.html) {\n return (\n // @ts-expect-error - Dynamic component type conflict with Vue JSX\n (\n <Dynamic component={local.tag || 'span'} {...(others as unknown as Record<string, unknown>)} innerHTML={translation()} />\n ) as unknown as JSX.Element\n )\n }\n\n // Если html=false, рендерим как текст (Solid автоматически экранирует HTML)\n const translationValue = translation()\n if (local.hideIfEmpty && !translationValue.trim()) {\n if (local.defaultValue) {\n return (\n <Dynamic component={local.tag || 'span'} {...(others as unknown as Record<string, unknown>)}>\n {local.defaultValue}\n </Dynamic>\n ) as unknown as JSX.Element\n }\n return null as unknown as JSX.Element\n }\n\n return (\n // @ts-expect-error - Dynamic component type conflict with Vue JSX\n (\n <Dynamic component={local.tag || 'span'} {...(others as unknown as Record<string, unknown>)}>\n {translationValue}\n </Dynamic>\n ) as unknown as JSX.Element\n )\n}\n","// @ts-nocheck\n\nimport type { Locale } from '@i18n-micro/types'\nimport type { JSX, ParentComponent } from 'solid-js'\nimport type { SolidI18n } from './i18n'\nimport { I18nContext, I18nDefaultLocaleContext, I18nLocalesContext, I18nRouterContext } from './injection'\nimport type { I18nRoutingStrategy } from './router/types'\n\nexport interface I18nProviderProps {\n i18n: SolidI18n\n locales?: Locale[]\n defaultLocale?: string\n routingStrategy?: I18nRoutingStrategy\n}\n\nexport const I18nProvider: ParentComponent<I18nProviderProps> = (props): JSX.Element => {\n const children = props.children as JSX.Element\n return (\n // @ts-expect-error - Provider components type conflict with Vue JSX\n (\n <I18nContext.Provider value={props.i18n}>\n {props.locales && (\n // @ts-expect-error - Provider components type conflict with Vue JSX\n <I18nLocalesContext.Provider value={props.locales}>\n {props.defaultLocale && (\n // @ts-expect-error - Provider components type conflict with Vue JSX\n <I18nDefaultLocaleContext.Provider value={props.defaultLocale}>\n {props.routingStrategy && (\n // @ts-expect-error - Provider components type conflict with Vue JSX\n <I18nRouterContext.Provider value={props.routingStrategy}>{children}</I18nRouterContext.Provider>\n )}\n {!props.routingStrategy && children}\n </I18nDefaultLocaleContext.Provider>\n )}\n {!props.defaultLocale && children}\n </I18nLocalesContext.Provider>\n )}\n {!props.locales && children}\n </I18nContext.Provider>\n ) as unknown as JSX.Element\n )\n}\n\n// Keep useI18nContext for backward compatibility\nexport { useI18nContext } from './injection'\n","import { BaseI18n, type TranslationStorage } from '@i18n-micro/core'\nimport type { PluralFunc, Translations } from '@i18n-micro/types'\nimport { type Accessor, createSignal, type Setter } from 'solid-js'\n\nexport interface SolidI18nOptions {\n locale: string\n fallbackLocale?: string\n messages?: Record<string, Translations>\n plural?: PluralFunc\n missingWarn?: boolean\n missingHandler?: (locale: string, key: string, routeName: string) => void\n}\n\nexport class SolidI18n extends BaseI18n {\n private _locale: Accessor<string>\n private _setLocale: Setter<string>\n private _fallbackLocale: Accessor<string>\n private _currentRoute: Accessor<string>\n private _setRoute: Setter<string>\n\n public readonly storage: TranslationStorage\n\n private listeners = new Set<() => void>()\n\n constructor(options: SolidI18nOptions) {\n const storage: TranslationStorage = {\n translations: new Map<string, Translations>(),\n }\n\n super({\n storage,\n plural: options.plural,\n missingWarn: options.missingWarn,\n missingHandler: options.missingHandler,\n })\n\n this.storage = storage\n\n const [locale, setLocale] = createSignal(options.locale)\n const [fallback] = createSignal(options.fallbackLocale || options.locale)\n const [route, setRoute] = createSignal('general')\n\n this._locale = locale\n this._setLocale = setLocale\n this._fallbackLocale = fallback\n this._currentRoute = route\n this._setRoute = setRoute\n\n if (options.messages) {\n for (const [lang, msgs] of Object.entries(options.messages)) {\n this.addTranslations(lang, msgs)\n }\n }\n }\n\n public getLocale(): string {\n return this._locale()\n }\n\n public getFallbackLocale(): string {\n return this._fallbackLocale()\n }\n\n public getRoute(): string {\n return this._currentRoute()\n }\n\n public set locale(val: string) {\n this._setLocale(val)\n this.notifyListeners()\n }\n\n public get locale(): string {\n return this._locale()\n }\n\n public get localeAccessor(): Accessor<string> {\n return this._locale\n }\n\n public get fallbackLocale(): string {\n return this._fallbackLocale()\n }\n\n public get currentRoute(): string {\n return this._currentRoute()\n }\n\n public get routeAccessor(): Accessor<string> {\n return this._currentRoute\n }\n\n public setRoute(val: string): void {\n this._setRoute(val)\n this.notifyListeners()\n }\n\n public addTranslations(locale: string, translations: Translations, merge = true): void {\n super.loadTranslationsCore(locale, translations, merge)\n this.notifyListeners()\n }\n\n public addRouteTranslations(locale: string, routeName: string, translations: Translations, merge = true): void {\n super.loadRouteTranslationsCore(locale, routeName, translations, merge)\n this.notifyListeners()\n }\n\n public override clearCache(): void {\n super.clearCache()\n this.notifyListeners()\n }\n\n public subscribe(cb: () => void): () => void {\n this.listeners.add(cb)\n return () => this.listeners.delete(cb)\n }\n\n private notifyListeners(): void {\n this.listeners.forEach((cb) => cb())\n }\n}\n\nexport function createI18n(options: SolidI18nOptions): SolidI18n {\n return new SolidI18n(options)\n}\n","// @ts-nocheck\n\nimport type { Locale } from '@i18n-micro/types'\nimport { A, type Location, type useNavigate } from '@solidjs/router'\nimport { type Accessor, type Component, createEffect, createSignal, type JSX } from 'solid-js'\nimport type { I18nRoutingStrategy } from './types'\n\ntype NavigateFunction = ReturnType<typeof useNavigate>\n\n/**\n * Factory for Solid Router adapter\n * Implements routing utilities for Solid Router\n * Uses @solidjs/router APIs for navigation and path resolution\n *\n * **IMPORTANT**: This function must be called inside a SolidJS component or reactive context\n * (e.g., inside a component function, not at module level). This is required because\n * `createSignal` and `createEffect` need to be within a reactive owner context.\n *\n * @example\n * ```tsx\n * const RouterRoot: Component = () => {\n * const navigate = useNavigate()\n * const location = useLocation()\n * const routingStrategy = createSolidRouterAdapter(\n * locales,\n * defaultLocale,\n * navigate,\n * location,\n * )\n * // ...\n * }\n * ```\n *\n * @param locales - Array of locale configurations\n * @param defaultLocale - Default locale code\n * @param navigate - Navigation function from @solidjs/router's useNavigate hook\n * @param location - Location object from @solidjs/router's useLocation hook\n * @returns I18nRoutingStrategy with reactive pathname accessor\n */\nexport function createSolidRouterAdapter(\n locales: Locale[],\n defaultLocale: string,\n navigate: NavigateFunction,\n location: Location,\n): I18nRoutingStrategy & { getCurrentPathAccessor: Accessor<string> } {\n const localeCodes = locales.map((loc) => loc.code)\n\n // Create signal to track pathname changes\n // NOTE: This requires a reactive context (component/effect), so this function\n // must be called inside a component, not at module level\n const [pathname, setPathname] = createSignal(location.pathname)\n\n // Track location.pathname changes\n // NOTE: createEffect requires a reactive owner, so this function must be called\n // inside a component or runWithOwner context\n createEffect(() => {\n setPathname(location.pathname)\n })\n\n const resolvePath = (to: string | { path?: string }, locale: string): string | { path?: string } => {\n const path = typeof to === 'string' ? to : to.path || '/'\n const pathSegments = path.split('/').filter(Boolean)\n\n if (pathSegments.length > 0 && localeCodes.includes(pathSegments[0])) {\n pathSegments.shift()\n }\n\n const cleanPath = `/${pathSegments.join('/')}`\n return locale === defaultLocale ? cleanPath : `/${locale}${cleanPath === '/' ? '' : cleanPath}`\n }\n\n return {\n getCurrentPath: () => pathname(), // Returns current value for compatibility\n getCurrentPathAccessor: pathname, // Returns accessor for reactivity\n\n push: (target: { path: string }) => {\n // Use navigate from @solidjs/router\n navigate(target.path)\n },\n\n replace: (target: { path: string }) => {\n // Use navigate with replace option\n navigate(target.path, { replace: true })\n },\n\n resolvePath: (to: string | { path?: string }, locale: string) => resolvePath(to, locale),\n\n getRoute: () => ({\n fullPath: pathname(),\n query: {},\n }),\n\n // Use A component from @solidjs/router\n linkComponent: ((props: { href: string; children?: JSX.Element; class?: string; style?: JSX.CSSProperties; [key: string]: unknown }) => {\n const { href, children, class: className, style, ...restProps } = props\n return (\n <A href={href} class={className} style={style} {...restProps}>\n {children}\n </A>\n ) as unknown as JSX.Element\n }) as unknown as Component<{\n href: string\n children?: JSX.Element\n style?: JSX.CSSProperties\n class?: string\n [key: string]: unknown\n }>,\n }\n}\n","import type { Locale } from '@i18n-micro/types'\nimport { createMemo } from 'solid-js'\nimport { useI18nContext, useI18nDefaultLocale, useI18nLocales, useI18nRouter } from './injection'\n\nexport interface UseI18nOptions {\n locales?: Locale[]\n defaultLocale?: string\n}\n\nexport function useI18n(options?: UseI18nOptions) {\n const i18n = useI18nContext()\n const router = useI18nRouter()\n const injectedLocales = useI18nLocales()\n const injectedDefaultLocale = useI18nDefaultLocale()\n\n const locales = options?.locales || injectedLocales\n const defaultLocale = options?.defaultLocale || injectedDefaultLocale\n\n const resolveLocalePath = (to: string | { path?: string }, localeCode?: string): string | { path?: string } => {\n if (!router?.resolvePath) {\n return to\n }\n return router.resolvePath(to, localeCode || i18n.getLocale())\n }\n\n return {\n // Direct access to instance\n instance: i18n,\n\n // Locale (reactive) - используем accessor для отслеживания изменений\n locale: createMemo(() => i18n.localeAccessor()),\n\n // Locale helpers\n getLocales: () => locales,\n defaultLocale: () => defaultLocale,\n getLocaleName: () => {\n // Используем accessor для реактивности\n const current = locales.find((l) => l.code === i18n.localeAccessor())\n return current?.displayName || null\n },\n\n // Routing helpers\n localeRoute: resolveLocalePath,\n localePath: (to: string | { path?: string }, locale?: string): string => {\n const res = resolveLocalePath(to, locale)\n return typeof res === 'string' ? res : res.path || '/'\n },\n switchLocale: (newLocale: string) => {\n i18n.locale = newLocale\n if (router) {\n const currentPath = router.getCurrentPath()\n const newPath = resolveLocalePath(currentPath, newLocale)\n router.push(typeof newPath === 'string' ? { path: newPath } : { path: newPath.path || '/' })\n }\n },\n\n // Translation methods (delegate to instance)\n t: i18n.t.bind(i18n),\n ts: i18n.ts.bind(i18n),\n tc: i18n.tc.bind(i18n),\n tn: i18n.tn.bind(i18n),\n td: i18n.td.bind(i18n),\n tdr: i18n.tdr.bind(i18n),\n has: i18n.has.bind(i18n),\n\n // Route management\n setRoute: i18n.setRoute.bind(i18n),\n getRoute: i18n.getRoute.bind(i18n),\n getLocale: () => i18n.getLocale(),\n\n // Translation management\n addTranslations: i18n.addTranslations.bind(i18n),\n addRouteTranslations: i18n.addRouteTranslations.bind(i18n),\n clearCache: i18n.clearCache.bind(i18n),\n }\n}\n"],"names":["I18nContext","createContext","I18nLocalesContext","I18nDefaultLocaleContext","I18nRouterContext","useI18nContext","context","useContext","useI18nLocales","useI18nDefaultLocale","useI18nRouter","I18nGroup","props","i18n","local","others","splitProps","translate","key","params","result","t","prefix","undefined","getRoute","String","_el$","_tmpl$","_$spread","_$mergeProps","groupClass","filter","Boolean","join","_$insert","_c$","_$memo","children","I18nLink","router","pathnameAccessor","getCurrentPathAccessor","targetPath","createMemo","currentLocale","localeAccessor","localeRoute","res","to","path","resolvePath","isExternal","test","isActive","current","getCurrentPath","window","location","pathname","target","normCurrent","replace","normTarget","mergedStyle","baseStyle","style","activeStyle","LinkComponent","linkComponent","href","_$createComponent","_el$2","_tmpl$2","e","preventDefault","push","I18nSwitcher","injectedLocales","dropdownOpen","setDropdownOpen","createSignal","wrapperRef","locales","currentLocaleName","getLocaleName","find","l","code","displayName","toggleDropdown","event","stopPropagation","localeLabel","localeItem","customLabels","currentLocaleLabel","handleSwitchLocale","switchLocale","locale","extendedRouter","currentPath","newPath","wrapperStyle","position","display","buttonStyle","padding","cursor","border","transition","dropdownStyle","top","left","margin","itemStyle","linkStyle","color","activeLinkStyle","iconStyle","openIconStyle","transform","handleClickOutside","isClickInside","contains","isButtonClick","closest","onMount","document","addEventListener","onCleanup","removeEventListener","firstChild","_el$3","_el$4","nextSibling","_$use","el","customWrapperStyle","$$click","_el$5","map","routeTo","_el$6","_tmpl$3","_el$7","_$setAttribute","_$effect","_p$","_v$4","customItemStyle","_v$5","_v$6","customLinkStyle","customActiveLinkStyle","_$style","_$className","a","_$p","customDropdownStyle","_v$","customButtonStyle","_v$2","_v$3","customIconStyle","_$delegateEvents","I18nT","translation","route","routeAccessor","number","numberValue","Number","formattedNumber","tn","keypath","date","formattedDate","td","relativeDate","formattedRelativeDate","tdr","plural","count","parseInt","toString","customPluralRule","k","p","dv","tc","defaultValue","translationResult","hideIfEmpty","trim","html","Dynamic","component","tag","innerHTML","translationValue","I18nProvider","Provider","value","defaultLocale","routingStrategy","SolidI18n","BaseI18n","options","storage","setLocale","fallback","setRoute","lang","msgs","val","translations","merge","routeName","cb","createI18n","createSolidRouterAdapter","navigate","localeCodes","loc","setPathname","createEffect","pathSegments","split","length","includes","shift","cleanPath","fullPath","query","class","className","restProps","A","useI18n","injectedDef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AKA,CAAI,EACzD,WAAYA,EAAK,WAAW,KAAKA,CAAI,CAAA,CAEzC"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/injection.ts","../src/components/I18nGroup.tsx","../src/components/I18nLink.tsx","../src/components/I18nSwitcher.tsx","../src/components/I18nT.tsx","../src/context.tsx","../src/i18n.ts","../src/router/adapter.tsx","../src/use-i18n.ts"],"sourcesContent":["import type { Locale } from '@i18n-micro/types'\nimport { createContext, useContext } from 'solid-js'\nimport type { SolidI18n } from './i18n'\nimport type { I18nRoutingStrategy } from './router/types'\n\n// Context keys (analogous to Vue's InjectionKey)\nexport const I18nContext = createContext<SolidI18n>()\nexport const I18nLocalesContext = createContext<Locale[]>()\nexport const I18nDefaultLocaleContext = createContext<string>()\nexport const I18nRouterContext = createContext<I18nRoutingStrategy | undefined>()\n\n// Helper hooks (analogous to Vue's inject)\nexport const useI18nContext = () => {\n const context = useContext(I18nContext)\n if (!context) {\n throw new Error('[i18n-micro] I18nContext not found. Make sure I18nProvider is used.')\n }\n return context\n}\n\nexport const useI18nLocales = () => {\n const context = useContext(I18nLocalesContext)\n if (!context) {\n throw new Error('[i18n-micro] I18nLocalesContext not found. Make sure I18nLocalesContext is provided.')\n }\n return context\n}\n\nexport const useI18nDefaultLocale = () => {\n const context = useContext(I18nDefaultLocaleContext)\n if (!context) {\n throw new Error('[i18n-micro] I18nDefaultLocaleContext not found. Make sure I18nDefaultLocaleContext is provided.')\n }\n return context\n}\n\nexport const useI18nRouter = () => {\n return useContext(I18nRouterContext)\n}\n","// @ts-nocheck\n\nimport type { TranslationKey } from '@i18n-micro/types'\nimport { type Component, type JSX, splitProps } from 'solid-js'\nimport { useI18nContext } from '../injection'\n\ninterface I18nGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {\n prefix: string\n groupClass?: string\n}\n\nexport const I18nGroup: Component<I18nGroupProps> = (props): JSX.Element => {\n const i18n = useI18nContext()\n const [local, others] = splitProps(props, ['prefix', 'groupClass'])\n\n const translate = (key: string, params?: Record<string, string | number | boolean>): string => {\n // Use type assertion for dynamic keys with prefix\n // The developer is responsible for ensuring the key exists\n const result = i18n.t(`${local.prefix}.${key}` as TranslationKey, params, undefined, i18n.getRoute())\n return typeof result === 'string' ? result : String(result)\n }\n\n return (\n // @ts-expect-error - Type conflict with Vue JSX in monorepo\n (\n <div class={['i18n-group', local.groupClass].filter(Boolean).join(' ')} {...(others as unknown as JSX.HTMLAttributes<HTMLDivElement>)}>\n {typeof props.children === 'function'\n ? (\n props.children as (props: {\n prefix: string\n t: (key: string, params?: Record<string, string | number | boolean>) => string\n }) => JSX.Element\n )({ prefix: local.prefix, t: translate })\n : props.children}\n </div>\n ) as unknown as JSX.Element\n )\n}\n","// @ts-nocheck\nimport { type Accessor, type Component, createMemo, type JSX, splitProps } from 'solid-js'\nimport { useI18nContext, useI18nRouter } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\n\ninterface I18nLinkProps extends JSX.AnchorHTMLAttributes<HTMLAnchorElement> {\n to: string | { path?: string }\n localeRoute?: (to: string | { path?: string }, locale?: string) => string | { path?: string }\n activeStyle?: JSX.CSSProperties\n}\n\nexport const I18nLink: Component<I18nLinkProps> = (props): JSX.Element => {\n const router = useI18nRouter()\n const i18n = useI18nContext()\n // Разделяем пропсы: явно выделяем style, чтобы объединить его с activeStyle\n const [local, others] = splitProps(props, ['to', 'localeRoute', 'activeStyle', 'style', 'children'])\n\n // 1. Получаем accessor для текущего пути из роутера\n const extendedRouter = router as I18nRoutingStrategy & { getCurrentPathAccessor?: Accessor<string> }\n const pathnameAccessor = extendedRouter?.getCurrentPathAccessor\n\n // 2. Вычисление целевого пути (href) - реактивно отслеживает изменения локали\n const targetPath = createMemo(() => {\n // Используем реактивный accessor для отслеживания изменений локали\n const currentLocale = i18n.localeAccessor()\n let result: string\n if (local.localeRoute) {\n const res = local.localeRoute(local.to, currentLocale)\n result = typeof res === 'string' ? res : res?.path || '/'\n } else if (router?.resolvePath) {\n const res = router.resolvePath(local.to, currentLocale)\n result = typeof res === 'string' ? res : res?.path || '/'\n } else if (typeof local.to === 'string') {\n result = local.to\n } else {\n result = (local.to as { path?: string })?.path || '/'\n }\n return result\n })\n\n // 3. Проверка на внешнюю ссылку\n const isExternal = createMemo(() => {\n if (typeof local.to === 'string') {\n return /^(?:https?:\\/\\/|\\/\\/|[a-zA-Z0-9-]+\\.[a-zA-Z]{2,})|tel:|mailto:/.test(local.to)\n }\n return false\n })\n\n // 4. Вычисление активного состояния\n // Важно: вызываем pathnameAccessor() внутри createMemo для правильного отслеживания изменений\n const isActive = createMemo(() => {\n if (isExternal()) {\n return false\n }\n\n // Получаем текущий путь - вызываем accessor внутри createMemo для реактивности\n const current = pathnameAccessor\n ? pathnameAccessor() // Вызов accessor внутри createMemo отслеживает изменения\n : router\n ? router.getCurrentPath()\n : typeof window !== 'undefined'\n ? window.location.pathname\n : '/'\n const target = targetPath()\n\n // Нормализация для сравнения (убираем слэш в конце, если это не корень)\n const normCurrent = current === '/' ? '/' : current.replace(/\\/$/, '')\n const normTarget = target === '/' ? '/' : target.replace(/\\/$/, '')\n\n return normCurrent === normTarget\n })\n\n // 5. Объединение стилей - используем isActive напрямую для реактивности\n const mergedStyle = createMemo(() => {\n const baseStyle = local.style || {}\n // Вызываем isActive() внутри createMemo для отслеживания изменений\n const active = isActive()\n const activeStyle = active ? local.activeStyle || {} : {}\n\n // SolidJS умеет работать с объектами стилей корректно при слиянии\n return {\n ...(typeof baseStyle === 'object' ? baseStyle : {}),\n ...(typeof activeStyle === 'object' ? activeStyle : {}),\n } as JSX.CSSProperties\n })\n\n // Используем linkComponent из роутера, если доступен\n const LinkComponent = router?.linkComponent\n\n if (isExternal()) {\n return (\n // @ts-expect-error - Type conflict with Vue JSX\n (\n <a\n href={typeof local.to === 'string' ? local.to : ''}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={mergedStyle()}\n {...(others as unknown as JSX.AnchorHTMLAttributes<HTMLAnchorElement>)}\n >\n {local.children}\n </a>\n ) as unknown as JSX.Element\n )\n }\n\n // Если есть linkComponent из роутера (например, A из @solidjs/router), используем его\n if (LinkComponent) {\n return (\n // @ts-expect-error - Type conflict with router component types\n (\n <LinkComponent href={targetPath()} style={mergedStyle()} {...(others as unknown as Record<string, unknown>)}>\n {local.children}\n </LinkComponent>\n ) as unknown as JSX.Element\n )\n }\n\n // Fallback на нативный <a> с onClick обработчиком\n return (\n // @ts-expect-error - Type conflict with Vue JSX\n (\n <a\n href={targetPath()}\n style={mergedStyle()}\n {...(others as unknown as JSX.AnchorHTMLAttributes<HTMLAnchorElement>)}\n onClick={(e: MouseEvent) => {\n if (router && !isExternal()) {\n e.preventDefault()\n router.push({ path: targetPath() })\n }\n }}\n >\n {local.children}\n </a>\n ) as unknown as JSX.Element\n )\n}\n","// @ts-nocheck\n\nimport type { Locale } from '@i18n-micro/types'\nimport { type Accessor, type Component, createMemo, createSignal, type JSX, onCleanup, onMount, splitProps } from 'solid-js'\nimport { useI18nContext, useI18nLocales, useI18nRouter } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\n\ninterface I18nSwitcherProps extends JSX.HTMLAttributes<HTMLDivElement> {\n locales?: Locale[]\n currentLocale?: string | (() => string)\n getLocaleName?: () => string | null\n switchLocale?: (locale: string) => void\n localeRoute?: (to: string | { path?: string }, locale?: string) => string | { path?: string }\n customLabels?: Record<string, string>\n customWrapperStyle?: JSX.CSSProperties\n customButtonStyle?: JSX.CSSProperties\n customDropdownStyle?: JSX.CSSProperties\n customItemStyle?: JSX.CSSProperties\n customLinkStyle?: JSX.CSSProperties\n customActiveLinkStyle?: JSX.CSSProperties\n customDisabledLinkStyle?: JSX.CSSProperties\n customIconStyle?: JSX.CSSProperties\n}\n\nexport const I18nSwitcher: Component<I18nSwitcherProps> = (props): JSX.Element => {\n const i18n = useI18nContext()\n const router = useI18nRouter()\n const injectedLocales = useI18nLocales()\n\n const [local, others] = splitProps(props, [\n 'locales',\n 'currentLocale',\n 'getLocaleName',\n 'switchLocale',\n 'localeRoute',\n 'customLabels',\n 'customWrapperStyle',\n 'customButtonStyle',\n 'customDropdownStyle',\n 'customItemStyle',\n 'customLinkStyle',\n 'customActiveLinkStyle',\n 'customDisabledLinkStyle',\n 'customIconStyle',\n ])\n\n const [dropdownOpen, setDropdownOpen] = createSignal(false)\n let wrapperRef: HTMLDivElement | undefined\n\n const locales = createMemo(() => local.locales || injectedLocales || [])\n const currentLocale = createMemo(() => {\n if (local.currentLocale !== undefined) {\n return typeof local.currentLocale === 'function' ? local.currentLocale() : local.currentLocale\n }\n // Используем реактивный accessor для отслеживания изменений\n return i18n.localeAccessor()\n })\n const currentLocaleName = createMemo(() => {\n if (local.getLocaleName) {\n return local.getLocaleName() || null\n }\n // Используем реактивный accessor для отслеживания изменений\n const current = locales().find((l) => l.code === i18n.localeAccessor())\n return current?.displayName || null\n })\n\n const toggleDropdown = (event?: Event) => {\n if (event) {\n event.stopPropagation()\n event.preventDefault()\n }\n setDropdownOpen(!dropdownOpen())\n }\n\n const localeLabel = (localeItem: Locale): string => {\n const current = local.customLabels?.[localeItem.code] || localeItem.displayName\n return current || localeItem.code\n }\n\n const currentLocaleLabel = createMemo(() => {\n const current = locales().find((l) => l.code === currentLocale())\n return current ? localeLabel(current) : currentLocaleName() || currentLocale()\n })\n\n const handleSwitchLocale = async (code: string) => {\n setDropdownOpen(false)\n\n if (local.switchLocale) {\n local.switchLocale(code)\n return\n }\n\n i18n.locale = code\n\n if (!router) {\n return\n }\n\n // Используем accessor напрямую, если доступен, иначе fallback на getCurrentPath()\n const extendedRouter = router as I18nRoutingStrategy & { getCurrentPathAccessor?: Accessor<string> }\n const currentPath = extendedRouter.getCurrentPathAccessor ? extendedRouter.getCurrentPathAccessor() : router.getCurrentPath()\n const newPath = local.localeRoute\n ? (() => {\n const res = local.localeRoute(currentPath, code)\n return typeof res === 'string' ? res : res.path || '/'\n })()\n : router?.resolvePath\n ? (() => {\n const res = router.resolvePath(currentPath, code)\n return typeof res === 'string' ? res : res.path || '/'\n })()\n : currentPath\n\n router.push({ path: newPath })\n }\n\n // Default Styles\n const wrapperStyle: JSX.CSSProperties = {\n position: 'relative',\n display: 'inline-block',\n 'vertical-align': 'middle',\n }\n\n const buttonStyle: JSX.CSSProperties = {\n padding: '4px 12px',\n 'font-size': '16px',\n cursor: 'pointer',\n 'background-color': '#fff',\n border: '1px solid #333',\n transition: 'background-color 0.3s ease',\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'space-between',\n }\n\n const dropdownStyle: JSX.CSSProperties = {\n position: 'absolute',\n top: '100%',\n left: '0',\n 'z-index': 1000,\n 'background-color': '#fff',\n border: '1px solid #333',\n 'list-style': 'none',\n padding: '0',\n margin: '4px 0 0 0',\n 'min-width': '150px',\n 'box-shadow': '0 2px 8px rgba(0,0,0,0.15)',\n }\n\n const itemStyle: JSX.CSSProperties = {\n margin: '0',\n padding: '0',\n }\n\n const linkStyle: JSX.CSSProperties = {\n display: 'block',\n padding: '8px 12px',\n color: '#333',\n 'text-decoration': 'none',\n transition: 'background-color 0.3s ease',\n cursor: 'pointer',\n }\n\n const activeLinkStyle: JSX.CSSProperties = {\n 'font-weight': 'bold',\n color: '#007bff',\n }\n\n const iconStyle: JSX.CSSProperties = {\n 'margin-left': '8px',\n display: 'inline-block',\n transition: 'transform 0.3s ease',\n }\n\n const openIconStyle: JSX.CSSProperties = {\n transform: 'rotate(180deg)',\n }\n\n const handleClickOutside = (event: MouseEvent) => {\n if (!dropdownOpen()) return\n\n const target = event.target as HTMLElement\n if (!target || !wrapperRef) return\n\n const isClickInside = wrapperRef.contains(target)\n const isButtonClick = target.closest('.i18n-switcher-button') !== null\n\n if (!isClickInside && !isButtonClick) {\n setDropdownOpen(false)\n }\n }\n\n onMount(() => {\n document.addEventListener('click', handleClickOutside)\n })\n\n onCleanup(() => {\n document.removeEventListener('click', handleClickOutside)\n })\n\n return (\n <div\n // @ts-expect-error - ref type conflict with Vue JSX\n ref={(el: HTMLDivElement) => {\n wrapperRef = el\n }}\n class=\"i18n-switcher-wrapper\"\n style={{ ...wrapperStyle, ...local.customWrapperStyle }}\n {...(others as unknown as JSX.HTMLAttributes<HTMLDivElement>)}\n >\n <button\n type=\"button\"\n class=\"i18n-switcher-button\"\n style={{ ...buttonStyle, ...local.customButtonStyle }}\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n toggleDropdown(e)\n }}\n aria-haspopup=\"true\"\n aria-expanded={dropdownOpen()}\n >\n <span>{currentLocaleLabel()}</span>\n <span\n style={{\n ...iconStyle,\n ...(dropdownOpen() ? openIconStyle : {}),\n ...local.customIconStyle,\n }}\n >\n ▼\n </span>\n </button>\n\n {dropdownOpen() && (\n <ul class=\"i18n-switcher-dropdown\" style={{ ...dropdownStyle, ...local.customDropdownStyle }}>\n {locales().map((localeItem) => {\n const isActive = localeItem.code === currentLocale()\n // Используем accessor для реактивного отслеживания пути\n const extendedRouter = router as I18nRoutingStrategy & { getCurrentPathAccessor?: Accessor<string> }\n const currentPath = extendedRouter?.getCurrentPathAccessor\n ? extendedRouter.getCurrentPathAccessor()\n : router?.getCurrentPath() || (typeof window !== 'undefined' ? window.location.pathname : '/')\n const result = local.localeRoute\n ? local.localeRoute(currentPath, localeItem.code)\n : router?.resolvePath\n ? router.resolvePath(currentPath, localeItem.code)\n : currentPath\n const routeTo = typeof result === 'string' ? result : result?.path || '#'\n\n return (\n <li style={{ ...itemStyle, ...local.customItemStyle }}>\n <a\n class={`switcher-locale-${localeItem.code}`}\n href={typeof routeTo === 'string' ? routeTo : '#'}\n style={{\n ...linkStyle,\n ...(isActive ? activeLinkStyle : {}),\n ...local.customLinkStyle,\n ...(isActive ? local.customActiveLinkStyle : {}),\n }}\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n handleSwitchLocale(localeItem.code)\n }}\n >\n {localeLabel(localeItem)}\n </a>\n </li>\n )\n })}\n </ul>\n )}\n </div>\n ) as unknown as JSX.Element\n}\n","// @ts-nocheck\n\nimport type { PluralFunc, TranslationKey } from '@i18n-micro/types'\nimport { type Component, createMemo, type JSX, splitProps } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { useI18nContext } from '../injection'\n\ninterface I18nTProps extends JSX.HTMLAttributes<HTMLElement> {\n keypath: TranslationKey\n params?: Record<string, string | number | boolean>\n tag?: string\n plural?: number | string\n defaultValue?: string\n html?: boolean\n hideIfEmpty?: boolean\n customPluralRule?: PluralFunc\n number?: number | string\n date?: Date | string | number\n relativeDate?: Date | string | number\n}\n\nexport const I18nT: Component<I18nTProps> = (props): JSX.Element => {\n const i18n = useI18nContext()\n const [local, others] = splitProps(props, [\n 'keypath',\n 'params',\n 'tag',\n 'plural',\n 'defaultValue',\n 'html',\n 'hideIfEmpty',\n 'customPluralRule',\n 'number',\n 'date',\n 'relativeDate',\n ])\n\n // Используем createMemo для реактивности (отслеживает изменения локали и роута)\n // В Solid мемо автоматически отслеживает зависимости при использовании в JSX\n const translation = createMemo(() => {\n // Отслеживаем изменения локали и роута через accessors\n const locale = i18n.localeAccessor()\n const route = i18n.routeAccessor()\n\n // Handle number formatting\n if (local.number !== undefined) {\n const numberValue = Number(local.number)\n const formattedNumber = i18n.tn(numberValue)\n const result = i18n.t(local.keypath, { number: formattedNumber, ...(local.params || {}) }, undefined, route)\n return typeof result === 'string' ? result : String(result)\n }\n\n // Handle date formatting\n if (local.date !== undefined) {\n const formattedDate = i18n.td(local.date)\n const result = i18n.t(local.keypath, { date: formattedDate, ...(local.params || {}) }, undefined, route)\n return typeof result === 'string' ? result : String(result)\n }\n\n // Handle relative date formatting\n if (local.relativeDate !== undefined) {\n const formattedRelativeDate = i18n.tdr(local.relativeDate)\n const result = i18n.t(local.keypath, { relativeDate: formattedRelativeDate, ...(local.params || {}) }, undefined, route)\n return typeof result === 'string' ? result : String(result)\n }\n\n // Handle pluralization\n if (local.plural !== undefined) {\n const count = Number.parseInt(local.plural.toString(), 10)\n if (local.customPluralRule) {\n const translationResult = local.customPluralRule(\n local.keypath,\n count,\n local.params || {},\n locale,\n (k: TranslationKey, p?: Record<string, string | number | boolean>, dv?: string) => i18n.t(k, p, dv, route),\n )\n return translationResult || ''\n } else {\n return i18n.tc(local.keypath, { count, ...(local.params || {}) }, local.defaultValue)\n }\n }\n\n // Regular translation\n const translationResult = (i18n.t(local.keypath, local.params, local.defaultValue, route) ?? '').toString()\n\n if (local.hideIfEmpty && !translationResult.trim()) {\n return local.defaultValue || ''\n }\n\n return translationResult\n })\n\n // Если html=true, используем innerHTML и не рендерим children\n if (local.html) {\n return (\n // @ts-expect-error - Dynamic component type conflict with Vue JSX\n (\n <Dynamic component={local.tag || 'span'} {...(others as unknown as Record<string, unknown>)} innerHTML={translation()} />\n ) as unknown as JSX.Element\n )\n }\n\n // Если html=false, рендерим как текст (Solid автоматически экранирует HTML)\n const translationValue = translation()\n if (local.hideIfEmpty && !translationValue.trim()) {\n if (local.defaultValue) {\n return (\n <Dynamic component={local.tag || 'span'} {...(others as unknown as Record<string, unknown>)}>\n {local.defaultValue}\n </Dynamic>\n ) as unknown as JSX.Element\n }\n return null as unknown as JSX.Element\n }\n\n return (\n // @ts-expect-error - Dynamic component type conflict with Vue JSX\n (\n <Dynamic component={local.tag || 'span'} {...(others as unknown as Record<string, unknown>)}>\n {translationValue}\n </Dynamic>\n ) as unknown as JSX.Element\n )\n}\n","// @ts-nocheck\n\nimport type { Locale } from '@i18n-micro/types'\nimport type { JSX, ParentComponent } from 'solid-js'\nimport type { SolidI18n } from './i18n'\nimport { I18nContext, I18nDefaultLocaleContext, I18nLocalesContext, I18nRouterContext } from './injection'\nimport type { I18nRoutingStrategy } from './router/types'\n\nexport interface I18nProviderProps {\n i18n: SolidI18n\n locales?: Locale[]\n defaultLocale?: string\n routingStrategy?: I18nRoutingStrategy\n}\n\nexport const I18nProvider: ParentComponent<I18nProviderProps> = (props): JSX.Element => {\n const children = props.children as JSX.Element\n return (\n // @ts-expect-error - Provider components type conflict with Vue JSX\n (\n <I18nContext.Provider value={props.i18n}>\n {props.locales && (\n // @ts-expect-error - Provider components type conflict with Vue JSX\n <I18nLocalesContext.Provider value={props.locales}>\n {props.defaultLocale && (\n // @ts-expect-error - Provider components type conflict with Vue JSX\n <I18nDefaultLocaleContext.Provider value={props.defaultLocale}>\n {props.routingStrategy && (\n // @ts-expect-error - Provider components type conflict with Vue JSX\n <I18nRouterContext.Provider value={props.routingStrategy}>{children}</I18nRouterContext.Provider>\n )}\n {!props.routingStrategy && children}\n </I18nDefaultLocaleContext.Provider>\n )}\n {!props.defaultLocale && children}\n </I18nLocalesContext.Provider>\n )}\n {!props.locales && children}\n </I18nContext.Provider>\n ) as unknown as JSX.Element\n )\n}\n\n// Keep useI18nContext for backward compatibility\nexport { useI18nContext } from './injection'\n","import { BaseI18n, type TranslationStorage } from '@i18n-micro/core'\nimport type { PluralFunc, Translations } from '@i18n-micro/types'\nimport { type Accessor, createSignal, type Setter } from 'solid-js'\n\nexport interface SolidI18nOptions {\n locale: string\n fallbackLocale?: string\n messages?: Record<string, Translations>\n plural?: PluralFunc\n missingWarn?: boolean\n missingHandler?: (locale: string, key: string, routeName: string) => void\n}\n\nexport class SolidI18n extends BaseI18n {\n private _locale: Accessor<string>\n private _setLocale: Setter<string>\n private _fallbackLocale: Accessor<string>\n private _currentRoute: Accessor<string>\n private _setRoute: Setter<string>\n\n public readonly storage: TranslationStorage\n\n private listeners = new Set<() => void>()\n\n constructor(options: SolidI18nOptions) {\n const storage: TranslationStorage = {\n translations: new Map<string, Translations>(),\n }\n\n super({\n storage,\n plural: options.plural,\n missingWarn: options.missingWarn,\n missingHandler: options.missingHandler,\n })\n\n this.storage = storage\n\n const [locale, setLocale] = createSignal(options.locale)\n const [fallback] = createSignal(options.fallbackLocale || options.locale)\n const [route, setRoute] = createSignal('index')\n\n this._locale = locale\n this._setLocale = setLocale\n this._fallbackLocale = fallback\n this._currentRoute = route\n this._setRoute = setRoute\n\n if (options.messages) {\n for (const [lang, msgs] of Object.entries(options.messages)) {\n this.addTranslations(lang, msgs)\n }\n }\n }\n\n public getLocale(): string {\n return this._locale()\n }\n\n public getFallbackLocale(): string {\n return this._fallbackLocale()\n }\n\n public getRoute(): string {\n return this._currentRoute()\n }\n\n public set locale(val: string) {\n this._setLocale(val)\n this.notifyListeners()\n }\n\n public get locale(): string {\n return this._locale()\n }\n\n public get localeAccessor(): Accessor<string> {\n return this._locale\n }\n\n public get fallbackLocale(): string {\n return this._fallbackLocale()\n }\n\n public get currentRoute(): string {\n return this._currentRoute()\n }\n\n public get routeAccessor(): Accessor<string> {\n return this._currentRoute\n }\n\n public setRoute(val: string): void {\n this._setRoute(val)\n this.notifyListeners()\n }\n\n public addTranslations(locale: string, translations: Translations, merge = true): void {\n super.loadTranslationsCore(locale, translations, merge)\n this.notifyListeners()\n }\n\n public addRouteTranslations(locale: string, routeName: string, translations: Translations, merge = true): void {\n super.loadRouteTranslationsCore(locale, routeName, translations, merge)\n this.notifyListeners()\n }\n\n public override clearCache(): void {\n super.clearCache()\n this.notifyListeners()\n }\n\n public subscribe(cb: () => void): () => void {\n this.listeners.add(cb)\n return () => this.listeners.delete(cb)\n }\n\n private notifyListeners(): void {\n this.listeners.forEach((cb) => cb())\n }\n}\n\nexport function createI18n(options: SolidI18nOptions): SolidI18n {\n return new SolidI18n(options)\n}\n","// @ts-nocheck\n\nimport type { Locale } from '@i18n-micro/types'\nimport { A, type Location, type useNavigate } from '@solidjs/router'\nimport { type Accessor, type Component, createEffect, createSignal, type JSX } from 'solid-js'\nimport type { I18nRoutingStrategy } from './types'\n\ntype NavigateFunction = ReturnType<typeof useNavigate>\n\n/**\n * Factory for Solid Router adapter\n * Implements routing utilities for Solid Router\n * Uses @solidjs/router APIs for navigation and path resolution\n *\n * **IMPORTANT**: This function must be called inside a SolidJS component or reactive context\n * (e.g., inside a component function, not at module level). This is required because\n * `createSignal` and `createEffect` need to be within a reactive owner context.\n *\n * @example\n * ```tsx\n * const RouterRoot: Component = () => {\n * const navigate = useNavigate()\n * const location = useLocation()\n * const routingStrategy = createSolidRouterAdapter(\n * locales,\n * defaultLocale,\n * navigate,\n * location,\n * )\n * // ...\n * }\n * ```\n *\n * @param locales - Array of locale configurations\n * @param defaultLocale - Default locale code\n * @param navigate - Navigation function from @solidjs/router's useNavigate hook\n * @param location - Location object from @solidjs/router's useLocation hook\n * @returns I18nRoutingStrategy with reactive pathname accessor\n */\nexport function createSolidRouterAdapter(\n locales: Locale[],\n defaultLocale: string,\n navigate: NavigateFunction,\n location: Location,\n): I18nRoutingStrategy & { getCurrentPathAccessor: Accessor<string> } {\n const localeCodes = locales.map((loc) => loc.code)\n\n // Create signal to track pathname changes\n // NOTE: This requires a reactive context (component/effect), so this function\n // must be called inside a component, not at module level\n const [pathname, setPathname] = createSignal(location.pathname)\n\n // Track location.pathname changes\n // NOTE: createEffect requires a reactive owner, so this function must be called\n // inside a component or runWithOwner context\n createEffect(() => {\n setPathname(location.pathname)\n })\n\n const resolvePath = (to: string | { path?: string }, locale: string): string | { path?: string } => {\n const path = typeof to === 'string' ? to : to.path || '/'\n const pathSegments = path.split('/').filter(Boolean)\n\n if (pathSegments.length > 0 && localeCodes.includes(pathSegments[0])) {\n pathSegments.shift()\n }\n\n const cleanPath = `/${pathSegments.join('/')}`\n return locale === defaultLocale ? cleanPath : `/${locale}${cleanPath === '/' ? '' : cleanPath}`\n }\n\n return {\n getCurrentPath: () => pathname(), // Returns current value for compatibility\n getCurrentPathAccessor: pathname, // Returns accessor for reactivity\n\n push: (target: { path: string }) => {\n // Use navigate from @solidjs/router\n navigate(target.path)\n },\n\n replace: (target: { path: string }) => {\n // Use navigate with replace option\n navigate(target.path, { replace: true })\n },\n\n resolvePath: (to: string | { path?: string }, locale: string) => resolvePath(to, locale),\n\n getRoute: () => ({\n fullPath: pathname(),\n query: {},\n }),\n\n // Use A component from @solidjs/router\n linkComponent: ((props: { href: string; children?: JSX.Element; class?: string; style?: JSX.CSSProperties; [key: string]: unknown }) => {\n const { href, children, class: className, style, ...restProps } = props\n return (\n <A href={href} class={className} style={style} {...restProps}>\n {children}\n </A>\n ) as unknown as JSX.Element\n }) as unknown as Component<{\n href: string\n children?: JSX.Element\n style?: JSX.CSSProperties\n class?: string\n [key: string]: unknown\n }>,\n }\n}\n","import type { Locale } from '@i18n-micro/types'\nimport { createMemo } from 'solid-js'\nimport { useI18nContext, useI18nDefaultLocale, useI18nLocales, useI18nRouter } from './injection'\n\nexport interface UseI18nOptions {\n locales?: Locale[]\n defaultLocale?: string\n}\n\nexport function useI18n(options?: UseI18nOptions) {\n const i18n = useI18nContext()\n const router = useI18nRouter()\n const injectedLocales = useI18nLocales()\n const injectedDefaultLocale = useI18nDefaultLocale()\n\n const locales = options?.locales || injectedLocales\n const defaultLocale = options?.defaultLocale || injectedDefaultLocale\n\n const resolveLocalePath = (to: string | { path?: string }, localeCode?: string): string | { path?: string } => {\n if (!router?.resolvePath) {\n return to\n }\n return router.resolvePath(to, localeCode || i18n.getLocale())\n }\n\n return {\n // Direct access to instance\n instance: i18n,\n\n // Locale (reactive) - use accessor to track changes\n locale: createMemo(() => i18n.localeAccessor()),\n\n // Locale helpers\n getLocales: () => locales,\n defaultLocale: () => defaultLocale,\n getLocaleName: () => {\n // Use accessor for reactivity\n const current = locales.find((l) => l.code === i18n.localeAccessor())\n return current?.displayName || null\n },\n\n // Routing helpers\n localeRoute: resolveLocalePath,\n localePath: (to: string | { path?: string }, locale?: string): string => {\n const res = resolveLocalePath(to, locale)\n return typeof res === 'string' ? res : res.path || '/'\n },\n switchLocale: (newLocale: string) => {\n i18n.locale = newLocale\n if (router) {\n const currentPath = router.getCurrentPath()\n const newPath = resolveLocalePath(currentPath, newLocale)\n router.push(typeof newPath === 'string' ? { path: newPath } : { path: newPath.path || '/' })\n }\n },\n\n // Translation methods (delegate to instance)\n t: i18n.t.bind(i18n),\n ts: i18n.ts.bind(i18n),\n tc: i18n.tc.bind(i18n),\n tn: i18n.tn.bind(i18n),\n td: i18n.td.bind(i18n),\n tdr: i18n.tdr.bind(i18n),\n has: i18n.has.bind(i18n),\n\n // Route management\n setRoute: i18n.setRoute.bind(i18n),\n getRoute: i18n.getRoute.bind(i18n),\n getLocale: () => i18n.getLocale(),\n\n // Translation management\n addTranslations: i18n.addTranslations.bind(i18n),\n addRouteTranslations: i18n.addRouteTranslations.bind(i18n),\n clearCache: i18n.clearCache.bind(i18n),\n }\n}\n"],"names":["I18nContext","createContext","I18nLocalesContext","I18nDefaultLocaleContext","I18nRouterContext","useI18nContext","context","useContext","useI18nLocales","useI18nDefaultLocale","useI18nRouter","I18nGroup","props","i18n","local","others","splitProps","translate","key","params","result","t","prefix","undefined","getRoute","String","_el$","_tmpl$","_$spread","_$mergeProps","groupClass","filter","Boolean","join","_$insert","_c$","_$memo","children","I18nLink","router","pathnameAccessor","getCurrentPathAccessor","targetPath","createMemo","currentLocale","localeAccessor","localeRoute","res","to","path","resolvePath","isExternal","test","isActive","current","getCurrentPath","window","location","pathname","target","normCurrent","replace","normTarget","mergedStyle","baseStyle","style","activeStyle","LinkComponent","linkComponent","href","_$createComponent","_el$2","_tmpl$2","e","preventDefault","push","I18nSwitcher","injectedLocales","dropdownOpen","setDropdownOpen","createSignal","wrapperRef","locales","currentLocaleName","getLocaleName","find","l","code","displayName","toggleDropdown","event","stopPropagation","localeLabel","localeItem","customLabels","currentLocaleLabel","handleSwitchLocale","switchLocale","locale","extendedRouter","currentPath","newPath","wrapperStyle","position","display","buttonStyle","padding","cursor","border","transition","dropdownStyle","top","left","margin","itemStyle","linkStyle","color","activeLinkStyle","iconStyle","openIconStyle","transform","handleClickOutside","isClickInside","contains","isButtonClick","closest","onMount","document","addEventListener","onCleanup","removeEventListener","firstChild","_el$3","_el$4","nextSibling","_$use","el","customWrapperStyle","$$click","_el$5","map","routeTo","_el$6","_tmpl$3","_el$7","_$setAttribute","_$effect","_p$","_v$4","customItemStyle","_v$5","_v$6","customLinkStyle","customActiveLinkStyle","_$style","_$className","a","_$p","customDropdownStyle","_v$","customButtonStyle","_v$2","_v$3","customIconStyle","_$delegateEvents","I18nT","translation","route","routeAccessor","number","numberValue","Number","formattedNumber","tn","keypath","date","formattedDate","td","relativeDate","formattedRelativeDate","tdr","plural","count","parseInt","toString","customPluralRule","k","p","dv","tc","defaultValue","translationResult","hideIfEmpty","trim","html","Dynamic","component","tag","innerHTML","translationValue","I18nProvider","Provider","value","defaultLocale","routingStrategy","SolidI18n","BaseI18n","options","storage","setLocale","fallback","setRoute","lang","msgs","val","translations","merge","routeName","cb","createI18n","createSolidRouterAdapter","navigate","localeCodes","loc","setPathname","createEffect","pathSegments","split","length","includes","shift","cleanPath","fullPath","query","class","className","restProps","A","useI18n","injectedDefaultLocale","resolveLocalePath","localeCode","newLocale"],"mappings":"kMAMaA,EAAcC,EAAAA,cAAA,EACdC,EAAqBD,EAAAA,cAAA,EACrBE,EAA2BF,EAAAA,cAAA,EAC3BG,EAAoBH,EAAAA,cAAA,EAGpBI,EAAiB,IAAM,CAClC,MAAMC,EAAUC,EAAAA,WAAWP,CAAW,EACtC,GAAI,CAACM,EACH,MAAM,IAAI,MAAM,qEAAqE,EAEvF,OAAOA,CACT,EAEaE,EAAiB,IAAM,CAClC,MAAMF,EAAUC,EAAAA,WAAWL,CAAkB,EAC7C,GAAI,CAACI,EACH,MAAM,IAAI,MAAM,sFAAsF,EAExG,OAAOA,CACT,EAEaG,EAAuB,IAAM,CACxC,MAAMH,EAAUC,EAAAA,WAAWJ,CAAwB,EACnD,GAAI,CAACG,EACH,MAAM,IAAI,MAAM,kGAAkG,EAEpH,OAAOA,CACT,EAEaI,EAAgB,IACpBH,EAAAA,WAAWH,CAAiB,6BC1B9B,MAAMO,GAAwCC,GAAuB,CAC1E,MAAMC,EAAOR,EAAAA,EACP,CAACS,EAAOC,CAAM,EAAIC,EAAAA,WAAWJ,EAAO,CAAC,SAAU,YAAY,CAAC,EAE5DK,EAAYA,CAACC,EAAaC,IAA+D,CAG7F,MAAMC,EAASP,EAAKQ,EAAE,GAAGP,EAAMQ,MAAM,IAAIJ,CAAG,GAAsBC,EAAQI,OAA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B,GAAIA,EAAK,GAAG,KAAKA,CAAI,EACrB,GAAIA,EAAK,GAAG,KAAKA,CAAI,EACrB,GAAIA,EAAK,GAAG,KAAKA,CAAI,EACrB,IAAKA,EAAK,IAAI,KAAKA,CAAI,EACvB,IAAKA,EAAK,IAAI,KAAKA,CAAI,EAGvB,SAAUA,EAAK,SAAS,KAAKA,CAAI,EACjC,SAAUA,EAAK,SAAS,KAAKA,CAAI,EACjC,UAAW,IAAMA,EAAK,UAAA,EAGtB,gBAAiBA,EAAK,gBAAgB,KAAKA,CAAI,EAC/C,qBAAsBA,EAAK,qBAAqB,KAAKA,CAAI,EACzD,WAAYA,EAAK,WAAW,KAAKA,CAAI,CAAA,CAEzC"}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { Accessor } from 'solid-js';
|
|
2
|
+
import { BaseI18n } from '@i18n-micro/core';
|
|
3
|
+
import { CleanTranslation } from '@i18n-micro/types';
|
|
4
|
+
import { Component } from 'solid-js';
|
|
5
|
+
import { Context } from 'solid-js';
|
|
6
|
+
import { defaultPlural } from '@i18n-micro/core';
|
|
7
|
+
import { FormatService } from '@i18n-micro/core';
|
|
8
|
+
import { Getter } from '@i18n-micro/types';
|
|
9
|
+
import { interpolate } from '@i18n-micro/core';
|
|
10
|
+
import { JSX } from 'solid-js';
|
|
11
|
+
import { Locale } from '@i18n-micro/types';
|
|
12
|
+
import { LocaleCode } from '@i18n-micro/types';
|
|
13
|
+
import { Location as Location_2 } from '@solidjs/router';
|
|
14
|
+
import { ModuleOptions } from '@i18n-micro/types';
|
|
15
|
+
import { Params } from '@i18n-micro/types';
|
|
16
|
+
import { ParentComponent } from 'solid-js';
|
|
17
|
+
import { PluralFunc } from '@i18n-micro/types';
|
|
18
|
+
import { TranslationKey } from '@i18n-micro/types';
|
|
19
|
+
import { Translations } from '@i18n-micro/types';
|
|
20
|
+
import { TranslationStorage } from '@i18n-micro/core';
|
|
21
|
+
import { useNavigate } from '@solidjs/router';
|
|
22
|
+
|
|
23
|
+
export { CleanTranslation }
|
|
24
|
+
|
|
25
|
+
export declare function createI18n(options: SolidI18nOptions): SolidI18n;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Factory for Solid Router adapter
|
|
29
|
+
* Implements routing utilities for Solid Router
|
|
30
|
+
* Uses @solidjs/router APIs for navigation and path resolution
|
|
31
|
+
*
|
|
32
|
+
* **IMPORTANT**: This function must be called inside a SolidJS component or reactive context
|
|
33
|
+
* (e.g., inside a component function, not at module level). This is required because
|
|
34
|
+
* `createSignal` and `createEffect` need to be within a reactive owner context.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* const RouterRoot: Component = () => {
|
|
39
|
+
* const navigate = useNavigate()
|
|
40
|
+
* const location = useLocation()
|
|
41
|
+
* const routingStrategy = createSolidRouterAdapter(
|
|
42
|
+
* locales,
|
|
43
|
+
* defaultLocale,
|
|
44
|
+
* navigate,
|
|
45
|
+
* location,
|
|
46
|
+
* )
|
|
47
|
+
* // ...
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @param locales - Array of locale configurations
|
|
52
|
+
* @param defaultLocale - Default locale code
|
|
53
|
+
* @param navigate - Navigation function from @solidjs/router's useNavigate hook
|
|
54
|
+
* @param location - Location object from @solidjs/router's useLocation hook
|
|
55
|
+
* @returns I18nRoutingStrategy with reactive pathname accessor
|
|
56
|
+
*/
|
|
57
|
+
export declare function createSolidRouterAdapter(locales: Locale[], defaultLocale: string, navigate: NavigateFunction, location: Location_2): I18nRoutingStrategy & {
|
|
58
|
+
getCurrentPathAccessor: Accessor<string>;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export { defaultPlural }
|
|
62
|
+
|
|
63
|
+
export { FormatService }
|
|
64
|
+
|
|
65
|
+
export { Getter }
|
|
66
|
+
|
|
67
|
+
export declare const I18nContext: Context<SolidI18n | undefined>;
|
|
68
|
+
|
|
69
|
+
export declare const I18nDefaultLocaleContext: Context<string | undefined>;
|
|
70
|
+
|
|
71
|
+
export declare const I18nGroup: Component<I18nGroupProps>;
|
|
72
|
+
|
|
73
|
+
declare interface I18nGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
74
|
+
prefix: string;
|
|
75
|
+
groupClass?: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export declare const I18nLink: Component<I18nLinkProps>;
|
|
79
|
+
|
|
80
|
+
declare interface I18nLinkProps extends JSX.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
81
|
+
to: string | {
|
|
82
|
+
path?: string;
|
|
83
|
+
};
|
|
84
|
+
localeRoute?: (to: string | {
|
|
85
|
+
path?: string;
|
|
86
|
+
}, locale?: string) => string | {
|
|
87
|
+
path?: string;
|
|
88
|
+
};
|
|
89
|
+
activeStyle?: JSX.CSSProperties;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export declare const I18nLocalesContext: Context<Locale[] | undefined>;
|
|
93
|
+
|
|
94
|
+
export declare const I18nProvider: ParentComponent<I18nProviderProps>;
|
|
95
|
+
|
|
96
|
+
export declare interface I18nProviderProps {
|
|
97
|
+
i18n: SolidI18n;
|
|
98
|
+
locales?: Locale[];
|
|
99
|
+
defaultLocale?: string;
|
|
100
|
+
routingStrategy?: I18nRoutingStrategy;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export declare const I18nRouterContext: Context<I18nRoutingStrategy | undefined>;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Routing strategy interface for i18n
|
|
107
|
+
* Implement this interface to integrate with any router library
|
|
108
|
+
* Matches Vue package interface for consistency
|
|
109
|
+
*/
|
|
110
|
+
export declare interface I18nRoutingStrategy {
|
|
111
|
+
/**
|
|
112
|
+
* Returns current path (without locale prefix if needed, or full path)
|
|
113
|
+
* Used for determining active classes in links
|
|
114
|
+
* Note: For SolidJS, this should return the current value synchronously.
|
|
115
|
+
* For reactive updates, use `getCurrentPathAccessor` instead.
|
|
116
|
+
*/
|
|
117
|
+
getCurrentPath: () => string;
|
|
118
|
+
/**
|
|
119
|
+
* (SolidJS-specific, highly recommended) Returns reactive accessor for current path
|
|
120
|
+
* This is REQUIRED for proper reactivity in SolidJS components.
|
|
121
|
+
* Without this, active link states and path-dependent UI won't update reactively.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```tsx
|
|
125
|
+
* const pathnameAccessor = router.getCurrentPathAccessor?.()
|
|
126
|
+
* // Use inside createMemo for reactivity:
|
|
127
|
+
* const currentPath = createMemo(() => pathnameAccessor?.() ?? router.getCurrentPath())
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
getCurrentPathAccessor?: () => Accessor<string>;
|
|
131
|
+
/**
|
|
132
|
+
* Component to use for rendering links (e.g., RouterLink)
|
|
133
|
+
*/
|
|
134
|
+
linkComponent?: string | Component<{
|
|
135
|
+
href: string;
|
|
136
|
+
children?: JSX.Element;
|
|
137
|
+
style?: JSX.CSSProperties;
|
|
138
|
+
class?: string;
|
|
139
|
+
[key: string]: unknown;
|
|
140
|
+
}>;
|
|
141
|
+
/**
|
|
142
|
+
* Function to navigate to another route/locale
|
|
143
|
+
*/
|
|
144
|
+
push: (target: {
|
|
145
|
+
path: string;
|
|
146
|
+
}) => void;
|
|
147
|
+
/**
|
|
148
|
+
* Function to replace current route
|
|
149
|
+
*/
|
|
150
|
+
replace: (target: {
|
|
151
|
+
path: string;
|
|
152
|
+
}) => void;
|
|
153
|
+
/**
|
|
154
|
+
* Generate path for specific locale
|
|
155
|
+
*/
|
|
156
|
+
resolvePath?: (to: string | {
|
|
157
|
+
path?: string;
|
|
158
|
+
}, locale: string) => string | {
|
|
159
|
+
path?: string;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* (Optional) Get current route object for SEO/Meta tags
|
|
163
|
+
*/
|
|
164
|
+
getRoute?: () => {
|
|
165
|
+
fullPath: string;
|
|
166
|
+
query: Record<string, unknown>;
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export declare const I18nSwitcher: Component<I18nSwitcherProps>;
|
|
171
|
+
|
|
172
|
+
declare interface I18nSwitcherProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
173
|
+
locales?: Locale[];
|
|
174
|
+
currentLocale?: string | (() => string);
|
|
175
|
+
getLocaleName?: () => string | null;
|
|
176
|
+
switchLocale?: (locale: string) => void;
|
|
177
|
+
localeRoute?: (to: string | {
|
|
178
|
+
path?: string;
|
|
179
|
+
}, locale?: string) => string | {
|
|
180
|
+
path?: string;
|
|
181
|
+
};
|
|
182
|
+
customLabels?: Record<string, string>;
|
|
183
|
+
customWrapperStyle?: JSX.CSSProperties;
|
|
184
|
+
customButtonStyle?: JSX.CSSProperties;
|
|
185
|
+
customDropdownStyle?: JSX.CSSProperties;
|
|
186
|
+
customItemStyle?: JSX.CSSProperties;
|
|
187
|
+
customLinkStyle?: JSX.CSSProperties;
|
|
188
|
+
customActiveLinkStyle?: JSX.CSSProperties;
|
|
189
|
+
customDisabledLinkStyle?: JSX.CSSProperties;
|
|
190
|
+
customIconStyle?: JSX.CSSProperties;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export declare const I18nT: Component<I18nTProps>;
|
|
194
|
+
|
|
195
|
+
declare interface I18nTProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
196
|
+
keypath: TranslationKey;
|
|
197
|
+
params?: Record<string, string | number | boolean>;
|
|
198
|
+
tag?: string;
|
|
199
|
+
plural?: number | string;
|
|
200
|
+
defaultValue?: string;
|
|
201
|
+
html?: boolean;
|
|
202
|
+
hideIfEmpty?: boolean;
|
|
203
|
+
customPluralRule?: PluralFunc;
|
|
204
|
+
number?: number | string;
|
|
205
|
+
date?: Date | string | number;
|
|
206
|
+
relativeDate?: Date | string | number;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export { interpolate }
|
|
210
|
+
|
|
211
|
+
export { Locale }
|
|
212
|
+
|
|
213
|
+
export { LocaleCode }
|
|
214
|
+
|
|
215
|
+
export { ModuleOptions }
|
|
216
|
+
|
|
217
|
+
declare type NavigateFunction = ReturnType<typeof useNavigate>;
|
|
218
|
+
|
|
219
|
+
export { Params }
|
|
220
|
+
|
|
221
|
+
export { PluralFunc }
|
|
222
|
+
|
|
223
|
+
export declare class SolidI18n extends BaseI18n {
|
|
224
|
+
private _locale;
|
|
225
|
+
private _setLocale;
|
|
226
|
+
private _fallbackLocale;
|
|
227
|
+
private _currentRoute;
|
|
228
|
+
private _setRoute;
|
|
229
|
+
readonly storage: TranslationStorage;
|
|
230
|
+
private listeners;
|
|
231
|
+
constructor(options: SolidI18nOptions);
|
|
232
|
+
getLocale(): string;
|
|
233
|
+
getFallbackLocale(): string;
|
|
234
|
+
getRoute(): string;
|
|
235
|
+
set locale(val: string);
|
|
236
|
+
get locale(): string;
|
|
237
|
+
get localeAccessor(): Accessor<string>;
|
|
238
|
+
get fallbackLocale(): string;
|
|
239
|
+
get currentRoute(): string;
|
|
240
|
+
get routeAccessor(): Accessor<string>;
|
|
241
|
+
setRoute(val: string): void;
|
|
242
|
+
addTranslations(locale: string, translations: Translations, merge?: boolean): void;
|
|
243
|
+
addRouteTranslations(locale: string, routeName: string, translations: Translations, merge?: boolean): void;
|
|
244
|
+
clearCache(): void;
|
|
245
|
+
subscribe(cb: () => void): () => void;
|
|
246
|
+
private notifyListeners;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export declare interface SolidI18nOptions {
|
|
250
|
+
locale: string;
|
|
251
|
+
fallbackLocale?: string;
|
|
252
|
+
messages?: Record<string, Translations>;
|
|
253
|
+
plural?: PluralFunc;
|
|
254
|
+
missingWarn?: boolean;
|
|
255
|
+
missingHandler?: (locale: string, key: string, routeName: string) => void;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export { TranslationKey }
|
|
259
|
+
|
|
260
|
+
export { Translations }
|
|
261
|
+
|
|
262
|
+
export declare function useI18n(options?: UseI18nOptions): {
|
|
263
|
+
instance: SolidI18n;
|
|
264
|
+
locale: Accessor<string>;
|
|
265
|
+
getLocales: () => Locale[];
|
|
266
|
+
defaultLocale: () => string;
|
|
267
|
+
getLocaleName: () => string | null;
|
|
268
|
+
localeRoute: (to: string | {
|
|
269
|
+
path?: string;
|
|
270
|
+
}, localeCode?: string) => string | {
|
|
271
|
+
path?: string;
|
|
272
|
+
};
|
|
273
|
+
localePath: (to: string | {
|
|
274
|
+
path?: string;
|
|
275
|
+
}, locale?: string) => string;
|
|
276
|
+
switchLocale: (newLocale: string) => void;
|
|
277
|
+
t: (key: TranslationKey, params?: Params, defaultValue?: string | null, routeName?: string) => CleanTranslation;
|
|
278
|
+
ts: (key: TranslationKey, params?: Params, defaultValue?: string, routeName?: string) => string;
|
|
279
|
+
tc: (key: TranslationKey, count: number | Params, defaultValue?: string) => string;
|
|
280
|
+
tn: (value: number, options?: Intl.NumberFormatOptions) => string;
|
|
281
|
+
td: (value: Date | number | string, options?: Intl.DateTimeFormatOptions) => string;
|
|
282
|
+
tdr: (value: Date | number | string, options?: Intl.RelativeTimeFormatOptions) => string;
|
|
283
|
+
has: (key: TranslationKey, routeName?: string) => boolean;
|
|
284
|
+
setRoute: (val: string) => void;
|
|
285
|
+
getRoute: () => string;
|
|
286
|
+
getLocale: () => string;
|
|
287
|
+
addTranslations: (locale: string, translations: Translations, merge?: boolean) => void;
|
|
288
|
+
addRouteTranslations: (locale: string, routeName: string, translations: Translations, merge?: boolean) => void;
|
|
289
|
+
clearCache: () => void;
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
export declare const useI18nContext: () => SolidI18n;
|
|
293
|
+
|
|
294
|
+
export declare const useI18nDefaultLocale: () => string;
|
|
295
|
+
|
|
296
|
+
export declare const useI18nLocales: () => Locale[];
|
|
297
|
+
|
|
298
|
+
export declare interface UseI18nOptions {
|
|
299
|
+
locales?: Locale[];
|
|
300
|
+
defaultLocale?: string;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export declare const useI18nRouter: () => I18nRoutingStrategy | undefined;
|
|
304
|
+
|
|
305
|
+
export { }
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseI18n as dt } from "@i18n-micro/core";
|
|
2
2
|
import { FormatService as Ot, defaultPlural as Wt, interpolate as Ht } from "@i18n-micro/core";
|
|
3
|
-
import { spread as T, mergeProps as
|
|
3
|
+
import { spread as T, mergeProps as x, insert as S, memo as v, template as C, createComponent as k, use as ft, setAttribute as K, effect as W, style as I, className as ht, delegateEvents as pt, Dynamic as H } from "solid-js/web";
|
|
4
4
|
import { createContext as E, useContext as j, splitProps as V, createMemo as P, createSignal as A, onMount as gt, onCleanup as mt, createEffect as yt } from "solid-js";
|
|
5
5
|
import { A as vt } from "@solidjs/router";
|
|
6
6
|
const Q = E(), U = E(), X = E(), Y = E(), D = () => {
|
|
@@ -29,11 +29,11 @@ const At = (r) => {
|
|
|
29
29
|
// @ts-expect-error - Type conflict with Vue JSX in monorepo
|
|
30
30
|
(() => {
|
|
31
31
|
var f = bt();
|
|
32
|
-
return T(f,
|
|
32
|
+
return T(f, x({
|
|
33
33
|
get class() {
|
|
34
34
|
return ["i18n-group", e.groupClass].filter(Boolean).join(" ");
|
|
35
35
|
}
|
|
36
|
-
}, o), !1, !0),
|
|
36
|
+
}, o), !1, !0), S(f, (() => {
|
|
37
37
|
var h = v(() => typeof r.children == "function");
|
|
38
38
|
return () => h() ? r.children({
|
|
39
39
|
prefix: e.prefix,
|
|
@@ -72,18 +72,18 @@ const Dt = (r) => {
|
|
|
72
72
|
// @ts-expect-error - Type conflict with Vue JSX
|
|
73
73
|
(() => {
|
|
74
74
|
var i = Pt();
|
|
75
|
-
return T(i,
|
|
75
|
+
return T(i, x({
|
|
76
76
|
get href() {
|
|
77
77
|
return v(() => typeof o.to == "string")() ? o.to : "";
|
|
78
78
|
},
|
|
79
79
|
get style() {
|
|
80
80
|
return l();
|
|
81
81
|
}
|
|
82
|
-
}, n), !1, !0),
|
|
82
|
+
}, n), !1, !0), S(i, () => o.children), i;
|
|
83
83
|
})()
|
|
84
84
|
) : g ? (
|
|
85
85
|
// @ts-expect-error - Type conflict with router component types
|
|
86
|
-
k(g,
|
|
86
|
+
k(g, x({
|
|
87
87
|
get href() {
|
|
88
88
|
return c();
|
|
89
89
|
},
|
|
@@ -99,7 +99,7 @@ const Dt = (r) => {
|
|
|
99
99
|
// @ts-expect-error - Type conflict with Vue JSX
|
|
100
100
|
(() => {
|
|
101
101
|
var i = kt();
|
|
102
|
-
return T(i,
|
|
102
|
+
return T(i, x({
|
|
103
103
|
get href() {
|
|
104
104
|
return c();
|
|
105
105
|
},
|
|
@@ -112,11 +112,11 @@ const Dt = (r) => {
|
|
|
112
112
|
path: c()
|
|
113
113
|
}));
|
|
114
114
|
}
|
|
115
|
-
}), !1, !0),
|
|
115
|
+
}), !1, !0), S(i, () => o.children), i;
|
|
116
116
|
})()
|
|
117
117
|
);
|
|
118
118
|
};
|
|
119
|
-
var
|
|
119
|
+
var xt = /* @__PURE__ */ C("<div class=i18n-switcher-wrapper><button type=button class=i18n-switcher-button aria-haspopup=true><span></span><span>▼"), Rt = /* @__PURE__ */ C("<ul class=i18n-switcher-dropdown>"), St = /* @__PURE__ */ C("<li><a>");
|
|
120
120
|
const Nt = (r) => {
|
|
121
121
|
const t = D(), e = F(), o = tt(), [n, f] = V(r, ["locales", "currentLocale", "getLocaleName", "switchLocale", "localeRoute", "customLabels", "customWrapperStyle", "customButtonStyle", "customDropdownStyle", "customItemStyle", "customLinkStyle", "customActiveLinkStyle", "customDisabledLinkStyle", "customIconStyle"]), [h, c] = A(!1);
|
|
122
122
|
let a;
|
|
@@ -132,13 +132,13 @@ const Nt = (r) => {
|
|
|
132
132
|
}
|
|
133
133
|
if (t.locale = u, !e)
|
|
134
134
|
return;
|
|
135
|
-
const m = e,
|
|
136
|
-
const d = n.localeRoute(
|
|
135
|
+
const m = e, R = m.getCurrentPathAccessor ? m.getCurrentPathAccessor() : e.getCurrentPath(), w = n.localeRoute ? (() => {
|
|
136
|
+
const d = n.localeRoute(R, u);
|
|
137
137
|
return typeof d == "string" ? d : d.path || "/";
|
|
138
138
|
})() : e?.resolvePath ? (() => {
|
|
139
|
-
const d = e.resolvePath(
|
|
139
|
+
const d = e.resolvePath(R, u);
|
|
140
140
|
return typeof d == "string" ? d : d.path || "/";
|
|
141
|
-
})() :
|
|
141
|
+
})() : R;
|
|
142
142
|
e.push({
|
|
143
143
|
path: w
|
|
144
144
|
});
|
|
@@ -191,18 +191,18 @@ const Nt = (r) => {
|
|
|
191
191
|
if (!h()) return;
|
|
192
192
|
const m = u.target;
|
|
193
193
|
if (!m || !a) return;
|
|
194
|
-
const
|
|
195
|
-
!
|
|
194
|
+
const R = a.contains(m), w = m.closest(".i18n-switcher-button") !== null;
|
|
195
|
+
!R && !w && c(!1);
|
|
196
196
|
};
|
|
197
197
|
return gt(() => {
|
|
198
198
|
document.addEventListener("click", Z);
|
|
199
199
|
}), mt(() => {
|
|
200
200
|
document.removeEventListener("click", Z);
|
|
201
201
|
}), (() => {
|
|
202
|
-
var u =
|
|
203
|
-
return
|
|
202
|
+
var u = xt(), m = u.firstChild, R = m.firstChild, w = R.nextSibling;
|
|
203
|
+
return ft((d) => {
|
|
204
204
|
a = d;
|
|
205
|
-
}, u), T(u,
|
|
205
|
+
}, u), T(u, x({
|
|
206
206
|
get style() {
|
|
207
207
|
return {
|
|
208
208
|
...et,
|
|
@@ -211,17 +211,17 @@ const Nt = (r) => {
|
|
|
211
211
|
}
|
|
212
212
|
}, f), !1, !0), m.$$click = (d) => {
|
|
213
213
|
d.preventDefault(), d.stopPropagation(), i(d);
|
|
214
|
-
},
|
|
214
|
+
}, S(R, y), S(u, (() => {
|
|
215
215
|
var d = v(() => !!h());
|
|
216
216
|
return () => d() && (() => {
|
|
217
|
-
var _ =
|
|
218
|
-
return
|
|
217
|
+
var _ = Rt();
|
|
218
|
+
return S(_, () => s().map((L) => {
|
|
219
219
|
const N = L.code === l(), q = e, B = q?.getCurrentPathAccessor ? q.getCurrentPathAccessor() : e?.getCurrentPath() || (typeof window < "u" ? window.location.pathname : "/"), z = n.localeRoute ? n.localeRoute(B, L.code) : e?.resolvePath ? e.resolvePath(B, L.code) : B, G = typeof z == "string" ? z : z?.path || "#";
|
|
220
220
|
return (() => {
|
|
221
|
-
var O =
|
|
221
|
+
var O = St(), $ = O.firstChild;
|
|
222
222
|
return $.$$click = (b) => {
|
|
223
223
|
b.preventDefault(), b.stopPropagation(), M(L.code);
|
|
224
|
-
}, K($, "href", typeof G == "string" ? G : "#"),
|
|
224
|
+
}, K($, "href", typeof G == "string" ? G : "#"), S($, () => p(L)), W((b) => {
|
|
225
225
|
var it = {
|
|
226
226
|
...ot,
|
|
227
227
|
...n.customItemStyle
|
|
@@ -231,7 +231,7 @@ const Nt = (r) => {
|
|
|
231
231
|
...n.customLinkStyle,
|
|
232
232
|
...N ? n.customActiveLinkStyle : {}
|
|
233
233
|
};
|
|
234
|
-
return b.e = I(O, it, b.e), J !== b.t &&
|
|
234
|
+
return b.e = I(O, it, b.e), J !== b.t && ht($, b.t = J), b.a = I($, ut, b.a), b;
|
|
235
235
|
}, {
|
|
236
236
|
e: void 0,
|
|
237
237
|
t: void 0,
|
|
@@ -260,7 +260,7 @@ const Nt = (r) => {
|
|
|
260
260
|
}), u;
|
|
261
261
|
})();
|
|
262
262
|
};
|
|
263
|
-
|
|
263
|
+
pt(["click"]);
|
|
264
264
|
const Tt = (r) => {
|
|
265
265
|
const t = D(), [e, o] = V(r, ["keypath", "params", "tag", "plural", "defaultValue", "html", "hideIfEmpty", "customPluralRule", "number", "date", "relativeDate"]), n = P(() => {
|
|
266
266
|
const h = t.localeAccessor(), c = t.routeAccessor();
|
|
@@ -298,7 +298,7 @@ const Tt = (r) => {
|
|
|
298
298
|
if (e.html)
|
|
299
299
|
return (
|
|
300
300
|
// @ts-expect-error - Dynamic component type conflict with Vue JSX
|
|
301
|
-
k(H,
|
|
301
|
+
k(H, x({
|
|
302
302
|
get component() {
|
|
303
303
|
return e.tag || "span";
|
|
304
304
|
}
|
|
@@ -309,7 +309,7 @@ const Tt = (r) => {
|
|
|
309
309
|
}))
|
|
310
310
|
);
|
|
311
311
|
const f = n();
|
|
312
|
-
return e.hideIfEmpty && !f.trim() ? e.defaultValue ? k(H,
|
|
312
|
+
return e.hideIfEmpty && !f.trim() ? e.defaultValue ? k(H, x({
|
|
313
313
|
get component() {
|
|
314
314
|
return e.tag || "span";
|
|
315
315
|
}
|
|
@@ -319,7 +319,7 @@ const Tt = (r) => {
|
|
|
319
319
|
}
|
|
320
320
|
})) : null : (
|
|
321
321
|
// @ts-expect-error - Dynamic component type conflict with Vue JSX
|
|
322
|
-
k(H,
|
|
322
|
+
k(H, x({
|
|
323
323
|
get component() {
|
|
324
324
|
return e.tag || "span";
|
|
325
325
|
}
|
|
@@ -381,7 +381,7 @@ class Ct extends dt {
|
|
|
381
381
|
missingWarn: t.missingWarn,
|
|
382
382
|
missingHandler: t.missingHandler
|
|
383
383
|
}), this.storage = e;
|
|
384
|
-
const [o, n] = A(t.locale), [f] = A(t.fallbackLocale || t.locale), [h, c] = A("
|
|
384
|
+
const [o, n] = A(t.locale), [f] = A(t.fallbackLocale || t.locale), [h, c] = A("index");
|
|
385
385
|
if (this._locale = o, this._setLocale = n, this._fallbackLocale = f, this._currentRoute = h, this._setRoute = c, t.messages)
|
|
386
386
|
for (const [a, s] of Object.entries(t.messages))
|
|
387
387
|
this.addTranslations(a, s);
|
|
@@ -473,7 +473,7 @@ function Vt(r, t, e, o) {
|
|
|
473
473
|
style: i,
|
|
474
474
|
...p
|
|
475
475
|
} = a;
|
|
476
|
-
return k(vt,
|
|
476
|
+
return k(vt, x({
|
|
477
477
|
href: s,
|
|
478
478
|
class: g,
|
|
479
479
|
style: i
|
|
@@ -488,7 +488,7 @@ function Mt(r) {
|
|
|
488
488
|
return {
|
|
489
489
|
// Direct access to instance
|
|
490
490
|
instance: t,
|
|
491
|
-
// Locale (reactive) -
|
|
491
|
+
// Locale (reactive) - use accessor to track changes
|
|
492
492
|
locale: P(() => t.localeAccessor()),
|
|
493
493
|
// Locale helpers
|
|
494
494
|
getLocales: () => f,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/injection.ts","../src/components/I18nGroup.tsx","../src/components/I18nLink.tsx","../src/components/I18nSwitcher.tsx","../src/components/I18nT.tsx","../src/context.tsx","../src/i18n.ts","../src/router/adapter.tsx","../src/use-i18n.ts"],"sourcesContent":["import type { Locale } from '@i18n-micro/types'\nimport { createContext, useContext } from 'solid-js'\nimport type { SolidI18n } from './i18n'\nimport type { I18nRoutingStrategy } from './router/types'\n\n// Context keys (analogous to Vue's InjectionKey)\nexport const I18nContext = createContext<SolidI18n>()\nexport const I18nLocalesContext = createContext<Locale[]>()\nexport const I18nDefaultLocaleContext = createContext<string>()\nexport const I18nRouterContext = createContext<I18nRoutingStrategy | undefined>()\n\n// Helper hooks (analogous to Vue's inject)\nexport const useI18nContext = () => {\n const context = useContext(I18nContext)\n if (!context) {\n throw new Error('[i18n-micro] I18nContext not found. Make sure I18nProvider is used.')\n }\n return context\n}\n\nexport const useI18nLocales = () => {\n const context = useContext(I18nLocalesContext)\n if (!context) {\n throw new Error('[i18n-micro] I18nLocalesContext not found. Make sure I18nLocalesContext is provided.')\n }\n return context\n}\n\nexport const useI18nDefaultLocale = () => {\n const context = useContext(I18nDefaultLocaleContext)\n if (!context) {\n throw new Error('[i18n-micro] I18nDefaultLocaleContext not found. Make sure I18nDefaultLocaleContext is provided.')\n }\n return context\n}\n\nexport const useI18nRouter = () => {\n return useContext(I18nRouterContext)\n}\n","// @ts-nocheck\n\nimport type { TranslationKey } from '@i18n-micro/types'\nimport { type Component, type JSX, splitProps } from 'solid-js'\nimport { useI18nContext } from '../injection'\n\ninterface I18nGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {\n prefix: string\n groupClass?: string\n}\n\nexport const I18nGroup: Component<I18nGroupProps> = (props): JSX.Element => {\n const i18n = useI18nContext()\n const [local, others] = splitProps(props, ['prefix', 'groupClass'])\n\n const translate = (key: string, params?: Record<string, string | number | boolean>): string => {\n // Use type assertion for dynamic keys with prefix\n // The developer is responsible for ensuring the key exists\n const result = i18n.t(`${local.prefix}.${key}` as TranslationKey, params, undefined, i18n.getRoute())\n return typeof result === 'string' ? result : String(result)\n }\n\n return (\n // @ts-expect-error - Type conflict with Vue JSX in monorepo\n (\n <div class={['i18n-group', local.groupClass].filter(Boolean).join(' ')} {...(others as unknown as JSX.HTMLAttributes<HTMLDivElement>)}>\n {typeof props.children === 'function'\n ? (\n props.children as (props: {\n prefix: string\n t: (key: string, params?: Record<string, string | number | boolean>) => string\n }) => JSX.Element\n )({ prefix: local.prefix, t: translate })\n : props.children}\n </div>\n ) as unknown as JSX.Element\n )\n}\n","// @ts-nocheck\nimport { type Accessor, type Component, createMemo, type JSX, splitProps } from 'solid-js'\nimport { useI18nContext, useI18nRouter } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\n\ninterface I18nLinkProps extends JSX.AnchorHTMLAttributes<HTMLAnchorElement> {\n to: string | { path?: string }\n localeRoute?: (to: string | { path?: string }, locale?: string) => string | { path?: string }\n activeStyle?: JSX.CSSProperties\n}\n\nexport const I18nLink: Component<I18nLinkProps> = (props): JSX.Element => {\n const router = useI18nRouter()\n const i18n = useI18nContext()\n // Разделяем пропсы: явно выделяем style, чтобы объединить его с activeStyle\n const [local, others] = splitProps(props, ['to', 'localeRoute', 'activeStyle', 'style', 'children'])\n\n // 1. Получаем accessor для текущего пути из роутера\n const extendedRouter = router as I18nRoutingStrategy & { getCurrentPathAccessor?: Accessor<string> }\n const pathnameAccessor = extendedRouter?.getCurrentPathAccessor\n\n // 2. Вычисление целевого пути (href) - реактивно отслеживает изменения локали\n const targetPath = createMemo(() => {\n // Используем реактивный accessor для отслеживания изменений локали\n const currentLocale = i18n.localeAccessor()\n let result: string\n if (local.localeRoute) {\n const res = local.localeRoute(local.to, currentLocale)\n result = typeof res === 'string' ? res : res?.path || '/'\n } else if (router?.resolvePath) {\n const res = router.resolvePath(local.to, currentLocale)\n result = typeof res === 'string' ? res : res?.path || '/'\n } else if (typeof local.to === 'string') {\n result = local.to\n } else {\n result = (local.to as { path?: string })?.path || '/'\n }\n return result\n })\n\n // 3. Проверка на внешнюю ссылку\n const isExternal = createMemo(() => {\n if (typeof local.to === 'string') {\n return /^(?:https?:\\/\\/|\\/\\/|[a-zA-Z0-9-]+\\.[a-zA-Z]{2,})|tel:|mailto:/.test(local.to)\n }\n return false\n })\n\n // 4. Вычисление активного состояния\n // Важно: вызываем pathnameAccessor() внутри createMemo для правильного отслеживания изменений\n const isActive = createMemo(() => {\n if (isExternal()) {\n return false\n }\n\n // Получаем текущий путь - вызываем accessor внутри createMemo для реактивности\n const current = pathnameAccessor\n ? pathnameAccessor() // Вызов accessor внутри createMemo отслеживает изменения\n : router\n ? router.getCurrentPath()\n : typeof window !== 'undefined'\n ? window.location.pathname\n : '/'\n const target = targetPath()\n\n // Нормализация для сравнения (убираем слэш в конце, если это не корень)\n const normCurrent = current === '/' ? '/' : current.replace(/\\/$/, '')\n const normTarget = target === '/' ? '/' : target.replace(/\\/$/, '')\n\n return normCurrent === normTarget\n })\n\n // 5. Объединение стилей - используем isActive напрямую для реактивности\n const mergedStyle = createMemo(() => {\n const baseStyle = local.style || {}\n // Вызываем isActive() внутри createMemo для отслеживания изменений\n const active = isActive()\n const activeStyle = active ? local.activeStyle || {} : {}\n\n // SolidJS умеет работать с объектами стилей корректно при слиянии\n return {\n ...(typeof baseStyle === 'object' ? baseStyle : {}),\n ...(typeof activeStyle === 'object' ? activeStyle : {}),\n } as JSX.CSSProperties\n })\n\n // Используем linkComponent из роутера, если доступен\n const LinkComponent = router?.linkComponent\n\n if (isExternal()) {\n return (\n // @ts-expect-error - Type conflict with Vue JSX\n (\n <a\n href={typeof local.to === 'string' ? local.to : ''}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={mergedStyle()}\n {...(others as unknown as JSX.AnchorHTMLAttributes<HTMLAnchorElement>)}\n >\n {local.children}\n </a>\n ) as unknown as JSX.Element\n )\n }\n\n // Если есть linkComponent из роутера (например, A из @solidjs/router), используем его\n if (LinkComponent) {\n return (\n // @ts-expect-error - Type conflict with router component types\n (\n <LinkComponent href={targetPath()} style={mergedStyle()} {...(others as unknown as Record<string, unknown>)}>\n {local.children}\n </LinkComponent>\n ) as unknown as JSX.Element\n )\n }\n\n // Fallback на нативный <a> с onClick обработчиком\n return (\n // @ts-expect-error - Type conflict with Vue JSX\n (\n <a\n href={targetPath()}\n style={mergedStyle()}\n {...(others as unknown as JSX.AnchorHTMLAttributes<HTMLAnchorElement>)}\n onClick={(e: MouseEvent) => {\n if (router && !isExternal()) {\n e.preventDefault()\n router.push({ path: targetPath() })\n }\n }}\n >\n {local.children}\n </a>\n ) as unknown as JSX.Element\n )\n}\n","// @ts-nocheck\n\nimport type { Locale } from '@i18n-micro/types'\nimport { type Accessor, type Component, createMemo, createSignal, type JSX, onCleanup, onMount, splitProps } from 'solid-js'\nimport { useI18nContext, useI18nLocales, useI18nRouter } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\n\ninterface I18nSwitcherProps extends JSX.HTMLAttributes<HTMLDivElement> {\n locales?: Locale[]\n currentLocale?: string | (() => string)\n getLocaleName?: () => string | null\n switchLocale?: (locale: string) => void\n localeRoute?: (to: string | { path?: string }, locale?: string) => string | { path?: string }\n customLabels?: Record<string, string>\n customWrapperStyle?: JSX.CSSProperties\n customButtonStyle?: JSX.CSSProperties\n customDropdownStyle?: JSX.CSSProperties\n customItemStyle?: JSX.CSSProperties\n customLinkStyle?: JSX.CSSProperties\n customActiveLinkStyle?: JSX.CSSProperties\n customDisabledLinkStyle?: JSX.CSSProperties\n customIconStyle?: JSX.CSSProperties\n}\n\nexport const I18nSwitcher: Component<I18nSwitcherProps> = (props): JSX.Element => {\n const i18n = useI18nContext()\n const router = useI18nRouter()\n const injectedLocales = useI18nLocales()\n\n const [local, others] = splitProps(props, [\n 'locales',\n 'currentLocale',\n 'getLocaleName',\n 'switchLocale',\n 'localeRoute',\n 'customLabels',\n 'customWrapperStyle',\n 'customButtonStyle',\n 'customDropdownStyle',\n 'customItemStyle',\n 'customLinkStyle',\n 'customActiveLinkStyle',\n 'customDisabledLinkStyle',\n 'customIconStyle',\n ])\n\n const [dropdownOpen, setDropdownOpen] = createSignal(false)\n let wrapperRef: HTMLDivElement | undefined\n\n const locales = createMemo(() => local.locales || injectedLocales || [])\n const currentLocale = createMemo(() => {\n if (local.currentLocale !== undefined) {\n return typeof local.currentLocale === 'function' ? local.currentLocale() : local.currentLocale\n }\n // Используем реактивный accessor для отслеживания изменений\n return i18n.localeAccessor()\n })\n const currentLocaleName = createMemo(() => {\n if (local.getLocaleName) {\n return local.getLocaleName() || null\n }\n // Используем реактивный accessor для отслеживания изменений\n const current = locales().find((l) => l.code === i18n.localeAccessor())\n return current?.displayName || null\n })\n\n const toggleDropdown = (event?: Event) => {\n if (event) {\n event.stopPropagation()\n event.preventDefault()\n }\n setDropdownOpen(!dropdownOpen())\n }\n\n const localeLabel = (localeItem: Locale): string => {\n const current = local.customLabels?.[localeItem.code] || localeItem.displayName\n return current || localeItem.code\n }\n\n const currentLocaleLabel = createMemo(() => {\n const current = locales().find((l) => l.code === currentLocale())\n return current ? localeLabel(current) : currentLocaleName() || currentLocale()\n })\n\n const handleSwitchLocale = async (code: string) => {\n setDropdownOpen(false)\n\n if (local.switchLocale) {\n local.switchLocale(code)\n return\n }\n\n i18n.locale = code\n\n if (!router) {\n return\n }\n\n // Используем accessor напрямую, если доступен, иначе fallback на getCurrentPath()\n const extendedRouter = router as I18nRoutingStrategy & { getCurrentPathAccessor?: Accessor<string> }\n const currentPath = extendedRouter.getCurrentPathAccessor ? extendedRouter.getCurrentPathAccessor() : router.getCurrentPath()\n const newPath = local.localeRoute\n ? (() => {\n const res = local.localeRoute(currentPath, code)\n return typeof res === 'string' ? res : res.path || '/'\n })()\n : router?.resolvePath\n ? (() => {\n const res = router.resolvePath(currentPath, code)\n return typeof res === 'string' ? res : res.path || '/'\n })()\n : currentPath\n\n router.push({ path: newPath })\n }\n\n // Default Styles\n const wrapperStyle: JSX.CSSProperties = {\n position: 'relative',\n display: 'inline-block',\n 'vertical-align': 'middle',\n }\n\n const buttonStyle: JSX.CSSProperties = {\n padding: '4px 12px',\n 'font-size': '16px',\n cursor: 'pointer',\n 'background-color': '#fff',\n border: '1px solid #333',\n transition: 'background-color 0.3s ease',\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'space-between',\n }\n\n const dropdownStyle: JSX.CSSProperties = {\n position: 'absolute',\n top: '100%',\n left: '0',\n 'z-index': 1000,\n 'background-color': '#fff',\n border: '1px solid #333',\n 'list-style': 'none',\n padding: '0',\n margin: '4px 0 0 0',\n 'min-width': '150px',\n 'box-shadow': '0 2px 8px rgba(0,0,0,0.15)',\n }\n\n const itemStyle: JSX.CSSProperties = {\n margin: '0',\n padding: '0',\n }\n\n const linkStyle: JSX.CSSProperties = {\n display: 'block',\n padding: '8px 12px',\n color: '#333',\n 'text-decoration': 'none',\n transition: 'background-color 0.3s ease',\n cursor: 'pointer',\n }\n\n const activeLinkStyle: JSX.CSSProperties = {\n 'font-weight': 'bold',\n color: '#007bff',\n }\n\n const iconStyle: JSX.CSSProperties = {\n 'margin-left': '8px',\n display: 'inline-block',\n transition: 'transform 0.3s ease',\n }\n\n const openIconStyle: JSX.CSSProperties = {\n transform: 'rotate(180deg)',\n }\n\n const handleClickOutside = (event: MouseEvent) => {\n if (!dropdownOpen()) return\n\n const target = event.target as HTMLElement\n if (!target || !wrapperRef) return\n\n const isClickInside = wrapperRef.contains(target)\n const isButtonClick = target.closest('.i18n-switcher-button') !== null\n\n if (!isClickInside && !isButtonClick) {\n setDropdownOpen(false)\n }\n }\n\n onMount(() => {\n document.addEventListener('click', handleClickOutside)\n })\n\n onCleanup(() => {\n document.removeEventListener('click', handleClickOutside)\n })\n\n return (\n <div\n // @ts-expect-error - ref type conflict with Vue JSX\n ref={(el: HTMLDivElement) => {\n wrapperRef = el\n }}\n class=\"i18n-switcher-wrapper\"\n style={{ ...wrapperStyle, ...local.customWrapperStyle }}\n {...(others as unknown as JSX.HTMLAttributes<HTMLDivElement>)}\n >\n <button\n type=\"button\"\n class=\"i18n-switcher-button\"\n style={{ ...buttonStyle, ...local.customButtonStyle }}\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n toggleDropdown(e)\n }}\n aria-haspopup=\"true\"\n aria-expanded={dropdownOpen()}\n >\n <span>{currentLocaleLabel()}</span>\n <span\n style={{\n ...iconStyle,\n ...(dropdownOpen() ? openIconStyle : {}),\n ...local.customIconStyle,\n }}\n >\n ▼\n </span>\n </button>\n\n {dropdownOpen() && (\n <ul class=\"i18n-switcher-dropdown\" style={{ ...dropdownStyle, ...local.customDropdownStyle }}>\n {locales().map((localeItem) => {\n const isActive = localeItem.code === currentLocale()\n // Используем accessor для реактивного отслеживания пути\n const extendedRouter = router as I18nRoutingStrategy & { getCurrentPathAccessor?: Accessor<string> }\n const currentPath = extendedRouter?.getCurrentPathAccessor\n ? extendedRouter.getCurrentPathAccessor()\n : router?.getCurrentPath() || (typeof window !== 'undefined' ? window.location.pathname : '/')\n const result = local.localeRoute\n ? local.localeRoute(currentPath, localeItem.code)\n : router?.resolvePath\n ? router.resolvePath(currentPath, localeItem.code)\n : currentPath\n const routeTo = typeof result === 'string' ? result : result?.path || '#'\n\n return (\n <li style={{ ...itemStyle, ...local.customItemStyle }}>\n <a\n class={`switcher-locale-${localeItem.code}`}\n href={typeof routeTo === 'string' ? routeTo : '#'}\n style={{\n ...linkStyle,\n ...(isActive ? activeLinkStyle : {}),\n ...local.customLinkStyle,\n ...(isActive ? local.customActiveLinkStyle : {}),\n }}\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n handleSwitchLocale(localeItem.code)\n }}\n >\n {localeLabel(localeItem)}\n </a>\n </li>\n )\n })}\n </ul>\n )}\n </div>\n ) as unknown as JSX.Element\n}\n","// @ts-nocheck\n\nimport type { PluralFunc, TranslationKey } from '@i18n-micro/types'\nimport { type Component, createMemo, type JSX, splitProps } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { useI18nContext } from '../injection'\n\ninterface I18nTProps extends JSX.HTMLAttributes<HTMLElement> {\n keypath: TranslationKey\n params?: Record<string, string | number | boolean>\n tag?: string\n plural?: number | string\n defaultValue?: string\n html?: boolean\n hideIfEmpty?: boolean\n customPluralRule?: PluralFunc\n number?: number | string\n date?: Date | string | number\n relativeDate?: Date | string | number\n}\n\nexport const I18nT: Component<I18nTProps> = (props): JSX.Element => {\n const i18n = useI18nContext()\n const [local, others] = splitProps(props, [\n 'keypath',\n 'params',\n 'tag',\n 'plural',\n 'defaultValue',\n 'html',\n 'hideIfEmpty',\n 'customPluralRule',\n 'number',\n 'date',\n 'relativeDate',\n ])\n\n // Используем createMemo для реактивности (отслеживает изменения локали и роута)\n // В Solid мемо автоматически отслеживает зависимости при использовании в JSX\n const translation = createMemo(() => {\n // Отслеживаем изменения локали и роута через accessors\n const locale = i18n.localeAccessor()\n const route = i18n.routeAccessor()\n\n // Handle number formatting\n if (local.number !== undefined) {\n const numberValue = Number(local.number)\n const formattedNumber = i18n.tn(numberValue)\n const result = i18n.t(local.keypath, { number: formattedNumber, ...(local.params || {}) }, undefined, route)\n return typeof result === 'string' ? result : String(result)\n }\n\n // Handle date formatting\n if (local.date !== undefined) {\n const formattedDate = i18n.td(local.date)\n const result = i18n.t(local.keypath, { date: formattedDate, ...(local.params || {}) }, undefined, route)\n return typeof result === 'string' ? result : String(result)\n }\n\n // Handle relative date formatting\n if (local.relativeDate !== undefined) {\n const formattedRelativeDate = i18n.tdr(local.relativeDate)\n const result = i18n.t(local.keypath, { relativeDate: formattedRelativeDate, ...(local.params || {}) }, undefined, route)\n return typeof result === 'string' ? result : String(result)\n }\n\n // Handle pluralization\n if (local.plural !== undefined) {\n const count = Number.parseInt(local.plural.toString(), 10)\n if (local.customPluralRule) {\n const translationResult = local.customPluralRule(\n local.keypath,\n count,\n local.params || {},\n locale,\n (k: TranslationKey, p?: Record<string, string | number | boolean>, dv?: string) => i18n.t(k, p, dv, route),\n )\n return translationResult || ''\n } else {\n return i18n.tc(local.keypath, { count, ...(local.params || {}) }, local.defaultValue)\n }\n }\n\n // Regular translation\n const translationResult = (i18n.t(local.keypath, local.params, local.defaultValue, route) ?? '').toString()\n\n if (local.hideIfEmpty && !translationResult.trim()) {\n return local.defaultValue || ''\n }\n\n return translationResult\n })\n\n // Если html=true, используем innerHTML и не рендерим children\n if (local.html) {\n return (\n // @ts-expect-error - Dynamic component type conflict with Vue JSX\n (\n <Dynamic component={local.tag || 'span'} {...(others as unknown as Record<string, unknown>)} innerHTML={translation()} />\n ) as unknown as JSX.Element\n )\n }\n\n // Если html=false, рендерим как текст (Solid автоматически экранирует HTML)\n const translationValue = translation()\n if (local.hideIfEmpty && !translationValue.trim()) {\n if (local.defaultValue) {\n return (\n <Dynamic component={local.tag || 'span'} {...(others as unknown as Record<string, unknown>)}>\n {local.defaultValue}\n </Dynamic>\n ) as unknown as JSX.Element\n }\n return null as unknown as JSX.Element\n }\n\n return (\n // @ts-expect-error - Dynamic component type conflict with Vue JSX\n (\n <Dynamic component={local.tag || 'span'} {...(others as unknown as Record<string, unknown>)}>\n {translationValue}\n </Dynamic>\n ) as unknown as JSX.Element\n )\n}\n","// @ts-nocheck\n\nimport type { Locale } from '@i18n-micro/types'\nimport type { JSX, ParentComponent } from 'solid-js'\nimport type { SolidI18n } from './i18n'\nimport { I18nContext, I18nDefaultLocaleContext, I18nLocalesContext, I18nRouterContext } from './injection'\nimport type { I18nRoutingStrategy } from './router/types'\n\nexport interface I18nProviderProps {\n i18n: SolidI18n\n locales?: Locale[]\n defaultLocale?: string\n routingStrategy?: I18nRoutingStrategy\n}\n\nexport const I18nProvider: ParentComponent<I18nProviderProps> = (props): JSX.Element => {\n const children = props.children as JSX.Element\n return (\n // @ts-expect-error - Provider components type conflict with Vue JSX\n (\n <I18nContext.Provider value={props.i18n}>\n {props.locales && (\n // @ts-expect-error - Provider components type conflict with Vue JSX\n <I18nLocalesContext.Provider value={props.locales}>\n {props.defaultLocale && (\n // @ts-expect-error - Provider components type conflict with Vue JSX\n <I18nDefaultLocaleContext.Provider value={props.defaultLocale}>\n {props.routingStrategy && (\n // @ts-expect-error - Provider components type conflict with Vue JSX\n <I18nRouterContext.Provider value={props.routingStrategy}>{children}</I18nRouterContext.Provider>\n )}\n {!props.routingStrategy && children}\n </I18nDefaultLocaleContext.Provider>\n )}\n {!props.defaultLocale && children}\n </I18nLocalesContext.Provider>\n )}\n {!props.locales && children}\n </I18nContext.Provider>\n ) as unknown as JSX.Element\n )\n}\n\n// Keep useI18nContext for backward compatibility\nexport { useI18nContext } from './injection'\n","import { BaseI18n, type TranslationStorage } from '@i18n-micro/core'\nimport type { PluralFunc, Translations } from '@i18n-micro/types'\nimport { type Accessor, createSignal, type Setter } from 'solid-js'\n\nexport interface SolidI18nOptions {\n locale: string\n fallbackLocale?: string\n messages?: Record<string, Translations>\n plural?: PluralFunc\n missingWarn?: boolean\n missingHandler?: (locale: string, key: string, routeName: string) => void\n}\n\nexport class SolidI18n extends BaseI18n {\n private _locale: Accessor<string>\n private _setLocale: Setter<string>\n private _fallbackLocale: Accessor<string>\n private _currentRoute: Accessor<string>\n private _setRoute: Setter<string>\n\n public readonly storage: TranslationStorage\n\n private listeners = new Set<() => void>()\n\n constructor(options: SolidI18nOptions) {\n const storage: TranslationStorage = {\n translations: new Map<string, Translations>(),\n }\n\n super({\n storage,\n plural: options.plural,\n missingWarn: options.missingWarn,\n missingHandler: options.missingHandler,\n })\n\n this.storage = storage\n\n const [locale, setLocale] = createSignal(options.locale)\n const [fallback] = createSignal(options.fallbackLocale || options.locale)\n const [route, setRoute] = createSignal('general')\n\n this._locale = locale\n this._setLocale = setLocale\n this._fallbackLocale = fallback\n this._currentRoute = route\n this._setRoute = setRoute\n\n if (options.messages) {\n for (const [lang, msgs] of Object.entries(options.messages)) {\n this.addTranslations(lang, msgs)\n }\n }\n }\n\n public getLocale(): string {\n return this._locale()\n }\n\n public getFallbackLocale(): string {\n return this._fallbackLocale()\n }\n\n public getRoute(): string {\n return this._currentRoute()\n }\n\n public set locale(val: string) {\n this._setLocale(val)\n this.notifyListeners()\n }\n\n public get locale(): string {\n return this._locale()\n }\n\n public get localeAccessor(): Accessor<string> {\n return this._locale\n }\n\n public get fallbackLocale(): string {\n return this._fallbackLocale()\n }\n\n public get currentRoute(): string {\n return this._currentRoute()\n }\n\n public get routeAccessor(): Accessor<string> {\n return this._currentRoute\n }\n\n public setRoute(val: string): void {\n this._setRoute(val)\n this.notifyListeners()\n }\n\n public addTranslations(locale: string, translations: Translations, merge = true): void {\n super.loadTranslationsCore(locale, translations, merge)\n this.notifyListeners()\n }\n\n public addRouteTranslations(locale: string, routeName: string, translations: Translations, merge = true): void {\n super.loadRouteTranslationsCore(locale, routeName, translations, merge)\n this.notifyListeners()\n }\n\n public override clearCache(): void {\n super.clearCache()\n this.notifyListeners()\n }\n\n public subscribe(cb: () => void): () => void {\n this.listeners.add(cb)\n return () => this.listeners.delete(cb)\n }\n\n private notifyListeners(): void {\n this.listeners.forEach((cb) => cb())\n }\n}\n\nexport function createI18n(options: SolidI18nOptions): SolidI18n {\n return new SolidI18n(options)\n}\n","// @ts-nocheck\n\nimport type { Locale } from '@i18n-micro/types'\nimport { A, type Location, type useNavigate } from '@solidjs/router'\nimport { type Accessor, type Component, createEffect, createSignal, type JSX } from 'solid-js'\nimport type { I18nRoutingStrategy } from './types'\n\ntype NavigateFunction = ReturnType<typeof useNavigate>\n\n/**\n * Factory for Solid Router adapter\n * Implements routing utilities for Solid Router\n * Uses @solidjs/router APIs for navigation and path resolution\n *\n * **IMPORTANT**: This function must be called inside a SolidJS component or reactive context\n * (e.g., inside a component function, not at module level). This is required because\n * `createSignal` and `createEffect` need to be within a reactive owner context.\n *\n * @example\n * ```tsx\n * const RouterRoot: Component = () => {\n * const navigate = useNavigate()\n * const location = useLocation()\n * const routingStrategy = createSolidRouterAdapter(\n * locales,\n * defaultLocale,\n * navigate,\n * location,\n * )\n * // ...\n * }\n * ```\n *\n * @param locales - Array of locale configurations\n * @param defaultLocale - Default locale code\n * @param navigate - Navigation function from @solidjs/router's useNavigate hook\n * @param location - Location object from @solidjs/router's useLocation hook\n * @returns I18nRoutingStrategy with reactive pathname accessor\n */\nexport function createSolidRouterAdapter(\n locales: Locale[],\n defaultLocale: string,\n navigate: NavigateFunction,\n location: Location,\n): I18nRoutingStrategy & { getCurrentPathAccessor: Accessor<string> } {\n const localeCodes = locales.map((loc) => loc.code)\n\n // Create signal to track pathname changes\n // NOTE: This requires a reactive context (component/effect), so this function\n // must be called inside a component, not at module level\n const [pathname, setPathname] = createSignal(location.pathname)\n\n // Track location.pathname changes\n // NOTE: createEffect requires a reactive owner, so this function must be called\n // inside a component or runWithOwner context\n createEffect(() => {\n setPathname(location.pathname)\n })\n\n const resolvePath = (to: string | { path?: string }, locale: string): string | { path?: string } => {\n const path = typeof to === 'string' ? to : to.path || '/'\n const pathSegments = path.split('/').filter(Boolean)\n\n if (pathSegments.length > 0 && localeCodes.includes(pathSegments[0])) {\n pathSegments.shift()\n }\n\n const cleanPath = `/${pathSegments.join('/')}`\n return locale === defaultLocale ? cleanPath : `/${locale}${cleanPath === '/' ? '' : cleanPath}`\n }\n\n return {\n getCurrentPath: () => pathname(), // Returns current value for compatibility\n getCurrentPathAccessor: pathname, // Returns accessor for reactivity\n\n push: (target: { path: string }) => {\n // Use navigate from @solidjs/router\n navigate(target.path)\n },\n\n replace: (target: { path: string }) => {\n // Use navigate with replace option\n navigate(target.path, { replace: true })\n },\n\n resolvePath: (to: string | { path?: string }, locale: string) => resolvePath(to, locale),\n\n getRoute: () => ({\n fullPath: pathname(),\n query: {},\n }),\n\n // Use A component from @solidjs/router\n linkComponent: ((props: { href: string; children?: JSX.Element; class?: string; style?: JSX.CSSProperties; [key: string]: unknown }) => {\n const { href, children, class: className, style, ...restProps } = props\n return (\n <A href={href} class={className} style={style} {...restProps}>\n {children}\n </A>\n ) as unknown as JSX.Element\n }) as unknown as Component<{\n href: string\n children?: JSX.Element\n style?: JSX.CSSProperties\n class?: string\n [key: string]: unknown\n }>,\n }\n}\n","import type { Locale } from '@i18n-micro/types'\nimport { createMemo } from 'solid-js'\nimport { useI18nContext, useI18nDefaultLocale, useI18nLocales, useI18nRouter } from './injection'\n\nexport interface UseI18nOptions {\n locales?: Locale[]\n defaultLocale?: string\n}\n\nexport function useI18n(options?: UseI18nOptions) {\n const i18n = useI18nContext()\n const router = useI18nRouter()\n const injectedLocales = useI18nLocales()\n const injectedDefaultLocale = useI18nDefaultLocale()\n\n const locales = options?.locales || injectedLocales\n const defaultLocale = options?.defaultLocale || injectedDefaultLocale\n\n const resolveLocalePath = (to: string | { path?: string }, localeCode?: string): string | { path?: string } => {\n if (!router?.resolvePath) {\n return to\n }\n return router.resolvePath(to, localeCode || i18n.getLocale())\n }\n\n return {\n // Direct access to instance\n instance: i18n,\n\n // Locale (reactive) - используем accessor для отслеживания изменений\n locale: createMemo(() => i18n.localeAccessor()),\n\n // Locale helpers\n getLocales: () => locales,\n defaultLocale: () => defaultLocale,\n getLocaleName: () => {\n // Используем accessor для реактивности\n const current = locales.find((l) => l.code === i18n.localeAccessor())\n return current?.displayName || null\n },\n\n // Routing helpers\n localeRoute: resolveLocalePath,\n localePath: (to: string | { path?: string }, locale?: string): string => {\n const res = resolveLocalePath(to, locale)\n return typeof res === 'string' ? res : res.path || '/'\n },\n switchLocale: (newLocale: string) => {\n i18n.locale = newLocale\n if (router) {\n const currentPath = router.getCurrentPath()\n const newPath = resolveLocalePath(currentPath, newLocale)\n router.push(typeof newPath === 'string' ? { path: newPath } : { path: newPath.path || '/' })\n }\n },\n\n // Translation methods (delegate to instance)\n t: i18n.t.bind(i18n),\n ts: i18n.ts.bind(i18n),\n tc: i18n.tc.bind(i18n),\n tn: i18n.tn.bind(i18n),\n td: i18n.td.bind(i18n),\n tdr: i18n.tdr.bind(i18n),\n has: i18n.has.bind(i18n),\n\n // Route management\n setRoute: i18n.setRoute.bind(i18n),\n getRoute: i18n.getRoute.bind(i18n),\n getLocale: () => i18n.getLocale(),\n\n // Translation management\n addTranslations: i18n.addTranslations.bind(i18n),\n addRouteTranslations: i18n.addRouteTranslations.bind(i18n),\n clearCache: i18n.clearCache.bind(i18n),\n }\n}\n"],"names":["I18nContext","createContext","I18nLocalesContext","I18nDefaultLocaleContext","I18nRouterContext","useI18nContext","context","useContext","useI18nLocales","useI18nDefaultLocale","useI18nRouter","I18nGroup","props","i18n","local","others","splitProps","translate","key","params","result","t","prefix","undefined","getRoute","String","_el$","_tmpl$","_$spread","_$mergeProps","groupClass","filter","Boolean","join","_$insert","_c$","_$memo","children","I18nLink","router","pathnameAccessor","getCurrentPathAccessor","targetPath","createMemo","currentLocale","localeAccessor","localeRoute","res","to","path","resolvePath","isExternal","test","isActive","current","getCurrentPath","window","location","pathname","target","normCurrent","replace","normTarget","mergedStyle","baseStyle","style","activeStyle","LinkComponent","linkComponent","href","_$createComponent","_el$2","_tmpl$2","onClick","e","preventDefault","push","I18nSwitcher","injectedLocales","dropdownOpen","setDropdownOpen","createSignal","wrapperRef","locales","currentLocaleName","getLocaleName","find","l","code","displayName","toggleDropdown","event","stopPropagation","localeLabel","localeItem","customLabels","currentLocaleLabel","handleSwitchLocale","switchLocale","locale","extendedRouter","currentPath","newPath","wrapperStyle","position","display","buttonStyle","padding","cursor","border","transition","dropdownStyle","top","left","margin","itemStyle","linkStyle","color","activeLinkStyle","iconStyle","openIconStyle","transform","handleClickOutside","isClickInside","contains","isButtonClick","closest","onMount","document","addEventListener","onCleanup","removeEventListener","firstChild","_el$3","_el$4","nextSibling","_$use","el","customWrapperStyle","$$click","_el$5","map","routeTo","_el$6","_tmpl$3","_el$7","_$setAttribute","_$effect","_p$","_v$4","customItemStyle","_v$5","_v$6","customLinkStyle","customActiveLinkStyle","_$style","_$className","a","_$p","customDropdownStyle","_v$","customButtonStyle","_v$2","_v$3","customIconStyle","_$delegateEvents","I18nT","translation","route","routeAccessor","number","numberValue","Number","formattedNumber","tn","keypath","date","formattedDate","td","relativeDate","formattedRelativeDate","tdr","plural","count","parseInt","toString","customPluralRule","k","p","dv","tc","defaultValue","translationResult","hideIfEmpty","trim","html","Dynamic","component","tag","innerHTML","translationValue","I18nProvider","Provider","value","defaultLocale","routingStrategy","SolidI18n","BaseI18n","options","storage","setLocale","fallback","setRoute","lang","msgs","val","translations","merge","routeName","cb","createI18n","createSolidRouterAdapter","navigate","localeCodes","loc","setPathname","createEffect","pathSegments","split","length","includes","shift","cleanPath","fullPath","query","class","className","restProps","A","useI18n","injectedDefaultLocale","resolveLocalePath","localeCode","newLocale"],"mappings":";;;;;AAMO,MAAMA,IAAcC,EAAA,GACdC,IAAqBD,EAAA,GACrBE,IAA2BF,EAAA,GAC3BG,IAAoBH,EAAA,GAGpBI,IAAiB,MAAM;AAClC,QAAMC,IAAUC,EAAWP,CAAW;AACtC,MAAI,CAACM;AACH,UAAM,IAAI,MAAM,qEAAqE;AAEvF,SAAOA;AACT,GAEaE,KAAiB,MAAM;AAClC,QAAMF,IAAUC,EAAWL,CAAkB;AAC7C,MAAI,CAACI;AACH,UAAM,IAAI,MAAM,sFAAsF;AAExG,SAAOA;AACT,GAEaG,KAAuB,MAAM;AACxC,QAAMH,IAAUC,EAAWJ,CAAwB;AACnD,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,kGAAkG;AAEpH,SAAOA;AACT,GAEaI,IAAgB,MACpBH,EAAWH,CAAiB;;AC1B9B,MAAMO,KAAuCA,CAACC,MAAuB;AAC1E,QAAMC,IAAOR,EAAAA,GACP,CAACS,GAAOC,CAAM,IAAIC,EAAWJ,GAAO,CAAC,UAAU,YAAY,CAAC,GAE5DK,IAAYA,CAACC,GAAaC,MAA+D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src/components/I18nSwitcher.tsx","../src/components/I18nT.tsx","../src/context.tsx","../src/i18n.ts","../src/router/adapter.tsx","../src/use-i18n.ts"],"sourcesContent":["import type { Locale } from '@i18n-micro/types'\nimport { createContext, useContext } from 'solid-js'\nimport type { SolidI18n } from './i18n'\nimport type { I18nRoutingStrategy } from './router/types'\n\n// Context keys (analogous to Vue's InjectionKey)\nexport const I18nContext = createContext<SolidI18n>()\nexport const I18nLocalesContext = createContext<Locale[]>()\nexport const I18nDefaultLocaleContext = createContext<string>()\nexport const I18nRouterContext = createContext<I18nRoutingStrategy | undefined>()\n\n// Helper hooks (analogous to Vue's inject)\nexport const useI18nContext = () => {\n const context = useContext(I18nContext)\n if (!context) {\n throw new Error('[i18n-micro] I18nContext not found. Make sure I18nProvider is used.')\n }\n return context\n}\n\nexport const useI18nLocales = () => {\n const context = useContext(I18nLocalesContext)\n if (!context) {\n throw new Error('[i18n-micro] I18nLocalesContext not found. Make sure I18nLocalesContext is provided.')\n }\n return context\n}\n\nexport const useI18nDefaultLocale = () => {\n const context = useContext(I18nDefaultLocaleContext)\n if (!context) {\n throw new Error('[i18n-micro] I18nDefaultLocaleContext not found. Make sure I18nDefaultLocaleContext is provided.')\n }\n return context\n}\n\nexport const useI18nRouter = () => {\n return useContext(I18nRouterContext)\n}\n","// @ts-nocheck\n\nimport type { TranslationKey } from '@i18n-micro/types'\nimport { type Component, type JSX, splitProps } from 'solid-js'\nimport { useI18nContext } from '../injection'\n\ninterface I18nGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {\n prefix: string\n groupClass?: string\n}\n\nexport const I18nGroup: Component<I18nGroupProps> = (props): JSX.Element => {\n const i18n = useI18nContext()\n const [local, others] = splitProps(props, ['prefix', 'groupClass'])\n\n const translate = (key: string, params?: Record<string, string | number | boolean>): string => {\n // Use type assertion for dynamic keys with prefix\n // The developer is responsible for ensuring the key exists\n const result = i18n.t(`${local.prefix}.${key}` as TranslationKey, params, undefined, i18n.getRoute())\n return typeof result === 'string' ? result : String(result)\n }\n\n return (\n // @ts-expect-error - Type conflict with Vue JSX in monorepo\n (\n <div class={['i18n-group', local.groupClass].filter(Boolean).join(' ')} {...(others as unknown as JSX.HTMLAttributes<HTMLDivElement>)}>\n {typeof props.children === 'function'\n ? (\n props.children as (props: {\n prefix: string\n t: (key: string, params?: Record<string, string | number | boolean>) => string\n }) => JSX.Element\n )({ prefix: local.prefix, t: translate })\n : props.children}\n </div>\n ) as unknown as JSX.Element\n )\n}\n","// @ts-nocheck\nimport { type Accessor, type Component, createMemo, type JSX, splitProps } from 'solid-js'\nimport { useI18nContext, useI18nRouter } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\n\ninterface I18nLinkProps extends JSX.AnchorHTMLAttributes<HTMLAnchorElement> {\n to: string | { path?: string }\n localeRoute?: (to: string | { path?: string }, locale?: string) => string | { path?: string }\n activeStyle?: JSX.CSSProperties\n}\n\nexport const I18nLink: Component<I18nLinkProps> = (props): JSX.Element => {\n const router = useI18nRouter()\n const i18n = useI18nContext()\n // Разделяем пропсы: явно выделяем style, чтобы объединить его с activeStyle\n const [local, others] = splitProps(props, ['to', 'localeRoute', 'activeStyle', 'style', 'children'])\n\n // 1. Получаем accessor для текущего пути из роутера\n const extendedRouter = router as I18nRoutingStrategy & { getCurrentPathAccessor?: Accessor<string> }\n const pathnameAccessor = extendedRouter?.getCurrentPathAccessor\n\n // 2. Вычисление целевого пути (href) - реактивно отслеживает изменения локали\n const targetPath = createMemo(() => {\n // Используем реактивный accessor для отслеживания изменений локали\n const currentLocale = i18n.localeAccessor()\n let result: string\n if (local.localeRoute) {\n const res = local.localeRoute(local.to, currentLocale)\n result = typeof res === 'string' ? res : res?.path || '/'\n } else if (router?.resolvePath) {\n const res = router.resolvePath(local.to, currentLocale)\n result = typeof res === 'string' ? res : res?.path || '/'\n } else if (typeof local.to === 'string') {\n result = local.to\n } else {\n result = (local.to as { path?: string })?.path || '/'\n }\n return result\n })\n\n // 3. Проверка на внешнюю ссылку\n const isExternal = createMemo(() => {\n if (typeof local.to === 'string') {\n return /^(?:https?:\\/\\/|\\/\\/|[a-zA-Z0-9-]+\\.[a-zA-Z]{2,})|tel:|mailto:/.test(local.to)\n }\n return false\n })\n\n // 4. Вычисление активного состояния\n // Важно: вызываем pathnameAccessor() внутри createMemo для правильного отслеживания изменений\n const isActive = createMemo(() => {\n if (isExternal()) {\n return false\n }\n\n // Получаем текущий путь - вызываем accessor внутри createMemo для реактивности\n const current = pathnameAccessor\n ? pathnameAccessor() // Вызов accessor внутри createMemo отслеживает изменения\n : router\n ? router.getCurrentPath()\n : typeof window !== 'undefined'\n ? window.location.pathname\n : '/'\n const target = targetPath()\n\n // Нормализация для сравнения (убираем слэш в конце, если это не корень)\n const normCurrent = current === '/' ? '/' : current.replace(/\\/$/, '')\n const normTarget = target === '/' ? '/' : target.replace(/\\/$/, '')\n\n return normCurrent === normTarget\n })\n\n // 5. Объединение стилей - используем isActive напрямую для реактивности\n const mergedStyle = createMemo(() => {\n const baseStyle = local.style || {}\n // Вызываем isActive() внутри createMemo для отслеживания изменений\n const active = isActive()\n const activeStyle = active ? local.activeStyle || {} : {}\n\n // SolidJS умеет работать с объектами стилей корректно при слиянии\n return {\n ...(typeof baseStyle === 'object' ? baseStyle : {}),\n ...(typeof activeStyle === 'object' ? activeStyle : {}),\n } as JSX.CSSProperties\n })\n\n // Используем linkComponent из роутера, если доступен\n const LinkComponent = router?.linkComponent\n\n if (isExternal()) {\n return (\n // @ts-expect-error - Type conflict with Vue JSX\n (\n <a\n href={typeof local.to === 'string' ? local.to : ''}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={mergedStyle()}\n {...(others as unknown as JSX.AnchorHTMLAttributes<HTMLAnchorElement>)}\n >\n {local.children}\n </a>\n ) as unknown as JSX.Element\n )\n }\n\n // Если есть linkComponent из роутера (например, A из @solidjs/router), используем его\n if (LinkComponent) {\n return (\n // @ts-expect-error - Type conflict with router component types\n (\n <LinkComponent href={targetPath()} style={mergedStyle()} {...(others as unknown as Record<string, unknown>)}>\n {local.children}\n </LinkComponent>\n ) as unknown as JSX.Element\n )\n }\n\n // Fallback на нативный <a> с onClick обработчиком\n return (\n // @ts-expect-error - Type conflict with Vue JSX\n (\n <a\n href={targetPath()}\n style={mergedStyle()}\n {...(others as unknown as JSX.AnchorHTMLAttributes<HTMLAnchorElement>)}\n onClick={(e: MouseEvent) => {\n if (router && !isExternal()) {\n e.preventDefault()\n router.push({ path: targetPath() })\n }\n }}\n >\n {local.children}\n </a>\n ) as unknown as JSX.Element\n )\n}\n","// @ts-nocheck\n\nimport type { Locale } from '@i18n-micro/types'\nimport { type Accessor, type Component, createMemo, createSignal, type JSX, onCleanup, onMount, splitProps } from 'solid-js'\nimport { useI18nContext, useI18nLocales, useI18nRouter } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\n\ninterface I18nSwitcherProps extends JSX.HTMLAttributes<HTMLDivElement> {\n locales?: Locale[]\n currentLocale?: string | (() => string)\n getLocaleName?: () => string | null\n switchLocale?: (locale: string) => void\n localeRoute?: (to: string | { path?: string }, locale?: string) => string | { path?: string }\n customLabels?: Record<string, string>\n customWrapperStyle?: JSX.CSSProperties\n customButtonStyle?: JSX.CSSProperties\n customDropdownStyle?: JSX.CSSProperties\n customItemStyle?: JSX.CSSProperties\n customLinkStyle?: JSX.CSSProperties\n customActiveLinkStyle?: JSX.CSSProperties\n customDisabledLinkStyle?: JSX.CSSProperties\n customIconStyle?: JSX.CSSProperties\n}\n\nexport const I18nSwitcher: Component<I18nSwitcherProps> = (props): JSX.Element => {\n const i18n = useI18nContext()\n const router = useI18nRouter()\n const injectedLocales = useI18nLocales()\n\n const [local, others] = splitProps(props, [\n 'locales',\n 'currentLocale',\n 'getLocaleName',\n 'switchLocale',\n 'localeRoute',\n 'customLabels',\n 'customWrapperStyle',\n 'customButtonStyle',\n 'customDropdownStyle',\n 'customItemStyle',\n 'customLinkStyle',\n 'customActiveLinkStyle',\n 'customDisabledLinkStyle',\n 'customIconStyle',\n ])\n\n const [dropdownOpen, setDropdownOpen] = createSignal(false)\n let wrapperRef: HTMLDivElement | undefined\n\n const locales = createMemo(() => local.locales || injectedLocales || [])\n const currentLocale = createMemo(() => {\n if (local.currentLocale !== undefined) {\n return typeof local.currentLocale === 'function' ? local.currentLocale() : local.currentLocale\n }\n // Используем реактивный accessor для отслеживания изменений\n return i18n.localeAccessor()\n })\n const currentLocaleName = createMemo(() => {\n if (local.getLocaleName) {\n return local.getLocaleName() || null\n }\n // Используем реактивный accessor для отслеживания изменений\n const current = locales().find((l) => l.code === i18n.localeAccessor())\n return current?.displayName || null\n })\n\n const toggleDropdown = (event?: Event) => {\n if (event) {\n event.stopPropagation()\n event.preventDefault()\n }\n setDropdownOpen(!dropdownOpen())\n }\n\n const localeLabel = (localeItem: Locale): string => {\n const current = local.customLabels?.[localeItem.code] || localeItem.displayName\n return current || localeItem.code\n }\n\n const currentLocaleLabel = createMemo(() => {\n const current = locales().find((l) => l.code === currentLocale())\n return current ? localeLabel(current) : currentLocaleName() || currentLocale()\n })\n\n const handleSwitchLocale = async (code: string) => {\n setDropdownOpen(false)\n\n if (local.switchLocale) {\n local.switchLocale(code)\n return\n }\n\n i18n.locale = code\n\n if (!router) {\n return\n }\n\n // Используем accessor напрямую, если доступен, иначе fallback на getCurrentPath()\n const extendedRouter = router as I18nRoutingStrategy & { getCurrentPathAccessor?: Accessor<string> }\n const currentPath = extendedRouter.getCurrentPathAccessor ? extendedRouter.getCurrentPathAccessor() : router.getCurrentPath()\n const newPath = local.localeRoute\n ? (() => {\n const res = local.localeRoute(currentPath, code)\n return typeof res === 'string' ? res : res.path || '/'\n })()\n : router?.resolvePath\n ? (() => {\n const res = router.resolvePath(currentPath, code)\n return typeof res === 'string' ? res : res.path || '/'\n })()\n : currentPath\n\n router.push({ path: newPath })\n }\n\n // Default Styles\n const wrapperStyle: JSX.CSSProperties = {\n position: 'relative',\n display: 'inline-block',\n 'vertical-align': 'middle',\n }\n\n const buttonStyle: JSX.CSSProperties = {\n padding: '4px 12px',\n 'font-size': '16px',\n cursor: 'pointer',\n 'background-color': '#fff',\n border: '1px solid #333',\n transition: 'background-color 0.3s ease',\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'space-between',\n }\n\n const dropdownStyle: JSX.CSSProperties = {\n position: 'absolute',\n top: '100%',\n left: '0',\n 'z-index': 1000,\n 'background-color': '#fff',\n border: '1px solid #333',\n 'list-style': 'none',\n padding: '0',\n margin: '4px 0 0 0',\n 'min-width': '150px',\n 'box-shadow': '0 2px 8px rgba(0,0,0,0.15)',\n }\n\n const itemStyle: JSX.CSSProperties = {\n margin: '0',\n padding: '0',\n }\n\n const linkStyle: JSX.CSSProperties = {\n display: 'block',\n padding: '8px 12px',\n color: '#333',\n 'text-decoration': 'none',\n transition: 'background-color 0.3s ease',\n cursor: 'pointer',\n }\n\n const activeLinkStyle: JSX.CSSProperties = {\n 'font-weight': 'bold',\n color: '#007bff',\n }\n\n const iconStyle: JSX.CSSProperties = {\n 'margin-left': '8px',\n display: 'inline-block',\n transition: 'transform 0.3s ease',\n }\n\n const openIconStyle: JSX.CSSProperties = {\n transform: 'rotate(180deg)',\n }\n\n const handleClickOutside = (event: MouseEvent) => {\n if (!dropdownOpen()) return\n\n const target = event.target as HTMLElement\n if (!target || !wrapperRef) return\n\n const isClickInside = wrapperRef.contains(target)\n const isButtonClick = target.closest('.i18n-switcher-button') !== null\n\n if (!isClickInside && !isButtonClick) {\n setDropdownOpen(false)\n }\n }\n\n onMount(() => {\n document.addEventListener('click', handleClickOutside)\n })\n\n onCleanup(() => {\n document.removeEventListener('click', handleClickOutside)\n })\n\n return (\n <div\n // @ts-expect-error - ref type conflict with Vue JSX\n ref={(el: HTMLDivElement) => {\n wrapperRef = el\n }}\n class=\"i18n-switcher-wrapper\"\n style={{ ...wrapperStyle, ...local.customWrapperStyle }}\n {...(others as unknown as JSX.HTMLAttributes<HTMLDivElement>)}\n >\n <button\n type=\"button\"\n class=\"i18n-switcher-button\"\n style={{ ...buttonStyle, ...local.customButtonStyle }}\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n toggleDropdown(e)\n }}\n aria-haspopup=\"true\"\n aria-expanded={dropdownOpen()}\n >\n <span>{currentLocaleLabel()}</span>\n <span\n style={{\n ...iconStyle,\n ...(dropdownOpen() ? openIconStyle : {}),\n ...local.customIconStyle,\n }}\n >\n ▼\n </span>\n </button>\n\n {dropdownOpen() && (\n <ul class=\"i18n-switcher-dropdown\" style={{ ...dropdownStyle, ...local.customDropdownStyle }}>\n {locales().map((localeItem) => {\n const isActive = localeItem.code === currentLocale()\n // Используем accessor для реактивного отслеживания пути\n const extendedRouter = router as I18nRoutingStrategy & { getCurrentPathAccessor?: Accessor<string> }\n const currentPath = extendedRouter?.getCurrentPathAccessor\n ? extendedRouter.getCurrentPathAccessor()\n : router?.getCurrentPath() || (typeof window !== 'undefined' ? window.location.pathname : '/')\n const result = local.localeRoute\n ? local.localeRoute(currentPath, localeItem.code)\n : router?.resolvePath\n ? router.resolvePath(currentPath, localeItem.code)\n : currentPath\n const routeTo = typeof result === 'string' ? result : result?.path || '#'\n\n return (\n <li style={{ ...itemStyle, ...local.customItemStyle }}>\n <a\n class={`switcher-locale-${localeItem.code}`}\n href={typeof routeTo === 'string' ? routeTo : '#'}\n style={{\n ...linkStyle,\n ...(isActive ? activeLinkStyle : {}),\n ...local.customLinkStyle,\n ...(isActive ? local.customActiveLinkStyle : {}),\n }}\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n handleSwitchLocale(localeItem.code)\n }}\n >\n {localeLabel(localeItem)}\n </a>\n </li>\n )\n })}\n </ul>\n )}\n </div>\n ) as unknown as JSX.Element\n}\n","// @ts-nocheck\n\nimport type { PluralFunc, TranslationKey } from '@i18n-micro/types'\nimport { type Component, createMemo, type JSX, splitProps } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { useI18nContext } from '../injection'\n\ninterface I18nTProps extends JSX.HTMLAttributes<HTMLElement> {\n keypath: TranslationKey\n params?: Record<string, string | number | boolean>\n tag?: string\n plural?: number | string\n defaultValue?: string\n html?: boolean\n hideIfEmpty?: boolean\n customPluralRule?: PluralFunc\n number?: number | string\n date?: Date | string | number\n relativeDate?: Date | string | number\n}\n\nexport const I18nT: Component<I18nTProps> = (props): JSX.Element => {\n const i18n = useI18nContext()\n const [local, others] = splitProps(props, [\n 'keypath',\n 'params',\n 'tag',\n 'plural',\n 'defaultValue',\n 'html',\n 'hideIfEmpty',\n 'customPluralRule',\n 'number',\n 'date',\n 'relativeDate',\n ])\n\n // Используем createMemo для реактивности (отслеживает изменения локали и роута)\n // В Solid мемо автоматически отслеживает зависимости при использовании в JSX\n const translation = createMemo(() => {\n // Отслеживаем изменения локали и роута через accessors\n const locale = i18n.localeAccessor()\n const route = i18n.routeAccessor()\n\n // Handle number formatting\n if (local.number !== undefined) {\n const numberValue = Number(local.number)\n const formattedNumber = i18n.tn(numberValue)\n const result = i18n.t(local.keypath, { number: formattedNumber, ...(local.params || {}) }, undefined, route)\n return typeof result === 'string' ? result : String(result)\n }\n\n // Handle date formatting\n if (local.date !== undefined) {\n const formattedDate = i18n.td(local.date)\n const result = i18n.t(local.keypath, { date: formattedDate, ...(local.params || {}) }, undefined, route)\n return typeof result === 'string' ? result : String(result)\n }\n\n // Handle relative date formatting\n if (local.relativeDate !== undefined) {\n const formattedRelativeDate = i18n.tdr(local.relativeDate)\n const result = i18n.t(local.keypath, { relativeDate: formattedRelativeDate, ...(local.params || {}) }, undefined, route)\n return typeof result === 'string' ? result : String(result)\n }\n\n // Handle pluralization\n if (local.plural !== undefined) {\n const count = Number.parseInt(local.plural.toString(), 10)\n if (local.customPluralRule) {\n const translationResult = local.customPluralRule(\n local.keypath,\n count,\n local.params || {},\n locale,\n (k: TranslationKey, p?: Record<string, string | number | boolean>, dv?: string) => i18n.t(k, p, dv, route),\n )\n return translationResult || ''\n } else {\n return i18n.tc(local.keypath, { count, ...(local.params || {}) }, local.defaultValue)\n }\n }\n\n // Regular translation\n const translationResult = (i18n.t(local.keypath, local.params, local.defaultValue, route) ?? '').toString()\n\n if (local.hideIfEmpty && !translationResult.trim()) {\n return local.defaultValue || ''\n }\n\n return translationResult\n })\n\n // Если html=true, используем innerHTML и не рендерим children\n if (local.html) {\n return (\n // @ts-expect-error - Dynamic component type conflict with Vue JSX\n (\n <Dynamic component={local.tag || 'span'} {...(others as unknown as Record<string, unknown>)} innerHTML={translation()} />\n ) as unknown as JSX.Element\n )\n }\n\n // Если html=false, рендерим как текст (Solid автоматически экранирует HTML)\n const translationValue = translation()\n if (local.hideIfEmpty && !translationValue.trim()) {\n if (local.defaultValue) {\n return (\n <Dynamic component={local.tag || 'span'} {...(others as unknown as Record<string, unknown>)}>\n {local.defaultValue}\n </Dynamic>\n ) as unknown as JSX.Element\n }\n return null as unknown as JSX.Element\n }\n\n return (\n // @ts-expect-error - Dynamic component type conflict with Vue JSX\n (\n <Dynamic component={local.tag || 'span'} {...(others as unknown as Record<string, unknown>)}>\n {translationValue}\n </Dynamic>\n ) as unknown as JSX.Element\n )\n}\n","// @ts-nocheck\n\nimport type { Locale } from '@i18n-micro/types'\nimport type { JSX, ParentComponent } from 'solid-js'\nimport type { SolidI18n } from './i18n'\nimport { I18nContext, I18nDefaultLocaleContext, I18nLocalesContext, I18nRouterContext } from './injection'\nimport type { I18nRoutingStrategy } from './router/types'\n\nexport interface I18nProviderProps {\n i18n: SolidI18n\n locales?: Locale[]\n defaultLocale?: string\n routingStrategy?: I18nRoutingStrategy\n}\n\nexport const I18nProvider: ParentComponent<I18nProviderProps> = (props): JSX.Element => {\n const children = props.children as JSX.Element\n return (\n // @ts-expect-error - Provider components type conflict with Vue JSX\n (\n <I18nContext.Provider value={props.i18n}>\n {props.locales && (\n // @ts-expect-error - Provider components type conflict with Vue JSX\n <I18nLocalesContext.Provider value={props.locales}>\n {props.defaultLocale && (\n // @ts-expect-error - Provider components type conflict with Vue JSX\n <I18nDefaultLocaleContext.Provider value={props.defaultLocale}>\n {props.routingStrategy && (\n // @ts-expect-error - Provider components type conflict with Vue JSX\n <I18nRouterContext.Provider value={props.routingStrategy}>{children}</I18nRouterContext.Provider>\n )}\n {!props.routingStrategy && children}\n </I18nDefaultLocaleContext.Provider>\n )}\n {!props.defaultLocale && children}\n </I18nLocalesContext.Provider>\n )}\n {!props.locales && children}\n </I18nContext.Provider>\n ) as unknown as JSX.Element\n )\n}\n\n// Keep useI18nContext for backward compatibility\nexport { useI18nContext } from './injection'\n","import { BaseI18n, type TranslationStorage } from '@i18n-micro/core'\nimport type { PluralFunc, Translations } from '@i18n-micro/types'\nimport { type Accessor, createSignal, type Setter } from 'solid-js'\n\nexport interface SolidI18nOptions {\n locale: string\n fallbackLocale?: string\n messages?: Record<string, Translations>\n plural?: PluralFunc\n missingWarn?: boolean\n missingHandler?: (locale: string, key: string, routeName: string) => void\n}\n\nexport class SolidI18n extends BaseI18n {\n private _locale: Accessor<string>\n private _setLocale: Setter<string>\n private _fallbackLocale: Accessor<string>\n private _currentRoute: Accessor<string>\n private _setRoute: Setter<string>\n\n public readonly storage: TranslationStorage\n\n private listeners = new Set<() => void>()\n\n constructor(options: SolidI18nOptions) {\n const storage: TranslationStorage = {\n translations: new Map<string, Translations>(),\n }\n\n super({\n storage,\n plural: options.plural,\n missingWarn: options.missingWarn,\n missingHandler: options.missingHandler,\n })\n\n this.storage = storage\n\n const [locale, setLocale] = createSignal(options.locale)\n const [fallback] = createSignal(options.fallbackLocale || options.locale)\n const [route, setRoute] = createSignal('index')\n\n this._locale = locale\n this._setLocale = setLocale\n this._fallbackLocale = fallback\n this._currentRoute = route\n this._setRoute = setRoute\n\n if (options.messages) {\n for (const [lang, msgs] of Object.entries(options.messages)) {\n this.addTranslations(lang, msgs)\n }\n }\n }\n\n public getLocale(): string {\n return this._locale()\n }\n\n public getFallbackLocale(): string {\n return this._fallbackLocale()\n }\n\n public getRoute(): string {\n return this._currentRoute()\n }\n\n public set locale(val: string) {\n this._setLocale(val)\n this.notifyListeners()\n }\n\n public get locale(): string {\n return this._locale()\n }\n\n public get localeAccessor(): Accessor<string> {\n return this._locale\n }\n\n public get fallbackLocale(): string {\n return this._fallbackLocale()\n }\n\n public get currentRoute(): string {\n return this._currentRoute()\n }\n\n public get routeAccessor(): Accessor<string> {\n return this._currentRoute\n }\n\n public setRoute(val: string): void {\n this._setRoute(val)\n this.notifyListeners()\n }\n\n public addTranslations(locale: string, translations: Translations, merge = true): void {\n super.loadTranslationsCore(locale, translations, merge)\n this.notifyListeners()\n }\n\n public addRouteTranslations(locale: string, routeName: string, translations: Translations, merge = true): void {\n super.loadRouteTranslationsCore(locale, routeName, translations, merge)\n this.notifyListeners()\n }\n\n public override clearCache(): void {\n super.clearCache()\n this.notifyListeners()\n }\n\n public subscribe(cb: () => void): () => void {\n this.listeners.add(cb)\n return () => this.listeners.delete(cb)\n }\n\n private notifyListeners(): void {\n this.listeners.forEach((cb) => cb())\n }\n}\n\nexport function createI18n(options: SolidI18nOptions): SolidI18n {\n return new SolidI18n(options)\n}\n","// @ts-nocheck\n\nimport type { Locale } from '@i18n-micro/types'\nimport { A, type Location, type useNavigate } from '@solidjs/router'\nimport { type Accessor, type Component, createEffect, createSignal, type JSX } from 'solid-js'\nimport type { I18nRoutingStrategy } from './types'\n\ntype NavigateFunction = ReturnType<typeof useNavigate>\n\n/**\n * Factory for Solid Router adapter\n * Implements routing utilities for Solid Router\n * Uses @solidjs/router APIs for navigation and path resolution\n *\n * **IMPORTANT**: This function must be called inside a SolidJS component or reactive context\n * (e.g., inside a component function, not at module level). This is required because\n * `createSignal` and `createEffect` need to be within a reactive owner context.\n *\n * @example\n * ```tsx\n * const RouterRoot: Component = () => {\n * const navigate = useNavigate()\n * const location = useLocation()\n * const routingStrategy = createSolidRouterAdapter(\n * locales,\n * defaultLocale,\n * navigate,\n * location,\n * )\n * // ...\n * }\n * ```\n *\n * @param locales - Array of locale configurations\n * @param defaultLocale - Default locale code\n * @param navigate - Navigation function from @solidjs/router's useNavigate hook\n * @param location - Location object from @solidjs/router's useLocation hook\n * @returns I18nRoutingStrategy with reactive pathname accessor\n */\nexport function createSolidRouterAdapter(\n locales: Locale[],\n defaultLocale: string,\n navigate: NavigateFunction,\n location: Location,\n): I18nRoutingStrategy & { getCurrentPathAccessor: Accessor<string> } {\n const localeCodes = locales.map((loc) => loc.code)\n\n // Create signal to track pathname changes\n // NOTE: This requires a reactive context (component/effect), so this function\n // must be called inside a component, not at module level\n const [pathname, setPathname] = createSignal(location.pathname)\n\n // Track location.pathname changes\n // NOTE: createEffect requires a reactive owner, so this function must be called\n // inside a component or runWithOwner context\n createEffect(() => {\n setPathname(location.pathname)\n })\n\n const resolvePath = (to: string | { path?: string }, locale: string): string | { path?: string } => {\n const path = typeof to === 'string' ? to : to.path || '/'\n const pathSegments = path.split('/').filter(Boolean)\n\n if (pathSegments.length > 0 && localeCodes.includes(pathSegments[0])) {\n pathSegments.shift()\n }\n\n const cleanPath = `/${pathSegments.join('/')}`\n return locale === defaultLocale ? cleanPath : `/${locale}${cleanPath === '/' ? '' : cleanPath}`\n }\n\n return {\n getCurrentPath: () => pathname(), // Returns current value for compatibility\n getCurrentPathAccessor: pathname, // Returns accessor for reactivity\n\n push: (target: { path: string }) => {\n // Use navigate from @solidjs/router\n navigate(target.path)\n },\n\n replace: (target: { path: string }) => {\n // Use navigate with replace option\n navigate(target.path, { replace: true })\n },\n\n resolvePath: (to: string | { path?: string }, locale: string) => resolvePath(to, locale),\n\n getRoute: () => ({\n fullPath: pathname(),\n query: {},\n }),\n\n // Use A component from @solidjs/router\n linkComponent: ((props: { href: string; children?: JSX.Element; class?: string; style?: JSX.CSSProperties; [key: string]: unknown }) => {\n const { href, children, class: className, style, ...restProps } = props\n return (\n <A href={href} class={className} style={style} {...restProps}>\n {children}\n </A>\n ) as unknown as JSX.Element\n }) as unknown as Component<{\n href: string\n children?: JSX.Element\n style?: JSX.CSSProperties\n class?: string\n [key: string]: unknown\n }>,\n }\n}\n","import type { Locale } from '@i18n-micro/types'\nimport { createMemo } from 'solid-js'\nimport { useI18nContext, useI18nDefaultLocale, useI18nLocales, useI18nRouter } from './injection'\n\nexport interface UseI18nOptions {\n locales?: Locale[]\n defaultLocale?: string\n}\n\nexport function useI18n(options?: UseI18nOptions) {\n const i18n = useI18nContext()\n const router = useI18nRouter()\n const injectedLocales = useI18nLocales()\n const injectedDefaultLocale = useI18nDefaultLocale()\n\n const locales = options?.locales || injectedLocales\n const defaultLocale = options?.defaultLocale || injectedDefaultLocale\n\n const resolveLocalePath = (to: string | { path?: string }, localeCode?: string): string | { path?: string } => {\n if (!router?.resolvePath) {\n return to\n }\n return router.resolvePath(to, localeCode || i18n.getLocale())\n }\n\n return {\n // Direct access to instance\n instance: i18n,\n\n // Locale (reactive) - use accessor to track changes\n locale: createMemo(() => i18n.localeAccessor()),\n\n // Locale helpers\n getLocales: () => locales,\n defaultLocale: () => defaultLocale,\n getLocaleName: () => {\n // Use accessor for reactivity\n const current = locales.find((l) => l.code === i18n.localeAccessor())\n return current?.displayName || null\n },\n\n // Routing helpers\n localeRoute: resolveLocalePath,\n localePath: (to: string | { path?: string }, locale?: string): string => {\n const res = resolveLocalePath(to, locale)\n return typeof res === 'string' ? res : res.path || '/'\n },\n switchLocale: (newLocale: string) => {\n i18n.locale = newLocale\n if (router) {\n const currentPath = router.getCurrentPath()\n const newPath = resolveLocalePath(currentPath, newLocale)\n router.push(typeof newPath === 'string' ? { path: newPath } : { path: newPath.path || '/' })\n }\n },\n\n // Translation methods (delegate to instance)\n t: i18n.t.bind(i18n),\n ts: i18n.ts.bind(i18n),\n tc: i18n.tc.bind(i18n),\n tn: i18n.tn.bind(i18n),\n td: i18n.td.bind(i18n),\n tdr: i18n.tdr.bind(i18n),\n has: i18n.has.bind(i18n),\n\n // Route management\n setRoute: i18n.setRoute.bind(i18n),\n getRoute: i18n.getRoute.bind(i18n),\n getLocale: () => i18n.getLocale(),\n\n // Translation management\n addTranslations: i18n.addTranslations.bind(i18n),\n addRouteTranslations: i18n.addRouteTranslations.bind(i18n),\n clearCache: i18n.clearCache.bind(i18n),\n }\n}\n"],"names":["I18nContext","createContext","I18nLocalesContext","I18nDefaultLocaleContext","I18nRouterContext","useI18nContext","context","useContext","useI18nLocales","useI18nDefaultLocale","useI18nRouter","I18nGroup","props","i18n","local","others","splitProps","translate","key","params","result","t","prefix","undefined","getRoute","String","_el$","_tmpl$","_$spread","_$mergeProps","groupClass","filter","Boolean","join","_$insert","_c$","_$memo","children","I18nLink","router","pathnameAccessor","getCurrentPathAccessor","targetPath","createMemo","currentLocale","localeAccessor","localeRoute","res","to","path","resolvePath","isExternal","test","isActive","current","getCurrentPath","window","location","pathname","target","normCurrent","replace","normTarget","mergedStyle","baseStyle","style","activeStyle","LinkComponent","linkComponent","href","_$createComponent","_el$2","_tmpl$2","onClick","e","preventDefault","push","I18nSwitcher","injectedLocales","dropdownOpen","setDropdownOpen","createSignal","wrapperRef","locales","currentLocaleName","getLocaleName","find","l","code","displayName","toggleDropdown","event","stopPropagation","localeLabel","localeItem","customLabels","currentLocaleLabel","handleSwitchLocale","switchLocale","locale","extendedRouter","currentPath","newPath","wrapperStyle","position","display","buttonStyle","padding","cursor","border","transition","dropdownStyle","top","left","margin","itemStyle","linkStyle","color","activeLinkStyle","iconStyle","openIconStyle","transform","handleClickOutside","isClickInside","contains","isButtonClick","closest","onMount","document","addEventListener","onCleanup","removeEventListener","firstChild","_el$3","_el$4","nextSibling","_$use","el","customWrapperStyle","$$click","_el$5","map","routeTo","_el$6","_tmpl$3","_el$7","_$setAttribute","_$effect","_p$","_v$4","customItemStyle","_v$5","_v$6","customLinkStyle","customActiveLinkStyle","_$style","_$className","a","_$p","customDropdownStyle","_v$","customButtonStyle","_v$2","_v$3","customIconStyle","_$delegateEvents","I18nT","translation","route","routeAccessor","number","numberValue","Number","formattedNumber","tn","keypath","date","formattedDate","td","relativeDate","formattedRelativeDate","tdr","plural","count","parseInt","toString","customPluralRule","k","p","dv","tc","defaultValue","translationResult","hideIfEmpty","trim","html","Dynamic","component","tag","innerHTML","translationValue","I18nProvider","Provider","value","defaultLocale","routingStrategy","SolidI18n","BaseI18n","options","storage","setLocale","fallback","setRoute","lang","msgs","val","translations","merge","routeName","cb","createI18n","createSolidRouterAdapter","navigate","localeCodes","loc","setPathname","createEffect","pathSegments","split","length","includes","shift","cleanPath","fullPath","query","class","className","restProps","A","useI18n","injectedDefaultLocale","resolveLocalePath","localeCode","newLocale"],"mappings":";;;;;AAMO,MAAMA,IAAcC,EAAA,GACdC,IAAqBD,EAAA,GACrBE,IAA2BF,EAAA,GAC3BG,IAAoBH,EAAA,GAGpBI,IAAiB,MAAM;AAClC,QAAMC,IAAUC,EAAWP,CAAW;AACtC,MAAI,CAACM;AACH,UAAM,IAAI,MAAM,qEAAqE;AAEvF,SAAOA;AACT,GAEaE,KAAiB,MAAM;AAClC,QAAMF,IAAUC,EAAWL,CAAkB;AAC7C,MAAI,CAACI;AACH,UAAM,IAAI,MAAM,sFAAsF;AAExG,SAAOA;AACT,GAEaG,KAAuB,MAAM;AACxC,QAAMH,IAAUC,EAAWJ,CAAwB;AACnD,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,kGAAkG;AAEpH,SAAOA;AACT,GAEaI,IAAgB,MACpBH,EAAWH,CAAiB;;AC1B9B,MAAMO,KAAuCA,CAACC,MAAuB;AAC1E,QAAMC,IAAOR,EAAAA,GACP,CAACS,GAAOC,CAAM,IAAIC,EAAWJ,GAAO,CAAC,UAAU,YAAY,CAAC,GAE5DK,IAAYA,CAACC,GAAaC,MAA+D;AAG7F,UAAMC,IAASP,EAAKQ,EAAE,GAAGP,EAAMQ,MAAM,IAAIJ,CAAG,IAAsBC,GAAQI,QAAWV,EAAKW,UAAU;AACpG,WAAO,OAAOJ,KAAW,WAAWA,IAASK,OAAOL,CAAM;AAAA,EAC5D;AAEA;AAAA;AAAA,KAEE,MAAA;AAAA,UAAAM,IAAAC,GAAAA;AAAAC,aAAAA,EAAAF,GAAAG,EAAA;AAAA,QAAA,IAAA,Q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O,EAAK,SAASsO,GACV5M,GAAQ;AACV,cAAM8D,IAAc9D,EAAO,eAAA,GACrB+D,IAAU2I,EAAkB5I,GAAa8I,CAAS;AACxD,QAAA5M,EAAO,KAAK,OAAO+D,KAAY,WAAW,EAAE,MAAMA,EAAA,IAAY,EAAE,MAAMA,EAAQ,QAAQ,KAAK;AAAA,MAC7F;AAAA,IACF;AAAA;AAAA,IAGA,GAAGzF,EAAK,EAAE,KAAKA,CAAI;AAAA,IACnB,IAAIA,EAAK,GAAG,KAAKA,CAAI;AAAA,IACrB,IAAIA,EAAK,GAAG,KAAKA,CAAI;AAAA,IACrB,IAAIA,EAAK,GAAG,KAAKA,CAAI;AAAA,IACrB,IAAIA,EAAK,GAAG,KAAKA,CAAI;AAAA,IACrB,KAAKA,EAAK,IAAI,KAAKA,CAAI;AAAA,IACvB,KAAKA,EAAK,IAAI,KAAKA,CAAI;AAAA;AAAA,IAGvB,UAAUA,EAAK,SAAS,KAAKA,CAAI;AAAA,IACjC,UAAUA,EAAK,SAAS,KAAKA,CAAI;AAAA,IACjC,WAAW,MAAMA,EAAK,UAAA;AAAA;AAAA,IAGtB,iBAAiBA,EAAK,gBAAgB,KAAKA,CAAI;AAAA,IAC/C,sBAAsBA,EAAK,qBAAqB,KAAKA,CAAI;AAAA,IACzD,YAAYA,EAAK,WAAW,KAAKA,CAAI;AAAA,EAAA;AAEzC;"}
|
package/package.json
CHANGED
|
@@ -1,23 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@i18n-micro/solid",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "SolidJS bindings for i18n-micro — primitives, context, and UI components.",
|
|
4
5
|
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/s00d/nuxt-i18n-micro.git",
|
|
11
|
+
"directory": "packages/solid"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/solid#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/s00d/nuxt-i18n-micro/issues"
|
|
16
|
+
},
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18"
|
|
19
|
+
},
|
|
5
20
|
"main": "./dist/index.cjs",
|
|
6
|
-
"module": "./dist/index.mjs",
|
|
7
21
|
"types": "./dist/index.d.ts",
|
|
8
22
|
"exports": {
|
|
9
23
|
".": {
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
24
|
+
"import": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"default": "./dist/index.mjs"
|
|
27
|
+
},
|
|
28
|
+
"require": {
|
|
29
|
+
"types": "./dist/index.d.cts",
|
|
30
|
+
"default": "./dist/index.cjs"
|
|
31
|
+
},
|
|
32
|
+
"default": "./dist/index.mjs"
|
|
33
|
+
},
|
|
34
|
+
"./package.json": "./package.json"
|
|
14
35
|
},
|
|
15
36
|
"files": [
|
|
16
|
-
"dist"
|
|
37
|
+
"dist",
|
|
38
|
+
"README.md",
|
|
39
|
+
"LICENSE"
|
|
17
40
|
],
|
|
18
41
|
"publishConfig": {
|
|
19
42
|
"access": "public"
|
|
20
43
|
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"solid",
|
|
46
|
+
"solidjs",
|
|
47
|
+
"i18n",
|
|
48
|
+
"internationalization",
|
|
49
|
+
"translations"
|
|
50
|
+
],
|
|
21
51
|
"peerDependencies": {
|
|
22
52
|
"solid-js": "^1.9.10",
|
|
23
53
|
"@solidjs/router": "^0.15.4"
|
|
@@ -31,13 +61,14 @@
|
|
|
31
61
|
}
|
|
32
62
|
},
|
|
33
63
|
"dependencies": {
|
|
34
|
-
"@i18n-micro/core": "1.1
|
|
35
|
-
"@i18n-micro/types": "1.
|
|
64
|
+
"@i18n-micro/core": "1.3.1",
|
|
65
|
+
"@i18n-micro/types": "1.2.2"
|
|
36
66
|
},
|
|
37
67
|
"devDependencies": {
|
|
38
68
|
"@types/jest": "^29.5.14",
|
|
39
69
|
"jest": "^29.7.0",
|
|
40
70
|
"jest-environment-jsdom": "^29.7.0",
|
|
71
|
+
"publint": "^0.3.17",
|
|
41
72
|
"solid-js": "^1.9.10",
|
|
42
73
|
"ts-jest": "^29.4.6",
|
|
43
74
|
"vite": "^7.3.1",
|
|
@@ -46,6 +77,7 @@
|
|
|
46
77
|
},
|
|
47
78
|
"scripts": {
|
|
48
79
|
"build": "vite build",
|
|
80
|
+
"check:package": "publint",
|
|
49
81
|
"dev": "cd playground && vite",
|
|
50
82
|
"test": "jest",
|
|
51
83
|
"typecheck": "tsc --noEmit"
|