@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-react.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, require('react')) :
|
|
@@ -1065,6 +1065,9 @@
|
|
|
1065
1065
|
EmbedEvent["Download"] = "download";
|
|
1066
1066
|
/**
|
|
1067
1067
|
* Emitted when the download action is triggered on an Answer.
|
|
1068
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
1069
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
1070
|
+
* accepts the union now; per-context enforced next release.
|
|
1068
1071
|
* Use start:true to subscribe to when download is initiated, or end:true to
|
|
1069
1072
|
* subscribe to when download is completed. Default is end:true.
|
|
1070
1073
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
|
|
@@ -1081,6 +1084,9 @@
|
|
|
1081
1084
|
EmbedEvent["DownloadAsPng"] = "downloadAsPng";
|
|
1082
1085
|
/**
|
|
1083
1086
|
* Emitted when the Download as PDF action is triggered on an Answer
|
|
1087
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer; plus
|
|
1088
|
+
* liveboardId on Liveboard), {@link RequiredVizRequest} (Spotter). trigger()
|
|
1089
|
+
* accepts the union now; per-context enforced next release.
|
|
1084
1090
|
* Use start:true to subscribe to when download as PDF is initiated, or end:true to
|
|
1085
1091
|
* subscribe to when download as PDF is completed. Default is end:true.
|
|
1086
1092
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -1097,6 +1103,9 @@
|
|
|
1097
1103
|
EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
1098
1104
|
/**
|
|
1099
1105
|
* Emitted when the Download as CSV action is triggered on an Answer.
|
|
1106
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
1107
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
1108
|
+
* accepts the union now; per-context enforced next release.
|
|
1100
1109
|
* Use start:true to subscribe to when download as CSV is initiated, or end:true to
|
|
1101
1110
|
* subscribe to when download as CSV is completed. Default is end:true.
|
|
1102
1111
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -1113,6 +1122,9 @@
|
|
|
1113
1122
|
EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
|
|
1114
1123
|
/**
|
|
1115
1124
|
* Emitted when the Download as XLSX action is triggered on an Answer.
|
|
1125
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
1126
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
1127
|
+
* accepts the union now; per-context enforced next release.
|
|
1116
1128
|
* Use start:true to subscribe to when download as XLSX is initiated, or end:true to
|
|
1117
1129
|
* subscribe to when download as XLSX is completed. Default is end:true.
|
|
1118
1130
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -1391,6 +1403,9 @@
|
|
|
1391
1403
|
EmbedEvent["Schedule"] = "subscription";
|
|
1392
1404
|
/**
|
|
1393
1405
|
* Emitted when a user clicks **Edit** on a Liveboard or visualization
|
|
1406
|
+
* Payload varies by context: {@link VizScopedRequest} (Liveboard),
|
|
1407
|
+
* {@link RequiredVizRequest} (Spotter, vizId required). trigger() accepts the
|
|
1408
|
+
* union now; per-context enforced next release.
|
|
1394
1409
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1395
1410
|
* @example
|
|
1396
1411
|
* ```js
|
|
@@ -2470,6 +2485,7 @@
|
|
|
2470
2485
|
* the search query string.
|
|
2471
2486
|
* Supported in `AppEmbed` and `SearchEmbed` deployments.
|
|
2472
2487
|
* Includes the following properties:
|
|
2488
|
+
* Payload: {@link SearchRequest}.
|
|
2473
2489
|
* @param - Includes the following keys:
|
|
2474
2490
|
* - `searchQuery`: Query string with search tokens.
|
|
2475
2491
|
* - `dataSources`: Data source GUID to search on.
|
|
@@ -2497,6 +2513,9 @@
|
|
|
2497
2513
|
HostEvent["Search"] = "search";
|
|
2498
2514
|
/**
|
|
2499
2515
|
* Triggers a drill on certain points of the specified column
|
|
2516
|
+
* Payload: {@link DrillDownRequest}; in Liveboard context vizId is required
|
|
2517
|
+
* ({@link RequiredVizRequest}). trigger() accepts the union now; per-context
|
|
2518
|
+
* enforced next release.
|
|
2500
2519
|
* Includes the following properties:
|
|
2501
2520
|
* @param - Includes the following keys:
|
|
2502
2521
|
* - `points`: An object containing `selectedPoints` and/or `clickedPoint`
|
|
@@ -2576,6 +2595,8 @@
|
|
|
2576
2595
|
HostEvent["Reload"] = "reload";
|
|
2577
2596
|
/**
|
|
2578
2597
|
* Get iframe URL for the current embed view.
|
|
2598
|
+
* Payload: none.
|
|
2599
|
+
* Response: {@link GetIframeUrlResponse}.
|
|
2579
2600
|
* @example
|
|
2580
2601
|
* ```js
|
|
2581
2602
|
* const url = embed.trigger(HostEvent.GetIframeUrl);
|
|
@@ -2594,6 +2615,7 @@
|
|
|
2594
2615
|
HostEvent["GetIframeUrl"] = "GetIframeUrl";
|
|
2595
2616
|
/**
|
|
2596
2617
|
* Display specific visualizations on a Liveboard.
|
|
2618
|
+
* Payload: `string[]`.
|
|
2597
2619
|
* @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
|
|
2598
2620
|
* in this parameter will be hidden.
|
|
2599
2621
|
* @example
|
|
@@ -2616,6 +2638,7 @@
|
|
|
2616
2638
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
2617
2639
|
/**
|
|
2618
2640
|
* Set a Liveboard tab as an active tab.
|
|
2641
|
+
* Payload: {@link SetActiveTabRequest}.
|
|
2619
2642
|
* @param - tabId - string of id of Tab to show
|
|
2620
2643
|
* @example
|
|
2621
2644
|
* ```js
|
|
@@ -2643,6 +2666,7 @@
|
|
|
2643
2666
|
* and `AppEmbed` only. In full application embedding, this event updates
|
|
2644
2667
|
* the runtime filters applied on the Liveboard and saved Answer objects.
|
|
2645
2668
|
*
|
|
2669
|
+
* Payload: {@link RuntimeFilter}[].
|
|
2646
2670
|
* @param - Array of {@link RuntimeFilter} objects. Each item includes:
|
|
2647
2671
|
* - `columnName`: Name of the column to filter on.
|
|
2648
2672
|
* - `operator`: {@link RuntimeFilterOp} to apply. For more information, see
|
|
@@ -2684,6 +2708,7 @@
|
|
|
2684
2708
|
* Accepts either a plain value or an object with `path`
|
|
2685
2709
|
* and an optional `replace` flag.
|
|
2686
2710
|
*
|
|
2711
|
+
* Payload: `string` | `number` | {@link NavigateRequest}.
|
|
2687
2712
|
* @param data - A string path, a numeric history delta, or an object
|
|
2688
2713
|
* `{ path: string | number, replace?: boolean }`.
|
|
2689
2714
|
* - `path` — the route to navigate to, or a history delta such as `1`
|
|
@@ -2711,6 +2736,9 @@
|
|
|
2711
2736
|
/**
|
|
2712
2737
|
* Open the filter panel for a particular column.
|
|
2713
2738
|
* Works with Search and Liveboard embed.
|
|
2739
|
+
* Payload: {@link OpenFilterRequest} (the cross-context superset). The
|
|
2740
|
+
* accepted fields vary by context: {@link OpenFilterLiveboardRequest},
|
|
2741
|
+
* {@link OpenFilterSpotterRequest}, {@link OpenFilterSearchRequest}.
|
|
2714
2742
|
* @param - { columnId: string,
|
|
2715
2743
|
* name: string,
|
|
2716
2744
|
* type: ATTRIBUTE/MEASURE,
|
|
@@ -2793,6 +2821,7 @@
|
|
|
2793
2821
|
/**
|
|
2794
2822
|
* Open the parameter panel for a particular parameter on a Liveboard.
|
|
2795
2823
|
* Mirrors {@link HostEvent.OpenFilter} for parameters.
|
|
2824
|
+
* Payload: {@link OpenParameterRequest}.
|
|
2796
2825
|
* @param - Includes the following keys:
|
|
2797
2826
|
* - `parameter`: An object identifying the parameter to open, for
|
|
2798
2827
|
* example, `{ parameterId: '<parameter-GUID>' }`.
|
|
@@ -2824,6 +2853,7 @@
|
|
|
2824
2853
|
HostEvent["OpenParameter"] = "openParameter";
|
|
2825
2854
|
/**
|
|
2826
2855
|
* Add columns to the current search query.
|
|
2856
|
+
* Payload: `{ columnIds: string[] }`.
|
|
2827
2857
|
* @param - { columnIds: string[] }
|
|
2828
2858
|
* @example
|
|
2829
2859
|
* ```js
|
|
@@ -2842,6 +2872,7 @@
|
|
|
2842
2872
|
HostEvent["AddColumns"] = "addColumns";
|
|
2843
2873
|
/**
|
|
2844
2874
|
* Remove a column from the current search query.
|
|
2875
|
+
* Payload: `{ columnId: string }`.
|
|
2845
2876
|
* @param - { columnId: string }
|
|
2846
2877
|
* @example
|
|
2847
2878
|
* ```js
|
|
@@ -2866,6 +2897,8 @@
|
|
|
2866
2897
|
* sorting, toggling of legends, and data drill down.
|
|
2867
2898
|
* For more information, see
|
|
2868
2899
|
* link:https://developers.thoughtspot.com/docs/fetch-data-and-report-apis#transient-lb-content[Liveboard data with unsaved changes].
|
|
2900
|
+
* Payload: none.
|
|
2901
|
+
* Response: {@link GetExportRequestForCurrentPinboardResponse}.
|
|
2869
2902
|
* @example
|
|
2870
2903
|
* ```js
|
|
2871
2904
|
* liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard).then(
|
|
@@ -2887,6 +2920,8 @@
|
|
|
2887
2920
|
* requiring additional user input via the *Pin to Liveboard* modal, define
|
|
2888
2921
|
* the following parameters:
|
|
2889
2922
|
*
|
|
2923
|
+
* Payload: {@link PinAnswerToLiveboardRequest}.
|
|
2924
|
+
* Response: {@link PinAnswerToLiveboardResponse}.
|
|
2890
2925
|
* @param - Includes the following keys:
|
|
2891
2926
|
* - `vizId`: GUID of the saved Answer or Spotter visualization ID to pin to a
|
|
2892
2927
|
* Liveboard.
|
|
@@ -3001,6 +3036,7 @@
|
|
|
3001
3036
|
HostEvent["LiveboardInfo"] = "pinboardInfo";
|
|
3002
3037
|
/**
|
|
3003
3038
|
* Trigger the **Schedule** action on an embedded Liveboard.
|
|
3039
|
+
* Payload: {@link VizScopedRequest}.
|
|
3004
3040
|
* @example
|
|
3005
3041
|
* ```js
|
|
3006
3042
|
* liveboardEmbed.trigger(HostEvent.Schedule)
|
|
@@ -3016,6 +3052,7 @@
|
|
|
3016
3052
|
HostEvent["Schedule"] = "subscription";
|
|
3017
3053
|
/**
|
|
3018
3054
|
* Trigger the **Manage schedule** action on an embedded Liveboard
|
|
3055
|
+
* Payload: {@link VizScopedRequest}.
|
|
3019
3056
|
* @example
|
|
3020
3057
|
* ```js
|
|
3021
3058
|
* liveboardEmbed.trigger(HostEvent.SchedulesList)
|
|
@@ -3032,6 +3069,7 @@
|
|
|
3032
3069
|
/**
|
|
3033
3070
|
* Trigger the **Export TML** action on an embedded Liveboard or
|
|
3034
3071
|
* Answer.
|
|
3072
|
+
* Payload: {@link VizScopedRequest}.
|
|
3035
3073
|
* @example
|
|
3036
3074
|
* ```js
|
|
3037
3075
|
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
@@ -3054,6 +3092,7 @@
|
|
|
3054
3092
|
/**
|
|
3055
3093
|
* Trigger the **Edit TML** action on an embedded Liveboard or
|
|
3056
3094
|
* saved Answers in the full application embedding.
|
|
3095
|
+
* Payload: {@link VizScopedRequest}.
|
|
3057
3096
|
* @example
|
|
3058
3097
|
* ```js
|
|
3059
3098
|
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
@@ -3075,6 +3114,7 @@
|
|
|
3075
3114
|
HostEvent["EditTML"] = "editTSL";
|
|
3076
3115
|
/**
|
|
3077
3116
|
* Trigger the **Update TML** action on an embedded Liveboard.
|
|
3117
|
+
* Payload: {@link VizScopedRequest}.
|
|
3078
3118
|
* @example
|
|
3079
3119
|
* ```js
|
|
3080
3120
|
* liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
@@ -3092,6 +3132,7 @@
|
|
|
3092
3132
|
* Trigger the **Download PDF** action on an embedded Liveboard,
|
|
3093
3133
|
* visualization or Answer.
|
|
3094
3134
|
*
|
|
3135
|
+
* Payload: {@link VizScopedRequest} plus optional `liveboardId`.
|
|
3095
3136
|
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
3096
3137
|
*
|
|
3097
3138
|
* **NOTE**: The **Download** > **PDF** action is available on
|
|
@@ -3142,6 +3183,7 @@
|
|
|
3142
3183
|
/**
|
|
3143
3184
|
* Trigger the **AI Highlights** action on an embedded Liveboard
|
|
3144
3185
|
*
|
|
3186
|
+
* Payload: none.
|
|
3145
3187
|
* @example
|
|
3146
3188
|
* ```js
|
|
3147
3189
|
* liveboardEmbed.trigger(HostEvent.AIHighlights)
|
|
@@ -3196,6 +3238,9 @@
|
|
|
3196
3238
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
3197
3239
|
/**
|
|
3198
3240
|
* Trigger the **Delete** action for a Liveboard.
|
|
3241
|
+
* Payload varies by context: {@link RequiredVizRequest} (Liveboard, vizId
|
|
3242
|
+
* required), {@link VizScopedRequest} (Search). trigger() accepts the union
|
|
3243
|
+
* now; per-context enforced next release.
|
|
3199
3244
|
* @example
|
|
3200
3245
|
* ```js
|
|
3201
3246
|
* appEmbed.trigger(HostEvent.Remove)
|
|
@@ -3210,6 +3255,7 @@
|
|
|
3210
3255
|
HostEvent["Remove"] = "delete";
|
|
3211
3256
|
/**
|
|
3212
3257
|
* Trigger the **Explore** action on a visualization.
|
|
3258
|
+
* Payload: {@link RequiredVizRequest}.
|
|
3213
3259
|
* @param - an object with `vizId` as a key
|
|
3214
3260
|
* @example
|
|
3215
3261
|
* ```js
|
|
@@ -3229,6 +3275,7 @@
|
|
|
3229
3275
|
/**
|
|
3230
3276
|
* Trigger the **Create alert** action on a KPI chart
|
|
3231
3277
|
* in a Liveboard or saved Answer.
|
|
3278
|
+
* Payload: {@link VizScopedRequest}.
|
|
3232
3279
|
* @param - an object with `vizId` as a key
|
|
3233
3280
|
* @example
|
|
3234
3281
|
* ```js
|
|
@@ -3260,6 +3307,7 @@
|
|
|
3260
3307
|
/**
|
|
3261
3308
|
* Trigger the **Manage alerts** action on a KPI chart
|
|
3262
3309
|
* in a visualization or saved Answer.
|
|
3310
|
+
* Payload: {@link VizScopedRequest}.
|
|
3263
3311
|
* @param - an object with `vizId` as a key
|
|
3264
3312
|
* @example
|
|
3265
3313
|
* ```js
|
|
@@ -3297,6 +3345,7 @@
|
|
|
3297
3345
|
* on a Liveboard.
|
|
3298
3346
|
*
|
|
3299
3347
|
* This event is not supported in visualization embed and search embed.
|
|
3348
|
+
* Payload: {@link VizScopedRequest}.
|
|
3300
3349
|
* @param - Object parameter. Includes the following keys:
|
|
3301
3350
|
* - `vizId`: To trigger the action for a specific visualization in Liveboard embed,
|
|
3302
3351
|
* pass in `vizId` as a key. In Spotter embed, `vizId` refers to the Answer ID and
|
|
@@ -3339,6 +3388,7 @@
|
|
|
3339
3388
|
HostEvent["Edit"] = "edit";
|
|
3340
3389
|
/**
|
|
3341
3390
|
* Trigger the **Copy link** action on a Liveboard or visualization
|
|
3391
|
+
* Payload: {@link VizScopedRequest}.
|
|
3342
3392
|
* @param - object - to trigger the action for a
|
|
3343
3393
|
* specific visualization in Liveboard embed, pass in `vizId` as a key
|
|
3344
3394
|
* @example
|
|
@@ -3384,6 +3434,7 @@
|
|
|
3384
3434
|
HostEvent["CopyLink"] = "embedDocument";
|
|
3385
3435
|
/**
|
|
3386
3436
|
* Trigger the **Present** action on a Liveboard or visualization
|
|
3437
|
+
* Payload: {@link VizScopedRequest}.
|
|
3387
3438
|
* @param - object - to trigger the action for a specific visualization
|
|
3388
3439
|
* in Liveboard embed, pass in `vizId` as a key
|
|
3389
3440
|
* @example
|
|
@@ -3429,6 +3480,8 @@
|
|
|
3429
3480
|
HostEvent["Present"] = "present";
|
|
3430
3481
|
/**
|
|
3431
3482
|
* Get TML for the current search.
|
|
3483
|
+
* Payload: {@link GetTMLRequest}.
|
|
3484
|
+
* Response: `Record<string, any>`.
|
|
3432
3485
|
* @example
|
|
3433
3486
|
* ```js
|
|
3434
3487
|
* searchEmbed.trigger(HostEvent.GetTML).then((tml) => {
|
|
@@ -3478,6 +3531,7 @@
|
|
|
3478
3531
|
* Trigger the **Show underlying data** action on a
|
|
3479
3532
|
* chart or table.
|
|
3480
3533
|
*
|
|
3534
|
+
* Payload: {@link VizScopedRequest}.
|
|
3481
3535
|
* @param - an object with vizId as a key
|
|
3482
3536
|
* @example
|
|
3483
3537
|
* ```js
|
|
@@ -3511,6 +3565,7 @@
|
|
|
3511
3565
|
* Trigger the **Delete** action for a visualization
|
|
3512
3566
|
* in an embedded Liveboard, or a chart or table
|
|
3513
3567
|
* generated from Search.
|
|
3568
|
+
* Payload: {@link VizScopedRequest}.
|
|
3514
3569
|
* @param - Liveboard embed takes an object with `vizId` as a key.
|
|
3515
3570
|
* Can be left empty if embedding Search or visualization.
|
|
3516
3571
|
* @example
|
|
@@ -3539,6 +3594,7 @@
|
|
|
3539
3594
|
/**
|
|
3540
3595
|
* Trigger the **SpotIQ analyze** action on a
|
|
3541
3596
|
* chart or table.
|
|
3597
|
+
* Payload: {@link VizScopedRequest}.
|
|
3542
3598
|
* @param - Liveboard embed takes `vizId` as a
|
|
3543
3599
|
* key. Can be left undefined when embedding Search or
|
|
3544
3600
|
* visualization.
|
|
@@ -3601,6 +3657,7 @@
|
|
|
3601
3657
|
/**
|
|
3602
3658
|
* Trigger the **Download** > **PNG** action on
|
|
3603
3659
|
* charts in the embedded view.
|
|
3660
|
+
* Payload: {@link VizScopedRequest}.
|
|
3604
3661
|
* @example
|
|
3605
3662
|
* ```js
|
|
3606
3663
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPng,
|
|
@@ -3632,6 +3689,7 @@
|
|
|
3632
3689
|
/**
|
|
3633
3690
|
* Trigger the **Download** > **CSV** action on tables in
|
|
3634
3691
|
* the embedded view.
|
|
3692
|
+
* Payload: {@link VizScopedRequest}.
|
|
3635
3693
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
3636
3694
|
* @example
|
|
3637
3695
|
* ```js
|
|
@@ -3671,6 +3729,7 @@
|
|
|
3671
3729
|
/**
|
|
3672
3730
|
* Trigger the **Download** > **XLSX** action on tables
|
|
3673
3731
|
* in the embedded view.
|
|
3732
|
+
* Payload: {@link VizScopedRequest}.
|
|
3674
3733
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
3675
3734
|
* @example
|
|
3676
3735
|
* ```js
|
|
@@ -3710,6 +3769,7 @@
|
|
|
3710
3769
|
/**
|
|
3711
3770
|
* Trigger the **Share** action on an embedded
|
|
3712
3771
|
* Liveboard or Answer.
|
|
3772
|
+
* Payload: {@link VizScopedRequest}.
|
|
3713
3773
|
* @example
|
|
3714
3774
|
* ```js
|
|
3715
3775
|
* liveboardEmbed.trigger(HostEvent.Share)
|
|
@@ -3736,6 +3796,7 @@
|
|
|
3736
3796
|
* Trigger the **Save** action on a Liveboard, Answer, or Spotter.
|
|
3737
3797
|
* Saves the changes.
|
|
3738
3798
|
*
|
|
3799
|
+
* Payload: {@link VizScopedRequest}.
|
|
3739
3800
|
* @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
|
|
3740
3801
|
* It is required and can be retrieved from the data embed event.
|
|
3741
3802
|
*
|
|
@@ -3787,6 +3848,7 @@
|
|
|
3787
3848
|
/**
|
|
3788
3849
|
* Trigger the **Sync to Sheets** action on an embedded visualization or Answer
|
|
3789
3850
|
* Sends data from an Answer or Liveboard visualization to a Google sheet.
|
|
3851
|
+
* Payload: {@link VizScopedRequest}.
|
|
3790
3852
|
* @param - an object with `vizId` as a key
|
|
3791
3853
|
* @example
|
|
3792
3854
|
* ```js
|
|
@@ -3817,6 +3879,7 @@
|
|
|
3817
3879
|
* Trigger the **Sync to Other Apps** action on an embedded visualization or Answer
|
|
3818
3880
|
* Sends data from an Answer or Liveboard visualization to third-party apps such
|
|
3819
3881
|
* as Slack, Salesforce, Microsoft Teams, ServiceNow and so on.
|
|
3882
|
+
* Payload: {@link VizScopedRequest}.
|
|
3820
3883
|
* @param - an object with vizId as a key
|
|
3821
3884
|
* @example
|
|
3822
3885
|
* ```js
|
|
@@ -3847,6 +3910,7 @@
|
|
|
3847
3910
|
* Trigger the **Manage pipelines** action on an embedded
|
|
3848
3911
|
* visualization or Answer.
|
|
3849
3912
|
* Allows users to manage ThoughtSpot Sync pipelines.
|
|
3913
|
+
* Payload: {@link VizScopedRequest}.
|
|
3850
3914
|
* @param - an object with `vizId` as a key
|
|
3851
3915
|
* @example
|
|
3852
3916
|
* ```js
|
|
@@ -3875,6 +3939,7 @@
|
|
|
3875
3939
|
HostEvent["ManagePipelines"] = "manage-pipeline";
|
|
3876
3940
|
/**
|
|
3877
3941
|
* Reset search operation on the Search or Answer page.
|
|
3942
|
+
* Payload: none.
|
|
3878
3943
|
* @example
|
|
3879
3944
|
* ```js
|
|
3880
3945
|
* searchEmbed.trigger(HostEvent.ResetSearch)
|
|
@@ -3902,6 +3967,8 @@
|
|
|
3902
3967
|
* whole Liveboard.
|
|
3903
3968
|
* The `applicability` attribute is available from SDK: 1.53.0 |
|
|
3904
3969
|
* ThoughtSpot: 26.10.0.cl.
|
|
3970
|
+
* Payload: {@link GetFiltersRequest}.
|
|
3971
|
+
* Response: {@link GetFiltersResponse}.
|
|
3905
3972
|
* @example
|
|
3906
3973
|
* ```js
|
|
3907
3974
|
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
|
|
@@ -3921,6 +3988,7 @@
|
|
|
3921
3988
|
HostEvent["GetFilters"] = "getFilters";
|
|
3922
3989
|
/**
|
|
3923
3990
|
* Update one or several filters applied on a Liveboard.
|
|
3991
|
+
* Payload: {@link UpdateFiltersRequest}.
|
|
3924
3992
|
* @param - Includes the following keys:
|
|
3925
3993
|
* - `filter`: A single filter object containing column name, filter operator, and
|
|
3926
3994
|
* values.
|
|
@@ -4049,6 +4117,8 @@
|
|
|
4049
4117
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
4050
4118
|
/**
|
|
4051
4119
|
* Get tab details for the current Liveboard.
|
|
4120
|
+
* Payload: none.
|
|
4121
|
+
* Response: {@link GetTabsResponse}.
|
|
4052
4122
|
* @example
|
|
4053
4123
|
* ```js
|
|
4054
4124
|
* liveboardEmbed.trigger(HostEvent.GetTabs).then((tabDetails) => {
|
|
@@ -4074,6 +4144,8 @@
|
|
|
4074
4144
|
/**
|
|
4075
4145
|
* Get group details for the current Liveboard.
|
|
4076
4146
|
* Mirrors {@link HostEvent.GetTabs} for filter/parameter groups.
|
|
4147
|
+
* Payload: none.
|
|
4148
|
+
* Response: {@link GetGroupsResponse}.
|
|
4077
4149
|
* @example
|
|
4078
4150
|
* ```js
|
|
4079
4151
|
* liveboardEmbed.trigger(HostEvent.GetGroups).then((groupDetails) => {
|
|
@@ -4098,6 +4170,7 @@
|
|
|
4098
4170
|
HostEvent["GetGroups"] = "getGroups";
|
|
4099
4171
|
/**
|
|
4100
4172
|
* Set the visible tabs on a Liveboard.
|
|
4173
|
+
* Payload: `string[]`.
|
|
4101
4174
|
* @param - an array of ids of tabs to show, the IDs not passed
|
|
4102
4175
|
* will be hidden.
|
|
4103
4176
|
* @example
|
|
@@ -4120,6 +4193,7 @@
|
|
|
4120
4193
|
HostEvent["SetVisibleTabs"] = "SetPinboardVisibleTabs";
|
|
4121
4194
|
/**
|
|
4122
4195
|
* Set the hidden tabs on a Liveboard.
|
|
4196
|
+
* Payload: `string[]`.
|
|
4123
4197
|
* @param - an array of the IDs of the tabs to hide.
|
|
4124
4198
|
* The IDs not passed will be shown.
|
|
4125
4199
|
* @example
|
|
@@ -4148,6 +4222,8 @@
|
|
|
4148
4222
|
* `getAnswerService()` method on the embed instance to get an AnswerService
|
|
4149
4223
|
* object that provides a more convenient interface for working with answers.
|
|
4150
4224
|
*
|
|
4225
|
+
* Payload: {@link GetAnswerSessionRequest}.
|
|
4226
|
+
* Response: {@link GetAnswerSessionResponse}.
|
|
4151
4227
|
* @example
|
|
4152
4228
|
* ```js
|
|
4153
4229
|
* // Preferred way to get an AnswerService
|
|
@@ -4175,6 +4251,7 @@
|
|
|
4175
4251
|
HostEvent["GetAnswerSession"] = "getAnswerSession";
|
|
4176
4252
|
/**
|
|
4177
4253
|
* Trigger the *Ask Sage* action for visualizations
|
|
4254
|
+
* Payload: {@link RequiredVizRequest}.
|
|
4178
4255
|
* @example
|
|
4179
4256
|
* ```js
|
|
4180
4257
|
* liveboardEmbed.trigger(HostEvent.AskSage,
|
|
@@ -4186,6 +4263,7 @@
|
|
|
4186
4263
|
/**
|
|
4187
4264
|
* Trigger cross filter update action on a Liveboard.
|
|
4188
4265
|
*
|
|
4266
|
+
* Payload: {@link UpdateCrossFilterRequest}.
|
|
4189
4267
|
* @example
|
|
4190
4268
|
* ```js
|
|
4191
4269
|
* liveboardEmbed.trigger(HostEvent.UpdateCrossFilter, {
|
|
@@ -4201,7 +4279,9 @@
|
|
|
4201
4279
|
HostEvent["UpdateCrossFilter"] = "UpdateCrossFilter";
|
|
4202
4280
|
/**
|
|
4203
4281
|
* Trigger reset action for a personalized Liveboard view.
|
|
4204
|
-
* This event is deprecated.
|
|
4282
|
+
* This event is deprecated.
|
|
4283
|
+
* Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
|
|
4284
|
+
* Payload: none.
|
|
4205
4285
|
* @example
|
|
4206
4286
|
* ```js
|
|
4207
4287
|
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
|
|
@@ -4222,6 +4302,7 @@
|
|
|
4222
4302
|
/**
|
|
4223
4303
|
* Triggers an action to update Parameter values on embedded
|
|
4224
4304
|
* Answers, Liveboard, and Spotter answer in Edit mode.
|
|
4305
|
+
* Payload: {@link RuntimeParameter}[].
|
|
4225
4306
|
* @param - Includes the following keys for each item:
|
|
4226
4307
|
* - `name`: Name of the parameter.
|
|
4227
4308
|
* - `value`: The value to set for the parameter.
|
|
@@ -4279,6 +4360,8 @@
|
|
|
4279
4360
|
* whole Liveboard.
|
|
4280
4361
|
* The `applicability` attribute is available from SDK: 1.53.0 |
|
|
4281
4362
|
* ThoughtSpot: 26.10.0.cl.
|
|
4363
|
+
* Payload: none.
|
|
4364
|
+
* Response: {@link GetParametersResponse}.
|
|
4282
4365
|
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
4283
4366
|
* ```js
|
|
4284
4367
|
* liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
|
|
@@ -4316,6 +4399,7 @@
|
|
|
4316
4399
|
* ```js
|
|
4317
4400
|
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
|
|
4318
4401
|
* ```
|
|
4402
|
+
* Payload: {@link PersonalisedViewRequest} (`viewId` only).
|
|
4319
4403
|
* @example
|
|
4320
4404
|
* ```js
|
|
4321
4405
|
* // Update personalized view from liveboard context
|
|
@@ -4348,6 +4432,7 @@
|
|
|
4348
4432
|
* If neither is provided, the Liveboard resets to the original/default view.
|
|
4349
4433
|
* When a `viewName` is provided and multiple views share
|
|
4350
4434
|
* the same name, the first match is selected.
|
|
4435
|
+
* Payload: {@link PersonalisedViewRequest}.
|
|
4351
4436
|
* @example
|
|
4352
4437
|
* ```js
|
|
4353
4438
|
* liveboardEmbed.trigger(
|
|
@@ -4391,6 +4476,8 @@
|
|
|
4391
4476
|
* If no parameters are specified, the save action is
|
|
4392
4477
|
* triggered with a modal to prompt users to
|
|
4393
4478
|
* add a name and description for the Answer.
|
|
4479
|
+
* Payload: {@link SaveAnswerRequest}.
|
|
4480
|
+
* Response: {@link SaveAnswerResponse}.
|
|
4394
4481
|
* @param - Includes the following keys:
|
|
4395
4482
|
* - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
|
|
4396
4483
|
* embed.
|
|
@@ -4476,6 +4563,7 @@
|
|
|
4476
4563
|
/**
|
|
4477
4564
|
* Triggers a search operation with the search tokens specified in
|
|
4478
4565
|
* the search query string in spotter embed.
|
|
4566
|
+
* Payload: {@link SpotterSearchRequest}.
|
|
4479
4567
|
* @param - Includes the following keys:
|
|
4480
4568
|
* - `query`: Text string in Natural Language format.
|
|
4481
4569
|
* - `executeSearch`: Boolean to execute search and update search query.
|
|
@@ -4500,6 +4588,7 @@
|
|
|
4500
4588
|
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
4501
4589
|
/**
|
|
4502
4590
|
* Edits the last prompt in spotter embed.
|
|
4591
|
+
* Payload: `string`.
|
|
4503
4592
|
* @param - `query`: Text string
|
|
4504
4593
|
* @example
|
|
4505
4594
|
* ```js
|
|
@@ -4516,6 +4605,7 @@
|
|
|
4516
4605
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
4517
4606
|
/**
|
|
4518
4607
|
* Opens the data source preview modal in Spotter Embed.
|
|
4608
|
+
* Payload: none.
|
|
4519
4609
|
* @example
|
|
4520
4610
|
* ```js
|
|
4521
4611
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
@@ -4551,6 +4641,7 @@
|
|
|
4551
4641
|
HostEvent["DataModelInstructions"] = "DataModelInstructions";
|
|
4552
4642
|
/**
|
|
4553
4643
|
* Resets the Spotter Embed Conversation.
|
|
4644
|
+
* Payload: none.
|
|
4554
4645
|
* @example
|
|
4555
4646
|
* ```js
|
|
4556
4647
|
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
@@ -4563,6 +4654,7 @@
|
|
|
4563
4654
|
* `conversationId` is **mandatory** — you must pass the id of the
|
|
4564
4655
|
* conversation to share. Also no-op when sharing is disabled
|
|
4565
4656
|
* (enableShareConversation off) or when already in the read-only shared view.
|
|
4657
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4566
4658
|
* @example
|
|
4567
4659
|
* ```js
|
|
4568
4660
|
* spotterEmbed.trigger(HostEvent.ShareSpotterConversation, { conversationId: 'abc' });
|
|
@@ -4572,6 +4664,7 @@
|
|
|
4572
4664
|
HostEvent["ShareSpotterConversation"] = "ShareSpotterConversation";
|
|
4573
4665
|
/**
|
|
4574
4666
|
* Closes the Spotter share-conversation modal. No-op if none is open.
|
|
4667
|
+
* Payload: none.
|
|
4575
4668
|
* @example
|
|
4576
4669
|
* ```js
|
|
4577
4670
|
* spotterEmbed.trigger(HostEvent.CloseSpotterShareConversation);
|
|
@@ -4581,6 +4674,7 @@
|
|
|
4581
4674
|
HostEvent["CloseSpotterShareConversation"] = "CloseSpotterShareConversation";
|
|
4582
4675
|
/**
|
|
4583
4676
|
* Exits the read-only shared-conversation view.
|
|
4677
|
+
* Payload: none.
|
|
4584
4678
|
* @example
|
|
4585
4679
|
* ```js
|
|
4586
4680
|
* spotterEmbed.trigger(HostEvent.ExitSpotterSharedConversation);
|
|
@@ -4590,6 +4684,7 @@
|
|
|
4590
4684
|
HostEvent["ExitSpotterSharedConversation"] = "ExitSpotterSharedConversation";
|
|
4591
4685
|
/**
|
|
4592
4686
|
* Deletes the last prompt in spotter embed.
|
|
4687
|
+
* Payload: none.
|
|
4593
4688
|
* @example
|
|
4594
4689
|
* ```js
|
|
4595
4690
|
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
@@ -4599,6 +4694,7 @@
|
|
|
4599
4694
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
4600
4695
|
/**
|
|
4601
4696
|
* Toggle the visualization to chart or table view.
|
|
4697
|
+
* Payload: {@link RequiredVizRequest}.
|
|
4602
4698
|
* @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
|
|
4603
4699
|
* @example
|
|
4604
4700
|
* ```js
|
|
@@ -4637,6 +4733,7 @@
|
|
|
4637
4733
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
4638
4734
|
/**
|
|
4639
4735
|
* Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
|
|
4736
|
+
* Payload: {@link RequiredVizRequest}.
|
|
4640
4737
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
|
|
4641
4738
|
* @example
|
|
4642
4739
|
* ```js
|
|
@@ -4698,6 +4795,7 @@
|
|
|
4698
4795
|
* instance. Contact your admin or ThoughtSpot Support to enable chat history on your
|
|
4699
4796
|
* instance.
|
|
4700
4797
|
*
|
|
4798
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4701
4799
|
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
4702
4800
|
* @example
|
|
4703
4801
|
* ```js
|
|
@@ -4715,6 +4813,7 @@
|
|
|
4715
4813
|
* instance. Contact your admin or ThoughtSpot Support to enable chat history on your
|
|
4716
4814
|
* instance.
|
|
4717
4815
|
*
|
|
4816
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4718
4817
|
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
4719
4818
|
* @example
|
|
4720
4819
|
* ```js
|
|
@@ -4739,6 +4838,7 @@
|
|
|
4739
4838
|
* Trigger the **Send Test Email** action in the Liveboard schedule modal.
|
|
4740
4839
|
* Sends a test schedule email to self or all recipients.
|
|
4741
4840
|
* Requires `isSendNowLiveboardSchedulingEnabled` to be enabled.
|
|
4841
|
+
* Payload: {@link ScheduleEmailRequest}.
|
|
4742
4842
|
* @example
|
|
4743
4843
|
* ```js
|
|
4744
4844
|
* liveboardEmbed.trigger(HostEvent.SendTestScheduleEmail, {
|
|
@@ -4757,6 +4857,7 @@
|
|
|
4757
4857
|
HostEvent["SendTestScheduleEmail"] = "sendTestScheduleEmail";
|
|
4758
4858
|
/**
|
|
4759
4859
|
* Sends a user message (prompt) to the SpotterViz panel programmatically.
|
|
4860
|
+
* Payload: `{ query: string }`.
|
|
4760
4861
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4761
4862
|
* @param query - the prompt text to send.
|
|
4762
4863
|
* @example
|
|
@@ -4769,6 +4870,7 @@
|
|
|
4769
4870
|
HostEvent["SpotterVizSendUserMessage"] = "SpotterVizSendUserMessage";
|
|
4770
4871
|
/**
|
|
4771
4872
|
* Initializes a new SpotterViz conversation.
|
|
4873
|
+
* Payload: none.
|
|
4772
4874
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4773
4875
|
* @example
|
|
4774
4876
|
* ```js
|
|
@@ -4778,6 +4880,7 @@
|
|
|
4778
4880
|
HostEvent["InitSpotterVizConversation"] = "InitSpotterVizConversation";
|
|
4779
4881
|
/**
|
|
4780
4882
|
* Opens the SpotterViz panel.
|
|
4883
|
+
* Payload: none.
|
|
4781
4884
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4782
4885
|
* @example
|
|
4783
4886
|
* ```js
|
|
@@ -4787,6 +4890,7 @@
|
|
|
4787
4890
|
HostEvent["OpenSpotterVizPanel"] = "OpenSpotterVizPanel";
|
|
4788
4891
|
/**
|
|
4789
4892
|
* Closes the SpotterViz panel.
|
|
4893
|
+
* Payload: none.
|
|
4790
4894
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4791
4895
|
* @example
|
|
4792
4896
|
* ```js
|
|
@@ -4797,6 +4901,7 @@
|
|
|
4797
4901
|
/**
|
|
4798
4902
|
* Clears browser cache and fetches new data for liveboard ChartViz Containers.
|
|
4799
4903
|
* Requires `enableLiveboardDataCache` to be enabled.
|
|
4904
|
+
* Payload: {@link ScheduleEmailRequest}.
|
|
4800
4905
|
* @example
|
|
4801
4906
|
* ```js
|
|
4802
4907
|
* liveboardEmbed.trigger(HostEvent.RefreshLiveboardBrowserCache);
|
|
@@ -4994,6 +5099,7 @@
|
|
|
4994
5099
|
Param["SpotterDataSources"] = "spotterDataSources";
|
|
4995
5100
|
Param["AnalystId"] = "analystId";
|
|
4996
5101
|
Param["OpenSpotterOnLiveboardByDefault"] = "openSpotterOnLiveboardByDefault";
|
|
5102
|
+
Param["ShowAnswerEditPanel"] = "showAnswerEditPanel";
|
|
4997
5103
|
})(Param || (Param = {}));
|
|
4998
5104
|
/**
|
|
4999
5105
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -6998,6 +7104,225 @@
|
|
|
6998
7104
|
* ```
|
|
6999
7105
|
*/
|
|
7000
7106
|
Action["SpotterOnLiveboard"] = "spotterOnLiveboard";
|
|
7107
|
+
/**
|
|
7108
|
+
* Controls the visibility and disabled state of the "Chart Type" menu item
|
|
7109
|
+
* in Chart Settings V2.
|
|
7110
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7111
|
+
* @example
|
|
7112
|
+
* ```js
|
|
7113
|
+
* {
|
|
7114
|
+
* hiddenActions: [Action.ChartTypeSettings],
|
|
7115
|
+
* disabledActions: [Action.ChartTypeSettings],
|
|
7116
|
+
* }
|
|
7117
|
+
* ```
|
|
7118
|
+
*/
|
|
7119
|
+
Action["ChartTypeSettings"] = "CHART_TYPE";
|
|
7120
|
+
/**
|
|
7121
|
+
* Controls the visibility and disabled state of the "Layout" menu item
|
|
7122
|
+
* in Chart Settings V2.
|
|
7123
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7124
|
+
* @example
|
|
7125
|
+
* ```js
|
|
7126
|
+
* {
|
|
7127
|
+
* hiddenActions: [Action.LayoutSettings],
|
|
7128
|
+
* disabledActions: [Action.LayoutSettings],
|
|
7129
|
+
* }
|
|
7130
|
+
* ```
|
|
7131
|
+
*/
|
|
7132
|
+
Action["LayoutSettings"] = "LAYOUT";
|
|
7133
|
+
/**
|
|
7134
|
+
* Controls the visibility and disabled state of the "Column" menu item
|
|
7135
|
+
* in Chart Settings V2.
|
|
7136
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7137
|
+
* @example
|
|
7138
|
+
* ```js
|
|
7139
|
+
* {
|
|
7140
|
+
* hiddenActions: [Action.ColumnSettings],
|
|
7141
|
+
* disabledActions: [Action.ColumnSettings],
|
|
7142
|
+
* }
|
|
7143
|
+
* ```
|
|
7144
|
+
*/
|
|
7145
|
+
Action["ColumnSettings"] = "COLUMN";
|
|
7146
|
+
/**
|
|
7147
|
+
* Controls the visibility and disabled state of the "Axis" menu item
|
|
7148
|
+
* in Chart Settings V2.
|
|
7149
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7150
|
+
* @example
|
|
7151
|
+
* ```js
|
|
7152
|
+
* {
|
|
7153
|
+
* hiddenActions: [Action.AxisSettings],
|
|
7154
|
+
* disabledActions: [Action.AxisSettings],
|
|
7155
|
+
* }
|
|
7156
|
+
* ```
|
|
7157
|
+
*/
|
|
7158
|
+
Action["AxisSettings"] = "AXIS";
|
|
7159
|
+
/**
|
|
7160
|
+
* Controls the visibility and disabled state of the "Data Label" menu item
|
|
7161
|
+
* in Chart Settings V2.
|
|
7162
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7163
|
+
* @example
|
|
7164
|
+
* ```js
|
|
7165
|
+
* {
|
|
7166
|
+
* hiddenActions: [Action.DataLabelSettings],
|
|
7167
|
+
* disabledActions: [Action.DataLabelSettings],
|
|
7168
|
+
* }
|
|
7169
|
+
* ```
|
|
7170
|
+
*/
|
|
7171
|
+
Action["DataLabelSettings"] = "DATA_LABEL";
|
|
7172
|
+
/**
|
|
7173
|
+
* Controls the visibility and disabled state of the "Tooltip" menu item
|
|
7174
|
+
* in Chart Settings V2.
|
|
7175
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7176
|
+
* @example
|
|
7177
|
+
* ```js
|
|
7178
|
+
* {
|
|
7179
|
+
* hiddenActions: [Action.TooltipSettings],
|
|
7180
|
+
* disabledActions: [Action.TooltipSettings],
|
|
7181
|
+
* }
|
|
7182
|
+
* ```
|
|
7183
|
+
*/
|
|
7184
|
+
Action["TooltipSettings"] = "TOOLTIP";
|
|
7185
|
+
/**
|
|
7186
|
+
* Controls the visibility and disabled state of the "Legend" menu item
|
|
7187
|
+
* in Chart Settings V2.
|
|
7188
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7189
|
+
* @example
|
|
7190
|
+
* ```js
|
|
7191
|
+
* {
|
|
7192
|
+
* hiddenActions: [Action.LegendSettings],
|
|
7193
|
+
* disabledActions: [Action.LegendSettings],
|
|
7194
|
+
* }
|
|
7195
|
+
* ```
|
|
7196
|
+
*/
|
|
7197
|
+
Action["LegendSettings"] = "LEGEND";
|
|
7198
|
+
/**
|
|
7199
|
+
* Controls the visibility and disabled state of the "Display" menu item
|
|
7200
|
+
* in Chart Settings V2.
|
|
7201
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7202
|
+
* @example
|
|
7203
|
+
* ```js
|
|
7204
|
+
* {
|
|
7205
|
+
* hiddenActions: [Action.DisplaySettings],
|
|
7206
|
+
* disabledActions: [Action.DisplaySettings],
|
|
7207
|
+
* }
|
|
7208
|
+
* ```
|
|
7209
|
+
*/
|
|
7210
|
+
Action["DisplaySettings"] = "DISPLAY";
|
|
7211
|
+
/**
|
|
7212
|
+
* Controls the visibility and disabled state of the "Query Details" menu
|
|
7213
|
+
* item in Chart Settings V2.
|
|
7214
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7215
|
+
* @example
|
|
7216
|
+
* ```js
|
|
7217
|
+
* {
|
|
7218
|
+
* hiddenActions: [Action.QuerySettings],
|
|
7219
|
+
* disabledActions: [Action.QuerySettings],
|
|
7220
|
+
* }
|
|
7221
|
+
* ```
|
|
7222
|
+
*/
|
|
7223
|
+
Action["QuerySettings"] = "QUERY_DETAILS";
|
|
7224
|
+
/**
|
|
7225
|
+
* Controls the visibility and disabled state of the "Custom Action" menu
|
|
7226
|
+
* item in Chart Settings V2.
|
|
7227
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7228
|
+
* @example
|
|
7229
|
+
* ```js
|
|
7230
|
+
* {
|
|
7231
|
+
* hiddenActions: [Action.CustomSettings],
|
|
7232
|
+
* disabledActions: [Action.CustomSettings],
|
|
7233
|
+
* }
|
|
7234
|
+
* ```
|
|
7235
|
+
*/
|
|
7236
|
+
Action["CustomSettings"] = "CUSTOM_ACTION";
|
|
7237
|
+
/**
|
|
7238
|
+
* Controls the visibility and disabled state of the "Muze AI" menu item
|
|
7239
|
+
* in Chart Settings V2.
|
|
7240
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7241
|
+
* @example
|
|
7242
|
+
* ```js
|
|
7243
|
+
* {
|
|
7244
|
+
* hiddenActions: [Action.MuzeAiSettings],
|
|
7245
|
+
* disabledActions: [Action.MuzeAiSettings],
|
|
7246
|
+
* }
|
|
7247
|
+
* ```
|
|
7248
|
+
*/
|
|
7249
|
+
Action["MuzeAiSettings"] = "MUZE_AI";
|
|
7250
|
+
/**
|
|
7251
|
+
* Controls the visibility and disabled state of the "R Analysis" menu item
|
|
7252
|
+
* in Chart Settings V2.
|
|
7253
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7254
|
+
* @example
|
|
7255
|
+
* ```js
|
|
7256
|
+
* {
|
|
7257
|
+
* hiddenActions: [Action.RAnalysisSettings],
|
|
7258
|
+
* disabledActions: [Action.RAnalysisSettings],
|
|
7259
|
+
* }
|
|
7260
|
+
* ```
|
|
7261
|
+
*/
|
|
7262
|
+
Action["RAnalysisSettings"] = "R_ANALYSIS";
|
|
7263
|
+
/**
|
|
7264
|
+
* Controls the visibility and disabled state of the "Add to Collection" menu item.
|
|
7265
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7266
|
+
* @example
|
|
7267
|
+
* ```js
|
|
7268
|
+
* {
|
|
7269
|
+
* hiddenActions: [Action.AddToCollection],
|
|
7270
|
+
* disabledActions: [Action.AddToCollection],
|
|
7271
|
+
* }
|
|
7272
|
+
* ```
|
|
7273
|
+
*/
|
|
7274
|
+
Action["AddToCollection"] = "addToCollection";
|
|
7275
|
+
/**
|
|
7276
|
+
* Controls the visibility and disabled state of the "Create Collection" button.
|
|
7277
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7278
|
+
* @example
|
|
7279
|
+
* ```js
|
|
7280
|
+
* {
|
|
7281
|
+
* hiddenActions: [Action.CreateCollection],
|
|
7282
|
+
* disabledActions: [Action.CreateCollection],
|
|
7283
|
+
* }
|
|
7284
|
+
* ```
|
|
7285
|
+
*/
|
|
7286
|
+
Action["CreateCollection"] = "createCollection";
|
|
7287
|
+
/**
|
|
7288
|
+
* Controls the visibility and disabled state of the "Move" menu item in a
|
|
7289
|
+
* Collection.
|
|
7290
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7291
|
+
* @example
|
|
7292
|
+
* ```js
|
|
7293
|
+
* {
|
|
7294
|
+
* hiddenActions: [Action.MoveToCollection],
|
|
7295
|
+
* disabledActions: [Action.MoveToCollection],
|
|
7296
|
+
* }
|
|
7297
|
+
* ```
|
|
7298
|
+
*/
|
|
7299
|
+
Action["MoveToCollection"] = "moveToCollection";
|
|
7300
|
+
/**
|
|
7301
|
+
* Controls the visibility and disabled state of the "Remove" menu item in a
|
|
7302
|
+
* Collection.
|
|
7303
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7304
|
+
* @example
|
|
7305
|
+
* ```js
|
|
7306
|
+
* {
|
|
7307
|
+
* hiddenActions: [Action.RemoveFromCollection],
|
|
7308
|
+
* disabledActions: [Action.RemoveFromCollection],
|
|
7309
|
+
* }
|
|
7310
|
+
* ```
|
|
7311
|
+
*/
|
|
7312
|
+
Action["RemoveFromCollection"] = "removeFromCollection";
|
|
7313
|
+
/**
|
|
7314
|
+
* Controls the visibility and disabled state of the "Delete" menu item for a
|
|
7315
|
+
* Collection.
|
|
7316
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7317
|
+
* @example
|
|
7318
|
+
* ```js
|
|
7319
|
+
* {
|
|
7320
|
+
* hiddenActions: [Action.DeleteCollection],
|
|
7321
|
+
* disabledActions: [Action.DeleteCollection],
|
|
7322
|
+
* }
|
|
7323
|
+
* ```
|
|
7324
|
+
*/
|
|
7325
|
+
Action["DeleteCollection"] = "deleteCollection";
|
|
7001
7326
|
})(exports.Action || (exports.Action = {}));
|
|
7002
7327
|
var PrefetchFeatures;
|
|
7003
7328
|
(function (PrefetchFeatures) {
|
|
@@ -7502,7 +7827,7 @@
|
|
|
7502
7827
|
TableContentDensity["Compact"] = "COMPACT";
|
|
7503
7828
|
})(TableContentDensity || (TableContentDensity = {}));
|
|
7504
7829
|
|
|
7505
|
-
var version$1="1.52.
|
|
7830
|
+
var version$1="1.52.1";var pkg = {version:version$1};
|
|
7506
7831
|
|
|
7507
7832
|
const { version } = pkg;
|
|
7508
7833
|
|
|
@@ -8255,6 +8580,43 @@
|
|
|
8255
8580
|
if (value !== undefined) {
|
|
8256
8581
|
queryParams[param] = asBoolean ? !!value : value;
|
|
8257
8582
|
}
|
|
8583
|
+
};
|
|
8584
|
+
/**
|
|
8585
|
+
* Calculates the element center for the currently visible viewport of the
|
|
8586
|
+
* element, using the scroll position of the host app, the offsetTop of the
|
|
8587
|
+
* element in the host app, and the viewport height of the tab.
|
|
8588
|
+
*
|
|
8589
|
+
* The returned keys are sent to the ThoughtSpot app over postMessage, so they
|
|
8590
|
+
* are named after the iframe and must not be renamed.
|
|
8591
|
+
* @param element The element to measure
|
|
8592
|
+
* @returns The element center within the visible viewport, the element height,
|
|
8593
|
+
* and the viewport height.
|
|
8594
|
+
*/
|
|
8595
|
+
const calculateElementCenter = (element) => {
|
|
8596
|
+
const offsetTopClient = getOffsetTop(element);
|
|
8597
|
+
const scrollTopClient = window.scrollY;
|
|
8598
|
+
const viewPortHeight = window.innerHeight;
|
|
8599
|
+
const iframeHeight = element.offsetHeight;
|
|
8600
|
+
const iframeScrolled = scrollTopClient - offsetTopClient;
|
|
8601
|
+
let iframeVisibleViewPort;
|
|
8602
|
+
let iframeOffset;
|
|
8603
|
+
if (iframeScrolled < 0) {
|
|
8604
|
+
iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
|
|
8605
|
+
iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
|
|
8606
|
+
iframeOffset = 0;
|
|
8607
|
+
}
|
|
8608
|
+
else {
|
|
8609
|
+
iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
|
|
8610
|
+
iframeOffset = iframeScrolled;
|
|
8611
|
+
}
|
|
8612
|
+
const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
|
|
8613
|
+
return {
|
|
8614
|
+
iframeCenter,
|
|
8615
|
+
iframeScrolled,
|
|
8616
|
+
iframeHeight,
|
|
8617
|
+
viewPortHeight,
|
|
8618
|
+
iframeVisibleViewPort,
|
|
8619
|
+
};
|
|
8258
8620
|
};
|
|
8259
8621
|
|
|
8260
8622
|
/** Used for built-in method references. */
|
|
@@ -9165,7 +9527,110 @@
|
|
|
9165
9527
|
UIPassthroughEvent["GetTabs"] = "getTabs";
|
|
9166
9528
|
UIPassthroughEvent["GetGroups"] = "getGroups";
|
|
9167
9529
|
UIPassthroughEvent["GetExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
|
|
9168
|
-
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
9530
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
9531
|
+
// NOTE: HostEventRequest / HostEventResponse / TriggerPayload / TriggerResponse
|
|
9532
|
+
// live in the sibling ./host-event-contracts, which layers the
|
|
9533
|
+
// HostEventRequestMap on top of the UI-passthrough mapping above.
|
|
9534
|
+
// The former 2-tier definitions that lived here were superseded and removed.
|
|
9535
|
+
|
|
9536
|
+
/**
|
|
9537
|
+
* Copyright (c) 2026
|
|
9538
|
+
*
|
|
9539
|
+
* Dedicated transport layer for SDK <-> ThoughtSpot iframe messaging.
|
|
9540
|
+
*
|
|
9541
|
+
* Owns the postMessage/MessageChannel mechanics and origin resolution so
|
|
9542
|
+
* that embed/business logic (ts-embed.ts, hostEventClient) never touches
|
|
9543
|
+
* the wire directly. The wire format is unchanged from the historical
|
|
9544
|
+
* implementation — this layer is a pure structural extraction.
|
|
9545
|
+
*/
|
|
9546
|
+
/**
|
|
9547
|
+
* Default time to wait for the app to respond to a request-response
|
|
9548
|
+
* message before giving up and reclaiming the channel.
|
|
9549
|
+
*/
|
|
9550
|
+
const MESSAGE_RESPONSE_TIMEOUT = 30000;
|
|
9551
|
+
/**
|
|
9552
|
+
* Single implementation of origin resolution for the embedded app.
|
|
9553
|
+
* Returns the origin (scheme://host[:port]) for a ThoughtSpot host URL,
|
|
9554
|
+
* or null when it cannot be parsed.
|
|
9555
|
+
* @param thoughtSpotHost
|
|
9556
|
+
*/
|
|
9557
|
+
const resolveMessageOrigin = (thoughtSpotHost) => {
|
|
9558
|
+
try {
|
|
9559
|
+
return new URL(thoughtSpotHost).origin;
|
|
9560
|
+
}
|
|
9561
|
+
catch (e) {
|
|
9562
|
+
return null;
|
|
9563
|
+
}
|
|
9564
|
+
};
|
|
9565
|
+
/**
|
|
9566
|
+
* Validates that an inbound window message came from the embedded
|
|
9567
|
+
* ThoughtSpot app: the source window must be the embed iframe's window and,
|
|
9568
|
+
* when the expected origin is resolvable, the message origin must match it.
|
|
9569
|
+
*
|
|
9570
|
+
* Fails open (returns true) on the origin check when the expected origin
|
|
9571
|
+
* cannot be resolved, to avoid breaking unconventional-but-working setups;
|
|
9572
|
+
* a warning is logged on mismatch either way.
|
|
9573
|
+
* @param event The message event received on window.
|
|
9574
|
+
* @param iFrame The embed iframe the message should originate from.
|
|
9575
|
+
* @param thoughtSpotHost The configured ThoughtSpot host.
|
|
9576
|
+
*/
|
|
9577
|
+
const isMessageFromIframe = (event, iFrame, thoughtSpotHost) => {
|
|
9578
|
+
if (event.source !== (iFrame === null || iFrame === void 0 ? void 0 : iFrame.contentWindow)) {
|
|
9579
|
+
return false;
|
|
9580
|
+
}
|
|
9581
|
+
const expectedOrigin = resolveMessageOrigin(thoughtSpotHost);
|
|
9582
|
+
if (expectedOrigin && event.origin && event.origin !== expectedOrigin) {
|
|
9583
|
+
logger$3.warn(`Dropped message from unexpected origin ${event.origin}; expected ${expectedOrigin}`);
|
|
9584
|
+
return false;
|
|
9585
|
+
}
|
|
9586
|
+
return true;
|
|
9587
|
+
};
|
|
9588
|
+
/**
|
|
9589
|
+
* Posts a one-way message to the embedded app's iframe, optionally
|
|
9590
|
+
* transferring a MessageChannel port for the response.
|
|
9591
|
+
* @param iFrame
|
|
9592
|
+
* @param message
|
|
9593
|
+
* @param thoughtSpotHost Used as the postMessage targetOrigin.
|
|
9594
|
+
* @param channel
|
|
9595
|
+
*/
|
|
9596
|
+
const postMessageToIframe = (iFrame, message, thoughtSpotHost, channel) => {
|
|
9597
|
+
var _a;
|
|
9598
|
+
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, channel ? [channel.port2] : []);
|
|
9599
|
+
};
|
|
9600
|
+
/**
|
|
9601
|
+
* Sends a request-response message to the embedded app over a dedicated
|
|
9602
|
+
* MessageChannel. Resolves with the response payload; rejects when the app
|
|
9603
|
+
* responds with an error; resolves with a timeout Error object when no
|
|
9604
|
+
* response arrives in time (historical behavior, preserved for backward
|
|
9605
|
+
* compatibility).
|
|
9606
|
+
* @param iFrame
|
|
9607
|
+
* @param message
|
|
9608
|
+
* @param thoughtSpotHost
|
|
9609
|
+
* @param timeoutMs
|
|
9610
|
+
*/
|
|
9611
|
+
function sendMessageWithResponse(iFrame, message, thoughtSpotHost, timeoutMs = MESSAGE_RESPONSE_TIMEOUT) {
|
|
9612
|
+
return new Promise((res, rej) => {
|
|
9613
|
+
const channel = new MessageChannel();
|
|
9614
|
+
// Close the messageChannel and resolve the promise if timeout.
|
|
9615
|
+
const timeoutId = setTimeout(() => {
|
|
9616
|
+
channel.port1.close();
|
|
9617
|
+
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
9618
|
+
}, timeoutMs);
|
|
9619
|
+
channel.port1.onmessage = ({ data: responseData }) => {
|
|
9620
|
+
var _a;
|
|
9621
|
+
clearTimeout(timeoutId);
|
|
9622
|
+
channel.port1.close();
|
|
9623
|
+
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);
|
|
9624
|
+
if (error) {
|
|
9625
|
+
rej(error);
|
|
9626
|
+
}
|
|
9627
|
+
else {
|
|
9628
|
+
res(responseData);
|
|
9629
|
+
}
|
|
9630
|
+
};
|
|
9631
|
+
postMessageToIframe(iFrame, message, thoughtSpotHost, channel);
|
|
9632
|
+
});
|
|
9633
|
+
}
|
|
9169
9634
|
|
|
9170
9635
|
const EndPoints = {
|
|
9171
9636
|
AUTH_VERIFICATION: '/callosum/v1/session/info',
|
|
@@ -20375,23 +20840,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20375
20840
|
iFrame.src = src;
|
|
20376
20841
|
}, 100);
|
|
20377
20842
|
};
|
|
20843
|
+
const TRIGGER_TIMEOUT = MESSAGE_RESPONSE_TIMEOUT;
|
|
20378
20844
|
/**
|
|
20379
|
-
*
|
|
20380
|
-
*
|
|
20381
|
-
*
|
|
20382
|
-
* @param message.type
|
|
20383
|
-
* @param message.data
|
|
20384
|
-
* @param message.context
|
|
20385
|
-
* @param thoughtSpotHost
|
|
20386
|
-
* @param channel
|
|
20387
|
-
*/
|
|
20388
|
-
function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
|
|
20389
|
-
var _a;
|
|
20390
|
-
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
|
|
20391
|
-
}
|
|
20392
|
-
const TRIGGER_TIMEOUT = 30000;
|
|
20393
|
-
/**
|
|
20394
|
-
*
|
|
20845
|
+
* Processes a host event trigger: handles SDK-local events (Reload,
|
|
20846
|
+
* Present) and forwards everything else to the embedded app over the
|
|
20847
|
+
* iframe transport.
|
|
20395
20848
|
* @param iFrame
|
|
20396
20849
|
* @param messageType
|
|
20397
20850
|
* @param thoughtSpotHost
|
|
@@ -20399,42 +20852,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20399
20852
|
* @param context
|
|
20400
20853
|
*/
|
|
20401
20854
|
function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
|
|
20402
|
-
|
|
20403
|
-
|
|
20404
|
-
|
|
20405
|
-
|
|
20406
|
-
|
|
20407
|
-
|
|
20408
|
-
|
|
20409
|
-
|
|
20410
|
-
|
|
20411
|
-
|
|
20412
|
-
handlePresentEvent(iFrame);
|
|
20413
|
-
}
|
|
20414
|
-
else {
|
|
20415
|
-
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
20416
|
-
}
|
|
20855
|
+
var _a;
|
|
20856
|
+
if (messageType === exports.HostEvent.Reload) {
|
|
20857
|
+
reload(iFrame);
|
|
20858
|
+
return Promise.resolve(null);
|
|
20859
|
+
}
|
|
20860
|
+
if (messageType === exports.HostEvent.Present) {
|
|
20861
|
+
const embedConfig = getEmbedConfig();
|
|
20862
|
+
const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
|
|
20863
|
+
if (!disableFullscreenPresentation) {
|
|
20864
|
+
handlePresentEvent(iFrame);
|
|
20417
20865
|
}
|
|
20418
|
-
|
|
20419
|
-
|
|
20420
|
-
|
|
20421
|
-
|
|
20422
|
-
|
|
20423
|
-
}, TRIGGER_TIMEOUT);
|
|
20424
|
-
channel.port1.onmessage = ({ data: responseData }) => {
|
|
20425
|
-
var _a;
|
|
20426
|
-
clearTimeout(timeoutId);
|
|
20427
|
-
channel.port1.close();
|
|
20428
|
-
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);
|
|
20429
|
-
if (error) {
|
|
20430
|
-
rej(error);
|
|
20431
|
-
}
|
|
20432
|
-
else {
|
|
20433
|
-
res(responseData);
|
|
20434
|
-
}
|
|
20435
|
-
};
|
|
20436
|
-
return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
|
|
20437
|
-
});
|
|
20866
|
+
else {
|
|
20867
|
+
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
20868
|
+
}
|
|
20869
|
+
}
|
|
20870
|
+
return sendMessageWithResponse(iFrame, { type: messageType, data, context }, thoughtSpotHost, TRIGGER_TIMEOUT);
|
|
20438
20871
|
}
|
|
20439
20872
|
|
|
20440
20873
|
/**
|
|
@@ -21143,6 +21576,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21143
21576
|
if (!isValidUpdateFiltersPayload(payload)) {
|
|
21144
21577
|
throwUpdateFiltersValidationError();
|
|
21145
21578
|
}
|
|
21579
|
+
// The shared contract accepts both current (columnName/operator) and
|
|
21580
|
+
// legacy (column/oper) filter field names — as does the validation
|
|
21581
|
+
// above and the app at runtime. The UIPassthrough FilterUpdate type
|
|
21582
|
+
// still requires the legacy names; bridge until that contract is
|
|
21583
|
+
// audited.
|
|
21146
21584
|
return this.handleHostEventWithParam(UIPassthroughEvent.UpdateFilters, payload, context);
|
|
21147
21585
|
}
|
|
21148
21586
|
handleUpdateParametersEvent(payload, context) {
|
|
@@ -21377,6 +21815,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21377
21815
|
*/
|
|
21378
21816
|
const PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY = 'tsEmbedOriginalPosition';
|
|
21379
21817
|
const PRERENDER_WRAPPER_ID_PREFIX = 'tsEmbed-pre-render-wrapper-';
|
|
21818
|
+
// The container applies UpdateEmbedParams through React state, so a delivered
|
|
21819
|
+
// post is not the same as the params being in effect.
|
|
21820
|
+
const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
|
|
21821
|
+
// The container ignores runtimeFilterParams/runtimeParameterParams unless truthy, so
|
|
21822
|
+
// null or '' leaves the previous embed's values in place. '&' is truthy and parses to {}.
|
|
21823
|
+
const NO_RUNTIME_PARAMS = '&';
|
|
21380
21824
|
/**
|
|
21381
21825
|
* The event id map from v2 event names to v1 event id
|
|
21382
21826
|
* v1 events are the classic embed events implemented in Blink v1
|
|
@@ -21403,6 +21847,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21403
21847
|
* The key to store the embed instance in the DOM node
|
|
21404
21848
|
*/
|
|
21405
21849
|
this.embedNodeKey = '__tsEmbed';
|
|
21850
|
+
this.embedContainerLoadedKey = '__tsEmbedContainerLoaded';
|
|
21406
21851
|
this.isAppInitialized = false;
|
|
21407
21852
|
/**
|
|
21408
21853
|
* Should we encode URL Query Params using base64 encoding which ThoughtSpot
|
|
@@ -21423,7 +21868,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21423
21868
|
const eventType = this.getEventType(event);
|
|
21424
21869
|
const eventPort = this.getEventPort(event);
|
|
21425
21870
|
const eventData = this.formatEventData(event, eventType);
|
|
21426
|
-
if (event
|
|
21871
|
+
if (isMessageFromIframe(event, this.iFrame, this.thoughtSpotHost)) {
|
|
21427
21872
|
const processedEventData = processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.hostElement);
|
|
21428
21873
|
if (eventType === exports.EmbedEvent.ApiIntercept) {
|
|
21429
21874
|
this.handleApiInterceptEvent({ eventData, eventPort });
|
|
@@ -21565,7 +22010,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21565
22010
|
this.createEmbedContainerHandler = (source) => () => {
|
|
21566
22011
|
const processEmbedContainerReady = () => {
|
|
21567
22012
|
logger$3.debug('processEmbedContainerReady');
|
|
21568
|
-
this.
|
|
22013
|
+
this.markEmbedContainerLoaded();
|
|
21569
22014
|
this.executeEmbedContainerReadyCallbacks();
|
|
21570
22015
|
};
|
|
21571
22016
|
if (source === exports.EmbedEvent.AuthInit) {
|
|
@@ -21579,6 +22024,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21579
22024
|
processEmbedContainerReady();
|
|
21580
22025
|
}
|
|
21581
22026
|
};
|
|
22027
|
+
// Subclasses that navigate the pre-render on show must await this before
|
|
22028
|
+
// triggering Navigate. Resolves even on failure, so navigation is never blocked.
|
|
22029
|
+
this.preRenderParamsApplied = Promise.resolve();
|
|
21582
22030
|
this.hostElement = getDOMNode(domSelector);
|
|
21583
22031
|
this.eventHandlerMap = new Map();
|
|
21584
22032
|
this.isError = false;
|
|
@@ -21895,6 +22343,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21895
22343
|
return `${basePath}#`;
|
|
21896
22344
|
}
|
|
21897
22345
|
async getUpdateEmbedParamsObject() {
|
|
22346
|
+
var _a, _b;
|
|
21898
22347
|
const queryParams = this.getEmbedParamsObject();
|
|
21899
22348
|
// Values are URL-serialized (e.g. dataSources as '["guid"]'); parse
|
|
21900
22349
|
// them back so the event payload matches a URL load (SCAL-334713).
|
|
@@ -21902,7 +22351,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21902
22351
|
queryParams[key] = deserializeParam(queryParams[key]);
|
|
21903
22352
|
});
|
|
21904
22353
|
const appInitData = await this.getAppInitData();
|
|
21905
|
-
return {
|
|
22354
|
+
return {
|
|
22355
|
+
...this.viewConfig,
|
|
22356
|
+
...queryParams,
|
|
22357
|
+
...appInitData,
|
|
22358
|
+
// A show cycle has no URL to carry these, so the payload always states them
|
|
22359
|
+
// — including "none", which is the case that leaks the previous filters.
|
|
22360
|
+
runtimeFilterParams: getFilterQuery((_a = this.viewConfig.runtimeFilters) !== null && _a !== void 0 ? _a : []) || NO_RUNTIME_PARAMS,
|
|
22361
|
+
runtimeParameterParams: getRuntimeParameters((_b = this.viewConfig.runtimeParameters) !== null && _b !== void 0 ? _b : [])
|
|
22362
|
+
|| NO_RUNTIME_PARAMS,
|
|
22363
|
+
};
|
|
21906
22364
|
}
|
|
21907
22365
|
/**
|
|
21908
22366
|
* Common query params set for all the embed modes.
|
|
@@ -22533,40 +22991,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22533
22991
|
getCompatibleEventType(eventType) {
|
|
22534
22992
|
return V1EventMap[eventType] || eventType;
|
|
22535
22993
|
}
|
|
22536
|
-
/**
|
|
22537
|
-
* Calculates the iframe center for the current visible viewPort
|
|
22538
|
-
* of iframe using Scroll position of Host App, offsetTop for iframe
|
|
22539
|
-
* in Host app. ViewPort height of the tab.
|
|
22540
|
-
* @returns iframe Center in visible viewport,
|
|
22541
|
-
* Iframe height,
|
|
22542
|
-
* View port height.
|
|
22543
|
-
*/
|
|
22544
|
-
getIframeCenter() {
|
|
22545
|
-
const offsetTopClient = getOffsetTop(this.iFrame);
|
|
22546
|
-
const scrollTopClient = window.scrollY;
|
|
22547
|
-
const viewPortHeight = window.innerHeight;
|
|
22548
|
-
const iframeHeight = this.iFrame.offsetHeight;
|
|
22549
|
-
const iframeScrolled = scrollTopClient - offsetTopClient;
|
|
22550
|
-
let iframeVisibleViewPort;
|
|
22551
|
-
let iframeOffset;
|
|
22552
|
-
if (iframeScrolled < 0) {
|
|
22553
|
-
iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
|
|
22554
|
-
iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
|
|
22555
|
-
iframeOffset = 0;
|
|
22556
|
-
}
|
|
22557
|
-
else {
|
|
22558
|
-
iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
|
|
22559
|
-
iframeOffset = iframeScrolled;
|
|
22560
|
-
}
|
|
22561
|
-
const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
|
|
22562
|
-
return {
|
|
22563
|
-
iframeCenter,
|
|
22564
|
-
iframeScrolled,
|
|
22565
|
-
iframeHeight,
|
|
22566
|
-
viewPortHeight,
|
|
22567
|
-
iframeVisibleViewPort,
|
|
22568
|
-
};
|
|
22569
|
-
}
|
|
22570
22994
|
/**
|
|
22571
22995
|
* Registers an event listener to trigger an alert when the ThoughtSpot app
|
|
22572
22996
|
* sends an event of a particular message type to the host application.
|
|
@@ -22650,13 +23074,32 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22650
23074
|
var _a;
|
|
22651
23075
|
const embedObj = (_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
22652
23076
|
if (embedObj === this) {
|
|
22653
|
-
logger$3.
|
|
23077
|
+
logger$3.debug('embedObj is same as this');
|
|
22654
23078
|
}
|
|
22655
23079
|
return embedObj;
|
|
22656
23080
|
}
|
|
23081
|
+
takeOverPreRender() {
|
|
23082
|
+
if (!this.preRenderWrapper)
|
|
23083
|
+
return;
|
|
23084
|
+
this.preRenderWrapper[this.embedNodeKey] = this;
|
|
23085
|
+
}
|
|
23086
|
+
// The flag lives on the wrapper because it describes the iframe: an instance
|
|
23087
|
+
// hidden when the container announced itself would otherwise report false forever.
|
|
23088
|
+
markEmbedContainerLoaded() {
|
|
23089
|
+
this.isEmbedContainerLoaded = true;
|
|
23090
|
+
if (this.preRenderWrapper) {
|
|
23091
|
+
this.preRenderWrapper[this.embedContainerLoadedKey] = true;
|
|
23092
|
+
}
|
|
23093
|
+
}
|
|
22657
23094
|
checkEmbedContainerLoaded() {
|
|
23095
|
+
var _a;
|
|
22658
23096
|
if (this.isEmbedContainerLoaded)
|
|
22659
23097
|
return true;
|
|
23098
|
+
if ((_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedContainerLoadedKey]) {
|
|
23099
|
+
this.isEmbedContainerLoaded = true;
|
|
23100
|
+
return true;
|
|
23101
|
+
}
|
|
23102
|
+
// Older builds stamped the flag on the instance, not the wrapper.
|
|
22660
23103
|
const preRenderObj = this.getPreRenderObj();
|
|
22661
23104
|
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
22662
23105
|
this.isEmbedContainerLoaded = true;
|
|
@@ -22685,8 +23128,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22685
23128
|
}
|
|
22686
23129
|
/**
|
|
22687
23130
|
* Triggers an event to the embedded app
|
|
23131
|
+
*
|
|
23132
|
+
* Payload typing: from SDK 1.52.0 (ThoughtSpot Cloud 26.9.0.cl), unknown fields
|
|
23133
|
+
* on a known event's payload fail to compile. From SDK 1.54.0 (26.11.0.cl) the
|
|
23134
|
+
* payload is checked strictly against the event contract — update call sites now.
|
|
22688
23135
|
* @param {HostEvent} messageType The event type
|
|
22689
|
-
* @param {
|
|
23136
|
+
* @param {TriggerData} data The payload, typed against the event's contract
|
|
22690
23137
|
* @param {ContextType} context Optional context type to specify the context from which the event is triggered.
|
|
22691
23138
|
* Use ContextType.Search for search answer context, ContextType.Answer for answer/explore context,
|
|
22692
23139
|
* ContextType.Liveboard for liveboard context, or ContextType.Spotter for spotter context.
|
|
@@ -22703,7 +23150,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22703
23150
|
* ```
|
|
22704
23151
|
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl (for context parameter)
|
|
22705
23152
|
*/
|
|
22706
|
-
async trigger(messageType,
|
|
23153
|
+
async trigger(messageType,
|
|
23154
|
+
// Contract shape is the contextual type: payload fields autocomplete
|
|
23155
|
+
// and unknown fields on object literals are flagged. Strict checks
|
|
23156
|
+
// land in SDK 1.54.0 — see TriggerData.
|
|
23157
|
+
data = {}, context) {
|
|
22707
23158
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
22708
23159
|
if (!this.isRendered) {
|
|
22709
23160
|
this.handleError({
|
|
@@ -22991,20 +23442,27 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22991
23442
|
// have moved on to UpdateEmbedParams supported clusters
|
|
22992
23443
|
// this.validatePreRenderViewConfig(this.viewConfig); removed in #517
|
|
22993
23444
|
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
22994
|
-
|
|
22995
|
-
|
|
22996
|
-
|
|
22997
|
-
|
|
22998
|
-
|
|
22999
|
-
|
|
23000
|
-
|
|
23001
|
-
|
|
23002
|
-
|
|
23003
|
-
|
|
23004
|
-
|
|
23005
|
-
|
|
23006
|
-
|
|
23007
|
-
|
|
23445
|
+
// Created synchronously: a queued navigation needs something to await
|
|
23446
|
+
// whether the container is already loaded or not.
|
|
23447
|
+
this.preRenderParamsApplied = new Promise((resolve) => {
|
|
23448
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
23449
|
+
try {
|
|
23450
|
+
const params = await this.getUpdateEmbedParamsObject();
|
|
23451
|
+
this.trigger(exports.HostEvent.UpdateEmbedParams, params);
|
|
23452
|
+
}
|
|
23453
|
+
catch (error) {
|
|
23454
|
+
logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
|
|
23455
|
+
this.handleError({
|
|
23456
|
+
errorType: ErrorDetailsTypes.API,
|
|
23457
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
|
|
23458
|
+
code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
|
|
23459
|
+
error: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
23460
|
+
});
|
|
23461
|
+
}
|
|
23462
|
+
finally {
|
|
23463
|
+
setTimeout(resolve, UPDATE_EMBED_PARAMS_SETTLE_MS);
|
|
23464
|
+
}
|
|
23465
|
+
});
|
|
23008
23466
|
});
|
|
23009
23467
|
}
|
|
23010
23468
|
/**
|
|
@@ -23080,6 +23538,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23080
23538
|
if (this.iFrame) {
|
|
23081
23539
|
this.setupFullscreenChangeHandler();
|
|
23082
23540
|
}
|
|
23541
|
+
// Last, so everything above still sees the instance being taken over from.
|
|
23542
|
+
this.takeOverPreRender();
|
|
23083
23543
|
return this;
|
|
23084
23544
|
}
|
|
23085
23545
|
getPreRenderPlaceHolderElement() {
|
|
@@ -23282,6 +23742,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23282
23742
|
* ```
|
|
23283
23743
|
*/
|
|
23284
23744
|
on(messageType, callback, options = { start: false }) {
|
|
23745
|
+
// Mirror the base TsEmbed.on generic signature so the enriched
|
|
23746
|
+
// EmbedEventPayload (e.g. CustomAction's answerService) flows through
|
|
23747
|
+
// the override too, and the class hierarchy stays assignable.
|
|
23285
23748
|
const eventType = this.getCompatibleEventType(messageType);
|
|
23286
23749
|
return super.on(eventType, callback, options);
|
|
23287
23750
|
}
|
|
@@ -23451,7 +23914,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23451
23914
|
}
|
|
23452
23915
|
getEmbedParamsObject() {
|
|
23453
23916
|
var _a;
|
|
23454
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, isThisPeriodInDateFiltersEnabled, newChartsLibrary, } = this.viewConfig;
|
|
23917
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, isThisPeriodInDateFiltersEnabled, newChartsLibrary, hideAnswerEditPanel, } = this.viewConfig;
|
|
23455
23918
|
const queryParams = this.getBaseQueryParams();
|
|
23456
23919
|
queryParams[Param.HideActions] = [
|
|
23457
23920
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -23474,6 +23937,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23474
23937
|
if (enableSearchAssist) {
|
|
23475
23938
|
queryParams[Param.EnableSearchAssist] = true;
|
|
23476
23939
|
}
|
|
23940
|
+
if (hideAnswerEditPanel !== undefined) {
|
|
23941
|
+
queryParams[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
|
|
23942
|
+
}
|
|
23477
23943
|
if (hideResults) {
|
|
23478
23944
|
queryParams[Param.HideResult] = true;
|
|
23479
23945
|
}
|
|
@@ -23559,6 +24025,270 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23559
24025
|
}
|
|
23560
24026
|
};
|
|
23561
24027
|
|
|
24028
|
+
/**
|
|
24029
|
+
* Copyright (c) 2025
|
|
24030
|
+
*
|
|
24031
|
+
* Full-height support for the Liveboard and app embeds.
|
|
24032
|
+
* @summary Full height
|
|
24033
|
+
*/
|
|
24034
|
+
/**
|
|
24035
|
+
* The height the embed falls back to when the host app has not configured
|
|
24036
|
+
* `minimumHeight` or `defaultHeight`.
|
|
24037
|
+
*/
|
|
24038
|
+
const DEFAULT_MINIMUM_HEIGHT = 500;
|
|
24039
|
+
/**
|
|
24040
|
+
* Routes that are part of the Liveboard experience itself. Navigating between
|
|
24041
|
+
* these does not reset the frame height, because the ThoughtSpot app keeps
|
|
24042
|
+
* reporting a height of its own for them.
|
|
24043
|
+
*/
|
|
24044
|
+
const LIVEBOARD_RELATED_ROUTES = [
|
|
24045
|
+
'/pinboard/',
|
|
24046
|
+
'/insights/pinboard/',
|
|
24047
|
+
'/schedules/',
|
|
24048
|
+
'/embed/viz/',
|
|
24049
|
+
'/embed/insights/viz/',
|
|
24050
|
+
'/liveboard/',
|
|
24051
|
+
'/insights/liveboard/',
|
|
24052
|
+
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
24053
|
+
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
24054
|
+
];
|
|
24055
|
+
/**
|
|
24056
|
+
* Owns every piece of full-height behavior for an embed: the height
|
|
24057
|
+
* negotiation with the ThoughtSpot app, the query parameters that switch the
|
|
24058
|
+
* feature on, and the viewport listeners that drive lazy loading.
|
|
24059
|
+
*
|
|
24060
|
+
* The controller is inert unless `fullHeight` is enabled, so embeds can create
|
|
24061
|
+
* one unconditionally.
|
|
24062
|
+
*/
|
|
24063
|
+
class FullHeightController {
|
|
24064
|
+
constructor(viewConfig, host) {
|
|
24065
|
+
this.host = host;
|
|
24066
|
+
this.scrollContainers = [];
|
|
24067
|
+
/**
|
|
24068
|
+
* Sets the frame height to the height reported by the ThoughtSpot app,
|
|
24069
|
+
* never going below the configured minimum.
|
|
24070
|
+
*/
|
|
24071
|
+
this.handleEmbedHeight = (payload) => {
|
|
24072
|
+
const height = Number(payload === null || payload === void 0 ? void 0 : payload.data);
|
|
24073
|
+
if (!isNaN(height)) {
|
|
24074
|
+
this.host.setFrameHeight(Math.max(height, this.minimumHeight));
|
|
24075
|
+
}
|
|
24076
|
+
this.sendVisibleCoordinates();
|
|
24077
|
+
};
|
|
24078
|
+
/**
|
|
24079
|
+
* Answers the app's request for the center of the visible embed region.
|
|
24080
|
+
*/
|
|
24081
|
+
this.handleEmbedIframeCenter = (payload, responder) => {
|
|
24082
|
+
const iframe = this.host.getIframe();
|
|
24083
|
+
if (!iframe) {
|
|
24084
|
+
return;
|
|
24085
|
+
}
|
|
24086
|
+
responder === null || responder === void 0 ? void 0 : responder({
|
|
24087
|
+
type: exports.EmbedEvent.EmbedIframeCenter,
|
|
24088
|
+
data: calculateElementCenter(iframe),
|
|
24089
|
+
});
|
|
24090
|
+
};
|
|
24091
|
+
/**
|
|
24092
|
+
* Answers the app's request for the currently visible embed coordinates.
|
|
24093
|
+
*/
|
|
24094
|
+
this.handleRequestVisibleCoordinates = (payload, responder) => {
|
|
24095
|
+
logger$3.info('Sending RequestVisibleEmbedCoordinates', payload);
|
|
24096
|
+
responder === null || responder === void 0 ? void 0 : responder({
|
|
24097
|
+
type: exports.EmbedEvent.RequestVisibleEmbedCoordinates,
|
|
24098
|
+
data: this.getVisibleCoordinates(),
|
|
24099
|
+
});
|
|
24100
|
+
};
|
|
24101
|
+
/**
|
|
24102
|
+
* Resets the frame height when the app navigates away from a Liveboard,
|
|
24103
|
+
* since only Liveboard routes report a height of their own.
|
|
24104
|
+
*/
|
|
24105
|
+
this.handleRouteChange = (payload) => {
|
|
24106
|
+
var _a, _b;
|
|
24107
|
+
const currentPath = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.currentPath;
|
|
24108
|
+
if (!currentPath) {
|
|
24109
|
+
return;
|
|
24110
|
+
}
|
|
24111
|
+
if (LIVEBOARD_RELATED_ROUTES.some((route) => currentPath.startsWith(route))) {
|
|
24112
|
+
return;
|
|
24113
|
+
}
|
|
24114
|
+
this.host.setFrameHeight(((_b = this.config.frameParams) === null || _b === void 0 ? void 0 : _b.height) || this.minimumHeight);
|
|
24115
|
+
};
|
|
24116
|
+
/**
|
|
24117
|
+
* Pushes the visible embed region to the app so it can decide which
|
|
24118
|
+
* visualizations to load.
|
|
24119
|
+
*/
|
|
24120
|
+
this.sendVisibleCoordinates = () => {
|
|
24121
|
+
if (!this.isLazyLoadEnabled) {
|
|
24122
|
+
return;
|
|
24123
|
+
}
|
|
24124
|
+
const coordinates = this.getVisibleCoordinates();
|
|
24125
|
+
if (coordinates) {
|
|
24126
|
+
this.host.trigger(exports.HostEvent.VisibleEmbedCoordinates, coordinates);
|
|
24127
|
+
}
|
|
24128
|
+
};
|
|
24129
|
+
this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
|
|
24130
|
+
this.registerEventHandlers();
|
|
24131
|
+
}
|
|
24132
|
+
/**
|
|
24133
|
+
* The view config the controller runs on: the host app's own config with
|
|
24134
|
+
* the lazy-loading defaults filled in. Read-only, so the only way to change
|
|
24135
|
+
* it is through the setter, which re-resolves the defaults.
|
|
24136
|
+
*/
|
|
24137
|
+
get viewConfig() {
|
|
24138
|
+
return this.config;
|
|
24139
|
+
}
|
|
24140
|
+
/**
|
|
24141
|
+
* Replaces the view config the controller runs on and re-resolves the
|
|
24142
|
+
* lazy-loading defaults against it. The config the caller passes is never
|
|
24143
|
+
* written to; the controller keeps a copy of its own.
|
|
24144
|
+
*/
|
|
24145
|
+
set viewConfig(viewConfig) {
|
|
24146
|
+
this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
|
|
24147
|
+
}
|
|
24148
|
+
/**
|
|
24149
|
+
* The view config with the lazy-loading settings the embed falls back to
|
|
24150
|
+
* when the host app has not chosen its own.
|
|
24151
|
+
*
|
|
24152
|
+
* Pure by design: it returns a new config rather than writing to the one it
|
|
24153
|
+
* is given, so the host app's object is left untouched.
|
|
24154
|
+
* @param viewConfig The embed's view config
|
|
24155
|
+
* @returns A copy with the defaults filled in, host app choices preserved
|
|
24156
|
+
*/
|
|
24157
|
+
static withLazyLoadingDefaults(viewConfig) {
|
|
24158
|
+
return {
|
|
24159
|
+
...viewConfig,
|
|
24160
|
+
lazyLoadingForFullHeight: viewConfig.lazyLoadingForFullHeight === undefined
|
|
24161
|
+
? true
|
|
24162
|
+
: viewConfig.lazyLoadingForFullHeight,
|
|
24163
|
+
enableScrollableContainerLazyLoading: viewConfig.enableScrollableContainerLazyLoading === undefined
|
|
24164
|
+
? true
|
|
24165
|
+
: viewConfig.enableScrollableContainerLazyLoading,
|
|
24166
|
+
lazyLoadingMargin: viewConfig.lazyLoadingMargin === undefined
|
|
24167
|
+
? DEFAULT_LAZY_LOADING_MARGIN
|
|
24168
|
+
: viewConfig.lazyLoadingMargin,
|
|
24169
|
+
};
|
|
24170
|
+
}
|
|
24171
|
+
/**
|
|
24172
|
+
* Whether the host app asked for a full-height embed.
|
|
24173
|
+
*/
|
|
24174
|
+
get isEnabled() {
|
|
24175
|
+
return this.config.fullHeight === true;
|
|
24176
|
+
}
|
|
24177
|
+
/**
|
|
24178
|
+
* Whether visualizations should load as they scroll into view, which
|
|
24179
|
+
* requires the SDK to report the visible region of the embed.
|
|
24180
|
+
*/
|
|
24181
|
+
get isLazyLoadEnabled() {
|
|
24182
|
+
return this.isEnabled && !!this.config.lazyLoadingForFullHeight;
|
|
24183
|
+
}
|
|
24184
|
+
/**
|
|
24185
|
+
* The floor for the frame height. `defaultHeight` is the deprecated
|
|
24186
|
+
* spelling of `minimumHeight` and is still honored for compatibility.
|
|
24187
|
+
*/
|
|
24188
|
+
get minimumHeight() {
|
|
24189
|
+
const { minimumHeight, defaultHeight } = this.config;
|
|
24190
|
+
return minimumHeight || defaultHeight || DEFAULT_MINIMUM_HEIGHT;
|
|
24191
|
+
}
|
|
24192
|
+
/**
|
|
24193
|
+
* Registers the embed event handlers the feature depends on. Called from
|
|
24194
|
+
* the constructor, so the handlers are in place before `render`.
|
|
24195
|
+
*/
|
|
24196
|
+
registerEventHandlers() {
|
|
24197
|
+
if (!this.isEnabled) {
|
|
24198
|
+
return;
|
|
24199
|
+
}
|
|
24200
|
+
this.host.on(exports.EmbedEvent.RouteChange, this.handleRouteChange);
|
|
24201
|
+
this.host.on(exports.EmbedEvent.EmbedHeight, this.handleEmbedHeight);
|
|
24202
|
+
this.host.on(exports.EmbedEvent.EmbedIframeCenter, this.handleEmbedIframeCenter);
|
|
24203
|
+
this.host.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.handleRequestVisibleCoordinates);
|
|
24204
|
+
}
|
|
24205
|
+
/**
|
|
24206
|
+
* Adds the full-height query parameters to the embed URL params.
|
|
24207
|
+
* @param params The query parameters being built by the embed
|
|
24208
|
+
*/
|
|
24209
|
+
addQueryParams(params) {
|
|
24210
|
+
if (!this.isEnabled) {
|
|
24211
|
+
return;
|
|
24212
|
+
}
|
|
24213
|
+
params[Param.fullHeight] = true;
|
|
24214
|
+
if (!this.config.lazyLoadingForFullHeight) {
|
|
24215
|
+
return;
|
|
24216
|
+
}
|
|
24217
|
+
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
24218
|
+
if (isValidCssMargin(this.config.lazyLoadingMargin)) {
|
|
24219
|
+
params[Param.RootMarginForLazyLoad] = this.config.lazyLoadingMargin;
|
|
24220
|
+
}
|
|
24221
|
+
}
|
|
24222
|
+
/**
|
|
24223
|
+
* Attaches the viewport listeners that keep lazy loading in sync. Call this
|
|
24224
|
+
* once the embed has rendered and the iframe exists.
|
|
24225
|
+
*/
|
|
24226
|
+
onRender() {
|
|
24227
|
+
this.registerLazyLoadListeners();
|
|
24228
|
+
}
|
|
24229
|
+
/**
|
|
24230
|
+
* Detaches every listener and observer owned by the controller.
|
|
24231
|
+
*/
|
|
24232
|
+
destroy() {
|
|
24233
|
+
this.unregisterLazyLoadListeners();
|
|
24234
|
+
}
|
|
24235
|
+
getVisibleCoordinates() {
|
|
24236
|
+
const iframe = this.host.getIframe();
|
|
24237
|
+
if (!iframe) {
|
|
24238
|
+
return null;
|
|
24239
|
+
}
|
|
24240
|
+
return calculateVisibleElementData(iframe, this.config.enableScrollableContainerLazyLoading);
|
|
24241
|
+
}
|
|
24242
|
+
registerLazyLoadListeners() {
|
|
24243
|
+
if (!this.isLazyLoadEnabled || !this.host.getIframe()) {
|
|
24244
|
+
return;
|
|
24245
|
+
}
|
|
24246
|
+
// Re-registering is safe: drop whatever a previous render attached.
|
|
24247
|
+
this.unregisterLazyLoadListeners();
|
|
24248
|
+
// TODO: Use passive: true, install modernizr to check for passive
|
|
24249
|
+
window.addEventListener('resize', this.sendVisibleCoordinates);
|
|
24250
|
+
window.addEventListener('scroll', this.sendVisibleCoordinates, true);
|
|
24251
|
+
if (!this.config.enableScrollableContainerLazyLoading) {
|
|
24252
|
+
return;
|
|
24253
|
+
}
|
|
24254
|
+
this.observeScrollableContainers();
|
|
24255
|
+
}
|
|
24256
|
+
/**
|
|
24257
|
+
* Tracks the ancestors that can scroll or clip the embed, so the visible
|
|
24258
|
+
* region stays correct when the embed lives inside its own scroll
|
|
24259
|
+
* container rather than the page.
|
|
24260
|
+
*/
|
|
24261
|
+
observeScrollableContainers() {
|
|
24262
|
+
const iFrame = this.host.getIframe();
|
|
24263
|
+
this.scrollContainers = getScrollableAncestors(iFrame);
|
|
24264
|
+
this.scrollContainers.forEach((scrollContainer) => {
|
|
24265
|
+
scrollContainer.addEventListener('scroll', this.sendVisibleCoordinates);
|
|
24266
|
+
});
|
|
24267
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
24268
|
+
return;
|
|
24269
|
+
}
|
|
24270
|
+
const resizeTargets = new Set([iFrame.parentElement, ...getEffectiveClippingAncestors(iFrame)].filter(Boolean));
|
|
24271
|
+
this.resizeObserver = new ResizeObserver(this.sendVisibleCoordinates);
|
|
24272
|
+
resizeTargets.forEach((resizeTarget) => {
|
|
24273
|
+
this.resizeObserver.observe(resizeTarget);
|
|
24274
|
+
});
|
|
24275
|
+
}
|
|
24276
|
+
unregisterLazyLoadListeners() {
|
|
24277
|
+
var _a;
|
|
24278
|
+
if (!this.isLazyLoadEnabled) {
|
|
24279
|
+
return;
|
|
24280
|
+
}
|
|
24281
|
+
window.removeEventListener('resize', this.sendVisibleCoordinates);
|
|
24282
|
+
window.removeEventListener('scroll', this.sendVisibleCoordinates, true);
|
|
24283
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
24284
|
+
this.resizeObserver = undefined;
|
|
24285
|
+
this.scrollContainers.forEach((scrollContainer) => {
|
|
24286
|
+
scrollContainer.removeEventListener('scroll', this.sendVisibleCoordinates);
|
|
24287
|
+
});
|
|
24288
|
+
this.scrollContainers = [];
|
|
24289
|
+
}
|
|
24290
|
+
}
|
|
24291
|
+
|
|
23562
24292
|
/**
|
|
23563
24293
|
* Resolves enablePastConversationsSidebar with
|
|
23564
24294
|
* spotterSidebarConfig taking precedence over the
|
|
@@ -23794,73 +24524,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23794
24524
|
constructor(domSelector, viewConfig) {
|
|
23795
24525
|
viewConfig.embedComponentType = 'AppEmbed';
|
|
23796
24526
|
super(domSelector, viewConfig);
|
|
23797
|
-
this.defaultHeight = 500;
|
|
23798
|
-
this.lazyLoadScrollContainers = [];
|
|
23799
|
-
this.sendFullHeightLazyLoadData = () => {
|
|
23800
|
-
const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
23801
|
-
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
23802
|
-
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
23803
|
-
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
23804
|
-
}
|
|
23805
|
-
};
|
|
23806
|
-
/**
|
|
23807
|
-
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
23808
|
-
* It is used to send the visible coordinates data to the host application.
|
|
23809
|
-
* @param data The event payload
|
|
23810
|
-
* @param responder The responder function
|
|
23811
|
-
*/
|
|
23812
|
-
this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
|
|
23813
|
-
logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
23814
|
-
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
23815
|
-
responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
23816
|
-
};
|
|
23817
|
-
/**
|
|
23818
|
-
* Set the iframe height as per the computed height received
|
|
23819
|
-
* from the ThoughtSpot app.
|
|
23820
|
-
* @param data The event payload
|
|
23821
|
-
*/
|
|
23822
|
-
this.updateIFrameHeight = (data) => {
|
|
23823
|
-
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
23824
|
-
this.sendFullHeightLazyLoadData();
|
|
23825
|
-
};
|
|
23826
|
-
this.embedIframeCenter = (data, responder) => {
|
|
23827
|
-
const obj = this.getIframeCenter();
|
|
23828
|
-
responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
|
|
23829
|
-
};
|
|
23830
|
-
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
23831
|
-
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
23832
|
-
const liveboardRelatedRoutes = [
|
|
23833
|
-
'/pinboard/',
|
|
23834
|
-
'/insights/pinboard/',
|
|
23835
|
-
'/schedules/',
|
|
23836
|
-
'/embed/viz/',
|
|
23837
|
-
'/embed/insights/viz/',
|
|
23838
|
-
'/liveboard/',
|
|
23839
|
-
'/insights/liveboard/',
|
|
23840
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
23841
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
23842
|
-
];
|
|
23843
|
-
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
23844
|
-
// Ignore the height reset of the frame, if the navigation is
|
|
23845
|
-
// only within the liveboard page.
|
|
23846
|
-
return;
|
|
23847
|
-
}
|
|
23848
|
-
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
23849
|
-
};
|
|
23850
24527
|
if (this.viewConfig.fullHeight === true) {
|
|
23851
|
-
|
|
23852
|
-
this.
|
|
23853
|
-
|
|
23854
|
-
|
|
23855
|
-
|
|
23856
|
-
|
|
23857
|
-
|
|
23858
|
-
|
|
23859
|
-
|
|
23860
|
-
|
|
23861
|
-
this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
23862
|
-
this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
23863
|
-
this.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
|
|
24528
|
+
this.fullHeightController = new FullHeightController(this.viewConfig, {
|
|
24529
|
+
getIframe: () => this.iFrame,
|
|
24530
|
+
setFrameHeight: (height) => this.setIFrameHeight(height),
|
|
24531
|
+
on: (eventType, callback) => {
|
|
24532
|
+
this.on(eventType, callback);
|
|
24533
|
+
},
|
|
24534
|
+
trigger: (hostEvent, data) => {
|
|
24535
|
+
this.trigger(hostEvent, data);
|
|
24536
|
+
},
|
|
24537
|
+
});
|
|
23864
24538
|
}
|
|
23865
24539
|
}
|
|
23866
24540
|
/**
|
|
@@ -23891,7 +24565,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23891
24565
|
return getQueryParamString(params, true);
|
|
23892
24566
|
}
|
|
23893
24567
|
getEmbedParamsObject() {
|
|
23894
|
-
|
|
24568
|
+
var _a;
|
|
24569
|
+
const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, newConnectionsExperience, dataPanelV2 = true, updatedSpotterExperience, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, hideHomepageLeftNav = false, modularHomeExperience, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.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;
|
|
23895
24570
|
let params = {};
|
|
23896
24571
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
23897
24572
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -23927,6 +24602,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23927
24602
|
if (!isUndefined$1(coverAndFilterOptionInPDF)) {
|
|
23928
24603
|
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
23929
24604
|
}
|
|
24605
|
+
if (!isUndefined$1(hideAnswerEditPanel)) {
|
|
24606
|
+
params[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
|
|
24607
|
+
}
|
|
23930
24608
|
params = this.getBaseQueryParams(params);
|
|
23931
24609
|
if (!isUndefined$1(updatedSpotterChatPrompt)) {
|
|
23932
24610
|
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
@@ -23973,15 +24651,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23973
24651
|
if (hideNotification) {
|
|
23974
24652
|
params[Param.HideNotification] = !!hideNotification;
|
|
23975
24653
|
}
|
|
23976
|
-
|
|
23977
|
-
params[Param.fullHeight] = true;
|
|
23978
|
-
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
23979
|
-
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
23980
|
-
if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
|
|
23981
|
-
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
23982
|
-
}
|
|
23983
|
-
}
|
|
23984
|
-
}
|
|
24654
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
|
|
23985
24655
|
if (tag) {
|
|
23986
24656
|
params[Param.Tag] = tag;
|
|
23987
24657
|
}
|
|
@@ -24048,7 +24718,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
24048
24718
|
if (isContinuousLiveboardPDFEnabled !== undefined) {
|
|
24049
24719
|
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
24050
24720
|
}
|
|
24051
|
-
this.defaultHeight = minimumHeight || this.defaultHeight;
|
|
24052
24721
|
if (enableLiveboardDataCache !== undefined) {
|
|
24053
24722
|
params[Param.EnableLiveboardDataCache] = enableLiveboardDataCache;
|
|
24054
24723
|
}
|
|
@@ -24187,52 +24856,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
24187
24856
|
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
24188
24857
|
*/
|
|
24189
24858
|
destroy() {
|
|
24859
|
+
var _a;
|
|
24190
24860
|
super.destroy();
|
|
24191
|
-
this.
|
|
24861
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
24192
24862
|
}
|
|
24193
24863
|
postRender() {
|
|
24194
|
-
this.registerLazyLoadEvents();
|
|
24195
|
-
}
|
|
24196
|
-
registerLazyLoadEvents() {
|
|
24197
|
-
if (!this.iFrame) {
|
|
24198
|
-
return;
|
|
24199
|
-
}
|
|
24200
|
-
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
24201
|
-
this.unregisterLazyLoadEvents();
|
|
24202
|
-
// TODO: Use passive: true, install modernizr to check for passive
|
|
24203
|
-
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24204
|
-
window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24205
|
-
if (!this.viewConfig.enableScrollableContainerLazyLoading) {
|
|
24206
|
-
return;
|
|
24207
|
-
}
|
|
24208
|
-
this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
|
|
24209
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24210
|
-
scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24211
|
-
});
|
|
24212
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
24213
|
-
const resizeTargets = new Set([
|
|
24214
|
-
this.iFrame.parentElement,
|
|
24215
|
-
...getEffectiveClippingAncestors(this.iFrame),
|
|
24216
|
-
].filter(Boolean));
|
|
24217
|
-
this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
|
|
24218
|
-
resizeTargets.forEach((resizeTarget) => {
|
|
24219
|
-
this.lazyLoadResizeObserver.observe(resizeTarget);
|
|
24220
|
-
});
|
|
24221
|
-
}
|
|
24222
|
-
}
|
|
24223
|
-
}
|
|
24224
|
-
unregisterLazyLoadEvents() {
|
|
24225
24864
|
var _a;
|
|
24226
|
-
|
|
24227
|
-
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24228
|
-
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24229
|
-
(_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
24230
|
-
this.lazyLoadResizeObserver = undefined;
|
|
24231
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24232
|
-
scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24233
|
-
});
|
|
24234
|
-
this.lazyLoadScrollContainers = [];
|
|
24235
|
-
}
|
|
24865
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
|
|
24236
24866
|
}
|
|
24237
24867
|
/**
|
|
24238
24868
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
@@ -24327,6 +24957,10 @@ query GetEurekaVizSnapshots(
|
|
|
24327
24957
|
* @summary Liveboard & visualization embed
|
|
24328
24958
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
24329
24959
|
*/
|
|
24960
|
+
// Home unmounts the liveboard container, which is how its state gets cleared. The
|
|
24961
|
+
// settle window gives the container time to do it before we ask for the liveboard back.
|
|
24962
|
+
const HOME_ROUTE = 'home';
|
|
24963
|
+
const HOME_SETTLE_MS = 200;
|
|
24330
24964
|
/**
|
|
24331
24965
|
* Embed a ThoughtSpot Liveboard or visualization. When rendered it already
|
|
24332
24966
|
* waits for the authentication to complete, so you need not wait for
|
|
@@ -24346,59 +24980,6 @@ query GetEurekaVizSnapshots(
|
|
|
24346
24980
|
constructor(domSelector, viewConfig) {
|
|
24347
24981
|
viewConfig.embedComponentType = 'LiveboardEmbed';
|
|
24348
24982
|
super(domSelector, viewConfig);
|
|
24349
|
-
this.defaultHeight = 500;
|
|
24350
|
-
this.lazyLoadScrollContainers = [];
|
|
24351
|
-
this.sendFullHeightLazyLoadData = () => {
|
|
24352
|
-
const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
24353
|
-
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
24354
|
-
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
24355
|
-
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
24356
|
-
}
|
|
24357
|
-
};
|
|
24358
|
-
/**
|
|
24359
|
-
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
24360
|
-
* It is used to send the visible coordinates data to the host application.
|
|
24361
|
-
* @param data The event payload
|
|
24362
|
-
* @param responder The responder function
|
|
24363
|
-
*/
|
|
24364
|
-
this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
|
|
24365
|
-
logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
24366
|
-
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
24367
|
-
responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
24368
|
-
};
|
|
24369
|
-
/**
|
|
24370
|
-
* Set the iframe height as per the computed height received
|
|
24371
|
-
* from the ThoughtSpot app.
|
|
24372
|
-
* @param data The event payload
|
|
24373
|
-
*/
|
|
24374
|
-
this.updateIFrameHeight = (data) => {
|
|
24375
|
-
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
24376
|
-
this.sendFullHeightLazyLoadData();
|
|
24377
|
-
};
|
|
24378
|
-
this.embedIframeCenter = (data, responder) => {
|
|
24379
|
-
const obj = this.getIframeCenter();
|
|
24380
|
-
responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
|
|
24381
|
-
};
|
|
24382
|
-
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
24383
|
-
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
24384
|
-
const liveboardRelatedRoutes = [
|
|
24385
|
-
'/pinboard/',
|
|
24386
|
-
'/insights/pinboard/',
|
|
24387
|
-
'/schedules/',
|
|
24388
|
-
'/embed/viz/',
|
|
24389
|
-
'/embed/insights/viz/',
|
|
24390
|
-
'/liveboard/',
|
|
24391
|
-
'/insights/liveboard/',
|
|
24392
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
24393
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
24394
|
-
];
|
|
24395
|
-
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
24396
|
-
// Ignore the height reset of the frame, if the navigation is
|
|
24397
|
-
// only within the liveboard page.
|
|
24398
|
-
return;
|
|
24399
|
-
}
|
|
24400
|
-
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
24401
|
-
};
|
|
24402
24983
|
/**
|
|
24403
24984
|
* @hidden
|
|
24404
24985
|
* Internal state to track the current liveboard id.
|
|
@@ -24412,22 +24993,19 @@ query GetEurekaVizSnapshots(
|
|
|
24412
24993
|
};
|
|
24413
24994
|
if (this.viewConfig.fullHeight === true) {
|
|
24414
24995
|
if (this.viewConfig.vizId) {
|
|
24415
|
-
logger$3.warn('Full height is currently only supported for Liveboard embeds.'
|
|
24416
|
-
'Using full height with vizId might lead to unexpected behavior.');
|
|
24417
|
-
}
|
|
24418
|
-
if (this.viewConfig.lazyLoadingForFullHeight === undefined) {
|
|
24419
|
-
this.viewConfig.lazyLoadingForFullHeight = true;
|
|
24420
|
-
}
|
|
24421
|
-
if (this.viewConfig.enableScrollableContainerLazyLoading === undefined) {
|
|
24422
|
-
this.viewConfig.enableScrollableContainerLazyLoading = true;
|
|
24996
|
+
logger$3.warn('Full height is currently only supported for Liveboard embeds.'
|
|
24997
|
+
+ 'Using full height with vizId might lead to unexpected behavior.');
|
|
24423
24998
|
}
|
|
24424
|
-
|
|
24425
|
-
this.
|
|
24426
|
-
|
|
24427
|
-
|
|
24428
|
-
|
|
24429
|
-
|
|
24430
|
-
|
|
24999
|
+
this.fullHeightController = new FullHeightController(this.viewConfig, {
|
|
25000
|
+
getIframe: () => this.iFrame,
|
|
25001
|
+
setFrameHeight: (height) => this.setIFrameHeight(height),
|
|
25002
|
+
on: (eventType, callback) => {
|
|
25003
|
+
this.on(eventType, callback);
|
|
25004
|
+
},
|
|
25005
|
+
trigger: (hostEvent, data) => {
|
|
25006
|
+
this.trigger(hostEvent, data);
|
|
25007
|
+
},
|
|
25008
|
+
});
|
|
24431
25009
|
}
|
|
24432
25010
|
}
|
|
24433
25011
|
async getAppInitData() {
|
|
@@ -24445,21 +25023,13 @@ query GetEurekaVizSnapshots(
|
|
|
24445
25023
|
return queryParams;
|
|
24446
25024
|
}
|
|
24447
25025
|
getEmbedParamsObject() {
|
|
25026
|
+
var _a;
|
|
24448
25027
|
let params = {};
|
|
24449
25028
|
params = this.getBaseQueryParams(params);
|
|
24450
|
-
const { enableVizTransformations,
|
|
25029
|
+
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;
|
|
24451
25030
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
24452
25031
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
24453
|
-
|
|
24454
|
-
params[Param.fullHeight] = true;
|
|
24455
|
-
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
24456
|
-
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
24457
|
-
if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
|
|
24458
|
-
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
24459
|
-
}
|
|
24460
|
-
}
|
|
24461
|
-
}
|
|
24462
|
-
this.defaultHeight = minimumHeight || defaultHeight || this.defaultHeight;
|
|
25032
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
|
|
24463
25033
|
if (enableVizTransformations !== undefined) {
|
|
24464
25034
|
params[Param.EnableVizTransformations] = enableVizTransformations.toString();
|
|
24465
25035
|
}
|
|
@@ -24686,19 +25256,45 @@ query GetEurekaVizSnapshots(
|
|
|
24686
25256
|
}
|
|
24687
25257
|
beforePrerenderVisible() {
|
|
24688
25258
|
super.beforePrerenderVisible();
|
|
24689
|
-
|
|
24690
|
-
|
|
24691
|
-
|
|
24692
|
-
|
|
24693
|
-
|
|
24694
|
-
|
|
24695
|
-
|
|
24696
|
-
|
|
24697
|
-
|
|
24698
|
-
|
|
25259
|
+
// Captured before showPreRender() hands the wrapper over to this instance.
|
|
25260
|
+
// Itself means a hide/show, not a hand-over, so there is nothing stale to clear.
|
|
25261
|
+
const previous = this.getPreRenderObj();
|
|
25262
|
+
const showing = previous === this ? undefined : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
|
|
25263
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
25264
|
+
// Without this the params callback suspends on its await and Navigate
|
|
25265
|
+
// goes out first, so the container loads with the previous config's filters.
|
|
25266
|
+
await this.preRenderParamsApplied;
|
|
25267
|
+
if (this.isShowingLiveboardRoute(showing)) {
|
|
25268
|
+
// Navigate to the route we are already on is a no-op, so the liveboard
|
|
25269
|
+
// keeps its state. Home unmounts the container, which clears it.
|
|
25270
|
+
this.trigger(exports.HostEvent.Navigate, HOME_ROUTE)
|
|
25271
|
+
.catch((error) => logger$3.warn('Could not route via home', error));
|
|
25272
|
+
// Not awaited above: the container never acks Navigate, so that promise
|
|
25273
|
+
// only settles on the 30s trigger timeout.
|
|
25274
|
+
await new Promise((resolve) => {
|
|
25275
|
+
setTimeout(resolve, HOME_SETTLE_MS);
|
|
25276
|
+
});
|
|
24699
25277
|
}
|
|
25278
|
+
this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId, this.viewConfig.personalizedViewId);
|
|
25279
|
+
this.currentLiveboardState = {
|
|
25280
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
25281
|
+
vizId: this.viewConfig.vizId,
|
|
25282
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
25283
|
+
personalizedViewId: this.viewConfig.personalizedViewId,
|
|
25284
|
+
};
|
|
24700
25285
|
});
|
|
24701
25286
|
}
|
|
25287
|
+
// The whole route, not just the liveboard id: the path is built from the viz, tab
|
|
25288
|
+
// and view too, so a same-liveboard show onto another tab is a real navigation.
|
|
25289
|
+
isShowingLiveboardRoute(showing) {
|
|
25290
|
+
if (!(showing === null || showing === void 0 ? void 0 : showing.liveboardId))
|
|
25291
|
+
return false;
|
|
25292
|
+
const { liveboardId, vizId, activeTabId, personalizedViewId, } = this.viewConfig;
|
|
25293
|
+
return showing.liveboardId === liveboardId
|
|
25294
|
+
&& showing.vizId === vizId
|
|
25295
|
+
&& showing.activeTabId === activeTabId
|
|
25296
|
+
&& showing.personalizedViewId === personalizedViewId;
|
|
25297
|
+
}
|
|
24702
25298
|
async handleRenderForPrerender() {
|
|
24703
25299
|
if (isUndefined$1(this.viewConfig.liveboardId)) {
|
|
24704
25300
|
return this.prerenderGeneric();
|
|
@@ -24707,11 +25303,16 @@ query GetEurekaVizSnapshots(
|
|
|
24707
25303
|
}
|
|
24708
25304
|
/**
|
|
24709
25305
|
* Triggers an event to the embedded app
|
|
25306
|
+
* Payload typing follows {@link TsEmbed.trigger}: unknown fields fail to compile
|
|
25307
|
+
* from SDK 1.52.0; strict contract checks land in SDK 1.54.0.
|
|
24710
25308
|
* @param {HostEvent} messageType The event type
|
|
24711
|
-
* @param {
|
|
25309
|
+
* @param {TriggerData} data The payload, typed against the event's contract
|
|
24712
25310
|
* @returns A promise that resolves with the response from the embedded app
|
|
24713
25311
|
*/
|
|
24714
|
-
trigger(messageType,
|
|
25312
|
+
trigger(messageType,
|
|
25313
|
+
// Mirror TsEmbed.trigger: contract shape is the contextual type and
|
|
25314
|
+
// unknown fields on object literals are flagged. Strict in SDK 1.54.0.
|
|
25315
|
+
data = {}, context) {
|
|
24715
25316
|
const dataWithVizId = data;
|
|
24716
25317
|
if (messageType === exports.HostEvent.SetActiveTab) {
|
|
24717
25318
|
this.setActiveTab(data);
|
|
@@ -24727,52 +25328,13 @@ query GetEurekaVizSnapshots(
|
|
|
24727
25328
|
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
24728
25329
|
*/
|
|
24729
25330
|
destroy() {
|
|
25331
|
+
var _a;
|
|
24730
25332
|
super.destroy();
|
|
24731
|
-
this.
|
|
25333
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
24732
25334
|
}
|
|
24733
25335
|
postRender() {
|
|
24734
|
-
this.registerLazyLoadEvents();
|
|
24735
|
-
}
|
|
24736
|
-
registerLazyLoadEvents() {
|
|
24737
|
-
if (!this.iFrame) {
|
|
24738
|
-
return;
|
|
24739
|
-
}
|
|
24740
|
-
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
24741
|
-
this.unregisterLazyLoadEvents();
|
|
24742
|
-
// TODO: Use passive: true, install modernizr to check for passive
|
|
24743
|
-
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24744
|
-
window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24745
|
-
if (!this.viewConfig.enableScrollableContainerLazyLoading) {
|
|
24746
|
-
return;
|
|
24747
|
-
}
|
|
24748
|
-
this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
|
|
24749
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24750
|
-
scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24751
|
-
});
|
|
24752
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
24753
|
-
const resizeTargets = new Set([
|
|
24754
|
-
this.iFrame.parentElement,
|
|
24755
|
-
...getEffectiveClippingAncestors(this.iFrame),
|
|
24756
|
-
].filter(Boolean));
|
|
24757
|
-
this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
|
|
24758
|
-
resizeTargets.forEach((resizeTarget) => {
|
|
24759
|
-
this.lazyLoadResizeObserver.observe(resizeTarget);
|
|
24760
|
-
});
|
|
24761
|
-
}
|
|
24762
|
-
}
|
|
24763
|
-
}
|
|
24764
|
-
unregisterLazyLoadEvents() {
|
|
24765
25336
|
var _a;
|
|
24766
|
-
|
|
24767
|
-
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24768
|
-
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24769
|
-
(_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
24770
|
-
this.lazyLoadResizeObserver = undefined;
|
|
24771
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24772
|
-
scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24773
|
-
});
|
|
24774
|
-
this.lazyLoadScrollContainers = [];
|
|
24775
|
-
}
|
|
25337
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
|
|
24776
25338
|
}
|
|
24777
25339
|
/**
|
|
24778
25340
|
* Render an embedded ThoughtSpot Liveboard or visualization
|