@generaltranslation/react-core 11.0.0-odysseus.4 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +301 -0
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/components/branches/Branch.cjs +2 -0
- package/dist/components/branches/Branch.cjs.map +1 -0
- package/dist/components/branches/Branch.d.ts +30 -0
- package/dist/components/branches/Branch.d.ts.map +1 -0
- package/dist/components/branches/Branch.mjs +2 -0
- package/dist/components/branches/Branch.mjs.map +1 -0
- package/dist/components/branches/Plural.cjs +2 -0
- package/dist/components/branches/Plural.cjs.map +1 -0
- package/dist/components/branches/Plural.d.ts +19 -0
- package/dist/components/branches/Plural.d.ts.map +1 -0
- package/dist/components/branches/Plural.mjs +2 -0
- package/dist/components/branches/Plural.mjs.map +1 -0
- package/dist/components/branches/Plural.rsc.cjs +2 -0
- package/dist/components/branches/Plural.rsc.cjs.map +1 -0
- package/dist/components/branches/Plural.rsc.d.ts +15 -0
- package/dist/components/branches/Plural.rsc.d.ts.map +1 -0
- package/dist/components/branches/Plural.rsc.mjs +2 -0
- package/dist/components/branches/Plural.rsc.mjs.map +1 -0
- package/dist/components/branches/Plural.shared.cjs +2 -0
- package/dist/components/branches/Plural.shared.cjs.map +1 -0
- package/dist/components/branches/Plural.shared.d.ts +18 -0
- package/dist/components/branches/Plural.shared.d.ts.map +1 -0
- package/dist/components/branches/Plural.shared.mjs +2 -0
- package/dist/components/branches/Plural.shared.mjs.map +1 -0
- package/dist/components/derivation/Derive.cjs +2 -0
- package/dist/components/derivation/Derive.cjs.map +1 -0
- package/dist/components/derivation/Derive.d.ts +19 -0
- package/dist/components/derivation/Derive.d.ts.map +1 -0
- package/dist/components/derivation/Derive.mjs +2 -0
- package/dist/components/derivation/Derive.mjs.map +1 -0
- package/dist/components/helpers/InternalLocaleSelector.cjs +2 -0
- package/dist/components/helpers/InternalLocaleSelector.cjs.map +1 -0
- package/dist/components/helpers/InternalLocaleSelector.d.ts +38 -0
- package/dist/components/helpers/InternalLocaleSelector.d.ts.map +1 -0
- package/dist/components/helpers/InternalLocaleSelector.mjs +2 -0
- package/dist/components/helpers/InternalLocaleSelector.mjs.map +1 -0
- package/dist/components/helpers/InternalRegionSelector.cjs +2 -0
- package/dist/components/helpers/InternalRegionSelector.cjs.map +1 -0
- package/dist/components/helpers/InternalRegionSelector.d.ts +33 -0
- package/dist/components/helpers/InternalRegionSelector.d.ts.map +1 -0
- package/dist/components/helpers/InternalRegionSelector.mjs +2 -0
- package/dist/components/helpers/InternalRegionSelector.mjs.map +1 -0
- package/dist/components/translation/T.cjs +2 -0
- package/dist/components/translation/T.cjs.map +1 -0
- package/dist/components/translation/T.d.ts +18 -0
- package/dist/components/translation/T.d.ts.map +1 -0
- package/dist/components/translation/T.mjs +2 -0
- package/dist/components/translation/T.mjs.map +1 -0
- package/dist/components/translation/T.rsc.cjs +2 -0
- package/dist/components/translation/T.rsc.cjs.map +1 -0
- package/dist/components/translation/T.rsc.d.ts +17 -0
- package/dist/components/translation/T.rsc.d.ts.map +1 -0
- package/dist/components/translation/T.rsc.mjs +2 -0
- package/dist/components/translation/T.rsc.mjs.map +1 -0
- package/dist/components/translation/Tx.rsc.cjs +2 -0
- package/dist/components/translation/Tx.rsc.cjs.map +1 -0
- package/dist/components/translation/Tx.rsc.d.ts +17 -0
- package/dist/components/translation/Tx.rsc.d.ts.map +1 -0
- package/dist/components/translation/Tx.rsc.mjs +2 -0
- package/dist/components/translation/Tx.rsc.mjs.map +1 -0
- package/dist/components/variables/Currency.cjs +2 -0
- package/dist/components/variables/Currency.cjs.map +1 -0
- package/dist/components/variables/Currency.d.ts +18 -0
- package/dist/components/variables/Currency.d.ts.map +1 -0
- package/dist/components/variables/Currency.mjs +2 -0
- package/dist/components/variables/Currency.mjs.map +1 -0
- package/dist/components/variables/Currency.rsc.cjs +2 -0
- package/dist/components/variables/Currency.rsc.cjs.map +1 -0
- package/dist/components/variables/Currency.rsc.d.ts +14 -0
- package/dist/components/variables/Currency.rsc.d.ts.map +1 -0
- package/dist/components/variables/Currency.rsc.mjs +2 -0
- package/dist/components/variables/Currency.rsc.mjs.map +1 -0
- package/dist/components/variables/Currency.shared.cjs +2 -0
- package/dist/components/variables/Currency.shared.cjs.map +1 -0
- package/dist/components/variables/Currency.shared.d.ts +17 -0
- package/dist/components/variables/Currency.shared.d.ts.map +1 -0
- package/dist/components/variables/Currency.shared.mjs +2 -0
- package/dist/components/variables/Currency.shared.mjs.map +1 -0
- package/dist/components/variables/DateTime.cjs +2 -0
- package/dist/components/variables/DateTime.cjs.map +1 -0
- package/dist/components/variables/DateTime.d.ts +18 -0
- package/dist/components/variables/DateTime.d.ts.map +1 -0
- package/dist/components/variables/DateTime.mjs +2 -0
- package/dist/components/variables/DateTime.mjs.map +1 -0
- package/dist/components/variables/DateTime.rsc.cjs +2 -0
- package/dist/components/variables/DateTime.rsc.cjs.map +1 -0
- package/dist/components/variables/DateTime.rsc.d.ts +14 -0
- package/dist/components/variables/DateTime.rsc.d.ts.map +1 -0
- package/dist/components/variables/DateTime.rsc.mjs +2 -0
- package/dist/components/variables/DateTime.rsc.mjs.map +1 -0
- package/dist/components/variables/DateTime.shared.cjs +2 -0
- package/dist/components/variables/DateTime.shared.cjs.map +1 -0
- package/dist/components/variables/DateTime.shared.d.ts +16 -0
- package/dist/components/variables/DateTime.shared.d.ts.map +1 -0
- package/dist/components/variables/DateTime.shared.mjs +2 -0
- package/dist/components/variables/DateTime.shared.mjs.map +1 -0
- package/dist/components/variables/Num.cjs +2 -0
- package/dist/components/variables/Num.cjs.map +1 -0
- package/dist/components/variables/Num.d.ts +18 -0
- package/dist/components/variables/Num.d.ts.map +1 -0
- package/dist/components/variables/Num.mjs +2 -0
- package/dist/components/variables/Num.mjs.map +1 -0
- package/dist/components/variables/Num.rsc.cjs +2 -0
- package/dist/components/variables/Num.rsc.cjs.map +1 -0
- package/dist/components/variables/Num.rsc.d.ts +14 -0
- package/dist/components/variables/Num.rsc.d.ts.map +1 -0
- package/dist/components/variables/Num.rsc.mjs +2 -0
- package/dist/components/variables/Num.rsc.mjs.map +1 -0
- package/dist/components/variables/Num.shared.cjs +2 -0
- package/dist/components/variables/Num.shared.cjs.map +1 -0
- package/dist/components/variables/Num.shared.d.ts +16 -0
- package/dist/components/variables/Num.shared.d.ts.map +1 -0
- package/dist/components/variables/Num.shared.mjs +2 -0
- package/dist/components/variables/Num.shared.mjs.map +1 -0
- package/dist/components/variables/RelativeTime.cjs +2 -0
- package/dist/components/variables/RelativeTime.cjs.map +1 -0
- package/dist/components/variables/RelativeTime.d.ts +18 -0
- package/dist/components/variables/RelativeTime.d.ts.map +1 -0
- package/dist/components/variables/RelativeTime.mjs +2 -0
- package/dist/components/variables/RelativeTime.mjs.map +1 -0
- package/dist/components/variables/RelativeTime.rsc.cjs +2 -0
- package/dist/components/variables/RelativeTime.rsc.cjs.map +1 -0
- package/dist/components/variables/RelativeTime.rsc.d.ts +14 -0
- package/dist/components/variables/RelativeTime.rsc.d.ts.map +1 -0
- package/dist/components/variables/RelativeTime.rsc.mjs +2 -0
- package/dist/components/variables/RelativeTime.rsc.mjs.map +1 -0
- package/dist/components/variables/RelativeTime.shared.cjs +2 -0
- package/dist/components/variables/RelativeTime.shared.cjs.map +1 -0
- package/dist/components/variables/RelativeTime.shared.d.ts +20 -0
- package/dist/components/variables/RelativeTime.shared.d.ts.map +1 -0
- package/dist/components/variables/RelativeTime.shared.mjs +2 -0
- package/dist/components/variables/RelativeTime.shared.mjs.map +1 -0
- package/dist/components/variables/Var.cjs +2 -0
- package/dist/components/variables/Var.cjs.map +1 -0
- package/dist/components/variables/Var.d.ts +27 -0
- package/dist/components/variables/Var.d.ts.map +1 -0
- package/dist/components/variables/Var.mjs +2 -0
- package/dist/components/variables/Var.mjs.map +1 -0
- package/dist/components-rsc.cjs +1 -0
- package/dist/components-rsc.d.ts +32 -531
- package/dist/components-rsc.mjs +1 -0
- package/dist/components.cjs +1 -0
- package/dist/components.d.ts +14 -495
- package/dist/components.mjs +1 -0
- package/dist/condition-store/singleton-operations.cjs +2 -0
- package/dist/condition-store/singleton-operations.cjs.map +1 -0
- package/dist/condition-store/singleton-operations.d.ts +7 -0
- package/dist/condition-store/singleton-operations.d.ts.map +1 -0
- package/dist/condition-store/singleton-operations.mjs +2 -0
- package/dist/condition-store/singleton-operations.mjs.map +1 -0
- package/dist/context/InternalGTProvider.cjs +2 -0
- package/dist/context/InternalGTProvider.cjs.map +1 -0
- package/dist/context/InternalGTProvider.d.ts +39 -0
- package/dist/context/InternalGTProvider.d.ts.map +1 -0
- package/dist/context/InternalGTProvider.mjs +2 -0
- package/dist/context/InternalGTProvider.mjs.map +1 -0
- package/dist/context/context.cjs +2 -0
- package/dist/context/context.cjs.map +1 -0
- package/dist/context/context.mjs +2 -0
- package/dist/context/context.mjs.map +1 -0
- package/dist/functions/helpers/getTranslationsSnapshot.cjs +2 -0
- package/dist/functions/helpers/getTranslationsSnapshot.cjs.map +1 -0
- package/dist/functions/helpers/getTranslationsSnapshot.d.ts +14 -0
- package/dist/functions/helpers/getTranslationsSnapshot.d.ts.map +1 -0
- package/dist/functions/helpers/getTranslationsSnapshot.mjs +2 -0
- package/dist/functions/helpers/getTranslationsSnapshot.mjs.map +1 -0
- package/dist/functions/translation/t.cjs +2 -0
- package/dist/functions/translation/t.cjs.map +1 -0
- package/dist/functions/translation/t.d.ts +34 -0
- package/dist/functions/translation/t.d.ts.map +1 -0
- package/dist/functions/translation/t.mjs +2 -0
- package/dist/functions/translation/t.mjs.map +1 -0
- package/dist/hooks/condition-store.cjs +2 -0
- package/dist/hooks/condition-store.cjs.map +1 -0
- package/dist/hooks/condition-store.d.ts +23 -0
- package/dist/hooks/condition-store.d.ts.map +1 -0
- package/dist/hooks/condition-store.mjs +2 -0
- package/dist/hooks/condition-store.mjs.map +1 -0
- package/dist/hooks/external-store/useSubscribeToTrackedLookups.cjs +2 -0
- package/dist/hooks/external-store/useSubscribeToTrackedLookups.cjs.map +1 -0
- package/dist/hooks/external-store/useSubscribeToTrackedLookups.mjs +2 -0
- package/dist/hooks/external-store/useSubscribeToTrackedLookups.mjs.map +1 -0
- package/dist/hooks/external-store/useTrackedDictionaryObjResolver.cjs +2 -0
- package/dist/hooks/external-store/useTrackedDictionaryObjResolver.cjs.map +1 -0
- package/dist/hooks/external-store/useTrackedDictionaryObjResolver.mjs +2 -0
- package/dist/hooks/external-store/useTrackedDictionaryObjResolver.mjs.map +1 -0
- package/dist/hooks/external-store/useTrackedDictionaryResolver.cjs +2 -0
- package/dist/hooks/external-store/useTrackedDictionaryResolver.cjs.map +1 -0
- package/dist/hooks/external-store/useTrackedDictionaryResolver.mjs +2 -0
- package/dist/hooks/external-store/useTrackedDictionaryResolver.mjs.map +1 -0
- package/dist/hooks/external-store/useTrackedTranslationResolver.cjs +2 -0
- package/dist/hooks/external-store/useTrackedTranslationResolver.cjs.map +1 -0
- package/dist/hooks/external-store/useTrackedTranslationResolver.d.ts +10 -0
- package/dist/hooks/external-store/useTrackedTranslationResolver.d.ts.map +1 -0
- package/dist/hooks/external-store/useTrackedTranslationResolver.mjs +2 -0
- package/dist/hooks/external-store/useTrackedTranslationResolver.mjs.map +1 -0
- package/dist/hooks/external-store.cjs +2 -0
- package/dist/hooks/external-store.cjs.map +1 -0
- package/dist/hooks/external-store.mjs +2 -0
- package/dist/hooks/external-store.mjs.map +1 -0
- package/dist/hooks/i18n-config.cjs +2 -0
- package/dist/hooks/i18n-config.cjs.map +1 -0
- package/dist/hooks/i18n-config.d.ts +9 -0
- package/dist/hooks/i18n-config.d.ts.map +1 -0
- package/dist/hooks/i18n-config.mjs +2 -0
- package/dist/hooks/i18n-config.mjs.map +1 -0
- package/dist/hooks/useGT.cjs +2 -0
- package/dist/hooks/useGT.cjs.map +1 -0
- package/dist/hooks/useGT.d.ts +8 -0
- package/dist/hooks/useGT.d.ts.map +1 -0
- package/dist/hooks/useGT.mjs +2 -0
- package/dist/hooks/useGT.mjs.map +1 -0
- package/dist/hooks/useInternalLocaleSelector.cjs +2 -0
- package/dist/hooks/useInternalLocaleSelector.cjs.map +1 -0
- package/dist/hooks/useInternalLocaleSelector.d.ts +12 -0
- package/dist/hooks/useInternalLocaleSelector.d.ts.map +1 -0
- package/dist/hooks/useInternalLocaleSelector.mjs +2 -0
- package/dist/hooks/useInternalLocaleSelector.mjs.map +1 -0
- package/dist/hooks/useInternalRegionSelector.cjs +2 -0
- package/dist/hooks/useInternalRegionSelector.cjs.map +1 -0
- package/dist/hooks/useInternalRegionSelector.d.ts +42 -0
- package/dist/hooks/useInternalRegionSelector.d.ts.map +1 -0
- package/dist/hooks/useInternalRegionSelector.mjs +2 -0
- package/dist/hooks/useInternalRegionSelector.mjs.map +1 -0
- package/dist/hooks/useMessages.cjs +2 -0
- package/dist/hooks/useMessages.cjs.map +1 -0
- package/dist/hooks/useMessages.d.ts +8 -0
- package/dist/hooks/useMessages.d.ts.map +1 -0
- package/dist/hooks/useMessages.mjs +2 -0
- package/dist/hooks/useMessages.mjs.map +1 -0
- package/dist/hooks/useTranslations.cjs +2 -0
- package/dist/hooks/useTranslations.cjs.map +1 -0
- package/dist/hooks/useTranslations.d.ts +10 -0
- package/dist/hooks/useTranslations.d.ts.map +1 -0
- package/dist/hooks/useTranslations.mjs +2 -0
- package/dist/hooks/useTranslations.mjs.map +1 -0
- package/dist/hooks/utils/getFormatLocales.cjs +2 -0
- package/dist/hooks/utils/getFormatLocales.cjs.map +1 -0
- package/dist/hooks/utils/getFormatLocales.d.ts +13 -0
- package/dist/hooks/utils/getFormatLocales.d.ts.map +1 -0
- package/dist/hooks/utils/getFormatLocales.mjs +2 -0
- package/dist/hooks/utils/getFormatLocales.mjs.map +1 -0
- package/dist/hooks/utils/getShouldTranslate.cjs +2 -0
- package/dist/hooks/utils/getShouldTranslate.cjs.map +1 -0
- package/dist/hooks/utils/getShouldTranslate.d.ts +8 -0
- package/dist/hooks/utils/getShouldTranslate.d.ts.map +1 -0
- package/dist/hooks/utils/getShouldTranslate.mjs +2 -0
- package/dist/hooks/utils/getShouldTranslate.mjs.map +1 -0
- package/dist/hooks/utils/missing-translation.cjs +2 -0
- package/dist/hooks/utils/missing-translation.cjs.map +1 -0
- package/dist/hooks/utils/missing-translation.d.ts +10 -0
- package/dist/hooks/utils/missing-translation.d.ts.map +1 -0
- package/dist/hooks/utils/missing-translation.mjs +2 -0
- package/dist/hooks/utils/missing-translation.mjs.map +1 -0
- package/dist/hooks/utils.cjs +2 -0
- package/dist/hooks/utils.cjs.map +1 -0
- package/dist/hooks/utils.d.ts +10 -0
- package/dist/hooks/utils.d.ts.map +1 -0
- package/dist/hooks/utils.mjs +2 -0
- package/dist/hooks/utils.mjs.map +1 -0
- package/dist/hooks.cjs +1 -0
- package/dist/hooks.d.ts +9 -130
- package/dist/hooks.mjs +1 -0
- package/dist/i18n-cache/ReactI18nCache.cjs +2 -0
- package/dist/i18n-cache/ReactI18nCache.cjs.map +1 -0
- package/dist/i18n-cache/ReactI18nCache.d.ts +10 -0
- package/dist/i18n-cache/ReactI18nCache.d.ts.map +1 -0
- package/dist/i18n-cache/ReactI18nCache.mjs +2 -0
- package/dist/i18n-cache/ReactI18nCache.mjs.map +1 -0
- package/dist/i18n-cache/singleton-operations.cjs +2 -0
- package/dist/i18n-cache/singleton-operations.cjs.map +1 -0
- package/dist/i18n-cache/singleton-operations.d.ts +8 -0
- package/dist/i18n-cache/singleton-operations.d.ts.map +1 -0
- package/dist/i18n-cache/singleton-operations.mjs +2 -0
- package/dist/i18n-cache/singleton-operations.mjs.map +1 -0
- package/dist/i18n-store/I18nStore.cjs +2 -0
- package/dist/i18n-store/I18nStore.cjs.map +1 -0
- package/dist/i18n-store/I18nStore.d.ts +41 -0
- package/dist/i18n-store/I18nStore.d.ts.map +1 -0
- package/dist/i18n-store/I18nStore.mjs +2 -0
- package/dist/i18n-store/I18nStore.mjs.map +1 -0
- package/dist/i18n-store/singleton-operations.cjs +2 -0
- package/dist/i18n-store/singleton-operations.cjs.map +1 -0
- package/dist/i18n-store/singleton-operations.d.ts +7 -0
- package/dist/i18n-store/singleton-operations.d.ts.map +1 -0
- package/dist/i18n-store/singleton-operations.mjs +2 -0
- package/dist/i18n-store/singleton-operations.mjs.map +1 -0
- package/dist/i18n-store/storeTypes.d.ts +22 -0
- package/dist/i18n-store/storeTypes.d.ts.map +1 -0
- package/dist/i18n-store/useI18nStore.cjs +2 -0
- package/dist/i18n-store/useI18nStore.cjs.map +1 -0
- package/dist/i18n-store/useI18nStore.mjs +2 -0
- package/dist/i18n-store/useI18nStore.mjs.map +1 -0
- package/dist/i18n-store/utils/dictionaries.cjs +2 -0
- package/dist/i18n-store/utils/dictionaries.cjs.map +1 -0
- package/dist/i18n-store/utils/dictionaries.mjs +2 -0
- package/dist/i18n-store/utils/dictionaries.mjs.map +1 -0
- package/dist/i18n-store/utils/subscriptions.cjs +2 -0
- package/dist/i18n-store/utils/subscriptions.cjs.map +1 -0
- package/dist/i18n-store/utils/subscriptions.mjs +2 -0
- package/dist/i18n-store/utils/subscriptions.mjs.map +1 -0
- package/dist/i18n-store/utils/translations.cjs +2 -0
- package/dist/i18n-store/utils/translations.cjs.map +1 -0
- package/dist/i18n-store/utils/translations.mjs +2 -0
- package/dist/i18n-store/utils/translations.mjs.map +1 -0
- package/dist/pure.cjs +1 -0
- package/dist/pure.d.ts +18 -677
- package/dist/pure.mjs +1 -0
- package/dist/setup/i18nConfig.cjs +2 -0
- package/dist/setup/i18nConfig.cjs.map +1 -0
- package/dist/setup/i18nConfig.d.ts +48 -0
- package/dist/setup/i18nConfig.d.ts.map +1 -0
- package/dist/setup/i18nConfig.mjs +2 -0
- package/dist/setup/i18nConfig.mjs.map +1 -0
- package/dist/setup/initializeGTSRA.cjs +2 -0
- package/dist/setup/initializeGTSRA.cjs.map +1 -0
- package/dist/setup/initializeGTSRA.d.ts +11 -0
- package/dist/setup/initializeGTSRA.d.ts.map +1 -0
- package/dist/setup/initializeGTSRA.mjs +2 -0
- package/dist/setup/initializeGTSRA.mjs.map +1 -0
- package/dist/utils/internal/addGTIdentifier.cjs +2 -0
- package/dist/utils/internal/addGTIdentifier.cjs.map +1 -0
- package/dist/utils/internal/addGTIdentifier.mjs +2 -0
- package/dist/utils/internal/addGTIdentifier.mjs.map +1 -0
- package/dist/utils/internal/removeInjectedT.cjs +2 -0
- package/dist/utils/internal/removeInjectedT.cjs.map +1 -0
- package/dist/utils/internal/removeInjectedT.mjs +2 -0
- package/dist/utils/internal/removeInjectedT.mjs.map +1 -0
- package/dist/utils/internal/writeChildrenAsObjects.cjs +2 -0
- package/dist/utils/internal/writeChildrenAsObjects.cjs.map +1 -0
- package/dist/utils/internal/writeChildrenAsObjects.mjs +2 -0
- package/dist/utils/internal/writeChildrenAsObjects.mjs.map +1 -0
- package/dist/utils/plurals/getPluralBranch.cjs +2 -0
- package/dist/utils/plurals/getPluralBranch.cjs.map +1 -0
- package/dist/utils/plurals/getPluralBranch.d.ts +12 -0
- package/dist/utils/plurals/getPluralBranch.d.ts.map +1 -0
- package/dist/utils/plurals/getPluralBranch.mjs +2 -0
- package/dist/utils/plurals/getPluralBranch.mjs.map +1 -0
- package/dist/utils/rendering/createRenderPipeline.cjs +2 -0
- package/dist/utils/rendering/createRenderPipeline.cjs.map +1 -0
- package/dist/utils/rendering/createRenderPipeline.d.ts +18 -0
- package/dist/utils/rendering/createRenderPipeline.d.ts.map +1 -0
- package/dist/utils/rendering/createRenderPipeline.mjs +2 -0
- package/dist/utils/rendering/createRenderPipeline.mjs.map +1 -0
- package/dist/utils/rendering/createRenderVariable.cjs +2 -0
- package/dist/utils/rendering/createRenderVariable.cjs.map +1 -0
- package/dist/utils/rendering/createRenderVariable.d.ts +46 -0
- package/dist/utils/rendering/createRenderVariable.d.ts.map +1 -0
- package/dist/utils/rendering/createRenderVariable.mjs +2 -0
- package/dist/utils/rendering/createRenderVariable.mjs.map +1 -0
- package/dist/utils/rendering/getDefaultRenderSettings.cjs +2 -0
- package/dist/utils/rendering/getDefaultRenderSettings.cjs.map +1 -0
- package/dist/utils/rendering/getDefaultRenderSettings.d.ts +10 -0
- package/dist/utils/rendering/getDefaultRenderSettings.d.ts.map +1 -0
- package/dist/utils/rendering/getDefaultRenderSettings.mjs +2 -0
- package/dist/utils/rendering/getDefaultRenderSettings.mjs.map +1 -0
- package/dist/utils/rendering/getGTTag.cjs +2 -0
- package/dist/utils/rendering/getGTTag.cjs.map +1 -0
- package/dist/utils/rendering/getGTTag.mjs +2 -0
- package/dist/utils/rendering/getGTTag.mjs.map +1 -0
- package/dist/utils/rendering/renderDefaultChildren.shared.cjs +2 -0
- package/dist/utils/rendering/renderDefaultChildren.shared.cjs.map +1 -0
- package/dist/utils/rendering/renderDefaultChildren.shared.d.ts +12 -0
- package/dist/utils/rendering/renderDefaultChildren.shared.d.ts.map +1 -0
- package/dist/utils/rendering/renderDefaultChildren.shared.mjs +2 -0
- package/dist/utils/rendering/renderDefaultChildren.shared.mjs.map +1 -0
- package/dist/utils/rendering/renderPipeline.cjs +2 -0
- package/dist/utils/rendering/renderPipeline.cjs.map +1 -0
- package/dist/utils/rendering/renderPipeline.mjs +2 -0
- package/dist/utils/rendering/renderPipeline.mjs.map +1 -0
- package/dist/utils/rendering/renderPipeline.rsc.cjs +2 -0
- package/dist/utils/rendering/renderPipeline.rsc.cjs.map +1 -0
- package/dist/utils/rendering/renderPipeline.rsc.d.ts +11 -0
- package/dist/utils/rendering/renderPipeline.rsc.d.ts.map +1 -0
- package/dist/utils/rendering/renderPipeline.rsc.mjs +2 -0
- package/dist/utils/rendering/renderPipeline.rsc.mjs.map +1 -0
- package/dist/utils/rendering/renderPreparedT.shared.cjs +2 -0
- package/dist/utils/rendering/renderPreparedT.shared.cjs.map +1 -0
- package/dist/utils/rendering/renderPreparedT.shared.d.ts +16 -0
- package/dist/utils/rendering/renderPreparedT.shared.d.ts.map +1 -0
- package/dist/utils/rendering/renderPreparedT.shared.mjs +2 -0
- package/dist/utils/rendering/renderPreparedT.shared.mjs.map +1 -0
- package/dist/utils/rendering/renderTranslatedChildren.shared.cjs +2 -0
- package/dist/utils/rendering/renderTranslatedChildren.shared.cjs.map +1 -0
- package/dist/utils/rendering/renderTranslatedChildren.shared.d.ts +13 -0
- package/dist/utils/rendering/renderTranslatedChildren.shared.d.ts.map +1 -0
- package/dist/utils/rendering/renderTranslatedChildren.shared.mjs +2 -0
- package/dist/utils/rendering/renderTranslatedChildren.shared.mjs.map +1 -0
- package/dist/utils/translation/prepareT.shared.cjs +2 -0
- package/dist/utils/translation/prepareT.shared.cjs.map +1 -0
- package/dist/utils/translation/prepareT.shared.d.ts +40 -0
- package/dist/utils/translation/prepareT.shared.d.ts.map +1 -0
- package/dist/utils/translation/prepareT.shared.mjs +2 -0
- package/dist/utils/translation/prepareT.shared.mjs.map +1 -0
- package/dist/utils/translation/usePrepareT.cjs +2 -0
- package/dist/utils/translation/usePrepareT.cjs.map +1 -0
- package/dist/utils/translation/usePrepareT.mjs +2 -0
- package/dist/utils/translation/usePrepareT.mjs.map +1 -0
- package/dist/utils/types.d.ts +64 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/utils.cjs +2 -0
- package/dist/utils/utils.cjs.map +1 -0
- package/dist/utils/utils.mjs +2 -0
- package/dist/utils/utils.mjs.map +1 -0
- package/dist/utils/variables/_getVariableProps.cjs +2 -0
- package/dist/utils/variables/_getVariableProps.cjs.map +1 -0
- package/dist/utils/variables/_getVariableProps.mjs +2 -0
- package/dist/utils/variables/_getVariableProps.mjs.map +1 -0
- package/dist/utils/variables/getVariableName.cjs +2 -0
- package/dist/utils/variables/getVariableName.cjs.map +1 -0
- package/dist/utils/variables/getVariableName.mjs +2 -0
- package/dist/utils/variables/getVariableName.mjs.map +1 -0
- package/package.json +13 -41
- package/dist/components-rsc.cjs.min.cjs +0 -2
- package/dist/components-rsc.cjs.min.cjs.map +0 -1
- package/dist/components-rsc.d.ts.map +0 -1
- package/dist/components-rsc.esm.min.mjs +0 -2
- package/dist/components-rsc.esm.min.mjs.map +0 -1
- package/dist/components.cjs.min.cjs +0 -2
- package/dist/components.cjs.min.cjs.map +0 -1
- package/dist/components.d.ts.map +0 -1
- package/dist/components.esm.min.mjs +0 -2
- package/dist/components.esm.min.mjs.map +0 -1
- package/dist/cookies.cjs.min.cjs +0 -2
- package/dist/cookies.cjs.min.cjs.map +0 -1
- package/dist/cookies.d.ts +0 -16
- package/dist/cookies.d.ts.map +0 -1
- package/dist/cookies.esm.min.mjs +0 -2
- package/dist/cookies.esm.min.mjs.map +0 -1
- package/dist/hooks.cjs.min.cjs +0 -2
- package/dist/hooks.cjs.min.cjs.map +0 -1
- package/dist/hooks.d.ts.map +0 -1
- package/dist/hooks.esm.min.mjs +0 -2
- package/dist/hooks.esm.min.mjs.map +0 -1
- package/dist/pure.cjs.min.cjs +0 -2
- package/dist/pure.cjs.min.cjs.map +0 -1
- package/dist/pure.d.ts.map +0 -1
- package/dist/pure.esm.min.mjs +0 -2
- package/dist/pure.esm.min.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,252 @@
|
|
|
1
1
|
# @generaltranslation/react-core
|
|
2
2
|
|
|
3
|
+
## 11.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#1816](https://github.com/generaltranslation/gt/pull/1816) [`463a8db`](https://github.com/generaltranslation/gt/commit/463a8dbb03bde35f2f229dfdabfe117197d4527b) Thanks [@bgub](https://github.com/bgub)! - Add a config-aware `resolveCanonicalLocale` helper and remove the public `getGTClass` helper.
|
|
8
|
+
|
|
9
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`e12fb17`](https://github.com/generaltranslation/gt/commit/e12fb17d41cfa5fa231e64fe70423434739ea985) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Prepare Odysseus major releases for core runtime packages.
|
|
10
|
+
|
|
11
|
+
- [#1816](https://github.com/generaltranslation/gt/pull/1816) [`463a8db`](https://github.com/generaltranslation/gt/commit/463a8dbb03bde35f2f229dfdabfe117197d4527b) Thanks [@bgub](https://github.com/bgub)! - Remove the deprecated `useGTClass` hook from public entry points.
|
|
12
|
+
|
|
13
|
+
- [#1821](https://github.com/generaltranslation/gt/pull/1821) [`40db0c5`](https://github.com/generaltranslation/gt/commit/40db0c54a58e82d693d8a16d19fe5071baabecdc) Thanks [@bgub](https://github.com/bgub)! - Remove `useVersionId` from public package entrypoints.
|
|
14
|
+
|
|
15
|
+
The `getVersionId` helper remains available from public function entrypoints and `gt-i18n/internal`.
|
|
16
|
+
|
|
17
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`8a2f7ee`](https://github.com/generaltranslation/gt/commit/8a2f7ee79f4b890fb1aaf47f42bb844334899793) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - 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.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`37e0080`](https://github.com/generaltranslation/gt/commit/37e0080b2c072840cf6c0f1c66a8f0f3a54e17e5) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Add default form and accessibility labels to LocaleSelector.
|
|
22
|
+
|
|
23
|
+
- [#1815](https://github.com/generaltranslation/gt/pull/1815) [`1212135`](https://github.com/generaltranslation/gt/commit/1212135e4e09ed754756cac2805bc3a139408dc1) Thanks [@bgub](https://github.com/bgub)! - Clean up the `@generaltranslation/react-core` public API surface.
|
|
24
|
+
- `@generaltranslation/react-core`: Removed dead dictionary helper exports and source files, stopped exporting JSX serialization internals from `/pure`, dropped internal singleton/plumbing exports from `/pure`, removed `useShouldTranslate` from `/hooks`, and kept only `internalInitializeGTSRA` for the server-rendered initializer.
|
|
25
|
+
- `gt-react`: Aliases `internalInitializeGTSRA` locally from the RSC entrypoint so the public `initializeGT` export remains unchanged.
|
|
26
|
+
- `gt-next`: Replaced imports of removed react-core legacy types with equivalent local types.
|
|
27
|
+
|
|
28
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`04f419d`](https://github.com/generaltranslation/gt/commit/04f419d65e69db3eb4adb8ee6299c0ddee153135) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Fix source interpolation for default-locale string helpers.
|
|
29
|
+
Clarify that `tx()` does not apply ICU formatting by default.
|
|
30
|
+
|
|
31
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`72e9e16`](https://github.com/generaltranslation/gt/commit/72e9e1643797be8e4ae1453897fd0b023fce2674) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Split the runtime surface of the GT class (locale management, formatting, runtime translation) into a GTRuntime base class exported from the new `generaltranslation/runtime` entry point. The SDK runtime (gt-i18n's I18nConfig, gt-next middleware) now constructs GTRuntime, so production browser bundles no longer ship the project/file management API client (enqueueFiles, uploads, downloads, etc.). The GT class extends GTRuntime and keeps its full API for the CLI and other tooling. Also import getLocaleProperties from @generaltranslation/format directly in react-core so client bundles don't reach the full core entry.
|
|
32
|
+
|
|
33
|
+
- [#1811](https://github.com/generaltranslation/gt/pull/1811) [`bea8233`](https://github.com/generaltranslation/gt/commit/bea8233d8b055980483cb2e226157f6adcbd8c2b) Thanks [@bgub](https://github.com/bgub)! - Statically gate dev hot-reload code paths (tracked resolver invalidation, missing-translation queue, T hot-reload fallbacks, getGT dev preload) behind `process.env.NODE_ENV !== 'production'` so bundlers can drop them from production builds. Behavior is unchanged: the existing runtime `isDevHotReloadEnabled()` check still applies in development.
|
|
34
|
+
|
|
35
|
+
- [#1812](https://github.com/generaltranslation/gt/pull/1812) [`5736d58`](https://github.com/generaltranslation/gt/commit/5736d585b8285ef56cc6f412799308969ac786c0) Thanks [@bgub](https://github.com/bgub)! - Use production no-op stubs for dev hot-reload hooks so bundlers can drop more dev-only hot-reload code.
|
|
36
|
+
|
|
37
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`947fe0c`](https://github.com/generaltranslation/gt/commit/947fe0c97a2821a0980cd3e779252ea0078e80f8) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Fix `useVersionId()` throwing and `useLocaleDirection()` requiring a locale argument in the client and server entrypoints.
|
|
38
|
+
|
|
39
|
+
`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.
|
|
40
|
+
|
|
41
|
+
- [#1820](https://github.com/generaltranslation/gt/pull/1820) [`1f53e42`](https://github.com/generaltranslation/gt/commit/1f53e420e9a6475f85cf27e1cd0c9c89f4beeb36) Thanks [@bgub](https://github.com/bgub)! - Clean up the `gt-i18n` public API surface by removing dead subpaths, internal exports, and unused types.
|
|
42
|
+
|
|
43
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`b3bb391`](https://github.com/generaltranslation/gt/commit/b3bb391d33041680e2d62b6a7c9b05662946544f) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Store cookie names in I18nConfig so custom cookie names work before the condition store is initialized.
|
|
44
|
+
- `gt-i18n`: Removed the unused React locale cookie name from the shared GT config type.
|
|
45
|
+
- `@generaltranslation/react-core`: `ReactI18nConfig` now accepts `localeCookieName`, `regionCookieName`, and `enableI18nCookieName`, exposes getters that fall back to the default names, and exports the default storage names from the `pure` entrypoint.
|
|
46
|
+
- `gt-next`: Imports default cookie names from the React Core `pure` entrypoint instead of the removed React Core cookie constants subpath.
|
|
47
|
+
- `gt-react`: The browser condition store now resolves cookie names from `I18nConfig` instead of hardcoding the defaults, so custom cookie names passed to `initializeGT()` are honored for both reads and writes.
|
|
48
|
+
- `gt-react-native`: Native condition storage now resolves its store keys from `I18nConfig`, matching `gt-react` behavior.
|
|
49
|
+
- `gt-tanstack-start`: `parseLocale()` reads and writes the locale cookie using the configured cookie name instead of the default.
|
|
50
|
+
|
|
51
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`d48604e`](https://github.com/generaltranslation/gt/commit/d48604e2171aa84c76873cacb6eb8d43c2f17546) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Trigger an odysseus prerelease patch for all publishable packages.
|
|
52
|
+
|
|
53
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`44bc998`](https://github.com/generaltranslation/gt/commit/44bc998abf813ea4a96ade6c2632e1143034bd45) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Trigger a new Odysseus prerelease after updating the release workflow.
|
|
54
|
+
|
|
55
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`b7d44dc`](https://github.com/generaltranslation/gt/commit/b7d44dc2d79ac3332a0ed55da0ba130b6896f756) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Share render pipeline child renderers with prepared translation rendering.
|
|
56
|
+
|
|
57
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`9561761`](https://github.com/generaltranslation/gt/commit/9561761c3ab72a5e39327415b3274eccc63f4ffe) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Build `@generaltranslation/react-core` as unbundled, tree-shakeable modules.
|
|
58
|
+
|
|
59
|
+
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.
|
|
60
|
+
|
|
61
|
+
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.
|
|
62
|
+
|
|
63
|
+
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.
|
|
64
|
+
|
|
65
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`72c6a85`](https://github.com/generaltranslation/gt/commit/72c6a85cc3ca025ebdeb006dbdd865e935ec77ae) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Add portable selector hook return types for React Native declarations.
|
|
66
|
+
|
|
67
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`3d95277`](https://github.com/generaltranslation/gt/commit/3d95277a057b28fffc73b3fa616210bdcb447e85) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Remove unused internal exports and dead utility code.
|
|
68
|
+
|
|
69
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`97dc7f4`](https://github.com/generaltranslation/gt/commit/97dc7f4818476a319a54b1519e994a62d5a9a3a5) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Remove default exports from package entrypoints and internal source modules.
|
|
70
|
+
|
|
71
|
+
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`.
|
|
72
|
+
|
|
73
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`85a0c19`](https://github.com/generaltranslation/gt/commit/85a0c1998a6500233affd8c1987551170584c782) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - 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.
|
|
74
|
+
|
|
75
|
+
- [#1825](https://github.com/generaltranslation/gt/pull/1825) [`e343775`](https://github.com/generaltranslation/gt/commit/e343775d8a41ce3eea03dd319b90497a9744cc4f) Thanks [@bgub](https://github.com/bgub)! - Remove the accidental `useShouldTranslate` export from `@generaltranslation/react-core/hooks`. The hook is an internal implementation detail and was never meant to be public.
|
|
76
|
+
|
|
77
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`2c46baf`](https://github.com/generaltranslation/gt/commit/2c46baf137400613495e3fe2865865b5506edece) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Persist TanStack Start locale resolution through the browser locale cookie.
|
|
78
|
+
Allow React i18n config checks to work across bundled react-core entrypoints.
|
|
79
|
+
|
|
80
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`9e78cf0`](https://github.com/generaltranslation/gt/commit/9e78cf07db58bfe6063bcd0b217553176c9681bd) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Share tracked lookup subscription handling across resolver hooks.
|
|
81
|
+
|
|
82
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`338e5e8`](https://github.com/generaltranslation/gt/commit/338e5e8a42354c7d288d9be960ebd1d58adfd402) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Remove the unused dictionary-injection helpers from `@generaltranslation/react-core/pure`.
|
|
83
|
+
|
|
84
|
+
`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.
|
|
85
|
+
|
|
86
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`8834c51`](https://github.com/generaltranslation/gt/commit/8834c518ac84259706f2b603fd024ad13a9072ee) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - 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.
|
|
87
|
+
|
|
88
|
+
- [#1439](https://github.com/generaltranslation/gt/pull/1439) [`195f009`](https://github.com/generaltranslation/gt/commit/195f00910c2a675a6f9da327e19e3d3c5e44e26b) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - fix: make singleton not-initialized errors consistent and descriptive, and stop error paths from masking the original failure when I18nConfig is also uninitialized
|
|
89
|
+
|
|
90
|
+
- Updated dependencies [[`463a8db`](https://github.com/generaltranslation/gt/commit/463a8dbb03bde35f2f229dfdabfe117197d4527b), [`8870496`](https://github.com/generaltranslation/gt/commit/88704963eb74e81401994681ce7cdae3ba91b6c0), [`b72c30b`](https://github.com/generaltranslation/gt/commit/b72c30bc603562310a51b656fb003f1486315a8a), [`72e9e16`](https://github.com/generaltranslation/gt/commit/72e9e1643797be8e4ae1453897fd0b023fce2674), [`42a440f`](https://github.com/generaltranslation/gt/commit/42a440ff3420bdbdb35ed24f9a5af1c9040eaf66), [`fd22c68`](https://github.com/generaltranslation/gt/commit/fd22c68978af50ce519dc06c7b887d3fa67181ae), [`bea8233`](https://github.com/generaltranslation/gt/commit/bea8233d8b055980483cb2e226157f6adcbd8c2b), [`8870496`](https://github.com/generaltranslation/gt/commit/88704963eb74e81401994681ce7cdae3ba91b6c0), [`04b5064`](https://github.com/generaltranslation/gt/commit/04b50645675abb9e927a82056b249b50f0907fcc), [`5adeede`](https://github.com/generaltranslation/gt/commit/5adeede157922d547a33a078d0f527f572c9a8b4), [`328795b`](https://github.com/generaltranslation/gt/commit/328795bf730296658a57b7132bbd1e0bbff2fd62), [`1f53e42`](https://github.com/generaltranslation/gt/commit/1f53e420e9a6475f85cf27e1cd0c9c89f4beeb36), [`b3bb391`](https://github.com/generaltranslation/gt/commit/b3bb391d33041680e2d62b6a7c9b05662946544f), [`d48604e`](https://github.com/generaltranslation/gt/commit/d48604e2171aa84c76873cacb6eb8d43c2f17546), [`88f3a2e`](https://github.com/generaltranslation/gt/commit/88f3a2e0f304fdd19891afac0b41954edc9497c6), [`e12fb17`](https://github.com/generaltranslation/gt/commit/e12fb17d41cfa5fa231e64fe70423434739ea985), [`5752fe8`](https://github.com/generaltranslation/gt/commit/5752fe81bf5b5deaae878638e0de99959bf719be), [`3d95277`](https://github.com/generaltranslation/gt/commit/3d95277a057b28fffc73b3fa616210bdcb447e85), [`97dc7f4`](https://github.com/generaltranslation/gt/commit/97dc7f4818476a319a54b1519e994a62d5a9a3a5), [`c1e0a0f`](https://github.com/generaltranslation/gt/commit/c1e0a0f837da440eeed84af10b553dee24bfc936), [`693288d`](https://github.com/generaltranslation/gt/commit/693288d632c42b923920a2fdd9ae2babc1bc28f5), [`8a2f7ee`](https://github.com/generaltranslation/gt/commit/8a2f7ee79f4b890fb1aaf47f42bb844334899793), [`c5364f9`](https://github.com/generaltranslation/gt/commit/c5364f977ffb4b387ad39206e6ed626bbeec56f3), [`2e85ebd`](https://github.com/generaltranslation/gt/commit/2e85ebd1528a4f99a8e36e1d8d6714a639040596), [`d5cf2d3`](https://github.com/generaltranslation/gt/commit/d5cf2d34f412ad49e8b2818fe788b870a5964d65), [`4986567`](https://github.com/generaltranslation/gt/commit/498656728741898a56ae348a536107bd92f95c04), [`795edc8`](https://github.com/generaltranslation/gt/commit/795edc8a2b3e91fc9801d726f4b5cd6fbbc98fb0), [`d863bcf`](https://github.com/generaltranslation/gt/commit/d863bcf05770c336c98b2b2fae8534c90f00df51), [`11ecf87`](https://github.com/generaltranslation/gt/commit/11ecf876a1221b9dbce9fc0c0f0804101558c8a7), [`03bae6d`](https://github.com/generaltranslation/gt/commit/03bae6d3b4791107781cb800c1ae7ac4f675705c), [`5d42608`](https://github.com/generaltranslation/gt/commit/5d426089f04f37dd7369620e9db3e6512f06eee8), [`9804aa4`](https://github.com/generaltranslation/gt/commit/9804aa460c07ec36d2e667d79a839720a1e011e8), [`2ca78ec`](https://github.com/generaltranslation/gt/commit/2ca78ec4805639c10c7b200c8dee660b55eddf15), [`195f009`](https://github.com/generaltranslation/gt/commit/195f00910c2a675a6f9da327e19e3d3c5e44e26b)]:
|
|
91
|
+
- gt-i18n@1.0.0
|
|
92
|
+
- generaltranslation@9.0.0
|
|
93
|
+
- @generaltranslation/format@0.1.2
|
|
94
|
+
- @generaltranslation/supported-locales@2.1.2
|
|
95
|
+
|
|
96
|
+
## 11.0.0-odysseus.16
|
|
97
|
+
|
|
98
|
+
### Major Changes
|
|
99
|
+
|
|
100
|
+
- 463a8db: Add a config-aware `resolveCanonicalLocale` helper and remove the public `getGTClass` helper.
|
|
101
|
+
- 463a8db: Remove the deprecated `useGTClass` hook from public entry points.
|
|
102
|
+
- 40db0c5: Remove `useVersionId` from public package entrypoints.
|
|
103
|
+
|
|
104
|
+
The `getVersionId` helper remains available from public function entrypoints and `gt-i18n/internal`.
|
|
105
|
+
|
|
106
|
+
### Patch Changes
|
|
107
|
+
|
|
108
|
+
- bea8233: Statically gate dev hot-reload code paths (tracked resolver invalidation, missing-translation queue, T hot-reload fallbacks, getGT dev preload) behind `process.env.NODE_ENV !== 'production'` so bundlers can drop them from production builds. Behavior is unchanged: the existing runtime `isDevHotReloadEnabled()` check still applies in development.
|
|
109
|
+
- 5736d58: Use production no-op stubs for dev hot-reload hooks so bundlers can drop more dev-only hot-reload code.
|
|
110
|
+
- 1f53e42: Clean up the `gt-i18n` public API surface by removing dead subpaths, internal exports, and unused types.
|
|
111
|
+
- e343775: Remove the accidental `useShouldTranslate` export from `@generaltranslation/react-core/hooks`. The hook is an internal implementation detail and was never meant to be public.
|
|
112
|
+
- Updated dependencies [463a8db]
|
|
113
|
+
- Updated dependencies [b72c30b]
|
|
114
|
+
- Updated dependencies [bea8233]
|
|
115
|
+
- Updated dependencies [1f53e42]
|
|
116
|
+
- Updated dependencies [d5cf2d3]
|
|
117
|
+
- gt-i18n@1.0.0-odysseus.9
|
|
118
|
+
- generaltranslation@9.0.0-odysseus.6
|
|
119
|
+
- @generaltranslation/supported-locales@2.1.2-odysseus.6
|
|
120
|
+
|
|
121
|
+
## 11.0.0-odysseus.15
|
|
122
|
+
|
|
123
|
+
### Patch Changes
|
|
124
|
+
|
|
125
|
+
- 04f419d: Fix source interpolation for default-locale string helpers.
|
|
126
|
+
Clarify that `tx()` does not apply ICU formatting by default.
|
|
127
|
+
- 72e9e16: Split the runtime surface of the GT class (locale management, formatting, runtime translation) into a GTRuntime base class exported from the new `generaltranslation/runtime` entry point. The SDK runtime (gt-i18n's I18nConfig, gt-next middleware) now constructs GTRuntime, so production browser bundles no longer ship the project/file management API client (enqueueFiles, uploads, downloads, etc.). The GT class extends GTRuntime and keeps its full API for the CLI and other tooling. Also import getLocaleProperties from @generaltranslation/format directly in react-core so client bundles don't reach the full core entry.
|
|
128
|
+
- 195f009: fix: make singleton not-initialized errors consistent and descriptive, and stop error paths from masking the original failure when I18nConfig is also uninitialized
|
|
129
|
+
- Updated dependencies [72e9e16]
|
|
130
|
+
- Updated dependencies [42a440f]
|
|
131
|
+
- Updated dependencies [5adeede]
|
|
132
|
+
- Updated dependencies [c5364f9]
|
|
133
|
+
- Updated dependencies [2e85ebd]
|
|
134
|
+
- Updated dependencies [195f009]
|
|
135
|
+
- generaltranslation@9.0.0-odysseus.5
|
|
136
|
+
- gt-i18n@1.0.0-odysseus.8
|
|
137
|
+
- @generaltranslation/supported-locales@2.1.2-odysseus.5
|
|
138
|
+
|
|
139
|
+
## 11.0.0-odysseus.14
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- 0cd7813: Store cookie names in I18nConfig so custom cookie names work before the condition store is initialized.
|
|
144
|
+
- `gt-i18n`: Removed the unused React locale cookie name from the shared GT config type.
|
|
145
|
+
- `@generaltranslation/react-core`: `ReactI18nConfig` now accepts `localeCookieName`, `regionCookieName`, and `enableI18nCookieName`, exposes getters that fall back to the default names, and exports the default storage names from the `pure` entrypoint.
|
|
146
|
+
- `gt-next`: Imports default cookie names from the React Core `pure` entrypoint instead of the removed React Core cookie constants subpath.
|
|
147
|
+
- `gt-react`: The browser condition store now resolves cookie names from `I18nConfig` instead of hardcoding the defaults, so custom cookie names passed to `initializeGT()` are honored for both reads and writes.
|
|
148
|
+
- `gt-react-native`: Native condition storage now resolves its store keys from `I18nConfig`, matching `gt-react` behavior.
|
|
149
|
+
- `gt-tanstack-start`: `parseLocale()` reads and writes the locale cookie using the configured cookie name instead of the default.
|
|
150
|
+
|
|
151
|
+
- Updated dependencies [ab61565]
|
|
152
|
+
- Updated dependencies [0cd7813]
|
|
153
|
+
- gt-i18n@1.0.0-odysseus.7
|
|
154
|
+
|
|
155
|
+
## 11.0.0-odysseus.13
|
|
156
|
+
|
|
157
|
+
### Patch Changes
|
|
158
|
+
|
|
159
|
+
- Updated dependencies [a2b9677]
|
|
160
|
+
- Updated dependencies [41371e0]
|
|
161
|
+
- gt-i18n@1.0.0-odysseus.6
|
|
162
|
+
|
|
163
|
+
## 11.0.0-odysseus.12
|
|
164
|
+
|
|
165
|
+
### Patch Changes
|
|
166
|
+
|
|
167
|
+
- 7be23bc: Share tracked lookup subscription handling across resolver hooks.
|
|
168
|
+
|
|
169
|
+
## 11.0.0-odysseus.11
|
|
170
|
+
|
|
171
|
+
## 11.0.0-odysseus.10
|
|
172
|
+
|
|
173
|
+
### Patch Changes
|
|
174
|
+
|
|
175
|
+
- bcba6fd: Fix `useVersionId()` throwing and `useLocaleDirection()` requiring a locale argument in the client and server entrypoints.
|
|
176
|
+
|
|
177
|
+
`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.
|
|
178
|
+
|
|
179
|
+
- b7b3eaf: Share render pipeline child renderers with prepared translation rendering.
|
|
180
|
+
- dfb5fc9: Add portable selector hook return types for React Native declarations.
|
|
181
|
+
- 4a5f8e8: Remove unused internal exports and dead utility code.
|
|
182
|
+
- 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.
|
|
183
|
+
- Updated dependencies [432fa49]
|
|
184
|
+
- Updated dependencies [432fa49]
|
|
185
|
+
- Updated dependencies [933916e]
|
|
186
|
+
- Updated dependencies [4a5f8e8]
|
|
187
|
+
- Updated dependencies [083d306]
|
|
188
|
+
- gt-i18n@1.0.0-odysseus.5
|
|
189
|
+
|
|
190
|
+
## 11.0.0-odysseus.9
|
|
191
|
+
|
|
192
|
+
## 11.0.0-odysseus.8
|
|
193
|
+
|
|
194
|
+
### Patch Changes
|
|
195
|
+
|
|
196
|
+
- 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.
|
|
197
|
+
- Updated dependencies [26faa87]
|
|
198
|
+
- Updated dependencies [270b821]
|
|
199
|
+
- Updated dependencies [bffaa67]
|
|
200
|
+
- Updated dependencies [d602065]
|
|
201
|
+
- generaltranslation@9.0.0-odysseus.4
|
|
202
|
+
- gt-i18n@1.0.0-odysseus.4
|
|
203
|
+
- @generaltranslation/supported-locales@2.1.2-odysseus.4
|
|
204
|
+
|
|
205
|
+
## 11.0.0-odysseus.7
|
|
206
|
+
|
|
207
|
+
### Patch Changes
|
|
208
|
+
|
|
209
|
+
- 07bfb00: Remove the unused dictionary-injection helpers from `@generaltranslation/react-core/pure`.
|
|
210
|
+
|
|
211
|
+
`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.
|
|
212
|
+
|
|
213
|
+
- Updated dependencies [b1eef00]
|
|
214
|
+
- Updated dependencies [b765174]
|
|
215
|
+
- generaltranslation@9.0.0-odysseus.3
|
|
216
|
+
- gt-i18n@1.0.0-odysseus.3
|
|
217
|
+
- @generaltranslation/supported-locales@2.1.2-odysseus.3
|
|
218
|
+
|
|
219
|
+
## 11.0.0-odysseus.6
|
|
220
|
+
|
|
221
|
+
### Patch Changes
|
|
222
|
+
|
|
223
|
+
- c1aa794: Trigger a new Odysseus prerelease after updating the release workflow.
|
|
224
|
+
- e0ace5b: Build `@generaltranslation/react-core` as unbundled, tree-shakeable modules.
|
|
225
|
+
|
|
226
|
+
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.
|
|
227
|
+
|
|
228
|
+
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.
|
|
229
|
+
|
|
230
|
+
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.
|
|
231
|
+
|
|
232
|
+
## 11.0.0-odysseus.5
|
|
233
|
+
|
|
234
|
+
### Major Changes
|
|
235
|
+
|
|
236
|
+
- [#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.
|
|
237
|
+
|
|
238
|
+
### Patch Changes
|
|
239
|
+
|
|
240
|
+
- [#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.
|
|
241
|
+
|
|
242
|
+
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`.
|
|
243
|
+
|
|
244
|
+
- 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)]:
|
|
245
|
+
- @generaltranslation/format@0.1.2-odysseus.1
|
|
246
|
+
- generaltranslation@9.0.0-odysseus.2
|
|
247
|
+
- gt-i18n@1.0.0-odysseus.2
|
|
248
|
+
- @generaltranslation/supported-locales@2.1.2-odysseus.2
|
|
249
|
+
|
|
3
250
|
## 11.0.0-odysseus.4
|
|
4
251
|
|
|
5
252
|
### Patch Changes
|
|
@@ -73,6 +320,60 @@
|
|
|
73
320
|
|
|
74
321
|
### Patch Changes
|
|
75
322
|
|
|
323
|
+
- Updated dependencies [[`cc4edc1`](https://github.com/generaltranslation/gt/commit/cc4edc1e40d9977125bf6d053fb7f8cdbdd40b05)]:
|
|
324
|
+
- @generaltranslation/supported-locales@2.1.0
|
|
325
|
+
- gt-i18n@0.9.4
|
|
326
|
+
|
|
327
|
+
## 1.8.25
|
|
328
|
+
|
|
329
|
+
### Patch Changes
|
|
330
|
+
|
|
331
|
+
- [#1786](https://github.com/generaltranslation/gt/pull/1786) [`6945a98`](https://github.com/generaltranslation/gt/commit/6945a9871ea260dd999dcb2246c48b21134721f6) Thanks [@fernando-aviles](https://github.com/fernando-aviles)! - Add `requiresReview`
|
|
332
|
+
|
|
333
|
+
- Updated dependencies [[`6945a98`](https://github.com/generaltranslation/gt/commit/6945a9871ea260dd999dcb2246c48b21134721f6)]:
|
|
334
|
+
- generaltranslation@8.2.19
|
|
335
|
+
- gt-i18n@0.9.9
|
|
336
|
+
- @generaltranslation/supported-locales@2.1.5
|
|
337
|
+
|
|
338
|
+
## 1.8.24
|
|
339
|
+
|
|
340
|
+
### Patch Changes
|
|
341
|
+
|
|
342
|
+
- Updated dependencies [[`a2a3dd0`](https://github.com/generaltranslation/gt/commit/a2a3dd0bcdce9abe360c406a12fc6bb3bc3ca181)]:
|
|
343
|
+
- @generaltranslation/supported-locales@2.1.4
|
|
344
|
+
- gt-i18n@0.9.8
|
|
345
|
+
|
|
346
|
+
## 1.8.23
|
|
347
|
+
|
|
348
|
+
### Patch Changes
|
|
349
|
+
|
|
350
|
+
- Updated dependencies [[`9709a2f`](https://github.com/generaltranslation/gt/commit/9709a2f2b97b9d8239298e39bb31e57692bbffd8)]:
|
|
351
|
+
- generaltranslation@8.2.18
|
|
352
|
+
- gt-i18n@0.9.7
|
|
353
|
+
- @generaltranslation/supported-locales@2.1.3
|
|
354
|
+
|
|
355
|
+
## 1.8.22
|
|
356
|
+
|
|
357
|
+
### Patch Changes
|
|
358
|
+
|
|
359
|
+
- Updated dependencies [[`3197028`](https://github.com/generaltranslation/gt/commit/319702855a7b129f95217d41be9f2402680a2f01)]:
|
|
360
|
+
- generaltranslation@8.2.17
|
|
361
|
+
- gt-i18n@0.9.6
|
|
362
|
+
- @generaltranslation/supported-locales@2.1.2
|
|
363
|
+
|
|
364
|
+
## 1.8.21
|
|
365
|
+
|
|
366
|
+
### Patch Changes
|
|
367
|
+
|
|
368
|
+
- Updated dependencies [[`e041312`](https://github.com/generaltranslation/gt/commit/e04131263dd61e469db977bcc196dc1283e773d0)]:
|
|
369
|
+
- generaltranslation@8.2.16
|
|
370
|
+
- gt-i18n@0.9.5
|
|
371
|
+
- @generaltranslation/supported-locales@2.1.1
|
|
372
|
+
|
|
373
|
+
## 1.8.20
|
|
374
|
+
|
|
375
|
+
### Patch Changes
|
|
376
|
+
|
|
76
377
|
- Updated dependencies [[`cc4edc1`](https://github.com/generaltranslation/gt/commit/cc4edc1e40d9977125bf6d053fb7f8cdbdd40b05)]:
|
|
77
378
|
- @generaltranslation/supported-locales@2.1.0
|
|
78
379
|
- gt-i18n@0.9.4
|
|
@@ -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(`../../hooks/utils/getFormatLocales.cjs`),t=require(`../../utils/plurals/getPluralBranch.cjs`);function n({_enableI18n:n,_locale:r,children:i,n:a,locales:o=[],...s}){let c=e.getFormatLocales({locale:r,enableI18n:n,localesProp:o});return typeof a==`number`?t.getPluralBranch(a,c,s)??i: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 const resolvedBranch = getPluralBranch(n, locales, branches);\n return resolvedBranch != null ? resolvedBranch : 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,CAKF,OAJI,OAAO,GAAM,SAGMC,EAAAA,gBAAgB,EAAG,EAAS,EAC5C,EAA0C,EAHxC"}
|
|
@@ -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{getFormatLocales as e}from"../../hooks/utils/getFormatLocales.mjs";import{getPluralBranch as t}from"../../utils/plurals/getPluralBranch.mjs";function n({_enableI18n:n,_locale:r,children:i,n:a,locales:o=[],...s}){let c=e({locale:r,enableI18n:n,localesProp:o});return typeof a==`number`?t(a,c,s)??i: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 const resolvedBranch = getPluralBranch(n, locales, branches);\n return resolvedBranch != null ? resolvedBranch : 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,CAKF,OAJI,OAAO,GAAM,SAGM,EAAgB,EAAG,EAAS,EAC5C,EAA0C,EAHxC"}
|
|
@@ -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/jsx-runtime`),n=require(`react`);n=e.__toESM(n);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:n,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!n||n.length===0||!s?null:(0,t.jsxs)(`select`,{name:`generaltranslation-locale`,"aria-label":`General Translation locale selector`,...l,value:e||``,onChange:e=>s(e.target.value),children:[!e&&(0,t.jsx)(`option`,{value:``}),n.map(e=>(0,t.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":"6HASA,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"}
|