@gooddata/sdk-ui-pluggable-application 11.29.0-alpha.6 → 11.29.0-alpha.8

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,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
@@ -6,4 +6,5 @@
6
6
  export { type IClientPlatformContext, PlatformContextProvider, type IPlatformContextProviderProps, usePlatformContext, usePlatformContextStrict, } from "./context.js";
7
7
  export { createBackendForModule, type ICreateBackendForModuleOptions } from "./backend.js";
8
8
  export { AppProviders, type IAppProvidersProps } from "./AppProviders.js";
9
+ export { type IPluggableAppEventsContextValue, type IPluggableAppEventsProviderProps, PluggableAppEventsProvider, usePluggableAppEvents, } from "./events.js";
9
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;AAE3F,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,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
@@ -8,4 +8,5 @@
8
8
  export { PlatformContextProvider, usePlatformContext, usePlatformContextStrict, } from "./context.js";
9
9
  export { createBackendForModule } from "./backend.js";
10
10
  export { AppProviders } from "./AppProviders.js";
11
+ export { PluggableAppEventsProvider, usePluggableAppEvents, } from "./events.js";
11
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;AAE3F,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,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"}
@@ -8,6 +8,7 @@ import { IAnalyticalBackend } from '@gooddata/sdk-backend-spi';
8
8
  import { IAuthCredentials } from '@gooddata/sdk-pluggable-application-model';
9
9
  import { ILocale } from '@gooddata/sdk-model';
10
10
  import { IPlatformContext } from '@gooddata/sdk-pluggable-application-model';
11
+ import { IPluggableAppEvent } from '@gooddata/sdk-pluggable-application-model';
11
12
  import { ITranslations } from '@gooddata/sdk-ui';
12
13
  import { JSX } from 'react/jsx-runtime';
13
14
  import { PropsWithChildren } from 'react';
@@ -149,6 +150,34 @@ export declare interface IPlatformContextProviderProps extends PropsWithChildren
149
150
  value: IClientPlatformContext;
150
151
  }
151
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
+
152
181
  /**
153
182
  * React provider that binds platform context into React context.
154
183
  *
@@ -156,6 +185,13 @@ export declare interface IPlatformContextProviderProps extends PropsWithChildren
156
185
  */
157
186
  export declare function PlatformContextProvider({ value, children }: IPlatformContextProviderProps): JSX.Element;
158
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
+
159
195
  /**
160
196
  * Returns client platform context snapshot (or undefined if not available yet).
161
197
  *
@@ -170,4 +206,11 @@ export declare function usePlatformContext(): IClientPlatformContext | undefined
170
206
  */
171
207
  export declare function usePlatformContextStrict(context?: string): IClientPlatformContext;
172
208
 
209
+ /**
210
+ * Returns event helpers for communication with host.
211
+ *
212
+ * @alpha
213
+ */
214
+ export declare function usePluggableAppEvents(): IPluggableAppEventsContextValue;
215
+
173
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.6",
3
+ "version": "11.29.0-alpha.8",
4
4
  "description": "GoodData SDK React helpers for pluggable applications",
5
5
  "license": "MIT",
6
6
  "author": "GoodData Corporation",
@@ -24,13 +24,13 @@
24
24
  "react-intl": "7.1.11",
25
25
  "ts-invariant": "0.10.3",
26
26
  "tslib": "2.8.1",
27
- "@gooddata/sdk-backend-base": "11.29.0-alpha.6",
28
- "@gooddata/sdk-backend-tiger": "11.29.0-alpha.6",
29
- "@gooddata/sdk-backend-spi": "11.29.0-alpha.6",
30
- "@gooddata/sdk-pluggable-application-model": "11.29.0-alpha.6",
31
- "@gooddata/sdk-model": "11.29.0-alpha.6",
32
- "@gooddata/sdk-ui": "11.29.0-alpha.6",
33
- "@gooddata/sdk-ui-theme-provider": "11.29.0-alpha.6"
27
+ "@gooddata/sdk-backend-base": "11.29.0-alpha.8",
28
+ "@gooddata/sdk-backend-spi": "11.29.0-alpha.8",
29
+ "@gooddata/sdk-model": "11.29.0-alpha.8",
30
+ "@gooddata/sdk-pluggable-application-model": "11.29.0-alpha.8",
31
+ "@gooddata/sdk-backend-tiger": "11.29.0-alpha.8",
32
+ "@gooddata/sdk-ui": "11.29.0-alpha.8",
33
+ "@gooddata/sdk-ui-theme-provider": "11.29.0-alpha.8"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@microsoft/api-documenter": "^7.17.0",
@@ -62,8 +62,8 @@
62
62
  "react-dom": "19.1.1",
63
63
  "typescript": "5.9.3",
64
64
  "vitest": "4.1.0",
65
- "@gooddata/oxlint-config": "11.29.0-alpha.6",
66
- "@gooddata/eslint-config": "11.29.0-alpha.6"
65
+ "@gooddata/oxlint-config": "11.29.0-alpha.8",
66
+ "@gooddata/eslint-config": "11.29.0-alpha.8"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "react": "^18.0.0 || ^19.0.0",