@generaltranslation/react-core 2.0.0-odysseus.0 → 11.0.0-odysseus.10
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 +121 -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 +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 +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 +30 -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/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 +98 -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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,100 @@
|
|
|
1
1
|
# @generaltranslation/react-core
|
|
2
2
|
|
|
3
|
+
## 11.0.0-odysseus.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bcba6fd: Fix `useVersionId()` throwing and `useLocaleDirection()` requiring a locale argument in the client and server entrypoints.
|
|
8
|
+
|
|
9
|
+
`useVersionId()` now returns the current version id (instead of throwing the react-core "not implemented" error), and `useLocaleDirection()` once again accepts an optional locale that defaults to the current locale. The shared implementation now lives in `@generaltranslation/react-core/hooks`, so `gt-react` and `gt-react-native` use the same behavior; the RSC entrypoint keeps its stricter signatures.
|
|
10
|
+
|
|
11
|
+
- b7b3eaf: Share render pipeline child renderers with prepared translation rendering.
|
|
12
|
+
- dfb5fc9: Add portable selector hook return types for React Native declarations.
|
|
13
|
+
- 4a5f8e8: Remove unused internal exports and dead utility code.
|
|
14
|
+
- 288c9f8: Remove the deprecated `internalInitializeGTSPA` export from `@generaltranslation/react-core/pure` and the downstream `gt-react` server/types surfaces. Use `initializeGTSPA` from `gt-react` for browser SPA initialization.
|
|
15
|
+
- Updated dependencies [432fa49]
|
|
16
|
+
- Updated dependencies [432fa49]
|
|
17
|
+
- Updated dependencies [933916e]
|
|
18
|
+
- Updated dependencies [4a5f8e8]
|
|
19
|
+
- Updated dependencies [083d306]
|
|
20
|
+
- gt-i18n@1.0.0-odysseus.5
|
|
21
|
+
|
|
22
|
+
## 11.0.0-odysseus.9
|
|
23
|
+
|
|
24
|
+
## 11.0.0-odysseus.8
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 6da26e8: Remove three unused exports from `@generaltranslation/react-core/pure`: `isVariableObject`, `renderSkeleton`, and `reactHasUse`. None had consumers anywhere in the libraries. Trims dead code from the client-shipped `/pure` entry.
|
|
29
|
+
- Updated dependencies [26faa87]
|
|
30
|
+
- Updated dependencies [270b821]
|
|
31
|
+
- Updated dependencies [bffaa67]
|
|
32
|
+
- Updated dependencies [d602065]
|
|
33
|
+
- generaltranslation@9.0.0-odysseus.4
|
|
34
|
+
- gt-i18n@1.0.0-odysseus.4
|
|
35
|
+
- @generaltranslation/supported-locales@2.1.2-odysseus.4
|
|
36
|
+
|
|
37
|
+
## 11.0.0-odysseus.7
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- 07bfb00: Remove the unused dictionary-injection helpers from `@generaltranslation/react-core/pure`.
|
|
42
|
+
|
|
43
|
+
`collectUntranslatedEntries`, `injectAndMerge`, `injectEntry`, `injectFallbacks`, `injectHashes`, `injectTranslations`, `getSubtree`, `getSubtreeWithCreation`, and `stripMetadataFromEntries` were a self-referential cluster with no consumers anywhere in the library or its packages. Removing them (and their modules/tests) trims ~415 LOC of dead code from the client-shipped `/pure` entry. The still-used dictionary helpers (`getDictionaryEntry`, `getEntryAndMetadata`, `mergeDictionaries`, `flattenDictionary`, `indexDict`, `isDictionaryEntry`) are unchanged.
|
|
44
|
+
|
|
45
|
+
- Updated dependencies [b1eef00]
|
|
46
|
+
- Updated dependencies [b765174]
|
|
47
|
+
- generaltranslation@9.0.0-odysseus.3
|
|
48
|
+
- gt-i18n@1.0.0-odysseus.3
|
|
49
|
+
- @generaltranslation/supported-locales@2.1.2-odysseus.3
|
|
50
|
+
|
|
51
|
+
## 11.0.0-odysseus.6
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- c1aa794: Trigger a new Odysseus prerelease after updating the release workflow.
|
|
56
|
+
- e0ace5b: Build `@generaltranslation/react-core` as unbundled, tree-shakeable modules.
|
|
57
|
+
|
|
58
|
+
Each entrypoint (`pure`, `hooks`, `components`, `components-rsc`, `cookies`) was previously emitted as a single pre-bundled, minified file, so a consumer importing one component pulled the entire entry. The package now builds unbundled (per-module) output in both ESM and CJS: entrypoints are thin re-export barrels over granular sibling modules, allowing a downstream bundler to drop unused components and hooks.
|
|
59
|
+
|
|
60
|
+
The build also stops inlining `generaltranslation`/`@generaltranslation/format` into react-core's output, so they resolve to their single shared copy instead of being duplicated in react-core (they are already loaded standalone). This removes the duplication and keeps the per-module declarations referencing the dependency packages directly, so inferred types stay portable for downstream packages.
|
|
61
|
+
|
|
62
|
+
When consumed via ESM (see the companion `gt-next` ESM change), tree-shaking plus de-duplication cuts react-core's client footprint substantially. Output filenames change from `*.cjs.min.cjs`/`*.esm.min.mjs` to `*.cjs`/`*.mjs` (resolved through the `exports` map, so no consumer-facing API change). The package-shape test is updated to assert the new unbundled layout.
|
|
63
|
+
|
|
64
|
+
## 11.0.0-odysseus.5
|
|
65
|
+
|
|
66
|
+
### Major Changes
|
|
67
|
+
|
|
68
|
+
- [#1690](https://github.com/generaltranslation/gt/pull/1690) [`b3c3b9a`](https://github.com/generaltranslation/gt/commit/b3c3b9af39f1b2abec2c2b6bf2c2a40fe76db5ce) Thanks [@bgub](https://github.com/bgub)! - Simplify translation option types. Replace deprecated inline and dictionary option aliases with `GTTranslationOptions`, use interpolation variables for dictionary `t()` options, and trim higher-level type exports to avoid exposing internal translation option fields.
|
|
69
|
+
|
|
70
|
+
### Patch Changes
|
|
71
|
+
|
|
72
|
+
- [#1676](https://github.com/generaltranslation/gt/pull/1676) [`020c6bd`](https://github.com/generaltranslation/gt/commit/020c6bdd8c604bc07d80d75e8ea2ace1e70d7447) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Remove default exports from package entrypoints and internal source modules.
|
|
73
|
+
|
|
74
|
+
Use named imports for affected public entrypoints, including `import { plugin } from 'gt-react-native/plugin'`. The `gt-next/link` entrypoint keeps its default export to match `next/link`.
|
|
75
|
+
|
|
76
|
+
- Updated dependencies [[`4b97bc3`](https://github.com/generaltranslation/gt/commit/4b97bc360b2869bbb6e5f214589ef84f6d58a660), [`020c6bd`](https://github.com/generaltranslation/gt/commit/020c6bdd8c604bc07d80d75e8ea2ace1e70d7447), [`41c938c`](https://github.com/generaltranslation/gt/commit/41c938c0d00f4b76faa7a2805ad0015891e0740e), [`b3c3b9a`](https://github.com/generaltranslation/gt/commit/b3c3b9af39f1b2abec2c2b6bf2c2a40fe76db5ce)]:
|
|
77
|
+
- @generaltranslation/format@0.1.2-odysseus.1
|
|
78
|
+
- generaltranslation@9.0.0-odysseus.2
|
|
79
|
+
- gt-i18n@1.0.0-odysseus.2
|
|
80
|
+
- @generaltranslation/supported-locales@2.1.2-odysseus.2
|
|
81
|
+
|
|
82
|
+
## 11.0.0-odysseus.4
|
|
83
|
+
|
|
84
|
+
### Patch Changes
|
|
85
|
+
|
|
86
|
+
- Updated dependencies [[`87d6320`](https://github.com/generaltranslation/gt/commit/87d6320d271a1bf455f4e283dc1bb23893c7ba64)]:
|
|
87
|
+
- generaltranslation@9.0.0-odysseus.1
|
|
88
|
+
- gt-i18n@1.0.0-odysseus.1
|
|
89
|
+
- @generaltranslation/supported-locales@2.1.2-odysseus.1
|
|
90
|
+
|
|
91
|
+
## 2.0.0-odysseus.1
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- [#1657](https://github.com/generaltranslation/gt/pull/1657) [`e29cd01`](https://github.com/generaltranslation/gt/commit/e29cd01c1bfe9ffba64c8fb3794d053a8c1304af) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Persist TanStack Start locale resolution through the browser locale cookie.
|
|
96
|
+
Allow React i18n config checks to work across bundled react-core entrypoints.
|
|
97
|
+
|
|
3
98
|
## 2.0.0-odysseus.0
|
|
4
99
|
|
|
5
100
|
### Major Changes
|
|
@@ -18,6 +113,32 @@
|
|
|
18
113
|
- generaltranslation@9.0.0-odysseus.0
|
|
19
114
|
- gt-i18n@1.0.0-odysseus.0
|
|
20
115
|
|
|
116
|
+
## 1.8.24
|
|
117
|
+
|
|
118
|
+
### Patch Changes
|
|
119
|
+
|
|
120
|
+
- Updated dependencies [[`a2a3dd0`](https://github.com/generaltranslation/gt/commit/a2a3dd0bcdce9abe360c406a12fc6bb3bc3ca181)]:
|
|
121
|
+
- @generaltranslation/supported-locales@2.1.4
|
|
122
|
+
- gt-i18n@0.9.8
|
|
123
|
+
|
|
124
|
+
## 1.8.23
|
|
125
|
+
|
|
126
|
+
### Patch Changes
|
|
127
|
+
|
|
128
|
+
- Updated dependencies [[`9709a2f`](https://github.com/generaltranslation/gt/commit/9709a2f2b97b9d8239298e39bb31e57692bbffd8)]:
|
|
129
|
+
- generaltranslation@8.2.18
|
|
130
|
+
- gt-i18n@0.9.7
|
|
131
|
+
- @generaltranslation/supported-locales@2.1.3
|
|
132
|
+
|
|
133
|
+
## 1.8.22
|
|
134
|
+
|
|
135
|
+
### Patch Changes
|
|
136
|
+
|
|
137
|
+
- Updated dependencies [[`3197028`](https://github.com/generaltranslation/gt/commit/319702855a7b129f95217d41be9f2402680a2f01)]:
|
|
138
|
+
- generaltranslation@8.2.17
|
|
139
|
+
- gt-i18n@0.9.6
|
|
140
|
+
- @generaltranslation/supported-locales@2.1.2
|
|
141
|
+
|
|
21
142
|
## 1.8.21
|
|
22
143
|
|
|
23
144
|
### Patch Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`react/jsx-runtime`);function t({children:e,branch:t,_locale:n,_enableI18n:r,...i}){let a=t?.toString();return typeof a==`string`&&a.startsWith(`data-`)&&(a=void 0),a&&i[a]!==void 0?i[a]:e}function n(n){return(0,e.jsx)(t,{...n})}n._gtt=`branch`,t._gtt=`branch-automatic`,exports.Branch=n,exports.GtInternalBranch=t;
|
|
2
|
+
//# sourceMappingURL=Branch.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Branch.cjs","names":[],"sources":["../../../src/components/branches/Branch.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\ntype BranchProps = {\n children?: ReactNode;\n branch?: string | number | boolean;\n _locale?: string;\n _enableI18n?: boolean;\n [key: string]: ReactNode;\n};\n\n// ===== Component ===== //\n\n/**\n * External-store version of the `<Branch>` component.\n */\nfunction GtInternalBranch({\n children,\n branch,\n _locale,\n _enableI18n,\n ...branches\n}: BranchProps): ReactNode {\n void _locale;\n void _enableI18n;\n\n let branchKey = branch?.toString();\n if (typeof branchKey === 'string' && branchKey.startsWith('data-')) {\n branchKey = undefined;\n }\n return branchKey && typeof branches[branchKey] !== 'undefined'\n ? branches[branchKey]\n : children;\n}\n\nfunction Branch(props: BranchProps): React.JSX.Element {\n return <GtInternalBranch {...props} />;\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nBranch._gtt = 'branch';\nGtInternalBranch._gtt = 'branch-automatic';\n\n// ===== Exports ===== //\n\nexport { GtInternalBranch, Branch };\n"],"mappings":"mFAeA,SAAS,EAAiB,CACxB,WACA,SACA,UACA,cACA,GAAG,GACsB,CAIzB,IAAI,EAAY,GAAQ,UAAU,CAIlC,OAHI,OAAO,GAAc,UAAY,EAAU,WAAW,QAAQ,GAChE,EAAY,IAAA,IAEP,GAAoB,EAAS,KAAe,OAC/C,EAAS,GACT,EAGN,SAAS,EAAO,EAAuC,CACrD,OAAO,EAAA,EAAA,KAAC,EAAD,CAAkB,GAAI,EAAS,CAAA,CAIxC,EAAO,KAAO,SACd,EAAiB,KAAO"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/branches/Branch.d.ts
|
|
4
|
+
type BranchProps = {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
branch?: string | number | boolean;
|
|
7
|
+
_locale?: string;
|
|
8
|
+
_enableI18n?: boolean;
|
|
9
|
+
[key: string]: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* External-store version of the `<Branch>` component.
|
|
13
|
+
*/
|
|
14
|
+
declare function GtInternalBranch({
|
|
15
|
+
children,
|
|
16
|
+
branch,
|
|
17
|
+
_locale,
|
|
18
|
+
_enableI18n,
|
|
19
|
+
...branches
|
|
20
|
+
}: BranchProps): ReactNode;
|
|
21
|
+
declare namespace GtInternalBranch {
|
|
22
|
+
var _gtt: string;
|
|
23
|
+
}
|
|
24
|
+
declare function Branch(props: BranchProps): React.JSX.Element;
|
|
25
|
+
declare namespace Branch {
|
|
26
|
+
var _gtt: string;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Branch, GtInternalBranch };
|
|
30
|
+
//# sourceMappingURL=Branch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Branch.d.ts","names":[],"sources":["../../../src/components/branches/Branch.tsx"],"mappings":";;;KAEK,WAAA;EACH,QAAA,GAAW,SAAA;EACX,MAAA;EACA,OAAA;EACA,WAAA;EAAA,CACC,GAAA,WAAc,SAAA;AAAA;;;;iBAQR,gBAAA,CAAA;EACP,QAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EAAA,GACG;AAAA,GACF,WAAA,GAAc,SAAA;AAAA,kBANR,gBAAA;EAAA,IAAgB,IAAA;AAAA;AAAA,iBAmBhB,MAAA,CAAO,KAAA,EAAO,WAAA,GAAc,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,kBAAtC,MAAA;EAAA,IAAM,IAAA;AAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";function t({children:e,branch:t,_locale:n,_enableI18n:r,...i}){let a=t?.toString();return typeof a==`string`&&a.startsWith(`data-`)&&(a=void 0),a&&i[a]!==void 0?i[a]:e}function n(n){return e(t,{...n})}n._gtt=`branch`,t._gtt=`branch-automatic`;export{n as Branch,t as GtInternalBranch};
|
|
2
|
+
//# sourceMappingURL=Branch.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Branch.mjs","names":[],"sources":["../../../src/components/branches/Branch.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\ntype BranchProps = {\n children?: ReactNode;\n branch?: string | number | boolean;\n _locale?: string;\n _enableI18n?: boolean;\n [key: string]: ReactNode;\n};\n\n// ===== Component ===== //\n\n/**\n * External-store version of the `<Branch>` component.\n */\nfunction GtInternalBranch({\n children,\n branch,\n _locale,\n _enableI18n,\n ...branches\n}: BranchProps): ReactNode {\n void _locale;\n void _enableI18n;\n\n let branchKey = branch?.toString();\n if (typeof branchKey === 'string' && branchKey.startsWith('data-')) {\n branchKey = undefined;\n }\n return branchKey && typeof branches[branchKey] !== 'undefined'\n ? branches[branchKey]\n : children;\n}\n\nfunction Branch(props: BranchProps): React.JSX.Element {\n return <GtInternalBranch {...props} />;\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nBranch._gtt = 'branch';\nGtInternalBranch._gtt = 'branch-automatic';\n\n// ===== Exports ===== //\n\nexport { GtInternalBranch, Branch };\n"],"mappings":"wCAeA,SAAS,EAAiB,CACxB,WACA,SACA,UACA,cACA,GAAG,GACsB,CAIzB,IAAI,EAAY,GAAQ,UAAU,CAIlC,OAHI,OAAO,GAAc,UAAY,EAAU,WAAW,QAAQ,GAChE,EAAY,IAAA,IAEP,GAAoB,EAAS,KAAe,OAC/C,EAAS,GACT,EAGN,SAAS,EAAO,EAAuC,CACrD,OAAO,EAAC,EAAD,CAAkB,GAAI,EAAS,CAAA,CAIxC,EAAO,KAAO,SACd,EAAiB,KAAO"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../hooks/condition-store.cjs`),t=require(`./Plural.shared.cjs`);let n=require(`react/jsx-runtime`);function r({_enableI18n:n,_locale:r,...i}){return t.renderPlural({...i,_locale:r??e.useLocale(),_enableI18n:n??e.useEnableI18n()})}function i(e){return(0,n.jsx)(r,{...e})}i._gtt=`plural`,r._gtt=`plural-automatic`,exports.GtInternalPlural=r,exports.Plural=i;
|
|
2
|
+
//# sourceMappingURL=Plural.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plural.cjs","names":["renderPlural","useLocale","useEnableI18n"],"sources":["../../../src/components/branches/Plural.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { useEnableI18n, useLocale } from '../../hooks/condition-store';\nimport { renderPlural, type PluralProps } from './Plural.shared';\n\n// ===== Component ===== //\n\nfunction GtInternalPlural({\n _enableI18n,\n _locale,\n ...props\n}: PluralProps): ReactNode {\n return renderPlural({\n ...props,\n _locale: _locale ?? useLocale(),\n _enableI18n: _enableI18n ?? useEnableI18n(),\n });\n}\n\nfunction Plural(props: PluralProps): React.JSX.Element {\n return <GtInternalPlural {...props} />;\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nPlural._gtt = 'plural';\nGtInternalPlural._gtt = 'plural-automatic';\n\n// ===== Exports ===== //\n\nexport { GtInternalPlural, Plural };\n"],"mappings":"uKAMA,SAAS,EAAiB,CACxB,cACA,UACA,GAAG,GACsB,CACzB,OAAOA,EAAAA,aAAa,CAClB,GAAG,EACH,QAAS,GAAWC,EAAAA,WAAW,CAC/B,YAAa,GAAeC,EAAAA,eAAe,CAC5C,CAAC,CAGJ,SAAS,EAAO,EAAuC,CACrD,OAAO,EAAA,EAAA,KAAC,EAAD,CAAkB,GAAI,EAAS,CAAA,CAIxC,EAAO,KAAO,SACd,EAAiB,KAAO"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PluralProps } from "./Plural.shared.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/branches/Plural.d.ts
|
|
5
|
+
declare function GtInternalPlural({
|
|
6
|
+
_enableI18n,
|
|
7
|
+
_locale,
|
|
8
|
+
...props
|
|
9
|
+
}: PluralProps): ReactNode;
|
|
10
|
+
declare namespace GtInternalPlural {
|
|
11
|
+
var _gtt: string;
|
|
12
|
+
}
|
|
13
|
+
declare function Plural(props: PluralProps): React.JSX.Element;
|
|
14
|
+
declare namespace Plural {
|
|
15
|
+
var _gtt: string;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { GtInternalPlural, Plural };
|
|
19
|
+
//# sourceMappingURL=Plural.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plural.d.ts","names":[],"sources":["../../../src/components/branches/Plural.tsx"],"mappings":";;;;iBAMS,gBAAA,CAAA;EACP,WAAA;EACA,OAAA;EAAA,GACG;AAAA,GACF,WAAA,GAAc,SAAA;AAAA,kBAJR,gBAAA;EAAA,IAAgB,IAAA;AAAA;AAAA,iBAYhB,MAAA,CAAO,KAAA,EAAO,WAAA,GAAc,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,kBAAtC,MAAA;EAAA,IAAM,IAAA;AAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useEnableI18n as e,useLocale as t}from"../../hooks/condition-store.mjs";import{renderPlural as n}from"./Plural.shared.mjs";import{jsx as r}from"react/jsx-runtime";function i({_enableI18n:r,_locale:i,...a}){return n({...a,_locale:i??t(),_enableI18n:r??e()})}function a(e){return r(i,{...e})}a._gtt=`plural`,i._gtt=`plural-automatic`;export{i as GtInternalPlural,a as Plural};
|
|
2
|
+
//# sourceMappingURL=Plural.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plural.mjs","names":[],"sources":["../../../src/components/branches/Plural.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { useEnableI18n, useLocale } from '../../hooks/condition-store';\nimport { renderPlural, type PluralProps } from './Plural.shared';\n\n// ===== Component ===== //\n\nfunction GtInternalPlural({\n _enableI18n,\n _locale,\n ...props\n}: PluralProps): ReactNode {\n return renderPlural({\n ...props,\n _locale: _locale ?? useLocale(),\n _enableI18n: _enableI18n ?? useEnableI18n(),\n });\n}\n\nfunction Plural(props: PluralProps): React.JSX.Element {\n return <GtInternalPlural {...props} />;\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nPlural._gtt = 'plural';\nGtInternalPlural._gtt = 'plural-automatic';\n\n// ===== Exports ===== //\n\nexport { GtInternalPlural, Plural };\n"],"mappings":"0KAMA,SAAS,EAAiB,CACxB,cACA,UACA,GAAG,GACsB,CACzB,OAAO,EAAa,CAClB,GAAG,EACH,QAAS,GAAW,GAAW,CAC/B,YAAa,GAAe,GAAe,CAC5C,CAAC,CAGJ,SAAS,EAAO,EAAuC,CACrD,OAAO,EAAC,EAAD,CAAkB,GAAI,EAAS,CAAA,CAIxC,EAAO,KAAO,SACd,EAAiB,KAAO"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`./Plural.shared.cjs`);let t=require(`react/jsx-runtime`);function n(t){return e.renderPlural(t)}function r(e){return(0,t.jsx)(n,{...e})}r._gtt=`plural`,n._gtt=`plural-automatic`,exports.RscGtInternalPlural=n,exports.RscPlural=r;
|
|
2
|
+
//# sourceMappingURL=Plural.rsc.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plural.rsc.cjs","names":["renderPlural"],"sources":["../../../src/components/branches/Plural.rsc.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { renderPlural, type ResolvedPluralProps } from './Plural.shared';\n\n// RSC implementation: request conditions are passed explicitly instead of\n// being read from hooks. This module must stay free of hook/context imports\n// so it can be exported from the components-rsc entrypoint.\n\nfunction RscGtInternalPlural(props: ResolvedPluralProps): ReactNode {\n return renderPlural(props);\n}\n\nfunction RscPlural(props: ResolvedPluralProps): React.JSX.Element {\n return <RscGtInternalPlural {...props} />;\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nRscPlural._gtt = 'plural';\nRscGtInternalPlural._gtt = 'plural-automatic';\n\n// ===== Exports ===== //\n\nexport { RscGtInternalPlural, RscPlural };\n"],"mappings":"0HAOA,SAAS,EAAoB,EAAuC,CAClE,OAAOA,EAAAA,aAAa,EAAM,CAG5B,SAAS,EAAU,EAA+C,CAChE,OAAO,EAAA,EAAA,KAAC,EAAD,CAAqB,GAAI,EAAS,CAAA,CAI3C,EAAU,KAAO,SACjB,EAAoB,KAAO"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ResolvedPluralProps } from "./Plural.shared.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/branches/Plural.rsc.d.ts
|
|
5
|
+
declare function RscGtInternalPlural(props: ResolvedPluralProps): ReactNode;
|
|
6
|
+
declare namespace RscGtInternalPlural {
|
|
7
|
+
var _gtt: string;
|
|
8
|
+
}
|
|
9
|
+
declare function RscPlural(props: ResolvedPluralProps): React.JSX.Element;
|
|
10
|
+
declare namespace RscPlural {
|
|
11
|
+
var _gtt: string;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { RscGtInternalPlural, RscPlural };
|
|
15
|
+
//# sourceMappingURL=Plural.rsc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plural.rsc.d.ts","names":[],"sources":["../../../src/components/branches/Plural.rsc.tsx"],"mappings":";;;;iBAOS,mBAAA,CAAoB,KAAA,EAAO,mBAAA,GAAsB,SAAA;AAAA,kBAAjD,mBAAA;EAAA,IAAmB,IAAA;AAAA;AAAA,iBAInB,SAAA,CAAU,KAAA,EAAO,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,kBAAjD,SAAA;EAAA,IAAS,IAAA;AAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{renderPlural as e}from"./Plural.shared.mjs";import{jsx as t}from"react/jsx-runtime";function n(t){return e(t)}function r(e){return t(n,{...e})}r._gtt=`plural`,n._gtt=`plural-automatic`;export{n as RscGtInternalPlural,r as RscPlural};
|
|
2
|
+
//# sourceMappingURL=Plural.rsc.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plural.rsc.mjs","names":[],"sources":["../../../src/components/branches/Plural.rsc.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { renderPlural, type ResolvedPluralProps } from './Plural.shared';\n\n// RSC implementation: request conditions are passed explicitly instead of\n// being read from hooks. This module must stay free of hook/context imports\n// so it can be exported from the components-rsc entrypoint.\n\nfunction RscGtInternalPlural(props: ResolvedPluralProps): ReactNode {\n return renderPlural(props);\n}\n\nfunction RscPlural(props: ResolvedPluralProps): React.JSX.Element {\n return <RscGtInternalPlural {...props} />;\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nRscPlural._gtt = 'plural';\nRscGtInternalPlural._gtt = 'plural-automatic';\n\n// ===== Exports ===== //\n\nexport { RscGtInternalPlural, RscPlural };\n"],"mappings":"2FAOA,SAAS,EAAoB,EAAuC,CAClE,OAAO,EAAa,EAAM,CAG5B,SAAS,EAAU,EAA+C,CAChE,OAAO,EAAC,EAAD,CAAqB,GAAI,EAAS,CAAA,CAI3C,EAAU,KAAO,SACjB,EAAoB,KAAO"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require(`../../utils/plurals/getPluralBranch.cjs`),t=require(`../../hooks/utils/getFormatLocales.cjs`);function n({_enableI18n:n,_locale:r,children:i,n:a,locales:o=[],...s}){let c=t.getFormatLocales({locale:r,enableI18n:n,localesProp:o});return typeof a==`number`&&e.getPluralBranch(a,c,s)||i}exports.renderPlural=n;
|
|
2
|
+
//# sourceMappingURL=Plural.shared.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plural.shared.cjs","names":["getFormatLocales","getPluralBranch"],"sources":["../../../src/components/branches/Plural.shared.ts"],"sourcesContent":["import { getPluralBranch } from '../../utils/plurals/getPluralBranch';\nimport type { ReactNode } from 'react';\nimport { getFormatLocales } from '../../hooks/utils/getFormatLocales';\n\n// Pure render logic shared by the hook-based and RSC implementations. This\n// module must stay free of hook/context imports so it can be reached from the\n// components-rsc entrypoint.\n\ntype PluralProps = {\n children?: ReactNode;\n n: number;\n locales?: string[];\n _locale?: string;\n _enableI18n?: boolean;\n [key: string]: ReactNode;\n};\n\ntype ResolvedPluralProps = PluralProps & {\n _locale: string;\n _enableI18n: boolean;\n};\n\nfunction renderPlural({\n _enableI18n,\n _locale,\n children,\n n,\n locales: localesProp = [],\n ...branches\n}: ResolvedPluralProps): ReactNode {\n const locales = getFormatLocales({\n locale: _locale,\n enableI18n: _enableI18n,\n localesProp,\n });\n if (typeof n !== 'number') {\n return children;\n }\n return getPluralBranch(n, locales, branches) || children;\n}\n\nexport { renderPlural };\nexport type { PluralProps, ResolvedPluralProps };\n"],"mappings":"+GAsBA,SAAS,EAAa,CACpB,cACA,UACA,WACA,IACA,QAAS,EAAc,EAAE,CACzB,GAAG,GAC8B,CACjC,IAAM,EAAUA,EAAAA,iBAAiB,CAC/B,OAAQ,EACR,WAAY,EACZ,cACD,CAAC,CAIF,OAHI,OAAO,GAAM,UAGVC,EAAAA,gBAAgB,EAAG,EAAS,EAAS,EAFnC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/branches/Plural.shared.d.ts
|
|
4
|
+
type PluralProps = {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
n: number;
|
|
7
|
+
locales?: string[];
|
|
8
|
+
_locale?: string;
|
|
9
|
+
_enableI18n?: boolean;
|
|
10
|
+
[key: string]: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
type ResolvedPluralProps = PluralProps & {
|
|
13
|
+
_locale: string;
|
|
14
|
+
_enableI18n: boolean;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { type PluralProps, type ResolvedPluralProps };
|
|
18
|
+
//# sourceMappingURL=Plural.shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plural.shared.d.ts","names":[],"sources":["../../../src/components/branches/Plural.shared.ts"],"mappings":";;;KAQK,WAAA;EACH,QAAA,GAAW,SAAA;EACX,CAAA;EACA,OAAA;EACA,OAAA;EACA,WAAA;EAAA,CACC,GAAA,WAAc,SAAA;AAAA;AAAA,KAGZ,mBAAA,GAAsB,WAAA;EACzB,OAAA;EACA,WAAA;AAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{getPluralBranch as e}from"../../utils/plurals/getPluralBranch.mjs";import{getFormatLocales as t}from"../../hooks/utils/getFormatLocales.mjs";function n({_enableI18n:n,_locale:r,children:i,n:a,locales:o=[],...s}){let c=t({locale:r,enableI18n:n,localesProp:o});return typeof a==`number`&&e(a,c,s)||i}export{n as renderPlural};
|
|
2
|
+
//# sourceMappingURL=Plural.shared.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plural.shared.mjs","names":[],"sources":["../../../src/components/branches/Plural.shared.ts"],"sourcesContent":["import { getPluralBranch } from '../../utils/plurals/getPluralBranch';\nimport type { ReactNode } from 'react';\nimport { getFormatLocales } from '../../hooks/utils/getFormatLocales';\n\n// Pure render logic shared by the hook-based and RSC implementations. This\n// module must stay free of hook/context imports so it can be reached from the\n// components-rsc entrypoint.\n\ntype PluralProps = {\n children?: ReactNode;\n n: number;\n locales?: string[];\n _locale?: string;\n _enableI18n?: boolean;\n [key: string]: ReactNode;\n};\n\ntype ResolvedPluralProps = PluralProps & {\n _locale: string;\n _enableI18n: boolean;\n};\n\nfunction renderPlural({\n _enableI18n,\n _locale,\n children,\n n,\n locales: localesProp = [],\n ...branches\n}: ResolvedPluralProps): ReactNode {\n const locales = getFormatLocales({\n locale: _locale,\n enableI18n: _enableI18n,\n localesProp,\n });\n if (typeof n !== 'number') {\n return children;\n }\n return getPluralBranch(n, locales, branches) || children;\n}\n\nexport { renderPlural };\nexport type { PluralProps, ResolvedPluralProps };\n"],"mappings":"oJAsBA,SAAS,EAAa,CACpB,cACA,UACA,WACA,IACA,QAAS,EAAc,EAAE,CACzB,GAAG,GAC8B,CACjC,IAAM,EAAU,EAAiB,CAC/B,OAAQ,EACR,WAAY,EACZ,cACD,CAAC,CAIF,OAHI,OAAO,GAAM,UAGV,EAAgB,EAAG,EAAS,EAAS,EAFnC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`react/jsx-runtime`);function t({children:e}){return e}function n(n){return(0,e.jsx)(t,{...n})}n._gtt=`derive`,t._gtt=`derive-automatic`,exports.Derive=n,exports.GtInternalDerive=t;
|
|
2
|
+
//# sourceMappingURL=Derive.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Derive.cjs","names":[],"sources":["../../../src/components/derivation/Derive.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\ntype DeriveProps<T extends ReactNode> = {\n children: T;\n};\n\n// ===== Component ===== //\n\nfunction GtInternalDerive<T extends ReactNode>({\n children,\n}: DeriveProps<T>): T {\n return children;\n}\n\nfunction Derive<T extends ReactNode>(props: DeriveProps<T>): React.JSX.Element {\n return <GtInternalDerive {...props} />;\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nDerive._gtt = 'derive';\nGtInternalDerive._gtt = 'derive-automatic';\n\n// ===== Exports ===== //\n\nexport { GtInternalDerive, Derive };\n"],"mappings":"mFAQA,SAAS,EAAsC,CAC7C,YACoB,CACpB,OAAO,EAGT,SAAS,EAA4B,EAA0C,CAC7E,OAAO,EAAA,EAAA,KAAC,EAAD,CAAkB,GAAI,EAAS,CAAA,CAIxC,EAAO,KAAO,SACd,EAAiB,KAAO"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/derivation/Derive.d.ts
|
|
4
|
+
type DeriveProps<T extends ReactNode> = {
|
|
5
|
+
children: T;
|
|
6
|
+
};
|
|
7
|
+
declare function GtInternalDerive<T extends ReactNode>({
|
|
8
|
+
children
|
|
9
|
+
}: DeriveProps<T>): T;
|
|
10
|
+
declare namespace GtInternalDerive {
|
|
11
|
+
var _gtt: string;
|
|
12
|
+
}
|
|
13
|
+
declare function Derive<T extends ReactNode>(props: DeriveProps<T>): React.JSX.Element;
|
|
14
|
+
declare namespace Derive {
|
|
15
|
+
var _gtt: string;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Derive, GtInternalDerive };
|
|
19
|
+
//# sourceMappingURL=Derive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Derive.d.ts","names":[],"sources":["../../../src/components/derivation/Derive.tsx"],"mappings":";;;KAEK,WAAA,WAAsB,SAAA;EACzB,QAAA,EAAU,CAAA;AAAA;AAAA,iBAKH,gBAAA,WAA2B,SAAA,CAAA,CAAA;EAClC;AAAA,GACC,WAAA,CAAY,CAAA,IAAK,CAAA;AAAA,kBAFX,gBAAA;EAAA,IAAgB,IAAA;AAAA;AAAA,iBAMhB,MAAA,WAAiB,SAAA,CAAA,CAAW,KAAA,EAAO,WAAA,CAAY,CAAA,IAAK,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,kBAA9D,MAAA;EAAA,IAAM,IAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Derive.mjs","names":[],"sources":["../../../src/components/derivation/Derive.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\ntype DeriveProps<T extends ReactNode> = {\n children: T;\n};\n\n// ===== Component ===== //\n\nfunction GtInternalDerive<T extends ReactNode>({\n children,\n}: DeriveProps<T>): T {\n return children;\n}\n\nfunction Derive<T extends ReactNode>(props: DeriveProps<T>): React.JSX.Element {\n return <GtInternalDerive {...props} />;\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nDerive._gtt = 'derive';\nGtInternalDerive._gtt = 'derive-automatic';\n\n// ===== Exports ===== //\n\nexport { GtInternalDerive, Derive };\n"],"mappings":"wCAQA,SAAS,EAAsC,CAC7C,YACoB,CACpB,OAAO,EAGT,SAAS,EAA4B,EAA0C,CAC7E,OAAO,EAAC,EAAD,CAAkB,GAAI,EAAS,CAAA,CAIxC,EAAO,KAAO,SACd,EAAiB,KAAO"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require(`../../_virtual/_rolldown/runtime.cjs`);let t=require(`react`);t=e.__toESM(t);let n=require(`react/jsx-runtime`);function r(e){return e?e.charAt(0).toUpperCase()+(e.length>1?e.slice(1):``):``}function i(e){if(!e)return;let t={};for(let n in e)t[n]={name:e[n]};return t}function a({locale:e,locales:t,customNames:a,customMapping:o=i(a),setLocale:s,getLocaleProperties:c,...l}){let u=e=>{if(o&&o[e]){if(typeof o[e]==`string`)return o[e];if(o[e].name)return o[e].name}return r(c(e).nativeNameWithRegionCode)};return!t||t.length===0||!s?null:(0,n.jsxs)(`select`,{name:`generaltranslation-locale`,"aria-label":`General Translation locale selector`,...l,value:e||``,onChange:e=>s(e.target.value),children:[!e&&(0,n.jsx)(`option`,{value:``}),t.map(e=>(0,n.jsx)(`option`,{value:e,suppressHydrationWarning:!0,children:u(e)},e))]})}exports.InternalLocaleSelector=a;
|
|
2
|
+
//# sourceMappingURL=InternalLocaleSelector.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InternalLocaleSelector.cjs","names":[],"sources":["../../../src/components/helpers/InternalLocaleSelector.tsx"],"sourcesContent":["import React from 'react';\nimport { CustomMapping, LocaleProperties } from 'generaltranslation/types';\n\n/**\n * Capitalizes the first letter of a string if applicable.\n * For strings that do not use capitalization, it returns the string unchanged.\n * @param {string} str - The string to capitalize.\n * @returns {string} The string with the first letter capitalized if applicable.\n */\nfunction capitalizeName(str: string): string {\n if (!str) return '';\n return str.charAt(0).toUpperCase() + (str.length > 1 ? str.slice(1) : '');\n}\n\n/**\n * Internal helper to convert deprecated customNames prop to the new customMapping format.\n * Used for backward compatibility with previous LocaleSelector API.\n * @param {object} customNames - Mapping of locale to display name.\n * @returns {CustomMapping | undefined} The converted mapping or undefined.\n * @internal\n */\nfunction _convertCustomNamesToMapping(\n customNames?: { [key: string]: string } | undefined\n): CustomMapping | undefined {\n if (!customNames) return undefined;\n const result: CustomMapping = {};\n for (const locale in customNames) {\n result[locale] = { name: customNames[locale] };\n }\n return result;\n}\n\n/**\n * A dropdown component that allows users to select a locale.\n * @param {string} locale - The currently selected locale.\n * @param {string[]} locales - The list of all available locales.\n * @param {function} setLocale - Function to update the current locale.\n * @param {function} getLocaleProperties - Function to retrieve properties for a given locale.\n * @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.\n * @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.\n * @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.\n *\n * @internal\n */\nexport function InternalLocaleSelector({\n locale,\n locales,\n customNames,\n customMapping = _convertCustomNamesToMapping(customNames),\n setLocale,\n getLocaleProperties,\n ...props\n}: {\n locale: string;\n locales: string[];\n customNames?: { [key: string]: string };\n customMapping?: CustomMapping;\n setLocale: (locale: string) => void;\n getLocaleProperties: (locale: string) => LocaleProperties;\n [key: string]: any;\n}): React.JSX.Element | null {\n // Get display name\n const getDisplayName = (locale: string) => {\n if (customMapping && customMapping[locale]) {\n if (typeof customMapping[locale] === 'string')\n return customMapping[locale];\n if (customMapping[locale].name) return customMapping[locale].name;\n }\n return capitalizeName(getLocaleProperties(locale).nativeNameWithRegionCode);\n };\n\n // If no locales are returned, just render nothing or handle gracefully\n if (!locales || locales.length === 0 || !setLocale) {\n return null;\n }\n\n return (\n <select\n name='generaltranslation-locale'\n aria-label='General Translation locale selector'\n {...props}\n // Fallback to an empty string if currentLocale is undefined\n value={locale || ''}\n onChange={(e) => setLocale(e.target.value)}\n >\n {/* Optional fallback for when no locale is set */}\n {!locale && <option value='' />}\n\n {locales.map((locale) => (\n <option key={locale} value={locale} suppressHydrationWarning>\n {getDisplayName(locale)}\n </option>\n ))}\n </select>\n );\n}\n"],"mappings":"iIASA,SAAS,EAAe,EAAqB,CAE3C,OADK,EACE,EAAI,OAAO,EAAE,CAAC,aAAa,EAAI,EAAI,OAAS,EAAI,EAAI,MAAM,EAAE,CAAG,IADrD,GAWnB,SAAS,EACP,EAC2B,CAC3B,GAAI,CAAC,EAAa,OAClB,IAAM,EAAwB,EAAE,CAChC,IAAK,IAAM,KAAU,EACnB,EAAO,GAAU,CAAE,KAAM,EAAY,GAAS,CAEhD,OAAO,EAeT,SAAgB,EAAuB,CACrC,SACA,UACA,cACA,gBAAgB,EAA6B,EAAY,CACzD,YACA,sBACA,GAAG,GASwB,CAE3B,IAAM,EAAkB,GAAmB,CACzC,GAAI,GAAiB,EAAc,GAAS,CAC1C,GAAI,OAAO,EAAc,IAAY,SACnC,OAAO,EAAc,GACvB,GAAI,EAAc,GAAQ,KAAM,OAAO,EAAc,GAAQ,KAE/D,OAAO,EAAe,EAAoB,EAAO,CAAC,yBAAyB,EAQ7E,MAJI,CAAC,GAAW,EAAQ,SAAW,GAAK,CAAC,EAChC,MAIP,EAAA,EAAA,MAAC,SAAD,CACE,KAAK,4BACL,aAAW,sCACX,GAAI,EAEJ,MAAO,GAAU,GACjB,SAAW,GAAM,EAAU,EAAE,OAAO,MAAM,UAN5C,CASG,CAAC,IAAU,EAAA,EAAA,KAAC,SAAD,CAAQ,MAAM,GAAK,CAAA,CAE9B,EAAQ,IAAK,IACZ,EAAA,EAAA,KAAC,SAAD,CAAqB,MAAO,EAAQ,yBAAA,YACjC,EAAe,EAAO,CAChB,CAFI,EAEJ,CACT,CACK"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CustomMapping, LocaleProperties } from "generaltranslation/types";
|
|
3
|
+
|
|
4
|
+
//#region src/components/helpers/InternalLocaleSelector.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* A dropdown component that allows users to select a locale.
|
|
7
|
+
* @param {string} locale - The currently selected locale.
|
|
8
|
+
* @param {string[]} locales - The list of all available locales.
|
|
9
|
+
* @param {function} setLocale - Function to update the current locale.
|
|
10
|
+
* @param {function} getLocaleProperties - Function to retrieve properties for a given locale.
|
|
11
|
+
* @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.
|
|
12
|
+
* @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.
|
|
13
|
+
* @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
declare function InternalLocaleSelector({
|
|
18
|
+
locale,
|
|
19
|
+
locales,
|
|
20
|
+
customNames,
|
|
21
|
+
customMapping,
|
|
22
|
+
setLocale,
|
|
23
|
+
getLocaleProperties,
|
|
24
|
+
...props
|
|
25
|
+
}: {
|
|
26
|
+
locale: string;
|
|
27
|
+
locales: string[];
|
|
28
|
+
customNames?: {
|
|
29
|
+
[key: string]: string;
|
|
30
|
+
};
|
|
31
|
+
customMapping?: CustomMapping;
|
|
32
|
+
setLocale: (locale: string) => void;
|
|
33
|
+
getLocaleProperties: (locale: string) => LocaleProperties;
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
}): React.JSX.Element | null;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { InternalLocaleSelector };
|
|
38
|
+
//# sourceMappingURL=InternalLocaleSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InternalLocaleSelector.d.ts","names":[],"sources":["../../../src/components/helpers/InternalLocaleSelector.tsx"],"mappings":";;;;;;AA4CA;;;;;;;;;;iBAAgB,sBAAA,CAAA;EACd,MAAA;EACA,OAAA;EACA,WAAA;EACA,aAAA;EACA,SAAA;EACA,mBAAA;EAAA,GACG;AAAA;EAEH,MAAA;EACA,OAAA;EACA,WAAA;IAAA,CAAiB,GAAA;EAAA;EACjB,aAAA,GAAgB,aAAA;EAChB,SAAA,GAAY,MAAA;EACZ,mBAAA,GAAsB,MAAA,aAAmB,gBAAA;EAAA,CACxC,GAAA;AAAA,IACC,KAAA,CAAM,GAAA,CAAI,OAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function n(e){return e?e.charAt(0).toUpperCase()+(e.length>1?e.slice(1):``):``}function r(e){if(!e)return;let t={};for(let n in e)t[n]={name:e[n]};return t}function i({locale:i,locales:a,customNames:o,customMapping:s=r(o),setLocale:c,getLocaleProperties:l,...u}){let d=e=>{if(s&&s[e]){if(typeof s[e]==`string`)return s[e];if(s[e].name)return s[e].name}return n(l(e).nativeNameWithRegionCode)};return!a||a.length===0||!c?null:t(`select`,{name:`generaltranslation-locale`,"aria-label":`General Translation locale selector`,...u,value:i||``,onChange:e=>c(e.target.value),children:[!i&&e(`option`,{value:``}),a.map(t=>e(`option`,{value:t,suppressHydrationWarning:!0,children:d(t)},t))]})}export{i as InternalLocaleSelector};
|
|
2
|
+
//# sourceMappingURL=InternalLocaleSelector.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InternalLocaleSelector.mjs","names":[],"sources":["../../../src/components/helpers/InternalLocaleSelector.tsx"],"sourcesContent":["import React from 'react';\nimport { CustomMapping, LocaleProperties } from 'generaltranslation/types';\n\n/**\n * Capitalizes the first letter of a string if applicable.\n * For strings that do not use capitalization, it returns the string unchanged.\n * @param {string} str - The string to capitalize.\n * @returns {string} The string with the first letter capitalized if applicable.\n */\nfunction capitalizeName(str: string): string {\n if (!str) return '';\n return str.charAt(0).toUpperCase() + (str.length > 1 ? str.slice(1) : '');\n}\n\n/**\n * Internal helper to convert deprecated customNames prop to the new customMapping format.\n * Used for backward compatibility with previous LocaleSelector API.\n * @param {object} customNames - Mapping of locale to display name.\n * @returns {CustomMapping | undefined} The converted mapping or undefined.\n * @internal\n */\nfunction _convertCustomNamesToMapping(\n customNames?: { [key: string]: string } | undefined\n): CustomMapping | undefined {\n if (!customNames) return undefined;\n const result: CustomMapping = {};\n for (const locale in customNames) {\n result[locale] = { name: customNames[locale] };\n }\n return result;\n}\n\n/**\n * A dropdown component that allows users to select a locale.\n * @param {string} locale - The currently selected locale.\n * @param {string[]} locales - The list of all available locales.\n * @param {function} setLocale - Function to update the current locale.\n * @param {function} getLocaleProperties - Function to retrieve properties for a given locale.\n * @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.\n * @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.\n * @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.\n *\n * @internal\n */\nexport function InternalLocaleSelector({\n locale,\n locales,\n customNames,\n customMapping = _convertCustomNamesToMapping(customNames),\n setLocale,\n getLocaleProperties,\n ...props\n}: {\n locale: string;\n locales: string[];\n customNames?: { [key: string]: string };\n customMapping?: CustomMapping;\n setLocale: (locale: string) => void;\n getLocaleProperties: (locale: string) => LocaleProperties;\n [key: string]: any;\n}): React.JSX.Element | null {\n // Get display name\n const getDisplayName = (locale: string) => {\n if (customMapping && customMapping[locale]) {\n if (typeof customMapping[locale] === 'string')\n return customMapping[locale];\n if (customMapping[locale].name) return customMapping[locale].name;\n }\n return capitalizeName(getLocaleProperties(locale).nativeNameWithRegionCode);\n };\n\n // If no locales are returned, just render nothing or handle gracefully\n if (!locales || locales.length === 0 || !setLocale) {\n return null;\n }\n\n return (\n <select\n name='generaltranslation-locale'\n aria-label='General Translation locale selector'\n {...props}\n // Fallback to an empty string if currentLocale is undefined\n value={locale || ''}\n onChange={(e) => setLocale(e.target.value)}\n >\n {/* Optional fallback for when no locale is set */}\n {!locale && <option value='' />}\n\n {locales.map((locale) => (\n <option key={locale} value={locale} suppressHydrationWarning>\n {getDisplayName(locale)}\n </option>\n ))}\n </select>\n );\n}\n"],"mappings":"gEASA,SAAS,EAAe,EAAqB,CAE3C,OADK,EACE,EAAI,OAAO,EAAE,CAAC,aAAa,EAAI,EAAI,OAAS,EAAI,EAAI,MAAM,EAAE,CAAG,IADrD,GAWnB,SAAS,EACP,EAC2B,CAC3B,GAAI,CAAC,EAAa,OAClB,IAAM,EAAwB,EAAE,CAChC,IAAK,IAAM,KAAU,EACnB,EAAO,GAAU,CAAE,KAAM,EAAY,GAAS,CAEhD,OAAO,EAeT,SAAgB,EAAuB,CACrC,SACA,UACA,cACA,gBAAgB,EAA6B,EAAY,CACzD,YACA,sBACA,GAAG,GASwB,CAE3B,IAAM,EAAkB,GAAmB,CACzC,GAAI,GAAiB,EAAc,GAAS,CAC1C,GAAI,OAAO,EAAc,IAAY,SACnC,OAAO,EAAc,GACvB,GAAI,EAAc,GAAQ,KAAM,OAAO,EAAc,GAAQ,KAE/D,OAAO,EAAe,EAAoB,EAAO,CAAC,yBAAyB,EAQ7E,MAJI,CAAC,GAAW,EAAQ,SAAW,GAAK,CAAC,EAChC,KAIP,EAAC,SAAD,CACE,KAAK,4BACL,aAAW,sCACX,GAAI,EAEJ,MAAO,GAAU,GACjB,SAAW,GAAM,EAAU,EAAE,OAAO,MAAM,UAN5C,CASG,CAAC,GAAU,EAAC,SAAD,CAAQ,MAAM,GAAK,CAAA,CAE9B,EAAQ,IAAK,GACZ,EAAC,SAAD,CAAqB,MAAO,EAAQ,yBAAA,YACjC,EAAe,EAAO,CAChB,CAFI,EAEJ,CACT,CACK"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require(`../../_virtual/_rolldown/runtime.cjs`);let t=require(`react`);t=e.__toESM(t);let n=require(`react/jsx-runtime`);function r({region:e,regions:t,regionData:r,setRegion:i,placeholder:a,...o}){return!t||t.length===0||!i?null:(0,n.jsxs)(`select`,{name:`generaltranslation-region`,"aria-label":`General Translation region selector`,...o,value:e||``,onChange:e=>i(e.target.value),children:[!e&&(0,n.jsx)(`option`,{value:``,suppressHydrationWarning:!0,children:a||``},`placeholder`),t.map(e=>(0,n.jsx)(`option`,{value:e,suppressHydrationWarning:!0,children:r.get(e)?.name??e},e))]})}exports.InternalRegionSelector=r;
|
|
2
|
+
//# sourceMappingURL=InternalRegionSelector.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InternalRegionSelector.cjs","names":[],"sources":["../../../src/components/helpers/InternalRegionSelector.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport type { RegionData } from '../../hooks/useInternalRegionSelector';\n\n/**\n * A dropdown component that allows users to select a region.\n * @param {string | undefined} region - The currently selected region.\n * @param {string[]} regions - The ordered list of available region codes.\n * @param {Map<string, RegionData>} regionData - Map of region codes to their display data (name, emoji, locale).\n * @param {function} setRegion - Function to update the current region.\n * @param {React.ReactNode} [placeholder] - Optional placeholder node to display as the first option when no region is selected.\n * @returns {React.ReactElement | null} The rendered region dropdown component or null to prevent rendering.\n *\n * @internal\n */\nexport function InternalRegionSelector({\n region,\n regions,\n regionData,\n setRegion,\n placeholder,\n ...props\n}: {\n region: string | undefined;\n regions: string[];\n regionData: Map<string, RegionData>;\n setRegion: (region: string) => void;\n placeholder?: ReactNode;\n [key: string]: any;\n}): React.JSX.Element | null {\n // If no regions are returned, just render nothing or handle gracefully\n if (!regions || regions.length === 0 || !setRegion) {\n return null;\n }\n\n return (\n <select\n name='generaltranslation-region'\n aria-label='General Translation region selector'\n {...props}\n // Fallback to an empty string if no region is set\n value={region || ''}\n onChange={(e) => setRegion(e.target.value)}\n >\n {/* Optional placeholder for when no region is set */}\n {!region && (\n <option key='placeholder' value='' suppressHydrationWarning>\n {placeholder || ''}\n </option>\n )}\n\n {regions.map((r) => (\n <option key={r} value={r} suppressHydrationWarning>\n {regionData.get(r)?.name ?? r}\n </option>\n ))}\n </select>\n );\n}\n"],"mappings":"iIAcA,SAAgB,EAAuB,CACrC,SACA,UACA,aACA,YACA,cACA,GAAG,GAQwB,CAM3B,MAJI,CAAC,GAAW,EAAQ,SAAW,GAAK,CAAC,EAChC,MAIP,EAAA,EAAA,MAAC,SAAD,CACE,KAAK,4BACL,aAAW,sCACX,GAAI,EAEJ,MAAO,GAAU,GACjB,SAAW,GAAM,EAAU,EAAE,OAAO,MAAM,UAN5C,CASG,CAAC,IACA,EAAA,EAAA,KAAC,SAAD,CAA0B,MAAM,GAAG,yBAAA,YAChC,GAAe,GACT,CAFG,cAEH,CAGV,EAAQ,IAAK,IACZ,EAAA,EAAA,KAAC,SAAD,CAAgB,MAAO,EAAG,yBAAA,YACvB,EAAW,IAAI,EAAE,EAAE,MAAQ,EACrB,CAFI,EAEJ,CACT,CACK"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { RegionData } from "../../hooks/useInternalRegionSelector.js";
|
|
2
|
+
import React, { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/helpers/InternalRegionSelector.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* A dropdown component that allows users to select a region.
|
|
7
|
+
* @param {string | undefined} region - The currently selected region.
|
|
8
|
+
* @param {string[]} regions - The ordered list of available region codes.
|
|
9
|
+
* @param {Map<string, RegionData>} regionData - Map of region codes to their display data (name, emoji, locale).
|
|
10
|
+
* @param {function} setRegion - Function to update the current region.
|
|
11
|
+
* @param {React.ReactNode} [placeholder] - Optional placeholder node to display as the first option when no region is selected.
|
|
12
|
+
* @returns {React.ReactElement | null} The rendered region dropdown component or null to prevent rendering.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
declare function InternalRegionSelector({
|
|
17
|
+
region,
|
|
18
|
+
regions,
|
|
19
|
+
regionData,
|
|
20
|
+
setRegion,
|
|
21
|
+
placeholder,
|
|
22
|
+
...props
|
|
23
|
+
}: {
|
|
24
|
+
region: string | undefined;
|
|
25
|
+
regions: string[];
|
|
26
|
+
regionData: Map<string, RegionData>;
|
|
27
|
+
setRegion: (region: string) => void;
|
|
28
|
+
placeholder?: ReactNode;
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}): React.JSX.Element | null;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { InternalRegionSelector };
|
|
33
|
+
//# sourceMappingURL=InternalRegionSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InternalRegionSelector.d.ts","names":[],"sources":["../../../src/components/helpers/InternalRegionSelector.tsx"],"mappings":";;;;;;AAcA;;;;;;;;;iBAAgB,sBAAA,CAAA;EACd,MAAA;EACA,OAAA;EACA,UAAA;EACA,SAAA;EACA,WAAA;EAAA,GACG;AAAA;EAEH,MAAA;EACA,OAAA;EACA,UAAA,EAAY,GAAA,SAAY,UAAA;EACxB,SAAA,GAAY,MAAA;EACZ,WAAA,GAAc,SAAA;EAAA,CACb,GAAA;AAAA,IACC,KAAA,CAAM,GAAA,CAAI,OAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function n({region:n,regions:r,regionData:i,setRegion:a,placeholder:o,...s}){return!r||r.length===0||!a?null:t(`select`,{name:`generaltranslation-region`,"aria-label":`General Translation region selector`,...s,value:n||``,onChange:e=>a(e.target.value),children:[!n&&e(`option`,{value:``,suppressHydrationWarning:!0,children:o||``},`placeholder`),r.map(t=>e(`option`,{value:t,suppressHydrationWarning:!0,children:i.get(t)?.name??t},t))]})}export{n as InternalRegionSelector};
|
|
2
|
+
//# sourceMappingURL=InternalRegionSelector.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InternalRegionSelector.mjs","names":[],"sources":["../../../src/components/helpers/InternalRegionSelector.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport type { RegionData } from '../../hooks/useInternalRegionSelector';\n\n/**\n * A dropdown component that allows users to select a region.\n * @param {string | undefined} region - The currently selected region.\n * @param {string[]} regions - The ordered list of available region codes.\n * @param {Map<string, RegionData>} regionData - Map of region codes to their display data (name, emoji, locale).\n * @param {function} setRegion - Function to update the current region.\n * @param {React.ReactNode} [placeholder] - Optional placeholder node to display as the first option when no region is selected.\n * @returns {React.ReactElement | null} The rendered region dropdown component or null to prevent rendering.\n *\n * @internal\n */\nexport function InternalRegionSelector({\n region,\n regions,\n regionData,\n setRegion,\n placeholder,\n ...props\n}: {\n region: string | undefined;\n regions: string[];\n regionData: Map<string, RegionData>;\n setRegion: (region: string) => void;\n placeholder?: ReactNode;\n [key: string]: any;\n}): React.JSX.Element | null {\n // If no regions are returned, just render nothing or handle gracefully\n if (!regions || regions.length === 0 || !setRegion) {\n return null;\n }\n\n return (\n <select\n name='generaltranslation-region'\n aria-label='General Translation region selector'\n {...props}\n // Fallback to an empty string if no region is set\n value={region || ''}\n onChange={(e) => setRegion(e.target.value)}\n >\n {/* Optional placeholder for when no region is set */}\n {!region && (\n <option key='placeholder' value='' suppressHydrationWarning>\n {placeholder || ''}\n </option>\n )}\n\n {regions.map((r) => (\n <option key={r} value={r} suppressHydrationWarning>\n {regionData.get(r)?.name ?? r}\n </option>\n ))}\n </select>\n );\n}\n"],"mappings":"gEAcA,SAAgB,EAAuB,CACrC,SACA,UACA,aACA,YACA,cACA,GAAG,GAQwB,CAM3B,MAJI,CAAC,GAAW,EAAQ,SAAW,GAAK,CAAC,EAChC,KAIP,EAAC,SAAD,CACE,KAAK,4BACL,aAAW,sCACX,GAAI,EAEJ,MAAO,GAAU,GACjB,SAAW,GAAM,EAAU,EAAE,OAAO,MAAM,UAN5C,CASG,CAAC,GACA,EAAC,SAAD,CAA0B,MAAM,GAAG,yBAAA,YAChC,GAAe,GACT,CAFG,cAEH,CAGV,EAAQ,IAAK,GACZ,EAAC,SAAD,CAAgB,MAAO,EAAG,yBAAA,YACvB,EAAW,IAAI,EAAE,EAAE,MAAQ,EACrB,CAFI,EAEJ,CACT,CACK"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../hooks/external-store.cjs`),t=require(`../../utils/rendering/renderPipeline.cjs`),n=require(`../../utils/translation/usePrepareT.cjs`);let r=require(`react`),i=require(`gt-i18n/internal`);function a(e){return s(e)}function o(e){return s(e)}a._gtt=`translate-client`,o._gtt=`translate-client-automatic`;function s({children:a,_locale:o,_enableI18n:s,_renderPreparedT:c=t.renderPreparedT,...l}){let{defaultLocale:u,locale:d,enableI18n:f,targetOptions:p,taggedSourceChildren:m,sourceJsxChildren:h,shouldTranslate:g}=n.usePrepareT({sourceChildren:a,params:l,_locale:o,_enableI18n:s}),_=e.useTranslate({locale:d,message:h,options:p}),v=(0,r.useRef)(null);if((0,i.getI18nConfig)().isDevHotReloadEnabled()&&_==null&&v.current!=null&&g)return v.current;let y=c({taggedSourceChildren:m,targetJsxChildren:_,locale:d,defaultLocale:u,enableI18n:f,shouldTranslate:g});return v.current=y,y}exports.GtInternalTranslateJsx=o,exports.T=a;
|
|
2
|
+
//# sourceMappingURL=T.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"T.cjs","names":["renderPreparedT","usePrepareT","useTranslate"],"sources":["../../../src/components/translation/T.tsx"],"sourcesContent":["import { useTranslate } from '../../hooks/external-store';\nimport { getI18nConfig } from 'gt-i18n/internal';\nimport { useRef, type ReactNode } from 'react';\nimport { renderPreparedT } from '../../utils/rendering/renderPipeline';\nimport type { TProps } from '../../utils/translation/prepareT.shared';\nimport { usePrepareT } from '../../utils/translation/usePrepareT';\n\n// ===== Component ===== //\n\n/**\n * External-store version of the `<T>` component.\n */\nfunction T(props: TProps): ReactNode {\n return useComputeT(props);\n}\n\nfunction GtInternalTranslateJsx(props: TProps): ReactNode {\n return useComputeT(props);\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nT._gtt = 'translate-client';\nGtInternalTranslateJsx._gtt = 'translate-client-automatic';\n\nexport { GtInternalTranslateJsx, T };\n\n/**\n * Render logic\n */\nfunction useComputeT({\n children: sourceChildren,\n _locale,\n _enableI18n,\n _renderPreparedT = renderPreparedT,\n ...params\n}: TProps): ReactNode {\n // Prepare our source children for rendering\n const {\n defaultLocale,\n locale,\n enableI18n,\n targetOptions,\n taggedSourceChildren,\n sourceJsxChildren,\n shouldTranslate,\n } = usePrepareT({\n sourceChildren,\n params,\n _locale,\n _enableI18n,\n });\n\n // Lookup translation in cache\n const targetJsxChildren = useTranslate({\n locale,\n message: sourceJsxChildren,\n options: targetOptions,\n });\n\n // Tx hot reload: render previous translation while loading new one\n // TODO: account for success vs loading vs failed request states\n const prev = useRef<ReactNode | null>(null);\n if (\n getI18nConfig().isDevHotReloadEnabled() &&\n targetJsxChildren == null &&\n prev.current != null &&\n shouldTranslate\n ) {\n return prev.current;\n }\n\n const result = _renderPreparedT({\n taggedSourceChildren,\n targetJsxChildren,\n locale,\n defaultLocale,\n enableI18n,\n shouldTranslate,\n });\n\n // record previous result\n prev.current = result;\n\n return result;\n}\n"],"mappings":"kQAYA,SAAS,EAAE,EAA0B,CACnC,OAAO,EAAY,EAAM,CAG3B,SAAS,EAAuB,EAA0B,CACxD,OAAO,EAAY,EAAM,CAI3B,EAAE,KAAO,mBACT,EAAuB,KAAO,6BAO9B,SAAS,EAAY,CACnB,SAAU,EACV,UACA,cACA,mBAAmBA,EAAAA,gBACnB,GAAG,GACiB,CAEpB,GAAM,CACJ,gBACA,SACA,aACA,gBACA,uBACA,oBACA,mBACEC,EAAAA,YAAY,CACd,iBACA,SACA,UACA,cACD,CAAC,CAGI,EAAoBC,EAAAA,aAAa,CACrC,SACA,QAAS,EACT,QAAS,EACV,CAAC,CAII,GAAA,EAAA,EAAA,QAAgC,KAAK,CAC3C,IAAA,EAAA,EAAA,gBACiB,CAAC,uBAAuB,EACvC,GAAqB,MACrB,EAAK,SAAW,MAChB,EAEA,OAAO,EAAK,QAGd,IAAM,EAAS,EAAiB,CAC9B,uBACA,oBACA,SACA,gBACA,aACA,kBACD,CAAC,CAKF,MAFA,GAAK,QAAU,EAER"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TProps } from "../../utils/translation/prepareT.shared.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/translation/T.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* External-store version of the `<T>` component.
|
|
7
|
+
*/
|
|
8
|
+
declare function T(props: TProps): ReactNode;
|
|
9
|
+
declare namespace T {
|
|
10
|
+
var _gtt: string;
|
|
11
|
+
}
|
|
12
|
+
declare function GtInternalTranslateJsx(props: TProps): ReactNode;
|
|
13
|
+
declare namespace GtInternalTranslateJsx {
|
|
14
|
+
var _gtt: string;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { GtInternalTranslateJsx, T };
|
|
18
|
+
//# sourceMappingURL=T.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"T.d.ts","names":[],"sources":["../../../src/components/translation/T.tsx"],"mappings":";;;;;;AAIsE;iBAQ7D,CAAA,CAAE,KAAA,EAAO,MAAA,GAAS,SAAA;AAAA,kBAAlB,CAAA;EAAA,IAAC,IAAA;AAAA;AAAA,iBAID,sBAAA,CAAuB,KAAA,EAAO,MAAA,GAAS,SAAA;AAAA,kBAAvC,sBAAA;EAAA,IAAsB,IAAA;AAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useTranslate as e}from"../../hooks/external-store.mjs";import{renderPreparedT as t}from"../../utils/rendering/renderPipeline.mjs";import{usePrepareT as n}from"../../utils/translation/usePrepareT.mjs";import{useRef as r}from"react";import{getI18nConfig as i}from"gt-i18n/internal";function a(e){return s(e)}function o(e){return s(e)}a._gtt=`translate-client`,o._gtt=`translate-client-automatic`;function s({children:a,_locale:o,_enableI18n:s,_renderPreparedT:c=t,...l}){let{defaultLocale:u,locale:d,enableI18n:f,targetOptions:p,taggedSourceChildren:m,sourceJsxChildren:h,shouldTranslate:g}=n({sourceChildren:a,params:l,_locale:o,_enableI18n:s}),_=e({locale:d,message:h,options:p}),v=r(null);if(i().isDevHotReloadEnabled()&&_==null&&v.current!=null&&g)return v.current;let y=c({taggedSourceChildren:m,targetJsxChildren:_,locale:d,defaultLocale:u,enableI18n:f,shouldTranslate:g});return v.current=y,y}export{o as GtInternalTranslateJsx,a as T};
|
|
2
|
+
//# sourceMappingURL=T.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"T.mjs","names":[],"sources":["../../../src/components/translation/T.tsx"],"sourcesContent":["import { useTranslate } from '../../hooks/external-store';\nimport { getI18nConfig } from 'gt-i18n/internal';\nimport { useRef, type ReactNode } from 'react';\nimport { renderPreparedT } from '../../utils/rendering/renderPipeline';\nimport type { TProps } from '../../utils/translation/prepareT.shared';\nimport { usePrepareT } from '../../utils/translation/usePrepareT';\n\n// ===== Component ===== //\n\n/**\n * External-store version of the `<T>` component.\n */\nfunction T(props: TProps): ReactNode {\n return useComputeT(props);\n}\n\nfunction GtInternalTranslateJsx(props: TProps): ReactNode {\n return useComputeT(props);\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nT._gtt = 'translate-client';\nGtInternalTranslateJsx._gtt = 'translate-client-automatic';\n\nexport { GtInternalTranslateJsx, T };\n\n/**\n * Render logic\n */\nfunction useComputeT({\n children: sourceChildren,\n _locale,\n _enableI18n,\n _renderPreparedT = renderPreparedT,\n ...params\n}: TProps): ReactNode {\n // Prepare our source children for rendering\n const {\n defaultLocale,\n locale,\n enableI18n,\n targetOptions,\n taggedSourceChildren,\n sourceJsxChildren,\n shouldTranslate,\n } = usePrepareT({\n sourceChildren,\n params,\n _locale,\n _enableI18n,\n });\n\n // Lookup translation in cache\n const targetJsxChildren = useTranslate({\n locale,\n message: sourceJsxChildren,\n options: targetOptions,\n });\n\n // Tx hot reload: render previous translation while loading new one\n // TODO: account for success vs loading vs failed request states\n const prev = useRef<ReactNode | null>(null);\n if (\n getI18nConfig().isDevHotReloadEnabled() &&\n targetJsxChildren == null &&\n prev.current != null &&\n shouldTranslate\n ) {\n return prev.current;\n }\n\n const result = _renderPreparedT({\n taggedSourceChildren,\n targetJsxChildren,\n locale,\n defaultLocale,\n enableI18n,\n shouldTranslate,\n });\n\n // record previous result\n prev.current = result;\n\n return result;\n}\n"],"mappings":"+RAYA,SAAS,EAAE,EAA0B,CACnC,OAAO,EAAY,EAAM,CAG3B,SAAS,EAAuB,EAA0B,CACxD,OAAO,EAAY,EAAM,CAI3B,EAAE,KAAO,mBACT,EAAuB,KAAO,6BAO9B,SAAS,EAAY,CACnB,SAAU,EACV,UACA,cACA,mBAAmB,EACnB,GAAG,GACiB,CAEpB,GAAM,CACJ,gBACA,SACA,aACA,gBACA,uBACA,oBACA,mBACE,EAAY,CACd,iBACA,SACA,UACA,cACD,CAAC,CAGI,EAAoB,EAAa,CACrC,SACA,QAAS,EACT,QAAS,EACV,CAAC,CAII,EAAO,EAAyB,KAAK,CAC3C,GACE,GAAe,CAAC,uBAAuB,EACvC,GAAqB,MACrB,EAAK,SAAW,MAChB,EAEA,OAAO,EAAK,QAGd,IAAM,EAAS,EAAiB,CAC9B,uBACA,oBACA,SACA,gBACA,aACA,kBACD,CAAC,CAKF,MAFA,GAAK,QAAU,EAER"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../i18n-cache/singleton-operations.cjs`),t=require(`../../utils/translation/prepareT.shared.cjs`),n=require(`../../utils/rendering/renderPipeline.rsc.cjs`);let r=require(`gt-i18n/internal`);async function i({children:i,_locale:a,_enableI18n:o,_renderPreparedT:s=n.renderPreparedT,...c}){let l=a,u=o,d=(0,r.getI18nConfig)().getDefaultLocale(),f=u&&(0,r.getI18nConfig)().requiresTranslation(l),p=t.prepareT({sourceChildren:i,params:c,locale:l});if(!f)return s({...p,targetJsxChildren:void 0,locale:l,defaultLocale:d,enableI18n:u,shouldTranslate:f});let m,h=e.getReactI18nCache();return m=(0,r.getI18nConfig)().isDevHotReloadEnabled()?await h.lookupTranslationWithFallback(l,p.sourceJsxChildren,p.targetOptions):(await h.getLookupTranslation(l))(p.sourceJsxChildren,p.targetOptions),s({...p,targetJsxChildren:m,locale:l,defaultLocale:d,enableI18n:u,shouldTranslate:f})}i._gtt=`translate-server`,exports.RscT=i;
|
|
2
|
+
//# sourceMappingURL=T.rsc.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"T.rsc.cjs","names":["renderPreparedT","prepareT","getReactI18nCache"],"sources":["../../../src/components/translation/T.rsc.tsx"],"sourcesContent":["import { getI18nConfig } from 'gt-i18n/internal';\nimport type { ReactNode } from 'react';\nimport { getReactI18nCache } from '../../i18n-cache/singleton-operations';\nimport { renderPreparedT } from '../../utils/rendering/renderPipeline.rsc';\nimport {\n prepareT,\n type ResolvedTProps,\n} from '../../utils/translation/prepareT.shared';\nimport { JsxChildren } from '@generaltranslation/format/types';\n\n// RSC implementation: request conditions are passed explicitly instead of\n// being read from hooks. This module must stay free of hook/context imports\n// so it can be exported from the components-rsc entrypoint.\n\nasync function RscT({\n children: sourceChildren,\n _locale,\n _enableI18n,\n // TODO: don't expose to consumer, this should be thru an internal path\n _renderPreparedT = renderPreparedT,\n ...params\n}: ResolvedTProps): Promise<ReactNode> {\n const locale = _locale;\n const enableI18n = _enableI18n;\n const defaultLocale = getI18nConfig().getDefaultLocale();\n const shouldTranslate =\n enableI18n && getI18nConfig().requiresTranslation(locale);\n const prepared = prepareT({\n sourceChildren,\n params,\n locale,\n });\n\n if (!shouldTranslate) {\n return _renderPreparedT({\n ...prepared,\n targetJsxChildren: undefined,\n locale,\n defaultLocale,\n enableI18n,\n shouldTranslate,\n });\n }\n\n let targetJsxChildren: JsxChildren | undefined;\n const i18nCache = getReactI18nCache();\n if (getI18nConfig().isDevHotReloadEnabled()) {\n targetJsxChildren = await i18nCache.lookupTranslationWithFallback(\n locale,\n prepared.sourceJsxChildren,\n prepared.targetOptions\n );\n } else {\n const lookupTranslation = await i18nCache.getLookupTranslation(locale);\n targetJsxChildren = lookupTranslation(\n prepared.sourceJsxChildren,\n prepared.targetOptions\n );\n }\n\n return _renderPreparedT({\n ...prepared,\n targetJsxChildren,\n locale,\n defaultLocale,\n enableI18n,\n shouldTranslate,\n });\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nRscT._gtt = 'translate-server';\n\n// ===== Exports ===== //\n\nexport { RscT };\n"],"mappings":"kQAcA,eAAe,EAAK,CAClB,SAAU,EACV,UACA,cAEA,mBAAmBA,EAAAA,gBACnB,GAAG,GACkC,CACrC,IAAM,EAAS,EACT,EAAa,EACb,GAAA,EAAA,EAAA,gBAA+B,CAAC,kBAAkB,CAClD,EACJ,IAAA,EAAA,EAAA,gBAA6B,CAAC,oBAAoB,EAAO,CACrD,EAAWC,EAAAA,SAAS,CACxB,iBACA,SACA,SACD,CAAC,CAEF,GAAI,CAAC,EACH,OAAO,EAAiB,CACtB,GAAG,EACH,kBAAmB,IAAA,GACnB,SACA,gBACA,aACA,kBACD,CAAC,CAGJ,IAAI,EACE,EAAYC,EAAAA,mBAAmB,CAerC,MAdA,CAQE,GARF,EAAA,EAAA,gBAAmB,CAAC,uBAAuB,CACrB,MAAM,EAAU,8BAClC,EACA,EAAS,kBACT,EAAS,cACV,EAGmB,MADY,EAAU,qBAAqB,EAAO,EAEpE,EAAS,kBACT,EAAS,cACV,CAGI,EAAiB,CACtB,GAAG,EACH,oBACA,SACA,gBACA,aACA,kBACD,CAAC,CAIJ,EAAK,KAAO"}
|