@thoughtspot/visual-embed-sdk 1.42.0 → 1.42.1-HE2.0
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/contracts.d.ts +9 -2
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +9 -1
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +5 -5
- 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 +2 -2
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +6 -3
- 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 +15 -2
- 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 +3 -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/index-UY-4yjBN.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/contracts.d.ts +9 -2
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +5 -5
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +2 -2
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +15 -2
- 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 +3 -1
- package/dist/src/utils/processTrigger.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +202 -99
- package/dist/tsembed-react.js +201 -98
- package/dist/tsembed.es.js +202 -99
- package/dist/tsembed.js +201 -98
- package/dist/visual-embed-sdk-react-full.d.ts +164 -68
- package/dist/visual-embed-sdk-react.d.ts +164 -68
- package/dist/visual-embed-sdk.d.ts +164 -68
- 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/contracts.d.ts +9 -2
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +8 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +5 -5
- 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 +2 -2
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +6 -3
- 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 +15 -2
- 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 +3 -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/contracts.ts +11 -3
- package/src/embed/hostEventClient/host-event-client.ts +10 -5
- package/src/embed/liveboard.spec.ts +30 -0
- package/src/embed/liveboard.ts +10 -4
- package/src/embed/ts-embed.spec.ts +111 -0
- package/src/embed/ts-embed.ts +79 -27
- package/src/errors.ts +1 -0
- package/src/types.ts +119 -61
- package/src/utils/processTrigger.ts +6 -2
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.42.0 */
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.1-HE2.0 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -636,7 +636,7 @@
|
|
|
636
636
|
*/
|
|
637
637
|
EmbedEvent["Load"] = "load";
|
|
638
638
|
/**
|
|
639
|
-
* Data pertaining to an Answer or
|
|
639
|
+
* Data pertaining to an Answer, Liveboard or Spotter visualization is received.
|
|
640
640
|
* The event payload includes the raw data of the object.
|
|
641
641
|
* @return data - Answer of Liveboard data
|
|
642
642
|
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
@@ -2007,7 +2007,7 @@
|
|
|
2007
2007
|
* the following parameters:
|
|
2008
2008
|
*
|
|
2009
2009
|
* @param
|
|
2010
|
-
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
2010
|
+
* `vizId`- GUID of the saved Answer or Spotter visualization ID to pin to a Liveboard.
|
|
2011
2011
|
* Optional when pinning a new chart or table generated from a Search query.
|
|
2012
2012
|
* **Required** in Spotter Embed.
|
|
2013
2013
|
* @param
|
|
@@ -2059,10 +2059,16 @@
|
|
|
2059
2059
|
* ```
|
|
2060
2060
|
* @example
|
|
2061
2061
|
* ```js
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2062
|
+
|
|
2063
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
|
|
2064
|
+
* let latestSpotterVizId = '';
|
|
2065
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2066
|
+
* latestSpotterVizId = payload.data.id;
|
|
2067
|
+
* });
|
|
2068
|
+
*
|
|
2069
|
+
* spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
|
|
2070
|
+
* ```
|
|
2071
|
+
*
|
|
2066
2072
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2067
2073
|
*/
|
|
2068
2074
|
HostEvent["Pin"] = "pin";
|
|
@@ -2137,10 +2143,15 @@
|
|
|
2137
2143
|
* ```
|
|
2138
2144
|
* @example
|
|
2139
2145
|
* ```js
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2146
|
+
|
|
2147
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPdf host event.
|
|
2148
|
+
* let latestSpotterVizId = '';
|
|
2149
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2150
|
+
* latestSpotterVizId = payload.data.id;
|
|
2151
|
+
* });
|
|
2152
|
+
*
|
|
2153
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
|
|
2154
|
+
* ```
|
|
2144
2155
|
*
|
|
2145
2156
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2146
2157
|
*/
|
|
@@ -2167,10 +2178,14 @@
|
|
|
2167
2178
|
* ```
|
|
2168
2179
|
* @example
|
|
2169
2180
|
* ```js
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2181
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event.
|
|
2182
|
+
* let latestSpotterVizId = '';
|
|
2183
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2184
|
+
* latestSpotterVizId = payload.data.id;
|
|
2185
|
+
* });
|
|
2186
|
+
*
|
|
2187
|
+
* spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
|
|
2188
|
+
* ```
|
|
2174
2189
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2175
2190
|
*/
|
|
2176
2191
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2255,15 +2270,7 @@
|
|
|
2255
2270
|
* ```
|
|
2256
2271
|
* @example
|
|
2257
2272
|
* ```js
|
|
2258
|
-
*
|
|
2259
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2260
|
-
* });
|
|
2261
|
-
* ```
|
|
2262
|
-
* @example
|
|
2263
|
-
* ```js
|
|
2264
|
-
* const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2265
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2266
|
-
* });
|
|
2273
|
+
* spotterEmbed.trigger(HostEvent.Edit);
|
|
2267
2274
|
* ```
|
|
2268
2275
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2269
2276
|
*/
|
|
@@ -2312,16 +2319,23 @@
|
|
|
2312
2319
|
* );
|
|
2313
2320
|
* })
|
|
2314
2321
|
* ```
|
|
2315
|
-
* @example
|
|
2322
|
+
* * @example
|
|
2316
2323
|
* ```js
|
|
2317
|
-
|
|
2318
|
-
|
|
2324
|
+
|
|
2325
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
|
|
2326
|
+
* let latestSpotterVizId = '';
|
|
2327
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2328
|
+
* latestSpotterVizId = payload.data.id;
|
|
2329
|
+
* });
|
|
2330
|
+
*
|
|
2331
|
+
* spotterEmbed.trigger(HostEvent.GetTML, {
|
|
2332
|
+
* vizId: latestSpotterVizId
|
|
2319
2333
|
* }).then((tml) => {
|
|
2320
2334
|
* console.log(
|
|
2321
2335
|
* tml.answer.search_query // TML representation of the search query
|
|
2322
2336
|
* );
|
|
2323
2337
|
* })
|
|
2324
|
-
|
|
2338
|
+
* ```
|
|
2325
2339
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2326
2340
|
* @important
|
|
2327
2341
|
*/
|
|
@@ -2385,7 +2399,7 @@
|
|
|
2385
2399
|
/**
|
|
2386
2400
|
* Trigger the **Download** action on charts in
|
|
2387
2401
|
* the embedded view.
|
|
2388
|
-
* @param - `vizId` refers to the
|
|
2402
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2389
2403
|
* @example
|
|
2390
2404
|
* ```js
|
|
2391
2405
|
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
@@ -2395,10 +2409,14 @@
|
|
|
2395
2409
|
* embed.trigger(HostEvent.Download)
|
|
2396
2410
|
* ```
|
|
2397
2411
|
* ```js
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2412
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event.
|
|
2413
|
+
* let latestSpotterVizId = '';
|
|
2414
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2415
|
+
* latestSpotterVizId = payload.data.id;
|
|
2416
|
+
* });
|
|
2417
|
+
*
|
|
2418
|
+
* spotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId });
|
|
2419
|
+
* ```
|
|
2402
2420
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
2403
2421
|
* Use {@link DownloadAsPng}
|
|
2404
2422
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
@@ -2416,9 +2434,13 @@
|
|
|
2416
2434
|
*
|
|
2417
2435
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2418
2436
|
*
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2437
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event.
|
|
2438
|
+
* let latestSpotterVizId = '';
|
|
2439
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2440
|
+
* latestSpotterVizId = payload.data.id;
|
|
2441
|
+
* });
|
|
2442
|
+
*
|
|
2443
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
|
|
2422
2444
|
* ```
|
|
2423
2445
|
*
|
|
2424
2446
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
@@ -2427,7 +2449,7 @@
|
|
|
2427
2449
|
/**
|
|
2428
2450
|
* Trigger the **Download** > **CSV** action on tables in
|
|
2429
2451
|
* the embedded view.
|
|
2430
|
-
* @param - `vizId` refers to the
|
|
2452
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2431
2453
|
* @example
|
|
2432
2454
|
* ```js
|
|
2433
2455
|
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
@@ -2440,9 +2462,13 @@
|
|
|
2440
2462
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2441
2463
|
* ```
|
|
2442
2464
|
* ```js
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2465
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event.
|
|
2466
|
+
* let latestSpotterVizId = '';
|
|
2467
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2468
|
+
* latestSpotterVizId = payload.data.id;
|
|
2469
|
+
* });
|
|
2470
|
+
*
|
|
2471
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
|
|
2446
2472
|
* ```
|
|
2447
2473
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2448
2474
|
*/
|
|
@@ -2450,7 +2476,7 @@
|
|
|
2450
2476
|
/**
|
|
2451
2477
|
* Trigger the **Download** > **XLSX** action on tables
|
|
2452
2478
|
* in the embedded view.
|
|
2453
|
-
* @param - `vizId` refers to the
|
|
2479
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2454
2480
|
* @example
|
|
2455
2481
|
* ```js
|
|
2456
2482
|
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
@@ -2463,9 +2489,13 @@
|
|
|
2463
2489
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2464
2490
|
* ```
|
|
2465
2491
|
* ```js
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2492
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event.
|
|
2493
|
+
* let latestSpotterVizId = '';
|
|
2494
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2495
|
+
* latestSpotterVizId = payload.data.id;
|
|
2496
|
+
* });
|
|
2497
|
+
*
|
|
2498
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
|
|
2469
2499
|
* ```
|
|
2470
2500
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2471
2501
|
*/
|
|
@@ -2502,7 +2532,7 @@
|
|
|
2502
2532
|
* ```
|
|
2503
2533
|
*
|
|
2504
2534
|
* ```js
|
|
2505
|
-
* // Save
|
|
2535
|
+
* // Save a Visualization in Spotter (requires vizId)
|
|
2506
2536
|
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2507
2537
|
* vizId: "730496d6-6903-4601-937e-2c691821af3c"
|
|
2508
2538
|
* })
|
|
@@ -2824,11 +2854,13 @@
|
|
|
2824
2854
|
* });
|
|
2825
2855
|
*```
|
|
2826
2856
|
*```js
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2857
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event.
|
|
2858
|
+
* let latestSpotterVizId = '';
|
|
2859
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2860
|
+
* latestSpotterVizId = payload.data.id;
|
|
2861
|
+
* });
|
|
2862
|
+
*
|
|
2863
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
|
|
2832
2864
|
*```
|
|
2833
2865
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2834
2866
|
*/
|
|
@@ -2871,11 +2903,13 @@
|
|
|
2871
2903
|
* ```
|
|
2872
2904
|
* @example
|
|
2873
2905
|
* ```js
|
|
2874
|
-
*
|
|
2875
|
-
*
|
|
2876
|
-
*
|
|
2877
|
-
*
|
|
2906
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in SaveAnswer host event.
|
|
2907
|
+
* let latestSpotterVizId = '';
|
|
2908
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2909
|
+
* latestSpotterVizId = payload.data.id;
|
|
2878
2910
|
* });
|
|
2911
|
+
*
|
|
2912
|
+
* spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
|
|
2879
2913
|
* ```
|
|
2880
2914
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
2881
2915
|
*/
|
|
@@ -2959,12 +2993,15 @@
|
|
|
2959
2993
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
2960
2994
|
/**
|
|
2961
2995
|
* Toggle the visualization to chart or table view.
|
|
2962
|
-
* @param - `vizId ` refers to the
|
|
2996
|
+
* @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
|
|
2963
2997
|
* @example
|
|
2964
2998
|
* ```js
|
|
2965
|
-
*
|
|
2966
|
-
*
|
|
2999
|
+
* let latestSpotterVizId = '';
|
|
3000
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3001
|
+
* latestSpotterVizId = payload.data.id;
|
|
2967
3002
|
* });
|
|
3003
|
+
*
|
|
3004
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
|
|
2968
3005
|
*```
|
|
2969
3006
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2970
3007
|
*/
|
|
@@ -2993,12 +3030,16 @@
|
|
|
2993
3030
|
*/
|
|
2994
3031
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
2995
3032
|
/**
|
|
2996
|
-
* Trigger the *
|
|
2997
|
-
* @param - `vizId` refers to the
|
|
3033
|
+
* Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
|
|
3034
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
|
|
2998
3035
|
* @example
|
|
2999
3036
|
* ```js
|
|
3000
|
-
*
|
|
3001
|
-
* {
|
|
3037
|
+
* let latestSpotterVizId = '';
|
|
3038
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3039
|
+
* latestSpotterVizId = payload.data.id;
|
|
3040
|
+
* });
|
|
3041
|
+
*
|
|
3042
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });
|
|
3002
3043
|
* ```
|
|
3003
3044
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3004
3045
|
*/
|
|
@@ -3056,6 +3097,7 @@
|
|
|
3056
3097
|
Param["HideResult"] = "hideResult";
|
|
3057
3098
|
Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
|
|
3058
3099
|
Param["Tag"] = "tag";
|
|
3100
|
+
Param["HideTagFilterChips"] = "hideTagFilterChips";
|
|
3059
3101
|
Param["AutoLogin"] = "autoLogin";
|
|
3060
3102
|
Param["searchTokenString"] = "searchTokenString";
|
|
3061
3103
|
Param["executeSearch"] = "executeSearch";
|
|
@@ -3160,6 +3202,7 @@
|
|
|
3160
3202
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3161
3203
|
Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3162
3204
|
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
3205
|
+
Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
|
|
3163
3206
|
})(Param || (Param = {}));
|
|
3164
3207
|
/**
|
|
3165
3208
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -7369,6 +7412,7 @@
|
|
|
7369
7412
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
7370
7413
|
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',
|
|
7371
7414
|
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
7415
|
+
OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
|
|
7372
7416
|
};
|
|
7373
7417
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
7374
7418
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -17451,7 +17495,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17451
17495
|
return e;
|
|
17452
17496
|
}
|
|
17453
17497
|
|
|
17454
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.0";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$1={".":{"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
|
|
17498
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-HE2.0";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$1={".":{"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$1,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};
|
|
17455
17499
|
|
|
17456
17500
|
/**
|
|
17457
17501
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17470,6 +17514,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17470
17514
|
* @param message
|
|
17471
17515
|
* @param message.type
|
|
17472
17516
|
* @param message.data
|
|
17517
|
+
* @param message.context
|
|
17473
17518
|
* @param thoughtSpotHost
|
|
17474
17519
|
* @param channel
|
|
17475
17520
|
*/
|
|
@@ -17484,8 +17529,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17484
17529
|
* @param messageType
|
|
17485
17530
|
* @param thoughtSpotHost
|
|
17486
17531
|
* @param data
|
|
17532
|
+
* @param context
|
|
17487
17533
|
*/
|
|
17488
|
-
function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
17534
|
+
function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
|
|
17489
17535
|
return new Promise((res, rej) => {
|
|
17490
17536
|
var _a;
|
|
17491
17537
|
if (messageType === exports.HostEvent.Reload) {
|
|
@@ -17519,7 +17565,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17519
17565
|
channel.port1.close();
|
|
17520
17566
|
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
17521
17567
|
}, TRIGGER_TIMEOUT);
|
|
17522
|
-
return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
|
|
17568
|
+
return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
|
|
17523
17569
|
});
|
|
17524
17570
|
}
|
|
17525
17571
|
|
|
@@ -17531,7 +17577,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17531
17577
|
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
17532
17578
|
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
17533
17579
|
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
17534
|
-
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
17580
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
17581
|
+
var ContextType;
|
|
17582
|
+
(function (ContextType) {
|
|
17583
|
+
ContextType["Search"] = "search";
|
|
17584
|
+
ContextType["Liveboard"] = "liveboard";
|
|
17585
|
+
ContextType["Answer"] = "answer";
|
|
17586
|
+
ContextType["Spotter"] = "spotter";
|
|
17587
|
+
ContextType["None"] = "";
|
|
17588
|
+
})(ContextType || (ContextType = {}));
|
|
17535
17589
|
|
|
17536
17590
|
class HostEventClient {
|
|
17537
17591
|
constructor(iFrame) {
|
|
@@ -17543,12 +17597,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17543
17597
|
* @param {any} data Data to send with the host event
|
|
17544
17598
|
* @returns {Promise<any>} - the response from the process trigger
|
|
17545
17599
|
*/
|
|
17546
|
-
async processTrigger(message, data) {
|
|
17600
|
+
async processTrigger(message, data, context) {
|
|
17547
17601
|
if (!this.iFrame) {
|
|
17548
17602
|
throw new Error('Iframe element is not set');
|
|
17549
17603
|
}
|
|
17550
17604
|
const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
|
|
17551
|
-
return processTrigger(this.iFrame, message, thoughtspotHost, data);
|
|
17605
|
+
return processTrigger(this.iFrame, message, thoughtspotHost, data, context);
|
|
17552
17606
|
}
|
|
17553
17607
|
async handleHostEventWithParam(apiName, parameters) {
|
|
17554
17608
|
var _a, _b, _c, _d;
|
|
@@ -17567,8 +17621,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17567
17621
|
}
|
|
17568
17622
|
return { ...response.value };
|
|
17569
17623
|
}
|
|
17570
|
-
async hostEventFallback(hostEvent, data) {
|
|
17571
|
-
return this.processTrigger(hostEvent, data);
|
|
17624
|
+
async hostEventFallback(hostEvent, data, context) {
|
|
17625
|
+
return this.processTrigger(hostEvent, data, context);
|
|
17572
17626
|
}
|
|
17573
17627
|
/**
|
|
17574
17628
|
* Setter for the iframe element used for host events
|
|
@@ -17612,14 +17666,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17612
17666
|
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,
|
|
17613
17667
|
};
|
|
17614
17668
|
}
|
|
17615
|
-
async triggerHostEvent(hostEvent, payload) {
|
|
17669
|
+
async triggerHostEvent(hostEvent, payload, context) {
|
|
17616
17670
|
switch (hostEvent) {
|
|
17617
17671
|
case exports.HostEvent.Pin:
|
|
17618
17672
|
return this.handlePinEvent(payload);
|
|
17619
17673
|
case exports.HostEvent.SaveAnswer:
|
|
17620
17674
|
return this.handleSaveAnswerEvent(payload);
|
|
17621
17675
|
default:
|
|
17622
|
-
return this.hostEventFallback(hostEvent, payload);
|
|
17676
|
+
return this.hostEventFallback(hostEvent, payload, context);
|
|
17623
17677
|
}
|
|
17624
17678
|
}
|
|
17625
17679
|
}
|
|
@@ -17921,39 +17975,69 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17921
17975
|
return eventData;
|
|
17922
17976
|
}
|
|
17923
17977
|
/**
|
|
17924
|
-
*
|
|
17925
|
-
*
|
|
17926
|
-
* embed instance through an identifier contained in the payload,
|
|
17927
|
-
* and executes the registered callbacks accordingly.
|
|
17978
|
+
* Subscribe to network events (online/offline) that should
|
|
17979
|
+
* work regardless of auth status
|
|
17928
17980
|
*/
|
|
17929
|
-
|
|
17930
|
-
this.
|
|
17931
|
-
const messageEventListener = (event) => {
|
|
17932
|
-
const eventType = this.getEventType(event);
|
|
17933
|
-
const eventPort = this.getEventPort(event);
|
|
17934
|
-
const eventData = this.formatEventData(event, eventType);
|
|
17935
|
-
if (event.source === this.iFrame.contentWindow) {
|
|
17936
|
-
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
17937
|
-
}
|
|
17938
|
-
};
|
|
17939
|
-
window.addEventListener('message', messageEventListener);
|
|
17981
|
+
subscribeToNetworkEvents() {
|
|
17982
|
+
this.unsubscribeToNetworkEvents();
|
|
17940
17983
|
const onlineEventListener = (e) => {
|
|
17941
17984
|
this.trigger(exports.HostEvent.Reload);
|
|
17942
17985
|
};
|
|
17943
17986
|
window.addEventListener('online', onlineEventListener);
|
|
17944
17987
|
const offlineEventListener = (e) => {
|
|
17945
|
-
const offlineWarning =
|
|
17988
|
+
const offlineWarning = ERROR_MESSAGE.OFFLINE_WARNING;
|
|
17946
17989
|
this.executeCallbacks(exports.EmbedEvent.Error, {
|
|
17947
17990
|
offlineWarning,
|
|
17948
17991
|
});
|
|
17949
17992
|
logger$3.warn(offlineWarning);
|
|
17950
17993
|
};
|
|
17951
17994
|
window.addEventListener('offline', offlineEventListener);
|
|
17952
|
-
this.subscribedListeners =
|
|
17953
|
-
|
|
17954
|
-
|
|
17955
|
-
|
|
17995
|
+
this.subscribedListeners.online = onlineEventListener;
|
|
17996
|
+
this.subscribedListeners.offline = offlineEventListener;
|
|
17997
|
+
}
|
|
17998
|
+
/**
|
|
17999
|
+
* Subscribe to message events that depend on successful iframe setup
|
|
18000
|
+
*/
|
|
18001
|
+
subscribeToMessageEvents() {
|
|
18002
|
+
this.unsubscribeToMessageEvents();
|
|
18003
|
+
const messageEventListener = (event) => {
|
|
18004
|
+
const eventType = this.getEventType(event);
|
|
18005
|
+
const eventPort = this.getEventPort(event);
|
|
18006
|
+
const eventData = this.formatEventData(event, eventType);
|
|
18007
|
+
if (event.source === this.iFrame.contentWindow) {
|
|
18008
|
+
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
18009
|
+
}
|
|
17956
18010
|
};
|
|
18011
|
+
window.addEventListener('message', messageEventListener);
|
|
18012
|
+
this.subscribedListeners.message = messageEventListener;
|
|
18013
|
+
}
|
|
18014
|
+
/**
|
|
18015
|
+
* Adds event listeners for both network and message events.
|
|
18016
|
+
* This maintains backward compatibility with the existing method.
|
|
18017
|
+
* Adds a global event listener to window for "message" events.
|
|
18018
|
+
* ThoughtSpot detects if a particular event is targeted to this
|
|
18019
|
+
* embed instance through an identifier contained in the payload,
|
|
18020
|
+
* and executes the registered callbacks accordingly.
|
|
18021
|
+
*/
|
|
18022
|
+
subscribeToEvents() {
|
|
18023
|
+
this.subscribeToNetworkEvents();
|
|
18024
|
+
this.subscribeToMessageEvents();
|
|
18025
|
+
}
|
|
18026
|
+
unsubscribeToNetworkEvents() {
|
|
18027
|
+
if (this.subscribedListeners.online) {
|
|
18028
|
+
window.removeEventListener('online', this.subscribedListeners.online);
|
|
18029
|
+
delete this.subscribedListeners.online;
|
|
18030
|
+
}
|
|
18031
|
+
if (this.subscribedListeners.offline) {
|
|
18032
|
+
window.removeEventListener('offline', this.subscribedListeners.offline);
|
|
18033
|
+
delete this.subscribedListeners.offline;
|
|
18034
|
+
}
|
|
18035
|
+
}
|
|
18036
|
+
unsubscribeToMessageEvents() {
|
|
18037
|
+
if (this.subscribedListeners.message) {
|
|
18038
|
+
window.removeEventListener('message', this.subscribedListeners.message);
|
|
18039
|
+
delete this.subscribedListeners.message;
|
|
18040
|
+
}
|
|
17957
18041
|
}
|
|
17958
18042
|
unsubscribeToEvents() {
|
|
17959
18043
|
Object.keys(this.subscribedListeners).forEach((key) => {
|
|
@@ -18254,6 +18338,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18254
18338
|
type: exports.EmbedEvent.Init,
|
|
18255
18339
|
});
|
|
18256
18340
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_START);
|
|
18341
|
+
// Always subscribe to network events, regardless of auth status
|
|
18342
|
+
this.subscribeToNetworkEvents();
|
|
18257
18343
|
return (_a = getAuthPromise()) === null || _a === void 0 ? void 0 : _a.then((isLoggedIn) => {
|
|
18258
18344
|
if (!isLoggedIn) {
|
|
18259
18345
|
this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
|
|
@@ -18296,7 +18382,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18296
18382
|
el.remove();
|
|
18297
18383
|
});
|
|
18298
18384
|
}
|
|
18299
|
-
|
|
18385
|
+
// Subscribe to message events only after successful
|
|
18386
|
+
// auth and iframe setup
|
|
18387
|
+
this.subscribeToMessageEvents();
|
|
18300
18388
|
}).catch((error) => {
|
|
18301
18389
|
nextInQueue();
|
|
18302
18390
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_FAILED, {
|
|
@@ -18606,7 +18694,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18606
18694
|
* @param {any} data The payload to send with the message
|
|
18607
18695
|
* @returns A promise that resolves with the response from the embedded app
|
|
18608
18696
|
*/
|
|
18609
|
-
async trigger(messageType, data = {}) {
|
|
18697
|
+
async trigger(messageType, data = {}, context) {
|
|
18610
18698
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
18611
18699
|
if (!this.isRendered) {
|
|
18612
18700
|
this.handleError('Please call render before triggering events');
|
|
@@ -18616,8 +18704,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18616
18704
|
this.handleError('Host event type is undefined');
|
|
18617
18705
|
return null;
|
|
18618
18706
|
}
|
|
18707
|
+
// Check if iframe exists before triggering -
|
|
18708
|
+
// this prevents the error when auth fails
|
|
18709
|
+
if (!this.iFrame) {
|
|
18710
|
+
logger$3.debug(`Cannot trigger ${messageType} - iframe not available (likely due to auth failure)`);
|
|
18711
|
+
return null;
|
|
18712
|
+
}
|
|
18619
18713
|
// send an empty object, this is needed for liveboard default handlers
|
|
18620
|
-
return this.hostEventClient.triggerHostEvent(messageType, data);
|
|
18714
|
+
return this.hostEventClient.triggerHostEvent(messageType, data, context);
|
|
18621
18715
|
}
|
|
18622
18716
|
/**
|
|
18623
18717
|
* Triggers an event to the embedded app, skipping the UI flow.
|
|
@@ -19470,7 +19564,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19470
19564
|
* embedded Liveboard or visualization.
|
|
19471
19565
|
*/
|
|
19472
19566
|
getEmbedParams() {
|
|
19473
|
-
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;
|
|
19567
|
+
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;
|
|
19474
19568
|
let params = {};
|
|
19475
19569
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19476
19570
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19538,6 +19632,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19538
19632
|
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19539
19633
|
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19540
19634
|
}
|
|
19635
|
+
if (hideTagFilterChips !== undefined) {
|
|
19636
|
+
params[Param.HideTagFilterChips] = hideTagFilterChips;
|
|
19637
|
+
}
|
|
19638
|
+
if (isLinkParametersEnabled !== undefined) {
|
|
19639
|
+
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
19640
|
+
}
|
|
19541
19641
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19542
19642
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
19543
19643
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -19892,7 +19992,7 @@ query GetEurekaVizSnapshots(
|
|
|
19892
19992
|
getEmbedParamsObject() {
|
|
19893
19993
|
let params = {};
|
|
19894
19994
|
params = this.getBaseQueryParams(params);
|
|
19895
|
-
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;
|
|
19995
|
+
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;
|
|
19896
19996
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
19897
19997
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
19898
19998
|
if (fullHeight === true) {
|
|
@@ -19957,6 +20057,9 @@ query GetEurekaVizSnapshots(
|
|
|
19957
20057
|
if (showSpotterLimitations !== undefined) {
|
|
19958
20058
|
params[Param.ShowSpotterLimitations] = showSpotterLimitations;
|
|
19959
20059
|
}
|
|
20060
|
+
if (isLinkParametersEnabled !== undefined) {
|
|
20061
|
+
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
20062
|
+
}
|
|
19960
20063
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19961
20064
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
19962
20065
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
@@ -20053,7 +20156,7 @@ query GetEurekaVizSnapshots(
|
|
|
20053
20156
|
* @param {any} data The payload to send with the message
|
|
20054
20157
|
* @returns A promise that resolves with the response from the embedded app
|
|
20055
20158
|
*/
|
|
20056
|
-
trigger(messageType, data = {}) {
|
|
20159
|
+
trigger(messageType, data = {}, context) {
|
|
20057
20160
|
const dataWithVizId = data;
|
|
20058
20161
|
if (messageType === exports.HostEvent.SetActiveTab) {
|
|
20059
20162
|
this.setActiveTab(data);
|
|
@@ -20062,7 +20165,7 @@ query GetEurekaVizSnapshots(
|
|
|
20062
20165
|
if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
|
|
20063
20166
|
dataWithVizId.vizId = this.viewConfig.vizId;
|
|
20064
20167
|
}
|
|
20065
|
-
return super.trigger(messageType, dataWithVizId);
|
|
20168
|
+
return super.trigger(messageType, dataWithVizId, context);
|
|
20066
20169
|
}
|
|
20067
20170
|
/**
|
|
20068
20171
|
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|