@generaltranslation/react-core 2.0.0-odysseus.1 → 11.0.0-odysseus.9
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 +95 -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 +12 -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/cookies.cjs +1 -0
- package/dist/cookies.d.ts +2 -0
- package/dist/cookies.mjs +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/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 +11 -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 +41 -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 +14 -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 +9 -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 +21 -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 +31 -676
- 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 +21 -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/initializeGTSPA.cjs +2 -0
- package/dist/setup/initializeGTSPA.cjs.map +1 -0
- package/dist/setup/initializeGTSPA.d.ts +16 -0
- package/dist/setup/initializeGTSPA.d.ts.map +1 -0
- package/dist/setup/initializeGTSPA.mjs +2 -0
- package/dist/setup/initializeGTSPA.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/cookies.cjs +2 -0
- package/dist/utils/cookies.cjs.map +1 -0
- package/dist/utils/cookies.d.ts +16 -0
- package/dist/utils/cookies.d.ts.map +1 -0
- package/dist/utils/cookies.mjs +2 -0
- package/dist/utils/cookies.mjs.map +1 -0
- package/dist/utils/dictionaries/flattenDictionary.cjs +2 -0
- package/dist/utils/dictionaries/flattenDictionary.cjs.map +1 -0
- package/dist/utils/dictionaries/flattenDictionary.d.ts +15 -0
- package/dist/utils/dictionaries/flattenDictionary.d.ts.map +1 -0
- package/dist/utils/dictionaries/flattenDictionary.mjs +2 -0
- package/dist/utils/dictionaries/flattenDictionary.mjs.map +1 -0
- package/dist/utils/dictionaries/getDictionaryEntry.cjs +2 -0
- package/dist/utils/dictionaries/getDictionaryEntry.cjs.map +1 -0
- package/dist/utils/dictionaries/getDictionaryEntry.d.ts +8 -0
- package/dist/utils/dictionaries/getDictionaryEntry.d.ts.map +1 -0
- package/dist/utils/dictionaries/getDictionaryEntry.mjs +2 -0
- package/dist/utils/dictionaries/getDictionaryEntry.mjs.map +1 -0
- package/dist/utils/dictionaries/getEntryAndMetadata.cjs +2 -0
- package/dist/utils/dictionaries/getEntryAndMetadata.cjs.map +1 -0
- package/dist/utils/dictionaries/getEntryAndMetadata.d.ts +10 -0
- package/dist/utils/dictionaries/getEntryAndMetadata.d.ts.map +1 -0
- package/dist/utils/dictionaries/getEntryAndMetadata.mjs +2 -0
- package/dist/utils/dictionaries/getEntryAndMetadata.mjs.map +1 -0
- package/dist/utils/dictionaries/indexDict.cjs +2 -0
- package/dist/utils/dictionaries/indexDict.cjs.map +1 -0
- package/dist/utils/dictionaries/indexDict.mjs +2 -0
- package/dist/utils/dictionaries/indexDict.mjs.map +1 -0
- package/dist/utils/dictionaries/isDictionaryEntry.cjs +2 -0
- package/dist/utils/dictionaries/isDictionaryEntry.cjs.map +1 -0
- package/dist/utils/dictionaries/isDictionaryEntry.d.ts +12 -0
- package/dist/utils/dictionaries/isDictionaryEntry.d.ts.map +1 -0
- package/dist/utils/dictionaries/isDictionaryEntry.mjs +2 -0
- package/dist/utils/dictionaries/isDictionaryEntry.mjs.map +1 -0
- package/dist/utils/dictionaries/mergeDictionaries.cjs +2 -0
- package/dist/utils/dictionaries/mergeDictionaries.cjs.map +1 -0
- package/dist/utils/dictionaries/mergeDictionaries.d.ts +7 -0
- package/dist/utils/dictionaries/mergeDictionaries.d.ts.map +1 -0
- package/dist/utils/dictionaries/mergeDictionaries.mjs +2 -0
- package/dist/utils/dictionaries/mergeDictionaries.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.d.ts +8 -0
- package/dist/utils/internal/addGTIdentifier.d.ts.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.d.ts +14 -0
- package/dist/utils/internal/writeChildrenAsObjects.d.ts.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 +106 -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.d.ts +13 -0
- package/dist/utils/variables/_getVariableProps.d.ts.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.d.ts +12 -0
- package/dist/utils/variables/getVariableName.d.ts.map +1 -0
- package/dist/utils/variables/getVariableName.mjs +2 -0
- package/dist/utils/variables/getVariableName.mjs.map +1 -0
- package/package.json +24 -13
- 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/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 @@
|
|
|
1
|
+
{"version":3,"file":"I18nStore.d.ts","names":[],"sources":["../../src/i18n-store/I18nStore.ts"],"mappings":";;;;;KAqBY,uBAAA,IAA2B,KAAA,EAAO,gBAAA;;AAA9C;;;;;AAWA;;;cAAa,SAAA;EAAA,QAGH,kBAAA;EAAA,QACA,wBAAA;EAAA,QACA,yBAAA;EAUQ;;;;EADhB,kBAAA,GACE,YAAA,EAAc,MAAA,CAAO,MAAA,EAAQ,MAAA,CAAO,IAAA,EAAM,WAAA;EAK5C,kBAAA,GAAsB,YAAA,EAAc,MAAA,CAAO,MAAA,EAAQ,UAAA;EAMnD,SAAA,aAA6B,WAAA,EAC3B,MAAA,EAAQ,eAAA,CAAgB,CAAA,MACvB,OAAA;EAeH,wBAAA,GAA4B,MAAA,EAAQ,gBAAA;EAWpC,yBAAA,GAA6B,MAAA,EAAQ,gBAAA;EAerC,oBAAA,aAAkC,WAAA,EAChC,MAAA,EAAQ,eAAA,CAAgB,CAAA,GACxB,QAAA,EAAU,aAAA,KACT,WAAA;EAUH,4BAAA,GACE,QAAA,EAAU,sBAAA,KACT,WAAA;EAIH,gCAAA,GACE,QAAA,EAAU,uBAAA,KACT,WAAA;EAIH,iCAAA,GACE,QAAA,EAAU,uBAAA,KACT,WAAA;EAMH,oBAAA,aAAkC,WAAA,EAChC,MAAA,EAAQ,eAAA,CAAgB,CAAA,GACxB,oBAAA,GAAsB,MAAA,CAAO,MAAA,EAAQ,MAAA,CAAO,IAAA,EAAM,WAAA,OACjD,iBAAA,CAAkB,CAAA;EAWrB,0BAAA,GACE,MAAA,EAAQ,gBAAA,EACR,oBAAA,GAAsB,MAAA,CAAO,MAAA,EAAQ,UAAA,MACpC,uBAAA;EAOH,2BAAA,GACE,MAAA,EAAQ,gBAAA,EACR,oBAAA,GAAsB,MAAA,CAAO,MAAA,EAAQ,UAAA,MACpC,wBAAA;EAAA,QASK,kBAAA;EAAA,QAIA,mBAAA;AAAA"}
|
|
@@ -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 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,EAON,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(`generaltranslation/internal`);function n(){let e=globalThis;return e.__generaltranslation??={},e.__generaltranslation.reactCore??={},e.__generaltranslation.reactCore}function r(){let e=n().i18nStore;if(!e)throw o();return e}function i(e){let t=n();t.i18nStore&&t.i18nStore!==e&&console.warn(s()),t.i18nStore=e}function a(){return n().i18nStore!==void 0}function o(){let n=(0,t.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(n)}function s(){return(0,t.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Warning`,whatHappened:`Overwriting global i18nStore singleton instance`})}exports.getI18nStore=r,exports.isI18nStoreInitialized=a,exports.setI18nStore=i;
|
|
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 { I18nStore } from './I18nStore';\nimport { getI18nConfig } from '../setup/i18nConfig';\n\n// ===== I18n Store ===== //\n\ntype ReactCoreGlobals = {\n i18nStore?: I18nStore;\n [key: string]: unknown;\n};\n\ntype GeneralTranslationGlobal = {\n reactCore?: ReactCoreGlobals;\n [key: string]: unknown;\n};\n\ntype GlobalWithGeneralTranslation = {\n __generaltranslation?: GeneralTranslationGlobal;\n};\n\nfunction getReactCoreGlobals(): ReactCoreGlobals {\n const globalObj = globalThis as unknown as GlobalWithGeneralTranslation;\n globalObj.__generaltranslation ??= {};\n // TODO: Consider checking package versions and using a compatibility matrix before sharing global singletons.\n globalObj.__generaltranslation.reactCore ??= {};\n return globalObj.__generaltranslation.reactCore;\n}\n\nexport function getI18nStore(): I18nStore {\n const i18nStore = getReactCoreGlobals().i18nStore;\n if (!i18nStore) {\n throw createI18nStoreNotInitializedError();\n }\n return i18nStore;\n}\n\nexport function setI18nStore(nextStore: I18nStore): void {\n const reactCoreGlobals = getReactCoreGlobals();\n if (reactCoreGlobals.i18nStore && reactCoreGlobals.i18nStore !== nextStore) {\n console.warn(createI18nStoreOverwriteWarning());\n }\n reactCoreGlobals.i18nStore = nextStore;\n}\n\nexport function isI18nStoreInitialized(): boolean {\n return getReactCoreGlobals().i18nStore !== undefined;\n}\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\nfunction createI18nStoreOverwriteWarning(): string {\n return createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Warning',\n whatHappened: 'Overwriting global i18nStore singleton instance',\n });\n}\n"],"mappings":"qIAoBA,SAAS,GAAwC,CAC/C,IAAM,EAAY,WAIlB,MAHA,GAAU,uBAAyB,EAAE,CAErC,EAAU,qBAAqB,YAAc,EAAE,CACxC,EAAU,qBAAqB,UAGxC,SAAgB,GAA0B,CACxC,IAAM,EAAY,GAAqB,CAAC,UACxC,GAAI,CAAC,EACH,MAAM,GAAoC,CAE5C,OAAO,EAGT,SAAgB,EAAa,EAA4B,CACvD,IAAM,EAAmB,GAAqB,CAC1C,EAAiB,WAAa,EAAiB,YAAc,GAC/D,QAAQ,KAAK,GAAiC,CAAC,CAEjD,EAAiB,UAAY,EAG/B,SAAgB,GAAkC,CAChD,OAAO,GAAqB,CAAC,YAAc,IAAA,GAG7C,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,CAGhC,SAAS,GAA0C,CACjD,OAAA,EAAA,EAAA,yBAA+B,CAC7B,OAAQ,iCACR,SAAU,UACV,aAAc,kDACf,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { I18nStore } from "./I18nStore.js";
|
|
2
|
+
|
|
3
|
+
//#region src/i18n-store/singleton-operations.d.ts
|
|
4
|
+
declare function getI18nStore(): I18nStore;
|
|
5
|
+
declare function setI18nStore(nextStore: I18nStore): void;
|
|
6
|
+
declare function isI18nStoreInitialized(): boolean;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { getI18nStore, isI18nStoreInitialized, setI18nStore };
|
|
9
|
+
//# sourceMappingURL=singleton-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singleton-operations.d.ts","names":[],"sources":["../../src/i18n-store/singleton-operations.ts"],"mappings":";;;iBA4BgB,YAAA,CAAA,GAAgB,SAAA;AAAA,iBAQhB,YAAA,CAAa,SAAA,EAAW,SAAA;AAAA,iBAQxB,sBAAA,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{getI18nConfig as e}from"../setup/i18nConfig.mjs";import{createDiagnosticMessage as t}from"generaltranslation/internal";function n(){let e=globalThis;return e.__generaltranslation??={},e.__generaltranslation.reactCore??={},e.__generaltranslation.reactCore}function r(){let e=n().i18nStore;if(!e)throw o();return e}function i(e){let t=n();t.i18nStore&&t.i18nStore!==e&&console.warn(s()),t.i18nStore=e}function a(){return n().i18nStore!==void 0}function o(){let n=t({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(n)}function s(){return t({source:`@generaltranslation/react-core`,severity:`Warning`,whatHappened:`Overwriting global i18nStore singleton instance`})}export{r as getI18nStore,a as isI18nStoreInitialized,i as setI18nStore};
|
|
2
|
+
//# sourceMappingURL=singleton-operations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singleton-operations.mjs","names":[],"sources":["../../src/i18n-store/singleton-operations.ts"],"sourcesContent":["import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport { I18nStore } from './I18nStore';\nimport { getI18nConfig } from '../setup/i18nConfig';\n\n// ===== I18n Store ===== //\n\ntype ReactCoreGlobals = {\n i18nStore?: I18nStore;\n [key: string]: unknown;\n};\n\ntype GeneralTranslationGlobal = {\n reactCore?: ReactCoreGlobals;\n [key: string]: unknown;\n};\n\ntype GlobalWithGeneralTranslation = {\n __generaltranslation?: GeneralTranslationGlobal;\n};\n\nfunction getReactCoreGlobals(): ReactCoreGlobals {\n const globalObj = globalThis as unknown as GlobalWithGeneralTranslation;\n globalObj.__generaltranslation ??= {};\n // TODO: Consider checking package versions and using a compatibility matrix before sharing global singletons.\n globalObj.__generaltranslation.reactCore ??= {};\n return globalObj.__generaltranslation.reactCore;\n}\n\nexport function getI18nStore(): I18nStore {\n const i18nStore = getReactCoreGlobals().i18nStore;\n if (!i18nStore) {\n throw createI18nStoreNotInitializedError();\n }\n return i18nStore;\n}\n\nexport function setI18nStore(nextStore: I18nStore): void {\n const reactCoreGlobals = getReactCoreGlobals();\n if (reactCoreGlobals.i18nStore && reactCoreGlobals.i18nStore !== nextStore) {\n console.warn(createI18nStoreOverwriteWarning());\n }\n reactCoreGlobals.i18nStore = nextStore;\n}\n\nexport function isI18nStoreInitialized(): boolean {\n return getReactCoreGlobals().i18nStore !== undefined;\n}\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\nfunction createI18nStoreOverwriteWarning(): string {\n return createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Warning',\n whatHappened: 'Overwriting global i18nStore singleton instance',\n });\n}\n"],"mappings":"8HAoBA,SAAS,GAAwC,CAC/C,IAAM,EAAY,WAIlB,MAHA,GAAU,uBAAyB,EAAE,CAErC,EAAU,qBAAqB,YAAc,EAAE,CACxC,EAAU,qBAAqB,UAGxC,SAAgB,GAA0B,CACxC,IAAM,EAAY,GAAqB,CAAC,UACxC,GAAI,CAAC,EACH,MAAM,GAAoC,CAE5C,OAAO,EAGT,SAAgB,EAAa,EAA4B,CACvD,IAAM,EAAmB,GAAqB,CAC1C,EAAiB,WAAa,EAAiB,YAAc,GAC/D,QAAQ,KAAK,GAAiC,CAAC,CAEjD,EAAiB,UAAY,EAG/B,SAAgB,GAAkC,CAChD,OAAO,GAAqB,CAAC,YAAc,IAAA,GAG7C,SAAS,GAA4C,CAEnD,IAAM,EAAe,EAAwB,CAC3C,OAAQ,iCACR,SAAU,QACV,aAAc,oDACd,IALqB,GAAe,CAAC,mBAMrB,GAAK,MACf,mDACA,yDACP,CAAC,CAEF,OAAW,MAAM,EAAa,CAGhC,SAAS,GAA0C,CACjD,OAAO,EAAwB,CAC7B,OAAQ,iCACR,SAAU,UACV,aAAc,kDACf,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DictionaryEntry, DictionaryObject, LookupOptions, Translation } from "gt-i18n/types";
|
|
2
|
+
|
|
3
|
+
//#region src/i18n-store/storeTypes.d.ts
|
|
4
|
+
type Unsubscribe = () => void;
|
|
5
|
+
type StoreListener = () => void;
|
|
6
|
+
type TranslateEventListener = (lookup: TranslateLookup) => void;
|
|
7
|
+
type TranslateLookup<T extends Translation = Translation> = {
|
|
8
|
+
locale: string;
|
|
9
|
+
message: T;
|
|
10
|
+
options: LookupOptions;
|
|
11
|
+
};
|
|
12
|
+
type DictionaryLookup = {
|
|
13
|
+
locale: string;
|
|
14
|
+
id: string;
|
|
15
|
+
};
|
|
16
|
+
type TranslateSnapshot<T extends Translation = Translation> = T | undefined;
|
|
17
|
+
type DictionaryEntrySnapshot = DictionaryEntry | undefined;
|
|
18
|
+
type DictionaryObjectSnapshot = DictionaryObject | undefined;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { DictionaryEntrySnapshot, DictionaryLookup, DictionaryObjectSnapshot, StoreListener, TranslateEventListener, TranslateLookup, TranslateSnapshot, Unsubscribe };
|
|
21
|
+
//# 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(`./utils/plurals/getPluralBranch.cjs`),t=require(`./utils/internal/addGTIdentifier.cjs`),n=require(`./utils/variables/getVariableName.cjs`),r=require(`./utils/internal/writeChildrenAsObjects.cjs`),i=require(`./utils/dictionaries/flattenDictionary.cjs`),a=require(`./utils/variables/_getVariableProps.cjs`),o=require(`./hooks/utils/getFormatLocales.cjs`),s=require(`./i18n-cache/singleton-operations.cjs`),c=require(`./functions/helpers/getTranslationsSnapshot.cjs`),l=require(`./setup/i18nConfig.cjs`),u=require(`./condition-store/singleton-operations.cjs`),d=require(`./functions/translation/t.cjs`),f=require(`./utils/rendering/createRenderPipeline.cjs`),p=require(`./utils/cookies.cjs`),m=require(`./utils/dictionaries/getDictionaryEntry.cjs`),h=require(`./utils/dictionaries/getEntryAndMetadata.cjs`),g=require(`./utils/dictionaries/isDictionaryEntry.cjs`),_=require(`./utils/dictionaries/mergeDictionaries.cjs`),v=require(`./utils/rendering/getDefaultRenderSettings.cjs`),y=require(`./i18n-cache/ReactI18nCache.cjs`),b=require(`./setup/initializeGTSRA.cjs`),x=require(`./i18n-store/I18nStore.cjs`),S=require(`./i18n-store/singleton-operations.cjs`),C=require(`./setup/initializeGTSPA.cjs`);let w=require(`gt-i18n`),T=require(`gt-i18n/internal`);exports.I18nStore=x.I18nStore,exports.ReactI18nCache=y.ReactI18nCache,exports.ReactI18nConfig=l.ReactI18nConfig,Object.defineProperty(exports,`ReadonlyConditionStore`,{enumerable:!0,get:function(){return T.ReadonlyConditionStore}}),Object.defineProperty(exports,`WritableConditionStore`,{enumerable:!0,get:function(){return T.WritableConditionStore}}),exports.addGTIdentifier=t.addGTIdentifier,exports.createRenderPipeline=f.createRenderPipeline,Object.defineProperty(exports,`declareVar`,{enumerable:!0,get:function(){return w.declareVar}}),Object.defineProperty(exports,`decodeMsg`,{enumerable:!0,get:function(){return w.decodeMsg}}),Object.defineProperty(exports,`decodeOptions`,{enumerable:!0,get:function(){return w.decodeOptions}}),Object.defineProperty(exports,`decodeVars`,{enumerable:!0,get:function(){return w.decodeVars}}),exports.defaultEnableI18nCookieName=p.defaultEnableI18nCookieName,exports.defaultLocaleCookieName=p.defaultLocaleCookieName,exports.defaultRegionCookieName=p.defaultRegionCookieName,Object.defineProperty(exports,`derive`,{enumerable:!0,get:function(){return w.derive}}),exports.flattenDictionary=i.flattenDictionary,Object.defineProperty(exports,`getDefaultLocale`,{enumerable:!0,get:function(){return w.getDefaultLocale}}),exports.getDefaultRenderSettings=v.getDefaultRenderSettings,exports.getDictionaryEntry=m.getDictionaryEntry,exports.getEntryAndMetadata=h.getEntryAndMetadata,exports.getFormatLocales=o.getFormatLocales,Object.defineProperty(exports,`getGTClass`,{enumerable:!0,get:function(){return w.getGTClass}}),exports.getI18nConfig=l.getI18nConfig,exports.getI18nStore=S.getI18nStore,Object.defineProperty(exports,`getLocaleProperties`,{enumerable:!0,get:function(){return w.getLocaleProperties}}),Object.defineProperty(exports,`getLocales`,{enumerable:!0,get:function(){return w.getLocales}}),exports.getPluralBranch=e.getPluralBranch,exports.getReactI18nCache=s.getReactI18nCache,exports.getReadonlyConditionStoreWithFallback=u.getReadonlyConditionStoreWithFallback,exports.getTranslationsSnapshot=c.getTranslationsSnapshot,exports.getVariableName=n.getVariableName,exports.getVariableProps=a.getVariableProps,Object.defineProperty(exports,`getVersionId`,{enumerable:!0,get:function(){return w.getVersionId}}),Object.defineProperty(exports,`gtFallback`,{enumerable:!0,get:function(){return w.gtFallback}}),exports.initializeGT=b.internalInitializeGTSRA,exports.initializeI18nConfig=l.initializeI18nConfig,exports.internalInitializeGTSPA=C.internalInitializeGTSPA,exports.internalInitializeGTSRA=b.internalInitializeGTSRA,exports.isDictionaryEntry=g.isDictionaryEntry,exports.isI18nStoreInitialized=S.isI18nStoreInitialized,exports.isValidDictionaryEntry=m.isValidDictionaryEntry,Object.defineProperty(exports,`mFallback`,{enumerable:!0,get:function(){return w.mFallback}}),exports.mergeDictionaries=_.mergeDictionaries,Object.defineProperty(exports,`msg`,{enumerable:!0,get:function(){return w.msg}}),exports.setI18nConfig=l.setI18nConfig,exports.setI18nStore=S.setI18nStore,exports.setReactI18nCache=s.setReactI18nCache,exports.setReadonlyConditionStore=u.setConditionStore,exports.t=d.t,exports.writeChildrenAsObjects=r.writeChildrenAsObjects;
|