@thoughtspot/visual-embed-sdk 1.52.0 → 1.52.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 +9 -1
- package/cjs/src/contracts/contracts.spec.d.ts +2 -0
- package/cjs/src/contracts/contracts.spec.d.ts.map +1 -0
- package/cjs/src/contracts/contracts.spec.js +345 -0
- package/cjs/src/contracts/contracts.spec.js.map +1 -0
- package/cjs/src/contracts/embed-event-payloads.d.ts +73 -0
- package/cjs/src/contracts/embed-event-payloads.d.ts.map +1 -0
- package/cjs/src/contracts/embed-event-payloads.js +3 -0
- package/cjs/src/contracts/embed-event-payloads.js.map +1 -0
- package/cjs/src/contracts/host-event-contracts.d.ts +378 -0
- package/cjs/src/contracts/host-event-contracts.d.ts.map +1 -0
- package/cjs/src/contracts/host-event-contracts.js +3 -0
- package/cjs/src/contracts/host-event-contracts.js.map +1 -0
- package/cjs/src/contracts/index.d.ts +22 -0
- package/cjs/src/contracts/index.d.ts.map +1 -0
- package/cjs/src/contracts/index.js +33 -0
- package/cjs/src/contracts/index.js.map +1 -0
- package/cjs/src/contracts/ui-passthrough-contracts.d.ts +277 -0
- package/cjs/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
- package/cjs/src/{embed/hostEventClient/contracts.js → contracts/ui-passthrough-contracts.js} +6 -2
- package/cjs/src/contracts/ui-passthrough-contracts.js.map +1 -0
- package/cjs/src/embed/app.d.ts +17 -140
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +20 -120
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +70 -26
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/events.spec.js +12 -2
- package/cjs/src/embed/events.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +3 -2
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +23 -18
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +36 -36
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.js +3 -3
- package/cjs/src/embed/hostEventClient/utils.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +9 -161
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +66 -134
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +211 -28
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/search.d.ts +14 -0
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +4 -1
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +65 -0
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +17 -22
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +82 -56
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +325 -17
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/full-height.d.ts +137 -0
- package/cjs/src/full-height.d.ts.map +1 -0
- package/cjs/src/full-height.js +272 -0
- package/cjs/src/full-height.js.map +1 -0
- package/cjs/src/full-height.spec.d.ts +2 -0
- package/cjs/src/full-height.spec.d.ts.map +1 -0
- package/cjs/src/full-height.spec.js +835 -0
- package/cjs/src/full-height.spec.js.map +1 -0
- package/cjs/src/index.d.ts +4 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -3
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/all-types-export.parity.spec.js +55 -3
- package/cjs/src/react/all-types-export.parity.spec.js.map +1 -1
- package/cjs/src/types.d.ts +540 -3
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +326 -1
- 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 +19 -51
- package/cjs/src/utils/processTrigger.js.map +1 -1
- package/cjs/src/utils/transport/iframe-transport.d.ts +55 -0
- package/cjs/src/utils/transport/iframe-transport.d.ts.map +1 -0
- package/cjs/src/utils/transport/iframe-transport.js +108 -0
- package/cjs/src/utils/transport/iframe-transport.js.map +1 -0
- package/cjs/src/utils/transport/iframe-transport.spec.d.ts +2 -0
- package/cjs/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
- package/cjs/src/utils/transport/iframe-transport.spec.js +140 -0
- package/cjs/src/utils/transport/iframe-transport.spec.js.map +1 -0
- package/cjs/src/utils.d.ts +18 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +39 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +62 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-BMppCU63.js → index-C1pmYb5H.js} +1 -1
- package/dist/src/contracts/contracts.spec.d.ts +2 -0
- package/dist/src/contracts/contracts.spec.d.ts.map +1 -0
- package/dist/src/contracts/embed-event-payloads.d.ts +73 -0
- package/dist/src/contracts/embed-event-payloads.d.ts.map +1 -0
- package/dist/src/contracts/host-event-contracts.d.ts +378 -0
- package/dist/src/contracts/host-event-contracts.d.ts.map +1 -0
- package/dist/src/contracts/index.d.ts +22 -0
- package/dist/src/contracts/index.d.ts.map +1 -0
- package/dist/src/contracts/ui-passthrough-contracts.d.ts +277 -0
- package/dist/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
- package/dist/src/embed/app.d.ts +17 -140
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +3 -2
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +9 -161
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +14 -0
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +17 -22
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/full-height.d.ts +137 -0
- package/dist/src/full-height.d.ts.map +1 -0
- package/dist/src/full-height.spec.d.ts +2 -0
- package/dist/src/full-height.spec.d.ts.map +1 -0
- package/dist/src/index.d.ts +4 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/types.d.ts +540 -3
- 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/src/utils/transport/iframe-transport.d.ts +55 -0
- package/dist/src/utils/transport/iframe-transport.d.ts.map +1 -0
- package/dist/src/utils/transport/iframe-transport.spec.d.ts +2 -0
- package/dist/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
- package/dist/src/utils.d.ts +18 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +925 -363
- package/dist/tsembed-react.js +924 -362
- package/dist/tsembed.es.js +925 -363
- package/dist/tsembed.js +924 -362
- package/dist/visual-embed-sdk-react-full.d.ts +1357 -656
- package/dist/visual-embed-sdk-react.d.ts +1257 -606
- package/dist/visual-embed-sdk.d.ts +1320 -642
- package/lib/package.json +9 -1
- package/lib/src/contracts/contracts.spec.d.ts +2 -0
- package/lib/src/contracts/contracts.spec.d.ts.map +1 -0
- package/lib/src/contracts/contracts.spec.js +342 -0
- package/lib/src/contracts/contracts.spec.js.map +1 -0
- package/lib/src/contracts/embed-event-payloads.d.ts +73 -0
- package/lib/src/contracts/embed-event-payloads.d.ts.map +1 -0
- package/lib/src/contracts/embed-event-payloads.js +2 -0
- package/lib/src/contracts/embed-event-payloads.js.map +1 -0
- package/lib/src/contracts/host-event-contracts.d.ts +378 -0
- package/lib/src/contracts/host-event-contracts.d.ts.map +1 -0
- package/lib/src/contracts/host-event-contracts.js +2 -0
- package/lib/src/contracts/host-event-contracts.js.map +1 -0
- package/lib/src/contracts/index.d.ts +22 -0
- package/lib/src/contracts/index.d.ts.map +1 -0
- package/lib/src/contracts/index.js +22 -0
- package/lib/src/contracts/index.js.map +1 -0
- package/lib/src/contracts/ui-passthrough-contracts.d.ts +277 -0
- package/lib/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
- package/lib/src/{embed/hostEventClient/contracts.js → contracts/ui-passthrough-contracts.js} +6 -2
- package/lib/src/contracts/ui-passthrough-contracts.js.map +1 -0
- package/lib/src/embed/app.d.ts +17 -140
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +22 -122
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +70 -26
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/events.spec.js +12 -2
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +3 -2
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +6 -1
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/utils.js +1 -1
- package/lib/src/embed/hostEventClient/utils.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +9 -161
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +67 -135
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +211 -28
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/search.d.ts +14 -0
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +4 -1
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +65 -0
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +17 -22
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +82 -56
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +322 -14
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/full-height.d.ts +137 -0
- package/lib/src/full-height.d.ts.map +1 -0
- package/lib/src/full-height.js +268 -0
- package/lib/src/full-height.js.map +1 -0
- package/lib/src/full-height.spec.d.ts +2 -0
- package/lib/src/full-height.spec.d.ts.map +1 -0
- package/lib/src/full-height.spec.js +833 -0
- package/lib/src/full-height.spec.js.map +1 -0
- package/lib/src/index.d.ts +4 -3
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/all-types-export.parity.spec.js +55 -3
- package/lib/src/react/all-types-export.parity.spec.js.map +1 -1
- package/lib/src/types.d.ts +540 -3
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +326 -1
- 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 +19 -51
- package/lib/src/utils/processTrigger.js.map +1 -1
- package/lib/src/utils/transport/iframe-transport.d.ts +55 -0
- package/lib/src/utils/transport/iframe-transport.d.ts.map +1 -0
- package/lib/src/utils/transport/iframe-transport.js +101 -0
- package/lib/src/utils/transport/iframe-transport.js.map +1 -0
- package/lib/src/utils/transport/iframe-transport.spec.d.ts +2 -0
- package/lib/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
- package/lib/src/utils/transport/iframe-transport.spec.js +138 -0
- package/lib/src/utils/transport/iframe-transport.spec.js.map +1 -0
- package/lib/src/utils.d.ts +18 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +37 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +63 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +1320 -642
- package/package.json +9 -1
- package/src/contracts/contracts.spec.ts +392 -0
- package/src/contracts/embed-event-payloads.ts +83 -0
- package/src/contracts/host-event-contracts.ts +456 -0
- package/src/contracts/index.ts +53 -0
- package/src/contracts/ui-passthrough-contracts.ts +301 -0
- package/src/embed/app.spec.ts +86 -34
- package/src/embed/app.ts +37 -264
- package/src/embed/events.spec.ts +14 -2
- package/src/embed/hostEventClient/host-event-client.spec.ts +2 -2
- package/src/embed/hostEventClient/host-event-client.ts +18 -5
- package/src/embed/hostEventClient/utils.ts +2 -1
- package/src/embed/liveboard.spec.ts +257 -38
- package/src/embed/liveboard.ts +75 -296
- package/src/embed/search.spec.ts +80 -0
- package/src/embed/search.ts +20 -0
- package/src/embed/ts-embed.spec.ts +448 -15
- package/src/embed/ts-embed.ts +109 -66
- package/src/full-height.spec.ts +1008 -0
- package/src/full-height.ts +361 -0
- package/src/index.ts +93 -5
- package/src/react/all-types-export.parity.spec.ts +63 -3
- package/src/react/all-types-export.ts +45 -0
- package/src/types.ts +540 -1
- package/src/utils/processTrigger.ts +28 -58
- package/src/utils/transport/iframe-transport.spec.ts +177 -0
- package/src/utils/transport/iframe-transport.ts +122 -0
- package/src/utils.spec.ts +71 -0
- package/src/utils.ts +38 -0
- package/cjs/src/embed/hostEventClient/contracts.d.ts +0 -231
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +0 -1
- package/cjs/src/embed/hostEventClient/contracts.js.map +0 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +0 -231
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +0 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +0 -231
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +0 -1
- package/lib/src/embed/hostEventClient/contracts.js.map +0 -1
- package/src/embed/hostEventClient/contracts.ts +0 -262
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.52.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.52.1 */
|
|
2
2
|
'use client';
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -858,6 +858,9 @@ var EmbedEvent;
|
|
|
858
858
|
EmbedEvent["Download"] = "download";
|
|
859
859
|
/**
|
|
860
860
|
* Emitted when the download action is triggered on an Answer.
|
|
861
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
862
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
863
|
+
* accepts the union now; per-context enforced next release.
|
|
861
864
|
* Use start:true to subscribe to when download is initiated, or end:true to
|
|
862
865
|
* subscribe to when download is completed. Default is end:true.
|
|
863
866
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
|
|
@@ -874,6 +877,9 @@ var EmbedEvent;
|
|
|
874
877
|
EmbedEvent["DownloadAsPng"] = "downloadAsPng";
|
|
875
878
|
/**
|
|
876
879
|
* Emitted when the Download as PDF action is triggered on an Answer
|
|
880
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer; plus
|
|
881
|
+
* liveboardId on Liveboard), {@link RequiredVizRequest} (Spotter). trigger()
|
|
882
|
+
* accepts the union now; per-context enforced next release.
|
|
877
883
|
* Use start:true to subscribe to when download as PDF is initiated, or end:true to
|
|
878
884
|
* subscribe to when download as PDF is completed. Default is end:true.
|
|
879
885
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -890,6 +896,9 @@ var EmbedEvent;
|
|
|
890
896
|
EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
891
897
|
/**
|
|
892
898
|
* Emitted when the Download as CSV action is triggered on an Answer.
|
|
899
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
900
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
901
|
+
* accepts the union now; per-context enforced next release.
|
|
893
902
|
* Use start:true to subscribe to when download as CSV is initiated, or end:true to
|
|
894
903
|
* subscribe to when download as CSV is completed. Default is end:true.
|
|
895
904
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -906,6 +915,9 @@ var EmbedEvent;
|
|
|
906
915
|
EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
|
|
907
916
|
/**
|
|
908
917
|
* Emitted when the Download as XLSX action is triggered on an Answer.
|
|
918
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
919
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
920
|
+
* accepts the union now; per-context enforced next release.
|
|
909
921
|
* Use start:true to subscribe to when download as XLSX is initiated, or end:true to
|
|
910
922
|
* subscribe to when download as XLSX is completed. Default is end:true.
|
|
911
923
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -1184,6 +1196,9 @@ var EmbedEvent;
|
|
|
1184
1196
|
EmbedEvent["Schedule"] = "subscription";
|
|
1185
1197
|
/**
|
|
1186
1198
|
* Emitted when a user clicks **Edit** on a Liveboard or visualization
|
|
1199
|
+
* Payload varies by context: {@link VizScopedRequest} (Liveboard),
|
|
1200
|
+
* {@link RequiredVizRequest} (Spotter, vizId required). trigger() accepts the
|
|
1201
|
+
* union now; per-context enforced next release.
|
|
1187
1202
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1188
1203
|
* @example
|
|
1189
1204
|
* ```js
|
|
@@ -2263,6 +2278,7 @@ var HostEvent;
|
|
|
2263
2278
|
* the search query string.
|
|
2264
2279
|
* Supported in `AppEmbed` and `SearchEmbed` deployments.
|
|
2265
2280
|
* Includes the following properties:
|
|
2281
|
+
* Payload: {@link SearchRequest}.
|
|
2266
2282
|
* @param - Includes the following keys:
|
|
2267
2283
|
* - `searchQuery`: Query string with search tokens.
|
|
2268
2284
|
* - `dataSources`: Data source GUID to search on.
|
|
@@ -2290,6 +2306,9 @@ var HostEvent;
|
|
|
2290
2306
|
HostEvent["Search"] = "search";
|
|
2291
2307
|
/**
|
|
2292
2308
|
* Triggers a drill on certain points of the specified column
|
|
2309
|
+
* Payload: {@link DrillDownRequest}; in Liveboard context vizId is required
|
|
2310
|
+
* ({@link RequiredVizRequest}). trigger() accepts the union now; per-context
|
|
2311
|
+
* enforced next release.
|
|
2293
2312
|
* Includes the following properties:
|
|
2294
2313
|
* @param - Includes the following keys:
|
|
2295
2314
|
* - `points`: An object containing `selectedPoints` and/or `clickedPoint`
|
|
@@ -2369,6 +2388,8 @@ var HostEvent;
|
|
|
2369
2388
|
HostEvent["Reload"] = "reload";
|
|
2370
2389
|
/**
|
|
2371
2390
|
* Get iframe URL for the current embed view.
|
|
2391
|
+
* Payload: none.
|
|
2392
|
+
* Response: {@link GetIframeUrlResponse}.
|
|
2372
2393
|
* @example
|
|
2373
2394
|
* ```js
|
|
2374
2395
|
* const url = embed.trigger(HostEvent.GetIframeUrl);
|
|
@@ -2387,6 +2408,7 @@ var HostEvent;
|
|
|
2387
2408
|
HostEvent["GetIframeUrl"] = "GetIframeUrl";
|
|
2388
2409
|
/**
|
|
2389
2410
|
* Display specific visualizations on a Liveboard.
|
|
2411
|
+
* Payload: `string[]`.
|
|
2390
2412
|
* @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
|
|
2391
2413
|
* in this parameter will be hidden.
|
|
2392
2414
|
* @example
|
|
@@ -2409,6 +2431,7 @@ var HostEvent;
|
|
|
2409
2431
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
2410
2432
|
/**
|
|
2411
2433
|
* Set a Liveboard tab as an active tab.
|
|
2434
|
+
* Payload: {@link SetActiveTabRequest}.
|
|
2412
2435
|
* @param - tabId - string of id of Tab to show
|
|
2413
2436
|
* @example
|
|
2414
2437
|
* ```js
|
|
@@ -2436,6 +2459,7 @@ var HostEvent;
|
|
|
2436
2459
|
* and `AppEmbed` only. In full application embedding, this event updates
|
|
2437
2460
|
* the runtime filters applied on the Liveboard and saved Answer objects.
|
|
2438
2461
|
*
|
|
2462
|
+
* Payload: {@link RuntimeFilter}[].
|
|
2439
2463
|
* @param - Array of {@link RuntimeFilter} objects. Each item includes:
|
|
2440
2464
|
* - `columnName`: Name of the column to filter on.
|
|
2441
2465
|
* - `operator`: {@link RuntimeFilterOp} to apply. For more information, see
|
|
@@ -2477,6 +2501,7 @@ var HostEvent;
|
|
|
2477
2501
|
* Accepts either a plain value or an object with `path`
|
|
2478
2502
|
* and an optional `replace` flag.
|
|
2479
2503
|
*
|
|
2504
|
+
* Payload: `string` | `number` | {@link NavigateRequest}.
|
|
2480
2505
|
* @param data - A string path, a numeric history delta, or an object
|
|
2481
2506
|
* `{ path: string | number, replace?: boolean }`.
|
|
2482
2507
|
* - `path` — the route to navigate to, or a history delta such as `1`
|
|
@@ -2504,6 +2529,9 @@ var HostEvent;
|
|
|
2504
2529
|
/**
|
|
2505
2530
|
* Open the filter panel for a particular column.
|
|
2506
2531
|
* Works with Search and Liveboard embed.
|
|
2532
|
+
* Payload: {@link OpenFilterRequest} (the cross-context superset). The
|
|
2533
|
+
* accepted fields vary by context: {@link OpenFilterLiveboardRequest},
|
|
2534
|
+
* {@link OpenFilterSpotterRequest}, {@link OpenFilterSearchRequest}.
|
|
2507
2535
|
* @param - { columnId: string,
|
|
2508
2536
|
* name: string,
|
|
2509
2537
|
* type: ATTRIBUTE/MEASURE,
|
|
@@ -2586,6 +2614,7 @@ var HostEvent;
|
|
|
2586
2614
|
/**
|
|
2587
2615
|
* Open the parameter panel for a particular parameter on a Liveboard.
|
|
2588
2616
|
* Mirrors {@link HostEvent.OpenFilter} for parameters.
|
|
2617
|
+
* Payload: {@link OpenParameterRequest}.
|
|
2589
2618
|
* @param - Includes the following keys:
|
|
2590
2619
|
* - `parameter`: An object identifying the parameter to open, for
|
|
2591
2620
|
* example, `{ parameterId: '<parameter-GUID>' }`.
|
|
@@ -2617,6 +2646,7 @@ var HostEvent;
|
|
|
2617
2646
|
HostEvent["OpenParameter"] = "openParameter";
|
|
2618
2647
|
/**
|
|
2619
2648
|
* Add columns to the current search query.
|
|
2649
|
+
* Payload: `{ columnIds: string[] }`.
|
|
2620
2650
|
* @param - { columnIds: string[] }
|
|
2621
2651
|
* @example
|
|
2622
2652
|
* ```js
|
|
@@ -2635,6 +2665,7 @@ var HostEvent;
|
|
|
2635
2665
|
HostEvent["AddColumns"] = "addColumns";
|
|
2636
2666
|
/**
|
|
2637
2667
|
* Remove a column from the current search query.
|
|
2668
|
+
* Payload: `{ columnId: string }`.
|
|
2638
2669
|
* @param - { columnId: string }
|
|
2639
2670
|
* @example
|
|
2640
2671
|
* ```js
|
|
@@ -2659,6 +2690,8 @@ var HostEvent;
|
|
|
2659
2690
|
* sorting, toggling of legends, and data drill down.
|
|
2660
2691
|
* For more information, see
|
|
2661
2692
|
* link:https://developers.thoughtspot.com/docs/fetch-data-and-report-apis#transient-lb-content[Liveboard data with unsaved changes].
|
|
2693
|
+
* Payload: none.
|
|
2694
|
+
* Response: {@link GetExportRequestForCurrentPinboardResponse}.
|
|
2662
2695
|
* @example
|
|
2663
2696
|
* ```js
|
|
2664
2697
|
* liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard).then(
|
|
@@ -2680,6 +2713,8 @@ var HostEvent;
|
|
|
2680
2713
|
* requiring additional user input via the *Pin to Liveboard* modal, define
|
|
2681
2714
|
* the following parameters:
|
|
2682
2715
|
*
|
|
2716
|
+
* Payload: {@link PinAnswerToLiveboardRequest}.
|
|
2717
|
+
* Response: {@link PinAnswerToLiveboardResponse}.
|
|
2683
2718
|
* @param - Includes the following keys:
|
|
2684
2719
|
* - `vizId`: GUID of the saved Answer or Spotter visualization ID to pin to a
|
|
2685
2720
|
* Liveboard.
|
|
@@ -2794,6 +2829,7 @@ var HostEvent;
|
|
|
2794
2829
|
HostEvent["LiveboardInfo"] = "pinboardInfo";
|
|
2795
2830
|
/**
|
|
2796
2831
|
* Trigger the **Schedule** action on an embedded Liveboard.
|
|
2832
|
+
* Payload: {@link VizScopedRequest}.
|
|
2797
2833
|
* @example
|
|
2798
2834
|
* ```js
|
|
2799
2835
|
* liveboardEmbed.trigger(HostEvent.Schedule)
|
|
@@ -2809,6 +2845,7 @@ var HostEvent;
|
|
|
2809
2845
|
HostEvent["Schedule"] = "subscription";
|
|
2810
2846
|
/**
|
|
2811
2847
|
* Trigger the **Manage schedule** action on an embedded Liveboard
|
|
2848
|
+
* Payload: {@link VizScopedRequest}.
|
|
2812
2849
|
* @example
|
|
2813
2850
|
* ```js
|
|
2814
2851
|
* liveboardEmbed.trigger(HostEvent.SchedulesList)
|
|
@@ -2825,6 +2862,7 @@ var HostEvent;
|
|
|
2825
2862
|
/**
|
|
2826
2863
|
* Trigger the **Export TML** action on an embedded Liveboard or
|
|
2827
2864
|
* Answer.
|
|
2865
|
+
* Payload: {@link VizScopedRequest}.
|
|
2828
2866
|
* @example
|
|
2829
2867
|
* ```js
|
|
2830
2868
|
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
@@ -2847,6 +2885,7 @@ var HostEvent;
|
|
|
2847
2885
|
/**
|
|
2848
2886
|
* Trigger the **Edit TML** action on an embedded Liveboard or
|
|
2849
2887
|
* saved Answers in the full application embedding.
|
|
2888
|
+
* Payload: {@link VizScopedRequest}.
|
|
2850
2889
|
* @example
|
|
2851
2890
|
* ```js
|
|
2852
2891
|
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
@@ -2868,6 +2907,7 @@ var HostEvent;
|
|
|
2868
2907
|
HostEvent["EditTML"] = "editTSL";
|
|
2869
2908
|
/**
|
|
2870
2909
|
* Trigger the **Update TML** action on an embedded Liveboard.
|
|
2910
|
+
* Payload: {@link VizScopedRequest}.
|
|
2871
2911
|
* @example
|
|
2872
2912
|
* ```js
|
|
2873
2913
|
* liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
@@ -2885,6 +2925,7 @@ var HostEvent;
|
|
|
2885
2925
|
* Trigger the **Download PDF** action on an embedded Liveboard,
|
|
2886
2926
|
* visualization or Answer.
|
|
2887
2927
|
*
|
|
2928
|
+
* Payload: {@link VizScopedRequest} plus optional `liveboardId`.
|
|
2888
2929
|
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2889
2930
|
*
|
|
2890
2931
|
* **NOTE**: The **Download** > **PDF** action is available on
|
|
@@ -2935,6 +2976,7 @@ var HostEvent;
|
|
|
2935
2976
|
/**
|
|
2936
2977
|
* Trigger the **AI Highlights** action on an embedded Liveboard
|
|
2937
2978
|
*
|
|
2979
|
+
* Payload: none.
|
|
2938
2980
|
* @example
|
|
2939
2981
|
* ```js
|
|
2940
2982
|
* liveboardEmbed.trigger(HostEvent.AIHighlights)
|
|
@@ -2989,6 +3031,9 @@ var HostEvent;
|
|
|
2989
3031
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
2990
3032
|
/**
|
|
2991
3033
|
* Trigger the **Delete** action for a Liveboard.
|
|
3034
|
+
* Payload varies by context: {@link RequiredVizRequest} (Liveboard, vizId
|
|
3035
|
+
* required), {@link VizScopedRequest} (Search). trigger() accepts the union
|
|
3036
|
+
* now; per-context enforced next release.
|
|
2992
3037
|
* @example
|
|
2993
3038
|
* ```js
|
|
2994
3039
|
* appEmbed.trigger(HostEvent.Remove)
|
|
@@ -3003,6 +3048,7 @@ var HostEvent;
|
|
|
3003
3048
|
HostEvent["Remove"] = "delete";
|
|
3004
3049
|
/**
|
|
3005
3050
|
* Trigger the **Explore** action on a visualization.
|
|
3051
|
+
* Payload: {@link RequiredVizRequest}.
|
|
3006
3052
|
* @param - an object with `vizId` as a key
|
|
3007
3053
|
* @example
|
|
3008
3054
|
* ```js
|
|
@@ -3022,6 +3068,7 @@ var HostEvent;
|
|
|
3022
3068
|
/**
|
|
3023
3069
|
* Trigger the **Create alert** action on a KPI chart
|
|
3024
3070
|
* in a Liveboard or saved Answer.
|
|
3071
|
+
* Payload: {@link VizScopedRequest}.
|
|
3025
3072
|
* @param - an object with `vizId` as a key
|
|
3026
3073
|
* @example
|
|
3027
3074
|
* ```js
|
|
@@ -3053,6 +3100,7 @@ var HostEvent;
|
|
|
3053
3100
|
/**
|
|
3054
3101
|
* Trigger the **Manage alerts** action on a KPI chart
|
|
3055
3102
|
* in a visualization or saved Answer.
|
|
3103
|
+
* Payload: {@link VizScopedRequest}.
|
|
3056
3104
|
* @param - an object with `vizId` as a key
|
|
3057
3105
|
* @example
|
|
3058
3106
|
* ```js
|
|
@@ -3090,6 +3138,7 @@ var HostEvent;
|
|
|
3090
3138
|
* on a Liveboard.
|
|
3091
3139
|
*
|
|
3092
3140
|
* This event is not supported in visualization embed and search embed.
|
|
3141
|
+
* Payload: {@link VizScopedRequest}.
|
|
3093
3142
|
* @param - Object parameter. Includes the following keys:
|
|
3094
3143
|
* - `vizId`: To trigger the action for a specific visualization in Liveboard embed,
|
|
3095
3144
|
* pass in `vizId` as a key. In Spotter embed, `vizId` refers to the Answer ID and
|
|
@@ -3132,6 +3181,7 @@ var HostEvent;
|
|
|
3132
3181
|
HostEvent["Edit"] = "edit";
|
|
3133
3182
|
/**
|
|
3134
3183
|
* Trigger the **Copy link** action on a Liveboard or visualization
|
|
3184
|
+
* Payload: {@link VizScopedRequest}.
|
|
3135
3185
|
* @param - object - to trigger the action for a
|
|
3136
3186
|
* specific visualization in Liveboard embed, pass in `vizId` as a key
|
|
3137
3187
|
* @example
|
|
@@ -3177,6 +3227,7 @@ var HostEvent;
|
|
|
3177
3227
|
HostEvent["CopyLink"] = "embedDocument";
|
|
3178
3228
|
/**
|
|
3179
3229
|
* Trigger the **Present** action on a Liveboard or visualization
|
|
3230
|
+
* Payload: {@link VizScopedRequest}.
|
|
3180
3231
|
* @param - object - to trigger the action for a specific visualization
|
|
3181
3232
|
* in Liveboard embed, pass in `vizId` as a key
|
|
3182
3233
|
* @example
|
|
@@ -3222,6 +3273,8 @@ var HostEvent;
|
|
|
3222
3273
|
HostEvent["Present"] = "present";
|
|
3223
3274
|
/**
|
|
3224
3275
|
* Get TML for the current search.
|
|
3276
|
+
* Payload: {@link GetTMLRequest}.
|
|
3277
|
+
* Response: `Record<string, any>`.
|
|
3225
3278
|
* @example
|
|
3226
3279
|
* ```js
|
|
3227
3280
|
* searchEmbed.trigger(HostEvent.GetTML).then((tml) => {
|
|
@@ -3271,6 +3324,7 @@ var HostEvent;
|
|
|
3271
3324
|
* Trigger the **Show underlying data** action on a
|
|
3272
3325
|
* chart or table.
|
|
3273
3326
|
*
|
|
3327
|
+
* Payload: {@link VizScopedRequest}.
|
|
3274
3328
|
* @param - an object with vizId as a key
|
|
3275
3329
|
* @example
|
|
3276
3330
|
* ```js
|
|
@@ -3304,6 +3358,7 @@ var HostEvent;
|
|
|
3304
3358
|
* Trigger the **Delete** action for a visualization
|
|
3305
3359
|
* in an embedded Liveboard, or a chart or table
|
|
3306
3360
|
* generated from Search.
|
|
3361
|
+
* Payload: {@link VizScopedRequest}.
|
|
3307
3362
|
* @param - Liveboard embed takes an object with `vizId` as a key.
|
|
3308
3363
|
* Can be left empty if embedding Search or visualization.
|
|
3309
3364
|
* @example
|
|
@@ -3332,6 +3387,7 @@ var HostEvent;
|
|
|
3332
3387
|
/**
|
|
3333
3388
|
* Trigger the **SpotIQ analyze** action on a
|
|
3334
3389
|
* chart or table.
|
|
3390
|
+
* Payload: {@link VizScopedRequest}.
|
|
3335
3391
|
* @param - Liveboard embed takes `vizId` as a
|
|
3336
3392
|
* key. Can be left undefined when embedding Search or
|
|
3337
3393
|
* visualization.
|
|
@@ -3394,6 +3450,7 @@ var HostEvent;
|
|
|
3394
3450
|
/**
|
|
3395
3451
|
* Trigger the **Download** > **PNG** action on
|
|
3396
3452
|
* charts in the embedded view.
|
|
3453
|
+
* Payload: {@link VizScopedRequest}.
|
|
3397
3454
|
* @example
|
|
3398
3455
|
* ```js
|
|
3399
3456
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPng,
|
|
@@ -3425,6 +3482,7 @@ var HostEvent;
|
|
|
3425
3482
|
/**
|
|
3426
3483
|
* Trigger the **Download** > **CSV** action on tables in
|
|
3427
3484
|
* the embedded view.
|
|
3485
|
+
* Payload: {@link VizScopedRequest}.
|
|
3428
3486
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
3429
3487
|
* @example
|
|
3430
3488
|
* ```js
|
|
@@ -3464,6 +3522,7 @@ var HostEvent;
|
|
|
3464
3522
|
/**
|
|
3465
3523
|
* Trigger the **Download** > **XLSX** action on tables
|
|
3466
3524
|
* in the embedded view.
|
|
3525
|
+
* Payload: {@link VizScopedRequest}.
|
|
3467
3526
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
3468
3527
|
* @example
|
|
3469
3528
|
* ```js
|
|
@@ -3503,6 +3562,7 @@ var HostEvent;
|
|
|
3503
3562
|
/**
|
|
3504
3563
|
* Trigger the **Share** action on an embedded
|
|
3505
3564
|
* Liveboard or Answer.
|
|
3565
|
+
* Payload: {@link VizScopedRequest}.
|
|
3506
3566
|
* @example
|
|
3507
3567
|
* ```js
|
|
3508
3568
|
* liveboardEmbed.trigger(HostEvent.Share)
|
|
@@ -3529,6 +3589,7 @@ var HostEvent;
|
|
|
3529
3589
|
* Trigger the **Save** action on a Liveboard, Answer, or Spotter.
|
|
3530
3590
|
* Saves the changes.
|
|
3531
3591
|
*
|
|
3592
|
+
* Payload: {@link VizScopedRequest}.
|
|
3532
3593
|
* @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
|
|
3533
3594
|
* It is required and can be retrieved from the data embed event.
|
|
3534
3595
|
*
|
|
@@ -3580,6 +3641,7 @@ var HostEvent;
|
|
|
3580
3641
|
/**
|
|
3581
3642
|
* Trigger the **Sync to Sheets** action on an embedded visualization or Answer
|
|
3582
3643
|
* Sends data from an Answer or Liveboard visualization to a Google sheet.
|
|
3644
|
+
* Payload: {@link VizScopedRequest}.
|
|
3583
3645
|
* @param - an object with `vizId` as a key
|
|
3584
3646
|
* @example
|
|
3585
3647
|
* ```js
|
|
@@ -3610,6 +3672,7 @@ var HostEvent;
|
|
|
3610
3672
|
* Trigger the **Sync to Other Apps** action on an embedded visualization or Answer
|
|
3611
3673
|
* Sends data from an Answer or Liveboard visualization to third-party apps such
|
|
3612
3674
|
* as Slack, Salesforce, Microsoft Teams, ServiceNow and so on.
|
|
3675
|
+
* Payload: {@link VizScopedRequest}.
|
|
3613
3676
|
* @param - an object with vizId as a key
|
|
3614
3677
|
* @example
|
|
3615
3678
|
* ```js
|
|
@@ -3640,6 +3703,7 @@ var HostEvent;
|
|
|
3640
3703
|
* Trigger the **Manage pipelines** action on an embedded
|
|
3641
3704
|
* visualization or Answer.
|
|
3642
3705
|
* Allows users to manage ThoughtSpot Sync pipelines.
|
|
3706
|
+
* Payload: {@link VizScopedRequest}.
|
|
3643
3707
|
* @param - an object with `vizId` as a key
|
|
3644
3708
|
* @example
|
|
3645
3709
|
* ```js
|
|
@@ -3668,6 +3732,7 @@ var HostEvent;
|
|
|
3668
3732
|
HostEvent["ManagePipelines"] = "manage-pipeline";
|
|
3669
3733
|
/**
|
|
3670
3734
|
* Reset search operation on the Search or Answer page.
|
|
3735
|
+
* Payload: none.
|
|
3671
3736
|
* @example
|
|
3672
3737
|
* ```js
|
|
3673
3738
|
* searchEmbed.trigger(HostEvent.ResetSearch)
|
|
@@ -3695,6 +3760,8 @@ var HostEvent;
|
|
|
3695
3760
|
* whole Liveboard.
|
|
3696
3761
|
* The `applicability` attribute is available from SDK: 1.53.0 |
|
|
3697
3762
|
* ThoughtSpot: 26.10.0.cl.
|
|
3763
|
+
* Payload: {@link GetFiltersRequest}.
|
|
3764
|
+
* Response: {@link GetFiltersResponse}.
|
|
3698
3765
|
* @example
|
|
3699
3766
|
* ```js
|
|
3700
3767
|
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
|
|
@@ -3714,6 +3781,7 @@ var HostEvent;
|
|
|
3714
3781
|
HostEvent["GetFilters"] = "getFilters";
|
|
3715
3782
|
/**
|
|
3716
3783
|
* Update one or several filters applied on a Liveboard.
|
|
3784
|
+
* Payload: {@link UpdateFiltersRequest}.
|
|
3717
3785
|
* @param - Includes the following keys:
|
|
3718
3786
|
* - `filter`: A single filter object containing column name, filter operator, and
|
|
3719
3787
|
* values.
|
|
@@ -3842,6 +3910,8 @@ var HostEvent;
|
|
|
3842
3910
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
3843
3911
|
/**
|
|
3844
3912
|
* Get tab details for the current Liveboard.
|
|
3913
|
+
* Payload: none.
|
|
3914
|
+
* Response: {@link GetTabsResponse}.
|
|
3845
3915
|
* @example
|
|
3846
3916
|
* ```js
|
|
3847
3917
|
* liveboardEmbed.trigger(HostEvent.GetTabs).then((tabDetails) => {
|
|
@@ -3867,6 +3937,8 @@ var HostEvent;
|
|
|
3867
3937
|
/**
|
|
3868
3938
|
* Get group details for the current Liveboard.
|
|
3869
3939
|
* Mirrors {@link HostEvent.GetTabs} for filter/parameter groups.
|
|
3940
|
+
* Payload: none.
|
|
3941
|
+
* Response: {@link GetGroupsResponse}.
|
|
3870
3942
|
* @example
|
|
3871
3943
|
* ```js
|
|
3872
3944
|
* liveboardEmbed.trigger(HostEvent.GetGroups).then((groupDetails) => {
|
|
@@ -3891,6 +3963,7 @@ var HostEvent;
|
|
|
3891
3963
|
HostEvent["GetGroups"] = "getGroups";
|
|
3892
3964
|
/**
|
|
3893
3965
|
* Set the visible tabs on a Liveboard.
|
|
3966
|
+
* Payload: `string[]`.
|
|
3894
3967
|
* @param - an array of ids of tabs to show, the IDs not passed
|
|
3895
3968
|
* will be hidden.
|
|
3896
3969
|
* @example
|
|
@@ -3913,6 +3986,7 @@ var HostEvent;
|
|
|
3913
3986
|
HostEvent["SetVisibleTabs"] = "SetPinboardVisibleTabs";
|
|
3914
3987
|
/**
|
|
3915
3988
|
* Set the hidden tabs on a Liveboard.
|
|
3989
|
+
* Payload: `string[]`.
|
|
3916
3990
|
* @param - an array of the IDs of the tabs to hide.
|
|
3917
3991
|
* The IDs not passed will be shown.
|
|
3918
3992
|
* @example
|
|
@@ -3941,6 +4015,8 @@ var HostEvent;
|
|
|
3941
4015
|
* `getAnswerService()` method on the embed instance to get an AnswerService
|
|
3942
4016
|
* object that provides a more convenient interface for working with answers.
|
|
3943
4017
|
*
|
|
4018
|
+
* Payload: {@link GetAnswerSessionRequest}.
|
|
4019
|
+
* Response: {@link GetAnswerSessionResponse}.
|
|
3944
4020
|
* @example
|
|
3945
4021
|
* ```js
|
|
3946
4022
|
* // Preferred way to get an AnswerService
|
|
@@ -3968,6 +4044,7 @@ var HostEvent;
|
|
|
3968
4044
|
HostEvent["GetAnswerSession"] = "getAnswerSession";
|
|
3969
4045
|
/**
|
|
3970
4046
|
* Trigger the *Ask Sage* action for visualizations
|
|
4047
|
+
* Payload: {@link RequiredVizRequest}.
|
|
3971
4048
|
* @example
|
|
3972
4049
|
* ```js
|
|
3973
4050
|
* liveboardEmbed.trigger(HostEvent.AskSage,
|
|
@@ -3979,6 +4056,7 @@ var HostEvent;
|
|
|
3979
4056
|
/**
|
|
3980
4057
|
* Trigger cross filter update action on a Liveboard.
|
|
3981
4058
|
*
|
|
4059
|
+
* Payload: {@link UpdateCrossFilterRequest}.
|
|
3982
4060
|
* @example
|
|
3983
4061
|
* ```js
|
|
3984
4062
|
* liveboardEmbed.trigger(HostEvent.UpdateCrossFilter, {
|
|
@@ -3994,7 +4072,9 @@ var HostEvent;
|
|
|
3994
4072
|
HostEvent["UpdateCrossFilter"] = "UpdateCrossFilter";
|
|
3995
4073
|
/**
|
|
3996
4074
|
* Trigger reset action for a personalized Liveboard view.
|
|
3997
|
-
* This event is deprecated.
|
|
4075
|
+
* This event is deprecated.
|
|
4076
|
+
* Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
|
|
4077
|
+
* Payload: none.
|
|
3998
4078
|
* @example
|
|
3999
4079
|
* ```js
|
|
4000
4080
|
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
|
|
@@ -4015,6 +4095,7 @@ var HostEvent;
|
|
|
4015
4095
|
/**
|
|
4016
4096
|
* Triggers an action to update Parameter values on embedded
|
|
4017
4097
|
* Answers, Liveboard, and Spotter answer in Edit mode.
|
|
4098
|
+
* Payload: {@link RuntimeParameter}[].
|
|
4018
4099
|
* @param - Includes the following keys for each item:
|
|
4019
4100
|
* - `name`: Name of the parameter.
|
|
4020
4101
|
* - `value`: The value to set for the parameter.
|
|
@@ -4072,6 +4153,8 @@ var HostEvent;
|
|
|
4072
4153
|
* whole Liveboard.
|
|
4073
4154
|
* The `applicability` attribute is available from SDK: 1.53.0 |
|
|
4074
4155
|
* ThoughtSpot: 26.10.0.cl.
|
|
4156
|
+
* Payload: none.
|
|
4157
|
+
* Response: {@link GetParametersResponse}.
|
|
4075
4158
|
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
4076
4159
|
* ```js
|
|
4077
4160
|
* liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
|
|
@@ -4109,6 +4192,7 @@ var HostEvent;
|
|
|
4109
4192
|
* ```js
|
|
4110
4193
|
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
|
|
4111
4194
|
* ```
|
|
4195
|
+
* Payload: {@link PersonalisedViewRequest} (`viewId` only).
|
|
4112
4196
|
* @example
|
|
4113
4197
|
* ```js
|
|
4114
4198
|
* // Update personalized view from liveboard context
|
|
@@ -4141,6 +4225,7 @@ var HostEvent;
|
|
|
4141
4225
|
* If neither is provided, the Liveboard resets to the original/default view.
|
|
4142
4226
|
* When a `viewName` is provided and multiple views share
|
|
4143
4227
|
* the same name, the first match is selected.
|
|
4228
|
+
* Payload: {@link PersonalisedViewRequest}.
|
|
4144
4229
|
* @example
|
|
4145
4230
|
* ```js
|
|
4146
4231
|
* liveboardEmbed.trigger(
|
|
@@ -4184,6 +4269,8 @@ var HostEvent;
|
|
|
4184
4269
|
* If no parameters are specified, the save action is
|
|
4185
4270
|
* triggered with a modal to prompt users to
|
|
4186
4271
|
* add a name and description for the Answer.
|
|
4272
|
+
* Payload: {@link SaveAnswerRequest}.
|
|
4273
|
+
* Response: {@link SaveAnswerResponse}.
|
|
4187
4274
|
* @param - Includes the following keys:
|
|
4188
4275
|
* - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
|
|
4189
4276
|
* embed.
|
|
@@ -4269,6 +4356,7 @@ var HostEvent;
|
|
|
4269
4356
|
/**
|
|
4270
4357
|
* Triggers a search operation with the search tokens specified in
|
|
4271
4358
|
* the search query string in spotter embed.
|
|
4359
|
+
* Payload: {@link SpotterSearchRequest}.
|
|
4272
4360
|
* @param - Includes the following keys:
|
|
4273
4361
|
* - `query`: Text string in Natural Language format.
|
|
4274
4362
|
* - `executeSearch`: Boolean to execute search and update search query.
|
|
@@ -4293,6 +4381,7 @@ var HostEvent;
|
|
|
4293
4381
|
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
4294
4382
|
/**
|
|
4295
4383
|
* Edits the last prompt in spotter embed.
|
|
4384
|
+
* Payload: `string`.
|
|
4296
4385
|
* @param - `query`: Text string
|
|
4297
4386
|
* @example
|
|
4298
4387
|
* ```js
|
|
@@ -4309,6 +4398,7 @@ var HostEvent;
|
|
|
4309
4398
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
4310
4399
|
/**
|
|
4311
4400
|
* Opens the data source preview modal in Spotter Embed.
|
|
4401
|
+
* Payload: none.
|
|
4312
4402
|
* @example
|
|
4313
4403
|
* ```js
|
|
4314
4404
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
@@ -4344,6 +4434,7 @@ var HostEvent;
|
|
|
4344
4434
|
HostEvent["DataModelInstructions"] = "DataModelInstructions";
|
|
4345
4435
|
/**
|
|
4346
4436
|
* Resets the Spotter Embed Conversation.
|
|
4437
|
+
* Payload: none.
|
|
4347
4438
|
* @example
|
|
4348
4439
|
* ```js
|
|
4349
4440
|
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
@@ -4356,6 +4447,7 @@ var HostEvent;
|
|
|
4356
4447
|
* `conversationId` is **mandatory** — you must pass the id of the
|
|
4357
4448
|
* conversation to share. Also no-op when sharing is disabled
|
|
4358
4449
|
* (enableShareConversation off) or when already in the read-only shared view.
|
|
4450
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4359
4451
|
* @example
|
|
4360
4452
|
* ```js
|
|
4361
4453
|
* spotterEmbed.trigger(HostEvent.ShareSpotterConversation, { conversationId: 'abc' });
|
|
@@ -4365,6 +4457,7 @@ var HostEvent;
|
|
|
4365
4457
|
HostEvent["ShareSpotterConversation"] = "ShareSpotterConversation";
|
|
4366
4458
|
/**
|
|
4367
4459
|
* Closes the Spotter share-conversation modal. No-op if none is open.
|
|
4460
|
+
* Payload: none.
|
|
4368
4461
|
* @example
|
|
4369
4462
|
* ```js
|
|
4370
4463
|
* spotterEmbed.trigger(HostEvent.CloseSpotterShareConversation);
|
|
@@ -4374,6 +4467,7 @@ var HostEvent;
|
|
|
4374
4467
|
HostEvent["CloseSpotterShareConversation"] = "CloseSpotterShareConversation";
|
|
4375
4468
|
/**
|
|
4376
4469
|
* Exits the read-only shared-conversation view.
|
|
4470
|
+
* Payload: none.
|
|
4377
4471
|
* @example
|
|
4378
4472
|
* ```js
|
|
4379
4473
|
* spotterEmbed.trigger(HostEvent.ExitSpotterSharedConversation);
|
|
@@ -4383,6 +4477,7 @@ var HostEvent;
|
|
|
4383
4477
|
HostEvent["ExitSpotterSharedConversation"] = "ExitSpotterSharedConversation";
|
|
4384
4478
|
/**
|
|
4385
4479
|
* Deletes the last prompt in spotter embed.
|
|
4480
|
+
* Payload: none.
|
|
4386
4481
|
* @example
|
|
4387
4482
|
* ```js
|
|
4388
4483
|
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
@@ -4392,6 +4487,7 @@ var HostEvent;
|
|
|
4392
4487
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
4393
4488
|
/**
|
|
4394
4489
|
* Toggle the visualization to chart or table view.
|
|
4490
|
+
* Payload: {@link RequiredVizRequest}.
|
|
4395
4491
|
* @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
|
|
4396
4492
|
* @example
|
|
4397
4493
|
* ```js
|
|
@@ -4430,6 +4526,7 @@ var HostEvent;
|
|
|
4430
4526
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
4431
4527
|
/**
|
|
4432
4528
|
* Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
|
|
4529
|
+
* Payload: {@link RequiredVizRequest}.
|
|
4433
4530
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
|
|
4434
4531
|
* @example
|
|
4435
4532
|
* ```js
|
|
@@ -4491,6 +4588,7 @@ var HostEvent;
|
|
|
4491
4588
|
* instance. Contact your admin or ThoughtSpot Support to enable chat history on your
|
|
4492
4589
|
* instance.
|
|
4493
4590
|
*
|
|
4591
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4494
4592
|
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
4495
4593
|
* @example
|
|
4496
4594
|
* ```js
|
|
@@ -4508,6 +4606,7 @@ var HostEvent;
|
|
|
4508
4606
|
* instance. Contact your admin or ThoughtSpot Support to enable chat history on your
|
|
4509
4607
|
* instance.
|
|
4510
4608
|
*
|
|
4609
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4511
4610
|
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
4512
4611
|
* @example
|
|
4513
4612
|
* ```js
|
|
@@ -4532,6 +4631,7 @@ var HostEvent;
|
|
|
4532
4631
|
* Trigger the **Send Test Email** action in the Liveboard schedule modal.
|
|
4533
4632
|
* Sends a test schedule email to self or all recipients.
|
|
4534
4633
|
* Requires `isSendNowLiveboardSchedulingEnabled` to be enabled.
|
|
4634
|
+
* Payload: {@link ScheduleEmailRequest}.
|
|
4535
4635
|
* @example
|
|
4536
4636
|
* ```js
|
|
4537
4637
|
* liveboardEmbed.trigger(HostEvent.SendTestScheduleEmail, {
|
|
@@ -4550,6 +4650,7 @@ var HostEvent;
|
|
|
4550
4650
|
HostEvent["SendTestScheduleEmail"] = "sendTestScheduleEmail";
|
|
4551
4651
|
/**
|
|
4552
4652
|
* Sends a user message (prompt) to the SpotterViz panel programmatically.
|
|
4653
|
+
* Payload: `{ query: string }`.
|
|
4553
4654
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4554
4655
|
* @param query - the prompt text to send.
|
|
4555
4656
|
* @example
|
|
@@ -4562,6 +4663,7 @@ var HostEvent;
|
|
|
4562
4663
|
HostEvent["SpotterVizSendUserMessage"] = "SpotterVizSendUserMessage";
|
|
4563
4664
|
/**
|
|
4564
4665
|
* Initializes a new SpotterViz conversation.
|
|
4666
|
+
* Payload: none.
|
|
4565
4667
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4566
4668
|
* @example
|
|
4567
4669
|
* ```js
|
|
@@ -4571,6 +4673,7 @@ var HostEvent;
|
|
|
4571
4673
|
HostEvent["InitSpotterVizConversation"] = "InitSpotterVizConversation";
|
|
4572
4674
|
/**
|
|
4573
4675
|
* Opens the SpotterViz panel.
|
|
4676
|
+
* Payload: none.
|
|
4574
4677
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4575
4678
|
* @example
|
|
4576
4679
|
* ```js
|
|
@@ -4580,6 +4683,7 @@ var HostEvent;
|
|
|
4580
4683
|
HostEvent["OpenSpotterVizPanel"] = "OpenSpotterVizPanel";
|
|
4581
4684
|
/**
|
|
4582
4685
|
* Closes the SpotterViz panel.
|
|
4686
|
+
* Payload: none.
|
|
4583
4687
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4584
4688
|
* @example
|
|
4585
4689
|
* ```js
|
|
@@ -4590,6 +4694,7 @@ var HostEvent;
|
|
|
4590
4694
|
/**
|
|
4591
4695
|
* Clears browser cache and fetches new data for liveboard ChartViz Containers.
|
|
4592
4696
|
* Requires `enableLiveboardDataCache` to be enabled.
|
|
4697
|
+
* Payload: {@link ScheduleEmailRequest}.
|
|
4593
4698
|
* @example
|
|
4594
4699
|
* ```js
|
|
4595
4700
|
* liveboardEmbed.trigger(HostEvent.RefreshLiveboardBrowserCache);
|
|
@@ -4787,6 +4892,7 @@ var Param;
|
|
|
4787
4892
|
Param["SpotterDataSources"] = "spotterDataSources";
|
|
4788
4893
|
Param["AnalystId"] = "analystId";
|
|
4789
4894
|
Param["OpenSpotterOnLiveboardByDefault"] = "openSpotterOnLiveboardByDefault";
|
|
4895
|
+
Param["ShowAnswerEditPanel"] = "showAnswerEditPanel";
|
|
4790
4896
|
})(Param || (Param = {}));
|
|
4791
4897
|
/**
|
|
4792
4898
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -6791,6 +6897,225 @@ var Action;
|
|
|
6791
6897
|
* ```
|
|
6792
6898
|
*/
|
|
6793
6899
|
Action["SpotterOnLiveboard"] = "spotterOnLiveboard";
|
|
6900
|
+
/**
|
|
6901
|
+
* Controls the visibility and disabled state of the "Chart Type" menu item
|
|
6902
|
+
* in Chart Settings V2.
|
|
6903
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6904
|
+
* @example
|
|
6905
|
+
* ```js
|
|
6906
|
+
* {
|
|
6907
|
+
* hiddenActions: [Action.ChartTypeSettings],
|
|
6908
|
+
* disabledActions: [Action.ChartTypeSettings],
|
|
6909
|
+
* }
|
|
6910
|
+
* ```
|
|
6911
|
+
*/
|
|
6912
|
+
Action["ChartTypeSettings"] = "CHART_TYPE";
|
|
6913
|
+
/**
|
|
6914
|
+
* Controls the visibility and disabled state of the "Layout" menu item
|
|
6915
|
+
* in Chart Settings V2.
|
|
6916
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6917
|
+
* @example
|
|
6918
|
+
* ```js
|
|
6919
|
+
* {
|
|
6920
|
+
* hiddenActions: [Action.LayoutSettings],
|
|
6921
|
+
* disabledActions: [Action.LayoutSettings],
|
|
6922
|
+
* }
|
|
6923
|
+
* ```
|
|
6924
|
+
*/
|
|
6925
|
+
Action["LayoutSettings"] = "LAYOUT";
|
|
6926
|
+
/**
|
|
6927
|
+
* Controls the visibility and disabled state of the "Column" menu item
|
|
6928
|
+
* in Chart Settings V2.
|
|
6929
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6930
|
+
* @example
|
|
6931
|
+
* ```js
|
|
6932
|
+
* {
|
|
6933
|
+
* hiddenActions: [Action.ColumnSettings],
|
|
6934
|
+
* disabledActions: [Action.ColumnSettings],
|
|
6935
|
+
* }
|
|
6936
|
+
* ```
|
|
6937
|
+
*/
|
|
6938
|
+
Action["ColumnSettings"] = "COLUMN";
|
|
6939
|
+
/**
|
|
6940
|
+
* Controls the visibility and disabled state of the "Axis" menu item
|
|
6941
|
+
* in Chart Settings V2.
|
|
6942
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6943
|
+
* @example
|
|
6944
|
+
* ```js
|
|
6945
|
+
* {
|
|
6946
|
+
* hiddenActions: [Action.AxisSettings],
|
|
6947
|
+
* disabledActions: [Action.AxisSettings],
|
|
6948
|
+
* }
|
|
6949
|
+
* ```
|
|
6950
|
+
*/
|
|
6951
|
+
Action["AxisSettings"] = "AXIS";
|
|
6952
|
+
/**
|
|
6953
|
+
* Controls the visibility and disabled state of the "Data Label" menu item
|
|
6954
|
+
* in Chart Settings V2.
|
|
6955
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6956
|
+
* @example
|
|
6957
|
+
* ```js
|
|
6958
|
+
* {
|
|
6959
|
+
* hiddenActions: [Action.DataLabelSettings],
|
|
6960
|
+
* disabledActions: [Action.DataLabelSettings],
|
|
6961
|
+
* }
|
|
6962
|
+
* ```
|
|
6963
|
+
*/
|
|
6964
|
+
Action["DataLabelSettings"] = "DATA_LABEL";
|
|
6965
|
+
/**
|
|
6966
|
+
* Controls the visibility and disabled state of the "Tooltip" menu item
|
|
6967
|
+
* in Chart Settings V2.
|
|
6968
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6969
|
+
* @example
|
|
6970
|
+
* ```js
|
|
6971
|
+
* {
|
|
6972
|
+
* hiddenActions: [Action.TooltipSettings],
|
|
6973
|
+
* disabledActions: [Action.TooltipSettings],
|
|
6974
|
+
* }
|
|
6975
|
+
* ```
|
|
6976
|
+
*/
|
|
6977
|
+
Action["TooltipSettings"] = "TOOLTIP";
|
|
6978
|
+
/**
|
|
6979
|
+
* Controls the visibility and disabled state of the "Legend" menu item
|
|
6980
|
+
* in Chart Settings V2.
|
|
6981
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6982
|
+
* @example
|
|
6983
|
+
* ```js
|
|
6984
|
+
* {
|
|
6985
|
+
* hiddenActions: [Action.LegendSettings],
|
|
6986
|
+
* disabledActions: [Action.LegendSettings],
|
|
6987
|
+
* }
|
|
6988
|
+
* ```
|
|
6989
|
+
*/
|
|
6990
|
+
Action["LegendSettings"] = "LEGEND";
|
|
6991
|
+
/**
|
|
6992
|
+
* Controls the visibility and disabled state of the "Display" menu item
|
|
6993
|
+
* in Chart Settings V2.
|
|
6994
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6995
|
+
* @example
|
|
6996
|
+
* ```js
|
|
6997
|
+
* {
|
|
6998
|
+
* hiddenActions: [Action.DisplaySettings],
|
|
6999
|
+
* disabledActions: [Action.DisplaySettings],
|
|
7000
|
+
* }
|
|
7001
|
+
* ```
|
|
7002
|
+
*/
|
|
7003
|
+
Action["DisplaySettings"] = "DISPLAY";
|
|
7004
|
+
/**
|
|
7005
|
+
* Controls the visibility and disabled state of the "Query Details" menu
|
|
7006
|
+
* item in Chart Settings V2.
|
|
7007
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7008
|
+
* @example
|
|
7009
|
+
* ```js
|
|
7010
|
+
* {
|
|
7011
|
+
* hiddenActions: [Action.QuerySettings],
|
|
7012
|
+
* disabledActions: [Action.QuerySettings],
|
|
7013
|
+
* }
|
|
7014
|
+
* ```
|
|
7015
|
+
*/
|
|
7016
|
+
Action["QuerySettings"] = "QUERY_DETAILS";
|
|
7017
|
+
/**
|
|
7018
|
+
* Controls the visibility and disabled state of the "Custom Action" menu
|
|
7019
|
+
* item in Chart Settings V2.
|
|
7020
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7021
|
+
* @example
|
|
7022
|
+
* ```js
|
|
7023
|
+
* {
|
|
7024
|
+
* hiddenActions: [Action.CustomSettings],
|
|
7025
|
+
* disabledActions: [Action.CustomSettings],
|
|
7026
|
+
* }
|
|
7027
|
+
* ```
|
|
7028
|
+
*/
|
|
7029
|
+
Action["CustomSettings"] = "CUSTOM_ACTION";
|
|
7030
|
+
/**
|
|
7031
|
+
* Controls the visibility and disabled state of the "Muze AI" menu item
|
|
7032
|
+
* in Chart Settings V2.
|
|
7033
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7034
|
+
* @example
|
|
7035
|
+
* ```js
|
|
7036
|
+
* {
|
|
7037
|
+
* hiddenActions: [Action.MuzeAiSettings],
|
|
7038
|
+
* disabledActions: [Action.MuzeAiSettings],
|
|
7039
|
+
* }
|
|
7040
|
+
* ```
|
|
7041
|
+
*/
|
|
7042
|
+
Action["MuzeAiSettings"] = "MUZE_AI";
|
|
7043
|
+
/**
|
|
7044
|
+
* Controls the visibility and disabled state of the "R Analysis" menu item
|
|
7045
|
+
* in Chart Settings V2.
|
|
7046
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7047
|
+
* @example
|
|
7048
|
+
* ```js
|
|
7049
|
+
* {
|
|
7050
|
+
* hiddenActions: [Action.RAnalysisSettings],
|
|
7051
|
+
* disabledActions: [Action.RAnalysisSettings],
|
|
7052
|
+
* }
|
|
7053
|
+
* ```
|
|
7054
|
+
*/
|
|
7055
|
+
Action["RAnalysisSettings"] = "R_ANALYSIS";
|
|
7056
|
+
/**
|
|
7057
|
+
* Controls the visibility and disabled state of the "Add to Collection" menu item.
|
|
7058
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7059
|
+
* @example
|
|
7060
|
+
* ```js
|
|
7061
|
+
* {
|
|
7062
|
+
* hiddenActions: [Action.AddToCollection],
|
|
7063
|
+
* disabledActions: [Action.AddToCollection],
|
|
7064
|
+
* }
|
|
7065
|
+
* ```
|
|
7066
|
+
*/
|
|
7067
|
+
Action["AddToCollection"] = "addToCollection";
|
|
7068
|
+
/**
|
|
7069
|
+
* Controls the visibility and disabled state of the "Create Collection" button.
|
|
7070
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7071
|
+
* @example
|
|
7072
|
+
* ```js
|
|
7073
|
+
* {
|
|
7074
|
+
* hiddenActions: [Action.CreateCollection],
|
|
7075
|
+
* disabledActions: [Action.CreateCollection],
|
|
7076
|
+
* }
|
|
7077
|
+
* ```
|
|
7078
|
+
*/
|
|
7079
|
+
Action["CreateCollection"] = "createCollection";
|
|
7080
|
+
/**
|
|
7081
|
+
* Controls the visibility and disabled state of the "Move" menu item in a
|
|
7082
|
+
* Collection.
|
|
7083
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7084
|
+
* @example
|
|
7085
|
+
* ```js
|
|
7086
|
+
* {
|
|
7087
|
+
* hiddenActions: [Action.MoveToCollection],
|
|
7088
|
+
* disabledActions: [Action.MoveToCollection],
|
|
7089
|
+
* }
|
|
7090
|
+
* ```
|
|
7091
|
+
*/
|
|
7092
|
+
Action["MoveToCollection"] = "moveToCollection";
|
|
7093
|
+
/**
|
|
7094
|
+
* Controls the visibility and disabled state of the "Remove" menu item in a
|
|
7095
|
+
* Collection.
|
|
7096
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7097
|
+
* @example
|
|
7098
|
+
* ```js
|
|
7099
|
+
* {
|
|
7100
|
+
* hiddenActions: [Action.RemoveFromCollection],
|
|
7101
|
+
* disabledActions: [Action.RemoveFromCollection],
|
|
7102
|
+
* }
|
|
7103
|
+
* ```
|
|
7104
|
+
*/
|
|
7105
|
+
Action["RemoveFromCollection"] = "removeFromCollection";
|
|
7106
|
+
/**
|
|
7107
|
+
* Controls the visibility and disabled state of the "Delete" menu item for a
|
|
7108
|
+
* Collection.
|
|
7109
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7110
|
+
* @example
|
|
7111
|
+
* ```js
|
|
7112
|
+
* {
|
|
7113
|
+
* hiddenActions: [Action.DeleteCollection],
|
|
7114
|
+
* disabledActions: [Action.DeleteCollection],
|
|
7115
|
+
* }
|
|
7116
|
+
* ```
|
|
7117
|
+
*/
|
|
7118
|
+
Action["DeleteCollection"] = "deleteCollection";
|
|
6794
7119
|
})(Action || (Action = {}));
|
|
6795
7120
|
var PrefetchFeatures;
|
|
6796
7121
|
(function (PrefetchFeatures) {
|
|
@@ -7295,7 +7620,7 @@ var TableContentDensity;
|
|
|
7295
7620
|
TableContentDensity["Compact"] = "COMPACT";
|
|
7296
7621
|
})(TableContentDensity || (TableContentDensity = {}));
|
|
7297
7622
|
|
|
7298
|
-
var version$1="1.52.
|
|
7623
|
+
var version$1="1.52.1";var pkg = {version:version$1};
|
|
7299
7624
|
|
|
7300
7625
|
const { version } = pkg;
|
|
7301
7626
|
|
|
@@ -8117,6 +8442,43 @@ const setParamIfDefined = (queryParams, param, value, asBoolean = false) => {
|
|
|
8117
8442
|
if (value !== undefined) {
|
|
8118
8443
|
queryParams[param] = asBoolean ? !!value : value;
|
|
8119
8444
|
}
|
|
8445
|
+
};
|
|
8446
|
+
/**
|
|
8447
|
+
* Calculates the element center for the currently visible viewport of the
|
|
8448
|
+
* element, using the scroll position of the host app, the offsetTop of the
|
|
8449
|
+
* element in the host app, and the viewport height of the tab.
|
|
8450
|
+
*
|
|
8451
|
+
* The returned keys are sent to the ThoughtSpot app over postMessage, so they
|
|
8452
|
+
* are named after the iframe and must not be renamed.
|
|
8453
|
+
* @param element The element to measure
|
|
8454
|
+
* @returns The element center within the visible viewport, the element height,
|
|
8455
|
+
* and the viewport height.
|
|
8456
|
+
*/
|
|
8457
|
+
const calculateElementCenter = (element) => {
|
|
8458
|
+
const offsetTopClient = getOffsetTop(element);
|
|
8459
|
+
const scrollTopClient = window.scrollY;
|
|
8460
|
+
const viewPortHeight = window.innerHeight;
|
|
8461
|
+
const iframeHeight = element.offsetHeight;
|
|
8462
|
+
const iframeScrolled = scrollTopClient - offsetTopClient;
|
|
8463
|
+
let iframeVisibleViewPort;
|
|
8464
|
+
let iframeOffset;
|
|
8465
|
+
if (iframeScrolled < 0) {
|
|
8466
|
+
iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
|
|
8467
|
+
iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
|
|
8468
|
+
iframeOffset = 0;
|
|
8469
|
+
}
|
|
8470
|
+
else {
|
|
8471
|
+
iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
|
|
8472
|
+
iframeOffset = iframeScrolled;
|
|
8473
|
+
}
|
|
8474
|
+
const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
|
|
8475
|
+
return {
|
|
8476
|
+
iframeCenter,
|
|
8477
|
+
iframeScrolled,
|
|
8478
|
+
iframeHeight,
|
|
8479
|
+
viewPortHeight,
|
|
8480
|
+
iframeVisibleViewPort,
|
|
8481
|
+
};
|
|
8120
8482
|
};
|
|
8121
8483
|
|
|
8122
8484
|
/**
|
|
@@ -8185,6 +8547,270 @@ const DEFAULT_EMBED_WIDTH = '100%';
|
|
|
8185
8547
|
const DEFAULT_EMBED_HEIGHT = '100%';
|
|
8186
8548
|
const DEFAULT_LAZY_LOADING_MARGIN = '500px 0px';
|
|
8187
8549
|
|
|
8550
|
+
/**
|
|
8551
|
+
* Copyright (c) 2025
|
|
8552
|
+
*
|
|
8553
|
+
* Full-height support for the Liveboard and app embeds.
|
|
8554
|
+
* @summary Full height
|
|
8555
|
+
*/
|
|
8556
|
+
/**
|
|
8557
|
+
* The height the embed falls back to when the host app has not configured
|
|
8558
|
+
* `minimumHeight` or `defaultHeight`.
|
|
8559
|
+
*/
|
|
8560
|
+
const DEFAULT_MINIMUM_HEIGHT = 500;
|
|
8561
|
+
/**
|
|
8562
|
+
* Routes that are part of the Liveboard experience itself. Navigating between
|
|
8563
|
+
* these does not reset the frame height, because the ThoughtSpot app keeps
|
|
8564
|
+
* reporting a height of its own for them.
|
|
8565
|
+
*/
|
|
8566
|
+
const LIVEBOARD_RELATED_ROUTES = [
|
|
8567
|
+
'/pinboard/',
|
|
8568
|
+
'/insights/pinboard/',
|
|
8569
|
+
'/schedules/',
|
|
8570
|
+
'/embed/viz/',
|
|
8571
|
+
'/embed/insights/viz/',
|
|
8572
|
+
'/liveboard/',
|
|
8573
|
+
'/insights/liveboard/',
|
|
8574
|
+
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
8575
|
+
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
8576
|
+
];
|
|
8577
|
+
/**
|
|
8578
|
+
* Owns every piece of full-height behavior for an embed: the height
|
|
8579
|
+
* negotiation with the ThoughtSpot app, the query parameters that switch the
|
|
8580
|
+
* feature on, and the viewport listeners that drive lazy loading.
|
|
8581
|
+
*
|
|
8582
|
+
* The controller is inert unless `fullHeight` is enabled, so embeds can create
|
|
8583
|
+
* one unconditionally.
|
|
8584
|
+
*/
|
|
8585
|
+
class FullHeightController {
|
|
8586
|
+
constructor(viewConfig, host) {
|
|
8587
|
+
this.host = host;
|
|
8588
|
+
this.scrollContainers = [];
|
|
8589
|
+
/**
|
|
8590
|
+
* Sets the frame height to the height reported by the ThoughtSpot app,
|
|
8591
|
+
* never going below the configured minimum.
|
|
8592
|
+
*/
|
|
8593
|
+
this.handleEmbedHeight = (payload) => {
|
|
8594
|
+
const height = Number(payload === null || payload === void 0 ? void 0 : payload.data);
|
|
8595
|
+
if (!isNaN(height)) {
|
|
8596
|
+
this.host.setFrameHeight(Math.max(height, this.minimumHeight));
|
|
8597
|
+
}
|
|
8598
|
+
this.sendVisibleCoordinates();
|
|
8599
|
+
};
|
|
8600
|
+
/**
|
|
8601
|
+
* Answers the app's request for the center of the visible embed region.
|
|
8602
|
+
*/
|
|
8603
|
+
this.handleEmbedIframeCenter = (payload, responder) => {
|
|
8604
|
+
const iframe = this.host.getIframe();
|
|
8605
|
+
if (!iframe) {
|
|
8606
|
+
return;
|
|
8607
|
+
}
|
|
8608
|
+
responder === null || responder === void 0 ? void 0 : responder({
|
|
8609
|
+
type: EmbedEvent.EmbedIframeCenter,
|
|
8610
|
+
data: calculateElementCenter(iframe),
|
|
8611
|
+
});
|
|
8612
|
+
};
|
|
8613
|
+
/**
|
|
8614
|
+
* Answers the app's request for the currently visible embed coordinates.
|
|
8615
|
+
*/
|
|
8616
|
+
this.handleRequestVisibleCoordinates = (payload, responder) => {
|
|
8617
|
+
logger$3.info('Sending RequestVisibleEmbedCoordinates', payload);
|
|
8618
|
+
responder === null || responder === void 0 ? void 0 : responder({
|
|
8619
|
+
type: EmbedEvent.RequestVisibleEmbedCoordinates,
|
|
8620
|
+
data: this.getVisibleCoordinates(),
|
|
8621
|
+
});
|
|
8622
|
+
};
|
|
8623
|
+
/**
|
|
8624
|
+
* Resets the frame height when the app navigates away from a Liveboard,
|
|
8625
|
+
* since only Liveboard routes report a height of their own.
|
|
8626
|
+
*/
|
|
8627
|
+
this.handleRouteChange = (payload) => {
|
|
8628
|
+
var _a, _b;
|
|
8629
|
+
const currentPath = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.currentPath;
|
|
8630
|
+
if (!currentPath) {
|
|
8631
|
+
return;
|
|
8632
|
+
}
|
|
8633
|
+
if (LIVEBOARD_RELATED_ROUTES.some((route) => currentPath.startsWith(route))) {
|
|
8634
|
+
return;
|
|
8635
|
+
}
|
|
8636
|
+
this.host.setFrameHeight(((_b = this.config.frameParams) === null || _b === void 0 ? void 0 : _b.height) || this.minimumHeight);
|
|
8637
|
+
};
|
|
8638
|
+
/**
|
|
8639
|
+
* Pushes the visible embed region to the app so it can decide which
|
|
8640
|
+
* visualizations to load.
|
|
8641
|
+
*/
|
|
8642
|
+
this.sendVisibleCoordinates = () => {
|
|
8643
|
+
if (!this.isLazyLoadEnabled) {
|
|
8644
|
+
return;
|
|
8645
|
+
}
|
|
8646
|
+
const coordinates = this.getVisibleCoordinates();
|
|
8647
|
+
if (coordinates) {
|
|
8648
|
+
this.host.trigger(HostEvent.VisibleEmbedCoordinates, coordinates);
|
|
8649
|
+
}
|
|
8650
|
+
};
|
|
8651
|
+
this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
|
|
8652
|
+
this.registerEventHandlers();
|
|
8653
|
+
}
|
|
8654
|
+
/**
|
|
8655
|
+
* The view config the controller runs on: the host app's own config with
|
|
8656
|
+
* the lazy-loading defaults filled in. Read-only, so the only way to change
|
|
8657
|
+
* it is through the setter, which re-resolves the defaults.
|
|
8658
|
+
*/
|
|
8659
|
+
get viewConfig() {
|
|
8660
|
+
return this.config;
|
|
8661
|
+
}
|
|
8662
|
+
/**
|
|
8663
|
+
* Replaces the view config the controller runs on and re-resolves the
|
|
8664
|
+
* lazy-loading defaults against it. The config the caller passes is never
|
|
8665
|
+
* written to; the controller keeps a copy of its own.
|
|
8666
|
+
*/
|
|
8667
|
+
set viewConfig(viewConfig) {
|
|
8668
|
+
this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
|
|
8669
|
+
}
|
|
8670
|
+
/**
|
|
8671
|
+
* The view config with the lazy-loading settings the embed falls back to
|
|
8672
|
+
* when the host app has not chosen its own.
|
|
8673
|
+
*
|
|
8674
|
+
* Pure by design: it returns a new config rather than writing to the one it
|
|
8675
|
+
* is given, so the host app's object is left untouched.
|
|
8676
|
+
* @param viewConfig The embed's view config
|
|
8677
|
+
* @returns A copy with the defaults filled in, host app choices preserved
|
|
8678
|
+
*/
|
|
8679
|
+
static withLazyLoadingDefaults(viewConfig) {
|
|
8680
|
+
return {
|
|
8681
|
+
...viewConfig,
|
|
8682
|
+
lazyLoadingForFullHeight: viewConfig.lazyLoadingForFullHeight === undefined
|
|
8683
|
+
? true
|
|
8684
|
+
: viewConfig.lazyLoadingForFullHeight,
|
|
8685
|
+
enableScrollableContainerLazyLoading: viewConfig.enableScrollableContainerLazyLoading === undefined
|
|
8686
|
+
? true
|
|
8687
|
+
: viewConfig.enableScrollableContainerLazyLoading,
|
|
8688
|
+
lazyLoadingMargin: viewConfig.lazyLoadingMargin === undefined
|
|
8689
|
+
? DEFAULT_LAZY_LOADING_MARGIN
|
|
8690
|
+
: viewConfig.lazyLoadingMargin,
|
|
8691
|
+
};
|
|
8692
|
+
}
|
|
8693
|
+
/**
|
|
8694
|
+
* Whether the host app asked for a full-height embed.
|
|
8695
|
+
*/
|
|
8696
|
+
get isEnabled() {
|
|
8697
|
+
return this.config.fullHeight === true;
|
|
8698
|
+
}
|
|
8699
|
+
/**
|
|
8700
|
+
* Whether visualizations should load as they scroll into view, which
|
|
8701
|
+
* requires the SDK to report the visible region of the embed.
|
|
8702
|
+
*/
|
|
8703
|
+
get isLazyLoadEnabled() {
|
|
8704
|
+
return this.isEnabled && !!this.config.lazyLoadingForFullHeight;
|
|
8705
|
+
}
|
|
8706
|
+
/**
|
|
8707
|
+
* The floor for the frame height. `defaultHeight` is the deprecated
|
|
8708
|
+
* spelling of `minimumHeight` and is still honored for compatibility.
|
|
8709
|
+
*/
|
|
8710
|
+
get minimumHeight() {
|
|
8711
|
+
const { minimumHeight, defaultHeight } = this.config;
|
|
8712
|
+
return minimumHeight || defaultHeight || DEFAULT_MINIMUM_HEIGHT;
|
|
8713
|
+
}
|
|
8714
|
+
/**
|
|
8715
|
+
* Registers the embed event handlers the feature depends on. Called from
|
|
8716
|
+
* the constructor, so the handlers are in place before `render`.
|
|
8717
|
+
*/
|
|
8718
|
+
registerEventHandlers() {
|
|
8719
|
+
if (!this.isEnabled) {
|
|
8720
|
+
return;
|
|
8721
|
+
}
|
|
8722
|
+
this.host.on(EmbedEvent.RouteChange, this.handleRouteChange);
|
|
8723
|
+
this.host.on(EmbedEvent.EmbedHeight, this.handleEmbedHeight);
|
|
8724
|
+
this.host.on(EmbedEvent.EmbedIframeCenter, this.handleEmbedIframeCenter);
|
|
8725
|
+
this.host.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.handleRequestVisibleCoordinates);
|
|
8726
|
+
}
|
|
8727
|
+
/**
|
|
8728
|
+
* Adds the full-height query parameters to the embed URL params.
|
|
8729
|
+
* @param params The query parameters being built by the embed
|
|
8730
|
+
*/
|
|
8731
|
+
addQueryParams(params) {
|
|
8732
|
+
if (!this.isEnabled) {
|
|
8733
|
+
return;
|
|
8734
|
+
}
|
|
8735
|
+
params[Param.fullHeight] = true;
|
|
8736
|
+
if (!this.config.lazyLoadingForFullHeight) {
|
|
8737
|
+
return;
|
|
8738
|
+
}
|
|
8739
|
+
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
8740
|
+
if (isValidCssMargin(this.config.lazyLoadingMargin)) {
|
|
8741
|
+
params[Param.RootMarginForLazyLoad] = this.config.lazyLoadingMargin;
|
|
8742
|
+
}
|
|
8743
|
+
}
|
|
8744
|
+
/**
|
|
8745
|
+
* Attaches the viewport listeners that keep lazy loading in sync. Call this
|
|
8746
|
+
* once the embed has rendered and the iframe exists.
|
|
8747
|
+
*/
|
|
8748
|
+
onRender() {
|
|
8749
|
+
this.registerLazyLoadListeners();
|
|
8750
|
+
}
|
|
8751
|
+
/**
|
|
8752
|
+
* Detaches every listener and observer owned by the controller.
|
|
8753
|
+
*/
|
|
8754
|
+
destroy() {
|
|
8755
|
+
this.unregisterLazyLoadListeners();
|
|
8756
|
+
}
|
|
8757
|
+
getVisibleCoordinates() {
|
|
8758
|
+
const iframe = this.host.getIframe();
|
|
8759
|
+
if (!iframe) {
|
|
8760
|
+
return null;
|
|
8761
|
+
}
|
|
8762
|
+
return calculateVisibleElementData(iframe, this.config.enableScrollableContainerLazyLoading);
|
|
8763
|
+
}
|
|
8764
|
+
registerLazyLoadListeners() {
|
|
8765
|
+
if (!this.isLazyLoadEnabled || !this.host.getIframe()) {
|
|
8766
|
+
return;
|
|
8767
|
+
}
|
|
8768
|
+
// Re-registering is safe: drop whatever a previous render attached.
|
|
8769
|
+
this.unregisterLazyLoadListeners();
|
|
8770
|
+
// TODO: Use passive: true, install modernizr to check for passive
|
|
8771
|
+
window.addEventListener('resize', this.sendVisibleCoordinates);
|
|
8772
|
+
window.addEventListener('scroll', this.sendVisibleCoordinates, true);
|
|
8773
|
+
if (!this.config.enableScrollableContainerLazyLoading) {
|
|
8774
|
+
return;
|
|
8775
|
+
}
|
|
8776
|
+
this.observeScrollableContainers();
|
|
8777
|
+
}
|
|
8778
|
+
/**
|
|
8779
|
+
* Tracks the ancestors that can scroll or clip the embed, so the visible
|
|
8780
|
+
* region stays correct when the embed lives inside its own scroll
|
|
8781
|
+
* container rather than the page.
|
|
8782
|
+
*/
|
|
8783
|
+
observeScrollableContainers() {
|
|
8784
|
+
const iFrame = this.host.getIframe();
|
|
8785
|
+
this.scrollContainers = getScrollableAncestors(iFrame);
|
|
8786
|
+
this.scrollContainers.forEach((scrollContainer) => {
|
|
8787
|
+
scrollContainer.addEventListener('scroll', this.sendVisibleCoordinates);
|
|
8788
|
+
});
|
|
8789
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
8790
|
+
return;
|
|
8791
|
+
}
|
|
8792
|
+
const resizeTargets = new Set([iFrame.parentElement, ...getEffectiveClippingAncestors(iFrame)].filter(Boolean));
|
|
8793
|
+
this.resizeObserver = new ResizeObserver(this.sendVisibleCoordinates);
|
|
8794
|
+
resizeTargets.forEach((resizeTarget) => {
|
|
8795
|
+
this.resizeObserver.observe(resizeTarget);
|
|
8796
|
+
});
|
|
8797
|
+
}
|
|
8798
|
+
unregisterLazyLoadListeners() {
|
|
8799
|
+
var _a;
|
|
8800
|
+
if (!this.isLazyLoadEnabled) {
|
|
8801
|
+
return;
|
|
8802
|
+
}
|
|
8803
|
+
window.removeEventListener('resize', this.sendVisibleCoordinates);
|
|
8804
|
+
window.removeEventListener('scroll', this.sendVisibleCoordinates, true);
|
|
8805
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
8806
|
+
this.resizeObserver = undefined;
|
|
8807
|
+
this.scrollContainers.forEach((scrollContainer) => {
|
|
8808
|
+
scrollContainer.removeEventListener('scroll', this.sendVisibleCoordinates);
|
|
8809
|
+
});
|
|
8810
|
+
this.scrollContainers = [];
|
|
8811
|
+
}
|
|
8812
|
+
}
|
|
8813
|
+
|
|
8188
8814
|
/** Used for built-in method references. */
|
|
8189
8815
|
var objectProto$d = Object.prototype;
|
|
8190
8816
|
|
|
@@ -9093,7 +9719,110 @@ var UIPassthroughEvent;
|
|
|
9093
9719
|
UIPassthroughEvent["GetTabs"] = "getTabs";
|
|
9094
9720
|
UIPassthroughEvent["GetGroups"] = "getGroups";
|
|
9095
9721
|
UIPassthroughEvent["GetExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
|
|
9096
|
-
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
9722
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
9723
|
+
// NOTE: HostEventRequest / HostEventResponse / TriggerPayload / TriggerResponse
|
|
9724
|
+
// live in the sibling ./host-event-contracts, which layers the
|
|
9725
|
+
// HostEventRequestMap on top of the UI-passthrough mapping above.
|
|
9726
|
+
// The former 2-tier definitions that lived here were superseded and removed.
|
|
9727
|
+
|
|
9728
|
+
/**
|
|
9729
|
+
* Copyright (c) 2026
|
|
9730
|
+
*
|
|
9731
|
+
* Dedicated transport layer for SDK <-> ThoughtSpot iframe messaging.
|
|
9732
|
+
*
|
|
9733
|
+
* Owns the postMessage/MessageChannel mechanics and origin resolution so
|
|
9734
|
+
* that embed/business logic (ts-embed.ts, hostEventClient) never touches
|
|
9735
|
+
* the wire directly. The wire format is unchanged from the historical
|
|
9736
|
+
* implementation — this layer is a pure structural extraction.
|
|
9737
|
+
*/
|
|
9738
|
+
/**
|
|
9739
|
+
* Default time to wait for the app to respond to a request-response
|
|
9740
|
+
* message before giving up and reclaiming the channel.
|
|
9741
|
+
*/
|
|
9742
|
+
const MESSAGE_RESPONSE_TIMEOUT = 30000;
|
|
9743
|
+
/**
|
|
9744
|
+
* Single implementation of origin resolution for the embedded app.
|
|
9745
|
+
* Returns the origin (scheme://host[:port]) for a ThoughtSpot host URL,
|
|
9746
|
+
* or null when it cannot be parsed.
|
|
9747
|
+
* @param thoughtSpotHost
|
|
9748
|
+
*/
|
|
9749
|
+
const resolveMessageOrigin = (thoughtSpotHost) => {
|
|
9750
|
+
try {
|
|
9751
|
+
return new URL(thoughtSpotHost).origin;
|
|
9752
|
+
}
|
|
9753
|
+
catch (e) {
|
|
9754
|
+
return null;
|
|
9755
|
+
}
|
|
9756
|
+
};
|
|
9757
|
+
/**
|
|
9758
|
+
* Validates that an inbound window message came from the embedded
|
|
9759
|
+
* ThoughtSpot app: the source window must be the embed iframe's window and,
|
|
9760
|
+
* when the expected origin is resolvable, the message origin must match it.
|
|
9761
|
+
*
|
|
9762
|
+
* Fails open (returns true) on the origin check when the expected origin
|
|
9763
|
+
* cannot be resolved, to avoid breaking unconventional-but-working setups;
|
|
9764
|
+
* a warning is logged on mismatch either way.
|
|
9765
|
+
* @param event The message event received on window.
|
|
9766
|
+
* @param iFrame The embed iframe the message should originate from.
|
|
9767
|
+
* @param thoughtSpotHost The configured ThoughtSpot host.
|
|
9768
|
+
*/
|
|
9769
|
+
const isMessageFromIframe = (event, iFrame, thoughtSpotHost) => {
|
|
9770
|
+
if (event.source !== (iFrame === null || iFrame === void 0 ? void 0 : iFrame.contentWindow)) {
|
|
9771
|
+
return false;
|
|
9772
|
+
}
|
|
9773
|
+
const expectedOrigin = resolveMessageOrigin(thoughtSpotHost);
|
|
9774
|
+
if (expectedOrigin && event.origin && event.origin !== expectedOrigin) {
|
|
9775
|
+
logger$3.warn(`Dropped message from unexpected origin ${event.origin}; expected ${expectedOrigin}`);
|
|
9776
|
+
return false;
|
|
9777
|
+
}
|
|
9778
|
+
return true;
|
|
9779
|
+
};
|
|
9780
|
+
/**
|
|
9781
|
+
* Posts a one-way message to the embedded app's iframe, optionally
|
|
9782
|
+
* transferring a MessageChannel port for the response.
|
|
9783
|
+
* @param iFrame
|
|
9784
|
+
* @param message
|
|
9785
|
+
* @param thoughtSpotHost Used as the postMessage targetOrigin.
|
|
9786
|
+
* @param channel
|
|
9787
|
+
*/
|
|
9788
|
+
const postMessageToIframe = (iFrame, message, thoughtSpotHost, channel) => {
|
|
9789
|
+
var _a;
|
|
9790
|
+
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, channel ? [channel.port2] : []);
|
|
9791
|
+
};
|
|
9792
|
+
/**
|
|
9793
|
+
* Sends a request-response message to the embedded app over a dedicated
|
|
9794
|
+
* MessageChannel. Resolves with the response payload; rejects when the app
|
|
9795
|
+
* responds with an error; resolves with a timeout Error object when no
|
|
9796
|
+
* response arrives in time (historical behavior, preserved for backward
|
|
9797
|
+
* compatibility).
|
|
9798
|
+
* @param iFrame
|
|
9799
|
+
* @param message
|
|
9800
|
+
* @param thoughtSpotHost
|
|
9801
|
+
* @param timeoutMs
|
|
9802
|
+
*/
|
|
9803
|
+
function sendMessageWithResponse(iFrame, message, thoughtSpotHost, timeoutMs = MESSAGE_RESPONSE_TIMEOUT) {
|
|
9804
|
+
return new Promise((res, rej) => {
|
|
9805
|
+
const channel = new MessageChannel();
|
|
9806
|
+
// Close the messageChannel and resolve the promise if timeout.
|
|
9807
|
+
const timeoutId = setTimeout(() => {
|
|
9808
|
+
channel.port1.close();
|
|
9809
|
+
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
9810
|
+
}, timeoutMs);
|
|
9811
|
+
channel.port1.onmessage = ({ data: responseData }) => {
|
|
9812
|
+
var _a;
|
|
9813
|
+
clearTimeout(timeoutId);
|
|
9814
|
+
channel.port1.close();
|
|
9815
|
+
const error = (responseData === null || responseData === void 0 ? void 0 : responseData.error) || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
|
|
9816
|
+
if (error) {
|
|
9817
|
+
rej(error);
|
|
9818
|
+
}
|
|
9819
|
+
else {
|
|
9820
|
+
res(responseData);
|
|
9821
|
+
}
|
|
9822
|
+
};
|
|
9823
|
+
postMessageToIframe(iFrame, message, thoughtSpotHost, channel);
|
|
9824
|
+
});
|
|
9825
|
+
}
|
|
9097
9826
|
|
|
9098
9827
|
const EndPoints = {
|
|
9099
9828
|
AUTH_VERIFICATION: '/callosum/v1/session/info',
|
|
@@ -10027,7 +10756,7 @@ class AnswerService {
|
|
|
10027
10756
|
async getTML() {
|
|
10028
10757
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
10029
10758
|
const edoc = object[0].edoc;
|
|
10030
|
-
const YAML = await import('./index-
|
|
10759
|
+
const YAML = await import('./index-C1pmYb5H.js');
|
|
10031
10760
|
const parsedDoc = YAML.parse(edoc);
|
|
10032
10761
|
return {
|
|
10033
10762
|
answer: {
|
|
@@ -20265,23 +20994,11 @@ const reload = (iFrame) => {
|
|
|
20265
20994
|
iFrame.src = src;
|
|
20266
20995
|
}, 100);
|
|
20267
20996
|
};
|
|
20997
|
+
const TRIGGER_TIMEOUT = MESSAGE_RESPONSE_TIMEOUT;
|
|
20268
20998
|
/**
|
|
20269
|
-
*
|
|
20270
|
-
*
|
|
20271
|
-
*
|
|
20272
|
-
* @param message.type
|
|
20273
|
-
* @param message.data
|
|
20274
|
-
* @param message.context
|
|
20275
|
-
* @param thoughtSpotHost
|
|
20276
|
-
* @param channel
|
|
20277
|
-
*/
|
|
20278
|
-
function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
|
|
20279
|
-
var _a;
|
|
20280
|
-
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
|
|
20281
|
-
}
|
|
20282
|
-
const TRIGGER_TIMEOUT = 30000;
|
|
20283
|
-
/**
|
|
20284
|
-
*
|
|
20999
|
+
* Processes a host event trigger: handles SDK-local events (Reload,
|
|
21000
|
+
* Present) and forwards everything else to the embedded app over the
|
|
21001
|
+
* iframe transport.
|
|
20285
21002
|
* @param iFrame
|
|
20286
21003
|
* @param messageType
|
|
20287
21004
|
* @param thoughtSpotHost
|
|
@@ -20289,42 +21006,22 @@ const TRIGGER_TIMEOUT = 30000;
|
|
|
20289
21006
|
* @param context
|
|
20290
21007
|
*/
|
|
20291
21008
|
function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
|
|
20292
|
-
|
|
20293
|
-
|
|
20294
|
-
|
|
20295
|
-
|
|
20296
|
-
|
|
20297
|
-
|
|
20298
|
-
|
|
20299
|
-
|
|
20300
|
-
|
|
20301
|
-
|
|
20302
|
-
handlePresentEvent(iFrame);
|
|
20303
|
-
}
|
|
20304
|
-
else {
|
|
20305
|
-
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
20306
|
-
}
|
|
21009
|
+
var _a;
|
|
21010
|
+
if (messageType === HostEvent.Reload) {
|
|
21011
|
+
reload(iFrame);
|
|
21012
|
+
return Promise.resolve(null);
|
|
21013
|
+
}
|
|
21014
|
+
if (messageType === HostEvent.Present) {
|
|
21015
|
+
const embedConfig = getEmbedConfig();
|
|
21016
|
+
const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
|
|
21017
|
+
if (!disableFullscreenPresentation) {
|
|
21018
|
+
handlePresentEvent(iFrame);
|
|
20307
21019
|
}
|
|
20308
|
-
|
|
20309
|
-
|
|
20310
|
-
|
|
20311
|
-
|
|
20312
|
-
|
|
20313
|
-
}, TRIGGER_TIMEOUT);
|
|
20314
|
-
channel.port1.onmessage = ({ data: responseData }) => {
|
|
20315
|
-
var _a;
|
|
20316
|
-
clearTimeout(timeoutId);
|
|
20317
|
-
channel.port1.close();
|
|
20318
|
-
const error = (responseData === null || responseData === void 0 ? void 0 : responseData.error) || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
|
|
20319
|
-
if (error) {
|
|
20320
|
-
rej(error);
|
|
20321
|
-
}
|
|
20322
|
-
else {
|
|
20323
|
-
res(responseData);
|
|
20324
|
-
}
|
|
20325
|
-
};
|
|
20326
|
-
return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
|
|
20327
|
-
});
|
|
21020
|
+
else {
|
|
21021
|
+
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
21022
|
+
}
|
|
21023
|
+
}
|
|
21024
|
+
return sendMessageWithResponse(iFrame, { type: messageType, data, context }, thoughtSpotHost, TRIGGER_TIMEOUT);
|
|
20328
21025
|
}
|
|
20329
21026
|
|
|
20330
21027
|
/**
|
|
@@ -21186,6 +21883,11 @@ class HostEventClient {
|
|
|
21186
21883
|
if (!isValidUpdateFiltersPayload(payload)) {
|
|
21187
21884
|
throwUpdateFiltersValidationError();
|
|
21188
21885
|
}
|
|
21886
|
+
// The shared contract accepts both current (columnName/operator) and
|
|
21887
|
+
// legacy (column/oper) filter field names — as does the validation
|
|
21888
|
+
// above and the app at runtime. The UIPassthrough FilterUpdate type
|
|
21889
|
+
// still requires the legacy names; bridge until that contract is
|
|
21890
|
+
// audited.
|
|
21189
21891
|
return this.handleHostEventWithParam(UIPassthroughEvent.UpdateFilters, payload, context);
|
|
21190
21892
|
}
|
|
21191
21893
|
handleUpdateParametersEvent(payload, context) {
|
|
@@ -21420,6 +22122,12 @@ const TS_EMBED_ID = '_thoughtspot-embed';
|
|
|
21420
22122
|
*/
|
|
21421
22123
|
const PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY = 'tsEmbedOriginalPosition';
|
|
21422
22124
|
const PRERENDER_WRAPPER_ID_PREFIX = 'tsEmbed-pre-render-wrapper-';
|
|
22125
|
+
// The container applies UpdateEmbedParams through React state, so a delivered
|
|
22126
|
+
// post is not the same as the params being in effect.
|
|
22127
|
+
const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
|
|
22128
|
+
// The container ignores runtimeFilterParams/runtimeParameterParams unless truthy, so
|
|
22129
|
+
// null or '' leaves the previous embed's values in place. '&' is truthy and parses to {}.
|
|
22130
|
+
const NO_RUNTIME_PARAMS = '&';
|
|
21423
22131
|
/**
|
|
21424
22132
|
* The event id map from v2 event names to v1 event id
|
|
21425
22133
|
* v1 events are the classic embed events implemented in Blink v1
|
|
@@ -21446,6 +22154,7 @@ class TsEmbed {
|
|
|
21446
22154
|
* The key to store the embed instance in the DOM node
|
|
21447
22155
|
*/
|
|
21448
22156
|
this.embedNodeKey = '__tsEmbed';
|
|
22157
|
+
this.embedContainerLoadedKey = '__tsEmbedContainerLoaded';
|
|
21449
22158
|
this.isAppInitialized = false;
|
|
21450
22159
|
/**
|
|
21451
22160
|
* Should we encode URL Query Params using base64 encoding which ThoughtSpot
|
|
@@ -21466,7 +22175,7 @@ class TsEmbed {
|
|
|
21466
22175
|
const eventType = this.getEventType(event);
|
|
21467
22176
|
const eventPort = this.getEventPort(event);
|
|
21468
22177
|
const eventData = this.formatEventData(event, eventType);
|
|
21469
|
-
if (event
|
|
22178
|
+
if (isMessageFromIframe(event, this.iFrame, this.thoughtSpotHost)) {
|
|
21470
22179
|
const processedEventData = processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.hostElement);
|
|
21471
22180
|
if (eventType === EmbedEvent.ApiIntercept) {
|
|
21472
22181
|
this.handleApiInterceptEvent({ eventData, eventPort });
|
|
@@ -21608,7 +22317,7 @@ class TsEmbed {
|
|
|
21608
22317
|
this.createEmbedContainerHandler = (source) => () => {
|
|
21609
22318
|
const processEmbedContainerReady = () => {
|
|
21610
22319
|
logger$3.debug('processEmbedContainerReady');
|
|
21611
|
-
this.
|
|
22320
|
+
this.markEmbedContainerLoaded();
|
|
21612
22321
|
this.executeEmbedContainerReadyCallbacks();
|
|
21613
22322
|
};
|
|
21614
22323
|
if (source === EmbedEvent.AuthInit) {
|
|
@@ -21622,6 +22331,9 @@ class TsEmbed {
|
|
|
21622
22331
|
processEmbedContainerReady();
|
|
21623
22332
|
}
|
|
21624
22333
|
};
|
|
22334
|
+
// Subclasses that navigate the pre-render on show must await this before
|
|
22335
|
+
// triggering Navigate. Resolves even on failure, so navigation is never blocked.
|
|
22336
|
+
this.preRenderParamsApplied = Promise.resolve();
|
|
21625
22337
|
this.hostElement = getDOMNode(domSelector);
|
|
21626
22338
|
this.eventHandlerMap = new Map();
|
|
21627
22339
|
this.isError = false;
|
|
@@ -21938,6 +22650,7 @@ class TsEmbed {
|
|
|
21938
22650
|
return `${basePath}#`;
|
|
21939
22651
|
}
|
|
21940
22652
|
async getUpdateEmbedParamsObject() {
|
|
22653
|
+
var _a, _b;
|
|
21941
22654
|
const queryParams = this.getEmbedParamsObject();
|
|
21942
22655
|
// Values are URL-serialized (e.g. dataSources as '["guid"]'); parse
|
|
21943
22656
|
// them back so the event payload matches a URL load (SCAL-334713).
|
|
@@ -21945,7 +22658,16 @@ class TsEmbed {
|
|
|
21945
22658
|
queryParams[key] = deserializeParam(queryParams[key]);
|
|
21946
22659
|
});
|
|
21947
22660
|
const appInitData = await this.getAppInitData();
|
|
21948
|
-
return {
|
|
22661
|
+
return {
|
|
22662
|
+
...this.viewConfig,
|
|
22663
|
+
...queryParams,
|
|
22664
|
+
...appInitData,
|
|
22665
|
+
// A show cycle has no URL to carry these, so the payload always states them
|
|
22666
|
+
// — including "none", which is the case that leaks the previous filters.
|
|
22667
|
+
runtimeFilterParams: getFilterQuery((_a = this.viewConfig.runtimeFilters) !== null && _a !== void 0 ? _a : []) || NO_RUNTIME_PARAMS,
|
|
22668
|
+
runtimeParameterParams: getRuntimeParameters((_b = this.viewConfig.runtimeParameters) !== null && _b !== void 0 ? _b : [])
|
|
22669
|
+
|| NO_RUNTIME_PARAMS,
|
|
22670
|
+
};
|
|
21949
22671
|
}
|
|
21950
22672
|
/**
|
|
21951
22673
|
* Common query params set for all the embed modes.
|
|
@@ -22576,40 +23298,6 @@ class TsEmbed {
|
|
|
22576
23298
|
getCompatibleEventType(eventType) {
|
|
22577
23299
|
return V1EventMap[eventType] || eventType;
|
|
22578
23300
|
}
|
|
22579
|
-
/**
|
|
22580
|
-
* Calculates the iframe center for the current visible viewPort
|
|
22581
|
-
* of iframe using Scroll position of Host App, offsetTop for iframe
|
|
22582
|
-
* in Host app. ViewPort height of the tab.
|
|
22583
|
-
* @returns iframe Center in visible viewport,
|
|
22584
|
-
* Iframe height,
|
|
22585
|
-
* View port height.
|
|
22586
|
-
*/
|
|
22587
|
-
getIframeCenter() {
|
|
22588
|
-
const offsetTopClient = getOffsetTop(this.iFrame);
|
|
22589
|
-
const scrollTopClient = window.scrollY;
|
|
22590
|
-
const viewPortHeight = window.innerHeight;
|
|
22591
|
-
const iframeHeight = this.iFrame.offsetHeight;
|
|
22592
|
-
const iframeScrolled = scrollTopClient - offsetTopClient;
|
|
22593
|
-
let iframeVisibleViewPort;
|
|
22594
|
-
let iframeOffset;
|
|
22595
|
-
if (iframeScrolled < 0) {
|
|
22596
|
-
iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
|
|
22597
|
-
iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
|
|
22598
|
-
iframeOffset = 0;
|
|
22599
|
-
}
|
|
22600
|
-
else {
|
|
22601
|
-
iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
|
|
22602
|
-
iframeOffset = iframeScrolled;
|
|
22603
|
-
}
|
|
22604
|
-
const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
|
|
22605
|
-
return {
|
|
22606
|
-
iframeCenter,
|
|
22607
|
-
iframeScrolled,
|
|
22608
|
-
iframeHeight,
|
|
22609
|
-
viewPortHeight,
|
|
22610
|
-
iframeVisibleViewPort,
|
|
22611
|
-
};
|
|
22612
|
-
}
|
|
22613
23301
|
/**
|
|
22614
23302
|
* Registers an event listener to trigger an alert when the ThoughtSpot app
|
|
22615
23303
|
* sends an event of a particular message type to the host application.
|
|
@@ -22693,13 +23381,32 @@ class TsEmbed {
|
|
|
22693
23381
|
var _a;
|
|
22694
23382
|
const embedObj = (_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
22695
23383
|
if (embedObj === this) {
|
|
22696
|
-
logger$3.
|
|
23384
|
+
logger$3.debug('embedObj is same as this');
|
|
22697
23385
|
}
|
|
22698
23386
|
return embedObj;
|
|
22699
23387
|
}
|
|
23388
|
+
takeOverPreRender() {
|
|
23389
|
+
if (!this.preRenderWrapper)
|
|
23390
|
+
return;
|
|
23391
|
+
this.preRenderWrapper[this.embedNodeKey] = this;
|
|
23392
|
+
}
|
|
23393
|
+
// The flag lives on the wrapper because it describes the iframe: an instance
|
|
23394
|
+
// hidden when the container announced itself would otherwise report false forever.
|
|
23395
|
+
markEmbedContainerLoaded() {
|
|
23396
|
+
this.isEmbedContainerLoaded = true;
|
|
23397
|
+
if (this.preRenderWrapper) {
|
|
23398
|
+
this.preRenderWrapper[this.embedContainerLoadedKey] = true;
|
|
23399
|
+
}
|
|
23400
|
+
}
|
|
22700
23401
|
checkEmbedContainerLoaded() {
|
|
23402
|
+
var _a;
|
|
22701
23403
|
if (this.isEmbedContainerLoaded)
|
|
22702
23404
|
return true;
|
|
23405
|
+
if ((_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedContainerLoadedKey]) {
|
|
23406
|
+
this.isEmbedContainerLoaded = true;
|
|
23407
|
+
return true;
|
|
23408
|
+
}
|
|
23409
|
+
// Older builds stamped the flag on the instance, not the wrapper.
|
|
22703
23410
|
const preRenderObj = this.getPreRenderObj();
|
|
22704
23411
|
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
22705
23412
|
this.isEmbedContainerLoaded = true;
|
|
@@ -22728,8 +23435,12 @@ class TsEmbed {
|
|
|
22728
23435
|
}
|
|
22729
23436
|
/**
|
|
22730
23437
|
* Triggers an event to the embedded app
|
|
23438
|
+
*
|
|
23439
|
+
* Payload typing: from SDK 1.52.0 (ThoughtSpot Cloud 26.9.0.cl), unknown fields
|
|
23440
|
+
* on a known event's payload fail to compile. From SDK 1.54.0 (26.11.0.cl) the
|
|
23441
|
+
* payload is checked strictly against the event contract — update call sites now.
|
|
22731
23442
|
* @param {HostEvent} messageType The event type
|
|
22732
|
-
* @param {
|
|
23443
|
+
* @param {TriggerData} data The payload, typed against the event's contract
|
|
22733
23444
|
* @param {ContextType} context Optional context type to specify the context from which the event is triggered.
|
|
22734
23445
|
* Use ContextType.Search for search answer context, ContextType.Answer for answer/explore context,
|
|
22735
23446
|
* ContextType.Liveboard for liveboard context, or ContextType.Spotter for spotter context.
|
|
@@ -22746,7 +23457,11 @@ class TsEmbed {
|
|
|
22746
23457
|
* ```
|
|
22747
23458
|
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl (for context parameter)
|
|
22748
23459
|
*/
|
|
22749
|
-
async trigger(messageType,
|
|
23460
|
+
async trigger(messageType,
|
|
23461
|
+
// Contract shape is the contextual type: payload fields autocomplete
|
|
23462
|
+
// and unknown fields on object literals are flagged. Strict checks
|
|
23463
|
+
// land in SDK 1.54.0 — see TriggerData.
|
|
23464
|
+
data = {}, context) {
|
|
22750
23465
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
22751
23466
|
if (!this.isRendered) {
|
|
22752
23467
|
this.handleError({
|
|
@@ -23034,20 +23749,27 @@ class TsEmbed {
|
|
|
23034
23749
|
// have moved on to UpdateEmbedParams supported clusters
|
|
23035
23750
|
// this.validatePreRenderViewConfig(this.viewConfig); removed in #517
|
|
23036
23751
|
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
23037
|
-
|
|
23038
|
-
|
|
23039
|
-
|
|
23040
|
-
|
|
23041
|
-
|
|
23042
|
-
|
|
23043
|
-
|
|
23044
|
-
|
|
23045
|
-
|
|
23046
|
-
|
|
23047
|
-
|
|
23048
|
-
|
|
23049
|
-
|
|
23050
|
-
|
|
23752
|
+
// Created synchronously: a queued navigation needs something to await
|
|
23753
|
+
// whether the container is already loaded or not.
|
|
23754
|
+
this.preRenderParamsApplied = new Promise((resolve) => {
|
|
23755
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
23756
|
+
try {
|
|
23757
|
+
const params = await this.getUpdateEmbedParamsObject();
|
|
23758
|
+
this.trigger(HostEvent.UpdateEmbedParams, params);
|
|
23759
|
+
}
|
|
23760
|
+
catch (error) {
|
|
23761
|
+
logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
|
|
23762
|
+
this.handleError({
|
|
23763
|
+
errorType: ErrorDetailsTypes.API,
|
|
23764
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
|
|
23765
|
+
code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
|
|
23766
|
+
error: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
23767
|
+
});
|
|
23768
|
+
}
|
|
23769
|
+
finally {
|
|
23770
|
+
setTimeout(resolve, UPDATE_EMBED_PARAMS_SETTLE_MS);
|
|
23771
|
+
}
|
|
23772
|
+
});
|
|
23051
23773
|
});
|
|
23052
23774
|
}
|
|
23053
23775
|
/**
|
|
@@ -23123,6 +23845,8 @@ class TsEmbed {
|
|
|
23123
23845
|
if (this.iFrame) {
|
|
23124
23846
|
this.setupFullscreenChangeHandler();
|
|
23125
23847
|
}
|
|
23848
|
+
// Last, so everything above still sees the instance being taken over from.
|
|
23849
|
+
this.takeOverPreRender();
|
|
23126
23850
|
return this;
|
|
23127
23851
|
}
|
|
23128
23852
|
getPreRenderPlaceHolderElement() {
|
|
@@ -23325,6 +24049,9 @@ class V1Embed extends TsEmbed {
|
|
|
23325
24049
|
* ```
|
|
23326
24050
|
*/
|
|
23327
24051
|
on(messageType, callback, options = { start: false }) {
|
|
24052
|
+
// Mirror the base TsEmbed.on generic signature so the enriched
|
|
24053
|
+
// EmbedEventPayload (e.g. CustomAction's answerService) flows through
|
|
24054
|
+
// the override too, and the class hierarchy stays assignable.
|
|
23328
24055
|
const eventType = this.getCompatibleEventType(messageType);
|
|
23329
24056
|
return super.on(eventType, callback, options);
|
|
23330
24057
|
}
|
|
@@ -23565,73 +24292,17 @@ class AppEmbed extends V1Embed {
|
|
|
23565
24292
|
constructor(domSelector, viewConfig) {
|
|
23566
24293
|
viewConfig.embedComponentType = 'AppEmbed';
|
|
23567
24294
|
super(domSelector, viewConfig);
|
|
23568
|
-
this.defaultHeight = 500;
|
|
23569
|
-
this.lazyLoadScrollContainers = [];
|
|
23570
|
-
this.sendFullHeightLazyLoadData = () => {
|
|
23571
|
-
const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
23572
|
-
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
23573
|
-
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
23574
|
-
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
|
|
23575
|
-
}
|
|
23576
|
-
};
|
|
23577
|
-
/**
|
|
23578
|
-
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
23579
|
-
* It is used to send the visible coordinates data to the host application.
|
|
23580
|
-
* @param data The event payload
|
|
23581
|
-
* @param responder The responder function
|
|
23582
|
-
*/
|
|
23583
|
-
this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
|
|
23584
|
-
logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
23585
|
-
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
23586
|
-
responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
23587
|
-
};
|
|
23588
|
-
/**
|
|
23589
|
-
* Set the iframe height as per the computed height received
|
|
23590
|
-
* from the ThoughtSpot app.
|
|
23591
|
-
* @param data The event payload
|
|
23592
|
-
*/
|
|
23593
|
-
this.updateIFrameHeight = (data) => {
|
|
23594
|
-
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
23595
|
-
this.sendFullHeightLazyLoadData();
|
|
23596
|
-
};
|
|
23597
|
-
this.embedIframeCenter = (data, responder) => {
|
|
23598
|
-
const obj = this.getIframeCenter();
|
|
23599
|
-
responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
|
|
23600
|
-
};
|
|
23601
|
-
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
23602
|
-
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
23603
|
-
const liveboardRelatedRoutes = [
|
|
23604
|
-
'/pinboard/',
|
|
23605
|
-
'/insights/pinboard/',
|
|
23606
|
-
'/schedules/',
|
|
23607
|
-
'/embed/viz/',
|
|
23608
|
-
'/embed/insights/viz/',
|
|
23609
|
-
'/liveboard/',
|
|
23610
|
-
'/insights/liveboard/',
|
|
23611
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
23612
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
23613
|
-
];
|
|
23614
|
-
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
23615
|
-
// Ignore the height reset of the frame, if the navigation is
|
|
23616
|
-
// only within the liveboard page.
|
|
23617
|
-
return;
|
|
23618
|
-
}
|
|
23619
|
-
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
23620
|
-
};
|
|
23621
24295
|
if (this.viewConfig.fullHeight === true) {
|
|
23622
|
-
|
|
23623
|
-
this.
|
|
23624
|
-
|
|
23625
|
-
|
|
23626
|
-
|
|
23627
|
-
|
|
23628
|
-
|
|
23629
|
-
|
|
23630
|
-
|
|
23631
|
-
|
|
23632
|
-
this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
23633
|
-
this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
23634
|
-
this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
|
|
24296
|
+
this.fullHeightController = new FullHeightController(this.viewConfig, {
|
|
24297
|
+
getIframe: () => this.iFrame,
|
|
24298
|
+
setFrameHeight: (height) => this.setIFrameHeight(height),
|
|
24299
|
+
on: (eventType, callback) => {
|
|
24300
|
+
this.on(eventType, callback);
|
|
24301
|
+
},
|
|
24302
|
+
trigger: (hostEvent, data) => {
|
|
24303
|
+
this.trigger(hostEvent, data);
|
|
24304
|
+
},
|
|
24305
|
+
});
|
|
23635
24306
|
}
|
|
23636
24307
|
}
|
|
23637
24308
|
/**
|
|
@@ -23662,7 +24333,8 @@ class AppEmbed extends V1Embed {
|
|
|
23662
24333
|
return getQueryParamString(params, true);
|
|
23663
24334
|
}
|
|
23664
24335
|
getEmbedParamsObject() {
|
|
23665
|
-
|
|
24336
|
+
var _a;
|
|
24337
|
+
const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, newConnectionsExperience, dataPanelV2 = true, updatedSpotterExperience, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, hideHomepageLeftNav = false, modularHomeExperience, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, isEnhancedFilterInteractivityEnabled, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig, spotterDataSources, isThisPeriodInDateFiltersEnabled, enableHomepageAnnouncement = false, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, hideAnswerEditPanel, } = this.viewConfig;
|
|
23666
24338
|
let params = {};
|
|
23667
24339
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
23668
24340
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -23698,6 +24370,9 @@ class AppEmbed extends V1Embed {
|
|
|
23698
24370
|
if (!isUndefined$1(coverAndFilterOptionInPDF)) {
|
|
23699
24371
|
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
23700
24372
|
}
|
|
24373
|
+
if (!isUndefined$1(hideAnswerEditPanel)) {
|
|
24374
|
+
params[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
|
|
24375
|
+
}
|
|
23701
24376
|
params = this.getBaseQueryParams(params);
|
|
23702
24377
|
if (!isUndefined$1(updatedSpotterChatPrompt)) {
|
|
23703
24378
|
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
@@ -23744,15 +24419,7 @@ class AppEmbed extends V1Embed {
|
|
|
23744
24419
|
if (hideNotification) {
|
|
23745
24420
|
params[Param.HideNotification] = !!hideNotification;
|
|
23746
24421
|
}
|
|
23747
|
-
|
|
23748
|
-
params[Param.fullHeight] = true;
|
|
23749
|
-
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
23750
|
-
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
23751
|
-
if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
|
|
23752
|
-
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
23753
|
-
}
|
|
23754
|
-
}
|
|
23755
|
-
}
|
|
24422
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
|
|
23756
24423
|
if (tag) {
|
|
23757
24424
|
params[Param.Tag] = tag;
|
|
23758
24425
|
}
|
|
@@ -23819,7 +24486,6 @@ class AppEmbed extends V1Embed {
|
|
|
23819
24486
|
if (isContinuousLiveboardPDFEnabled !== undefined) {
|
|
23820
24487
|
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
23821
24488
|
}
|
|
23822
|
-
this.defaultHeight = minimumHeight || this.defaultHeight;
|
|
23823
24489
|
if (enableLiveboardDataCache !== undefined) {
|
|
23824
24490
|
params[Param.EnableLiveboardDataCache] = enableLiveboardDataCache;
|
|
23825
24491
|
}
|
|
@@ -23958,52 +24624,13 @@ class AppEmbed extends V1Embed {
|
|
|
23958
24624
|
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
23959
24625
|
*/
|
|
23960
24626
|
destroy() {
|
|
24627
|
+
var _a;
|
|
23961
24628
|
super.destroy();
|
|
23962
|
-
this.
|
|
24629
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
23963
24630
|
}
|
|
23964
24631
|
postRender() {
|
|
23965
|
-
this.registerLazyLoadEvents();
|
|
23966
|
-
}
|
|
23967
|
-
registerLazyLoadEvents() {
|
|
23968
|
-
if (!this.iFrame) {
|
|
23969
|
-
return;
|
|
23970
|
-
}
|
|
23971
|
-
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
23972
|
-
this.unregisterLazyLoadEvents();
|
|
23973
|
-
// TODO: Use passive: true, install modernizr to check for passive
|
|
23974
|
-
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
23975
|
-
window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
23976
|
-
if (!this.viewConfig.enableScrollableContainerLazyLoading) {
|
|
23977
|
-
return;
|
|
23978
|
-
}
|
|
23979
|
-
this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
|
|
23980
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
23981
|
-
scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
23982
|
-
});
|
|
23983
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
23984
|
-
const resizeTargets = new Set([
|
|
23985
|
-
this.iFrame.parentElement,
|
|
23986
|
-
...getEffectiveClippingAncestors(this.iFrame),
|
|
23987
|
-
].filter(Boolean));
|
|
23988
|
-
this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
|
|
23989
|
-
resizeTargets.forEach((resizeTarget) => {
|
|
23990
|
-
this.lazyLoadResizeObserver.observe(resizeTarget);
|
|
23991
|
-
});
|
|
23992
|
-
}
|
|
23993
|
-
}
|
|
23994
|
-
}
|
|
23995
|
-
unregisterLazyLoadEvents() {
|
|
23996
24632
|
var _a;
|
|
23997
|
-
|
|
23998
|
-
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
23999
|
-
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24000
|
-
(_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
24001
|
-
this.lazyLoadResizeObserver = undefined;
|
|
24002
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24003
|
-
scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24004
|
-
});
|
|
24005
|
-
this.lazyLoadScrollContainers = [];
|
|
24006
|
-
}
|
|
24633
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
|
|
24007
24634
|
}
|
|
24008
24635
|
/**
|
|
24009
24636
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
@@ -24098,6 +24725,10 @@ const addPreviewStylesIfNotPresent = () => {
|
|
|
24098
24725
|
* @summary Liveboard & visualization embed
|
|
24099
24726
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
24100
24727
|
*/
|
|
24728
|
+
// Home unmounts the liveboard container, which is how its state gets cleared. The
|
|
24729
|
+
// settle window gives the container time to do it before we ask for the liveboard back.
|
|
24730
|
+
const HOME_ROUTE = 'home';
|
|
24731
|
+
const HOME_SETTLE_MS = 200;
|
|
24101
24732
|
/**
|
|
24102
24733
|
* Embed a ThoughtSpot Liveboard or visualization. When rendered it already
|
|
24103
24734
|
* waits for the authentication to complete, so you need not wait for
|
|
@@ -24117,59 +24748,6 @@ class LiveboardEmbed extends V1Embed {
|
|
|
24117
24748
|
constructor(domSelector, viewConfig) {
|
|
24118
24749
|
viewConfig.embedComponentType = 'LiveboardEmbed';
|
|
24119
24750
|
super(domSelector, viewConfig);
|
|
24120
|
-
this.defaultHeight = 500;
|
|
24121
|
-
this.lazyLoadScrollContainers = [];
|
|
24122
|
-
this.sendFullHeightLazyLoadData = () => {
|
|
24123
|
-
const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
24124
|
-
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
24125
|
-
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
24126
|
-
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
|
|
24127
|
-
}
|
|
24128
|
-
};
|
|
24129
|
-
/**
|
|
24130
|
-
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
24131
|
-
* It is used to send the visible coordinates data to the host application.
|
|
24132
|
-
* @param data The event payload
|
|
24133
|
-
* @param responder The responder function
|
|
24134
|
-
*/
|
|
24135
|
-
this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
|
|
24136
|
-
logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
24137
|
-
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
24138
|
-
responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
24139
|
-
};
|
|
24140
|
-
/**
|
|
24141
|
-
* Set the iframe height as per the computed height received
|
|
24142
|
-
* from the ThoughtSpot app.
|
|
24143
|
-
* @param data The event payload
|
|
24144
|
-
*/
|
|
24145
|
-
this.updateIFrameHeight = (data) => {
|
|
24146
|
-
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
24147
|
-
this.sendFullHeightLazyLoadData();
|
|
24148
|
-
};
|
|
24149
|
-
this.embedIframeCenter = (data, responder) => {
|
|
24150
|
-
const obj = this.getIframeCenter();
|
|
24151
|
-
responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
|
|
24152
|
-
};
|
|
24153
|
-
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
24154
|
-
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
24155
|
-
const liveboardRelatedRoutes = [
|
|
24156
|
-
'/pinboard/',
|
|
24157
|
-
'/insights/pinboard/',
|
|
24158
|
-
'/schedules/',
|
|
24159
|
-
'/embed/viz/',
|
|
24160
|
-
'/embed/insights/viz/',
|
|
24161
|
-
'/liveboard/',
|
|
24162
|
-
'/insights/liveboard/',
|
|
24163
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
24164
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
24165
|
-
];
|
|
24166
|
-
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
24167
|
-
// Ignore the height reset of the frame, if the navigation is
|
|
24168
|
-
// only within the liveboard page.
|
|
24169
|
-
return;
|
|
24170
|
-
}
|
|
24171
|
-
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
24172
|
-
};
|
|
24173
24751
|
/**
|
|
24174
24752
|
* @hidden
|
|
24175
24753
|
* Internal state to track the current liveboard id.
|
|
@@ -24183,22 +24761,19 @@ class LiveboardEmbed extends V1Embed {
|
|
|
24183
24761
|
};
|
|
24184
24762
|
if (this.viewConfig.fullHeight === true) {
|
|
24185
24763
|
if (this.viewConfig.vizId) {
|
|
24186
|
-
logger$3.warn('Full height is currently only supported for Liveboard embeds.'
|
|
24187
|
-
'Using full height with vizId might lead to unexpected behavior.');
|
|
24188
|
-
}
|
|
24189
|
-
if (this.viewConfig.lazyLoadingForFullHeight === undefined) {
|
|
24190
|
-
this.viewConfig.lazyLoadingForFullHeight = true;
|
|
24191
|
-
}
|
|
24192
|
-
if (this.viewConfig.enableScrollableContainerLazyLoading === undefined) {
|
|
24193
|
-
this.viewConfig.enableScrollableContainerLazyLoading = true;
|
|
24194
|
-
}
|
|
24195
|
-
if (this.viewConfig.lazyLoadingMargin === undefined) {
|
|
24196
|
-
this.viewConfig.lazyLoadingMargin = DEFAULT_LAZY_LOADING_MARGIN;
|
|
24764
|
+
logger$3.warn('Full height is currently only supported for Liveboard embeds.'
|
|
24765
|
+
+ 'Using full height with vizId might lead to unexpected behavior.');
|
|
24197
24766
|
}
|
|
24198
|
-
this.
|
|
24199
|
-
|
|
24200
|
-
|
|
24201
|
-
|
|
24767
|
+
this.fullHeightController = new FullHeightController(this.viewConfig, {
|
|
24768
|
+
getIframe: () => this.iFrame,
|
|
24769
|
+
setFrameHeight: (height) => this.setIFrameHeight(height),
|
|
24770
|
+
on: (eventType, callback) => {
|
|
24771
|
+
this.on(eventType, callback);
|
|
24772
|
+
},
|
|
24773
|
+
trigger: (hostEvent, data) => {
|
|
24774
|
+
this.trigger(hostEvent, data);
|
|
24775
|
+
},
|
|
24776
|
+
});
|
|
24202
24777
|
}
|
|
24203
24778
|
}
|
|
24204
24779
|
async getAppInitData() {
|
|
@@ -24216,21 +24791,13 @@ class LiveboardEmbed extends V1Embed {
|
|
|
24216
24791
|
return queryParams;
|
|
24217
24792
|
}
|
|
24218
24793
|
getEmbedParamsObject() {
|
|
24794
|
+
var _a;
|
|
24219
24795
|
let params = {};
|
|
24220
24796
|
params = this.getBaseQueryParams(params);
|
|
24221
|
-
const { enableVizTransformations,
|
|
24797
|
+
const { enableVizTransformations, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, isEnhancedFilterInteractivityEnabled, enableAskSage, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, dataPanelV2 = true, updatedSpotterExperience, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, enableStopAnswerGenerationEmbed, spotterChatConfig, isThisPeriodInDateFiltersEnabled, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, } = this.viewConfig;
|
|
24222
24798
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
24223
24799
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
24224
|
-
|
|
24225
|
-
params[Param.fullHeight] = true;
|
|
24226
|
-
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
24227
|
-
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
24228
|
-
if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
|
|
24229
|
-
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
24230
|
-
}
|
|
24231
|
-
}
|
|
24232
|
-
}
|
|
24233
|
-
this.defaultHeight = minimumHeight || defaultHeight || this.defaultHeight;
|
|
24800
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
|
|
24234
24801
|
if (enableVizTransformations !== undefined) {
|
|
24235
24802
|
params[Param.EnableVizTransformations] = enableVizTransformations.toString();
|
|
24236
24803
|
}
|
|
@@ -24457,19 +25024,45 @@ class LiveboardEmbed extends V1Embed {
|
|
|
24457
25024
|
}
|
|
24458
25025
|
beforePrerenderVisible() {
|
|
24459
25026
|
super.beforePrerenderVisible();
|
|
24460
|
-
|
|
24461
|
-
|
|
24462
|
-
|
|
24463
|
-
|
|
24464
|
-
|
|
24465
|
-
|
|
24466
|
-
|
|
24467
|
-
|
|
24468
|
-
|
|
24469
|
-
|
|
25027
|
+
// Captured before showPreRender() hands the wrapper over to this instance.
|
|
25028
|
+
// Itself means a hide/show, not a hand-over, so there is nothing stale to clear.
|
|
25029
|
+
const previous = this.getPreRenderObj();
|
|
25030
|
+
const showing = previous === this ? undefined : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
|
|
25031
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
25032
|
+
// Without this the params callback suspends on its await and Navigate
|
|
25033
|
+
// goes out first, so the container loads with the previous config's filters.
|
|
25034
|
+
await this.preRenderParamsApplied;
|
|
25035
|
+
if (this.isShowingLiveboardRoute(showing)) {
|
|
25036
|
+
// Navigate to the route we are already on is a no-op, so the liveboard
|
|
25037
|
+
// keeps its state. Home unmounts the container, which clears it.
|
|
25038
|
+
this.trigger(HostEvent.Navigate, HOME_ROUTE)
|
|
25039
|
+
.catch((error) => logger$3.warn('Could not route via home', error));
|
|
25040
|
+
// Not awaited above: the container never acks Navigate, so that promise
|
|
25041
|
+
// only settles on the 30s trigger timeout.
|
|
25042
|
+
await new Promise((resolve) => {
|
|
25043
|
+
setTimeout(resolve, HOME_SETTLE_MS);
|
|
25044
|
+
});
|
|
24470
25045
|
}
|
|
25046
|
+
this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId, this.viewConfig.personalizedViewId);
|
|
25047
|
+
this.currentLiveboardState = {
|
|
25048
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
25049
|
+
vizId: this.viewConfig.vizId,
|
|
25050
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
25051
|
+
personalizedViewId: this.viewConfig.personalizedViewId,
|
|
25052
|
+
};
|
|
24471
25053
|
});
|
|
24472
25054
|
}
|
|
25055
|
+
// The whole route, not just the liveboard id: the path is built from the viz, tab
|
|
25056
|
+
// and view too, so a same-liveboard show onto another tab is a real navigation.
|
|
25057
|
+
isShowingLiveboardRoute(showing) {
|
|
25058
|
+
if (!(showing === null || showing === void 0 ? void 0 : showing.liveboardId))
|
|
25059
|
+
return false;
|
|
25060
|
+
const { liveboardId, vizId, activeTabId, personalizedViewId, } = this.viewConfig;
|
|
25061
|
+
return showing.liveboardId === liveboardId
|
|
25062
|
+
&& showing.vizId === vizId
|
|
25063
|
+
&& showing.activeTabId === activeTabId
|
|
25064
|
+
&& showing.personalizedViewId === personalizedViewId;
|
|
25065
|
+
}
|
|
24473
25066
|
async handleRenderForPrerender() {
|
|
24474
25067
|
if (isUndefined$1(this.viewConfig.liveboardId)) {
|
|
24475
25068
|
return this.prerenderGeneric();
|
|
@@ -24478,11 +25071,16 @@ class LiveboardEmbed extends V1Embed {
|
|
|
24478
25071
|
}
|
|
24479
25072
|
/**
|
|
24480
25073
|
* Triggers an event to the embedded app
|
|
25074
|
+
* Payload typing follows {@link TsEmbed.trigger}: unknown fields fail to compile
|
|
25075
|
+
* from SDK 1.52.0; strict contract checks land in SDK 1.54.0.
|
|
24481
25076
|
* @param {HostEvent} messageType The event type
|
|
24482
|
-
* @param {
|
|
25077
|
+
* @param {TriggerData} data The payload, typed against the event's contract
|
|
24483
25078
|
* @returns A promise that resolves with the response from the embedded app
|
|
24484
25079
|
*/
|
|
24485
|
-
trigger(messageType,
|
|
25080
|
+
trigger(messageType,
|
|
25081
|
+
// Mirror TsEmbed.trigger: contract shape is the contextual type and
|
|
25082
|
+
// unknown fields on object literals are flagged. Strict in SDK 1.54.0.
|
|
25083
|
+
data = {}, context) {
|
|
24486
25084
|
const dataWithVizId = data;
|
|
24487
25085
|
if (messageType === HostEvent.SetActiveTab) {
|
|
24488
25086
|
this.setActiveTab(data);
|
|
@@ -24498,52 +25096,13 @@ class LiveboardEmbed extends V1Embed {
|
|
|
24498
25096
|
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
24499
25097
|
*/
|
|
24500
25098
|
destroy() {
|
|
25099
|
+
var _a;
|
|
24501
25100
|
super.destroy();
|
|
24502
|
-
this.
|
|
25101
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
24503
25102
|
}
|
|
24504
25103
|
postRender() {
|
|
24505
|
-
this.registerLazyLoadEvents();
|
|
24506
|
-
}
|
|
24507
|
-
registerLazyLoadEvents() {
|
|
24508
|
-
if (!this.iFrame) {
|
|
24509
|
-
return;
|
|
24510
|
-
}
|
|
24511
|
-
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
24512
|
-
this.unregisterLazyLoadEvents();
|
|
24513
|
-
// TODO: Use passive: true, install modernizr to check for passive
|
|
24514
|
-
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24515
|
-
window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24516
|
-
if (!this.viewConfig.enableScrollableContainerLazyLoading) {
|
|
24517
|
-
return;
|
|
24518
|
-
}
|
|
24519
|
-
this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
|
|
24520
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24521
|
-
scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24522
|
-
});
|
|
24523
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
24524
|
-
const resizeTargets = new Set([
|
|
24525
|
-
this.iFrame.parentElement,
|
|
24526
|
-
...getEffectiveClippingAncestors(this.iFrame),
|
|
24527
|
-
].filter(Boolean));
|
|
24528
|
-
this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
|
|
24529
|
-
resizeTargets.forEach((resizeTarget) => {
|
|
24530
|
-
this.lazyLoadResizeObserver.observe(resizeTarget);
|
|
24531
|
-
});
|
|
24532
|
-
}
|
|
24533
|
-
}
|
|
24534
|
-
}
|
|
24535
|
-
unregisterLazyLoadEvents() {
|
|
24536
25104
|
var _a;
|
|
24537
|
-
|
|
24538
|
-
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24539
|
-
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24540
|
-
(_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
24541
|
-
this.lazyLoadResizeObserver = undefined;
|
|
24542
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24543
|
-
scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24544
|
-
});
|
|
24545
|
-
this.lazyLoadScrollContainers = [];
|
|
24546
|
-
}
|
|
25105
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
|
|
24547
25106
|
}
|
|
24548
25107
|
/**
|
|
24549
25108
|
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
@@ -24688,7 +25247,7 @@ class SearchEmbed extends TsEmbed {
|
|
|
24688
25247
|
}
|
|
24689
25248
|
getEmbedParamsObject() {
|
|
24690
25249
|
var _a;
|
|
24691
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, isThisPeriodInDateFiltersEnabled, newChartsLibrary, } = this.viewConfig;
|
|
25250
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, isThisPeriodInDateFiltersEnabled, newChartsLibrary, hideAnswerEditPanel, } = this.viewConfig;
|
|
24692
25251
|
const queryParams = this.getBaseQueryParams();
|
|
24693
25252
|
queryParams[Param.HideActions] = [
|
|
24694
25253
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -24711,6 +25270,9 @@ class SearchEmbed extends TsEmbed {
|
|
|
24711
25270
|
if (enableSearchAssist) {
|
|
24712
25271
|
queryParams[Param.EnableSearchAssist] = true;
|
|
24713
25272
|
}
|
|
25273
|
+
if (hideAnswerEditPanel !== undefined) {
|
|
25274
|
+
queryParams[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
|
|
25275
|
+
}
|
|
24714
25276
|
if (hideResults) {
|
|
24715
25277
|
queryParams[Param.HideResult] = true;
|
|
24716
25278
|
}
|