@gooddata/sdk-ui-analytical-designer 11.65.0-alpha.10 → 11.65.0-alpha.12
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/NOTICE +1 -39
- package/README.md +20 -14
- package/esm/components/buckets/BucketIcon.d.ts +1 -1
- package/esm/components/buckets/BucketIcon.d.ts.map +1 -1
- package/esm/components/buckets/BucketIcon.js +11 -161
- package/esm/embedding/AnalyticalDesigner.d.ts.map +1 -1
- package/esm/embedding/AnalyticalDesigner.js +2 -3
- package/esm/embedding/AnalyticalDesignerEmbedded.d.ts +5 -2
- package/esm/embedding/AnalyticalDesignerEmbedded.d.ts.map +1 -1
- package/esm/embedding/AnalyticalDesignerEmbedded.js +1 -2
- package/esm/embedding/analyticalDesignerConfig.d.ts +0 -6
- package/esm/embedding/analyticalDesignerConfig.d.ts.map +1 -1
- package/esm/embedding/analyticalDesignerConfig.js +0 -36
- package/esm/embedding/analyticalDesignerTypes.d.ts +119 -104
- package/esm/embedding/analyticalDesignerTypes.d.ts.map +1 -1
- package/esm/embedding/hostBridge.d.ts +2 -9
- package/esm/embedding/hostBridge.d.ts.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/postMessageApi/outgoing/drill_events.d.ts.map +1 -1
- package/esm/postMessageApi/outgoing/drill_events.js +10 -3
- package/esm/postMessageApi/outgoing/post_event_helper.d.ts +11 -1
- package/esm/postMessageApi/outgoing/post_event_helper.d.ts.map +1 -1
- package/esm/postMessageApi/outgoing/post_event_helper.js +22 -13
- package/esm/sdk-ui-analytical-designer.d.ts +112 -95
- package/package.json +21 -21
- package/styles/css/buckets.css +7 -0
- package/styles/css/buckets.css.map +1 -1
- package/styles/css/editor_header.css +1 -1
- package/styles/css/editor_header.css.map +1 -1
- package/styles/css/main.css +11 -1
- package/styles/css/main.css.map +1 -1
- package/styles/css/typo.css +3 -0
- package/styles/css/typo.css.map +1 -1
- package/styles/scss/buckets.scss +10 -0
- package/styles/scss/editor_header.scss +1 -1
- package/styles/scss/typo.scss +4 -0
- package/esm/embedding/embeddedCallbacks.d.ts +0 -31
- package/esm/embedding/embeddedCallbacks.d.ts.map +0 -1
- package/esm/embedding/embeddedCallbacks.js +0 -59
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type Ref } from "react";
|
|
2
2
|
import { type IAnalyticalBackend, type IUserSettings, type IUserWorkspaceSettings } from "@gooddata/sdk-backend-spi";
|
|
3
|
-
import { type AdCommandData, type AdExportFinishedBody, type AdFilterContextChangedBody, type AdInsightChangedBody, type AdInsightRenderedBody, type AdInsightSavedBody, type GdcAdCommandType, type IAdAvailableCommands, type ICommandFailedBody, type IFilterContextContent, type IObjectMeta } from "@gooddata/sdk-embedding";
|
|
3
|
+
import { type AdCatalogLoadedBody, type AdCommandData, type AdExportFinishedBody, type AdFilterContextChangedBody, type AdInsightChangedBody, type AdInsightRenderedBody, type AdInsightSavedBody, type GdcAdCommandType, type IAdAvailableCommands, type ICommandFailedBody, type IFilterContextContent, type IObjectMeta } from "@gooddata/sdk-embedding";
|
|
4
4
|
import { type IColorPalette, type IEntitlementDescriptor, type IInsight, type IInsightDefinition, type ILocale, type ISeparators, type ITheme, type IUser, type IWorkspacePermissions, type ObjRef } from "@gooddata/sdk-model";
|
|
5
|
+
import { type IDrillEvent } from "@gooddata/sdk-ui";
|
|
5
6
|
import { type IAnalyticalDesignerSlots } from "./slots.js";
|
|
6
7
|
/**
|
|
7
8
|
* An action of the Analytical Designer header that a host can hide.
|
|
@@ -143,63 +144,147 @@ export interface IAnalyticalDesignerConfig {
|
|
|
143
144
|
telemetryCallbacks?: IAnalyticalDesignerTelemetryCallbacks;
|
|
144
145
|
}
|
|
145
146
|
/**
|
|
146
|
-
*
|
|
147
|
-
* contract of the embedded Analytical Designer.
|
|
147
|
+
* Payload of the event Analytical Designer emits when it opens an insight.
|
|
148
148
|
*
|
|
149
149
|
* @alpha
|
|
150
150
|
*/
|
|
151
|
-
export interface
|
|
152
|
-
/**
|
|
153
|
-
* Name of the product that emits the event.
|
|
154
|
-
*/
|
|
155
|
-
product: string;
|
|
151
|
+
export interface IAnalyticalDesignerInsightOpenedData {
|
|
156
152
|
/**
|
|
157
|
-
*
|
|
153
|
+
* Commands Analytical Designer accepts for the open insight.
|
|
158
154
|
*/
|
|
159
|
-
|
|
155
|
+
availableCommands: GdcAdCommandType[];
|
|
160
156
|
/**
|
|
161
|
-
*
|
|
157
|
+
* Definition of the open insight.
|
|
162
158
|
*/
|
|
163
|
-
|
|
159
|
+
definition: IInsightDefinition;
|
|
164
160
|
/**
|
|
165
|
-
*
|
|
161
|
+
* Metadata of the open insight.
|
|
166
162
|
*/
|
|
167
|
-
|
|
163
|
+
insight: IObjectMeta;
|
|
168
164
|
}
|
|
169
165
|
/**
|
|
170
|
-
*
|
|
166
|
+
* Payload of each event Analytical Designer emits, by the type of the event.
|
|
167
|
+
*
|
|
168
|
+
* @remarks
|
|
169
|
+
* The types are the names of the `@gooddata/sdk-embedding` contract of the embedded Analytical
|
|
170
|
+
* Designer, for example `GdcAdEventType.InsightSaved` is `visualizationSaved`.
|
|
171
171
|
*
|
|
172
172
|
* @alpha
|
|
173
173
|
*/
|
|
174
|
-
export interface
|
|
174
|
+
export interface IAnalyticalDesignerEventDataMap {
|
|
175
175
|
/**
|
|
176
|
-
*
|
|
176
|
+
* Analytical Designer opened an insight.
|
|
177
177
|
*/
|
|
178
|
-
|
|
178
|
+
insightOpened: IAnalyticalDesignerInsightOpenedData;
|
|
179
179
|
/**
|
|
180
|
-
*
|
|
180
|
+
* The insight rendered.
|
|
181
181
|
*/
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Payload of the event Analytical Designer emits when it opens an insight.
|
|
186
|
-
*
|
|
187
|
-
* @alpha
|
|
188
|
-
*/
|
|
189
|
-
export interface IAnalyticalDesignerInsightOpenedData {
|
|
182
|
+
insightRendered: AdInsightRenderedBody;
|
|
190
183
|
/**
|
|
191
|
-
*
|
|
184
|
+
* The insight definition changed and its execution started.
|
|
185
|
+
*/
|
|
186
|
+
insightChanged: AdInsightChangedBody;
|
|
187
|
+
/**
|
|
188
|
+
* The user or a `save` command saved the insight.
|
|
189
|
+
*/
|
|
190
|
+
visualizationSaved: AdInsightSavedBody;
|
|
191
|
+
/**
|
|
192
|
+
* The user cancelled the editing.
|
|
193
|
+
*/
|
|
194
|
+
insightEditingCancelled: null;
|
|
195
|
+
/**
|
|
196
|
+
* The catalog loaded.
|
|
197
|
+
*/
|
|
198
|
+
catalogLoaded: AdCatalogLoadedBody;
|
|
199
|
+
/**
|
|
200
|
+
* A `clear` command finished.
|
|
201
|
+
*/
|
|
202
|
+
clearFinished: IAdAvailableCommands;
|
|
203
|
+
/**
|
|
204
|
+
* A `clearInsight` command finished.
|
|
205
|
+
*/
|
|
206
|
+
clearInsightFinished: IAdAvailableCommands;
|
|
207
|
+
/**
|
|
208
|
+
* An `undo` command finished.
|
|
209
|
+
*/
|
|
210
|
+
undoFinished: IAdAvailableCommands;
|
|
211
|
+
/**
|
|
212
|
+
* A `redo` command finished.
|
|
213
|
+
*/
|
|
214
|
+
redoFinished: IAdAvailableCommands;
|
|
215
|
+
/**
|
|
216
|
+
* An `exportInsight` command finished, with the link to the exported file.
|
|
217
|
+
*/
|
|
218
|
+
exportInsightFinished: AdExportFinishedBody;
|
|
219
|
+
/**
|
|
220
|
+
* The user changed a filter of the insight.
|
|
221
|
+
*/
|
|
222
|
+
filterContextChanged: AdFilterContextChangedBody;
|
|
223
|
+
/**
|
|
224
|
+
* A `setFilterContext` command finished.
|
|
225
|
+
*/
|
|
226
|
+
setFilterContextFinished: IAdAvailableCommands;
|
|
227
|
+
/**
|
|
228
|
+
* A `removeFilterContext` command finished.
|
|
229
|
+
*/
|
|
230
|
+
removeFilterContextFinished: IAdAvailableCommands;
|
|
231
|
+
/**
|
|
232
|
+
* The user created, changed or deleted an attribute hierarchy.
|
|
233
|
+
*/
|
|
234
|
+
attributeHierarchyModified: IAdAvailableCommands;
|
|
235
|
+
/**
|
|
236
|
+
* A command the host sent failed.
|
|
237
|
+
*/
|
|
238
|
+
appCommandFailed: ICommandFailedBody;
|
|
239
|
+
/**
|
|
240
|
+
* The commands Analytical Designer accepts changed.
|
|
192
241
|
*/
|
|
193
242
|
availableCommands: GdcAdCommandType[];
|
|
194
243
|
/**
|
|
195
|
-
*
|
|
244
|
+
* The user saved or deleted a metric. A host that shares a caching backend with Analytical
|
|
245
|
+
* Designer resets its caches here.
|
|
196
246
|
*/
|
|
197
|
-
|
|
247
|
+
metricsChanged: Record<string, never>;
|
|
198
248
|
/**
|
|
199
|
-
*
|
|
249
|
+
* The user drilled in the insight.
|
|
200
250
|
*/
|
|
201
|
-
|
|
251
|
+
drill: IDrillEvent;
|
|
252
|
+
/**
|
|
253
|
+
* Analytical Designer accepts the `drillableItems` command.
|
|
254
|
+
*/
|
|
255
|
+
listeningForDrillableItems: Record<string, never>;
|
|
256
|
+
/**
|
|
257
|
+
* The API token of Analytical Designer expires soon.
|
|
258
|
+
*/
|
|
259
|
+
apiTokenIsAboutToExpire: Record<string, never>;
|
|
202
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* Type of an event Analytical Designer emits.
|
|
263
|
+
*
|
|
264
|
+
* @alpha
|
|
265
|
+
*/
|
|
266
|
+
export type AnalyticalDesignerEventType = keyof IAnalyticalDesignerEventDataMap;
|
|
267
|
+
/**
|
|
268
|
+
* An event Analytical Designer emits. Checking `type` narrows `data` to the payload of the event.
|
|
269
|
+
*
|
|
270
|
+
* @alpha
|
|
271
|
+
*/
|
|
272
|
+
export type AnalyticalDesignerEvent<T extends AnalyticalDesignerEventType = AnalyticalDesignerEventType> = {
|
|
273
|
+
[K in T]: {
|
|
274
|
+
/**
|
|
275
|
+
* Type of the event.
|
|
276
|
+
*/
|
|
277
|
+
type: K;
|
|
278
|
+
/**
|
|
279
|
+
* Payload of the event.
|
|
280
|
+
*/
|
|
281
|
+
data: IAnalyticalDesignerEventDataMap[K];
|
|
282
|
+
/**
|
|
283
|
+
* Identifier of the command the event answers, if any.
|
|
284
|
+
*/
|
|
285
|
+
contextId?: string;
|
|
286
|
+
};
|
|
287
|
+
}[T];
|
|
203
288
|
/**
|
|
204
289
|
* Commands a host sends to Analytical Designer.
|
|
205
290
|
*
|
|
@@ -293,83 +378,13 @@ export interface IAnalyticalDesignerProps {
|
|
|
293
378
|
*/
|
|
294
379
|
slots?: IAnalyticalDesignerSlots;
|
|
295
380
|
/**
|
|
296
|
-
* Called
|
|
297
|
-
*/
|
|
298
|
-
onInsightSaved?: (data: AdInsightSavedBody, contextId?: string) => void;
|
|
299
|
-
/**
|
|
300
|
-
* Called when the user cancels the editing.
|
|
301
|
-
*/
|
|
302
|
-
onInsightEditingCancelled?: () => void;
|
|
303
|
-
/**
|
|
304
|
-
* Called when Analytical Designer opens an insight.
|
|
305
|
-
*/
|
|
306
|
-
onInsightOpened?: (data: IAnalyticalDesignerInsightOpenedData) => void;
|
|
307
|
-
/**
|
|
308
|
-
* Called when the insight renders.
|
|
309
|
-
*/
|
|
310
|
-
onInsightRendered?: (data: AdInsightRenderedBody) => void;
|
|
311
|
-
/**
|
|
312
|
-
* Called when the insight definition changes and its execution starts.
|
|
313
|
-
*/
|
|
314
|
-
onInsightChanged?: (data: AdInsightChangedBody) => void;
|
|
315
|
-
/**
|
|
316
|
-
* Called when a `clear` command finishes. `contextId` identifies the command.
|
|
381
|
+
* Called with every event Analytical Designer emits. Check `event.type` to narrow `event.data`.
|
|
317
382
|
*/
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Called when a `clearInsight` command finishes. `contextId` identifies the command.
|
|
321
|
-
*/
|
|
322
|
-
onClearInsightFinished?: (data: IAdAvailableCommands, contextId?: string) => void;
|
|
323
|
-
/**
|
|
324
|
-
* Called when an `undo` command finishes. `contextId` identifies the command.
|
|
325
|
-
*/
|
|
326
|
-
onUndoFinished?: (data: IAdAvailableCommands, contextId?: string) => void;
|
|
327
|
-
/**
|
|
328
|
-
* Called when a `redo` command finishes. `contextId` identifies the command.
|
|
329
|
-
*/
|
|
330
|
-
onRedoFinished?: (data: IAdAvailableCommands, contextId?: string) => void;
|
|
331
|
-
/**
|
|
332
|
-
* Called when an `exportInsight` command finishes, with the link to the exported file.
|
|
333
|
-
* `contextId` identifies the command.
|
|
334
|
-
*/
|
|
335
|
-
onExportFinished?: (data: AdExportFinishedBody, contextId?: string) => void;
|
|
336
|
-
/**
|
|
337
|
-
* Called when the user changes a filter of the insight.
|
|
338
|
-
*/
|
|
339
|
-
onFilterContextChanged?: (data: AdFilterContextChangedBody) => void;
|
|
340
|
-
/**
|
|
341
|
-
* Called when a `setFilterContext` command finishes. `contextId` identifies the command.
|
|
342
|
-
*/
|
|
343
|
-
onSetFilterContextFinished?: (data: IAdAvailableCommands, contextId?: string) => void;
|
|
344
|
-
/**
|
|
345
|
-
* Called when a `removeFilterContext` command finishes. `contextId` identifies the command.
|
|
346
|
-
*/
|
|
347
|
-
onRemoveFilterContextFinished?: (data: IAdAvailableCommands, contextId?: string) => void;
|
|
348
|
-
/**
|
|
349
|
-
* Called when the user saves or deletes a metric. A host that shares a caching backend with
|
|
350
|
-
* Analytical Designer resets its caches here.
|
|
351
|
-
*/
|
|
352
|
-
onMetricsChanged?: () => void;
|
|
353
|
-
/**
|
|
354
|
-
* Called when the user creates, changes or deletes an attribute hierarchy.
|
|
355
|
-
*/
|
|
356
|
-
onAttributeHierarchyModified?: () => void;
|
|
357
|
-
/**
|
|
358
|
-
* Called when a command the host sent fails. `contextId` identifies the command.
|
|
359
|
-
*/
|
|
360
|
-
onCommandFailed?: (data: ICommandFailedBody, contextId?: string) => void;
|
|
383
|
+
onEvent?: (event: AnalyticalDesignerEvent) => void;
|
|
361
384
|
/**
|
|
362
385
|
* Called when Analytical Designer cannot start.
|
|
363
386
|
*/
|
|
364
387
|
onError?: (error: unknown) => void;
|
|
365
|
-
/**
|
|
366
|
-
* Called with every event, before the typed callback.
|
|
367
|
-
*/
|
|
368
|
-
onEvent?: (event: IAnalyticalDesignerEvent) => void;
|
|
369
|
-
/**
|
|
370
|
-
* Handlers called with the events they accept.
|
|
371
|
-
*/
|
|
372
|
-
eventHandlers?: IAnalyticalDesignerEventHandler[];
|
|
373
388
|
/**
|
|
374
389
|
* Receives the commands the host sends to Analytical Designer.
|
|
375
390
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyticalDesignerTypes.d.ts","sourceRoot":"","sources":["../../src/embedding/analyticalDesignerTypes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACH,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACH,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,qBAAqB,EAC1B,KAAK,MAAM,EACd,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"analyticalDesignerTypes.d.ts","sourceRoot":"","sources":["../../src/embedding/analyticalDesignerTypes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACH,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC9B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;GAIG;AACH,MAAM,WAAW,wBAAwB;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;IAErC;;;OAGG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAE7B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAE3C;;OAEG;IACH,MAAM,CAAC,EAAE,yBAAyB,CAAC;IAEnC;;;OAGG;IACH,WAAW,CAAC,EAAE,qBAAqB,CAAC;IAEpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAE1C;;OAEG;IACH,KAAK,CAAC,EAAE,wBAAwB,CAAC;IAEjC;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAEnD;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAEnC;;OAEG;IACH,MAAM,CAAC,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC;CACxC"}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import { type AdCommandData } from "@gooddata/sdk-embedding";
|
|
2
|
+
import { type AnalyticalDesignerEvent } from "./analyticalDesignerTypes.js";
|
|
2
3
|
/** Envelope of an incoming AD command — the exact shape the postMessage transport delivers. */
|
|
3
4
|
export type AdCommandEnvelope = AdCommandData;
|
|
4
|
-
/** One outgoing AD event — exactly what messagingUtils.postEvent would have wrapped. */
|
|
5
|
-
export interface IAdOutgoingEvent<TData = unknown> {
|
|
6
|
-
product: string;
|
|
7
|
-
name: string;
|
|
8
|
-
/** the @gooddata/sdk-embedding contract payload for `name` — opaque to the bridge itself */
|
|
9
|
-
data: TData;
|
|
10
|
-
contextId?: string;
|
|
11
|
-
}
|
|
12
5
|
/**
|
|
13
6
|
* Transport adapter installed by a host that renders AD in-process (as a React component) instead
|
|
14
7
|
* of in an iframe. While installed, every outgoing AD event is delivered to onEvent INSTEAD of
|
|
@@ -17,7 +10,7 @@ export interface IAdOutgoingEvent<TData = unknown> {
|
|
|
17
10
|
* host's own embedded postMessage API).
|
|
18
11
|
*/
|
|
19
12
|
export interface IAdHostAdapter {
|
|
20
|
-
onEvent(event:
|
|
13
|
+
onEvent(event: AnalyticalDesignerEvent): void;
|
|
21
14
|
}
|
|
22
15
|
/**
|
|
23
16
|
* Sentinel origin marking commands injected in-process through the host adapter. Commands with
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hostBridge.d.ts","sourceRoot":"","sources":["../../src/embedding/hostBridge.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,+FAA+F;AAC/F,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAE9C
|
|
1
|
+
{"version":3,"file":"hostBridge.d.ts","sourceRoot":"","sources":["../../src/embedding/hostBridge.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAE5E,+FAA+F;AAC/F,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC3B,OAAO,CAAC,KAAK,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACjD;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,iCAAiC,CAAC;AAIlE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,IAAI,CAOtE;AAED,wBAAgB,cAAc,IAAI,cAAc,GAAG,IAAI,CAEtD"}
|
package/esm/index.d.ts
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
6
|
export { AnalyticalDesigner } from "./embedding/AnalyticalDesigner.js";
|
|
7
|
-
export { type AnalyticalDesignerHiddenAction, type IAnalyticalDesignerApi, type IAnalyticalDesignerCacheReset, type IAnalyticalDesignerConfig, type
|
|
7
|
+
export { type AnalyticalDesignerEvent, type AnalyticalDesignerEventType, type AnalyticalDesignerHiddenAction, type IAnalyticalDesignerApi, type IAnalyticalDesignerCacheReset, type IAnalyticalDesignerConfig, type IAnalyticalDesignerEventDataMap, type IAnalyticalDesignerInsightOpenedData, type IAnalyticalDesignerProps, type IAnalyticalDesignerTelemetryCallbacks, } from "./embedding/analyticalDesignerTypes.js";
|
|
8
8
|
export { type AnalyticalDesignerSlotComponent, type IAnalyticalDesignerErrorProps, type IAnalyticalDesignerLoadingProps, type IAnalyticalDesignerSlots, } from "./embedding/slots.js";
|
|
9
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,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EACH,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACpC,KAAK,oCAAoC,EACzC,KAAK,wBAAwB,EAC7B,KAAK,qCAAqC,GAC7C,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACH,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EAClC,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,GAChC,MAAM,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drill_events.d.ts","sourceRoot":"","sources":["../../../src/postMessageApi/outgoing/drill_events.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"drill_events.d.ts","sourceRoot":"","sources":["../../../src/postMessageApi/outgoing/drill_events.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAOpD,wBAAgB,cAAc,CAAC,UAAU,EAAE,WAAW,GAAG,IAAI,CAS5D"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
// (C) 2020-2026 GoodData Corporation
|
|
2
2
|
import { GdcAdEventType } from "@gooddata/sdk-embedding";
|
|
3
|
+
import { getHostAdapter } from "../../embedding/hostBridge.js";
|
|
3
4
|
import { transformDrillEventToLegacy } from "../../utils/drilling/index.js";
|
|
4
|
-
import {
|
|
5
|
+
import { postHostEvent, postWindowEvent } from "./post_event_helper.js";
|
|
5
6
|
export function drillPerformed(drillEvent) {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
// A host component receives the drill event of @gooddata/sdk-ui; the postMessage contract carries
|
|
8
|
+
// the legacy shape.
|
|
9
|
+
const hostAdapter = getHostAdapter();
|
|
10
|
+
if (hostAdapter) {
|
|
11
|
+
postHostEvent(hostAdapter, GdcAdEventType.Drill, drillEvent);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
postWindowEvent(GdcAdEventType.Drill, transformDrillEventToLegacy(drillEvent));
|
|
8
15
|
}
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { type AnalyticalDesignerEventType, type IAnalyticalDesignerEventDataMap } from "../../embedding/analyticalDesignerTypes.js";
|
|
2
|
+
import { type IAdHostAdapter } from "../../embedding/hostBridge.js";
|
|
3
|
+
/** Delivers an event to the host that renders AD as a React component. */
|
|
4
|
+
export declare function postHostEvent<T extends AnalyticalDesignerEventType>(hostAdapter: IAdHostAdapter, type: T, data: IAnalyticalDesignerEventDataMap[T], contextId?: string): void;
|
|
5
|
+
/** Posts an event as a window message; data is the @gooddata/sdk-embedding contract payload. */
|
|
6
|
+
export declare function postWindowEvent(type: AnalyticalDesignerEventType, data: unknown, contextId?: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Emits an event to the host: to the host component when one is installed, else as a window message.
|
|
9
|
+
* Drill is emitted by drillPerformed: the two transports carry different payloads for it.
|
|
10
|
+
*/
|
|
11
|
+
export declare function adPostEvent<T extends Exclude<AnalyticalDesignerEventType, "drill">>(type: T, data: IAnalyticalDesignerEventDataMap[T], contextId?: string): void;
|
|
2
12
|
//# sourceMappingURL=post_event_helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post_event_helper.d.ts","sourceRoot":"","sources":["../../../src/postMessageApi/outgoing/post_event_helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"post_event_helper.d.ts","sourceRoot":"","sources":["../../../src/postMessageApi/outgoing/post_event_helper.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,EACvC,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,+BAA+B,CAAC;AAOpF,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,CAAC,SAAS,2BAA2B,EAC/D,WAAW,EAAE,cAAc,EAC3B,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,+BAA+B,CAAC,CAAC,CAAC,EACxC,SAAS,CAAC,EAAE,MAAM,GACnB,IAAI,CAKN;AAED,gGAAgG;AAChG,wBAAgB,eAAe,CAAC,IAAI,EAAE,2BAA2B,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAO1G;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,CAAC,2BAA2B,EAAE,OAAO,CAAC,EAC/E,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,+BAA+B,CAAC,CAAC,CAAC,EACxC,SAAS,CAAC,EAAE,MAAM,GACnB,IAAI,CAON"}
|
|
@@ -3,20 +3,29 @@ import { GdcProductName } from "@gooddata/sdk-embedding";
|
|
|
3
3
|
import { messagingUtils } from "@gooddata/sdk-embedding/internal";
|
|
4
4
|
import { getHostAdapter } from "../../embedding/hostBridge.js";
|
|
5
5
|
import { DEFAULT_POST_MESSAGE_CONTEXT_ID } from "../actions/post_message_action_helper.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const resetDefaultContextId = (contextId) => {
|
|
7
|
+
return contextId && contextId === DEFAULT_POST_MESSAGE_CONTEXT_ID ? undefined : contextId;
|
|
8
|
+
};
|
|
9
|
+
/** Delivers an event to the host that renders AD as a React component. */
|
|
10
|
+
export function postHostEvent(hostAdapter, type, data, contextId) {
|
|
11
|
+
const event = { type, data, contextId: resetDefaultContextId(contextId) };
|
|
12
|
+
// every AnalyticalDesignerEvent<T> is an AnalyticalDesignerEvent; TypeScript cannot widen a
|
|
13
|
+
// generic mapped union (TS#30581)
|
|
14
|
+
hostAdapter.onEvent(event);
|
|
15
|
+
}
|
|
16
|
+
/** Posts an event as a window message; data is the @gooddata/sdk-embedding contract payload. */
|
|
17
|
+
export function postWindowEvent(type, data, contextId) {
|
|
18
|
+
messagingUtils.postEvent(GdcProductName.ANALYTICAL_DESIGNER, type, data, resetDefaultContextId(contextId));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Emits an event to the host: to the host component when one is installed, else as a window message.
|
|
22
|
+
* Drill is emitted by drillPerformed: the two transports carry different payloads for it.
|
|
23
|
+
*/
|
|
24
|
+
export function adPostEvent(type, data, contextId) {
|
|
11
25
|
const hostAdapter = getHostAdapter();
|
|
12
26
|
if (hostAdapter) {
|
|
13
|
-
hostAdapter
|
|
14
|
-
product: GdcProductName.ANALYTICAL_DESIGNER,
|
|
15
|
-
name,
|
|
16
|
-
data,
|
|
17
|
-
contextId: resetDefaultContextId(contextId),
|
|
18
|
-
});
|
|
27
|
+
postHostEvent(hostAdapter, type, data, contextId);
|
|
19
28
|
return;
|
|
20
29
|
}
|
|
21
|
-
|
|
22
|
-
}
|
|
30
|
+
postWindowEvent(type, data, contextId);
|
|
31
|
+
}
|