@thoughtspot/visual-embed-sdk 1.51.2 → 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/api-intercept.d.ts.map +1 -1
- package/cjs/src/api-intercept.js +1 -0
- package/cjs/src/api-intercept.js.map +1 -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/css-variables.d.ts +1 -1
- 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/conversation.d.ts +5 -5
- 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 +68 -135
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +215 -32
- 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 +21 -25
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +105 -72
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +380 -33
- 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 +5 -4
- 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 +2 -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/react/index.d.ts +8 -8
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +1 -1
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +7 -7
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +664 -39
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +406 -13
- 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-D8_Zs-Nr.js → index-C1pmYb5H.js} +1 -1
- package/dist/src/api-intercept.d.ts.map +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/css-variables.d.ts +1 -1
- package/dist/src/embed/app.d.ts +17 -140
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +5 -5
- 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 +21 -25
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.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/react/index.d.ts +8 -8
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +664 -39
- 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 +1031 -392
- package/dist/tsembed-react.js +1030 -391
- package/dist/tsembed.es.js +1031 -392
- package/dist/tsembed.js +1029 -390
- package/dist/visual-embed-sdk-react-full.d.ts +1483 -693
- package/dist/visual-embed-sdk-react.d.ts +1364 -647
- package/dist/visual-embed-sdk.d.ts +1426 -659
- package/lib/package.json +9 -1
- package/lib/src/api-intercept.d.ts.map +1 -1
- package/lib/src/api-intercept.js +2 -1
- package/lib/src/api-intercept.js.map +1 -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/css-variables.d.ts +1 -1
- 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/conversation.d.ts +5 -5
- 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 +70 -137
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +215 -32
- 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 +21 -25
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +106 -73
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +378 -31
- 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 +3 -3
- 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 +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/react/index.d.ts +8 -8
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +1 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +7 -7
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +664 -39
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +405 -12
- 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 +1426 -659
- package/package.json +9 -1
- package/src/api-intercept.ts +2 -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/css-variables.ts +1 -1
- package/src/embed/app.spec.ts +86 -34
- package/src/embed/app.ts +37 -264
- package/src/embed/conversation.ts +5 -5
- 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 +261 -42
- package/src/embed/liveboard.ts +78 -297
- package/src/embed/search.spec.ts +80 -0
- package/src/embed/search.ts +20 -0
- package/src/embed/ts-embed.spec.ts +518 -31
- package/src/embed/ts-embed.ts +133 -82
- package/src/full-height.spec.ts +1008 -0
- package/src/full-height.ts +361 -0
- package/src/index.ts +95 -5
- package/src/react/all-types-export.parity.spec.ts +63 -3
- package/src/react/all-types-export.ts +46 -0
- package/src/react/index.spec.tsx +7 -7
- package/src/react/index.tsx +9 -9
- package/src/types.ts +665 -37
- 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.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.52.1 */
|
|
2
2
|
'use client';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef, useCallback } from 'react';
|
|
@@ -1043,6 +1043,9 @@ var EmbedEvent;
|
|
|
1043
1043
|
EmbedEvent["Download"] = "download";
|
|
1044
1044
|
/**
|
|
1045
1045
|
* Emitted when the download action is triggered on an Answer.
|
|
1046
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
1047
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
1048
|
+
* accepts the union now; per-context enforced next release.
|
|
1046
1049
|
* Use start:true to subscribe to when download is initiated, or end:true to
|
|
1047
1050
|
* subscribe to when download is completed. Default is end:true.
|
|
1048
1051
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
|
|
@@ -1059,6 +1062,9 @@ var EmbedEvent;
|
|
|
1059
1062
|
EmbedEvent["DownloadAsPng"] = "downloadAsPng";
|
|
1060
1063
|
/**
|
|
1061
1064
|
* Emitted when the Download as PDF action is triggered on an Answer
|
|
1065
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer; plus
|
|
1066
|
+
* liveboardId on Liveboard), {@link RequiredVizRequest} (Spotter). trigger()
|
|
1067
|
+
* accepts the union now; per-context enforced next release.
|
|
1062
1068
|
* Use start:true to subscribe to when download as PDF is initiated, or end:true to
|
|
1063
1069
|
* subscribe to when download as PDF is completed. Default is end:true.
|
|
1064
1070
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -1075,6 +1081,9 @@ var EmbedEvent;
|
|
|
1075
1081
|
EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
1076
1082
|
/**
|
|
1077
1083
|
* Emitted when the Download as CSV action is triggered on an Answer.
|
|
1084
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
1085
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
1086
|
+
* accepts the union now; per-context enforced next release.
|
|
1078
1087
|
* Use start:true to subscribe to when download as CSV is initiated, or end:true to
|
|
1079
1088
|
* subscribe to when download as CSV is completed. Default is end:true.
|
|
1080
1089
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -1091,6 +1100,9 @@ var EmbedEvent;
|
|
|
1091
1100
|
EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
|
|
1092
1101
|
/**
|
|
1093
1102
|
* Emitted when the Download as XLSX action is triggered on an Answer.
|
|
1103
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
1104
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
1105
|
+
* accepts the union now; per-context enforced next release.
|
|
1094
1106
|
* Use start:true to subscribe to when download as XLSX is initiated, or end:true to
|
|
1095
1107
|
* subscribe to when download as XLSX is completed. Default is end:true.
|
|
1096
1108
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -1369,6 +1381,9 @@ var EmbedEvent;
|
|
|
1369
1381
|
EmbedEvent["Schedule"] = "subscription";
|
|
1370
1382
|
/**
|
|
1371
1383
|
* Emitted when a user clicks **Edit** on a Liveboard or visualization
|
|
1384
|
+
* Payload varies by context: {@link VizScopedRequest} (Liveboard),
|
|
1385
|
+
* {@link RequiredVizRequest} (Spotter, vizId required). trigger() accepts the
|
|
1386
|
+
* union now; per-context enforced next release.
|
|
1372
1387
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1373
1388
|
* @example
|
|
1374
1389
|
* ```js
|
|
@@ -1910,7 +1925,32 @@ var EmbedEvent;
|
|
|
1910
1925
|
*/
|
|
1911
1926
|
EmbedEvent["OrgSwitched"] = "orgSwitched";
|
|
1912
1927
|
/**
|
|
1913
|
-
* Emitted
|
|
1928
|
+
* Emitted before the embedded ThoughtSpot app sends a network request whose
|
|
1929
|
+
* fully resolved URL matches one of the `interceptUrls` in the view config.
|
|
1930
|
+
* The request is held until you call `responder`, which decides whether the
|
|
1931
|
+
* real request goes out or a response you supply is used in its place.
|
|
1932
|
+
*
|
|
1933
|
+
* Setting `interceptUrls` is what enables this; there is no separate enable
|
|
1934
|
+
* flag. If `responder` is not called within `interceptTimeout` (30000 ms by
|
|
1935
|
+
* default) the request fails and `EmbedEvent.Error` is emitted.
|
|
1936
|
+
*
|
|
1937
|
+
* The payload is `{ input, init, urlType }`, where `input` is the request
|
|
1938
|
+
* URL and `init` is the `fetch` init object, with `init.body` parsed into an
|
|
1939
|
+
* object when it is valid JSON. `urlType` is the matching
|
|
1940
|
+
* `InterceptedApiType`; it is `InterceptedApiType.ALL` for any URL outside
|
|
1941
|
+
* the recognized API groups.
|
|
1942
|
+
*
|
|
1943
|
+
* Interception wraps the outermost layer of `fetch`, so `init` holds the
|
|
1944
|
+
* request as the application composed it, before ThoughtSpot attaches its
|
|
1945
|
+
* authentication headers. Those headers, and any token refresh and retry,
|
|
1946
|
+
* are applied afterwards and only when you pass `execute: true`. Only
|
|
1947
|
+
* requests made through `fetch` are intercepted.
|
|
1948
|
+
*
|
|
1949
|
+
* Pass `execute: true` to let the original request proceed untouched, in
|
|
1950
|
+
* which case any `response` you supply alongside it is ignored. With
|
|
1951
|
+
* `execute: false` the request is never sent, and your `response.body` is
|
|
1952
|
+
* returned to the app as JSON, defaulting to status 200 and a
|
|
1953
|
+
* `Content-Type: application/json` header.
|
|
1914
1954
|
*
|
|
1915
1955
|
* Supported on all embed types.
|
|
1916
1956
|
*
|
|
@@ -2423,6 +2463,7 @@ var HostEvent;
|
|
|
2423
2463
|
* the search query string.
|
|
2424
2464
|
* Supported in `AppEmbed` and `SearchEmbed` deployments.
|
|
2425
2465
|
* Includes the following properties:
|
|
2466
|
+
* Payload: {@link SearchRequest}.
|
|
2426
2467
|
* @param - Includes the following keys:
|
|
2427
2468
|
* - `searchQuery`: Query string with search tokens.
|
|
2428
2469
|
* - `dataSources`: Data source GUID to search on.
|
|
@@ -2450,6 +2491,9 @@ var HostEvent;
|
|
|
2450
2491
|
HostEvent["Search"] = "search";
|
|
2451
2492
|
/**
|
|
2452
2493
|
* Triggers a drill on certain points of the specified column
|
|
2494
|
+
* Payload: {@link DrillDownRequest}; in Liveboard context vizId is required
|
|
2495
|
+
* ({@link RequiredVizRequest}). trigger() accepts the union now; per-context
|
|
2496
|
+
* enforced next release.
|
|
2453
2497
|
* Includes the following properties:
|
|
2454
2498
|
* @param - Includes the following keys:
|
|
2455
2499
|
* - `points`: An object containing `selectedPoints` and/or `clickedPoint`
|
|
@@ -2529,6 +2573,8 @@ var HostEvent;
|
|
|
2529
2573
|
HostEvent["Reload"] = "reload";
|
|
2530
2574
|
/**
|
|
2531
2575
|
* Get iframe URL for the current embed view.
|
|
2576
|
+
* Payload: none.
|
|
2577
|
+
* Response: {@link GetIframeUrlResponse}.
|
|
2532
2578
|
* @example
|
|
2533
2579
|
* ```js
|
|
2534
2580
|
* const url = embed.trigger(HostEvent.GetIframeUrl);
|
|
@@ -2547,6 +2593,7 @@ var HostEvent;
|
|
|
2547
2593
|
HostEvent["GetIframeUrl"] = "GetIframeUrl";
|
|
2548
2594
|
/**
|
|
2549
2595
|
* Display specific visualizations on a Liveboard.
|
|
2596
|
+
* Payload: `string[]`.
|
|
2550
2597
|
* @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
|
|
2551
2598
|
* in this parameter will be hidden.
|
|
2552
2599
|
* @example
|
|
@@ -2569,6 +2616,7 @@ var HostEvent;
|
|
|
2569
2616
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
2570
2617
|
/**
|
|
2571
2618
|
* Set a Liveboard tab as an active tab.
|
|
2619
|
+
* Payload: {@link SetActiveTabRequest}.
|
|
2572
2620
|
* @param - tabId - string of id of Tab to show
|
|
2573
2621
|
* @example
|
|
2574
2622
|
* ```js
|
|
@@ -2596,6 +2644,7 @@ var HostEvent;
|
|
|
2596
2644
|
* and `AppEmbed` only. In full application embedding, this event updates
|
|
2597
2645
|
* the runtime filters applied on the Liveboard and saved Answer objects.
|
|
2598
2646
|
*
|
|
2647
|
+
* Payload: {@link RuntimeFilter}[].
|
|
2599
2648
|
* @param - Array of {@link RuntimeFilter} objects. Each item includes:
|
|
2600
2649
|
* - `columnName`: Name of the column to filter on.
|
|
2601
2650
|
* - `operator`: {@link RuntimeFilterOp} to apply. For more information, see
|
|
@@ -2637,6 +2686,7 @@ var HostEvent;
|
|
|
2637
2686
|
* Accepts either a plain value or an object with `path`
|
|
2638
2687
|
* and an optional `replace` flag.
|
|
2639
2688
|
*
|
|
2689
|
+
* Payload: `string` | `number` | {@link NavigateRequest}.
|
|
2640
2690
|
* @param data - A string path, a numeric history delta, or an object
|
|
2641
2691
|
* `{ path: string | number, replace?: boolean }`.
|
|
2642
2692
|
* - `path` — the route to navigate to, or a history delta such as `1`
|
|
@@ -2664,6 +2714,9 @@ var HostEvent;
|
|
|
2664
2714
|
/**
|
|
2665
2715
|
* Open the filter panel for a particular column.
|
|
2666
2716
|
* Works with Search and Liveboard embed.
|
|
2717
|
+
* Payload: {@link OpenFilterRequest} (the cross-context superset). The
|
|
2718
|
+
* accepted fields vary by context: {@link OpenFilterLiveboardRequest},
|
|
2719
|
+
* {@link OpenFilterSpotterRequest}, {@link OpenFilterSearchRequest}.
|
|
2667
2720
|
* @param - { columnId: string,
|
|
2668
2721
|
* name: string,
|
|
2669
2722
|
* type: ATTRIBUTE/MEASURE,
|
|
@@ -2720,7 +2773,7 @@ var HostEvent;
|
|
|
2720
2773
|
*
|
|
2721
2774
|
* Unlike {@link HostEvent.OpenFilter}, which opens the panel of an
|
|
2722
2775
|
* existing filter, this event starts the creation of a new filter.
|
|
2723
|
-
* @version SDK: 1.
|
|
2776
|
+
* @version SDK: 1.51.1 | ThoughtSpot Cloud: 26.8.0.cl
|
|
2724
2777
|
* @example
|
|
2725
2778
|
* ```js
|
|
2726
2779
|
* liveboardEmbed.trigger(HostEvent.OpenAddFilterModal);
|
|
@@ -2736,7 +2789,7 @@ var HostEvent;
|
|
|
2736
2789
|
* Hiding the *Add parameter* button with `hiddenActions:
|
|
2737
2790
|
* [Action.AddParameter]` does not block this event, but disabling it
|
|
2738
2791
|
* with `disabledActions` does.
|
|
2739
|
-
* @version SDK: 1.
|
|
2792
|
+
* @version SDK: 1.51.1 | ThoughtSpot Cloud: 26.8.0.cl
|
|
2740
2793
|
* @example
|
|
2741
2794
|
* ```js
|
|
2742
2795
|
* liveboardEmbed.trigger(HostEvent.OpenAddParameterModal);
|
|
@@ -2746,6 +2799,7 @@ var HostEvent;
|
|
|
2746
2799
|
/**
|
|
2747
2800
|
* Open the parameter panel for a particular parameter on a Liveboard.
|
|
2748
2801
|
* Mirrors {@link HostEvent.OpenFilter} for parameters.
|
|
2802
|
+
* Payload: {@link OpenParameterRequest}.
|
|
2749
2803
|
* @param - Includes the following keys:
|
|
2750
2804
|
* - `parameter`: An object identifying the parameter to open, for
|
|
2751
2805
|
* example, `{ parameterId: '<parameter-GUID>' }`.
|
|
@@ -2777,6 +2831,7 @@ var HostEvent;
|
|
|
2777
2831
|
HostEvent["OpenParameter"] = "openParameter";
|
|
2778
2832
|
/**
|
|
2779
2833
|
* Add columns to the current search query.
|
|
2834
|
+
* Payload: `{ columnIds: string[] }`.
|
|
2780
2835
|
* @param - { columnIds: string[] }
|
|
2781
2836
|
* @example
|
|
2782
2837
|
* ```js
|
|
@@ -2795,6 +2850,7 @@ var HostEvent;
|
|
|
2795
2850
|
HostEvent["AddColumns"] = "addColumns";
|
|
2796
2851
|
/**
|
|
2797
2852
|
* Remove a column from the current search query.
|
|
2853
|
+
* Payload: `{ columnId: string }`.
|
|
2798
2854
|
* @param - { columnId: string }
|
|
2799
2855
|
* @example
|
|
2800
2856
|
* ```js
|
|
@@ -2819,6 +2875,8 @@ var HostEvent;
|
|
|
2819
2875
|
* sorting, toggling of legends, and data drill down.
|
|
2820
2876
|
* For more information, see
|
|
2821
2877
|
* link:https://developers.thoughtspot.com/docs/fetch-data-and-report-apis#transient-lb-content[Liveboard data with unsaved changes].
|
|
2878
|
+
* Payload: none.
|
|
2879
|
+
* Response: {@link GetExportRequestForCurrentPinboardResponse}.
|
|
2822
2880
|
* @example
|
|
2823
2881
|
* ```js
|
|
2824
2882
|
* liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard).then(
|
|
@@ -2840,6 +2898,8 @@ var HostEvent;
|
|
|
2840
2898
|
* requiring additional user input via the *Pin to Liveboard* modal, define
|
|
2841
2899
|
* the following parameters:
|
|
2842
2900
|
*
|
|
2901
|
+
* Payload: {@link PinAnswerToLiveboardRequest}.
|
|
2902
|
+
* Response: {@link PinAnswerToLiveboardResponse}.
|
|
2843
2903
|
* @param - Includes the following keys:
|
|
2844
2904
|
* - `vizId`: GUID of the saved Answer or Spotter visualization ID to pin to a
|
|
2845
2905
|
* Liveboard.
|
|
@@ -2954,6 +3014,7 @@ var HostEvent;
|
|
|
2954
3014
|
HostEvent["LiveboardInfo"] = "pinboardInfo";
|
|
2955
3015
|
/**
|
|
2956
3016
|
* Trigger the **Schedule** action on an embedded Liveboard.
|
|
3017
|
+
* Payload: {@link VizScopedRequest}.
|
|
2957
3018
|
* @example
|
|
2958
3019
|
* ```js
|
|
2959
3020
|
* liveboardEmbed.trigger(HostEvent.Schedule)
|
|
@@ -2969,6 +3030,7 @@ var HostEvent;
|
|
|
2969
3030
|
HostEvent["Schedule"] = "subscription";
|
|
2970
3031
|
/**
|
|
2971
3032
|
* Trigger the **Manage schedule** action on an embedded Liveboard
|
|
3033
|
+
* Payload: {@link VizScopedRequest}.
|
|
2972
3034
|
* @example
|
|
2973
3035
|
* ```js
|
|
2974
3036
|
* liveboardEmbed.trigger(HostEvent.SchedulesList)
|
|
@@ -2985,6 +3047,7 @@ var HostEvent;
|
|
|
2985
3047
|
/**
|
|
2986
3048
|
* Trigger the **Export TML** action on an embedded Liveboard or
|
|
2987
3049
|
* Answer.
|
|
3050
|
+
* Payload: {@link VizScopedRequest}.
|
|
2988
3051
|
* @example
|
|
2989
3052
|
* ```js
|
|
2990
3053
|
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
@@ -3007,6 +3070,7 @@ var HostEvent;
|
|
|
3007
3070
|
/**
|
|
3008
3071
|
* Trigger the **Edit TML** action on an embedded Liveboard or
|
|
3009
3072
|
* saved Answers in the full application embedding.
|
|
3073
|
+
* Payload: {@link VizScopedRequest}.
|
|
3010
3074
|
* @example
|
|
3011
3075
|
* ```js
|
|
3012
3076
|
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
@@ -3028,6 +3092,7 @@ var HostEvent;
|
|
|
3028
3092
|
HostEvent["EditTML"] = "editTSL";
|
|
3029
3093
|
/**
|
|
3030
3094
|
* Trigger the **Update TML** action on an embedded Liveboard.
|
|
3095
|
+
* Payload: {@link VizScopedRequest}.
|
|
3031
3096
|
* @example
|
|
3032
3097
|
* ```js
|
|
3033
3098
|
* liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
@@ -3045,6 +3110,7 @@ var HostEvent;
|
|
|
3045
3110
|
* Trigger the **Download PDF** action on an embedded Liveboard,
|
|
3046
3111
|
* visualization or Answer.
|
|
3047
3112
|
*
|
|
3113
|
+
* Payload: {@link VizScopedRequest} plus optional `liveboardId`.
|
|
3048
3114
|
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
3049
3115
|
*
|
|
3050
3116
|
* **NOTE**: The **Download** > **PDF** action is available on
|
|
@@ -3095,6 +3161,7 @@ var HostEvent;
|
|
|
3095
3161
|
/**
|
|
3096
3162
|
* Trigger the **AI Highlights** action on an embedded Liveboard
|
|
3097
3163
|
*
|
|
3164
|
+
* Payload: none.
|
|
3098
3165
|
* @example
|
|
3099
3166
|
* ```js
|
|
3100
3167
|
* liveboardEmbed.trigger(HostEvent.AIHighlights)
|
|
@@ -3149,6 +3216,9 @@ var HostEvent;
|
|
|
3149
3216
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
3150
3217
|
/**
|
|
3151
3218
|
* Trigger the **Delete** action for a Liveboard.
|
|
3219
|
+
* Payload varies by context: {@link RequiredVizRequest} (Liveboard, vizId
|
|
3220
|
+
* required), {@link VizScopedRequest} (Search). trigger() accepts the union
|
|
3221
|
+
* now; per-context enforced next release.
|
|
3152
3222
|
* @example
|
|
3153
3223
|
* ```js
|
|
3154
3224
|
* appEmbed.trigger(HostEvent.Remove)
|
|
@@ -3163,6 +3233,7 @@ var HostEvent;
|
|
|
3163
3233
|
HostEvent["Remove"] = "delete";
|
|
3164
3234
|
/**
|
|
3165
3235
|
* Trigger the **Explore** action on a visualization.
|
|
3236
|
+
* Payload: {@link RequiredVizRequest}.
|
|
3166
3237
|
* @param - an object with `vizId` as a key
|
|
3167
3238
|
* @example
|
|
3168
3239
|
* ```js
|
|
@@ -3182,6 +3253,7 @@ var HostEvent;
|
|
|
3182
3253
|
/**
|
|
3183
3254
|
* Trigger the **Create alert** action on a KPI chart
|
|
3184
3255
|
* in a Liveboard or saved Answer.
|
|
3256
|
+
* Payload: {@link VizScopedRequest}.
|
|
3185
3257
|
* @param - an object with `vizId` as a key
|
|
3186
3258
|
* @example
|
|
3187
3259
|
* ```js
|
|
@@ -3213,6 +3285,7 @@ var HostEvent;
|
|
|
3213
3285
|
/**
|
|
3214
3286
|
* Trigger the **Manage alerts** action on a KPI chart
|
|
3215
3287
|
* in a visualization or saved Answer.
|
|
3288
|
+
* Payload: {@link VizScopedRequest}.
|
|
3216
3289
|
* @param - an object with `vizId` as a key
|
|
3217
3290
|
* @example
|
|
3218
3291
|
* ```js
|
|
@@ -3250,6 +3323,7 @@ var HostEvent;
|
|
|
3250
3323
|
* on a Liveboard.
|
|
3251
3324
|
*
|
|
3252
3325
|
* This event is not supported in visualization embed and search embed.
|
|
3326
|
+
* Payload: {@link VizScopedRequest}.
|
|
3253
3327
|
* @param - Object parameter. Includes the following keys:
|
|
3254
3328
|
* - `vizId`: To trigger the action for a specific visualization in Liveboard embed,
|
|
3255
3329
|
* pass in `vizId` as a key. In Spotter embed, `vizId` refers to the Answer ID and
|
|
@@ -3292,6 +3366,7 @@ var HostEvent;
|
|
|
3292
3366
|
HostEvent["Edit"] = "edit";
|
|
3293
3367
|
/**
|
|
3294
3368
|
* Trigger the **Copy link** action on a Liveboard or visualization
|
|
3369
|
+
* Payload: {@link VizScopedRequest}.
|
|
3295
3370
|
* @param - object - to trigger the action for a
|
|
3296
3371
|
* specific visualization in Liveboard embed, pass in `vizId` as a key
|
|
3297
3372
|
* @example
|
|
@@ -3337,6 +3412,7 @@ var HostEvent;
|
|
|
3337
3412
|
HostEvent["CopyLink"] = "embedDocument";
|
|
3338
3413
|
/**
|
|
3339
3414
|
* Trigger the **Present** action on a Liveboard or visualization
|
|
3415
|
+
* Payload: {@link VizScopedRequest}.
|
|
3340
3416
|
* @param - object - to trigger the action for a specific visualization
|
|
3341
3417
|
* in Liveboard embed, pass in `vizId` as a key
|
|
3342
3418
|
* @example
|
|
@@ -3382,6 +3458,8 @@ var HostEvent;
|
|
|
3382
3458
|
HostEvent["Present"] = "present";
|
|
3383
3459
|
/**
|
|
3384
3460
|
* Get TML for the current search.
|
|
3461
|
+
* Payload: {@link GetTMLRequest}.
|
|
3462
|
+
* Response: `Record<string, any>`.
|
|
3385
3463
|
* @example
|
|
3386
3464
|
* ```js
|
|
3387
3465
|
* searchEmbed.trigger(HostEvent.GetTML).then((tml) => {
|
|
@@ -3431,6 +3509,7 @@ var HostEvent;
|
|
|
3431
3509
|
* Trigger the **Show underlying data** action on a
|
|
3432
3510
|
* chart or table.
|
|
3433
3511
|
*
|
|
3512
|
+
* Payload: {@link VizScopedRequest}.
|
|
3434
3513
|
* @param - an object with vizId as a key
|
|
3435
3514
|
* @example
|
|
3436
3515
|
* ```js
|
|
@@ -3464,6 +3543,7 @@ var HostEvent;
|
|
|
3464
3543
|
* Trigger the **Delete** action for a visualization
|
|
3465
3544
|
* in an embedded Liveboard, or a chart or table
|
|
3466
3545
|
* generated from Search.
|
|
3546
|
+
* Payload: {@link VizScopedRequest}.
|
|
3467
3547
|
* @param - Liveboard embed takes an object with `vizId` as a key.
|
|
3468
3548
|
* Can be left empty if embedding Search or visualization.
|
|
3469
3549
|
* @example
|
|
@@ -3492,6 +3572,7 @@ var HostEvent;
|
|
|
3492
3572
|
/**
|
|
3493
3573
|
* Trigger the **SpotIQ analyze** action on a
|
|
3494
3574
|
* chart or table.
|
|
3575
|
+
* Payload: {@link VizScopedRequest}.
|
|
3495
3576
|
* @param - Liveboard embed takes `vizId` as a
|
|
3496
3577
|
* key. Can be left undefined when embedding Search or
|
|
3497
3578
|
* visualization.
|
|
@@ -3554,6 +3635,7 @@ var HostEvent;
|
|
|
3554
3635
|
/**
|
|
3555
3636
|
* Trigger the **Download** > **PNG** action on
|
|
3556
3637
|
* charts in the embedded view.
|
|
3638
|
+
* Payload: {@link VizScopedRequest}.
|
|
3557
3639
|
* @example
|
|
3558
3640
|
* ```js
|
|
3559
3641
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPng,
|
|
@@ -3585,6 +3667,7 @@ var HostEvent;
|
|
|
3585
3667
|
/**
|
|
3586
3668
|
* Trigger the **Download** > **CSV** action on tables in
|
|
3587
3669
|
* the embedded view.
|
|
3670
|
+
* Payload: {@link VizScopedRequest}.
|
|
3588
3671
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
3589
3672
|
* @example
|
|
3590
3673
|
* ```js
|
|
@@ -3624,6 +3707,7 @@ var HostEvent;
|
|
|
3624
3707
|
/**
|
|
3625
3708
|
* Trigger the **Download** > **XLSX** action on tables
|
|
3626
3709
|
* in the embedded view.
|
|
3710
|
+
* Payload: {@link VizScopedRequest}.
|
|
3627
3711
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
3628
3712
|
* @example
|
|
3629
3713
|
* ```js
|
|
@@ -3663,6 +3747,7 @@ var HostEvent;
|
|
|
3663
3747
|
/**
|
|
3664
3748
|
* Trigger the **Share** action on an embedded
|
|
3665
3749
|
* Liveboard or Answer.
|
|
3750
|
+
* Payload: {@link VizScopedRequest}.
|
|
3666
3751
|
* @example
|
|
3667
3752
|
* ```js
|
|
3668
3753
|
* liveboardEmbed.trigger(HostEvent.Share)
|
|
@@ -3689,6 +3774,7 @@ var HostEvent;
|
|
|
3689
3774
|
* Trigger the **Save** action on a Liveboard, Answer, or Spotter.
|
|
3690
3775
|
* Saves the changes.
|
|
3691
3776
|
*
|
|
3777
|
+
* Payload: {@link VizScopedRequest}.
|
|
3692
3778
|
* @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
|
|
3693
3779
|
* It is required and can be retrieved from the data embed event.
|
|
3694
3780
|
*
|
|
@@ -3740,6 +3826,7 @@ var HostEvent;
|
|
|
3740
3826
|
/**
|
|
3741
3827
|
* Trigger the **Sync to Sheets** action on an embedded visualization or Answer
|
|
3742
3828
|
* Sends data from an Answer or Liveboard visualization to a Google sheet.
|
|
3829
|
+
* Payload: {@link VizScopedRequest}.
|
|
3743
3830
|
* @param - an object with `vizId` as a key
|
|
3744
3831
|
* @example
|
|
3745
3832
|
* ```js
|
|
@@ -3770,6 +3857,7 @@ var HostEvent;
|
|
|
3770
3857
|
* Trigger the **Sync to Other Apps** action on an embedded visualization or Answer
|
|
3771
3858
|
* Sends data from an Answer or Liveboard visualization to third-party apps such
|
|
3772
3859
|
* as Slack, Salesforce, Microsoft Teams, ServiceNow and so on.
|
|
3860
|
+
* Payload: {@link VizScopedRequest}.
|
|
3773
3861
|
* @param - an object with vizId as a key
|
|
3774
3862
|
* @example
|
|
3775
3863
|
* ```js
|
|
@@ -3800,6 +3888,7 @@ var HostEvent;
|
|
|
3800
3888
|
* Trigger the **Manage pipelines** action on an embedded
|
|
3801
3889
|
* visualization or Answer.
|
|
3802
3890
|
* Allows users to manage ThoughtSpot Sync pipelines.
|
|
3891
|
+
* Payload: {@link VizScopedRequest}.
|
|
3803
3892
|
* @param - an object with `vizId` as a key
|
|
3804
3893
|
* @example
|
|
3805
3894
|
* ```js
|
|
@@ -3828,6 +3917,7 @@ var HostEvent;
|
|
|
3828
3917
|
HostEvent["ManagePipelines"] = "manage-pipeline";
|
|
3829
3918
|
/**
|
|
3830
3919
|
* Reset search operation on the Search or Answer page.
|
|
3920
|
+
* Payload: none.
|
|
3831
3921
|
* @example
|
|
3832
3922
|
* ```js
|
|
3833
3923
|
* searchEmbed.trigger(HostEvent.ResetSearch)
|
|
@@ -3855,6 +3945,8 @@ var HostEvent;
|
|
|
3855
3945
|
* whole Liveboard.
|
|
3856
3946
|
* The `applicability` attribute is available from SDK: 1.53.0 |
|
|
3857
3947
|
* ThoughtSpot: 26.10.0.cl.
|
|
3948
|
+
* Payload: {@link GetFiltersRequest}.
|
|
3949
|
+
* Response: {@link GetFiltersResponse}.
|
|
3858
3950
|
* @example
|
|
3859
3951
|
* ```js
|
|
3860
3952
|
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
|
|
@@ -3874,6 +3966,7 @@ var HostEvent;
|
|
|
3874
3966
|
HostEvent["GetFilters"] = "getFilters";
|
|
3875
3967
|
/**
|
|
3876
3968
|
* Update one or several filters applied on a Liveboard.
|
|
3969
|
+
* Payload: {@link UpdateFiltersRequest}.
|
|
3877
3970
|
* @param - Includes the following keys:
|
|
3878
3971
|
* - `filter`: A single filter object containing column name, filter operator, and
|
|
3879
3972
|
* values.
|
|
@@ -4002,6 +4095,8 @@ var HostEvent;
|
|
|
4002
4095
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
4003
4096
|
/**
|
|
4004
4097
|
* Get tab details for the current Liveboard.
|
|
4098
|
+
* Payload: none.
|
|
4099
|
+
* Response: {@link GetTabsResponse}.
|
|
4005
4100
|
* @example
|
|
4006
4101
|
* ```js
|
|
4007
4102
|
* liveboardEmbed.trigger(HostEvent.GetTabs).then((tabDetails) => {
|
|
@@ -4027,6 +4122,8 @@ var HostEvent;
|
|
|
4027
4122
|
/**
|
|
4028
4123
|
* Get group details for the current Liveboard.
|
|
4029
4124
|
* Mirrors {@link HostEvent.GetTabs} for filter/parameter groups.
|
|
4125
|
+
* Payload: none.
|
|
4126
|
+
* Response: {@link GetGroupsResponse}.
|
|
4030
4127
|
* @example
|
|
4031
4128
|
* ```js
|
|
4032
4129
|
* liveboardEmbed.trigger(HostEvent.GetGroups).then((groupDetails) => {
|
|
@@ -4051,6 +4148,7 @@ var HostEvent;
|
|
|
4051
4148
|
HostEvent["GetGroups"] = "getGroups";
|
|
4052
4149
|
/**
|
|
4053
4150
|
* Set the visible tabs on a Liveboard.
|
|
4151
|
+
* Payload: `string[]`.
|
|
4054
4152
|
* @param - an array of ids of tabs to show, the IDs not passed
|
|
4055
4153
|
* will be hidden.
|
|
4056
4154
|
* @example
|
|
@@ -4073,6 +4171,7 @@ var HostEvent;
|
|
|
4073
4171
|
HostEvent["SetVisibleTabs"] = "SetPinboardVisibleTabs";
|
|
4074
4172
|
/**
|
|
4075
4173
|
* Set the hidden tabs on a Liveboard.
|
|
4174
|
+
* Payload: `string[]`.
|
|
4076
4175
|
* @param - an array of the IDs of the tabs to hide.
|
|
4077
4176
|
* The IDs not passed will be shown.
|
|
4078
4177
|
* @example
|
|
@@ -4101,6 +4200,8 @@ var HostEvent;
|
|
|
4101
4200
|
* `getAnswerService()` method on the embed instance to get an AnswerService
|
|
4102
4201
|
* object that provides a more convenient interface for working with answers.
|
|
4103
4202
|
*
|
|
4203
|
+
* Payload: {@link GetAnswerSessionRequest}.
|
|
4204
|
+
* Response: {@link GetAnswerSessionResponse}.
|
|
4104
4205
|
* @example
|
|
4105
4206
|
* ```js
|
|
4106
4207
|
* // Preferred way to get an AnswerService
|
|
@@ -4128,6 +4229,7 @@ var HostEvent;
|
|
|
4128
4229
|
HostEvent["GetAnswerSession"] = "getAnswerSession";
|
|
4129
4230
|
/**
|
|
4130
4231
|
* Trigger the *Ask Sage* action for visualizations
|
|
4232
|
+
* Payload: {@link RequiredVizRequest}.
|
|
4131
4233
|
* @example
|
|
4132
4234
|
* ```js
|
|
4133
4235
|
* liveboardEmbed.trigger(HostEvent.AskSage,
|
|
@@ -4139,6 +4241,7 @@ var HostEvent;
|
|
|
4139
4241
|
/**
|
|
4140
4242
|
* Trigger cross filter update action on a Liveboard.
|
|
4141
4243
|
*
|
|
4244
|
+
* Payload: {@link UpdateCrossFilterRequest}.
|
|
4142
4245
|
* @example
|
|
4143
4246
|
* ```js
|
|
4144
4247
|
* liveboardEmbed.trigger(HostEvent.UpdateCrossFilter, {
|
|
@@ -4154,7 +4257,9 @@ var HostEvent;
|
|
|
4154
4257
|
HostEvent["UpdateCrossFilter"] = "UpdateCrossFilter";
|
|
4155
4258
|
/**
|
|
4156
4259
|
* Trigger reset action for a personalized Liveboard view.
|
|
4157
|
-
* This event is deprecated.
|
|
4260
|
+
* This event is deprecated.
|
|
4261
|
+
* Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
|
|
4262
|
+
* Payload: none.
|
|
4158
4263
|
* @example
|
|
4159
4264
|
* ```js
|
|
4160
4265
|
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
|
|
@@ -4175,6 +4280,7 @@ var HostEvent;
|
|
|
4175
4280
|
/**
|
|
4176
4281
|
* Triggers an action to update Parameter values on embedded
|
|
4177
4282
|
* Answers, Liveboard, and Spotter answer in Edit mode.
|
|
4283
|
+
* Payload: {@link RuntimeParameter}[].
|
|
4178
4284
|
* @param - Includes the following keys for each item:
|
|
4179
4285
|
* - `name`: Name of the parameter.
|
|
4180
4286
|
* - `value`: The value to set for the parameter.
|
|
@@ -4232,6 +4338,8 @@ var HostEvent;
|
|
|
4232
4338
|
* whole Liveboard.
|
|
4233
4339
|
* The `applicability` attribute is available from SDK: 1.53.0 |
|
|
4234
4340
|
* ThoughtSpot: 26.10.0.cl.
|
|
4341
|
+
* Payload: none.
|
|
4342
|
+
* Response: {@link GetParametersResponse}.
|
|
4235
4343
|
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
4236
4344
|
* ```js
|
|
4237
4345
|
* liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
|
|
@@ -4269,6 +4377,7 @@ var HostEvent;
|
|
|
4269
4377
|
* ```js
|
|
4270
4378
|
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
|
|
4271
4379
|
* ```
|
|
4380
|
+
* Payload: {@link PersonalisedViewRequest} (`viewId` only).
|
|
4272
4381
|
* @example
|
|
4273
4382
|
* ```js
|
|
4274
4383
|
* // Update personalized view from liveboard context
|
|
@@ -4301,6 +4410,7 @@ var HostEvent;
|
|
|
4301
4410
|
* If neither is provided, the Liveboard resets to the original/default view.
|
|
4302
4411
|
* When a `viewName` is provided and multiple views share
|
|
4303
4412
|
* the same name, the first match is selected.
|
|
4413
|
+
* Payload: {@link PersonalisedViewRequest}.
|
|
4304
4414
|
* @example
|
|
4305
4415
|
* ```js
|
|
4306
4416
|
* liveboardEmbed.trigger(
|
|
@@ -4344,6 +4454,8 @@ var HostEvent;
|
|
|
4344
4454
|
* If no parameters are specified, the save action is
|
|
4345
4455
|
* triggered with a modal to prompt users to
|
|
4346
4456
|
* add a name and description for the Answer.
|
|
4457
|
+
* Payload: {@link SaveAnswerRequest}.
|
|
4458
|
+
* Response: {@link SaveAnswerResponse}.
|
|
4347
4459
|
* @param - Includes the following keys:
|
|
4348
4460
|
* - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
|
|
4349
4461
|
* embed.
|
|
@@ -4429,6 +4541,7 @@ var HostEvent;
|
|
|
4429
4541
|
/**
|
|
4430
4542
|
* Triggers a search operation with the search tokens specified in
|
|
4431
4543
|
* the search query string in spotter embed.
|
|
4544
|
+
* Payload: {@link SpotterSearchRequest}.
|
|
4432
4545
|
* @param - Includes the following keys:
|
|
4433
4546
|
* - `query`: Text string in Natural Language format.
|
|
4434
4547
|
* - `executeSearch`: Boolean to execute search and update search query.
|
|
@@ -4453,6 +4566,7 @@ var HostEvent;
|
|
|
4453
4566
|
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
4454
4567
|
/**
|
|
4455
4568
|
* Edits the last prompt in spotter embed.
|
|
4569
|
+
* Payload: `string`.
|
|
4456
4570
|
* @param - `query`: Text string
|
|
4457
4571
|
* @example
|
|
4458
4572
|
* ```js
|
|
@@ -4469,6 +4583,7 @@ var HostEvent;
|
|
|
4469
4583
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
4470
4584
|
/**
|
|
4471
4585
|
* Opens the data source preview modal in Spotter Embed.
|
|
4586
|
+
* Payload: none.
|
|
4472
4587
|
* @example
|
|
4473
4588
|
* ```js
|
|
4474
4589
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
@@ -4504,6 +4619,7 @@ var HostEvent;
|
|
|
4504
4619
|
HostEvent["DataModelInstructions"] = "DataModelInstructions";
|
|
4505
4620
|
/**
|
|
4506
4621
|
* Resets the Spotter Embed Conversation.
|
|
4622
|
+
* Payload: none.
|
|
4507
4623
|
* @example
|
|
4508
4624
|
* ```js
|
|
4509
4625
|
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
@@ -4516,6 +4632,7 @@ var HostEvent;
|
|
|
4516
4632
|
* `conversationId` is **mandatory** — you must pass the id of the
|
|
4517
4633
|
* conversation to share. Also no-op when sharing is disabled
|
|
4518
4634
|
* (enableShareConversation off) or when already in the read-only shared view.
|
|
4635
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4519
4636
|
* @example
|
|
4520
4637
|
* ```js
|
|
4521
4638
|
* spotterEmbed.trigger(HostEvent.ShareSpotterConversation, { conversationId: 'abc' });
|
|
@@ -4525,6 +4642,7 @@ var HostEvent;
|
|
|
4525
4642
|
HostEvent["ShareSpotterConversation"] = "ShareSpotterConversation";
|
|
4526
4643
|
/**
|
|
4527
4644
|
* Closes the Spotter share-conversation modal. No-op if none is open.
|
|
4645
|
+
* Payload: none.
|
|
4528
4646
|
* @example
|
|
4529
4647
|
* ```js
|
|
4530
4648
|
* spotterEmbed.trigger(HostEvent.CloseSpotterShareConversation);
|
|
@@ -4534,6 +4652,7 @@ var HostEvent;
|
|
|
4534
4652
|
HostEvent["CloseSpotterShareConversation"] = "CloseSpotterShareConversation";
|
|
4535
4653
|
/**
|
|
4536
4654
|
* Exits the read-only shared-conversation view.
|
|
4655
|
+
* Payload: none.
|
|
4537
4656
|
* @example
|
|
4538
4657
|
* ```js
|
|
4539
4658
|
* spotterEmbed.trigger(HostEvent.ExitSpotterSharedConversation);
|
|
@@ -4543,6 +4662,7 @@ var HostEvent;
|
|
|
4543
4662
|
HostEvent["ExitSpotterSharedConversation"] = "ExitSpotterSharedConversation";
|
|
4544
4663
|
/**
|
|
4545
4664
|
* Deletes the last prompt in spotter embed.
|
|
4665
|
+
* Payload: none.
|
|
4546
4666
|
* @example
|
|
4547
4667
|
* ```js
|
|
4548
4668
|
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
@@ -4552,6 +4672,7 @@ var HostEvent;
|
|
|
4552
4672
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
4553
4673
|
/**
|
|
4554
4674
|
* Toggle the visualization to chart or table view.
|
|
4675
|
+
* Payload: {@link RequiredVizRequest}.
|
|
4555
4676
|
* @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
|
|
4556
4677
|
* @example
|
|
4557
4678
|
* ```js
|
|
@@ -4590,6 +4711,7 @@ var HostEvent;
|
|
|
4590
4711
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
4591
4712
|
/**
|
|
4592
4713
|
* Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
|
|
4714
|
+
* Payload: {@link RequiredVizRequest}.
|
|
4593
4715
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
|
|
4594
4716
|
* @example
|
|
4595
4717
|
* ```js
|
|
@@ -4614,7 +4736,13 @@ var HostEvent;
|
|
|
4614
4736
|
*/
|
|
4615
4737
|
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
4616
4738
|
/**
|
|
4617
|
-
*
|
|
4739
|
+
* Notifies the embedded ThoughtSpot app that the embed is being torn down, so that
|
|
4740
|
+
* it can release any resources it holds before the iframe is removed from the DOM.
|
|
4741
|
+
*
|
|
4742
|
+
* This is triggered for you by `embed.destroy()`; you rarely need to trigger it
|
|
4743
|
+
* directly. If `waitForCleanupOnDestroy` is set in the embed config, `destroy()`
|
|
4744
|
+
* waits for the app to acknowledge this event (up to `cleanupTimeout`) before
|
|
4745
|
+
* removing the iframe.
|
|
4618
4746
|
* @example
|
|
4619
4747
|
* ```js
|
|
4620
4748
|
* liveboardEmbed.trigger(HostEvent.DestroyEmbed);
|
|
@@ -4645,6 +4773,7 @@ var HostEvent;
|
|
|
4645
4773
|
* instance. Contact your admin or ThoughtSpot Support to enable chat history on your
|
|
4646
4774
|
* instance.
|
|
4647
4775
|
*
|
|
4776
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4648
4777
|
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
4649
4778
|
* @example
|
|
4650
4779
|
* ```js
|
|
@@ -4662,6 +4791,7 @@ var HostEvent;
|
|
|
4662
4791
|
* instance. Contact your admin or ThoughtSpot Support to enable chat history on your
|
|
4663
4792
|
* instance.
|
|
4664
4793
|
*
|
|
4794
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4665
4795
|
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
4666
4796
|
* @example
|
|
4667
4797
|
* ```js
|
|
@@ -4686,6 +4816,7 @@ var HostEvent;
|
|
|
4686
4816
|
* Trigger the **Send Test Email** action in the Liveboard schedule modal.
|
|
4687
4817
|
* Sends a test schedule email to self or all recipients.
|
|
4688
4818
|
* Requires `isSendNowLiveboardSchedulingEnabled` to be enabled.
|
|
4819
|
+
* Payload: {@link ScheduleEmailRequest}.
|
|
4689
4820
|
* @example
|
|
4690
4821
|
* ```js
|
|
4691
4822
|
* liveboardEmbed.trigger(HostEvent.SendTestScheduleEmail, {
|
|
@@ -4704,6 +4835,7 @@ var HostEvent;
|
|
|
4704
4835
|
HostEvent["SendTestScheduleEmail"] = "sendTestScheduleEmail";
|
|
4705
4836
|
/**
|
|
4706
4837
|
* Sends a user message (prompt) to the SpotterViz panel programmatically.
|
|
4838
|
+
* Payload: `{ query: string }`.
|
|
4707
4839
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4708
4840
|
* @param query - the prompt text to send.
|
|
4709
4841
|
* @example
|
|
@@ -4716,6 +4848,7 @@ var HostEvent;
|
|
|
4716
4848
|
HostEvent["SpotterVizSendUserMessage"] = "SpotterVizSendUserMessage";
|
|
4717
4849
|
/**
|
|
4718
4850
|
* Initializes a new SpotterViz conversation.
|
|
4851
|
+
* Payload: none.
|
|
4719
4852
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4720
4853
|
* @example
|
|
4721
4854
|
* ```js
|
|
@@ -4725,6 +4858,7 @@ var HostEvent;
|
|
|
4725
4858
|
HostEvent["InitSpotterVizConversation"] = "InitSpotterVizConversation";
|
|
4726
4859
|
/**
|
|
4727
4860
|
* Opens the SpotterViz panel.
|
|
4861
|
+
* Payload: none.
|
|
4728
4862
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4729
4863
|
* @example
|
|
4730
4864
|
* ```js
|
|
@@ -4734,6 +4868,7 @@ var HostEvent;
|
|
|
4734
4868
|
HostEvent["OpenSpotterVizPanel"] = "OpenSpotterVizPanel";
|
|
4735
4869
|
/**
|
|
4736
4870
|
* Closes the SpotterViz panel.
|
|
4871
|
+
* Payload: none.
|
|
4737
4872
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4738
4873
|
* @example
|
|
4739
4874
|
* ```js
|
|
@@ -4744,6 +4879,7 @@ var HostEvent;
|
|
|
4744
4879
|
/**
|
|
4745
4880
|
* Clears browser cache and fetches new data for liveboard ChartViz Containers.
|
|
4746
4881
|
* Requires `enableLiveboardDataCache` to be enabled.
|
|
4882
|
+
* Payload: {@link ScheduleEmailRequest}.
|
|
4747
4883
|
* @example
|
|
4748
4884
|
* ```js
|
|
4749
4885
|
* liveboardEmbed.trigger(HostEvent.RefreshLiveboardBrowserCache);
|
|
@@ -4941,6 +5077,7 @@ var Param;
|
|
|
4941
5077
|
Param["SpotterDataSources"] = "spotterDataSources";
|
|
4942
5078
|
Param["AnalystId"] = "analystId";
|
|
4943
5079
|
Param["OpenSpotterOnLiveboardByDefault"] = "openSpotterOnLiveboardByDefault";
|
|
5080
|
+
Param["ShowAnswerEditPanel"] = "showAnswerEditPanel";
|
|
4944
5081
|
})(Param || (Param = {}));
|
|
4945
5082
|
/**
|
|
4946
5083
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -6732,7 +6869,7 @@ var Action;
|
|
|
6732
6869
|
* ```js
|
|
6733
6870
|
* hiddenActions: [Action.QuickSearchPill]
|
|
6734
6871
|
* ```
|
|
6735
|
-
* @version SDK: 1.
|
|
6872
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
6736
6873
|
*/
|
|
6737
6874
|
Action["QuickSearchPill"] = "quickSearchPill";
|
|
6738
6875
|
/**
|
|
@@ -6747,7 +6884,7 @@ var Action;
|
|
|
6747
6884
|
* ```js
|
|
6748
6885
|
* hiddenActions: [Action.DeepAnalysisPill]
|
|
6749
6886
|
* ```
|
|
6750
|
-
* @version SDK: 1.
|
|
6887
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
6751
6888
|
*/
|
|
6752
6889
|
Action["DeepAnalysisPill"] = "deepAnalysisPill";
|
|
6753
6890
|
/**
|
|
@@ -6762,7 +6899,7 @@ var Action;
|
|
|
6762
6899
|
* ```js
|
|
6763
6900
|
* hiddenActions: [Action.DataLiteracyPill]
|
|
6764
6901
|
* ```
|
|
6765
|
-
* @version SDK: 1.
|
|
6902
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
6766
6903
|
*/
|
|
6767
6904
|
Action["DataLiteracyPill"] = "dataLiteracyPill";
|
|
6768
6905
|
/**
|
|
@@ -6945,6 +7082,225 @@ var Action;
|
|
|
6945
7082
|
* ```
|
|
6946
7083
|
*/
|
|
6947
7084
|
Action["SpotterOnLiveboard"] = "spotterOnLiveboard";
|
|
7085
|
+
/**
|
|
7086
|
+
* Controls the visibility and disabled state of the "Chart Type" menu item
|
|
7087
|
+
* in Chart Settings V2.
|
|
7088
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7089
|
+
* @example
|
|
7090
|
+
* ```js
|
|
7091
|
+
* {
|
|
7092
|
+
* hiddenActions: [Action.ChartTypeSettings],
|
|
7093
|
+
* disabledActions: [Action.ChartTypeSettings],
|
|
7094
|
+
* }
|
|
7095
|
+
* ```
|
|
7096
|
+
*/
|
|
7097
|
+
Action["ChartTypeSettings"] = "CHART_TYPE";
|
|
7098
|
+
/**
|
|
7099
|
+
* Controls the visibility and disabled state of the "Layout" menu item
|
|
7100
|
+
* in Chart Settings V2.
|
|
7101
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7102
|
+
* @example
|
|
7103
|
+
* ```js
|
|
7104
|
+
* {
|
|
7105
|
+
* hiddenActions: [Action.LayoutSettings],
|
|
7106
|
+
* disabledActions: [Action.LayoutSettings],
|
|
7107
|
+
* }
|
|
7108
|
+
* ```
|
|
7109
|
+
*/
|
|
7110
|
+
Action["LayoutSettings"] = "LAYOUT";
|
|
7111
|
+
/**
|
|
7112
|
+
* Controls the visibility and disabled state of the "Column" menu item
|
|
7113
|
+
* in Chart Settings V2.
|
|
7114
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7115
|
+
* @example
|
|
7116
|
+
* ```js
|
|
7117
|
+
* {
|
|
7118
|
+
* hiddenActions: [Action.ColumnSettings],
|
|
7119
|
+
* disabledActions: [Action.ColumnSettings],
|
|
7120
|
+
* }
|
|
7121
|
+
* ```
|
|
7122
|
+
*/
|
|
7123
|
+
Action["ColumnSettings"] = "COLUMN";
|
|
7124
|
+
/**
|
|
7125
|
+
* Controls the visibility and disabled state of the "Axis" menu item
|
|
7126
|
+
* in Chart Settings V2.
|
|
7127
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7128
|
+
* @example
|
|
7129
|
+
* ```js
|
|
7130
|
+
* {
|
|
7131
|
+
* hiddenActions: [Action.AxisSettings],
|
|
7132
|
+
* disabledActions: [Action.AxisSettings],
|
|
7133
|
+
* }
|
|
7134
|
+
* ```
|
|
7135
|
+
*/
|
|
7136
|
+
Action["AxisSettings"] = "AXIS";
|
|
7137
|
+
/**
|
|
7138
|
+
* Controls the visibility and disabled state of the "Data Label" menu item
|
|
7139
|
+
* in Chart Settings V2.
|
|
7140
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7141
|
+
* @example
|
|
7142
|
+
* ```js
|
|
7143
|
+
* {
|
|
7144
|
+
* hiddenActions: [Action.DataLabelSettings],
|
|
7145
|
+
* disabledActions: [Action.DataLabelSettings],
|
|
7146
|
+
* }
|
|
7147
|
+
* ```
|
|
7148
|
+
*/
|
|
7149
|
+
Action["DataLabelSettings"] = "DATA_LABEL";
|
|
7150
|
+
/**
|
|
7151
|
+
* Controls the visibility and disabled state of the "Tooltip" menu item
|
|
7152
|
+
* in Chart Settings V2.
|
|
7153
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7154
|
+
* @example
|
|
7155
|
+
* ```js
|
|
7156
|
+
* {
|
|
7157
|
+
* hiddenActions: [Action.TooltipSettings],
|
|
7158
|
+
* disabledActions: [Action.TooltipSettings],
|
|
7159
|
+
* }
|
|
7160
|
+
* ```
|
|
7161
|
+
*/
|
|
7162
|
+
Action["TooltipSettings"] = "TOOLTIP";
|
|
7163
|
+
/**
|
|
7164
|
+
* Controls the visibility and disabled state of the "Legend" menu item
|
|
7165
|
+
* in Chart Settings V2.
|
|
7166
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7167
|
+
* @example
|
|
7168
|
+
* ```js
|
|
7169
|
+
* {
|
|
7170
|
+
* hiddenActions: [Action.LegendSettings],
|
|
7171
|
+
* disabledActions: [Action.LegendSettings],
|
|
7172
|
+
* }
|
|
7173
|
+
* ```
|
|
7174
|
+
*/
|
|
7175
|
+
Action["LegendSettings"] = "LEGEND";
|
|
7176
|
+
/**
|
|
7177
|
+
* Controls the visibility and disabled state of the "Display" menu item
|
|
7178
|
+
* in Chart Settings V2.
|
|
7179
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7180
|
+
* @example
|
|
7181
|
+
* ```js
|
|
7182
|
+
* {
|
|
7183
|
+
* hiddenActions: [Action.DisplaySettings],
|
|
7184
|
+
* disabledActions: [Action.DisplaySettings],
|
|
7185
|
+
* }
|
|
7186
|
+
* ```
|
|
7187
|
+
*/
|
|
7188
|
+
Action["DisplaySettings"] = "DISPLAY";
|
|
7189
|
+
/**
|
|
7190
|
+
* Controls the visibility and disabled state of the "Query Details" menu
|
|
7191
|
+
* item in Chart Settings V2.
|
|
7192
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7193
|
+
* @example
|
|
7194
|
+
* ```js
|
|
7195
|
+
* {
|
|
7196
|
+
* hiddenActions: [Action.QuerySettings],
|
|
7197
|
+
* disabledActions: [Action.QuerySettings],
|
|
7198
|
+
* }
|
|
7199
|
+
* ```
|
|
7200
|
+
*/
|
|
7201
|
+
Action["QuerySettings"] = "QUERY_DETAILS";
|
|
7202
|
+
/**
|
|
7203
|
+
* Controls the visibility and disabled state of the "Custom Action" menu
|
|
7204
|
+
* item in Chart Settings V2.
|
|
7205
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7206
|
+
* @example
|
|
7207
|
+
* ```js
|
|
7208
|
+
* {
|
|
7209
|
+
* hiddenActions: [Action.CustomSettings],
|
|
7210
|
+
* disabledActions: [Action.CustomSettings],
|
|
7211
|
+
* }
|
|
7212
|
+
* ```
|
|
7213
|
+
*/
|
|
7214
|
+
Action["CustomSettings"] = "CUSTOM_ACTION";
|
|
7215
|
+
/**
|
|
7216
|
+
* Controls the visibility and disabled state of the "Muze AI" menu item
|
|
7217
|
+
* in Chart Settings V2.
|
|
7218
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7219
|
+
* @example
|
|
7220
|
+
* ```js
|
|
7221
|
+
* {
|
|
7222
|
+
* hiddenActions: [Action.MuzeAiSettings],
|
|
7223
|
+
* disabledActions: [Action.MuzeAiSettings],
|
|
7224
|
+
* }
|
|
7225
|
+
* ```
|
|
7226
|
+
*/
|
|
7227
|
+
Action["MuzeAiSettings"] = "MUZE_AI";
|
|
7228
|
+
/**
|
|
7229
|
+
* Controls the visibility and disabled state of the "R Analysis" menu item
|
|
7230
|
+
* in Chart Settings V2.
|
|
7231
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7232
|
+
* @example
|
|
7233
|
+
* ```js
|
|
7234
|
+
* {
|
|
7235
|
+
* hiddenActions: [Action.RAnalysisSettings],
|
|
7236
|
+
* disabledActions: [Action.RAnalysisSettings],
|
|
7237
|
+
* }
|
|
7238
|
+
* ```
|
|
7239
|
+
*/
|
|
7240
|
+
Action["RAnalysisSettings"] = "R_ANALYSIS";
|
|
7241
|
+
/**
|
|
7242
|
+
* Controls the visibility and disabled state of the "Add to Collection" menu item.
|
|
7243
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7244
|
+
* @example
|
|
7245
|
+
* ```js
|
|
7246
|
+
* {
|
|
7247
|
+
* hiddenActions: [Action.AddToCollection],
|
|
7248
|
+
* disabledActions: [Action.AddToCollection],
|
|
7249
|
+
* }
|
|
7250
|
+
* ```
|
|
7251
|
+
*/
|
|
7252
|
+
Action["AddToCollection"] = "addToCollection";
|
|
7253
|
+
/**
|
|
7254
|
+
* Controls the visibility and disabled state of the "Create Collection" button.
|
|
7255
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7256
|
+
* @example
|
|
7257
|
+
* ```js
|
|
7258
|
+
* {
|
|
7259
|
+
* hiddenActions: [Action.CreateCollection],
|
|
7260
|
+
* disabledActions: [Action.CreateCollection],
|
|
7261
|
+
* }
|
|
7262
|
+
* ```
|
|
7263
|
+
*/
|
|
7264
|
+
Action["CreateCollection"] = "createCollection";
|
|
7265
|
+
/**
|
|
7266
|
+
* Controls the visibility and disabled state of the "Move" menu item in a
|
|
7267
|
+
* Collection.
|
|
7268
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7269
|
+
* @example
|
|
7270
|
+
* ```js
|
|
7271
|
+
* {
|
|
7272
|
+
* hiddenActions: [Action.MoveToCollection],
|
|
7273
|
+
* disabledActions: [Action.MoveToCollection],
|
|
7274
|
+
* }
|
|
7275
|
+
* ```
|
|
7276
|
+
*/
|
|
7277
|
+
Action["MoveToCollection"] = "moveToCollection";
|
|
7278
|
+
/**
|
|
7279
|
+
* Controls the visibility and disabled state of the "Remove" menu item in a
|
|
7280
|
+
* Collection.
|
|
7281
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7282
|
+
* @example
|
|
7283
|
+
* ```js
|
|
7284
|
+
* {
|
|
7285
|
+
* hiddenActions: [Action.RemoveFromCollection],
|
|
7286
|
+
* disabledActions: [Action.RemoveFromCollection],
|
|
7287
|
+
* }
|
|
7288
|
+
* ```
|
|
7289
|
+
*/
|
|
7290
|
+
Action["RemoveFromCollection"] = "removeFromCollection";
|
|
7291
|
+
/**
|
|
7292
|
+
* Controls the visibility and disabled state of the "Delete" menu item for a
|
|
7293
|
+
* Collection.
|
|
7294
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7295
|
+
* @example
|
|
7296
|
+
* ```js
|
|
7297
|
+
* {
|
|
7298
|
+
* hiddenActions: [Action.DeleteCollection],
|
|
7299
|
+
* disabledActions: [Action.DeleteCollection],
|
|
7300
|
+
* }
|
|
7301
|
+
* ```
|
|
7302
|
+
*/
|
|
7303
|
+
Action["DeleteCollection"] = "deleteCollection";
|
|
6948
7304
|
})(Action || (Action = {}));
|
|
6949
7305
|
var PrefetchFeatures;
|
|
6950
7306
|
(function (PrefetchFeatures) {
|
|
@@ -7235,6 +7591,36 @@ var EmbedErrorCodes;
|
|
|
7235
7591
|
/** UpdateParameters payload is invalid - malformed applicability */
|
|
7236
7592
|
EmbedErrorCodes["UPDATEPARAMETERS_INVALID_PAYLOAD"] = "UPDATEPARAMETERS_INVALID_PAYLOAD";
|
|
7237
7593
|
})(EmbedErrorCodes || (EmbedErrorCodes = {}));
|
|
7594
|
+
/**
|
|
7595
|
+
* How badly an error affects the embed, so the host can decide whether it is
|
|
7596
|
+
* worth surfacing to the end user.
|
|
7597
|
+
*
|
|
7598
|
+
* Mirrors the severity that ThoughtSpot itself stamps on errors raised inside
|
|
7599
|
+
* the embedded app, so a host can apply one rule to both sources.
|
|
7600
|
+
*
|
|
7601
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
7602
|
+
* @group Error Handling
|
|
7603
|
+
*
|
|
7604
|
+
* @example
|
|
7605
|
+
* Only surface errors that took the embed down
|
|
7606
|
+
*
|
|
7607
|
+
* ```js
|
|
7608
|
+
* embed.on(EmbedEvent.Error, (error) => {
|
|
7609
|
+
* if (error.severity === EmbedErrorSeverity.SEV1) {
|
|
7610
|
+
* showBanner(error.message);
|
|
7611
|
+
* }
|
|
7612
|
+
* });
|
|
7613
|
+
* ```
|
|
7614
|
+
*/
|
|
7615
|
+
var EmbedErrorSeverity;
|
|
7616
|
+
(function (EmbedErrorSeverity) {
|
|
7617
|
+
/** The embed cannot render. Nothing usable is on screen. */
|
|
7618
|
+
EmbedErrorSeverity[EmbedErrorSeverity["SEV1"] = 1] = "SEV1";
|
|
7619
|
+
/** Something is degraded but the embed still works. */
|
|
7620
|
+
EmbedErrorSeverity[EmbedErrorSeverity["SEV2"] = 2] = "SEV2";
|
|
7621
|
+
/** Everything else, including validation of the embedder's own input. */
|
|
7622
|
+
EmbedErrorSeverity[EmbedErrorSeverity["SEV3"] = 3] = "SEV3";
|
|
7623
|
+
})(EmbedErrorSeverity || (EmbedErrorSeverity = {}));
|
|
7238
7624
|
/**
|
|
7239
7625
|
* Context types for specifying the page context when triggering host events.
|
|
7240
7626
|
* Used as the third parameter in the `trigger` method to help ThoughtSpot
|
|
@@ -7275,20 +7661,27 @@ var ContextType;
|
|
|
7275
7661
|
ContextType["Other"] = "other";
|
|
7276
7662
|
})(ContextType || (ContextType = {}));
|
|
7277
7663
|
/**
|
|
7278
|
-
*
|
|
7664
|
+
* Named groups of ThoughtSpot APIs that can be intercepted, for use in
|
|
7665
|
+
* `interceptUrls`. Each group expands to the underlying request URLs, so you do
|
|
7666
|
+
* not have to list them individually.
|
|
7279
7667
|
*/
|
|
7280
7668
|
var InterceptedApiType;
|
|
7281
7669
|
(function (InterceptedApiType) {
|
|
7282
7670
|
/**
|
|
7283
|
-
* The
|
|
7671
|
+
* The APIs that fetch the data backing an Answer, including its chart,
|
|
7672
|
+
* table, and headline data.
|
|
7284
7673
|
*/
|
|
7285
7674
|
InterceptedApiType["AnswerData"] = "AnswerData";
|
|
7286
7675
|
/**
|
|
7287
|
-
*
|
|
7676
|
+
* Intercepts every `fetch` request the embedded application makes, not only
|
|
7677
|
+
* the data APIs. This includes authentication, session, and metadata calls,
|
|
7678
|
+
* so the handler must respond to requests it does not recognize by passing
|
|
7679
|
+
* `execute: true`. Listing this alongside other entries in `interceptUrls`
|
|
7680
|
+
* supersedes them.
|
|
7288
7681
|
*/
|
|
7289
7682
|
InterceptedApiType["ALL"] = "ALL";
|
|
7290
7683
|
/**
|
|
7291
|
-
* The
|
|
7684
|
+
* The APIs that fetch the data backing a Liveboard.
|
|
7292
7685
|
*/
|
|
7293
7686
|
InterceptedApiType["LiveboardData"] = "LiveboardData";
|
|
7294
7687
|
})(InterceptedApiType || (InterceptedApiType = {}));
|
|
@@ -7412,7 +7805,7 @@ var TableContentDensity;
|
|
|
7412
7805
|
TableContentDensity["Compact"] = "COMPACT";
|
|
7413
7806
|
})(TableContentDensity || (TableContentDensity = {}));
|
|
7414
7807
|
|
|
7415
|
-
var version$1="1.
|
|
7808
|
+
var version$1="1.52.1";var pkg = {version:version$1};
|
|
7416
7809
|
|
|
7417
7810
|
const { version } = pkg;
|
|
7418
7811
|
|
|
@@ -8165,6 +8558,43 @@ const setParamIfDefined = (queryParams, param, value, asBoolean = false) => {
|
|
|
8165
8558
|
if (value !== undefined) {
|
|
8166
8559
|
queryParams[param] = asBoolean ? !!value : value;
|
|
8167
8560
|
}
|
|
8561
|
+
};
|
|
8562
|
+
/**
|
|
8563
|
+
* Calculates the element center for the currently visible viewport of the
|
|
8564
|
+
* element, using the scroll position of the host app, the offsetTop of the
|
|
8565
|
+
* element in the host app, and the viewport height of the tab.
|
|
8566
|
+
*
|
|
8567
|
+
* The returned keys are sent to the ThoughtSpot app over postMessage, so they
|
|
8568
|
+
* are named after the iframe and must not be renamed.
|
|
8569
|
+
* @param element The element to measure
|
|
8570
|
+
* @returns The element center within the visible viewport, the element height,
|
|
8571
|
+
* and the viewport height.
|
|
8572
|
+
*/
|
|
8573
|
+
const calculateElementCenter = (element) => {
|
|
8574
|
+
const offsetTopClient = getOffsetTop(element);
|
|
8575
|
+
const scrollTopClient = window.scrollY;
|
|
8576
|
+
const viewPortHeight = window.innerHeight;
|
|
8577
|
+
const iframeHeight = element.offsetHeight;
|
|
8578
|
+
const iframeScrolled = scrollTopClient - offsetTopClient;
|
|
8579
|
+
let iframeVisibleViewPort;
|
|
8580
|
+
let iframeOffset;
|
|
8581
|
+
if (iframeScrolled < 0) {
|
|
8582
|
+
iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
|
|
8583
|
+
iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
|
|
8584
|
+
iframeOffset = 0;
|
|
8585
|
+
}
|
|
8586
|
+
else {
|
|
8587
|
+
iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
|
|
8588
|
+
iframeOffset = iframeScrolled;
|
|
8589
|
+
}
|
|
8590
|
+
const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
|
|
8591
|
+
return {
|
|
8592
|
+
iframeCenter,
|
|
8593
|
+
iframeScrolled,
|
|
8594
|
+
iframeHeight,
|
|
8595
|
+
viewPortHeight,
|
|
8596
|
+
iframeVisibleViewPort,
|
|
8597
|
+
};
|
|
8168
8598
|
};
|
|
8169
8599
|
|
|
8170
8600
|
/** Used for built-in method references. */
|
|
@@ -9075,7 +9505,110 @@ var UIPassthroughEvent;
|
|
|
9075
9505
|
UIPassthroughEvent["GetTabs"] = "getTabs";
|
|
9076
9506
|
UIPassthroughEvent["GetGroups"] = "getGroups";
|
|
9077
9507
|
UIPassthroughEvent["GetExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
|
|
9078
|
-
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
9508
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
9509
|
+
// NOTE: HostEventRequest / HostEventResponse / TriggerPayload / TriggerResponse
|
|
9510
|
+
// live in the sibling ./host-event-contracts, which layers the
|
|
9511
|
+
// HostEventRequestMap on top of the UI-passthrough mapping above.
|
|
9512
|
+
// The former 2-tier definitions that lived here were superseded and removed.
|
|
9513
|
+
|
|
9514
|
+
/**
|
|
9515
|
+
* Copyright (c) 2026
|
|
9516
|
+
*
|
|
9517
|
+
* Dedicated transport layer for SDK <-> ThoughtSpot iframe messaging.
|
|
9518
|
+
*
|
|
9519
|
+
* Owns the postMessage/MessageChannel mechanics and origin resolution so
|
|
9520
|
+
* that embed/business logic (ts-embed.ts, hostEventClient) never touches
|
|
9521
|
+
* the wire directly. The wire format is unchanged from the historical
|
|
9522
|
+
* implementation — this layer is a pure structural extraction.
|
|
9523
|
+
*/
|
|
9524
|
+
/**
|
|
9525
|
+
* Default time to wait for the app to respond to a request-response
|
|
9526
|
+
* message before giving up and reclaiming the channel.
|
|
9527
|
+
*/
|
|
9528
|
+
const MESSAGE_RESPONSE_TIMEOUT = 30000;
|
|
9529
|
+
/**
|
|
9530
|
+
* Single implementation of origin resolution for the embedded app.
|
|
9531
|
+
* Returns the origin (scheme://host[:port]) for a ThoughtSpot host URL,
|
|
9532
|
+
* or null when it cannot be parsed.
|
|
9533
|
+
* @param thoughtSpotHost
|
|
9534
|
+
*/
|
|
9535
|
+
const resolveMessageOrigin = (thoughtSpotHost) => {
|
|
9536
|
+
try {
|
|
9537
|
+
return new URL(thoughtSpotHost).origin;
|
|
9538
|
+
}
|
|
9539
|
+
catch (e) {
|
|
9540
|
+
return null;
|
|
9541
|
+
}
|
|
9542
|
+
};
|
|
9543
|
+
/**
|
|
9544
|
+
* Validates that an inbound window message came from the embedded
|
|
9545
|
+
* ThoughtSpot app: the source window must be the embed iframe's window and,
|
|
9546
|
+
* when the expected origin is resolvable, the message origin must match it.
|
|
9547
|
+
*
|
|
9548
|
+
* Fails open (returns true) on the origin check when the expected origin
|
|
9549
|
+
* cannot be resolved, to avoid breaking unconventional-but-working setups;
|
|
9550
|
+
* a warning is logged on mismatch either way.
|
|
9551
|
+
* @param event The message event received on window.
|
|
9552
|
+
* @param iFrame The embed iframe the message should originate from.
|
|
9553
|
+
* @param thoughtSpotHost The configured ThoughtSpot host.
|
|
9554
|
+
*/
|
|
9555
|
+
const isMessageFromIframe = (event, iFrame, thoughtSpotHost) => {
|
|
9556
|
+
if (event.source !== (iFrame === null || iFrame === void 0 ? void 0 : iFrame.contentWindow)) {
|
|
9557
|
+
return false;
|
|
9558
|
+
}
|
|
9559
|
+
const expectedOrigin = resolveMessageOrigin(thoughtSpotHost);
|
|
9560
|
+
if (expectedOrigin && event.origin && event.origin !== expectedOrigin) {
|
|
9561
|
+
logger$3.warn(`Dropped message from unexpected origin ${event.origin}; expected ${expectedOrigin}`);
|
|
9562
|
+
return false;
|
|
9563
|
+
}
|
|
9564
|
+
return true;
|
|
9565
|
+
};
|
|
9566
|
+
/**
|
|
9567
|
+
* Posts a one-way message to the embedded app's iframe, optionally
|
|
9568
|
+
* transferring a MessageChannel port for the response.
|
|
9569
|
+
* @param iFrame
|
|
9570
|
+
* @param message
|
|
9571
|
+
* @param thoughtSpotHost Used as the postMessage targetOrigin.
|
|
9572
|
+
* @param channel
|
|
9573
|
+
*/
|
|
9574
|
+
const postMessageToIframe = (iFrame, message, thoughtSpotHost, channel) => {
|
|
9575
|
+
var _a;
|
|
9576
|
+
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, channel ? [channel.port2] : []);
|
|
9577
|
+
};
|
|
9578
|
+
/**
|
|
9579
|
+
* Sends a request-response message to the embedded app over a dedicated
|
|
9580
|
+
* MessageChannel. Resolves with the response payload; rejects when the app
|
|
9581
|
+
* responds with an error; resolves with a timeout Error object when no
|
|
9582
|
+
* response arrives in time (historical behavior, preserved for backward
|
|
9583
|
+
* compatibility).
|
|
9584
|
+
* @param iFrame
|
|
9585
|
+
* @param message
|
|
9586
|
+
* @param thoughtSpotHost
|
|
9587
|
+
* @param timeoutMs
|
|
9588
|
+
*/
|
|
9589
|
+
function sendMessageWithResponse(iFrame, message, thoughtSpotHost, timeoutMs = MESSAGE_RESPONSE_TIMEOUT) {
|
|
9590
|
+
return new Promise((res, rej) => {
|
|
9591
|
+
const channel = new MessageChannel();
|
|
9592
|
+
// Close the messageChannel and resolve the promise if timeout.
|
|
9593
|
+
const timeoutId = setTimeout(() => {
|
|
9594
|
+
channel.port1.close();
|
|
9595
|
+
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
9596
|
+
}, timeoutMs);
|
|
9597
|
+
channel.port1.onmessage = ({ data: responseData }) => {
|
|
9598
|
+
var _a;
|
|
9599
|
+
clearTimeout(timeoutId);
|
|
9600
|
+
channel.port1.close();
|
|
9601
|
+
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);
|
|
9602
|
+
if (error) {
|
|
9603
|
+
rej(error);
|
|
9604
|
+
}
|
|
9605
|
+
else {
|
|
9606
|
+
res(responseData);
|
|
9607
|
+
}
|
|
9608
|
+
};
|
|
9609
|
+
postMessageToIframe(iFrame, message, thoughtSpotHost, channel);
|
|
9610
|
+
});
|
|
9611
|
+
}
|
|
9079
9612
|
|
|
9080
9613
|
const EndPoints = {
|
|
9081
9614
|
AUTH_VERIFICATION: '/callosum/v1/session/info',
|
|
@@ -10009,7 +10542,7 @@ class AnswerService {
|
|
|
10009
10542
|
async getTML() {
|
|
10010
10543
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
10011
10544
|
const edoc = object[0].edoc;
|
|
10012
|
-
const YAML = await import('./index-
|
|
10545
|
+
const YAML = await import('./index-C1pmYb5H.js');
|
|
10013
10546
|
const parsedDoc = YAML.parse(edoc);
|
|
10014
10547
|
return {
|
|
10015
10548
|
answer: {
|
|
@@ -20285,23 +20818,11 @@ const reload = (iFrame) => {
|
|
|
20285
20818
|
iFrame.src = src;
|
|
20286
20819
|
}, 100);
|
|
20287
20820
|
};
|
|
20821
|
+
const TRIGGER_TIMEOUT = MESSAGE_RESPONSE_TIMEOUT;
|
|
20288
20822
|
/**
|
|
20289
|
-
*
|
|
20290
|
-
*
|
|
20291
|
-
*
|
|
20292
|
-
* @param message.type
|
|
20293
|
-
* @param message.data
|
|
20294
|
-
* @param message.context
|
|
20295
|
-
* @param thoughtSpotHost
|
|
20296
|
-
* @param channel
|
|
20297
|
-
*/
|
|
20298
|
-
function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
|
|
20299
|
-
var _a;
|
|
20300
|
-
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
|
|
20301
|
-
}
|
|
20302
|
-
const TRIGGER_TIMEOUT = 30000;
|
|
20303
|
-
/**
|
|
20304
|
-
*
|
|
20823
|
+
* Processes a host event trigger: handles SDK-local events (Reload,
|
|
20824
|
+
* Present) and forwards everything else to the embedded app over the
|
|
20825
|
+
* iframe transport.
|
|
20305
20826
|
* @param iFrame
|
|
20306
20827
|
* @param messageType
|
|
20307
20828
|
* @param thoughtSpotHost
|
|
@@ -20309,42 +20830,22 @@ const TRIGGER_TIMEOUT = 30000;
|
|
|
20309
20830
|
* @param context
|
|
20310
20831
|
*/
|
|
20311
20832
|
function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
|
|
20312
|
-
|
|
20313
|
-
|
|
20314
|
-
|
|
20315
|
-
|
|
20316
|
-
|
|
20317
|
-
|
|
20318
|
-
|
|
20319
|
-
|
|
20320
|
-
|
|
20321
|
-
|
|
20322
|
-
handlePresentEvent(iFrame);
|
|
20323
|
-
}
|
|
20324
|
-
else {
|
|
20325
|
-
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
20326
|
-
}
|
|
20833
|
+
var _a;
|
|
20834
|
+
if (messageType === HostEvent.Reload) {
|
|
20835
|
+
reload(iFrame);
|
|
20836
|
+
return Promise.resolve(null);
|
|
20837
|
+
}
|
|
20838
|
+
if (messageType === HostEvent.Present) {
|
|
20839
|
+
const embedConfig = getEmbedConfig();
|
|
20840
|
+
const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
|
|
20841
|
+
if (!disableFullscreenPresentation) {
|
|
20842
|
+
handlePresentEvent(iFrame);
|
|
20327
20843
|
}
|
|
20328
|
-
|
|
20329
|
-
|
|
20330
|
-
|
|
20331
|
-
|
|
20332
|
-
|
|
20333
|
-
}, TRIGGER_TIMEOUT);
|
|
20334
|
-
channel.port1.onmessage = ({ data: responseData }) => {
|
|
20335
|
-
var _a;
|
|
20336
|
-
clearTimeout(timeoutId);
|
|
20337
|
-
channel.port1.close();
|
|
20338
|
-
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);
|
|
20339
|
-
if (error) {
|
|
20340
|
-
rej(error);
|
|
20341
|
-
}
|
|
20342
|
-
else {
|
|
20343
|
-
res(responseData);
|
|
20344
|
-
}
|
|
20345
|
-
};
|
|
20346
|
-
return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
|
|
20347
|
-
});
|
|
20844
|
+
else {
|
|
20845
|
+
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
20846
|
+
}
|
|
20847
|
+
}
|
|
20848
|
+
return sendMessageWithResponse(iFrame, { type: messageType, data, context }, thoughtSpotHost, TRIGGER_TIMEOUT);
|
|
20348
20849
|
}
|
|
20349
20850
|
|
|
20350
20851
|
/**
|
|
@@ -21053,6 +21554,11 @@ class HostEventClient {
|
|
|
21053
21554
|
if (!isValidUpdateFiltersPayload(payload)) {
|
|
21054
21555
|
throwUpdateFiltersValidationError();
|
|
21055
21556
|
}
|
|
21557
|
+
// The shared contract accepts both current (columnName/operator) and
|
|
21558
|
+
// legacy (column/oper) filter field names — as does the validation
|
|
21559
|
+
// above and the app at runtime. The UIPassthrough FilterUpdate type
|
|
21560
|
+
// still requires the legacy names; bridge until that contract is
|
|
21561
|
+
// audited.
|
|
21056
21562
|
return this.handleHostEventWithParam(UIPassthroughEvent.UpdateFilters, payload, context);
|
|
21057
21563
|
}
|
|
21058
21564
|
handleUpdateParametersEvent(payload, context) {
|
|
@@ -21203,6 +21709,7 @@ const handleInterceptEvent = async (params) => {
|
|
|
21203
21709
|
errorType: ErrorDetailsTypes.API,
|
|
21204
21710
|
message: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
21205
21711
|
code: EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
|
|
21712
|
+
severity: EmbedErrorSeverity.SEV3,
|
|
21206
21713
|
error: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
21207
21714
|
};
|
|
21208
21715
|
executeEvent(EmbedEvent.Error, errorDetails);
|
|
@@ -21286,6 +21793,12 @@ const TS_EMBED_ID = '_thoughtspot-embed';
|
|
|
21286
21793
|
*/
|
|
21287
21794
|
const PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY = 'tsEmbedOriginalPosition';
|
|
21288
21795
|
const PRERENDER_WRAPPER_ID_PREFIX = 'tsEmbed-pre-render-wrapper-';
|
|
21796
|
+
// The container applies UpdateEmbedParams through React state, so a delivered
|
|
21797
|
+
// post is not the same as the params being in effect.
|
|
21798
|
+
const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
|
|
21799
|
+
// The container ignores runtimeFilterParams/runtimeParameterParams unless truthy, so
|
|
21800
|
+
// null or '' leaves the previous embed's values in place. '&' is truthy and parses to {}.
|
|
21801
|
+
const NO_RUNTIME_PARAMS = '&';
|
|
21289
21802
|
/**
|
|
21290
21803
|
* The event id map from v2 event names to v1 event id
|
|
21291
21804
|
* v1 events are the classic embed events implemented in Blink v1
|
|
@@ -21312,6 +21825,7 @@ class TsEmbed {
|
|
|
21312
21825
|
* The key to store the embed instance in the DOM node
|
|
21313
21826
|
*/
|
|
21314
21827
|
this.embedNodeKey = '__tsEmbed';
|
|
21828
|
+
this.embedContainerLoadedKey = '__tsEmbedContainerLoaded';
|
|
21315
21829
|
this.isAppInitialized = false;
|
|
21316
21830
|
/**
|
|
21317
21831
|
* Should we encode URL Query Params using base64 encoding which ThoughtSpot
|
|
@@ -21332,7 +21846,7 @@ class TsEmbed {
|
|
|
21332
21846
|
const eventType = this.getEventType(event);
|
|
21333
21847
|
const eventPort = this.getEventPort(event);
|
|
21334
21848
|
const eventData = this.formatEventData(event, eventType);
|
|
21335
|
-
if (event
|
|
21849
|
+
if (isMessageFromIframe(event, this.iFrame, this.thoughtSpotHost)) {
|
|
21336
21850
|
const processedEventData = processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.hostElement);
|
|
21337
21851
|
if (eventType === EmbedEvent.ApiIntercept) {
|
|
21338
21852
|
this.handleApiInterceptEvent({ eventData, eventPort });
|
|
@@ -21474,7 +21988,7 @@ class TsEmbed {
|
|
|
21474
21988
|
this.createEmbedContainerHandler = (source) => () => {
|
|
21475
21989
|
const processEmbedContainerReady = () => {
|
|
21476
21990
|
logger$3.debug('processEmbedContainerReady');
|
|
21477
|
-
this.
|
|
21991
|
+
this.markEmbedContainerLoaded();
|
|
21478
21992
|
this.executeEmbedContainerReadyCallbacks();
|
|
21479
21993
|
};
|
|
21480
21994
|
if (source === EmbedEvent.AuthInit) {
|
|
@@ -21488,6 +22002,9 @@ class TsEmbed {
|
|
|
21488
22002
|
processEmbedContainerReady();
|
|
21489
22003
|
}
|
|
21490
22004
|
};
|
|
22005
|
+
// Subclasses that navigate the pre-render on show must await this before
|
|
22006
|
+
// triggering Navigate. Resolves even on failure, so navigation is never blocked.
|
|
22007
|
+
this.preRenderParamsApplied = Promise.resolve();
|
|
21491
22008
|
this.hostElement = getDOMNode(domSelector);
|
|
21492
22009
|
this.eventHandlerMap = new Map();
|
|
21493
22010
|
this.isError = false;
|
|
@@ -21547,6 +22064,7 @@ class TsEmbed {
|
|
|
21547
22064
|
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21548
22065
|
message: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
21549
22066
|
code: EmbedErrorCodes.INIT_ERROR,
|
|
22067
|
+
severity: EmbedErrorSeverity.SEV1,
|
|
21550
22068
|
error: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
21551
22069
|
});
|
|
21552
22070
|
}
|
|
@@ -21557,7 +22075,10 @@ class TsEmbed {
|
|
|
21557
22075
|
*/
|
|
21558
22076
|
handleError(errorDetails) {
|
|
21559
22077
|
this.isError = true;
|
|
21560
|
-
this.executeCallbacks(EmbedEvent.Error,
|
|
22078
|
+
this.executeCallbacks(EmbedEvent.Error, {
|
|
22079
|
+
severity: EmbedErrorSeverity.SEV3,
|
|
22080
|
+
...errorDetails,
|
|
22081
|
+
});
|
|
21561
22082
|
// Log error
|
|
21562
22083
|
logger$3.error(errorDetails);
|
|
21563
22084
|
}
|
|
@@ -21642,6 +22163,7 @@ class TsEmbed {
|
|
|
21642
22163
|
errorType: ErrorDetailsTypes.NETWORK,
|
|
21643
22164
|
message: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
21644
22165
|
code: EmbedErrorCodes.NETWORK_ERROR,
|
|
22166
|
+
severity: EmbedErrorSeverity.SEV2,
|
|
21645
22167
|
offlineWarning: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
21646
22168
|
};
|
|
21647
22169
|
this.executeCallbacks(EmbedEvent.Error, errorDetails);
|
|
@@ -21799,6 +22321,7 @@ class TsEmbed {
|
|
|
21799
22321
|
return `${basePath}#`;
|
|
21800
22322
|
}
|
|
21801
22323
|
async getUpdateEmbedParamsObject() {
|
|
22324
|
+
var _a, _b;
|
|
21802
22325
|
const queryParams = this.getEmbedParamsObject();
|
|
21803
22326
|
// Values are URL-serialized (e.g. dataSources as '["guid"]'); parse
|
|
21804
22327
|
// them back so the event payload matches a URL load (SCAL-334713).
|
|
@@ -21806,7 +22329,16 @@ class TsEmbed {
|
|
|
21806
22329
|
queryParams[key] = deserializeParam(queryParams[key]);
|
|
21807
22330
|
});
|
|
21808
22331
|
const appInitData = await this.getAppInitData();
|
|
21809
|
-
return {
|
|
22332
|
+
return {
|
|
22333
|
+
...this.viewConfig,
|
|
22334
|
+
...queryParams,
|
|
22335
|
+
...appInitData,
|
|
22336
|
+
// A show cycle has no URL to carry these, so the payload always states them
|
|
22337
|
+
// — including "none", which is the case that leaks the previous filters.
|
|
22338
|
+
runtimeFilterParams: getFilterQuery((_a = this.viewConfig.runtimeFilters) !== null && _a !== void 0 ? _a : []) || NO_RUNTIME_PARAMS,
|
|
22339
|
+
runtimeParameterParams: getRuntimeParameters((_b = this.viewConfig.runtimeParameters) !== null && _b !== void 0 ? _b : [])
|
|
22340
|
+
|| NO_RUNTIME_PARAMS,
|
|
22341
|
+
};
|
|
21810
22342
|
}
|
|
21811
22343
|
/**
|
|
21812
22344
|
* Common query params set for all the embed modes.
|
|
@@ -22014,9 +22546,10 @@ class TsEmbed {
|
|
|
22014
22546
|
return iFrame;
|
|
22015
22547
|
}
|
|
22016
22548
|
/**
|
|
22017
|
-
* Returns a merged {@link PreRenderConfig} object where each
|
|
22018
|
-
*
|
|
22019
|
-
*
|
|
22549
|
+
* Returns a merged {@link PreRenderConfig} object where each key prefers the
|
|
22550
|
+
* value from `preRenderConfig` over its deprecated top-level `viewConfig`
|
|
22551
|
+
* counterpart (`id`/`preRenderId`, `containerSelector`/`preRenderContainer`,
|
|
22552
|
+
* `doNotTrackSize`/`doNotTrackPreRenderSize`) for backward compatibility.
|
|
22020
22553
|
*/
|
|
22021
22554
|
getPreRenderConfig() {
|
|
22022
22555
|
var _a, _b, _c, _d;
|
|
@@ -22024,16 +22557,16 @@ class TsEmbed {
|
|
|
22024
22557
|
const preRenderCfg = (_a = viewCfg.preRenderConfig) !== null && _a !== void 0 ? _a : {};
|
|
22025
22558
|
return {
|
|
22026
22559
|
...preRenderCfg,
|
|
22027
|
-
|
|
22028
|
-
|
|
22029
|
-
|
|
22560
|
+
id: (_b = preRenderCfg.id) !== null && _b !== void 0 ? _b : viewCfg.preRenderId,
|
|
22561
|
+
containerSelector: (_c = preRenderCfg.containerSelector) !== null && _c !== void 0 ? _c : viewCfg.preRenderContainer,
|
|
22562
|
+
doNotTrackSize: (_d = preRenderCfg.doNotTrackSize) !== null && _d !== void 0 ? _d : viewCfg.doNotTrackPreRenderSize,
|
|
22030
22563
|
};
|
|
22031
22564
|
}
|
|
22032
22565
|
/**
|
|
22033
22566
|
* Returns true if this embed instance is configured for pre-rendering.
|
|
22034
22567
|
*/
|
|
22035
22568
|
isPreRenderEmbed() {
|
|
22036
|
-
return !!this.getPreRenderConfig().
|
|
22569
|
+
return !!this.getPreRenderConfig().id;
|
|
22037
22570
|
}
|
|
22038
22571
|
handleInsertionIntoDOM(child) {
|
|
22039
22572
|
if (this.isPreRenderEmbed()) {
|
|
@@ -22129,6 +22662,7 @@ class TsEmbed {
|
|
|
22129
22662
|
errorType: ErrorDetailsTypes.API,
|
|
22130
22663
|
message: error.message || ERROR_MESSAGE.LOGIN_FAILED,
|
|
22131
22664
|
code: EmbedErrorCodes.LOGIN_FAILED,
|
|
22665
|
+
severity: EmbedErrorSeverity.SEV1,
|
|
22132
22666
|
error: error,
|
|
22133
22667
|
});
|
|
22134
22668
|
});
|
|
@@ -22220,7 +22754,7 @@ class TsEmbed {
|
|
|
22220
22754
|
*/
|
|
22221
22755
|
resolvePreRenderContainerTarget() {
|
|
22222
22756
|
var _a;
|
|
22223
|
-
const containerConfig = this.getPreRenderConfig().
|
|
22757
|
+
const containerConfig = this.getPreRenderConfig().containerSelector;
|
|
22224
22758
|
let container = null;
|
|
22225
22759
|
if (typeof containerConfig === 'string') {
|
|
22226
22760
|
try {
|
|
@@ -22245,7 +22779,7 @@ class TsEmbed {
|
|
|
22245
22779
|
return;
|
|
22246
22780
|
}
|
|
22247
22781
|
const ownerContainer = (_a = preRenderedObject.preRenderContainerEl) !== null && _a !== void 0 ? _a : document.body;
|
|
22248
|
-
if (this.getPreRenderConfig().
|
|
22782
|
+
if (this.getPreRenderConfig().containerSelector
|
|
22249
22783
|
&& this.resolvePreRenderContainerTarget() !== ownerContainer) {
|
|
22250
22784
|
logger$3.warn('preRenderContainer is applied only by the component that creates the preRender; '
|
|
22251
22785
|
+ 'the one passed here is ignored. Set it on the PreRender component instead.');
|
|
@@ -22435,40 +22969,6 @@ class TsEmbed {
|
|
|
22435
22969
|
getCompatibleEventType(eventType) {
|
|
22436
22970
|
return V1EventMap[eventType] || eventType;
|
|
22437
22971
|
}
|
|
22438
|
-
/**
|
|
22439
|
-
* Calculates the iframe center for the current visible viewPort
|
|
22440
|
-
* of iframe using Scroll position of Host App, offsetTop for iframe
|
|
22441
|
-
* in Host app. ViewPort height of the tab.
|
|
22442
|
-
* @returns iframe Center in visible viewport,
|
|
22443
|
-
* Iframe height,
|
|
22444
|
-
* View port height.
|
|
22445
|
-
*/
|
|
22446
|
-
getIframeCenter() {
|
|
22447
|
-
const offsetTopClient = getOffsetTop(this.iFrame);
|
|
22448
|
-
const scrollTopClient = window.scrollY;
|
|
22449
|
-
const viewPortHeight = window.innerHeight;
|
|
22450
|
-
const iframeHeight = this.iFrame.offsetHeight;
|
|
22451
|
-
const iframeScrolled = scrollTopClient - offsetTopClient;
|
|
22452
|
-
let iframeVisibleViewPort;
|
|
22453
|
-
let iframeOffset;
|
|
22454
|
-
if (iframeScrolled < 0) {
|
|
22455
|
-
iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
|
|
22456
|
-
iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
|
|
22457
|
-
iframeOffset = 0;
|
|
22458
|
-
}
|
|
22459
|
-
else {
|
|
22460
|
-
iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
|
|
22461
|
-
iframeOffset = iframeScrolled;
|
|
22462
|
-
}
|
|
22463
|
-
const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
|
|
22464
|
-
return {
|
|
22465
|
-
iframeCenter,
|
|
22466
|
-
iframeScrolled,
|
|
22467
|
-
iframeHeight,
|
|
22468
|
-
viewPortHeight,
|
|
22469
|
-
iframeVisibleViewPort,
|
|
22470
|
-
};
|
|
22471
|
-
}
|
|
22472
22972
|
/**
|
|
22473
22973
|
* Registers an event listener to trigger an alert when the ThoughtSpot app
|
|
22474
22974
|
* sends an event of a particular message type to the host application.
|
|
@@ -22552,13 +23052,32 @@ class TsEmbed {
|
|
|
22552
23052
|
var _a;
|
|
22553
23053
|
const embedObj = (_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
22554
23054
|
if (embedObj === this) {
|
|
22555
|
-
logger$3.
|
|
23055
|
+
logger$3.debug('embedObj is same as this');
|
|
22556
23056
|
}
|
|
22557
23057
|
return embedObj;
|
|
22558
23058
|
}
|
|
23059
|
+
takeOverPreRender() {
|
|
23060
|
+
if (!this.preRenderWrapper)
|
|
23061
|
+
return;
|
|
23062
|
+
this.preRenderWrapper[this.embedNodeKey] = this;
|
|
23063
|
+
}
|
|
23064
|
+
// The flag lives on the wrapper because it describes the iframe: an instance
|
|
23065
|
+
// hidden when the container announced itself would otherwise report false forever.
|
|
23066
|
+
markEmbedContainerLoaded() {
|
|
23067
|
+
this.isEmbedContainerLoaded = true;
|
|
23068
|
+
if (this.preRenderWrapper) {
|
|
23069
|
+
this.preRenderWrapper[this.embedContainerLoadedKey] = true;
|
|
23070
|
+
}
|
|
23071
|
+
}
|
|
22559
23072
|
checkEmbedContainerLoaded() {
|
|
23073
|
+
var _a;
|
|
22560
23074
|
if (this.isEmbedContainerLoaded)
|
|
22561
23075
|
return true;
|
|
23076
|
+
if ((_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedContainerLoadedKey]) {
|
|
23077
|
+
this.isEmbedContainerLoaded = true;
|
|
23078
|
+
return true;
|
|
23079
|
+
}
|
|
23080
|
+
// Older builds stamped the flag on the instance, not the wrapper.
|
|
22562
23081
|
const preRenderObj = this.getPreRenderObj();
|
|
22563
23082
|
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
22564
23083
|
this.isEmbedContainerLoaded = true;
|
|
@@ -22587,8 +23106,12 @@ class TsEmbed {
|
|
|
22587
23106
|
}
|
|
22588
23107
|
/**
|
|
22589
23108
|
* Triggers an event to the embedded app
|
|
23109
|
+
*
|
|
23110
|
+
* Payload typing: from SDK 1.52.0 (ThoughtSpot Cloud 26.9.0.cl), unknown fields
|
|
23111
|
+
* on a known event's payload fail to compile. From SDK 1.54.0 (26.11.0.cl) the
|
|
23112
|
+
* payload is checked strictly against the event contract — update call sites now.
|
|
22590
23113
|
* @param {HostEvent} messageType The event type
|
|
22591
|
-
* @param {
|
|
23114
|
+
* @param {TriggerData} data The payload, typed against the event's contract
|
|
22592
23115
|
* @param {ContextType} context Optional context type to specify the context from which the event is triggered.
|
|
22593
23116
|
* Use ContextType.Search for search answer context, ContextType.Answer for answer/explore context,
|
|
22594
23117
|
* ContextType.Liveboard for liveboard context, or ContextType.Spotter for spotter context.
|
|
@@ -22605,7 +23128,11 @@ class TsEmbed {
|
|
|
22605
23128
|
* ```
|
|
22606
23129
|
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl (for context parameter)
|
|
22607
23130
|
*/
|
|
22608
|
-
async trigger(messageType,
|
|
23131
|
+
async trigger(messageType,
|
|
23132
|
+
// Contract shape is the contextual type: payload fields autocomplete
|
|
23133
|
+
// and unknown fields on object literals are flagged. Strict checks
|
|
23134
|
+
// land in SDK 1.54.0 — see TriggerData.
|
|
23135
|
+
data = {}, context) {
|
|
22609
23136
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
22610
23137
|
if (!this.isRendered) {
|
|
22611
23138
|
this.handleError({
|
|
@@ -22742,7 +23269,7 @@ class TsEmbed {
|
|
|
22742
23269
|
showPreRenderByDefault,
|
|
22743
23270
|
replaceExistingPreRender,
|
|
22744
23271
|
});
|
|
22745
|
-
if (!this.getPreRenderConfig().
|
|
23272
|
+
if (!this.getPreRenderConfig().id) {
|
|
22746
23273
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
22747
23274
|
return this;
|
|
22748
23275
|
}
|
|
@@ -22893,20 +23420,27 @@ class TsEmbed {
|
|
|
22893
23420
|
// have moved on to UpdateEmbedParams supported clusters
|
|
22894
23421
|
// this.validatePreRenderViewConfig(this.viewConfig); removed in #517
|
|
22895
23422
|
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
22896
|
-
|
|
22897
|
-
|
|
22898
|
-
|
|
22899
|
-
|
|
22900
|
-
|
|
22901
|
-
|
|
22902
|
-
|
|
22903
|
-
|
|
22904
|
-
|
|
22905
|
-
|
|
22906
|
-
|
|
22907
|
-
|
|
22908
|
-
|
|
22909
|
-
|
|
23423
|
+
// Created synchronously: a queued navigation needs something to await
|
|
23424
|
+
// whether the container is already loaded or not.
|
|
23425
|
+
this.preRenderParamsApplied = new Promise((resolve) => {
|
|
23426
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
23427
|
+
try {
|
|
23428
|
+
const params = await this.getUpdateEmbedParamsObject();
|
|
23429
|
+
this.trigger(HostEvent.UpdateEmbedParams, params);
|
|
23430
|
+
}
|
|
23431
|
+
catch (error) {
|
|
23432
|
+
logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
|
|
23433
|
+
this.handleError({
|
|
23434
|
+
errorType: ErrorDetailsTypes.API,
|
|
23435
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
|
|
23436
|
+
code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
|
|
23437
|
+
error: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
23438
|
+
});
|
|
23439
|
+
}
|
|
23440
|
+
finally {
|
|
23441
|
+
setTimeout(resolve, UPDATE_EMBED_PARAMS_SETTLE_MS);
|
|
23442
|
+
}
|
|
23443
|
+
});
|
|
22910
23444
|
});
|
|
22911
23445
|
}
|
|
22912
23446
|
/**
|
|
@@ -22918,12 +23452,12 @@ class TsEmbed {
|
|
|
22918
23452
|
async showPreRender() {
|
|
22919
23453
|
var _a, _b;
|
|
22920
23454
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_SHOW_PRE_RENDER, {
|
|
22921
|
-
preRenderId: this.getPreRenderConfig().
|
|
23455
|
+
preRenderId: this.getPreRenderConfig().id,
|
|
22922
23456
|
embedComponentType: this.viewConfig.embedComponentType,
|
|
22923
23457
|
});
|
|
22924
23458
|
if (this.shouldWaitForRenderPromise)
|
|
22925
23459
|
await this.isReadyForRenderPromise;
|
|
22926
|
-
if (!this.getPreRenderConfig().
|
|
23460
|
+
if (!this.getPreRenderConfig().id) {
|
|
22927
23461
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
22928
23462
|
return this;
|
|
22929
23463
|
}
|
|
@@ -22959,7 +23493,7 @@ class TsEmbed {
|
|
|
22959
23493
|
this.containerScrollListener = () => this.syncPreRenderStyle();
|
|
22960
23494
|
customContainer.addEventListener('scroll', this.containerScrollListener);
|
|
22961
23495
|
}
|
|
22962
|
-
if (!this.getPreRenderConfig().
|
|
23496
|
+
if (!this.getPreRenderConfig().doNotTrackSize) {
|
|
22963
23497
|
const observeTarget = (_b = this.insertedDomEl) !== null && _b !== void 0 ? _b : this.hostElement;
|
|
22964
23498
|
this.resizeObserver = new ResizeObserver((entries) => {
|
|
22965
23499
|
entries.forEach((entry) => {
|
|
@@ -22982,6 +23516,8 @@ class TsEmbed {
|
|
|
22982
23516
|
if (this.iFrame) {
|
|
22983
23517
|
this.setupFullscreenChangeHandler();
|
|
22984
23518
|
}
|
|
23519
|
+
// Last, so everything above still sees the instance being taken over from.
|
|
23520
|
+
this.takeOverPreRender();
|
|
22985
23521
|
return this;
|
|
22986
23522
|
}
|
|
22987
23523
|
getPreRenderPlaceHolderElement() {
|
|
@@ -23027,7 +23563,7 @@ class TsEmbed {
|
|
|
23027
23563
|
*/
|
|
23028
23564
|
hidePreRender() {
|
|
23029
23565
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_HIDE_PRE_RENDER, {
|
|
23030
|
-
preRenderId: this.getPreRenderConfig().
|
|
23566
|
+
preRenderId: this.getPreRenderConfig().id,
|
|
23031
23567
|
embedComponentType: this.viewConfig.embedComponentType,
|
|
23032
23568
|
});
|
|
23033
23569
|
logger$3.debug('HidePreRender Called');
|
|
@@ -23065,7 +23601,7 @@ class TsEmbed {
|
|
|
23065
23601
|
* @property {string} child - The HTML element ID for the PreRender child.
|
|
23066
23602
|
*/
|
|
23067
23603
|
getPreRenderIds() {
|
|
23068
|
-
const preRenderId = this.getPreRenderConfig().
|
|
23604
|
+
const preRenderId = this.getPreRenderConfig().id;
|
|
23069
23605
|
return {
|
|
23070
23606
|
wrapper: `${PRERENDER_WRAPPER_ID_PREFIX}${preRenderId}`,
|
|
23071
23607
|
child: `tsEmbed-pre-render-child-${preRenderId}`,
|
|
@@ -23184,6 +23720,9 @@ class V1Embed extends TsEmbed {
|
|
|
23184
23720
|
* ```
|
|
23185
23721
|
*/
|
|
23186
23722
|
on(messageType, callback, options = { start: false }) {
|
|
23723
|
+
// Mirror the base TsEmbed.on generic signature so the enriched
|
|
23724
|
+
// EmbedEventPayload (e.g. CustomAction's answerService) flows through
|
|
23725
|
+
// the override too, and the class hierarchy stays assignable.
|
|
23187
23726
|
const eventType = this.getCompatibleEventType(messageType);
|
|
23188
23727
|
return super.on(eventType, callback, options);
|
|
23189
23728
|
}
|
|
@@ -23353,7 +23892,7 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
|
|
|
23353
23892
|
}
|
|
23354
23893
|
getEmbedParamsObject() {
|
|
23355
23894
|
var _a;
|
|
23356
|
-
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;
|
|
23895
|
+
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;
|
|
23357
23896
|
const queryParams = this.getBaseQueryParams();
|
|
23358
23897
|
queryParams[Param.HideActions] = [
|
|
23359
23898
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -23376,6 +23915,9 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
|
|
|
23376
23915
|
if (enableSearchAssist) {
|
|
23377
23916
|
queryParams[Param.EnableSearchAssist] = true;
|
|
23378
23917
|
}
|
|
23918
|
+
if (hideAnswerEditPanel !== undefined) {
|
|
23919
|
+
queryParams[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
|
|
23920
|
+
}
|
|
23379
23921
|
if (hideResults) {
|
|
23380
23922
|
queryParams[Param.HideResult] = true;
|
|
23381
23923
|
}
|
|
@@ -23461,6 +24003,270 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
|
|
|
23461
24003
|
}
|
|
23462
24004
|
};
|
|
23463
24005
|
|
|
24006
|
+
/**
|
|
24007
|
+
* Copyright (c) 2025
|
|
24008
|
+
*
|
|
24009
|
+
* Full-height support for the Liveboard and app embeds.
|
|
24010
|
+
* @summary Full height
|
|
24011
|
+
*/
|
|
24012
|
+
/**
|
|
24013
|
+
* The height the embed falls back to when the host app has not configured
|
|
24014
|
+
* `minimumHeight` or `defaultHeight`.
|
|
24015
|
+
*/
|
|
24016
|
+
const DEFAULT_MINIMUM_HEIGHT = 500;
|
|
24017
|
+
/**
|
|
24018
|
+
* Routes that are part of the Liveboard experience itself. Navigating between
|
|
24019
|
+
* these does not reset the frame height, because the ThoughtSpot app keeps
|
|
24020
|
+
* reporting a height of its own for them.
|
|
24021
|
+
*/
|
|
24022
|
+
const LIVEBOARD_RELATED_ROUTES = [
|
|
24023
|
+
'/pinboard/',
|
|
24024
|
+
'/insights/pinboard/',
|
|
24025
|
+
'/schedules/',
|
|
24026
|
+
'/embed/viz/',
|
|
24027
|
+
'/embed/insights/viz/',
|
|
24028
|
+
'/liveboard/',
|
|
24029
|
+
'/insights/liveboard/',
|
|
24030
|
+
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
24031
|
+
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
24032
|
+
];
|
|
24033
|
+
/**
|
|
24034
|
+
* Owns every piece of full-height behavior for an embed: the height
|
|
24035
|
+
* negotiation with the ThoughtSpot app, the query parameters that switch the
|
|
24036
|
+
* feature on, and the viewport listeners that drive lazy loading.
|
|
24037
|
+
*
|
|
24038
|
+
* The controller is inert unless `fullHeight` is enabled, so embeds can create
|
|
24039
|
+
* one unconditionally.
|
|
24040
|
+
*/
|
|
24041
|
+
class FullHeightController {
|
|
24042
|
+
constructor(viewConfig, host) {
|
|
24043
|
+
this.host = host;
|
|
24044
|
+
this.scrollContainers = [];
|
|
24045
|
+
/**
|
|
24046
|
+
* Sets the frame height to the height reported by the ThoughtSpot app,
|
|
24047
|
+
* never going below the configured minimum.
|
|
24048
|
+
*/
|
|
24049
|
+
this.handleEmbedHeight = (payload) => {
|
|
24050
|
+
const height = Number(payload === null || payload === void 0 ? void 0 : payload.data);
|
|
24051
|
+
if (!isNaN(height)) {
|
|
24052
|
+
this.host.setFrameHeight(Math.max(height, this.minimumHeight));
|
|
24053
|
+
}
|
|
24054
|
+
this.sendVisibleCoordinates();
|
|
24055
|
+
};
|
|
24056
|
+
/**
|
|
24057
|
+
* Answers the app's request for the center of the visible embed region.
|
|
24058
|
+
*/
|
|
24059
|
+
this.handleEmbedIframeCenter = (payload, responder) => {
|
|
24060
|
+
const iframe = this.host.getIframe();
|
|
24061
|
+
if (!iframe) {
|
|
24062
|
+
return;
|
|
24063
|
+
}
|
|
24064
|
+
responder === null || responder === void 0 ? void 0 : responder({
|
|
24065
|
+
type: EmbedEvent.EmbedIframeCenter,
|
|
24066
|
+
data: calculateElementCenter(iframe),
|
|
24067
|
+
});
|
|
24068
|
+
};
|
|
24069
|
+
/**
|
|
24070
|
+
* Answers the app's request for the currently visible embed coordinates.
|
|
24071
|
+
*/
|
|
24072
|
+
this.handleRequestVisibleCoordinates = (payload, responder) => {
|
|
24073
|
+
logger$3.info('Sending RequestVisibleEmbedCoordinates', payload);
|
|
24074
|
+
responder === null || responder === void 0 ? void 0 : responder({
|
|
24075
|
+
type: EmbedEvent.RequestVisibleEmbedCoordinates,
|
|
24076
|
+
data: this.getVisibleCoordinates(),
|
|
24077
|
+
});
|
|
24078
|
+
};
|
|
24079
|
+
/**
|
|
24080
|
+
* Resets the frame height when the app navigates away from a Liveboard,
|
|
24081
|
+
* since only Liveboard routes report a height of their own.
|
|
24082
|
+
*/
|
|
24083
|
+
this.handleRouteChange = (payload) => {
|
|
24084
|
+
var _a, _b;
|
|
24085
|
+
const currentPath = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.currentPath;
|
|
24086
|
+
if (!currentPath) {
|
|
24087
|
+
return;
|
|
24088
|
+
}
|
|
24089
|
+
if (LIVEBOARD_RELATED_ROUTES.some((route) => currentPath.startsWith(route))) {
|
|
24090
|
+
return;
|
|
24091
|
+
}
|
|
24092
|
+
this.host.setFrameHeight(((_b = this.config.frameParams) === null || _b === void 0 ? void 0 : _b.height) || this.minimumHeight);
|
|
24093
|
+
};
|
|
24094
|
+
/**
|
|
24095
|
+
* Pushes the visible embed region to the app so it can decide which
|
|
24096
|
+
* visualizations to load.
|
|
24097
|
+
*/
|
|
24098
|
+
this.sendVisibleCoordinates = () => {
|
|
24099
|
+
if (!this.isLazyLoadEnabled) {
|
|
24100
|
+
return;
|
|
24101
|
+
}
|
|
24102
|
+
const coordinates = this.getVisibleCoordinates();
|
|
24103
|
+
if (coordinates) {
|
|
24104
|
+
this.host.trigger(HostEvent.VisibleEmbedCoordinates, coordinates);
|
|
24105
|
+
}
|
|
24106
|
+
};
|
|
24107
|
+
this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
|
|
24108
|
+
this.registerEventHandlers();
|
|
24109
|
+
}
|
|
24110
|
+
/**
|
|
24111
|
+
* The view config the controller runs on: the host app's own config with
|
|
24112
|
+
* the lazy-loading defaults filled in. Read-only, so the only way to change
|
|
24113
|
+
* it is through the setter, which re-resolves the defaults.
|
|
24114
|
+
*/
|
|
24115
|
+
get viewConfig() {
|
|
24116
|
+
return this.config;
|
|
24117
|
+
}
|
|
24118
|
+
/**
|
|
24119
|
+
* Replaces the view config the controller runs on and re-resolves the
|
|
24120
|
+
* lazy-loading defaults against it. The config the caller passes is never
|
|
24121
|
+
* written to; the controller keeps a copy of its own.
|
|
24122
|
+
*/
|
|
24123
|
+
set viewConfig(viewConfig) {
|
|
24124
|
+
this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
|
|
24125
|
+
}
|
|
24126
|
+
/**
|
|
24127
|
+
* The view config with the lazy-loading settings the embed falls back to
|
|
24128
|
+
* when the host app has not chosen its own.
|
|
24129
|
+
*
|
|
24130
|
+
* Pure by design: it returns a new config rather than writing to the one it
|
|
24131
|
+
* is given, so the host app's object is left untouched.
|
|
24132
|
+
* @param viewConfig The embed's view config
|
|
24133
|
+
* @returns A copy with the defaults filled in, host app choices preserved
|
|
24134
|
+
*/
|
|
24135
|
+
static withLazyLoadingDefaults(viewConfig) {
|
|
24136
|
+
return {
|
|
24137
|
+
...viewConfig,
|
|
24138
|
+
lazyLoadingForFullHeight: viewConfig.lazyLoadingForFullHeight === undefined
|
|
24139
|
+
? true
|
|
24140
|
+
: viewConfig.lazyLoadingForFullHeight,
|
|
24141
|
+
enableScrollableContainerLazyLoading: viewConfig.enableScrollableContainerLazyLoading === undefined
|
|
24142
|
+
? true
|
|
24143
|
+
: viewConfig.enableScrollableContainerLazyLoading,
|
|
24144
|
+
lazyLoadingMargin: viewConfig.lazyLoadingMargin === undefined
|
|
24145
|
+
? DEFAULT_LAZY_LOADING_MARGIN
|
|
24146
|
+
: viewConfig.lazyLoadingMargin,
|
|
24147
|
+
};
|
|
24148
|
+
}
|
|
24149
|
+
/**
|
|
24150
|
+
* Whether the host app asked for a full-height embed.
|
|
24151
|
+
*/
|
|
24152
|
+
get isEnabled() {
|
|
24153
|
+
return this.config.fullHeight === true;
|
|
24154
|
+
}
|
|
24155
|
+
/**
|
|
24156
|
+
* Whether visualizations should load as they scroll into view, which
|
|
24157
|
+
* requires the SDK to report the visible region of the embed.
|
|
24158
|
+
*/
|
|
24159
|
+
get isLazyLoadEnabled() {
|
|
24160
|
+
return this.isEnabled && !!this.config.lazyLoadingForFullHeight;
|
|
24161
|
+
}
|
|
24162
|
+
/**
|
|
24163
|
+
* The floor for the frame height. `defaultHeight` is the deprecated
|
|
24164
|
+
* spelling of `minimumHeight` and is still honored for compatibility.
|
|
24165
|
+
*/
|
|
24166
|
+
get minimumHeight() {
|
|
24167
|
+
const { minimumHeight, defaultHeight } = this.config;
|
|
24168
|
+
return minimumHeight || defaultHeight || DEFAULT_MINIMUM_HEIGHT;
|
|
24169
|
+
}
|
|
24170
|
+
/**
|
|
24171
|
+
* Registers the embed event handlers the feature depends on. Called from
|
|
24172
|
+
* the constructor, so the handlers are in place before `render`.
|
|
24173
|
+
*/
|
|
24174
|
+
registerEventHandlers() {
|
|
24175
|
+
if (!this.isEnabled) {
|
|
24176
|
+
return;
|
|
24177
|
+
}
|
|
24178
|
+
this.host.on(EmbedEvent.RouteChange, this.handleRouteChange);
|
|
24179
|
+
this.host.on(EmbedEvent.EmbedHeight, this.handleEmbedHeight);
|
|
24180
|
+
this.host.on(EmbedEvent.EmbedIframeCenter, this.handleEmbedIframeCenter);
|
|
24181
|
+
this.host.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.handleRequestVisibleCoordinates);
|
|
24182
|
+
}
|
|
24183
|
+
/**
|
|
24184
|
+
* Adds the full-height query parameters to the embed URL params.
|
|
24185
|
+
* @param params The query parameters being built by the embed
|
|
24186
|
+
*/
|
|
24187
|
+
addQueryParams(params) {
|
|
24188
|
+
if (!this.isEnabled) {
|
|
24189
|
+
return;
|
|
24190
|
+
}
|
|
24191
|
+
params[Param.fullHeight] = true;
|
|
24192
|
+
if (!this.config.lazyLoadingForFullHeight) {
|
|
24193
|
+
return;
|
|
24194
|
+
}
|
|
24195
|
+
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
24196
|
+
if (isValidCssMargin(this.config.lazyLoadingMargin)) {
|
|
24197
|
+
params[Param.RootMarginForLazyLoad] = this.config.lazyLoadingMargin;
|
|
24198
|
+
}
|
|
24199
|
+
}
|
|
24200
|
+
/**
|
|
24201
|
+
* Attaches the viewport listeners that keep lazy loading in sync. Call this
|
|
24202
|
+
* once the embed has rendered and the iframe exists.
|
|
24203
|
+
*/
|
|
24204
|
+
onRender() {
|
|
24205
|
+
this.registerLazyLoadListeners();
|
|
24206
|
+
}
|
|
24207
|
+
/**
|
|
24208
|
+
* Detaches every listener and observer owned by the controller.
|
|
24209
|
+
*/
|
|
24210
|
+
destroy() {
|
|
24211
|
+
this.unregisterLazyLoadListeners();
|
|
24212
|
+
}
|
|
24213
|
+
getVisibleCoordinates() {
|
|
24214
|
+
const iframe = this.host.getIframe();
|
|
24215
|
+
if (!iframe) {
|
|
24216
|
+
return null;
|
|
24217
|
+
}
|
|
24218
|
+
return calculateVisibleElementData(iframe, this.config.enableScrollableContainerLazyLoading);
|
|
24219
|
+
}
|
|
24220
|
+
registerLazyLoadListeners() {
|
|
24221
|
+
if (!this.isLazyLoadEnabled || !this.host.getIframe()) {
|
|
24222
|
+
return;
|
|
24223
|
+
}
|
|
24224
|
+
// Re-registering is safe: drop whatever a previous render attached.
|
|
24225
|
+
this.unregisterLazyLoadListeners();
|
|
24226
|
+
// TODO: Use passive: true, install modernizr to check for passive
|
|
24227
|
+
window.addEventListener('resize', this.sendVisibleCoordinates);
|
|
24228
|
+
window.addEventListener('scroll', this.sendVisibleCoordinates, true);
|
|
24229
|
+
if (!this.config.enableScrollableContainerLazyLoading) {
|
|
24230
|
+
return;
|
|
24231
|
+
}
|
|
24232
|
+
this.observeScrollableContainers();
|
|
24233
|
+
}
|
|
24234
|
+
/**
|
|
24235
|
+
* Tracks the ancestors that can scroll or clip the embed, so the visible
|
|
24236
|
+
* region stays correct when the embed lives inside its own scroll
|
|
24237
|
+
* container rather than the page.
|
|
24238
|
+
*/
|
|
24239
|
+
observeScrollableContainers() {
|
|
24240
|
+
const iFrame = this.host.getIframe();
|
|
24241
|
+
this.scrollContainers = getScrollableAncestors(iFrame);
|
|
24242
|
+
this.scrollContainers.forEach((scrollContainer) => {
|
|
24243
|
+
scrollContainer.addEventListener('scroll', this.sendVisibleCoordinates);
|
|
24244
|
+
});
|
|
24245
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
24246
|
+
return;
|
|
24247
|
+
}
|
|
24248
|
+
const resizeTargets = new Set([iFrame.parentElement, ...getEffectiveClippingAncestors(iFrame)].filter(Boolean));
|
|
24249
|
+
this.resizeObserver = new ResizeObserver(this.sendVisibleCoordinates);
|
|
24250
|
+
resizeTargets.forEach((resizeTarget) => {
|
|
24251
|
+
this.resizeObserver.observe(resizeTarget);
|
|
24252
|
+
});
|
|
24253
|
+
}
|
|
24254
|
+
unregisterLazyLoadListeners() {
|
|
24255
|
+
var _a;
|
|
24256
|
+
if (!this.isLazyLoadEnabled) {
|
|
24257
|
+
return;
|
|
24258
|
+
}
|
|
24259
|
+
window.removeEventListener('resize', this.sendVisibleCoordinates);
|
|
24260
|
+
window.removeEventListener('scroll', this.sendVisibleCoordinates, true);
|
|
24261
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
24262
|
+
this.resizeObserver = undefined;
|
|
24263
|
+
this.scrollContainers.forEach((scrollContainer) => {
|
|
24264
|
+
scrollContainer.removeEventListener('scroll', this.sendVisibleCoordinates);
|
|
24265
|
+
});
|
|
24266
|
+
this.scrollContainers = [];
|
|
24267
|
+
}
|
|
24268
|
+
}
|
|
24269
|
+
|
|
23464
24270
|
/**
|
|
23465
24271
|
* Resolves enablePastConversationsSidebar with
|
|
23466
24272
|
* spotterSidebarConfig taking precedence over the
|
|
@@ -23696,73 +24502,17 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
23696
24502
|
constructor(domSelector, viewConfig) {
|
|
23697
24503
|
viewConfig.embedComponentType = 'AppEmbed';
|
|
23698
24504
|
super(domSelector, viewConfig);
|
|
23699
|
-
this.defaultHeight = 500;
|
|
23700
|
-
this.lazyLoadScrollContainers = [];
|
|
23701
|
-
this.sendFullHeightLazyLoadData = () => {
|
|
23702
|
-
const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
23703
|
-
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
23704
|
-
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
23705
|
-
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
|
|
23706
|
-
}
|
|
23707
|
-
};
|
|
23708
|
-
/**
|
|
23709
|
-
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
23710
|
-
* It is used to send the visible coordinates data to the host application.
|
|
23711
|
-
* @param data The event payload
|
|
23712
|
-
* @param responder The responder function
|
|
23713
|
-
*/
|
|
23714
|
-
this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
|
|
23715
|
-
logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
23716
|
-
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
23717
|
-
responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
23718
|
-
};
|
|
23719
|
-
/**
|
|
23720
|
-
* Set the iframe height as per the computed height received
|
|
23721
|
-
* from the ThoughtSpot app.
|
|
23722
|
-
* @param data The event payload
|
|
23723
|
-
*/
|
|
23724
|
-
this.updateIFrameHeight = (data) => {
|
|
23725
|
-
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
23726
|
-
this.sendFullHeightLazyLoadData();
|
|
23727
|
-
};
|
|
23728
|
-
this.embedIframeCenter = (data, responder) => {
|
|
23729
|
-
const obj = this.getIframeCenter();
|
|
23730
|
-
responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
|
|
23731
|
-
};
|
|
23732
|
-
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
23733
|
-
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
23734
|
-
const liveboardRelatedRoutes = [
|
|
23735
|
-
'/pinboard/',
|
|
23736
|
-
'/insights/pinboard/',
|
|
23737
|
-
'/schedules/',
|
|
23738
|
-
'/embed/viz/',
|
|
23739
|
-
'/embed/insights/viz/',
|
|
23740
|
-
'/liveboard/',
|
|
23741
|
-
'/insights/liveboard/',
|
|
23742
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
23743
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
23744
|
-
];
|
|
23745
|
-
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
23746
|
-
// Ignore the height reset of the frame, if the navigation is
|
|
23747
|
-
// only within the liveboard page.
|
|
23748
|
-
return;
|
|
23749
|
-
}
|
|
23750
|
-
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
23751
|
-
};
|
|
23752
24505
|
if (this.viewConfig.fullHeight === true) {
|
|
23753
|
-
|
|
23754
|
-
this.
|
|
23755
|
-
|
|
23756
|
-
|
|
23757
|
-
|
|
23758
|
-
|
|
23759
|
-
|
|
23760
|
-
|
|
23761
|
-
|
|
23762
|
-
|
|
23763
|
-
this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
23764
|
-
this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
23765
|
-
this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
|
|
24506
|
+
this.fullHeightController = new FullHeightController(this.viewConfig, {
|
|
24507
|
+
getIframe: () => this.iFrame,
|
|
24508
|
+
setFrameHeight: (height) => this.setIFrameHeight(height),
|
|
24509
|
+
on: (eventType, callback) => {
|
|
24510
|
+
this.on(eventType, callback);
|
|
24511
|
+
},
|
|
24512
|
+
trigger: (hostEvent, data) => {
|
|
24513
|
+
this.trigger(hostEvent, data);
|
|
24514
|
+
},
|
|
24515
|
+
});
|
|
23766
24516
|
}
|
|
23767
24517
|
}
|
|
23768
24518
|
/**
|
|
@@ -23793,7 +24543,8 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
23793
24543
|
return getQueryParamString(params, true);
|
|
23794
24544
|
}
|
|
23795
24545
|
getEmbedParamsObject() {
|
|
23796
|
-
|
|
24546
|
+
var _a;
|
|
24547
|
+
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;
|
|
23797
24548
|
let params = {};
|
|
23798
24549
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
23799
24550
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -23829,6 +24580,9 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
23829
24580
|
if (!isUndefined$1(coverAndFilterOptionInPDF)) {
|
|
23830
24581
|
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
23831
24582
|
}
|
|
24583
|
+
if (!isUndefined$1(hideAnswerEditPanel)) {
|
|
24584
|
+
params[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
|
|
24585
|
+
}
|
|
23832
24586
|
params = this.getBaseQueryParams(params);
|
|
23833
24587
|
if (!isUndefined$1(updatedSpotterChatPrompt)) {
|
|
23834
24588
|
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
@@ -23875,15 +24629,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
23875
24629
|
if (hideNotification) {
|
|
23876
24630
|
params[Param.HideNotification] = !!hideNotification;
|
|
23877
24631
|
}
|
|
23878
|
-
|
|
23879
|
-
params[Param.fullHeight] = true;
|
|
23880
|
-
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
23881
|
-
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
23882
|
-
if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
|
|
23883
|
-
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
23884
|
-
}
|
|
23885
|
-
}
|
|
23886
|
-
}
|
|
24632
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
|
|
23887
24633
|
if (tag) {
|
|
23888
24634
|
params[Param.Tag] = tag;
|
|
23889
24635
|
}
|
|
@@ -23950,7 +24696,6 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
23950
24696
|
if (isContinuousLiveboardPDFEnabled !== undefined) {
|
|
23951
24697
|
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
23952
24698
|
}
|
|
23953
|
-
this.defaultHeight = minimumHeight || this.defaultHeight;
|
|
23954
24699
|
if (enableLiveboardDataCache !== undefined) {
|
|
23955
24700
|
params[Param.EnableLiveboardDataCache] = enableLiveboardDataCache;
|
|
23956
24701
|
}
|
|
@@ -24089,52 +24834,13 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
24089
24834
|
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
24090
24835
|
*/
|
|
24091
24836
|
destroy() {
|
|
24837
|
+
var _a;
|
|
24092
24838
|
super.destroy();
|
|
24093
|
-
this.
|
|
24839
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
24094
24840
|
}
|
|
24095
24841
|
postRender() {
|
|
24096
|
-
this.registerLazyLoadEvents();
|
|
24097
|
-
}
|
|
24098
|
-
registerLazyLoadEvents() {
|
|
24099
|
-
if (!this.iFrame) {
|
|
24100
|
-
return;
|
|
24101
|
-
}
|
|
24102
|
-
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
24103
|
-
this.unregisterLazyLoadEvents();
|
|
24104
|
-
// TODO: Use passive: true, install modernizr to check for passive
|
|
24105
|
-
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24106
|
-
window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24107
|
-
if (!this.viewConfig.enableScrollableContainerLazyLoading) {
|
|
24108
|
-
return;
|
|
24109
|
-
}
|
|
24110
|
-
this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
|
|
24111
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24112
|
-
scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24113
|
-
});
|
|
24114
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
24115
|
-
const resizeTargets = new Set([
|
|
24116
|
-
this.iFrame.parentElement,
|
|
24117
|
-
...getEffectiveClippingAncestors(this.iFrame),
|
|
24118
|
-
].filter(Boolean));
|
|
24119
|
-
this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
|
|
24120
|
-
resizeTargets.forEach((resizeTarget) => {
|
|
24121
|
-
this.lazyLoadResizeObserver.observe(resizeTarget);
|
|
24122
|
-
});
|
|
24123
|
-
}
|
|
24124
|
-
}
|
|
24125
|
-
}
|
|
24126
|
-
unregisterLazyLoadEvents() {
|
|
24127
24842
|
var _a;
|
|
24128
|
-
|
|
24129
|
-
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24130
|
-
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24131
|
-
(_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
24132
|
-
this.lazyLoadResizeObserver = undefined;
|
|
24133
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24134
|
-
scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24135
|
-
});
|
|
24136
|
-
this.lazyLoadScrollContainers = [];
|
|
24137
|
-
}
|
|
24843
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
|
|
24138
24844
|
}
|
|
24139
24845
|
/**
|
|
24140
24846
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
@@ -24229,6 +24935,10 @@ const addPreviewStylesIfNotPresent = () => {
|
|
|
24229
24935
|
* @summary Liveboard & visualization embed
|
|
24230
24936
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
24231
24937
|
*/
|
|
24938
|
+
// Home unmounts the liveboard container, which is how its state gets cleared. The
|
|
24939
|
+
// settle window gives the container time to do it before we ask for the liveboard back.
|
|
24940
|
+
const HOME_ROUTE = 'home';
|
|
24941
|
+
const HOME_SETTLE_MS = 200;
|
|
24232
24942
|
/**
|
|
24233
24943
|
* Embed a ThoughtSpot Liveboard or visualization. When rendered it already
|
|
24234
24944
|
* waits for the authentication to complete, so you need not wait for
|
|
@@ -24248,59 +24958,6 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
24248
24958
|
constructor(domSelector, viewConfig) {
|
|
24249
24959
|
viewConfig.embedComponentType = 'LiveboardEmbed';
|
|
24250
24960
|
super(domSelector, viewConfig);
|
|
24251
|
-
this.defaultHeight = 500;
|
|
24252
|
-
this.lazyLoadScrollContainers = [];
|
|
24253
|
-
this.sendFullHeightLazyLoadData = () => {
|
|
24254
|
-
const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
24255
|
-
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
24256
|
-
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
24257
|
-
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
|
|
24258
|
-
}
|
|
24259
|
-
};
|
|
24260
|
-
/**
|
|
24261
|
-
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
24262
|
-
* It is used to send the visible coordinates data to the host application.
|
|
24263
|
-
* @param data The event payload
|
|
24264
|
-
* @param responder The responder function
|
|
24265
|
-
*/
|
|
24266
|
-
this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
|
|
24267
|
-
logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
24268
|
-
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
24269
|
-
responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
24270
|
-
};
|
|
24271
|
-
/**
|
|
24272
|
-
* Set the iframe height as per the computed height received
|
|
24273
|
-
* from the ThoughtSpot app.
|
|
24274
|
-
* @param data The event payload
|
|
24275
|
-
*/
|
|
24276
|
-
this.updateIFrameHeight = (data) => {
|
|
24277
|
-
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
24278
|
-
this.sendFullHeightLazyLoadData();
|
|
24279
|
-
};
|
|
24280
|
-
this.embedIframeCenter = (data, responder) => {
|
|
24281
|
-
const obj = this.getIframeCenter();
|
|
24282
|
-
responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
|
|
24283
|
-
};
|
|
24284
|
-
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
24285
|
-
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
24286
|
-
const liveboardRelatedRoutes = [
|
|
24287
|
-
'/pinboard/',
|
|
24288
|
-
'/insights/pinboard/',
|
|
24289
|
-
'/schedules/',
|
|
24290
|
-
'/embed/viz/',
|
|
24291
|
-
'/embed/insights/viz/',
|
|
24292
|
-
'/liveboard/',
|
|
24293
|
-
'/insights/liveboard/',
|
|
24294
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
24295
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
24296
|
-
];
|
|
24297
|
-
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
24298
|
-
// Ignore the height reset of the frame, if the navigation is
|
|
24299
|
-
// only within the liveboard page.
|
|
24300
|
-
return;
|
|
24301
|
-
}
|
|
24302
|
-
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
24303
|
-
};
|
|
24304
24961
|
/**
|
|
24305
24962
|
* @hidden
|
|
24306
24963
|
* Internal state to track the current liveboard id.
|
|
@@ -24314,22 +24971,19 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
24314
24971
|
};
|
|
24315
24972
|
if (this.viewConfig.fullHeight === true) {
|
|
24316
24973
|
if (this.viewConfig.vizId) {
|
|
24317
|
-
logger$3.warn('Full height is currently only supported for Liveboard embeds.'
|
|
24318
|
-
'Using full height with vizId might lead to unexpected behavior.');
|
|
24319
|
-
}
|
|
24320
|
-
if (this.viewConfig.lazyLoadingForFullHeight === undefined) {
|
|
24321
|
-
this.viewConfig.lazyLoadingForFullHeight = true;
|
|
24322
|
-
}
|
|
24323
|
-
if (this.viewConfig.enableScrollableContainerLazyLoading === undefined) {
|
|
24324
|
-
this.viewConfig.enableScrollableContainerLazyLoading = true;
|
|
24325
|
-
}
|
|
24326
|
-
if (this.viewConfig.lazyLoadingMargin === undefined) {
|
|
24327
|
-
this.viewConfig.lazyLoadingMargin = DEFAULT_LAZY_LOADING_MARGIN;
|
|
24974
|
+
logger$3.warn('Full height is currently only supported for Liveboard embeds.'
|
|
24975
|
+
+ 'Using full height with vizId might lead to unexpected behavior.');
|
|
24328
24976
|
}
|
|
24329
|
-
this.
|
|
24330
|
-
|
|
24331
|
-
|
|
24332
|
-
|
|
24977
|
+
this.fullHeightController = new FullHeightController(this.viewConfig, {
|
|
24978
|
+
getIframe: () => this.iFrame,
|
|
24979
|
+
setFrameHeight: (height) => this.setIFrameHeight(height),
|
|
24980
|
+
on: (eventType, callback) => {
|
|
24981
|
+
this.on(eventType, callback);
|
|
24982
|
+
},
|
|
24983
|
+
trigger: (hostEvent, data) => {
|
|
24984
|
+
this.trigger(hostEvent, data);
|
|
24985
|
+
},
|
|
24986
|
+
});
|
|
24333
24987
|
}
|
|
24334
24988
|
}
|
|
24335
24989
|
async getAppInitData() {
|
|
@@ -24347,21 +25001,13 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
24347
25001
|
return queryParams;
|
|
24348
25002
|
}
|
|
24349
25003
|
getEmbedParamsObject() {
|
|
25004
|
+
var _a;
|
|
24350
25005
|
let params = {};
|
|
24351
25006
|
params = this.getBaseQueryParams(params);
|
|
24352
|
-
const { enableVizTransformations,
|
|
25007
|
+
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;
|
|
24353
25008
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
24354
25009
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
24355
|
-
|
|
24356
|
-
params[Param.fullHeight] = true;
|
|
24357
|
-
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
24358
|
-
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
24359
|
-
if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
|
|
24360
|
-
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
24361
|
-
}
|
|
24362
|
-
}
|
|
24363
|
-
}
|
|
24364
|
-
this.defaultHeight = minimumHeight || defaultHeight || this.defaultHeight;
|
|
25010
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
|
|
24365
25011
|
if (enableVizTransformations !== undefined) {
|
|
24366
25012
|
params[Param.EnableVizTransformations] = enableVizTransformations.toString();
|
|
24367
25013
|
}
|
|
@@ -24546,6 +25192,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
24546
25192
|
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
24547
25193
|
message: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
24548
25194
|
code: EmbedErrorCodes.LIVEBOARD_ID_MISSING,
|
|
25195
|
+
severity: EmbedErrorSeverity.SEV1,
|
|
24549
25196
|
error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
24550
25197
|
});
|
|
24551
25198
|
}
|
|
@@ -24587,19 +25234,45 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
24587
25234
|
}
|
|
24588
25235
|
beforePrerenderVisible() {
|
|
24589
25236
|
super.beforePrerenderVisible();
|
|
24590
|
-
|
|
24591
|
-
|
|
24592
|
-
|
|
24593
|
-
|
|
24594
|
-
|
|
24595
|
-
|
|
24596
|
-
|
|
24597
|
-
|
|
24598
|
-
|
|
24599
|
-
|
|
25237
|
+
// Captured before showPreRender() hands the wrapper over to this instance.
|
|
25238
|
+
// Itself means a hide/show, not a hand-over, so there is nothing stale to clear.
|
|
25239
|
+
const previous = this.getPreRenderObj();
|
|
25240
|
+
const showing = previous === this ? undefined : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
|
|
25241
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
25242
|
+
// Without this the params callback suspends on its await and Navigate
|
|
25243
|
+
// goes out first, so the container loads with the previous config's filters.
|
|
25244
|
+
await this.preRenderParamsApplied;
|
|
25245
|
+
if (this.isShowingLiveboardRoute(showing)) {
|
|
25246
|
+
// Navigate to the route we are already on is a no-op, so the liveboard
|
|
25247
|
+
// keeps its state. Home unmounts the container, which clears it.
|
|
25248
|
+
this.trigger(HostEvent.Navigate, HOME_ROUTE)
|
|
25249
|
+
.catch((error) => logger$3.warn('Could not route via home', error));
|
|
25250
|
+
// Not awaited above: the container never acks Navigate, so that promise
|
|
25251
|
+
// only settles on the 30s trigger timeout.
|
|
25252
|
+
await new Promise((resolve) => {
|
|
25253
|
+
setTimeout(resolve, HOME_SETTLE_MS);
|
|
25254
|
+
});
|
|
24600
25255
|
}
|
|
25256
|
+
this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId, this.viewConfig.personalizedViewId);
|
|
25257
|
+
this.currentLiveboardState = {
|
|
25258
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
25259
|
+
vizId: this.viewConfig.vizId,
|
|
25260
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
25261
|
+
personalizedViewId: this.viewConfig.personalizedViewId,
|
|
25262
|
+
};
|
|
24601
25263
|
});
|
|
24602
25264
|
}
|
|
25265
|
+
// The whole route, not just the liveboard id: the path is built from the viz, tab
|
|
25266
|
+
// and view too, so a same-liveboard show onto another tab is a real navigation.
|
|
25267
|
+
isShowingLiveboardRoute(showing) {
|
|
25268
|
+
if (!(showing === null || showing === void 0 ? void 0 : showing.liveboardId))
|
|
25269
|
+
return false;
|
|
25270
|
+
const { liveboardId, vizId, activeTabId, personalizedViewId, } = this.viewConfig;
|
|
25271
|
+
return showing.liveboardId === liveboardId
|
|
25272
|
+
&& showing.vizId === vizId
|
|
25273
|
+
&& showing.activeTabId === activeTabId
|
|
25274
|
+
&& showing.personalizedViewId === personalizedViewId;
|
|
25275
|
+
}
|
|
24603
25276
|
async handleRenderForPrerender() {
|
|
24604
25277
|
if (isUndefined$1(this.viewConfig.liveboardId)) {
|
|
24605
25278
|
return this.prerenderGeneric();
|
|
@@ -24608,11 +25281,16 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
24608
25281
|
}
|
|
24609
25282
|
/**
|
|
24610
25283
|
* Triggers an event to the embedded app
|
|
25284
|
+
* Payload typing follows {@link TsEmbed.trigger}: unknown fields fail to compile
|
|
25285
|
+
* from SDK 1.52.0; strict contract checks land in SDK 1.54.0.
|
|
24611
25286
|
* @param {HostEvent} messageType The event type
|
|
24612
|
-
* @param {
|
|
25287
|
+
* @param {TriggerData} data The payload, typed against the event's contract
|
|
24613
25288
|
* @returns A promise that resolves with the response from the embedded app
|
|
24614
25289
|
*/
|
|
24615
|
-
trigger(messageType,
|
|
25290
|
+
trigger(messageType,
|
|
25291
|
+
// Mirror TsEmbed.trigger: contract shape is the contextual type and
|
|
25292
|
+
// unknown fields on object literals are flagged. Strict in SDK 1.54.0.
|
|
25293
|
+
data = {}, context) {
|
|
24616
25294
|
const dataWithVizId = data;
|
|
24617
25295
|
if (messageType === HostEvent.SetActiveTab) {
|
|
24618
25296
|
this.setActiveTab(data);
|
|
@@ -24628,52 +25306,13 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
24628
25306
|
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
24629
25307
|
*/
|
|
24630
25308
|
destroy() {
|
|
25309
|
+
var _a;
|
|
24631
25310
|
super.destroy();
|
|
24632
|
-
this.
|
|
25311
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
24633
25312
|
}
|
|
24634
25313
|
postRender() {
|
|
24635
|
-
this.registerLazyLoadEvents();
|
|
24636
|
-
}
|
|
24637
|
-
registerLazyLoadEvents() {
|
|
24638
|
-
if (!this.iFrame) {
|
|
24639
|
-
return;
|
|
24640
|
-
}
|
|
24641
|
-
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
24642
|
-
this.unregisterLazyLoadEvents();
|
|
24643
|
-
// TODO: Use passive: true, install modernizr to check for passive
|
|
24644
|
-
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24645
|
-
window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24646
|
-
if (!this.viewConfig.enableScrollableContainerLazyLoading) {
|
|
24647
|
-
return;
|
|
24648
|
-
}
|
|
24649
|
-
this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
|
|
24650
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24651
|
-
scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24652
|
-
});
|
|
24653
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
24654
|
-
const resizeTargets = new Set([
|
|
24655
|
-
this.iFrame.parentElement,
|
|
24656
|
-
...getEffectiveClippingAncestors(this.iFrame),
|
|
24657
|
-
].filter(Boolean));
|
|
24658
|
-
this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
|
|
24659
|
-
resizeTargets.forEach((resizeTarget) => {
|
|
24660
|
-
this.lazyLoadResizeObserver.observe(resizeTarget);
|
|
24661
|
-
});
|
|
24662
|
-
}
|
|
24663
|
-
}
|
|
24664
|
-
}
|
|
24665
|
-
unregisterLazyLoadEvents() {
|
|
24666
25314
|
var _a;
|
|
24667
|
-
|
|
24668
|
-
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24669
|
-
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24670
|
-
(_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
24671
|
-
this.lazyLoadResizeObserver = undefined;
|
|
24672
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24673
|
-
scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24674
|
-
});
|
|
24675
|
-
this.lazyLoadScrollContainers = [];
|
|
24676
|
-
}
|
|
25315
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
|
|
24677
25316
|
}
|
|
24678
25317
|
/**
|
|
24679
25318
|
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
@@ -24697,7 +25336,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
24697
25336
|
if (this.isRendered) {
|
|
24698
25337
|
this.trigger(HostEvent.Navigate, path.substring(1));
|
|
24699
25338
|
}
|
|
24700
|
-
else if (this.getPreRenderConfig().
|
|
25339
|
+
else if (this.getPreRenderConfig().id) {
|
|
24701
25340
|
this.preRender(true);
|
|
24702
25341
|
}
|
|
24703
25342
|
else {
|
|
@@ -25401,7 +26040,7 @@ isPreRenderedComponent = false) => {
|
|
|
25401
26040
|
const ref = React__default.useRef(null);
|
|
25402
26041
|
const { className, style, ...embedProps } = props;
|
|
25403
26042
|
const { viewConfig, listeners } = getViewPropsAndListeners(embedProps);
|
|
25404
|
-
const preRenderId = (_b = (_a = props.preRenderConfig) === null || _a === void 0 ? void 0 : _a.
|
|
26043
|
+
const preRenderId = (_b = (_a = props.preRenderConfig) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : props.preRenderId;
|
|
25405
26044
|
const handleDestroy = (tsEmbed) => {
|
|
25406
26045
|
// do not destroy if it is a preRender component
|
|
25407
26046
|
if (isPreRenderedComponent)
|