gt-next 11.2.0 → 11.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/config.d.ts.map +1 -1
  3. package/dist/config.js +2 -7
  4. package/dist/config.js.map +1 -1
  5. package/dist/config.mjs +4 -9
  6. package/dist/config.mjs.map +1 -1
  7. package/dist/errors/createErrors.d.ts +0 -1
  8. package/dist/errors/createErrors.d.ts.map +1 -1
  9. package/dist/errors/createErrors.js +0 -2
  10. package/dist/errors/createErrors.js.map +1 -1
  11. package/dist/errors/createErrors.mjs +1 -2
  12. package/dist/errors/createErrors.mjs.map +1 -1
  13. package/dist/middleware-dir/createNextMiddleware.d.ts +4 -1
  14. package/dist/middleware-dir/createNextMiddleware.d.ts.map +1 -1
  15. package/dist/middleware-dir/createNextMiddleware.js +38 -13
  16. package/dist/middleware-dir/createNextMiddleware.js.map +1 -1
  17. package/dist/middleware-dir/createNextMiddleware.mjs +39 -14
  18. package/dist/middleware-dir/createNextMiddleware.mjs.map +1 -1
  19. package/dist/middleware-dir/utils.d.ts +1 -1
  20. package/dist/middleware-dir/utils.d.ts.map +1 -1
  21. package/dist/middleware-dir/utils.js +5 -11
  22. package/dist/middleware-dir/utils.js.map +1 -1
  23. package/dist/middleware-dir/utils.mjs +5 -11
  24. package/dist/middleware-dir/utils.mjs.map +1 -1
  25. package/dist/middleware.d.ts +1 -1
  26. package/dist/middleware.d.ts.map +1 -1
  27. package/dist/plugin/constants.d.ts +1 -0
  28. package/dist/plugin/constants.d.ts.map +1 -1
  29. package/dist/plugin/constants.js +2 -0
  30. package/dist/plugin/constants.js.map +1 -1
  31. package/dist/plugin/constants.mjs +2 -1
  32. package/dist/plugin/constants.mjs.map +1 -1
  33. package/dist/plugin/getStableNextVersionInfo.d.ts +1 -0
  34. package/dist/plugin/getStableNextVersionInfo.d.ts.map +1 -1
  35. package/dist/plugin/getStableNextVersionInfo.js +2 -0
  36. package/dist/plugin/getStableNextVersionInfo.js.map +1 -1
  37. package/dist/plugin/getStableNextVersionInfo.mjs +3 -2
  38. package/dist/plugin/getStableNextVersionInfo.mjs.map +1 -1
  39. package/dist/provider/GTProvider.d.ts.map +1 -1
  40. package/dist/provider/GTProvider.js +10 -5
  41. package/dist/provider/GTProvider.js.map +1 -1
  42. package/dist/provider/GTProvider.mjs +10 -5
  43. package/dist/provider/GTProvider.mjs.map +1 -1
  44. package/dist/request/localeValidation.js +2 -2
  45. package/dist/request/localeValidation.js.map +1 -1
  46. package/dist/request/localeValidation.mjs +2 -2
  47. package/dist/request/localeValidation.mjs.map +1 -1
  48. package/dist/utils/client-boundary.d.ts +4 -1
  49. package/dist/utils/client-boundary.d.ts.map +1 -1
  50. package/dist/utils/client-boundary.js +14 -10
  51. package/dist/utils/client-boundary.js.map +1 -1
  52. package/dist/utils/client-boundary.mjs +14 -10
  53. package/dist/utils/client-boundary.mjs.map +1 -1
  54. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"GTProvider.mjs","names":[],"sources":["../../src/provider/GTProvider.tsx"],"sourcesContent":["import { getLocale } from '../request/getLocale';\nimport { getRegion } from '../request/getRegion';\nimport type { GTProviderProps } from '../utils/types';\nimport { Client_GTProvider } from '../utils/client-boundary';\nimport { getNextI18nCache } from '../i18n-cache/NextI18nCache';\nimport { getI18nConfig } from 'gt-i18n/internal';\nimport { getEnableI18n } from '../request/getEnableI18n';\n\nexport async function GTProvider({ children }: GTProviderProps) {\n // ---------- SETUP ---------- //\n const i18nCache = getNextI18nCache();\n const i18nConfig = getI18nConfig();\n const locale = await getLocale();\n const region = await getRegion();\n const enableI18n = await getEnableI18n();\n const translationRequired = i18nConfig.requiresTranslation(locale);\n\n // ----- FETCH TRANSLATIONS FROM CACHE ----- //\n\n const translationsSnapshotPromise = translationRequired\n ? i18nCache.loadTranslations(locale)\n : Promise.resolve({});\n\n const dictionariesSnapshotPromise = i18nCache.loadDictionaries(locale);\n\n // Block until cache check resolves\n const translationsSnapshot = { [locale]: await translationsSnapshotPromise };\n const dictionariesSnapshot = await dictionariesSnapshotPromise;\n\n return (\n <Client_GTProvider\n enableI18n={enableI18n}\n locale={locale}\n region={region}\n translations={translationsSnapshot}\n dictionaries={dictionariesSnapshot}\n >\n {children}\n </Client_GTProvider>\n );\n}\n"],"mappings":";;;;;;;;AAQA,eAAsB,WAAW,EAAE,YAA6B;CAE9D,MAAM,YAAY,kBAAkB;CACpC,MAAM,aAAa,eAAe;CAClC,MAAM,SAAS,MAAM,WAAW;CAChC,MAAM,SAAS,MAAM,WAAW;CAChC,MAAM,aAAa,MAAM,eAAe;CAKxC,MAAM,8BAJsB,WAAW,oBAAoB,OAIJ,GACnD,UAAU,iBAAiB,OAAO,GAClC,QAAQ,QAAQ,EAAE,CAAC;CAEvB,MAAM,8BAA8B,UAAU,iBAAiB,OAAO;AAMtE,QACE,oBAAC,mBAAD;EACc;EACJ;EACA;EACR,cAAc,GARc,SAAS,MAAM,6BAQT;EAClC,cAAc,MARiB;EAU9B;EACiB,CAAA"}
1
+ {"version":3,"file":"GTProvider.mjs","names":[],"sources":["../../src/provider/GTProvider.tsx"],"sourcesContent":["import { getLocale } from '../request/getLocale';\nimport { getRegion } from '../request/getRegion';\nimport type { GTProviderProps } from '../utils/types';\nimport { Client_GTProvider } from '../utils/client-boundary';\nimport { getNextI18nCache } from '../i18n-cache/NextI18nCache';\nimport { getI18nConfig } from 'gt-i18n/internal';\nimport { getEnableI18n } from '../request/getEnableI18n';\n\nexport async function GTProvider({ children }: GTProviderProps) {\n // ---------- SETUP ---------- //\n const i18nCache = getNextI18nCache();\n const i18nConfig = getI18nConfig();\n const locale = await getLocale();\n const region = await getRegion();\n const enableI18n = await getEnableI18n();\n const translationRequired = i18nConfig.requiresTranslation(locale);\n\n // ----- FETCH TRANSLATIONS FROM CACHE ----- //\n\n const translationsSnapshotPromise = translationRequired\n ? i18nCache.loadTranslations(locale)\n : Promise.resolve({});\n\n const dictionariesSnapshotPromise = i18nCache.loadDictionaries(locale);\n\n // Block until cache check resolves\n const translationsSnapshot = { [locale]: await translationsSnapshotPromise };\n const dictionariesSnapshot = await dictionariesSnapshotPromise;\n\n return (\n <Client_GTProvider\n supportsLocaleRefresh={\n process.env._GENERALTRANSLATION_LOCALE_REFRESH_SUPPORTED === 'true'\n }\n conditions={{ locale, region, enableI18n }}\n translations={translationsSnapshot}\n dictionaries={dictionariesSnapshot}\n >\n {children}\n </Client_GTProvider>\n );\n}\n"],"mappings":";;;;;;;;AAQA,eAAsB,WAAW,EAAE,YAA6B;CAE9D,MAAM,YAAY,kBAAkB;CACpC,MAAM,aAAa,eAAe;CAClC,MAAM,SAAS,MAAM,WAAW;CAChC,MAAM,SAAS,MAAM,WAAW;CAChC,MAAM,aAAa,MAAM,eAAe;CAKxC,MAAM,8BAJsB,WAAW,oBAAoB,OAIJ,GACnD,UAAU,iBAAiB,OAAO,GAClC,QAAQ,QAAQ,EAAE,CAAC;CAEvB,MAAM,8BAA8B,UAAU,iBAAiB,OAAO;CAGtE,MAAM,uBAAuB,GAAG,SAAS,MAAM,6BAA6B;CAC5E,MAAM,uBAAuB,MAAM;AAEnC,QACE,oBAAC,mBAAD;EACE,uBACE,QAAQ,IAAI,iDAAiD;EAE/D,YAAY;GAAE;GAAQ;GAAQ;GAAY;EAC1C,cAAc;EACd,cAAc;EAEb;EACiB,CAAA"}
@@ -15,9 +15,9 @@ function resolveLocaleOrDefault(locale) {
15
15
  const i18nConfig = (0, gt_i18n_internal.getI18nConfig)();
16
16
  const defaultLocale = i18nConfig.getDefaultLocale();
17
17
  const supportedLocale = typeof locale === "string" && locale.length > 0 ? i18nConfig.determineSupportedLocale(locale) : void 0;
18
- if (supportedLocale) return i18nConfig.resolveAliasLocale(supportedLocale);
18
+ if (supportedLocale) return supportedLocale;
19
19
  if (typeof locale === "string" && locale.length > 0) warnInvalidLocale(locale, defaultLocale);
20
- return i18nConfig.resolveAliasLocale(defaultLocale);
20
+ return defaultLocale;
21
21
  }
22
22
  /**
23
23
  * Checks whether a locale is valid and supported by the current gt-next config.
@@ -1 +1 @@
1
- {"version":3,"file":"localeValidation.js","names":["createInvalidRequestLocaleWarning"],"sources":["../../src/request/localeValidation.ts"],"sourcesContent":["import { getI18nConfig } from 'gt-i18n/internal';\nimport { createInvalidRequestLocaleWarning } from '../errors/request';\n\nfunction determineSupportedLocale(locale: unknown): string | undefined {\n if (typeof locale !== 'string' || locale.length === 0) return undefined;\n return getI18nConfig().determineSupportedLocale(locale);\n}\n\nfunction warnInvalidLocale(locale: string, defaultLocale: string) {\n if (\n process.env._GENERALTRANSLATION_DISABLE_INVALID_LOCALE_WARNING === 'true'\n ) {\n return;\n }\n\n console.warn(createInvalidRequestLocaleWarning(locale, defaultLocale));\n}\n\nexport function resolveLocaleOrDefault(locale: unknown): string {\n const i18nConfig = getI18nConfig();\n const defaultLocale = i18nConfig.getDefaultLocale();\n const supportedLocale =\n typeof locale === 'string' && locale.length > 0\n ? i18nConfig.determineSupportedLocale(locale)\n : undefined;\n\n if (supportedLocale) return i18nConfig.resolveAliasLocale(supportedLocale);\n\n if (typeof locale === 'string' && locale.length > 0) {\n warnInvalidLocale(locale, defaultLocale);\n }\n\n return i18nConfig.resolveAliasLocale(defaultLocale);\n}\n\n/**\n * Checks whether a locale is valid and supported by the current gt-next config.\n *\n * Use this when route params or other request inputs should be rejected instead\n * of falling back to the default locale.\n *\n * @param locale - The locale candidate to validate.\n * @returns True when the locale resolves to one of the configured locales.\n */\nexport function isLocaleSupported(locale: unknown): locale is string {\n return determineSupportedLocale(locale) !== undefined;\n}\n"],"mappings":";;;;;AAGA,SAAS,yBAAyB,QAAqC;AACrE,KAAI,OAAO,WAAW,YAAY,OAAO,WAAW,EAAG,QAAO,KAAA;AAC9D,SAAA,GAAA,iBAAA,gBAAsB,CAAC,yBAAyB,OAAO;;AAGzD,SAAS,kBAAkB,QAAgB,eAAuB;AAChE,KACE,QAAQ,IAAI,uDAAuD,OAEnE;AAGF,SAAQ,KAAKA,uBAAAA,kCAAkC,QAAQ,cAAc,CAAC;;AAGxE,SAAgB,uBAAuB,QAAyB;CAC9D,MAAM,cAAA,GAAA,iBAAA,gBAA4B;CAClC,MAAM,gBAAgB,WAAW,kBAAkB;CACnD,MAAM,kBACJ,OAAO,WAAW,YAAY,OAAO,SAAS,IAC1C,WAAW,yBAAyB,OAAO,GAC3C,KAAA;AAEN,KAAI,gBAAiB,QAAO,WAAW,mBAAmB,gBAAgB;AAE1E,KAAI,OAAO,WAAW,YAAY,OAAO,SAAS,EAChD,mBAAkB,QAAQ,cAAc;AAG1C,QAAO,WAAW,mBAAmB,cAAc;;;;;;;;;;;AAYrD,SAAgB,kBAAkB,QAAmC;AACnE,QAAO,yBAAyB,OAAO,KAAK,KAAA"}
1
+ {"version":3,"file":"localeValidation.js","names":["createInvalidRequestLocaleWarning"],"sources":["../../src/request/localeValidation.ts"],"sourcesContent":["import { getI18nConfig } from 'gt-i18n/internal';\nimport { createInvalidRequestLocaleWarning } from '../errors/request';\n\nfunction determineSupportedLocale(locale: unknown): string | undefined {\n if (typeof locale !== 'string' || locale.length === 0) return undefined;\n return getI18nConfig().determineSupportedLocale(locale);\n}\n\nfunction warnInvalidLocale(locale: string, defaultLocale: string) {\n if (\n process.env._GENERALTRANSLATION_DISABLE_INVALID_LOCALE_WARNING === 'true'\n ) {\n return;\n }\n\n console.warn(createInvalidRequestLocaleWarning(locale, defaultLocale));\n}\n\nexport function resolveLocaleOrDefault(locale: unknown): string {\n const i18nConfig = getI18nConfig();\n const defaultLocale = i18nConfig.getDefaultLocale();\n const supportedLocale =\n typeof locale === 'string' && locale.length > 0\n ? i18nConfig.determineSupportedLocale(locale)\n : undefined;\n\n if (supportedLocale) return supportedLocale;\n\n if (typeof locale === 'string' && locale.length > 0) {\n warnInvalidLocale(locale, defaultLocale);\n }\n\n return defaultLocale;\n}\n\n/**\n * Checks whether a locale is valid and supported by the current gt-next config.\n *\n * Use this when route params or other request inputs should be rejected instead\n * of falling back to the default locale.\n *\n * @param locale - The locale candidate to validate.\n * @returns True when the locale resolves to one of the configured locales.\n */\nexport function isLocaleSupported(locale: unknown): locale is string {\n return determineSupportedLocale(locale) !== undefined;\n}\n"],"mappings":";;;;;AAGA,SAAS,yBAAyB,QAAqC;AACrE,KAAI,OAAO,WAAW,YAAY,OAAO,WAAW,EAAG,QAAO,KAAA;AAC9D,SAAA,GAAA,iBAAA,gBAAsB,CAAC,yBAAyB,OAAO;;AAGzD,SAAS,kBAAkB,QAAgB,eAAuB;AAChE,KACE,QAAQ,IAAI,uDAAuD,OAEnE;AAGF,SAAQ,KAAKA,uBAAAA,kCAAkC,QAAQ,cAAc,CAAC;;AAGxE,SAAgB,uBAAuB,QAAyB;CAC9D,MAAM,cAAA,GAAA,iBAAA,gBAA4B;CAClC,MAAM,gBAAgB,WAAW,kBAAkB;CACnD,MAAM,kBACJ,OAAO,WAAW,YAAY,OAAO,SAAS,IAC1C,WAAW,yBAAyB,OAAO,GAC3C,KAAA;AAEN,KAAI,gBAAiB,QAAO;AAE5B,KAAI,OAAO,WAAW,YAAY,OAAO,SAAS,EAChD,mBAAkB,QAAQ,cAAc;AAG1C,QAAO;;;;;;;;;;;AAYT,SAAgB,kBAAkB,QAAmC;AACnE,QAAO,yBAAyB,OAAO,KAAK,KAAA"}
@@ -13,9 +13,9 @@ function resolveLocaleOrDefault(locale) {
13
13
  const i18nConfig = getI18nConfig();
14
14
  const defaultLocale = i18nConfig.getDefaultLocale();
15
15
  const supportedLocale = typeof locale === "string" && locale.length > 0 ? i18nConfig.determineSupportedLocale(locale) : void 0;
16
- if (supportedLocale) return i18nConfig.resolveAliasLocale(supportedLocale);
16
+ if (supportedLocale) return supportedLocale;
17
17
  if (typeof locale === "string" && locale.length > 0) warnInvalidLocale(locale, defaultLocale);
18
- return i18nConfig.resolveAliasLocale(defaultLocale);
18
+ return defaultLocale;
19
19
  }
20
20
  /**
21
21
  * Checks whether a locale is valid and supported by the current gt-next config.
@@ -1 +1 @@
1
- {"version":3,"file":"localeValidation.mjs","names":[],"sources":["../../src/request/localeValidation.ts"],"sourcesContent":["import { getI18nConfig } from 'gt-i18n/internal';\nimport { createInvalidRequestLocaleWarning } from '../errors/request';\n\nfunction determineSupportedLocale(locale: unknown): string | undefined {\n if (typeof locale !== 'string' || locale.length === 0) return undefined;\n return getI18nConfig().determineSupportedLocale(locale);\n}\n\nfunction warnInvalidLocale(locale: string, defaultLocale: string) {\n if (\n process.env._GENERALTRANSLATION_DISABLE_INVALID_LOCALE_WARNING === 'true'\n ) {\n return;\n }\n\n console.warn(createInvalidRequestLocaleWarning(locale, defaultLocale));\n}\n\nexport function resolveLocaleOrDefault(locale: unknown): string {\n const i18nConfig = getI18nConfig();\n const defaultLocale = i18nConfig.getDefaultLocale();\n const supportedLocale =\n typeof locale === 'string' && locale.length > 0\n ? i18nConfig.determineSupportedLocale(locale)\n : undefined;\n\n if (supportedLocale) return i18nConfig.resolveAliasLocale(supportedLocale);\n\n if (typeof locale === 'string' && locale.length > 0) {\n warnInvalidLocale(locale, defaultLocale);\n }\n\n return i18nConfig.resolveAliasLocale(defaultLocale);\n}\n\n/**\n * Checks whether a locale is valid and supported by the current gt-next config.\n *\n * Use this when route params or other request inputs should be rejected instead\n * of falling back to the default locale.\n *\n * @param locale - The locale candidate to validate.\n * @returns True when the locale resolves to one of the configured locales.\n */\nexport function isLocaleSupported(locale: unknown): locale is string {\n return determineSupportedLocale(locale) !== undefined;\n}\n"],"mappings":";;;AAGA,SAAS,yBAAyB,QAAqC;AACrE,KAAI,OAAO,WAAW,YAAY,OAAO,WAAW,EAAG,QAAO,KAAA;AAC9D,QAAO,eAAe,CAAC,yBAAyB,OAAO;;AAGzD,SAAS,kBAAkB,QAAgB,eAAuB;AAChE,KACE,QAAQ,IAAI,uDAAuD,OAEnE;AAGF,SAAQ,KAAK,kCAAkC,QAAQ,cAAc,CAAC;;AAGxE,SAAgB,uBAAuB,QAAyB;CAC9D,MAAM,aAAa,eAAe;CAClC,MAAM,gBAAgB,WAAW,kBAAkB;CACnD,MAAM,kBACJ,OAAO,WAAW,YAAY,OAAO,SAAS,IAC1C,WAAW,yBAAyB,OAAO,GAC3C,KAAA;AAEN,KAAI,gBAAiB,QAAO,WAAW,mBAAmB,gBAAgB;AAE1E,KAAI,OAAO,WAAW,YAAY,OAAO,SAAS,EAChD,mBAAkB,QAAQ,cAAc;AAG1C,QAAO,WAAW,mBAAmB,cAAc;;;;;;;;;;;AAYrD,SAAgB,kBAAkB,QAAmC;AACnE,QAAO,yBAAyB,OAAO,KAAK,KAAA"}
1
+ {"version":3,"file":"localeValidation.mjs","names":[],"sources":["../../src/request/localeValidation.ts"],"sourcesContent":["import { getI18nConfig } from 'gt-i18n/internal';\nimport { createInvalidRequestLocaleWarning } from '../errors/request';\n\nfunction determineSupportedLocale(locale: unknown): string | undefined {\n if (typeof locale !== 'string' || locale.length === 0) return undefined;\n return getI18nConfig().determineSupportedLocale(locale);\n}\n\nfunction warnInvalidLocale(locale: string, defaultLocale: string) {\n if (\n process.env._GENERALTRANSLATION_DISABLE_INVALID_LOCALE_WARNING === 'true'\n ) {\n return;\n }\n\n console.warn(createInvalidRequestLocaleWarning(locale, defaultLocale));\n}\n\nexport function resolveLocaleOrDefault(locale: unknown): string {\n const i18nConfig = getI18nConfig();\n const defaultLocale = i18nConfig.getDefaultLocale();\n const supportedLocale =\n typeof locale === 'string' && locale.length > 0\n ? i18nConfig.determineSupportedLocale(locale)\n : undefined;\n\n if (supportedLocale) return supportedLocale;\n\n if (typeof locale === 'string' && locale.length > 0) {\n warnInvalidLocale(locale, defaultLocale);\n }\n\n return defaultLocale;\n}\n\n/**\n * Checks whether a locale is valid and supported by the current gt-next config.\n *\n * Use this when route params or other request inputs should be rejected instead\n * of falling back to the default locale.\n *\n * @param locale - The locale candidate to validate.\n * @returns True when the locale resolves to one of the configured locales.\n */\nexport function isLocaleSupported(locale: unknown): locale is string {\n return determineSupportedLocale(locale) !== undefined;\n}\n"],"mappings":";;;AAGA,SAAS,yBAAyB,QAAqC;AACrE,KAAI,OAAO,WAAW,YAAY,OAAO,WAAW,EAAG,QAAO,KAAA;AAC9D,QAAO,eAAe,CAAC,yBAAyB,OAAO;;AAGzD,SAAS,kBAAkB,QAAgB,eAAuB;AAChE,KACE,QAAQ,IAAI,uDAAuD,OAEnE;AAGF,SAAQ,KAAK,kCAAkC,QAAQ,cAAc,CAAC;;AAGxE,SAAgB,uBAAuB,QAAyB;CAC9D,MAAM,aAAa,eAAe;CAClC,MAAM,gBAAgB,WAAW,kBAAkB;CACnD,MAAM,kBACJ,OAAO,WAAW,YAAY,OAAO,SAAS,IAC1C,WAAW,yBAAyB,OAAO,GAC3C,KAAA;AAEN,KAAI,gBAAiB,QAAO;AAE5B,KAAI,OAAO,WAAW,YAAY,OAAO,SAAS,EAChD,mBAAkB,QAAQ,cAAc;AAG1C,QAAO;;;;;;;;;;;AAYT,SAAgB,kBAAkB,QAAmC;AACnE,QAAO,yBAAyB,OAAO,KAAK,KAAA"}
@@ -12,5 +12,8 @@ import { type SharedGTProviderProps } from 'gt-react';
12
12
  /**
13
13
  * Small wrapper to embed nextjs app router behavior
14
14
  */
15
- export declare function Client_GTProvider(props: SharedGTProviderProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function Client_GTProvider({ conditions, supportsLocaleRefresh, ...props }: Omit<SharedGTProviderProps, 'locale' | 'region' | 'enableI18n' | '_serverConditions'> & {
16
+ conditions: NonNullable<SharedGTProviderProps['_serverConditions']>;
17
+ supportsLocaleRefresh: boolean;
18
+ }): import("react/jsx-runtime").JSX.Element;
16
19
  //# sourceMappingURL=client-boundary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client-boundary.d.ts","sourceRoot":"","sources":["../../src/utils/client-boundary.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EAAE,cAAc,IAAI,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,cAAc,IAAI,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAGnE,OAAO,EAAc,KAAK,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAsBlE;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,qBAAqB,2CA+C7D"}
1
+ {"version":3,"file":"client-boundary.d.ts","sourceRoot":"","sources":["../../src/utils/client-boundary.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EAAE,cAAc,IAAI,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,cAAc,IAAI,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAGnE,OAAO,EAAc,KAAK,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAsBlE;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,qBAAqB,EACrB,GAAG,KAAK,EACT,EAAE,IAAI,CACL,qBAAqB,EACrB,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,mBAAmB,CACzD,GAAG;IACF,UAAU,EAAE,WAAW,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACpE,qBAAqB,EAAE,OAAO,CAAC;CAChC,2CA+DA"}
@@ -20,11 +20,15 @@ if (typeof window !== "undefined") require_setup_initGT_client.initializeGTClien
20
20
  /**
21
21
  * Small wrapper to embed nextjs app router behavior
22
22
  */
23
- function Client_GTProvider(props) {
23
+ function Client_GTProvider({ conditions, supportsLocaleRefresh, ...props }) {
24
24
  const router = (0, next_navigation_js.useRouter)();
25
25
  const refreshServerComponents = (0, react.useCallback)(() => {
26
+ if (!supportsLocaleRefresh) {
27
+ globalThis.location.reload();
28
+ return;
29
+ }
26
30
  router.refresh();
27
- }, [router]);
31
+ }, [router, supportsLocaleRefresh]);
28
32
  const reloadBrowserPage = (0, react.useCallback)(() => {
29
33
  globalThis.location.reload();
30
34
  }, []);
@@ -45,10 +49,12 @@ function Client_GTProvider(props) {
45
49
  usePathCheck({
46
50
  reloadBrowserPage,
47
51
  refreshServerComponents,
48
- locale: props.locale
52
+ locale: conditions.locale
49
53
  });
50
54
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(gt_react.GTProvider, {
51
55
  ...props,
56
+ ...conditions,
57
+ _serverConditions: conditions,
52
58
  _reload: syncServerContent
53
59
  });
54
60
  }
@@ -61,7 +67,7 @@ function usePathCheck({ reloadBrowserPage, refreshServerComponents, locale, refe
61
67
  const pathname = (0, next_navigation_js.usePathname)();
62
68
  (0, react.useEffect)(() => {
63
69
  const i18nConfig = (0, gt_i18n_internal.getI18nConfig)();
64
- document.cookie = `${referrerLocaleCookieName}=${i18nConfig.resolveAliasLocale(locale)};path=/`;
70
+ document.cookie = `${referrerLocaleCookieName}=${locale};path=/`;
65
71
  const locales = i18nConfig.getLocales();
66
72
  const defaultLocale = i18nConfig.getDefaultLocale();
67
73
  if ((0, gt_i18n_internal.getCookieValue)(document.cookie, localeRoutingEnabledCookieName) === "true" && require_utils_pathRegex.pathnameMatchesRegex(pathname, pathRegex)) {
@@ -82,14 +88,12 @@ function usePathCheck({ reloadBrowserPage, refreshServerComponents, locale, refe
82
88
  ]);
83
89
  }
84
90
  function resolvePathLocale(pathname, i18nConfig, defaultLocale, locales) {
85
- const extractedLocale = extractLocale(pathname, i18nConfig);
91
+ const extractedLocale = extractLocale(pathname);
86
92
  if (!extractedLocale) return defaultLocale;
87
- const currentPathLocale = i18nConfig.determineLocale([i18nConfig.isGTServicesEnabled() ? i18nConfig.standardizeLocale(extractedLocale) : extractedLocale], locales);
88
- return currentPathLocale ? i18nConfig.resolveAliasLocale(currentPathLocale) : defaultLocale;
93
+ return i18nConfig.determineLocale([extractedLocale], locales) ?? defaultLocale;
89
94
  }
90
- function extractLocale(pathname, i18nConfig) {
91
- const matches = pathname.match(/^\/([^/]+)(?:\/|$)/);
92
- return matches ? i18nConfig.resolveAliasLocale(matches[1]) : null;
95
+ function extractLocale(pathname) {
96
+ return pathname.match(/^\/([^/]+)(?:\/|$)/)?.[1] ?? null;
93
97
  }
94
98
  //#endregion
95
99
  exports.Client_GTProvider = Client_GTProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"client-boundary.js","names":["compilePathRegex","defaultLocaleRoutingEnabledCookieName","pathnameMatchesRegex","GTProvider","defaultReferrerLocaleCookieName"],"sources":["../../src/utils/client-boundary.tsx"],"sourcesContent":["'use client';\n\n/**\n * This is a small boundary for RSC consumption of client components\n * Cannot be consumed through gt-react/index.rsc as deciding btwn\n * gt-react/index.server and gt-react/index.client can only happen\n * here. This matters for GTProvider, but not for LocaleSelector.\n * This pattern is just good to follow for carrying over different\n * behaviors between client and server from gt-react.\n */\n\nexport { LocaleSelector as Client_LocaleSelector } from 'gt-react';\nexport { RegionSelector as Client_RegionSelector } from 'gt-react';\n\nimport { getCookieValue, getI18nConfig, I18nConfig } from 'gt-i18n/internal';\nimport { GTProvider, type SharedGTProviderProps } from 'gt-react';\nimport { usePathname, useRouter } from 'next/navigation';\nimport { useCallback, useEffect } from 'react';\nimport { initializeGTClient } from '../setup/initGT.client';\nimport {\n defaultLocaleRoutingEnabledCookieName,\n defaultReferrerLocaleCookieName,\n} from './cookies';\nimport { compilePathRegex, pathnameMatchesRegex } from './pathRegex';\n\n// withGTConfig exposes this build-time value to both middleware and client code.\nconst pathRegex = compilePathRegex(process.env._GENERALTRANSLATION_PATH_REGEX);\n\n/**\n * Only need to initalize client. We know server was already\n * inialaized by index.rsc.ts. We do not know yet if client\n * has been initialized by index.client.ts.\n */\nif (typeof window !== 'undefined') {\n initializeGTClient();\n}\n\n/**\n * Small wrapper to embed nextjs app router behavior\n */\nexport function Client_GTProvider(props: SharedGTProviderProps) {\n const router = useRouter();\n const refreshServerComponents = useCallback(() => {\n router.refresh();\n }, [router]);\n const reloadBrowserPage = useCallback(() => {\n globalThis.location.reload();\n }, []);\n const syncServerContent = useCallback<\n NonNullable<SharedGTProviderProps['_reload']>\n >(\n ({ locale }) => {\n const i18nConfig = getI18nConfig();\n const localeRoutingEnabled =\n getCookieValue(\n document.cookie,\n defaultLocaleRoutingEnabledCookieName\n ) === 'true';\n const defaultLocale = i18nConfig.getDefaultLocale();\n const locales = i18nConfig.getLocales();\n const currentPathname = globalThis.location.pathname;\n const localeRoutingApplies =\n localeRoutingEnabled &&\n pathnameMatchesRegex(currentPathname, pathRegex);\n if (localeRoutingApplies && locale === defaultLocale) {\n const currentPathLocale = resolvePathLocale(\n currentPathname,\n i18nConfig,\n defaultLocale,\n locales\n );\n if (currentPathLocale !== defaultLocale) {\n reloadBrowserPage();\n return;\n }\n }\n\n refreshServerComponents();\n },\n [refreshServerComponents, reloadBrowserPage]\n );\n usePathCheck({\n reloadBrowserPage,\n refreshServerComponents,\n locale: props.locale,\n });\n return <GTProvider {...props} _reload={syncServerContent} />;\n}\n\n/**\n * Synchronizes server content if the URL locale does not match the selected\n * locale.\n * TODO: optimize this hook\n */\nfunction usePathCheck({\n reloadBrowserPage,\n refreshServerComponents,\n locale,\n referrerLocaleCookieName = defaultReferrerLocaleCookieName,\n localeRoutingEnabledCookieName = defaultLocaleRoutingEnabledCookieName,\n}: {\n reloadBrowserPage: () => void;\n refreshServerComponents: () => void;\n locale: string;\n referrerLocaleCookieName?: string;\n localeRoutingEnabledCookieName?: string;\n}) {\n const pathname = usePathname();\n\n useEffect(() => {\n // Track the referrer locale for middleware\n const i18nConfig = getI18nConfig();\n document.cookie = `${referrerLocaleCookieName}=${i18nConfig.resolveAliasLocale(locale)};path=/`;\n\n // Synchronize server content if the pathname changes\n const locales = i18nConfig.getLocales();\n const defaultLocale = i18nConfig.getDefaultLocale();\n const localeRoutingEnabled =\n getCookieValue(document.cookie, localeRoutingEnabledCookieName) ===\n 'true';\n if (localeRoutingEnabled && pathnameMatchesRegex(pathname, pathRegex)) {\n // Extract locale from pathname\n const currentPathLocale = resolvePathLocale(\n pathname,\n i18nConfig,\n defaultLocale,\n locales\n );\n\n if (\n currentPathLocale &&\n locales.includes(currentPathLocale) &&\n currentPathLocale !== locale\n ) {\n // clear cookie (avoids infinite loop when there is no middleware)\n document.cookie = `${localeRoutingEnabledCookieName}=;path=/`;\n\n if (locale === defaultLocale) {\n // A browser navigation follows the middleware redirect that removes\n // the default locale prefix. Next.js router.refresh() does not.\n reloadBrowserPage();\n } else {\n refreshServerComponents();\n }\n }\n }\n }, [\n pathname,\n locale,\n referrerLocaleCookieName,\n localeRoutingEnabledCookieName,\n reloadBrowserPage,\n refreshServerComponents,\n ]);\n}\n\nfunction resolvePathLocale(\n pathname: string,\n i18nConfig: I18nConfig,\n defaultLocale: string,\n locales: string[]\n): string {\n const extractedLocale = extractLocale(pathname, i18nConfig);\n if (!extractedLocale) {\n return defaultLocale;\n }\n\n const currentPathLocale = i18nConfig.determineLocale(\n [\n i18nConfig.isGTServicesEnabled()\n ? i18nConfig.standardizeLocale(extractedLocale)\n : extractedLocale,\n ],\n locales\n );\n return currentPathLocale\n ? i18nConfig.resolveAliasLocale(currentPathLocale)\n : defaultLocale;\n}\n\nfunction extractLocale(\n pathname: string,\n i18nConfig: I18nConfig\n): string | null {\n const matches = pathname.match(/^\\/([^/]+)(?:\\/|$)/);\n return matches ? i18nConfig.resolveAliasLocale(matches[1]) : null;\n}\n"],"mappings":";;;;;;;;;;;;AA0BA,MAAM,YAAYA,wBAAAA,iBAAiB,QAAQ,IAAI,+BAA+B;;;;;;AAO9E,IAAI,OAAO,WAAW,YACpB,6BAAA,oBAAoB;;;;AAMtB,SAAgB,kBAAkB,OAA8B;CAC9D,MAAM,UAAA,GAAA,mBAAA,YAAoB;CAC1B,MAAM,2BAAA,GAAA,MAAA,mBAA4C;AAChD,SAAO,SAAS;IACf,CAAC,OAAO,CAAC;CACZ,MAAM,qBAAA,GAAA,MAAA,mBAAsC;AAC1C,aAAW,SAAS,QAAQ;IAC3B,EAAE,CAAC;CACN,MAAM,qBAAA,GAAA,MAAA,cAGH,EAAE,aAAa;EACd,MAAM,cAAA,GAAA,iBAAA,gBAA4B;EAClC,MAAM,wBAAA,GAAA,iBAAA,gBAEF,SAAS,QACTC,sBAAAA,sCACD,KAAK;EACR,MAAM,gBAAgB,WAAW,kBAAkB;EACnD,MAAM,UAAU,WAAW,YAAY;EACvC,MAAM,kBAAkB,WAAW,SAAS;AAI5C,MAFE,wBACAC,wBAAAA,qBAAqB,iBAAiB,UAAU,IACtB,WAAW;OACX,kBACxB,iBACA,YACA,eACA,QAEmB,KAAK,eAAe;AACvC,uBAAmB;AACnB;;;AAIJ,2BAAyB;IAE3B,CAAC,yBAAyB,kBAAkB,CAC7C;AACD,cAAa;EACX;EACA;EACA,QAAQ,MAAM;EACf,CAAC;AACF,QAAO,iBAAA,GAAA,kBAAA,KAACC,SAAAA,YAAD;EAAY,GAAI;EAAO,SAAS;EAAqB,CAAA;;;;;;;AAQ9D,SAAS,aAAa,EACpB,mBACA,yBACA,QACA,2BAA2BC,sBAAAA,iCAC3B,iCAAiCH,sBAAAA,yCAOhC;CACD,MAAM,YAAA,GAAA,mBAAA,cAAwB;AAE9B,EAAA,GAAA,MAAA,iBAAgB;EAEd,MAAM,cAAA,GAAA,iBAAA,gBAA4B;AAClC,WAAS,SAAS,GAAG,yBAAyB,GAAG,WAAW,mBAAmB,OAAO,CAAC;EAGvF,MAAM,UAAU,WAAW,YAAY;EACvC,MAAM,gBAAgB,WAAW,kBAAkB;AAInD,OAAA,GAAA,iBAAA,gBAFiB,SAAS,QAAQ,+BAA+B,KAC/D,UAC0BC,wBAAAA,qBAAqB,UAAU,UAAU,EAAE;GAErE,MAAM,oBAAoB,kBACxB,UACA,YACA,eACA,QACD;AAED,OACE,qBACA,QAAQ,SAAS,kBAAkB,IACnC,sBAAsB,QACtB;AAEA,aAAS,SAAS,GAAG,+BAA+B;AAEpD,QAAI,WAAW,cAGb,oBAAmB;QAEnB,0BAAyB;;;IAI9B;EACD;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;;AAGJ,SAAS,kBACP,UACA,YACA,eACA,SACQ;CACR,MAAM,kBAAkB,cAAc,UAAU,WAAW;AAC3D,KAAI,CAAC,gBACH,QAAO;CAGT,MAAM,oBAAoB,WAAW,gBACnC,CACE,WAAW,qBAAqB,GAC5B,WAAW,kBAAkB,gBAAgB,GAC7C,gBACL,EACD,QACD;AACD,QAAO,oBACH,WAAW,mBAAmB,kBAAkB,GAChD;;AAGN,SAAS,cACP,UACA,YACe;CACf,MAAM,UAAU,SAAS,MAAM,qBAAqB;AACpD,QAAO,UAAU,WAAW,mBAAmB,QAAQ,GAAG,GAAG"}
1
+ {"version":3,"file":"client-boundary.js","names":["compilePathRegex","defaultLocaleRoutingEnabledCookieName","pathnameMatchesRegex","GTProvider","defaultReferrerLocaleCookieName"],"sources":["../../src/utils/client-boundary.tsx"],"sourcesContent":["'use client';\n\n/**\n * This is a small boundary for RSC consumption of client components\n * Cannot be consumed through gt-react/index.rsc as deciding btwn\n * gt-react/index.server and gt-react/index.client can only happen\n * here. This matters for GTProvider, but not for LocaleSelector.\n * This pattern is just good to follow for carrying over different\n * behaviors between client and server from gt-react.\n */\n\nexport { LocaleSelector as Client_LocaleSelector } from 'gt-react';\nexport { RegionSelector as Client_RegionSelector } from 'gt-react';\n\nimport { getCookieValue, getI18nConfig, I18nConfig } from 'gt-i18n/internal';\nimport { GTProvider, type SharedGTProviderProps } from 'gt-react';\nimport { usePathname, useRouter } from 'next/navigation';\nimport { useCallback, useEffect } from 'react';\nimport { initializeGTClient } from '../setup/initGT.client';\nimport {\n defaultLocaleRoutingEnabledCookieName,\n defaultReferrerLocaleCookieName,\n} from './cookies';\nimport { compilePathRegex, pathnameMatchesRegex } from './pathRegex';\n\n// withGTConfig exposes this build-time value to both middleware and client code.\nconst pathRegex = compilePathRegex(process.env._GENERALTRANSLATION_PATH_REGEX);\n\n/**\n * Only need to initalize client. We know server was already\n * inialaized by index.rsc.ts. We do not know yet if client\n * has been initialized by index.client.ts.\n */\nif (typeof window !== 'undefined') {\n initializeGTClient();\n}\n\n/**\n * Small wrapper to embed nextjs app router behavior\n */\nexport function Client_GTProvider({\n conditions,\n supportsLocaleRefresh,\n ...props\n}: Omit<\n SharedGTProviderProps,\n 'locale' | 'region' | 'enableI18n' | '_serverConditions'\n> & {\n conditions: NonNullable<SharedGTProviderProps['_serverConditions']>;\n supportsLocaleRefresh: boolean;\n}) {\n const router = useRouter();\n const refreshServerComponents = useCallback(() => {\n // Older Next versions can retain a stale layout/provider after a redirect.\n if (!supportsLocaleRefresh) {\n globalThis.location.reload();\n return;\n }\n // The server supplies a fresh conditions object even when its accepted\n // locale is unchanged. For example, switching /en/careers to excluded 'fr'\n // returns another 'en' snapshot, which resets the browser store to 'en'\n // without discarding client state through a document reload.\n router.refresh();\n }, [router, supportsLocaleRefresh]);\n const reloadBrowserPage = useCallback(() => {\n globalThis.location.reload();\n }, []);\n const syncServerContent = useCallback<\n NonNullable<SharedGTProviderProps['_reload']>\n >(\n ({ locale }) => {\n const i18nConfig = getI18nConfig();\n const localeRoutingEnabled =\n getCookieValue(\n document.cookie,\n defaultLocaleRoutingEnabledCookieName\n ) === 'true';\n const defaultLocale = i18nConfig.getDefaultLocale();\n const locales = i18nConfig.getLocales();\n const currentPathname = globalThis.location.pathname;\n const localeRoutingApplies =\n localeRoutingEnabled &&\n pathnameMatchesRegex(currentPathname, pathRegex);\n if (localeRoutingApplies && locale === defaultLocale) {\n const currentPathLocale = resolvePathLocale(\n currentPathname,\n i18nConfig,\n defaultLocale,\n locales\n );\n if (currentPathLocale !== defaultLocale) {\n reloadBrowserPage();\n return;\n }\n }\n\n refreshServerComponents();\n },\n [refreshServerComponents, reloadBrowserPage]\n );\n usePathCheck({\n reloadBrowserPage,\n refreshServerComponents,\n locale: conditions.locale,\n });\n return (\n <GTProvider\n {...props}\n {...conditions}\n _serverConditions={conditions}\n _reload={syncServerContent}\n />\n );\n}\n\n/**\n * Synchronizes server content if the URL locale does not match the selected\n * locale.\n * TODO: optimize this hook\n */\nfunction usePathCheck({\n reloadBrowserPage,\n refreshServerComponents,\n locale,\n referrerLocaleCookieName = defaultReferrerLocaleCookieName,\n localeRoutingEnabledCookieName = defaultLocaleRoutingEnabledCookieName,\n}: {\n reloadBrowserPage: () => void;\n refreshServerComponents: () => void;\n locale: string;\n referrerLocaleCookieName?: string;\n localeRoutingEnabledCookieName?: string;\n}) {\n const pathname = usePathname();\n\n useEffect(() => {\n // Track the referrer locale for middleware\n const i18nConfig = getI18nConfig();\n document.cookie = `${referrerLocaleCookieName}=${locale};path=/`;\n\n // Synchronize server content if the pathname changes\n const locales = i18nConfig.getLocales();\n const defaultLocale = i18nConfig.getDefaultLocale();\n const localeRoutingEnabled =\n getCookieValue(document.cookie, localeRoutingEnabledCookieName) ===\n 'true';\n if (localeRoutingEnabled && pathnameMatchesRegex(pathname, pathRegex)) {\n // Extract locale from pathname\n const currentPathLocale = resolvePathLocale(\n pathname,\n i18nConfig,\n defaultLocale,\n locales\n );\n\n // Both values are resolved to configured identities before comparison.\n if (\n currentPathLocale &&\n locales.includes(currentPathLocale) &&\n currentPathLocale !== locale\n ) {\n // clear cookie (avoids infinite loop when there is no middleware)\n document.cookie = `${localeRoutingEnabledCookieName}=;path=/`;\n\n if (locale === defaultLocale) {\n // A browser navigation follows the middleware redirect that removes\n // the default locale prefix. Next.js router.refresh() does not.\n reloadBrowserPage();\n } else {\n refreshServerComponents();\n }\n }\n }\n }, [\n pathname,\n locale,\n referrerLocaleCookieName,\n localeRoutingEnabledCookieName,\n reloadBrowserPage,\n refreshServerComponents,\n ]);\n}\n\nfunction resolvePathLocale(\n pathname: string,\n i18nConfig: I18nConfig,\n defaultLocale: string,\n locales: string[]\n): string {\n const extractedLocale = extractLocale(pathname);\n if (!extractedLocale) {\n return defaultLocale;\n }\n\n return (\n i18nConfig.determineLocale([extractedLocale], locales) ?? defaultLocale\n );\n}\n\nfunction extractLocale(pathname: string): string | null {\n return pathname.match(/^\\/([^/]+)(?:\\/|$)/)?.[1] ?? null;\n}\n"],"mappings":";;;;;;;;;;;;AA0BA,MAAM,YAAYA,wBAAAA,iBAAiB,QAAQ,IAAI,+BAA+B;;;;;;AAO9E,IAAI,OAAO,WAAW,YACpB,6BAAA,oBAAoB;;;;AAMtB,SAAgB,kBAAkB,EAChC,YACA,uBACA,GAAG,SAOF;CACD,MAAM,UAAA,GAAA,mBAAA,YAAoB;CAC1B,MAAM,2BAAA,GAAA,MAAA,mBAA4C;AAEhD,MAAI,CAAC,uBAAuB;AAC1B,cAAW,SAAS,QAAQ;AAC5B;;AAMF,SAAO,SAAS;IACf,CAAC,QAAQ,sBAAsB,CAAC;CACnC,MAAM,qBAAA,GAAA,MAAA,mBAAsC;AAC1C,aAAW,SAAS,QAAQ;IAC3B,EAAE,CAAC;CACN,MAAM,qBAAA,GAAA,MAAA,cAGH,EAAE,aAAa;EACd,MAAM,cAAA,GAAA,iBAAA,gBAA4B;EAClC,MAAM,wBAAA,GAAA,iBAAA,gBAEF,SAAS,QACTC,sBAAAA,sCACD,KAAK;EACR,MAAM,gBAAgB,WAAW,kBAAkB;EACnD,MAAM,UAAU,WAAW,YAAY;EACvC,MAAM,kBAAkB,WAAW,SAAS;AAI5C,MAFE,wBACAC,wBAAAA,qBAAqB,iBAAiB,UAAU,IACtB,WAAW;OACX,kBACxB,iBACA,YACA,eACA,QAEmB,KAAK,eAAe;AACvC,uBAAmB;AACnB;;;AAIJ,2BAAyB;IAE3B,CAAC,yBAAyB,kBAAkB,CAC7C;AACD,cAAa;EACX;EACA;EACA,QAAQ,WAAW;EACpB,CAAC;AACF,QACE,iBAAA,GAAA,kBAAA,KAACC,SAAAA,YAAD;EACE,GAAI;EACJ,GAAI;EACJ,mBAAmB;EACnB,SAAS;EACT,CAAA;;;;;;;AASN,SAAS,aAAa,EACpB,mBACA,yBACA,QACA,2BAA2BC,sBAAAA,iCAC3B,iCAAiCH,sBAAAA,yCAOhC;CACD,MAAM,YAAA,GAAA,mBAAA,cAAwB;AAE9B,EAAA,GAAA,MAAA,iBAAgB;EAEd,MAAM,cAAA,GAAA,iBAAA,gBAA4B;AAClC,WAAS,SAAS,GAAG,yBAAyB,GAAG,OAAO;EAGxD,MAAM,UAAU,WAAW,YAAY;EACvC,MAAM,gBAAgB,WAAW,kBAAkB;AAInD,OAAA,GAAA,iBAAA,gBAFiB,SAAS,QAAQ,+BAA+B,KAC/D,UAC0BC,wBAAAA,qBAAqB,UAAU,UAAU,EAAE;GAErE,MAAM,oBAAoB,kBACxB,UACA,YACA,eACA,QACD;AAGD,OACE,qBACA,QAAQ,SAAS,kBAAkB,IACnC,sBAAsB,QACtB;AAEA,aAAS,SAAS,GAAG,+BAA+B;AAEpD,QAAI,WAAW,cAGb,oBAAmB;QAEnB,0BAAyB;;;IAI9B;EACD;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;;AAGJ,SAAS,kBACP,UACA,YACA,eACA,SACQ;CACR,MAAM,kBAAkB,cAAc,SAAS;AAC/C,KAAI,CAAC,gBACH,QAAO;AAGT,QACE,WAAW,gBAAgB,CAAC,gBAAgB,EAAE,QAAQ,IAAI;;AAI9D,SAAS,cAAc,UAAiC;AACtD,QAAO,SAAS,MAAM,qBAAqB,GAAG,MAAM"}
@@ -18,11 +18,15 @@ if (typeof window !== "undefined") initializeGTClient();
18
18
  /**
19
19
  * Small wrapper to embed nextjs app router behavior
20
20
  */
21
- function Client_GTProvider(props) {
21
+ function Client_GTProvider({ conditions, supportsLocaleRefresh, ...props }) {
22
22
  const router = useRouter();
23
23
  const refreshServerComponents = useCallback(() => {
24
+ if (!supportsLocaleRefresh) {
25
+ globalThis.location.reload();
26
+ return;
27
+ }
24
28
  router.refresh();
25
- }, [router]);
29
+ }, [router, supportsLocaleRefresh]);
26
30
  const reloadBrowserPage = useCallback(() => {
27
31
  globalThis.location.reload();
28
32
  }, []);
@@ -43,10 +47,12 @@ function Client_GTProvider(props) {
43
47
  usePathCheck({
44
48
  reloadBrowserPage,
45
49
  refreshServerComponents,
46
- locale: props.locale
50
+ locale: conditions.locale
47
51
  });
48
52
  return /* @__PURE__ */ jsx(GTProvider, {
49
53
  ...props,
54
+ ...conditions,
55
+ _serverConditions: conditions,
50
56
  _reload: syncServerContent
51
57
  });
52
58
  }
@@ -59,7 +65,7 @@ function usePathCheck({ reloadBrowserPage, refreshServerComponents, locale, refe
59
65
  const pathname = usePathname();
60
66
  useEffect(() => {
61
67
  const i18nConfig = getI18nConfig();
62
- document.cookie = `${referrerLocaleCookieName}=${i18nConfig.resolveAliasLocale(locale)};path=/`;
68
+ document.cookie = `${referrerLocaleCookieName}=${locale};path=/`;
63
69
  const locales = i18nConfig.getLocales();
64
70
  const defaultLocale = i18nConfig.getDefaultLocale();
65
71
  if (getCookieValue(document.cookie, localeRoutingEnabledCookieName) === "true" && pathnameMatchesRegex(pathname, pathRegex)) {
@@ -80,14 +86,12 @@ function usePathCheck({ reloadBrowserPage, refreshServerComponents, locale, refe
80
86
  ]);
81
87
  }
82
88
  function resolvePathLocale(pathname, i18nConfig, defaultLocale, locales) {
83
- const extractedLocale = extractLocale(pathname, i18nConfig);
89
+ const extractedLocale = extractLocale(pathname);
84
90
  if (!extractedLocale) return defaultLocale;
85
- const currentPathLocale = i18nConfig.determineLocale([i18nConfig.isGTServicesEnabled() ? i18nConfig.standardizeLocale(extractedLocale) : extractedLocale], locales);
86
- return currentPathLocale ? i18nConfig.resolveAliasLocale(currentPathLocale) : defaultLocale;
91
+ return i18nConfig.determineLocale([extractedLocale], locales) ?? defaultLocale;
87
92
  }
88
- function extractLocale(pathname, i18nConfig) {
89
- const matches = pathname.match(/^\/([^/]+)(?:\/|$)/);
90
- return matches ? i18nConfig.resolveAliasLocale(matches[1]) : null;
93
+ function extractLocale(pathname) {
94
+ return pathname.match(/^\/([^/]+)(?:\/|$)/)?.[1] ?? null;
91
95
  }
92
96
  //#endregion
93
97
  export { Client_GTProvider, Client_LocaleSelector, Client_RegionSelector };
@@ -1 +1 @@
1
- {"version":3,"file":"client-boundary.mjs","names":[],"sources":["../../src/utils/client-boundary.tsx"],"sourcesContent":["'use client';\n\n/**\n * This is a small boundary for RSC consumption of client components\n * Cannot be consumed through gt-react/index.rsc as deciding btwn\n * gt-react/index.server and gt-react/index.client can only happen\n * here. This matters for GTProvider, but not for LocaleSelector.\n * This pattern is just good to follow for carrying over different\n * behaviors between client and server from gt-react.\n */\n\nexport { LocaleSelector as Client_LocaleSelector } from 'gt-react';\nexport { RegionSelector as Client_RegionSelector } from 'gt-react';\n\nimport { getCookieValue, getI18nConfig, I18nConfig } from 'gt-i18n/internal';\nimport { GTProvider, type SharedGTProviderProps } from 'gt-react';\nimport { usePathname, useRouter } from 'next/navigation';\nimport { useCallback, useEffect } from 'react';\nimport { initializeGTClient } from '../setup/initGT.client';\nimport {\n defaultLocaleRoutingEnabledCookieName,\n defaultReferrerLocaleCookieName,\n} from './cookies';\nimport { compilePathRegex, pathnameMatchesRegex } from './pathRegex';\n\n// withGTConfig exposes this build-time value to both middleware and client code.\nconst pathRegex = compilePathRegex(process.env._GENERALTRANSLATION_PATH_REGEX);\n\n/**\n * Only need to initalize client. We know server was already\n * inialaized by index.rsc.ts. We do not know yet if client\n * has been initialized by index.client.ts.\n */\nif (typeof window !== 'undefined') {\n initializeGTClient();\n}\n\n/**\n * Small wrapper to embed nextjs app router behavior\n */\nexport function Client_GTProvider(props: SharedGTProviderProps) {\n const router = useRouter();\n const refreshServerComponents = useCallback(() => {\n router.refresh();\n }, [router]);\n const reloadBrowserPage = useCallback(() => {\n globalThis.location.reload();\n }, []);\n const syncServerContent = useCallback<\n NonNullable<SharedGTProviderProps['_reload']>\n >(\n ({ locale }) => {\n const i18nConfig = getI18nConfig();\n const localeRoutingEnabled =\n getCookieValue(\n document.cookie,\n defaultLocaleRoutingEnabledCookieName\n ) === 'true';\n const defaultLocale = i18nConfig.getDefaultLocale();\n const locales = i18nConfig.getLocales();\n const currentPathname = globalThis.location.pathname;\n const localeRoutingApplies =\n localeRoutingEnabled &&\n pathnameMatchesRegex(currentPathname, pathRegex);\n if (localeRoutingApplies && locale === defaultLocale) {\n const currentPathLocale = resolvePathLocale(\n currentPathname,\n i18nConfig,\n defaultLocale,\n locales\n );\n if (currentPathLocale !== defaultLocale) {\n reloadBrowserPage();\n return;\n }\n }\n\n refreshServerComponents();\n },\n [refreshServerComponents, reloadBrowserPage]\n );\n usePathCheck({\n reloadBrowserPage,\n refreshServerComponents,\n locale: props.locale,\n });\n return <GTProvider {...props} _reload={syncServerContent} />;\n}\n\n/**\n * Synchronizes server content if the URL locale does not match the selected\n * locale.\n * TODO: optimize this hook\n */\nfunction usePathCheck({\n reloadBrowserPage,\n refreshServerComponents,\n locale,\n referrerLocaleCookieName = defaultReferrerLocaleCookieName,\n localeRoutingEnabledCookieName = defaultLocaleRoutingEnabledCookieName,\n}: {\n reloadBrowserPage: () => void;\n refreshServerComponents: () => void;\n locale: string;\n referrerLocaleCookieName?: string;\n localeRoutingEnabledCookieName?: string;\n}) {\n const pathname = usePathname();\n\n useEffect(() => {\n // Track the referrer locale for middleware\n const i18nConfig = getI18nConfig();\n document.cookie = `${referrerLocaleCookieName}=${i18nConfig.resolveAliasLocale(locale)};path=/`;\n\n // Synchronize server content if the pathname changes\n const locales = i18nConfig.getLocales();\n const defaultLocale = i18nConfig.getDefaultLocale();\n const localeRoutingEnabled =\n getCookieValue(document.cookie, localeRoutingEnabledCookieName) ===\n 'true';\n if (localeRoutingEnabled && pathnameMatchesRegex(pathname, pathRegex)) {\n // Extract locale from pathname\n const currentPathLocale = resolvePathLocale(\n pathname,\n i18nConfig,\n defaultLocale,\n locales\n );\n\n if (\n currentPathLocale &&\n locales.includes(currentPathLocale) &&\n currentPathLocale !== locale\n ) {\n // clear cookie (avoids infinite loop when there is no middleware)\n document.cookie = `${localeRoutingEnabledCookieName}=;path=/`;\n\n if (locale === defaultLocale) {\n // A browser navigation follows the middleware redirect that removes\n // the default locale prefix. Next.js router.refresh() does not.\n reloadBrowserPage();\n } else {\n refreshServerComponents();\n }\n }\n }\n }, [\n pathname,\n locale,\n referrerLocaleCookieName,\n localeRoutingEnabledCookieName,\n reloadBrowserPage,\n refreshServerComponents,\n ]);\n}\n\nfunction resolvePathLocale(\n pathname: string,\n i18nConfig: I18nConfig,\n defaultLocale: string,\n locales: string[]\n): string {\n const extractedLocale = extractLocale(pathname, i18nConfig);\n if (!extractedLocale) {\n return defaultLocale;\n }\n\n const currentPathLocale = i18nConfig.determineLocale(\n [\n i18nConfig.isGTServicesEnabled()\n ? i18nConfig.standardizeLocale(extractedLocale)\n : extractedLocale,\n ],\n locales\n );\n return currentPathLocale\n ? i18nConfig.resolveAliasLocale(currentPathLocale)\n : defaultLocale;\n}\n\nfunction extractLocale(\n pathname: string,\n i18nConfig: I18nConfig\n): string | null {\n const matches = pathname.match(/^\\/([^/]+)(?:\\/|$)/);\n return matches ? i18nConfig.resolveAliasLocale(matches[1]) : null;\n}\n"],"mappings":";;;;;;;;;;AA0BA,MAAM,YAAY,iBAAiB,QAAQ,IAAI,+BAA+B;;;;;;AAO9E,IAAI,OAAO,WAAW,YACpB,qBAAoB;;;;AAMtB,SAAgB,kBAAkB,OAA8B;CAC9D,MAAM,SAAS,WAAW;CAC1B,MAAM,0BAA0B,kBAAkB;AAChD,SAAO,SAAS;IACf,CAAC,OAAO,CAAC;CACZ,MAAM,oBAAoB,kBAAkB;AAC1C,aAAW,SAAS,QAAQ;IAC3B,EAAE,CAAC;CACN,MAAM,oBAAoB,aAGvB,EAAE,aAAa;EACd,MAAM,aAAa,eAAe;EAClC,MAAM,uBACJ,eACE,SAAS,QACT,sCACD,KAAK;EACR,MAAM,gBAAgB,WAAW,kBAAkB;EACnD,MAAM,UAAU,WAAW,YAAY;EACvC,MAAM,kBAAkB,WAAW,SAAS;AAI5C,MAFE,wBACA,qBAAqB,iBAAiB,UAAU,IACtB,WAAW;OACX,kBACxB,iBACA,YACA,eACA,QAEmB,KAAK,eAAe;AACvC,uBAAmB;AACnB;;;AAIJ,2BAAyB;IAE3B,CAAC,yBAAyB,kBAAkB,CAC7C;AACD,cAAa;EACX;EACA;EACA,QAAQ,MAAM;EACf,CAAC;AACF,QAAO,oBAAC,YAAD;EAAY,GAAI;EAAO,SAAS;EAAqB,CAAA;;;;;;;AAQ9D,SAAS,aAAa,EACpB,mBACA,yBACA,QACA,2BAA2B,iCAC3B,iCAAiC,yCAOhC;CACD,MAAM,WAAW,aAAa;AAE9B,iBAAgB;EAEd,MAAM,aAAa,eAAe;AAClC,WAAS,SAAS,GAAG,yBAAyB,GAAG,WAAW,mBAAmB,OAAO,CAAC;EAGvF,MAAM,UAAU,WAAW,YAAY;EACvC,MAAM,gBAAgB,WAAW,kBAAkB;AAInD,MAFE,eAAe,SAAS,QAAQ,+BAA+B,KAC/D,UAC0B,qBAAqB,UAAU,UAAU,EAAE;GAErE,MAAM,oBAAoB,kBACxB,UACA,YACA,eACA,QACD;AAED,OACE,qBACA,QAAQ,SAAS,kBAAkB,IACnC,sBAAsB,QACtB;AAEA,aAAS,SAAS,GAAG,+BAA+B;AAEpD,QAAI,WAAW,cAGb,oBAAmB;QAEnB,0BAAyB;;;IAI9B;EACD;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;;AAGJ,SAAS,kBACP,UACA,YACA,eACA,SACQ;CACR,MAAM,kBAAkB,cAAc,UAAU,WAAW;AAC3D,KAAI,CAAC,gBACH,QAAO;CAGT,MAAM,oBAAoB,WAAW,gBACnC,CACE,WAAW,qBAAqB,GAC5B,WAAW,kBAAkB,gBAAgB,GAC7C,gBACL,EACD,QACD;AACD,QAAO,oBACH,WAAW,mBAAmB,kBAAkB,GAChD;;AAGN,SAAS,cACP,UACA,YACe;CACf,MAAM,UAAU,SAAS,MAAM,qBAAqB;AACpD,QAAO,UAAU,WAAW,mBAAmB,QAAQ,GAAG,GAAG"}
1
+ {"version":3,"file":"client-boundary.mjs","names":[],"sources":["../../src/utils/client-boundary.tsx"],"sourcesContent":["'use client';\n\n/**\n * This is a small boundary for RSC consumption of client components\n * Cannot be consumed through gt-react/index.rsc as deciding btwn\n * gt-react/index.server and gt-react/index.client can only happen\n * here. This matters for GTProvider, but not for LocaleSelector.\n * This pattern is just good to follow for carrying over different\n * behaviors between client and server from gt-react.\n */\n\nexport { LocaleSelector as Client_LocaleSelector } from 'gt-react';\nexport { RegionSelector as Client_RegionSelector } from 'gt-react';\n\nimport { getCookieValue, getI18nConfig, I18nConfig } from 'gt-i18n/internal';\nimport { GTProvider, type SharedGTProviderProps } from 'gt-react';\nimport { usePathname, useRouter } from 'next/navigation';\nimport { useCallback, useEffect } from 'react';\nimport { initializeGTClient } from '../setup/initGT.client';\nimport {\n defaultLocaleRoutingEnabledCookieName,\n defaultReferrerLocaleCookieName,\n} from './cookies';\nimport { compilePathRegex, pathnameMatchesRegex } from './pathRegex';\n\n// withGTConfig exposes this build-time value to both middleware and client code.\nconst pathRegex = compilePathRegex(process.env._GENERALTRANSLATION_PATH_REGEX);\n\n/**\n * Only need to initalize client. We know server was already\n * inialaized by index.rsc.ts. We do not know yet if client\n * has been initialized by index.client.ts.\n */\nif (typeof window !== 'undefined') {\n initializeGTClient();\n}\n\n/**\n * Small wrapper to embed nextjs app router behavior\n */\nexport function Client_GTProvider({\n conditions,\n supportsLocaleRefresh,\n ...props\n}: Omit<\n SharedGTProviderProps,\n 'locale' | 'region' | 'enableI18n' | '_serverConditions'\n> & {\n conditions: NonNullable<SharedGTProviderProps['_serverConditions']>;\n supportsLocaleRefresh: boolean;\n}) {\n const router = useRouter();\n const refreshServerComponents = useCallback(() => {\n // Older Next versions can retain a stale layout/provider after a redirect.\n if (!supportsLocaleRefresh) {\n globalThis.location.reload();\n return;\n }\n // The server supplies a fresh conditions object even when its accepted\n // locale is unchanged. For example, switching /en/careers to excluded 'fr'\n // returns another 'en' snapshot, which resets the browser store to 'en'\n // without discarding client state through a document reload.\n router.refresh();\n }, [router, supportsLocaleRefresh]);\n const reloadBrowserPage = useCallback(() => {\n globalThis.location.reload();\n }, []);\n const syncServerContent = useCallback<\n NonNullable<SharedGTProviderProps['_reload']>\n >(\n ({ locale }) => {\n const i18nConfig = getI18nConfig();\n const localeRoutingEnabled =\n getCookieValue(\n document.cookie,\n defaultLocaleRoutingEnabledCookieName\n ) === 'true';\n const defaultLocale = i18nConfig.getDefaultLocale();\n const locales = i18nConfig.getLocales();\n const currentPathname = globalThis.location.pathname;\n const localeRoutingApplies =\n localeRoutingEnabled &&\n pathnameMatchesRegex(currentPathname, pathRegex);\n if (localeRoutingApplies && locale === defaultLocale) {\n const currentPathLocale = resolvePathLocale(\n currentPathname,\n i18nConfig,\n defaultLocale,\n locales\n );\n if (currentPathLocale !== defaultLocale) {\n reloadBrowserPage();\n return;\n }\n }\n\n refreshServerComponents();\n },\n [refreshServerComponents, reloadBrowserPage]\n );\n usePathCheck({\n reloadBrowserPage,\n refreshServerComponents,\n locale: conditions.locale,\n });\n return (\n <GTProvider\n {...props}\n {...conditions}\n _serverConditions={conditions}\n _reload={syncServerContent}\n />\n );\n}\n\n/**\n * Synchronizes server content if the URL locale does not match the selected\n * locale.\n * TODO: optimize this hook\n */\nfunction usePathCheck({\n reloadBrowserPage,\n refreshServerComponents,\n locale,\n referrerLocaleCookieName = defaultReferrerLocaleCookieName,\n localeRoutingEnabledCookieName = defaultLocaleRoutingEnabledCookieName,\n}: {\n reloadBrowserPage: () => void;\n refreshServerComponents: () => void;\n locale: string;\n referrerLocaleCookieName?: string;\n localeRoutingEnabledCookieName?: string;\n}) {\n const pathname = usePathname();\n\n useEffect(() => {\n // Track the referrer locale for middleware\n const i18nConfig = getI18nConfig();\n document.cookie = `${referrerLocaleCookieName}=${locale};path=/`;\n\n // Synchronize server content if the pathname changes\n const locales = i18nConfig.getLocales();\n const defaultLocale = i18nConfig.getDefaultLocale();\n const localeRoutingEnabled =\n getCookieValue(document.cookie, localeRoutingEnabledCookieName) ===\n 'true';\n if (localeRoutingEnabled && pathnameMatchesRegex(pathname, pathRegex)) {\n // Extract locale from pathname\n const currentPathLocale = resolvePathLocale(\n pathname,\n i18nConfig,\n defaultLocale,\n locales\n );\n\n // Both values are resolved to configured identities before comparison.\n if (\n currentPathLocale &&\n locales.includes(currentPathLocale) &&\n currentPathLocale !== locale\n ) {\n // clear cookie (avoids infinite loop when there is no middleware)\n document.cookie = `${localeRoutingEnabledCookieName}=;path=/`;\n\n if (locale === defaultLocale) {\n // A browser navigation follows the middleware redirect that removes\n // the default locale prefix. Next.js router.refresh() does not.\n reloadBrowserPage();\n } else {\n refreshServerComponents();\n }\n }\n }\n }, [\n pathname,\n locale,\n referrerLocaleCookieName,\n localeRoutingEnabledCookieName,\n reloadBrowserPage,\n refreshServerComponents,\n ]);\n}\n\nfunction resolvePathLocale(\n pathname: string,\n i18nConfig: I18nConfig,\n defaultLocale: string,\n locales: string[]\n): string {\n const extractedLocale = extractLocale(pathname);\n if (!extractedLocale) {\n return defaultLocale;\n }\n\n return (\n i18nConfig.determineLocale([extractedLocale], locales) ?? defaultLocale\n );\n}\n\nfunction extractLocale(pathname: string): string | null {\n return pathname.match(/^\\/([^/]+)(?:\\/|$)/)?.[1] ?? null;\n}\n"],"mappings":";;;;;;;;;;AA0BA,MAAM,YAAY,iBAAiB,QAAQ,IAAI,+BAA+B;;;;;;AAO9E,IAAI,OAAO,WAAW,YACpB,qBAAoB;;;;AAMtB,SAAgB,kBAAkB,EAChC,YACA,uBACA,GAAG,SAOF;CACD,MAAM,SAAS,WAAW;CAC1B,MAAM,0BAA0B,kBAAkB;AAEhD,MAAI,CAAC,uBAAuB;AAC1B,cAAW,SAAS,QAAQ;AAC5B;;AAMF,SAAO,SAAS;IACf,CAAC,QAAQ,sBAAsB,CAAC;CACnC,MAAM,oBAAoB,kBAAkB;AAC1C,aAAW,SAAS,QAAQ;IAC3B,EAAE,CAAC;CACN,MAAM,oBAAoB,aAGvB,EAAE,aAAa;EACd,MAAM,aAAa,eAAe;EAClC,MAAM,uBACJ,eACE,SAAS,QACT,sCACD,KAAK;EACR,MAAM,gBAAgB,WAAW,kBAAkB;EACnD,MAAM,UAAU,WAAW,YAAY;EACvC,MAAM,kBAAkB,WAAW,SAAS;AAI5C,MAFE,wBACA,qBAAqB,iBAAiB,UAAU,IACtB,WAAW;OACX,kBACxB,iBACA,YACA,eACA,QAEmB,KAAK,eAAe;AACvC,uBAAmB;AACnB;;;AAIJ,2BAAyB;IAE3B,CAAC,yBAAyB,kBAAkB,CAC7C;AACD,cAAa;EACX;EACA;EACA,QAAQ,WAAW;EACpB,CAAC;AACF,QACE,oBAAC,YAAD;EACE,GAAI;EACJ,GAAI;EACJ,mBAAmB;EACnB,SAAS;EACT,CAAA;;;;;;;AASN,SAAS,aAAa,EACpB,mBACA,yBACA,QACA,2BAA2B,iCAC3B,iCAAiC,yCAOhC;CACD,MAAM,WAAW,aAAa;AAE9B,iBAAgB;EAEd,MAAM,aAAa,eAAe;AAClC,WAAS,SAAS,GAAG,yBAAyB,GAAG,OAAO;EAGxD,MAAM,UAAU,WAAW,YAAY;EACvC,MAAM,gBAAgB,WAAW,kBAAkB;AAInD,MAFE,eAAe,SAAS,QAAQ,+BAA+B,KAC/D,UAC0B,qBAAqB,UAAU,UAAU,EAAE;GAErE,MAAM,oBAAoB,kBACxB,UACA,YACA,eACA,QACD;AAGD,OACE,qBACA,QAAQ,SAAS,kBAAkB,IACnC,sBAAsB,QACtB;AAEA,aAAS,SAAS,GAAG,+BAA+B;AAEpD,QAAI,WAAW,cAGb,oBAAmB;QAEnB,0BAAyB;;;IAI9B;EACD;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;;AAGJ,SAAS,kBACP,UACA,YACA,eACA,SACQ;CACR,MAAM,kBAAkB,cAAc,SAAS;AAC/C,KAAI,CAAC,gBACH,QAAO;AAGT,QACE,WAAW,gBAAgB,CAAC,gBAAgB,EAAE,QAAQ,IAAI;;AAI9D,SAAS,cAAc,UAAiC;AACtD,QAAO,SAAS,MAAM,qBAAqB,GAAG,MAAM"}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "gt-next",
3
- "version": "11.2.0",
3
+ "version": "11.3.0",
4
4
  "description": "A Next.js library for automatic internationalization.",
5
5
  "main": "dist/index.server.js",
6
6
  "peerDependencies": {
7
- "@generaltranslation/compiler": "^1.3.51",
7
+ "@generaltranslation/compiler": "^1.3.53",
8
8
  "next": ">=13.0.0 <15.2.1 || >15.2.2",
9
9
  "react": ">=16.8.0 <20.0.0",
10
10
  "react-dom": ">=16.8.0 <20.0.0"
@@ -28,11 +28,11 @@
28
28
  "./dist/utils/client-boundary.*"
29
29
  ],
30
30
  "dependencies": {
31
- "@generaltranslation/format": "0.1.8",
32
- "@generaltranslation/react-core": "11.2.0",
33
- "generaltranslation": "9.3.1",
34
- "gt-react": "11.2.0",
35
- "gt-i18n": "1.0.26"
31
+ "@generaltranslation/format": "0.1.9",
32
+ "@generaltranslation/react-core": "11.3.0",
33
+ "generaltranslation": "9.4.1",
34
+ "gt-react": "11.3.0",
35
+ "gt-i18n": "1.0.28"
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",
@@ -52,7 +52,7 @@
52
52
  "next": "15.2.3",
53
53
  "tsdown": "^0.21.10",
54
54
  "typescript": "^5.9.2",
55
- "@generaltranslation/compiler": "1.3.51"
55
+ "@generaltranslation/compiler": "1.3.53"
56
56
  },
57
57
  "exports": {
58
58
  ".": {