@gooddata/sdk-ui-pluggable-application 11.29.0-alpha.3 → 11.29.0-alpha.5
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/esm/AppProviders.d.ts +63 -0
- package/esm/AppProviders.d.ts.map +1 -0
- package/esm/AppProviders.js +52 -0
- package/esm/AppProviders.js.map +1 -0
- package/esm/context.d.ts +5 -5
- package/esm/context.js +3 -3
- package/esm/index.d.ts +1 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/esm/sdk-ui-pluggable-application.d.ts +67 -5
- package/package.json +11 -7
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type PropsWithChildren } from "react";
|
|
2
|
+
import { type ILocale } from "@gooddata/sdk-model";
|
|
3
|
+
import { type IPlatformContext } from "@gooddata/sdk-pluggable-application-model";
|
|
4
|
+
import { type ITranslations } from "@gooddata/sdk-ui";
|
|
5
|
+
/**
|
|
6
|
+
* Props for {@link AppProviders}.
|
|
7
|
+
*
|
|
8
|
+
* @alpha
|
|
9
|
+
*/
|
|
10
|
+
export interface IAppProvidersProps {
|
|
11
|
+
/**
|
|
12
|
+
* Platform context snapshot provided by the host (from mount options).
|
|
13
|
+
*/
|
|
14
|
+
ctx: IPlatformContext;
|
|
15
|
+
/**
|
|
16
|
+
* Package name reported to the backend for telemetry.
|
|
17
|
+
*/
|
|
18
|
+
packageName: string;
|
|
19
|
+
/**
|
|
20
|
+
* Asynchronous translation message resolver — typically the memoized
|
|
21
|
+
* `resolveMessages` function exported from the module's `translations.ts`.
|
|
22
|
+
*/
|
|
23
|
+
resolveMessages: (locale: string) => Promise<ITranslations>;
|
|
24
|
+
/**
|
|
25
|
+
* Eagerly-loaded default messages keyed by locale.
|
|
26
|
+
* Typically `{ "en-US": { ...sdkDefaults, ...appDefaults } }`.
|
|
27
|
+
*/
|
|
28
|
+
defaultMessages: Record<string, ITranslations>;
|
|
29
|
+
/**
|
|
30
|
+
* Default language/locale used when `ctx.preferredLocale` is not set.
|
|
31
|
+
*
|
|
32
|
+
* @defaultValue `"en-US"`
|
|
33
|
+
*/
|
|
34
|
+
defaultLanguage?: ILocale;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Standard provider stack for pluggable application modules.
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* Wraps children with, in order:
|
|
41
|
+
*
|
|
42
|
+
* 1. **PlatformContextProvider** — exposes `IClientPlatformContext` (ctx + backend)
|
|
43
|
+
* 2. **BackendProvider** — makes backend available to SDK UI components (`useBackendStrict`)
|
|
44
|
+
* 3. **WorkspaceProvider** — conditionally mounted when a workspace ID is available
|
|
45
|
+
* 4. **ThemeProvider** — applies theme CSS variables from `ctx.theme`
|
|
46
|
+
* 5. **IntlProvider** — localization with async-loaded translation bundles
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <AppProviders
|
|
51
|
+
* ctx={ctx}
|
|
52
|
+
* packageName="gdc-my-app-module"
|
|
53
|
+
* resolveMessages={resolveMessages}
|
|
54
|
+
* defaultMessages={DEFAULT_MESSAGES}
|
|
55
|
+
* >
|
|
56
|
+
* <App />
|
|
57
|
+
* </AppProviders>
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @alpha
|
|
61
|
+
*/
|
|
62
|
+
export declare function AppProviders({ ctx, packageName, resolveMessages: resolveMessagesFn, defaultMessages, defaultLanguage, children }: PropsWithChildren<IAppProvidersProps>): import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
//# sourceMappingURL=AppProviders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppProviders.d.ts","sourceRoot":"","sources":["../src/AppProviders.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAIxD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAEH,KAAK,aAAa,EAIrB,MAAM,kBAAkB,CAAC;AAM1B;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,GAAG,EAAE,gBAAgB,CAAC;IAEtB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IAE5D;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAE/C;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,YAAY,CAAC,EACzB,GAAG,EACH,WAAW,EACX,eAAe,EAAE,iBAAiB,EAClC,eAAe,EACf,eAAyB,EACzB,QAAQ,EACX,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,2CAuBvC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2026 GoodData Corporation
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { IntlProvider } from "react-intl";
|
|
5
|
+
import { BackendProvider, WorkspaceProvider, resolveLocale, useResolveMessages, } from "@gooddata/sdk-ui";
|
|
6
|
+
import { ThemeProvider } from "@gooddata/sdk-ui-theme-provider";
|
|
7
|
+
import { createBackendForModule } from "./backend.js";
|
|
8
|
+
import { PlatformContextProvider } from "./context.js";
|
|
9
|
+
/**
|
|
10
|
+
* Standard provider stack for pluggable application modules.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* Wraps children with, in order:
|
|
14
|
+
*
|
|
15
|
+
* 1. **PlatformContextProvider** — exposes `IClientPlatformContext` (ctx + backend)
|
|
16
|
+
* 2. **BackendProvider** — makes backend available to SDK UI components (`useBackendStrict`)
|
|
17
|
+
* 3. **WorkspaceProvider** — conditionally mounted when a workspace ID is available
|
|
18
|
+
* 4. **ThemeProvider** — applies theme CSS variables from `ctx.theme`
|
|
19
|
+
* 5. **IntlProvider** — localization with async-loaded translation bundles
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <AppProviders
|
|
24
|
+
* ctx={ctx}
|
|
25
|
+
* packageName="gdc-my-app-module"
|
|
26
|
+
* resolveMessages={resolveMessages}
|
|
27
|
+
* defaultMessages={DEFAULT_MESSAGES}
|
|
28
|
+
* >
|
|
29
|
+
* <App />
|
|
30
|
+
* </AppProviders>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @alpha
|
|
34
|
+
*/
|
|
35
|
+
export function AppProviders({ ctx, packageName, resolveMessages: resolveMessagesFn, defaultMessages, defaultLanguage = "en-US", children, }) {
|
|
36
|
+
const backend = useMemo(() => createBackendForModule(ctx.auth, { packageName }), [ctx.auth, packageName]);
|
|
37
|
+
const clientCtx = useMemo(() => ({ ...ctx, backend }), [ctx, backend]);
|
|
38
|
+
const locale = resolveLocale(ctx.preferredLocale ?? defaultLanguage);
|
|
39
|
+
const messages = useResolveMessages(locale, resolveMessagesFn, defaultMessages);
|
|
40
|
+
return (_jsx(PlatformContextProvider, { value: clientCtx, children: _jsx(BackendProvider, { backend: backend, children: _jsx(WorkspaceProviderIfAvailable, { workspaceId: ctx.currentWorkspaceId, children: _jsx(ThemeProvider, { theme: ctx.theme, children: messages[locale] ? (_jsx(IntlProvider, { locale: locale, messages: messages[locale], children: children })) : null }) }) }) }));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Only mounts WorkspaceProvider when a workspace ID is available (organization-scope apps
|
|
44
|
+
* may not have one). This prevents WorkspaceProvider from receiving an undefined value.
|
|
45
|
+
*/
|
|
46
|
+
function WorkspaceProviderIfAvailable({ workspaceId, children, }) {
|
|
47
|
+
if (!workspaceId) {
|
|
48
|
+
return _jsx(_Fragment, { children: children });
|
|
49
|
+
}
|
|
50
|
+
return _jsx(WorkspaceProvider, { workspace: workspaceId, children: children });
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=AppProviders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppProviders.js","sourceRoot":"","sources":["../src/AppProviders.tsx"],"names":[],"mappings":";AAAA,gCAAgC;AAEhC,OAAO,EAA0B,OAAO,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI1C,OAAO,EACH,eAAe,EAEf,iBAAiB,EACjB,aAAa,EACb,kBAAkB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAA+B,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAsCpF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,YAAY,CAAC,EACzB,GAAG,EACH,WAAW,EACX,eAAe,EAAE,iBAAiB,EAClC,eAAe,EACf,eAAe,GAAG,OAAO,EACzB,QAAQ,GAC4B,EAAE;IACtC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;IAE1G,MAAM,SAAS,GAA2B,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IAE/F,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,eAAe,IAAI,eAAe,CAAC,CAAC;IACrE,MAAM,QAAQ,GAAG,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,EAAE,eAAe,CAAC,CAAC;IAEhF,OAAO,CACH,KAAC,uBAAuB,IAAC,KAAK,EAAE,SAAS,YACrC,KAAC,eAAe,IAAC,OAAO,EAAE,OAAO,YAC7B,KAAC,4BAA4B,IAAC,WAAW,EAAE,GAAG,CAAC,kBAAkB,YAC7D,KAAC,aAAa,IAAC,KAAK,EAAE,GAAG,CAAC,KAAK,YAC1B,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAChB,KAAC,YAAY,IAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,YACnD,QAAQ,GACE,CAClB,CAAC,CAAC,CAAC,IAAI,GACI,GACW,GACjB,GACI,CAC7B,CAAC;AAAA,CACL;AAED;;;GAGG;AACH,SAAS,4BAA4B,CAAC,EAClC,WAAW,EACX,QAAQ,GAC6C,EAAE;IACvD,IAAI,CAAC,WAAW,EAAE,CAAC;QACf,OAAO,4BAAG,QAAQ,GAAI,CAAC;IAC3B,CAAC;IACD,OAAO,KAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,YAAG,QAAQ,GAAqB,CAAC;AAAA,CACpF"}
|
package/esm/context.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { type IPlatformContext } from "@gooddata/sdk-pluggable-application-model
|
|
|
14
14
|
* backend-specific escape hatches (e.g., tiger-specific functions)
|
|
15
15
|
* automatically.
|
|
16
16
|
*
|
|
17
|
-
* @
|
|
17
|
+
* @alpha
|
|
18
18
|
*/
|
|
19
19
|
export interface IClientPlatformContext extends IPlatformContext {
|
|
20
20
|
/**
|
|
@@ -26,7 +26,7 @@ export interface IClientPlatformContext extends IPlatformContext {
|
|
|
26
26
|
/**
|
|
27
27
|
* Props for {@link PlatformContextProvider}.
|
|
28
28
|
*
|
|
29
|
-
* @
|
|
29
|
+
* @alpha
|
|
30
30
|
*/
|
|
31
31
|
export interface IPlatformContextProviderProps extends PropsWithChildren {
|
|
32
32
|
/**
|
|
@@ -37,19 +37,19 @@ export interface IPlatformContextProviderProps extends PropsWithChildren {
|
|
|
37
37
|
/**
|
|
38
38
|
* React provider that binds platform context into React context.
|
|
39
39
|
*
|
|
40
|
-
* @
|
|
40
|
+
* @alpha
|
|
41
41
|
*/
|
|
42
42
|
export declare function PlatformContextProvider({ value, children }: IPlatformContextProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
43
43
|
/**
|
|
44
44
|
* Returns client platform context snapshot (or undefined if not available yet).
|
|
45
45
|
*
|
|
46
|
-
* @
|
|
46
|
+
* @alpha
|
|
47
47
|
*/
|
|
48
48
|
export declare function usePlatformContext(): IClientPlatformContext | undefined;
|
|
49
49
|
/**
|
|
50
50
|
* Returns client platform context snapshot and throws if it's not available.
|
|
51
51
|
*
|
|
52
|
-
* @
|
|
52
|
+
* @alpha
|
|
53
53
|
*/
|
|
54
54
|
export declare function usePlatformContextStrict(context?: string): IClientPlatformContext;
|
|
55
55
|
//# sourceMappingURL=context.d.ts.map
|
package/esm/context.js
CHANGED
|
@@ -7,7 +7,7 @@ PlatformContext.displayName = "PlatformContext";
|
|
|
7
7
|
/**
|
|
8
8
|
* React provider that binds platform context into React context.
|
|
9
9
|
*
|
|
10
|
-
* @
|
|
10
|
+
* @alpha
|
|
11
11
|
*/
|
|
12
12
|
export function PlatformContextProvider({ value, children }) {
|
|
13
13
|
return _jsx(PlatformContext.Provider, { value: value, children: children });
|
|
@@ -15,7 +15,7 @@ export function PlatformContextProvider({ value, children }) {
|
|
|
15
15
|
/**
|
|
16
16
|
* Returns client platform context snapshot (or undefined if not available yet).
|
|
17
17
|
*
|
|
18
|
-
* @
|
|
18
|
+
* @alpha
|
|
19
19
|
*/
|
|
20
20
|
export function usePlatformContext() {
|
|
21
21
|
return useContext(PlatformContext);
|
|
@@ -23,7 +23,7 @@ export function usePlatformContext() {
|
|
|
23
23
|
/**
|
|
24
24
|
* Returns client platform context snapshot and throws if it's not available.
|
|
25
25
|
*
|
|
26
|
-
* @
|
|
26
|
+
* @alpha
|
|
27
27
|
*/
|
|
28
28
|
export function usePlatformContextStrict(context = "usePlatformContextStrict") {
|
|
29
29
|
const value = usePlatformContext();
|
package/esm/index.d.ts
CHANGED
|
@@ -5,4 +5,5 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { type IClientPlatformContext, PlatformContextProvider, type IPlatformContextProviderProps, usePlatformContext, usePlatformContextStrict, } from "./context.js";
|
|
7
7
|
export { createBackendForModule, type ICreateBackendForModuleOptions } from "./backend.js";
|
|
8
|
+
export { AppProviders, type IAppProvidersProps } from "./AppProviders.js";
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,OAAO,EACH,KAAK,sBAAsB,EAC3B,uBAAuB,EACvB,KAAK,6BAA6B,EAClC,kBAAkB,EAClB,wBAAwB,GAC3B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,sBAAsB,EAAE,KAAK,8BAA8B,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,OAAO,EACH,KAAK,sBAAsB,EAC3B,uBAAuB,EACvB,KAAK,6BAA6B,EAClC,kBAAkB,EAClB,wBAAwB,GAC3B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,sBAAsB,EAAE,KAAK,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAE3F,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/esm/index.js
CHANGED
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,oDAAoD;AAEpD;;;;GAIG;AAEH,OAAO,EAEH,uBAAuB,EAEvB,kBAAkB,EAClB,wBAAwB,GAC3B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,sBAAsB,EAAuC,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,oDAAoD;AAEpD;;;;GAIG;AAEH,OAAO,EAEH,uBAAuB,EAEvB,kBAAkB,EAClB,wBAAwB,GAC3B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,sBAAsB,EAAuC,MAAM,cAAc,CAAC;AAE3F,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAC"}
|
|
@@ -6,10 +6,40 @@
|
|
|
6
6
|
|
|
7
7
|
import { IAnalyticalBackend } from '@gooddata/sdk-backend-spi';
|
|
8
8
|
import { IAuthCredentials } from '@gooddata/sdk-pluggable-application-model';
|
|
9
|
+
import { ILocale } from '@gooddata/sdk-model';
|
|
9
10
|
import { IPlatformContext } from '@gooddata/sdk-pluggable-application-model';
|
|
11
|
+
import { ITranslations } from '@gooddata/sdk-ui';
|
|
10
12
|
import { JSX } from 'react/jsx-runtime';
|
|
11
13
|
import { PropsWithChildren } from 'react';
|
|
12
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Standard provider stack for pluggable application modules.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Wraps children with, in order:
|
|
20
|
+
*
|
|
21
|
+
* 1. **PlatformContextProvider** — exposes `IClientPlatformContext` (ctx + backend)
|
|
22
|
+
* 2. **BackendProvider** — makes backend available to SDK UI components (`useBackendStrict`)
|
|
23
|
+
* 3. **WorkspaceProvider** — conditionally mounted when a workspace ID is available
|
|
24
|
+
* 4. **ThemeProvider** — applies theme CSS variables from `ctx.theme`
|
|
25
|
+
* 5. **IntlProvider** — localization with async-loaded translation bundles
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <AppProviders
|
|
30
|
+
* ctx={ctx}
|
|
31
|
+
* packageName="gdc-my-app-module"
|
|
32
|
+
* resolveMessages={resolveMessages}
|
|
33
|
+
* defaultMessages={DEFAULT_MESSAGES}
|
|
34
|
+
* >
|
|
35
|
+
* <App />
|
|
36
|
+
* </AppProviders>
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @alpha
|
|
40
|
+
*/
|
|
41
|
+
export declare function AppProviders({ ctx, packageName, resolveMessages: resolveMessagesFn, defaultMessages, defaultLanguage, children }: PropsWithChildren<IAppProvidersProps>): JSX.Element;
|
|
42
|
+
|
|
13
43
|
/**
|
|
14
44
|
* Creates an analytical backend instance from the platform context auth credentials.
|
|
15
45
|
*
|
|
@@ -36,6 +66,38 @@ import { PropsWithChildren } from 'react';
|
|
|
36
66
|
*/
|
|
37
67
|
export declare function createBackendForModule(auth: IAuthCredentials, options: ICreateBackendForModuleOptions): IAnalyticalBackend;
|
|
38
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Props for {@link AppProviders}.
|
|
71
|
+
*
|
|
72
|
+
* @alpha
|
|
73
|
+
*/
|
|
74
|
+
export declare interface IAppProvidersProps {
|
|
75
|
+
/**
|
|
76
|
+
* Platform context snapshot provided by the host (from mount options).
|
|
77
|
+
*/
|
|
78
|
+
ctx: IPlatformContext;
|
|
79
|
+
/**
|
|
80
|
+
* Package name reported to the backend for telemetry.
|
|
81
|
+
*/
|
|
82
|
+
packageName: string;
|
|
83
|
+
/**
|
|
84
|
+
* Asynchronous translation message resolver — typically the memoized
|
|
85
|
+
* `resolveMessages` function exported from the module's `translations.ts`.
|
|
86
|
+
*/
|
|
87
|
+
resolveMessages: (locale: string) => Promise<ITranslations>;
|
|
88
|
+
/**
|
|
89
|
+
* Eagerly-loaded default messages keyed by locale.
|
|
90
|
+
* Typically `{ "en-US": { ...sdkDefaults, ...appDefaults } }`.
|
|
91
|
+
*/
|
|
92
|
+
defaultMessages: Record<string, ITranslations>;
|
|
93
|
+
/**
|
|
94
|
+
* Default language/locale used when `ctx.preferredLocale` is not set.
|
|
95
|
+
*
|
|
96
|
+
* @defaultValue `"en-US"`
|
|
97
|
+
*/
|
|
98
|
+
defaultLanguage?: ILocale;
|
|
99
|
+
}
|
|
100
|
+
|
|
39
101
|
/**
|
|
40
102
|
* Platform context extended with a client-created backend instance.
|
|
41
103
|
*
|
|
@@ -49,7 +111,7 @@ export declare function createBackendForModule(auth: IAuthCredentials, options:
|
|
|
49
111
|
* backend-specific escape hatches (e.g., tiger-specific functions)
|
|
50
112
|
* automatically.
|
|
51
113
|
*
|
|
52
|
-
* @
|
|
114
|
+
* @alpha
|
|
53
115
|
*/
|
|
54
116
|
export declare interface IClientPlatformContext extends IPlatformContext {
|
|
55
117
|
/**
|
|
@@ -78,7 +140,7 @@ export declare interface ICreateBackendForModuleOptions {
|
|
|
78
140
|
/**
|
|
79
141
|
* Props for {@link PlatformContextProvider}.
|
|
80
142
|
*
|
|
81
|
-
* @
|
|
143
|
+
* @alpha
|
|
82
144
|
*/
|
|
83
145
|
export declare interface IPlatformContextProviderProps extends PropsWithChildren {
|
|
84
146
|
/**
|
|
@@ -90,21 +152,21 @@ export declare interface IPlatformContextProviderProps extends PropsWithChildren
|
|
|
90
152
|
/**
|
|
91
153
|
* React provider that binds platform context into React context.
|
|
92
154
|
*
|
|
93
|
-
* @
|
|
155
|
+
* @alpha
|
|
94
156
|
*/
|
|
95
157
|
export declare function PlatformContextProvider({ value, children }: IPlatformContextProviderProps): JSX.Element;
|
|
96
158
|
|
|
97
159
|
/**
|
|
98
160
|
* Returns client platform context snapshot (or undefined if not available yet).
|
|
99
161
|
*
|
|
100
|
-
* @
|
|
162
|
+
* @alpha
|
|
101
163
|
*/
|
|
102
164
|
export declare function usePlatformContext(): IClientPlatformContext | undefined;
|
|
103
165
|
|
|
104
166
|
/**
|
|
105
167
|
* Returns client platform context snapshot and throws if it's not available.
|
|
106
168
|
*
|
|
107
|
-
* @
|
|
169
|
+
* @alpha
|
|
108
170
|
*/
|
|
109
171
|
export declare function usePlatformContextStrict(context?: string): IClientPlatformContext;
|
|
110
172
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-pluggable-application",
|
|
3
|
-
"version": "11.29.0-alpha.
|
|
3
|
+
"version": "11.29.0-alpha.5",
|
|
4
4
|
"description": "GoodData SDK React helpers for pluggable applications",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -21,12 +21,16 @@
|
|
|
21
21
|
"types": "./esm/index.d.ts",
|
|
22
22
|
"exports": "./esm/index.js",
|
|
23
23
|
"dependencies": {
|
|
24
|
+
"react-intl": "7.1.11",
|
|
24
25
|
"ts-invariant": "0.10.3",
|
|
25
26
|
"tslib": "2.8.1",
|
|
26
|
-
"@gooddata/sdk-backend-base": "11.29.0-alpha.
|
|
27
|
-
"@gooddata/sdk-backend-
|
|
28
|
-
"@gooddata/sdk-
|
|
29
|
-
"@gooddata/sdk-
|
|
27
|
+
"@gooddata/sdk-backend-base": "11.29.0-alpha.5",
|
|
28
|
+
"@gooddata/sdk-backend-tiger": "11.29.0-alpha.5",
|
|
29
|
+
"@gooddata/sdk-model": "11.29.0-alpha.5",
|
|
30
|
+
"@gooddata/sdk-backend-spi": "11.29.0-alpha.5",
|
|
31
|
+
"@gooddata/sdk-pluggable-application-model": "11.29.0-alpha.5",
|
|
32
|
+
"@gooddata/sdk-ui": "11.29.0-alpha.5",
|
|
33
|
+
"@gooddata/sdk-ui-theme-provider": "11.29.0-alpha.5"
|
|
30
34
|
},
|
|
31
35
|
"devDependencies": {
|
|
32
36
|
"@microsoft/api-documenter": "^7.17.0",
|
|
@@ -58,8 +62,8 @@
|
|
|
58
62
|
"react-dom": "19.1.1",
|
|
59
63
|
"typescript": "5.9.3",
|
|
60
64
|
"vitest": "4.1.0",
|
|
61
|
-
"@gooddata/eslint-config": "11.29.0-alpha.
|
|
62
|
-
"@gooddata/oxlint-config": "11.29.0-alpha.
|
|
65
|
+
"@gooddata/eslint-config": "11.29.0-alpha.5",
|
|
66
|
+
"@gooddata/oxlint-config": "11.29.0-alpha.5"
|
|
63
67
|
},
|
|
64
68
|
"peerDependencies": {
|
|
65
69
|
"react": "^18.0.0 || ^19.0.0",
|