@capillarytech/blaze-ui 5.11.6 → 5.11.7
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/CapErrorBoundary/index.js +75 -40
- package/CapErrorBoundary/index.js.map +1 -1
- package/CapLanguageProvider/CapLanguageProvider-use-cases.md +56 -0
- package/CapLanguageProvider/README.md +206 -0
- package/CapLanguageProvider/index.d.ts +4 -59
- package/CapLanguageProvider/index.d.ts.map +1 -1
- package/CapLanguageProvider/index.js +53 -46
- package/CapLanguageProvider/index.js.map +1 -1
- package/CapLanguageProvider/reducer.d.ts +3 -11
- package/CapLanguageProvider/reducer.d.ts.map +1 -1
- package/CapLanguageProvider/types.d.ts +120 -0
- package/CapLanguageProvider/types.d.ts.map +1 -0
- package/CapNavigation/index.js +2 -6
- package/CapNavigation/index.js.map +1 -1
- package/CapUserProfile/index.js +2 -6
- package/CapUserProfile/index.js.map +1 -1
- package/index.d.ts +1 -2
- package/index.d.ts.map +1 -1
- package/index.js +55 -235
- package/index.js.map +1 -1
- package/package.json +1 -2
- package/CapErrorBoundary/CapErrorBoundary-use-cases.md +0 -89
- package/CapErrorBoundary/README.md +0 -150
- package/CapErrorBoundary/index.d.ts +0 -10
- package/CapErrorBoundary/index.d.ts.map +0 -1
- package/CapErrorBoundary/types.d.ts +0 -46
- package/CapErrorBoundary/types.d.ts.map +0 -1
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
locale?: string;
|
|
5
|
-
data?: Record<string, unknown> | SupportedLocale[];
|
|
6
|
-
}
|
|
7
|
-
interface SupportedLocale {
|
|
8
|
-
locale: string;
|
|
9
|
-
locize_locale?: string;
|
|
10
|
-
}
|
|
11
|
-
declare const languageProviderReducer: (state?: import("immutable").Map<"locale" | "localeLoading" | "messages" | "fetchSupportedLocalesStatus" | "supportedLocales", string | import("immutable").List<never> | import("immutable").Map<never, never>>, action?: Action) => import("immutable").Map<"locale" | "localeLoading" | "messages" | "fetchSupportedLocalesStatus" | "supportedLocales", string | import("immutable").List<never> | import("immutable").Map<never, never>>;
|
|
1
|
+
import type { Action, ReducerState } from './types';
|
|
2
|
+
export declare const initialState: ReducerState;
|
|
3
|
+
declare const languageProviderReducer: (state?: ReducerState, action?: Action) => ReducerState;
|
|
12
4
|
export default languageProviderReducer;
|
|
13
5
|
//# sourceMappingURL=reducer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../components/CapLanguageProvider/reducer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../components/CapLanguageProvider/reducer.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,YAAY,EAAE,YAMT,CAAC;AAEnB,QAAA,MAAM,uBAAuB,GAAI,oBAAoB,EAAE,SAAQ,MAAqB,iBA8BnF,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type enUS from 'antd-v5/locale/en_US';
|
|
2
|
+
import { fromJS, Map } from 'immutable';
|
|
3
|
+
import type React from 'react';
|
|
4
|
+
export type Locale = typeof enUS;
|
|
5
|
+
/**
|
|
6
|
+
* Supported locale configuration structure
|
|
7
|
+
*/
|
|
8
|
+
export interface SupportedLocale {
|
|
9
|
+
locale: string;
|
|
10
|
+
locize_locale?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Parameters for getAllLocales function
|
|
14
|
+
*/
|
|
15
|
+
export interface GetAllLocalesParams {
|
|
16
|
+
lang?: string | null;
|
|
17
|
+
supportedLocales?: SupportedLocale[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Result from getAllLocales function
|
|
21
|
+
*/
|
|
22
|
+
export interface GetAllLocalesResult {
|
|
23
|
+
antdLocale?: string;
|
|
24
|
+
reactIntlLocale?: string;
|
|
25
|
+
locale?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* User data structure with optional iso_lang property
|
|
29
|
+
*/
|
|
30
|
+
export interface UserData {
|
|
31
|
+
iso_lang?: string;
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Language state from Redux store
|
|
36
|
+
*/
|
|
37
|
+
export interface LanguageState {
|
|
38
|
+
locale?: string;
|
|
39
|
+
localeLoading?: string;
|
|
40
|
+
messages?: Record<string, string>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Redux action creators interface
|
|
44
|
+
*/
|
|
45
|
+
export interface Actions {
|
|
46
|
+
getSupportedLocales: (params: {
|
|
47
|
+
supportedLocalesApi?: string;
|
|
48
|
+
isSkip?: boolean;
|
|
49
|
+
}) => void;
|
|
50
|
+
getLocizeMessage: (params: {
|
|
51
|
+
locale: string;
|
|
52
|
+
isSkip?: boolean;
|
|
53
|
+
locizeApi?: string;
|
|
54
|
+
}) => void;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Supported locales details from Redux store
|
|
58
|
+
*/
|
|
59
|
+
export interface SupportedLocalesDetails {
|
|
60
|
+
supportedLocales?: SupportedLocale[];
|
|
61
|
+
fetchSupportedLocalesStatus?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Props for CapLanguageProvider component
|
|
65
|
+
*/
|
|
66
|
+
export interface CapLanguageProviderProps {
|
|
67
|
+
/** User data object containing iso_lang property */
|
|
68
|
+
user?: UserData;
|
|
69
|
+
/** Redux action creators */
|
|
70
|
+
actions?: Actions;
|
|
71
|
+
/** Child component to wrap */
|
|
72
|
+
children?: React.ReactNode;
|
|
73
|
+
/** Language state from Redux */
|
|
74
|
+
language?: LanguageState;
|
|
75
|
+
/** Translation messages object */
|
|
76
|
+
messages?: Record<string, string>;
|
|
77
|
+
/** Supported locales details from Redux */
|
|
78
|
+
supportedLocalesDetails?: SupportedLocalesDetails;
|
|
79
|
+
/** CSS class name for the spinner wrapper */
|
|
80
|
+
className?: string;
|
|
81
|
+
/** Whether to show loading spinner */
|
|
82
|
+
spinnerVisible?: boolean;
|
|
83
|
+
/** API endpoint for fetching supported locales */
|
|
84
|
+
supportedLocalesApi?: string;
|
|
85
|
+
/** API endpoint for fetching Locize translations */
|
|
86
|
+
locizeApi?: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Internal component state
|
|
90
|
+
*/
|
|
91
|
+
export interface CapLanguageProviderState {
|
|
92
|
+
/** Antd locale object */
|
|
93
|
+
locale: Locale;
|
|
94
|
+
/** Whether user data has been loaded */
|
|
95
|
+
userLoaded: boolean;
|
|
96
|
+
/** Whether supported locales have been loaded */
|
|
97
|
+
supportedLocaleLoaded: boolean;
|
|
98
|
+
/** Whether locale has been loaded */
|
|
99
|
+
localeLoaded: boolean;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Action payload for getLocizeMessage saga
|
|
103
|
+
*/
|
|
104
|
+
export interface GetLocizeMessageAction {
|
|
105
|
+
locale: string;
|
|
106
|
+
locizeApi: (locale: string) => Promise<Record<string, string>>;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Action payload for fetchSupportedLocales saga
|
|
110
|
+
*/
|
|
111
|
+
export interface FetchSupportedLocalesAction {
|
|
112
|
+
supportedLocalesApi: () => Promise<SupportedLocale[] | Error | unknown>;
|
|
113
|
+
}
|
|
114
|
+
export interface Action {
|
|
115
|
+
type: string;
|
|
116
|
+
locale?: string;
|
|
117
|
+
data?: Record<string, unknown> | SupportedLocale[] | null | undefined;
|
|
118
|
+
}
|
|
119
|
+
export type ReducerState = Map<string, string | ReturnType<typeof fromJS>>;
|
|
120
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","source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AW,2BAA2B;IAC1C,mBAAmB,EAAE,MAAM,OAAO,CAAC,eAAe,EAAE,GAAG,KAAK,GAAG,OAAO,CAAC,CAAC;CACzE;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,eAAe,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;CACvE;AAED,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC"}
|
package/CapNavigation/index.js
CHANGED
|
@@ -51261,9 +51261,7 @@ const languageProviderReducer = function (state, action) {
|
|
|
51261
51261
|
case types.GET_LOCIZE_MESSAGE_REQUEST:
|
|
51262
51262
|
return state.set('localeLoading', types.REQUEST);
|
|
51263
51263
|
case types.GET_LOCIZE_MESSAGE_SUCCESS:
|
|
51264
|
-
return state.set('localeLoading', types.COMPLETE)
|
|
51265
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
51266
|
-
.set('messages', (0, _immutable.fromJS)(action.data || {})).set('locale', action.locale || types.DEFAULT_LOCALE);
|
|
51264
|
+
return state.set('localeLoading', types.COMPLETE).set('messages', (0, _immutable.fromJS)(action.data || {})).set('locale', action.locale || types.DEFAULT_LOCALE);
|
|
51267
51265
|
case types.GET_LOCIZE_MESSAGE_FAILURE:
|
|
51268
51266
|
return state.set('localeLoading', types.COMPLETE).set('messages', (0, _immutable.fromJS)({}));
|
|
51269
51267
|
case types.GET_LOCIZE_MESSAGE_SKIP:
|
|
@@ -51271,9 +51269,7 @@ const languageProviderReducer = function (state, action) {
|
|
|
51271
51269
|
case types.GET_SUPPORTED_LOCALES_REQUEST:
|
|
51272
51270
|
return state.set('fetchSupportedLocalesStatus', types.REQUEST).set('supportedLocales', (0, _immutable.fromJS)([]));
|
|
51273
51271
|
case types.GET_SUPPORTED_LOCALES_SUCCESS:
|
|
51274
|
-
return state.set('fetchSupportedLocalesStatus', types.SUCCESS)
|
|
51275
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
51276
|
-
.set('supportedLocales', (0, _immutable.fromJS)(action.data || []));
|
|
51272
|
+
return state.set('fetchSupportedLocalesStatus', types.SUCCESS).set('supportedLocales', (0, _immutable.fromJS)(action.data || []));
|
|
51277
51273
|
case types.GET_SUPPORTED_LOCALES_FAILURE:
|
|
51278
51274
|
return state.set('fetchSupportedLocalesStatus', types.FAILURE).set('supportedLocales', (0, _immutable.fromJS)([]));
|
|
51279
51275
|
default:
|