solid-intlayer 8.5.0 → 8.5.2
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/cjs/client/IntlayerProvider.cjs +1 -1
- package/dist/cjs/client/index.cjs +1 -1
- package/dist/cjs/client/t.cjs +1 -1
- package/dist/cjs/client/useContent.cjs +1 -1
- package/dist/cjs/client/useDictionary.cjs +1 -1
- package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
- package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/client/useLocale.cjs +1 -1
- package/dist/cjs/client/useLocaleBase.cjs +1 -1
- package/dist/cjs/client/useRewriteURL.cjs +1 -1
- package/dist/cjs/client/useTraduction.cjs +1 -1
- package/dist/cjs/editor/ContentSelector.cjs +1 -1
- package/dist/cjs/editor/EditorProvider.cjs +1 -1
- package/dist/cjs/editor/useEditor.cjs +1 -1
- package/dist/cjs/format/index.cjs +1 -0
- package/dist/cjs/format/useCompact.cjs +1 -0
- package/dist/cjs/format/useCurrency.cjs +1 -0
- package/dist/cjs/format/useDate.cjs +1 -0
- package/dist/cjs/format/useIntl.cjs +1 -0
- package/dist/cjs/format/useList.cjs +1 -0
- package/dist/cjs/format/useNumber.cjs +1 -0
- package/dist/cjs/format/usePercentage.cjs +1 -0
- package/dist/cjs/format/useRelativeTime.cjs +1 -0
- package/dist/cjs/format/useUnit.cjs +1 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/client-BAX4Q-5b.js +1 -0
- package/dist/{client-fCZdjnbu.mjs → client-BIdlTo6F.mjs} +31 -35
- package/dist/esm/client/IntlayerProvider.mjs +2 -2
- package/dist/esm/client/index.mjs +4 -4
- package/dist/esm/client/t.mjs +1 -1
- package/dist/esm/client/useContent.mjs +1 -1
- package/dist/esm/client/useDictionary.mjs +1 -1
- package/dist/esm/client/useDictionaryAsync.mjs +1 -1
- package/dist/esm/client/useDictionaryDynamic.mjs +1 -1
- package/dist/esm/client/useIntlayer.mjs +1 -1
- package/dist/esm/client/useLocale.mjs +1 -1
- package/dist/esm/client/useLocaleBase.mjs +1 -1
- package/dist/esm/client/useRewriteURL.mjs +1 -1
- package/dist/esm/client/useTraduction.mjs +1 -1
- package/dist/esm/editor/ContentSelector.mjs +15 -7
- package/dist/esm/editor/EditorProvider.mjs +1 -1
- package/dist/esm/editor/useEditor.mjs +1 -1
- package/dist/esm/format/index.mjs +10 -0
- package/dist/esm/format/useCompact.mjs +12 -0
- package/dist/esm/format/useCurrency.mjs +13 -0
- package/dist/esm/format/useDate.mjs +19 -0
- package/dist/esm/format/useIntl.mjs +10 -0
- package/dist/esm/format/useList.mjs +12 -0
- package/dist/esm/format/useNumber.mjs +13 -0
- package/dist/esm/format/usePercentage.mjs +13 -0
- package/dist/esm/format/useRelativeTime.mjs +13 -0
- package/dist/esm/format/useUnit.mjs +12 -0
- package/dist/esm/index.mjs +4 -4
- package/dist/types/client/index.d.ts +0 -1
- package/dist/types/client/useContent.d.ts +1 -1
- package/dist/types/client/useDictionaryDynamic.d.ts +1 -1
- package/dist/types/client/useLocaleStorage.d.ts +4 -4
- package/dist/types/format/index.d.ts +9 -0
- package/dist/types/format/useCompact.d.ts +5 -0
- package/dist/types/format/useCurrency.d.ts +5 -0
- package/dist/types/format/useDate.d.ts +8 -0
- package/dist/types/{client/format → format}/useIntl.d.ts +1 -1
- package/dist/types/format/useList.d.ts +5 -0
- package/dist/types/format/useNumber.d.ts +8 -0
- package/dist/types/format/usePercentage.d.ts +5 -0
- package/dist/types/format/useRelativeTime.d.ts +5 -0
- package/dist/types/format/useUnit.d.ts +5 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +15 -6
- package/dist/cjs/UI/ContentSelector.cjs +0 -1
- package/dist/cjs/client/format/useIntl.cjs +0 -1
- package/dist/client-D7A544-v.js +0 -1
- package/dist/esm/UI/ContentSelector.mjs +0 -58
- package/dist/esm/client/format/useIntl.mjs +0 -2
- package/dist/types/UI/ContentSelector.d.ts +0 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-BAX4Q-5b.js`);exports.IntlayerClientContext=e.l,exports.IntlayerProvider=e.u,exports.IntlayerProviderContent=e.d,exports.useIntlayerContext=e.f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./getBrowserLocale.cjs`),t=require(`../../client-BAX4Q-5b.js`),n=require(`./useLocaleStorage.cjs`),r=require(`./useLoadDynamic.cjs`);exports.IntlayerClientContext=t.l,exports.IntlayerProvider=t.u,exports.IntlayerProviderContent=t.d,exports.getBrowserLocale=e.getBrowserLocale,exports.localeCookie=n.localeCookie,exports.localeInStorage=n.localeInStorage,exports.setLocaleCookie=n.setLocaleCookie,exports.setLocaleInStorage=n.setLocaleInStorage,exports.t=t.c,exports.useDictionary=t.s,exports.useDictionaryAsync=t.o,exports.useDictionaryDynamic=t.a,exports.useIntlayer=t.i,exports.useIntlayerContext=t.f,exports.useLoadDynamic=r.useLoadDynamic,exports.useLocale=t.r,exports.useLocaleBase=t.n,exports.useLocaleCookie=n.useLocaleCookie,exports.useLocaleStorage=n.useLocaleStorage,exports.useRewriteURL=t.t;
|
package/dist/cjs/client/t.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-BAX4Q-5b.js`);exports.t=e.c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-BAX4Q-5b.js`),t=require(`./useTraduction.cjs`);var n=n=>{let{locale:r}=e.n();return{locale:r,content:t.useTranslation(n),t:t.useTranslation}};exports.useContent=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-BAX4Q-5b.js`);exports.useDictionary=e.s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-BAX4Q-5b.js`);exports.useDictionaryAsync=e.o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-BAX4Q-5b.js`);exports.useDictionaryDynamic=e.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-BAX4Q-5b.js`);exports.useIntlayer=e.i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-BAX4Q-5b.js`);exports.useLocale=e.r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-BAX4Q-5b.js`);exports.useLocaleBase=e.n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-BAX4Q-5b.js`);exports.useRewriteURL=e.t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../chunk-C91j1N6u.js`),t=require(`../../client-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../chunk-C91j1N6u.js`),t=require(`../../client-BAX4Q-5b.js`);let n=require(`@intlayer/core/interpreter`),r=require(`@intlayer/config/built`);r=e.t(r);let i=require(`solid-js`);var a=e=>{let{locale:a}=(0,i.useContext)(t.l)??{};return(0,n.getTranslation)(e,a?.()??r.default?.internationalization.defaultLocale)};exports.useTranslation=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);let e=require(`solid-js/web`),t=require(`@intlayer/editor/isEnabled`);var n=(0,e.
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);let e=require(`solid-js/web`),t=require(`@intlayer/editor/isEnabled`);var n=n=>t.isEnabled?(0,e.createComponent)(e.Dynamic,{component:`intlayer-content-selector-wrapper`,get"attr:key-path"(){return JSON.stringify(n.keyPath)},get"attr:dictionary-key"(){return n.dictionaryKey},get children(){return n.children}}):n.children;exports.ContentSelector=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-BAX4Q-5b.js`);exports.EditorProvider=e.p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../client-BAX4Q-5b.js`);exports.useEditor=e.m;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./useCompact.cjs`),t=require(`./useCurrency.cjs`),n=require(`./useDate.cjs`),r=require(`./useIntl.cjs`),i=require(`./useList.cjs`),a=require(`./useNumber.cjs`),o=require(`./usePercentage.cjs`),s=require(`./useRelativeTime.cjs`),c=require(`./useUnit.cjs`);exports.useCompact=e.useCompact,exports.useCurrency=t.useCurrency,exports.useDate=n.useDate,exports.useIntl=r.useIntl,exports.useList=i.useList,exports.useNumber=a.useNumber,exports.usePercentage=o.usePercentage,exports.useRelativeTime=s.useRelativeTime,exports.useUnit=c.useUnit;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../client-BAX4Q-5b.js`);let t=require(`@intlayer/core/formatters`);var n=()=>{let{locale:n}=e.f();return(...e)=>(0,t.compact)(e[0],{...e[1],locale:e[1]?.locale??n()})};exports.useCompact=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../client-BAX4Q-5b.js`);let t=require(`solid-js`),n=require(`@intlayer/core/formatters`);var r=()=>{let{locale:r}=(0,t.useContext)(e.l);return(...e)=>(0,n.currency)(e[0],{...e[1],locale:e[1]?.locale??r()})};exports.useCurrency=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../client-BAX4Q-5b.js`);let t=require(`solid-js`),n=require(`@intlayer/core/formatters`);var r=()=>{let{locale:r}=(0,t.useContext)(e.l);return(...e)=>{let t=typeof e[1]==`string`?{...n.presets[e[1]],locale:r()}:{...e[1],locale:e[1]?.locale??r()};return(0,n.date)(e[0],t)}};exports.useDate=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../client-BAX4Q-5b.js`);let t=require(`solid-js`),n=require(`@intlayer/core/formatters`);var r=r=>{let i=(0,t.useContext)(e.l);return(0,t.createMemo)(()=>(0,n.bindIntl)(r??i.locale()))};exports.useIntl=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../client-BAX4Q-5b.js`);let t=require(`@intlayer/core/formatters`);var n=()=>{let{locale:n}=e.f();return(...e)=>(0,t.list)(e[0],{...e[1],locale:e[1]?.locale??n()})};exports.useList=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../client-BAX4Q-5b.js`);let t=require(`solid-js`),n=require(`@intlayer/core/formatters`);var r=()=>{let{locale:r}=(0,t.useContext)(e.l);return(...e)=>(0,n.number)(e[0],{...e[1],locale:e[1]?.locale??r()})};exports.useNumber=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../client-BAX4Q-5b.js`);let t=require(`solid-js`),n=require(`@intlayer/core/formatters`);var r=()=>{let{locale:r}=(0,t.useContext)(e.l);return(...e)=>(0,n.percentage)(e[0],{...e[1],locale:e[1]?.locale??r()})};exports.usePercentage=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../client-BAX4Q-5b.js`);let t=require(`solid-js`),n=require(`@intlayer/core/formatters`);var r=()=>{let{locale:r}=(0,t.useContext)(e.l);return(...e)=>(0,n.relativeTime)(e[0],e[1],{...e[2],locale:e[2]?.locale??r()})};exports.useRelativeTime=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`../../client-BAX4Q-5b.js`);let t=require(`@intlayer/core/formatters`);var n=()=>{let{locale:n}=e.f();return(...e)=>(0,t.units)(e[0],{...e[1],locale:e[1]?.locale??n()})};exports.useUnit=n;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./getDictionary.cjs`),t=require(`./getIntlayer.cjs`),n=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./getDictionary.cjs`),t=require(`./getIntlayer.cjs`),n=require(`./client/getBrowserLocale.cjs`),r=require(`../client-BAX4Q-5b.js`),i=require(`./client/useLocaleStorage.cjs`),a=require(`./client/useLoadDynamic.cjs`);exports.IntlayerClientContext=r.l,exports.IntlayerProvider=r.u,exports.IntlayerProviderContent=r.d,exports.getBrowserLocale=n.getBrowserLocale,exports.getDictionary=e.getDictionary,exports.getIntlayer=t.getIntlayer,exports.localeCookie=i.localeCookie,exports.localeInStorage=i.localeInStorage,exports.setLocaleCookie=i.setLocaleCookie,exports.setLocaleInStorage=i.setLocaleInStorage,exports.t=r.c,exports.useDictionary=r.s,exports.useDictionaryAsync=r.o,exports.useDictionaryDynamic=r.a,exports.useIntlayer=r.i,exports.useIntlayerContext=r.f,exports.useLoadDynamic=a.useLoadDynamic,exports.useLocale=r.r,exports.useLocaleBase=r.n,exports.useLocaleCookie=i.useLocaleCookie,exports.useLocaleStorage=i.useLocaleStorage,exports.useRewriteURL=r.t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./chunk-C91j1N6u.js`),t=require(`./cjs/getDictionary.cjs`),n=require(`./cjs/getIntlayer.cjs`),r=require(`./cjs/client/useLocaleStorage.cjs`),i=require(`./cjs/client/useLoadDynamic.cjs`);let a=require(`@intlayer/core/interpreter`),o=require(`solid-js/web`),s=require(`@intlayer/config/built`);s=e.t(s);let c=require(`@intlayer/editor/isEnabled`),l=require(`solid-js`),u=require(`@intlayer/core/localization`);var d=()=>{if(process.env.INTLAYER_EDITOR_ENABLED===`false`||!c.isEnabled)return;let{locale:e}=m(),[t,n]=(0,l.createSignal)(null);(0,l.onMount)(()=>{import(`@intlayer/editor`).then(({initEditorClient:e})=>{n(e())})}),(0,l.createEffect)(()=>{let n=t(),r=e();n&&r&&n.currentLocale.set(r)}),(0,l.onCleanup)(()=>{import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})})},f=({children:e})=>(d(),e),p=(0,l.createContext)({locale:()=>r.localeInStorage??s.default?.internationalization?.defaultLocale,setLocale:()=>null}),m=()=>(0,l.useContext)(p),h=e=>{let{internationalization:t}=s.default??{},{defaultLocale:n,locales:i}=t??{},[a,c]=(0,l.createSignal)(e.locale??r.localeInStorage??e.defaultLocale??n),d=e.setLocale??(t=>{if(a().toString()!==t.toString()){if(!i?.map(String).includes(t)){console.error(`Locale ${t} is not available`);return}c(t),r.setLocaleInStorage(t,e.isCookieEnabled)}}),f=(0,l.createMemo)(()=>(0,u.localeResolver)(a()));return(0,l.createEffect)((0,l.on)(()=>e.locale,e=>{e&&e!==(0,l.untrack)(a)&&c(e)},{defer:!0})),(0,o.createComponent)(p.Provider,{value:{locale:f,setLocale:d},get children(){return e.children}})},g=e=>(0,o.createComponent)(h,(0,o.mergeProps)(e,{get children(){return[(0,o.createComponent)(f,{}),(0,o.memo)(()=>e.children)]}})),_=(e,t)=>{let{locale:n}=(0,l.useContext)(p);return(0,a.getTranslation)(e,t??(typeof n==`function`?n():n))},v=(e,n)=>{let r=(0,l.useContext)(p);return(0,l.createMemo)(()=>t.getDictionary(e,n??r?.locale?.()))},y=async(e,t)=>{let{locale:n}=(0,l.useContext)(p),r=s.default?.internationalization.defaultLocale,i=t??n()??r;return v(await e[i]?.(),i)},b=(e,t,n)=>{let{locale:r}=(0,l.useContext)(p)??{},a=s.default?.internationalization.defaultLocale,o=n??r?.()??a;return v(i.useLoadDynamic(`${String(t)}.${o}`,e[o]?.()),o)},x=(e,t)=>{let r=(0,l.useContext)(p);return(0,l.createMemo)(()=>{let i=r?.locale();return n.getIntlayer(e,t??i)})},S=({isCookieEnabled:e,onLocaleChange:t}={})=>{let{defaultLocale:n,locales:i}=s.default?.internationalization??{},a=(0,l.useContext)(p);return(0,l.createEffect)((0,l.on)(()=>a?.locale?.(),e=>{t&&e!==void 0&&t(e)},{defer:!0})),{locale:a?.locale,defaultLocale:n,availableLocales:i,setLocale:t=>{if(!i?.map(String).includes(t)){console.error(`Locale ${t} is not available`);return}a?.setLocale(t),r.setLocaleInStorage(t,e??a?.isCookieEnabled??!0)}}},{defaultLocale:C,locales:w}=s.default.internationalization,T=()=>{let{locale:e,setLocale:t}=(0,l.useContext)(p);return{locale:e,defaultLocale:C,availableLocales:w,setLocale:t}},E=()=>{let{locale:e}=S(),t=s.default?.routing?.rewrite;(0,l.createEffect)(()=>{if(typeof window>`u`||!t)return;let n=e(),r=window.location.pathname,i=(0,u.getRewritePath)(r,n,t);i&&i!==r&&window.history.replaceState(window.history.state,``,i+window.location.search+window.location.hash)})};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return g}});
|
|
@@ -7,12 +7,11 @@ import { createComponent as o, memo as s, mergeProps as c } from "solid-js/web";
|
|
|
7
7
|
import l from "@intlayer/config/built";
|
|
8
8
|
import { isEnabled as u } from "@intlayer/editor/isEnabled";
|
|
9
9
|
import { createContext as d, createEffect as f, createMemo as p, createSignal as m, on as h, onCleanup as g, onMount as _, untrack as v, useContext as y } from "solid-js";
|
|
10
|
-
import {
|
|
11
|
-
import { getRewritePath as x, localeResolver as S } from "@intlayer/core/localization";
|
|
10
|
+
import { getRewritePath as b, localeResolver as x } from "@intlayer/core/localization";
|
|
12
11
|
//#region src/editor/useEditor.tsx
|
|
13
|
-
var
|
|
12
|
+
var S = () => {
|
|
14
13
|
if (process.env.INTLAYER_EDITOR_ENABLED === "false" || !u) return;
|
|
15
|
-
let { locale: e } =
|
|
14
|
+
let { locale: e } = T(), [t, n] = m(null);
|
|
16
15
|
_(() => {
|
|
17
16
|
import("@intlayer/editor").then(({ initEditorClient: e }) => {
|
|
18
17
|
n(e());
|
|
@@ -25,10 +24,10 @@ var C = () => {
|
|
|
25
24
|
e();
|
|
26
25
|
});
|
|
27
26
|
});
|
|
28
|
-
},
|
|
27
|
+
}, C = ({ children: e }) => (S(), e), w = d({
|
|
29
28
|
locale: () => n ?? l?.internationalization?.defaultLocale,
|
|
30
29
|
setLocale: () => null
|
|
31
|
-
}),
|
|
30
|
+
}), T = () => y(w), E = (e) => {
|
|
32
31
|
let { internationalization: t } = l ?? {}, { defaultLocale: i, locales: a } = t ?? {}, [s, c] = m(e.locale ?? n ?? e.defaultLocale ?? i), u = e.setLocale ?? ((t) => {
|
|
33
32
|
if (s().toString() !== t.toString()) {
|
|
34
33
|
if (!a?.map(String).includes(t)) {
|
|
@@ -37,10 +36,10 @@ var C = () => {
|
|
|
37
36
|
}
|
|
38
37
|
c(t), r(t, e.isCookieEnabled);
|
|
39
38
|
}
|
|
40
|
-
}), d = p(() =>
|
|
39
|
+
}), d = p(() => x(s()));
|
|
41
40
|
return f(h(() => e.locale, (e) => {
|
|
42
41
|
e && e !== v(s) && c(e);
|
|
43
|
-
}, { defer: !0 })), o(
|
|
42
|
+
}, { defer: !0 })), o(w.Provider, {
|
|
44
43
|
value: {
|
|
45
44
|
locale: d,
|
|
46
45
|
setLocale: u
|
|
@@ -49,31 +48,28 @@ var C = () => {
|
|
|
49
48
|
return e.children;
|
|
50
49
|
}
|
|
51
50
|
});
|
|
52
|
-
},
|
|
53
|
-
return [o(
|
|
54
|
-
} })),
|
|
55
|
-
let
|
|
56
|
-
return p(() => b(e ?? t.locale()));
|
|
57
|
-
}, A = (e, t) => {
|
|
58
|
-
let { locale: n } = y(T);
|
|
51
|
+
}, D = (e) => o(E, c(e, { get children() {
|
|
52
|
+
return [o(C, {}), s(() => e.children)];
|
|
53
|
+
} })), O = (e, t) => {
|
|
54
|
+
let { locale: n } = y(w);
|
|
59
55
|
return a(e, t ?? (typeof n == "function" ? n() : n));
|
|
60
|
-
},
|
|
61
|
-
let r = y(
|
|
56
|
+
}, k = (t, n) => {
|
|
57
|
+
let r = y(w);
|
|
62
58
|
return p(() => e(t, n ?? r?.locale?.()));
|
|
63
|
-
},
|
|
64
|
-
let { locale: n } = y(
|
|
65
|
-
return
|
|
66
|
-
},
|
|
67
|
-
let { locale: r } = y(
|
|
68
|
-
return
|
|
69
|
-
},
|
|
70
|
-
let r = y(
|
|
59
|
+
}, A = async (e, t) => {
|
|
60
|
+
let { locale: n } = y(w), r = l?.internationalization.defaultLocale, i = t ?? n() ?? r;
|
|
61
|
+
return k(await e[i]?.(), i);
|
|
62
|
+
}, j = (e, t, n) => {
|
|
63
|
+
let { locale: r } = y(w) ?? {}, a = l?.internationalization.defaultLocale, o = n ?? r?.() ?? a;
|
|
64
|
+
return k(i(`${String(t)}.${o}`, e[o]?.()), o);
|
|
65
|
+
}, M = (e, n) => {
|
|
66
|
+
let r = y(w);
|
|
71
67
|
return p(() => {
|
|
72
68
|
let i = r?.locale();
|
|
73
69
|
return t(e, n ?? i);
|
|
74
70
|
});
|
|
75
|
-
},
|
|
76
|
-
let { defaultLocale: n, locales: i } = l?.internationalization ?? {}, a = y(
|
|
71
|
+
}, N = ({ isCookieEnabled: e, onLocaleChange: t } = {}) => {
|
|
72
|
+
let { defaultLocale: n, locales: i } = l?.internationalization ?? {}, a = y(w);
|
|
77
73
|
return f(h(() => a?.locale?.(), (e) => {
|
|
78
74
|
t && e !== void 0 && t(e);
|
|
79
75
|
}, { defer: !0 })), {
|
|
@@ -88,21 +84,21 @@ var C = () => {
|
|
|
88
84
|
a?.setLocale(t), r(t, e ?? a?.isCookieEnabled ?? !0);
|
|
89
85
|
}
|
|
90
86
|
};
|
|
91
|
-
}, { defaultLocale:
|
|
92
|
-
let { locale: e, setLocale: t } = y(
|
|
87
|
+
}, { defaultLocale: P, locales: F } = l.internationalization, I = () => {
|
|
88
|
+
let { locale: e, setLocale: t } = y(w);
|
|
93
89
|
return {
|
|
94
90
|
locale: e,
|
|
95
|
-
defaultLocale:
|
|
96
|
-
availableLocales:
|
|
91
|
+
defaultLocale: P,
|
|
92
|
+
availableLocales: F,
|
|
97
93
|
setLocale: t
|
|
98
94
|
};
|
|
99
|
-
},
|
|
100
|
-
let { locale: e } =
|
|
95
|
+
}, L = () => {
|
|
96
|
+
let { locale: e } = N(), t = l?.routing?.rewrite;
|
|
101
97
|
f(() => {
|
|
102
98
|
if (typeof window > "u" || !t) return;
|
|
103
|
-
let n = e(), r = window.location.pathname, i =
|
|
99
|
+
let n = e(), r = window.location.pathname, i = b(r, n, t);
|
|
104
100
|
i && i !== r && window.history.replaceState(window.history.state, "", i + window.location.search + window.location.hash);
|
|
105
101
|
});
|
|
106
102
|
};
|
|
107
103
|
//#endregion
|
|
108
|
-
export {
|
|
104
|
+
export { j as a, O as c, E as d, T as f, M as i, w as l, S as m, I as n, A as o, C as p, N as r, k as s, L as t, D as u };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { d as e, f as t,
|
|
2
|
-
export {
|
|
1
|
+
import { d as e, f as t, l as n, u as r } from "../../client-BIdlTo6F.mjs";
|
|
2
|
+
export { n as IntlayerClientContext, r as IntlayerProvider, e as IntlayerProviderContent, t as useIntlayerContext };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getBrowserLocale as e } from "./getBrowserLocale.mjs";
|
|
2
|
+
import { a as t, c as n, d as r, f as i, i as a, l as o, n as s, o as c, r as l, s as u, t as d, u as f } from "../../client-BIdlTo6F.mjs";
|
|
2
3
|
import { localeCookie as p, localeInStorage as m, setLocaleCookie as h, setLocaleInStorage as g, useLocaleCookie as _, useLocaleStorage as v } from "./useLocaleStorage.mjs";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export { f as IntlayerClientContext, n as IntlayerProvider, r as IntlayerProviderContent, y as getBrowserLocale, p as localeCookie, m as localeInStorage, h as setLocaleCookie, g as setLocaleInStorage, t, u as useDictionary, s as useDictionaryAsync, e as useDictionaryDynamic, a as useIntl, i as useIntlayer, c as useIntlayerContext, b as useLoadDynamic, l as useLocale, o as useLocaleBase, _ as useLocaleCookie, v as useLocaleStorage, d as useRewriteURL };
|
|
4
|
+
import { useLoadDynamic as y } from "./useLoadDynamic.mjs";
|
|
5
|
+
export { o as IntlayerClientContext, f as IntlayerProvider, r as IntlayerProviderContent, e as getBrowserLocale, p as localeCookie, m as localeInStorage, h as setLocaleCookie, g as setLocaleInStorage, n as t, u as useDictionary, c as useDictionaryAsync, t as useDictionaryDynamic, a as useIntlayer, i as useIntlayerContext, y as useLoadDynamic, l as useLocale, s as useLocaleBase, _ as useLocaleCookie, v as useLocaleStorage, d as useRewriteURL };
|
package/dist/esm/client/t.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as e } from "../../client-
|
|
1
|
+
import { c as e } from "../../client-BIdlTo6F.mjs";
|
|
2
2
|
export { e as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { s as e } from "../../client-
|
|
1
|
+
import { s as e } from "../../client-BIdlTo6F.mjs";
|
|
2
2
|
export { e as useDictionary };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { o as e } from "../../client-
|
|
1
|
+
import { o as e } from "../../client-BIdlTo6F.mjs";
|
|
2
2
|
export { e as useDictionaryAsync };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e } from "../../client-
|
|
1
|
+
import { a as e } from "../../client-BIdlTo6F.mjs";
|
|
2
2
|
export { e as useDictionaryDynamic };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as e } from "../../client-
|
|
1
|
+
import { i as e } from "../../client-BIdlTo6F.mjs";
|
|
2
2
|
export { e as useIntlayer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as e } from "../../client-
|
|
1
|
+
import { r as e } from "../../client-BIdlTo6F.mjs";
|
|
2
2
|
export { e as useLocale };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e } from "../../client-
|
|
1
|
+
import { n as e } from "../../client-BIdlTo6F.mjs";
|
|
2
2
|
export { e as useLocaleBase };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../client-
|
|
1
|
+
import { t as e } from "../../client-BIdlTo6F.mjs";
|
|
2
2
|
export { e as useRewriteURL };
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isEnabled as
|
|
1
|
+
import { Dynamic as e, createComponent as t } from "solid-js/web";
|
|
2
|
+
import { isEnabled as n } from "@intlayer/editor/isEnabled";
|
|
3
3
|
//#region src/editor/ContentSelector.tsx
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
var r = (r) => n ? t(e, {
|
|
5
|
+
component: "intlayer-content-selector-wrapper",
|
|
6
|
+
get "attr:key-path"() {
|
|
7
|
+
return JSON.stringify(r.keyPath);
|
|
8
|
+
},
|
|
9
|
+
get "attr:dictionary-key"() {
|
|
10
|
+
return r.dictionaryKey;
|
|
11
|
+
},
|
|
12
|
+
get children() {
|
|
13
|
+
return r.children;
|
|
14
|
+
}
|
|
15
|
+
}) : r.children;
|
|
8
16
|
//#endregion
|
|
9
|
-
export {
|
|
17
|
+
export { r as ContentSelector };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { p as e } from "../../client-BIdlTo6F.mjs";
|
|
2
2
|
export { e as EditorProvider };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as e } from "../../client-BIdlTo6F.mjs";
|
|
2
2
|
export { e as useEditor };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useCompact as e } from "./useCompact.mjs";
|
|
2
|
+
import { useCurrency as t } from "./useCurrency.mjs";
|
|
3
|
+
import { useDate as n } from "./useDate.mjs";
|
|
4
|
+
import { useIntl as r } from "./useIntl.mjs";
|
|
5
|
+
import { useList as i } from "./useList.mjs";
|
|
6
|
+
import { useNumber as a } from "./useNumber.mjs";
|
|
7
|
+
import { usePercentage as o } from "./usePercentage.mjs";
|
|
8
|
+
import { useRelativeTime as s } from "./useRelativeTime.mjs";
|
|
9
|
+
import { useUnit as c } from "./useUnit.mjs";
|
|
10
|
+
export { e as useCompact, t as useCurrency, n as useDate, r as useIntl, i as useList, a as useNumber, o as usePercentage, s as useRelativeTime, c as useUnit };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { f as e } from "../../client-BIdlTo6F.mjs";
|
|
2
|
+
import { compact as t } from "@intlayer/core/formatters";
|
|
3
|
+
//#region src/format/useCompact.ts
|
|
4
|
+
var n = () => {
|
|
5
|
+
let { locale: n } = e();
|
|
6
|
+
return (...e) => t(e[0], {
|
|
7
|
+
...e[1],
|
|
8
|
+
locale: e[1]?.locale ?? n()
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as useCompact };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { l as e } from "../../client-BIdlTo6F.mjs";
|
|
2
|
+
import { useContext as t } from "solid-js";
|
|
3
|
+
import { currency as n } from "@intlayer/core/formatters";
|
|
4
|
+
//#region src/format/useCurrency.ts
|
|
5
|
+
var r = () => {
|
|
6
|
+
let { locale: r } = t(e);
|
|
7
|
+
return (...e) => n(e[0], {
|
|
8
|
+
...e[1],
|
|
9
|
+
locale: e[1]?.locale ?? r()
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as useCurrency };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { l as e } from "../../client-BIdlTo6F.mjs";
|
|
2
|
+
import { useContext as t } from "solid-js";
|
|
3
|
+
import { date as n, presets as r } from "@intlayer/core/formatters";
|
|
4
|
+
//#region src/format/useDate.ts
|
|
5
|
+
var i = () => {
|
|
6
|
+
let { locale: i } = t(e);
|
|
7
|
+
return (...e) => {
|
|
8
|
+
let t = typeof e[1] == "string" ? {
|
|
9
|
+
...r[e[1]],
|
|
10
|
+
locale: i()
|
|
11
|
+
} : {
|
|
12
|
+
...e[1],
|
|
13
|
+
locale: e[1]?.locale ?? i()
|
|
14
|
+
};
|
|
15
|
+
return n(e[0], t);
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { i as useDate };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { l as e } from "../../client-BIdlTo6F.mjs";
|
|
2
|
+
import { createMemo as t, useContext as n } from "solid-js";
|
|
3
|
+
import { bindIntl as r } from "@intlayer/core/formatters";
|
|
4
|
+
//#region src/format/useIntl.ts
|
|
5
|
+
var i = (i) => {
|
|
6
|
+
let a = n(e);
|
|
7
|
+
return t(() => r(i ?? a.locale()));
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { i as useIntl };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { f as e } from "../../client-BIdlTo6F.mjs";
|
|
2
|
+
import { list as t } from "@intlayer/core/formatters";
|
|
3
|
+
//#region src/format/useList.ts
|
|
4
|
+
var n = () => {
|
|
5
|
+
let { locale: n } = e();
|
|
6
|
+
return (...e) => t(e[0], {
|
|
7
|
+
...e[1],
|
|
8
|
+
locale: e[1]?.locale ?? n()
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as useList };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { l as e } from "../../client-BIdlTo6F.mjs";
|
|
2
|
+
import { useContext as t } from "solid-js";
|
|
3
|
+
import { number as n } from "@intlayer/core/formatters";
|
|
4
|
+
//#region src/format/useNumber.ts
|
|
5
|
+
var r = () => {
|
|
6
|
+
let { locale: r } = t(e);
|
|
7
|
+
return (...e) => n(e[0], {
|
|
8
|
+
...e[1],
|
|
9
|
+
locale: e[1]?.locale ?? r()
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as useNumber };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { l as e } from "../../client-BIdlTo6F.mjs";
|
|
2
|
+
import { useContext as t } from "solid-js";
|
|
3
|
+
import { percentage as n } from "@intlayer/core/formatters";
|
|
4
|
+
//#region src/format/usePercentage.ts
|
|
5
|
+
var r = () => {
|
|
6
|
+
let { locale: r } = t(e);
|
|
7
|
+
return (...e) => n(e[0], {
|
|
8
|
+
...e[1],
|
|
9
|
+
locale: e[1]?.locale ?? r()
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as usePercentage };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { l as e } from "../../client-BIdlTo6F.mjs";
|
|
2
|
+
import { useContext as t } from "solid-js";
|
|
3
|
+
import { relativeTime as n } from "@intlayer/core/formatters";
|
|
4
|
+
//#region src/format/useRelativeTime.ts
|
|
5
|
+
var r = () => {
|
|
6
|
+
let { locale: r } = t(e);
|
|
7
|
+
return (...e) => n(e[0], e[1], {
|
|
8
|
+
...e[2],
|
|
9
|
+
locale: e[2]?.locale ?? r()
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as useRelativeTime };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { f as e } from "../../client-BIdlTo6F.mjs";
|
|
2
|
+
import { units as t } from "@intlayer/core/formatters";
|
|
3
|
+
//#region src/format/useUnit.ts
|
|
4
|
+
var n = () => {
|
|
5
|
+
let { locale: n } = e();
|
|
6
|
+
return (...e) => t(e[0], {
|
|
7
|
+
...e[1],
|
|
8
|
+
locale: e[1]?.locale ?? n()
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as useUnit };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getDictionary as e } from "./getDictionary.mjs";
|
|
2
2
|
import { getIntlayer as t } from "./getIntlayer.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { getBrowserLocale as n } from "./client/getBrowserLocale.mjs";
|
|
4
|
+
import { a as r, c as i, d as a, f as o, i as s, l as c, n as l, o as u, r as d, s as f, t as p, u as m } from "../client-BIdlTo6F.mjs";
|
|
4
5
|
import { localeCookie as h, localeInStorage as g, setLocaleCookie as _, setLocaleInStorage as v, useLocaleCookie as y, useLocaleStorage as b } from "./client/useLocaleStorage.mjs";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
export { m as IntlayerClientContext, i as IntlayerProvider, a as IntlayerProviderContent, x as getBrowserLocale, e as getDictionary, t as getIntlayer, h as localeCookie, g as localeInStorage, _ as setLocaleCookie, v as setLocaleInStorage, r as t, f as useDictionary, l as useDictionaryAsync, n as useDictionaryDynamic, s as useIntl, o as useIntlayer, u as useIntlayerContext, S as useLoadDynamic, d as useLocale, c as useLocaleBase, y as useLocaleCookie, b as useLocaleStorage, p as useRewriteURL };
|
|
6
|
+
import { useLoadDynamic as x } from "./client/useLoadDynamic.mjs";
|
|
7
|
+
export { c as IntlayerClientContext, m as IntlayerProvider, a as IntlayerProviderContent, n as getBrowserLocale, e as getDictionary, t as getIntlayer, h as localeCookie, g as localeInStorage, _ as setLocaleCookie, v as setLocaleInStorage, i as t, f as useDictionary, u as useDictionaryAsync, r as useDictionaryDynamic, s as useIntlayer, o as useIntlayerContext, x as useLoadDynamic, d as useLocale, l as useLocaleBase, y as useLocaleCookie, b as useLocaleStorage, p as useRewriteURL };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { useIntl } from './format/useIntl';
|
|
2
1
|
export { getBrowserLocale } from './getBrowserLocale';
|
|
3
2
|
export { IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, type IntlayerProviderProps, useIntlayerContext, } from './IntlayerProvider';
|
|
4
3
|
export { t } from './t';
|
|
@@ -3,7 +3,7 @@ import { StrictModeLocaleMap } from '@intlayer/types/module_augmentation';
|
|
|
3
3
|
* On the client side, hook to get the translation content based on the locale
|
|
4
4
|
*/
|
|
5
5
|
export declare const useContent: <Content>(languageContent: StrictModeLocaleMap<Content>) => {
|
|
6
|
-
locale: import('
|
|
6
|
+
locale: import('intlayer').Locale;
|
|
7
7
|
content: Content;
|
|
8
8
|
t: <Content_1 = string>(languageContent: StrictModeLocaleMap<Content_1>) => Content_1;
|
|
9
9
|
};
|
|
@@ -5,4 +5,4 @@ import { DictionaryKeys, LocalesValues, StrictModeLocaleMap } from '@intlayer/ty
|
|
|
5
5
|
*
|
|
6
6
|
* If the locale is not provided, it will use the locale from the client context
|
|
7
7
|
*/
|
|
8
|
-
export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => import('solid-js').Accessor<import('@intlayer/core/interpreter').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState, (string & {}) | "is" | "id" | "
|
|
8
|
+
export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => import('solid-js').Accessor<import('@intlayer/core/interpreter').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState, (string & {}) | "is" | "id" | "hr" | "th" | "tr" | "mi" | "mn" | "ms" | "af" | "af-ZA" | "sq" | "sq-AL" | "am" | "am-ET" | "ar" | "ar-DZ" | "ar-BH" | "ar-TD" | "ar-KM" | "ar-DJ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MR" | "ar-MA" | "ar-OM" | "ar-PS" | "ar-QA" | "ar-SA" | "ar-SO" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-AE" | "ar-YE" | "hy" | "hy-AM" | "az" | "az-AZ" | "eu" | "eu-ES" | "be" | "be-BY" | "bn" | "bn-BD" | "bn-IN" | "bn-MM" | "bs" | "bs-BA" | "bg" | "bg-BG" | "my" | "my-MM" | "ca" | "ca-ES" | "zh" | "zh-HK" | "zh-MO" | "zh-Hans" | "zh-CN" | "zh-SG" | "zh-TW" | "zh-Hant" | "hr-BA" | "hr-HR" | "cs" | "cs-CZ" | "da" | "da-DK" | "dv" | "dv-MV" | "nl" | "nl-BE" | "nl-NL" | "en" | "en-AU" | "en-BZ" | "en-BW" | "en-CA" | "en-CB" | "en-GH" | "en-HK" | "en-IN" | "en-IE" | "en-JM" | "en-KE" | "en-MY" | "en-NZ" | "en-NG" | "en-PK" | "en-PH" | "en-SG" | "en-ZA" | "en-TZ" | "en-TT" | "en-UG" | "en-GB" | "en-US" | "en-ZW" | "eo" | "et" | "et-EE" | "fo" | "fo-FO" | "fa" | "fa-IR" | "fi" | "fi-FI" | "fr" | "fr-BE" | "fr-CA" | "fr-FR" | "fr-LU" | "fr-MC" | "fr-CH" | "mk" | "mk-MK" | "gl" | "gl-ES" | "ka" | "ka-GE" | "de" | "de-AT" | "de-DE" | "de-LI" | "de-LU" | "de-CH" | "el" | "el-GR" | "gu" | "gu-IN" | "he" | "he-IL" | "hi" | "hi-IN" | "hu" | "hu-HU" | "is-IS" | "id-ID" | "ga" | "ga-IE" | "it" | "it-IT" | "it-CH" | "ja" | "ja-JP" | "kn" | "kn-IN" | "kk" | "kk-KZ" | "km" | "km-KH" | "kok" | "kok-IN" | "ko" | "ko-KR" | "ku" | "ku-TR" | "ky" | "ky-KG" | "lo" | "lo-LA" | "lv" | "lv-LV" | "lt" | "lt-LT" | "dsb" | "dsb-DE" | "mg-MG" | "ml" | "ml-IN" | "ms-BN" | "ms-MY" | "mt" | "mt-MT" | "mi-NZ" | "mr" | "mr-IN" | "mn-MN" | "ne" | "ne-NP" | "ns" | "ns-ZA" | "no" | "nb" | "nb-NO" | "nn" | "nn-NO" | "ps" | "ps-AR" | "pl" | "pl-PL" | "pt" | "pt-BR" | "pt-CV" | "pt-GW" | "pt-MO" | "pt-MZ" | "pt-PT" | "pt-ST" | "pt-TL" | "pa" | "pa-IN" | "qu" | "qu-BO" | "qu-EC" | "qu-PE" | "ro" | "ro-MD" | "ro-RO" | "rm" | "rm-CH" | "ru" | "ru-MD" | "ru-RU" | "se" | "se-FI" | "se-NO" | "se-SE" | "sa" | "sa-IN" | "gd" | "gd-GB" | "sr-Cyrl" | "sr-BA" | "sr-RS" | "sr" | "sr-SP" | "si" | "si-LK" | "sk" | "sk-SK" | "sl" | "sl-SI" | "es" | "es-AR" | "es-BO" | "es-CL" | "es-CO" | "es-CR" | "es-CU" | "es-DO" | "es-EC" | "es-SV" | "es-GT" | "es-HN" | "es-MX" | "es-NI" | "es-PA" | "es-PY" | "es-PE" | "es-PR" | "es-ES" | "es-US" | "es-UY" | "es-VE" | "sw" | "sw-KE" | "sv" | "sv-FI" | "sv-SE" | "syr" | "syr-SY" | "tl" | "tl-PH" | "ta" | "ta-IN" | "tt" | "tt-RU" | "te" | "te-IN" | "th-TH" | "ts" | "tn" | "tn-ZA" | "tr-TR" | "uk" | "uk-UA" | "hsb" | "hsb-DE" | "ur" | "ur-PK" | "uz" | "uz-UZ" | "ve" | "ve-ZA" | "vi" | "vi-VN" | "cy" | "cy-GB" | "xh" | "xh-ZA" | "yi" | "yi-001" | "yo" | "yo-NG" | "zu" | "zu-ZA">>;
|
|
@@ -2,13 +2,13 @@ import { LocalesValues } from '@intlayer/types/module_augmentation';
|
|
|
2
2
|
/**
|
|
3
3
|
* Get the locale cookie
|
|
4
4
|
*/
|
|
5
|
-
export declare const localeInStorage: import('
|
|
5
|
+
export declare const localeInStorage: import('intlayer').Locale | undefined;
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated Use localeInStorage instead
|
|
8
8
|
*
|
|
9
9
|
* Get the locale cookie
|
|
10
10
|
*/
|
|
11
|
-
export declare const localeCookie: import('
|
|
11
|
+
export declare const localeCookie: import('intlayer').Locale | undefined;
|
|
12
12
|
/**
|
|
13
13
|
* Set the locale cookie
|
|
14
14
|
*/
|
|
@@ -23,7 +23,7 @@ export declare const setLocaleCookie: (locale: LocalesValues, isCookieEnabled?:
|
|
|
23
23
|
* Hook that provides the locale storage and a function to set it
|
|
24
24
|
*/
|
|
25
25
|
export declare const useLocaleStorage: (isCookieEnabled?: boolean) => import('solid-js').Accessor<{
|
|
26
|
-
getLocale: () => import('
|
|
26
|
+
getLocale: () => import('intlayer').Locale;
|
|
27
27
|
setLocale: (locale: LocalesValues) => void;
|
|
28
28
|
}>;
|
|
29
29
|
/**
|
|
@@ -34,6 +34,6 @@ export declare const useLocaleStorage: (isCookieEnabled?: boolean) => import('so
|
|
|
34
34
|
* Hook that provides the locale cookie and a function to set it
|
|
35
35
|
*/
|
|
36
36
|
export declare const useLocaleCookie: (isCookieEnabled?: boolean) => {
|
|
37
|
-
localeCookie: import('
|
|
37
|
+
localeCookie: import('intlayer').Locale;
|
|
38
38
|
setLocaleCookie: (locale: LocalesValues) => void;
|
|
39
39
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './useCompact';
|
|
2
|
+
export * from './useCurrency';
|
|
3
|
+
export * from './useDate';
|
|
4
|
+
export * from './useIntl';
|
|
5
|
+
export * from './useList';
|
|
6
|
+
export * from './useNumber';
|
|
7
|
+
export * from './usePercentage';
|
|
8
|
+
export * from './useRelativeTime';
|
|
9
|
+
export * from './useUnit';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { date } from '@intlayer/core/formatters';
|
|
2
|
+
/**
|
|
3
|
+
* Solid client hook that provides a localized date/time formatter.
|
|
4
|
+
*
|
|
5
|
+
* @returns {(date: Date | string | number, options?: DateProps) => string}
|
|
6
|
+
* A function to format dates into localized strings.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useDate: () => (...args: Parameters<typeof date>) => string;
|
|
@@ -12,7 +12,7 @@ import { LocalesValues } from '@intlayer/types/module_augmentation';
|
|
|
12
12
|
* const intl = useIntl(); // uses context locale
|
|
13
13
|
*
|
|
14
14
|
* // Standard API, but no need to pass locale as the first argument
|
|
15
|
-
* const formatted = new intl().NumberFormat({
|
|
15
|
+
* const formatted = new (intl().NumberFormat)({
|
|
16
16
|
* style: 'currency',
|
|
17
17
|
* currency: 'USD'
|
|
18
18
|
* }).format(123.45);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { number } from '@intlayer/core/formatters';
|
|
2
|
+
/**
|
|
3
|
+
* Solid client hook that provides a localized number formatter.
|
|
4
|
+
*
|
|
5
|
+
* @returns {(value: string | number, options?: import("@intlayer/core/formatters").NumberProps) => string}
|
|
6
|
+
* A function to format numbers into localized strings.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useNumber: () => (...args: Parameters<typeof number>) => string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ declare module '@intlayer/core/interpreter' {
|
|
|
4
4
|
interface IInterpreterPlugin<T, S, L extends LocalesValues> extends IInterpreterPluginSolid<T, S, L> {
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
export { getBrowserLocale, IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, type IntlayerProviderProps, localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, t, useDictionary, useDictionaryAsync, useDictionaryDynamic,
|
|
7
|
+
export { getBrowserLocale, IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, type IntlayerProviderProps, localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useIntlayer, useIntlayerContext, useLoadDynamic, useLocale, useLocaleBase, useLocaleCookie, useLocaleStorage, useRewriteURL, } from './client/index';
|
|
8
8
|
export { getDictionary } from './getDictionary';
|
|
9
9
|
export { getIntlayer } from './getIntlayer';
|
|
10
10
|
export type { IntlayerNode } from './IntlayerNode';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-intlayer",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Solid applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -52,6 +52,12 @@
|
|
|
52
52
|
"require": "./dist/cjs/markdown/index.cjs",
|
|
53
53
|
"import": "./dist/esm/markdown/index.mjs"
|
|
54
54
|
},
|
|
55
|
+
"./format": {
|
|
56
|
+
"types": "./dist/types/format/index.d.ts",
|
|
57
|
+
"solid": "./dist/esm/format/index.mjs",
|
|
58
|
+
"require": "./dist/cjs/format/index.cjs",
|
|
59
|
+
"import": "./dist/esm/format/index.mjs"
|
|
60
|
+
},
|
|
55
61
|
"./package.json": "./package.json"
|
|
56
62
|
},
|
|
57
63
|
"main": "dist/cjs/index.cjs",
|
|
@@ -68,6 +74,9 @@
|
|
|
68
74
|
"markdown": [
|
|
69
75
|
"./dist/types/markdown/index.d.ts"
|
|
70
76
|
],
|
|
77
|
+
"format": [
|
|
78
|
+
"./dist/types/format/index.d.ts"
|
|
79
|
+
],
|
|
71
80
|
"package.json": [
|
|
72
81
|
"./package.json"
|
|
73
82
|
]
|
|
@@ -95,11 +104,11 @@
|
|
|
95
104
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
96
105
|
},
|
|
97
106
|
"dependencies": {
|
|
98
|
-
"@intlayer/api": "8.5.
|
|
99
|
-
"@intlayer/config": "8.5.
|
|
100
|
-
"@intlayer/core": "8.5.
|
|
101
|
-
"@intlayer/editor": "8.5.
|
|
102
|
-
"@intlayer/types": "8.5.
|
|
107
|
+
"@intlayer/api": "8.5.1",
|
|
108
|
+
"@intlayer/config": "8.5.1",
|
|
109
|
+
"@intlayer/core": "8.5.1",
|
|
110
|
+
"@intlayer/editor": "8.5.1",
|
|
111
|
+
"@intlayer/types": "8.5.1"
|
|
103
112
|
},
|
|
104
113
|
"devDependencies": {
|
|
105
114
|
"@solidjs/testing-library": "0.8.10",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);let e=require(`solid-js/web`),t=require(`solid-js`);var n=(0,e.template)(`<span role=button tabindex=0>`),r=250,i=i=>{let a,[o,s]=(0,t.createSignal)(!1),[c,l]=(0,t.createSignal)(i.isSelecting),u=null,d=typeof i.children==`string`,f=()=>{l(!0),i.onPress()},p=()=>{u=setTimeout(()=>{f()},i.pressDuration??r)},m=()=>{u&&=(clearTimeout(u),null)},h=()=>{m(),p()},g=()=>{s(!0),i.onHover?.()},_=()=>{s(!1),m()},v=e=>{a&&!a.contains(e.target)&&(l(!1),i.onClickOutside?.())};(0,t.createEffect)(()=>{document.addEventListener(`mousedown`,v),(0,t.onCleanup)(()=>{document.removeEventListener(`mousedown`,v),m()})});let y=e=>{c()&&(e.preventDefault(),e.stopPropagation())},b=()=>{l(!1)};return(()=>{var t=n(),r=a;return typeof r==`function`?(0,e.use)(r,t):a=t,t.addEventListener(`mouseenter`,g),t.addEventListener(`blur`,b),t.addEventListener(`touchcancel`,_),t.$$touchend=_,t.$$touchstart=h,t.addEventListener(`mouseleave`,_),t.$$mouseup=_,t.$$mousedown=h,t.$$click=y,t.$$keyup=()=>null,(0,e.spread)(t,(0,e.mergeProps)({get style(){return{display:d?`inline`:`inline-block`,cursor:`pointer`,"user-select":`none`,"border-radius":`0.375rem`,"outline-width":`2px`,"outline-offset":`4px`,"outline-style":`solid`,"outline-color":i.isSelecting||c()||o()?`inherit`:`transparent`,transition:`all 100ms 50ms ease-in-out`}}},i),!1,!0),(0,e.insert)(t,()=>i.children),t})()};(0,e.delegateEvents)([`keyup`,`click`,`mousedown`,`mouseup`,`touchstart`,`touchend`]),exports.ContentSelector=i;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../../client-D7A544-v.js`);exports.useIntl=e.l;
|
package/dist/client-D7A544-v.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./chunk-C91j1N6u.js`),t=require(`./cjs/getDictionary.cjs`),n=require(`./cjs/getIntlayer.cjs`),r=require(`./cjs/client/useLocaleStorage.cjs`),i=require(`./cjs/client/useLoadDynamic.cjs`);let a=require(`@intlayer/core/interpreter`),o=require(`solid-js/web`),s=require(`@intlayer/config/built`);s=e.t(s);let c=require(`@intlayer/editor/isEnabled`),l=require(`solid-js`),u=require(`@intlayer/core/formatters`),d=require(`@intlayer/core/localization`);var f=()=>{if(process.env.INTLAYER_EDITOR_ENABLED===`false`||!c.isEnabled)return;let{locale:e}=h(),[t,n]=(0,l.createSignal)(null);(0,l.onMount)(()=>{import(`@intlayer/editor`).then(({initEditorClient:e})=>{n(e())})}),(0,l.createEffect)(()=>{let n=t(),r=e();n&&r&&n.currentLocale.set(r)}),(0,l.onCleanup)(()=>{import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})})},p=({children:e})=>(f(),e),m=(0,l.createContext)({locale:()=>r.localeInStorage??s.default?.internationalization?.defaultLocale,setLocale:()=>null}),h=()=>(0,l.useContext)(m),g=e=>{let{internationalization:t}=s.default??{},{defaultLocale:n,locales:i}=t??{},[a,c]=(0,l.createSignal)(e.locale??r.localeInStorage??e.defaultLocale??n),u=e.setLocale??(t=>{if(a().toString()!==t.toString()){if(!i?.map(String).includes(t)){console.error(`Locale ${t} is not available`);return}c(t),r.setLocaleInStorage(t,e.isCookieEnabled)}}),f=(0,l.createMemo)(()=>(0,d.localeResolver)(a()));return(0,l.createEffect)((0,l.on)(()=>e.locale,e=>{e&&e!==(0,l.untrack)(a)&&c(e)},{defer:!0})),(0,o.createComponent)(m.Provider,{value:{locale:f,setLocale:u},get children(){return e.children}})},_=e=>(0,o.createComponent)(g,(0,o.mergeProps)(e,{get children(){return[(0,o.createComponent)(p,{}),(0,o.memo)(()=>e.children)]}})),v=e=>{let t=(0,l.useContext)(m);return(0,l.createMemo)(()=>(0,u.bindIntl)(e??t.locale()))},y=(e,t)=>{let{locale:n}=(0,l.useContext)(m);return(0,a.getTranslation)(e,t??(typeof n==`function`?n():n))},b=(e,n)=>{let r=(0,l.useContext)(m);return(0,l.createMemo)(()=>t.getDictionary(e,n??r?.locale?.()))},x=async(e,t)=>{let{locale:n}=(0,l.useContext)(m),r=s.default?.internationalization.defaultLocale,i=t??n()??r;return b(await e[i]?.(),i)},S=(e,t,n)=>{let{locale:r}=(0,l.useContext)(m)??{},a=s.default?.internationalization.defaultLocale,o=n??r?.()??a;return b(i.useLoadDynamic(`${String(t)}.${o}`,e[o]?.()),o)},C=(e,t)=>{let r=(0,l.useContext)(m);return(0,l.createMemo)(()=>{let i=r?.locale();return n.getIntlayer(e,t??i)})},w=({isCookieEnabled:e,onLocaleChange:t}={})=>{let{defaultLocale:n,locales:i}=s.default?.internationalization??{},a=(0,l.useContext)(m);return(0,l.createEffect)((0,l.on)(()=>a?.locale?.(),e=>{t&&e!==void 0&&t(e)},{defer:!0})),{locale:a?.locale,defaultLocale:n,availableLocales:i,setLocale:t=>{if(!i?.map(String).includes(t)){console.error(`Locale ${t} is not available`);return}a?.setLocale(t),r.setLocaleInStorage(t,e??a?.isCookieEnabled??!0)}}},{defaultLocale:T,locales:E}=s.default.internationalization,D=()=>{let{locale:e,setLocale:t}=(0,l.useContext)(m);return{locale:e,defaultLocale:T,availableLocales:E,setLocale:t}},O=()=>{let{locale:e}=w(),t=s.default?.routing?.rewrite;(0,l.createEffect)(()=>{if(typeof window>`u`||!t)return;let n=e(),r=window.location.pathname,i=(0,d.getRewritePath)(r,n,t);i&&i!==r&&window.history.replaceState(window.history.state,``,i+window.location.search+window.location.hash)})};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return m}});
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { delegateEvents as e, insert as t, mergeProps as n, spread as r, template as i, use as a } from "solid-js/web";
|
|
2
|
-
import { createEffect as o, createSignal as s, onCleanup as c } from "solid-js";
|
|
3
|
-
//#region src/UI/ContentSelector.tsx
|
|
4
|
-
var l = /* @__PURE__ */ i("<span role=button tabindex=0>"), u = 250, d = (e) => {
|
|
5
|
-
let i, [d, f] = s(!1), [p, m] = s(e.isSelecting), h = null, g = typeof e.children == "string", _ = () => {
|
|
6
|
-
m(!0), e.onPress();
|
|
7
|
-
}, v = () => {
|
|
8
|
-
h = setTimeout(() => {
|
|
9
|
-
_();
|
|
10
|
-
}, e.pressDuration ?? u);
|
|
11
|
-
}, y = () => {
|
|
12
|
-
h &&= (clearTimeout(h), null);
|
|
13
|
-
}, b = () => {
|
|
14
|
-
y(), v();
|
|
15
|
-
}, x = () => {
|
|
16
|
-
f(!0), e.onHover?.();
|
|
17
|
-
}, S = () => {
|
|
18
|
-
f(!1), y();
|
|
19
|
-
}, C = (t) => {
|
|
20
|
-
i && !i.contains(t.target) && (m(!1), e.onClickOutside?.());
|
|
21
|
-
};
|
|
22
|
-
o(() => {
|
|
23
|
-
document.addEventListener("mousedown", C), c(() => {
|
|
24
|
-
document.removeEventListener("mousedown", C), y();
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
let w = (e) => {
|
|
28
|
-
p() && (e.preventDefault(), e.stopPropagation());
|
|
29
|
-
}, T = () => {
|
|
30
|
-
m(!1);
|
|
31
|
-
};
|
|
32
|
-
return (() => {
|
|
33
|
-
var o = l(), s = i;
|
|
34
|
-
return typeof s == "function" ? a(s, o) : i = o, o.addEventListener("mouseenter", x), o.addEventListener("blur", T), o.addEventListener("touchcancel", S), o.$$touchend = S, o.$$touchstart = b, o.addEventListener("mouseleave", S), o.$$mouseup = S, o.$$mousedown = b, o.$$click = w, o.$$keyup = () => null, r(o, n({ get style() {
|
|
35
|
-
return {
|
|
36
|
-
display: g ? "inline" : "inline-block",
|
|
37
|
-
cursor: "pointer",
|
|
38
|
-
"user-select": "none",
|
|
39
|
-
"border-radius": "0.375rem",
|
|
40
|
-
"outline-width": "2px",
|
|
41
|
-
"outline-offset": "4px",
|
|
42
|
-
"outline-style": "solid",
|
|
43
|
-
"outline-color": e.isSelecting || p() || d() ? "inherit" : "transparent",
|
|
44
|
-
transition: "all 100ms 50ms ease-in-out"
|
|
45
|
-
};
|
|
46
|
-
} }, e), !1, !0), t(o, () => e.children), o;
|
|
47
|
-
})();
|
|
48
|
-
};
|
|
49
|
-
e([
|
|
50
|
-
"keyup",
|
|
51
|
-
"click",
|
|
52
|
-
"mousedown",
|
|
53
|
-
"mouseup",
|
|
54
|
-
"touchstart",
|
|
55
|
-
"touchend"
|
|
56
|
-
]);
|
|
57
|
-
//#endregion
|
|
58
|
-
export { d as ContentSelector };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Component, JSX } from 'solid-js';
|
|
2
|
-
type ContentSelectorProps = {
|
|
3
|
-
onPress: () => void;
|
|
4
|
-
onHover?: () => void;
|
|
5
|
-
onClickOutside?: () => void;
|
|
6
|
-
pressDuration?: number;
|
|
7
|
-
isSelecting?: boolean;
|
|
8
|
-
children?: JSX.Element;
|
|
9
|
-
} & JSX.HTMLAttributes<HTMLDivElement>;
|
|
10
|
-
export declare const ContentSelector: Component<ContentSelectorProps>;
|
|
11
|
-
export {};
|