gt-react-native 11.4.2 → 11.4.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"GTProvider.js","names":["getLocale","getInitialRegion","getInitialEnableI18n","resolveLocale","Suspense","NativeGTProvider","loadTranslations","View","ActivityIndicator","StyleSheet"],"sources":["../../../src/provider/GTProvider.tsx"],"sourcesContent":["import type { InternalGTProviderProps } from '@generaltranslation/react-core/components';\nimport { Suspense, use, useCallback, useMemo, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { ActivityIndicator, StyleSheet, View } from 'react-native';\nimport type { LocaleCandidates, Locale } from 'gt-i18n/internal/types';\nimport type {\n NativeConditionStoreParams,\n NativeConditionStoreState,\n} from '../condition-store/NativeConditionStore';\nimport { getLocale } from '../utils/getLocale';\nimport {\n getInitialEnableI18n,\n getInitialRegion,\n} from '../utils/getInitialNativeConditions';\nimport { resolveLocale } from '../utils/resolveLocale';\nimport { loadTranslations, type LocaleTranslations } from './loadTranslations';\nimport {\n NativeGTProvider,\n type NativeGTProviderProps,\n} from './NativeGTProvider';\n\nexport type GTProviderProps = Omit<\n InternalGTProviderProps,\n 'conditionStore' | 'i18nStore' | 'translations'\n> &\n Omit<NativeConditionStoreParams, 'locale' | '_reload'> & {\n children?: ReactNode;\n locale?: LocaleCandidates;\n fallback?: ReactNode;\n };\n\ntype LoadedGTProviderProps = Omit<NativeGTProviderProps, 'translations'>;\ntype TranslationSnapshot = Record<Locale, LocaleTranslations>;\n\nexport function GTProvider(props: GTProviderProps) {\n return <LoadableGTProvider {...props} />;\n}\n\n/**\n * This wrapper takes the place of a loader that would be present in\n * SSR style applications.\n */\nfunction LoadableGTProvider(props: GTProviderProps) {\n const { fallback, ...providerProps } = props;\n const renderedFallback = fallback ?? <DefaultLoadingFallback />;\n const { locale, region, enableI18n } = providerProps;\n // Keep native conditions in React state so condition-store writes trigger rerenders.\n const [nativeConditions, setNativeConditions] =\n useState<NativeConditionStoreState>(() => ({\n locale: getLocale(),\n region: getInitialRegion({ region }),\n enableI18n: getInitialEnableI18n({ enableI18n }),\n }));\n const activeLocale = resolveLocale(locale ?? nativeConditions.locale);\n const activeRegion = region ?? nativeConditions.region;\n const activeEnableI18n = enableI18n ?? nativeConditions.enableI18n;\n const fallbackTranslations = useMemo<TranslationSnapshot>(\n () => ({ [activeLocale]: {} }),\n [activeLocale]\n );\n const reload = useCallback(\n (state: NativeConditionStoreState) => {\n setNativeConditions((previousState) => ({\n locale: locale === undefined ? state.locale : previousState.locale,\n region: region === undefined ? state.region : previousState.region,\n enableI18n:\n enableI18n === undefined\n ? state.enableI18n\n : previousState.enableI18n,\n }));\n },\n [enableI18n, locale, region]\n );\n\n return (\n <Suspense\n fallback={\n <NativeGTProvider\n {...providerProps}\n locale={activeLocale}\n region={activeRegion}\n enableI18n={activeEnableI18n}\n translations={fallbackTranslations}\n _reload={reload}\n >\n {renderedFallback}\n </NativeGTProvider>\n }\n >\n <LoadedGTProvider\n {...providerProps}\n locale={activeLocale}\n region={activeRegion}\n enableI18n={activeEnableI18n}\n _reload={reload}\n />\n </Suspense>\n );\n}\n\nfunction LoadedGTProvider(props: LoadedGTProviderProps) {\n const activeLocale = resolveLocale(props.locale);\n const localeTranslations = use(loadTranslations(activeLocale));\n const translations = useMemo<TranslationSnapshot>(\n () => ({ [activeLocale]: localeTranslations }),\n [activeLocale, localeTranslations]\n );\n\n return (\n <NativeGTProvider\n {...props}\n locale={activeLocale}\n translations={translations}\n />\n );\n}\n\nfunction DefaultLoadingFallback() {\n return (\n <View style={styles.loadingContainer}>\n <ActivityIndicator />\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n loadingContainer: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n"],"mappings":";;;;;;;;;;;AAkCA,SAAgB,WAAW,OAAwB;AACjD,QAAO,iBAAA,GAAA,kBAAA,KAAC,oBAAD,EAAoB,GAAI,OAAS,CAAA;;;;;;AAO1C,SAAS,mBAAmB,OAAwB;CAClD,MAAM,EAAE,UAAU,GAAG,kBAAkB;CACvC,MAAM,mBAAmB,YAAY,iBAAA,GAAA,kBAAA,KAAC,wBAAD,EAA0B,CAAA;CAC/D,MAAM,EAAE,QAAQ,QAAQ,eAAe;CAEvC,MAAM,CAAC,kBAAkB,wBAAA,GAAA,MAAA,iBACoB;EACzC,QAAQA,wBAAAA,WAAW;EACnB,QAAQC,yCAAAA,iBAAiB,EAAE,QAAQ,CAAC;EACpC,YAAYC,yCAAAA,qBAAqB,EAAE,YAAY,CAAC;EACjD,EAAE;CACL,MAAM,eAAeC,4BAAAA,cAAc,UAAU,iBAAiB,OAAO;CACrE,MAAM,eAAe,UAAU,iBAAiB;CAChD,MAAM,mBAAmB,cAAc,iBAAiB;CACxD,MAAM,wBAAA,GAAA,MAAA,gBACG,GAAG,eAAe,EAAE,EAAE,GAC7B,CAAC,aAAa,CACf;CACD,MAAM,UAAA,GAAA,MAAA,cACH,UAAqC;AACpC,uBAAqB,mBAAmB;GACtC,QAAQ,WAAW,KAAA,IAAY,MAAM,SAAS,cAAc;GAC5D,QAAQ,WAAW,KAAA,IAAY,MAAM,SAAS,cAAc;GAC5D,YACE,eAAe,KAAA,IACX,MAAM,aACN,cAAc;GACrB,EAAE;IAEL;EAAC;EAAY;EAAQ;EAAO,CAC7B;AAED,QACE,iBAAA,GAAA,kBAAA,KAACC,MAAAA,UAAD;EACE,UACE,iBAAA,GAAA,kBAAA,KAACC,kCAAAA,kBAAD;GACE,GAAI;GACJ,QAAQ;GACR,QAAQ;GACR,YAAY;GACZ,cAAc;GACd,SAAS;aAER;GACgB,CAAA;YAGrB,iBAAA,GAAA,kBAAA,KAAC,kBAAD;GACE,GAAI;GACJ,QAAQ;GACR,QAAQ;GACR,YAAY;GACZ,SAAS;GACT,CAAA;EACO,CAAA;;AAIf,SAAS,iBAAiB,OAA8B;CACtD,MAAM,eAAeF,4BAAAA,cAAc,MAAM,OAAO;CAChD,MAAM,sBAAA,GAAA,MAAA,KAAyBG,kCAAAA,iBAAiB,aAAa,CAAC;CAC9D,MAAM,gBAAA,GAAA,MAAA,gBACG,GAAG,eAAe,oBAAoB,GAC7C,CAAC,cAAc,mBAAmB,CACnC;AAED,QACE,iBAAA,GAAA,kBAAA,KAACD,kCAAAA,kBAAD;EACE,GAAI;EACJ,QAAQ;EACM;EACd,CAAA;;AAIN,SAAS,yBAAyB;AAChC,QACE,iBAAA,GAAA,kBAAA,KAACE,aAAAA,MAAD;EAAM,OAAO,OAAO;YAClB,iBAAA,GAAA,kBAAA,KAACC,aAAAA,mBAAD,EAAqB,CAAA;EAChB,CAAA;;AAIX,MAAM,SAASC,aAAAA,WAAW,OAAO,EAC/B,kBAAkB;CAChB,MAAM;CACN,YAAY;CACZ,gBAAgB;CACjB,EACF,CAAC"}
1
+ {"version":3,"file":"GTProvider.js","names":["getLocale","getInitialRegion","getInitialEnableI18n","resolveLocale","Suspense","NativeGTProvider","loadTranslations","View","ActivityIndicator","StyleSheet"],"sources":["../../../src/provider/GTProvider.tsx"],"sourcesContent":["import type { InternalGTProviderProps } from '@generaltranslation/react-core/components';\nimport { Suspense, use, useCallback, useMemo, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { ActivityIndicator, StyleSheet, View } from 'react-native';\nimport type { LocaleCandidates, Locale } from 'gt-i18n/internal/types';\nimport type {\n NativeConditionStoreParams,\n NativeConditionStoreState,\n} from '../condition-store/NativeConditionStore';\nimport { getLocale } from '../utils/getLocale';\nimport {\n getInitialEnableI18n,\n getInitialRegion,\n} from '../utils/getInitialNativeConditions';\nimport { resolveLocale } from '../utils/resolveLocale';\nimport { loadTranslations, type LocaleTranslations } from './loadTranslations';\nimport {\n NativeGTProvider,\n type NativeGTProviderProps,\n} from './NativeGTProvider';\n\nexport type GTProviderProps = Omit<\n InternalGTProviderProps,\n | 'i18nStore'\n | 'translations'\n | 'locale'\n | 'region'\n | 'enableI18n'\n | 'setLocale'\n | 'setRegion'\n | 'setEnableI18n'\n> &\n Omit<NativeConditionStoreParams, 'locale' | '_reload'> & {\n children?: ReactNode;\n locale?: LocaleCandidates;\n fallback?: ReactNode;\n };\n\ntype LoadedGTProviderProps = Omit<NativeGTProviderProps, 'translations'>;\ntype TranslationSnapshot = Record<Locale, LocaleTranslations>;\n\nexport function GTProvider(props: GTProviderProps) {\n return <LoadableGTProvider {...props} />;\n}\n\n/**\n * This wrapper takes the place of a loader that would be present in\n * SSR style applications.\n */\nfunction LoadableGTProvider(props: GTProviderProps) {\n const { fallback, ...providerProps } = props;\n const renderedFallback = fallback ?? <DefaultLoadingFallback />;\n const { locale, region, enableI18n } = providerProps;\n // Keep native conditions in React state so condition-store writes trigger rerenders.\n const [nativeConditions, setNativeConditions] =\n useState<NativeConditionStoreState>(() => ({\n locale: getLocale(),\n region: getInitialRegion({ region }),\n enableI18n: getInitialEnableI18n({ enableI18n }),\n }));\n const activeLocale = resolveLocale(locale ?? nativeConditions.locale);\n const activeRegion = region ?? nativeConditions.region;\n const activeEnableI18n = enableI18n ?? nativeConditions.enableI18n;\n const fallbackTranslations = useMemo<TranslationSnapshot>(\n () => ({ [activeLocale]: {} }),\n [activeLocale]\n );\n const reload = useCallback(\n (state: NativeConditionStoreState) => {\n setNativeConditions((previousState) => ({\n locale: locale === undefined ? state.locale : previousState.locale,\n region: region === undefined ? state.region : previousState.region,\n enableI18n:\n enableI18n === undefined\n ? state.enableI18n\n : previousState.enableI18n,\n }));\n },\n [enableI18n, locale, region]\n );\n\n return (\n <Suspense\n fallback={\n <NativeGTProvider\n {...providerProps}\n locale={activeLocale}\n region={activeRegion}\n enableI18n={activeEnableI18n}\n translations={fallbackTranslations}\n _reload={reload}\n >\n {renderedFallback}\n </NativeGTProvider>\n }\n >\n <LoadedGTProvider\n {...providerProps}\n locale={activeLocale}\n region={activeRegion}\n enableI18n={activeEnableI18n}\n _reload={reload}\n />\n </Suspense>\n );\n}\n\nfunction LoadedGTProvider(props: LoadedGTProviderProps) {\n const activeLocale = resolveLocale(props.locale);\n const localeTranslations = use(loadTranslations(activeLocale));\n const translations = useMemo<TranslationSnapshot>(\n () => ({ [activeLocale]: localeTranslations }),\n [activeLocale, localeTranslations]\n );\n\n return (\n <NativeGTProvider\n {...props}\n locale={activeLocale}\n translations={translations}\n />\n );\n}\n\nfunction DefaultLoadingFallback() {\n return (\n <View style={styles.loadingContainer}>\n <ActivityIndicator />\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n loadingContainer: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n"],"mappings":";;;;;;;;;;;AAyCA,SAAgB,WAAW,OAAwB;AACjD,QAAO,iBAAA,GAAA,kBAAA,KAAC,oBAAD,EAAoB,GAAI,OAAS,CAAA;;;;;;AAO1C,SAAS,mBAAmB,OAAwB;CAClD,MAAM,EAAE,UAAU,GAAG,kBAAkB;CACvC,MAAM,mBAAmB,YAAY,iBAAA,GAAA,kBAAA,KAAC,wBAAD,EAA0B,CAAA;CAC/D,MAAM,EAAE,QAAQ,QAAQ,eAAe;CAEvC,MAAM,CAAC,kBAAkB,wBAAA,GAAA,MAAA,iBACoB;EACzC,QAAQA,wBAAAA,WAAW;EACnB,QAAQC,yCAAAA,iBAAiB,EAAE,QAAQ,CAAC;EACpC,YAAYC,yCAAAA,qBAAqB,EAAE,YAAY,CAAC;EACjD,EAAE;CACL,MAAM,eAAeC,4BAAAA,cAAc,UAAU,iBAAiB,OAAO;CACrE,MAAM,eAAe,UAAU,iBAAiB;CAChD,MAAM,mBAAmB,cAAc,iBAAiB;CACxD,MAAM,wBAAA,GAAA,MAAA,gBACG,GAAG,eAAe,EAAE,EAAE,GAC7B,CAAC,aAAa,CACf;CACD,MAAM,UAAA,GAAA,MAAA,cACH,UAAqC;AACpC,uBAAqB,mBAAmB;GACtC,QAAQ,WAAW,KAAA,IAAY,MAAM,SAAS,cAAc;GAC5D,QAAQ,WAAW,KAAA,IAAY,MAAM,SAAS,cAAc;GAC5D,YACE,eAAe,KAAA,IACX,MAAM,aACN,cAAc;GACrB,EAAE;IAEL;EAAC;EAAY;EAAQ;EAAO,CAC7B;AAED,QACE,iBAAA,GAAA,kBAAA,KAACC,MAAAA,UAAD;EACE,UACE,iBAAA,GAAA,kBAAA,KAACC,kCAAAA,kBAAD;GACE,GAAI;GACJ,QAAQ;GACR,QAAQ;GACR,YAAY;GACZ,cAAc;GACd,SAAS;aAER;GACgB,CAAA;YAGrB,iBAAA,GAAA,kBAAA,KAAC,kBAAD;GACE,GAAI;GACJ,QAAQ;GACR,QAAQ;GACR,YAAY;GACZ,SAAS;GACT,CAAA;EACO,CAAA;;AAIf,SAAS,iBAAiB,OAA8B;CACtD,MAAM,eAAeF,4BAAAA,cAAc,MAAM,OAAO;CAChD,MAAM,sBAAA,GAAA,MAAA,KAAyBG,kCAAAA,iBAAiB,aAAa,CAAC;CAC9D,MAAM,gBAAA,GAAA,MAAA,gBACG,GAAG,eAAe,oBAAoB,GAC7C,CAAC,cAAc,mBAAmB,CACnC;AAED,QACE,iBAAA,GAAA,kBAAA,KAACD,kCAAAA,kBAAD;EACE,GAAI;EACJ,QAAQ;EACM;EACd,CAAA;;AAIN,SAAS,yBAAyB;AAChC,QACE,iBAAA,GAAA,kBAAA,KAACE,aAAAA,MAAD;EAAM,OAAO,OAAO;YAClB,iBAAA,GAAA,kBAAA,KAACC,aAAAA,mBAAD,EAAqB,CAAA;EAChB,CAAA;;AAIX,MAAM,SAASC,aAAAA,WAAW,OAAO,EAC/B,kBAAkB;CAChB,MAAM;CACN,YAAY;CACZ,gBAAgB;CACjB,EACF,CAAC"}
@@ -18,7 +18,12 @@ function NativeGTProvider(props) {
18
18
  if (i18nStoreRef.current == null) i18nStoreRef.current = new _generaltranslation_react_core_components.I18nStore();
19
19
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_generaltranslation_react_core_components.InternalGTProvider, {
20
20
  ...props,
21
- conditionStore,
21
+ locale: conditionStore.getLocale(),
22
+ region: conditionStore.getRegion(),
23
+ enableI18n: conditionStore.getEnableI18n(),
24
+ setLocale: conditionStore.setLocale,
25
+ setRegion: conditionStore.setRegion,
26
+ setEnableI18n: conditionStore.setEnableI18n,
22
27
  i18nStore: i18nStoreRef.current
23
28
  });
24
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NativeGTProvider.js","names":["NativeConditionStore","I18nStore","InternalGTProvider"],"sources":["../../../src/provider/NativeGTProvider.tsx"],"sourcesContent":["import {\n I18nStore,\n InternalGTProvider,\n type InternalGTProviderProps,\n} from '@generaltranslation/react-core/components';\nimport { useMemo, useRef } from 'react';\nimport type { LocaleCandidates } from 'gt-i18n/internal/types';\nimport type { NativeConditionStoreParams } from '../condition-store/NativeConditionStore';\nimport { NativeConditionStore } from '../condition-store/NativeConditionStore';\n\nexport type NativeGTProviderProps = Omit<\n InternalGTProviderProps,\n 'conditionStore' | 'i18nStore'\n> &\n Omit<NativeConditionStoreParams, 'locale'> & {\n locale: LocaleCandidates;\n };\n\nexport function NativeGTProvider(props: NativeGTProviderProps) {\n const conditionStore = useMemo(() => {\n return new NativeConditionStore(props);\n }, [props.locale, props.region, props.enableI18n, props._reload]);\n\n const i18nStoreRef = useRef<I18nStore | null>(null);\n if (i18nStoreRef.current == null) {\n i18nStoreRef.current = new I18nStore();\n }\n\n return (\n <InternalGTProvider\n {...props}\n conditionStore={conditionStore}\n i18nStore={i18nStoreRef.current}\n />\n );\n}\n"],"mappings":";;;;;;;AAkBA,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,kBAAA,GAAA,MAAA,eAA+B;AACnC,SAAO,IAAIA,6CAAAA,qBAAqB,MAAM;IACrC;EAAC,MAAM;EAAQ,MAAM;EAAQ,MAAM;EAAY,MAAM;EAAQ,CAAC;CAEjE,MAAM,gBAAA,GAAA,MAAA,QAAwC,KAAK;AACnD,KAAI,aAAa,WAAW,KAC1B,cAAa,UAAU,IAAIC,0CAAAA,WAAW;AAGxC,QACE,iBAAA,GAAA,kBAAA,KAACC,0CAAAA,oBAAD;EACE,GAAI;EACY;EAChB,WAAW,aAAa;EACxB,CAAA"}
1
+ {"version":3,"file":"NativeGTProvider.js","names":["NativeConditionStore","I18nStore","InternalGTProvider"],"sources":["../../../src/provider/NativeGTProvider.tsx"],"sourcesContent":["import {\n I18nStore,\n InternalGTProvider,\n type InternalGTProviderProps,\n} from '@generaltranslation/react-core/components';\nimport { useMemo, useRef } from 'react';\nimport type { LocaleCandidates } from 'gt-i18n/internal/types';\nimport type { NativeConditionStoreParams } from '../condition-store/NativeConditionStore';\nimport { NativeConditionStore } from '../condition-store/NativeConditionStore';\n\nexport type NativeGTProviderProps = Omit<\n InternalGTProviderProps,\n 'i18nStore' | 'setLocale' | 'setRegion' | 'setEnableI18n'\n> &\n Omit<NativeConditionStoreParams, 'locale'> & {\n locale: LocaleCandidates;\n };\n\nexport function NativeGTProvider(props: NativeGTProviderProps) {\n const conditionStore = useMemo(() => {\n return new NativeConditionStore(props);\n }, [props.locale, props.region, props.enableI18n, props._reload]);\n\n const i18nStoreRef = useRef<I18nStore | null>(null);\n if (i18nStoreRef.current == null) {\n i18nStoreRef.current = new I18nStore();\n }\n\n return (\n <InternalGTProvider\n {...props}\n locale={conditionStore.getLocale()}\n region={conditionStore.getRegion()}\n enableI18n={conditionStore.getEnableI18n()}\n setLocale={conditionStore.setLocale}\n setRegion={conditionStore.setRegion}\n setEnableI18n={conditionStore.setEnableI18n}\n i18nStore={i18nStoreRef.current}\n />\n );\n}\n"],"mappings":";;;;;;;AAkBA,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,kBAAA,GAAA,MAAA,eAA+B;AACnC,SAAO,IAAIA,6CAAAA,qBAAqB,MAAM;IACrC;EAAC,MAAM;EAAQ,MAAM;EAAQ,MAAM;EAAY,MAAM;EAAQ,CAAC;CAEjE,MAAM,gBAAA,GAAA,MAAA,QAAwC,KAAK;AACnD,KAAI,aAAa,WAAW,KAC1B,cAAa,UAAU,IAAIC,0CAAAA,WAAW;AAGxC,QACE,iBAAA,GAAA,kBAAA,KAACC,0CAAAA,oBAAD;EACE,GAAI;EACJ,QAAQ,eAAe,WAAW;EAClC,QAAQ,eAAe,WAAW;EAClC,YAAY,eAAe,eAAe;EAC1C,WAAW,eAAe;EAC1B,WAAW,eAAe;EAC1B,eAAe,eAAe;EAC9B,WAAW,aAAa;EACxB,CAAA"}
@@ -2,7 +2,7 @@ import type { InternalGTProviderProps } from '@generaltranslation/react-core/com
2
2
  import type { ReactNode } from 'react';
3
3
  import type { LocaleCandidates } from 'gt-i18n/internal/types';
4
4
  import type { NativeConditionStoreParams } from '../condition-store/NativeConditionStore';
5
- export type GTProviderProps = Omit<InternalGTProviderProps, 'conditionStore' | 'i18nStore' | 'translations'> & Omit<NativeConditionStoreParams, 'locale' | '_reload'> & {
5
+ export type GTProviderProps = Omit<InternalGTProviderProps, 'i18nStore' | 'translations' | 'locale' | 'region' | 'enableI18n' | 'setLocale' | 'setRegion' | 'setEnableI18n'> & Omit<NativeConditionStoreParams, 'locale' | '_reload'> & {
6
6
  children?: ReactNode;
7
7
  locale?: LocaleCandidates;
8
8
  fallback?: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"GTProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/GTProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAEzF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAU,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EACV,0BAA0B,EAE3B,MAAM,yCAAyC,CAAC;AAajD,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,uBAAuB,EACvB,gBAAgB,GAAG,WAAW,GAAG,cAAc,CAChD,GACC,IAAI,CAAC,0BAA0B,EAAE,QAAQ,GAAG,SAAS,CAAC,GAAG;IACvD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAKJ,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAEhD"}
1
+ {"version":3,"file":"GTProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/GTProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAEzF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAU,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EACV,0BAA0B,EAE3B,MAAM,yCAAyC,CAAC;AAajD,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,uBAAuB,EACrB,WAAW,GACX,cAAc,GACd,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,WAAW,GACX,eAAe,CAClB,GACC,IAAI,CAAC,0BAA0B,EAAE,QAAQ,GAAG,SAAS,CAAC,GAAG;IACvD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAKJ,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAEhD"}
@@ -1 +1 @@
1
- {"version":3,"file":"GTProvider.js","names":[],"sources":["../../../src/provider/GTProvider.tsx"],"sourcesContent":["import type { InternalGTProviderProps } from '@generaltranslation/react-core/components';\nimport { Suspense, use, useCallback, useMemo, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { ActivityIndicator, StyleSheet, View } from 'react-native';\nimport type { LocaleCandidates, Locale } from 'gt-i18n/internal/types';\nimport type {\n NativeConditionStoreParams,\n NativeConditionStoreState,\n} from '../condition-store/NativeConditionStore';\nimport { getLocale } from '../utils/getLocale';\nimport {\n getInitialEnableI18n,\n getInitialRegion,\n} from '../utils/getInitialNativeConditions';\nimport { resolveLocale } from '../utils/resolveLocale';\nimport { loadTranslations, type LocaleTranslations } from './loadTranslations';\nimport {\n NativeGTProvider,\n type NativeGTProviderProps,\n} from './NativeGTProvider';\n\nexport type GTProviderProps = Omit<\n InternalGTProviderProps,\n 'conditionStore' | 'i18nStore' | 'translations'\n> &\n Omit<NativeConditionStoreParams, 'locale' | '_reload'> & {\n children?: ReactNode;\n locale?: LocaleCandidates;\n fallback?: ReactNode;\n };\n\ntype LoadedGTProviderProps = Omit<NativeGTProviderProps, 'translations'>;\ntype TranslationSnapshot = Record<Locale, LocaleTranslations>;\n\nexport function GTProvider(props: GTProviderProps) {\n return <LoadableGTProvider {...props} />;\n}\n\n/**\n * This wrapper takes the place of a loader that would be present in\n * SSR style applications.\n */\nfunction LoadableGTProvider(props: GTProviderProps) {\n const { fallback, ...providerProps } = props;\n const renderedFallback = fallback ?? <DefaultLoadingFallback />;\n const { locale, region, enableI18n } = providerProps;\n // Keep native conditions in React state so condition-store writes trigger rerenders.\n const [nativeConditions, setNativeConditions] =\n useState<NativeConditionStoreState>(() => ({\n locale: getLocale(),\n region: getInitialRegion({ region }),\n enableI18n: getInitialEnableI18n({ enableI18n }),\n }));\n const activeLocale = resolveLocale(locale ?? nativeConditions.locale);\n const activeRegion = region ?? nativeConditions.region;\n const activeEnableI18n = enableI18n ?? nativeConditions.enableI18n;\n const fallbackTranslations = useMemo<TranslationSnapshot>(\n () => ({ [activeLocale]: {} }),\n [activeLocale]\n );\n const reload = useCallback(\n (state: NativeConditionStoreState) => {\n setNativeConditions((previousState) => ({\n locale: locale === undefined ? state.locale : previousState.locale,\n region: region === undefined ? state.region : previousState.region,\n enableI18n:\n enableI18n === undefined\n ? state.enableI18n\n : previousState.enableI18n,\n }));\n },\n [enableI18n, locale, region]\n );\n\n return (\n <Suspense\n fallback={\n <NativeGTProvider\n {...providerProps}\n locale={activeLocale}\n region={activeRegion}\n enableI18n={activeEnableI18n}\n translations={fallbackTranslations}\n _reload={reload}\n >\n {renderedFallback}\n </NativeGTProvider>\n }\n >\n <LoadedGTProvider\n {...providerProps}\n locale={activeLocale}\n region={activeRegion}\n enableI18n={activeEnableI18n}\n _reload={reload}\n />\n </Suspense>\n );\n}\n\nfunction LoadedGTProvider(props: LoadedGTProviderProps) {\n const activeLocale = resolveLocale(props.locale);\n const localeTranslations = use(loadTranslations(activeLocale));\n const translations = useMemo<TranslationSnapshot>(\n () => ({ [activeLocale]: localeTranslations }),\n [activeLocale, localeTranslations]\n );\n\n return (\n <NativeGTProvider\n {...props}\n locale={activeLocale}\n translations={translations}\n />\n );\n}\n\nfunction DefaultLoadingFallback() {\n return (\n <View style={styles.loadingContainer}>\n <ActivityIndicator />\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n loadingContainer: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n"],"mappings":";;;;;;;;;AAkCA,SAAgB,WAAW,OAAwB;AACjD,QAAO,oBAAC,oBAAD,EAAoB,GAAI,OAAS,CAAA;;;;;;AAO1C,SAAS,mBAAmB,OAAwB;CAClD,MAAM,EAAE,UAAU,GAAG,kBAAkB;CACvC,MAAM,mBAAmB,YAAY,oBAAC,wBAAD,EAA0B,CAAA;CAC/D,MAAM,EAAE,QAAQ,QAAQ,eAAe;CAEvC,MAAM,CAAC,kBAAkB,uBACvB,gBAA2C;EACzC,QAAQ,WAAW;EACnB,QAAQ,iBAAiB,EAAE,QAAQ,CAAC;EACpC,YAAY,qBAAqB,EAAE,YAAY,CAAC;EACjD,EAAE;CACL,MAAM,eAAe,cAAc,UAAU,iBAAiB,OAAO;CACrE,MAAM,eAAe,UAAU,iBAAiB;CAChD,MAAM,mBAAmB,cAAc,iBAAiB;CACxD,MAAM,uBAAuB,eACpB,GAAG,eAAe,EAAE,EAAE,GAC7B,CAAC,aAAa,CACf;CACD,MAAM,SAAS,aACZ,UAAqC;AACpC,uBAAqB,mBAAmB;GACtC,QAAQ,WAAW,KAAA,IAAY,MAAM,SAAS,cAAc;GAC5D,QAAQ,WAAW,KAAA,IAAY,MAAM,SAAS,cAAc;GAC5D,YACE,eAAe,KAAA,IACX,MAAM,aACN,cAAc;GACrB,EAAE;IAEL;EAAC;EAAY;EAAQ;EAAO,CAC7B;AAED,QACE,oBAAC,UAAD;EACE,UACE,oBAAC,kBAAD;GACE,GAAI;GACJ,QAAQ;GACR,QAAQ;GACR,YAAY;GACZ,cAAc;GACd,SAAS;aAER;GACgB,CAAA;YAGrB,oBAAC,kBAAD;GACE,GAAI;GACJ,QAAQ;GACR,QAAQ;GACR,YAAY;GACZ,SAAS;GACT,CAAA;EACO,CAAA;;AAIf,SAAS,iBAAiB,OAA8B;CACtD,MAAM,eAAe,cAAc,MAAM,OAAO;CAChD,MAAM,qBAAqB,IAAI,iBAAiB,aAAa,CAAC;CAC9D,MAAM,eAAe,eACZ,GAAG,eAAe,oBAAoB,GAC7C,CAAC,cAAc,mBAAmB,CACnC;AAED,QACE,oBAAC,kBAAD;EACE,GAAI;EACJ,QAAQ;EACM;EACd,CAAA;;AAIN,SAAS,yBAAyB;AAChC,QACE,oBAAC,MAAD;EAAM,OAAO,OAAO;YAClB,oBAAC,mBAAD,EAAqB,CAAA;EAChB,CAAA;;AAIX,MAAM,SAAS,WAAW,OAAO,EAC/B,kBAAkB;CAChB,MAAM;CACN,YAAY;CACZ,gBAAgB;CACjB,EACF,CAAC"}
1
+ {"version":3,"file":"GTProvider.js","names":[],"sources":["../../../src/provider/GTProvider.tsx"],"sourcesContent":["import type { InternalGTProviderProps } from '@generaltranslation/react-core/components';\nimport { Suspense, use, useCallback, useMemo, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { ActivityIndicator, StyleSheet, View } from 'react-native';\nimport type { LocaleCandidates, Locale } from 'gt-i18n/internal/types';\nimport type {\n NativeConditionStoreParams,\n NativeConditionStoreState,\n} from '../condition-store/NativeConditionStore';\nimport { getLocale } from '../utils/getLocale';\nimport {\n getInitialEnableI18n,\n getInitialRegion,\n} from '../utils/getInitialNativeConditions';\nimport { resolveLocale } from '../utils/resolveLocale';\nimport { loadTranslations, type LocaleTranslations } from './loadTranslations';\nimport {\n NativeGTProvider,\n type NativeGTProviderProps,\n} from './NativeGTProvider';\n\nexport type GTProviderProps = Omit<\n InternalGTProviderProps,\n | 'i18nStore'\n | 'translations'\n | 'locale'\n | 'region'\n | 'enableI18n'\n | 'setLocale'\n | 'setRegion'\n | 'setEnableI18n'\n> &\n Omit<NativeConditionStoreParams, 'locale' | '_reload'> & {\n children?: ReactNode;\n locale?: LocaleCandidates;\n fallback?: ReactNode;\n };\n\ntype LoadedGTProviderProps = Omit<NativeGTProviderProps, 'translations'>;\ntype TranslationSnapshot = Record<Locale, LocaleTranslations>;\n\nexport function GTProvider(props: GTProviderProps) {\n return <LoadableGTProvider {...props} />;\n}\n\n/**\n * This wrapper takes the place of a loader that would be present in\n * SSR style applications.\n */\nfunction LoadableGTProvider(props: GTProviderProps) {\n const { fallback, ...providerProps } = props;\n const renderedFallback = fallback ?? <DefaultLoadingFallback />;\n const { locale, region, enableI18n } = providerProps;\n // Keep native conditions in React state so condition-store writes trigger rerenders.\n const [nativeConditions, setNativeConditions] =\n useState<NativeConditionStoreState>(() => ({\n locale: getLocale(),\n region: getInitialRegion({ region }),\n enableI18n: getInitialEnableI18n({ enableI18n }),\n }));\n const activeLocale = resolveLocale(locale ?? nativeConditions.locale);\n const activeRegion = region ?? nativeConditions.region;\n const activeEnableI18n = enableI18n ?? nativeConditions.enableI18n;\n const fallbackTranslations = useMemo<TranslationSnapshot>(\n () => ({ [activeLocale]: {} }),\n [activeLocale]\n );\n const reload = useCallback(\n (state: NativeConditionStoreState) => {\n setNativeConditions((previousState) => ({\n locale: locale === undefined ? state.locale : previousState.locale,\n region: region === undefined ? state.region : previousState.region,\n enableI18n:\n enableI18n === undefined\n ? state.enableI18n\n : previousState.enableI18n,\n }));\n },\n [enableI18n, locale, region]\n );\n\n return (\n <Suspense\n fallback={\n <NativeGTProvider\n {...providerProps}\n locale={activeLocale}\n region={activeRegion}\n enableI18n={activeEnableI18n}\n translations={fallbackTranslations}\n _reload={reload}\n >\n {renderedFallback}\n </NativeGTProvider>\n }\n >\n <LoadedGTProvider\n {...providerProps}\n locale={activeLocale}\n region={activeRegion}\n enableI18n={activeEnableI18n}\n _reload={reload}\n />\n </Suspense>\n );\n}\n\nfunction LoadedGTProvider(props: LoadedGTProviderProps) {\n const activeLocale = resolveLocale(props.locale);\n const localeTranslations = use(loadTranslations(activeLocale));\n const translations = useMemo<TranslationSnapshot>(\n () => ({ [activeLocale]: localeTranslations }),\n [activeLocale, localeTranslations]\n );\n\n return (\n <NativeGTProvider\n {...props}\n locale={activeLocale}\n translations={translations}\n />\n );\n}\n\nfunction DefaultLoadingFallback() {\n return (\n <View style={styles.loadingContainer}>\n <ActivityIndicator />\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n loadingContainer: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n"],"mappings":";;;;;;;;;AAyCA,SAAgB,WAAW,OAAwB;AACjD,QAAO,oBAAC,oBAAD,EAAoB,GAAI,OAAS,CAAA;;;;;;AAO1C,SAAS,mBAAmB,OAAwB;CAClD,MAAM,EAAE,UAAU,GAAG,kBAAkB;CACvC,MAAM,mBAAmB,YAAY,oBAAC,wBAAD,EAA0B,CAAA;CAC/D,MAAM,EAAE,QAAQ,QAAQ,eAAe;CAEvC,MAAM,CAAC,kBAAkB,uBACvB,gBAA2C;EACzC,QAAQ,WAAW;EACnB,QAAQ,iBAAiB,EAAE,QAAQ,CAAC;EACpC,YAAY,qBAAqB,EAAE,YAAY,CAAC;EACjD,EAAE;CACL,MAAM,eAAe,cAAc,UAAU,iBAAiB,OAAO;CACrE,MAAM,eAAe,UAAU,iBAAiB;CAChD,MAAM,mBAAmB,cAAc,iBAAiB;CACxD,MAAM,uBAAuB,eACpB,GAAG,eAAe,EAAE,EAAE,GAC7B,CAAC,aAAa,CACf;CACD,MAAM,SAAS,aACZ,UAAqC;AACpC,uBAAqB,mBAAmB;GACtC,QAAQ,WAAW,KAAA,IAAY,MAAM,SAAS,cAAc;GAC5D,QAAQ,WAAW,KAAA,IAAY,MAAM,SAAS,cAAc;GAC5D,YACE,eAAe,KAAA,IACX,MAAM,aACN,cAAc;GACrB,EAAE;IAEL;EAAC;EAAY;EAAQ;EAAO,CAC7B;AAED,QACE,oBAAC,UAAD;EACE,UACE,oBAAC,kBAAD;GACE,GAAI;GACJ,QAAQ;GACR,QAAQ;GACR,YAAY;GACZ,cAAc;GACd,SAAS;aAER;GACgB,CAAA;YAGrB,oBAAC,kBAAD;GACE,GAAI;GACJ,QAAQ;GACR,QAAQ;GACR,YAAY;GACZ,SAAS;GACT,CAAA;EACO,CAAA;;AAIf,SAAS,iBAAiB,OAA8B;CACtD,MAAM,eAAe,cAAc,MAAM,OAAO;CAChD,MAAM,qBAAqB,IAAI,iBAAiB,aAAa,CAAC;CAC9D,MAAM,eAAe,eACZ,GAAG,eAAe,oBAAoB,GAC7C,CAAC,cAAc,mBAAmB,CACnC;AAED,QACE,oBAAC,kBAAD;EACE,GAAI;EACJ,QAAQ;EACM;EACd,CAAA;;AAIN,SAAS,yBAAyB;AAChC,QACE,oBAAC,MAAD;EAAM,OAAO,OAAO;YAClB,oBAAC,mBAAD,EAAqB,CAAA;EAChB,CAAA;;AAIX,MAAM,SAAS,WAAW,OAAO,EAC/B,kBAAkB;CAChB,MAAM;CACN,YAAY;CACZ,gBAAgB;CACjB,EACF,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { type InternalGTProviderProps } from '@generaltranslation/react-core/components';
2
2
  import type { LocaleCandidates } from 'gt-i18n/internal/types';
3
3
  import type { NativeConditionStoreParams } from '../condition-store/NativeConditionStore';
4
- export type NativeGTProviderProps = Omit<InternalGTProviderProps, 'conditionStore' | 'i18nStore'> & Omit<NativeConditionStoreParams, 'locale'> & {
4
+ export type NativeGTProviderProps = Omit<InternalGTProviderProps, 'i18nStore' | 'setLocale' | 'setRegion' | 'setEnableI18n'> & Omit<NativeConditionStoreParams, 'locale'> & {
5
5
  locale: LocaleCandidates;
6
6
  };
7
7
  export declare function NativeGTProvider(props: NativeGTProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeGTProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/NativeGTProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAG1F,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,uBAAuB,EACvB,gBAAgB,GAAG,WAAW,CAC/B,GACC,IAAI,CAAC,0BAA0B,EAAE,QAAQ,CAAC,GAAG;IAC3C,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEJ,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,2CAiB5D"}
1
+ {"version":3,"file":"NativeGTProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/NativeGTProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAG1F,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,uBAAuB,EACvB,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,eAAe,CAC1D,GACC,IAAI,CAAC,0BAA0B,EAAE,QAAQ,CAAC,GAAG;IAC3C,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEJ,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,2CAsB5D"}
@@ -16,7 +16,12 @@ function NativeGTProvider(props) {
16
16
  if (i18nStoreRef.current == null) i18nStoreRef.current = new I18nStore();
17
17
  return /* @__PURE__ */ jsx(InternalGTProvider, {
18
18
  ...props,
19
- conditionStore,
19
+ locale: conditionStore.getLocale(),
20
+ region: conditionStore.getRegion(),
21
+ enableI18n: conditionStore.getEnableI18n(),
22
+ setLocale: conditionStore.setLocale,
23
+ setRegion: conditionStore.setRegion,
24
+ setEnableI18n: conditionStore.setEnableI18n,
20
25
  i18nStore: i18nStoreRef.current
21
26
  });
22
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NativeGTProvider.js","names":[],"sources":["../../../src/provider/NativeGTProvider.tsx"],"sourcesContent":["import {\n I18nStore,\n InternalGTProvider,\n type InternalGTProviderProps,\n} from '@generaltranslation/react-core/components';\nimport { useMemo, useRef } from 'react';\nimport type { LocaleCandidates } from 'gt-i18n/internal/types';\nimport type { NativeConditionStoreParams } from '../condition-store/NativeConditionStore';\nimport { NativeConditionStore } from '../condition-store/NativeConditionStore';\n\nexport type NativeGTProviderProps = Omit<\n InternalGTProviderProps,\n 'conditionStore' | 'i18nStore'\n> &\n Omit<NativeConditionStoreParams, 'locale'> & {\n locale: LocaleCandidates;\n };\n\nexport function NativeGTProvider(props: NativeGTProviderProps) {\n const conditionStore = useMemo(() => {\n return new NativeConditionStore(props);\n }, [props.locale, props.region, props.enableI18n, props._reload]);\n\n const i18nStoreRef = useRef<I18nStore | null>(null);\n if (i18nStoreRef.current == null) {\n i18nStoreRef.current = new I18nStore();\n }\n\n return (\n <InternalGTProvider\n {...props}\n conditionStore={conditionStore}\n i18nStore={i18nStoreRef.current}\n />\n );\n}\n"],"mappings":";;;;;AAkBA,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,iBAAiB,cAAc;AACnC,SAAO,IAAI,qBAAqB,MAAM;IACrC;EAAC,MAAM;EAAQ,MAAM;EAAQ,MAAM;EAAY,MAAM;EAAQ,CAAC;CAEjE,MAAM,eAAe,OAAyB,KAAK;AACnD,KAAI,aAAa,WAAW,KAC1B,cAAa,UAAU,IAAI,WAAW;AAGxC,QACE,oBAAC,oBAAD;EACE,GAAI;EACY;EAChB,WAAW,aAAa;EACxB,CAAA"}
1
+ {"version":3,"file":"NativeGTProvider.js","names":[],"sources":["../../../src/provider/NativeGTProvider.tsx"],"sourcesContent":["import {\n I18nStore,\n InternalGTProvider,\n type InternalGTProviderProps,\n} from '@generaltranslation/react-core/components';\nimport { useMemo, useRef } from 'react';\nimport type { LocaleCandidates } from 'gt-i18n/internal/types';\nimport type { NativeConditionStoreParams } from '../condition-store/NativeConditionStore';\nimport { NativeConditionStore } from '../condition-store/NativeConditionStore';\n\nexport type NativeGTProviderProps = Omit<\n InternalGTProviderProps,\n 'i18nStore' | 'setLocale' | 'setRegion' | 'setEnableI18n'\n> &\n Omit<NativeConditionStoreParams, 'locale'> & {\n locale: LocaleCandidates;\n };\n\nexport function NativeGTProvider(props: NativeGTProviderProps) {\n const conditionStore = useMemo(() => {\n return new NativeConditionStore(props);\n }, [props.locale, props.region, props.enableI18n, props._reload]);\n\n const i18nStoreRef = useRef<I18nStore | null>(null);\n if (i18nStoreRef.current == null) {\n i18nStoreRef.current = new I18nStore();\n }\n\n return (\n <InternalGTProvider\n {...props}\n locale={conditionStore.getLocale()}\n region={conditionStore.getRegion()}\n enableI18n={conditionStore.getEnableI18n()}\n setLocale={conditionStore.setLocale}\n setRegion={conditionStore.setRegion}\n setEnableI18n={conditionStore.setEnableI18n}\n i18nStore={i18nStoreRef.current}\n />\n );\n}\n"],"mappings":";;;;;AAkBA,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,iBAAiB,cAAc;AACnC,SAAO,IAAI,qBAAqB,MAAM;IACrC;EAAC,MAAM;EAAQ,MAAM;EAAQ,MAAM;EAAY,MAAM;EAAQ,CAAC;CAEjE,MAAM,eAAe,OAAyB,KAAK;AACnD,KAAI,aAAa,WAAW,KAC1B,cAAa,UAAU,IAAI,WAAW;AAGxC,QACE,oBAAC,oBAAD;EACE,GAAI;EACJ,QAAQ,eAAe,WAAW;EAClC,QAAQ,eAAe,WAAW;EAClC,YAAY,eAAe,eAAe;EAC1C,WAAW,eAAe;EAC1B,WAAW,eAAe;EAC1B,eAAe,eAAe;EAC9B,WAAW,aAAa;EACxB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gt-react-native",
3
- "version": "11.4.2",
3
+ "version": "11.4.4",
4
4
  "description": "An i18n package for React Native",
5
5
  "main": "./dist/commonjs/index.js",
6
6
  "module": "./dist/module/index.js",
@@ -93,10 +93,10 @@
93
93
  "@formatjs/intl-pluralrules": "^5.4.6",
94
94
  "@formatjs/intl-relativetimeformat": "^11.4.13",
95
95
  "@generaltranslation/format": "0.1.9",
96
- "@generaltranslation/react-core": "11.4.2",
97
- "@generaltranslation/supported-locales": "2.1.33",
98
- "generaltranslation": "9.4.3",
99
- "gt-i18n": "1.0.30"
96
+ "@generaltranslation/react-core": "11.4.4",
97
+ "@generaltranslation/supported-locales": "2.1.35",
98
+ "generaltranslation": "9.5.1",
99
+ "gt-i18n": "1.0.32"
100
100
  },
101
101
  "devDependencies": {
102
102
  "@babel/core": "^7.28.4",
@@ -21,7 +21,14 @@ import {
21
21
 
22
22
  export type GTProviderProps = Omit<
23
23
  InternalGTProviderProps,
24
- 'conditionStore' | 'i18nStore' | 'translations'
24
+ | 'i18nStore'
25
+ | 'translations'
26
+ | 'locale'
27
+ | 'region'
28
+ | 'enableI18n'
29
+ | 'setLocale'
30
+ | 'setRegion'
31
+ | 'setEnableI18n'
25
32
  > &
26
33
  Omit<NativeConditionStoreParams, 'locale' | '_reload'> & {
27
34
  children?: ReactNode;
@@ -10,7 +10,7 @@ import { NativeConditionStore } from '../condition-store/NativeConditionStore';
10
10
 
11
11
  export type NativeGTProviderProps = Omit<
12
12
  InternalGTProviderProps,
13
- 'conditionStore' | 'i18nStore'
13
+ 'i18nStore' | 'setLocale' | 'setRegion' | 'setEnableI18n'
14
14
  > &
15
15
  Omit<NativeConditionStoreParams, 'locale'> & {
16
16
  locale: LocaleCandidates;
@@ -29,7 +29,12 @@ export function NativeGTProvider(props: NativeGTProviderProps) {
29
29
  return (
30
30
  <InternalGTProvider
31
31
  {...props}
32
- conditionStore={conditionStore}
32
+ locale={conditionStore.getLocale()}
33
+ region={conditionStore.getRegion()}
34
+ enableI18n={conditionStore.getEnableI18n()}
35
+ setLocale={conditionStore.setLocale}
36
+ setRegion={conditionStore.setRegion}
37
+ setEnableI18n={conditionStore.setEnableI18n}
33
38
  i18nStore={i18nStoreRef.current}
34
39
  />
35
40
  );