@nuskin/react-mysite-elements 1.6.0-comx-2229.2 → 1.6.0-comx-2229.3

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.
@@ -1,5 +1,19 @@
1
1
  import React from 'react';
2
2
  import { type TranslateFn, type TranslationEntry } from './TranslationKeys/translationResolver';
3
+ /**
4
+ * Re-renders the calling component whenever the active translate function changes.
5
+ * Widgets that read strings through the module-level `getTranslation` helper need this
6
+ * subscription because `React.memo` would otherwise keep their English first paint.
7
+ */
8
+ export declare function useTranslationRevision(): number;
9
+ /**
10
+ * Memoizes a widget while keeping it subscribed to translation changes.
11
+ *
12
+ * The subscription has to live inside the `React.memo` boundary: a memoized component
13
+ * bails out before its body runs when props are unchanged, so a parent-level
14
+ * subscription cannot refresh strings read through the module-level `getTranslation`.
15
+ */
16
+ export declare function memoWithTranslation<P extends object>(Component: React.ComponentType<P>): React.NamedExoticComponent<P>;
3
17
  export declare function useTranslationResolver(translate?: TranslateFn): void;
4
18
  export interface TranslationProviderProps {
5
19
  readonly translate?: TranslateFn;
@@ -385,6 +385,10 @@ export declare const ShoppingDashboardTranslationKeys: {
385
385
  readonly key: "shoppingDashboard.fullView.conversionRate.notAvailable";
386
386
  readonly fallback: "N/A";
387
387
  };
388
+ readonly noOrders: {
389
+ readonly key: "shoppingDashboard.fullView.conversionRate.noOrders";
390
+ readonly fallback: "No order details available for the selected filters";
391
+ };
388
392
  };
389
393
  readonly products: {
390
394
  readonly columns: {
@@ -3,6 +3,23 @@ export type TranslationEntry = {
3
3
  readonly fallback: string;
4
4
  };
5
5
  export type TranslateFn = (key: string, fallback: string) => string;
6
+ type ResolverListener = () => void;
6
7
  export declare function setTranslationResolver(resolver: TranslateFn | undefined): void;
8
+ /**
9
+ * Render-safe assignment. Updates the resolver without notifying subscribers so that
10
+ * descendants rendering in the same pass translate immediately instead of painting the
11
+ * English fallback. Subscribers are notified afterwards from an effect.
12
+ */
13
+ export declare function primeTranslationResolver(resolver: TranslateFn | undefined): void;
14
+ export declare function subscribeToTranslationResolver(listener: ResolverListener): () => void;
15
+ export declare function getTranslationRevision(): number;
16
+ /**
17
+ * Forces every subscriber to re-render. Use this when the translate function keeps the
18
+ * same identity but its underlying strings changed, e.g. after a locale switch reloads
19
+ * the translation resources in place.
20
+ */
21
+ export declare function notifyTranslationChange(): void;
7
22
  export declare function getTranslationResolver(): TranslateFn | undefined;
23
+ export declare function resolveTranslationWith(translate: TranslateFn | undefined, entry: TranslationEntry): string;
8
24
  export declare function resolveTranslation(entry: TranslationEntry): string;
25
+ export {};
@@ -21,9 +21,9 @@ export { SignupsFullView } from './shared/Signups/SignupsFullView';
21
21
  export { CategoriesFullView } from './shared/TopCategories/CategoriesFullView';
22
22
  export { ShoppingDashboardTranslationKeys, getTranslation } from './TranslationKeys/ShoppingDashboardTranslationKeys';
23
23
  export { ProductOfferDashboardTranslationKeys } from './TranslationKeys/ProductOfferDashboardTranslationKeys';
24
- export { setTranslationResolver, getTranslationResolver, resolveTranslation, } from './TranslationKeys/translationResolver';
24
+ export { setTranslationResolver, getTranslationResolver, getTranslationRevision, notifyTranslationChange, primeTranslationResolver, subscribeToTranslationResolver, resolveTranslation, resolveTranslationWith, } from './TranslationKeys/translationResolver';
25
25
  export type { TranslateFn } from './TranslationKeys/translationResolver';
26
- export { TranslationProvider, useTranslation, useTranslationResolver } from './TranslationContext';
26
+ export { memoWithTranslation, TranslationProvider, useTranslation, useTranslationResolver, useTranslationRevision, } from './TranslationContext';
27
27
  export type { TranslationProviderProps } from './TranslationContext';
28
28
  export type { DashboardStats, TopProduct, ConversionDataPoint, SignupDataPoint, CategoryRevenue, DateRangeOption, MarketOption, MarketFilterOption, CustomerType, OrderStatus, SignupType, SignupStatus, ProductSortOption, SignupViewOption, ConversionFilterOption, CategorySortOption, FullViewWidgetType, StatsCardProps, DashboardHeaderProps, TopSellingProductsListProps, ConversionRateChartProps, SignupsChartProps, TopCategoriesPieChartProps, WidgetMenuProps, ShoppingDashboardProps, OrderHistory, SignupDetail, ProductsFullViewProps, ConversionRateFullViewProps, SignupsFullViewProps, CategoriesFullViewProps, TrendIndicator, DateRangeInfo, MarketInfo, TranslationKey, } from './types.d';
29
29
  export type { MysiteDashboardView, MysiteDashboardHistoryLocation, MysiteDashboardHistoryAdapter, MysiteDashboardWithNavigationProps, } from './MysiteDashboardWithNavigation';