use-intl 4.11.2 → 4.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -192,12 +192,12 @@ function getArgs(messageOrParams, ...rest) {
|
|
|
192
192
|
message = messageOrParams.message;
|
|
193
193
|
values = messageOrParams.values;
|
|
194
194
|
formats = messageOrParams.formats;
|
|
195
|
-
// `description` is
|
|
195
|
+
// `description` is not used at runtime
|
|
196
196
|
}
|
|
197
197
|
// @ts-expect-error -- Secret fallback parameter
|
|
198
198
|
return [undefined,
|
|
199
199
|
// Always use fallback if not compiled
|
|
200
|
-
values, formats, message
|
|
200
|
+
values, formats, message];
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
// Note: This API is usually compiled into `useTranslations`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext as e,useContext as r,useMemo as t,useState as o,useEffect as
|
|
1
|
+
import{createContext as e,useContext as r,useMemo as t,useState as o,useEffect as a}from"react";import{b as n,c as s,I as c,a as i}from"./formatters-CJcico0N.js";import{i as m,r as l,a as f,c as u}from"./initializeConfig-CHgjheii.js";import{jsx as d}from"react/jsx-runtime";const g=e(void 0);function w({children:e,formats:o,getMessageFallback:a,locale:c,messages:i,now:l,onError:f,timeZone:u}){const w=r(g),p=t((()=>w?.cache||n()),[c,w?.cache]),E=t((()=>w?.formatters||s(p)),[p,w?.formatters]),h=t((()=>({...m({locale:c,formats:void 0===o?w?.formats:o,getMessageFallback:a||w?.getMessageFallback,messages:void 0===i?w?.messages:i,now:l||w?.now,onError:f||w?.onError,timeZone:u||w?.timeZone}),formatters:E,cache:p})),[p,o,E,a,c,i,l,f,w,u]);return d(g.Provider,{value:h,children:e})}function p(){const e=r(g);if(!e)throw new Error(void 0);return e}let E=!1;const h="undefined"==typeof window;function v(e){return function(e,r,o){const{cache:a,formats:n,formatters:s,getMessageFallback:m,locale:u,onError:d,timeZone:g}=p(),w=e[o],v=l(r,o);return g||E||!h||(E=!0,d(new c(i.ENVIRONMENT_FALLBACK,void 0))),t((()=>f({cache:a,formatters:s,getMessageFallback:m,messages:w,namespace:v,onError:d,formats:n,locale:u,timeZone:g})),[a,s,m,w,v,d,n,u,g])}({"!":p().messages},e?`!.${e}`:"!","!")}function Z(){return p().locale}function k(){return new Date}function b(e){const r=e?.updateInterval,{now:t}=p(),[n,s]=o(t||k());return a((()=>{if(!r)return;const e=setInterval((()=>{s(k())}),r);return()=>{clearInterval(e)}}),[t,r]),null==r&&t?t:n}function x(){return p().timeZone}function F(){const e=p();if(!e.messages)throw new Error(void 0);return e.messages}function I(){const{formats:e,formatters:r,locale:o,now:a,onError:n,timeZone:s}=p();return t((()=>u({formats:e,locale:o,now:a,onError:n,timeZone:s,_formatters:r})),[e,r,a,o,n,s])}function M(e){throw v(e),new Error("[next-intl] `useExtracted` was called in production without compilation. Include modules that call `useExtracted` in `srcPath` and use `transpilePackages` for 3rd-party packages.")}export{w as IntlProvider,M as _useExtracted,I as useFormatter,Z as useLocale,F as useMessages,b as useNow,x as useTimeZone,v as useTranslations};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "use-intl",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"author": "Jan Amann <jan@amann.work>",
|
|
6
6
|
"funding": [
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@formatjs/fast-memoize": "^3.1.0",
|
|
79
79
|
"@schummar/icu-type-parser": "1.21.5",
|
|
80
|
-
"icu-minify": "^4.
|
|
80
|
+
"icu-minify": "^4.13.0",
|
|
81
81
|
"intl-messageformat": "^11.1.0"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"react": "^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "3e013c402ee54f247bffd1e55ca1c8d06ca8eaa7"
|
|
87
87
|
}
|