@thoughtspot/visual-embed-sdk 1.42.0 → 1.42.1-HE2
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/cjs/package.json +2 -2
- package/cjs/src/embed/app.d.ts +20 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +7 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +52 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +3 -3
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +6 -6
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +4 -1
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +22 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +14 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +63 -23
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +83 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/types.d.ts +119 -61
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +103 -60
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/processTrigger.d.ts +2 -1
- package/cjs/src/utils/processTrigger.d.ts.map +1 -1
- package/cjs/src/utils/processTrigger.js +4 -2
- package/cjs/src/utils/processTrigger.js.map +1 -1
- package/dist/{index-BpSohedu.js → index-CWQnMX2L.js} +1 -1
- package/dist/index-Djtv-y7A.js +7371 -0
- package/dist/src/embed/app.d.ts +20 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +3 -3
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +14 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/types.d.ts +119 -61
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/processTrigger.d.ts +2 -1
- package/dist/src/utils/processTrigger.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +191 -96
- package/dist/tsembed-react.js +190 -95
- package/dist/tsembed.es.js +191 -96
- package/dist/tsembed.js +190 -95
- package/dist/visual-embed-sdk-react-full.d.ts +153 -64
- package/dist/visual-embed-sdk-react.d.ts +153 -64
- package/dist/visual-embed-sdk.d.ts +153 -64
- package/lib/package.json +2 -2
- package/lib/src/embed/app.d.ts +20 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +7 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +52 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +3 -3
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +6 -6
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +4 -1
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +22 -0
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +14 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +63 -23
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +83 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/types.d.ts +119 -61
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +103 -60
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processTrigger.d.ts +2 -1
- package/lib/src/utils/processTrigger.d.ts.map +1 -1
- package/lib/src/utils/processTrigger.js +4 -2
- package/lib/src/utils/processTrigger.js.map +1 -1
- package/package.json +2 -2
- package/src/embed/app.spec.ts +73 -0
- package/src/embed/app.ts +30 -0
- package/src/embed/hostEventClient/host-event-client.ts +7 -3
- package/src/embed/liveboard.spec.ts +30 -0
- package/src/embed/liveboard.ts +5 -0
- package/src/embed/ts-embed.spec.ts +111 -0
- package/src/embed/ts-embed.ts +76 -25
- package/src/errors.ts +1 -0
- package/src/types.ts +119 -61
- package/src/utils/processTrigger.ts +5 -2
|
@@ -11,6 +11,7 @@ export declare const TRIGGER_TIMEOUT = 30000;
|
|
|
11
11
|
* @param messageType
|
|
12
12
|
* @param thoughtSpotHost
|
|
13
13
|
* @param data
|
|
14
|
+
* @param context
|
|
14
15
|
*/
|
|
15
|
-
export declare function processTrigger(iFrame: HTMLIFrameElement, messageType: HostEvent, thoughtSpotHost: string, data: any): Promise<any>;
|
|
16
|
+
export declare function processTrigger(iFrame: HTMLIFrameElement, messageType: HostEvent, thoughtSpotHost: string, data: any, context?: any): Promise<any>;
|
|
16
17
|
//# sourceMappingURL=processTrigger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processTrigger.d.ts","sourceRoot":"","sources":["processTrigger.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAkB,MAAM,UAAU,CAAC;AAKrD;;;GAGG;AACH,eAAO,MAAM,MAAM,WAAY,iBAAiB,SAM/C,CAAC;
|
|
1
|
+
{"version":3,"file":"processTrigger.d.ts","sourceRoot":"","sources":["processTrigger.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAkB,MAAM,UAAU,CAAC;AAKrD;;;GAGG;AACH,eAAO,MAAM,MAAM,WAAY,iBAAiB,SAM/C,CAAC;AAqBF,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC1B,MAAM,EAAE,iBAAiB,EACzB,WAAW,EAAE,SAAS,EACtB,eAAe,EAAE,MAAM,EACvB,IAAI,EAAE,GAAG,EACT,OAAO,CAAC,EAAE,GAAG,GACd,OAAO,CAAC,GAAG,CAAC,CAqCd"}
|
package/dist/tsembed-react.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.42.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.1-HE2 */
|
|
2
2
|
'use client';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef, useCallback } from 'react';
|
|
@@ -614,7 +614,7 @@ var EmbedEvent;
|
|
|
614
614
|
*/
|
|
615
615
|
EmbedEvent["Load"] = "load";
|
|
616
616
|
/**
|
|
617
|
-
* Data pertaining to an Answer or
|
|
617
|
+
* Data pertaining to an Answer, Liveboard or Spotter visualization is received.
|
|
618
618
|
* The event payload includes the raw data of the object.
|
|
619
619
|
* @return data - Answer of Liveboard data
|
|
620
620
|
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
@@ -1985,7 +1985,7 @@ var HostEvent;
|
|
|
1985
1985
|
* the following parameters:
|
|
1986
1986
|
*
|
|
1987
1987
|
* @param
|
|
1988
|
-
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
1988
|
+
* `vizId`- GUID of the saved Answer or Spotter visualization ID to pin to a Liveboard.
|
|
1989
1989
|
* Optional when pinning a new chart or table generated from a Search query.
|
|
1990
1990
|
* **Required** in Spotter Embed.
|
|
1991
1991
|
* @param
|
|
@@ -2037,10 +2037,16 @@ var HostEvent;
|
|
|
2037
2037
|
* ```
|
|
2038
2038
|
* @example
|
|
2039
2039
|
* ```js
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2040
|
+
|
|
2041
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
|
|
2042
|
+
* let latestSpotterVizId = '';
|
|
2043
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2044
|
+
* latestSpotterVizId = payload.data.id;
|
|
2045
|
+
* });
|
|
2046
|
+
*
|
|
2047
|
+
* spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
|
|
2048
|
+
* ```
|
|
2049
|
+
*
|
|
2044
2050
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2045
2051
|
*/
|
|
2046
2052
|
HostEvent["Pin"] = "pin";
|
|
@@ -2115,10 +2121,15 @@ var HostEvent;
|
|
|
2115
2121
|
* ```
|
|
2116
2122
|
* @example
|
|
2117
2123
|
* ```js
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2124
|
+
|
|
2125
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPdf host event.
|
|
2126
|
+
* let latestSpotterVizId = '';
|
|
2127
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2128
|
+
* latestSpotterVizId = payload.data.id;
|
|
2129
|
+
* });
|
|
2130
|
+
*
|
|
2131
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
|
|
2132
|
+
* ```
|
|
2122
2133
|
*
|
|
2123
2134
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2124
2135
|
*/
|
|
@@ -2145,10 +2156,14 @@ var HostEvent;
|
|
|
2145
2156
|
* ```
|
|
2146
2157
|
* @example
|
|
2147
2158
|
* ```js
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2159
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event.
|
|
2160
|
+
* let latestSpotterVizId = '';
|
|
2161
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2162
|
+
* latestSpotterVizId = payload.data.id;
|
|
2163
|
+
* });
|
|
2164
|
+
*
|
|
2165
|
+
* spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
|
|
2166
|
+
* ```
|
|
2152
2167
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2153
2168
|
*/
|
|
2154
2169
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2233,15 +2248,7 @@ var HostEvent;
|
|
|
2233
2248
|
* ```
|
|
2234
2249
|
* @example
|
|
2235
2250
|
* ```js
|
|
2236
|
-
*
|
|
2237
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2238
|
-
* });
|
|
2239
|
-
* ```
|
|
2240
|
-
* @example
|
|
2241
|
-
* ```js
|
|
2242
|
-
* const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2243
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2244
|
-
* });
|
|
2251
|
+
* spotterEmbed.trigger(HostEvent.Edit);
|
|
2245
2252
|
* ```
|
|
2246
2253
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2247
2254
|
*/
|
|
@@ -2290,16 +2297,23 @@ var HostEvent;
|
|
|
2290
2297
|
* );
|
|
2291
2298
|
* })
|
|
2292
2299
|
* ```
|
|
2293
|
-
* @example
|
|
2300
|
+
* * @example
|
|
2294
2301
|
* ```js
|
|
2295
|
-
|
|
2296
|
-
|
|
2302
|
+
|
|
2303
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
|
|
2304
|
+
* let latestSpotterVizId = '';
|
|
2305
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2306
|
+
* latestSpotterVizId = payload.data.id;
|
|
2307
|
+
* });
|
|
2308
|
+
*
|
|
2309
|
+
* spotterEmbed.trigger(HostEvent.GetTML, {
|
|
2310
|
+
* vizId: latestSpotterVizId
|
|
2297
2311
|
* }).then((tml) => {
|
|
2298
2312
|
* console.log(
|
|
2299
2313
|
* tml.answer.search_query // TML representation of the search query
|
|
2300
2314
|
* );
|
|
2301
2315
|
* })
|
|
2302
|
-
|
|
2316
|
+
* ```
|
|
2303
2317
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2304
2318
|
* @important
|
|
2305
2319
|
*/
|
|
@@ -2363,7 +2377,7 @@ var HostEvent;
|
|
|
2363
2377
|
/**
|
|
2364
2378
|
* Trigger the **Download** action on charts in
|
|
2365
2379
|
* the embedded view.
|
|
2366
|
-
* @param - `vizId` refers to the
|
|
2380
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2367
2381
|
* @example
|
|
2368
2382
|
* ```js
|
|
2369
2383
|
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
@@ -2373,10 +2387,14 @@ var HostEvent;
|
|
|
2373
2387
|
* embed.trigger(HostEvent.Download)
|
|
2374
2388
|
* ```
|
|
2375
2389
|
* ```js
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2390
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event.
|
|
2391
|
+
* let latestSpotterVizId = '';
|
|
2392
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2393
|
+
* latestSpotterVizId = payload.data.id;
|
|
2394
|
+
* });
|
|
2395
|
+
*
|
|
2396
|
+
* spotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId });
|
|
2397
|
+
* ```
|
|
2380
2398
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
2381
2399
|
* Use {@link DownloadAsPng}
|
|
2382
2400
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
@@ -2394,9 +2412,13 @@ var HostEvent;
|
|
|
2394
2412
|
*
|
|
2395
2413
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2396
2414
|
*
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2415
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event.
|
|
2416
|
+
* let latestSpotterVizId = '';
|
|
2417
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2418
|
+
* latestSpotterVizId = payload.data.id;
|
|
2419
|
+
* });
|
|
2420
|
+
*
|
|
2421
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
|
|
2400
2422
|
* ```
|
|
2401
2423
|
*
|
|
2402
2424
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
@@ -2405,7 +2427,7 @@ var HostEvent;
|
|
|
2405
2427
|
/**
|
|
2406
2428
|
* Trigger the **Download** > **CSV** action on tables in
|
|
2407
2429
|
* the embedded view.
|
|
2408
|
-
* @param - `vizId` refers to the
|
|
2430
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2409
2431
|
* @example
|
|
2410
2432
|
* ```js
|
|
2411
2433
|
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
@@ -2418,9 +2440,13 @@ var HostEvent;
|
|
|
2418
2440
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2419
2441
|
* ```
|
|
2420
2442
|
* ```js
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2443
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event.
|
|
2444
|
+
* let latestSpotterVizId = '';
|
|
2445
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2446
|
+
* latestSpotterVizId = payload.data.id;
|
|
2447
|
+
* });
|
|
2448
|
+
*
|
|
2449
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
|
|
2424
2450
|
* ```
|
|
2425
2451
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2426
2452
|
*/
|
|
@@ -2428,7 +2454,7 @@ var HostEvent;
|
|
|
2428
2454
|
/**
|
|
2429
2455
|
* Trigger the **Download** > **XLSX** action on tables
|
|
2430
2456
|
* in the embedded view.
|
|
2431
|
-
* @param - `vizId` refers to the
|
|
2457
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2432
2458
|
* @example
|
|
2433
2459
|
* ```js
|
|
2434
2460
|
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
@@ -2441,9 +2467,13 @@ var HostEvent;
|
|
|
2441
2467
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2442
2468
|
* ```
|
|
2443
2469
|
* ```js
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2470
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event.
|
|
2471
|
+
* let latestSpotterVizId = '';
|
|
2472
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2473
|
+
* latestSpotterVizId = payload.data.id;
|
|
2474
|
+
* });
|
|
2475
|
+
*
|
|
2476
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
|
|
2447
2477
|
* ```
|
|
2448
2478
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2449
2479
|
*/
|
|
@@ -2480,7 +2510,7 @@ var HostEvent;
|
|
|
2480
2510
|
* ```
|
|
2481
2511
|
*
|
|
2482
2512
|
* ```js
|
|
2483
|
-
* // Save
|
|
2513
|
+
* // Save a Visualization in Spotter (requires vizId)
|
|
2484
2514
|
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2485
2515
|
* vizId: "730496d6-6903-4601-937e-2c691821af3c"
|
|
2486
2516
|
* })
|
|
@@ -2802,11 +2832,13 @@ var HostEvent;
|
|
|
2802
2832
|
* });
|
|
2803
2833
|
*```
|
|
2804
2834
|
*```js
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2835
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event.
|
|
2836
|
+
* let latestSpotterVizId = '';
|
|
2837
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2838
|
+
* latestSpotterVizId = payload.data.id;
|
|
2839
|
+
* });
|
|
2840
|
+
*
|
|
2841
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
|
|
2810
2842
|
*```
|
|
2811
2843
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2812
2844
|
*/
|
|
@@ -2849,11 +2881,13 @@ var HostEvent;
|
|
|
2849
2881
|
* ```
|
|
2850
2882
|
* @example
|
|
2851
2883
|
* ```js
|
|
2852
|
-
*
|
|
2853
|
-
*
|
|
2854
|
-
*
|
|
2855
|
-
*
|
|
2884
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in SaveAnswer host event.
|
|
2885
|
+
* let latestSpotterVizId = '';
|
|
2886
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2887
|
+
* latestSpotterVizId = payload.data.id;
|
|
2856
2888
|
* });
|
|
2889
|
+
*
|
|
2890
|
+
* spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
|
|
2857
2891
|
* ```
|
|
2858
2892
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
2859
2893
|
*/
|
|
@@ -2937,12 +2971,15 @@ var HostEvent;
|
|
|
2937
2971
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
2938
2972
|
/**
|
|
2939
2973
|
* Toggle the visualization to chart or table view.
|
|
2940
|
-
* @param - `vizId ` refers to the
|
|
2974
|
+
* @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
|
|
2941
2975
|
* @example
|
|
2942
2976
|
* ```js
|
|
2943
|
-
*
|
|
2944
|
-
*
|
|
2977
|
+
* let latestSpotterVizId = '';
|
|
2978
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2979
|
+
* latestSpotterVizId = payload.data.id;
|
|
2945
2980
|
* });
|
|
2981
|
+
*
|
|
2982
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
|
|
2946
2983
|
*```
|
|
2947
2984
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2948
2985
|
*/
|
|
@@ -2971,12 +3008,16 @@ var HostEvent;
|
|
|
2971
3008
|
*/
|
|
2972
3009
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
2973
3010
|
/**
|
|
2974
|
-
* Trigger the *
|
|
2975
|
-
* @param - `vizId` refers to the
|
|
3011
|
+
* Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
|
|
3012
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
|
|
2976
3013
|
* @example
|
|
2977
3014
|
* ```js
|
|
2978
|
-
*
|
|
2979
|
-
* {
|
|
3015
|
+
* let latestSpotterVizId = '';
|
|
3016
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3017
|
+
* latestSpotterVizId = payload.data.id;
|
|
3018
|
+
* });
|
|
3019
|
+
*
|
|
3020
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });
|
|
2980
3021
|
* ```
|
|
2981
3022
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2982
3023
|
*/
|
|
@@ -3034,6 +3075,7 @@ var Param;
|
|
|
3034
3075
|
Param["HideResult"] = "hideResult";
|
|
3035
3076
|
Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
|
|
3036
3077
|
Param["Tag"] = "tag";
|
|
3078
|
+
Param["HideTagFilterChips"] = "hideTagFilterChips";
|
|
3037
3079
|
Param["AutoLogin"] = "autoLogin";
|
|
3038
3080
|
Param["searchTokenString"] = "searchTokenString";
|
|
3039
3081
|
Param["executeSearch"] = "executeSearch";
|
|
@@ -3138,6 +3180,7 @@ var Param;
|
|
|
3138
3180
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3139
3181
|
Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3140
3182
|
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
3183
|
+
Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
|
|
3141
3184
|
})(Param || (Param = {}));
|
|
3142
3185
|
/**
|
|
3143
3186
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -7347,6 +7390,7 @@ const ERROR_MESSAGE = {
|
|
|
7347
7390
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
7348
7391
|
RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
|
|
7349
7392
|
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
7393
|
+
OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
|
|
7350
7394
|
};
|
|
7351
7395
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
7352
7396
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -8256,7 +8300,7 @@ class AnswerService {
|
|
|
8256
8300
|
async getTML() {
|
|
8257
8301
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8258
8302
|
const edoc = object[0].edoc;
|
|
8259
|
-
const YAML = await import('./index-
|
|
8303
|
+
const YAML = await import('./index-Djtv-y7A.js');
|
|
8260
8304
|
const parsedDoc = YAML.parse(edoc);
|
|
8261
8305
|
return {
|
|
8262
8306
|
answer: {
|
|
@@ -17429,7 +17473,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
17429
17473
|
return e;
|
|
17430
17474
|
}
|
|
17431
17475
|
|
|
17432
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.
|
|
17476
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-HE2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
17433
17477
|
|
|
17434
17478
|
/**
|
|
17435
17479
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17448,6 +17492,7 @@ const reload = (iFrame) => {
|
|
|
17448
17492
|
* @param message
|
|
17449
17493
|
* @param message.type
|
|
17450
17494
|
* @param message.data
|
|
17495
|
+
* @param message.context
|
|
17451
17496
|
* @param thoughtSpotHost
|
|
17452
17497
|
* @param channel
|
|
17453
17498
|
*/
|
|
@@ -17462,8 +17507,9 @@ const TRIGGER_TIMEOUT = 30000;
|
|
|
17462
17507
|
* @param messageType
|
|
17463
17508
|
* @param thoughtSpotHost
|
|
17464
17509
|
* @param data
|
|
17510
|
+
* @param context
|
|
17465
17511
|
*/
|
|
17466
|
-
function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
17512
|
+
function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
|
|
17467
17513
|
return new Promise((res, rej) => {
|
|
17468
17514
|
var _a;
|
|
17469
17515
|
if (messageType === HostEvent.Reload) {
|
|
@@ -17497,7 +17543,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
17497
17543
|
channel.port1.close();
|
|
17498
17544
|
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
17499
17545
|
}, TRIGGER_TIMEOUT);
|
|
17500
|
-
return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
|
|
17546
|
+
return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
|
|
17501
17547
|
});
|
|
17502
17548
|
}
|
|
17503
17549
|
|
|
@@ -17521,12 +17567,12 @@ class HostEventClient {
|
|
|
17521
17567
|
* @param {any} data Data to send with the host event
|
|
17522
17568
|
* @returns {Promise<any>} - the response from the process trigger
|
|
17523
17569
|
*/
|
|
17524
|
-
async processTrigger(message, data) {
|
|
17570
|
+
async processTrigger(message, data, context) {
|
|
17525
17571
|
if (!this.iFrame) {
|
|
17526
17572
|
throw new Error('Iframe element is not set');
|
|
17527
17573
|
}
|
|
17528
17574
|
const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
|
|
17529
|
-
return processTrigger(this.iFrame, message, thoughtspotHost, data);
|
|
17575
|
+
return processTrigger(this.iFrame, message, thoughtspotHost, data, context);
|
|
17530
17576
|
}
|
|
17531
17577
|
async handleHostEventWithParam(apiName, parameters) {
|
|
17532
17578
|
var _a, _b, _c, _d;
|
|
@@ -17545,8 +17591,8 @@ class HostEventClient {
|
|
|
17545
17591
|
}
|
|
17546
17592
|
return { ...response.value };
|
|
17547
17593
|
}
|
|
17548
|
-
async hostEventFallback(hostEvent, data) {
|
|
17549
|
-
return this.processTrigger(hostEvent, data);
|
|
17594
|
+
async hostEventFallback(hostEvent, data, context) {
|
|
17595
|
+
return this.processTrigger(hostEvent, data, context);
|
|
17550
17596
|
}
|
|
17551
17597
|
/**
|
|
17552
17598
|
* Setter for the iframe element used for host events
|
|
@@ -17590,14 +17636,14 @@ class HostEventClient {
|
|
|
17590
17636
|
answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
|
|
17591
17637
|
};
|
|
17592
17638
|
}
|
|
17593
|
-
async triggerHostEvent(hostEvent, payload) {
|
|
17639
|
+
async triggerHostEvent(hostEvent, payload, context) {
|
|
17594
17640
|
switch (hostEvent) {
|
|
17595
17641
|
case HostEvent.Pin:
|
|
17596
17642
|
return this.handlePinEvent(payload);
|
|
17597
17643
|
case HostEvent.SaveAnswer:
|
|
17598
17644
|
return this.handleSaveAnswerEvent(payload);
|
|
17599
17645
|
default:
|
|
17600
|
-
return this.hostEventFallback(hostEvent, payload);
|
|
17646
|
+
return this.hostEventFallback(hostEvent, payload, context);
|
|
17601
17647
|
}
|
|
17602
17648
|
}
|
|
17603
17649
|
}
|
|
@@ -17899,39 +17945,69 @@ class TsEmbed {
|
|
|
17899
17945
|
return eventData;
|
|
17900
17946
|
}
|
|
17901
17947
|
/**
|
|
17902
|
-
*
|
|
17903
|
-
*
|
|
17904
|
-
* embed instance through an identifier contained in the payload,
|
|
17905
|
-
* and executes the registered callbacks accordingly.
|
|
17948
|
+
* Subscribe to network events (online/offline) that should
|
|
17949
|
+
* work regardless of auth status
|
|
17906
17950
|
*/
|
|
17907
|
-
|
|
17908
|
-
this.
|
|
17909
|
-
const messageEventListener = (event) => {
|
|
17910
|
-
const eventType = this.getEventType(event);
|
|
17911
|
-
const eventPort = this.getEventPort(event);
|
|
17912
|
-
const eventData = this.formatEventData(event, eventType);
|
|
17913
|
-
if (event.source === this.iFrame.contentWindow) {
|
|
17914
|
-
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
17915
|
-
}
|
|
17916
|
-
};
|
|
17917
|
-
window.addEventListener('message', messageEventListener);
|
|
17951
|
+
subscribeToNetworkEvents() {
|
|
17952
|
+
this.unsubscribeToNetworkEvents();
|
|
17918
17953
|
const onlineEventListener = (e) => {
|
|
17919
17954
|
this.trigger(HostEvent.Reload);
|
|
17920
17955
|
};
|
|
17921
17956
|
window.addEventListener('online', onlineEventListener);
|
|
17922
17957
|
const offlineEventListener = (e) => {
|
|
17923
|
-
const offlineWarning =
|
|
17958
|
+
const offlineWarning = ERROR_MESSAGE.OFFLINE_WARNING;
|
|
17924
17959
|
this.executeCallbacks(EmbedEvent.Error, {
|
|
17925
17960
|
offlineWarning,
|
|
17926
17961
|
});
|
|
17927
17962
|
logger$3.warn(offlineWarning);
|
|
17928
17963
|
};
|
|
17929
17964
|
window.addEventListener('offline', offlineEventListener);
|
|
17930
|
-
this.subscribedListeners =
|
|
17931
|
-
|
|
17932
|
-
|
|
17933
|
-
|
|
17965
|
+
this.subscribedListeners.online = onlineEventListener;
|
|
17966
|
+
this.subscribedListeners.offline = offlineEventListener;
|
|
17967
|
+
}
|
|
17968
|
+
/**
|
|
17969
|
+
* Subscribe to message events that depend on successful iframe setup
|
|
17970
|
+
*/
|
|
17971
|
+
subscribeToMessageEvents() {
|
|
17972
|
+
this.unsubscribeToMessageEvents();
|
|
17973
|
+
const messageEventListener = (event) => {
|
|
17974
|
+
const eventType = this.getEventType(event);
|
|
17975
|
+
const eventPort = this.getEventPort(event);
|
|
17976
|
+
const eventData = this.formatEventData(event, eventType);
|
|
17977
|
+
if (event.source === this.iFrame.contentWindow) {
|
|
17978
|
+
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
17979
|
+
}
|
|
17934
17980
|
};
|
|
17981
|
+
window.addEventListener('message', messageEventListener);
|
|
17982
|
+
this.subscribedListeners.message = messageEventListener;
|
|
17983
|
+
}
|
|
17984
|
+
/**
|
|
17985
|
+
* Adds event listeners for both network and message events.
|
|
17986
|
+
* This maintains backward compatibility with the existing method.
|
|
17987
|
+
* Adds a global event listener to window for "message" events.
|
|
17988
|
+
* ThoughtSpot detects if a particular event is targeted to this
|
|
17989
|
+
* embed instance through an identifier contained in the payload,
|
|
17990
|
+
* and executes the registered callbacks accordingly.
|
|
17991
|
+
*/
|
|
17992
|
+
subscribeToEvents() {
|
|
17993
|
+
this.subscribeToNetworkEvents();
|
|
17994
|
+
this.subscribeToMessageEvents();
|
|
17995
|
+
}
|
|
17996
|
+
unsubscribeToNetworkEvents() {
|
|
17997
|
+
if (this.subscribedListeners.online) {
|
|
17998
|
+
window.removeEventListener('online', this.subscribedListeners.online);
|
|
17999
|
+
delete this.subscribedListeners.online;
|
|
18000
|
+
}
|
|
18001
|
+
if (this.subscribedListeners.offline) {
|
|
18002
|
+
window.removeEventListener('offline', this.subscribedListeners.offline);
|
|
18003
|
+
delete this.subscribedListeners.offline;
|
|
18004
|
+
}
|
|
18005
|
+
}
|
|
18006
|
+
unsubscribeToMessageEvents() {
|
|
18007
|
+
if (this.subscribedListeners.message) {
|
|
18008
|
+
window.removeEventListener('message', this.subscribedListeners.message);
|
|
18009
|
+
delete this.subscribedListeners.message;
|
|
18010
|
+
}
|
|
17935
18011
|
}
|
|
17936
18012
|
unsubscribeToEvents() {
|
|
17937
18013
|
Object.keys(this.subscribedListeners).forEach((key) => {
|
|
@@ -18232,6 +18308,8 @@ class TsEmbed {
|
|
|
18232
18308
|
type: EmbedEvent.Init,
|
|
18233
18309
|
});
|
|
18234
18310
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_START);
|
|
18311
|
+
// Always subscribe to network events, regardless of auth status
|
|
18312
|
+
this.subscribeToNetworkEvents();
|
|
18235
18313
|
return (_a = getAuthPromise()) === null || _a === void 0 ? void 0 : _a.then((isLoggedIn) => {
|
|
18236
18314
|
if (!isLoggedIn) {
|
|
18237
18315
|
this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
|
|
@@ -18274,7 +18352,9 @@ class TsEmbed {
|
|
|
18274
18352
|
el.remove();
|
|
18275
18353
|
});
|
|
18276
18354
|
}
|
|
18277
|
-
|
|
18355
|
+
// Subscribe to message events only after successful
|
|
18356
|
+
// auth and iframe setup
|
|
18357
|
+
this.subscribeToMessageEvents();
|
|
18278
18358
|
}).catch((error) => {
|
|
18279
18359
|
nextInQueue();
|
|
18280
18360
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_FAILED, {
|
|
@@ -18584,7 +18664,7 @@ class TsEmbed {
|
|
|
18584
18664
|
* @param {any} data The payload to send with the message
|
|
18585
18665
|
* @returns A promise that resolves with the response from the embedded app
|
|
18586
18666
|
*/
|
|
18587
|
-
async trigger(messageType, data = {}) {
|
|
18667
|
+
async trigger(messageType, data = {}, context = {}) {
|
|
18588
18668
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
18589
18669
|
if (!this.isRendered) {
|
|
18590
18670
|
this.handleError('Please call render before triggering events');
|
|
@@ -18594,8 +18674,14 @@ class TsEmbed {
|
|
|
18594
18674
|
this.handleError('Host event type is undefined');
|
|
18595
18675
|
return null;
|
|
18596
18676
|
}
|
|
18677
|
+
// Check if iframe exists before triggering -
|
|
18678
|
+
// this prevents the error when auth fails
|
|
18679
|
+
if (!this.iFrame) {
|
|
18680
|
+
logger$3.debug(`Cannot trigger ${messageType} - iframe not available (likely due to auth failure)`);
|
|
18681
|
+
return null;
|
|
18682
|
+
}
|
|
18597
18683
|
// send an empty object, this is needed for liveboard default handlers
|
|
18598
|
-
return this.hostEventClient.triggerHostEvent(messageType, data);
|
|
18684
|
+
return this.hostEventClient.triggerHostEvent(messageType, data, context);
|
|
18599
18685
|
}
|
|
18600
18686
|
/**
|
|
18601
18687
|
* Triggers an event to the embedded app, skipping the UI flow.
|
|
@@ -19448,7 +19534,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
19448
19534
|
* embedded Liveboard or visualization.
|
|
19449
19535
|
*/
|
|
19450
19536
|
getEmbedParams() {
|
|
19451
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, } = this.viewConfig;
|
|
19537
|
+
const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
|
|
19452
19538
|
let params = {};
|
|
19453
19539
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19454
19540
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19516,6 +19602,12 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
19516
19602
|
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19517
19603
|
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19518
19604
|
}
|
|
19605
|
+
if (hideTagFilterChips !== undefined) {
|
|
19606
|
+
params[Param.HideTagFilterChips] = hideTagFilterChips;
|
|
19607
|
+
}
|
|
19608
|
+
if (isLinkParametersEnabled !== undefined) {
|
|
19609
|
+
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
19610
|
+
}
|
|
19519
19611
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19520
19612
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
19521
19613
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -19870,7 +19962,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
19870
19962
|
getEmbedParamsObject() {
|
|
19871
19963
|
let params = {};
|
|
19872
19964
|
params = this.getBaseQueryParams(params);
|
|
19873
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, } = this.viewConfig;
|
|
19965
|
+
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isLinkParametersEnabled, } = this.viewConfig;
|
|
19874
19966
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
19875
19967
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
19876
19968
|
if (fullHeight === true) {
|
|
@@ -19935,6 +20027,9 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
19935
20027
|
if (showSpotterLimitations !== undefined) {
|
|
19936
20028
|
params[Param.ShowSpotterLimitations] = showSpotterLimitations;
|
|
19937
20029
|
}
|
|
20030
|
+
if (isLinkParametersEnabled !== undefined) {
|
|
20031
|
+
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
20032
|
+
}
|
|
19938
20033
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19939
20034
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
19940
20035
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|