@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.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 (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -864,6 +864,9 @@
|
|
|
864
864
|
EmbedEvent["Download"] = "download";
|
|
865
865
|
/**
|
|
866
866
|
* Emitted when the download action is triggered on an Answer.
|
|
867
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
868
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
869
|
+
* accepts the union now; per-context enforced next release.
|
|
867
870
|
* Use start:true to subscribe to when download is initiated, or end:true to
|
|
868
871
|
* subscribe to when download is completed. Default is end:true.
|
|
869
872
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
|
|
@@ -880,6 +883,9 @@
|
|
|
880
883
|
EmbedEvent["DownloadAsPng"] = "downloadAsPng";
|
|
881
884
|
/**
|
|
882
885
|
* Emitted when the Download as PDF action is triggered on an Answer
|
|
886
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer; plus
|
|
887
|
+
* liveboardId on Liveboard), {@link RequiredVizRequest} (Spotter). trigger()
|
|
888
|
+
* accepts the union now; per-context enforced next release.
|
|
883
889
|
* Use start:true to subscribe to when download as PDF is initiated, or end:true to
|
|
884
890
|
* subscribe to when download as PDF is completed. Default is end:true.
|
|
885
891
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -896,6 +902,9 @@
|
|
|
896
902
|
EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
897
903
|
/**
|
|
898
904
|
* Emitted when the Download as CSV action is triggered on an Answer.
|
|
905
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
906
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
907
|
+
* accepts the union now; per-context enforced next release.
|
|
899
908
|
* Use start:true to subscribe to when download as CSV is initiated, or end:true to
|
|
900
909
|
* subscribe to when download as CSV is completed. Default is end:true.
|
|
901
910
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -912,6 +921,9 @@
|
|
|
912
921
|
EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
|
|
913
922
|
/**
|
|
914
923
|
* Emitted when the Download as XLSX action is triggered on an Answer.
|
|
924
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
925
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
926
|
+
* accepts the union now; per-context enforced next release.
|
|
915
927
|
* Use start:true to subscribe to when download as XLSX is initiated, or end:true to
|
|
916
928
|
* subscribe to when download as XLSX is completed. Default is end:true.
|
|
917
929
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -1190,6 +1202,9 @@
|
|
|
1190
1202
|
EmbedEvent["Schedule"] = "subscription";
|
|
1191
1203
|
/**
|
|
1192
1204
|
* Emitted when a user clicks **Edit** on a Liveboard or visualization
|
|
1205
|
+
* Payload varies by context: {@link VizScopedRequest} (Liveboard),
|
|
1206
|
+
* {@link RequiredVizRequest} (Spotter, vizId required). trigger() accepts the
|
|
1207
|
+
* union now; per-context enforced next release.
|
|
1193
1208
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1194
1209
|
* @example
|
|
1195
1210
|
* ```js
|
|
@@ -2269,6 +2284,7 @@
|
|
|
2269
2284
|
* the search query string.
|
|
2270
2285
|
* Supported in `AppEmbed` and `SearchEmbed` deployments.
|
|
2271
2286
|
* Includes the following properties:
|
|
2287
|
+
* Payload: {@link SearchRequest}.
|
|
2272
2288
|
* @param - Includes the following keys:
|
|
2273
2289
|
* - `searchQuery`: Query string with search tokens.
|
|
2274
2290
|
* - `dataSources`: Data source GUID to search on.
|
|
@@ -2296,6 +2312,9 @@
|
|
|
2296
2312
|
HostEvent["Search"] = "search";
|
|
2297
2313
|
/**
|
|
2298
2314
|
* Triggers a drill on certain points of the specified column
|
|
2315
|
+
* Payload: {@link DrillDownRequest}; in Liveboard context vizId is required
|
|
2316
|
+
* ({@link RequiredVizRequest}). trigger() accepts the union now; per-context
|
|
2317
|
+
* enforced next release.
|
|
2299
2318
|
* Includes the following properties:
|
|
2300
2319
|
* @param - Includes the following keys:
|
|
2301
2320
|
* - `points`: An object containing `selectedPoints` and/or `clickedPoint`
|
|
@@ -2375,6 +2394,8 @@
|
|
|
2375
2394
|
HostEvent["Reload"] = "reload";
|
|
2376
2395
|
/**
|
|
2377
2396
|
* Get iframe URL for the current embed view.
|
|
2397
|
+
* Payload: none.
|
|
2398
|
+
* Response: {@link GetIframeUrlResponse}.
|
|
2378
2399
|
* @example
|
|
2379
2400
|
* ```js
|
|
2380
2401
|
* const url = embed.trigger(HostEvent.GetIframeUrl);
|
|
@@ -2393,6 +2414,7 @@
|
|
|
2393
2414
|
HostEvent["GetIframeUrl"] = "GetIframeUrl";
|
|
2394
2415
|
/**
|
|
2395
2416
|
* Display specific visualizations on a Liveboard.
|
|
2417
|
+
* Payload: `string[]`.
|
|
2396
2418
|
* @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
|
|
2397
2419
|
* in this parameter will be hidden.
|
|
2398
2420
|
* @example
|
|
@@ -2415,6 +2437,7 @@
|
|
|
2415
2437
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
2416
2438
|
/**
|
|
2417
2439
|
* Set a Liveboard tab as an active tab.
|
|
2440
|
+
* Payload: {@link SetActiveTabRequest}.
|
|
2418
2441
|
* @param - tabId - string of id of Tab to show
|
|
2419
2442
|
* @example
|
|
2420
2443
|
* ```js
|
|
@@ -2442,6 +2465,7 @@
|
|
|
2442
2465
|
* and `AppEmbed` only. In full application embedding, this event updates
|
|
2443
2466
|
* the runtime filters applied on the Liveboard and saved Answer objects.
|
|
2444
2467
|
*
|
|
2468
|
+
* Payload: {@link RuntimeFilter}[].
|
|
2445
2469
|
* @param - Array of {@link RuntimeFilter} objects. Each item includes:
|
|
2446
2470
|
* - `columnName`: Name of the column to filter on.
|
|
2447
2471
|
* - `operator`: {@link RuntimeFilterOp} to apply. For more information, see
|
|
@@ -2483,6 +2507,7 @@
|
|
|
2483
2507
|
* Accepts either a plain value or an object with `path`
|
|
2484
2508
|
* and an optional `replace` flag.
|
|
2485
2509
|
*
|
|
2510
|
+
* Payload: `string` | `number` | {@link NavigateRequest}.
|
|
2486
2511
|
* @param data - A string path, a numeric history delta, or an object
|
|
2487
2512
|
* `{ path: string | number, replace?: boolean }`.
|
|
2488
2513
|
* - `path` — the route to navigate to, or a history delta such as `1`
|
|
@@ -2510,6 +2535,9 @@
|
|
|
2510
2535
|
/**
|
|
2511
2536
|
* Open the filter panel for a particular column.
|
|
2512
2537
|
* Works with Search and Liveboard embed.
|
|
2538
|
+
* Payload: {@link OpenFilterRequest} (the cross-context superset). The
|
|
2539
|
+
* accepted fields vary by context: {@link OpenFilterLiveboardRequest},
|
|
2540
|
+
* {@link OpenFilterSpotterRequest}, {@link OpenFilterSearchRequest}.
|
|
2513
2541
|
* @param - { columnId: string,
|
|
2514
2542
|
* name: string,
|
|
2515
2543
|
* type: ATTRIBUTE/MEASURE,
|
|
@@ -2592,6 +2620,7 @@
|
|
|
2592
2620
|
/**
|
|
2593
2621
|
* Open the parameter panel for a particular parameter on a Liveboard.
|
|
2594
2622
|
* Mirrors {@link HostEvent.OpenFilter} for parameters.
|
|
2623
|
+
* Payload: {@link OpenParameterRequest}.
|
|
2595
2624
|
* @param - Includes the following keys:
|
|
2596
2625
|
* - `parameter`: An object identifying the parameter to open, for
|
|
2597
2626
|
* example, `{ parameterId: '<parameter-GUID>' }`.
|
|
@@ -2623,6 +2652,7 @@
|
|
|
2623
2652
|
HostEvent["OpenParameter"] = "openParameter";
|
|
2624
2653
|
/**
|
|
2625
2654
|
* Add columns to the current search query.
|
|
2655
|
+
* Payload: `{ columnIds: string[] }`.
|
|
2626
2656
|
* @param - { columnIds: string[] }
|
|
2627
2657
|
* @example
|
|
2628
2658
|
* ```js
|
|
@@ -2641,6 +2671,7 @@
|
|
|
2641
2671
|
HostEvent["AddColumns"] = "addColumns";
|
|
2642
2672
|
/**
|
|
2643
2673
|
* Remove a column from the current search query.
|
|
2674
|
+
* Payload: `{ columnId: string }`.
|
|
2644
2675
|
* @param - { columnId: string }
|
|
2645
2676
|
* @example
|
|
2646
2677
|
* ```js
|
|
@@ -2665,6 +2696,8 @@
|
|
|
2665
2696
|
* sorting, toggling of legends, and data drill down.
|
|
2666
2697
|
* For more information, see
|
|
2667
2698
|
* link:https://developers.thoughtspot.com/docs/fetch-data-and-report-apis#transient-lb-content[Liveboard data with unsaved changes].
|
|
2699
|
+
* Payload: none.
|
|
2700
|
+
* Response: {@link GetExportRequestForCurrentPinboardResponse}.
|
|
2668
2701
|
* @example
|
|
2669
2702
|
* ```js
|
|
2670
2703
|
* liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard).then(
|
|
@@ -2686,6 +2719,8 @@
|
|
|
2686
2719
|
* requiring additional user input via the *Pin to Liveboard* modal, define
|
|
2687
2720
|
* the following parameters:
|
|
2688
2721
|
*
|
|
2722
|
+
* Payload: {@link PinAnswerToLiveboardRequest}.
|
|
2723
|
+
* Response: {@link PinAnswerToLiveboardResponse}.
|
|
2689
2724
|
* @param - Includes the following keys:
|
|
2690
2725
|
* - `vizId`: GUID of the saved Answer or Spotter visualization ID to pin to a
|
|
2691
2726
|
* Liveboard.
|
|
@@ -2800,6 +2835,7 @@
|
|
|
2800
2835
|
HostEvent["LiveboardInfo"] = "pinboardInfo";
|
|
2801
2836
|
/**
|
|
2802
2837
|
* Trigger the **Schedule** action on an embedded Liveboard.
|
|
2838
|
+
* Payload: {@link VizScopedRequest}.
|
|
2803
2839
|
* @example
|
|
2804
2840
|
* ```js
|
|
2805
2841
|
* liveboardEmbed.trigger(HostEvent.Schedule)
|
|
@@ -2815,6 +2851,7 @@
|
|
|
2815
2851
|
HostEvent["Schedule"] = "subscription";
|
|
2816
2852
|
/**
|
|
2817
2853
|
* Trigger the **Manage schedule** action on an embedded Liveboard
|
|
2854
|
+
* Payload: {@link VizScopedRequest}.
|
|
2818
2855
|
* @example
|
|
2819
2856
|
* ```js
|
|
2820
2857
|
* liveboardEmbed.trigger(HostEvent.SchedulesList)
|
|
@@ -2831,6 +2868,7 @@
|
|
|
2831
2868
|
/**
|
|
2832
2869
|
* Trigger the **Export TML** action on an embedded Liveboard or
|
|
2833
2870
|
* Answer.
|
|
2871
|
+
* Payload: {@link VizScopedRequest}.
|
|
2834
2872
|
* @example
|
|
2835
2873
|
* ```js
|
|
2836
2874
|
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
@@ -2853,6 +2891,7 @@
|
|
|
2853
2891
|
/**
|
|
2854
2892
|
* Trigger the **Edit TML** action on an embedded Liveboard or
|
|
2855
2893
|
* saved Answers in the full application embedding.
|
|
2894
|
+
* Payload: {@link VizScopedRequest}.
|
|
2856
2895
|
* @example
|
|
2857
2896
|
* ```js
|
|
2858
2897
|
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
@@ -2874,6 +2913,7 @@
|
|
|
2874
2913
|
HostEvent["EditTML"] = "editTSL";
|
|
2875
2914
|
/**
|
|
2876
2915
|
* Trigger the **Update TML** action on an embedded Liveboard.
|
|
2916
|
+
* Payload: {@link VizScopedRequest}.
|
|
2877
2917
|
* @example
|
|
2878
2918
|
* ```js
|
|
2879
2919
|
* liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
@@ -2891,6 +2931,7 @@
|
|
|
2891
2931
|
* Trigger the **Download PDF** action on an embedded Liveboard,
|
|
2892
2932
|
* visualization or Answer.
|
|
2893
2933
|
*
|
|
2934
|
+
* Payload: {@link VizScopedRequest} plus optional `liveboardId`.
|
|
2894
2935
|
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2895
2936
|
*
|
|
2896
2937
|
* **NOTE**: The **Download** > **PDF** action is available on
|
|
@@ -2941,6 +2982,7 @@
|
|
|
2941
2982
|
/**
|
|
2942
2983
|
* Trigger the **AI Highlights** action on an embedded Liveboard
|
|
2943
2984
|
*
|
|
2985
|
+
* Payload: none.
|
|
2944
2986
|
* @example
|
|
2945
2987
|
* ```js
|
|
2946
2988
|
* liveboardEmbed.trigger(HostEvent.AIHighlights)
|
|
@@ -2995,6 +3037,9 @@
|
|
|
2995
3037
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
2996
3038
|
/**
|
|
2997
3039
|
* Trigger the **Delete** action for a Liveboard.
|
|
3040
|
+
* Payload varies by context: {@link RequiredVizRequest} (Liveboard, vizId
|
|
3041
|
+
* required), {@link VizScopedRequest} (Search). trigger() accepts the union
|
|
3042
|
+
* now; per-context enforced next release.
|
|
2998
3043
|
* @example
|
|
2999
3044
|
* ```js
|
|
3000
3045
|
* appEmbed.trigger(HostEvent.Remove)
|
|
@@ -3009,6 +3054,7 @@
|
|
|
3009
3054
|
HostEvent["Remove"] = "delete";
|
|
3010
3055
|
/**
|
|
3011
3056
|
* Trigger the **Explore** action on a visualization.
|
|
3057
|
+
* Payload: {@link RequiredVizRequest}.
|
|
3012
3058
|
* @param - an object with `vizId` as a key
|
|
3013
3059
|
* @example
|
|
3014
3060
|
* ```js
|
|
@@ -3028,6 +3074,7 @@
|
|
|
3028
3074
|
/**
|
|
3029
3075
|
* Trigger the **Create alert** action on a KPI chart
|
|
3030
3076
|
* in a Liveboard or saved Answer.
|
|
3077
|
+
* Payload: {@link VizScopedRequest}.
|
|
3031
3078
|
* @param - an object with `vizId` as a key
|
|
3032
3079
|
* @example
|
|
3033
3080
|
* ```js
|
|
@@ -3059,6 +3106,7 @@
|
|
|
3059
3106
|
/**
|
|
3060
3107
|
* Trigger the **Manage alerts** action on a KPI chart
|
|
3061
3108
|
* in a visualization or saved Answer.
|
|
3109
|
+
* Payload: {@link VizScopedRequest}.
|
|
3062
3110
|
* @param - an object with `vizId` as a key
|
|
3063
3111
|
* @example
|
|
3064
3112
|
* ```js
|
|
@@ -3096,6 +3144,7 @@
|
|
|
3096
3144
|
* on a Liveboard.
|
|
3097
3145
|
*
|
|
3098
3146
|
* This event is not supported in visualization embed and search embed.
|
|
3147
|
+
* Payload: {@link VizScopedRequest}.
|
|
3099
3148
|
* @param - Object parameter. Includes the following keys:
|
|
3100
3149
|
* - `vizId`: To trigger the action for a specific visualization in Liveboard embed,
|
|
3101
3150
|
* pass in `vizId` as a key. In Spotter embed, `vizId` refers to the Answer ID and
|
|
@@ -3138,6 +3187,7 @@
|
|
|
3138
3187
|
HostEvent["Edit"] = "edit";
|
|
3139
3188
|
/**
|
|
3140
3189
|
* Trigger the **Copy link** action on a Liveboard or visualization
|
|
3190
|
+
* Payload: {@link VizScopedRequest}.
|
|
3141
3191
|
* @param - object - to trigger the action for a
|
|
3142
3192
|
* specific visualization in Liveboard embed, pass in `vizId` as a key
|
|
3143
3193
|
* @example
|
|
@@ -3183,6 +3233,7 @@
|
|
|
3183
3233
|
HostEvent["CopyLink"] = "embedDocument";
|
|
3184
3234
|
/**
|
|
3185
3235
|
* Trigger the **Present** action on a Liveboard or visualization
|
|
3236
|
+
* Payload: {@link VizScopedRequest}.
|
|
3186
3237
|
* @param - object - to trigger the action for a specific visualization
|
|
3187
3238
|
* in Liveboard embed, pass in `vizId` as a key
|
|
3188
3239
|
* @example
|
|
@@ -3228,6 +3279,8 @@
|
|
|
3228
3279
|
HostEvent["Present"] = "present";
|
|
3229
3280
|
/**
|
|
3230
3281
|
* Get TML for the current search.
|
|
3282
|
+
* Payload: {@link GetTMLRequest}.
|
|
3283
|
+
* Response: `Record<string, any>`.
|
|
3231
3284
|
* @example
|
|
3232
3285
|
* ```js
|
|
3233
3286
|
* searchEmbed.trigger(HostEvent.GetTML).then((tml) => {
|
|
@@ -3277,6 +3330,7 @@
|
|
|
3277
3330
|
* Trigger the **Show underlying data** action on a
|
|
3278
3331
|
* chart or table.
|
|
3279
3332
|
*
|
|
3333
|
+
* Payload: {@link VizScopedRequest}.
|
|
3280
3334
|
* @param - an object with vizId as a key
|
|
3281
3335
|
* @example
|
|
3282
3336
|
* ```js
|
|
@@ -3310,6 +3364,7 @@
|
|
|
3310
3364
|
* Trigger the **Delete** action for a visualization
|
|
3311
3365
|
* in an embedded Liveboard, or a chart or table
|
|
3312
3366
|
* generated from Search.
|
|
3367
|
+
* Payload: {@link VizScopedRequest}.
|
|
3313
3368
|
* @param - Liveboard embed takes an object with `vizId` as a key.
|
|
3314
3369
|
* Can be left empty if embedding Search or visualization.
|
|
3315
3370
|
* @example
|
|
@@ -3338,6 +3393,7 @@
|
|
|
3338
3393
|
/**
|
|
3339
3394
|
* Trigger the **SpotIQ analyze** action on a
|
|
3340
3395
|
* chart or table.
|
|
3396
|
+
* Payload: {@link VizScopedRequest}.
|
|
3341
3397
|
* @param - Liveboard embed takes `vizId` as a
|
|
3342
3398
|
* key. Can be left undefined when embedding Search or
|
|
3343
3399
|
* visualization.
|
|
@@ -3400,6 +3456,7 @@
|
|
|
3400
3456
|
/**
|
|
3401
3457
|
* Trigger the **Download** > **PNG** action on
|
|
3402
3458
|
* charts in the embedded view.
|
|
3459
|
+
* Payload: {@link VizScopedRequest}.
|
|
3403
3460
|
* @example
|
|
3404
3461
|
* ```js
|
|
3405
3462
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPng,
|
|
@@ -3431,6 +3488,7 @@
|
|
|
3431
3488
|
/**
|
|
3432
3489
|
* Trigger the **Download** > **CSV** action on tables in
|
|
3433
3490
|
* the embedded view.
|
|
3491
|
+
* Payload: {@link VizScopedRequest}.
|
|
3434
3492
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
3435
3493
|
* @example
|
|
3436
3494
|
* ```js
|
|
@@ -3470,6 +3528,7 @@
|
|
|
3470
3528
|
/**
|
|
3471
3529
|
* Trigger the **Download** > **XLSX** action on tables
|
|
3472
3530
|
* in the embedded view.
|
|
3531
|
+
* Payload: {@link VizScopedRequest}.
|
|
3473
3532
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
3474
3533
|
* @example
|
|
3475
3534
|
* ```js
|
|
@@ -3509,6 +3568,7 @@
|
|
|
3509
3568
|
/**
|
|
3510
3569
|
* Trigger the **Share** action on an embedded
|
|
3511
3570
|
* Liveboard or Answer.
|
|
3571
|
+
* Payload: {@link VizScopedRequest}.
|
|
3512
3572
|
* @example
|
|
3513
3573
|
* ```js
|
|
3514
3574
|
* liveboardEmbed.trigger(HostEvent.Share)
|
|
@@ -3535,6 +3595,7 @@
|
|
|
3535
3595
|
* Trigger the **Save** action on a Liveboard, Answer, or Spotter.
|
|
3536
3596
|
* Saves the changes.
|
|
3537
3597
|
*
|
|
3598
|
+
* Payload: {@link VizScopedRequest}.
|
|
3538
3599
|
* @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
|
|
3539
3600
|
* It is required and can be retrieved from the data embed event.
|
|
3540
3601
|
*
|
|
@@ -3586,6 +3647,7 @@
|
|
|
3586
3647
|
/**
|
|
3587
3648
|
* Trigger the **Sync to Sheets** action on an embedded visualization or Answer
|
|
3588
3649
|
* Sends data from an Answer or Liveboard visualization to a Google sheet.
|
|
3650
|
+
* Payload: {@link VizScopedRequest}.
|
|
3589
3651
|
* @param - an object with `vizId` as a key
|
|
3590
3652
|
* @example
|
|
3591
3653
|
* ```js
|
|
@@ -3616,6 +3678,7 @@
|
|
|
3616
3678
|
* Trigger the **Sync to Other Apps** action on an embedded visualization or Answer
|
|
3617
3679
|
* Sends data from an Answer or Liveboard visualization to third-party apps such
|
|
3618
3680
|
* as Slack, Salesforce, Microsoft Teams, ServiceNow and so on.
|
|
3681
|
+
* Payload: {@link VizScopedRequest}.
|
|
3619
3682
|
* @param - an object with vizId as a key
|
|
3620
3683
|
* @example
|
|
3621
3684
|
* ```js
|
|
@@ -3646,6 +3709,7 @@
|
|
|
3646
3709
|
* Trigger the **Manage pipelines** action on an embedded
|
|
3647
3710
|
* visualization or Answer.
|
|
3648
3711
|
* Allows users to manage ThoughtSpot Sync pipelines.
|
|
3712
|
+
* Payload: {@link VizScopedRequest}.
|
|
3649
3713
|
* @param - an object with `vizId` as a key
|
|
3650
3714
|
* @example
|
|
3651
3715
|
* ```js
|
|
@@ -3674,6 +3738,7 @@
|
|
|
3674
3738
|
HostEvent["ManagePipelines"] = "manage-pipeline";
|
|
3675
3739
|
/**
|
|
3676
3740
|
* Reset search operation on the Search or Answer page.
|
|
3741
|
+
* Payload: none.
|
|
3677
3742
|
* @example
|
|
3678
3743
|
* ```js
|
|
3679
3744
|
* searchEmbed.trigger(HostEvent.ResetSearch)
|
|
@@ -3701,6 +3766,8 @@
|
|
|
3701
3766
|
* whole Liveboard.
|
|
3702
3767
|
* The `applicability` attribute is available from SDK: 1.53.0 |
|
|
3703
3768
|
* ThoughtSpot: 26.10.0.cl.
|
|
3769
|
+
* Payload: {@link GetFiltersRequest}.
|
|
3770
|
+
* Response: {@link GetFiltersResponse}.
|
|
3704
3771
|
* @example
|
|
3705
3772
|
* ```js
|
|
3706
3773
|
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
|
|
@@ -3720,6 +3787,7 @@
|
|
|
3720
3787
|
HostEvent["GetFilters"] = "getFilters";
|
|
3721
3788
|
/**
|
|
3722
3789
|
* Update one or several filters applied on a Liveboard.
|
|
3790
|
+
* Payload: {@link UpdateFiltersRequest}.
|
|
3723
3791
|
* @param - Includes the following keys:
|
|
3724
3792
|
* - `filter`: A single filter object containing column name, filter operator, and
|
|
3725
3793
|
* values.
|
|
@@ -3848,6 +3916,8 @@
|
|
|
3848
3916
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
3849
3917
|
/**
|
|
3850
3918
|
* Get tab details for the current Liveboard.
|
|
3919
|
+
* Payload: none.
|
|
3920
|
+
* Response: {@link GetTabsResponse}.
|
|
3851
3921
|
* @example
|
|
3852
3922
|
* ```js
|
|
3853
3923
|
* liveboardEmbed.trigger(HostEvent.GetTabs).then((tabDetails) => {
|
|
@@ -3873,6 +3943,8 @@
|
|
|
3873
3943
|
/**
|
|
3874
3944
|
* Get group details for the current Liveboard.
|
|
3875
3945
|
* Mirrors {@link HostEvent.GetTabs} for filter/parameter groups.
|
|
3946
|
+
* Payload: none.
|
|
3947
|
+
* Response: {@link GetGroupsResponse}.
|
|
3876
3948
|
* @example
|
|
3877
3949
|
* ```js
|
|
3878
3950
|
* liveboardEmbed.trigger(HostEvent.GetGroups).then((groupDetails) => {
|
|
@@ -3897,6 +3969,7 @@
|
|
|
3897
3969
|
HostEvent["GetGroups"] = "getGroups";
|
|
3898
3970
|
/**
|
|
3899
3971
|
* Set the visible tabs on a Liveboard.
|
|
3972
|
+
* Payload: `string[]`.
|
|
3900
3973
|
* @param - an array of ids of tabs to show, the IDs not passed
|
|
3901
3974
|
* will be hidden.
|
|
3902
3975
|
* @example
|
|
@@ -3919,6 +3992,7 @@
|
|
|
3919
3992
|
HostEvent["SetVisibleTabs"] = "SetPinboardVisibleTabs";
|
|
3920
3993
|
/**
|
|
3921
3994
|
* Set the hidden tabs on a Liveboard.
|
|
3995
|
+
* Payload: `string[]`.
|
|
3922
3996
|
* @param - an array of the IDs of the tabs to hide.
|
|
3923
3997
|
* The IDs not passed will be shown.
|
|
3924
3998
|
* @example
|
|
@@ -3947,6 +4021,8 @@
|
|
|
3947
4021
|
* `getAnswerService()` method on the embed instance to get an AnswerService
|
|
3948
4022
|
* object that provides a more convenient interface for working with answers.
|
|
3949
4023
|
*
|
|
4024
|
+
* Payload: {@link GetAnswerSessionRequest}.
|
|
4025
|
+
* Response: {@link GetAnswerSessionResponse}.
|
|
3950
4026
|
* @example
|
|
3951
4027
|
* ```js
|
|
3952
4028
|
* // Preferred way to get an AnswerService
|
|
@@ -3974,6 +4050,7 @@
|
|
|
3974
4050
|
HostEvent["GetAnswerSession"] = "getAnswerSession";
|
|
3975
4051
|
/**
|
|
3976
4052
|
* Trigger the *Ask Sage* action for visualizations
|
|
4053
|
+
* Payload: {@link RequiredVizRequest}.
|
|
3977
4054
|
* @example
|
|
3978
4055
|
* ```js
|
|
3979
4056
|
* liveboardEmbed.trigger(HostEvent.AskSage,
|
|
@@ -3985,6 +4062,7 @@
|
|
|
3985
4062
|
/**
|
|
3986
4063
|
* Trigger cross filter update action on a Liveboard.
|
|
3987
4064
|
*
|
|
4065
|
+
* Payload: {@link UpdateCrossFilterRequest}.
|
|
3988
4066
|
* @example
|
|
3989
4067
|
* ```js
|
|
3990
4068
|
* liveboardEmbed.trigger(HostEvent.UpdateCrossFilter, {
|
|
@@ -4000,7 +4078,9 @@
|
|
|
4000
4078
|
HostEvent["UpdateCrossFilter"] = "UpdateCrossFilter";
|
|
4001
4079
|
/**
|
|
4002
4080
|
* Trigger reset action for a personalized Liveboard view.
|
|
4003
|
-
* This event is deprecated.
|
|
4081
|
+
* This event is deprecated.
|
|
4082
|
+
* Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
|
|
4083
|
+
* Payload: none.
|
|
4004
4084
|
* @example
|
|
4005
4085
|
* ```js
|
|
4006
4086
|
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
|
|
@@ -4021,6 +4101,7 @@
|
|
|
4021
4101
|
/**
|
|
4022
4102
|
* Triggers an action to update Parameter values on embedded
|
|
4023
4103
|
* Answers, Liveboard, and Spotter answer in Edit mode.
|
|
4104
|
+
* Payload: {@link RuntimeParameter}[].
|
|
4024
4105
|
* @param - Includes the following keys for each item:
|
|
4025
4106
|
* - `name`: Name of the parameter.
|
|
4026
4107
|
* - `value`: The value to set for the parameter.
|
|
@@ -4078,6 +4159,8 @@
|
|
|
4078
4159
|
* whole Liveboard.
|
|
4079
4160
|
* The `applicability` attribute is available from SDK: 1.53.0 |
|
|
4080
4161
|
* ThoughtSpot: 26.10.0.cl.
|
|
4162
|
+
* Payload: none.
|
|
4163
|
+
* Response: {@link GetParametersResponse}.
|
|
4081
4164
|
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
4082
4165
|
* ```js
|
|
4083
4166
|
* liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
|
|
@@ -4115,6 +4198,7 @@
|
|
|
4115
4198
|
* ```js
|
|
4116
4199
|
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
|
|
4117
4200
|
* ```
|
|
4201
|
+
* Payload: {@link PersonalisedViewRequest} (`viewId` only).
|
|
4118
4202
|
* @example
|
|
4119
4203
|
* ```js
|
|
4120
4204
|
* // Update personalized view from liveboard context
|
|
@@ -4147,6 +4231,7 @@
|
|
|
4147
4231
|
* If neither is provided, the Liveboard resets to the original/default view.
|
|
4148
4232
|
* When a `viewName` is provided and multiple views share
|
|
4149
4233
|
* the same name, the first match is selected.
|
|
4234
|
+
* Payload: {@link PersonalisedViewRequest}.
|
|
4150
4235
|
* @example
|
|
4151
4236
|
* ```js
|
|
4152
4237
|
* liveboardEmbed.trigger(
|
|
@@ -4190,6 +4275,8 @@
|
|
|
4190
4275
|
* If no parameters are specified, the save action is
|
|
4191
4276
|
* triggered with a modal to prompt users to
|
|
4192
4277
|
* add a name and description for the Answer.
|
|
4278
|
+
* Payload: {@link SaveAnswerRequest}.
|
|
4279
|
+
* Response: {@link SaveAnswerResponse}.
|
|
4193
4280
|
* @param - Includes the following keys:
|
|
4194
4281
|
* - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
|
|
4195
4282
|
* embed.
|
|
@@ -4275,6 +4362,7 @@
|
|
|
4275
4362
|
/**
|
|
4276
4363
|
* Triggers a search operation with the search tokens specified in
|
|
4277
4364
|
* the search query string in spotter embed.
|
|
4365
|
+
* Payload: {@link SpotterSearchRequest}.
|
|
4278
4366
|
* @param - Includes the following keys:
|
|
4279
4367
|
* - `query`: Text string in Natural Language format.
|
|
4280
4368
|
* - `executeSearch`: Boolean to execute search and update search query.
|
|
@@ -4299,6 +4387,7 @@
|
|
|
4299
4387
|
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
4300
4388
|
/**
|
|
4301
4389
|
* Edits the last prompt in spotter embed.
|
|
4390
|
+
* Payload: `string`.
|
|
4302
4391
|
* @param - `query`: Text string
|
|
4303
4392
|
* @example
|
|
4304
4393
|
* ```js
|
|
@@ -4315,6 +4404,7 @@
|
|
|
4315
4404
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
4316
4405
|
/**
|
|
4317
4406
|
* Opens the data source preview modal in Spotter Embed.
|
|
4407
|
+
* Payload: none.
|
|
4318
4408
|
* @example
|
|
4319
4409
|
* ```js
|
|
4320
4410
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
@@ -4350,6 +4440,7 @@
|
|
|
4350
4440
|
HostEvent["DataModelInstructions"] = "DataModelInstructions";
|
|
4351
4441
|
/**
|
|
4352
4442
|
* Resets the Spotter Embed Conversation.
|
|
4443
|
+
* Payload: none.
|
|
4353
4444
|
* @example
|
|
4354
4445
|
* ```js
|
|
4355
4446
|
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
@@ -4362,6 +4453,7 @@
|
|
|
4362
4453
|
* `conversationId` is **mandatory** — you must pass the id of the
|
|
4363
4454
|
* conversation to share. Also no-op when sharing is disabled
|
|
4364
4455
|
* (enableShareConversation off) or when already in the read-only shared view.
|
|
4456
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4365
4457
|
* @example
|
|
4366
4458
|
* ```js
|
|
4367
4459
|
* spotterEmbed.trigger(HostEvent.ShareSpotterConversation, { conversationId: 'abc' });
|
|
@@ -4371,6 +4463,7 @@
|
|
|
4371
4463
|
HostEvent["ShareSpotterConversation"] = "ShareSpotterConversation";
|
|
4372
4464
|
/**
|
|
4373
4465
|
* Closes the Spotter share-conversation modal. No-op if none is open.
|
|
4466
|
+
* Payload: none.
|
|
4374
4467
|
* @example
|
|
4375
4468
|
* ```js
|
|
4376
4469
|
* spotterEmbed.trigger(HostEvent.CloseSpotterShareConversation);
|
|
@@ -4380,6 +4473,7 @@
|
|
|
4380
4473
|
HostEvent["CloseSpotterShareConversation"] = "CloseSpotterShareConversation";
|
|
4381
4474
|
/**
|
|
4382
4475
|
* Exits the read-only shared-conversation view.
|
|
4476
|
+
* Payload: none.
|
|
4383
4477
|
* @example
|
|
4384
4478
|
* ```js
|
|
4385
4479
|
* spotterEmbed.trigger(HostEvent.ExitSpotterSharedConversation);
|
|
@@ -4389,6 +4483,7 @@
|
|
|
4389
4483
|
HostEvent["ExitSpotterSharedConversation"] = "ExitSpotterSharedConversation";
|
|
4390
4484
|
/**
|
|
4391
4485
|
* Deletes the last prompt in spotter embed.
|
|
4486
|
+
* Payload: none.
|
|
4392
4487
|
* @example
|
|
4393
4488
|
* ```js
|
|
4394
4489
|
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
@@ -4398,6 +4493,7 @@
|
|
|
4398
4493
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
4399
4494
|
/**
|
|
4400
4495
|
* Toggle the visualization to chart or table view.
|
|
4496
|
+
* Payload: {@link RequiredVizRequest}.
|
|
4401
4497
|
* @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
|
|
4402
4498
|
* @example
|
|
4403
4499
|
* ```js
|
|
@@ -4436,6 +4532,7 @@
|
|
|
4436
4532
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
4437
4533
|
/**
|
|
4438
4534
|
* Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
|
|
4535
|
+
* Payload: {@link RequiredVizRequest}.
|
|
4439
4536
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
|
|
4440
4537
|
* @example
|
|
4441
4538
|
* ```js
|
|
@@ -4497,6 +4594,7 @@
|
|
|
4497
4594
|
* instance. Contact your admin or ThoughtSpot Support to enable chat history on your
|
|
4498
4595
|
* instance.
|
|
4499
4596
|
*
|
|
4597
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4500
4598
|
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
4501
4599
|
* @example
|
|
4502
4600
|
* ```js
|
|
@@ -4514,6 +4612,7 @@
|
|
|
4514
4612
|
* instance. Contact your admin or ThoughtSpot Support to enable chat history on your
|
|
4515
4613
|
* instance.
|
|
4516
4614
|
*
|
|
4615
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4517
4616
|
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
4518
4617
|
* @example
|
|
4519
4618
|
* ```js
|
|
@@ -4538,6 +4637,7 @@
|
|
|
4538
4637
|
* Trigger the **Send Test Email** action in the Liveboard schedule modal.
|
|
4539
4638
|
* Sends a test schedule email to self or all recipients.
|
|
4540
4639
|
* Requires `isSendNowLiveboardSchedulingEnabled` to be enabled.
|
|
4640
|
+
* Payload: {@link ScheduleEmailRequest}.
|
|
4541
4641
|
* @example
|
|
4542
4642
|
* ```js
|
|
4543
4643
|
* liveboardEmbed.trigger(HostEvent.SendTestScheduleEmail, {
|
|
@@ -4556,6 +4656,7 @@
|
|
|
4556
4656
|
HostEvent["SendTestScheduleEmail"] = "sendTestScheduleEmail";
|
|
4557
4657
|
/**
|
|
4558
4658
|
* Sends a user message (prompt) to the SpotterViz panel programmatically.
|
|
4659
|
+
* Payload: `{ query: string }`.
|
|
4559
4660
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4560
4661
|
* @param query - the prompt text to send.
|
|
4561
4662
|
* @example
|
|
@@ -4568,6 +4669,7 @@
|
|
|
4568
4669
|
HostEvent["SpotterVizSendUserMessage"] = "SpotterVizSendUserMessage";
|
|
4569
4670
|
/**
|
|
4570
4671
|
* Initializes a new SpotterViz conversation.
|
|
4672
|
+
* Payload: none.
|
|
4571
4673
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4572
4674
|
* @example
|
|
4573
4675
|
* ```js
|
|
@@ -4577,6 +4679,7 @@
|
|
|
4577
4679
|
HostEvent["InitSpotterVizConversation"] = "InitSpotterVizConversation";
|
|
4578
4680
|
/**
|
|
4579
4681
|
* Opens the SpotterViz panel.
|
|
4682
|
+
* Payload: none.
|
|
4580
4683
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4581
4684
|
* @example
|
|
4582
4685
|
* ```js
|
|
@@ -4586,6 +4689,7 @@
|
|
|
4586
4689
|
HostEvent["OpenSpotterVizPanel"] = "OpenSpotterVizPanel";
|
|
4587
4690
|
/**
|
|
4588
4691
|
* Closes the SpotterViz panel.
|
|
4692
|
+
* Payload: none.
|
|
4589
4693
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4590
4694
|
* @example
|
|
4591
4695
|
* ```js
|
|
@@ -4596,6 +4700,7 @@
|
|
|
4596
4700
|
/**
|
|
4597
4701
|
* Clears browser cache and fetches new data for liveboard ChartViz Containers.
|
|
4598
4702
|
* Requires `enableLiveboardDataCache` to be enabled.
|
|
4703
|
+
* Payload: {@link ScheduleEmailRequest}.
|
|
4599
4704
|
* @example
|
|
4600
4705
|
* ```js
|
|
4601
4706
|
* liveboardEmbed.trigger(HostEvent.RefreshLiveboardBrowserCache);
|
|
@@ -4793,6 +4898,7 @@
|
|
|
4793
4898
|
Param["SpotterDataSources"] = "spotterDataSources";
|
|
4794
4899
|
Param["AnalystId"] = "analystId";
|
|
4795
4900
|
Param["OpenSpotterOnLiveboardByDefault"] = "openSpotterOnLiveboardByDefault";
|
|
4901
|
+
Param["ShowAnswerEditPanel"] = "showAnswerEditPanel";
|
|
4796
4902
|
})(Param || (Param = {}));
|
|
4797
4903
|
/**
|
|
4798
4904
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -6797,6 +6903,225 @@
|
|
|
6797
6903
|
* ```
|
|
6798
6904
|
*/
|
|
6799
6905
|
Action["SpotterOnLiveboard"] = "spotterOnLiveboard";
|
|
6906
|
+
/**
|
|
6907
|
+
* Controls the visibility and disabled state of the "Chart Type" menu item
|
|
6908
|
+
* in Chart Settings V2.
|
|
6909
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6910
|
+
* @example
|
|
6911
|
+
* ```js
|
|
6912
|
+
* {
|
|
6913
|
+
* hiddenActions: [Action.ChartTypeSettings],
|
|
6914
|
+
* disabledActions: [Action.ChartTypeSettings],
|
|
6915
|
+
* }
|
|
6916
|
+
* ```
|
|
6917
|
+
*/
|
|
6918
|
+
Action["ChartTypeSettings"] = "CHART_TYPE";
|
|
6919
|
+
/**
|
|
6920
|
+
* Controls the visibility and disabled state of the "Layout" menu item
|
|
6921
|
+
* in Chart Settings V2.
|
|
6922
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6923
|
+
* @example
|
|
6924
|
+
* ```js
|
|
6925
|
+
* {
|
|
6926
|
+
* hiddenActions: [Action.LayoutSettings],
|
|
6927
|
+
* disabledActions: [Action.LayoutSettings],
|
|
6928
|
+
* }
|
|
6929
|
+
* ```
|
|
6930
|
+
*/
|
|
6931
|
+
Action["LayoutSettings"] = "LAYOUT";
|
|
6932
|
+
/**
|
|
6933
|
+
* Controls the visibility and disabled state of the "Column" menu item
|
|
6934
|
+
* in Chart Settings V2.
|
|
6935
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6936
|
+
* @example
|
|
6937
|
+
* ```js
|
|
6938
|
+
* {
|
|
6939
|
+
* hiddenActions: [Action.ColumnSettings],
|
|
6940
|
+
* disabledActions: [Action.ColumnSettings],
|
|
6941
|
+
* }
|
|
6942
|
+
* ```
|
|
6943
|
+
*/
|
|
6944
|
+
Action["ColumnSettings"] = "COLUMN";
|
|
6945
|
+
/**
|
|
6946
|
+
* Controls the visibility and disabled state of the "Axis" menu item
|
|
6947
|
+
* in Chart Settings V2.
|
|
6948
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6949
|
+
* @example
|
|
6950
|
+
* ```js
|
|
6951
|
+
* {
|
|
6952
|
+
* hiddenActions: [Action.AxisSettings],
|
|
6953
|
+
* disabledActions: [Action.AxisSettings],
|
|
6954
|
+
* }
|
|
6955
|
+
* ```
|
|
6956
|
+
*/
|
|
6957
|
+
Action["AxisSettings"] = "AXIS";
|
|
6958
|
+
/**
|
|
6959
|
+
* Controls the visibility and disabled state of the "Data Label" menu item
|
|
6960
|
+
* in Chart Settings V2.
|
|
6961
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6962
|
+
* @example
|
|
6963
|
+
* ```js
|
|
6964
|
+
* {
|
|
6965
|
+
* hiddenActions: [Action.DataLabelSettings],
|
|
6966
|
+
* disabledActions: [Action.DataLabelSettings],
|
|
6967
|
+
* }
|
|
6968
|
+
* ```
|
|
6969
|
+
*/
|
|
6970
|
+
Action["DataLabelSettings"] = "DATA_LABEL";
|
|
6971
|
+
/**
|
|
6972
|
+
* Controls the visibility and disabled state of the "Tooltip" menu item
|
|
6973
|
+
* in Chart Settings V2.
|
|
6974
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6975
|
+
* @example
|
|
6976
|
+
* ```js
|
|
6977
|
+
* {
|
|
6978
|
+
* hiddenActions: [Action.TooltipSettings],
|
|
6979
|
+
* disabledActions: [Action.TooltipSettings],
|
|
6980
|
+
* }
|
|
6981
|
+
* ```
|
|
6982
|
+
*/
|
|
6983
|
+
Action["TooltipSettings"] = "TOOLTIP";
|
|
6984
|
+
/**
|
|
6985
|
+
* Controls the visibility and disabled state of the "Legend" menu item
|
|
6986
|
+
* in Chart Settings V2.
|
|
6987
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6988
|
+
* @example
|
|
6989
|
+
* ```js
|
|
6990
|
+
* {
|
|
6991
|
+
* hiddenActions: [Action.LegendSettings],
|
|
6992
|
+
* disabledActions: [Action.LegendSettings],
|
|
6993
|
+
* }
|
|
6994
|
+
* ```
|
|
6995
|
+
*/
|
|
6996
|
+
Action["LegendSettings"] = "LEGEND";
|
|
6997
|
+
/**
|
|
6998
|
+
* Controls the visibility and disabled state of the "Display" menu item
|
|
6999
|
+
* in Chart Settings V2.
|
|
7000
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7001
|
+
* @example
|
|
7002
|
+
* ```js
|
|
7003
|
+
* {
|
|
7004
|
+
* hiddenActions: [Action.DisplaySettings],
|
|
7005
|
+
* disabledActions: [Action.DisplaySettings],
|
|
7006
|
+
* }
|
|
7007
|
+
* ```
|
|
7008
|
+
*/
|
|
7009
|
+
Action["DisplaySettings"] = "DISPLAY";
|
|
7010
|
+
/**
|
|
7011
|
+
* Controls the visibility and disabled state of the "Query Details" menu
|
|
7012
|
+
* item in Chart Settings V2.
|
|
7013
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7014
|
+
* @example
|
|
7015
|
+
* ```js
|
|
7016
|
+
* {
|
|
7017
|
+
* hiddenActions: [Action.QuerySettings],
|
|
7018
|
+
* disabledActions: [Action.QuerySettings],
|
|
7019
|
+
* }
|
|
7020
|
+
* ```
|
|
7021
|
+
*/
|
|
7022
|
+
Action["QuerySettings"] = "QUERY_DETAILS";
|
|
7023
|
+
/**
|
|
7024
|
+
* Controls the visibility and disabled state of the "Custom Action" menu
|
|
7025
|
+
* item in Chart Settings V2.
|
|
7026
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7027
|
+
* @example
|
|
7028
|
+
* ```js
|
|
7029
|
+
* {
|
|
7030
|
+
* hiddenActions: [Action.CustomSettings],
|
|
7031
|
+
* disabledActions: [Action.CustomSettings],
|
|
7032
|
+
* }
|
|
7033
|
+
* ```
|
|
7034
|
+
*/
|
|
7035
|
+
Action["CustomSettings"] = "CUSTOM_ACTION";
|
|
7036
|
+
/**
|
|
7037
|
+
* Controls the visibility and disabled state of the "Muze AI" menu item
|
|
7038
|
+
* in Chart Settings V2.
|
|
7039
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7040
|
+
* @example
|
|
7041
|
+
* ```js
|
|
7042
|
+
* {
|
|
7043
|
+
* hiddenActions: [Action.MuzeAiSettings],
|
|
7044
|
+
* disabledActions: [Action.MuzeAiSettings],
|
|
7045
|
+
* }
|
|
7046
|
+
* ```
|
|
7047
|
+
*/
|
|
7048
|
+
Action["MuzeAiSettings"] = "MUZE_AI";
|
|
7049
|
+
/**
|
|
7050
|
+
* Controls the visibility and disabled state of the "R Analysis" menu item
|
|
7051
|
+
* in Chart Settings V2.
|
|
7052
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7053
|
+
* @example
|
|
7054
|
+
* ```js
|
|
7055
|
+
* {
|
|
7056
|
+
* hiddenActions: [Action.RAnalysisSettings],
|
|
7057
|
+
* disabledActions: [Action.RAnalysisSettings],
|
|
7058
|
+
* }
|
|
7059
|
+
* ```
|
|
7060
|
+
*/
|
|
7061
|
+
Action["RAnalysisSettings"] = "R_ANALYSIS";
|
|
7062
|
+
/**
|
|
7063
|
+
* Controls the visibility and disabled state of the "Add to Collection" menu item.
|
|
7064
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7065
|
+
* @example
|
|
7066
|
+
* ```js
|
|
7067
|
+
* {
|
|
7068
|
+
* hiddenActions: [Action.AddToCollection],
|
|
7069
|
+
* disabledActions: [Action.AddToCollection],
|
|
7070
|
+
* }
|
|
7071
|
+
* ```
|
|
7072
|
+
*/
|
|
7073
|
+
Action["AddToCollection"] = "addToCollection";
|
|
7074
|
+
/**
|
|
7075
|
+
* Controls the visibility and disabled state of the "Create Collection" button.
|
|
7076
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7077
|
+
* @example
|
|
7078
|
+
* ```js
|
|
7079
|
+
* {
|
|
7080
|
+
* hiddenActions: [Action.CreateCollection],
|
|
7081
|
+
* disabledActions: [Action.CreateCollection],
|
|
7082
|
+
* }
|
|
7083
|
+
* ```
|
|
7084
|
+
*/
|
|
7085
|
+
Action["CreateCollection"] = "createCollection";
|
|
7086
|
+
/**
|
|
7087
|
+
* Controls the visibility and disabled state of the "Move" menu item in a
|
|
7088
|
+
* Collection.
|
|
7089
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7090
|
+
* @example
|
|
7091
|
+
* ```js
|
|
7092
|
+
* {
|
|
7093
|
+
* hiddenActions: [Action.MoveToCollection],
|
|
7094
|
+
* disabledActions: [Action.MoveToCollection],
|
|
7095
|
+
* }
|
|
7096
|
+
* ```
|
|
7097
|
+
*/
|
|
7098
|
+
Action["MoveToCollection"] = "moveToCollection";
|
|
7099
|
+
/**
|
|
7100
|
+
* Controls the visibility and disabled state of the "Remove" menu item in a
|
|
7101
|
+
* Collection.
|
|
7102
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7103
|
+
* @example
|
|
7104
|
+
* ```js
|
|
7105
|
+
* {
|
|
7106
|
+
* hiddenActions: [Action.RemoveFromCollection],
|
|
7107
|
+
* disabledActions: [Action.RemoveFromCollection],
|
|
7108
|
+
* }
|
|
7109
|
+
* ```
|
|
7110
|
+
*/
|
|
7111
|
+
Action["RemoveFromCollection"] = "removeFromCollection";
|
|
7112
|
+
/**
|
|
7113
|
+
* Controls the visibility and disabled state of the "Delete" menu item for a
|
|
7114
|
+
* Collection.
|
|
7115
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7116
|
+
* @example
|
|
7117
|
+
* ```js
|
|
7118
|
+
* {
|
|
7119
|
+
* hiddenActions: [Action.DeleteCollection],
|
|
7120
|
+
* disabledActions: [Action.DeleteCollection],
|
|
7121
|
+
* }
|
|
7122
|
+
* ```
|
|
7123
|
+
*/
|
|
7124
|
+
Action["DeleteCollection"] = "deleteCollection";
|
|
6800
7125
|
})(exports.Action || (exports.Action = {}));
|
|
6801
7126
|
exports.PrefetchFeatures = void 0;
|
|
6802
7127
|
(function (PrefetchFeatures) {
|
|
@@ -7301,7 +7626,7 @@
|
|
|
7301
7626
|
TableContentDensity["Compact"] = "COMPACT";
|
|
7302
7627
|
})(exports.TableContentDensity || (exports.TableContentDensity = {}));
|
|
7303
7628
|
|
|
7304
|
-
var version$1="1.52.
|
|
7629
|
+
var version$1="1.52.1";var pkg = {version:version$1};
|
|
7305
7630
|
|
|
7306
7631
|
const { version } = pkg;
|
|
7307
7632
|
|
|
@@ -8123,6 +8448,43 @@
|
|
|
8123
8448
|
if (value !== undefined) {
|
|
8124
8449
|
queryParams[param] = asBoolean ? !!value : value;
|
|
8125
8450
|
}
|
|
8451
|
+
};
|
|
8452
|
+
/**
|
|
8453
|
+
* Calculates the element center for the currently visible viewport of the
|
|
8454
|
+
* element, using the scroll position of the host app, the offsetTop of the
|
|
8455
|
+
* element in the host app, and the viewport height of the tab.
|
|
8456
|
+
*
|
|
8457
|
+
* The returned keys are sent to the ThoughtSpot app over postMessage, so they
|
|
8458
|
+
* are named after the iframe and must not be renamed.
|
|
8459
|
+
* @param element The element to measure
|
|
8460
|
+
* @returns The element center within the visible viewport, the element height,
|
|
8461
|
+
* and the viewport height.
|
|
8462
|
+
*/
|
|
8463
|
+
const calculateElementCenter = (element) => {
|
|
8464
|
+
const offsetTopClient = getOffsetTop(element);
|
|
8465
|
+
const scrollTopClient = window.scrollY;
|
|
8466
|
+
const viewPortHeight = window.innerHeight;
|
|
8467
|
+
const iframeHeight = element.offsetHeight;
|
|
8468
|
+
const iframeScrolled = scrollTopClient - offsetTopClient;
|
|
8469
|
+
let iframeVisibleViewPort;
|
|
8470
|
+
let iframeOffset;
|
|
8471
|
+
if (iframeScrolled < 0) {
|
|
8472
|
+
iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
|
|
8473
|
+
iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
|
|
8474
|
+
iframeOffset = 0;
|
|
8475
|
+
}
|
|
8476
|
+
else {
|
|
8477
|
+
iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
|
|
8478
|
+
iframeOffset = iframeScrolled;
|
|
8479
|
+
}
|
|
8480
|
+
const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
|
|
8481
|
+
return {
|
|
8482
|
+
iframeCenter,
|
|
8483
|
+
iframeScrolled,
|
|
8484
|
+
iframeHeight,
|
|
8485
|
+
viewPortHeight,
|
|
8486
|
+
iframeVisibleViewPort,
|
|
8487
|
+
};
|
|
8126
8488
|
};
|
|
8127
8489
|
|
|
8128
8490
|
/**
|
|
@@ -8191,6 +8553,270 @@
|
|
|
8191
8553
|
const DEFAULT_EMBED_HEIGHT = '100%';
|
|
8192
8554
|
const DEFAULT_LAZY_LOADING_MARGIN = '500px 0px';
|
|
8193
8555
|
|
|
8556
|
+
/**
|
|
8557
|
+
* Copyright (c) 2025
|
|
8558
|
+
*
|
|
8559
|
+
* Full-height support for the Liveboard and app embeds.
|
|
8560
|
+
* @summary Full height
|
|
8561
|
+
*/
|
|
8562
|
+
/**
|
|
8563
|
+
* The height the embed falls back to when the host app has not configured
|
|
8564
|
+
* `minimumHeight` or `defaultHeight`.
|
|
8565
|
+
*/
|
|
8566
|
+
const DEFAULT_MINIMUM_HEIGHT = 500;
|
|
8567
|
+
/**
|
|
8568
|
+
* Routes that are part of the Liveboard experience itself. Navigating between
|
|
8569
|
+
* these does not reset the frame height, because the ThoughtSpot app keeps
|
|
8570
|
+
* reporting a height of its own for them.
|
|
8571
|
+
*/
|
|
8572
|
+
const LIVEBOARD_RELATED_ROUTES = [
|
|
8573
|
+
'/pinboard/',
|
|
8574
|
+
'/insights/pinboard/',
|
|
8575
|
+
'/schedules/',
|
|
8576
|
+
'/embed/viz/',
|
|
8577
|
+
'/embed/insights/viz/',
|
|
8578
|
+
'/liveboard/',
|
|
8579
|
+
'/insights/liveboard/',
|
|
8580
|
+
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
8581
|
+
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
8582
|
+
];
|
|
8583
|
+
/**
|
|
8584
|
+
* Owns every piece of full-height behavior for an embed: the height
|
|
8585
|
+
* negotiation with the ThoughtSpot app, the query parameters that switch the
|
|
8586
|
+
* feature on, and the viewport listeners that drive lazy loading.
|
|
8587
|
+
*
|
|
8588
|
+
* The controller is inert unless `fullHeight` is enabled, so embeds can create
|
|
8589
|
+
* one unconditionally.
|
|
8590
|
+
*/
|
|
8591
|
+
class FullHeightController {
|
|
8592
|
+
constructor(viewConfig, host) {
|
|
8593
|
+
this.host = host;
|
|
8594
|
+
this.scrollContainers = [];
|
|
8595
|
+
/**
|
|
8596
|
+
* Sets the frame height to the height reported by the ThoughtSpot app,
|
|
8597
|
+
* never going below the configured minimum.
|
|
8598
|
+
*/
|
|
8599
|
+
this.handleEmbedHeight = (payload) => {
|
|
8600
|
+
const height = Number(payload === null || payload === void 0 ? void 0 : payload.data);
|
|
8601
|
+
if (!isNaN(height)) {
|
|
8602
|
+
this.host.setFrameHeight(Math.max(height, this.minimumHeight));
|
|
8603
|
+
}
|
|
8604
|
+
this.sendVisibleCoordinates();
|
|
8605
|
+
};
|
|
8606
|
+
/**
|
|
8607
|
+
* Answers the app's request for the center of the visible embed region.
|
|
8608
|
+
*/
|
|
8609
|
+
this.handleEmbedIframeCenter = (payload, responder) => {
|
|
8610
|
+
const iframe = this.host.getIframe();
|
|
8611
|
+
if (!iframe) {
|
|
8612
|
+
return;
|
|
8613
|
+
}
|
|
8614
|
+
responder === null || responder === void 0 ? void 0 : responder({
|
|
8615
|
+
type: exports.EmbedEvent.EmbedIframeCenter,
|
|
8616
|
+
data: calculateElementCenter(iframe),
|
|
8617
|
+
});
|
|
8618
|
+
};
|
|
8619
|
+
/**
|
|
8620
|
+
* Answers the app's request for the currently visible embed coordinates.
|
|
8621
|
+
*/
|
|
8622
|
+
this.handleRequestVisibleCoordinates = (payload, responder) => {
|
|
8623
|
+
logger$3.info('Sending RequestVisibleEmbedCoordinates', payload);
|
|
8624
|
+
responder === null || responder === void 0 ? void 0 : responder({
|
|
8625
|
+
type: exports.EmbedEvent.RequestVisibleEmbedCoordinates,
|
|
8626
|
+
data: this.getVisibleCoordinates(),
|
|
8627
|
+
});
|
|
8628
|
+
};
|
|
8629
|
+
/**
|
|
8630
|
+
* Resets the frame height when the app navigates away from a Liveboard,
|
|
8631
|
+
* since only Liveboard routes report a height of their own.
|
|
8632
|
+
*/
|
|
8633
|
+
this.handleRouteChange = (payload) => {
|
|
8634
|
+
var _a, _b;
|
|
8635
|
+
const currentPath = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.currentPath;
|
|
8636
|
+
if (!currentPath) {
|
|
8637
|
+
return;
|
|
8638
|
+
}
|
|
8639
|
+
if (LIVEBOARD_RELATED_ROUTES.some((route) => currentPath.startsWith(route))) {
|
|
8640
|
+
return;
|
|
8641
|
+
}
|
|
8642
|
+
this.host.setFrameHeight(((_b = this.config.frameParams) === null || _b === void 0 ? void 0 : _b.height) || this.minimumHeight);
|
|
8643
|
+
};
|
|
8644
|
+
/**
|
|
8645
|
+
* Pushes the visible embed region to the app so it can decide which
|
|
8646
|
+
* visualizations to load.
|
|
8647
|
+
*/
|
|
8648
|
+
this.sendVisibleCoordinates = () => {
|
|
8649
|
+
if (!this.isLazyLoadEnabled) {
|
|
8650
|
+
return;
|
|
8651
|
+
}
|
|
8652
|
+
const coordinates = this.getVisibleCoordinates();
|
|
8653
|
+
if (coordinates) {
|
|
8654
|
+
this.host.trigger(exports.HostEvent.VisibleEmbedCoordinates, coordinates);
|
|
8655
|
+
}
|
|
8656
|
+
};
|
|
8657
|
+
this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
|
|
8658
|
+
this.registerEventHandlers();
|
|
8659
|
+
}
|
|
8660
|
+
/**
|
|
8661
|
+
* The view config the controller runs on: the host app's own config with
|
|
8662
|
+
* the lazy-loading defaults filled in. Read-only, so the only way to change
|
|
8663
|
+
* it is through the setter, which re-resolves the defaults.
|
|
8664
|
+
*/
|
|
8665
|
+
get viewConfig() {
|
|
8666
|
+
return this.config;
|
|
8667
|
+
}
|
|
8668
|
+
/**
|
|
8669
|
+
* Replaces the view config the controller runs on and re-resolves the
|
|
8670
|
+
* lazy-loading defaults against it. The config the caller passes is never
|
|
8671
|
+
* written to; the controller keeps a copy of its own.
|
|
8672
|
+
*/
|
|
8673
|
+
set viewConfig(viewConfig) {
|
|
8674
|
+
this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
|
|
8675
|
+
}
|
|
8676
|
+
/**
|
|
8677
|
+
* The view config with the lazy-loading settings the embed falls back to
|
|
8678
|
+
* when the host app has not chosen its own.
|
|
8679
|
+
*
|
|
8680
|
+
* Pure by design: it returns a new config rather than writing to the one it
|
|
8681
|
+
* is given, so the host app's object is left untouched.
|
|
8682
|
+
* @param viewConfig The embed's view config
|
|
8683
|
+
* @returns A copy with the defaults filled in, host app choices preserved
|
|
8684
|
+
*/
|
|
8685
|
+
static withLazyLoadingDefaults(viewConfig) {
|
|
8686
|
+
return {
|
|
8687
|
+
...viewConfig,
|
|
8688
|
+
lazyLoadingForFullHeight: viewConfig.lazyLoadingForFullHeight === undefined
|
|
8689
|
+
? true
|
|
8690
|
+
: viewConfig.lazyLoadingForFullHeight,
|
|
8691
|
+
enableScrollableContainerLazyLoading: viewConfig.enableScrollableContainerLazyLoading === undefined
|
|
8692
|
+
? true
|
|
8693
|
+
: viewConfig.enableScrollableContainerLazyLoading,
|
|
8694
|
+
lazyLoadingMargin: viewConfig.lazyLoadingMargin === undefined
|
|
8695
|
+
? DEFAULT_LAZY_LOADING_MARGIN
|
|
8696
|
+
: viewConfig.lazyLoadingMargin,
|
|
8697
|
+
};
|
|
8698
|
+
}
|
|
8699
|
+
/**
|
|
8700
|
+
* Whether the host app asked for a full-height embed.
|
|
8701
|
+
*/
|
|
8702
|
+
get isEnabled() {
|
|
8703
|
+
return this.config.fullHeight === true;
|
|
8704
|
+
}
|
|
8705
|
+
/**
|
|
8706
|
+
* Whether visualizations should load as they scroll into view, which
|
|
8707
|
+
* requires the SDK to report the visible region of the embed.
|
|
8708
|
+
*/
|
|
8709
|
+
get isLazyLoadEnabled() {
|
|
8710
|
+
return this.isEnabled && !!this.config.lazyLoadingForFullHeight;
|
|
8711
|
+
}
|
|
8712
|
+
/**
|
|
8713
|
+
* The floor for the frame height. `defaultHeight` is the deprecated
|
|
8714
|
+
* spelling of `minimumHeight` and is still honored for compatibility.
|
|
8715
|
+
*/
|
|
8716
|
+
get minimumHeight() {
|
|
8717
|
+
const { minimumHeight, defaultHeight } = this.config;
|
|
8718
|
+
return minimumHeight || defaultHeight || DEFAULT_MINIMUM_HEIGHT;
|
|
8719
|
+
}
|
|
8720
|
+
/**
|
|
8721
|
+
* Registers the embed event handlers the feature depends on. Called from
|
|
8722
|
+
* the constructor, so the handlers are in place before `render`.
|
|
8723
|
+
*/
|
|
8724
|
+
registerEventHandlers() {
|
|
8725
|
+
if (!this.isEnabled) {
|
|
8726
|
+
return;
|
|
8727
|
+
}
|
|
8728
|
+
this.host.on(exports.EmbedEvent.RouteChange, this.handleRouteChange);
|
|
8729
|
+
this.host.on(exports.EmbedEvent.EmbedHeight, this.handleEmbedHeight);
|
|
8730
|
+
this.host.on(exports.EmbedEvent.EmbedIframeCenter, this.handleEmbedIframeCenter);
|
|
8731
|
+
this.host.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.handleRequestVisibleCoordinates);
|
|
8732
|
+
}
|
|
8733
|
+
/**
|
|
8734
|
+
* Adds the full-height query parameters to the embed URL params.
|
|
8735
|
+
* @param params The query parameters being built by the embed
|
|
8736
|
+
*/
|
|
8737
|
+
addQueryParams(params) {
|
|
8738
|
+
if (!this.isEnabled) {
|
|
8739
|
+
return;
|
|
8740
|
+
}
|
|
8741
|
+
params[Param.fullHeight] = true;
|
|
8742
|
+
if (!this.config.lazyLoadingForFullHeight) {
|
|
8743
|
+
return;
|
|
8744
|
+
}
|
|
8745
|
+
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
8746
|
+
if (isValidCssMargin(this.config.lazyLoadingMargin)) {
|
|
8747
|
+
params[Param.RootMarginForLazyLoad] = this.config.lazyLoadingMargin;
|
|
8748
|
+
}
|
|
8749
|
+
}
|
|
8750
|
+
/**
|
|
8751
|
+
* Attaches the viewport listeners that keep lazy loading in sync. Call this
|
|
8752
|
+
* once the embed has rendered and the iframe exists.
|
|
8753
|
+
*/
|
|
8754
|
+
onRender() {
|
|
8755
|
+
this.registerLazyLoadListeners();
|
|
8756
|
+
}
|
|
8757
|
+
/**
|
|
8758
|
+
* Detaches every listener and observer owned by the controller.
|
|
8759
|
+
*/
|
|
8760
|
+
destroy() {
|
|
8761
|
+
this.unregisterLazyLoadListeners();
|
|
8762
|
+
}
|
|
8763
|
+
getVisibleCoordinates() {
|
|
8764
|
+
const iframe = this.host.getIframe();
|
|
8765
|
+
if (!iframe) {
|
|
8766
|
+
return null;
|
|
8767
|
+
}
|
|
8768
|
+
return calculateVisibleElementData(iframe, this.config.enableScrollableContainerLazyLoading);
|
|
8769
|
+
}
|
|
8770
|
+
registerLazyLoadListeners() {
|
|
8771
|
+
if (!this.isLazyLoadEnabled || !this.host.getIframe()) {
|
|
8772
|
+
return;
|
|
8773
|
+
}
|
|
8774
|
+
// Re-registering is safe: drop whatever a previous render attached.
|
|
8775
|
+
this.unregisterLazyLoadListeners();
|
|
8776
|
+
// TODO: Use passive: true, install modernizr to check for passive
|
|
8777
|
+
window.addEventListener('resize', this.sendVisibleCoordinates);
|
|
8778
|
+
window.addEventListener('scroll', this.sendVisibleCoordinates, true);
|
|
8779
|
+
if (!this.config.enableScrollableContainerLazyLoading) {
|
|
8780
|
+
return;
|
|
8781
|
+
}
|
|
8782
|
+
this.observeScrollableContainers();
|
|
8783
|
+
}
|
|
8784
|
+
/**
|
|
8785
|
+
* Tracks the ancestors that can scroll or clip the embed, so the visible
|
|
8786
|
+
* region stays correct when the embed lives inside its own scroll
|
|
8787
|
+
* container rather than the page.
|
|
8788
|
+
*/
|
|
8789
|
+
observeScrollableContainers() {
|
|
8790
|
+
const iFrame = this.host.getIframe();
|
|
8791
|
+
this.scrollContainers = getScrollableAncestors(iFrame);
|
|
8792
|
+
this.scrollContainers.forEach((scrollContainer) => {
|
|
8793
|
+
scrollContainer.addEventListener('scroll', this.sendVisibleCoordinates);
|
|
8794
|
+
});
|
|
8795
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
8796
|
+
return;
|
|
8797
|
+
}
|
|
8798
|
+
const resizeTargets = new Set([iFrame.parentElement, ...getEffectiveClippingAncestors(iFrame)].filter(Boolean));
|
|
8799
|
+
this.resizeObserver = new ResizeObserver(this.sendVisibleCoordinates);
|
|
8800
|
+
resizeTargets.forEach((resizeTarget) => {
|
|
8801
|
+
this.resizeObserver.observe(resizeTarget);
|
|
8802
|
+
});
|
|
8803
|
+
}
|
|
8804
|
+
unregisterLazyLoadListeners() {
|
|
8805
|
+
var _a;
|
|
8806
|
+
if (!this.isLazyLoadEnabled) {
|
|
8807
|
+
return;
|
|
8808
|
+
}
|
|
8809
|
+
window.removeEventListener('resize', this.sendVisibleCoordinates);
|
|
8810
|
+
window.removeEventListener('scroll', this.sendVisibleCoordinates, true);
|
|
8811
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
8812
|
+
this.resizeObserver = undefined;
|
|
8813
|
+
this.scrollContainers.forEach((scrollContainer) => {
|
|
8814
|
+
scrollContainer.removeEventListener('scroll', this.sendVisibleCoordinates);
|
|
8815
|
+
});
|
|
8816
|
+
this.scrollContainers = [];
|
|
8817
|
+
}
|
|
8818
|
+
}
|
|
8819
|
+
|
|
8194
8820
|
/** Used for built-in method references. */
|
|
8195
8821
|
var objectProto$d = Object.prototype;
|
|
8196
8822
|
|
|
@@ -9099,7 +9725,110 @@
|
|
|
9099
9725
|
UIPassthroughEvent["GetTabs"] = "getTabs";
|
|
9100
9726
|
UIPassthroughEvent["GetGroups"] = "getGroups";
|
|
9101
9727
|
UIPassthroughEvent["GetExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
|
|
9102
|
-
})(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
|
|
9728
|
+
})(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
|
|
9729
|
+
// NOTE: HostEventRequest / HostEventResponse / TriggerPayload / TriggerResponse
|
|
9730
|
+
// live in the sibling ./host-event-contracts, which layers the
|
|
9731
|
+
// HostEventRequestMap on top of the UI-passthrough mapping above.
|
|
9732
|
+
// The former 2-tier definitions that lived here were superseded and removed.
|
|
9733
|
+
|
|
9734
|
+
/**
|
|
9735
|
+
* Copyright (c) 2026
|
|
9736
|
+
*
|
|
9737
|
+
* Dedicated transport layer for SDK <-> ThoughtSpot iframe messaging.
|
|
9738
|
+
*
|
|
9739
|
+
* Owns the postMessage/MessageChannel mechanics and origin resolution so
|
|
9740
|
+
* that embed/business logic (ts-embed.ts, hostEventClient) never touches
|
|
9741
|
+
* the wire directly. The wire format is unchanged from the historical
|
|
9742
|
+
* implementation — this layer is a pure structural extraction.
|
|
9743
|
+
*/
|
|
9744
|
+
/**
|
|
9745
|
+
* Default time to wait for the app to respond to a request-response
|
|
9746
|
+
* message before giving up and reclaiming the channel.
|
|
9747
|
+
*/
|
|
9748
|
+
const MESSAGE_RESPONSE_TIMEOUT = 30000;
|
|
9749
|
+
/**
|
|
9750
|
+
* Single implementation of origin resolution for the embedded app.
|
|
9751
|
+
* Returns the origin (scheme://host[:port]) for a ThoughtSpot host URL,
|
|
9752
|
+
* or null when it cannot be parsed.
|
|
9753
|
+
* @param thoughtSpotHost
|
|
9754
|
+
*/
|
|
9755
|
+
const resolveMessageOrigin = (thoughtSpotHost) => {
|
|
9756
|
+
try {
|
|
9757
|
+
return new URL(thoughtSpotHost).origin;
|
|
9758
|
+
}
|
|
9759
|
+
catch (e) {
|
|
9760
|
+
return null;
|
|
9761
|
+
}
|
|
9762
|
+
};
|
|
9763
|
+
/**
|
|
9764
|
+
* Validates that an inbound window message came from the embedded
|
|
9765
|
+
* ThoughtSpot app: the source window must be the embed iframe's window and,
|
|
9766
|
+
* when the expected origin is resolvable, the message origin must match it.
|
|
9767
|
+
*
|
|
9768
|
+
* Fails open (returns true) on the origin check when the expected origin
|
|
9769
|
+
* cannot be resolved, to avoid breaking unconventional-but-working setups;
|
|
9770
|
+
* a warning is logged on mismatch either way.
|
|
9771
|
+
* @param event The message event received on window.
|
|
9772
|
+
* @param iFrame The embed iframe the message should originate from.
|
|
9773
|
+
* @param thoughtSpotHost The configured ThoughtSpot host.
|
|
9774
|
+
*/
|
|
9775
|
+
const isMessageFromIframe = (event, iFrame, thoughtSpotHost) => {
|
|
9776
|
+
if (event.source !== (iFrame === null || iFrame === void 0 ? void 0 : iFrame.contentWindow)) {
|
|
9777
|
+
return false;
|
|
9778
|
+
}
|
|
9779
|
+
const expectedOrigin = resolveMessageOrigin(thoughtSpotHost);
|
|
9780
|
+
if (expectedOrigin && event.origin && event.origin !== expectedOrigin) {
|
|
9781
|
+
logger$3.warn(`Dropped message from unexpected origin ${event.origin}; expected ${expectedOrigin}`);
|
|
9782
|
+
return false;
|
|
9783
|
+
}
|
|
9784
|
+
return true;
|
|
9785
|
+
};
|
|
9786
|
+
/**
|
|
9787
|
+
* Posts a one-way message to the embedded app's iframe, optionally
|
|
9788
|
+
* transferring a MessageChannel port for the response.
|
|
9789
|
+
* @param iFrame
|
|
9790
|
+
* @param message
|
|
9791
|
+
* @param thoughtSpotHost Used as the postMessage targetOrigin.
|
|
9792
|
+
* @param channel
|
|
9793
|
+
*/
|
|
9794
|
+
const postMessageToIframe = (iFrame, message, thoughtSpotHost, channel) => {
|
|
9795
|
+
var _a;
|
|
9796
|
+
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, channel ? [channel.port2] : []);
|
|
9797
|
+
};
|
|
9798
|
+
/**
|
|
9799
|
+
* Sends a request-response message to the embedded app over a dedicated
|
|
9800
|
+
* MessageChannel. Resolves with the response payload; rejects when the app
|
|
9801
|
+
* responds with an error; resolves with a timeout Error object when no
|
|
9802
|
+
* response arrives in time (historical behavior, preserved for backward
|
|
9803
|
+
* compatibility).
|
|
9804
|
+
* @param iFrame
|
|
9805
|
+
* @param message
|
|
9806
|
+
* @param thoughtSpotHost
|
|
9807
|
+
* @param timeoutMs
|
|
9808
|
+
*/
|
|
9809
|
+
function sendMessageWithResponse(iFrame, message, thoughtSpotHost, timeoutMs = MESSAGE_RESPONSE_TIMEOUT) {
|
|
9810
|
+
return new Promise((res, rej) => {
|
|
9811
|
+
const channel = new MessageChannel();
|
|
9812
|
+
// Close the messageChannel and resolve the promise if timeout.
|
|
9813
|
+
const timeoutId = setTimeout(() => {
|
|
9814
|
+
channel.port1.close();
|
|
9815
|
+
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
9816
|
+
}, timeoutMs);
|
|
9817
|
+
channel.port1.onmessage = ({ data: responseData }) => {
|
|
9818
|
+
var _a;
|
|
9819
|
+
clearTimeout(timeoutId);
|
|
9820
|
+
channel.port1.close();
|
|
9821
|
+
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);
|
|
9822
|
+
if (error) {
|
|
9823
|
+
rej(error);
|
|
9824
|
+
}
|
|
9825
|
+
else {
|
|
9826
|
+
res(responseData);
|
|
9827
|
+
}
|
|
9828
|
+
};
|
|
9829
|
+
postMessageToIframe(iFrame, message, thoughtSpotHost, channel);
|
|
9830
|
+
});
|
|
9831
|
+
}
|
|
9103
9832
|
|
|
9104
9833
|
const EndPoints = {
|
|
9105
9834
|
AUTH_VERIFICATION: '/callosum/v1/session/info',
|
|
@@ -20271,23 +21000,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20271
21000
|
iFrame.src = src;
|
|
20272
21001
|
}, 100);
|
|
20273
21002
|
};
|
|
21003
|
+
const TRIGGER_TIMEOUT = MESSAGE_RESPONSE_TIMEOUT;
|
|
20274
21004
|
/**
|
|
20275
|
-
*
|
|
20276
|
-
*
|
|
20277
|
-
*
|
|
20278
|
-
* @param message.type
|
|
20279
|
-
* @param message.data
|
|
20280
|
-
* @param message.context
|
|
20281
|
-
* @param thoughtSpotHost
|
|
20282
|
-
* @param channel
|
|
20283
|
-
*/
|
|
20284
|
-
function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
|
|
20285
|
-
var _a;
|
|
20286
|
-
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
|
|
20287
|
-
}
|
|
20288
|
-
const TRIGGER_TIMEOUT = 30000;
|
|
20289
|
-
/**
|
|
20290
|
-
*
|
|
21005
|
+
* Processes a host event trigger: handles SDK-local events (Reload,
|
|
21006
|
+
* Present) and forwards everything else to the embedded app over the
|
|
21007
|
+
* iframe transport.
|
|
20291
21008
|
* @param iFrame
|
|
20292
21009
|
* @param messageType
|
|
20293
21010
|
* @param thoughtSpotHost
|
|
@@ -20295,42 +21012,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20295
21012
|
* @param context
|
|
20296
21013
|
*/
|
|
20297
21014
|
function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
|
|
20298
|
-
|
|
20299
|
-
|
|
20300
|
-
|
|
20301
|
-
|
|
20302
|
-
|
|
20303
|
-
|
|
20304
|
-
|
|
20305
|
-
|
|
20306
|
-
|
|
20307
|
-
|
|
20308
|
-
handlePresentEvent(iFrame);
|
|
20309
|
-
}
|
|
20310
|
-
else {
|
|
20311
|
-
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
20312
|
-
}
|
|
21015
|
+
var _a;
|
|
21016
|
+
if (messageType === exports.HostEvent.Reload) {
|
|
21017
|
+
reload(iFrame);
|
|
21018
|
+
return Promise.resolve(null);
|
|
21019
|
+
}
|
|
21020
|
+
if (messageType === exports.HostEvent.Present) {
|
|
21021
|
+
const embedConfig = getEmbedConfig();
|
|
21022
|
+
const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
|
|
21023
|
+
if (!disableFullscreenPresentation) {
|
|
21024
|
+
handlePresentEvent(iFrame);
|
|
20313
21025
|
}
|
|
20314
|
-
|
|
20315
|
-
|
|
20316
|
-
|
|
20317
|
-
|
|
20318
|
-
|
|
20319
|
-
}, TRIGGER_TIMEOUT);
|
|
20320
|
-
channel.port1.onmessage = ({ data: responseData }) => {
|
|
20321
|
-
var _a;
|
|
20322
|
-
clearTimeout(timeoutId);
|
|
20323
|
-
channel.port1.close();
|
|
20324
|
-
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);
|
|
20325
|
-
if (error) {
|
|
20326
|
-
rej(error);
|
|
20327
|
-
}
|
|
20328
|
-
else {
|
|
20329
|
-
res(responseData);
|
|
20330
|
-
}
|
|
20331
|
-
};
|
|
20332
|
-
return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
|
|
20333
|
-
});
|
|
21026
|
+
else {
|
|
21027
|
+
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
21028
|
+
}
|
|
21029
|
+
}
|
|
21030
|
+
return sendMessageWithResponse(iFrame, { type: messageType, data, context }, thoughtSpotHost, TRIGGER_TIMEOUT);
|
|
20334
21031
|
}
|
|
20335
21032
|
|
|
20336
21033
|
/**
|
|
@@ -21192,6 +21889,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21192
21889
|
if (!isValidUpdateFiltersPayload(payload)) {
|
|
21193
21890
|
throwUpdateFiltersValidationError();
|
|
21194
21891
|
}
|
|
21892
|
+
// The shared contract accepts both current (columnName/operator) and
|
|
21893
|
+
// legacy (column/oper) filter field names — as does the validation
|
|
21894
|
+
// above and the app at runtime. The UIPassthrough FilterUpdate type
|
|
21895
|
+
// still requires the legacy names; bridge until that contract is
|
|
21896
|
+
// audited.
|
|
21195
21897
|
return this.handleHostEventWithParam(exports.UIPassthroughEvent.UpdateFilters, payload, context);
|
|
21196
21898
|
}
|
|
21197
21899
|
handleUpdateParametersEvent(payload, context) {
|
|
@@ -21426,6 +22128,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21426
22128
|
*/
|
|
21427
22129
|
const PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY = 'tsEmbedOriginalPosition';
|
|
21428
22130
|
const PRERENDER_WRAPPER_ID_PREFIX = 'tsEmbed-pre-render-wrapper-';
|
|
22131
|
+
// The container applies UpdateEmbedParams through React state, so a delivered
|
|
22132
|
+
// post is not the same as the params being in effect.
|
|
22133
|
+
const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
|
|
22134
|
+
// The container ignores runtimeFilterParams/runtimeParameterParams unless truthy, so
|
|
22135
|
+
// null or '' leaves the previous embed's values in place. '&' is truthy and parses to {}.
|
|
22136
|
+
const NO_RUNTIME_PARAMS = '&';
|
|
21429
22137
|
/**
|
|
21430
22138
|
* The event id map from v2 event names to v1 event id
|
|
21431
22139
|
* v1 events are the classic embed events implemented in Blink v1
|
|
@@ -21452,6 +22160,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21452
22160
|
* The key to store the embed instance in the DOM node
|
|
21453
22161
|
*/
|
|
21454
22162
|
this.embedNodeKey = '__tsEmbed';
|
|
22163
|
+
this.embedContainerLoadedKey = '__tsEmbedContainerLoaded';
|
|
21455
22164
|
this.isAppInitialized = false;
|
|
21456
22165
|
/**
|
|
21457
22166
|
* Should we encode URL Query Params using base64 encoding which ThoughtSpot
|
|
@@ -21472,7 +22181,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21472
22181
|
const eventType = this.getEventType(event);
|
|
21473
22182
|
const eventPort = this.getEventPort(event);
|
|
21474
22183
|
const eventData = this.formatEventData(event, eventType);
|
|
21475
|
-
if (event
|
|
22184
|
+
if (isMessageFromIframe(event, this.iFrame, this.thoughtSpotHost)) {
|
|
21476
22185
|
const processedEventData = processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.hostElement);
|
|
21477
22186
|
if (eventType === exports.EmbedEvent.ApiIntercept) {
|
|
21478
22187
|
this.handleApiInterceptEvent({ eventData, eventPort });
|
|
@@ -21614,7 +22323,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21614
22323
|
this.createEmbedContainerHandler = (source) => () => {
|
|
21615
22324
|
const processEmbedContainerReady = () => {
|
|
21616
22325
|
logger$3.debug('processEmbedContainerReady');
|
|
21617
|
-
this.
|
|
22326
|
+
this.markEmbedContainerLoaded();
|
|
21618
22327
|
this.executeEmbedContainerReadyCallbacks();
|
|
21619
22328
|
};
|
|
21620
22329
|
if (source === exports.EmbedEvent.AuthInit) {
|
|
@@ -21628,6 +22337,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21628
22337
|
processEmbedContainerReady();
|
|
21629
22338
|
}
|
|
21630
22339
|
};
|
|
22340
|
+
// Subclasses that navigate the pre-render on show must await this before
|
|
22341
|
+
// triggering Navigate. Resolves even on failure, so navigation is never blocked.
|
|
22342
|
+
this.preRenderParamsApplied = Promise.resolve();
|
|
21631
22343
|
this.hostElement = getDOMNode(domSelector);
|
|
21632
22344
|
this.eventHandlerMap = new Map();
|
|
21633
22345
|
this.isError = false;
|
|
@@ -21944,6 +22656,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21944
22656
|
return `${basePath}#`;
|
|
21945
22657
|
}
|
|
21946
22658
|
async getUpdateEmbedParamsObject() {
|
|
22659
|
+
var _a, _b;
|
|
21947
22660
|
const queryParams = this.getEmbedParamsObject();
|
|
21948
22661
|
// Values are URL-serialized (e.g. dataSources as '["guid"]'); parse
|
|
21949
22662
|
// them back so the event payload matches a URL load (SCAL-334713).
|
|
@@ -21951,7 +22664,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21951
22664
|
queryParams[key] = deserializeParam(queryParams[key]);
|
|
21952
22665
|
});
|
|
21953
22666
|
const appInitData = await this.getAppInitData();
|
|
21954
|
-
return {
|
|
22667
|
+
return {
|
|
22668
|
+
...this.viewConfig,
|
|
22669
|
+
...queryParams,
|
|
22670
|
+
...appInitData,
|
|
22671
|
+
// A show cycle has no URL to carry these, so the payload always states them
|
|
22672
|
+
// — including "none", which is the case that leaks the previous filters.
|
|
22673
|
+
runtimeFilterParams: getFilterQuery((_a = this.viewConfig.runtimeFilters) !== null && _a !== void 0 ? _a : []) || NO_RUNTIME_PARAMS,
|
|
22674
|
+
runtimeParameterParams: getRuntimeParameters((_b = this.viewConfig.runtimeParameters) !== null && _b !== void 0 ? _b : [])
|
|
22675
|
+
|| NO_RUNTIME_PARAMS,
|
|
22676
|
+
};
|
|
21955
22677
|
}
|
|
21956
22678
|
/**
|
|
21957
22679
|
* Common query params set for all the embed modes.
|
|
@@ -22582,40 +23304,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22582
23304
|
getCompatibleEventType(eventType) {
|
|
22583
23305
|
return V1EventMap[eventType] || eventType;
|
|
22584
23306
|
}
|
|
22585
|
-
/**
|
|
22586
|
-
* Calculates the iframe center for the current visible viewPort
|
|
22587
|
-
* of iframe using Scroll position of Host App, offsetTop for iframe
|
|
22588
|
-
* in Host app. ViewPort height of the tab.
|
|
22589
|
-
* @returns iframe Center in visible viewport,
|
|
22590
|
-
* Iframe height,
|
|
22591
|
-
* View port height.
|
|
22592
|
-
*/
|
|
22593
|
-
getIframeCenter() {
|
|
22594
|
-
const offsetTopClient = getOffsetTop(this.iFrame);
|
|
22595
|
-
const scrollTopClient = window.scrollY;
|
|
22596
|
-
const viewPortHeight = window.innerHeight;
|
|
22597
|
-
const iframeHeight = this.iFrame.offsetHeight;
|
|
22598
|
-
const iframeScrolled = scrollTopClient - offsetTopClient;
|
|
22599
|
-
let iframeVisibleViewPort;
|
|
22600
|
-
let iframeOffset;
|
|
22601
|
-
if (iframeScrolled < 0) {
|
|
22602
|
-
iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
|
|
22603
|
-
iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
|
|
22604
|
-
iframeOffset = 0;
|
|
22605
|
-
}
|
|
22606
|
-
else {
|
|
22607
|
-
iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
|
|
22608
|
-
iframeOffset = iframeScrolled;
|
|
22609
|
-
}
|
|
22610
|
-
const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
|
|
22611
|
-
return {
|
|
22612
|
-
iframeCenter,
|
|
22613
|
-
iframeScrolled,
|
|
22614
|
-
iframeHeight,
|
|
22615
|
-
viewPortHeight,
|
|
22616
|
-
iframeVisibleViewPort,
|
|
22617
|
-
};
|
|
22618
|
-
}
|
|
22619
23307
|
/**
|
|
22620
23308
|
* Registers an event listener to trigger an alert when the ThoughtSpot app
|
|
22621
23309
|
* sends an event of a particular message type to the host application.
|
|
@@ -22699,13 +23387,32 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22699
23387
|
var _a;
|
|
22700
23388
|
const embedObj = (_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
22701
23389
|
if (embedObj === this) {
|
|
22702
|
-
logger$3.
|
|
23390
|
+
logger$3.debug('embedObj is same as this');
|
|
22703
23391
|
}
|
|
22704
23392
|
return embedObj;
|
|
22705
23393
|
}
|
|
23394
|
+
takeOverPreRender() {
|
|
23395
|
+
if (!this.preRenderWrapper)
|
|
23396
|
+
return;
|
|
23397
|
+
this.preRenderWrapper[this.embedNodeKey] = this;
|
|
23398
|
+
}
|
|
23399
|
+
// The flag lives on the wrapper because it describes the iframe: an instance
|
|
23400
|
+
// hidden when the container announced itself would otherwise report false forever.
|
|
23401
|
+
markEmbedContainerLoaded() {
|
|
23402
|
+
this.isEmbedContainerLoaded = true;
|
|
23403
|
+
if (this.preRenderWrapper) {
|
|
23404
|
+
this.preRenderWrapper[this.embedContainerLoadedKey] = true;
|
|
23405
|
+
}
|
|
23406
|
+
}
|
|
22706
23407
|
checkEmbedContainerLoaded() {
|
|
23408
|
+
var _a;
|
|
22707
23409
|
if (this.isEmbedContainerLoaded)
|
|
22708
23410
|
return true;
|
|
23411
|
+
if ((_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedContainerLoadedKey]) {
|
|
23412
|
+
this.isEmbedContainerLoaded = true;
|
|
23413
|
+
return true;
|
|
23414
|
+
}
|
|
23415
|
+
// Older builds stamped the flag on the instance, not the wrapper.
|
|
22709
23416
|
const preRenderObj = this.getPreRenderObj();
|
|
22710
23417
|
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
22711
23418
|
this.isEmbedContainerLoaded = true;
|
|
@@ -22734,8 +23441,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22734
23441
|
}
|
|
22735
23442
|
/**
|
|
22736
23443
|
* Triggers an event to the embedded app
|
|
23444
|
+
*
|
|
23445
|
+
* Payload typing: from SDK 1.52.0 (ThoughtSpot Cloud 26.9.0.cl), unknown fields
|
|
23446
|
+
* on a known event's payload fail to compile. From SDK 1.54.0 (26.11.0.cl) the
|
|
23447
|
+
* payload is checked strictly against the event contract — update call sites now.
|
|
22737
23448
|
* @param {HostEvent} messageType The event type
|
|
22738
|
-
* @param {
|
|
23449
|
+
* @param {TriggerData} data The payload, typed against the event's contract
|
|
22739
23450
|
* @param {ContextType} context Optional context type to specify the context from which the event is triggered.
|
|
22740
23451
|
* Use ContextType.Search for search answer context, ContextType.Answer for answer/explore context,
|
|
22741
23452
|
* ContextType.Liveboard for liveboard context, or ContextType.Spotter for spotter context.
|
|
@@ -22752,7 +23463,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22752
23463
|
* ```
|
|
22753
23464
|
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl (for context parameter)
|
|
22754
23465
|
*/
|
|
22755
|
-
async trigger(messageType,
|
|
23466
|
+
async trigger(messageType,
|
|
23467
|
+
// Contract shape is the contextual type: payload fields autocomplete
|
|
23468
|
+
// and unknown fields on object literals are flagged. Strict checks
|
|
23469
|
+
// land in SDK 1.54.0 — see TriggerData.
|
|
23470
|
+
data = {}, context) {
|
|
22756
23471
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
22757
23472
|
if (!this.isRendered) {
|
|
22758
23473
|
this.handleError({
|
|
@@ -23040,20 +23755,27 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23040
23755
|
// have moved on to UpdateEmbedParams supported clusters
|
|
23041
23756
|
// this.validatePreRenderViewConfig(this.viewConfig); removed in #517
|
|
23042
23757
|
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
23043
|
-
|
|
23044
|
-
|
|
23045
|
-
|
|
23046
|
-
|
|
23047
|
-
|
|
23048
|
-
|
|
23049
|
-
|
|
23050
|
-
|
|
23051
|
-
|
|
23052
|
-
|
|
23053
|
-
|
|
23054
|
-
|
|
23055
|
-
|
|
23056
|
-
|
|
23758
|
+
// Created synchronously: a queued navigation needs something to await
|
|
23759
|
+
// whether the container is already loaded or not.
|
|
23760
|
+
this.preRenderParamsApplied = new Promise((resolve) => {
|
|
23761
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
23762
|
+
try {
|
|
23763
|
+
const params = await this.getUpdateEmbedParamsObject();
|
|
23764
|
+
this.trigger(exports.HostEvent.UpdateEmbedParams, params);
|
|
23765
|
+
}
|
|
23766
|
+
catch (error) {
|
|
23767
|
+
logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
|
|
23768
|
+
this.handleError({
|
|
23769
|
+
errorType: exports.ErrorDetailsTypes.API,
|
|
23770
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
|
|
23771
|
+
code: exports.EmbedErrorCodes.UPDATE_PARAMS_FAILED,
|
|
23772
|
+
error: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
23773
|
+
});
|
|
23774
|
+
}
|
|
23775
|
+
finally {
|
|
23776
|
+
setTimeout(resolve, UPDATE_EMBED_PARAMS_SETTLE_MS);
|
|
23777
|
+
}
|
|
23778
|
+
});
|
|
23057
23779
|
});
|
|
23058
23780
|
}
|
|
23059
23781
|
/**
|
|
@@ -23129,6 +23851,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23129
23851
|
if (this.iFrame) {
|
|
23130
23852
|
this.setupFullscreenChangeHandler();
|
|
23131
23853
|
}
|
|
23854
|
+
// Last, so everything above still sees the instance being taken over from.
|
|
23855
|
+
this.takeOverPreRender();
|
|
23132
23856
|
return this;
|
|
23133
23857
|
}
|
|
23134
23858
|
getPreRenderPlaceHolderElement() {
|
|
@@ -23331,6 +24055,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23331
24055
|
* ```
|
|
23332
24056
|
*/
|
|
23333
24057
|
on(messageType, callback, options = { start: false }) {
|
|
24058
|
+
// Mirror the base TsEmbed.on generic signature so the enriched
|
|
24059
|
+
// EmbedEventPayload (e.g. CustomAction's answerService) flows through
|
|
24060
|
+
// the override too, and the class hierarchy stays assignable.
|
|
23334
24061
|
const eventType = this.getCompatibleEventType(messageType);
|
|
23335
24062
|
return super.on(eventType, callback, options);
|
|
23336
24063
|
}
|
|
@@ -23571,73 +24298,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23571
24298
|
constructor(domSelector, viewConfig) {
|
|
23572
24299
|
viewConfig.embedComponentType = 'AppEmbed';
|
|
23573
24300
|
super(domSelector, viewConfig);
|
|
23574
|
-
this.defaultHeight = 500;
|
|
23575
|
-
this.lazyLoadScrollContainers = [];
|
|
23576
|
-
this.sendFullHeightLazyLoadData = () => {
|
|
23577
|
-
const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
23578
|
-
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
23579
|
-
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
23580
|
-
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
23581
|
-
}
|
|
23582
|
-
};
|
|
23583
|
-
/**
|
|
23584
|
-
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
23585
|
-
* It is used to send the visible coordinates data to the host application.
|
|
23586
|
-
* @param data The event payload
|
|
23587
|
-
* @param responder The responder function
|
|
23588
|
-
*/
|
|
23589
|
-
this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
|
|
23590
|
-
logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
23591
|
-
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
23592
|
-
responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
23593
|
-
};
|
|
23594
|
-
/**
|
|
23595
|
-
* Set the iframe height as per the computed height received
|
|
23596
|
-
* from the ThoughtSpot app.
|
|
23597
|
-
* @param data The event payload
|
|
23598
|
-
*/
|
|
23599
|
-
this.updateIFrameHeight = (data) => {
|
|
23600
|
-
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
23601
|
-
this.sendFullHeightLazyLoadData();
|
|
23602
|
-
};
|
|
23603
|
-
this.embedIframeCenter = (data, responder) => {
|
|
23604
|
-
const obj = this.getIframeCenter();
|
|
23605
|
-
responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
|
|
23606
|
-
};
|
|
23607
|
-
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
23608
|
-
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
23609
|
-
const liveboardRelatedRoutes = [
|
|
23610
|
-
'/pinboard/',
|
|
23611
|
-
'/insights/pinboard/',
|
|
23612
|
-
'/schedules/',
|
|
23613
|
-
'/embed/viz/',
|
|
23614
|
-
'/embed/insights/viz/',
|
|
23615
|
-
'/liveboard/',
|
|
23616
|
-
'/insights/liveboard/',
|
|
23617
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
23618
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
23619
|
-
];
|
|
23620
|
-
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
23621
|
-
// Ignore the height reset of the frame, if the navigation is
|
|
23622
|
-
// only within the liveboard page.
|
|
23623
|
-
return;
|
|
23624
|
-
}
|
|
23625
|
-
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
23626
|
-
};
|
|
23627
24301
|
if (this.viewConfig.fullHeight === true) {
|
|
23628
|
-
|
|
23629
|
-
this.
|
|
23630
|
-
|
|
23631
|
-
|
|
23632
|
-
|
|
23633
|
-
|
|
23634
|
-
|
|
23635
|
-
|
|
23636
|
-
|
|
23637
|
-
|
|
23638
|
-
this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
23639
|
-
this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
23640
|
-
this.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
|
|
24302
|
+
this.fullHeightController = new FullHeightController(this.viewConfig, {
|
|
24303
|
+
getIframe: () => this.iFrame,
|
|
24304
|
+
setFrameHeight: (height) => this.setIFrameHeight(height),
|
|
24305
|
+
on: (eventType, callback) => {
|
|
24306
|
+
this.on(eventType, callback);
|
|
24307
|
+
},
|
|
24308
|
+
trigger: (hostEvent, data) => {
|
|
24309
|
+
this.trigger(hostEvent, data);
|
|
24310
|
+
},
|
|
24311
|
+
});
|
|
23641
24312
|
}
|
|
23642
24313
|
}
|
|
23643
24314
|
/**
|
|
@@ -23668,7 +24339,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23668
24339
|
return getQueryParamString(params, true);
|
|
23669
24340
|
}
|
|
23670
24341
|
getEmbedParamsObject() {
|
|
23671
|
-
|
|
24342
|
+
var _a;
|
|
24343
|
+
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 = exports.DataPanelCustomColumnGroupsAccordionState.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;
|
|
23672
24344
|
let params = {};
|
|
23673
24345
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
23674
24346
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -23704,6 +24376,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23704
24376
|
if (!isUndefined$1(coverAndFilterOptionInPDF)) {
|
|
23705
24377
|
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
23706
24378
|
}
|
|
24379
|
+
if (!isUndefined$1(hideAnswerEditPanel)) {
|
|
24380
|
+
params[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
|
|
24381
|
+
}
|
|
23707
24382
|
params = this.getBaseQueryParams(params);
|
|
23708
24383
|
if (!isUndefined$1(updatedSpotterChatPrompt)) {
|
|
23709
24384
|
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
@@ -23750,15 +24425,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23750
24425
|
if (hideNotification) {
|
|
23751
24426
|
params[Param.HideNotification] = !!hideNotification;
|
|
23752
24427
|
}
|
|
23753
|
-
|
|
23754
|
-
params[Param.fullHeight] = true;
|
|
23755
|
-
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
23756
|
-
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
23757
|
-
if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
|
|
23758
|
-
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
23759
|
-
}
|
|
23760
|
-
}
|
|
23761
|
-
}
|
|
24428
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
|
|
23762
24429
|
if (tag) {
|
|
23763
24430
|
params[Param.Tag] = tag;
|
|
23764
24431
|
}
|
|
@@ -23825,7 +24492,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23825
24492
|
if (isContinuousLiveboardPDFEnabled !== undefined) {
|
|
23826
24493
|
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
23827
24494
|
}
|
|
23828
|
-
this.defaultHeight = minimumHeight || this.defaultHeight;
|
|
23829
24495
|
if (enableLiveboardDataCache !== undefined) {
|
|
23830
24496
|
params[Param.EnableLiveboardDataCache] = enableLiveboardDataCache;
|
|
23831
24497
|
}
|
|
@@ -23964,52 +24630,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23964
24630
|
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
23965
24631
|
*/
|
|
23966
24632
|
destroy() {
|
|
24633
|
+
var _a;
|
|
23967
24634
|
super.destroy();
|
|
23968
|
-
this.
|
|
24635
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
23969
24636
|
}
|
|
23970
24637
|
postRender() {
|
|
23971
|
-
this.registerLazyLoadEvents();
|
|
23972
|
-
}
|
|
23973
|
-
registerLazyLoadEvents() {
|
|
23974
|
-
if (!this.iFrame) {
|
|
23975
|
-
return;
|
|
23976
|
-
}
|
|
23977
|
-
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
23978
|
-
this.unregisterLazyLoadEvents();
|
|
23979
|
-
// TODO: Use passive: true, install modernizr to check for passive
|
|
23980
|
-
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
23981
|
-
window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
23982
|
-
if (!this.viewConfig.enableScrollableContainerLazyLoading) {
|
|
23983
|
-
return;
|
|
23984
|
-
}
|
|
23985
|
-
this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
|
|
23986
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
23987
|
-
scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
23988
|
-
});
|
|
23989
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
23990
|
-
const resizeTargets = new Set([
|
|
23991
|
-
this.iFrame.parentElement,
|
|
23992
|
-
...getEffectiveClippingAncestors(this.iFrame),
|
|
23993
|
-
].filter(Boolean));
|
|
23994
|
-
this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
|
|
23995
|
-
resizeTargets.forEach((resizeTarget) => {
|
|
23996
|
-
this.lazyLoadResizeObserver.observe(resizeTarget);
|
|
23997
|
-
});
|
|
23998
|
-
}
|
|
23999
|
-
}
|
|
24000
|
-
}
|
|
24001
|
-
unregisterLazyLoadEvents() {
|
|
24002
24638
|
var _a;
|
|
24003
|
-
|
|
24004
|
-
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24005
|
-
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24006
|
-
(_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
24007
|
-
this.lazyLoadResizeObserver = undefined;
|
|
24008
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24009
|
-
scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24010
|
-
});
|
|
24011
|
-
this.lazyLoadScrollContainers = [];
|
|
24012
|
-
}
|
|
24639
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
|
|
24013
24640
|
}
|
|
24014
24641
|
/**
|
|
24015
24642
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
@@ -24104,6 +24731,10 @@ query GetEurekaVizSnapshots(
|
|
|
24104
24731
|
* @summary Liveboard & visualization embed
|
|
24105
24732
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
24106
24733
|
*/
|
|
24734
|
+
// Home unmounts the liveboard container, which is how its state gets cleared. The
|
|
24735
|
+
// settle window gives the container time to do it before we ask for the liveboard back.
|
|
24736
|
+
const HOME_ROUTE = 'home';
|
|
24737
|
+
const HOME_SETTLE_MS = 200;
|
|
24107
24738
|
/**
|
|
24108
24739
|
* Embed a ThoughtSpot Liveboard or visualization. When rendered it already
|
|
24109
24740
|
* waits for the authentication to complete, so you need not wait for
|
|
@@ -24123,59 +24754,6 @@ query GetEurekaVizSnapshots(
|
|
|
24123
24754
|
constructor(domSelector, viewConfig) {
|
|
24124
24755
|
viewConfig.embedComponentType = 'LiveboardEmbed';
|
|
24125
24756
|
super(domSelector, viewConfig);
|
|
24126
|
-
this.defaultHeight = 500;
|
|
24127
|
-
this.lazyLoadScrollContainers = [];
|
|
24128
|
-
this.sendFullHeightLazyLoadData = () => {
|
|
24129
|
-
const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
24130
|
-
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
24131
|
-
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
24132
|
-
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
24133
|
-
}
|
|
24134
|
-
};
|
|
24135
|
-
/**
|
|
24136
|
-
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
24137
|
-
* It is used to send the visible coordinates data to the host application.
|
|
24138
|
-
* @param data The event payload
|
|
24139
|
-
* @param responder The responder function
|
|
24140
|
-
*/
|
|
24141
|
-
this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
|
|
24142
|
-
logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
24143
|
-
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
24144
|
-
responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
24145
|
-
};
|
|
24146
|
-
/**
|
|
24147
|
-
* Set the iframe height as per the computed height received
|
|
24148
|
-
* from the ThoughtSpot app.
|
|
24149
|
-
* @param data The event payload
|
|
24150
|
-
*/
|
|
24151
|
-
this.updateIFrameHeight = (data) => {
|
|
24152
|
-
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
24153
|
-
this.sendFullHeightLazyLoadData();
|
|
24154
|
-
};
|
|
24155
|
-
this.embedIframeCenter = (data, responder) => {
|
|
24156
|
-
const obj = this.getIframeCenter();
|
|
24157
|
-
responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
|
|
24158
|
-
};
|
|
24159
|
-
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
24160
|
-
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
24161
|
-
const liveboardRelatedRoutes = [
|
|
24162
|
-
'/pinboard/',
|
|
24163
|
-
'/insights/pinboard/',
|
|
24164
|
-
'/schedules/',
|
|
24165
|
-
'/embed/viz/',
|
|
24166
|
-
'/embed/insights/viz/',
|
|
24167
|
-
'/liveboard/',
|
|
24168
|
-
'/insights/liveboard/',
|
|
24169
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
24170
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
24171
|
-
];
|
|
24172
|
-
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
24173
|
-
// Ignore the height reset of the frame, if the navigation is
|
|
24174
|
-
// only within the liveboard page.
|
|
24175
|
-
return;
|
|
24176
|
-
}
|
|
24177
|
-
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
24178
|
-
};
|
|
24179
24757
|
/**
|
|
24180
24758
|
* @hidden
|
|
24181
24759
|
* Internal state to track the current liveboard id.
|
|
@@ -24189,22 +24767,19 @@ query GetEurekaVizSnapshots(
|
|
|
24189
24767
|
};
|
|
24190
24768
|
if (this.viewConfig.fullHeight === true) {
|
|
24191
24769
|
if (this.viewConfig.vizId) {
|
|
24192
|
-
logger$3.warn('Full height is currently only supported for Liveboard embeds.'
|
|
24193
|
-
'Using full height with vizId might lead to unexpected behavior.');
|
|
24194
|
-
}
|
|
24195
|
-
if (this.viewConfig.lazyLoadingForFullHeight === undefined) {
|
|
24196
|
-
this.viewConfig.lazyLoadingForFullHeight = true;
|
|
24197
|
-
}
|
|
24198
|
-
if (this.viewConfig.enableScrollableContainerLazyLoading === undefined) {
|
|
24199
|
-
this.viewConfig.enableScrollableContainerLazyLoading = true;
|
|
24200
|
-
}
|
|
24201
|
-
if (this.viewConfig.lazyLoadingMargin === undefined) {
|
|
24202
|
-
this.viewConfig.lazyLoadingMargin = DEFAULT_LAZY_LOADING_MARGIN;
|
|
24770
|
+
logger$3.warn('Full height is currently only supported for Liveboard embeds.'
|
|
24771
|
+
+ 'Using full height with vizId might lead to unexpected behavior.');
|
|
24203
24772
|
}
|
|
24204
|
-
this.
|
|
24205
|
-
|
|
24206
|
-
|
|
24207
|
-
|
|
24773
|
+
this.fullHeightController = new FullHeightController(this.viewConfig, {
|
|
24774
|
+
getIframe: () => this.iFrame,
|
|
24775
|
+
setFrameHeight: (height) => this.setIFrameHeight(height),
|
|
24776
|
+
on: (eventType, callback) => {
|
|
24777
|
+
this.on(eventType, callback);
|
|
24778
|
+
},
|
|
24779
|
+
trigger: (hostEvent, data) => {
|
|
24780
|
+
this.trigger(hostEvent, data);
|
|
24781
|
+
},
|
|
24782
|
+
});
|
|
24208
24783
|
}
|
|
24209
24784
|
}
|
|
24210
24785
|
async getAppInitData() {
|
|
@@ -24222,21 +24797,13 @@ query GetEurekaVizSnapshots(
|
|
|
24222
24797
|
return queryParams;
|
|
24223
24798
|
}
|
|
24224
24799
|
getEmbedParamsObject() {
|
|
24800
|
+
var _a;
|
|
24225
24801
|
let params = {};
|
|
24226
24802
|
params = this.getBaseQueryParams(params);
|
|
24227
|
-
const { enableVizTransformations,
|
|
24803
|
+
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;
|
|
24228
24804
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
24229
24805
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
24230
|
-
|
|
24231
|
-
params[Param.fullHeight] = true;
|
|
24232
|
-
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
24233
|
-
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
24234
|
-
if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
|
|
24235
|
-
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
24236
|
-
}
|
|
24237
|
-
}
|
|
24238
|
-
}
|
|
24239
|
-
this.defaultHeight = minimumHeight || defaultHeight || this.defaultHeight;
|
|
24806
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
|
|
24240
24807
|
if (enableVizTransformations !== undefined) {
|
|
24241
24808
|
params[Param.EnableVizTransformations] = enableVizTransformations.toString();
|
|
24242
24809
|
}
|
|
@@ -24463,19 +25030,45 @@ query GetEurekaVizSnapshots(
|
|
|
24463
25030
|
}
|
|
24464
25031
|
beforePrerenderVisible() {
|
|
24465
25032
|
super.beforePrerenderVisible();
|
|
24466
|
-
|
|
24467
|
-
|
|
24468
|
-
|
|
24469
|
-
|
|
24470
|
-
|
|
24471
|
-
|
|
24472
|
-
|
|
24473
|
-
|
|
24474
|
-
|
|
24475
|
-
|
|
25033
|
+
// Captured before showPreRender() hands the wrapper over to this instance.
|
|
25034
|
+
// Itself means a hide/show, not a hand-over, so there is nothing stale to clear.
|
|
25035
|
+
const previous = this.getPreRenderObj();
|
|
25036
|
+
const showing = previous === this ? undefined : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
|
|
25037
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
25038
|
+
// Without this the params callback suspends on its await and Navigate
|
|
25039
|
+
// goes out first, so the container loads with the previous config's filters.
|
|
25040
|
+
await this.preRenderParamsApplied;
|
|
25041
|
+
if (this.isShowingLiveboardRoute(showing)) {
|
|
25042
|
+
// Navigate to the route we are already on is a no-op, so the liveboard
|
|
25043
|
+
// keeps its state. Home unmounts the container, which clears it.
|
|
25044
|
+
this.trigger(exports.HostEvent.Navigate, HOME_ROUTE)
|
|
25045
|
+
.catch((error) => logger$3.warn('Could not route via home', error));
|
|
25046
|
+
// Not awaited above: the container never acks Navigate, so that promise
|
|
25047
|
+
// only settles on the 30s trigger timeout.
|
|
25048
|
+
await new Promise((resolve) => {
|
|
25049
|
+
setTimeout(resolve, HOME_SETTLE_MS);
|
|
25050
|
+
});
|
|
24476
25051
|
}
|
|
25052
|
+
this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId, this.viewConfig.personalizedViewId);
|
|
25053
|
+
this.currentLiveboardState = {
|
|
25054
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
25055
|
+
vizId: this.viewConfig.vizId,
|
|
25056
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
25057
|
+
personalizedViewId: this.viewConfig.personalizedViewId,
|
|
25058
|
+
};
|
|
24477
25059
|
});
|
|
24478
25060
|
}
|
|
25061
|
+
// The whole route, not just the liveboard id: the path is built from the viz, tab
|
|
25062
|
+
// and view too, so a same-liveboard show onto another tab is a real navigation.
|
|
25063
|
+
isShowingLiveboardRoute(showing) {
|
|
25064
|
+
if (!(showing === null || showing === void 0 ? void 0 : showing.liveboardId))
|
|
25065
|
+
return false;
|
|
25066
|
+
const { liveboardId, vizId, activeTabId, personalizedViewId, } = this.viewConfig;
|
|
25067
|
+
return showing.liveboardId === liveboardId
|
|
25068
|
+
&& showing.vizId === vizId
|
|
25069
|
+
&& showing.activeTabId === activeTabId
|
|
25070
|
+
&& showing.personalizedViewId === personalizedViewId;
|
|
25071
|
+
}
|
|
24479
25072
|
async handleRenderForPrerender() {
|
|
24480
25073
|
if (isUndefined$1(this.viewConfig.liveboardId)) {
|
|
24481
25074
|
return this.prerenderGeneric();
|
|
@@ -24484,11 +25077,16 @@ query GetEurekaVizSnapshots(
|
|
|
24484
25077
|
}
|
|
24485
25078
|
/**
|
|
24486
25079
|
* Triggers an event to the embedded app
|
|
25080
|
+
* Payload typing follows {@link TsEmbed.trigger}: unknown fields fail to compile
|
|
25081
|
+
* from SDK 1.52.0; strict contract checks land in SDK 1.54.0.
|
|
24487
25082
|
* @param {HostEvent} messageType The event type
|
|
24488
|
-
* @param {
|
|
25083
|
+
* @param {TriggerData} data The payload, typed against the event's contract
|
|
24489
25084
|
* @returns A promise that resolves with the response from the embedded app
|
|
24490
25085
|
*/
|
|
24491
|
-
trigger(messageType,
|
|
25086
|
+
trigger(messageType,
|
|
25087
|
+
// Mirror TsEmbed.trigger: contract shape is the contextual type and
|
|
25088
|
+
// unknown fields on object literals are flagged. Strict in SDK 1.54.0.
|
|
25089
|
+
data = {}, context) {
|
|
24492
25090
|
const dataWithVizId = data;
|
|
24493
25091
|
if (messageType === exports.HostEvent.SetActiveTab) {
|
|
24494
25092
|
this.setActiveTab(data);
|
|
@@ -24504,52 +25102,13 @@ query GetEurekaVizSnapshots(
|
|
|
24504
25102
|
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
24505
25103
|
*/
|
|
24506
25104
|
destroy() {
|
|
25105
|
+
var _a;
|
|
24507
25106
|
super.destroy();
|
|
24508
|
-
this.
|
|
25107
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
24509
25108
|
}
|
|
24510
25109
|
postRender() {
|
|
24511
|
-
this.registerLazyLoadEvents();
|
|
24512
|
-
}
|
|
24513
|
-
registerLazyLoadEvents() {
|
|
24514
|
-
if (!this.iFrame) {
|
|
24515
|
-
return;
|
|
24516
|
-
}
|
|
24517
|
-
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
24518
|
-
this.unregisterLazyLoadEvents();
|
|
24519
|
-
// TODO: Use passive: true, install modernizr to check for passive
|
|
24520
|
-
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24521
|
-
window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24522
|
-
if (!this.viewConfig.enableScrollableContainerLazyLoading) {
|
|
24523
|
-
return;
|
|
24524
|
-
}
|
|
24525
|
-
this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
|
|
24526
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24527
|
-
scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24528
|
-
});
|
|
24529
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
24530
|
-
const resizeTargets = new Set([
|
|
24531
|
-
this.iFrame.parentElement,
|
|
24532
|
-
...getEffectiveClippingAncestors(this.iFrame),
|
|
24533
|
-
].filter(Boolean));
|
|
24534
|
-
this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
|
|
24535
|
-
resizeTargets.forEach((resizeTarget) => {
|
|
24536
|
-
this.lazyLoadResizeObserver.observe(resizeTarget);
|
|
24537
|
-
});
|
|
24538
|
-
}
|
|
24539
|
-
}
|
|
24540
|
-
}
|
|
24541
|
-
unregisterLazyLoadEvents() {
|
|
24542
25110
|
var _a;
|
|
24543
|
-
|
|
24544
|
-
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24545
|
-
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24546
|
-
(_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
24547
|
-
this.lazyLoadResizeObserver = undefined;
|
|
24548
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24549
|
-
scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24550
|
-
});
|
|
24551
|
-
this.lazyLoadScrollContainers = [];
|
|
24552
|
-
}
|
|
25111
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
|
|
24553
25112
|
}
|
|
24554
25113
|
/**
|
|
24555
25114
|
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
@@ -24694,7 +25253,7 @@ query GetEurekaVizSnapshots(
|
|
|
24694
25253
|
}
|
|
24695
25254
|
getEmbedParamsObject() {
|
|
24696
25255
|
var _a;
|
|
24697
|
-
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;
|
|
25256
|
+
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;
|
|
24698
25257
|
const queryParams = this.getBaseQueryParams();
|
|
24699
25258
|
queryParams[Param.HideActions] = [
|
|
24700
25259
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -24717,6 +25276,9 @@ query GetEurekaVizSnapshots(
|
|
|
24717
25276
|
if (enableSearchAssist) {
|
|
24718
25277
|
queryParams[Param.EnableSearchAssist] = true;
|
|
24719
25278
|
}
|
|
25279
|
+
if (hideAnswerEditPanel !== undefined) {
|
|
25280
|
+
queryParams[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
|
|
25281
|
+
}
|
|
24720
25282
|
if (hideResults) {
|
|
24721
25283
|
queryParams[Param.HideResult] = true;
|
|
24722
25284
|
}
|