@generaltranslation/react-core 11.0.0-odysseus.13 → 11.0.0-odysseus.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @generaltranslation/react-core
2
2
 
3
+ ## 11.0.0-odysseus.14
4
+
5
+ ### Patch Changes
6
+
7
+ - 0cd7813: Store cookie names in I18nConfig so custom cookie names work before the condition store is initialized.
8
+ - `gt-i18n`: Removed the unused React locale cookie name from the shared GT config type.
9
+ - `@generaltranslation/react-core`: `ReactI18nConfig` now accepts `localeCookieName`, `regionCookieName`, and `enableI18nCookieName`, exposes getters that fall back to the default names, and exports the default storage names from the `pure` entrypoint.
10
+ - `gt-next`: Imports default cookie names from the React Core `pure` entrypoint instead of the removed React Core cookie constants subpath.
11
+ - `gt-react`: The browser condition store now resolves cookie names from `I18nConfig` instead of hardcoding the defaults, so custom cookie names passed to `initializeGT()` are honored for both reads and writes.
12
+ - `gt-react-native`: Native condition storage now resolves its store keys from `I18nConfig`, matching `gt-react` behavior.
13
+ - `gt-tanstack-start`: `parseLocale()` reads and writes the locale cookie using the configured cookie name instead of the default.
14
+
15
+ - Updated dependencies [ab61565]
16
+ - Updated dependencies [0cd7813]
17
+ - gt-i18n@1.0.0-odysseus.7
18
+
3
19
  ## 11.0.0-odysseus.13
4
20
 
5
21
  ### Patch Changes
@@ -168,6 +184,60 @@
168
184
 
169
185
  ### Patch Changes
170
186
 
187
+ - Updated dependencies [[`cc4edc1`](https://github.com/generaltranslation/gt/commit/cc4edc1e40d9977125bf6d053fb7f8cdbdd40b05)]:
188
+ - @generaltranslation/supported-locales@2.1.0
189
+ - gt-i18n@0.9.4
190
+
191
+ ## 1.8.25
192
+
193
+ ### Patch Changes
194
+
195
+ - [#1786](https://github.com/generaltranslation/gt/pull/1786) [`6945a98`](https://github.com/generaltranslation/gt/commit/6945a9871ea260dd999dcb2246c48b21134721f6) Thanks [@fernando-aviles](https://github.com/fernando-aviles)! - Add `requiresReview`
196
+
197
+ - Updated dependencies [[`6945a98`](https://github.com/generaltranslation/gt/commit/6945a9871ea260dd999dcb2246c48b21134721f6)]:
198
+ - generaltranslation@8.2.19
199
+ - gt-i18n@0.9.9
200
+ - @generaltranslation/supported-locales@2.1.5
201
+
202
+ ## 1.8.24
203
+
204
+ ### Patch Changes
205
+
206
+ - Updated dependencies [[`a2a3dd0`](https://github.com/generaltranslation/gt/commit/a2a3dd0bcdce9abe360c406a12fc6bb3bc3ca181)]:
207
+ - @generaltranslation/supported-locales@2.1.4
208
+ - gt-i18n@0.9.8
209
+
210
+ ## 1.8.23
211
+
212
+ ### Patch Changes
213
+
214
+ - Updated dependencies [[`9709a2f`](https://github.com/generaltranslation/gt/commit/9709a2f2b97b9d8239298e39bb31e57692bbffd8)]:
215
+ - generaltranslation@8.2.18
216
+ - gt-i18n@0.9.7
217
+ - @generaltranslation/supported-locales@2.1.3
218
+
219
+ ## 1.8.22
220
+
221
+ ### Patch Changes
222
+
223
+ - Updated dependencies [[`3197028`](https://github.com/generaltranslation/gt/commit/319702855a7b129f95217d41be9f2402680a2f01)]:
224
+ - generaltranslation@8.2.17
225
+ - gt-i18n@0.9.6
226
+ - @generaltranslation/supported-locales@2.1.2
227
+
228
+ ## 1.8.21
229
+
230
+ ### Patch Changes
231
+
232
+ - Updated dependencies [[`e041312`](https://github.com/generaltranslation/gt/commit/e04131263dd61e469db977bcc196dc1283e773d0)]:
233
+ - generaltranslation@8.2.16
234
+ - gt-i18n@0.9.5
235
+ - @generaltranslation/supported-locales@2.1.1
236
+
237
+ ## 1.8.20
238
+
239
+ ### Patch Changes
240
+
171
241
  - Updated dependencies [[`cc4edc1`](https://github.com/generaltranslation/gt/commit/cc4edc1e40d9977125bf6d053fb7f8cdbdd40b05)]:
172
242
  - @generaltranslation/supported-locales@2.1.0
173
243
  - gt-i18n@0.9.4
package/dist/pure.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);const e=require(`./utils/plurals/getPluralBranch.cjs`),t=require(`./utils/internal/addGTIdentifier.cjs`),n=require(`./utils/variables/getVariableName.cjs`),r=require(`./utils/internal/writeChildrenAsObjects.cjs`),i=require(`./utils/dictionaries/flattenDictionary.cjs`),a=require(`./utils/variables/_getVariableProps.cjs`),o=require(`./hooks/utils/getFormatLocales.cjs`),s=require(`./i18n-cache/singleton-operations.cjs`),c=require(`./functions/helpers/getTranslationsSnapshot.cjs`),l=require(`./setup/i18nConfig.cjs`),u=require(`./condition-store/singleton-operations.cjs`),d=require(`./functions/translation/t.cjs`),f=require(`./utils/rendering/createRenderPipeline.cjs`),p=require(`./utils/cookies.cjs`),m=require(`./utils/dictionaries/getDictionaryEntry.cjs`),h=require(`./utils/dictionaries/getEntryAndMetadata.cjs`),g=require(`./utils/dictionaries/isDictionaryEntry.cjs`),_=require(`./utils/dictionaries/mergeDictionaries.cjs`),v=require(`./utils/rendering/getDefaultRenderSettings.cjs`),y=require(`./i18n-cache/ReactI18nCache.cjs`),b=require(`./setup/initializeGTSRA.cjs`),x=require(`./i18n-store/singleton-operations.cjs`),S=require(`./i18n-store/I18nStore.cjs`);let C=require(`gt-i18n`),w=require(`gt-i18n/internal`);exports.I18nStore=S.I18nStore,exports.ReactI18nCache=y.ReactI18nCache,exports.ReactI18nConfig=l.ReactI18nConfig,Object.defineProperty(exports,`ReadonlyConditionStore`,{enumerable:!0,get:function(){return w.ReadonlyConditionStore}}),Object.defineProperty(exports,`WritableConditionStore`,{enumerable:!0,get:function(){return w.WritableConditionStore}}),exports.addGTIdentifier=t.addGTIdentifier,exports.createRenderPipeline=f.createRenderPipeline,Object.defineProperty(exports,`declareVar`,{enumerable:!0,get:function(){return C.declareVar}}),Object.defineProperty(exports,`decodeMsg`,{enumerable:!0,get:function(){return C.decodeMsg}}),Object.defineProperty(exports,`decodeOptions`,{enumerable:!0,get:function(){return C.decodeOptions}}),Object.defineProperty(exports,`decodeVars`,{enumerable:!0,get:function(){return C.decodeVars}}),exports.defaultEnableI18nCookieName=p.defaultEnableI18nCookieName,exports.defaultLocaleCookieName=p.defaultLocaleCookieName,exports.defaultRegionCookieName=p.defaultRegionCookieName,Object.defineProperty(exports,`derive`,{enumerable:!0,get:function(){return C.derive}}),exports.flattenDictionary=i.flattenDictionary,Object.defineProperty(exports,`getDefaultLocale`,{enumerable:!0,get:function(){return C.getDefaultLocale}}),exports.getDefaultRenderSettings=v.getDefaultRenderSettings,exports.getDictionaryEntry=m.getDictionaryEntry,exports.getEntryAndMetadata=h.getEntryAndMetadata,exports.getFormatLocales=o.getFormatLocales,Object.defineProperty(exports,`getGTClass`,{enumerable:!0,get:function(){return C.getGTClass}}),exports.getI18nConfig=l.getI18nConfig,exports.getI18nStore=x.getI18nStore,Object.defineProperty(exports,`getLocaleProperties`,{enumerable:!0,get:function(){return C.getLocaleProperties}}),Object.defineProperty(exports,`getLocales`,{enumerable:!0,get:function(){return C.getLocales}}),exports.getPluralBranch=e.getPluralBranch,exports.getReactI18nCache=s.getReactI18nCache,exports.getReadonlyConditionStoreWithFallback=u.getReadonlyConditionStoreWithFallback,exports.getTranslationsSnapshot=c.getTranslationsSnapshot,exports.getVariableName=n.getVariableName,exports.getVariableProps=a.getVariableProps,Object.defineProperty(exports,`getVersionId`,{enumerable:!0,get:function(){return C.getVersionId}}),Object.defineProperty(exports,`gtFallback`,{enumerable:!0,get:function(){return C.gtFallback}}),exports.initializeGT=b.internalInitializeGTSRA,exports.initializeI18nConfig=l.initializeI18nConfig,exports.internalInitializeGTSRA=b.internalInitializeGTSRA,exports.isDictionaryEntry=g.isDictionaryEntry,exports.isI18nStoreInitialized=x.isI18nStoreInitialized,exports.isValidDictionaryEntry=m.isValidDictionaryEntry,Object.defineProperty(exports,`mFallback`,{enumerable:!0,get:function(){return C.mFallback}}),exports.mergeDictionaries=_.mergeDictionaries,Object.defineProperty(exports,`msg`,{enumerable:!0,get:function(){return C.msg}}),exports.setI18nConfig=l.setI18nConfig,exports.setI18nStore=x.setI18nStore,exports.setReactI18nCache=s.setReactI18nCache,exports.setReadonlyConditionStore=u.setConditionStore,exports.t=d.t,exports.writeChildrenAsObjects=r.writeChildrenAsObjects;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);const e=require(`./utils/plurals/getPluralBranch.cjs`),t=require(`./utils/internal/addGTIdentifier.cjs`),n=require(`./utils/variables/getVariableName.cjs`),r=require(`./utils/internal/writeChildrenAsObjects.cjs`),i=require(`./utils/dictionaries/flattenDictionary.cjs`),a=require(`./utils/variables/_getVariableProps.cjs`),o=require(`./hooks/utils/getFormatLocales.cjs`),s=require(`./i18n-cache/singleton-operations.cjs`),c=require(`./functions/helpers/getTranslationsSnapshot.cjs`),l=require(`./setup/i18nConfig.cjs`),u=require(`./condition-store/singleton-operations.cjs`),d=require(`./functions/translation/t.cjs`),f=require(`./utils/rendering/createRenderPipeline.cjs`),p=require(`./utils/dictionaries/getDictionaryEntry.cjs`),m=require(`./utils/dictionaries/getEntryAndMetadata.cjs`),h=require(`./utils/dictionaries/isDictionaryEntry.cjs`),g=require(`./utils/dictionaries/mergeDictionaries.cjs`),_=require(`./utils/rendering/getDefaultRenderSettings.cjs`),v=require(`./i18n-cache/ReactI18nCache.cjs`),y=require(`./setup/initializeGTSRA.cjs`),b=require(`./i18n-store/singleton-operations.cjs`),x=require(`./i18n-store/I18nStore.cjs`);let S=require(`gt-i18n`),C=require(`gt-i18n/internal`);exports.I18nStore=x.I18nStore,exports.ReactI18nCache=v.ReactI18nCache,exports.ReactI18nConfig=l.ReactI18nConfig,Object.defineProperty(exports,`ReadonlyConditionStore`,{enumerable:!0,get:function(){return C.ReadonlyConditionStore}}),Object.defineProperty(exports,`WritableConditionStore`,{enumerable:!0,get:function(){return C.WritableConditionStore}}),exports.addGTIdentifier=t.addGTIdentifier,exports.createRenderPipeline=f.createRenderPipeline,Object.defineProperty(exports,`declareVar`,{enumerable:!0,get:function(){return S.declareVar}}),Object.defineProperty(exports,`decodeMsg`,{enumerable:!0,get:function(){return S.decodeMsg}}),Object.defineProperty(exports,`decodeOptions`,{enumerable:!0,get:function(){return S.decodeOptions}}),Object.defineProperty(exports,`decodeVars`,{enumerable:!0,get:function(){return S.decodeVars}}),exports.defaultEnableI18nCookieName=l.defaultEnableI18nCookieName,exports.defaultLocaleCookieName=l.defaultLocaleCookieName,exports.defaultRegionCookieName=l.defaultRegionCookieName,exports.defaultResetLocaleCookieName=l.defaultResetLocaleCookieName,Object.defineProperty(exports,`derive`,{enumerable:!0,get:function(){return S.derive}}),exports.flattenDictionary=i.flattenDictionary,Object.defineProperty(exports,`getDefaultLocale`,{enumerable:!0,get:function(){return S.getDefaultLocale}}),exports.getDefaultRenderSettings=_.getDefaultRenderSettings,exports.getDictionaryEntry=p.getDictionaryEntry,exports.getEntryAndMetadata=m.getEntryAndMetadata,exports.getFormatLocales=o.getFormatLocales,Object.defineProperty(exports,`getGTClass`,{enumerable:!0,get:function(){return S.getGTClass}}),exports.getI18nConfig=l.getI18nConfig,exports.getI18nStore=b.getI18nStore,Object.defineProperty(exports,`getLocaleProperties`,{enumerable:!0,get:function(){return S.getLocaleProperties}}),Object.defineProperty(exports,`getLocales`,{enumerable:!0,get:function(){return S.getLocales}}),exports.getPluralBranch=e.getPluralBranch,exports.getReactI18nCache=s.getReactI18nCache,exports.getReadonlyConditionStoreWithFallback=u.getReadonlyConditionStoreWithFallback,exports.getTranslationsSnapshot=c.getTranslationsSnapshot,exports.getVariableName=n.getVariableName,exports.getVariableProps=a.getVariableProps,Object.defineProperty(exports,`getVersionId`,{enumerable:!0,get:function(){return S.getVersionId}}),Object.defineProperty(exports,`gtFallback`,{enumerable:!0,get:function(){return S.gtFallback}}),exports.initializeGT=y.internalInitializeGTSRA,exports.initializeI18nConfig=l.initializeI18nConfig,exports.internalInitializeGTSRA=y.internalInitializeGTSRA,exports.isDictionaryEntry=h.isDictionaryEntry,exports.isI18nStoreInitialized=b.isI18nStoreInitialized,exports.isValidDictionaryEntry=p.isValidDictionaryEntry,Object.defineProperty(exports,`mFallback`,{enumerable:!0,get:function(){return S.mFallback}}),exports.mergeDictionaries=g.mergeDictionaries,Object.defineProperty(exports,`msg`,{enumerable:!0,get:function(){return S.msg}}),exports.setI18nConfig=l.setI18nConfig,exports.setI18nStore=b.setI18nStore,exports.setReactI18nCache=s.setReactI18nCache,exports.setReadonlyConditionStore=u.setConditionStore,exports.t=d.t,exports.writeChildrenAsObjects=r.writeChildrenAsObjects;
package/dist/pure.d.ts CHANGED
@@ -12,7 +12,7 @@ import { getFormatLocales } from "./hooks/utils/getFormatLocales.js";
12
12
  import { RenderPipeline, createRenderPipeline } from "./utils/rendering/createRenderPipeline.js";
13
13
  import { ReactI18nCache, ReactI18nCacheParams } from "./i18n-cache/ReactI18nCache.js";
14
14
  import { getReactI18nCache, setReactI18nCache } from "./i18n-cache/singleton-operations.js";
15
- import { defaultEnableI18nCookieName, defaultLocaleCookieName, defaultRegionCookieName } from "./utils/cookies.js";
15
+ import { ReactI18nConfig, ReactI18nConfigParams, defaultEnableI18nCookieName, defaultLocaleCookieName, defaultRegionCookieName, defaultResetLocaleCookieName, getI18nConfig, initializeI18nConfig, setI18nConfig } from "./setup/i18nConfig.js";
16
16
  import { getDictionaryEntry, isValidDictionaryEntry } from "./utils/dictionaries/getDictionaryEntry.js";
17
17
  import { getEntryAndMetadata } from "./utils/dictionaries/getEntryAndMetadata.js";
18
18
  import { mergeDictionaries } from "./utils/dictionaries/mergeDictionaries.js";
@@ -22,10 +22,9 @@ import { internalInitializeGTSRA } from "./setup/initializeGTSRA.js";
22
22
  import { DictionaryLookup, TranslateLookup } from "./i18n-store/storeTypes.js";
23
23
  import { I18nStore } from "./i18n-store/I18nStore.js";
24
24
  import { getI18nStore, isI18nStoreInitialized, setI18nStore } from "./i18n-store/singleton-operations.js";
25
- import { ReactI18nConfig, getI18nConfig, initializeI18nConfig, setI18nConfig } from "./setup/i18nConfig.js";
26
25
  import { getReadonlyConditionStoreWithFallback, setConditionStore } from "./condition-store/singleton-operations.js";
27
26
  import { OnMissingDictionaryEntry, OnMissingDictionaryObj, OnMissingTranslation } from "./hooks/utils/missing-translation.js";
28
- import { I18nConfigParams, WritableConditionStoreParams } from "gt-i18n/internal/types";
27
+ import { WritableConditionStoreParams } from "gt-i18n/internal/types";
29
28
  import { declareVar, decodeMsg, decodeOptions, decodeVars, derive, getDefaultLocale, getGTClass, getLocaleProperties, getLocales, getVersionId, gtFallback, mFallback, msg } from "gt-i18n";
30
29
  import { ReadonlyConditionStore, WritableConditionStore } from "gt-i18n/internal";
31
- export { type CustomLoader, type Dictionary, type DictionaryContent, type DictionaryEntry, type DictionaryLookup, type DictionaryObject, type Entry, type FlattenedDictionary, type GTFunctionType, type GTProp, type GTTranslationOptions, type I18nConfigParams, I18nStore, type LocalesDictionary, type MFunctionType, type Metadata, type OnMissingDictionaryEntry, type OnMissingDictionaryObj, type OnMissingTranslation, ReactI18nCache, type ReactI18nCacheParams, ReactI18nConfig, ReadonlyConditionStore, type RelativeTimeFormatOptions, type RenderMethod, type RenderPipeline, type RenderPreparedT, type RenderVariable, type RuntimeTranslationOptions, type TranslateLookup, type TranslatedChildren, type Translations, type VariableProps, WritableConditionStore, type WritableConditionStoreParams, type _Message, type _Messages, addGTIdentifier, createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars, defaultEnableI18nCookieName, defaultLocaleCookieName, defaultRegionCookieName, derive, flattenDictionary, getDefaultLocale, getDefaultRenderSettings, getDictionaryEntry, getEntryAndMetadata, getFormatLocales, getGTClass, getI18nConfig, getI18nStore, getLocaleProperties, getLocales, getPluralBranch, getReactI18nCache, getReadonlyConditionStoreWithFallback, getTranslationsSnapshot, getVariableName, getVariableProps, getVersionId, gtFallback, internalInitializeGTSRA as initializeGT, initializeI18nConfig, internalInitializeGTSRA, isDictionaryEntry, isI18nStoreInitialized, isValidDictionaryEntry, mFallback, mergeDictionaries, msg, setI18nConfig, setI18nStore, setReactI18nCache, setConditionStore as setReadonlyConditionStore, t, writeChildrenAsObjects };
30
+ export { type CustomLoader, type Dictionary, type DictionaryContent, type DictionaryEntry, type DictionaryLookup, type DictionaryObject, type Entry, type FlattenedDictionary, type GTFunctionType, type GTProp, type GTTranslationOptions, type ReactI18nConfigParams as I18nConfigParams, I18nStore, type LocalesDictionary, type MFunctionType, type Metadata, type OnMissingDictionaryEntry, type OnMissingDictionaryObj, type OnMissingTranslation, ReactI18nCache, type ReactI18nCacheParams, ReactI18nConfig, ReadonlyConditionStore, type RelativeTimeFormatOptions, type RenderMethod, type RenderPipeline, type RenderPreparedT, type RenderVariable, type RuntimeTranslationOptions, type TranslateLookup, type TranslatedChildren, type Translations, type VariableProps, WritableConditionStore, type WritableConditionStoreParams, type _Message, type _Messages, addGTIdentifier, createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars, defaultEnableI18nCookieName, defaultLocaleCookieName, defaultRegionCookieName, defaultResetLocaleCookieName, derive, flattenDictionary, getDefaultLocale, getDefaultRenderSettings, getDictionaryEntry, getEntryAndMetadata, getFormatLocales, getGTClass, getI18nConfig, getI18nStore, getLocaleProperties, getLocales, getPluralBranch, getReactI18nCache, getReadonlyConditionStoreWithFallback, getTranslationsSnapshot, getVariableName, getVariableProps, getVersionId, gtFallback, internalInitializeGTSRA as initializeGT, initializeI18nConfig, internalInitializeGTSRA, isDictionaryEntry, isI18nStoreInitialized, isValidDictionaryEntry, mFallback, mergeDictionaries, msg, setI18nConfig, setI18nStore, setReactI18nCache, setConditionStore as setReadonlyConditionStore, t, writeChildrenAsObjects };
package/dist/pure.mjs CHANGED
@@ -1 +1 @@
1
- import{getPluralBranch as e}from"./utils/plurals/getPluralBranch.mjs";import{addGTIdentifier as t}from"./utils/internal/addGTIdentifier.mjs";import{getVariableName as n}from"./utils/variables/getVariableName.mjs";import{writeChildrenAsObjects as r}from"./utils/internal/writeChildrenAsObjects.mjs";import{flattenDictionary as i}from"./utils/dictionaries/flattenDictionary.mjs";import{getVariableProps as a}from"./utils/variables/_getVariableProps.mjs";import{getFormatLocales as o}from"./hooks/utils/getFormatLocales.mjs";import{getReactI18nCache as s,setReactI18nCache as c}from"./i18n-cache/singleton-operations.mjs";import{getTranslationsSnapshot as l}from"./functions/helpers/getTranslationsSnapshot.mjs";import{ReactI18nConfig as u,getI18nConfig as d,initializeI18nConfig as f,setI18nConfig as p}from"./setup/i18nConfig.mjs";import{getReadonlyConditionStoreWithFallback as m,setConditionStore as h}from"./condition-store/singleton-operations.mjs";import{t as g}from"./functions/translation/t.mjs";import{createRenderPipeline as _}from"./utils/rendering/createRenderPipeline.mjs";import{defaultEnableI18nCookieName as v,defaultLocaleCookieName as y,defaultRegionCookieName as b}from"./utils/cookies.mjs";import{getDictionaryEntry as x,isValidDictionaryEntry as S}from"./utils/dictionaries/getDictionaryEntry.mjs";import{getEntryAndMetadata as C}from"./utils/dictionaries/getEntryAndMetadata.mjs";import{isDictionaryEntry as w}from"./utils/dictionaries/isDictionaryEntry.mjs";import{mergeDictionaries as T}from"./utils/dictionaries/mergeDictionaries.mjs";import{getDefaultRenderSettings as E}from"./utils/rendering/getDefaultRenderSettings.mjs";import{ReactI18nCache as D}from"./i18n-cache/ReactI18nCache.mjs";import{internalInitializeGTSRA as O}from"./setup/initializeGTSRA.mjs";import{getI18nStore as k,isI18nStoreInitialized as A,setI18nStore as j}from"./i18n-store/singleton-operations.mjs";import{I18nStore as M}from"./i18n-store/I18nStore.mjs";import{declareVar as N,decodeMsg as P,decodeOptions as F,decodeVars as I,derive as L,getDefaultLocale as R,getGTClass as z,getLocaleProperties as B,getLocales as V,getVersionId as H,gtFallback as U,mFallback as W,msg as G}from"gt-i18n";import{ReadonlyConditionStore as K,WritableConditionStore as q}from"gt-i18n/internal";export{M as I18nStore,D as ReactI18nCache,u as ReactI18nConfig,K as ReadonlyConditionStore,q as WritableConditionStore,t as addGTIdentifier,_ as createRenderPipeline,N as declareVar,P as decodeMsg,F as decodeOptions,I as decodeVars,v as defaultEnableI18nCookieName,y as defaultLocaleCookieName,b as defaultRegionCookieName,L as derive,i as flattenDictionary,R as getDefaultLocale,E as getDefaultRenderSettings,x as getDictionaryEntry,C as getEntryAndMetadata,o as getFormatLocales,z as getGTClass,d as getI18nConfig,k as getI18nStore,B as getLocaleProperties,V as getLocales,e as getPluralBranch,s as getReactI18nCache,m as getReadonlyConditionStoreWithFallback,l as getTranslationsSnapshot,n as getVariableName,a as getVariableProps,H as getVersionId,U as gtFallback,O as initializeGT,f as initializeI18nConfig,O as internalInitializeGTSRA,w as isDictionaryEntry,A as isI18nStoreInitialized,S as isValidDictionaryEntry,W as mFallback,T as mergeDictionaries,G as msg,p as setI18nConfig,j as setI18nStore,c as setReactI18nCache,h as setReadonlyConditionStore,g as t,r as writeChildrenAsObjects};
1
+ import{getPluralBranch as e}from"./utils/plurals/getPluralBranch.mjs";import{addGTIdentifier as t}from"./utils/internal/addGTIdentifier.mjs";import{getVariableName as n}from"./utils/variables/getVariableName.mjs";import{writeChildrenAsObjects as r}from"./utils/internal/writeChildrenAsObjects.mjs";import{flattenDictionary as i}from"./utils/dictionaries/flattenDictionary.mjs";import{getVariableProps as a}from"./utils/variables/_getVariableProps.mjs";import{getFormatLocales as o}from"./hooks/utils/getFormatLocales.mjs";import{getReactI18nCache as s,setReactI18nCache as c}from"./i18n-cache/singleton-operations.mjs";import{getTranslationsSnapshot as l}from"./functions/helpers/getTranslationsSnapshot.mjs";import{ReactI18nConfig as u,defaultEnableI18nCookieName as d,defaultLocaleCookieName as f,defaultRegionCookieName as p,defaultResetLocaleCookieName as m,getI18nConfig as h,initializeI18nConfig as g,setI18nConfig as _}from"./setup/i18nConfig.mjs";import{getReadonlyConditionStoreWithFallback as v,setConditionStore as y}from"./condition-store/singleton-operations.mjs";import{t as b}from"./functions/translation/t.mjs";import{createRenderPipeline as x}from"./utils/rendering/createRenderPipeline.mjs";import{getDictionaryEntry as S,isValidDictionaryEntry as C}from"./utils/dictionaries/getDictionaryEntry.mjs";import{getEntryAndMetadata as w}from"./utils/dictionaries/getEntryAndMetadata.mjs";import{isDictionaryEntry as T}from"./utils/dictionaries/isDictionaryEntry.mjs";import{mergeDictionaries as E}from"./utils/dictionaries/mergeDictionaries.mjs";import{getDefaultRenderSettings as D}from"./utils/rendering/getDefaultRenderSettings.mjs";import{ReactI18nCache as O}from"./i18n-cache/ReactI18nCache.mjs";import{internalInitializeGTSRA as k}from"./setup/initializeGTSRA.mjs";import{getI18nStore as A,isI18nStoreInitialized as j,setI18nStore as M}from"./i18n-store/singleton-operations.mjs";import{I18nStore as N}from"./i18n-store/I18nStore.mjs";import{declareVar as P,decodeMsg as F,decodeOptions as I,decodeVars as L,derive as R,getDefaultLocale as z,getGTClass as B,getLocaleProperties as V,getLocales as H,getVersionId as U,gtFallback as W,mFallback as G,msg as K}from"gt-i18n";import{ReadonlyConditionStore as q,WritableConditionStore as J}from"gt-i18n/internal";export{N as I18nStore,O as ReactI18nCache,u as ReactI18nConfig,q as ReadonlyConditionStore,J as WritableConditionStore,t as addGTIdentifier,x as createRenderPipeline,P as declareVar,F as decodeMsg,I as decodeOptions,L as decodeVars,d as defaultEnableI18nCookieName,f as defaultLocaleCookieName,p as defaultRegionCookieName,m as defaultResetLocaleCookieName,R as derive,i as flattenDictionary,z as getDefaultLocale,D as getDefaultRenderSettings,S as getDictionaryEntry,w as getEntryAndMetadata,o as getFormatLocales,B as getGTClass,h as getI18nConfig,A as getI18nStore,V as getLocaleProperties,H as getLocales,e as getPluralBranch,s as getReactI18nCache,v as getReadonlyConditionStoreWithFallback,l as getTranslationsSnapshot,n as getVariableName,a as getVariableProps,U as getVersionId,W as gtFallback,k as initializeGT,g as initializeI18nConfig,k as internalInitializeGTSRA,T as isDictionaryEntry,j as isI18nStoreInitialized,C as isValidDictionaryEntry,G as mFallback,E as mergeDictionaries,K as msg,_ as setI18nConfig,M as setI18nStore,c as setReactI18nCache,y as setReadonlyConditionStore,b as t,r as writeChildrenAsObjects};
@@ -1,2 +1,2 @@
1
- require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`generaltranslation/internal`),t=require(`gt-i18n/internal`);const n=`server-render`,r=Symbol.for(`generaltranslation.react-core.ReactI18nConfig`);var i=class extends t.I18nConfig{renderStrategy;constructor(e={},t=n){super(e),c(t),Object.defineProperty(this,r,{value:!0}),this.renderStrategy=t}getRenderStrategy(){return this.renderStrategy}};function a(){let n=(0,t.getI18nConfig)();if(l(n))return n;throw Error((0,e.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot read ReactI18nConfig after base I18nConfig setup.`,why:`the internal I18nConfig singleton was initialized without react-core render strategy support`,fix:`Initialize GT through gt-react or @generaltranslation/react-core/pure.`}))}function o(e){(0,t.setI18nConfig)(e)}function s(e={},t=n){let r=new i(e,t);return o(r),r}function c(t){if(!(t===`SPA`||t===`server-render`))throw Error((0,e.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Invalid React render strategy.`,why:`the render strategy must be "SPA" or "server-render", but received "${String(t)}"`,fix:`Initialize GT through gt-react or pass a valid render strategy.`}))}function l(e){if(e instanceof i)return!0;let t=e;return t[r]===!0&&typeof t.getRenderStrategy==`function`}exports.ReactI18nConfig=i,exports.getI18nConfig=a,exports.initializeI18nConfig=s,exports.setI18nConfig=o;
1
+ require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`generaltranslation/internal`),t=require(`gt-i18n/internal`);const n=`server-render`,r=Symbol.for(`generaltranslation.react-core.ReactI18nConfig`);var i=class extends t.I18nConfig{renderStrategy;localeCookieName;regionCookieName;enableI18nCookieName;constructor(e={},t=n){super(e),c(t),Object.defineProperty(this,r,{value:!0}),this.renderStrategy=t,this.localeCookieName=e.localeCookieName??`generaltranslation.locale`,this.regionCookieName=e.regionCookieName??`generaltranslation.region`,this.enableI18nCookieName=e.enableI18nCookieName??`generaltranslation.enable-i18n`}getRenderStrategy(){return this.renderStrategy}getLocaleCookieName(){return this.localeCookieName}getRegionCookieName(){return this.regionCookieName}getEnableI18nCookieName(){return this.enableI18nCookieName}};function a(){let n=(0,t.getI18nConfig)();if(l(n))return n;throw Error((0,e.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot read ReactI18nConfig after base I18nConfig setup.`,why:`the internal I18nConfig singleton was initialized without react-core render strategy support`,fix:`Initialize GT through gt-react or @generaltranslation/react-core/pure.`}))}function o(e){(0,t.setI18nConfig)(e)}function s(e={},t=n){let r=new i(e,t);return o(r),r}function c(t){if(!(t===`SPA`||t===`server-render`))throw Error((0,e.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Invalid React render strategy.`,why:`the render strategy must be "SPA" or "server-render", but received "${String(t)}"`,fix:`Initialize GT through gt-react or pass a valid render strategy.`}))}function l(e){if(e instanceof i)return!0;let t=e;return t[r]===!0&&typeof t.getRenderStrategy==`function`&&typeof t.getLocaleCookieName==`function`&&typeof t.getRegionCookieName==`function`&&typeof t.getEnableI18nCookieName==`function`}exports.ReactI18nConfig=i,exports.defaultEnableI18nCookieName=`generaltranslation.enable-i18n`,exports.defaultLocaleCookieName=`generaltranslation.locale`,exports.defaultRegionCookieName=`generaltranslation.region`,exports.defaultResetLocaleCookieName=`generaltranslation.locale-reset`,exports.getI18nConfig=a,exports.initializeI18nConfig=s,exports.setI18nConfig=o;
2
2
  //# sourceMappingURL=i18nConfig.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"i18nConfig.cjs","names":["I18nConfig"],"sources":["../../src/setup/i18nConfig.ts"],"sourcesContent":["import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport {\n getI18nConfig as getBaseI18nConfig,\n I18nConfig,\n setI18nConfig as setBaseI18nConfig,\n} from 'gt-i18n/internal';\nimport type { I18nConfigParams } from 'gt-i18n/internal/types';\n\n/**\n * Helps us distinguish behavior for SPA vs server-rendered apps.\n * - server-rendered apps must use context\n * - SPA apps can synchronously access the locale\n */\nexport type RenderStrategy = 'SPA' | 'server-render';\n\nconst defaultRenderStrategy: RenderStrategy = 'server-render';\nconst reactI18nConfigBrand = Symbol.for(\n 'generaltranslation.react-core.ReactI18nConfig'\n);\n\nexport class ReactI18nConfig extends I18nConfig {\n private renderStrategy: RenderStrategy;\n\n constructor(\n params: I18nConfigParams = {},\n renderStrategy: RenderStrategy = defaultRenderStrategy\n ) {\n super(params);\n validateRenderStrategy(renderStrategy);\n Object.defineProperty(this, reactI18nConfigBrand, { value: true });\n this.renderStrategy = renderStrategy;\n }\n\n getRenderStrategy(): RenderStrategy {\n return this.renderStrategy;\n }\n}\n\nexport function getI18nConfig(): ReactI18nConfig {\n const i18nConfig = getBaseI18nConfig();\n if (isReactI18nConfig(i18nConfig)) {\n return i18nConfig;\n }\n throw new Error(\n createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot read ReactI18nConfig after base I18nConfig setup.',\n why: 'the internal I18nConfig singleton was initialized without react-core render strategy support',\n fix: 'Initialize GT through gt-react or @generaltranslation/react-core/pure.',\n })\n );\n}\n\nexport function setI18nConfig(nextI18nConfig: ReactI18nConfig): void {\n setBaseI18nConfig(nextI18nConfig);\n}\n\nexport function initializeI18nConfig(\n params: I18nConfigParams = {},\n renderStrategy: RenderStrategy = defaultRenderStrategy\n): ReactI18nConfig {\n const nextI18nConfig = new ReactI18nConfig(params, renderStrategy);\n setI18nConfig(nextI18nConfig);\n return nextI18nConfig;\n}\n\nfunction validateRenderStrategy(\n renderStrategy: RenderStrategy\n): asserts renderStrategy is RenderStrategy {\n if (renderStrategy === 'SPA' || renderStrategy === 'server-render') return;\n throw new Error(\n createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Invalid React render strategy.',\n why: `the render strategy must be \"SPA\" or \"server-render\", but received \"${String(renderStrategy)}\"`,\n fix: 'Initialize GT through gt-react or pass a valid render strategy.',\n })\n );\n}\n\nfunction isReactI18nConfig(\n i18nConfig: I18nConfig\n): i18nConfig is ReactI18nConfig {\n if (i18nConfig instanceof ReactI18nConfig) return true;\n\n const maybeReactI18nConfig = i18nConfig as I18nConfig &\n Record<PropertyKey, unknown>;\n return (\n maybeReactI18nConfig[reactI18nConfigBrand] === true &&\n typeof maybeReactI18nConfig.getRenderStrategy === 'function'\n );\n}\n"],"mappings":"wHAeA,MAAM,EAAwC,gBACxC,EAAuB,OAAO,IAClC,gDACD,CAED,IAAa,EAAb,cAAqCA,EAAAA,UAAW,CAC9C,eAEA,YACE,EAA2B,EAAE,CAC7B,EAAiC,EACjC,CACA,MAAM,EAAO,CACb,EAAuB,EAAe,CACtC,OAAO,eAAe,KAAM,EAAsB,CAAE,MAAO,GAAM,CAAC,CAClE,KAAK,eAAiB,EAGxB,mBAAoC,CAClC,OAAO,KAAK,iBAIhB,SAAgB,GAAiC,CAC/C,IAAM,GAAA,EAAA,EAAA,gBAAgC,CACtC,GAAI,EAAkB,EAAW,CAC/B,OAAO,EAET,MAAU,OAAA,EAAA,EAAA,yBACgB,CACtB,OAAQ,iCACR,SAAU,QACV,aAAc,2DACd,IAAK,+FACL,IAAK,yEACN,CAAC,CACH,CAGH,SAAgB,EAAc,EAAuC,EACnE,EAAA,EAAA,eAAkB,EAAe,CAGnC,SAAgB,EACd,EAA2B,EAAE,CAC7B,EAAiC,EAChB,CACjB,IAAM,EAAiB,IAAI,EAAgB,EAAQ,EAAe,CAElE,OADA,EAAc,EAAe,CACtB,EAGT,SAAS,EACP,EAC0C,CACtC,SAAmB,OAAS,IAAmB,iBACnD,MAAU,OAAA,EAAA,EAAA,yBACgB,CACtB,OAAQ,iCACR,SAAU,QACV,aAAc,iCACd,IAAK,uEAAuE,OAAO,EAAe,CAAC,GACnG,IAAK,kEACN,CAAC,CACH,CAGH,SAAS,EACP,EAC+B,CAC/B,GAAI,aAAsB,EAAiB,MAAO,GAElD,IAAM,EAAuB,EAE7B,OACE,EAAqB,KAA0B,IAC/C,OAAO,EAAqB,mBAAsB"}
1
+ {"version":3,"file":"i18nConfig.cjs","names":["I18nConfig"],"sources":["../../src/setup/i18nConfig.ts"],"sourcesContent":["import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport {\n getI18nConfig as getBaseI18nConfig,\n I18nConfig,\n setI18nConfig as setBaseI18nConfig,\n} from 'gt-i18n/internal';\nimport type { I18nConfigParams as BaseI18nConfigParams } from 'gt-i18n/internal/types';\n\n/**\n * Cookie name for tracking the user's selected locale.\n */\nexport const defaultLocaleCookieName = 'generaltranslation.locale';\n\n/**\n * Cookie name for tracking the user's selected region.\n */\nexport const defaultRegionCookieName = 'generaltranslation.region';\n\n/**\n * Cookie name for persisting the enableI18n feature flag.\n */\nexport const defaultEnableI18nCookieName = 'generaltranslation.enable-i18n';\n\n/**\n * Cookie name for tracking the locale reset.\n */\nexport const defaultResetLocaleCookieName = 'generaltranslation.locale-reset';\n\n/**\n * Helps us distinguish behavior for SPA vs server-rendered apps.\n * - server-rendered apps must use context\n * - SPA apps can synchronously access the locale\n */\nexport type RenderStrategy = 'SPA' | 'server-render';\n\ntype CookieNameConfig = {\n localeCookieName?: string;\n regionCookieName?: string;\n enableI18nCookieName?: string;\n};\n\nexport type ReactI18nConfigParams = BaseI18nConfigParams & CookieNameConfig;\n\nconst defaultRenderStrategy: RenderStrategy = 'server-render';\nconst reactI18nConfigBrand = Symbol.for(\n 'generaltranslation.react-core.ReactI18nConfig'\n);\n\nexport class ReactI18nConfig extends I18nConfig {\n private renderStrategy: RenderStrategy;\n private localeCookieName: string;\n private regionCookieName: string;\n private enableI18nCookieName: string;\n\n constructor(\n params: ReactI18nConfigParams = {},\n renderStrategy: RenderStrategy = defaultRenderStrategy\n ) {\n super(params);\n validateRenderStrategy(renderStrategy);\n Object.defineProperty(this, reactI18nConfigBrand, { value: true });\n this.renderStrategy = renderStrategy;\n this.localeCookieName = params.localeCookieName ?? defaultLocaleCookieName;\n this.regionCookieName = params.regionCookieName ?? defaultRegionCookieName;\n this.enableI18nCookieName =\n params.enableI18nCookieName ?? defaultEnableI18nCookieName;\n }\n\n getRenderStrategy(): RenderStrategy {\n return this.renderStrategy;\n }\n\n getLocaleCookieName(): string {\n return this.localeCookieName;\n }\n\n getRegionCookieName(): string {\n return this.regionCookieName;\n }\n\n getEnableI18nCookieName(): string {\n return this.enableI18nCookieName;\n }\n}\n\nexport function getI18nConfig(): ReactI18nConfig {\n const i18nConfig = getBaseI18nConfig();\n if (isReactI18nConfig(i18nConfig)) {\n return i18nConfig;\n }\n throw new Error(\n createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot read ReactI18nConfig after base I18nConfig setup.',\n why: 'the internal I18nConfig singleton was initialized without react-core render strategy support',\n fix: 'Initialize GT through gt-react or @generaltranslation/react-core/pure.',\n })\n );\n}\n\nexport function setI18nConfig(nextI18nConfig: ReactI18nConfig): void {\n setBaseI18nConfig(nextI18nConfig);\n}\n\nexport function initializeI18nConfig(\n params: ReactI18nConfigParams = {},\n renderStrategy: RenderStrategy = defaultRenderStrategy\n): ReactI18nConfig {\n const nextI18nConfig = new ReactI18nConfig(params, renderStrategy);\n setI18nConfig(nextI18nConfig);\n return nextI18nConfig;\n}\n\nfunction validateRenderStrategy(\n renderStrategy: RenderStrategy\n): asserts renderStrategy is RenderStrategy {\n if (renderStrategy === 'SPA' || renderStrategy === 'server-render') return;\n throw new Error(\n createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Invalid React render strategy.',\n why: `the render strategy must be \"SPA\" or \"server-render\", but received \"${String(renderStrategy)}\"`,\n fix: 'Initialize GT through gt-react or pass a valid render strategy.',\n })\n );\n}\n\nfunction isReactI18nConfig(\n i18nConfig: I18nConfig\n): i18nConfig is ReactI18nConfig {\n if (i18nConfig instanceof ReactI18nConfig) return true;\n\n const maybeReactI18nConfig = i18nConfig as I18nConfig &\n Record<PropertyKey, unknown>;\n return (\n maybeReactI18nConfig[reactI18nConfigBrand] === true &&\n typeof maybeReactI18nConfig.getRenderStrategy === 'function' &&\n typeof maybeReactI18nConfig.getLocaleCookieName === 'function' &&\n typeof maybeReactI18nConfig.getRegionCookieName === 'function' &&\n typeof maybeReactI18nConfig.getEnableI18nCookieName === 'function'\n );\n}\n"],"mappings":"wHAWA,MAgCM,EAAwC,gBACxC,EAAuB,OAAO,IAClC,gDACD,CAED,IAAa,EAAb,cAAqCA,EAAAA,UAAW,CAC9C,eACA,iBACA,iBACA,qBAEA,YACE,EAAgC,EAAE,CAClC,EAAiC,EACjC,CACA,MAAM,EAAO,CACb,EAAuB,EAAe,CACtC,OAAO,eAAe,KAAM,EAAsB,CAAE,MAAO,GAAM,CAAC,CAClE,KAAK,eAAiB,EACtB,KAAK,iBAAmB,EAAO,kBAAA,4BAC/B,KAAK,iBAAmB,EAAO,kBAAA,4BAC/B,KAAK,qBACH,EAAO,sBAAA,iCAGX,mBAAoC,CAClC,OAAO,KAAK,eAGd,qBAA8B,CAC5B,OAAO,KAAK,iBAGd,qBAA8B,CAC5B,OAAO,KAAK,iBAGd,yBAAkC,CAChC,OAAO,KAAK,uBAIhB,SAAgB,GAAiC,CAC/C,IAAM,GAAA,EAAA,EAAA,gBAAgC,CACtC,GAAI,EAAkB,EAAW,CAC/B,OAAO,EAET,MAAU,OAAA,EAAA,EAAA,yBACgB,CACtB,OAAQ,iCACR,SAAU,QACV,aAAc,2DACd,IAAK,+FACL,IAAK,yEACN,CAAC,CACH,CAGH,SAAgB,EAAc,EAAuC,EACnE,EAAA,EAAA,eAAkB,EAAe,CAGnC,SAAgB,EACd,EAAgC,EAAE,CAClC,EAAiC,EAChB,CACjB,IAAM,EAAiB,IAAI,EAAgB,EAAQ,EAAe,CAElE,OADA,EAAc,EAAe,CACtB,EAGT,SAAS,EACP,EAC0C,CACtC,SAAmB,OAAS,IAAmB,iBACnD,MAAU,OAAA,EAAA,EAAA,yBACgB,CACtB,OAAQ,iCACR,SAAU,QACV,aAAc,iCACd,IAAK,uEAAuE,OAAO,EAAe,CAAC,GACnG,IAAK,kEACN,CAAC,CACH,CAGH,SAAS,EACP,EAC+B,CAC/B,GAAI,aAAsB,EAAiB,MAAO,GAElD,IAAM,EAAuB,EAE7B,OACE,EAAqB,KAA0B,IAC/C,OAAO,EAAqB,mBAAsB,YAClD,OAAO,EAAqB,qBAAwB,YACpD,OAAO,EAAqB,qBAAwB,YACpD,OAAO,EAAqB,yBAA4B"}
@@ -2,20 +2,48 @@ import { I18nConfigParams } from "gt-i18n/internal/types";
2
2
  import { I18nConfig } from "gt-i18n/internal";
3
3
 
4
4
  //#region src/setup/i18nConfig.d.ts
5
+ /**
6
+ * Cookie name for tracking the user's selected locale.
7
+ */
8
+ declare const defaultLocaleCookieName = "generaltranslation.locale";
9
+ /**
10
+ * Cookie name for tracking the user's selected region.
11
+ */
12
+ declare const defaultRegionCookieName = "generaltranslation.region";
13
+ /**
14
+ * Cookie name for persisting the enableI18n feature flag.
15
+ */
16
+ declare const defaultEnableI18nCookieName = "generaltranslation.enable-i18n";
17
+ /**
18
+ * Cookie name for tracking the locale reset.
19
+ */
20
+ declare const defaultResetLocaleCookieName = "generaltranslation.locale-reset";
5
21
  /**
6
22
  * Helps us distinguish behavior for SPA vs server-rendered apps.
7
23
  * - server-rendered apps must use context
8
24
  * - SPA apps can synchronously access the locale
9
25
  */
10
26
  type RenderStrategy = 'SPA' | 'server-render';
27
+ type CookieNameConfig = {
28
+ localeCookieName?: string;
29
+ regionCookieName?: string;
30
+ enableI18nCookieName?: string;
31
+ };
32
+ type ReactI18nConfigParams = I18nConfigParams & CookieNameConfig;
11
33
  declare class ReactI18nConfig extends I18nConfig {
12
34
  private renderStrategy;
13
- constructor(params?: I18nConfigParams, renderStrategy?: RenderStrategy);
35
+ private localeCookieName;
36
+ private regionCookieName;
37
+ private enableI18nCookieName;
38
+ constructor(params?: ReactI18nConfigParams, renderStrategy?: RenderStrategy);
14
39
  getRenderStrategy(): RenderStrategy;
40
+ getLocaleCookieName(): string;
41
+ getRegionCookieName(): string;
42
+ getEnableI18nCookieName(): string;
15
43
  }
16
44
  declare function getI18nConfig(): ReactI18nConfig;
17
45
  declare function setI18nConfig(nextI18nConfig: ReactI18nConfig): void;
18
- declare function initializeI18nConfig(params?: I18nConfigParams, renderStrategy?: RenderStrategy): ReactI18nConfig;
46
+ declare function initializeI18nConfig(params?: ReactI18nConfigParams, renderStrategy?: RenderStrategy): ReactI18nConfig;
19
47
  //#endregion
20
- export { ReactI18nConfig, getI18nConfig, initializeI18nConfig, setI18nConfig };
48
+ export { ReactI18nConfig, ReactI18nConfigParams, defaultEnableI18nCookieName, defaultLocaleCookieName, defaultRegionCookieName, defaultResetLocaleCookieName, getI18nConfig, initializeI18nConfig, setI18nConfig };
21
49
  //# sourceMappingURL=i18nConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"i18nConfig.d.ts","names":[],"sources":["../../src/setup/i18nConfig.ts"],"mappings":";;;;;;AAaA;;;KAAY,cAAA;AAAA,cAOC,eAAA,SAAwB,UAAA;EAAA,QAC3B,cAAA;cAGN,MAAA,GAAQ,gBAAA,EACR,cAAA,GAAgB,cAAA;EAQlB,iBAAA,CAAA,GAAqB,cAAA;AAAA;AAAA,iBAKP,aAAA,CAAA,GAAiB,eAAA;AAAA,iBAgBjB,aAAA,CAAc,cAAA,EAAgB,eAAA;AAAA,iBAI9B,oBAAA,CACd,MAAA,GAAQ,gBAAA,EACR,cAAA,GAAgB,cAAA,GACf,eAAA"}
1
+ {"version":3,"file":"i18nConfig.d.ts","names":[],"sources":["../../src/setup/i18nConfig.ts"],"mappings":";;;;;;AAWA;cAAa,uBAAA;;;;cAKA,uBAAA;;;;cAKA,2BAAA;AAAb;;;AAAA,cAKa,4BAAA;;AAAb;;;;KAOY,cAAA;AAAA,KAEP,gBAAA;EACH,gBAAA;EACA,gBAAA;EACA,oBAAA;AAAA;AAAA,KAGU,qBAAA,GAAwB,gBAAA,GAAuB,gBAAA;AAAA,cAO9C,eAAA,SAAwB,UAAA;EAAA,QAC3B,cAAA;EAAA,QACA,gBAAA;EAAA,QACA,gBAAA;EAAA,QACA,oBAAA;cAGN,MAAA,GAAQ,qBAAA,EACR,cAAA,GAAgB,cAAA;EAYlB,iBAAA,CAAA,GAAqB,cAAA;EAIrB,mBAAA,CAAA;EAIA,mBAAA,CAAA;EAIA,uBAAA,CAAA;AAAA;AAAA,iBAKc,aAAA,CAAA,GAAiB,eAAA;AAAA,iBAgBjB,aAAA,CAAc,cAAA,EAAgB,eAAA;AAAA,iBAI9B,oBAAA,CACd,MAAA,GAAQ,qBAAA,EACR,cAAA,GAAgB,cAAA,GACf,eAAA"}
@@ -1,2 +1,2 @@
1
- import{createDiagnosticMessage as e}from"generaltranslation/internal";import{I18nConfig as t,getI18nConfig as n,setI18nConfig as r}from"gt-i18n/internal";const i=`server-render`,a=Symbol.for(`generaltranslation.react-core.ReactI18nConfig`);var o=class extends t{renderStrategy;constructor(e={},t=i){super(e),u(t),Object.defineProperty(this,a,{value:!0}),this.renderStrategy=t}getRenderStrategy(){return this.renderStrategy}};function s(){let t=n();if(d(t))return t;throw Error(e({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot read ReactI18nConfig after base I18nConfig setup.`,why:`the internal I18nConfig singleton was initialized without react-core render strategy support`,fix:`Initialize GT through gt-react or @generaltranslation/react-core/pure.`}))}function c(e){r(e)}function l(e={},t=i){let n=new o(e,t);return c(n),n}function u(t){if(!(t===`SPA`||t===`server-render`))throw Error(e({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Invalid React render strategy.`,why:`the render strategy must be "SPA" or "server-render", but received "${String(t)}"`,fix:`Initialize GT through gt-react or pass a valid render strategy.`}))}function d(e){if(e instanceof o)return!0;let t=e;return t[a]===!0&&typeof t.getRenderStrategy==`function`}export{o as ReactI18nConfig,s as getI18nConfig,l as initializeI18nConfig,c as setI18nConfig};
1
+ import{createDiagnosticMessage as e}from"generaltranslation/internal";import{I18nConfig as t,getI18nConfig as n,setI18nConfig as r}from"gt-i18n/internal";const i=`generaltranslation.locale`,a=`generaltranslation.region`,o=`generaltranslation.enable-i18n`,s=`generaltranslation.locale-reset`,c=`server-render`,l=Symbol.for(`generaltranslation.react-core.ReactI18nConfig`);var u=class extends t{renderStrategy;localeCookieName;regionCookieName;enableI18nCookieName;constructor(e={},t=c){super(e),m(t),Object.defineProperty(this,l,{value:!0}),this.renderStrategy=t,this.localeCookieName=e.localeCookieName??`generaltranslation.locale`,this.regionCookieName=e.regionCookieName??`generaltranslation.region`,this.enableI18nCookieName=e.enableI18nCookieName??`generaltranslation.enable-i18n`}getRenderStrategy(){return this.renderStrategy}getLocaleCookieName(){return this.localeCookieName}getRegionCookieName(){return this.regionCookieName}getEnableI18nCookieName(){return this.enableI18nCookieName}};function d(){let t=n();if(h(t))return t;throw Error(e({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot read ReactI18nConfig after base I18nConfig setup.`,why:`the internal I18nConfig singleton was initialized without react-core render strategy support`,fix:`Initialize GT through gt-react or @generaltranslation/react-core/pure.`}))}function f(e){r(e)}function p(e={},t=c){let n=new u(e,t);return f(n),n}function m(t){if(!(t===`SPA`||t===`server-render`))throw Error(e({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Invalid React render strategy.`,why:`the render strategy must be "SPA" or "server-render", but received "${String(t)}"`,fix:`Initialize GT through gt-react or pass a valid render strategy.`}))}function h(e){if(e instanceof u)return!0;let t=e;return t[l]===!0&&typeof t.getRenderStrategy==`function`&&typeof t.getLocaleCookieName==`function`&&typeof t.getRegionCookieName==`function`&&typeof t.getEnableI18nCookieName==`function`}export{u as ReactI18nConfig,o as defaultEnableI18nCookieName,i as defaultLocaleCookieName,a as defaultRegionCookieName,s as defaultResetLocaleCookieName,d as getI18nConfig,p as initializeI18nConfig,f as setI18nConfig};
2
2
  //# sourceMappingURL=i18nConfig.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"i18nConfig.mjs","names":["getI18nConfig","getBaseI18nConfig","setI18nConfig"],"sources":["../../src/setup/i18nConfig.ts"],"sourcesContent":["import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport {\n getI18nConfig as getBaseI18nConfig,\n I18nConfig,\n setI18nConfig as setBaseI18nConfig,\n} from 'gt-i18n/internal';\nimport type { I18nConfigParams } from 'gt-i18n/internal/types';\n\n/**\n * Helps us distinguish behavior for SPA vs server-rendered apps.\n * - server-rendered apps must use context\n * - SPA apps can synchronously access the locale\n */\nexport type RenderStrategy = 'SPA' | 'server-render';\n\nconst defaultRenderStrategy: RenderStrategy = 'server-render';\nconst reactI18nConfigBrand = Symbol.for(\n 'generaltranslation.react-core.ReactI18nConfig'\n);\n\nexport class ReactI18nConfig extends I18nConfig {\n private renderStrategy: RenderStrategy;\n\n constructor(\n params: I18nConfigParams = {},\n renderStrategy: RenderStrategy = defaultRenderStrategy\n ) {\n super(params);\n validateRenderStrategy(renderStrategy);\n Object.defineProperty(this, reactI18nConfigBrand, { value: true });\n this.renderStrategy = renderStrategy;\n }\n\n getRenderStrategy(): RenderStrategy {\n return this.renderStrategy;\n }\n}\n\nexport function getI18nConfig(): ReactI18nConfig {\n const i18nConfig = getBaseI18nConfig();\n if (isReactI18nConfig(i18nConfig)) {\n return i18nConfig;\n }\n throw new Error(\n createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot read ReactI18nConfig after base I18nConfig setup.',\n why: 'the internal I18nConfig singleton was initialized without react-core render strategy support',\n fix: 'Initialize GT through gt-react or @generaltranslation/react-core/pure.',\n })\n );\n}\n\nexport function setI18nConfig(nextI18nConfig: ReactI18nConfig): void {\n setBaseI18nConfig(nextI18nConfig);\n}\n\nexport function initializeI18nConfig(\n params: I18nConfigParams = {},\n renderStrategy: RenderStrategy = defaultRenderStrategy\n): ReactI18nConfig {\n const nextI18nConfig = new ReactI18nConfig(params, renderStrategy);\n setI18nConfig(nextI18nConfig);\n return nextI18nConfig;\n}\n\nfunction validateRenderStrategy(\n renderStrategy: RenderStrategy\n): asserts renderStrategy is RenderStrategy {\n if (renderStrategy === 'SPA' || renderStrategy === 'server-render') return;\n throw new Error(\n createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Invalid React render strategy.',\n why: `the render strategy must be \"SPA\" or \"server-render\", but received \"${String(renderStrategy)}\"`,\n fix: 'Initialize GT through gt-react or pass a valid render strategy.',\n })\n );\n}\n\nfunction isReactI18nConfig(\n i18nConfig: I18nConfig\n): i18nConfig is ReactI18nConfig {\n if (i18nConfig instanceof ReactI18nConfig) return true;\n\n const maybeReactI18nConfig = i18nConfig as I18nConfig &\n Record<PropertyKey, unknown>;\n return (\n maybeReactI18nConfig[reactI18nConfigBrand] === true &&\n typeof maybeReactI18nConfig.getRenderStrategy === 'function'\n );\n}\n"],"mappings":"0JAeA,MAAM,EAAwC,gBACxC,EAAuB,OAAO,IAClC,gDACD,CAED,IAAa,EAAb,cAAqC,CAAW,CAC9C,eAEA,YACE,EAA2B,EAAE,CAC7B,EAAiC,EACjC,CACA,MAAM,EAAO,CACb,EAAuB,EAAe,CACtC,OAAO,eAAe,KAAM,EAAsB,CAAE,MAAO,GAAM,CAAC,CAClE,KAAK,eAAiB,EAGxB,mBAAoC,CAClC,OAAO,KAAK,iBAIhB,SAAgBA,GAAiC,CAC/C,IAAM,EAAaC,GAAmB,CACtC,GAAI,EAAkB,EAAW,CAC/B,OAAO,EAET,MAAU,MACR,EAAwB,CACtB,OAAQ,iCACR,SAAU,QACV,aAAc,2DACd,IAAK,+FACL,IAAK,yEACN,CAAC,CACH,CAGH,SAAgBC,EAAc,EAAuC,CACnE,EAAkB,EAAe,CAGnC,SAAgB,EACd,EAA2B,EAAE,CAC7B,EAAiC,EAChB,CACjB,IAAM,EAAiB,IAAI,EAAgB,EAAQ,EAAe,CAElE,OADA,EAAc,EAAe,CACtB,EAGT,SAAS,EACP,EAC0C,CACtC,SAAmB,OAAS,IAAmB,iBACnD,MAAU,MACR,EAAwB,CACtB,OAAQ,iCACR,SAAU,QACV,aAAc,iCACd,IAAK,uEAAuE,OAAO,EAAe,CAAC,GACnG,IAAK,kEACN,CAAC,CACH,CAGH,SAAS,EACP,EAC+B,CAC/B,GAAI,aAAsB,EAAiB,MAAO,GAElD,IAAM,EAAuB,EAE7B,OACE,EAAqB,KAA0B,IAC/C,OAAO,EAAqB,mBAAsB"}
1
+ {"version":3,"file":"i18nConfig.mjs","names":["getI18nConfig","getBaseI18nConfig","setI18nConfig"],"sources":["../../src/setup/i18nConfig.ts"],"sourcesContent":["import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport {\n getI18nConfig as getBaseI18nConfig,\n I18nConfig,\n setI18nConfig as setBaseI18nConfig,\n} from 'gt-i18n/internal';\nimport type { I18nConfigParams as BaseI18nConfigParams } from 'gt-i18n/internal/types';\n\n/**\n * Cookie name for tracking the user's selected locale.\n */\nexport const defaultLocaleCookieName = 'generaltranslation.locale';\n\n/**\n * Cookie name for tracking the user's selected region.\n */\nexport const defaultRegionCookieName = 'generaltranslation.region';\n\n/**\n * Cookie name for persisting the enableI18n feature flag.\n */\nexport const defaultEnableI18nCookieName = 'generaltranslation.enable-i18n';\n\n/**\n * Cookie name for tracking the locale reset.\n */\nexport const defaultResetLocaleCookieName = 'generaltranslation.locale-reset';\n\n/**\n * Helps us distinguish behavior for SPA vs server-rendered apps.\n * - server-rendered apps must use context\n * - SPA apps can synchronously access the locale\n */\nexport type RenderStrategy = 'SPA' | 'server-render';\n\ntype CookieNameConfig = {\n localeCookieName?: string;\n regionCookieName?: string;\n enableI18nCookieName?: string;\n};\n\nexport type ReactI18nConfigParams = BaseI18nConfigParams & CookieNameConfig;\n\nconst defaultRenderStrategy: RenderStrategy = 'server-render';\nconst reactI18nConfigBrand = Symbol.for(\n 'generaltranslation.react-core.ReactI18nConfig'\n);\n\nexport class ReactI18nConfig extends I18nConfig {\n private renderStrategy: RenderStrategy;\n private localeCookieName: string;\n private regionCookieName: string;\n private enableI18nCookieName: string;\n\n constructor(\n params: ReactI18nConfigParams = {},\n renderStrategy: RenderStrategy = defaultRenderStrategy\n ) {\n super(params);\n validateRenderStrategy(renderStrategy);\n Object.defineProperty(this, reactI18nConfigBrand, { value: true });\n this.renderStrategy = renderStrategy;\n this.localeCookieName = params.localeCookieName ?? defaultLocaleCookieName;\n this.regionCookieName = params.regionCookieName ?? defaultRegionCookieName;\n this.enableI18nCookieName =\n params.enableI18nCookieName ?? defaultEnableI18nCookieName;\n }\n\n getRenderStrategy(): RenderStrategy {\n return this.renderStrategy;\n }\n\n getLocaleCookieName(): string {\n return this.localeCookieName;\n }\n\n getRegionCookieName(): string {\n return this.regionCookieName;\n }\n\n getEnableI18nCookieName(): string {\n return this.enableI18nCookieName;\n }\n}\n\nexport function getI18nConfig(): ReactI18nConfig {\n const i18nConfig = getBaseI18nConfig();\n if (isReactI18nConfig(i18nConfig)) {\n return i18nConfig;\n }\n throw new Error(\n createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot read ReactI18nConfig after base I18nConfig setup.',\n why: 'the internal I18nConfig singleton was initialized without react-core render strategy support',\n fix: 'Initialize GT through gt-react or @generaltranslation/react-core/pure.',\n })\n );\n}\n\nexport function setI18nConfig(nextI18nConfig: ReactI18nConfig): void {\n setBaseI18nConfig(nextI18nConfig);\n}\n\nexport function initializeI18nConfig(\n params: ReactI18nConfigParams = {},\n renderStrategy: RenderStrategy = defaultRenderStrategy\n): ReactI18nConfig {\n const nextI18nConfig = new ReactI18nConfig(params, renderStrategy);\n setI18nConfig(nextI18nConfig);\n return nextI18nConfig;\n}\n\nfunction validateRenderStrategy(\n renderStrategy: RenderStrategy\n): asserts renderStrategy is RenderStrategy {\n if (renderStrategy === 'SPA' || renderStrategy === 'server-render') return;\n throw new Error(\n createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Invalid React render strategy.',\n why: `the render strategy must be \"SPA\" or \"server-render\", but received \"${String(renderStrategy)}\"`,\n fix: 'Initialize GT through gt-react or pass a valid render strategy.',\n })\n );\n}\n\nfunction isReactI18nConfig(\n i18nConfig: I18nConfig\n): i18nConfig is ReactI18nConfig {\n if (i18nConfig instanceof ReactI18nConfig) return true;\n\n const maybeReactI18nConfig = i18nConfig as I18nConfig &\n Record<PropertyKey, unknown>;\n return (\n maybeReactI18nConfig[reactI18nConfigBrand] === true &&\n typeof maybeReactI18nConfig.getRenderStrategy === 'function' &&\n typeof maybeReactI18nConfig.getLocaleCookieName === 'function' &&\n typeof maybeReactI18nConfig.getRegionCookieName === 'function' &&\n typeof maybeReactI18nConfig.getEnableI18nCookieName === 'function'\n );\n}\n"],"mappings":"0JAWA,MAAa,EAA0B,4BAK1B,EAA0B,4BAK1B,EAA8B,iCAK9B,EAA+B,kCAiBtC,EAAwC,gBACxC,EAAuB,OAAO,IAClC,gDACD,CAED,IAAa,EAAb,cAAqC,CAAW,CAC9C,eACA,iBACA,iBACA,qBAEA,YACE,EAAgC,EAAE,CAClC,EAAiC,EACjC,CACA,MAAM,EAAO,CACb,EAAuB,EAAe,CACtC,OAAO,eAAe,KAAM,EAAsB,CAAE,MAAO,GAAM,CAAC,CAClE,KAAK,eAAiB,EACtB,KAAK,iBAAmB,EAAO,kBAAA,4BAC/B,KAAK,iBAAmB,EAAO,kBAAA,4BAC/B,KAAK,qBACH,EAAO,sBAAA,iCAGX,mBAAoC,CAClC,OAAO,KAAK,eAGd,qBAA8B,CAC5B,OAAO,KAAK,iBAGd,qBAA8B,CAC5B,OAAO,KAAK,iBAGd,yBAAkC,CAChC,OAAO,KAAK,uBAIhB,SAAgBA,GAAiC,CAC/C,IAAM,EAAaC,GAAmB,CACtC,GAAI,EAAkB,EAAW,CAC/B,OAAO,EAET,MAAU,MACR,EAAwB,CACtB,OAAQ,iCACR,SAAU,QACV,aAAc,2DACd,IAAK,+FACL,IAAK,yEACN,CAAC,CACH,CAGH,SAAgBC,EAAc,EAAuC,CACnE,EAAkB,EAAe,CAGnC,SAAgB,EACd,EAAgC,EAAE,CAClC,EAAiC,EAChB,CACjB,IAAM,EAAiB,IAAI,EAAgB,EAAQ,EAAe,CAElE,OADA,EAAc,EAAe,CACtB,EAGT,SAAS,EACP,EAC0C,CACtC,SAAmB,OAAS,IAAmB,iBACnD,MAAU,MACR,EAAwB,CACtB,OAAQ,iCACR,SAAU,QACV,aAAc,iCACd,IAAK,uEAAuE,OAAO,EAAe,CAAC,GACnG,IAAK,kEACN,CAAC,CACH,CAGH,SAAS,EACP,EAC+B,CAC/B,GAAI,aAAsB,EAAiB,MAAO,GAElD,IAAM,EAAuB,EAE7B,OACE,EAAqB,KAA0B,IAC/C,OAAO,EAAqB,mBAAsB,YAClD,OAAO,EAAqB,qBAAwB,YACpD,OAAO,EAAqB,qBAAwB,YACpD,OAAO,EAAqB,yBAA4B"}
@@ -1 +1 @@
1
- {"version":3,"file":"initializeGTSRA.cjs","names":["ReactI18nCache"],"sources":["../../src/setup/initializeGTSRA.ts"],"sourcesContent":["import type { I18nConfigParams } from 'gt-i18n/internal/types';\nimport type { ReactI18nCacheParams } from '../i18n-cache/ReactI18nCache';\nimport { setReactI18nCache } from '../i18n-cache/singleton-operations';\nimport { ReactI18nCache } from '../i18n-cache/ReactI18nCache';\nimport { initializeI18nConfig } from './i18nConfig';\n\n/**\n * Validation and setup for read only properties\n */\nexport function internalInitializeGTSRA(\n config: I18nConfigParams & ReactI18nCacheParams\n): void {\n initializeI18nConfig(config, 'server-render');\n\n const i18nCache = new ReactI18nCache(config);\n setReactI18nCache(i18nCache);\n}\n"],"mappings":"sIASA,SAAgB,EACd,EACM,CACN,EAAA,qBAAqB,EAAQ,gBAAgB,CAG7C,EAAA,kBAAkB,IADIA,EAAAA,eAAe,EACV,CAAC"}
1
+ {"version":3,"file":"initializeGTSRA.cjs","names":["ReactI18nCache"],"sources":["../../src/setup/initializeGTSRA.ts"],"sourcesContent":["import type { ReactI18nCacheParams } from '../i18n-cache/ReactI18nCache';\nimport { setReactI18nCache } from '../i18n-cache/singleton-operations';\nimport { ReactI18nCache } from '../i18n-cache/ReactI18nCache';\nimport { initializeI18nConfig, type ReactI18nConfigParams } from './i18nConfig';\n\n/**\n * Validation and setup for read only properties\n */\nexport function internalInitializeGTSRA(\n config: ReactI18nConfigParams & ReactI18nCacheParams\n): void {\n initializeI18nConfig(config, 'server-render');\n\n const i18nCache = new ReactI18nCache(config);\n setReactI18nCache(i18nCache);\n}\n"],"mappings":"sIAQA,SAAgB,EACd,EACM,CACN,EAAA,qBAAqB,EAAQ,gBAAgB,CAG7C,EAAA,kBAAkB,IADIA,EAAAA,eAAe,EACV,CAAC"}
@@ -1,11 +1,11 @@
1
1
  import { ReactI18nCacheParams } from "../i18n-cache/ReactI18nCache.js";
2
- import { I18nConfigParams } from "gt-i18n/internal/types";
2
+ import { ReactI18nConfigParams } from "./i18nConfig.js";
3
3
 
4
4
  //#region src/setup/initializeGTSRA.d.ts
5
5
  /**
6
6
  * Validation and setup for read only properties
7
7
  */
8
- declare function internalInitializeGTSRA(config: I18nConfigParams & ReactI18nCacheParams): void;
8
+ declare function internalInitializeGTSRA(config: ReactI18nConfigParams & ReactI18nCacheParams): void;
9
9
  //#endregion
10
10
  export { internalInitializeGTSRA };
11
11
  //# sourceMappingURL=initializeGTSRA.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"initializeGTSRA.d.ts","names":[],"sources":["../../src/setup/initializeGTSRA.ts"],"mappings":";;;;;;AASA;iBAAgB,uBAAA,CACd,MAAA,EAAQ,gBAAA,GAAmB,oBAAA"}
1
+ {"version":3,"file":"initializeGTSRA.d.ts","names":[],"sources":["../../src/setup/initializeGTSRA.ts"],"mappings":";;;;;;AAQA;iBAAgB,uBAAA,CACd,MAAA,EAAQ,qBAAA,GAAwB,oBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"initializeGTSRA.mjs","names":[],"sources":["../../src/setup/initializeGTSRA.ts"],"sourcesContent":["import type { I18nConfigParams } from 'gt-i18n/internal/types';\nimport type { ReactI18nCacheParams } from '../i18n-cache/ReactI18nCache';\nimport { setReactI18nCache } from '../i18n-cache/singleton-operations';\nimport { ReactI18nCache } from '../i18n-cache/ReactI18nCache';\nimport { initializeI18nConfig } from './i18nConfig';\n\n/**\n * Validation and setup for read only properties\n */\nexport function internalInitializeGTSRA(\n config: I18nConfigParams & ReactI18nCacheParams\n): void {\n initializeI18nConfig(config, 'server-render');\n\n const i18nCache = new ReactI18nCache(config);\n setReactI18nCache(i18nCache);\n}\n"],"mappings":"qMASA,SAAgB,EACd,EACM,CACN,EAAqB,EAAQ,gBAAgB,CAG7C,EAAkB,IADI,EAAe,EACV,CAAC"}
1
+ {"version":3,"file":"initializeGTSRA.mjs","names":[],"sources":["../../src/setup/initializeGTSRA.ts"],"sourcesContent":["import type { ReactI18nCacheParams } from '../i18n-cache/ReactI18nCache';\nimport { setReactI18nCache } from '../i18n-cache/singleton-operations';\nimport { ReactI18nCache } from '../i18n-cache/ReactI18nCache';\nimport { initializeI18nConfig, type ReactI18nConfigParams } from './i18nConfig';\n\n/**\n * Validation and setup for read only properties\n */\nexport function internalInitializeGTSRA(\n config: ReactI18nConfigParams & ReactI18nCacheParams\n): void {\n initializeI18nConfig(config, 'server-render');\n\n const i18nCache = new ReactI18nCache(config);\n setReactI18nCache(i18nCache);\n}\n"],"mappings":"qMAQA,SAAgB,EACd,EACM,CACN,EAAqB,EAAQ,gBAAgB,CAG7C,EAAkB,IADI,EAAe,EACV,CAAC"}
@@ -1,2 +1,2 @@
1
- const e=require(`../internal/addGTIdentifier.cjs`),t=require(`../internal/writeChildrenAsObjects.cjs`),n=require(`../internal/removeInjectedT.cjs`);function r({sourceChildren:e,params:t,locale:n}){let r=i(e);return{taggedSourceChildren:r,sourceJsxChildren:a(r),targetOptions:o({options:s(t),locale:n})}}function i(t){return e.addGTIdentifier(n.removeInjectedT(t))}function a(e){return t.writeChildrenAsObjects(e)}function o({options:e,locale:t}){return{...e,$locale:t}}function s(e){return{...e,$format:`JSX`,$context:e.$context??e.context,$id:e.$id??e.id,$_hash:e.$_hash??e._hash}}exports.prepareT=r;
1
+ const e=require(`../internal/addGTIdentifier.cjs`),t=require(`../internal/writeChildrenAsObjects.cjs`),n=require(`../internal/removeInjectedT.cjs`);function r({sourceChildren:e,params:t,locale:n}){let r=i(e);return{taggedSourceChildren:r,sourceJsxChildren:a(r),targetOptions:o({options:s(t),locale:n})}}function i(t){return e.addGTIdentifier(n.removeInjectedT(t))}function a(e){return t.writeChildrenAsObjects(e)}function o({options:e,locale:t}){return{...e,$locale:t}}function s(e){return{...e,$format:`JSX`,$context:e.$context??e.context,$id:e.$id??e.id,$_hash:e.$_hash??e._hash,$maxChars:e.$maxChars??e.maxChars,$requiresReview:e.$requiresReview??e.requiresReview}}exports.prepareT=r;
2
2
  //# sourceMappingURL=prepareT.shared.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"prepareT.shared.cjs","names":["addGTIdentifier","removeInjectedT","writeChildrenAsObjects"],"sources":["../../../src/utils/translation/prepareT.shared.ts"],"sourcesContent":["import { addGTIdentifier } from '../internal/addGTIdentifier';\nimport { removeInjectedT } from '../internal/removeInjectedT';\nimport { writeChildrenAsObjects } from '../internal/writeChildrenAsObjects';\nimport type { JsxTranslationOptions as JsxTranslationOptionsWithSugar } from 'gt-i18n/types';\nimport type { JsxChildren } from 'generaltranslation/types';\nimport type { ReactNode } from 'react';\nimport type { RenderPreparedTParams } from '../rendering/renderPreparedT.shared';\nimport type { TaggedChildren } from '../types';\n\n// Pure preparation logic shared by the hook wrapper (usePrepareT) and the RSC\n// code path. This module must stay free of hook/context imports so it can be\n// reached from the components-rsc entrypoint.\n\ntype StripDollarPrefix<T> = {\n [K in keyof T as K extends `$${infer Rest}` ? Rest : K]: T[K];\n};\n\ntype JsxTranslationOptions = StripDollarPrefix<JsxTranslationOptionsWithSugar> &\n JsxTranslationOptionsWithSugar;\n\ntype PreparedT = {\n taggedSourceChildren: TaggedChildren;\n sourceJsxChildren: JsxChildren;\n targetOptions: JsxTranslationOptionsWithSugar & {\n $format: 'JSX';\n $locale: string;\n };\n};\n\ntype RenderPreparedT = (params: RenderPreparedTParams) => ReactNode;\n\ntype TProps = {\n children: ReactNode;\n _locale?: string;\n _enableI18n?: boolean;\n _renderPreparedT?: RenderPreparedT;\n} & JsxTranslationOptions;\n\ntype ResolvedTProps = TProps & {\n _locale: string;\n _enableI18n: boolean;\n};\n\nfunction prepareT({\n sourceChildren,\n params,\n locale,\n}: {\n sourceChildren: ReactNode;\n params: JsxTranslationOptions;\n locale: string;\n}): PreparedT {\n const taggedSourceChildren = prepareTaggedSourceChildren(sourceChildren);\n const sourceJsxChildren = prepareSourceJsxChildren(taggedSourceChildren);\n const options = normalizeParameters(params);\n const targetOptions = prepareTargetOptions({ options, locale });\n\n return {\n taggedSourceChildren,\n sourceJsxChildren,\n targetOptions,\n };\n}\n\nfunction prepareTaggedSourceChildren(\n sourceChildren: ReactNode\n): TaggedChildren {\n return addGTIdentifier(removeInjectedT(sourceChildren));\n}\n\nfunction prepareSourceJsxChildren(\n taggedSourceChildren: TaggedChildren\n): JsxChildren {\n return writeChildrenAsObjects(taggedSourceChildren);\n}\n\nfunction prepareTargetOptions({\n options,\n locale,\n}: {\n options: JsxTranslationOptionsWithSugar & { $format: 'JSX' };\n locale: string;\n}): JsxTranslationOptionsWithSugar & {\n $format: 'JSX';\n $locale: string;\n} {\n return { ...options, $locale: locale };\n}\n\nfunction normalizeParameters(\n parameters: {\n context?: string;\n id?: string;\n _hash?: string;\n } & JsxTranslationOptions\n): JsxTranslationOptionsWithSugar & { $format: 'JSX' } {\n return {\n ...parameters,\n $format: 'JSX',\n $context: parameters.$context ?? parameters.context,\n $id: parameters.$id ?? parameters.id,\n $_hash: parameters.$_hash ?? parameters._hash,\n };\n}\n\nexport { prepareT };\nexport type {\n JsxTranslationOptions,\n PreparedT,\n RenderPreparedT,\n ResolvedTProps,\n TProps,\n};\n"],"mappings":"oJA2CA,SAAS,EAAS,CAChB,iBACA,SACA,UAKY,CACZ,IAAM,EAAuB,EAA4B,EAAe,CAKxE,MAAO,CACL,uBACA,kBANwB,EAAyB,EAMhC,CACjB,cALoB,EAAqB,CAAE,QAD7B,EAAoB,EACgB,CAAE,SAAQ,CAK/C,CACd,CAGH,SAAS,EACP,EACgB,CAChB,OAAOA,EAAAA,gBAAgBC,EAAAA,gBAAgB,EAAe,CAAC,CAGzD,SAAS,EACP,EACa,CACb,OAAOC,EAAAA,uBAAuB,EAAqB,CAGrD,SAAS,EAAqB,CAC5B,UACA,UAOA,CACA,MAAO,CAAE,GAAG,EAAS,QAAS,EAAQ,CAGxC,SAAS,EACP,EAKqD,CACrD,MAAO,CACL,GAAG,EACH,QAAS,MACT,SAAU,EAAW,UAAY,EAAW,QAC5C,IAAK,EAAW,KAAO,EAAW,GAClC,OAAQ,EAAW,QAAU,EAAW,MACzC"}
1
+ {"version":3,"file":"prepareT.shared.cjs","names":["addGTIdentifier","removeInjectedT","writeChildrenAsObjects"],"sources":["../../../src/utils/translation/prepareT.shared.ts"],"sourcesContent":["import { addGTIdentifier } from '../internal/addGTIdentifier';\nimport { removeInjectedT } from '../internal/removeInjectedT';\nimport { writeChildrenAsObjects } from '../internal/writeChildrenAsObjects';\nimport type { JsxTranslationOptions as JsxTranslationOptionsWithSugar } from 'gt-i18n/types';\nimport type { JsxChildren } from 'generaltranslation/types';\nimport type { ReactNode } from 'react';\nimport type { RenderPreparedTParams } from '../rendering/renderPreparedT.shared';\nimport type { TaggedChildren } from '../types';\n\n// Pure preparation logic shared by the hook wrapper (usePrepareT) and the RSC\n// code path. This module must stay free of hook/context imports so it can be\n// reached from the components-rsc entrypoint.\n\ntype StripDollarPrefix<T> = {\n [K in keyof T as K extends `$${infer Rest}` ? Rest : K]: T[K];\n};\n\ntype JsxTranslationOptions = StripDollarPrefix<JsxTranslationOptionsWithSugar> &\n JsxTranslationOptionsWithSugar;\n\ntype PreparedT = {\n taggedSourceChildren: TaggedChildren;\n sourceJsxChildren: JsxChildren;\n targetOptions: JsxTranslationOptionsWithSugar & {\n $format: 'JSX';\n $locale: string;\n };\n};\n\ntype RenderPreparedT = (params: RenderPreparedTParams) => ReactNode;\n\ntype TProps = {\n children: ReactNode;\n _locale?: string;\n _enableI18n?: boolean;\n _renderPreparedT?: RenderPreparedT;\n} & JsxTranslationOptions;\n\ntype ResolvedTProps = TProps & {\n _locale: string;\n _enableI18n: boolean;\n};\n\nfunction prepareT({\n sourceChildren,\n params,\n locale,\n}: {\n sourceChildren: ReactNode;\n params: JsxTranslationOptions;\n locale: string;\n}): PreparedT {\n const taggedSourceChildren = prepareTaggedSourceChildren(sourceChildren);\n const sourceJsxChildren = prepareSourceJsxChildren(taggedSourceChildren);\n const options = normalizeParameters(params);\n const targetOptions = prepareTargetOptions({ options, locale });\n\n return {\n taggedSourceChildren,\n sourceJsxChildren,\n targetOptions,\n };\n}\n\nfunction prepareTaggedSourceChildren(\n sourceChildren: ReactNode\n): TaggedChildren {\n return addGTIdentifier(removeInjectedT(sourceChildren));\n}\n\nfunction prepareSourceJsxChildren(\n taggedSourceChildren: TaggedChildren\n): JsxChildren {\n return writeChildrenAsObjects(taggedSourceChildren);\n}\n\nfunction prepareTargetOptions({\n options,\n locale,\n}: {\n options: JsxTranslationOptionsWithSugar & { $format: 'JSX' };\n locale: string;\n}): JsxTranslationOptionsWithSugar & {\n $format: 'JSX';\n $locale: string;\n} {\n return { ...options, $locale: locale };\n}\n\nfunction normalizeParameters(\n parameters: {\n context?: string;\n id?: string;\n _hash?: string;\n } & JsxTranslationOptions\n): JsxTranslationOptionsWithSugar & { $format: 'JSX' } {\n return {\n ...parameters,\n $format: 'JSX',\n $context: parameters.$context ?? parameters.context,\n $id: parameters.$id ?? parameters.id,\n $_hash: parameters.$_hash ?? parameters._hash,\n $maxChars: parameters.$maxChars ?? parameters.maxChars,\n $requiresReview: parameters.$requiresReview ?? parameters.requiresReview,\n };\n}\n\nexport { prepareT };\nexport type {\n JsxTranslationOptions,\n PreparedT,\n RenderPreparedT,\n ResolvedTProps,\n TProps,\n};\n"],"mappings":"oJA2CA,SAAS,EAAS,CAChB,iBACA,SACA,UAKY,CACZ,IAAM,EAAuB,EAA4B,EAAe,CAKxE,MAAO,CACL,uBACA,kBANwB,EAAyB,EAMhC,CACjB,cALoB,EAAqB,CAAE,QAD7B,EAAoB,EACgB,CAAE,SAAQ,CAK/C,CACd,CAGH,SAAS,EACP,EACgB,CAChB,OAAOA,EAAAA,gBAAgBC,EAAAA,gBAAgB,EAAe,CAAC,CAGzD,SAAS,EACP,EACa,CACb,OAAOC,EAAAA,uBAAuB,EAAqB,CAGrD,SAAS,EAAqB,CAC5B,UACA,UAOA,CACA,MAAO,CAAE,GAAG,EAAS,QAAS,EAAQ,CAGxC,SAAS,EACP,EAKqD,CACrD,MAAO,CACL,GAAG,EACH,QAAS,MACT,SAAU,EAAW,UAAY,EAAW,QAC5C,IAAK,EAAW,KAAO,EAAW,GAClC,OAAQ,EAAW,QAAU,EAAW,MACxC,UAAW,EAAW,WAAa,EAAW,SAC9C,gBAAiB,EAAW,iBAAmB,EAAW,eAC3D"}
@@ -1,2 +1,2 @@
1
- import{addGTIdentifier as e}from"../internal/addGTIdentifier.mjs";import{writeChildrenAsObjects as t}from"../internal/writeChildrenAsObjects.mjs";import{removeInjectedT as n}from"../internal/removeInjectedT.mjs";function r({sourceChildren:e,params:t,locale:n}){let r=i(e);return{taggedSourceChildren:r,sourceJsxChildren:a(r),targetOptions:o({options:s(t),locale:n})}}function i(t){return e(n(t))}function a(e){return t(e)}function o({options:e,locale:t}){return{...e,$locale:t}}function s(e){return{...e,$format:`JSX`,$context:e.$context??e.context,$id:e.$id??e.id,$_hash:e.$_hash??e._hash}}export{r as prepareT};
1
+ import{addGTIdentifier as e}from"../internal/addGTIdentifier.mjs";import{writeChildrenAsObjects as t}from"../internal/writeChildrenAsObjects.mjs";import{removeInjectedT as n}from"../internal/removeInjectedT.mjs";function r({sourceChildren:e,params:t,locale:n}){let r=i(e);return{taggedSourceChildren:r,sourceJsxChildren:a(r),targetOptions:o({options:s(t),locale:n})}}function i(t){return e(n(t))}function a(e){return t(e)}function o({options:e,locale:t}){return{...e,$locale:t}}function s(e){return{...e,$format:`JSX`,$context:e.$context??e.context,$id:e.$id??e.id,$_hash:e.$_hash??e._hash,$maxChars:e.$maxChars??e.maxChars,$requiresReview:e.$requiresReview??e.requiresReview}}export{r as prepareT};
2
2
  //# sourceMappingURL=prepareT.shared.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"prepareT.shared.mjs","names":[],"sources":["../../../src/utils/translation/prepareT.shared.ts"],"sourcesContent":["import { addGTIdentifier } from '../internal/addGTIdentifier';\nimport { removeInjectedT } from '../internal/removeInjectedT';\nimport { writeChildrenAsObjects } from '../internal/writeChildrenAsObjects';\nimport type { JsxTranslationOptions as JsxTranslationOptionsWithSugar } from 'gt-i18n/types';\nimport type { JsxChildren } from 'generaltranslation/types';\nimport type { ReactNode } from 'react';\nimport type { RenderPreparedTParams } from '../rendering/renderPreparedT.shared';\nimport type { TaggedChildren } from '../types';\n\n// Pure preparation logic shared by the hook wrapper (usePrepareT) and the RSC\n// code path. This module must stay free of hook/context imports so it can be\n// reached from the components-rsc entrypoint.\n\ntype StripDollarPrefix<T> = {\n [K in keyof T as K extends `$${infer Rest}` ? Rest : K]: T[K];\n};\n\ntype JsxTranslationOptions = StripDollarPrefix<JsxTranslationOptionsWithSugar> &\n JsxTranslationOptionsWithSugar;\n\ntype PreparedT = {\n taggedSourceChildren: TaggedChildren;\n sourceJsxChildren: JsxChildren;\n targetOptions: JsxTranslationOptionsWithSugar & {\n $format: 'JSX';\n $locale: string;\n };\n};\n\ntype RenderPreparedT = (params: RenderPreparedTParams) => ReactNode;\n\ntype TProps = {\n children: ReactNode;\n _locale?: string;\n _enableI18n?: boolean;\n _renderPreparedT?: RenderPreparedT;\n} & JsxTranslationOptions;\n\ntype ResolvedTProps = TProps & {\n _locale: string;\n _enableI18n: boolean;\n};\n\nfunction prepareT({\n sourceChildren,\n params,\n locale,\n}: {\n sourceChildren: ReactNode;\n params: JsxTranslationOptions;\n locale: string;\n}): PreparedT {\n const taggedSourceChildren = prepareTaggedSourceChildren(sourceChildren);\n const sourceJsxChildren = prepareSourceJsxChildren(taggedSourceChildren);\n const options = normalizeParameters(params);\n const targetOptions = prepareTargetOptions({ options, locale });\n\n return {\n taggedSourceChildren,\n sourceJsxChildren,\n targetOptions,\n };\n}\n\nfunction prepareTaggedSourceChildren(\n sourceChildren: ReactNode\n): TaggedChildren {\n return addGTIdentifier(removeInjectedT(sourceChildren));\n}\n\nfunction prepareSourceJsxChildren(\n taggedSourceChildren: TaggedChildren\n): JsxChildren {\n return writeChildrenAsObjects(taggedSourceChildren);\n}\n\nfunction prepareTargetOptions({\n options,\n locale,\n}: {\n options: JsxTranslationOptionsWithSugar & { $format: 'JSX' };\n locale: string;\n}): JsxTranslationOptionsWithSugar & {\n $format: 'JSX';\n $locale: string;\n} {\n return { ...options, $locale: locale };\n}\n\nfunction normalizeParameters(\n parameters: {\n context?: string;\n id?: string;\n _hash?: string;\n } & JsxTranslationOptions\n): JsxTranslationOptionsWithSugar & { $format: 'JSX' } {\n return {\n ...parameters,\n $format: 'JSX',\n $context: parameters.$context ?? parameters.context,\n $id: parameters.$id ?? parameters.id,\n $_hash: parameters.$_hash ?? parameters._hash,\n };\n}\n\nexport { prepareT };\nexport type {\n JsxTranslationOptions,\n PreparedT,\n RenderPreparedT,\n ResolvedTProps,\n TProps,\n};\n"],"mappings":"oNA2CA,SAAS,EAAS,CAChB,iBACA,SACA,UAKY,CACZ,IAAM,EAAuB,EAA4B,EAAe,CAKxE,MAAO,CACL,uBACA,kBANwB,EAAyB,EAMhC,CACjB,cALoB,EAAqB,CAAE,QAD7B,EAAoB,EACgB,CAAE,SAAQ,CAK/C,CACd,CAGH,SAAS,EACP,EACgB,CAChB,OAAO,EAAgB,EAAgB,EAAe,CAAC,CAGzD,SAAS,EACP,EACa,CACb,OAAO,EAAuB,EAAqB,CAGrD,SAAS,EAAqB,CAC5B,UACA,UAOA,CACA,MAAO,CAAE,GAAG,EAAS,QAAS,EAAQ,CAGxC,SAAS,EACP,EAKqD,CACrD,MAAO,CACL,GAAG,EACH,QAAS,MACT,SAAU,EAAW,UAAY,EAAW,QAC5C,IAAK,EAAW,KAAO,EAAW,GAClC,OAAQ,EAAW,QAAU,EAAW,MACzC"}
1
+ {"version":3,"file":"prepareT.shared.mjs","names":[],"sources":["../../../src/utils/translation/prepareT.shared.ts"],"sourcesContent":["import { addGTIdentifier } from '../internal/addGTIdentifier';\nimport { removeInjectedT } from '../internal/removeInjectedT';\nimport { writeChildrenAsObjects } from '../internal/writeChildrenAsObjects';\nimport type { JsxTranslationOptions as JsxTranslationOptionsWithSugar } from 'gt-i18n/types';\nimport type { JsxChildren } from 'generaltranslation/types';\nimport type { ReactNode } from 'react';\nimport type { RenderPreparedTParams } from '../rendering/renderPreparedT.shared';\nimport type { TaggedChildren } from '../types';\n\n// Pure preparation logic shared by the hook wrapper (usePrepareT) and the RSC\n// code path. This module must stay free of hook/context imports so it can be\n// reached from the components-rsc entrypoint.\n\ntype StripDollarPrefix<T> = {\n [K in keyof T as K extends `$${infer Rest}` ? Rest : K]: T[K];\n};\n\ntype JsxTranslationOptions = StripDollarPrefix<JsxTranslationOptionsWithSugar> &\n JsxTranslationOptionsWithSugar;\n\ntype PreparedT = {\n taggedSourceChildren: TaggedChildren;\n sourceJsxChildren: JsxChildren;\n targetOptions: JsxTranslationOptionsWithSugar & {\n $format: 'JSX';\n $locale: string;\n };\n};\n\ntype RenderPreparedT = (params: RenderPreparedTParams) => ReactNode;\n\ntype TProps = {\n children: ReactNode;\n _locale?: string;\n _enableI18n?: boolean;\n _renderPreparedT?: RenderPreparedT;\n} & JsxTranslationOptions;\n\ntype ResolvedTProps = TProps & {\n _locale: string;\n _enableI18n: boolean;\n};\n\nfunction prepareT({\n sourceChildren,\n params,\n locale,\n}: {\n sourceChildren: ReactNode;\n params: JsxTranslationOptions;\n locale: string;\n}): PreparedT {\n const taggedSourceChildren = prepareTaggedSourceChildren(sourceChildren);\n const sourceJsxChildren = prepareSourceJsxChildren(taggedSourceChildren);\n const options = normalizeParameters(params);\n const targetOptions = prepareTargetOptions({ options, locale });\n\n return {\n taggedSourceChildren,\n sourceJsxChildren,\n targetOptions,\n };\n}\n\nfunction prepareTaggedSourceChildren(\n sourceChildren: ReactNode\n): TaggedChildren {\n return addGTIdentifier(removeInjectedT(sourceChildren));\n}\n\nfunction prepareSourceJsxChildren(\n taggedSourceChildren: TaggedChildren\n): JsxChildren {\n return writeChildrenAsObjects(taggedSourceChildren);\n}\n\nfunction prepareTargetOptions({\n options,\n locale,\n}: {\n options: JsxTranslationOptionsWithSugar & { $format: 'JSX' };\n locale: string;\n}): JsxTranslationOptionsWithSugar & {\n $format: 'JSX';\n $locale: string;\n} {\n return { ...options, $locale: locale };\n}\n\nfunction normalizeParameters(\n parameters: {\n context?: string;\n id?: string;\n _hash?: string;\n } & JsxTranslationOptions\n): JsxTranslationOptionsWithSugar & { $format: 'JSX' } {\n return {\n ...parameters,\n $format: 'JSX',\n $context: parameters.$context ?? parameters.context,\n $id: parameters.$id ?? parameters.id,\n $_hash: parameters.$_hash ?? parameters._hash,\n $maxChars: parameters.$maxChars ?? parameters.maxChars,\n $requiresReview: parameters.$requiresReview ?? parameters.requiresReview,\n };\n}\n\nexport { prepareT };\nexport type {\n JsxTranslationOptions,\n PreparedT,\n RenderPreparedT,\n ResolvedTProps,\n TProps,\n};\n"],"mappings":"oNA2CA,SAAS,EAAS,CAChB,iBACA,SACA,UAKY,CACZ,IAAM,EAAuB,EAA4B,EAAe,CAKxE,MAAO,CACL,uBACA,kBANwB,EAAyB,EAMhC,CACjB,cALoB,EAAqB,CAAE,QAD7B,EAAoB,EACgB,CAAE,SAAQ,CAK/C,CACd,CAGH,SAAS,EACP,EACgB,CAChB,OAAO,EAAgB,EAAgB,EAAe,CAAC,CAGzD,SAAS,EACP,EACa,CACb,OAAO,EAAuB,EAAqB,CAGrD,SAAS,EAAqB,CAC5B,UACA,UAOA,CACA,MAAO,CAAE,GAAG,EAAS,QAAS,EAAQ,CAGxC,SAAS,EACP,EAKqD,CACrD,MAAO,CACL,GAAG,EACH,QAAS,MACT,SAAU,EAAW,UAAY,EAAW,QAC5C,IAAK,EAAW,KAAO,EAAW,GAClC,OAAQ,EAAW,QAAU,EAAW,MACxC,UAAW,EAAW,WAAa,EAAW,SAC9C,gBAAiB,EAAW,iBAAmB,EAAW,eAC3D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@generaltranslation/react-core",
3
- "version": "11.0.0-odysseus.13",
3
+ "version": "11.0.0-odysseus.14",
4
4
  "description": "A pure React library for internationalization",
5
5
  "files": [
6
6
  "dist",
@@ -14,7 +14,7 @@
14
14
  "@generaltranslation/format": "0.1.2-odysseus.1",
15
15
  "@generaltranslation/supported-locales": "2.1.2-odysseus.4",
16
16
  "generaltranslation": "9.0.0-odysseus.4",
17
- "gt-i18n": "1.0.0-odysseus.6"
17
+ "gt-i18n": "1.0.0-odysseus.7"
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
@@ -52,11 +52,6 @@
52
52
  "types": "./dist/components-rsc.d.ts",
53
53
  "require": "./dist/components-rsc.cjs",
54
54
  "import": "./dist/components-rsc.mjs"
55
- },
56
- "./cookies": {
57
- "types": "./dist/cookies.d.ts",
58
- "require": "./dist/cookies.cjs",
59
- "import": "./dist/cookies.mjs"
60
55
  }
61
56
  },
62
57
  "typesVersions": {
@@ -72,9 +67,6 @@
72
67
  ],
73
68
  "components-rsc": [
74
69
  "./dist/components-rsc.d.ts"
75
- ],
76
- "cookies": [
77
- "./dist/cookies.d.ts"
78
70
  ]
79
71
  }
80
72
  },
@@ -92,9 +84,6 @@
92
84
  ],
93
85
  "@generaltranslation/react-core/components-rsc": [
94
86
  "./dist/components-rsc"
95
- ],
96
- "@generaltranslation/react-core/cookies": [
97
- "./dist/cookies"
98
87
  ]
99
88
  }
100
89
  },
package/dist/cookies.cjs DELETED
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./utils/cookies.cjs`);exports.defaultEnableI18nCookieName=e.defaultEnableI18nCookieName,exports.defaultLocaleCookieName=e.defaultLocaleCookieName,exports.defaultRegionCookieName=e.defaultRegionCookieName;
package/dist/cookies.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { defaultEnableI18nCookieName, defaultLocaleCookieName, defaultRegionCookieName } from "./utils/cookies.js";
2
- export { defaultEnableI18nCookieName, defaultLocaleCookieName, defaultRegionCookieName };
package/dist/cookies.mjs DELETED
@@ -1 +0,0 @@
1
- import{defaultEnableI18nCookieName as e,defaultLocaleCookieName as t,defaultRegionCookieName as n}from"./utils/cookies.mjs";export{e as defaultEnableI18nCookieName,t as defaultLocaleCookieName,n as defaultRegionCookieName};
@@ -1,2 +0,0 @@
1
- exports.defaultEnableI18nCookieName=`generaltranslation.enable-i18n`,exports.defaultLocaleCookieName=`generaltranslation.locale`,exports.defaultRegionCookieName=`generaltranslation.region`;
2
- //# sourceMappingURL=cookies.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cookies.cjs","names":[],"sources":["../../src/utils/cookies.ts"],"sourcesContent":["/**\n * Cookie name for tracking the user's selected locale.\n */\nexport const defaultLocaleCookieName = 'generaltranslation.locale';\n\n/**\n * Cookie name for tracking the user's selected region.\n */\nexport const defaultRegionCookieName = 'generaltranslation.region';\n\n/**\n * Cookie name for persisting the enableI18n feature flag.\n */\nexport const defaultEnableI18nCookieName = 'generaltranslation.enable-i18n';\n"],"mappings":""}
@@ -1,16 +0,0 @@
1
- //#region src/utils/cookies.d.ts
2
- /**
3
- * Cookie name for tracking the user's selected locale.
4
- */
5
- declare const defaultLocaleCookieName = "generaltranslation.locale";
6
- /**
7
- * Cookie name for tracking the user's selected region.
8
- */
9
- declare const defaultRegionCookieName = "generaltranslation.region";
10
- /**
11
- * Cookie name for persisting the enableI18n feature flag.
12
- */
13
- declare const defaultEnableI18nCookieName = "generaltranslation.enable-i18n";
14
- //#endregion
15
- export { defaultEnableI18nCookieName, defaultLocaleCookieName, defaultRegionCookieName };
16
- //# sourceMappingURL=cookies.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cookies.d.ts","names":[],"sources":["../../src/utils/cookies.ts"],"mappings":";;AAGA;;cAAa,uBAAA;;;AAKb;cAAa,uBAAA;;;;cAKA,2BAAA"}
@@ -1,2 +0,0 @@
1
- const e=`generaltranslation.locale`,t=`generaltranslation.region`,n=`generaltranslation.enable-i18n`;export{n as defaultEnableI18nCookieName,e as defaultLocaleCookieName,t as defaultRegionCookieName};
2
- //# sourceMappingURL=cookies.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cookies.mjs","names":[],"sources":["../../src/utils/cookies.ts"],"sourcesContent":["/**\n * Cookie name for tracking the user's selected locale.\n */\nexport const defaultLocaleCookieName = 'generaltranslation.locale';\n\n/**\n * Cookie name for tracking the user's selected region.\n */\nexport const defaultRegionCookieName = 'generaltranslation.region';\n\n/**\n * Cookie name for persisting the enableI18n feature flag.\n */\nexport const defaultEnableI18nCookieName = 'generaltranslation.enable-i18n';\n"],"mappings":"AAGA,MAAa,EAA0B,4BAK1B,EAA0B,4BAK1B,EAA8B"}