@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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{getReactI18nCache as e}from"../i18n-cache/singleton-operations.mjs";import{subscribeToSet as t}from"./utils/subscriptions.mjs";import{lookupTranslation as n}from"./utils/translations.mjs";import{lookupDictionaryEntry as r,lookupDictionaryObject as i}from"./utils/dictionaries.mjs";import{getTranslateListenerKey as a}from"gt-i18n/internal";var o=class{translateListeners=new Set;dictionaryEntryListeners=new Set;dictionaryObjectListeners=new Set;constructor(){}updateTranslations=t=>{e().updateTranslations(t)};updateDictionaries=t=>{e().updateDictionaries(t)};translate=async t=>e().lookupTranslationWithFallback(t.locale,t.message,t.options).then(e=>{this.emitTranslateEvent(t)});translateDictionaryEntry=t=>{e().lookupDictionaryWithFallback(t.locale,t.id).then(e=>{this.emitDictionaryEvent(t)})};translateDictionaryObject=t=>{e().lookupDictionaryObjWithFallback(t.locale,t.id).then(e=>{this.emitDictionaryEvent(t)})};subscribeToTranslate=(e,n)=>{let r=a(e);return t(this.translateListeners,e=>{a(e)===r&&n()})};subscribeToTranslationEvents=e=>t(this.translateListeners,e);subscribeToDictionaryEntryEvents=e=>t(this.dictionaryEntryListeners,e);subscribeToDictionaryObjectEvents=e=>t(this.dictionaryObjectListeners,e);getTranslateSnapshot=(t,r={})=>n(r,t)??e().lookupTranslation(t.locale,t.message,t.options);getDictionaryEntrySnapshot=(t,n={})=>r(n,t)??e().lookupDictionary(t.locale,t.id);getDictionaryObjectSnapshot=(t,n={})=>i(n,t)??e().lookupDictionaryObj(t.locale,t.id);emitTranslateEvent(e){this.translateListeners.forEach(t=>t(e))}emitDictionaryEvent(e){this.dictionaryEntryListeners.forEach(t=>t(e)),this.dictionaryObjectListeners.forEach(t=>{t(e)})}};export{o as I18nStore};
|
|
2
|
+
//# sourceMappingURL=I18nStore.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"I18nStore.mjs","names":[],"sources":["../../src/i18n-store/I18nStore.ts"],"sourcesContent":["import { getTranslateListenerKey } from 'gt-i18n/internal';\nimport type {\n DictionaryEntrySnapshot,\n DictionaryLookup,\n DictionaryObjectSnapshot,\n StoreListener,\n TranslateEventListener,\n TranslateLookup,\n TranslateSnapshot,\n Unsubscribe,\n} from './storeTypes';\nimport type { Dictionary, Translation } from 'gt-i18n/types';\nimport { subscribeToSet } from './utils/subscriptions';\nimport { Hash, Locale } from 'gt-i18n/internal/types';\nimport { getReactI18nCache } from '../i18n-cache/singleton-operations';\nimport { lookupTranslation } from './utils/translations';\nimport {\n lookupDictionaryEntry,\n lookupDictionaryObject,\n} from './utils/dictionaries';\n\nexport type DictionaryStoreListener = (event: DictionaryLookup) => void;\n\n/**\n * I18nStore gives us the ability to perform client-side updates to translations.\n * Primarily useful for dev hot reload.\n *\n * This is the stateful primitive behind lookup subscriptions and runtime\n * translation requests. It intentionally does not know whether lookups are\n * being served from SPA singletons or SRA provider snapshots; that policy lives\n * in LookupAdapter, not in this store.\n */\nexport class I18nStore {\n // ----- Listener Sets ----- //\n\n private translateListeners = new Set<TranslateEventListener>();\n private dictionaryEntryListeners = new Set<DictionaryStoreListener>();\n private dictionaryObjectListeners = new Set<DictionaryStoreListener>();\n\n /**\n * I18nCache must be already initialized\n */\n constructor() {}\n\n // ========== Translation Updates ========== //\n\n updateTranslations = (\n translations: Record<Locale, Record<Hash, Translation>>\n ): void => {\n getReactI18nCache().updateTranslations(translations);\n };\n\n updateDictionaries = (dictionaries: Record<Locale, Dictionary>): void => {\n getReactI18nCache().updateDictionaries(dictionaries);\n };\n\n // ========== runtime translation ========== //\n\n translate = async <T extends Translation>(\n lookup: TranslateLookup<T>\n ): Promise<void> => {\n return getReactI18nCache()\n .lookupTranslationWithFallback(\n lookup.locale,\n lookup.message,\n lookup.options\n )\n .then((translation) => {\n if (translation == null) {\n // TODO: warn about runtime translation failure\n }\n this.emitTranslateEvent(lookup);\n });\n };\n\n translateDictionaryEntry = (lookup: DictionaryLookup): void => {\n getReactI18nCache()\n .lookupDictionaryWithFallback(lookup.locale, lookup.id)\n .then((dictionaryEntry) => {\n if (dictionaryEntry == null) {\n // TODO: warn about runtime dictionary translation failure\n }\n this.emitDictionaryEvent(lookup);\n });\n };\n\n translateDictionaryObject = (lookup: DictionaryLookup): void => {\n getReactI18nCache()\n .lookupDictionaryObjWithFallback(lookup.locale, lookup.id)\n .then((dictionaryObject) => {\n if (dictionaryObject == null) {\n // TODO: warn about runtime dictionary translation failure\n }\n this.emitDictionaryEvent(lookup);\n });\n };\n\n // ========== UseSyncExternalStore ========== //\n\n // ----- Subscriptions ----- //\n\n // Keep subscription methods as arrow fields so hooks can pass them by\n // reference without losing access to this store instance.\n subscribeToTranslate = <T extends Translation>(\n lookup: TranslateLookup<T>,\n listener: StoreListener\n ): Unsubscribe => {\n const lookupKey = getTranslateListenerKey(lookup);\n const wrappedListener: TranslateEventListener = (lookup) => {\n if (getTranslateListenerKey(lookup) === lookupKey) {\n listener();\n }\n };\n return subscribeToSet(this.translateListeners, wrappedListener);\n };\n\n subscribeToTranslationEvents = (\n listener: TranslateEventListener\n ): Unsubscribe => {\n return subscribeToSet(this.translateListeners, listener);\n };\n\n subscribeToDictionaryEntryEvents = (\n listener: DictionaryStoreListener\n ): Unsubscribe => {\n return subscribeToSet(this.dictionaryEntryListeners, listener);\n };\n\n subscribeToDictionaryObjectEvents = (\n listener: DictionaryStoreListener\n ): Unsubscribe => {\n return subscribeToSet(this.dictionaryObjectListeners, listener);\n };\n\n // ----- Snapshots ----- //\n\n getTranslateSnapshot = <T extends Translation>(\n lookup: TranslateLookup<T>,\n translationsSnapshot: Record<Locale, Record<Hash, Translation>> = {}\n ): TranslateSnapshot<T> => {\n return (\n lookupTranslation(translationsSnapshot, lookup) ??\n getReactI18nCache().lookupTranslation<T>(\n lookup.locale,\n lookup.message,\n lookup.options\n )\n );\n };\n\n getDictionaryEntrySnapshot = (\n lookup: DictionaryLookup,\n dictionariesSnapshot: Record<Locale, Dictionary> = {}\n ): DictionaryEntrySnapshot => {\n return (\n lookupDictionaryEntry(dictionariesSnapshot, lookup) ??\n getReactI18nCache().lookupDictionary(lookup.locale, lookup.id)\n );\n };\n\n getDictionaryObjectSnapshot = (\n lookup: DictionaryLookup,\n dictionariesSnapshot: Record<Locale, Dictionary> = {}\n ): DictionaryObjectSnapshot => {\n return (\n lookupDictionaryObject(dictionariesSnapshot, lookup) ??\n getReactI18nCache().lookupDictionaryObj(lookup.locale, lookup.id)\n );\n };\n\n // ----- Listener Utilities ----- //\n\n private emitTranslateEvent(event: TranslateLookup): void {\n this.translateListeners.forEach((listener) => listener(event));\n }\n\n private emitDictionaryEvent(event: DictionaryLookup): void {\n this.dictionaryEntryListeners.forEach((listener) => listener(event));\n this.dictionaryObjectListeners.forEach((listener) => {\n listener(event);\n });\n }\n}\n"],"mappings":"2VAgCA,IAAa,EAAb,KAAuB,CAGrB,mBAA6B,IAAI,IACjC,yBAAmC,IAAI,IACvC,0BAAoC,IAAI,IAKxC,aAAc,EAId,mBACE,GACS,CACT,GAAmB,CAAC,mBAAmB,EAAa,EAGtD,mBAAsB,GAAmD,CACvE,GAAmB,CAAC,mBAAmB,EAAa,EAKtD,UAAY,KACV,IAEO,GAAmB,CACvB,8BACC,EAAO,OACP,EAAO,QACP,EAAO,QACR,CACA,KAAM,GAAgB,CAIrB,KAAK,mBAAmB,EAAO,EAC/B,CAGN,yBAA4B,GAAmC,CAC7D,GAAmB,CAChB,6BAA6B,EAAO,OAAQ,EAAO,GAAG,CACtD,KAAM,GAAoB,CAIzB,KAAK,oBAAoB,EAAO,EAChC,EAGN,0BAA6B,GAAmC,CAC9D,GAAmB,CAChB,gCAAgC,EAAO,OAAQ,EAAO,GAAG,CACzD,KAAM,GAAqB,CAI1B,KAAK,oBAAoB,EAAO,EAChC,EASN,sBACE,EACA,IACgB,CAChB,IAAM,EAAY,EAAwB,EAAO,CAMjD,OAAO,EAAe,KAAK,mBALsB,GAAW,CACtD,EAAwB,EAAO,GAAK,GACtC,GAAU,EAGiD,EAGjE,6BACE,GAEO,EAAe,KAAK,mBAAoB,EAAS,CAG1D,iCACE,GAEO,EAAe,KAAK,yBAA0B,EAAS,CAGhE,kCACE,GAEO,EAAe,KAAK,0BAA2B,EAAS,CAKjE,sBACE,EACA,EAAkE,EAAE,GAGlE,EAAkB,EAAsB,EAAO,EAC/C,GAAmB,CAAC,kBAClB,EAAO,OACP,EAAO,QACP,EAAO,QACR,CAIL,4BACE,EACA,EAAmD,EAAE,GAGnD,EAAsB,EAAsB,EAAO,EACnD,GAAmB,CAAC,iBAAiB,EAAO,OAAQ,EAAO,GAAG,CAIlE,6BACE,EACA,EAAmD,EAAE,GAGnD,EAAuB,EAAsB,EAAO,EACpD,GAAmB,CAAC,oBAAoB,EAAO,OAAQ,EAAO,GAAG,CAMrE,mBAA2B,EAA8B,CACvD,KAAK,mBAAmB,QAAS,GAAa,EAAS,EAAM,CAAC,CAGhE,oBAA4B,EAA+B,CACzD,KAAK,yBAAyB,QAAS,GAAa,EAAS,EAAM,CAAC,CACpE,KAAK,0BAA0B,QAAS,GAAa,CACnD,EAAS,EAAM,EACf"}
|
|
@@ -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`);const r=(0,t.createGlobalSingleton)({namespace:`reactCore`,key:`i18nStore`,source:`@generaltranslation/react-core`,notInitialized:()=>o()}),i=r.get,a=r.set;r.isInitialized;function o(){let t=(0,n.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot access I18nStore before it is initialized.`,fix:e.getI18nConfig().getRenderStrategy()===`SPA`?`Initialize GT before reading GT runtime context.`:`Add a <GTProvider> at the root of your component tree.`});return Error(t)}exports.getI18nStore=i,exports.setI18nStore=a;
|
|
2
|
+
//# sourceMappingURL=singleton-operations.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singleton-operations.cjs","names":["getI18nConfig"],"sources":["../../src/i18n-store/singleton-operations.ts"],"sourcesContent":["import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport { createGlobalSingleton } from 'gt-i18n/internal';\nimport { I18nStore } from './I18nStore';\nimport { getI18nConfig } from '../setup/i18nConfig';\n\n// ===== I18n Store ===== //\n\nconst i18nStoreSingleton = createGlobalSingleton<I18nStore>({\n namespace: 'reactCore',\n key: 'i18nStore',\n source: '@generaltranslation/react-core',\n notInitialized: () => createI18nStoreNotInitializedError(),\n});\n\nexport const getI18nStore = i18nStoreSingleton.get;\nexport const setI18nStore = i18nStoreSingleton.set;\nexport const isI18nStoreInitialized = i18nStoreSingleton.isInitialized;\n\nfunction createI18nStoreNotInitializedError(): Error {\n const renderStrategy = getI18nConfig().getRenderStrategy();\n const errorMessage = createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot access I18nStore before it is initialized.',\n fix:\n renderStrategy === 'SPA'\n ? 'Initialize GT before reading GT runtime context.'\n : 'Add a <GTProvider> at the root of your component tree.',\n });\n\n return new Error(errorMessage);\n}\n"],"mappings":"mKAOA,MAAM,GAAA,EAAA,EAAA,uBAAsD,CAC1D,UAAW,YACX,IAAK,YACL,OAAQ,iCACR,mBAAsB,GAAoC,CAC3D,CAAC,CAEW,EAAe,EAAmB,IAClC,EAAe,EAAmB,IACT,EAAmB,cAEzD,SAAS,GAA4C,CAEnD,IAAM,GAAA,EAAA,EAAA,yBAAuC,CAC3C,OAAQ,iCACR,SAAU,QACV,aAAc,oDACd,IALqBA,EAAAA,eAAe,CAAC,mBAMrB,GAAK,MACf,mDACA,yDACP,CAAC,CAEF,OAAW,MAAM,EAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singleton-operations.d.ts","names":[],"sources":["../../src/i18n-store/singleton-operations.ts"],"mappings":";;;cAea,YAAA,GAAY,IAAA,EAAA,SAAA"}
|
|
@@ -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";const r=t({namespace:`reactCore`,key:`i18nStore`,source:`@generaltranslation/react-core`,notInitialized:()=>o()}),i=r.get,a=r.set;r.isInitialized;function o(){let t=n({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot access I18nStore before it is initialized.`,fix:e().getRenderStrategy()===`SPA`?`Initialize GT before reading GT runtime context.`:`Add a <GTProvider> at the root of your component tree.`});return Error(t)}export{i as getI18nStore,a as setI18nStore};
|
|
2
|
+
//# sourceMappingURL=singleton-operations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singleton-operations.mjs","names":["getI18nConfig"],"sources":["../../src/i18n-store/singleton-operations.ts"],"sourcesContent":["import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport { createGlobalSingleton } from 'gt-i18n/internal';\nimport { I18nStore } from './I18nStore';\nimport { getI18nConfig } from '../setup/i18nConfig';\n\n// ===== I18n Store ===== //\n\nconst i18nStoreSingleton = createGlobalSingleton<I18nStore>({\n namespace: 'reactCore',\n key: 'i18nStore',\n source: '@generaltranslation/react-core',\n notInitialized: () => createI18nStoreNotInitializedError(),\n});\n\nexport const getI18nStore = i18nStoreSingleton.get;\nexport const setI18nStore = i18nStoreSingleton.set;\nexport const isI18nStoreInitialized = i18nStoreSingleton.isInitialized;\n\nfunction createI18nStoreNotInitializedError(): Error {\n const renderStrategy = getI18nConfig().getRenderStrategy();\n const errorMessage = createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot access I18nStore before it is initialized.',\n fix:\n renderStrategy === 'SPA'\n ? 'Initialize GT before reading GT runtime context.'\n : 'Add a <GTProvider> at the root of your component tree.',\n });\n\n return new Error(errorMessage);\n}\n"],"mappings":"uLAOA,MAAM,EAAqB,EAAiC,CAC1D,UAAW,YACX,IAAK,YACL,OAAQ,iCACR,mBAAsB,GAAoC,CAC3D,CAAC,CAEW,EAAe,EAAmB,IAClC,EAAe,EAAmB,IACT,EAAmB,cAEzD,SAAS,GAA4C,CAEnD,IAAM,EAAe,EAAwB,CAC3C,OAAQ,iCACR,SAAU,QACV,aAAc,oDACd,IALqBA,GAAe,CAAC,mBAMrB,GAAK,MACf,mDACA,yDACP,CAAC,CAEF,OAAW,MAAM,EAAa"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DictionaryEntry, DictionaryObject, Translation } from "gt-i18n/types";
|
|
2
|
+
import { LookupOptions } from "gt-i18n/internal/types";
|
|
3
|
+
|
|
4
|
+
//#region src/i18n-store/storeTypes.d.ts
|
|
5
|
+
type Unsubscribe = () => void;
|
|
6
|
+
type StoreListener = () => void;
|
|
7
|
+
type TranslateEventListener = (lookup: TranslateLookup) => void;
|
|
8
|
+
type TranslateLookup<T extends Translation = Translation> = {
|
|
9
|
+
locale: string;
|
|
10
|
+
message: T;
|
|
11
|
+
options: LookupOptions;
|
|
12
|
+
};
|
|
13
|
+
type DictionaryLookup = {
|
|
14
|
+
locale: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
type TranslateSnapshot<T extends Translation = Translation> = T | undefined;
|
|
18
|
+
type DictionaryEntrySnapshot = DictionaryEntry | undefined;
|
|
19
|
+
type DictionaryObjectSnapshot = DictionaryObject | undefined;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { DictionaryEntrySnapshot, DictionaryLookup, DictionaryObjectSnapshot, StoreListener, TranslateEventListener, TranslateLookup, TranslateSnapshot, Unsubscribe };
|
|
22
|
+
//# sourceMappingURL=storeTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storeTypes.d.ts","names":[],"sources":["../../src/i18n-store/storeTypes.ts"],"mappings":";;;;KASY,WAAA;AAAA,KACA,aAAA;AAAA,KACA,sBAAA,IAA0B,MAAA,EAAQ,eAAA;AAAA,KAIlC,eAAA,WAA0B,WAAA,GAAc,WAAA;EAClD,MAAA;EACA,OAAA,EAAS,CAAA;EACT,OAAA,EAAS,aAAA;AAAA;AAAA,KAGC,gBAAA;EACV,MAAA;EACA,EAAA;AAAA;AAAA,KAIU,iBAAA,WAA4B,WAAA,GAAc,WAAA,IAClD,CAAA;AAAA,KAIQ,uBAAA,GAA0B,eAAA;AAAA,KAC1B,wBAAA,GAA2B,gBAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require(`./singleton-operations.cjs`),t=require(`../context/context.cjs`);function n(){return t.useGTContext()?.i18nStore||e.getI18nStore()}function r(){return t.useGTContext()?.translationsSnapshot||{}}function i(){return t.useGTContext()?.dictionariesSnapshot||{}}exports.useDictionariesSnapshot=i,exports.useI18nStore=n,exports.useTranslationsSnapshot=r;
|
|
2
|
+
//# sourceMappingURL=useI18nStore.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useI18nStore.cjs","names":["useGTContext","getI18nStore"],"sources":["../../src/i18n-store/useI18nStore.ts"],"sourcesContent":["import { Dictionary, Hash, Locale } from 'gt-i18n/internal/types';\nimport { useGTContext } from '../context/context';\nimport { I18nStore } from './I18nStore';\nimport { getI18nStore } from './singleton-operations';\nimport { Translation } from 'gt-i18n/types';\n\nexport function useI18nStore(): I18nStore {\n const context = useGTContext();\n return context?.i18nStore || getI18nStore();\n}\n\nexport function useTranslationsSnapshot(): Record<\n Locale,\n Record<Hash, Translation>\n> {\n const context = useGTContext();\n return context?.translationsSnapshot || {};\n}\n\nexport function useDictionariesSnapshot(): Record<Locale, Dictionary> {\n const context = useGTContext();\n return context?.dictionariesSnapshot || {};\n}\n"],"mappings":"kFAMA,SAAgB,GAA0B,CAExC,OADgBA,EAAAA,cACF,EAAE,WAAaC,EAAAA,cAAc,CAG7C,SAAgB,GAGd,CAEA,OADgBD,EAAAA,cACF,EAAE,sBAAwB,EAAE,CAG5C,SAAgB,GAAsD,CAEpE,OADgBA,EAAAA,cACF,EAAE,sBAAwB,EAAE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{getI18nStore as e}from"./singleton-operations.mjs";import{useGTContext as t}from"../context/context.mjs";function n(){return t()?.i18nStore||e()}function r(){return t()?.translationsSnapshot||{}}function i(){return t()?.dictionariesSnapshot||{}}export{i as useDictionariesSnapshot,n as useI18nStore,r as useTranslationsSnapshot};
|
|
2
|
+
//# sourceMappingURL=useI18nStore.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useI18nStore.mjs","names":[],"sources":["../../src/i18n-store/useI18nStore.ts"],"sourcesContent":["import { Dictionary, Hash, Locale } from 'gt-i18n/internal/types';\nimport { useGTContext } from '../context/context';\nimport { I18nStore } from './I18nStore';\nimport { getI18nStore } from './singleton-operations';\nimport { Translation } from 'gt-i18n/types';\n\nexport function useI18nStore(): I18nStore {\n const context = useGTContext();\n return context?.i18nStore || getI18nStore();\n}\n\nexport function useTranslationsSnapshot(): Record<\n Locale,\n Record<Hash, Translation>\n> {\n const context = useGTContext();\n return context?.translationsSnapshot || {};\n}\n\nexport function useDictionariesSnapshot(): Record<Locale, Dictionary> {\n const context = useGTContext();\n return context?.dictionariesSnapshot || {};\n}\n"],"mappings":"gHAMA,SAAgB,GAA0B,CAExC,OADgB,GACF,EAAE,WAAa,GAAc,CAG7C,SAAgB,GAGd,CAEA,OADgB,GACF,EAAE,sBAAwB,EAAE,CAG5C,SAAgB,GAAsD,CAEpE,OADgB,GACF,EAAE,sBAAwB,EAAE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`gt-i18n/internal`);function t(t,n){return(0,e.getDictionaryEntry)(r(t,n))}function n(e,t){return r(e,t)}function r(t,{locale:n,id:r}){let a=t?.[n];if(!a)return;if(!r)return a;let o=a;for(let t of r.split(`.`)){if(!i(t)||!(0,e.isDictionaryValue)(o)||!Object.prototype.hasOwnProperty.call(o,t))return;o=o[t]}return o}function i(e){return e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}exports.lookupDictionaryEntry=t,exports.lookupDictionaryObject=n;
|
|
2
|
+
//# sourceMappingURL=dictionaries.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionaries.cjs","names":[],"sources":["../../../src/i18n-store/utils/dictionaries.ts"],"sourcesContent":["import { getDictionaryEntry, isDictionaryValue } from 'gt-i18n/internal';\nimport type { Locale } from 'gt-i18n/internal/types';\nimport type { Dictionary, DictionaryObject } from 'gt-i18n/types';\nimport type {\n DictionaryEntrySnapshot,\n DictionaryLookup,\n DictionaryObjectSnapshot,\n} from '../storeTypes';\n\nexport function lookupDictionaryEntry(\n dictionariesSnapshot: Record<Locale, Dictionary> | undefined,\n lookup: DictionaryLookup\n): DictionaryEntrySnapshot {\n return getDictionaryEntry(\n lookupDictionaryValue(dictionariesSnapshot, lookup)\n );\n}\n\nexport function lookupDictionaryObject(\n dictionariesSnapshot: Record<Locale, Dictionary> | undefined,\n lookup: DictionaryLookup\n): DictionaryObjectSnapshot {\n return lookupDictionaryValue(dictionariesSnapshot, lookup);\n}\n\nfunction lookupDictionaryValue(\n dictionariesSnapshot: Record<Locale, Dictionary> | undefined,\n { locale, id }: DictionaryLookup\n): DictionaryObjectSnapshot {\n const dictionary = dictionariesSnapshot?.[locale];\n if (!dictionary) return undefined;\n if (!id) return dictionary;\n\n let current: DictionaryObject | undefined = dictionary;\n for (const segment of id.split('.')) {\n if (!isSafeDictionaryPathSegment(segment)) return undefined;\n if (!isDictionaryValue(current)) return undefined;\n if (!Object.prototype.hasOwnProperty.call(current, segment)) {\n return undefined;\n }\n current = current[segment];\n }\n return current;\n}\n\nfunction isSafeDictionaryPathSegment(segment: string): boolean {\n return (\n segment !== '__proto__' &&\n segment !== 'constructor' &&\n segment !== 'prototype'\n );\n}\n"],"mappings":"kFASA,SAAgB,EACd,EACA,EACyB,CACzB,OAAA,EAAA,EAAA,oBACE,EAAsB,EAAsB,EAAO,CACpD,CAGH,SAAgB,EACd,EACA,EAC0B,CAC1B,OAAO,EAAsB,EAAsB,EAAO,CAG5D,SAAS,EACP,EACA,CAAE,SAAQ,MACgB,CAC1B,IAAM,EAAa,IAAuB,GAC1C,GAAI,CAAC,EAAY,OACjB,GAAI,CAAC,EAAI,OAAO,EAEhB,IAAI,EAAwC,EAC5C,IAAK,IAAM,KAAW,EAAG,MAAM,IAAI,CAAE,CAGnC,GAFI,CAAC,EAA4B,EAAQ,EACrC,EAAA,EAAA,EAAA,mBAAmB,EAAQ,EAC3B,CAAC,OAAO,UAAU,eAAe,KAAK,EAAS,EAAQ,CACzD,OAEF,EAAU,EAAQ,GAEpB,OAAO,EAGT,SAAS,EAA4B,EAA0B,CAC7D,OACE,IAAY,aACZ,IAAY,eACZ,IAAY"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{getDictionaryEntry as e,isDictionaryValue as t}from"gt-i18n/internal";function n(t,n){return e(i(t,n))}function r(e,t){return i(e,t)}function i(e,{locale:n,id:r}){let i=e?.[n];if(!i)return;if(!r)return i;let o=i;for(let e of r.split(`.`)){if(!a(e)||!t(o)||!Object.prototype.hasOwnProperty.call(o,e))return;o=o[e]}return o}function a(e){return e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}export{n as lookupDictionaryEntry,r as lookupDictionaryObject};
|
|
2
|
+
//# sourceMappingURL=dictionaries.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionaries.mjs","names":[],"sources":["../../../src/i18n-store/utils/dictionaries.ts"],"sourcesContent":["import { getDictionaryEntry, isDictionaryValue } from 'gt-i18n/internal';\nimport type { Locale } from 'gt-i18n/internal/types';\nimport type { Dictionary, DictionaryObject } from 'gt-i18n/types';\nimport type {\n DictionaryEntrySnapshot,\n DictionaryLookup,\n DictionaryObjectSnapshot,\n} from '../storeTypes';\n\nexport function lookupDictionaryEntry(\n dictionariesSnapshot: Record<Locale, Dictionary> | undefined,\n lookup: DictionaryLookup\n): DictionaryEntrySnapshot {\n return getDictionaryEntry(\n lookupDictionaryValue(dictionariesSnapshot, lookup)\n );\n}\n\nexport function lookupDictionaryObject(\n dictionariesSnapshot: Record<Locale, Dictionary> | undefined,\n lookup: DictionaryLookup\n): DictionaryObjectSnapshot {\n return lookupDictionaryValue(dictionariesSnapshot, lookup);\n}\n\nfunction lookupDictionaryValue(\n dictionariesSnapshot: Record<Locale, Dictionary> | undefined,\n { locale, id }: DictionaryLookup\n): DictionaryObjectSnapshot {\n const dictionary = dictionariesSnapshot?.[locale];\n if (!dictionary) return undefined;\n if (!id) return dictionary;\n\n let current: DictionaryObject | undefined = dictionary;\n for (const segment of id.split('.')) {\n if (!isSafeDictionaryPathSegment(segment)) return undefined;\n if (!isDictionaryValue(current)) return undefined;\n if (!Object.prototype.hasOwnProperty.call(current, segment)) {\n return undefined;\n }\n current = current[segment];\n }\n return current;\n}\n\nfunction isSafeDictionaryPathSegment(segment: string): boolean {\n return (\n segment !== '__proto__' &&\n segment !== 'constructor' &&\n segment !== 'prototype'\n );\n}\n"],"mappings":"6EASA,SAAgB,EACd,EACA,EACyB,CACzB,OAAO,EACL,EAAsB,EAAsB,EAAO,CACpD,CAGH,SAAgB,EACd,EACA,EAC0B,CAC1B,OAAO,EAAsB,EAAsB,EAAO,CAG5D,SAAS,EACP,EACA,CAAE,SAAQ,MACgB,CAC1B,IAAM,EAAa,IAAuB,GAC1C,GAAI,CAAC,EAAY,OACjB,GAAI,CAAC,EAAI,OAAO,EAEhB,IAAI,EAAwC,EAC5C,IAAK,IAAM,KAAW,EAAG,MAAM,IAAI,CAAE,CAGnC,GAFI,CAAC,EAA4B,EAAQ,EACrC,CAAC,EAAkB,EAAQ,EAC3B,CAAC,OAAO,UAAU,eAAe,KAAK,EAAS,EAAQ,CACzD,OAEF,EAAU,EAAQ,GAEpB,OAAO,EAGT,SAAS,EAA4B,EAA0B,CAC7D,OACE,IAAY,aACZ,IAAY,eACZ,IAAY"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.cjs","names":[],"sources":["../../../src/i18n-store/utils/subscriptions.ts"],"sourcesContent":["import type { Unsubscribe } from '../storeTypes';\n\nexport function subscribeToSet<T>(\n listenerSet: Set<T>,\n listener: T\n): Unsubscribe {\n listenerSet.add(listener);\n return () => {\n listenerSet.delete(listener);\n };\n}\n"],"mappings":"AAEA,SAAgB,EACd,EACA,EACa,CAEb,OADA,EAAY,IAAI,EAAS,KACZ,CACX,EAAY,OAAO,EAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.mjs","names":[],"sources":["../../../src/i18n-store/utils/subscriptions.ts"],"sourcesContent":["import type { Unsubscribe } from '../storeTypes';\n\nexport function subscribeToSet<T>(\n listenerSet: Set<T>,\n listener: T\n): Unsubscribe {\n listenerSet.add(listener);\n return () => {\n listenerSet.delete(listener);\n };\n}\n"],"mappings":"AAEA,SAAgB,EACd,EACA,EACa,CAEb,OADA,EAAY,IAAI,EAAS,KACZ,CACX,EAAY,OAAO,EAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.cjs","names":[],"sources":["../../../src/i18n-store/utils/translations.ts"],"sourcesContent":["import { hashMessage } from 'gt-i18n/internal';\nimport type { Hash, Locale } from 'gt-i18n/internal/types';\nimport type { Translation } from 'gt-i18n/types';\nimport type { TranslateLookup, TranslateSnapshot } from '../storeTypes';\n\nexport function lookupTranslation<T extends Translation>(\n translationsSnapshot: Record<Locale, Record<Hash, Translation>> | undefined,\n lookup: TranslateLookup<T>\n): TranslateSnapshot<T> {\n const hash =\n lookup.options.$_hash ?? hashMessage(lookup.message, lookup.options);\n return translationsSnapshot?.[lookup.locale]?.[hash] as TranslateSnapshot<T>;\n}\n"],"mappings":"kFAKA,SAAgB,EACd,EACA,EACsB,CACtB,IAAM,EACJ,EAAO,QAAQ,SAAA,EAAA,EAAA,aAAsB,EAAO,QAAS,EAAO,QAAQ,CACtE,OAAO,IAAuB,EAAO,UAAU"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.mjs","names":[],"sources":["../../../src/i18n-store/utils/translations.ts"],"sourcesContent":["import { hashMessage } from 'gt-i18n/internal';\nimport type { Hash, Locale } from 'gt-i18n/internal/types';\nimport type { Translation } from 'gt-i18n/types';\nimport type { TranslateLookup, TranslateSnapshot } from '../storeTypes';\n\nexport function lookupTranslation<T extends Translation>(\n translationsSnapshot: Record<Locale, Record<Hash, Translation>> | undefined,\n lookup: TranslateLookup<T>\n): TranslateSnapshot<T> {\n const hash =\n lookup.options.$_hash ?? hashMessage(lookup.message, lookup.options);\n return translationsSnapshot?.[lookup.locale]?.[hash] as TranslateSnapshot<T>;\n}\n"],"mappings":"+CAKA,SAAgB,EACd,EACA,EACsB,CACtB,IAAM,EACJ,EAAO,QAAQ,QAAU,EAAY,EAAO,QAAS,EAAO,QAAQ,CACtE,OAAO,IAAuB,EAAO,UAAU"}
|
package/dist/pure.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);const e=require(`./hooks/utils/getFormatLocales.cjs`),t=require(`./i18n-cache/singleton-operations.cjs`),n=require(`./functions/helpers/getTranslationsSnapshot.cjs`),r=require(`./setup/i18nConfig.cjs`),i=require(`./condition-store/singleton-operations.cjs`),a=require(`./functions/translation/t.cjs`),o=require(`./utils/rendering/createRenderPipeline.cjs`),s=require(`./utils/rendering/getDefaultRenderSettings.cjs`),c=require(`./i18n-cache/ReactI18nCache.cjs`),l=require(`./setup/initializeGTSRA.cjs`),u=require(`./i18n-store/singleton-operations.cjs`),d=require(`./i18n-store/I18nStore.cjs`);let f=require(`gt-i18n`),p=require(`gt-i18n/internal`);exports.I18nStore=d.I18nStore,exports.ReactI18nCache=c.ReactI18nCache,Object.defineProperty(exports,`ReadonlyConditionStore`,{enumerable:!0,get:function(){return p.ReadonlyConditionStore}}),exports.createRenderPipeline=o.createRenderPipeline,Object.defineProperty(exports,`declareVar`,{enumerable:!0,get:function(){return f.declareVar}}),Object.defineProperty(exports,`decodeMsg`,{enumerable:!0,get:function(){return f.decodeMsg}}),Object.defineProperty(exports,`decodeOptions`,{enumerable:!0,get:function(){return f.decodeOptions}}),Object.defineProperty(exports,`decodeVars`,{enumerable:!0,get:function(){return f.decodeVars}}),exports.defaultEnableI18nCookieName=r.defaultEnableI18nCookieName,exports.defaultLocaleCookieName=r.defaultLocaleCookieName,exports.defaultRegionCookieName=r.defaultRegionCookieName,exports.defaultResetLocaleCookieName=r.defaultResetLocaleCookieName,Object.defineProperty(exports,`derive`,{enumerable:!0,get:function(){return f.derive}}),Object.defineProperty(exports,`getDefaultLocale`,{enumerable:!0,get:function(){return f.getDefaultLocale}}),exports.getDefaultRenderSettings=s.getDefaultRenderSettings,exports.getFormatLocales=e.getFormatLocales,exports.getI18nConfig=r.getI18nConfig,Object.defineProperty(exports,`getLocaleProperties`,{enumerable:!0,get:function(){return f.getLocaleProperties}}),Object.defineProperty(exports,`getLocales`,{enumerable:!0,get:function(){return f.getLocales}}),exports.getReactI18nCache=t.getReactI18nCache,exports.getReadonlyConditionStore=i.getConditionStore,exports.getTranslationsSnapshot=n.getTranslationsSnapshot,Object.defineProperty(exports,`getVersionId`,{enumerable:!0,get:function(){return f.getVersionId}}),Object.defineProperty(exports,`gtFallback`,{enumerable:!0,get:function(){return f.gtFallback}}),exports.initializeI18nConfig=r.initializeI18nConfig,exports.internalInitializeGTSRA=l.internalInitializeGTSRA,Object.defineProperty(exports,`mFallback`,{enumerable:!0,get:function(){return f.mFallback}}),Object.defineProperty(exports,`msg`,{enumerable:!0,get:function(){return f.msg}}),Object.defineProperty(exports,`resolveCanonicalLocale`,{enumerable:!0,get:function(){return f.resolveCanonicalLocale}}),exports.setI18nStore=u.setI18nStore,exports.setReactI18nCache=t.setReactI18nCache,exports.t=a.t;
|