next-intl 3.22.0-canary.0 → 3.22.0-canary.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.
Files changed (61) hide show
  1. package/dist/development/middleware/middleware.js +13 -12
  2. package/dist/development/middleware/resolveLocale.js +19 -28
  3. package/dist/development/middleware/syncCookie.js +7 -7
  4. package/dist/development/navigation/react-client/createLocalizedPathnamesNavigation.js +3 -1
  5. package/dist/development/navigation/react-client/createNavigation.js +1 -1
  6. package/dist/development/navigation/react-client/createSharedPathnamesNavigation.js +3 -1
  7. package/dist/development/navigation/react-client/useBaseRouter.js +3 -3
  8. package/dist/development/navigation/react-server/createLocalizedPathnamesNavigation.js +1 -0
  9. package/dist/development/navigation/react-server/createSharedPathnamesNavigation.js +2 -0
  10. package/dist/development/navigation/shared/BaseLink.js +2 -1
  11. package/dist/development/navigation/shared/LegacyBaseLink.js +3 -1
  12. package/dist/development/navigation/shared/createSharedNavigationFns.js +2 -1
  13. package/dist/development/navigation/shared/syncLocaleCookie.js +26 -5
  14. package/dist/development/routing/config.js +18 -1
  15. package/dist/development/shared/constants.js +0 -9
  16. package/dist/esm/middleware/middleware.js +1 -1
  17. package/dist/esm/middleware/resolveLocale.js +1 -1
  18. package/dist/esm/middleware/syncCookie.js +1 -1
  19. package/dist/esm/navigation/react-client/createLocalizedPathnamesNavigation.js +1 -1
  20. package/dist/esm/navigation/react-client/createNavigation.js +1 -1
  21. package/dist/esm/navigation/react-client/createSharedPathnamesNavigation.js +1 -1
  22. package/dist/esm/navigation/react-client/useBaseRouter.js +1 -1
  23. package/dist/esm/navigation/react-server/createLocalizedPathnamesNavigation.js +1 -1
  24. package/dist/esm/navigation/react-server/createSharedPathnamesNavigation.js +1 -1
  25. package/dist/esm/navigation/shared/BaseLink.js +1 -1
  26. package/dist/esm/navigation/shared/LegacyBaseLink.js +1 -1
  27. package/dist/esm/navigation/shared/createSharedNavigationFns.js +1 -1
  28. package/dist/esm/navigation/shared/syncLocaleCookie.js +1 -1
  29. package/dist/esm/routing/config.js +1 -1
  30. package/dist/esm/shared/constants.js +1 -1
  31. package/dist/production/middleware/middleware.js +1 -1
  32. package/dist/production/middleware/resolveLocale.js +1 -1
  33. package/dist/production/middleware/syncCookie.js +1 -1
  34. package/dist/production/navigation/react-client/createLocalizedPathnamesNavigation.js +1 -1
  35. package/dist/production/navigation/react-client/createNavigation.js +1 -1
  36. package/dist/production/navigation/react-client/createSharedPathnamesNavigation.js +1 -1
  37. package/dist/production/navigation/react-client/useBaseRouter.js +1 -1
  38. package/dist/production/navigation/react-server/createLocalizedPathnamesNavigation.js +1 -1
  39. package/dist/production/navigation/react-server/createSharedPathnamesNavigation.js +1 -1
  40. package/dist/production/navigation/shared/BaseLink.js +1 -1
  41. package/dist/production/navigation/shared/LegacyBaseLink.js +1 -1
  42. package/dist/production/navigation/shared/createSharedNavigationFns.js +1 -1
  43. package/dist/production/navigation/shared/syncLocaleCookie.js +1 -1
  44. package/dist/production/routing/config.js +1 -1
  45. package/dist/production/shared/constants.js +1 -1
  46. package/dist/types/src/middleware/middleware.d.ts +10 -2
  47. package/dist/types/src/middleware/resolveLocale.d.ts +1 -2
  48. package/dist/types/src/middleware/syncCookie.d.ts +2 -2
  49. package/dist/types/src/navigation/react-client/createLocalizedPathnamesNavigation.d.ts +2 -1
  50. package/dist/types/src/navigation/react-client/createSharedPathnamesNavigation.d.ts +2 -1
  51. package/dist/types/src/navigation/react-client/useBaseRouter.d.ts +2 -1
  52. package/dist/types/src/navigation/react-server/createLocalizedPathnamesNavigation.d.ts +2 -1
  53. package/dist/types/src/navigation/react-server/createSharedPathnamesNavigation.d.ts +1 -1
  54. package/dist/types/src/navigation/shared/BaseLink.d.ts +2 -0
  55. package/dist/types/src/navigation/shared/LegacyBaseLink.d.ts +2 -0
  56. package/dist/types/src/navigation/shared/createSharedNavigationFns.d.ts +4 -1
  57. package/dist/types/src/navigation/shared/syncLocaleCookie.d.ts +2 -1
  58. package/dist/types/src/routing/config.d.ts +29 -2
  59. package/dist/types/src/shared/constants.d.ts +0 -3
  60. package/package.json +36 -14
  61. package/dist/types/src/middleware/config.d.ts +0 -21
@@ -1 +1 @@
1
- function e(e){return{...e,localePrefix:o(null==e?void 0:e.localePrefix)}}function o(e){return"object"==typeof e?e:{mode:e||"always"}}export{o as receiveLocalePrefixConfig,e as receiveRoutingConfig};
1
+ function e(e){var n,t;return{...e,localePrefix:o(null==e?void 0:e.localePrefix),localeCookie:l(e.localeCookie),localeDetection:null===(n=e.localeDetection)||void 0===n||n,alternateLinks:null===(t=e.alternateLinks)||void 0===t||t}}function l(e){return!(null!=e&&!e)&&{name:"NEXT_LOCALE",maxAge:31536e3,sameSite:"lax",..."object"==typeof e&&e}}function o(e){return"object"==typeof e?e:{mode:e||"always"}}export{l as receiveLocaleCookie,o as receiveLocalePrefixConfig,e as receiveRoutingConfig};
@@ -1 +1 @@
1
- const L="NEXT_LOCALE",E=31536e3,e="lax",l="X-NEXT-INTL-LOCALE",o="locale";export{L as COOKIE_LOCALE_NAME,E as COOKIE_MAX_AGE,e as COOKIE_SAME_SITE,l as HEADER_LOCALE_NAME,o as LOCALE_SEGMENT_NAME};
1
+ const o="X-NEXT-INTL-LOCALE",L="locale";export{o as HEADER_LOCALE_NAME,L as LOCALE_SEGMENT_NAME};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/server"),a=require("../routing/config.js"),t=require("../shared/constants.js"),l=require("../shared/utils.js"),o=require("./getAlternateLinksHeaderValue.js"),n=require("./resolveLocale.js"),r=require("./syncCookie.js"),i=require("./utils.js");exports.default=function(s,c){var d,u,f,h,m,x;const P=a.receiveRoutingConfig(s),v={alternateLinks:null===(d=null!==(u=null==c?void 0:c.alternateLinks)&&void 0!==u?u:s.alternateLinks)||void 0===d||d,localeDetection:null===(f=null!==(h=null==c?void 0:c.localeDetection)&&void 0!==h?h:null==s?void 0:s.localeDetection)||void 0===f||f,localeCookie:null===(m=null!==(x=null==c?void 0:c.localeCookie)&&void 0!==x?x:null==s?void 0:s.localeCookie)||void 0===m||m};return function(a){var s;let c;try{c=decodeURI(a.nextUrl.pathname)}catch(a){return e.NextResponse.next()}const d=i.sanitizePathname(c),{domain:u,locale:f}=n.default(P,v,a.headers,a.cookies,d),h=u?u.defaultLocale===f:f===P.defaultLocale,m=(null===(s=P.domains)||void 0===s?void 0:s.filter((e=>i.isLocaleSupportedOnDomain(f,e))))||[],x=null!=P.domains&&!u;function p(l){const o=new URL(l,a.url);a.nextUrl.basePath&&(o.pathname=i.applyBasePath(o.pathname,a.nextUrl.basePath));const n=new Headers(a.headers);return n.set(t.HEADER_LOCALE_NAME,f),e.NextResponse.rewrite(o,{request:{headers:n}})}function g(t,o){const n=new URL(l.normalizeTrailingSlash(t),a.url);if(m.length>0&&!o&&u){const e=i.getBestMatchingDomain(u,f,m);e&&(o=e.domain,e.defaultLocale===f&&"as-needed"===P.localePrefix.mode&&(n.pathname=i.getNormalizedPathname(n.pathname,P.locales,P.localePrefix)))}var r,s;o&&(n.host=o,a.headers.get("x-forwarded-host")&&(n.protocol=null!==(r=a.headers.get("x-forwarded-proto"))&&void 0!==r?r:a.nextUrl.protocol,n.port=null!==(s=a.headers.get("x-forwarded-port"))&&void 0!==s?s:""));return a.nextUrl.basePath&&(n.pathname=i.applyBasePath(n.pathname,a.nextUrl.basePath)),e.NextResponse.redirect(n.toString())}const L=i.getNormalizedPathname(d,P.locales,P.localePrefix),U=i.getPathnameMatch(d,P.locales,P.localePrefix),k=null!=U,q="never"===P.localePrefix.mode||h&&"as-needed"===P.localePrefix.mode;let j,C,D=L;const R=P.pathnames;if(R){let e;if([e,C]=i.getInternalTemplate(R,L,f),C){const t=R[C],o="string"==typeof t?t:t[f];if(l.matchesPathname(o,L))D=i.formatTemplatePathname(L,o,C);else{let n;n=e?"string"==typeof t?t:t[e]:C;const r=q?void 0:l.getLocalePrefix(f,P.localePrefix),s=i.formatTemplatePathname(L,n,o);j=g(i.formatPathname(s,r,a.nextUrl.search))}}}if(!j)if("/"!==D||k){const e=i.formatPathname(D,i.getLocaleAsPrefix(f),a.nextUrl.search);if(k){const t=i.formatPathname(L,U.prefix,a.nextUrl.search);if("never"===P.localePrefix.mode)j=g(i.formatPathname(L,void 0,a.nextUrl.search));else if(U.exact)if(h&&q)j=g(i.formatPathname(L,void 0,a.nextUrl.search));else if(P.domains){const a=i.getBestMatchingDomain(u,U.locale,m);j=(null==u?void 0:u.domain)===(null==a?void 0:a.domain)||x?p(e):g(t,null==a?void 0:a.domain)}else j=p(e);else j=g(t)}else j=q?p(e):g(i.formatPathname(L,l.getLocalePrefix(f,P.localePrefix),a.nextUrl.search))}else j=q?p(i.formatPathname(D,i.getLocaleAsPrefix(f),a.nextUrl.search)):g(i.formatPathname(L,l.getLocalePrefix(f,P.localePrefix),a.nextUrl.search));return v.localeDetection&&v.localeCookie&&r.default(a,j,f,v.localeCookie),"never"!==P.localePrefix.mode&&v.alternateLinks&&P.locales.length>1&&j.headers.set("Link",o.default({routing:P,localizedPathnames:null!=C&&R?null==R?void 0:R[C]:void 0,request:a,resolvedLocale:f})),j}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/server"),a=require("../routing/config.js"),t=require("../shared/constants.js"),l=require("../shared/utils.js"),o=require("./getAlternateLinksHeaderValue.js"),n=require("./resolveLocale.js"),r=require("./syncCookie.js"),i=require("./utils.js");exports.default=function(s,c){var d,f,h;const m=a.receiveRoutingConfig({...s,alternateLinks:null!==(d=null==c?void 0:c.alternateLinks)&&void 0!==d?d:s.alternateLinks,localeDetection:null!==(f=null==c?void 0:c.localeDetection)&&void 0!==f?f:s.localeDetection,localeCookie:null!==(h=null==c?void 0:c.localeCookie)&&void 0!==h?h:s.localeCookie});return function(a){var s;let c;try{c=decodeURI(a.nextUrl.pathname)}catch(a){return e.NextResponse.next()}const d=i.sanitizePathname(c),{domain:f,locale:h}=n.default(m,a.headers,a.cookies,d),u=f?f.defaultLocale===h:h===m.defaultLocale,x=(null===(s=m.domains)||void 0===s?void 0:s.filter((e=>i.isLocaleSupportedOnDomain(h,e))))||[],P=null!=m.domains&&!f;function p(l){const o=new URL(l,a.url);a.nextUrl.basePath&&(o.pathname=i.applyBasePath(o.pathname,a.nextUrl.basePath));const n=new Headers(a.headers);return n.set(t.HEADER_LOCALE_NAME,h),e.NextResponse.rewrite(o,{request:{headers:n}})}function v(t,o){const n=new URL(l.normalizeTrailingSlash(t),a.url);if(x.length>0&&!o&&f){const e=i.getBestMatchingDomain(f,h,x);e&&(o=e.domain,e.defaultLocale===h&&"as-needed"===m.localePrefix.mode&&(n.pathname=i.getNormalizedPathname(n.pathname,m.locales,m.localePrefix)))}var r,s;o&&(n.host=o,a.headers.get("x-forwarded-host")&&(n.protocol=null!==(r=a.headers.get("x-forwarded-proto"))&&void 0!==r?r:a.nextUrl.protocol,n.port=null!==(s=a.headers.get("x-forwarded-port"))&&void 0!==s?s:""));return a.nextUrl.basePath&&(n.pathname=i.applyBasePath(n.pathname,a.nextUrl.basePath)),e.NextResponse.redirect(n.toString())}const g=i.getNormalizedPathname(d,m.locales,m.localePrefix),L=i.getPathnameMatch(d,m.locales,m.localePrefix),U=null!=L,k="never"===m.localePrefix.mode||u&&"as-needed"===m.localePrefix.mode;let q,j,C=g;const D=m.pathnames;if(D){let e;if([e,j]=i.getInternalTemplate(D,g,h),j){const t=D[j],o="string"==typeof t?t:t[h];if(l.matchesPathname(o,g))C=i.formatTemplatePathname(g,o,j);else{let n;n=e?"string"==typeof t?t:t[e]:j;const r=k?void 0:l.getLocalePrefix(h,m.localePrefix),s=i.formatTemplatePathname(g,n,o);q=v(i.formatPathname(s,r,a.nextUrl.search))}}}if(!q)if("/"!==C||U){const e=i.formatPathname(C,i.getLocaleAsPrefix(h),a.nextUrl.search);if(U){const t=i.formatPathname(g,L.prefix,a.nextUrl.search);if("never"===m.localePrefix.mode)q=v(i.formatPathname(g,void 0,a.nextUrl.search));else if(L.exact)if(u&&k)q=v(i.formatPathname(g,void 0,a.nextUrl.search));else if(m.domains){const a=i.getBestMatchingDomain(f,L.locale,x);q=(null==f?void 0:f.domain)===(null==a?void 0:a.domain)||P?p(e):v(t,null==a?void 0:a.domain)}else q=p(e);else q=v(t)}else q=k?p(e):v(i.formatPathname(g,l.getLocalePrefix(h,m.localePrefix),a.nextUrl.search))}else q=k?p(i.formatPathname(C,i.getLocaleAsPrefix(h),a.nextUrl.search)):v(i.formatPathname(g,l.getLocalePrefix(h,m.localePrefix),a.nextUrl.search));return m.localeDetection&&m.localeCookie&&r.default(a,q,h,m.localeCookie),"never"!==m.localePrefix.mode&&m.alternateLinks&&m.locales.length>1&&q.headers.set("Link",o.default({routing:m,localizedPathnames:null!=j&&D?null==D?void 0:D[j]:void 0,request:a,resolvedLocale:h})),q}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@formatjs/intl-localematcher"),t=require("negotiator"),o=require("../shared/constants.js"),a=require("./utils.js");function l(e){return e&&e.__esModule?e:{default:e}}var n=l(t);function c(t,o,a){let l;const c=new n.default({headers:{"accept-language":t.get("accept-language")||void 0}}).languages();try{const t=function(e){return e.slice().sort(((e,t)=>t.length-e.length))}(o);l=e.match(c,t,a)}catch(e){}return l}function i(e,t){if(e.has(o.COOKIE_LOCALE_NAME)){var a;const l=null===(a=e.get(o.COOKIE_LOCALE_NAME))||void 0===a?void 0:a.value;if(l&&t.includes(l))return l}}function r(e,t,o,l,n){let r,{defaultLocale:u,localePrefix:s,locales:f}=e,{localeDetection:d}=t;var g;n&&(r=null===(g=a.getPathnameMatch(n,f,s))||void 0===g?void 0:g.locale);return!r&&d&&l&&(r=i(l,f)),!r&&d&&o&&(r=c(o,f,u)),r||(r=u),r}function u(e,t,o,l,n){const u=function(e,t){const o=a.getHost(e);if(o&&t)return t.find((e=>e.domain===o))}(o,e.domains);if(!u)return{locale:r(e,t,o,l,n)};let s;if(n){var f;const t=null===(f=a.getPathnameMatch(n,e.locales,e.localePrefix))||void 0===f?void 0:f.locale;if(t){if(!a.isLocaleSupportedOnDomain(t,u))return{locale:t,domain:u};s=t}}if(!s&&t.localeDetection&&l){const t=i(l,e.locales);t&&a.isLocaleSupportedOnDomain(t,u)&&(s=t)}if(!s&&t.localeDetection&&o){const t=c(o,u.locales||e.locales,u.defaultLocale);t&&(s=t)}return s||(s=u.defaultLocale),{locale:s,domain:u}}exports.default=function(e,t,o,a,l){return e.domains?u(e,t,o,a,l):{locale:r(e,t,o,a,l)}},exports.getAcceptLanguageLocale=c;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@formatjs/intl-localematcher"),o=require("negotiator"),l=require("./utils.js");function t(e){return e&&e.__esModule?e:{default:e}}var a=t(o);function n(o,l,t){let n;const c=new a.default({headers:{"accept-language":o.get("accept-language")||void 0}}).languages();try{const o=function(e){return e.slice().sort(((e,o)=>o.length-e.length))}(l);n=e.match(c,o,t)}catch(e){}return n}function c(e,o){if(e.localeCookie&&o.has(e.localeCookie.name)){var l;const t=null===(l=o.get(e.localeCookie.name))||void 0===l?void 0:l.value;if(t&&e.locales.includes(t))return t}}function i(e,o,t,a){let i;var r;a&&(i=null===(r=l.getPathnameMatch(a,e.locales,e.localePrefix))||void 0===r?void 0:r.locale);return!i&&e.localeDetection&&t&&(i=c(e,t)),!i&&e.localeDetection&&o&&(i=n(o,e.locales,e.defaultLocale)),i||(i=e.defaultLocale),i}function r(e,o,t,a){const r=function(e,o){const t=l.getHost(e);if(t&&o)return o.find((e=>e.domain===t))}(o,e.domains);if(!r)return{locale:i(e,o,t,a)};let u;if(a){var s;const o=null===(s=l.getPathnameMatch(a,e.locales,e.localePrefix))||void 0===s?void 0:s.locale;if(o){if(!l.isLocaleSupportedOnDomain(o,r))return{locale:o,domain:r};u=o}}if(!u&&e.localeDetection&&t){const o=c(e,t);o&&l.isLocaleSupportedOnDomain(o,r)&&(u=o)}if(!u&&e.localeDetection&&o){const l=n(o,r.locales||e.locales,r.defaultLocale);l&&(u=l)}return u||(u=r.defaultLocale),{locale:u,domain:r}}exports.default=function(e,o,l,t){return e.domains?r(e,o,l,t):{locale:i(e,o,l,t)}},exports.getAcceptLanguageLocale=n;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../shared/constants.js");exports.default=function(t,o,s,a){var r;(null===(r=t.cookies.get(e.COOKIE_LOCALE_NAME))||void 0===r?void 0:r.value)!==s&&o.cookies.set(e.COOKIE_LOCALE_NAME,s,{path:t.nextUrl.basePath||void 0,sameSite:e.COOKIE_SAME_SITE,maxAge:e.COOKIE_MAX_AGE,..."object"==typeof a&&a})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(e,t,o,s){var a;const{name:i,...l}=s;(null===(a=e.cookies.get(i))||void 0===a?void 0:a.value)!==o&&t.cookies.set(i,o,{path:e.nextUrl.basePath||void 0,...l})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../react-client/useLocale.js"),a=require("../../routing/config.js"),l=require("../shared/utils.js"),n=require("./ClientLink.js"),o=require("./redirects.js"),c=require("./useBasePathname.js"),i=require("./useBaseRouter.js");function u(e){return e&&e.__esModule?e:{default:e}}var s=u(r);exports.default=function(u){const f=a.receiveRoutingConfig(u);function h(){const e=t.default();if(!f.locales.includes(e))throw new Error(void 0);return e}function d(r,t){let{href:a,locale:o,...c}=r;const i=h(),u=o||i;return s.default.createElement(n.default,e.extends({ref:t,href:l.compileLocalizedPathname({locale:u,pathname:a,params:"object"==typeof a?a.params:void 0,pathnames:f.pathnames}),locale:o,localePrefix:f.localePrefix},c))}const m=r.forwardRef(d);function p(e){let{href:r,locale:t}=e;return l.compileLocalizedPathname({...l.normalizeNameOrNameWithParams(r),locale:t,pathnames:f.pathnames})}return m.displayName="Link",{Link:m,redirect:function(e){const r=p({href:e,locale:h()});for(var t=arguments.length,a=new Array(t>1?t-1:0),l=1;l<t;l++)a[l-1]=arguments[l];return o.clientRedirect({pathname:r,localePrefix:f.localePrefix},...a)},permanentRedirect:function(e){const r=p({href:e,locale:h()});for(var t=arguments.length,a=new Array(t>1?t-1:0),l=1;l<t;l++)a[l-1]=arguments[l];return o.clientPermanentRedirect({pathname:r,localePrefix:f.localePrefix},...a)},usePathname:function(){const e=c.default(f.localePrefix),t=h();return r.useMemo((()=>e?l.getRoute(t,e,f.pathnames):e),[t,e])},useRouter:function(){const e=i.default(f.localePrefix),t=h();return r.useMemo((()=>({...e,push(r){for(var a,l=arguments.length,n=new Array(l>1?l-1:0),o=1;o<l;o++)n[o-1]=arguments[o];const c=p({href:r,locale:(null===(a=n[0])||void 0===a?void 0:a.locale)||t});return e.push(c,...n)},replace(r){for(var a,l=arguments.length,n=new Array(l>1?l-1:0),o=1;o<l;o++)n[o-1]=arguments[o];const c=p({href:r,locale:(null===(a=n[0])||void 0===a?void 0:a.locale)||t});return e.replace(c,...n)},prefetch(r){for(var a,l=arguments.length,n=new Array(l>1?l-1:0),o=1;o<l;o++)n[o-1]=arguments[o];const c=p({href:r,locale:(null===(a=n[0])||void 0===a?void 0:a.locale)||t});return e.prefetch(c,...n)}})),[e,t])},getPathname:p}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),a=require("../../react-client/useLocale.js"),l=require("../../routing/config.js"),t=require("../shared/utils.js"),o=require("./ClientLink.js"),n=require("./redirects.js"),c=require("./useBasePathname.js"),i=require("./useBaseRouter.js");function u(e){return e&&e.__esModule?e:{default:e}}var s=u(r);exports.default=function(u){const f=l.receiveRoutingConfig(u),h=l.receiveLocaleCookie(null==u?void 0:u.localeCookie);function d(){const e=a.default();if(!f.locales.includes(e))throw new Error(void 0);return e}function m(r,a){let{href:l,locale:n,...c}=r;const i=d(),u=n||i;return s.default.createElement(o.default,e.extends({ref:a,href:t.compileLocalizedPathname({locale:u,pathname:l,params:"object"==typeof l?l.params:void 0,pathnames:f.pathnames}),locale:n,localeCookie:h,localePrefix:f.localePrefix},c))}const p=r.forwardRef(m);function v(e){let{href:r,locale:a}=e;return t.compileLocalizedPathname({...t.normalizeNameOrNameWithParams(r),locale:a,pathnames:f.pathnames})}return p.displayName="Link",{Link:p,redirect:function(e){const r=v({href:e,locale:d()});for(var a=arguments.length,l=new Array(a>1?a-1:0),t=1;t<a;t++)l[t-1]=arguments[t];return n.clientRedirect({pathname:r,localePrefix:f.localePrefix},...l)},permanentRedirect:function(e){const r=v({href:e,locale:d()});for(var a=arguments.length,l=new Array(a>1?a-1:0),t=1;t<a;t++)l[t-1]=arguments[t];return n.clientPermanentRedirect({pathname:r,localePrefix:f.localePrefix},...l)},usePathname:function(){const e=c.default(f.localePrefix),a=d();return r.useMemo((()=>e?t.getRoute(a,e,f.pathnames):e),[a,e])},useRouter:function(){const e=i.default(f.localePrefix,h),a=d();return r.useMemo((()=>({...e,push(r){for(var l,t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];const c=v({href:r,locale:(null===(l=o[0])||void 0===l?void 0:l.locale)||a});return e.push(c,...o)},replace(r){for(var l,t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];const c=v({href:r,locale:(null===(l=o[0])||void 0===l?void 0:l.locale)||a});return e.replace(c,...o)},prefetch(r){for(var l,t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];const c=v({href:r,locale:(null===(l=o[0])||void 0===l?void 0:l.locale)||a});return e.prefetch(c,...o)}})),[e,a])},getPathname:v}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),t=require("react"),r=require("../../react-client/useLocale.js"),n=require("../shared/createSharedNavigationFns.js"),a=require("../shared/syncLocaleCookie.js"),u=require("../shared/utils.js"),s=require("./useBasePathname.js");exports.default=function(o){function c(){return r.default()}const{Link:i,config:l,getPathname:h,...f}=n.default(c,o);return{...f,Link:i,usePathname:function(){const e=s.default(l.localePrefix),r=c();return t.useMemo((()=>e&&l.pathnames?u.getRoute(r,e,l.pathnames):e),[r,e])},useRouter:function(){const r=e.useRouter(),n=c(),u=e.usePathname();return t.useMemo((()=>{function e(e){return function(t,r){const{locale:s,...o}=r||{},c=[h({href:t,locale:s||n,domain:window.location.host})];Object.keys(o).length>0&&c.push(o),e(...c),a.default(u,n,s)}}return{...r,push:e(r.push),replace:e(r.replace),prefetch:e(r.prefetch)}}),[n,u,r])},getPathname:h}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),t=require("react"),r=require("../../react-client/useLocale.js"),n=require("../shared/createSharedNavigationFns.js"),a=require("../shared/syncLocaleCookie.js"),u=require("../shared/utils.js"),o=require("./useBasePathname.js");exports.default=function(s){function c(){return r.default()}const{Link:i,config:l,getPathname:h,...f}=n.default(c,s);return{...f,Link:i,usePathname:function(){const e=o.default(l.localePrefix),r=c();return t.useMemo((()=>e&&l.pathnames?u.getRoute(r,e,l.pathnames):e),[r,e])},useRouter:function(){const r=e.useRouter(),n=c(),u=e.usePathname();return t.useMemo((()=>{function e(e){return function(t,r){const{locale:o,...s}=r||{},c=[h({href:t,locale:o||n,domain:window.location.host})];Object.keys(s).length>0&&c.push(s),e(...c),a.default(l.localeCookie,u,n,o)}}return{...r,push:e(r.push),replace:e(r.replace),prefetch:e(r.prefetch)}}),[n,u,r])},getPathname:h}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),n=require("./ClientLink.js"),u=require("./redirects.js"),i=require("./useBasePathname.js"),a=require("./useBaseRouter.js");function l(e){return e&&e.__esModule?e:{default:e}}var o=l(r);exports.default=function(l){const c=t.receiveLocalePrefixConfig(null==l?void 0:l.localePrefix);function f(r,t){return o.default.createElement(n.default,e.extends({ref:t,localePrefix:c},r))}const s=r.forwardRef(f);return s.displayName="Link",{Link:s,redirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return u.clientRedirect({pathname:e,localePrefix:c},...t)},permanentRedirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return u.clientPermanentRedirect({pathname:e,localePrefix:c},...t)},usePathname:function(){return i.default(c)},useRouter:function(){return a.default(c)}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),n=require("./ClientLink.js"),i=require("./redirects.js"),u=require("./useBasePathname.js"),a=require("./useBaseRouter.js");function l(e){return e&&e.__esModule?e:{default:e}}var o=l(r);exports.default=function(l){const c=t.receiveLocalePrefixConfig(null==l?void 0:l.localePrefix),f=t.receiveLocaleCookie(null==l?void 0:l.localeCookie);function s(r,t){return o.default.createElement(n.default,e.extends({ref:t,localeCookie:f,localePrefix:c},r))}const d=r.forwardRef(s);return d.displayName="Link",{Link:d,redirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return i.clientRedirect({pathname:e,localePrefix:c},...t)},permanentRedirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return i.clientPermanentRedirect({pathname:e,localePrefix:c},...t)},usePathname:function(){return u.default(c)},useRouter:function(){return a.default(c,f)}}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),t=require("react"),r=require("../../react-client/useLocale.js"),u=require("../../shared/utils.js"),n=require("../shared/syncLocaleCookie.js"),s=require("../shared/utils.js");exports.default=function(a){const c=e.useRouter(),o=r.default(),i=e.usePathname();return t.useMemo((()=>{function e(e,t){let r=window.location.pathname;const n=s.getBasePath(i);n&&(r=r.replace(n,""));const c=t||o,l=u.getLocalePrefix(c,a);return u.localizeHref(e,c,o,r,l)}function t(t){return function(r,u){const{locale:s,...a}=u||{};n.default(i,o,s);const c=[e(r,s)];return Object.keys(a).length>0&&c.push(a),t(...c)}}return{...c,push:t(c.push),replace:t(c.replace),prefetch:t(c.prefetch)}}),[o,a,i,c])};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),t=require("react"),r=require("../../react-client/useLocale.js"),u=require("../../shared/utils.js"),n=require("../shared/syncLocaleCookie.js"),s=require("../shared/utils.js");exports.default=function(a,c){const o=e.useRouter(),i=r.default(),l=e.usePathname();return t.useMemo((()=>{function e(e,t){let r=window.location.pathname;const n=s.getBasePath(l);n&&(r=r.replace(n,""));const c=t||i,o=u.getLocalePrefix(c,a);return u.localizeHref(e,c,i,r,o)}function t(t){return function(r,u){const{locale:s,...a}=u||{};n.default(c,l,i,s);const o=[e(r,s)];return Object.keys(a).length>0&&o.push(a),t(...o)}}return{...o,push:t(o.push),replace:t(o.replace),prefetch:t(o.prefetch)}}),[i,c,a,l,o])};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),a=require("../../server/react-server/RequestLocaleLegacy.js"),n=require("../shared/utils.js"),o=require("./ServerLink.js"),l=require("./redirects.js");function c(e){return e&&e.__esModule?e:{default:e}}var i=c(r);exports.default=function(r){const c=t.receiveRoutingConfig(r);function u(e){let{href:r,locale:t}=e;return n.compileLocalizedPathname({...n.normalizeNameOrNameWithParams(r),locale:t,pathnames:c.pathnames})}function s(e){return()=>{throw new Error("`".concat(e,"` is not supported in Server Components. You can use this hook if you convert the component to a Client Component."))}}return{Link:function(r){let{href:t,locale:l,...u}=r;const s=a.getRequestLocale(),f=l||s;return i.default.createElement(o.default,e.extends({href:n.compileLocalizedPathname({locale:f,pathname:t,params:"object"==typeof t?t.params:void 0,pathnames:c.pathnames}),locale:l,localePrefix:c.localePrefix},u))},redirect:function(e){const r=u({href:e,locale:a.getRequestLocale()});for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return l.serverRedirect({localePrefix:c.localePrefix,pathname:r},...n)},permanentRedirect:function(e){const r=u({href:e,locale:a.getRequestLocale()});for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return l.serverPermanentRedirect({localePrefix:c.localePrefix,pathname:r},...n)},getPathname:u,usePathname:s("usePathname"),useRouter:s("useRouter")}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),a=require("../../server/react-server/RequestLocaleLegacy.js"),o=require("../shared/utils.js"),n=require("./ServerLink.js"),l=require("./redirects.js");function c(e){return e&&e.__esModule?e:{default:e}}var i=c(r);exports.default=function(r){const c=t.receiveRoutingConfig(r);function u(e){let{href:r,locale:t}=e;return o.compileLocalizedPathname({...o.normalizeNameOrNameWithParams(r),locale:t,pathnames:c.pathnames})}function s(e){return()=>{throw new Error("`".concat(e,"` is not supported in Server Components. You can use this hook if you convert the component to a Client Component."))}}return{Link:function(r){let{href:t,locale:l,...u}=r;const s=a.getRequestLocale(),f=l||s;return i.default.createElement(n.default,e.extends({href:o.compileLocalizedPathname({locale:f,pathname:t,params:"object"==typeof t?t.params:void 0,pathnames:c.pathnames}),locale:l,localeCookie:c.localeCookie,localePrefix:c.localePrefix},u))},redirect:function(e){const r=u({href:e,locale:a.getRequestLocale()});for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];return l.serverRedirect({localePrefix:c.localePrefix,pathname:r},...o)},permanentRedirect:function(e){const r=u({href:e,locale:a.getRequestLocale()});for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];return l.serverPermanentRedirect({localePrefix:c.localePrefix,pathname:r},...o)},getPathname:u,usePathname:s("usePathname"),useRouter:s("useRouter")}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),n=require("./ServerLink.js"),o=require("./redirects.js");function u(e){return e&&e.__esModule?e:{default:e}}var i=u(r);exports.default=function(r){const u=t.receiveLocalePrefixConfig(null==r?void 0:r.localePrefix);function a(e){return()=>{throw new Error("`".concat(e,"` is not supported in Server Components. You can use this hook if you convert the component to a Client Component."))}}return{Link:function(r){return i.default.createElement(n.default,e.extends({localePrefix:u},r))},redirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return o.serverRedirect({pathname:e,localePrefix:u},...t)},permanentRedirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return o.serverPermanentRedirect({pathname:e,localePrefix:u},...t)},usePathname:a("usePathname"),useRouter:a("useRouter")}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),n=require("./ServerLink.js"),o=require("./redirects.js");function i(e){return e&&e.__esModule?e:{default:e}}var u=i(r);exports.default=function(r){const i=t.receiveLocalePrefixConfig(null==r?void 0:r.localePrefix),a=t.receiveLocaleCookie(null==r?void 0:r.localeCookie);function l(e){return()=>{throw new Error("`".concat(e,"` is not supported in Server Components. You can use this hook if you convert the component to a Client Component."))}}return{Link:function(r){return u.default.createElement(n.default,e.extends({localeCookie:a,localePrefix:i},r))},redirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return o.serverRedirect({pathname:e,localePrefix:i},...t)},permanentRedirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return o.serverPermanentRedirect({pathname:e,localePrefix:i},...t)},usePathname:l("usePathname"),useRouter:l("useRouter")}};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),t=require("next/link"),r=require("next/navigation"),n=require("react"),u=require("../../react-client/useLocale.js"),a=require("./syncLocaleCookie.js");function l(e){return e&&e.__esModule?e:{default:e}}var o=l(t),i=l(n);function c(t,l){let{defaultLocale:c,href:f,locale:s,onClick:d,prefetch:p,unprefixed:h,...v}=t;const q=u.default(),x=s!==q,_=s||q,j=function(){const[e,t]=n.useState();return n.useEffect((()=>{t(window.location.host)}),[]),e}(),k=j&&h&&(h.domains[j]===_||!Object.keys(h.domains).includes(j)&&q===c&&!s)?h.pathname:f,m=r.usePathname();return x&&(p=!1),i.default.createElement(o.default,e.extends({ref:l,href:k,hrefLang:x?s:void 0,onClick:function(e){a.default(m,q,s),d&&d(e)},prefetch:p},v))}var f=n.forwardRef(c);exports.default=f;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),t=require("next/link"),r=require("next/navigation"),n=require("react"),a=require("../../react-client/useLocale.js"),u=require("./syncLocaleCookie.js");function o(e){return e&&e.__esModule?e:{default:e}}var l=o(t),i=o(n);function c(t,o){let{defaultLocale:c,href:f,locale:s,localeCookie:d,onClick:p,prefetch:h,unprefixed:v,...k}=t;const q=a.default(),x=s!==q,_=s||q,j=function(){const[e,t]=n.useState();return n.useEffect((()=>{t(window.location.host)}),[]),e}(),m=j&&v&&(v.domains[j]===_||!Object.keys(v.domains).includes(j)&&q===c&&!s)?v.pathname:f,C=r.usePathname();return x&&(h=!1),i.default.createElement(l.default,e.extends({ref:o,href:m,hrefLang:x?s:void 0,onClick:function(e){u.default(d,C,q,s),p&&p(e)},prefetch:h},k))}var f=n.forwardRef(c);exports.default=f;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("next/navigation"),t=require("react"),l=require("../../react-client/useLocale.js"),a=require("../../shared/utils.js"),u=require("./BaseLink.js");function i(e){return e&&e.__esModule?e:{default:e}}var s=i(t);function f(i,f){let{href:n,locale:o,localePrefixMode:c,prefix:d,...p}=i;const x=r.usePathname(),q=l.default(),v=o!==q,[_,j]=t.useState((()=>a.isLocalizableHref(n)&&("never"!==c||v)?a.prefixHref(n,d):n));return t.useEffect((()=>{x&&j(a.localizeHref(n,o,q,x,d))}),[q,n,o,x,d]),s.default.createElement(u.default,e.extends({ref:f,href:_,locale:o},p))}const n=t.forwardRef(f);n.displayName="ClientLink",exports.default=n;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("next/navigation"),l=require("react"),t=require("../../react-client/useLocale.js"),a=require("../../shared/utils.js"),i=require("./BaseLink.js");function u(e){return e&&e.__esModule?e:{default:e}}var o=u(l);function s(u,s){let{href:f,locale:n,localeCookie:c,localePrefixMode:d,prefix:p,...x}=u;const q=r.usePathname(),v=t.default(),_=n!==v,[j,h]=l.useState((()=>a.isLocalizableHref(f)&&("never"!==d||_)?a.prefixHref(f,p):f));return l.useEffect((()=>{q&&h(a.localizeHref(f,n,v,q,p))}),[v,f,n,q,p]),o.default.createElement(i.default,e.extends({ref:s,href:j,locale:n,localeCookie:c},x))}const f=l.forwardRef(s);f.displayName="ClientLink",exports.default=f;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),a=require("next/navigation"),r=require("react"),t=require("../../routing/config.js"),n=require("../../shared/utils.js"),o=require("./BaseLink.js"),i=require("./utils.js");function l(e){return e&&e.__esModule?e:{default:e}}var u=l(r);exports.default=function(l,c){const s=t.receiveRoutingConfig(c||{}),f=s.pathnames,d="as-needed"===s.localePrefix.mode&&s.domains||void 0;function m(a,t){let i,c,{href:m,locale:p,...v}=a;"object"==typeof m?(i=m.pathname,c=m.params):i=m;const P=n.isLocalizableHref(m),g=l(),j=g instanceof Promise?r.use(g):g,q=P?h({locale:p||j,href:null==f?i:{pathname:i,params:c}},null!=p||d||void 0):i;return u.default.createElement(o.default,e.extends({ref:t,defaultLocale:s.defaultLocale,href:{..."object"==typeof m&&m,pathname:q},locale:p,unprefixed:d&&P?{domains:s.domains.reduce(((e,a)=>(e[a.domain]=a.defaultLocale,e)),{}),pathname:h({locale:j,href:null==f?i:{pathname:i,params:c}},!1)}:void 0},v))}const p=r.forwardRef(m);function h(e,a){const{href:r,locale:t}=e;let n;return null==f?"object"==typeof r?(n=r.pathname,r.query&&(n+=i.serializeSearchParams(r.query))):n=r:n=i.compileLocalizedPathname({locale:t,...i.normalizeNameOrNameWithParams(r),pathnames:s.pathnames}),i.applyPathnamePrefix(n,t,s,e.domain,a)}function v(e){return function(a){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return e(h(a,a.domain?void 0:d),...t)}}const P=v(a.redirect),g=v(a.permanentRedirect);return{config:s,Link:p,redirect:P,permanentRedirect:g,getPathname:h}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),a=require("next/navigation"),r=require("react"),t=require("../../routing/config.js"),n=require("../../shared/utils.js"),o=require("./BaseLink.js"),i=require("./utils.js");function l(e){return e&&e.__esModule?e:{default:e}}var u=l(r);exports.default=function(l,c){const s=t.receiveRoutingConfig(c||{}),f=s.pathnames,d="as-needed"===s.localePrefix.mode&&s.domains||void 0;function m(a,t){let i,c,{href:m,locale:p,...v}=a;"object"==typeof m?(i=m.pathname,c=m.params):i=m;const P=n.isLocalizableHref(m),g=l(),j=g instanceof Promise?r.use(g):g,q=P?h({locale:p||j,href:null==f?i:{pathname:i,params:c}},null!=p||d||void 0):i;return u.default.createElement(o.default,e.extends({ref:t,defaultLocale:s.defaultLocale,href:{..."object"==typeof m&&m,pathname:q},locale:p,localeCookie:s.localeCookie,unprefixed:d&&P?{domains:s.domains.reduce(((e,a)=>(e[a.domain]=a.defaultLocale,e)),{}),pathname:h({locale:j,href:null==f?i:{pathname:i,params:c}},!1)}:void 0},v))}const p=r.forwardRef(m);function h(e,a){const{href:r,locale:t}=e;let n;return null==f?"object"==typeof r?(n=r.pathname,r.query&&(n+=i.serializeSearchParams(r.query))):n=r:n=i.compileLocalizedPathname({locale:t,...i.normalizeNameOrNameWithParams(r),pathnames:s.pathnames}),i.applyPathnamePrefix(n,t,s,e.domain,a)}function v(e){return function(a){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return e(h(a,a.domain?void 0:d),...t)}}const P=v(a.redirect),g=v(a.permanentRedirect);return{config:s,Link:p,redirect:P,permanentRedirect:g,getPathname:h}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../shared/constants.js"),t=require("./utils.js");exports.default=function(c,a,o){if(!(o!==a&&null!=o)||!c)return;const n=t.getBasePath(c),s=""!==n?n:"/";document.cookie="".concat(e.COOKIE_LOCALE_NAME,"=").concat(o,"; path=").concat(s,"; max-age=").concat(e.COOKIE_MAX_AGE,"; sameSite=").concat(e.COOKIE_SAME_SITE)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./utils.js");exports.default=function(t,o,a,c){if(!t||!(c!==a&&null!=c)||!o)return;const n=e.getBasePath(o),r=""!==n?n:"/",{name:s,...u}=t;u.path||(u.path=r);let i="".concat(s,"=").concat(c,";");for(const[e,t]of Object.entries(u)){i+="".concat("maxAge"===e?"max-age":e),"boolean"!=typeof t&&(i+="="+t),i+=";"}document.cookie=i};
@@ -1 +1 @@
1
- "use strict";function e(e){return"object"==typeof e?e:{mode:e||"always"}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.receiveLocalePrefixConfig=e,exports.receiveRoutingConfig=function(o){return{...o,localePrefix:e(null==o?void 0:o.localePrefix)}};
1
+ "use strict";function e(e){return!(null!=e&&!e)&&{name:"NEXT_LOCALE",maxAge:31536e3,sameSite:"lax",..."object"==typeof e&&e}}function o(e){return"object"==typeof e?e:{mode:e||"always"}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.receiveLocaleCookie=e,exports.receiveLocalePrefixConfig=o,exports.receiveRoutingConfig=function(l){var t,i;return{...l,localePrefix:o(null==l?void 0:l.localePrefix),localeCookie:e(l.localeCookie),localeDetection:null===(t=l.localeDetection)||void 0===t||t,alternateLinks:null===(i=l.alternateLinks)||void 0===i||i}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.COOKIE_LOCALE_NAME="NEXT_LOCALE",exports.COOKIE_MAX_AGE=31536e3,exports.COOKIE_SAME_SITE="lax",exports.HEADER_LOCALE_NAME="X-NEXT-INTL-LOCALE",exports.LOCALE_SEGMENT_NAME="locale";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.HEADER_LOCALE_NAME="X-NEXT-INTL-LOCALE",exports.LOCALE_SEGMENT_NAME="locale";
@@ -1,5 +1,13 @@
1
1
  import { NextRequest, NextResponse } from 'next/server';
2
2
  import { RoutingConfig } from '../routing/config';
3
3
  import { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../routing/types';
4
- import { MiddlewareOptions } from './config';
5
- export default function createMiddleware<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode = 'always', AppPathnames extends Pathnames<AppLocales> = never, AppDomains extends DomainsConfig<AppLocales> = never>(routing: RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains> & MiddlewareOptions, options?: MiddlewareOptions): (request: NextRequest) => NextResponse<unknown>;
4
+ export default function createMiddleware<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode = 'always', AppPathnames extends Pathnames<AppLocales> = never, AppDomains extends DomainsConfig<AppLocales> = never>(routing: RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>,
5
+ /** @deprecated Should be passed via the first parameter `routing` instead (ideally defined with `defineRouting`) */
6
+ options?: {
7
+ /** @deprecated Should be passed via the first parameter `routing` instead (ideally defined with `defineRouting`) */
8
+ localeCookie?: RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>['localeCookie'];
9
+ /** @deprecated Should be passed via the first parameter `routing` instead (ideally defined with `defineRouting`) */
10
+ localeDetection?: RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>['localeDetection'];
11
+ /** @deprecated Should be passed via the first parameter `routing` instead (ideally defined with `defineRouting`) */
12
+ alternateLinks?: RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>['alternateLinks'];
13
+ }): (request: NextRequest) => NextResponse<unknown>;
@@ -1,9 +1,8 @@
1
1
  import { RequestCookies } from 'next/dist/server/web/spec-extension/cookies';
2
2
  import { ResolvedRoutingConfig } from '../routing/config';
3
3
  import { Locales, Pathnames, DomainsConfig, DomainConfig, LocalePrefixMode } from '../routing/types';
4
- import { ResolvedMiddlewareOptions } from './config';
5
4
  export declare function getAcceptLanguageLocale<AppLocales extends Locales>(requestHeaders: Headers, locales: AppLocales, defaultLocale: string): string | undefined;
6
- export default function resolveLocale<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode, AppPathnames extends Pathnames<AppLocales> | undefined, AppDomains extends DomainsConfig<AppLocales> | undefined>(routing: Omit<ResolvedRoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>, 'pathnames'>, options: ResolvedMiddlewareOptions, requestHeaders: Headers, requestCookies: RequestCookies, pathname: string): {
5
+ export default function resolveLocale<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode, AppPathnames extends Pathnames<AppLocales> | undefined, AppDomains extends DomainsConfig<AppLocales> | undefined>(routing: Omit<ResolvedRoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>, 'pathnames'>, requestHeaders: Headers, requestCookies: RequestCookies, pathname: string): {
7
6
  locale: AppLocales[number];
8
7
  domain?: DomainConfig<AppLocales>;
9
8
  };
@@ -1,3 +1,3 @@
1
1
  import { NextRequest, NextResponse } from 'next/server';
2
- import { MiddlewareOptions } from './config';
3
- export default function syncCookie(request: NextRequest, response: NextResponse, locale: string, localeCookie: MiddlewareOptions['localeCookie']): void;
2
+ import { LocaleCookieConfig } from '../routing/config';
3
+ export default function syncCookie(request: NextRequest, response: NextResponse, locale: string, localeCookie: LocaleCookieConfig): void;
@@ -39,6 +39,7 @@ export default function createLocalizedPathnamesNavigation<AppLocales extends Lo
39
39
  locale: string;
40
40
  prefix: string;
41
41
  localePrefixMode: LocalePrefixMode;
42
+ localeCookie: import("../../routing/config").InitializedLocaleCookieConfig;
42
43
  }, "ref"> & React.RefAttributes<HTMLAnchorElement>, "locale" | "prefix" | "localePrefixMode"> & {
43
44
  locale?: string | undefined;
44
45
  localePrefix: {
@@ -52,7 +53,7 @@ export default function createLocalizedPathnamesNavigation<AppLocales extends Lo
52
53
  };
53
54
  } & {
54
55
  ref?: React.LegacyRef<HTMLAnchorElement> | undefined;
55
- }, "localePrefix" | "href" | "name"> & {
56
+ }, "name" | "localePrefix" | "localeCookie" | "href"> & {
56
57
  href: Pathname extends `${string}[[...${string}` ? Pathname | ({
57
58
  pathname: Pathname;
58
59
  params?: import("../shared/StrictParams").default<Pathname> | undefined;
@@ -37,12 +37,13 @@ export default function createSharedPathnamesNavigation<AppLocales extends Local
37
37
  locale: string;
38
38
  prefix: string;
39
39
  localePrefixMode: LocalePrefixMode;
40
+ localeCookie: import("../../routing/config").InitializedLocaleCookieConfig;
40
41
  }, "ref"> & React.RefAttributes<HTMLAnchorElement>, "locale" | "prefix" | "localePrefixMode"> & {
41
42
  locale?: AppLocales[number] | undefined;
42
43
  localePrefix: import("../../routing/types").LocalePrefixConfigVerbose<AppLocales, AppLocalePrefixMode>;
43
44
  } & {
44
45
  ref?: React.LegacyRef<HTMLAnchorElement> | undefined;
45
- }, "localePrefix"> & {
46
+ }, "localePrefix" | "localeCookie"> & {
46
47
  ref?: React.LegacyRef<HTMLAnchorElement> | undefined;
47
48
  }) => ReactElement;
48
49
  redirect: (pathname: string, type?: import("next/navigation").RedirectType | undefined) => never;
@@ -1,3 +1,4 @@
1
+ import { InitializedLocaleCookieConfig } from '../../routing/config';
1
2
  import { Locales, LocalePrefixConfigVerbose, LocalePrefixMode } from '../../routing/types';
2
3
  type IntlNavigateOptions<AppLocales extends Locales> = {
3
4
  locale?: AppLocales[number];
@@ -21,7 +22,7 @@ type IntlNavigateOptions<AppLocales extends Locales> = {
21
22
  * router.push('/about', {locale: 'de'});
22
23
  * ```
23
24
  */
24
- export default function useBaseRouter<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode>(localePrefix: LocalePrefixConfigVerbose<AppLocales, AppLocalePrefixMode>): {
25
+ export default function useBaseRouter<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode>(localePrefix: LocalePrefixConfigVerbose<AppLocales, AppLocalePrefixMode>, localeCookie: InitializedLocaleCookieConfig): {
25
26
  push: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & IntlNavigateOptions<AppLocales>) | undefined) => void;
26
27
  replace: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & IntlNavigateOptions<AppLocales>) | undefined) => void;
27
28
  prefetch: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").PrefetchOptions & IntlNavigateOptions<AppLocales>) | undefined) => void;
@@ -35,6 +35,7 @@ export default function createLocalizedPathnamesNavigation<AppLocales extends Lo
35
35
  locale: string;
36
36
  prefix: string;
37
37
  localePrefixMode: LocalePrefixMode;
38
+ localeCookie: import("../../routing/config").InitializedLocaleCookieConfig;
38
39
  }, "ref"> & React.RefAttributes<HTMLAnchorElement>, "locale" | "prefix" | "localePrefixMode"> & {
39
40
  locale?: string | undefined;
40
41
  localePrefix: {
@@ -46,7 +47,7 @@ export default function createLocalizedPathnamesNavigation<AppLocales extends Lo
46
47
  mode: "as-needed";
47
48
  prefixes?: Partial<Record<string, string>> | undefined;
48
49
  };
49
- }, "localePrefix" | "href" | "name"> & {
50
+ }, "name" | "localePrefix" | "localeCookie" | "href"> & {
50
51
  href: Pathname extends `${string}[[...${string}` ? Pathname | ({
51
52
  pathname: Pathname;
52
53
  params?: import("../shared/StrictParams").default<Pathname> | undefined;
@@ -3,7 +3,7 @@ import { RoutingConfigSharedNavigation } from '../../routing/config';
3
3
  import { DomainsConfig, LocalePrefixMode, Locales } from '../../routing/types';
4
4
  import ServerLink from './ServerLink';
5
5
  export default function createSharedPathnamesNavigation<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode, AppDomains extends DomainsConfig<AppLocales> = never>(routing?: RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains>): {
6
- Link: (props: Omit<ComponentProps<typeof ServerLink<AppLocales, AppLocalePrefixMode>>, "localePrefix">) => React.JSX.Element;
6
+ Link: (props: Omit<ComponentProps<typeof ServerLink<AppLocales, AppLocalePrefixMode>>, "localePrefix" | "localeCookie">) => React.JSX.Element;
7
7
  redirect: (pathname: string, type?: import("next/navigation").RedirectType | undefined) => never;
8
8
  permanentRedirect: (pathname: string, type?: import("next/navigation").RedirectType | undefined) => never;
9
9
  usePathname: () => never;
@@ -1,8 +1,10 @@
1
1
  import NextLink from 'next/link';
2
2
  import React, { ComponentProps } from 'react';
3
+ import { InitializedLocaleCookieConfig } from '../../routing/config';
3
4
  type Props = Omit<ComponentProps<typeof NextLink>, 'locale'> & {
4
5
  locale?: string;
5
6
  defaultLocale?: string;
7
+ localeCookie: InitializedLocaleCookieConfig;
6
8
  /** Special case for `localePrefix: 'as-needed'` and `domains`. */
7
9
  unprefixed?: {
8
10
  domains: {
@@ -1,10 +1,12 @@
1
1
  import NextLink from 'next/link';
2
2
  import React, { ComponentProps } from 'react';
3
+ import { InitializedLocaleCookieConfig } from '../../routing/config';
3
4
  import { LocalePrefixMode } from '../../routing/types';
4
5
  type Props = Omit<ComponentProps<typeof NextLink>, 'locale'> & {
5
6
  locale: string;
6
7
  prefix: string;
7
8
  localePrefixMode: LocalePrefixMode;
9
+ localeCookie: InitializedLocaleCookieConfig;
8
10
  };
9
11
  declare const LegacyBaseLinkWithRef: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
10
12
  export default LegacyBaseLinkWithRef;
@@ -7,7 +7,7 @@ type PromiseOrValue<Type> = Type | Promise<Type>;
7
7
  * Shared implementations for `react-server` and `react-client`
8
8
  */
9
9
  export default function createSharedNavigationFns<const AppLocales extends Locales, const AppPathnames extends Pathnames<AppLocales> = never, const AppLocalePrefixMode extends LocalePrefixMode = 'always', const AppDomains extends DomainsConfig<AppLocales> = never>(getLocale: () => PromiseOrValue<AppLocales extends never ? string : AppLocales[number]>, routing?: [AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>): {
10
- config: Omit<{}, "localePrefix"> & {
10
+ config: Omit<{}, "localePrefix" | "localeCookie" | "alternateLinks" | "localeDetection"> & {
11
11
  localePrefix: {
12
12
  mode: "never";
13
13
  } | {
@@ -17,6 +17,9 @@ export default function createSharedNavigationFns<const AppLocales extends Local
17
17
  mode: "as-needed";
18
18
  prefixes?: Partial<Record<string, string>> | undefined;
19
19
  };
20
+ localeCookie: import("../../routing/config").InitializedLocaleCookieConfig;
21
+ localeDetection: NonNullable<boolean | undefined>;
22
+ alternateLinks: NonNullable<boolean | undefined>;
20
23
  };
21
24
  Link: React.ForwardRefExoticComponent<Omit<{
22
25
  locale?: string;
@@ -1,6 +1,7 @@
1
+ import { InitializedLocaleCookieConfig } from '../../routing/config';
1
2
  /**
2
3
  * We have to keep the cookie value in sync as Next.js might
3
4
  * skip a request to the server due to its router cache.
4
5
  * See https://github.com/amannn/next-intl/issues/786.
5
6
  */
6
- export default function syncLocaleCookie(pathname: string | null, locale: string, nextLocale?: string): void;
7
+ export default function syncLocaleCookie(localeCookie: InitializedLocaleCookieConfig, pathname: string | null, locale: string, nextLocale?: string): void;
@@ -1,4 +1,6 @@
1
+ import type { NextResponse } from 'next/server';
1
2
  import { Locales, LocalePrefix, LocalePrefixConfigVerbose, DomainsConfig, Pathnames, LocalePrefixMode } from './types';
3
+ type CookieAttributes = Pick<NonNullable<Parameters<typeof NextResponse.prototype.cookies.set>['2']>, 'maxAge' | 'domain' | 'partitioned' | 'path' | 'priority' | 'sameSite' | 'secure' | 'name'>;
2
4
  export type RoutingConfig<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode, AppPathnames extends Pathnames<AppLocales> | undefined, AppDomains extends DomainsConfig<AppLocales> | undefined> = {
3
5
  /**
4
6
  * All available locales.
@@ -20,6 +22,21 @@ export type RoutingConfig<AppLocales extends Locales, AppLocalePrefixMode extend
20
22
  * @see https://next-intl-docs.vercel.app/docs/routing#domains
21
23
  **/
22
24
  domains?: AppDomains;
25
+ /**
26
+ * Can be used to disable the locale cookie or to customize it.
27
+ * @see https://next-intl-docs.vercel.app/docs/routing/middleware#locale-cookie
28
+ */
29
+ localeCookie?: boolean | CookieAttributes;
30
+ /**
31
+ * Sets the `Link` response header to notify search engines about content in other languages (defaults to `true`). See https://developers.google.com/search/docs/specialty/international/localized-versions#http
32
+ * @see https://next-intl-docs.vercel.app/docs/routing/middleware#alternate-links
33
+ **/
34
+ alternateLinks?: boolean;
35
+ /**
36
+ * By setting this to `false`, the cookie as well as the `accept-language` header will no longer be used for locale detection.
37
+ * @see https://next-intl-docs.vercel.app/docs/routing/middleware#locale-detection
38
+ **/
39
+ localeDetection?: boolean;
23
40
  } & ([AppPathnames] extends [never] ? {} : {
24
41
  /**
25
42
  * A map of localized pathnames per locale.
@@ -31,10 +48,13 @@ export type RoutingConfigSharedNavigation<AppLocales extends Locales, AppLocaleP
31
48
  export type RoutingConfigLocalizedNavigation<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode, AppPathnames extends Pathnames<AppLocales>, AppDomains extends DomainsConfig<AppLocales> = never> = Omit<RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>, 'defaultLocale' | 'pathnames'> & Partial<Pick<RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>, 'defaultLocale'>> & {
32
49
  pathnames: AppPathnames;
33
50
  };
34
- export type ResolvedRoutingConfig<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode, AppPathnames extends Pathnames<AppLocales> | undefined, AppDomains extends DomainsConfig<AppLocales> | undefined> = Omit<RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>, 'localePrefix'> & {
51
+ export type ResolvedRoutingConfig<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode, AppPathnames extends Pathnames<AppLocales> | undefined, AppDomains extends DomainsConfig<AppLocales> | undefined> = Omit<RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>, 'localePrefix' | 'localeCookie' | 'alternateLinks' | 'localeDetection'> & {
35
52
  localePrefix: LocalePrefixConfigVerbose<AppLocales, AppLocalePrefixMode>;
53
+ localeCookie: InitializedLocaleCookieConfig;
54
+ alternateLinks: boolean;
55
+ localeDetection: boolean;
36
56
  };
37
- export declare function receiveRoutingConfig<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode, AppPathnames extends Pathnames<AppLocales> | undefined, AppDomains extends DomainsConfig<AppLocales> | undefined, Config extends Partial<RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>>>(input: Config): Omit<Config, "localePrefix"> & {
57
+ export declare function receiveRoutingConfig<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode, AppPathnames extends Pathnames<AppLocales> | undefined, AppDomains extends DomainsConfig<AppLocales> | undefined, Config extends Partial<RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>>>(input: Config): Omit<Config, "localePrefix" | "localeCookie" | "alternateLinks" | "localeDetection"> & {
38
58
  localePrefix: {
39
59
  mode: "never";
40
60
  } | {
@@ -44,5 +64,12 @@ export declare function receiveRoutingConfig<AppLocales extends Locales, AppLoca
44
64
  mode: "as-needed";
45
65
  prefixes?: Partial<Record<AppLocales[number], string>> | undefined;
46
66
  };
67
+ localeCookie: InitializedLocaleCookieConfig;
68
+ localeDetection: boolean | NonNullable<RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>["localeDetection"]>;
69
+ alternateLinks: boolean | NonNullable<RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>["alternateLinks"]>;
47
70
  };
71
+ export declare function receiveLocaleCookie(localeCookie?: boolean | CookieAttributes): InitializedLocaleCookieConfig;
72
+ export type InitializedLocaleCookieConfig = false | LocaleCookieConfig;
73
+ export type LocaleCookieConfig = Omit<CookieAttributes, 'name' | 'maxAge' | 'sameSite'> & Required<Pick<CookieAttributes, 'name' | 'maxAge' | 'sameSite'>>;
48
74
  export declare function receiveLocalePrefixConfig<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode>(localePrefix?: LocalePrefix<AppLocales, AppLocalePrefixMode>): LocalePrefixConfigVerbose<AppLocales, AppLocalePrefixMode>;
75
+ export {};
@@ -1,6 +1,3 @@
1
- export declare const COOKIE_LOCALE_NAME = "NEXT_LOCALE";
2
- export declare const COOKIE_MAX_AGE = 31536000;
3
- export declare const COOKIE_SAME_SITE = "lax";
4
1
  export declare const COOKIE_BASE_PATH_NAME = "NEXT_INTL_BASE_PATH";
5
2
  export declare const HEADER_LOCALE_NAME = "X-NEXT-INTL-LOCALE";
6
3
  export declare const LOCALE_SEGMENT_NAME = "locale";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-intl",
3
- "version": "3.22.0-canary.0",
3
+ "version": "3.22.0-canary.1",
4
4
  "sideEffects": false,
5
5
  "author": "Jan Amann <jan@amann.work>",
6
6
  "funding": [
@@ -16,16 +16,6 @@
16
16
  "type": "git",
17
17
  "url": "https://github.com/amannn/next-intl"
18
18
  },
19
- "scripts": {
20
- "build": "rm -rf dist && rollup -c",
21
- "test": "TZ=Europe/Berlin vitest",
22
- "lint": "pnpm run lint:source && pnpm run lint:package",
23
- "lint:source": "eslint src test && tsc --noEmit",
24
- "lint:package": "publint && attw --pack",
25
- "prepublishOnly": "turbo build && cp ../../README.md .",
26
- "postpublish": "git checkout . && rm ./README.md",
27
- "size": "size-limit"
28
- },
29
19
  "main": "./dist/index.react-client.js",
30
20
  "module": "./dist/esm/index.react-client.js",
31
21
  "typings": "./dist/types/src/index.react-client.d.ts",
@@ -87,11 +77,43 @@
87
77
  "dependencies": {
88
78
  "@formatjs/intl-localematcher": "^0.5.4",
89
79
  "negotiator": "^0.6.3",
90
- "use-intl": "^3.22.0-canary.0"
80
+ "use-intl": "3.21.2-canary.0"
91
81
  },
92
82
  "peerDependencies": {
93
83
  "next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
94
84
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
95
85
  },
96
- "gitHead": "be122b24844db127d9495f4f04b3e3551eefd4b3"
97
- }
86
+ "devDependencies": {
87
+ "@arethetypeswrong/cli": "^0.15.3",
88
+ "@edge-runtime/vm": "^3.2.0",
89
+ "@size-limit/preset-big-lib": "^11.1.4",
90
+ "@testing-library/react": "^16.0.0",
91
+ "@types/negotiator": "^0.6.3",
92
+ "@types/node": "^20.14.5",
93
+ "@types/react": "^18.3.3",
94
+ "@types/react-dom": "^18.3.0",
95
+ "eslint": "^8.56.0",
96
+ "eslint-config-molindo": "^7.0.0",
97
+ "eslint-plugin-deprecation": "^3.0.0",
98
+ "eslint-plugin-react-compiler": "0.0.0-experimental-8e3b87c-20240822",
99
+ "next": "^14.2.4",
100
+ "path-to-regexp": "^6.2.2",
101
+ "publint": "^0.2.8",
102
+ "react": "^18.3.1",
103
+ "react-dom": "^18.3.1",
104
+ "rollup": "^4.18.0",
105
+ "rollup-plugin-preserve-directives": "0.4.0",
106
+ "size-limit": "^11.1.4",
107
+ "typescript": "^5.5.3",
108
+ "vitest": "^2.0.2"
109
+ },
110
+ "prettier": "../../.prettierrc.json",
111
+ "scripts": {
112
+ "build": "rm -rf dist && rollup -c",
113
+ "test": "TZ=Europe/Berlin vitest",
114
+ "lint": "pnpm run lint:source && pnpm run lint:package",
115
+ "lint:source": "eslint src test && tsc --noEmit",
116
+ "lint:package": "publint && attw --pack",
117
+ "size": "size-limit"
118
+ }
119
+ }
@@ -1,21 +0,0 @@
1
- import { NextResponse } from 'next/server';
2
- type ResponseCookieOptions = Pick<NonNullable<Parameters<typeof NextResponse.prototype.cookies.set>['2']>, 'maxAge' | 'domain' | 'expires' | 'partitioned' | 'path' | 'priority' | 'sameSite' | 'secure'>;
3
- export type MiddlewareOptions = {
4
- /**
5
- * Sets the `Link` response header to notify search engines about content in other languages (defaults to `true`). See https://developers.google.com/search/docs/specialty/international/localized-versions#http
6
- * @see https://next-intl-docs.vercel.app/docs/routing/middleware#alternate-links
7
- **/
8
- alternateLinks?: boolean;
9
- /**
10
- * Can be used to disable the locale cookie or to customize it.
11
- * @see https://next-intl-docs.vercel.app/docs/routing/middleware#locale-cookie
12
- */
13
- localeCookie?: boolean | ResponseCookieOptions;
14
- /**
15
- * By setting this to `false`, the cookie as well as the `accept-language` header will no longer be used for locale detection.
16
- * @see https://next-intl-docs.vercel.app/docs/routing/middleware#locale-detection
17
- **/
18
- localeDetection?: boolean;
19
- };
20
- export type ResolvedMiddlewareOptions = Required<MiddlewareOptions>;
21
- export {};