@thoughtspot/visual-embed-sdk 1.42.2 → 1.43.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 +1 -1
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +2 -0
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +17 -2
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +134 -41
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/types.d.ts +159 -69
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +146 -68
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-CjbriUI0.js → index-HZ94j9Ey.js} +1 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/types.d.ts +159 -69
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +168 -73
- package/dist/tsembed-react.js +167 -72
- package/dist/tsembed.es.js +168 -73
- package/dist/tsembed.js +167 -72
- package/dist/visual-embed-sdk-react-full.d.ts +159 -69
- package/dist/visual-embed-sdk-react.d.ts +159 -69
- package/dist/visual-embed-sdk.d.ts +159 -69
- package/lib/package.json +1 -1
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +2 -0
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +17 -2
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +134 -41
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/types.d.ts +159 -69
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +146 -68
- package/lib/src/types.js.map +1 -1
- package/package.json +1 -1
- package/src/embed/base.ts +2 -0
- package/src/embed/ts-embed.spec.ts +168 -44
- package/src/embed/ts-embed.ts +14 -1
- package/src/types.ts +159 -68
package/dist/tsembed-react.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.43.0 */
|
|
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
|
|
@@ -1033,6 +1033,17 @@ var EmbedEvent;
|
|
|
1033
1033
|
*```
|
|
1034
1034
|
*/
|
|
1035
1035
|
EmbedEvent["AnswerDelete"] = "answerDelete";
|
|
1036
|
+
/**
|
|
1037
|
+
* Emitted when the AI Highlights action is triggered on a Liveboard
|
|
1038
|
+
* @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
|
|
1039
|
+
* @example
|
|
1040
|
+
*```js
|
|
1041
|
+
* liveboardEmbed.on(EmbedEvent.AIHighlights, (payload) => {
|
|
1042
|
+
* console.log('AI Highlights', payload);
|
|
1043
|
+
* })
|
|
1044
|
+
*```
|
|
1045
|
+
*/
|
|
1046
|
+
EmbedEvent["AIHighlights"] = "AIHighlights";
|
|
1036
1047
|
/**
|
|
1037
1048
|
* Emitted when a user initiates the Pin action to
|
|
1038
1049
|
* add an Answer to a Liveboard.
|
|
@@ -1983,7 +1994,7 @@ var HostEvent;
|
|
|
1983
1994
|
* the following parameters:
|
|
1984
1995
|
*
|
|
1985
1996
|
* @param
|
|
1986
|
-
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
1997
|
+
* `vizId`- GUID of the saved Answer or Spotter visualization ID to pin to a Liveboard.
|
|
1987
1998
|
* Optional when pinning a new chart or table generated from a Search query.
|
|
1988
1999
|
* **Required** in Spotter Embed.
|
|
1989
2000
|
* @param
|
|
@@ -2035,10 +2046,16 @@ var HostEvent;
|
|
|
2035
2046
|
* ```
|
|
2036
2047
|
* @example
|
|
2037
2048
|
* ```js
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2049
|
+
|
|
2050
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
|
|
2051
|
+
* let latestSpotterVizId = '';
|
|
2052
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2053
|
+
* latestSpotterVizId = payload.data.id;
|
|
2054
|
+
* });
|
|
2055
|
+
*
|
|
2056
|
+
* spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
|
|
2057
|
+
* ```
|
|
2058
|
+
*
|
|
2042
2059
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2043
2060
|
*/
|
|
2044
2061
|
HostEvent["Pin"] = "pin";
|
|
@@ -2113,14 +2130,29 @@ var HostEvent;
|
|
|
2113
2130
|
* ```
|
|
2114
2131
|
* @example
|
|
2115
2132
|
* ```js
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2133
|
+
|
|
2134
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPdf host event.
|
|
2135
|
+
* let latestSpotterVizId = '';
|
|
2136
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2137
|
+
* latestSpotterVizId = payload.data.id;
|
|
2138
|
+
* });
|
|
2139
|
+
*
|
|
2140
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
|
|
2141
|
+
* ```
|
|
2120
2142
|
*
|
|
2121
2143
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2122
2144
|
*/
|
|
2123
2145
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
2146
|
+
/**
|
|
2147
|
+
* Trigger the **AI Highlights** action on an embedded Liveboard
|
|
2148
|
+
*
|
|
2149
|
+
* @example
|
|
2150
|
+
* ```js
|
|
2151
|
+
* liveboardEmbed.trigger(HostEvent.AIHighlights)
|
|
2152
|
+
* ```
|
|
2153
|
+
* @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
|
|
2154
|
+
*/
|
|
2155
|
+
HostEvent["AIHighlights"] = "AIHighlights";
|
|
2124
2156
|
/**
|
|
2125
2157
|
* Trigger the **Make a copy** action on a Liveboard,
|
|
2126
2158
|
* visualization, or Answer page.
|
|
@@ -2143,10 +2175,14 @@ var HostEvent;
|
|
|
2143
2175
|
* ```
|
|
2144
2176
|
* @example
|
|
2145
2177
|
* ```js
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2178
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event.
|
|
2179
|
+
* let latestSpotterVizId = '';
|
|
2180
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2181
|
+
* latestSpotterVizId = payload.data.id;
|
|
2182
|
+
* });
|
|
2183
|
+
*
|
|
2184
|
+
* spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
|
|
2185
|
+
* ```
|
|
2150
2186
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2151
2187
|
*/
|
|
2152
2188
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2231,15 +2267,7 @@ var HostEvent;
|
|
|
2231
2267
|
* ```
|
|
2232
2268
|
* @example
|
|
2233
2269
|
* ```js
|
|
2234
|
-
*
|
|
2235
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2236
|
-
* });
|
|
2237
|
-
* ```
|
|
2238
|
-
* @example
|
|
2239
|
-
* ```js
|
|
2240
|
-
* const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2241
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2242
|
-
* });
|
|
2270
|
+
* spotterEmbed.trigger(HostEvent.Edit);
|
|
2243
2271
|
* ```
|
|
2244
2272
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2245
2273
|
*/
|
|
@@ -2288,16 +2316,23 @@ var HostEvent;
|
|
|
2288
2316
|
* );
|
|
2289
2317
|
* })
|
|
2290
2318
|
* ```
|
|
2291
|
-
* @example
|
|
2319
|
+
* * @example
|
|
2292
2320
|
* ```js
|
|
2293
|
-
|
|
2294
|
-
|
|
2321
|
+
|
|
2322
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
|
|
2323
|
+
* let latestSpotterVizId = '';
|
|
2324
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2325
|
+
* latestSpotterVizId = payload.data.id;
|
|
2326
|
+
* });
|
|
2327
|
+
*
|
|
2328
|
+
* spotterEmbed.trigger(HostEvent.GetTML, {
|
|
2329
|
+
* vizId: latestSpotterVizId
|
|
2295
2330
|
* }).then((tml) => {
|
|
2296
2331
|
* console.log(
|
|
2297
2332
|
* tml.answer.search_query // TML representation of the search query
|
|
2298
2333
|
* );
|
|
2299
2334
|
* })
|
|
2300
|
-
|
|
2335
|
+
* ```
|
|
2301
2336
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2302
2337
|
* @important
|
|
2303
2338
|
*/
|
|
@@ -2361,7 +2396,7 @@ var HostEvent;
|
|
|
2361
2396
|
/**
|
|
2362
2397
|
* Trigger the **Download** action on charts in
|
|
2363
2398
|
* the embedded view.
|
|
2364
|
-
* @param - `vizId` refers to the
|
|
2399
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2365
2400
|
* @example
|
|
2366
2401
|
* ```js
|
|
2367
2402
|
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
@@ -2371,10 +2406,14 @@ var HostEvent;
|
|
|
2371
2406
|
* embed.trigger(HostEvent.Download)
|
|
2372
2407
|
* ```
|
|
2373
2408
|
* ```js
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2409
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event.
|
|
2410
|
+
* let latestSpotterVizId = '';
|
|
2411
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2412
|
+
* latestSpotterVizId = payload.data.id;
|
|
2413
|
+
* });
|
|
2414
|
+
*
|
|
2415
|
+
* spotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId });
|
|
2416
|
+
* ```
|
|
2378
2417
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
2379
2418
|
* Use {@link DownloadAsPng}
|
|
2380
2419
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
@@ -2392,9 +2431,13 @@ var HostEvent;
|
|
|
2392
2431
|
*
|
|
2393
2432
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2394
2433
|
*
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2434
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event.
|
|
2435
|
+
* let latestSpotterVizId = '';
|
|
2436
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2437
|
+
* latestSpotterVizId = payload.data.id;
|
|
2438
|
+
* });
|
|
2439
|
+
*
|
|
2440
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
|
|
2398
2441
|
* ```
|
|
2399
2442
|
*
|
|
2400
2443
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
@@ -2403,7 +2446,7 @@ var HostEvent;
|
|
|
2403
2446
|
/**
|
|
2404
2447
|
* Trigger the **Download** > **CSV** action on tables in
|
|
2405
2448
|
* the embedded view.
|
|
2406
|
-
* @param - `vizId` refers to the
|
|
2449
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2407
2450
|
* @example
|
|
2408
2451
|
* ```js
|
|
2409
2452
|
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
@@ -2416,9 +2459,13 @@ var HostEvent;
|
|
|
2416
2459
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2417
2460
|
* ```
|
|
2418
2461
|
* ```js
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2462
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event.
|
|
2463
|
+
* let latestSpotterVizId = '';
|
|
2464
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2465
|
+
* latestSpotterVizId = payload.data.id;
|
|
2466
|
+
* });
|
|
2467
|
+
*
|
|
2468
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
|
|
2422
2469
|
* ```
|
|
2423
2470
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2424
2471
|
*/
|
|
@@ -2426,7 +2473,7 @@ var HostEvent;
|
|
|
2426
2473
|
/**
|
|
2427
2474
|
* Trigger the **Download** > **XLSX** action on tables
|
|
2428
2475
|
* in the embedded view.
|
|
2429
|
-
* @param - `vizId` refers to the
|
|
2476
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2430
2477
|
* @example
|
|
2431
2478
|
* ```js
|
|
2432
2479
|
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
@@ -2439,9 +2486,13 @@ var HostEvent;
|
|
|
2439
2486
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2440
2487
|
* ```
|
|
2441
2488
|
* ```js
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2489
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event.
|
|
2490
|
+
* let latestSpotterVizId = '';
|
|
2491
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2492
|
+
* latestSpotterVizId = payload.data.id;
|
|
2493
|
+
* });
|
|
2494
|
+
*
|
|
2495
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
|
|
2445
2496
|
* ```
|
|
2446
2497
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2447
2498
|
*/
|
|
@@ -2478,7 +2529,7 @@ var HostEvent;
|
|
|
2478
2529
|
* ```
|
|
2479
2530
|
*
|
|
2480
2531
|
* ```js
|
|
2481
|
-
* // Save
|
|
2532
|
+
* // Save a Visualization in Spotter (requires vizId)
|
|
2482
2533
|
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2483
2534
|
* vizId: "730496d6-6903-4601-937e-2c691821af3c"
|
|
2484
2535
|
* })
|
|
@@ -2779,15 +2830,21 @@ var HostEvent;
|
|
|
2779
2830
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
2780
2831
|
/**
|
|
2781
2832
|
* Triggers an action to update Parameter values on embedded
|
|
2782
|
-
* Answers, Liveboard and Spotter answer in Edit mode.
|
|
2833
|
+
* Answers, Liveboard, and Spotter answer in Edit mode.
|
|
2834
|
+
* @param - `name` - Name of the Parameter
|
|
2835
|
+
* @param - `value` - The value to set for the Parameter.
|
|
2836
|
+
*
|
|
2837
|
+
* Optionally, to control the visibility of the Parameter chip,
|
|
2838
|
+
* use the `isVisibleToUser` attribute when applying an override.
|
|
2783
2839
|
*
|
|
2784
2840
|
* @example
|
|
2785
2841
|
* ```js
|
|
2786
2842
|
* liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
|
|
2787
|
-
*
|
|
2788
|
-
*
|
|
2843
|
+
* name: "Integer Range Param",
|
|
2844
|
+
* value: 10,
|
|
2845
|
+
* isVisibleToUser: false
|
|
2789
2846
|
* }])
|
|
2790
|
-
*
|
|
2847
|
+
* ```
|
|
2791
2848
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2792
2849
|
*/
|
|
2793
2850
|
HostEvent["UpdateParameters"] = "UpdateParameters";
|
|
@@ -2800,11 +2857,13 @@ var HostEvent;
|
|
|
2800
2857
|
* });
|
|
2801
2858
|
*```
|
|
2802
2859
|
*```js
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2860
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event.
|
|
2861
|
+
* let latestSpotterVizId = '';
|
|
2862
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2863
|
+
* latestSpotterVizId = payload.data.id;
|
|
2864
|
+
* });
|
|
2865
|
+
*
|
|
2866
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
|
|
2808
2867
|
*```
|
|
2809
2868
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2810
2869
|
*/
|
|
@@ -2834,10 +2893,11 @@ var HostEvent;
|
|
|
2834
2893
|
* If no parameters are specified, the save action is
|
|
2835
2894
|
* triggered with a modal to prompt users to
|
|
2836
2895
|
* add a name and description for the Answer.
|
|
2837
|
-
* @param -
|
|
2838
|
-
*
|
|
2839
|
-
*
|
|
2840
|
-
* @param - `
|
|
2896
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed
|
|
2897
|
+
* and is required in Spotter embed.
|
|
2898
|
+
* Optional attributes to set Answer properties include:
|
|
2899
|
+
* @param - `name` - Name string for the Answer.
|
|
2900
|
+
* @param - `description` - Description text for the Answer.
|
|
2841
2901
|
* @example
|
|
2842
2902
|
* ```js
|
|
2843
2903
|
* const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
|
|
@@ -2847,11 +2907,13 @@ var HostEvent;
|
|
|
2847
2907
|
* ```
|
|
2848
2908
|
* @example
|
|
2849
2909
|
* ```js
|
|
2850
|
-
*
|
|
2851
|
-
*
|
|
2852
|
-
*
|
|
2853
|
-
*
|
|
2910
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in SaveAnswer host event.
|
|
2911
|
+
* let latestSpotterVizId = '';
|
|
2912
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2913
|
+
* latestSpotterVizId = payload.data.id;
|
|
2854
2914
|
* });
|
|
2915
|
+
*
|
|
2916
|
+
* spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
|
|
2855
2917
|
* ```
|
|
2856
2918
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
2857
2919
|
*/
|
|
@@ -2935,12 +2997,15 @@ var HostEvent;
|
|
|
2935
2997
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
2936
2998
|
/**
|
|
2937
2999
|
* Toggle the visualization to chart or table view.
|
|
2938
|
-
* @param - `vizId ` refers to the
|
|
3000
|
+
* @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
|
|
2939
3001
|
* @example
|
|
2940
3002
|
* ```js
|
|
2941
|
-
*
|
|
2942
|
-
*
|
|
3003
|
+
* let latestSpotterVizId = '';
|
|
3004
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3005
|
+
* latestSpotterVizId = payload.data.id;
|
|
2943
3006
|
* });
|
|
3007
|
+
*
|
|
3008
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
|
|
2944
3009
|
*```
|
|
2945
3010
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2946
3011
|
*/
|
|
@@ -2969,12 +3034,16 @@ var HostEvent;
|
|
|
2969
3034
|
*/
|
|
2970
3035
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
2971
3036
|
/**
|
|
2972
|
-
* Trigger the *
|
|
2973
|
-
* @param - `vizId` refers to the
|
|
3037
|
+
* Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
|
|
3038
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
|
|
2974
3039
|
* @example
|
|
2975
3040
|
* ```js
|
|
2976
|
-
*
|
|
2977
|
-
* {
|
|
3041
|
+
* let latestSpotterVizId = '';
|
|
3042
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3043
|
+
* latestSpotterVizId = payload.data.id;
|
|
3044
|
+
* });
|
|
3045
|
+
*
|
|
3046
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });
|
|
2978
3047
|
* ```
|
|
2979
3048
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2980
3049
|
*/
|
|
@@ -2989,6 +3058,15 @@ var HostEvent;
|
|
|
2989
3058
|
* ```
|
|
2990
3059
|
*/
|
|
2991
3060
|
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
3061
|
+
/**
|
|
3062
|
+
* Triggered when the embed is needed to be destroyed. This is used to clean up any embed related resources internally.
|
|
3063
|
+
* @example
|
|
3064
|
+
* ```js
|
|
3065
|
+
* liveboardEmbed.trigger(HostEvent.DestroyEmbed);
|
|
3066
|
+
* ```
|
|
3067
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3068
|
+
*/
|
|
3069
|
+
HostEvent["DestroyEmbed"] = "EmbedDestroyed";
|
|
2992
3070
|
})(HostEvent || (HostEvent = {}));
|
|
2993
3071
|
/**
|
|
2994
3072
|
* The different visual modes that the data sources panel within
|
|
@@ -8270,7 +8348,7 @@ class AnswerService {
|
|
|
8270
8348
|
async getTML() {
|
|
8271
8349
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8272
8350
|
const edoc = object[0].edoc;
|
|
8273
|
-
const YAML = await import('./index-
|
|
8351
|
+
const YAML = await import('./index-HZ94j9Ey.js');
|
|
8274
8352
|
const parsedDoc = YAML.parse(edoc);
|
|
8275
8353
|
return {
|
|
8276
8354
|
answer: {
|
|
@@ -17129,6 +17207,8 @@ const CONFIG_DEFAULTS = {
|
|
|
17129
17207
|
authTriggerText: 'Authorize',
|
|
17130
17208
|
authType: AuthType.None,
|
|
17131
17209
|
logLevel: LogLevel.ERROR,
|
|
17210
|
+
waitForCleanupOnDestroy: false,
|
|
17211
|
+
cleanupTimeout: 5000,
|
|
17132
17212
|
};
|
|
17133
17213
|
let authPromise;
|
|
17134
17214
|
const getAuthPromise = () => authPromise;
|
|
@@ -17451,7 +17531,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
17451
17531
|
return e;
|
|
17452
17532
|
}
|
|
17453
17533
|
|
|
17454
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
17534
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.43.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={".":{"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 test && 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};
|
|
17455
17535
|
|
|
17456
17536
|
/**
|
|
17457
17537
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -18738,11 +18818,26 @@ class TsEmbed {
|
|
|
18738
18818
|
* @version SDK: 1.19.1 | ThoughtSpot: *
|
|
18739
18819
|
*/
|
|
18740
18820
|
destroy() {
|
|
18741
|
-
var _a;
|
|
18821
|
+
var _a, _b;
|
|
18742
18822
|
try {
|
|
18743
18823
|
this.removeFullscreenChangeHandler();
|
|
18744
|
-
(_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a.parentNode.removeChild(this.insertedDomEl);
|
|
18745
18824
|
this.unsubscribeToEvents();
|
|
18825
|
+
if (!getEmbedConfig().waitForCleanupOnDestroy) {
|
|
18826
|
+
this.trigger(HostEvent.DestroyEmbed);
|
|
18827
|
+
(_b = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(this.insertedDomEl);
|
|
18828
|
+
}
|
|
18829
|
+
else {
|
|
18830
|
+
const cleanupTimeout = getEmbedConfig().cleanupTimeout;
|
|
18831
|
+
Promise.race([
|
|
18832
|
+
this.trigger(HostEvent.DestroyEmbed),
|
|
18833
|
+
new Promise((resolve) => setTimeout(resolve, cleanupTimeout)),
|
|
18834
|
+
]).then(() => {
|
|
18835
|
+
var _a, _b;
|
|
18836
|
+
(_b = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(this.insertedDomEl);
|
|
18837
|
+
}).catch((e) => {
|
|
18838
|
+
logger$3.log('Error destroying TS Embed', e);
|
|
18839
|
+
});
|
|
18840
|
+
}
|
|
18746
18841
|
}
|
|
18747
18842
|
catch (e) {
|
|
18748
18843
|
logger$3.log('Error destroying TS Embed', e);
|