@gooddata/sdk-ui-pluggable-application 11.29.0-alpha.1 → 11.29.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
- * @public
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
- * @public
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
- * @public
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
- * @public
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
- * @public
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
- * @public
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
- * @public
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
- * @public
26
+ * @alpha
27
27
  */
28
28
  export function usePlatformContextStrict(context = "usePlatformContextStrict") {
29
29
  const value = usePlatformContext();
@@ -0,0 +1,41 @@
1
+ import { type PropsWithChildren } from "react";
2
+ import { type IPluggableAppEvent } from "@gooddata/sdk-pluggable-application-model";
3
+ /**
4
+ * Value exposed by {@link PluggableAppEventsProvider}.
5
+ *
6
+ * @alpha
7
+ */
8
+ export interface IPluggableAppEventsContextValue {
9
+ /**
10
+ * Emits arbitrary event to host.
11
+ */
12
+ emit: (event: IPluggableAppEvent) => void;
13
+ /**
14
+ * Emits a standard platform-context reload request to host.
15
+ */
16
+ emitPlatformContextReload: () => void;
17
+ }
18
+ /**
19
+ * Props for {@link PluggableAppEventsProvider}.
20
+ *
21
+ * @alpha
22
+ */
23
+ export interface IPluggableAppEventsProviderProps extends PropsWithChildren {
24
+ /**
25
+ * Host callback passed through pluggable mount options.
26
+ */
27
+ onEvent?: (event: IPluggableAppEvent) => void;
28
+ }
29
+ /**
30
+ * React provider exposing pluggable-to-host event helpers.
31
+ *
32
+ * @alpha
33
+ */
34
+ export declare function PluggableAppEventsProvider({ onEvent, children }: IPluggableAppEventsProviderProps): import("react/jsx-runtime").JSX.Element;
35
+ /**
36
+ * Returns event helpers for communication with host.
37
+ *
38
+ * @alpha
39
+ */
40
+ export declare function usePluggableAppEvents(): IPluggableAppEventsContextValue;
41
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAmD,MAAM,OAAO,CAAC;AAEhG,OAAO,EACH,KAAK,kBAAkB,EAE1B,MAAM,2CAA2C,CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,+BAA+B;IAC5C;;OAEG;IACH,IAAI,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC1C;;OAEG;IACH,yBAAyB,EAAE,MAAM,IAAI,CAAC;CACzC;AAED;;;;GAIG;AACH,MAAM,WAAW,gCAAiC,SAAQ,iBAAiB;IACvE;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACjD;AAUD;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,gCAAgC,2CAmBjG;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,+BAA+B,CAEvE"}
package/esm/events.js ADDED
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // (C) 2026 GoodData Corporation
3
+ import { createContext, useCallback, useContext, useMemo } from "react";
4
+ import { reloadPlatformContextRequested, } from "@gooddata/sdk-pluggable-application-model";
5
+ const noop = () => undefined;
6
+ const PluggableAppEventsContext = createContext({
7
+ emit: noop,
8
+ emitPlatformContextReload: noop,
9
+ });
10
+ PluggableAppEventsContext.displayName = "PluggableAppEventsContext";
11
+ /**
12
+ * React provider exposing pluggable-to-host event helpers.
13
+ *
14
+ * @alpha
15
+ */
16
+ export function PluggableAppEventsProvider({ onEvent, children }) {
17
+ const emit = useCallback((event) => {
18
+ onEvent?.(event);
19
+ }, [onEvent]);
20
+ const emitPlatformContextReload = useCallback(() => {
21
+ emit(reloadPlatformContextRequested());
22
+ }, [emit]);
23
+ return (_jsx(PluggableAppEventsContext.Provider, { value: useMemo(() => ({ emit, emitPlatformContextReload }), [emit, emitPlatformContextReload]), children: children }));
24
+ }
25
+ /**
26
+ * Returns event helpers for communication with host.
27
+ *
28
+ * @alpha
29
+ */
30
+ export function usePluggableAppEvents() {
31
+ return useContext(PluggableAppEventsContext);
32
+ }
33
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.tsx"],"names":[],"mappings":";AAAA,gCAAgC;AAEhC,OAAO,EAA0B,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhG,OAAO,EAEH,8BAA8B,GACjC,MAAM,2CAA2C,CAAC;AA8BnD,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC;AAE7B,MAAM,yBAAyB,GAAG,aAAa,CAAkC;IAC7E,IAAI,EAAE,IAAI;IACV,yBAAyB,EAAE,IAAI;CAClC,CAAC,CAAC;AACH,yBAAyB,CAAC,WAAW,GAAG,2BAA2B,CAAC;AAEpE;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAoC,EAAE;IAChG,MAAM,IAAI,GAAG,WAAW,CACpB,CAAC,KAAyB,EAAE,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;IAAA,CACpB,EACD,CAAC,OAAO,CAAC,CACZ,CAAC;IAEF,MAAM,yBAAyB,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAChD,IAAI,CAAC,8BAA8B,EAAE,CAAC,CAAC;IAAA,CAC1C,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,OAAO,CACH,KAAC,yBAAyB,CAAC,QAAQ,IAC/B,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,yBAAyB,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC,YAE7F,QAAQ,GACwB,CACxC,CAAC;AAAA,CACL;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,GAAoC;IACrE,OAAO,UAAU,CAAC,yBAAyB,CAAC,CAAC;AAAA,CAChD"}
package/esm/index.d.ts CHANGED
@@ -5,4 +5,6 @@
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";
9
+ export { type IPluggableAppEventsContextValue, type IPluggableAppEventsProviderProps, PluggableAppEventsProvider, usePluggableAppEvents, } from "./events.js";
8
10
  //# sourceMappingURL=index.d.ts.map
@@ -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;AAC1E,OAAO,EACH,KAAK,+BAA+B,EACpC,KAAK,gCAAgC,EACrC,0BAA0B,EAC1B,qBAAqB,GACxB,MAAM,aAAa,CAAC"}
package/esm/index.js CHANGED
@@ -7,4 +7,6 @@
7
7
  */
8
8
  export { PlatformContextProvider, usePlatformContext, usePlatformContextStrict, } from "./context.js";
9
9
  export { createBackendForModule } from "./backend.js";
10
+ export { AppProviders } from "./AppProviders.js";
11
+ export { PluggableAppEventsProvider, usePluggableAppEvents, } from "./events.js";
10
12
  //# sourceMappingURL=index.js.map
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;AAC1E,OAAO,EAGH,0BAA0B,EAC1B,qBAAqB,GACxB,MAAM,aAAa,CAAC"}
@@ -6,10 +6,41 @@
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 { IPluggableAppEvent } from '@gooddata/sdk-pluggable-application-model';
12
+ import { ITranslations } from '@gooddata/sdk-ui';
10
13
  import { JSX } from 'react/jsx-runtime';
11
14
  import { PropsWithChildren } from 'react';
12
15
 
16
+ /**
17
+ * Standard provider stack for pluggable application modules.
18
+ *
19
+ * @remarks
20
+ * Wraps children with, in order:
21
+ *
22
+ * 1. **PlatformContextProvider** — exposes `IClientPlatformContext` (ctx + backend)
23
+ * 2. **BackendProvider** — makes backend available to SDK UI components (`useBackendStrict`)
24
+ * 3. **WorkspaceProvider** — conditionally mounted when a workspace ID is available
25
+ * 4. **ThemeProvider** — applies theme CSS variables from `ctx.theme`
26
+ * 5. **IntlProvider** — localization with async-loaded translation bundles
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * <AppProviders
31
+ * ctx={ctx}
32
+ * packageName="gdc-my-app-module"
33
+ * resolveMessages={resolveMessages}
34
+ * defaultMessages={DEFAULT_MESSAGES}
35
+ * >
36
+ * <App />
37
+ * </AppProviders>
38
+ * ```
39
+ *
40
+ * @alpha
41
+ */
42
+ export declare function AppProviders({ ctx, packageName, resolveMessages: resolveMessagesFn, defaultMessages, defaultLanguage, children }: PropsWithChildren<IAppProvidersProps>): JSX.Element;
43
+
13
44
  /**
14
45
  * Creates an analytical backend instance from the platform context auth credentials.
15
46
  *
@@ -36,6 +67,38 @@ import { PropsWithChildren } from 'react';
36
67
  */
37
68
  export declare function createBackendForModule(auth: IAuthCredentials, options: ICreateBackendForModuleOptions): IAnalyticalBackend;
38
69
 
70
+ /**
71
+ * Props for {@link AppProviders}.
72
+ *
73
+ * @alpha
74
+ */
75
+ export declare interface IAppProvidersProps {
76
+ /**
77
+ * Platform context snapshot provided by the host (from mount options).
78
+ */
79
+ ctx: IPlatformContext;
80
+ /**
81
+ * Package name reported to the backend for telemetry.
82
+ */
83
+ packageName: string;
84
+ /**
85
+ * Asynchronous translation message resolver — typically the memoized
86
+ * `resolveMessages` function exported from the module's `translations.ts`.
87
+ */
88
+ resolveMessages: (locale: string) => Promise<ITranslations>;
89
+ /**
90
+ * Eagerly-loaded default messages keyed by locale.
91
+ * Typically `{ "en-US": { ...sdkDefaults, ...appDefaults } }`.
92
+ */
93
+ defaultMessages: Record<string, ITranslations>;
94
+ /**
95
+ * Default language/locale used when `ctx.preferredLocale` is not set.
96
+ *
97
+ * @defaultValue `"en-US"`
98
+ */
99
+ defaultLanguage?: ILocale;
100
+ }
101
+
39
102
  /**
40
103
  * Platform context extended with a client-created backend instance.
41
104
  *
@@ -49,7 +112,7 @@ export declare function createBackendForModule(auth: IAuthCredentials, options:
49
112
  * backend-specific escape hatches (e.g., tiger-specific functions)
50
113
  * automatically.
51
114
  *
52
- * @public
115
+ * @alpha
53
116
  */
54
117
  export declare interface IClientPlatformContext extends IPlatformContext {
55
118
  /**
@@ -78,7 +141,7 @@ export declare interface ICreateBackendForModuleOptions {
78
141
  /**
79
142
  * Props for {@link PlatformContextProvider}.
80
143
  *
81
- * @public
144
+ * @alpha
82
145
  */
83
146
  export declare interface IPlatformContextProviderProps extends PropsWithChildren {
84
147
  /**
@@ -87,25 +150,67 @@ export declare interface IPlatformContextProviderProps extends PropsWithChildren
87
150
  value: IClientPlatformContext;
88
151
  }
89
152
 
153
+ /**
154
+ * Value exposed by {@link PluggableAppEventsProvider}.
155
+ *
156
+ * @alpha
157
+ */
158
+ export declare interface IPluggableAppEventsContextValue {
159
+ /**
160
+ * Emits arbitrary event to host.
161
+ */
162
+ emit: (event: IPluggableAppEvent) => void;
163
+ /**
164
+ * Emits a standard platform-context reload request to host.
165
+ */
166
+ emitPlatformContextReload: () => void;
167
+ }
168
+
169
+ /**
170
+ * Props for {@link PluggableAppEventsProvider}.
171
+ *
172
+ * @alpha
173
+ */
174
+ export declare interface IPluggableAppEventsProviderProps extends PropsWithChildren {
175
+ /**
176
+ * Host callback passed through pluggable mount options.
177
+ */
178
+ onEvent?: (event: IPluggableAppEvent) => void;
179
+ }
180
+
90
181
  /**
91
182
  * React provider that binds platform context into React context.
92
183
  *
93
- * @public
184
+ * @alpha
94
185
  */
95
186
  export declare function PlatformContextProvider({ value, children }: IPlatformContextProviderProps): JSX.Element;
96
187
 
188
+ /**
189
+ * React provider exposing pluggable-to-host event helpers.
190
+ *
191
+ * @alpha
192
+ */
193
+ export declare function PluggableAppEventsProvider({ onEvent, children }: IPluggableAppEventsProviderProps): JSX.Element;
194
+
97
195
  /**
98
196
  * Returns client platform context snapshot (or undefined if not available yet).
99
197
  *
100
- * @public
198
+ * @alpha
101
199
  */
102
200
  export declare function usePlatformContext(): IClientPlatformContext | undefined;
103
201
 
104
202
  /**
105
203
  * Returns client platform context snapshot and throws if it's not available.
106
204
  *
107
- * @public
205
+ * @alpha
108
206
  */
109
207
  export declare function usePlatformContextStrict(context?: string): IClientPlatformContext;
110
208
 
209
+ /**
210
+ * Returns event helpers for communication with host.
211
+ *
212
+ * @alpha
213
+ */
214
+ export declare function usePluggableAppEvents(): IPluggableAppEventsContextValue;
215
+
111
216
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-ui-pluggable-application",
3
- "version": "11.29.0-alpha.1",
3
+ "version": "11.29.0-alpha.10",
4
4
  "description": "GoodData SDK React helpers for pluggable applications",
5
5
  "license": "MIT",
6
6
  "author": "GoodData Corporation",
@@ -21,23 +21,27 @@
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.1",
27
- "@gooddata/sdk-backend-spi": "11.29.0-alpha.1",
28
- "@gooddata/sdk-backend-tiger": "11.29.0-alpha.1",
29
- "@gooddata/sdk-pluggable-application-model": "11.29.0-alpha.1"
27
+ "@gooddata/sdk-backend-base": "11.29.0-alpha.10",
28
+ "@gooddata/sdk-backend-tiger": "11.29.0-alpha.10",
29
+ "@gooddata/sdk-model": "11.29.0-alpha.10",
30
+ "@gooddata/sdk-backend-spi": "11.29.0-alpha.10",
31
+ "@gooddata/sdk-ui": "11.29.0-alpha.10",
32
+ "@gooddata/sdk-ui-theme-provider": "11.29.0-alpha.10",
33
+ "@gooddata/sdk-pluggable-application-model": "11.29.0-alpha.10"
30
34
  },
31
35
  "devDependencies": {
32
36
  "@microsoft/api-documenter": "^7.17.0",
33
37
  "@microsoft/api-extractor": "^7.55.2",
34
- "@types/node": "22.13.0",
38
+ "@types/node": "24.12.0",
35
39
  "@types/react": "19.1.11",
36
40
  "@types/react-dom": "19.1.7",
37
- "@typescript-eslint/eslint-plugin": "8.52.0",
38
- "@typescript-eslint/parser": "8.52.0",
41
+ "@typescript-eslint/eslint-plugin": "8.58.0",
42
+ "@typescript-eslint/parser": "8.58.0",
39
43
  "@typescript/native-preview": "7.0.0-dev.20260202.1",
40
- "dependency-cruiser": "^14.1.2",
44
+ "dependency-cruiser": "17.3.10",
41
45
  "eslint": "^9.39.2",
42
46
  "eslint-import-resolver-typescript": "4.4.4",
43
47
  "eslint-plugin-headers": "1.3.3",
@@ -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.1",
62
- "@gooddata/oxlint-config": "11.29.0-alpha.1"
65
+ "@gooddata/eslint-config": "11.29.0-alpha.10",
66
+ "@gooddata/oxlint-config": "11.29.0-alpha.10"
63
67
  },
64
68
  "peerDependencies": {
65
69
  "react": "^18.0.0 || ^19.0.0",