@thoughtspot/visual-embed-sdk 1.40.1-alpha.2 → 1.41.0-pre-render-1
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 +5 -4
- package/cjs/src/css-variables.d.ts +316 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +8 -0
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +12 -2
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +63 -2
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +10 -2
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +102 -0
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +11 -2
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +21 -7
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +185 -4
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +22 -7
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +75 -46
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +173 -1
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/types.d.ts +152 -44
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +139 -42
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/liveboardService/liveboardService.d.ts +21 -6
- package/cjs/src/utils/liveboardService/liveboardService.d.ts.map +1 -1
- package/cjs/src/utils/liveboardService/liveboardService.js +21 -6
- package/cjs/src/utils/liveboardService/liveboardService.js.map +1 -1
- package/dist/index-BDlM0f0T.js +7371 -0
- package/dist/src/css-variables.d.ts +316 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +63 -2
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +11 -2
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +22 -7
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/types.d.ts +152 -44
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/liveboardService/liveboardService.d.ts +21 -6
- package/dist/src/utils/liveboardService/liveboardService.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +256 -100
- package/dist/tsembed-react.js +255 -99
- package/dist/tsembed.es.js +277 -106
- package/dist/tsembed.js +276 -105
- package/dist/visual-embed-sdk-react-full.d.ts +575 -57
- package/dist/visual-embed-sdk-react.d.ts +575 -57
- package/dist/visual-embed-sdk.d.ts +575 -57
- package/lib/package.json +5 -4
- package/lib/src/css-variables.d.ts +316 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +8 -0
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +12 -2
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +63 -2
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +11 -3
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +104 -2
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +11 -2
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +21 -7
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +185 -4
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +22 -7
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +75 -46
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +173 -1
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/types.d.ts +152 -44
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +139 -42
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/liveboardService/liveboardService.d.ts +21 -6
- package/lib/src/utils/liveboardService/liveboardService.d.ts.map +1 -1
- package/lib/src/utils/liveboardService/liveboardService.js +21 -6
- package/lib/src/utils/liveboardService/liveboardService.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +576 -58
- package/package.json +5 -4
- package/src/css-variables.ts +396 -1
- package/src/embed/app.spec.ts +17 -2
- package/src/embed/app.ts +8 -0
- package/src/embed/bodyless-conversation.ts +0 -1
- package/src/embed/conversation.spec.ts +131 -5
- package/src/embed/conversation.ts +89 -10
- package/src/embed/liveboard.spec.ts +236 -5
- package/src/embed/liveboard.ts +22 -7
- package/src/embed/sage.ts +1 -1
- package/src/embed/ts-embed.spec.ts +345 -113
- package/src/embed/ts-embed.ts +83 -56
- package/src/types.ts +199 -91
- package/src/utils/liveboardService/liveboardService.ts +21 -6
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.41.0-pre-render-1 */
|
|
2
2
|
'use client';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef, useCallback } from 'react';
|
|
@@ -1223,7 +1223,7 @@ var EmbedEvent;
|
|
|
1223
1223
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1224
1224
|
* @example
|
|
1225
1225
|
*```js
|
|
1226
|
-
* liveboardEmbed.on(EmbedEvent.
|
|
1226
|
+
* liveboardEmbed.on(EmbedEvent.LiveboardInfo, payload => {
|
|
1227
1227
|
* console.log('Liveboard details', payload);
|
|
1228
1228
|
* })
|
|
1229
1229
|
*```
|
|
@@ -1598,58 +1598,58 @@ var EmbedEvent;
|
|
|
1598
1598
|
*/
|
|
1599
1599
|
EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
|
|
1600
1600
|
/**
|
|
1601
|
-
* Emitted when
|
|
1601
|
+
* Emitted when Spotter response is text data
|
|
1602
1602
|
* @example
|
|
1603
1603
|
* ```js
|
|
1604
1604
|
* spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
|
|
1605
1605
|
* console.log('payload', payload);
|
|
1606
1606
|
* })
|
|
1607
1607
|
*```
|
|
1608
|
-
* @version SDK: 1.
|
|
1608
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1609
1609
|
*/
|
|
1610
1610
|
EmbedEvent["SpotterData"] = "SpotterData";
|
|
1611
1611
|
/**
|
|
1612
|
-
* Emitted when user opens up the worksheet preview modal in
|
|
1612
|
+
* Emitted when user opens up the worksheet preview modal in Spotter embed.
|
|
1613
1613
|
* @example
|
|
1614
1614
|
* ```js
|
|
1615
1615
|
* spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
|
|
1616
1616
|
* console.log('payload', payload);
|
|
1617
1617
|
* })
|
|
1618
1618
|
*```
|
|
1619
|
-
* @version SDK: 1.
|
|
1619
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1620
1620
|
*/
|
|
1621
1621
|
EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
1622
1622
|
/**
|
|
1623
|
-
* Emitted when the
|
|
1623
|
+
* Emitted when the Spotter query is triggered in Spotter embed.
|
|
1624
1624
|
* @example
|
|
1625
1625
|
* ```js
|
|
1626
1626
|
* spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
|
|
1627
1627
|
* console.log('payload', payload);
|
|
1628
1628
|
* })
|
|
1629
1629
|
*```
|
|
1630
|
-
* @version SDK: 1.
|
|
1630
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1631
1631
|
*/
|
|
1632
1632
|
EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
|
|
1633
1633
|
/**
|
|
1634
|
-
* Emitted when the last
|
|
1634
|
+
* Emitted when the last Spotter query is edited in Spotter embed.
|
|
1635
1635
|
* @example
|
|
1636
1636
|
* ```js
|
|
1637
1637
|
* spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
|
|
1638
1638
|
* console.log('payload', payload);
|
|
1639
1639
|
* })
|
|
1640
1640
|
*```
|
|
1641
|
-
* @version SDK: 1.
|
|
1641
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1642
1642
|
*/
|
|
1643
1643
|
EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
|
|
1644
1644
|
/**
|
|
1645
|
-
* Emitted when the last
|
|
1645
|
+
* Emitted when the last Spotter query is deleted in Spotter embed.
|
|
1646
1646
|
* @example
|
|
1647
1647
|
* ```js
|
|
1648
1648
|
* spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
|
|
1649
1649
|
* console.log('payload', payload);
|
|
1650
1650
|
* })
|
|
1651
1651
|
*```
|
|
1652
|
-
* @version SDK: 1.
|
|
1652
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1653
1653
|
*/
|
|
1654
1654
|
EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
|
|
1655
1655
|
/**
|
|
@@ -1660,7 +1660,7 @@ var EmbedEvent;
|
|
|
1660
1660
|
* console.log('payload', payload);
|
|
1661
1661
|
* })
|
|
1662
1662
|
*```
|
|
1663
|
-
* @version SDK: 1.
|
|
1663
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1664
1664
|
*/
|
|
1665
1665
|
EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
1666
1666
|
/**
|
|
@@ -1673,7 +1673,19 @@ var EmbedEvent;
|
|
|
1673
1673
|
*```
|
|
1674
1674
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1675
1675
|
*/
|
|
1676
|
-
EmbedEvent["SpotterInit"] = "
|
|
1676
|
+
EmbedEvent["SpotterInit"] = "spotterInit";
|
|
1677
|
+
/**
|
|
1678
|
+
* @hidden
|
|
1679
|
+
* Triggers when the embed listener is ready to receive events.
|
|
1680
|
+
* This is used to trigger events after the embed container is loaded.
|
|
1681
|
+
* @example
|
|
1682
|
+
* ```js
|
|
1683
|
+
* liveboardEmbed.on(EmbedEvent.EmbedListenerReady, () => {
|
|
1684
|
+
* console.log('EmbedListenerReady');
|
|
1685
|
+
* })
|
|
1686
|
+
* ```
|
|
1687
|
+
*/
|
|
1688
|
+
EmbedEvent["EmbedListenerReady"] = "EmbedListenerReady";
|
|
1677
1689
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
1678
1690
|
/**
|
|
1679
1691
|
* Event types that can be triggered by the host application
|
|
@@ -1763,6 +1775,7 @@ var HostEvent;
|
|
|
1763
1775
|
* done automatically on the most popular column.
|
|
1764
1776
|
* @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
|
|
1765
1777
|
* in case of a Liveboard.
|
|
1778
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
1766
1779
|
* @example
|
|
1767
1780
|
* ```js
|
|
1768
1781
|
* searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
@@ -2082,12 +2095,21 @@ var HostEvent;
|
|
|
2082
2095
|
* Trigger the **Download PDF** action on an embedded Liveboard,
|
|
2083
2096
|
* visualization or Answer.
|
|
2084
2097
|
*
|
|
2098
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2099
|
+
*
|
|
2085
2100
|
* **NOTE**: The **Download** > **PDF** action is available on
|
|
2086
2101
|
* visualizations and Answers if the data is in tabular format.
|
|
2087
2102
|
* @example
|
|
2088
2103
|
* ```js
|
|
2089
2104
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
|
|
2090
2105
|
* ```
|
|
2106
|
+
* @example
|
|
2107
|
+
* ```js
|
|
2108
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
|
|
2109
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2110
|
+
* });
|
|
2111
|
+
* ```
|
|
2112
|
+
*
|
|
2091
2113
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2092
2114
|
*/
|
|
2093
2115
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
@@ -2189,7 +2211,8 @@ var HostEvent;
|
|
|
2189
2211
|
* This event is not supported in visualization embed and search embed.
|
|
2190
2212
|
* @param - object - To trigger the action for a specific visualization
|
|
2191
2213
|
* in Liveboard embed, pass in `vizId` as a key.
|
|
2192
|
-
*
|
|
2214
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2215
|
+
*
|
|
2193
2216
|
* @example
|
|
2194
2217
|
* ```js
|
|
2195
2218
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
@@ -2204,6 +2227,12 @@ var HostEvent;
|
|
|
2204
2227
|
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2205
2228
|
* });
|
|
2206
2229
|
* ```
|
|
2230
|
+
* @example
|
|
2231
|
+
* ```js
|
|
2232
|
+
* const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2233
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2234
|
+
* });
|
|
2235
|
+
* ```
|
|
2207
2236
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2208
2237
|
*/
|
|
2209
2238
|
HostEvent["Edit"] = "edit";
|
|
@@ -2324,6 +2353,7 @@ var HostEvent;
|
|
|
2324
2353
|
/**
|
|
2325
2354
|
* Trigger the **Download** action on charts in
|
|
2326
2355
|
* the embedded view.
|
|
2356
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2327
2357
|
* @example
|
|
2328
2358
|
* ```js
|
|
2329
2359
|
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
@@ -2332,6 +2362,11 @@ var HostEvent;
|
|
|
2332
2362
|
* ```js
|
|
2333
2363
|
* embed.trigger(HostEvent.Download)
|
|
2334
2364
|
* ```
|
|
2365
|
+
* ```js
|
|
2366
|
+
* spotterEmbed.trigger(HostEvent.Download, {
|
|
2367
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2368
|
+
* });
|
|
2369
|
+
* ```
|
|
2335
2370
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
2336
2371
|
* Use {@link DownloadAsPng}
|
|
2337
2372
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
@@ -2360,6 +2395,7 @@ var HostEvent;
|
|
|
2360
2395
|
/**
|
|
2361
2396
|
* Trigger the **Download** > **CSV** action on tables in
|
|
2362
2397
|
* the embedded view.
|
|
2398
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2363
2399
|
* @example
|
|
2364
2400
|
* ```js
|
|
2365
2401
|
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
@@ -2382,6 +2418,7 @@ var HostEvent;
|
|
|
2382
2418
|
/**
|
|
2383
2419
|
* Trigger the **Download** > **XLSX** action on tables
|
|
2384
2420
|
* in the embedded view.
|
|
2421
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2385
2422
|
* @example
|
|
2386
2423
|
* ```js
|
|
2387
2424
|
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
@@ -2417,7 +2454,7 @@ var HostEvent;
|
|
|
2417
2454
|
/**
|
|
2418
2455
|
* Trigger the **Save** action on a Liveboard or Answer.
|
|
2419
2456
|
* Saves the changes.
|
|
2420
|
-
* @param - `vizId` is required in Spotter
|
|
2457
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2421
2458
|
* @example
|
|
2422
2459
|
* ```js
|
|
2423
2460
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
@@ -2727,6 +2764,7 @@ var HostEvent;
|
|
|
2727
2764
|
HostEvent["UpdateParameters"] = "UpdateParameters";
|
|
2728
2765
|
/**
|
|
2729
2766
|
* Triggers GetParameters to fetch the runtime Parameters.
|
|
2767
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2730
2768
|
* ```js
|
|
2731
2769
|
* liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
|
|
2732
2770
|
* console.log('parameters', parameter);
|
|
@@ -2770,7 +2808,7 @@ var HostEvent;
|
|
|
2770
2808
|
* @param - optional attributes to set Answer properties.
|
|
2771
2809
|
* `name` - Name string for the Answer.
|
|
2772
2810
|
* `description` - Description text for the Answer.
|
|
2773
|
-
*
|
|
2811
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2774
2812
|
* @example
|
|
2775
2813
|
* ```js
|
|
2776
2814
|
* const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
|
|
@@ -2778,6 +2816,14 @@ var HostEvent;
|
|
|
2778
2816
|
* description: "Total sales by states in MidWest"
|
|
2779
2817
|
* });
|
|
2780
2818
|
* ```
|
|
2819
|
+
* @example
|
|
2820
|
+
* ```js
|
|
2821
|
+
* const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
|
|
2822
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c',
|
|
2823
|
+
* name: "Sales by states",
|
|
2824
|
+
* description: "Total sales by states in MidWest"
|
|
2825
|
+
* });
|
|
2826
|
+
* ```
|
|
2781
2827
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
2782
2828
|
*/
|
|
2783
2829
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
@@ -2809,7 +2855,7 @@ var HostEvent;
|
|
|
2809
2855
|
/**
|
|
2810
2856
|
* Triggers a search operation with the search tokens specified in
|
|
2811
2857
|
* the search query string in spotter embed.
|
|
2812
|
-
* @param - `
|
|
2858
|
+
* @param - `query`: Text string in Natural Language format
|
|
2813
2859
|
* @param - `executeSearch`: Boolean to execute search and update search query
|
|
2814
2860
|
* @example
|
|
2815
2861
|
* ```js
|
|
@@ -2818,6 +2864,7 @@ var HostEvent;
|
|
|
2818
2864
|
* executeSearch: true,
|
|
2819
2865
|
* })
|
|
2820
2866
|
* ```
|
|
2867
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2821
2868
|
*/
|
|
2822
2869
|
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
2823
2870
|
/**
|
|
@@ -2827,6 +2874,7 @@ var HostEvent;
|
|
|
2827
2874
|
* ```js
|
|
2828
2875
|
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
|
|
2829
2876
|
* ```
|
|
2877
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2830
2878
|
*/
|
|
2831
2879
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
2832
2880
|
/**
|
|
@@ -2835,6 +2883,7 @@ var HostEvent;
|
|
|
2835
2883
|
* ```js
|
|
2836
2884
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
2837
2885
|
* ```
|
|
2886
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2838
2887
|
*/
|
|
2839
2888
|
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
2840
2889
|
/**
|
|
@@ -2843,6 +2892,7 @@ var HostEvent;
|
|
|
2843
2892
|
* ```js
|
|
2844
2893
|
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
2845
2894
|
* ```
|
|
2895
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2846
2896
|
*/
|
|
2847
2897
|
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
2848
2898
|
/**
|
|
@@ -2851,17 +2901,19 @@ var HostEvent;
|
|
|
2851
2901
|
* ```js
|
|
2852
2902
|
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
2853
2903
|
* ```
|
|
2904
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2854
2905
|
*/
|
|
2855
2906
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
2856
2907
|
/**
|
|
2857
2908
|
* Toggle the visualization to chart or table view.
|
|
2858
|
-
* @param - `vizId `
|
|
2909
|
+
* @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
|
|
2859
2910
|
* @example
|
|
2860
2911
|
* ```js
|
|
2861
2912
|
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
|
|
2862
|
-
* vizId:
|
|
2913
|
+
* vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
|
|
2863
2914
|
* });
|
|
2864
2915
|
*```
|
|
2916
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2865
2917
|
*/
|
|
2866
2918
|
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
2867
2919
|
/**
|
|
@@ -2888,15 +2940,16 @@ var HostEvent;
|
|
|
2888
2940
|
*/
|
|
2889
2941
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
2890
2942
|
/**
|
|
2891
|
-
* Trigger the *Ask
|
|
2943
|
+
* Trigger the *Ask Spotter* action for visualizations
|
|
2944
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2892
2945
|
* @example
|
|
2893
2946
|
* ```js
|
|
2894
|
-
*
|
|
2895
|
-
* {
|
|
2947
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter,
|
|
2948
|
+
* {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
|
|
2896
2949
|
* ```
|
|
2897
2950
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2898
2951
|
*/
|
|
2899
|
-
HostEvent["AskSpotter"] = "
|
|
2952
|
+
HostEvent["AskSpotter"] = "AskSpotter";
|
|
2900
2953
|
/**
|
|
2901
2954
|
* @hidden
|
|
2902
2955
|
* Triggers the update of the embed params.
|
|
@@ -3206,27 +3259,27 @@ var Action;
|
|
|
3206
3259
|
*/
|
|
3207
3260
|
Action["ConfigureFilter"] = "configureFilter";
|
|
3208
3261
|
/**
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3262
|
+
* The **Collapse data sources** icon on the Search page.
|
|
3263
|
+
* Collapses the panel showing data sources.
|
|
3264
|
+
*
|
|
3265
|
+
* @example
|
|
3266
|
+
* ```js
|
|
3267
|
+
* disabledActions: [Action.CollapseDataPanel]
|
|
3268
|
+
* ```
|
|
3269
|
+
* @version: SDK: 1.1.0 | ThoughtSpot Cloud: ts7.may.cl, 8.4.1.sw
|
|
3270
|
+
*/
|
|
3218
3271
|
Action["CollapseDataSources"] = "collapseDataSources";
|
|
3219
3272
|
/**
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3273
|
+
* The **Collapse data panel** icon on the Search page.
|
|
3274
|
+
* Collapses the data panel view.
|
|
3275
|
+
*
|
|
3276
|
+
* @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
|
|
3277
|
+
*
|
|
3278
|
+
* @example
|
|
3279
|
+
* ```js
|
|
3280
|
+
* disabledActions: [Action.CollapseDataPanel]
|
|
3281
|
+
* ```
|
|
3282
|
+
*/
|
|
3230
3283
|
Action["CollapseDataPanel"] = "collapseDataPanel";
|
|
3231
3284
|
/**
|
|
3232
3285
|
* The **Choose sources** button on Search page.
|
|
@@ -3922,6 +3975,17 @@ var Action;
|
|
|
3922
3975
|
* @version SDK: 1.25.0 | ThoughtSpot Cloud: 9.6.0.cl
|
|
3923
3976
|
*/
|
|
3924
3977
|
Action["EnableContextualChangeAnalysis"] = "enableContextualChangeAnalysis";
|
|
3978
|
+
/**
|
|
3979
|
+
* Action ID to hide or disable Iterative Change Analysis option
|
|
3980
|
+
* on contextual change analysis Inisght charts context menu
|
|
3981
|
+
*
|
|
3982
|
+
* @example
|
|
3983
|
+
* ```js
|
|
3984
|
+
* disabledActions: [Action.EnableIterativeChangeAnalysis]
|
|
3985
|
+
* ```
|
|
3986
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 9.12.0.cl
|
|
3987
|
+
*/
|
|
3988
|
+
Action["EnableIterativeChangeAnalysis"] = "enableIterativeChangeAnalysis";
|
|
3925
3989
|
/**
|
|
3926
3990
|
* Action ID to hide or disable Natural Language Search query.
|
|
3927
3991
|
*
|
|
@@ -4291,6 +4355,39 @@ var Action;
|
|
|
4291
4355
|
* @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
|
|
4292
4356
|
*/
|
|
4293
4357
|
Action["InConversationTraining"] = "InConversationTraining";
|
|
4358
|
+
/**
|
|
4359
|
+
* Action ID to hide the warnings banner in
|
|
4360
|
+
* Spotter results. It's an EA feature and
|
|
4361
|
+
* handled by LD.
|
|
4362
|
+
* @example
|
|
4363
|
+
* ```js
|
|
4364
|
+
* hiddenAction: [Action.SpotterWarningsBanner]
|
|
4365
|
+
* ```
|
|
4366
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4367
|
+
*/
|
|
4368
|
+
Action["SpotterWarningsBanner"] = "SpotterWarningsBanner";
|
|
4369
|
+
/**
|
|
4370
|
+
* Action ID to hide the warnings border on the knowledge
|
|
4371
|
+
* card in Spotter results. It's an EA feature and
|
|
4372
|
+
* handled by LD.
|
|
4373
|
+
* @example
|
|
4374
|
+
* ```js
|
|
4375
|
+
* hiddenAction: [Action.SpotterWarningsOnTokens]
|
|
4376
|
+
* ```
|
|
4377
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4378
|
+
*/
|
|
4379
|
+
Action["SpotterWarningsOnTokens"] = "SpotterWarningsOnTokens";
|
|
4380
|
+
/**
|
|
4381
|
+
* Action ID to disable the click event handler on knowledge
|
|
4382
|
+
* card in Spotter results. It's an EA feature and
|
|
4383
|
+
* handled by LD.
|
|
4384
|
+
* @example
|
|
4385
|
+
* ```js
|
|
4386
|
+
* hiddenAction: [Action.SpotterTokenQuickEdit]
|
|
4387
|
+
* ```
|
|
4388
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4389
|
+
*/
|
|
4390
|
+
Action["SpotterTokenQuickEdit"] = "SpotterTokenQuickEdit";
|
|
4294
4391
|
})(Action || (Action = {}));
|
|
4295
4392
|
var PrefetchFeatures;
|
|
4296
4393
|
(function (PrefetchFeatures) {
|
|
@@ -8036,7 +8133,7 @@ class AnswerService {
|
|
|
8036
8133
|
async getTML() {
|
|
8037
8134
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8038
8135
|
const edoc = object[0].edoc;
|
|
8039
|
-
const YAML = await import('./index-
|
|
8136
|
+
const YAML = await import('./index-BDlM0f0T.js');
|
|
8040
8137
|
const parsedDoc = YAML.parse(edoc);
|
|
8041
8138
|
return {
|
|
8042
8139
|
answer: {
|
|
@@ -15770,7 +15867,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
15770
15867
|
return e;
|
|
15771
15868
|
}
|
|
15772
15869
|
|
|
15773
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
15870
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.41.0-pre-render-1";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 . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.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 | coveralls","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:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",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};
|
|
15774
15871
|
|
|
15775
15872
|
/**
|
|
15776
15873
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15996,7 +16093,6 @@ class TsEmbed {
|
|
|
15996
16093
|
*/
|
|
15997
16094
|
this.fullscreenChangeHandler = null;
|
|
15998
16095
|
this.subscribedListeners = {};
|
|
15999
|
-
this.isEmbedContainerLoaded = false;
|
|
16000
16096
|
/**
|
|
16001
16097
|
* Send Custom style as part of payload of APP_INIT
|
|
16002
16098
|
* @param _
|
|
@@ -16068,20 +16164,49 @@ class TsEmbed {
|
|
|
16068
16164
|
});
|
|
16069
16165
|
notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
|
|
16070
16166
|
};
|
|
16071
|
-
this.pendingEvents = [];
|
|
16072
16167
|
/**
|
|
16073
16168
|
* Register APP_INIT event and sendback init payload
|
|
16074
16169
|
*/
|
|
16075
16170
|
this.registerAppInit = () => {
|
|
16076
16171
|
this.on(EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
|
|
16077
|
-
this.on(EmbedEvent.AuthInit, () => {
|
|
16078
|
-
this.isEmbedContainerLoaded = true;
|
|
16079
|
-
this.executePendingEvents();
|
|
16080
|
-
}, { start: false }, true);
|
|
16081
16172
|
this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
16082
16173
|
this.on(EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
|
|
16174
|
+
const embedListenerReadyHandler = this.createEmbedContainerHandler(EmbedEvent.EmbedListenerReady);
|
|
16175
|
+
this.on(EmbedEvent.EmbedListenerReady, embedListenerReadyHandler, { start: false }, true);
|
|
16176
|
+
const authInitHandler = this.createEmbedContainerHandler(EmbedEvent.AuthInit);
|
|
16177
|
+
this.on(EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
|
|
16083
16178
|
};
|
|
16084
16179
|
this.showPreRenderByDefault = false;
|
|
16180
|
+
/**
|
|
16181
|
+
* @hidden
|
|
16182
|
+
* Internal state to track if the embed container is loaded.
|
|
16183
|
+
* This is used to trigger events after the embed container is loaded.
|
|
16184
|
+
*/
|
|
16185
|
+
this.isEmbedContainerLoaded = false;
|
|
16186
|
+
/**
|
|
16187
|
+
* @hidden
|
|
16188
|
+
* Internal state to track the callbacks to be executed after the embed container
|
|
16189
|
+
* is loaded.
|
|
16190
|
+
* This is used to trigger events after the embed container is loaded.
|
|
16191
|
+
*/
|
|
16192
|
+
this.embedContainerReadyCallbacks = [];
|
|
16193
|
+
this.createEmbedContainerHandler = (source) => () => {
|
|
16194
|
+
const processEmbedContainerReady = () => {
|
|
16195
|
+
logger$3.debug('processEmbedContainerReady');
|
|
16196
|
+
this.isEmbedContainerLoaded = true;
|
|
16197
|
+
this.executeEmbedContainerReadyCallbacks();
|
|
16198
|
+
};
|
|
16199
|
+
if (source === EmbedEvent.AuthInit) {
|
|
16200
|
+
const AUTH_INIT_FALLBACK_DELAY = 1000;
|
|
16201
|
+
// Wait for 1 second to ensure the embed container is loaded
|
|
16202
|
+
// This is a workaround to ensure the embed container is loaded
|
|
16203
|
+
// this is needed until all clusters have EmbedListenerReady event
|
|
16204
|
+
setTimeout(processEmbedContainerReady, AUTH_INIT_FALLBACK_DELAY);
|
|
16205
|
+
}
|
|
16206
|
+
else if (source === EmbedEvent.EmbedListenerReady) {
|
|
16207
|
+
processEmbedContainerReady();
|
|
16208
|
+
}
|
|
16209
|
+
};
|
|
16085
16210
|
this.validatePreRenderViewConfig = (viewConfig) => {
|
|
16086
16211
|
var _a;
|
|
16087
16212
|
const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
|
|
@@ -16103,7 +16228,6 @@ class TsEmbed {
|
|
|
16103
16228
|
});
|
|
16104
16229
|
}
|
|
16105
16230
|
};
|
|
16106
|
-
this.id = Date.now().toString();
|
|
16107
16231
|
this.el = getDOMNode(domSelector);
|
|
16108
16232
|
this.eventHandlerMap = new Map();
|
|
16109
16233
|
this.isError = false;
|
|
@@ -16116,9 +16240,9 @@ class TsEmbed {
|
|
|
16116
16240
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
16117
16241
|
...viewConfig,
|
|
16118
16242
|
});
|
|
16119
|
-
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
16120
16243
|
const embedConfig = getEmbedConfig();
|
|
16121
16244
|
this.embedConfig = embedConfig;
|
|
16245
|
+
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
16122
16246
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
16123
16247
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
16124
16248
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
@@ -16290,43 +16414,6 @@ class TsEmbed {
|
|
|
16290
16414
|
async getAppInitData() {
|
|
16291
16415
|
return this.getDefaultAppInitData();
|
|
16292
16416
|
}
|
|
16293
|
-
getPreRenderObj() {
|
|
16294
|
-
var _a;
|
|
16295
|
-
const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
16296
|
-
if (embedObj === this) {
|
|
16297
|
-
logger$3.info('embedObj is same as this');
|
|
16298
|
-
}
|
|
16299
|
-
return embedObj;
|
|
16300
|
-
}
|
|
16301
|
-
checkEmbedContainerLoaded() {
|
|
16302
|
-
if (this.isEmbedContainerLoaded)
|
|
16303
|
-
return true;
|
|
16304
|
-
const preRenderObj = this.getPreRenderObj();
|
|
16305
|
-
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
16306
|
-
this.isEmbedContainerLoaded = true;
|
|
16307
|
-
}
|
|
16308
|
-
return this.isEmbedContainerLoaded;
|
|
16309
|
-
}
|
|
16310
|
-
executePendingEvents() {
|
|
16311
|
-
logger$3.debug('executePendingEvents', this.pendingEvents);
|
|
16312
|
-
setTimeout(() => {
|
|
16313
|
-
this.pendingEvents.forEach((event) => {
|
|
16314
|
-
var _a;
|
|
16315
|
-
this.trigger(event.eventType, event.data);
|
|
16316
|
-
(_a = event.onEventTriggered) === null || _a === void 0 ? void 0 : _a.call(event);
|
|
16317
|
-
});
|
|
16318
|
-
this.pendingEvents = [];
|
|
16319
|
-
}, 1000);
|
|
16320
|
-
}
|
|
16321
|
-
triggerAfterLoad(eventType, data, onEventTriggered) {
|
|
16322
|
-
if (this.checkEmbedContainerLoaded()) {
|
|
16323
|
-
this.trigger(eventType, data);
|
|
16324
|
-
onEventTriggered === null || onEventTriggered === void 0 ? void 0 : onEventTriggered();
|
|
16325
|
-
}
|
|
16326
|
-
else {
|
|
16327
|
-
this.pendingEvents.push({ eventType, data, onEventTriggered });
|
|
16328
|
-
}
|
|
16329
|
-
}
|
|
16330
16417
|
/**
|
|
16331
16418
|
* Constructs the base URL string to load the ThoughtSpot app.
|
|
16332
16419
|
* @param query
|
|
@@ -16881,6 +16968,43 @@ class TsEmbed {
|
|
|
16881
16968
|
logger$3.log('Event Port is not defined');
|
|
16882
16969
|
}
|
|
16883
16970
|
}
|
|
16971
|
+
getPreRenderObj() {
|
|
16972
|
+
var _a;
|
|
16973
|
+
const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
16974
|
+
if (embedObj === this) {
|
|
16975
|
+
logger$3.info('embedObj is same as this');
|
|
16976
|
+
}
|
|
16977
|
+
return embedObj;
|
|
16978
|
+
}
|
|
16979
|
+
checkEmbedContainerLoaded() {
|
|
16980
|
+
if (this.isEmbedContainerLoaded)
|
|
16981
|
+
return true;
|
|
16982
|
+
const preRenderObj = this.getPreRenderObj();
|
|
16983
|
+
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
16984
|
+
this.isEmbedContainerLoaded = true;
|
|
16985
|
+
}
|
|
16986
|
+
return this.isEmbedContainerLoaded;
|
|
16987
|
+
}
|
|
16988
|
+
executeEmbedContainerReadyCallbacks() {
|
|
16989
|
+
logger$3.debug('executePendingEvents', this.embedContainerReadyCallbacks);
|
|
16990
|
+
this.embedContainerReadyCallbacks.forEach((callback) => {
|
|
16991
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
16992
|
+
});
|
|
16993
|
+
this.embedContainerReadyCallbacks = [];
|
|
16994
|
+
}
|
|
16995
|
+
/**
|
|
16996
|
+
* Executes a callback after the embed container is loaded.
|
|
16997
|
+
* @param callback The callback to execute
|
|
16998
|
+
*/
|
|
16999
|
+
executeAfterEmbedContainerLoaded(callback) {
|
|
17000
|
+
if (this.checkEmbedContainerLoaded()) {
|
|
17001
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
17002
|
+
}
|
|
17003
|
+
else {
|
|
17004
|
+
logger$3.debug('pushing callback to embedContainerReadyCallbacks', callback);
|
|
17005
|
+
this.embedContainerReadyCallbacks.push(callback);
|
|
17006
|
+
}
|
|
17007
|
+
}
|
|
16884
17008
|
/**
|
|
16885
17009
|
* Triggers an event to the embedded app
|
|
16886
17010
|
* @param {HostEvent} messageType The event type
|
|
@@ -17026,7 +17150,9 @@ class TsEmbed {
|
|
|
17026
17150
|
}
|
|
17027
17151
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
17028
17152
|
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
17029
|
-
this.
|
|
17153
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
17154
|
+
this.trigger(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
17155
|
+
});
|
|
17030
17156
|
}
|
|
17031
17157
|
this.beforePrerenderVisible();
|
|
17032
17158
|
if (this.el) {
|
|
@@ -17818,10 +17944,18 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
17818
17944
|
else {
|
|
17819
17945
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
17820
17946
|
}
|
|
17947
|
+
// Set navigation to v2 by default to avoid problems like the app
|
|
17948
|
+
// switcher (9-dot menu) not showing when v3 navigation is turned on
|
|
17949
|
+
// at the cluster level.
|
|
17950
|
+
// To use v3 navigation, we must manually set the discoveryExperience
|
|
17951
|
+
// settings.
|
|
17952
|
+
params[Param.NavigationVersion] = 'v2';
|
|
17821
17953
|
if (discoveryExperience) {
|
|
17822
17954
|
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
17823
17955
|
if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
|
|
17824
17956
|
params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
|
|
17957
|
+
// Enable the modularHomeExperience when Sliding is enabled.
|
|
17958
|
+
params[Param.ModularHomeExperienceEnabled] = true;
|
|
17825
17959
|
}
|
|
17826
17960
|
// homePage v2 will enable the modular home page
|
|
17827
17961
|
// and it will override the modularHomeExperience value
|
|
@@ -18105,7 +18239,16 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
18105
18239
|
}
|
|
18106
18240
|
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
18107
18241
|
};
|
|
18108
|
-
|
|
18242
|
+
/**
|
|
18243
|
+
* @hidden
|
|
18244
|
+
* Internal state to track the current liveboard id.
|
|
18245
|
+
* This is used to navigate to the correct liveboard when the prerender is visible.
|
|
18246
|
+
*/
|
|
18247
|
+
this.currentLiveboardState = {
|
|
18248
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
18249
|
+
vizId: this.viewConfig.vizId,
|
|
18250
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
18251
|
+
};
|
|
18109
18252
|
if (this.viewConfig.fullHeight === true) {
|
|
18110
18253
|
if (this.viewConfig.vizId) {
|
|
18111
18254
|
logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
|
|
@@ -18279,10 +18422,15 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
18279
18422
|
}
|
|
18280
18423
|
beforePrerenderVisible() {
|
|
18281
18424
|
const embedObj = this.getPreRenderObj();
|
|
18282
|
-
|
|
18283
|
-
|
|
18284
|
-
if (embedObj)
|
|
18285
|
-
embedObj.
|
|
18425
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
18426
|
+
this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId);
|
|
18427
|
+
if (embedObj) {
|
|
18428
|
+
embedObj.currentLiveboardState = {
|
|
18429
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
18430
|
+
vizId: this.viewConfig.vizId,
|
|
18431
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
18432
|
+
};
|
|
18433
|
+
}
|
|
18286
18434
|
});
|
|
18287
18435
|
}
|
|
18288
18436
|
async handleRenderForPrerender() {
|
|
@@ -18345,13 +18493,13 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
18345
18493
|
this.postRender();
|
|
18346
18494
|
return this;
|
|
18347
18495
|
}
|
|
18348
|
-
navigateToLiveboard(liveboardId, vizId, activeTabId
|
|
18496
|
+
navigateToLiveboard(liveboardId, vizId, activeTabId) {
|
|
18349
18497
|
const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId);
|
|
18350
18498
|
this.viewConfig.liveboardId = liveboardId;
|
|
18351
18499
|
this.viewConfig.activeTabId = activeTabId;
|
|
18352
18500
|
this.viewConfig.vizId = vizId;
|
|
18353
18501
|
if (this.isRendered) {
|
|
18354
|
-
this.
|
|
18502
|
+
this.trigger(HostEvent.Navigate, path.substring(1));
|
|
18355
18503
|
}
|
|
18356
18504
|
else if (this.viewConfig.preRenderId) {
|
|
18357
18505
|
this.preRender(true);
|
|
@@ -18936,7 +19084,7 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
18936
19084
|
this.viewConfig = viewConfig;
|
|
18937
19085
|
}
|
|
18938
19086
|
getEmbedParamsObject() {
|
|
18939
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
|
|
19087
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
18940
19088
|
if (!worksheetId) {
|
|
18941
19089
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
18942
19090
|
}
|
|
@@ -18960,7 +19108,7 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
18960
19108
|
return queryParams;
|
|
18961
19109
|
}
|
|
18962
19110
|
getIframeSrc() {
|
|
18963
|
-
const { worksheetId, searchOptions, } = this.viewConfig;
|
|
19111
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
18964
19112
|
const path = 'insights/conv-assist';
|
|
18965
19113
|
const queryParams = this.getEmbedParamsObject();
|
|
18966
19114
|
let query = '';
|
|
@@ -18968,6 +19116,14 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
18968
19116
|
if (queryParamsString) {
|
|
18969
19117
|
query = `?${queryParamsString}`;
|
|
18970
19118
|
}
|
|
19119
|
+
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
19120
|
+
if (filterQuery && !excludeRuntimeFiltersfromURL) {
|
|
19121
|
+
query += `&${filterQuery}`;
|
|
19122
|
+
}
|
|
19123
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
19124
|
+
if (parameterQuery && !excludeRuntimeParametersfromURL) {
|
|
19125
|
+
query += `&${parameterQuery}`;
|
|
19126
|
+
}
|
|
18971
19127
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams({
|
|
18972
19128
|
worksheet: worksheetId,
|
|
18973
19129
|
query: (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchQuery) || '',
|