@generaltranslation/react-core 11.0.0-odysseus.4 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +301 -0
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/components/branches/Branch.cjs +2 -0
- package/dist/components/branches/Branch.cjs.map +1 -0
- package/dist/components/branches/Branch.d.ts +30 -0
- package/dist/components/branches/Branch.d.ts.map +1 -0
- package/dist/components/branches/Branch.mjs +2 -0
- package/dist/components/branches/Branch.mjs.map +1 -0
- package/dist/components/branches/Plural.cjs +2 -0
- package/dist/components/branches/Plural.cjs.map +1 -0
- package/dist/components/branches/Plural.d.ts +19 -0
- package/dist/components/branches/Plural.d.ts.map +1 -0
- package/dist/components/branches/Plural.mjs +2 -0
- package/dist/components/branches/Plural.mjs.map +1 -0
- package/dist/components/branches/Plural.rsc.cjs +2 -0
- package/dist/components/branches/Plural.rsc.cjs.map +1 -0
- package/dist/components/branches/Plural.rsc.d.ts +15 -0
- package/dist/components/branches/Plural.rsc.d.ts.map +1 -0
- package/dist/components/branches/Plural.rsc.mjs +2 -0
- package/dist/components/branches/Plural.rsc.mjs.map +1 -0
- package/dist/components/branches/Plural.shared.cjs +2 -0
- package/dist/components/branches/Plural.shared.cjs.map +1 -0
- package/dist/components/branches/Plural.shared.d.ts +18 -0
- package/dist/components/branches/Plural.shared.d.ts.map +1 -0
- package/dist/components/branches/Plural.shared.mjs +2 -0
- package/dist/components/branches/Plural.shared.mjs.map +1 -0
- package/dist/components/derivation/Derive.cjs +2 -0
- package/dist/components/derivation/Derive.cjs.map +1 -0
- package/dist/components/derivation/Derive.d.ts +19 -0
- package/dist/components/derivation/Derive.d.ts.map +1 -0
- package/dist/components/derivation/Derive.mjs +2 -0
- package/dist/components/derivation/Derive.mjs.map +1 -0
- package/dist/components/helpers/InternalLocaleSelector.cjs +2 -0
- package/dist/components/helpers/InternalLocaleSelector.cjs.map +1 -0
- package/dist/components/helpers/InternalLocaleSelector.d.ts +38 -0
- package/dist/components/helpers/InternalLocaleSelector.d.ts.map +1 -0
- package/dist/components/helpers/InternalLocaleSelector.mjs +2 -0
- package/dist/components/helpers/InternalLocaleSelector.mjs.map +1 -0
- package/dist/components/helpers/InternalRegionSelector.cjs +2 -0
- package/dist/components/helpers/InternalRegionSelector.cjs.map +1 -0
- package/dist/components/helpers/InternalRegionSelector.d.ts +33 -0
- package/dist/components/helpers/InternalRegionSelector.d.ts.map +1 -0
- package/dist/components/helpers/InternalRegionSelector.mjs +2 -0
- package/dist/components/helpers/InternalRegionSelector.mjs.map +1 -0
- package/dist/components/translation/T.cjs +2 -0
- package/dist/components/translation/T.cjs.map +1 -0
- package/dist/components/translation/T.d.ts +18 -0
- package/dist/components/translation/T.d.ts.map +1 -0
- package/dist/components/translation/T.mjs +2 -0
- package/dist/components/translation/T.mjs.map +1 -0
- package/dist/components/translation/T.rsc.cjs +2 -0
- package/dist/components/translation/T.rsc.cjs.map +1 -0
- package/dist/components/translation/T.rsc.d.ts +17 -0
- package/dist/components/translation/T.rsc.d.ts.map +1 -0
- package/dist/components/translation/T.rsc.mjs +2 -0
- package/dist/components/translation/T.rsc.mjs.map +1 -0
- package/dist/components/translation/Tx.rsc.cjs +2 -0
- package/dist/components/translation/Tx.rsc.cjs.map +1 -0
- package/dist/components/translation/Tx.rsc.d.ts +17 -0
- package/dist/components/translation/Tx.rsc.d.ts.map +1 -0
- package/dist/components/translation/Tx.rsc.mjs +2 -0
- package/dist/components/translation/Tx.rsc.mjs.map +1 -0
- package/dist/components/variables/Currency.cjs +2 -0
- package/dist/components/variables/Currency.cjs.map +1 -0
- package/dist/components/variables/Currency.d.ts +18 -0
- package/dist/components/variables/Currency.d.ts.map +1 -0
- package/dist/components/variables/Currency.mjs +2 -0
- package/dist/components/variables/Currency.mjs.map +1 -0
- package/dist/components/variables/Currency.rsc.cjs +2 -0
- package/dist/components/variables/Currency.rsc.cjs.map +1 -0
- package/dist/components/variables/Currency.rsc.d.ts +14 -0
- package/dist/components/variables/Currency.rsc.d.ts.map +1 -0
- package/dist/components/variables/Currency.rsc.mjs +2 -0
- package/dist/components/variables/Currency.rsc.mjs.map +1 -0
- package/dist/components/variables/Currency.shared.cjs +2 -0
- package/dist/components/variables/Currency.shared.cjs.map +1 -0
- package/dist/components/variables/Currency.shared.d.ts +17 -0
- package/dist/components/variables/Currency.shared.d.ts.map +1 -0
- package/dist/components/variables/Currency.shared.mjs +2 -0
- package/dist/components/variables/Currency.shared.mjs.map +1 -0
- package/dist/components/variables/DateTime.cjs +2 -0
- package/dist/components/variables/DateTime.cjs.map +1 -0
- package/dist/components/variables/DateTime.d.ts +18 -0
- package/dist/components/variables/DateTime.d.ts.map +1 -0
- package/dist/components/variables/DateTime.mjs +2 -0
- package/dist/components/variables/DateTime.mjs.map +1 -0
- package/dist/components/variables/DateTime.rsc.cjs +2 -0
- package/dist/components/variables/DateTime.rsc.cjs.map +1 -0
- package/dist/components/variables/DateTime.rsc.d.ts +14 -0
- package/dist/components/variables/DateTime.rsc.d.ts.map +1 -0
- package/dist/components/variables/DateTime.rsc.mjs +2 -0
- package/dist/components/variables/DateTime.rsc.mjs.map +1 -0
- package/dist/components/variables/DateTime.shared.cjs +2 -0
- package/dist/components/variables/DateTime.shared.cjs.map +1 -0
- package/dist/components/variables/DateTime.shared.d.ts +16 -0
- package/dist/components/variables/DateTime.shared.d.ts.map +1 -0
- package/dist/components/variables/DateTime.shared.mjs +2 -0
- package/dist/components/variables/DateTime.shared.mjs.map +1 -0
- package/dist/components/variables/Num.cjs +2 -0
- package/dist/components/variables/Num.cjs.map +1 -0
- package/dist/components/variables/Num.d.ts +18 -0
- package/dist/components/variables/Num.d.ts.map +1 -0
- package/dist/components/variables/Num.mjs +2 -0
- package/dist/components/variables/Num.mjs.map +1 -0
- package/dist/components/variables/Num.rsc.cjs +2 -0
- package/dist/components/variables/Num.rsc.cjs.map +1 -0
- package/dist/components/variables/Num.rsc.d.ts +14 -0
- package/dist/components/variables/Num.rsc.d.ts.map +1 -0
- package/dist/components/variables/Num.rsc.mjs +2 -0
- package/dist/components/variables/Num.rsc.mjs.map +1 -0
- package/dist/components/variables/Num.shared.cjs +2 -0
- package/dist/components/variables/Num.shared.cjs.map +1 -0
- package/dist/components/variables/Num.shared.d.ts +16 -0
- package/dist/components/variables/Num.shared.d.ts.map +1 -0
- package/dist/components/variables/Num.shared.mjs +2 -0
- package/dist/components/variables/Num.shared.mjs.map +1 -0
- package/dist/components/variables/RelativeTime.cjs +2 -0
- package/dist/components/variables/RelativeTime.cjs.map +1 -0
- package/dist/components/variables/RelativeTime.d.ts +18 -0
- package/dist/components/variables/RelativeTime.d.ts.map +1 -0
- package/dist/components/variables/RelativeTime.mjs +2 -0
- package/dist/components/variables/RelativeTime.mjs.map +1 -0
- package/dist/components/variables/RelativeTime.rsc.cjs +2 -0
- package/dist/components/variables/RelativeTime.rsc.cjs.map +1 -0
- package/dist/components/variables/RelativeTime.rsc.d.ts +14 -0
- package/dist/components/variables/RelativeTime.rsc.d.ts.map +1 -0
- package/dist/components/variables/RelativeTime.rsc.mjs +2 -0
- package/dist/components/variables/RelativeTime.rsc.mjs.map +1 -0
- package/dist/components/variables/RelativeTime.shared.cjs +2 -0
- package/dist/components/variables/RelativeTime.shared.cjs.map +1 -0
- package/dist/components/variables/RelativeTime.shared.d.ts +20 -0
- package/dist/components/variables/RelativeTime.shared.d.ts.map +1 -0
- package/dist/components/variables/RelativeTime.shared.mjs +2 -0
- package/dist/components/variables/RelativeTime.shared.mjs.map +1 -0
- package/dist/components/variables/Var.cjs +2 -0
- package/dist/components/variables/Var.cjs.map +1 -0
- package/dist/components/variables/Var.d.ts +27 -0
- package/dist/components/variables/Var.d.ts.map +1 -0
- package/dist/components/variables/Var.mjs +2 -0
- package/dist/components/variables/Var.mjs.map +1 -0
- package/dist/components-rsc.cjs +1 -0
- package/dist/components-rsc.d.ts +32 -531
- package/dist/components-rsc.mjs +1 -0
- package/dist/components.cjs +1 -0
- package/dist/components.d.ts +14 -495
- package/dist/components.mjs +1 -0
- package/dist/condition-store/singleton-operations.cjs +2 -0
- package/dist/condition-store/singleton-operations.cjs.map +1 -0
- package/dist/condition-store/singleton-operations.d.ts +7 -0
- package/dist/condition-store/singleton-operations.d.ts.map +1 -0
- package/dist/condition-store/singleton-operations.mjs +2 -0
- package/dist/condition-store/singleton-operations.mjs.map +1 -0
- package/dist/context/InternalGTProvider.cjs +2 -0
- package/dist/context/InternalGTProvider.cjs.map +1 -0
- package/dist/context/InternalGTProvider.d.ts +39 -0
- package/dist/context/InternalGTProvider.d.ts.map +1 -0
- package/dist/context/InternalGTProvider.mjs +2 -0
- package/dist/context/InternalGTProvider.mjs.map +1 -0
- package/dist/context/context.cjs +2 -0
- package/dist/context/context.cjs.map +1 -0
- package/dist/context/context.mjs +2 -0
- package/dist/context/context.mjs.map +1 -0
- package/dist/functions/helpers/getTranslationsSnapshot.cjs +2 -0
- package/dist/functions/helpers/getTranslationsSnapshot.cjs.map +1 -0
- package/dist/functions/helpers/getTranslationsSnapshot.d.ts +14 -0
- package/dist/functions/helpers/getTranslationsSnapshot.d.ts.map +1 -0
- package/dist/functions/helpers/getTranslationsSnapshot.mjs +2 -0
- package/dist/functions/helpers/getTranslationsSnapshot.mjs.map +1 -0
- package/dist/functions/translation/t.cjs +2 -0
- package/dist/functions/translation/t.cjs.map +1 -0
- package/dist/functions/translation/t.d.ts +34 -0
- package/dist/functions/translation/t.d.ts.map +1 -0
- package/dist/functions/translation/t.mjs +2 -0
- package/dist/functions/translation/t.mjs.map +1 -0
- package/dist/hooks/condition-store.cjs +2 -0
- package/dist/hooks/condition-store.cjs.map +1 -0
- package/dist/hooks/condition-store.d.ts +23 -0
- package/dist/hooks/condition-store.d.ts.map +1 -0
- package/dist/hooks/condition-store.mjs +2 -0
- package/dist/hooks/condition-store.mjs.map +1 -0
- package/dist/hooks/external-store/useSubscribeToTrackedLookups.cjs +2 -0
- package/dist/hooks/external-store/useSubscribeToTrackedLookups.cjs.map +1 -0
- package/dist/hooks/external-store/useSubscribeToTrackedLookups.mjs +2 -0
- package/dist/hooks/external-store/useSubscribeToTrackedLookups.mjs.map +1 -0
- package/dist/hooks/external-store/useTrackedDictionaryObjResolver.cjs +2 -0
- package/dist/hooks/external-store/useTrackedDictionaryObjResolver.cjs.map +1 -0
- package/dist/hooks/external-store/useTrackedDictionaryObjResolver.mjs +2 -0
- package/dist/hooks/external-store/useTrackedDictionaryObjResolver.mjs.map +1 -0
- package/dist/hooks/external-store/useTrackedDictionaryResolver.cjs +2 -0
- package/dist/hooks/external-store/useTrackedDictionaryResolver.cjs.map +1 -0
- package/dist/hooks/external-store/useTrackedDictionaryResolver.mjs +2 -0
- package/dist/hooks/external-store/useTrackedDictionaryResolver.mjs.map +1 -0
- package/dist/hooks/external-store/useTrackedTranslationResolver.cjs +2 -0
- package/dist/hooks/external-store/useTrackedTranslationResolver.cjs.map +1 -0
- package/dist/hooks/external-store/useTrackedTranslationResolver.d.ts +10 -0
- package/dist/hooks/external-store/useTrackedTranslationResolver.d.ts.map +1 -0
- package/dist/hooks/external-store/useTrackedTranslationResolver.mjs +2 -0
- package/dist/hooks/external-store/useTrackedTranslationResolver.mjs.map +1 -0
- package/dist/hooks/external-store.cjs +2 -0
- package/dist/hooks/external-store.cjs.map +1 -0
- package/dist/hooks/external-store.mjs +2 -0
- package/dist/hooks/external-store.mjs.map +1 -0
- package/dist/hooks/i18n-config.cjs +2 -0
- package/dist/hooks/i18n-config.cjs.map +1 -0
- package/dist/hooks/i18n-config.d.ts +9 -0
- package/dist/hooks/i18n-config.d.ts.map +1 -0
- package/dist/hooks/i18n-config.mjs +2 -0
- package/dist/hooks/i18n-config.mjs.map +1 -0
- package/dist/hooks/useGT.cjs +2 -0
- package/dist/hooks/useGT.cjs.map +1 -0
- package/dist/hooks/useGT.d.ts +8 -0
- package/dist/hooks/useGT.d.ts.map +1 -0
- package/dist/hooks/useGT.mjs +2 -0
- package/dist/hooks/useGT.mjs.map +1 -0
- package/dist/hooks/useInternalLocaleSelector.cjs +2 -0
- package/dist/hooks/useInternalLocaleSelector.cjs.map +1 -0
- package/dist/hooks/useInternalLocaleSelector.d.ts +12 -0
- package/dist/hooks/useInternalLocaleSelector.d.ts.map +1 -0
- package/dist/hooks/useInternalLocaleSelector.mjs +2 -0
- package/dist/hooks/useInternalLocaleSelector.mjs.map +1 -0
- package/dist/hooks/useInternalRegionSelector.cjs +2 -0
- package/dist/hooks/useInternalRegionSelector.cjs.map +1 -0
- package/dist/hooks/useInternalRegionSelector.d.ts +42 -0
- package/dist/hooks/useInternalRegionSelector.d.ts.map +1 -0
- package/dist/hooks/useInternalRegionSelector.mjs +2 -0
- package/dist/hooks/useInternalRegionSelector.mjs.map +1 -0
- package/dist/hooks/useMessages.cjs +2 -0
- package/dist/hooks/useMessages.cjs.map +1 -0
- package/dist/hooks/useMessages.d.ts +8 -0
- package/dist/hooks/useMessages.d.ts.map +1 -0
- package/dist/hooks/useMessages.mjs +2 -0
- package/dist/hooks/useMessages.mjs.map +1 -0
- package/dist/hooks/useTranslations.cjs +2 -0
- package/dist/hooks/useTranslations.cjs.map +1 -0
- package/dist/hooks/useTranslations.d.ts +10 -0
- package/dist/hooks/useTranslations.d.ts.map +1 -0
- package/dist/hooks/useTranslations.mjs +2 -0
- package/dist/hooks/useTranslations.mjs.map +1 -0
- package/dist/hooks/utils/getFormatLocales.cjs +2 -0
- package/dist/hooks/utils/getFormatLocales.cjs.map +1 -0
- package/dist/hooks/utils/getFormatLocales.d.ts +13 -0
- package/dist/hooks/utils/getFormatLocales.d.ts.map +1 -0
- package/dist/hooks/utils/getFormatLocales.mjs +2 -0
- package/dist/hooks/utils/getFormatLocales.mjs.map +1 -0
- package/dist/hooks/utils/getShouldTranslate.cjs +2 -0
- package/dist/hooks/utils/getShouldTranslate.cjs.map +1 -0
- package/dist/hooks/utils/getShouldTranslate.d.ts +8 -0
- package/dist/hooks/utils/getShouldTranslate.d.ts.map +1 -0
- package/dist/hooks/utils/getShouldTranslate.mjs +2 -0
- package/dist/hooks/utils/getShouldTranslate.mjs.map +1 -0
- package/dist/hooks/utils/missing-translation.cjs +2 -0
- package/dist/hooks/utils/missing-translation.cjs.map +1 -0
- package/dist/hooks/utils/missing-translation.d.ts +10 -0
- package/dist/hooks/utils/missing-translation.d.ts.map +1 -0
- package/dist/hooks/utils/missing-translation.mjs +2 -0
- package/dist/hooks/utils/missing-translation.mjs.map +1 -0
- package/dist/hooks/utils.cjs +2 -0
- package/dist/hooks/utils.cjs.map +1 -0
- package/dist/hooks/utils.d.ts +10 -0
- package/dist/hooks/utils.d.ts.map +1 -0
- package/dist/hooks/utils.mjs +2 -0
- package/dist/hooks/utils.mjs.map +1 -0
- package/dist/hooks.cjs +1 -0
- package/dist/hooks.d.ts +9 -130
- package/dist/hooks.mjs +1 -0
- package/dist/i18n-cache/ReactI18nCache.cjs +2 -0
- package/dist/i18n-cache/ReactI18nCache.cjs.map +1 -0
- package/dist/i18n-cache/ReactI18nCache.d.ts +10 -0
- package/dist/i18n-cache/ReactI18nCache.d.ts.map +1 -0
- package/dist/i18n-cache/ReactI18nCache.mjs +2 -0
- package/dist/i18n-cache/ReactI18nCache.mjs.map +1 -0
- package/dist/i18n-cache/singleton-operations.cjs +2 -0
- package/dist/i18n-cache/singleton-operations.cjs.map +1 -0
- package/dist/i18n-cache/singleton-operations.d.ts +8 -0
- package/dist/i18n-cache/singleton-operations.d.ts.map +1 -0
- package/dist/i18n-cache/singleton-operations.mjs +2 -0
- package/dist/i18n-cache/singleton-operations.mjs.map +1 -0
- package/dist/i18n-store/I18nStore.cjs +2 -0
- package/dist/i18n-store/I18nStore.cjs.map +1 -0
- package/dist/i18n-store/I18nStore.d.ts +41 -0
- package/dist/i18n-store/I18nStore.d.ts.map +1 -0
- package/dist/i18n-store/I18nStore.mjs +2 -0
- package/dist/i18n-store/I18nStore.mjs.map +1 -0
- package/dist/i18n-store/singleton-operations.cjs +2 -0
- package/dist/i18n-store/singleton-operations.cjs.map +1 -0
- package/dist/i18n-store/singleton-operations.d.ts +7 -0
- package/dist/i18n-store/singleton-operations.d.ts.map +1 -0
- package/dist/i18n-store/singleton-operations.mjs +2 -0
- package/dist/i18n-store/singleton-operations.mjs.map +1 -0
- package/dist/i18n-store/storeTypes.d.ts +22 -0
- package/dist/i18n-store/storeTypes.d.ts.map +1 -0
- package/dist/i18n-store/useI18nStore.cjs +2 -0
- package/dist/i18n-store/useI18nStore.cjs.map +1 -0
- package/dist/i18n-store/useI18nStore.mjs +2 -0
- package/dist/i18n-store/useI18nStore.mjs.map +1 -0
- package/dist/i18n-store/utils/dictionaries.cjs +2 -0
- package/dist/i18n-store/utils/dictionaries.cjs.map +1 -0
- package/dist/i18n-store/utils/dictionaries.mjs +2 -0
- package/dist/i18n-store/utils/dictionaries.mjs.map +1 -0
- package/dist/i18n-store/utils/subscriptions.cjs +2 -0
- package/dist/i18n-store/utils/subscriptions.cjs.map +1 -0
- package/dist/i18n-store/utils/subscriptions.mjs +2 -0
- package/dist/i18n-store/utils/subscriptions.mjs.map +1 -0
- package/dist/i18n-store/utils/translations.cjs +2 -0
- package/dist/i18n-store/utils/translations.cjs.map +1 -0
- package/dist/i18n-store/utils/translations.mjs +2 -0
- package/dist/i18n-store/utils/translations.mjs.map +1 -0
- package/dist/pure.cjs +1 -0
- package/dist/pure.d.ts +18 -677
- package/dist/pure.mjs +1 -0
- package/dist/setup/i18nConfig.cjs +2 -0
- package/dist/setup/i18nConfig.cjs.map +1 -0
- package/dist/setup/i18nConfig.d.ts +48 -0
- package/dist/setup/i18nConfig.d.ts.map +1 -0
- package/dist/setup/i18nConfig.mjs +2 -0
- package/dist/setup/i18nConfig.mjs.map +1 -0
- package/dist/setup/initializeGTSRA.cjs +2 -0
- package/dist/setup/initializeGTSRA.cjs.map +1 -0
- package/dist/setup/initializeGTSRA.d.ts +11 -0
- package/dist/setup/initializeGTSRA.d.ts.map +1 -0
- package/dist/setup/initializeGTSRA.mjs +2 -0
- package/dist/setup/initializeGTSRA.mjs.map +1 -0
- package/dist/utils/internal/addGTIdentifier.cjs +2 -0
- package/dist/utils/internal/addGTIdentifier.cjs.map +1 -0
- package/dist/utils/internal/addGTIdentifier.mjs +2 -0
- package/dist/utils/internal/addGTIdentifier.mjs.map +1 -0
- package/dist/utils/internal/removeInjectedT.cjs +2 -0
- package/dist/utils/internal/removeInjectedT.cjs.map +1 -0
- package/dist/utils/internal/removeInjectedT.mjs +2 -0
- package/dist/utils/internal/removeInjectedT.mjs.map +1 -0
- package/dist/utils/internal/writeChildrenAsObjects.cjs +2 -0
- package/dist/utils/internal/writeChildrenAsObjects.cjs.map +1 -0
- package/dist/utils/internal/writeChildrenAsObjects.mjs +2 -0
- package/dist/utils/internal/writeChildrenAsObjects.mjs.map +1 -0
- package/dist/utils/plurals/getPluralBranch.cjs +2 -0
- package/dist/utils/plurals/getPluralBranch.cjs.map +1 -0
- package/dist/utils/plurals/getPluralBranch.d.ts +12 -0
- package/dist/utils/plurals/getPluralBranch.d.ts.map +1 -0
- package/dist/utils/plurals/getPluralBranch.mjs +2 -0
- package/dist/utils/plurals/getPluralBranch.mjs.map +1 -0
- package/dist/utils/rendering/createRenderPipeline.cjs +2 -0
- package/dist/utils/rendering/createRenderPipeline.cjs.map +1 -0
- package/dist/utils/rendering/createRenderPipeline.d.ts +18 -0
- package/dist/utils/rendering/createRenderPipeline.d.ts.map +1 -0
- package/dist/utils/rendering/createRenderPipeline.mjs +2 -0
- package/dist/utils/rendering/createRenderPipeline.mjs.map +1 -0
- package/dist/utils/rendering/createRenderVariable.cjs +2 -0
- package/dist/utils/rendering/createRenderVariable.cjs.map +1 -0
- package/dist/utils/rendering/createRenderVariable.d.ts +46 -0
- package/dist/utils/rendering/createRenderVariable.d.ts.map +1 -0
- package/dist/utils/rendering/createRenderVariable.mjs +2 -0
- package/dist/utils/rendering/createRenderVariable.mjs.map +1 -0
- package/dist/utils/rendering/getDefaultRenderSettings.cjs +2 -0
- package/dist/utils/rendering/getDefaultRenderSettings.cjs.map +1 -0
- package/dist/utils/rendering/getDefaultRenderSettings.d.ts +10 -0
- package/dist/utils/rendering/getDefaultRenderSettings.d.ts.map +1 -0
- package/dist/utils/rendering/getDefaultRenderSettings.mjs +2 -0
- package/dist/utils/rendering/getDefaultRenderSettings.mjs.map +1 -0
- package/dist/utils/rendering/getGTTag.cjs +2 -0
- package/dist/utils/rendering/getGTTag.cjs.map +1 -0
- package/dist/utils/rendering/getGTTag.mjs +2 -0
- package/dist/utils/rendering/getGTTag.mjs.map +1 -0
- package/dist/utils/rendering/renderDefaultChildren.shared.cjs +2 -0
- package/dist/utils/rendering/renderDefaultChildren.shared.cjs.map +1 -0
- package/dist/utils/rendering/renderDefaultChildren.shared.d.ts +12 -0
- package/dist/utils/rendering/renderDefaultChildren.shared.d.ts.map +1 -0
- package/dist/utils/rendering/renderDefaultChildren.shared.mjs +2 -0
- package/dist/utils/rendering/renderDefaultChildren.shared.mjs.map +1 -0
- package/dist/utils/rendering/renderPipeline.cjs +2 -0
- package/dist/utils/rendering/renderPipeline.cjs.map +1 -0
- package/dist/utils/rendering/renderPipeline.mjs +2 -0
- package/dist/utils/rendering/renderPipeline.mjs.map +1 -0
- package/dist/utils/rendering/renderPipeline.rsc.cjs +2 -0
- package/dist/utils/rendering/renderPipeline.rsc.cjs.map +1 -0
- package/dist/utils/rendering/renderPipeline.rsc.d.ts +11 -0
- package/dist/utils/rendering/renderPipeline.rsc.d.ts.map +1 -0
- package/dist/utils/rendering/renderPipeline.rsc.mjs +2 -0
- package/dist/utils/rendering/renderPipeline.rsc.mjs.map +1 -0
- package/dist/utils/rendering/renderPreparedT.shared.cjs +2 -0
- package/dist/utils/rendering/renderPreparedT.shared.cjs.map +1 -0
- package/dist/utils/rendering/renderPreparedT.shared.d.ts +16 -0
- package/dist/utils/rendering/renderPreparedT.shared.d.ts.map +1 -0
- package/dist/utils/rendering/renderPreparedT.shared.mjs +2 -0
- package/dist/utils/rendering/renderPreparedT.shared.mjs.map +1 -0
- package/dist/utils/rendering/renderTranslatedChildren.shared.cjs +2 -0
- package/dist/utils/rendering/renderTranslatedChildren.shared.cjs.map +1 -0
- package/dist/utils/rendering/renderTranslatedChildren.shared.d.ts +13 -0
- package/dist/utils/rendering/renderTranslatedChildren.shared.d.ts.map +1 -0
- package/dist/utils/rendering/renderTranslatedChildren.shared.mjs +2 -0
- package/dist/utils/rendering/renderTranslatedChildren.shared.mjs.map +1 -0
- package/dist/utils/translation/prepareT.shared.cjs +2 -0
- package/dist/utils/translation/prepareT.shared.cjs.map +1 -0
- package/dist/utils/translation/prepareT.shared.d.ts +40 -0
- package/dist/utils/translation/prepareT.shared.d.ts.map +1 -0
- package/dist/utils/translation/prepareT.shared.mjs +2 -0
- package/dist/utils/translation/prepareT.shared.mjs.map +1 -0
- package/dist/utils/translation/usePrepareT.cjs +2 -0
- package/dist/utils/translation/usePrepareT.cjs.map +1 -0
- package/dist/utils/translation/usePrepareT.mjs +2 -0
- package/dist/utils/translation/usePrepareT.mjs.map +1 -0
- package/dist/utils/types.d.ts +64 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/utils.cjs +2 -0
- package/dist/utils/utils.cjs.map +1 -0
- package/dist/utils/utils.mjs +2 -0
- package/dist/utils/utils.mjs.map +1 -0
- package/dist/utils/variables/_getVariableProps.cjs +2 -0
- package/dist/utils/variables/_getVariableProps.cjs.map +1 -0
- package/dist/utils/variables/_getVariableProps.mjs +2 -0
- package/dist/utils/variables/_getVariableProps.mjs.map +1 -0
- package/dist/utils/variables/getVariableName.cjs +2 -0
- package/dist/utils/variables/getVariableName.cjs.map +1 -0
- package/dist/utils/variables/getVariableName.mjs +2 -0
- package/dist/utils/variables/getVariableName.mjs.map +1 -0
- package/package.json +13 -41
- package/dist/components-rsc.cjs.min.cjs +0 -2
- package/dist/components-rsc.cjs.min.cjs.map +0 -1
- package/dist/components-rsc.d.ts.map +0 -1
- package/dist/components-rsc.esm.min.mjs +0 -2
- package/dist/components-rsc.esm.min.mjs.map +0 -1
- package/dist/components.cjs.min.cjs +0 -2
- package/dist/components.cjs.min.cjs.map +0 -1
- package/dist/components.d.ts.map +0 -1
- package/dist/components.esm.min.mjs +0 -2
- package/dist/components.esm.min.mjs.map +0 -1
- package/dist/cookies.cjs.min.cjs +0 -2
- package/dist/cookies.cjs.min.cjs.map +0 -1
- package/dist/cookies.d.ts +0 -16
- package/dist/cookies.d.ts.map +0 -1
- package/dist/cookies.esm.min.mjs +0 -2
- package/dist/cookies.esm.min.mjs.map +0 -1
- package/dist/hooks.cjs.min.cjs +0 -2
- package/dist/hooks.cjs.min.cjs.map +0 -1
- package/dist/hooks.d.ts.map +0 -1
- package/dist/hooks.esm.min.mjs +0 -2
- package/dist/hooks.esm.min.mjs.map +0 -1
- package/dist/pure.cjs.min.cjs +0 -2
- package/dist/pure.cjs.min.cjs.map +0 -1
- package/dist/pure.d.ts.map +0 -1
- package/dist/pure.esm.min.mjs +0 -2
- package/dist/pure.esm.min.mjs.map +0 -1
package/dist/components.d.ts
CHANGED
|
@@ -1,495 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
* External-store version of the `<Branch>` component.
|
|
16
|
-
*/
|
|
17
|
-
declare function GtInternalBranch({
|
|
18
|
-
children,
|
|
19
|
-
branch,
|
|
20
|
-
_locale,
|
|
21
|
-
_enableI18n,
|
|
22
|
-
...branches
|
|
23
|
-
}: BranchProps): ReactNode;
|
|
24
|
-
declare namespace GtInternalBranch {
|
|
25
|
-
var _gtt: string;
|
|
26
|
-
}
|
|
27
|
-
declare function Branch(props: BranchProps): React.JSX.Element;
|
|
28
|
-
declare namespace Branch {
|
|
29
|
-
var _gtt: string;
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/components/branches/Plural.shared.d.ts
|
|
33
|
-
type PluralProps = {
|
|
34
|
-
children?: ReactNode;
|
|
35
|
-
n: number;
|
|
36
|
-
locales?: string[];
|
|
37
|
-
_locale?: string;
|
|
38
|
-
_enableI18n?: boolean;
|
|
39
|
-
[key: string]: ReactNode;
|
|
40
|
-
};
|
|
41
|
-
//#endregion
|
|
42
|
-
//#region src/components/branches/Plural.d.ts
|
|
43
|
-
declare function GtInternalPlural({
|
|
44
|
-
_enableI18n,
|
|
45
|
-
_locale,
|
|
46
|
-
...props
|
|
47
|
-
}: PluralProps): ReactNode;
|
|
48
|
-
declare namespace GtInternalPlural {
|
|
49
|
-
var _gtt: string;
|
|
50
|
-
}
|
|
51
|
-
declare function Plural(props: PluralProps): React.JSX.Element;
|
|
52
|
-
declare namespace Plural {
|
|
53
|
-
var _gtt: string;
|
|
54
|
-
}
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/components/derivation/Derive.d.ts
|
|
57
|
-
type DeriveProps<T extends ReactNode> = {
|
|
58
|
-
children: T;
|
|
59
|
-
};
|
|
60
|
-
declare function GtInternalDerive<T extends ReactNode>({
|
|
61
|
-
children
|
|
62
|
-
}: DeriveProps<T>): T;
|
|
63
|
-
declare namespace GtInternalDerive {
|
|
64
|
-
var _gtt: string;
|
|
65
|
-
}
|
|
66
|
-
declare function Derive<T extends ReactNode>(props: DeriveProps<T>): React.JSX.Element;
|
|
67
|
-
declare namespace Derive {
|
|
68
|
-
var _gtt: string;
|
|
69
|
-
}
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region ../format/dist/types-COaQnqVZ.d.cts
|
|
72
|
-
//#region src/locales/customLocaleMapping.d.ts
|
|
73
|
-
type CustomMapping = Record<string, string | Partial<LocaleProperties>>; //#endregion
|
|
74
|
-
//#region src/locales/getLocaleProperties.d.ts
|
|
75
|
-
type LocaleProperties = {
|
|
76
|
-
code: string;
|
|
77
|
-
name: string;
|
|
78
|
-
nativeName: string;
|
|
79
|
-
languageCode: string;
|
|
80
|
-
languageName: string;
|
|
81
|
-
nativeLanguageName: string;
|
|
82
|
-
nameWithRegionCode: string;
|
|
83
|
-
nativeNameWithRegionCode: string;
|
|
84
|
-
regionCode: string;
|
|
85
|
-
regionName: string;
|
|
86
|
-
nativeRegionName: string;
|
|
87
|
-
scriptCode: string;
|
|
88
|
-
scriptName: string;
|
|
89
|
-
nativeScriptName: string;
|
|
90
|
-
maximizedCode: string;
|
|
91
|
-
maximizedName: string;
|
|
92
|
-
nativeMaximizedName: string;
|
|
93
|
-
minimizedCode: string;
|
|
94
|
-
minimizedName: string;
|
|
95
|
-
nativeMinimizedName: string;
|
|
96
|
-
emoji: string;
|
|
97
|
-
}; //#endregion
|
|
98
|
-
//#region src/locales/getRegionProperties.d.ts
|
|
99
|
-
//#endregion
|
|
100
|
-
//#region src/types-dir/jsx/variables.d.ts
|
|
101
|
-
type VariableType = 'v' | 'n' | 'd' | 'c' | 'rt';
|
|
102
|
-
/**
|
|
103
|
-
* Variables are used to store the variable name and type.
|
|
104
|
-
*/
|
|
105
|
-
type Variable = {
|
|
106
|
-
k: string;
|
|
107
|
-
i?: number;
|
|
108
|
-
v?: VariableType;
|
|
109
|
-
}; //#endregion
|
|
110
|
-
//#region src/types-dir/jsx/content.d.ts
|
|
111
|
-
/**
|
|
112
|
-
* Map of data-_gt properties to their corresponding React props
|
|
113
|
-
*/
|
|
114
|
-
declare const HTML_CONTENT_PROPS: {
|
|
115
|
-
readonly pl: "placeholder";
|
|
116
|
-
readonly ti: "title";
|
|
117
|
-
readonly alt: "alt";
|
|
118
|
-
readonly arl: "aria-label";
|
|
119
|
-
readonly arb: "aria-labelledby";
|
|
120
|
-
readonly ard: "aria-describedby";
|
|
121
|
-
};
|
|
122
|
-
type HtmlContentPropKeysRecord = Partial<Record<keyof typeof HTML_CONTENT_PROPS, string>>;
|
|
123
|
-
/**
|
|
124
|
-
* GTProp is an internal property used to contain data for translating and rendering elements.
|
|
125
|
-
* note, transformations are only read on the server side if they are 'plural' or 'branch'
|
|
126
|
-
*/
|
|
127
|
-
type GTProp = {
|
|
128
|
-
b?: Record<string, JsxChildren>;
|
|
129
|
-
t?: 'p' | 'b';
|
|
130
|
-
} & HtmlContentPropKeysRecord;
|
|
131
|
-
type JsxElement = {
|
|
132
|
-
t?: string;
|
|
133
|
-
i?: number;
|
|
134
|
-
d?: GTProp;
|
|
135
|
-
c?: JsxChildren;
|
|
136
|
-
};
|
|
137
|
-
type JsxChild = string | JsxElement | Variable;
|
|
138
|
-
/**
|
|
139
|
-
* The format of the string content
|
|
140
|
-
*/
|
|
141
|
-
/**
|
|
142
|
-
* A content type representing JSX elements.
|
|
143
|
-
*/
|
|
144
|
-
type JsxChildren = JsxChild | JsxChild[];
|
|
145
|
-
/**
|
|
146
|
-
* A content type representing ICU messages.
|
|
147
|
-
*/
|
|
148
|
-
//#endregion
|
|
149
|
-
//#region ../core/dist/types-CdRgQtET.d.cts
|
|
150
|
-
type TransformationPrefix = 'translate' | 'variable' | 'plural' | 'branch' | 'fragment' | 'derive';
|
|
151
|
-
type VariableTransformationSuffix = 'variable' | 'number' | 'datetime' | 'currency' | 'relative-time';
|
|
152
|
-
type InjectionType = 'automatic' | 'manual'; //#endregion
|
|
153
|
-
//#region src/types.d.ts
|
|
154
|
-
/**
|
|
155
|
-
* @deprecated Use {@link Content} instead.
|
|
156
|
-
*/
|
|
157
|
-
//#endregion
|
|
158
|
-
//#region src/utils/types.d.ts
|
|
159
|
-
/**
|
|
160
|
-
* TaggedElement is a React element with a GTProp property.
|
|
161
|
-
*/
|
|
162
|
-
type GTTag = {
|
|
163
|
-
id: number;
|
|
164
|
-
injectionType: InjectionType;
|
|
165
|
-
transformation?: TransformationPrefix;
|
|
166
|
-
branches?: Record<string, TaggedChildren>;
|
|
167
|
-
variableType?: VariableTransformationSuffix;
|
|
168
|
-
};
|
|
169
|
-
type TaggedElementProps = Record<string, unknown> & {
|
|
170
|
-
'data-_gt': GTTag;
|
|
171
|
-
children?: TaggedChildren;
|
|
172
|
-
branch?: string | number | boolean;
|
|
173
|
-
n?: number;
|
|
174
|
-
key?: React$1.Key;
|
|
175
|
-
};
|
|
176
|
-
type TaggedElement = React$1.ReactElement<TaggedElementProps>;
|
|
177
|
-
type TaggedChild = Exclude<React$1.ReactNode, React$1.ReactElement> | TaggedElement;
|
|
178
|
-
type TaggedChildren = TaggedChild[] | TaggedChild;
|
|
179
|
-
//#endregion
|
|
180
|
-
//#region src/utils/rendering/renderPreparedT.shared.d.ts
|
|
181
|
-
type RenderPreparedTParams = {
|
|
182
|
-
taggedSourceChildren: TaggedChildren;
|
|
183
|
-
targetJsxChildren: JsxChildren | null | undefined;
|
|
184
|
-
locale: string;
|
|
185
|
-
defaultLocale: string;
|
|
186
|
-
enableI18n: boolean;
|
|
187
|
-
shouldTranslate: boolean;
|
|
188
|
-
};
|
|
189
|
-
//#endregion
|
|
190
|
-
//#region src/utils/translation/prepareT.shared.d.ts
|
|
191
|
-
type StripDollarPrefix<T> = { [K in keyof T as K extends `$${infer Rest}` ? Rest : K]: T[K] };
|
|
192
|
-
type JsxTranslationOptions$1 = StripDollarPrefix<JsxTranslationOptions> & JsxTranslationOptions;
|
|
193
|
-
type RenderPreparedT = (params: RenderPreparedTParams) => ReactNode;
|
|
194
|
-
type TProps = {
|
|
195
|
-
children: ReactNode;
|
|
196
|
-
_locale?: string;
|
|
197
|
-
_enableI18n?: boolean;
|
|
198
|
-
_renderPreparedT?: RenderPreparedT;
|
|
199
|
-
} & JsxTranslationOptions$1;
|
|
200
|
-
//#endregion
|
|
201
|
-
//#region src/components/translation/T.d.ts
|
|
202
|
-
/**
|
|
203
|
-
* External-store version of the `<T>` component.
|
|
204
|
-
*/
|
|
205
|
-
declare function T(props: TProps): ReactNode;
|
|
206
|
-
declare namespace T {
|
|
207
|
-
var _gtt: string;
|
|
208
|
-
}
|
|
209
|
-
declare function GtInternalTranslateJsx(props: TProps): ReactNode;
|
|
210
|
-
declare namespace GtInternalTranslateJsx {
|
|
211
|
-
var _gtt: string;
|
|
212
|
-
}
|
|
213
|
-
//#endregion
|
|
214
|
-
//#region src/components/variables/Currency.shared.d.ts
|
|
215
|
-
type CurrencyProps = {
|
|
216
|
-
children: number | string | null | undefined;
|
|
217
|
-
currency?: string;
|
|
218
|
-
options?: Intl.NumberFormatOptions;
|
|
219
|
-
locales?: string[];
|
|
220
|
-
name?: string;
|
|
221
|
-
_locale?: string;
|
|
222
|
-
_enableI18n?: boolean;
|
|
223
|
-
};
|
|
224
|
-
//#endregion
|
|
225
|
-
//#region src/components/variables/Currency.d.ts
|
|
226
|
-
declare function GtInternalCurrency({
|
|
227
|
-
_enableI18n,
|
|
228
|
-
_locale,
|
|
229
|
-
...props
|
|
230
|
-
}: CurrencyProps): string | null;
|
|
231
|
-
declare namespace GtInternalCurrency {
|
|
232
|
-
var _gtt: string;
|
|
233
|
-
}
|
|
234
|
-
declare function Currency(props: CurrencyProps): React.JSX.Element;
|
|
235
|
-
declare namespace Currency {
|
|
236
|
-
var _gtt: string;
|
|
237
|
-
}
|
|
238
|
-
//#endregion
|
|
239
|
-
//#region src/components/variables/DateTime.shared.d.ts
|
|
240
|
-
type DateTimeProps = {
|
|
241
|
-
children: Date | null | undefined;
|
|
242
|
-
locales?: string[];
|
|
243
|
-
options?: Intl.DateTimeFormatOptions;
|
|
244
|
-
name?: string;
|
|
245
|
-
_locale?: string;
|
|
246
|
-
_enableI18n?: boolean;
|
|
247
|
-
};
|
|
248
|
-
//#endregion
|
|
249
|
-
//#region src/components/variables/DateTime.d.ts
|
|
250
|
-
declare function GtInternalDateTime({
|
|
251
|
-
_enableI18n,
|
|
252
|
-
_locale,
|
|
253
|
-
...props
|
|
254
|
-
}: DateTimeProps): string | null;
|
|
255
|
-
declare namespace GtInternalDateTime {
|
|
256
|
-
var _gtt: string;
|
|
257
|
-
}
|
|
258
|
-
declare function DateTime(props: DateTimeProps): React.JSX.Element;
|
|
259
|
-
declare namespace DateTime {
|
|
260
|
-
var _gtt: string;
|
|
261
|
-
}
|
|
262
|
-
//#endregion
|
|
263
|
-
//#region src/components/variables/Num.shared.d.ts
|
|
264
|
-
type NumProps = {
|
|
265
|
-
children: number | string | null | undefined;
|
|
266
|
-
options?: Intl.NumberFormatOptions;
|
|
267
|
-
locales?: string[];
|
|
268
|
-
name?: string;
|
|
269
|
-
_locale?: string;
|
|
270
|
-
_enableI18n?: boolean;
|
|
271
|
-
};
|
|
272
|
-
//#endregion
|
|
273
|
-
//#region src/components/variables/Num.d.ts
|
|
274
|
-
declare function GtInternalNum({
|
|
275
|
-
_enableI18n,
|
|
276
|
-
_locale,
|
|
277
|
-
...props
|
|
278
|
-
}: NumProps): string | null;
|
|
279
|
-
declare namespace GtInternalNum {
|
|
280
|
-
var _gtt: string;
|
|
281
|
-
}
|
|
282
|
-
declare function Num(props: NumProps): React.JSX.Element;
|
|
283
|
-
declare namespace Num {
|
|
284
|
-
var _gtt: string;
|
|
285
|
-
}
|
|
286
|
-
//#endregion
|
|
287
|
-
//#region src/components/variables/RelativeTime.shared.d.ts
|
|
288
|
-
type RelativeTimeProps = {
|
|
289
|
-
date?: Date | null | undefined;
|
|
290
|
-
children?: Date | null | undefined;
|
|
291
|
-
name?: string;
|
|
292
|
-
value?: number;
|
|
293
|
-
unit?: Intl.RelativeTimeFormatUnit;
|
|
294
|
-
baseDate?: Date;
|
|
295
|
-
locales?: string[];
|
|
296
|
-
options?: Intl.RelativeTimeFormatOptions;
|
|
297
|
-
_locale?: string;
|
|
298
|
-
_enableI18n?: boolean;
|
|
299
|
-
};
|
|
300
|
-
//#endregion
|
|
301
|
-
//#region src/components/variables/RelativeTime.d.ts
|
|
302
|
-
declare function GtInternalRelativeTime({
|
|
303
|
-
_enableI18n,
|
|
304
|
-
_locale,
|
|
305
|
-
...props
|
|
306
|
-
}: RelativeTimeProps): string | null;
|
|
307
|
-
declare namespace GtInternalRelativeTime {
|
|
308
|
-
var _gtt: string;
|
|
309
|
-
}
|
|
310
|
-
declare function RelativeTime(props: RelativeTimeProps): React.JSX.Element;
|
|
311
|
-
declare namespace RelativeTime {
|
|
312
|
-
var _gtt: string;
|
|
313
|
-
}
|
|
314
|
-
//#endregion
|
|
315
|
-
//#region src/components/variables/Var.d.ts
|
|
316
|
-
type VarProps<T extends ReactNode> = {
|
|
317
|
-
children: T;
|
|
318
|
-
name?: string; /** Accepted for renderVariable parity; raw variables are locale-independent. */
|
|
319
|
-
_locale?: string;
|
|
320
|
-
_enableI18n?: boolean;
|
|
321
|
-
};
|
|
322
|
-
/**
|
|
323
|
-
* External-store version of the `<Var>` component.
|
|
324
|
-
*/
|
|
325
|
-
declare function Var<T extends ReactNode>({
|
|
326
|
-
children
|
|
327
|
-
}: VarProps<T>): T;
|
|
328
|
-
declare namespace Var {
|
|
329
|
-
var _gtt: string;
|
|
330
|
-
}
|
|
331
|
-
declare function GtInternalVar<T extends ReactNode>({
|
|
332
|
-
children
|
|
333
|
-
}: VarProps<T>): T;
|
|
334
|
-
declare namespace GtInternalVar {
|
|
335
|
-
var _gtt: string;
|
|
336
|
-
}
|
|
337
|
-
//#endregion
|
|
338
|
-
//#region src/components/helpers/InternalLocaleSelector.d.ts
|
|
339
|
-
/**
|
|
340
|
-
* A dropdown component that allows users to select a locale.
|
|
341
|
-
* @param {string} locale - The currently selected locale.
|
|
342
|
-
* @param {string[]} locales - The list of all available locales.
|
|
343
|
-
* @param {function} setLocale - Function to update the current locale.
|
|
344
|
-
* @param {function} getLocaleProperties - Function to retrieve properties for a given locale.
|
|
345
|
-
* @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.
|
|
346
|
-
* @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.
|
|
347
|
-
* @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.
|
|
348
|
-
*
|
|
349
|
-
* @internal
|
|
350
|
-
*/
|
|
351
|
-
declare function InternalLocaleSelector({
|
|
352
|
-
locale,
|
|
353
|
-
locales,
|
|
354
|
-
customNames,
|
|
355
|
-
customMapping,
|
|
356
|
-
setLocale,
|
|
357
|
-
getLocaleProperties,
|
|
358
|
-
...props
|
|
359
|
-
}: {
|
|
360
|
-
locale: string;
|
|
361
|
-
locales: string[];
|
|
362
|
-
customNames?: {
|
|
363
|
-
[key: string]: string;
|
|
364
|
-
};
|
|
365
|
-
customMapping?: CustomMapping;
|
|
366
|
-
setLocale: (locale: string) => void;
|
|
367
|
-
getLocaleProperties: (locale: string) => LocaleProperties;
|
|
368
|
-
[key: string]: any;
|
|
369
|
-
}): React$1.JSX.Element | null;
|
|
370
|
-
//#endregion
|
|
371
|
-
//#region src/hooks/useInternalRegionSelector.d.ts
|
|
372
|
-
type RegionData = {
|
|
373
|
-
code: string;
|
|
374
|
-
name: string;
|
|
375
|
-
emoji: string;
|
|
376
|
-
locale: string;
|
|
377
|
-
};
|
|
378
|
-
//#endregion
|
|
379
|
-
//#region src/components/helpers/InternalRegionSelector.d.ts
|
|
380
|
-
/**
|
|
381
|
-
* A dropdown component that allows users to select a region.
|
|
382
|
-
* @param {string | undefined} region - The currently selected region.
|
|
383
|
-
* @param {string[]} regions - The ordered list of available region codes.
|
|
384
|
-
* @param {Map<string, RegionData>} regionData - Map of region codes to their display data (name, emoji, locale).
|
|
385
|
-
* @param {function} setRegion - Function to update the current region.
|
|
386
|
-
* @param {React.ReactNode} [placeholder] - Optional placeholder node to display as the first option when no region is selected.
|
|
387
|
-
* @returns {React.ReactElement | null} The rendered region dropdown component or null to prevent rendering.
|
|
388
|
-
*
|
|
389
|
-
* @internal
|
|
390
|
-
*/
|
|
391
|
-
declare function InternalRegionSelector({
|
|
392
|
-
region,
|
|
393
|
-
regions,
|
|
394
|
-
regionData,
|
|
395
|
-
setRegion,
|
|
396
|
-
placeholder,
|
|
397
|
-
...props
|
|
398
|
-
}: {
|
|
399
|
-
region: string | undefined;
|
|
400
|
-
regions: string[];
|
|
401
|
-
regionData: Map<string, RegionData>;
|
|
402
|
-
setRegion: (region: string) => void;
|
|
403
|
-
placeholder?: ReactNode;
|
|
404
|
-
[key: string]: any;
|
|
405
|
-
}): React$1.JSX.Element | null;
|
|
406
|
-
//#endregion
|
|
407
|
-
//#region src/i18n-store/storeTypes.d.ts
|
|
408
|
-
type Unsubscribe = () => void;
|
|
409
|
-
type StoreListener = () => void;
|
|
410
|
-
type TranslateEventListener = (lookup: TranslateLookup) => void;
|
|
411
|
-
type TranslateLookup<T extends Translation = Translation> = {
|
|
412
|
-
locale: string;
|
|
413
|
-
message: T;
|
|
414
|
-
options: LookupOptions;
|
|
415
|
-
};
|
|
416
|
-
type DictionaryLookup = {
|
|
417
|
-
locale: string;
|
|
418
|
-
id: string;
|
|
419
|
-
};
|
|
420
|
-
type TranslateSnapshot<T extends Translation = Translation> = T | undefined;
|
|
421
|
-
type DictionaryEntrySnapshot = DictionaryEntry | undefined;
|
|
422
|
-
type DictionaryObjectSnapshot = DictionaryObject | undefined;
|
|
423
|
-
//#endregion
|
|
424
|
-
//#region src/i18n-store/I18nStore.d.ts
|
|
425
|
-
type DictionaryStoreListener = (event: DictionaryLookup) => void;
|
|
426
|
-
/**
|
|
427
|
-
* I18nStore gives us the ability to perform client-side updates to translations.
|
|
428
|
-
* Primarily useful for dev hot reload.
|
|
429
|
-
*
|
|
430
|
-
* This is the stateful primitive behind lookup subscriptions and runtime
|
|
431
|
-
* translation requests. It intentionally does not know whether lookups are
|
|
432
|
-
* being served from SPA singletons or SRA provider snapshots; that policy lives
|
|
433
|
-
* in LookupAdapter, not in this store.
|
|
434
|
-
*/
|
|
435
|
-
declare class I18nStore {
|
|
436
|
-
private translateListeners;
|
|
437
|
-
private dictionaryEntryListeners;
|
|
438
|
-
private dictionaryObjectListeners;
|
|
439
|
-
/**
|
|
440
|
-
* I18nCache must be already initialized
|
|
441
|
-
*/
|
|
442
|
-
constructor();
|
|
443
|
-
updateTranslations: (translations: Record<Locale, Record<Hash, Translation>>) => void;
|
|
444
|
-
updateDictionaries: (dictionaries: Record<Locale, Dictionary>) => void;
|
|
445
|
-
translate: <T extends Translation>(lookup: TranslateLookup<T>) => Promise<void>;
|
|
446
|
-
translateDictionaryEntry: (lookup: DictionaryLookup) => void;
|
|
447
|
-
translateDictionaryObject: (lookup: DictionaryLookup) => void;
|
|
448
|
-
subscribeToTranslate: <T extends Translation>(lookup: TranslateLookup<T>, listener: StoreListener) => Unsubscribe;
|
|
449
|
-
subscribeToTranslationEvents: (listener: TranslateEventListener) => Unsubscribe;
|
|
450
|
-
subscribeToDictionaryEntryEvents: (listener: DictionaryStoreListener) => Unsubscribe;
|
|
451
|
-
subscribeToDictionaryObjectEvents: (listener: DictionaryStoreListener) => Unsubscribe;
|
|
452
|
-
getTranslateSnapshot: <T extends Translation>(lookup: TranslateLookup<T>, translationsSnapshot?: Record<Locale, Record<Hash, Translation>>) => TranslateSnapshot<T>;
|
|
453
|
-
getDictionaryEntrySnapshot: (lookup: DictionaryLookup, dictionariesSnapshot?: Record<Locale, Dictionary>) => DictionaryEntrySnapshot;
|
|
454
|
-
getDictionaryObjectSnapshot: (lookup: DictionaryLookup, dictionariesSnapshot?: Record<Locale, Dictionary>) => DictionaryObjectSnapshot;
|
|
455
|
-
private emitTranslateEvent;
|
|
456
|
-
private emitDictionaryEvent;
|
|
457
|
-
}
|
|
458
|
-
//#endregion
|
|
459
|
-
//#region src/hooks/utils/missing-translation.d.ts
|
|
460
|
-
type OnMissingTranslation = <T extends Translation>(lookup: TranslateLookup<T>) => void;
|
|
461
|
-
type OnMissingDictionaryEntry = (lookup: DictionaryLookup) => void;
|
|
462
|
-
type OnMissingDictionaryObj = (lookup: DictionaryLookup) => void;
|
|
463
|
-
//#endregion
|
|
464
|
-
//#region src/context/InternalGTProvider.d.ts
|
|
465
|
-
type InternalGTProviderProps = {
|
|
466
|
-
children?: ReactNode;
|
|
467
|
-
translations: Record<Locale, Record<Hash, Translation>>;
|
|
468
|
-
dictionaries?: Record<Locale, Dictionary>;
|
|
469
|
-
conditionStore: WritableConditionStoreInterface;
|
|
470
|
-
i18nStore: I18nStore;
|
|
471
|
-
onMissingTranslation?: OnMissingTranslation;
|
|
472
|
-
onMissingDictionaryEntry?: OnMissingDictionaryEntry;
|
|
473
|
-
onMissingDictionaryObj?: OnMissingDictionaryObj;
|
|
474
|
-
};
|
|
475
|
-
/**
|
|
476
|
-
* - Shared provider logic btwn client and server providers
|
|
477
|
-
* - This is not userfacing, it should be wrapped in a userfacing provider with runtime-specific logic
|
|
478
|
-
* - Locale and translations (and dictionaries if applicable) are required
|
|
479
|
-
*
|
|
480
|
-
* TODO: selectively filter to only pass new translations to client for dev hot reload
|
|
481
|
-
* TODO: rename parent directory to "/provider" (separate PR)
|
|
482
|
-
*/
|
|
483
|
-
declare function InternalGTProvider({
|
|
484
|
-
children,
|
|
485
|
-
translations,
|
|
486
|
-
dictionaries,
|
|
487
|
-
conditionStore,
|
|
488
|
-
i18nStore,
|
|
489
|
-
onMissingTranslation,
|
|
490
|
-
onMissingDictionaryEntry,
|
|
491
|
-
onMissingDictionaryObj
|
|
492
|
-
}: InternalGTProviderProps): _$react_jsx_runtime0.JSX.Element;
|
|
493
|
-
//#endregion
|
|
494
|
-
export { Branch, Currency, DateTime, Derive, GtInternalBranch, GtInternalCurrency, GtInternalDateTime, GtInternalDerive, GtInternalNum, GtInternalPlural, GtInternalRelativeTime, GtInternalTranslateJsx, GtInternalVar, I18nStore, InternalGTProvider, type InternalGTProviderProps, InternalLocaleSelector, InternalRegionSelector, Num, Plural, RelativeTime, T, Var };
|
|
495
|
-
//# sourceMappingURL=components.d.ts.map
|
|
1
|
+
import { Branch, GtInternalBranch } from "./components/branches/Branch.js";
|
|
2
|
+
import { Derive, GtInternalDerive } from "./components/derivation/Derive.js";
|
|
3
|
+
import { GtInternalVar, Var } from "./components/variables/Var.js";
|
|
4
|
+
import { I18nStore } from "./i18n-store/I18nStore.js";
|
|
5
|
+
import { GtInternalPlural, Plural } from "./components/branches/Plural.js";
|
|
6
|
+
import { GtInternalTranslateJsx, T } from "./components/translation/T.js";
|
|
7
|
+
import { Currency, GtInternalCurrency } from "./components/variables/Currency.js";
|
|
8
|
+
import { DateTime, GtInternalDateTime } from "./components/variables/DateTime.js";
|
|
9
|
+
import { GtInternalNum, Num } from "./components/variables/Num.js";
|
|
10
|
+
import { GtInternalRelativeTime, RelativeTime } from "./components/variables/RelativeTime.js";
|
|
11
|
+
import { InternalLocaleSelector } from "./components/helpers/InternalLocaleSelector.js";
|
|
12
|
+
import { InternalRegionSelector } from "./components/helpers/InternalRegionSelector.js";
|
|
13
|
+
import { InternalGTProvider, InternalGTProviderProps } from "./context/InternalGTProvider.js";
|
|
14
|
+
export { Branch, Currency, DateTime, Derive, GtInternalBranch, GtInternalCurrency, GtInternalDateTime, GtInternalDerive, GtInternalNum, GtInternalPlural, GtInternalRelativeTime, GtInternalTranslateJsx, GtInternalVar, I18nStore, InternalGTProvider, type InternalGTProviderProps, InternalLocaleSelector, InternalRegionSelector, Num, Plural, RelativeTime, T, Var };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I18nStore as e}from"./i18n-store/I18nStore.mjs";import{Branch as t,GtInternalBranch as n}from"./components/branches/Branch.mjs";import{GtInternalPlural as r,Plural as i}from"./components/branches/Plural.mjs";import{Derive as a,GtInternalDerive as o}from"./components/derivation/Derive.mjs";import{Currency as s,GtInternalCurrency as c}from"./components/variables/Currency.mjs";import{DateTime as l,GtInternalDateTime as u}from"./components/variables/DateTime.mjs";import{GtInternalNum as d,Num as f}from"./components/variables/Num.mjs";import{GtInternalRelativeTime as p,RelativeTime as m}from"./components/variables/RelativeTime.mjs";import{GtInternalVar as h,Var as g}from"./components/variables/Var.mjs";import{GtInternalTranslateJsx as _,T as v}from"./components/translation/T.mjs";import{InternalLocaleSelector as y}from"./components/helpers/InternalLocaleSelector.mjs";import{InternalRegionSelector as b}from"./components/helpers/InternalRegionSelector.mjs";import{InternalGTProvider as x}from"./context/InternalGTProvider.mjs";export{t as Branch,s as Currency,l as DateTime,a as Derive,n as GtInternalBranch,c as GtInternalCurrency,u as GtInternalDateTime,o as GtInternalDerive,d as GtInternalNum,r as GtInternalPlural,p as GtInternalRelativeTime,_ as GtInternalTranslateJsx,h as GtInternalVar,e as I18nStore,x as InternalGTProvider,y as InternalLocaleSelector,b as InternalRegionSelector,f as Num,i as Plural,m as RelativeTime,v as T,g as Var};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`gt-i18n/internal`),t=require(`generaltranslation/internal`);const{getConditionStore:n,setConditionStore:r,isConditionStoreInitialized:i}=(0,e.createConditionStoreSingleton)((0,t.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot read GT runtime context before it has been initialized`,why:`The internal ConditionStore is unavailable`,fix:`Call initializeGT() during setup (gt-next runs this automatically) and add a <GTProvider> at the root of your component tree.`}));exports.getConditionStore=n,exports.isConditionStoreInitialized=i;
|
|
2
|
+
//# sourceMappingURL=singleton-operations.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singleton-operations.cjs","names":[],"sources":["../../src/condition-store/singleton-operations.ts"],"sourcesContent":["import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport { createConditionStoreSingleton } from 'gt-i18n/internal';\nimport type { ReadonlyConditionStoreInterface } from 'gt-i18n/internal/types';\n\nconst conditionStoreNotInitializedError = createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot read GT runtime context before it has been initialized',\n why: 'The internal ConditionStore is unavailable',\n fix: 'Call initializeGT() during setup (gt-next runs this automatically) and add a <GTProvider> at the root of your component tree.',\n});\n\nconst { getConditionStore, setConditionStore, isConditionStoreInitialized } =\n createConditionStoreSingleton<ReadonlyConditionStoreInterface>(\n conditionStoreNotInitializedError\n );\n\nexport {\n getConditionStore as getReadonlyConditionStore,\n setConditionStore as setReadonlyConditionStore,\n isConditionStoreInitialized as isReadonlyConditionStoreInitialized,\n};\n"],"mappings":"wHAYA,KAAM,CAAE,oBAAmB,oBAAmB,gCAAA,EAAA,EAAA,gCAAA,EAAA,EAAA,yBARoB,CAChE,OAAQ,iCACR,SAAU,QACV,aAAc,gEACd,IAAK,6CACL,IAAK,gIACN,CAIoC,CAClC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReadonlyConditionStoreInterface } from "gt-i18n/internal/types";
|
|
2
|
+
|
|
3
|
+
//#region src/condition-store/singleton-operations.d.ts
|
|
4
|
+
declare const getConditionStore: () => ReadonlyConditionStoreInterface, setConditionStore: (next: ReadonlyConditionStoreInterface) => void, isConditionStoreInitialized: () => boolean;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { getConditionStore };
|
|
7
|
+
//# sourceMappingURL=singleton-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singleton-operations.d.ts","names":[],"sources":["../../src/condition-store/singleton-operations.ts"],"mappings":";;;cAYQ,iBAAA,QAAiB,+BAAA,EAAE,iBAAA,GAAiB,IAAA,EAAA,+BAAA,WAAE,2BAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createConditionStoreSingleton as e}from"gt-i18n/internal";import{createDiagnosticMessage as t}from"generaltranslation/internal";const{getConditionStore:n,setConditionStore:r,isConditionStoreInitialized:i}=e(t({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot read GT runtime context before it has been initialized`,why:`The internal ConditionStore is unavailable`,fix:`Call initializeGT() during setup (gt-next runs this automatically) and add a <GTProvider> at the root of your component tree.`}));export{n as getConditionStore,i as isConditionStoreInitialized};
|
|
2
|
+
//# sourceMappingURL=singleton-operations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singleton-operations.mjs","names":[],"sources":["../../src/condition-store/singleton-operations.ts"],"sourcesContent":["import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport { createConditionStoreSingleton } from 'gt-i18n/internal';\nimport type { ReadonlyConditionStoreInterface } from 'gt-i18n/internal/types';\n\nconst conditionStoreNotInitializedError = createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot read GT runtime context before it has been initialized',\n why: 'The internal ConditionStore is unavailable',\n fix: 'Call initializeGT() during setup (gt-next runs this automatically) and add a <GTProvider> at the root of your component tree.',\n});\n\nconst { getConditionStore, setConditionStore, isConditionStoreInitialized } =\n createConditionStoreSingleton<ReadonlyConditionStoreInterface>(\n conditionStoreNotInitializedError\n );\n\nexport {\n getConditionStore as getReadonlyConditionStore,\n setConditionStore as setReadonlyConditionStore,\n isConditionStoreInitialized as isReadonlyConditionStoreInitialized,\n};\n"],"mappings":"uIAYA,KAAM,CAAE,oBAAmB,oBAAmB,+BAC5C,EATwC,EAAwB,CAChE,OAAQ,iCACR,SAAU,QACV,aAAc,gEACd,IAAK,6CACL,IAAK,gIACN,CAIoC,CAClC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./context.cjs`);let t=require(`react/jsx-runtime`),n=require(`react`);const r=e.getGTContext();function i({children:e,translations:i,dictionaries:a,conditionStore:o,i18nStore:s,onMissingTranslation:c,onMissingDictionaryEntry:l,onMissingDictionaryObj:u}){let d=(0,n.useMemo)(()=>({translationsSnapshot:i,dictionariesSnapshot:a??{},i18nStore:s,conditionStore:o,onMissingTranslation:c,onMissingDictionaryEntry:l,onMissingDictionaryObj:u}),[i,a,s,o,c,l,u]);return(0,n.useEffect)(()=>{s.updateTranslations(i),s.updateDictionaries(a??{})},[i,a,s]),(0,t.jsx)(r.Provider,{value:d,children:e})}exports.InternalGTProvider=i;
|
|
2
|
+
//# sourceMappingURL=InternalGTProvider.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InternalGTProvider.cjs","names":["getGTContext"],"sources":["../../src/context/InternalGTProvider.tsx"],"sourcesContent":["import { useEffect, useMemo, type ReactNode } from 'react';\nimport { I18nStore } from '../i18n-store/I18nStore';\nimport type { Dictionary, Translation } from 'gt-i18n/types';\nimport type {\n Locale,\n Hash,\n WritableConditionStoreInterface,\n} from 'gt-i18n/internal/types';\nimport { getGTContext } from './context';\nimport type {\n OnMissingDictionaryEntry,\n OnMissingDictionaryObj,\n OnMissingTranslation,\n} from '../hooks/utils/missing-translation';\n\nexport type InternalGTProviderProps = {\n children?: ReactNode;\n // For streaming translations to server\n translations: Record<Locale, Record<Hash, Translation>>;\n dictionaries?: Record<Locale, Dictionary>;\n // Declared upstream dependent on environment\n conditionStore: WritableConditionStoreInterface;\n i18nStore: I18nStore;\n // Custom override missing translation behavior for dev hot reload\n onMissingTranslation?: OnMissingTranslation;\n onMissingDictionaryEntry?: OnMissingDictionaryEntry;\n onMissingDictionaryObj?: OnMissingDictionaryObj;\n};\n\n// ===== Component ===== //\nconst GTContext = getGTContext();\n/**\n * - Shared provider logic btwn client and server providers\n * - This is not userfacing, it should be wrapped in a userfacing provider with runtime-specific logic\n * - Locale and translations (and dictionaries if applicable) are required\n *\n * TODO: selectively filter to only pass new translations to client for dev hot reload\n * TODO: rename parent directory to \"/provider\" (separate PR)\n */\nexport function InternalGTProvider({\n children,\n translations,\n dictionaries,\n conditionStore,\n i18nStore,\n onMissingTranslation,\n onMissingDictionaryEntry,\n onMissingDictionaryObj,\n}: InternalGTProviderProps) {\n const value = useMemo(\n () => ({\n translationsSnapshot: translations,\n dictionariesSnapshot: dictionaries ?? {},\n i18nStore,\n conditionStore,\n onMissingTranslation,\n onMissingDictionaryEntry,\n onMissingDictionaryObj,\n }),\n [\n translations,\n dictionaries,\n i18nStore,\n conditionStore,\n onMissingTranslation,\n onMissingDictionaryEntry,\n onMissingDictionaryObj,\n ]\n );\n\n // Update cache with data from server, do not emit events\n useEffect(() => {\n i18nStore.updateTranslations(translations);\n i18nStore.updateDictionaries(dictionaries ?? {});\n }, [translations, dictionaries, i18nStore]);\n\n return <GTContext.Provider value={value}>{children}</GTContext.Provider>;\n}\n"],"mappings":"oIA8BA,MAAM,EAAYA,EAAAA,cAAc,CAShC,SAAgB,EAAmB,CACjC,WACA,eACA,eACA,iBACA,YACA,uBACA,2BACA,0BAC0B,CAC1B,IAAM,GAAA,EAAA,EAAA,cACG,CACL,qBAAsB,EACtB,qBAAsB,GAAgB,EAAE,CACxC,YACA,iBACA,uBACA,2BACA,yBACD,EACD,CACE,EACA,EACA,EACA,EACA,EACA,EACA,EACD,CACF,CAQD,OALA,EAAA,EAAA,eAAgB,CACd,EAAU,mBAAmB,EAAa,CAC1C,EAAU,mBAAmB,GAAgB,EAAE,CAAC,EAC/C,CAAC,EAAc,EAAc,EAAU,CAAC,EAEpC,EAAA,EAAA,KAAC,EAAU,SAAX,CAA2B,QAAQ,WAA8B,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { I18nStore } from "../i18n-store/I18nStore.js";
|
|
2
|
+
import { OnMissingDictionaryEntry, OnMissingDictionaryObj, OnMissingTranslation } from "../hooks/utils/missing-translation.js";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import { Dictionary, Translation } from "gt-i18n/types";
|
|
5
|
+
import { Hash, Locale, WritableConditionStoreInterface } from "gt-i18n/internal/types";
|
|
6
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/context/InternalGTProvider.d.ts
|
|
9
|
+
type InternalGTProviderProps = {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
translations: Record<Locale, Record<Hash, Translation>>;
|
|
12
|
+
dictionaries?: Record<Locale, Dictionary>;
|
|
13
|
+
conditionStore: WritableConditionStoreInterface;
|
|
14
|
+
i18nStore: I18nStore;
|
|
15
|
+
onMissingTranslation?: OnMissingTranslation;
|
|
16
|
+
onMissingDictionaryEntry?: OnMissingDictionaryEntry;
|
|
17
|
+
onMissingDictionaryObj?: OnMissingDictionaryObj;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* - Shared provider logic btwn client and server providers
|
|
21
|
+
* - This is not userfacing, it should be wrapped in a userfacing provider with runtime-specific logic
|
|
22
|
+
* - Locale and translations (and dictionaries if applicable) are required
|
|
23
|
+
*
|
|
24
|
+
* TODO: selectively filter to only pass new translations to client for dev hot reload
|
|
25
|
+
* TODO: rename parent directory to "/provider" (separate PR)
|
|
26
|
+
*/
|
|
27
|
+
declare function InternalGTProvider({
|
|
28
|
+
children,
|
|
29
|
+
translations,
|
|
30
|
+
dictionaries,
|
|
31
|
+
conditionStore,
|
|
32
|
+
i18nStore,
|
|
33
|
+
onMissingTranslation,
|
|
34
|
+
onMissingDictionaryEntry,
|
|
35
|
+
onMissingDictionaryObj
|
|
36
|
+
}: InternalGTProviderProps): _$react_jsx_runtime0.JSX.Element;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { InternalGTProvider, InternalGTProviderProps };
|
|
39
|
+
//# sourceMappingURL=InternalGTProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InternalGTProvider.d.ts","names":[],"sources":["../../src/context/InternalGTProvider.tsx"],"mappings":";;;;;;;;KAeY,uBAAA;EACV,QAAA,GAAW,SAAA;EAEX,YAAA,EAAc,MAAA,CAAO,MAAA,EAAQ,MAAA,CAAO,IAAA,EAAM,WAAA;EAC1C,YAAA,GAAe,MAAA,CAAO,MAAA,EAAQ,UAAA;EAE9B,cAAA,EAAgB,+BAAA;EAChB,SAAA,EAAW,SAAA;EAEX,oBAAA,GAAuB,oBAAA;EACvB,wBAAA,GAA2B,wBAAA;EAC3B,sBAAA,GAAyB,sBAAA;AAAA;;;;;;;;;iBAaX,kBAAA,CAAA;EACd,QAAA;EACA,YAAA;EACA,YAAA;EACA,cAAA;EACA,SAAA;EACA,oBAAA;EACA,wBAAA;EACA;AAAA,GACC,uBAAA,GAAuB,oBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{getGTContext as e}from"./context.mjs";import{jsx as t}from"react/jsx-runtime";import{useEffect as n,useMemo as r}from"react";const i=e();function a({children:e,translations:a,dictionaries:o,conditionStore:s,i18nStore:c,onMissingTranslation:l,onMissingDictionaryEntry:u,onMissingDictionaryObj:d}){let f=r(()=>({translationsSnapshot:a,dictionariesSnapshot:o??{},i18nStore:c,conditionStore:s,onMissingTranslation:l,onMissingDictionaryEntry:u,onMissingDictionaryObj:d}),[a,o,c,s,l,u,d]);return n(()=>{c.updateTranslations(a),c.updateDictionaries(o??{})},[a,o,c]),t(i.Provider,{value:f,children:e})}export{a as InternalGTProvider};
|
|
2
|
+
//# sourceMappingURL=InternalGTProvider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InternalGTProvider.mjs","names":[],"sources":["../../src/context/InternalGTProvider.tsx"],"sourcesContent":["import { useEffect, useMemo, type ReactNode } from 'react';\nimport { I18nStore } from '../i18n-store/I18nStore';\nimport type { Dictionary, Translation } from 'gt-i18n/types';\nimport type {\n Locale,\n Hash,\n WritableConditionStoreInterface,\n} from 'gt-i18n/internal/types';\nimport { getGTContext } from './context';\nimport type {\n OnMissingDictionaryEntry,\n OnMissingDictionaryObj,\n OnMissingTranslation,\n} from '../hooks/utils/missing-translation';\n\nexport type InternalGTProviderProps = {\n children?: ReactNode;\n // For streaming translations to server\n translations: Record<Locale, Record<Hash, Translation>>;\n dictionaries?: Record<Locale, Dictionary>;\n // Declared upstream dependent on environment\n conditionStore: WritableConditionStoreInterface;\n i18nStore: I18nStore;\n // Custom override missing translation behavior for dev hot reload\n onMissingTranslation?: OnMissingTranslation;\n onMissingDictionaryEntry?: OnMissingDictionaryEntry;\n onMissingDictionaryObj?: OnMissingDictionaryObj;\n};\n\n// ===== Component ===== //\nconst GTContext = getGTContext();\n/**\n * - Shared provider logic btwn client and server providers\n * - This is not userfacing, it should be wrapped in a userfacing provider with runtime-specific logic\n * - Locale and translations (and dictionaries if applicable) are required\n *\n * TODO: selectively filter to only pass new translations to client for dev hot reload\n * TODO: rename parent directory to \"/provider\" (separate PR)\n */\nexport function InternalGTProvider({\n children,\n translations,\n dictionaries,\n conditionStore,\n i18nStore,\n onMissingTranslation,\n onMissingDictionaryEntry,\n onMissingDictionaryObj,\n}: InternalGTProviderProps) {\n const value = useMemo(\n () => ({\n translationsSnapshot: translations,\n dictionariesSnapshot: dictionaries ?? {},\n i18nStore,\n conditionStore,\n onMissingTranslation,\n onMissingDictionaryEntry,\n onMissingDictionaryObj,\n }),\n [\n translations,\n dictionaries,\n i18nStore,\n conditionStore,\n onMissingTranslation,\n onMissingDictionaryEntry,\n onMissingDictionaryObj,\n ]\n );\n\n // Update cache with data from server, do not emit events\n useEffect(() => {\n i18nStore.updateTranslations(translations);\n i18nStore.updateDictionaries(dictionaries ?? {});\n }, [translations, dictionaries, i18nStore]);\n\n return <GTContext.Provider value={value}>{children}</GTContext.Provider>;\n}\n"],"mappings":"oIA8BA,MAAM,EAAY,GAAc,CAShC,SAAgB,EAAmB,CACjC,WACA,eACA,eACA,iBACA,YACA,uBACA,2BACA,0BAC0B,CAC1B,IAAM,EAAQ,OACL,CACL,qBAAsB,EACtB,qBAAsB,GAAgB,EAAE,CACxC,YACA,iBACA,uBACA,2BACA,yBACD,EACD,CACE,EACA,EACA,EACA,EACA,EACA,EACA,EACD,CACF,CAQD,OALA,MAAgB,CACd,EAAU,mBAAmB,EAAa,CAC1C,EAAU,mBAAmB,GAAgB,EAAE,CAAC,EAC/C,CAAC,EAAc,EAAc,EAAU,CAAC,CAEpC,EAAC,EAAU,SAAX,CAA2B,QAAQ,WAA8B,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../setup/i18nConfig.cjs`);let t=require(`gt-i18n/internal`),n=require(`generaltranslation/internal`),r=require(`react`);const i=(0,t.createGlobalSingleton)({namespace:`reactCore`,key:`gtContext`,source:`@generaltranslation/react-core`,notInitialized:()=>(0,n.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot read GTContext before it has been initialized`,why:`the internal GTContext singleton is unavailable`,fix:`Add a <GTProvider> at the root of your component tree.`})});function a(){return i.isInitialized()||i.set((0,r.createContext)(void 0)),i.get()}function o(){let t=(0,r.useContext)(a());if(t||e.getI18nConfig().getRenderStrategy()===`SPA`)return t;throw Error(s())}function s(){return(0,n.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`GT runtime context could not be read`,why:`GTContext was accessed outside of a <GTProvider>`,fix:`Add a <GTProvider> at the root of your component tree.`})}exports.getGTContext=a,exports.useGTContext=o;
|
|
2
|
+
//# sourceMappingURL=context.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.cjs","names":["getI18nConfig"],"sources":["../../src/context/context.ts"],"sourcesContent":["import {\n Dictionary,\n Hash,\n Locale,\n ReadonlyConditionStoreInterface,\n} from 'gt-i18n/internal/types';\nimport { Translation } from 'gt-i18n/types';\nimport { createDiagnosticMessage } from 'generaltranslation/internal';\nimport { createGlobalSingleton } from 'gt-i18n/internal';\nimport { createContext, useContext, type Context } from 'react';\nimport { I18nStore } from '../i18n-store/I18nStore';\nimport { getI18nConfig } from '../setup/i18nConfig';\nimport type {\n OnMissingTranslation,\n OnMissingDictionaryEntry,\n OnMissingDictionaryObj,\n} from '../hooks/utils/missing-translation';\n\nexport type GTContextType = {\n /**\n * Source of truth for translations, streamed from server\n * In SPA mode, these won't be accessible and translations\n * can be accessed via useSyncExternalStore() directly\n */\n translationsSnapshot: Record<Locale, Record<Hash, Translation>>;\n dictionariesSnapshot: Record<Locale, Dictionary>;\n /**\n * I18nStore allows us to sync state updates in ConditionStore and I18nCache\n * with renders\n */\n i18nStore: I18nStore;\n /**\n * ConditionStore should always remain separate from i18nStore as\n * it manages how we perform lookups\n */\n conditionStore: ReadonlyConditionStoreInterface;\n /**\n * Custom override behavior on missing translations\n * Used for server triggering tx hmr b/c no access to useEffect\n */\n onMissingTranslation?: OnMissingTranslation;\n onMissingDictionaryEntry?: OnMissingDictionaryEntry;\n onMissingDictionaryObj?: OnMissingDictionaryObj;\n};\n\nconst gtContextSingleton = createGlobalSingleton<\n Context<GTContextType | undefined>\n>({\n namespace: 'reactCore',\n key: 'gtContext',\n source: '@generaltranslation/react-core',\n notInitialized: () =>\n createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot read GTContext before it has been initialized',\n why: 'the internal GTContext singleton is unavailable',\n fix: 'Add a <GTProvider> at the root of your component tree.',\n }),\n});\n\nexport function getGTContext(): Context<GTContextType | undefined> {\n // Lazily create the React context once and share it across instances.\n if (!gtContextSingleton.isInitialized()) {\n gtContextSingleton.set(createContext<GTContextType | undefined>(undefined));\n }\n return gtContextSingleton.get();\n}\n\nexport function useGTContext(): GTContextType | undefined {\n const context = useContext(getGTContext());\n if (context || getI18nConfig().getRenderStrategy() === 'SPA') {\n return context;\n }\n /**\n * TODO: in a separate PR, we should figure out how to make this more of a forgiving system\n */\n throw new Error(createMissingGTProviderError());\n}\n\nfunction createMissingGTProviderError(): string {\n return createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'GT runtime context could not be read',\n why: 'GTContext was accessed outside of a <GTProvider>',\n fix: 'Add a <GTProvider> at the root of your component tree.',\n });\n}\n"],"mappings":"sLA6CA,MAAM,GAAA,EAAA,EAAA,uBAEJ,CACA,UAAW,YACX,IAAK,YACL,OAAQ,iCACR,oBAAA,EAAA,EAAA,yBAC0B,CACtB,OAAQ,iCACR,SAAU,QACV,aAAc,uDACd,IAAK,kDACL,IAAK,yDACN,CAAC,CACL,CAAC,CAEF,SAAgB,GAAmD,CAKjE,OAHK,EAAmB,eAAe,EACrC,EAAmB,KAAA,EAAA,EAAA,eAA6C,IAAA,GAAU,CAAC,CAEtE,EAAmB,KAAK,CAGjC,SAAgB,GAA0C,CACxD,IAAM,GAAA,EAAA,EAAA,YAAqB,GAAc,CAAC,CAC1C,GAAI,GAAWA,EAAAA,eAAe,CAAC,mBAAmB,GAAK,MACrD,OAAO,EAKT,MAAU,MAAM,GAA8B,CAAC,CAGjD,SAAS,GAAuC,CAC9C,OAAA,EAAA,EAAA,yBAA+B,CAC7B,OAAQ,iCACR,SAAU,QACV,aAAc,uCACd,IAAK,mDACL,IAAK,yDACN,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{getI18nConfig as e}from"../setup/i18nConfig.mjs";import{createGlobalSingleton as t}from"gt-i18n/internal";import{createDiagnosticMessage as n}from"generaltranslation/internal";import{createContext as r,useContext as i}from"react";const a=t({namespace:`reactCore`,key:`gtContext`,source:`@generaltranslation/react-core`,notInitialized:()=>n({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot read GTContext before it has been initialized`,why:`the internal GTContext singleton is unavailable`,fix:`Add a <GTProvider> at the root of your component tree.`})});function o(){return a.isInitialized()||a.set(r(void 0)),a.get()}function s(){let t=i(o());if(t||e().getRenderStrategy()===`SPA`)return t;throw Error(c())}function c(){return n({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`GT runtime context could not be read`,why:`GTContext was accessed outside of a <GTProvider>`,fix:`Add a <GTProvider> at the root of your component tree.`})}export{o as getGTContext,s as useGTContext};
|
|
2
|
+
//# sourceMappingURL=context.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.mjs","names":["getI18nConfig"],"sources":["../../src/context/context.ts"],"sourcesContent":["import {\n Dictionary,\n Hash,\n Locale,\n ReadonlyConditionStoreInterface,\n} from 'gt-i18n/internal/types';\nimport { Translation } from 'gt-i18n/types';\nimport { createDiagnosticMessage } from 'generaltranslation/internal';\nimport { createGlobalSingleton } from 'gt-i18n/internal';\nimport { createContext, useContext, type Context } from 'react';\nimport { I18nStore } from '../i18n-store/I18nStore';\nimport { getI18nConfig } from '../setup/i18nConfig';\nimport type {\n OnMissingTranslation,\n OnMissingDictionaryEntry,\n OnMissingDictionaryObj,\n} from '../hooks/utils/missing-translation';\n\nexport type GTContextType = {\n /**\n * Source of truth for translations, streamed from server\n * In SPA mode, these won't be accessible and translations\n * can be accessed via useSyncExternalStore() directly\n */\n translationsSnapshot: Record<Locale, Record<Hash, Translation>>;\n dictionariesSnapshot: Record<Locale, Dictionary>;\n /**\n * I18nStore allows us to sync state updates in ConditionStore and I18nCache\n * with renders\n */\n i18nStore: I18nStore;\n /**\n * ConditionStore should always remain separate from i18nStore as\n * it manages how we perform lookups\n */\n conditionStore: ReadonlyConditionStoreInterface;\n /**\n * Custom override behavior on missing translations\n * Used for server triggering tx hmr b/c no access to useEffect\n */\n onMissingTranslation?: OnMissingTranslation;\n onMissingDictionaryEntry?: OnMissingDictionaryEntry;\n onMissingDictionaryObj?: OnMissingDictionaryObj;\n};\n\nconst gtContextSingleton = createGlobalSingleton<\n Context<GTContextType | undefined>\n>({\n namespace: 'reactCore',\n key: 'gtContext',\n source: '@generaltranslation/react-core',\n notInitialized: () =>\n createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot read GTContext before it has been initialized',\n why: 'the internal GTContext singleton is unavailable',\n fix: 'Add a <GTProvider> at the root of your component tree.',\n }),\n});\n\nexport function getGTContext(): Context<GTContextType | undefined> {\n // Lazily create the React context once and share it across instances.\n if (!gtContextSingleton.isInitialized()) {\n gtContextSingleton.set(createContext<GTContextType | undefined>(undefined));\n }\n return gtContextSingleton.get();\n}\n\nexport function useGTContext(): GTContextType | undefined {\n const context = useContext(getGTContext());\n if (context || getI18nConfig().getRenderStrategy() === 'SPA') {\n return context;\n }\n /**\n * TODO: in a separate PR, we should figure out how to make this more of a forgiving system\n */\n throw new Error(createMissingGTProviderError());\n}\n\nfunction createMissingGTProviderError(): string {\n return createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'GT runtime context could not be read',\n why: 'GTContext was accessed outside of a <GTProvider>',\n fix: 'Add a <GTProvider> at the root of your component tree.',\n });\n}\n"],"mappings":"6OA6CA,MAAM,EAAqB,EAEzB,CACA,UAAW,YACX,IAAK,YACL,OAAQ,iCACR,mBACE,EAAwB,CACtB,OAAQ,iCACR,SAAU,QACV,aAAc,uDACd,IAAK,kDACL,IAAK,yDACN,CAAC,CACL,CAAC,CAEF,SAAgB,GAAmD,CAKjE,OAHK,EAAmB,eAAe,EACrC,EAAmB,IAAI,EAAyC,IAAA,GAAU,CAAC,CAEtE,EAAmB,KAAK,CAGjC,SAAgB,GAA0C,CACxD,IAAM,EAAU,EAAW,GAAc,CAAC,CAC1C,GAAI,GAAWA,GAAe,CAAC,mBAAmB,GAAK,MACrD,OAAO,EAKT,MAAU,MAAM,GAA8B,CAAC,CAGjD,SAAS,GAAuC,CAC9C,OAAO,EAAwB,CAC7B,OAAQ,iCACR,SAAU,QACV,aAAc,uCACd,IAAK,mDACL,IAAK,yDACN,CAAC"}
|