@thoughtspot/visual-embed-sdk 1.52.0 → 1.52.2-beta
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 +19 -4
- 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 +416 -0
- package/cjs/src/contracts/host-event-contracts.d.ts.map +1 -0
- package/cjs/src/contracts/host-event-contracts.js +3 -0
- package/cjs/src/contracts/host-event-contracts.js.map +1 -0
- package/cjs/src/contracts/index.d.ts +22 -0
- package/cjs/src/contracts/index.d.ts.map +1 -0
- package/cjs/src/contracts/index.js +33 -0
- package/cjs/src/contracts/index.js.map +1 -0
- package/cjs/src/contracts/ui-passthrough-contracts.d.ts +277 -0
- package/cjs/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
- package/cjs/src/{embed/hostEventClient/contracts.js → contracts/ui-passthrough-contracts.js} +6 -2
- package/cjs/src/contracts/ui-passthrough-contracts.js.map +1 -0
- package/cjs/src/embed/app.d.ts +21 -143
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +21 -121
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +80 -26
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/auto-frame-renderer.js +1 -1
- package/cjs/src/embed/auto-frame-renderer.js.map +1 -1
- package/cjs/src/embed/auto-frame-renderer.spec.js +24 -13
- package/cjs/src/embed/auto-frame-renderer.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +1 -1
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +1 -0
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +4 -4
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +35 -24
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/embedConfig.spec.js +2 -1
- package/cjs/src/embed/embedConfig.spec.js.map +1 -1
- package/cjs/src/embed/events.spec.js +12 -2
- package/cjs/src/embed/events.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +5 -4
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +34 -23
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +50 -44
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts +10 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.js +52 -6
- package/cjs/src/embed/hostEventClient/utils.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.spec.js +151 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +13 -164
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +72 -135
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +213 -29
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/search-bar.js +1 -1
- package/cjs/src/embed/search-bar.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 +5 -2
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +85 -0
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/spotter-utils.d.ts +8 -1
- package/cjs/src/embed/spotter-utils.d.ts.map +1 -1
- package/cjs/src/embed/spotter-utils.js +14 -1
- package/cjs/src/embed/spotter-utils.js.map +1 -1
- package/cjs/src/embed/spotter-utils.spec.js +26 -0
- package/cjs/src/embed/spotter-utils.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +20 -22
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +171 -66
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +486 -38
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.js +1 -1
- package/cjs/src/errors.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 +5 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +6 -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/types.d.ts +584 -24
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +370 -22
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/authService/tokenizedAuthService.spec.js +2 -1
- package/cjs/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
- package/cjs/src/utils/custom-actions.spec.js +4 -2
- package/cjs/src/utils/custom-actions.spec.js.map +1 -1
- package/cjs/src/utils/filterConverter.d.ts +106 -0
- package/cjs/src/utils/filterConverter.d.ts.map +1 -0
- package/cjs/src/utils/filterConverter.js +215 -0
- package/cjs/src/utils/filterConverter.js.map +1 -0
- package/cjs/src/utils/filterConverter.spec.d.ts +2 -0
- package/cjs/src/utils/filterConverter.spec.d.ts.map +1 -0
- package/cjs/src/utils/filterConverter.spec.js +709 -0
- package/cjs/src/utils/filterConverter.spec.js.map +1 -0
- package/cjs/src/utils/processData.spec.js +2 -1
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/cjs/src/utils/processTrigger.d.ts +3 -1
- package/cjs/src/utils/processTrigger.d.ts.map +1 -1
- package/cjs/src/utils/processTrigger.js +19 -51
- package/cjs/src/utils/processTrigger.js.map +1 -1
- package/cjs/src/utils/transport/iframe-transport.d.ts +55 -0
- package/cjs/src/utils/transport/iframe-transport.d.ts.map +1 -0
- package/cjs/src/utils/transport/iframe-transport.js +108 -0
- package/cjs/src/utils/transport/iframe-transport.js.map +1 -0
- package/cjs/src/utils/transport/iframe-transport.spec.d.ts +2 -0
- package/cjs/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
- package/cjs/src/utils/transport/iframe-transport.spec.js +140 -0
- package/cjs/src/utils/transport/iframe-transport.spec.js.map +1 -0
- package/cjs/src/utils.d.ts +18 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +39 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +62 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-BMppCU63.js → index-CcBYlGo9.js} +1 -1
- package/dist/src/contracts/contracts.spec.d.ts +2 -0
- package/dist/src/contracts/contracts.spec.d.ts.map +1 -0
- package/dist/src/contracts/embed-event-payloads.d.ts +73 -0
- package/dist/src/contracts/embed-event-payloads.d.ts.map +1 -0
- package/dist/src/contracts/host-event-contracts.d.ts +416 -0
- package/dist/src/contracts/host-event-contracts.d.ts.map +1 -0
- package/dist/src/contracts/index.d.ts +22 -0
- package/dist/src/contracts/index.d.ts.map +1 -0
- package/dist/src/contracts/ui-passthrough-contracts.d.ts +277 -0
- package/dist/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
- package/dist/src/embed/app.d.ts +21 -143
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +1 -0
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +5 -4
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts +10 -1
- package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +13 -164
- 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/spotter-utils.d.ts +8 -1
- package/dist/src/embed/spotter-utils.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +20 -22
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/full-height.d.ts +137 -0
- package/dist/src/full-height.d.ts.map +1 -0
- package/dist/src/full-height.spec.d.ts +2 -0
- package/dist/src/full-height.spec.d.ts.map +1 -0
- package/dist/src/index.d.ts +5 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/types.d.ts +584 -24
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/filterConverter.d.ts +106 -0
- package/dist/src/utils/filterConverter.d.ts.map +1 -0
- package/dist/src/utils/filterConverter.spec.d.ts +2 -0
- package/dist/src/utils/filterConverter.spec.d.ts.map +1 -0
- 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 +1144 -412
- package/dist/tsembed-react.js +1143 -411
- package/dist/tsembed.es.js +1357 -418
- package/dist/tsembed.js +1352 -412
- package/dist/visual-embed-sdk-react-full.d.ts +1514 -651
- package/dist/visual-embed-sdk-react.d.ts +1351 -632
- package/dist/visual-embed-sdk.d.ts +1508 -668
- package/lib/package.json +19 -4
- 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 +416 -0
- package/lib/src/contracts/host-event-contracts.d.ts.map +1 -0
- package/lib/src/contracts/host-event-contracts.js +2 -0
- package/lib/src/contracts/host-event-contracts.js.map +1 -0
- package/lib/src/contracts/index.d.ts +22 -0
- package/lib/src/contracts/index.d.ts.map +1 -0
- package/lib/src/contracts/index.js +22 -0
- package/lib/src/contracts/index.js.map +1 -0
- package/lib/src/contracts/ui-passthrough-contracts.d.ts +277 -0
- package/lib/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
- package/lib/src/{embed/hostEventClient/contracts.js → contracts/ui-passthrough-contracts.js} +6 -2
- package/lib/src/contracts/ui-passthrough-contracts.js.map +1 -0
- package/lib/src/embed/app.d.ts +21 -143
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +23 -123
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +80 -26
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/auto-frame-renderer.js +1 -1
- package/lib/src/embed/auto-frame-renderer.js.map +1 -1
- package/lib/src/embed/auto-frame-renderer.spec.js +24 -13
- package/lib/src/embed/auto-frame-renderer.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +1 -1
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +1 -0
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +5 -5
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +35 -24
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/embedConfig.spec.js +2 -1
- package/lib/src/embed/embedConfig.spec.js.map +1 -1
- package/lib/src/embed/events.spec.js +12 -2
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +5 -4
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +19 -8
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +15 -9
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts +10 -1
- package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/utils.js +48 -3
- package/lib/src/embed/hostEventClient/utils.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.spec.js +152 -1
- package/lib/src/embed/hostEventClient/utils.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +13 -164
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +73 -136
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +213 -29
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/search-bar.js +1 -1
- package/lib/src/embed/search-bar.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 +5 -2
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +85 -0
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/spotter-utils.d.ts +8 -1
- package/lib/src/embed/spotter-utils.d.ts.map +1 -1
- package/lib/src/embed/spotter-utils.js +12 -0
- package/lib/src/embed/spotter-utils.js.map +1 -1
- package/lib/src/embed/spotter-utils.spec.js +27 -1
- package/lib/src/embed/spotter-utils.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +20 -22
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +171 -66
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +484 -36
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.js +1 -1
- package/lib/src/errors.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 +5 -3
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +3 -2
- 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/types.d.ts +584 -24
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +370 -22
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/authService/tokenizedAuthService.spec.js +2 -1
- package/lib/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
- package/lib/src/utils/custom-actions.spec.js +4 -2
- package/lib/src/utils/custom-actions.spec.js.map +1 -1
- package/lib/src/utils/filterConverter.d.ts +106 -0
- package/lib/src/utils/filterConverter.d.ts.map +1 -0
- package/lib/src/utils/filterConverter.js +210 -0
- package/lib/src/utils/filterConverter.js.map +1 -0
- package/lib/src/utils/filterConverter.spec.d.ts +2 -0
- package/lib/src/utils/filterConverter.spec.d.ts.map +1 -0
- package/lib/src/utils/filterConverter.spec.js +707 -0
- package/lib/src/utils/filterConverter.spec.js.map +1 -0
- package/lib/src/utils/processData.spec.js +2 -1
- package/lib/src/utils/processData.spec.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 +1508 -668
- package/package.json +19 -4
- package/src/contracts/contracts.spec.ts +392 -0
- package/src/contracts/embed-event-payloads.ts +83 -0
- package/src/contracts/host-event-contracts.ts +500 -0
- package/src/contracts/index.ts +53 -0
- package/src/contracts/ui-passthrough-contracts.ts +301 -0
- package/src/embed/app.spec.ts +101 -34
- package/src/embed/app.ts +42 -268
- package/src/embed/auto-frame-renderer.spec.ts +24 -13
- package/src/embed/auto-frame-renderer.ts +1 -1
- package/src/embed/bodyless-conversation.ts +1 -1
- package/src/embed/conversation.spec.ts +38 -27
- package/src/embed/conversation.ts +5 -5
- package/src/embed/embedConfig.spec.ts +2 -1
- package/src/embed/events.spec.ts +14 -2
- package/src/embed/hostEventClient/host-event-client.spec.ts +16 -10
- package/src/embed/hostEventClient/host-event-client.ts +31 -10
- package/src/embed/hostEventClient/utils.spec.ts +176 -1
- package/src/embed/hostEventClient/utils.ts +53 -3
- package/src/embed/liveboard.spec.ts +261 -41
- package/src/embed/liveboard.ts +85 -300
- package/src/embed/search-bar.tsx +1 -1
- package/src/embed/search.spec.ts +103 -0
- package/src/embed/search.ts +21 -1
- package/src/embed/spotter-utils.spec.ts +29 -0
- package/src/embed/spotter-utils.ts +16 -0
- package/src/embed/ts-embed.spec.ts +650 -36
- package/src/embed/ts-embed.ts +205 -76
- package/src/errors.ts +1 -1
- package/src/full-height.spec.ts +1008 -0
- package/src/full-height.ts +361 -0
- package/src/index.ts +103 -5
- package/src/react/all-types-export.parity.spec.ts +63 -3
- package/src/react/all-types-export.ts +49 -0
- package/src/types.ts +584 -22
- package/src/utils/authService/tokenizedAuthService.spec.ts +2 -1
- package/src/utils/custom-actions.spec.ts +4 -2
- package/src/utils/filterConverter.spec.ts +801 -0
- package/src/utils/filterConverter.ts +304 -0
- package/src/utils/processData.spec.ts +2 -1
- package/src/utils/processTrigger.ts +28 -58
- package/src/utils/transport/iframe-transport.spec.ts +177 -0
- package/src/utils/transport/iframe-transport.ts +122 -0
- package/src/utils.spec.ts +71 -0
- package/src/utils.ts +38 -0
- package/cjs/src/embed/hostEventClient/contracts.d.ts +0 -231
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +0 -1
- package/cjs/src/embed/hostEventClient/contracts.js.map +0 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +0 -231
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +0 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +0 -231
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +0 -1
- package/lib/src/embed/hostEventClient/contracts.js.map +0 -1
- package/src/embed/hostEventClient/contracts.ts +0 -262
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.52.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.52.2-beta */
|
|
2
2
|
'use client';
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -858,6 +858,9 @@ var EmbedEvent;
|
|
|
858
858
|
EmbedEvent["Download"] = "download";
|
|
859
859
|
/**
|
|
860
860
|
* Emitted when the download action is triggered on an Answer.
|
|
861
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
862
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
863
|
+
* accepts the union now; per-context enforced next release.
|
|
861
864
|
* Use start:true to subscribe to when download is initiated, or end:true to
|
|
862
865
|
* subscribe to when download is completed. Default is end:true.
|
|
863
866
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
|
|
@@ -874,6 +877,9 @@ var EmbedEvent;
|
|
|
874
877
|
EmbedEvent["DownloadAsPng"] = "downloadAsPng";
|
|
875
878
|
/**
|
|
876
879
|
* Emitted when the Download as PDF action is triggered on an Answer
|
|
880
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer; plus
|
|
881
|
+
* liveboardId on Liveboard), {@link RequiredVizRequest} (Spotter). trigger()
|
|
882
|
+
* accepts the union now; per-context enforced next release.
|
|
877
883
|
* Use start:true to subscribe to when download as PDF is initiated, or end:true to
|
|
878
884
|
* subscribe to when download as PDF is completed. Default is end:true.
|
|
879
885
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -890,6 +896,9 @@ var EmbedEvent;
|
|
|
890
896
|
EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
891
897
|
/**
|
|
892
898
|
* Emitted when the Download as CSV action is triggered on an Answer.
|
|
899
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
900
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
901
|
+
* accepts the union now; per-context enforced next release.
|
|
893
902
|
* Use start:true to subscribe to when download as CSV is initiated, or end:true to
|
|
894
903
|
* subscribe to when download as CSV is completed. Default is end:true.
|
|
895
904
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -906,6 +915,9 @@ var EmbedEvent;
|
|
|
906
915
|
EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
|
|
907
916
|
/**
|
|
908
917
|
* Emitted when the Download as XLSX action is triggered on an Answer.
|
|
918
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
919
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
920
|
+
* accepts the union now; per-context enforced next release.
|
|
909
921
|
* Use start:true to subscribe to when download as XLSX is initiated, or end:true to
|
|
910
922
|
* subscribe to when download as XLSX is completed. Default is end:true.
|
|
911
923
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -1184,6 +1196,9 @@ var EmbedEvent;
|
|
|
1184
1196
|
EmbedEvent["Schedule"] = "subscription";
|
|
1185
1197
|
/**
|
|
1186
1198
|
* Emitted when a user clicks **Edit** on a Liveboard or visualization
|
|
1199
|
+
* Payload varies by context: {@link VizScopedRequest} (Liveboard),
|
|
1200
|
+
* {@link RequiredVizRequest} (Spotter, vizId required). trigger() accepts the
|
|
1201
|
+
* union now; per-context enforced next release.
|
|
1187
1202
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1188
1203
|
* @example
|
|
1189
1204
|
* ```js
|
|
@@ -2263,6 +2278,7 @@ var HostEvent;
|
|
|
2263
2278
|
* the search query string.
|
|
2264
2279
|
* Supported in `AppEmbed` and `SearchEmbed` deployments.
|
|
2265
2280
|
* Includes the following properties:
|
|
2281
|
+
* Payload: {@link SearchRequest}.
|
|
2266
2282
|
* @param - Includes the following keys:
|
|
2267
2283
|
* - `searchQuery`: Query string with search tokens.
|
|
2268
2284
|
* - `dataSources`: Data source GUID to search on.
|
|
@@ -2290,6 +2306,9 @@ var HostEvent;
|
|
|
2290
2306
|
HostEvent["Search"] = "search";
|
|
2291
2307
|
/**
|
|
2292
2308
|
* Triggers a drill on certain points of the specified column
|
|
2309
|
+
* Payload: {@link DrillDownRequest}; in Liveboard context vizId is required
|
|
2310
|
+
* ({@link RequiredVizRequest}). trigger() accepts the union now; per-context
|
|
2311
|
+
* enforced next release.
|
|
2293
2312
|
* Includes the following properties:
|
|
2294
2313
|
* @param - Includes the following keys:
|
|
2295
2314
|
* - `points`: An object containing `selectedPoints` and/or `clickedPoint`
|
|
@@ -2369,6 +2388,8 @@ var HostEvent;
|
|
|
2369
2388
|
HostEvent["Reload"] = "reload";
|
|
2370
2389
|
/**
|
|
2371
2390
|
* Get iframe URL for the current embed view.
|
|
2391
|
+
* Payload: none.
|
|
2392
|
+
* Response: {@link GetIframeUrlResponse}.
|
|
2372
2393
|
* @example
|
|
2373
2394
|
* ```js
|
|
2374
2395
|
* const url = embed.trigger(HostEvent.GetIframeUrl);
|
|
@@ -2387,6 +2408,7 @@ var HostEvent;
|
|
|
2387
2408
|
HostEvent["GetIframeUrl"] = "GetIframeUrl";
|
|
2388
2409
|
/**
|
|
2389
2410
|
* Display specific visualizations on a Liveboard.
|
|
2411
|
+
* Payload: `string[]`.
|
|
2390
2412
|
* @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
|
|
2391
2413
|
* in this parameter will be hidden.
|
|
2392
2414
|
* @example
|
|
@@ -2409,6 +2431,7 @@ var HostEvent;
|
|
|
2409
2431
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
2410
2432
|
/**
|
|
2411
2433
|
* Set a Liveboard tab as an active tab.
|
|
2434
|
+
* Payload: {@link SetActiveTabRequest}.
|
|
2412
2435
|
* @param - tabId - string of id of Tab to show
|
|
2413
2436
|
* @example
|
|
2414
2437
|
* ```js
|
|
@@ -2436,6 +2459,7 @@ var HostEvent;
|
|
|
2436
2459
|
* and `AppEmbed` only. In full application embedding, this event updates
|
|
2437
2460
|
* the runtime filters applied on the Liveboard and saved Answer objects.
|
|
2438
2461
|
*
|
|
2462
|
+
* Payload: {@link RuntimeFilter}[].
|
|
2439
2463
|
* @param - Array of {@link RuntimeFilter} objects. Each item includes:
|
|
2440
2464
|
* - `columnName`: Name of the column to filter on.
|
|
2441
2465
|
* - `operator`: {@link RuntimeFilterOp} to apply. For more information, see
|
|
@@ -2477,6 +2501,7 @@ var HostEvent;
|
|
|
2477
2501
|
* Accepts either a plain value or an object with `path`
|
|
2478
2502
|
* and an optional `replace` flag.
|
|
2479
2503
|
*
|
|
2504
|
+
* Payload: `string` | `number` | {@link NavigateRequest}.
|
|
2480
2505
|
* @param data - A string path, a numeric history delta, or an object
|
|
2481
2506
|
* `{ path: string | number, replace?: boolean }`.
|
|
2482
2507
|
* - `path` — the route to navigate to, or a history delta such as `1`
|
|
@@ -2504,6 +2529,9 @@ var HostEvent;
|
|
|
2504
2529
|
/**
|
|
2505
2530
|
* Open the filter panel for a particular column.
|
|
2506
2531
|
* Works with Search and Liveboard embed.
|
|
2532
|
+
* Payload: {@link OpenFilterRequest} (the cross-context superset). The
|
|
2533
|
+
* accepted fields vary by context: {@link OpenFilterLiveboardRequest},
|
|
2534
|
+
* {@link OpenFilterSpotterRequest}, {@link OpenFilterSearchRequest}.
|
|
2507
2535
|
* @param - { columnId: string,
|
|
2508
2536
|
* name: string,
|
|
2509
2537
|
* type: ATTRIBUTE/MEASURE,
|
|
@@ -2586,6 +2614,7 @@ var HostEvent;
|
|
|
2586
2614
|
/**
|
|
2587
2615
|
* Open the parameter panel for a particular parameter on a Liveboard.
|
|
2588
2616
|
* Mirrors {@link HostEvent.OpenFilter} for parameters.
|
|
2617
|
+
* Payload: {@link OpenParameterRequest}.
|
|
2589
2618
|
* @param - Includes the following keys:
|
|
2590
2619
|
* - `parameter`: An object identifying the parameter to open, for
|
|
2591
2620
|
* example, `{ parameterId: '<parameter-GUID>' }`.
|
|
@@ -2617,6 +2646,7 @@ var HostEvent;
|
|
|
2617
2646
|
HostEvent["OpenParameter"] = "openParameter";
|
|
2618
2647
|
/**
|
|
2619
2648
|
* Add columns to the current search query.
|
|
2649
|
+
* Payload: `{ columnIds: string[] }`.
|
|
2620
2650
|
* @param - { columnIds: string[] }
|
|
2621
2651
|
* @example
|
|
2622
2652
|
* ```js
|
|
@@ -2635,6 +2665,7 @@ var HostEvent;
|
|
|
2635
2665
|
HostEvent["AddColumns"] = "addColumns";
|
|
2636
2666
|
/**
|
|
2637
2667
|
* Remove a column from the current search query.
|
|
2668
|
+
* Payload: `{ columnId: string }`.
|
|
2638
2669
|
* @param - { columnId: string }
|
|
2639
2670
|
* @example
|
|
2640
2671
|
* ```js
|
|
@@ -2659,6 +2690,8 @@ var HostEvent;
|
|
|
2659
2690
|
* sorting, toggling of legends, and data drill down.
|
|
2660
2691
|
* For more information, see
|
|
2661
2692
|
* link:https://developers.thoughtspot.com/docs/fetch-data-and-report-apis#transient-lb-content[Liveboard data with unsaved changes].
|
|
2693
|
+
* Payload: none.
|
|
2694
|
+
* Response: {@link GetExportRequestForCurrentPinboardResponse}.
|
|
2662
2695
|
* @example
|
|
2663
2696
|
* ```js
|
|
2664
2697
|
* liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard).then(
|
|
@@ -2680,6 +2713,8 @@ var HostEvent;
|
|
|
2680
2713
|
* requiring additional user input via the *Pin to Liveboard* modal, define
|
|
2681
2714
|
* the following parameters:
|
|
2682
2715
|
*
|
|
2716
|
+
* Payload: {@link PinAnswerToLiveboardRequest}.
|
|
2717
|
+
* Response: {@link PinAnswerToLiveboardResponse}.
|
|
2683
2718
|
* @param - Includes the following keys:
|
|
2684
2719
|
* - `vizId`: GUID of the saved Answer or Spotter visualization ID to pin to a
|
|
2685
2720
|
* Liveboard.
|
|
@@ -2794,6 +2829,7 @@ var HostEvent;
|
|
|
2794
2829
|
HostEvent["LiveboardInfo"] = "pinboardInfo";
|
|
2795
2830
|
/**
|
|
2796
2831
|
* Trigger the **Schedule** action on an embedded Liveboard.
|
|
2832
|
+
* Payload: {@link VizScopedRequest}.
|
|
2797
2833
|
* @example
|
|
2798
2834
|
* ```js
|
|
2799
2835
|
* liveboardEmbed.trigger(HostEvent.Schedule)
|
|
@@ -2809,6 +2845,7 @@ var HostEvent;
|
|
|
2809
2845
|
HostEvent["Schedule"] = "subscription";
|
|
2810
2846
|
/**
|
|
2811
2847
|
* Trigger the **Manage schedule** action on an embedded Liveboard
|
|
2848
|
+
* Payload: {@link VizScopedRequest}.
|
|
2812
2849
|
* @example
|
|
2813
2850
|
* ```js
|
|
2814
2851
|
* liveboardEmbed.trigger(HostEvent.SchedulesList)
|
|
@@ -2825,6 +2862,7 @@ var HostEvent;
|
|
|
2825
2862
|
/**
|
|
2826
2863
|
* Trigger the **Export TML** action on an embedded Liveboard or
|
|
2827
2864
|
* Answer.
|
|
2865
|
+
* Payload: {@link VizScopedRequest}.
|
|
2828
2866
|
* @example
|
|
2829
2867
|
* ```js
|
|
2830
2868
|
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
@@ -2847,6 +2885,7 @@ var HostEvent;
|
|
|
2847
2885
|
/**
|
|
2848
2886
|
* Trigger the **Edit TML** action on an embedded Liveboard or
|
|
2849
2887
|
* saved Answers in the full application embedding.
|
|
2888
|
+
* Payload: {@link VizScopedRequest}.
|
|
2850
2889
|
* @example
|
|
2851
2890
|
* ```js
|
|
2852
2891
|
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
@@ -2868,6 +2907,7 @@ var HostEvent;
|
|
|
2868
2907
|
HostEvent["EditTML"] = "editTSL";
|
|
2869
2908
|
/**
|
|
2870
2909
|
* Trigger the **Update TML** action on an embedded Liveboard.
|
|
2910
|
+
* Payload: {@link VizScopedRequest}.
|
|
2871
2911
|
* @example
|
|
2872
2912
|
* ```js
|
|
2873
2913
|
* liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
@@ -2885,6 +2925,7 @@ var HostEvent;
|
|
|
2885
2925
|
* Trigger the **Download PDF** action on an embedded Liveboard,
|
|
2886
2926
|
* visualization or Answer.
|
|
2887
2927
|
*
|
|
2928
|
+
* Payload: {@link VizScopedRequest} plus optional `liveboardId`.
|
|
2888
2929
|
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2889
2930
|
*
|
|
2890
2931
|
* **NOTE**: The **Download** > **PDF** action is available on
|
|
@@ -2935,6 +2976,7 @@ var HostEvent;
|
|
|
2935
2976
|
/**
|
|
2936
2977
|
* Trigger the **AI Highlights** action on an embedded Liveboard
|
|
2937
2978
|
*
|
|
2979
|
+
* Payload: none.
|
|
2938
2980
|
* @example
|
|
2939
2981
|
* ```js
|
|
2940
2982
|
* liveboardEmbed.trigger(HostEvent.AIHighlights)
|
|
@@ -2989,6 +3031,9 @@ var HostEvent;
|
|
|
2989
3031
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
2990
3032
|
/**
|
|
2991
3033
|
* Trigger the **Delete** action for a Liveboard.
|
|
3034
|
+
* Payload varies by context: {@link RequiredVizRequest} (Liveboard, vizId
|
|
3035
|
+
* required), {@link VizScopedRequest} (Search). trigger() accepts the union
|
|
3036
|
+
* now; per-context enforced next release.
|
|
2992
3037
|
* @example
|
|
2993
3038
|
* ```js
|
|
2994
3039
|
* appEmbed.trigger(HostEvent.Remove)
|
|
@@ -3003,6 +3048,7 @@ var HostEvent;
|
|
|
3003
3048
|
HostEvent["Remove"] = "delete";
|
|
3004
3049
|
/**
|
|
3005
3050
|
* Trigger the **Explore** action on a visualization.
|
|
3051
|
+
* Payload: {@link RequiredVizRequest}.
|
|
3006
3052
|
* @param - an object with `vizId` as a key
|
|
3007
3053
|
* @example
|
|
3008
3054
|
* ```js
|
|
@@ -3022,6 +3068,7 @@ var HostEvent;
|
|
|
3022
3068
|
/**
|
|
3023
3069
|
* Trigger the **Create alert** action on a KPI chart
|
|
3024
3070
|
* in a Liveboard or saved Answer.
|
|
3071
|
+
* Payload: {@link VizScopedRequest}.
|
|
3025
3072
|
* @param - an object with `vizId` as a key
|
|
3026
3073
|
* @example
|
|
3027
3074
|
* ```js
|
|
@@ -3053,6 +3100,7 @@ var HostEvent;
|
|
|
3053
3100
|
/**
|
|
3054
3101
|
* Trigger the **Manage alerts** action on a KPI chart
|
|
3055
3102
|
* in a visualization or saved Answer.
|
|
3103
|
+
* Payload: {@link VizScopedRequest}.
|
|
3056
3104
|
* @param - an object with `vizId` as a key
|
|
3057
3105
|
* @example
|
|
3058
3106
|
* ```js
|
|
@@ -3090,6 +3138,7 @@ var HostEvent;
|
|
|
3090
3138
|
* on a Liveboard.
|
|
3091
3139
|
*
|
|
3092
3140
|
* This event is not supported in visualization embed and search embed.
|
|
3141
|
+
* Payload: {@link VizScopedRequest}.
|
|
3093
3142
|
* @param - Object parameter. Includes the following keys:
|
|
3094
3143
|
* - `vizId`: To trigger the action for a specific visualization in Liveboard embed,
|
|
3095
3144
|
* pass in `vizId` as a key. In Spotter embed, `vizId` refers to the Answer ID and
|
|
@@ -3132,6 +3181,7 @@ var HostEvent;
|
|
|
3132
3181
|
HostEvent["Edit"] = "edit";
|
|
3133
3182
|
/**
|
|
3134
3183
|
* Trigger the **Copy link** action on a Liveboard or visualization
|
|
3184
|
+
* Payload: {@link VizScopedRequest}.
|
|
3135
3185
|
* @param - object - to trigger the action for a
|
|
3136
3186
|
* specific visualization in Liveboard embed, pass in `vizId` as a key
|
|
3137
3187
|
* @example
|
|
@@ -3177,6 +3227,7 @@ var HostEvent;
|
|
|
3177
3227
|
HostEvent["CopyLink"] = "embedDocument";
|
|
3178
3228
|
/**
|
|
3179
3229
|
* Trigger the **Present** action on a Liveboard or visualization
|
|
3230
|
+
* Payload: {@link VizScopedRequest}.
|
|
3180
3231
|
* @param - object - to trigger the action for a specific visualization
|
|
3181
3232
|
* in Liveboard embed, pass in `vizId` as a key
|
|
3182
3233
|
* @example
|
|
@@ -3222,6 +3273,8 @@ var HostEvent;
|
|
|
3222
3273
|
HostEvent["Present"] = "present";
|
|
3223
3274
|
/**
|
|
3224
3275
|
* Get TML for the current search.
|
|
3276
|
+
* Payload: {@link GetTMLRequest}.
|
|
3277
|
+
* Response: `Record<string, any>`.
|
|
3225
3278
|
* @example
|
|
3226
3279
|
* ```js
|
|
3227
3280
|
* searchEmbed.trigger(HostEvent.GetTML).then((tml) => {
|
|
@@ -3271,6 +3324,7 @@ var HostEvent;
|
|
|
3271
3324
|
* Trigger the **Show underlying data** action on a
|
|
3272
3325
|
* chart or table.
|
|
3273
3326
|
*
|
|
3327
|
+
* Payload: {@link VizScopedRequest}.
|
|
3274
3328
|
* @param - an object with vizId as a key
|
|
3275
3329
|
* @example
|
|
3276
3330
|
* ```js
|
|
@@ -3304,6 +3358,7 @@ var HostEvent;
|
|
|
3304
3358
|
* Trigger the **Delete** action for a visualization
|
|
3305
3359
|
* in an embedded Liveboard, or a chart or table
|
|
3306
3360
|
* generated from Search.
|
|
3361
|
+
* Payload: {@link VizScopedRequest}.
|
|
3307
3362
|
* @param - Liveboard embed takes an object with `vizId` as a key.
|
|
3308
3363
|
* Can be left empty if embedding Search or visualization.
|
|
3309
3364
|
* @example
|
|
@@ -3332,6 +3387,7 @@ var HostEvent;
|
|
|
3332
3387
|
/**
|
|
3333
3388
|
* Trigger the **SpotIQ analyze** action on a
|
|
3334
3389
|
* chart or table.
|
|
3390
|
+
* Payload: {@link VizScopedRequest}.
|
|
3335
3391
|
* @param - Liveboard embed takes `vizId` as a
|
|
3336
3392
|
* key. Can be left undefined when embedding Search or
|
|
3337
3393
|
* visualization.
|
|
@@ -3394,6 +3450,7 @@ var HostEvent;
|
|
|
3394
3450
|
/**
|
|
3395
3451
|
* Trigger the **Download** > **PNG** action on
|
|
3396
3452
|
* charts in the embedded view.
|
|
3453
|
+
* Payload: {@link VizScopedRequest}.
|
|
3397
3454
|
* @example
|
|
3398
3455
|
* ```js
|
|
3399
3456
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPng,
|
|
@@ -3425,6 +3482,7 @@ var HostEvent;
|
|
|
3425
3482
|
/**
|
|
3426
3483
|
* Trigger the **Download** > **CSV** action on tables in
|
|
3427
3484
|
* the embedded view.
|
|
3485
|
+
* Payload: {@link VizScopedRequest}.
|
|
3428
3486
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
3429
3487
|
* @example
|
|
3430
3488
|
* ```js
|
|
@@ -3464,6 +3522,7 @@ var HostEvent;
|
|
|
3464
3522
|
/**
|
|
3465
3523
|
* Trigger the **Download** > **XLSX** action on tables
|
|
3466
3524
|
* in the embedded view.
|
|
3525
|
+
* Payload: {@link VizScopedRequest}.
|
|
3467
3526
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
3468
3527
|
* @example
|
|
3469
3528
|
* ```js
|
|
@@ -3503,6 +3562,7 @@ var HostEvent;
|
|
|
3503
3562
|
/**
|
|
3504
3563
|
* Trigger the **Share** action on an embedded
|
|
3505
3564
|
* Liveboard or Answer.
|
|
3565
|
+
* Payload: {@link VizScopedRequest}.
|
|
3506
3566
|
* @example
|
|
3507
3567
|
* ```js
|
|
3508
3568
|
* liveboardEmbed.trigger(HostEvent.Share)
|
|
@@ -3529,6 +3589,7 @@ var HostEvent;
|
|
|
3529
3589
|
* Trigger the **Save** action on a Liveboard, Answer, or Spotter.
|
|
3530
3590
|
* Saves the changes.
|
|
3531
3591
|
*
|
|
3592
|
+
* Payload: {@link VizScopedRequest}.
|
|
3532
3593
|
* @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
|
|
3533
3594
|
* It is required and can be retrieved from the data embed event.
|
|
3534
3595
|
*
|
|
@@ -3580,6 +3641,7 @@ var HostEvent;
|
|
|
3580
3641
|
/**
|
|
3581
3642
|
* Trigger the **Sync to Sheets** action on an embedded visualization or Answer
|
|
3582
3643
|
* Sends data from an Answer or Liveboard visualization to a Google sheet.
|
|
3644
|
+
* Payload: {@link VizScopedRequest}.
|
|
3583
3645
|
* @param - an object with `vizId` as a key
|
|
3584
3646
|
* @example
|
|
3585
3647
|
* ```js
|
|
@@ -3610,6 +3672,7 @@ var HostEvent;
|
|
|
3610
3672
|
* Trigger the **Sync to Other Apps** action on an embedded visualization or Answer
|
|
3611
3673
|
* Sends data from an Answer or Liveboard visualization to third-party apps such
|
|
3612
3674
|
* as Slack, Salesforce, Microsoft Teams, ServiceNow and so on.
|
|
3675
|
+
* Payload: {@link VizScopedRequest}.
|
|
3613
3676
|
* @param - an object with vizId as a key
|
|
3614
3677
|
* @example
|
|
3615
3678
|
* ```js
|
|
@@ -3640,6 +3703,7 @@ var HostEvent;
|
|
|
3640
3703
|
* Trigger the **Manage pipelines** action on an embedded
|
|
3641
3704
|
* visualization or Answer.
|
|
3642
3705
|
* Allows users to manage ThoughtSpot Sync pipelines.
|
|
3706
|
+
* Payload: {@link VizScopedRequest}.
|
|
3643
3707
|
* @param - an object with `vizId` as a key
|
|
3644
3708
|
* @example
|
|
3645
3709
|
* ```js
|
|
@@ -3668,6 +3732,7 @@ var HostEvent;
|
|
|
3668
3732
|
HostEvent["ManagePipelines"] = "manage-pipeline";
|
|
3669
3733
|
/**
|
|
3670
3734
|
* Reset search operation on the Search or Answer page.
|
|
3735
|
+
* Payload: none.
|
|
3671
3736
|
* @example
|
|
3672
3737
|
* ```js
|
|
3673
3738
|
* searchEmbed.trigger(HostEvent.ResetSearch)
|
|
@@ -3695,10 +3760,18 @@ var HostEvent;
|
|
|
3695
3760
|
* whole Liveboard.
|
|
3696
3761
|
* The `applicability` attribute is available from SDK: 1.53.0 |
|
|
3697
3762
|
* ThoughtSpot: 26.10.0.cl.
|
|
3763
|
+
* Payload: {@link GetFiltersRequest}.
|
|
3764
|
+
* Response: {@link GetFiltersResponse}.
|
|
3698
3765
|
* @example
|
|
3699
3766
|
* ```js
|
|
3700
3767
|
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
|
|
3701
3768
|
* console.log('data', data);
|
|
3769
|
+
* // {
|
|
3770
|
+
* // liveboardFilters: [ ... ],
|
|
3771
|
+
* // runtimeFilters: [
|
|
3772
|
+
* // { columnName: "Region", operator: "IN", values: ["West"] }
|
|
3773
|
+
* // ]
|
|
3774
|
+
* // }
|
|
3702
3775
|
* ```
|
|
3703
3776
|
* @example
|
|
3704
3777
|
* ```js
|
|
@@ -3714,6 +3787,7 @@ var HostEvent;
|
|
|
3714
3787
|
HostEvent["GetFilters"] = "getFilters";
|
|
3715
3788
|
/**
|
|
3716
3789
|
* Update one or several filters applied on a Liveboard.
|
|
3790
|
+
* Payload: {@link UpdateFiltersRequest}.
|
|
3717
3791
|
* @param - Includes the following keys:
|
|
3718
3792
|
* - `filter`: A single filter object containing column name, filter operator, and
|
|
3719
3793
|
* values.
|
|
@@ -3722,9 +3796,9 @@ var HostEvent;
|
|
|
3722
3796
|
*
|
|
3723
3797
|
* Each filter object must include the following attributes:
|
|
3724
3798
|
*
|
|
3725
|
-
* `
|
|
3799
|
+
* `columnName` - Name of the column to filter on.
|
|
3726
3800
|
*
|
|
3727
|
-
* `
|
|
3801
|
+
* `operator` - Filter operator, for example, EQ, IN, CONTAINS.
|
|
3728
3802
|
* For information about the supported filter operators,
|
|
3729
3803
|
* see link:https://developers.thoughtspot.com/docs/runtime-filters#rtOperator[Developer Documentation].
|
|
3730
3804
|
*
|
|
@@ -3751,8 +3825,8 @@ var HostEvent;
|
|
|
3751
3825
|
*
|
|
3752
3826
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3753
3827
|
* filter: {
|
|
3754
|
-
*
|
|
3755
|
-
*
|
|
3828
|
+
* columnName: "item type",
|
|
3829
|
+
* operator: "IN",
|
|
3756
3830
|
* values: ["bags","shirts"]
|
|
3757
3831
|
* }
|
|
3758
3832
|
* });
|
|
@@ -3762,8 +3836,8 @@ var HostEvent;
|
|
|
3762
3836
|
*
|
|
3763
3837
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3764
3838
|
* filter: {
|
|
3765
|
-
*
|
|
3766
|
-
*
|
|
3839
|
+
* columnName: "date",
|
|
3840
|
+
* operator: "EQ",
|
|
3767
3841
|
* values: ["JULY","2023"],
|
|
3768
3842
|
* type: "MONTH_YEAR"
|
|
3769
3843
|
* }
|
|
@@ -3774,18 +3848,18 @@ var HostEvent;
|
|
|
3774
3848
|
* ```js
|
|
3775
3849
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3776
3850
|
* filters: [{
|
|
3777
|
-
*
|
|
3778
|
-
*
|
|
3851
|
+
* columnName: "Item Type",
|
|
3852
|
+
* operator: 'IN',
|
|
3779
3853
|
* values: ["bags","shirts"]
|
|
3780
3854
|
* },
|
|
3781
3855
|
* {
|
|
3782
|
-
*
|
|
3783
|
-
*
|
|
3856
|
+
* columnName: "Region",
|
|
3857
|
+
* operator: 'IN',
|
|
3784
3858
|
* values: ["West","Midwest"]
|
|
3785
3859
|
* },
|
|
3786
3860
|
* {
|
|
3787
|
-
*
|
|
3788
|
-
*
|
|
3861
|
+
* columnName: "Date",
|
|
3862
|
+
* operator: 'EQ',
|
|
3789
3863
|
* values: ["2023-07-31"],
|
|
3790
3864
|
* type: "EXACT_DATE"
|
|
3791
3865
|
* }]
|
|
@@ -3799,13 +3873,13 @@ var HostEvent;
|
|
|
3799
3873
|
* ```js
|
|
3800
3874
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3801
3875
|
* filters: [{
|
|
3802
|
-
*
|
|
3803
|
-
*
|
|
3876
|
+
* columnName: "(Sample) Retail - Apparel::city",
|
|
3877
|
+
* operator: 'IN',
|
|
3804
3878
|
* values: ["atlanta"]
|
|
3805
3879
|
* },
|
|
3806
3880
|
* {
|
|
3807
|
-
*
|
|
3808
|
-
*
|
|
3881
|
+
* columnName: "(Sample) Retail - Apparel::Region",
|
|
3882
|
+
* operator: 'IN',
|
|
3809
3883
|
* values: ["West","Midwest"]
|
|
3810
3884
|
* }]
|
|
3811
3885
|
* });
|
|
@@ -3816,8 +3890,8 @@ var HostEvent;
|
|
|
3816
3890
|
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3817
3891
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3818
3892
|
* filter: {
|
|
3819
|
-
*
|
|
3820
|
-
*
|
|
3893
|
+
* columnName: "item type",
|
|
3894
|
+
* operator: "IN",
|
|
3821
3895
|
* values: ["shoes", "boots"]
|
|
3822
3896
|
* }
|
|
3823
3897
|
* }, ContextType.Liveboard);
|
|
@@ -3827,8 +3901,8 @@ var HostEvent;
|
|
|
3827
3901
|
* // Scope the filter to a specific Liveboard tab
|
|
3828
3902
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3829
3903
|
* filter: {
|
|
3830
|
-
*
|
|
3831
|
-
*
|
|
3904
|
+
* columnName: "item type",
|
|
3905
|
+
* operator: "IN",
|
|
3832
3906
|
* values: ["bags", "shirts"],
|
|
3833
3907
|
* applicability: {
|
|
3834
3908
|
* level: "TAB",
|
|
@@ -3837,11 +3911,19 @@ var HostEvent;
|
|
|
3837
3911
|
* }
|
|
3838
3912
|
* });
|
|
3839
3913
|
* ```
|
|
3914
|
+
* Use `columnName` and `operator` - the same spelling as
|
|
3915
|
+
* {@link RuntimeFilter}. The older `column` and `oper` spellings are
|
|
3916
|
+
* deprecated; they are still accepted, but pass only one spelling of each
|
|
3917
|
+
* field, never both. To reapply the filter state captured from
|
|
3918
|
+
* {@link EmbedEvent.FilterChanged}, use `convertFilterChangedToUpdateFiltersPayload`
|
|
3919
|
+
* to convert its payload into the shape expected here.
|
|
3840
3920
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
3841
3921
|
*/
|
|
3842
3922
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
3843
3923
|
/**
|
|
3844
3924
|
* Get tab details for the current Liveboard.
|
|
3925
|
+
* Payload: none.
|
|
3926
|
+
* Response: {@link GetTabsResponse}.
|
|
3845
3927
|
* @example
|
|
3846
3928
|
* ```js
|
|
3847
3929
|
* liveboardEmbed.trigger(HostEvent.GetTabs).then((tabDetails) => {
|
|
@@ -3867,6 +3949,8 @@ var HostEvent;
|
|
|
3867
3949
|
/**
|
|
3868
3950
|
* Get group details for the current Liveboard.
|
|
3869
3951
|
* Mirrors {@link HostEvent.GetTabs} for filter/parameter groups.
|
|
3952
|
+
* Payload: none.
|
|
3953
|
+
* Response: {@link GetGroupsResponse}.
|
|
3870
3954
|
* @example
|
|
3871
3955
|
* ```js
|
|
3872
3956
|
* liveboardEmbed.trigger(HostEvent.GetGroups).then((groupDetails) => {
|
|
@@ -3891,6 +3975,7 @@ var HostEvent;
|
|
|
3891
3975
|
HostEvent["GetGroups"] = "getGroups";
|
|
3892
3976
|
/**
|
|
3893
3977
|
* Set the visible tabs on a Liveboard.
|
|
3978
|
+
* Payload: `string[]`.
|
|
3894
3979
|
* @param - an array of ids of tabs to show, the IDs not passed
|
|
3895
3980
|
* will be hidden.
|
|
3896
3981
|
* @example
|
|
@@ -3913,6 +3998,7 @@ var HostEvent;
|
|
|
3913
3998
|
HostEvent["SetVisibleTabs"] = "SetPinboardVisibleTabs";
|
|
3914
3999
|
/**
|
|
3915
4000
|
* Set the hidden tabs on a Liveboard.
|
|
4001
|
+
* Payload: `string[]`.
|
|
3916
4002
|
* @param - an array of the IDs of the tabs to hide.
|
|
3917
4003
|
* The IDs not passed will be shown.
|
|
3918
4004
|
* @example
|
|
@@ -3941,6 +4027,8 @@ var HostEvent;
|
|
|
3941
4027
|
* `getAnswerService()` method on the embed instance to get an AnswerService
|
|
3942
4028
|
* object that provides a more convenient interface for working with answers.
|
|
3943
4029
|
*
|
|
4030
|
+
* Payload: {@link GetAnswerSessionRequest}.
|
|
4031
|
+
* Response: {@link GetAnswerSessionResponse}.
|
|
3944
4032
|
* @example
|
|
3945
4033
|
* ```js
|
|
3946
4034
|
* // Preferred way to get an AnswerService
|
|
@@ -3968,6 +4056,7 @@ var HostEvent;
|
|
|
3968
4056
|
HostEvent["GetAnswerSession"] = "getAnswerSession";
|
|
3969
4057
|
/**
|
|
3970
4058
|
* Trigger the *Ask Sage* action for visualizations
|
|
4059
|
+
* Payload: {@link RequiredVizRequest}.
|
|
3971
4060
|
* @example
|
|
3972
4061
|
* ```js
|
|
3973
4062
|
* liveboardEmbed.trigger(HostEvent.AskSage,
|
|
@@ -3979,6 +4068,7 @@ var HostEvent;
|
|
|
3979
4068
|
/**
|
|
3980
4069
|
* Trigger cross filter update action on a Liveboard.
|
|
3981
4070
|
*
|
|
4071
|
+
* Payload: {@link UpdateCrossFilterRequest}.
|
|
3982
4072
|
* @example
|
|
3983
4073
|
* ```js
|
|
3984
4074
|
* liveboardEmbed.trigger(HostEvent.UpdateCrossFilter, {
|
|
@@ -3994,7 +4084,9 @@ var HostEvent;
|
|
|
3994
4084
|
HostEvent["UpdateCrossFilter"] = "UpdateCrossFilter";
|
|
3995
4085
|
/**
|
|
3996
4086
|
* Trigger reset action for a personalized Liveboard view.
|
|
3997
|
-
* This event is deprecated.
|
|
4087
|
+
* This event is deprecated.
|
|
4088
|
+
* Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
|
|
4089
|
+
* Payload: none.
|
|
3998
4090
|
* @example
|
|
3999
4091
|
* ```js
|
|
4000
4092
|
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
|
|
@@ -4015,6 +4107,7 @@ var HostEvent;
|
|
|
4015
4107
|
/**
|
|
4016
4108
|
* Triggers an action to update Parameter values on embedded
|
|
4017
4109
|
* Answers, Liveboard, and Spotter answer in Edit mode.
|
|
4110
|
+
* Payload: {@link RuntimeParameter}[].
|
|
4018
4111
|
* @param - Includes the following keys for each item:
|
|
4019
4112
|
* - `name`: Name of the parameter.
|
|
4020
4113
|
* - `value`: The value to set for the parameter.
|
|
@@ -4072,6 +4165,8 @@ var HostEvent;
|
|
|
4072
4165
|
* whole Liveboard.
|
|
4073
4166
|
* The `applicability` attribute is available from SDK: 1.53.0 |
|
|
4074
4167
|
* ThoughtSpot: 26.10.0.cl.
|
|
4168
|
+
* Payload: none.
|
|
4169
|
+
* Response: {@link GetParametersResponse}.
|
|
4075
4170
|
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
4076
4171
|
* ```js
|
|
4077
4172
|
* liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
|
|
@@ -4109,6 +4204,7 @@ var HostEvent;
|
|
|
4109
4204
|
* ```js
|
|
4110
4205
|
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
|
|
4111
4206
|
* ```
|
|
4207
|
+
* Payload: {@link PersonalisedViewRequest} (`viewId` only).
|
|
4112
4208
|
* @example
|
|
4113
4209
|
* ```js
|
|
4114
4210
|
* // Update personalized view from liveboard context
|
|
@@ -4141,6 +4237,7 @@ var HostEvent;
|
|
|
4141
4237
|
* If neither is provided, the Liveboard resets to the original/default view.
|
|
4142
4238
|
* When a `viewName` is provided and multiple views share
|
|
4143
4239
|
* the same name, the first match is selected.
|
|
4240
|
+
* Payload: {@link PersonalisedViewRequest}.
|
|
4144
4241
|
* @example
|
|
4145
4242
|
* ```js
|
|
4146
4243
|
* liveboardEmbed.trigger(
|
|
@@ -4184,6 +4281,8 @@ var HostEvent;
|
|
|
4184
4281
|
* If no parameters are specified, the save action is
|
|
4185
4282
|
* triggered with a modal to prompt users to
|
|
4186
4283
|
* add a name and description for the Answer.
|
|
4284
|
+
* Payload: {@link SaveAnswerRequest}.
|
|
4285
|
+
* Response: {@link SaveAnswerResponse}.
|
|
4187
4286
|
* @param - Includes the following keys:
|
|
4188
4287
|
* - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
|
|
4189
4288
|
* embed.
|
|
@@ -4269,6 +4368,7 @@ var HostEvent;
|
|
|
4269
4368
|
/**
|
|
4270
4369
|
* Triggers a search operation with the search tokens specified in
|
|
4271
4370
|
* the search query string in spotter embed.
|
|
4371
|
+
* Payload: {@link SpotterSearchRequest}.
|
|
4272
4372
|
* @param - Includes the following keys:
|
|
4273
4373
|
* - `query`: Text string in Natural Language format.
|
|
4274
4374
|
* - `executeSearch`: Boolean to execute search and update search query.
|
|
@@ -4293,6 +4393,7 @@ var HostEvent;
|
|
|
4293
4393
|
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
4294
4394
|
/**
|
|
4295
4395
|
* Edits the last prompt in spotter embed.
|
|
4396
|
+
* Payload: `string`.
|
|
4296
4397
|
* @param - `query`: Text string
|
|
4297
4398
|
* @example
|
|
4298
4399
|
* ```js
|
|
@@ -4309,6 +4410,7 @@ var HostEvent;
|
|
|
4309
4410
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
4310
4411
|
/**
|
|
4311
4412
|
* Opens the data source preview modal in Spotter Embed.
|
|
4413
|
+
* Payload: none.
|
|
4312
4414
|
* @example
|
|
4313
4415
|
* ```js
|
|
4314
4416
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
@@ -4344,6 +4446,7 @@ var HostEvent;
|
|
|
4344
4446
|
HostEvent["DataModelInstructions"] = "DataModelInstructions";
|
|
4345
4447
|
/**
|
|
4346
4448
|
* Resets the Spotter Embed Conversation.
|
|
4449
|
+
* Payload: none.
|
|
4347
4450
|
* @example
|
|
4348
4451
|
* ```js
|
|
4349
4452
|
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
@@ -4356,6 +4459,7 @@ var HostEvent;
|
|
|
4356
4459
|
* `conversationId` is **mandatory** — you must pass the id of the
|
|
4357
4460
|
* conversation to share. Also no-op when sharing is disabled
|
|
4358
4461
|
* (enableShareConversation off) or when already in the read-only shared view.
|
|
4462
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4359
4463
|
* @example
|
|
4360
4464
|
* ```js
|
|
4361
4465
|
* spotterEmbed.trigger(HostEvent.ShareSpotterConversation, { conversationId: 'abc' });
|
|
@@ -4365,6 +4469,7 @@ var HostEvent;
|
|
|
4365
4469
|
HostEvent["ShareSpotterConversation"] = "ShareSpotterConversation";
|
|
4366
4470
|
/**
|
|
4367
4471
|
* Closes the Spotter share-conversation modal. No-op if none is open.
|
|
4472
|
+
* Payload: none.
|
|
4368
4473
|
* @example
|
|
4369
4474
|
* ```js
|
|
4370
4475
|
* spotterEmbed.trigger(HostEvent.CloseSpotterShareConversation);
|
|
@@ -4374,6 +4479,7 @@ var HostEvent;
|
|
|
4374
4479
|
HostEvent["CloseSpotterShareConversation"] = "CloseSpotterShareConversation";
|
|
4375
4480
|
/**
|
|
4376
4481
|
* Exits the read-only shared-conversation view.
|
|
4482
|
+
* Payload: none.
|
|
4377
4483
|
* @example
|
|
4378
4484
|
* ```js
|
|
4379
4485
|
* spotterEmbed.trigger(HostEvent.ExitSpotterSharedConversation);
|
|
@@ -4383,6 +4489,7 @@ var HostEvent;
|
|
|
4383
4489
|
HostEvent["ExitSpotterSharedConversation"] = "ExitSpotterSharedConversation";
|
|
4384
4490
|
/**
|
|
4385
4491
|
* Deletes the last prompt in spotter embed.
|
|
4492
|
+
* Payload: none.
|
|
4386
4493
|
* @example
|
|
4387
4494
|
* ```js
|
|
4388
4495
|
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
@@ -4392,6 +4499,7 @@ var HostEvent;
|
|
|
4392
4499
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
4393
4500
|
/**
|
|
4394
4501
|
* Toggle the visualization to chart or table view.
|
|
4502
|
+
* Payload: {@link RequiredVizRequest}.
|
|
4395
4503
|
* @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
|
|
4396
4504
|
* @example
|
|
4397
4505
|
* ```js
|
|
@@ -4430,6 +4538,7 @@ var HostEvent;
|
|
|
4430
4538
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
4431
4539
|
/**
|
|
4432
4540
|
* Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
|
|
4541
|
+
* Payload: {@link RequiredVizRequest}.
|
|
4433
4542
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
|
|
4434
4543
|
* @example
|
|
4435
4544
|
* ```js
|
|
@@ -4491,6 +4600,7 @@ var HostEvent;
|
|
|
4491
4600
|
* instance. Contact your admin or ThoughtSpot Support to enable chat history on your
|
|
4492
4601
|
* instance.
|
|
4493
4602
|
*
|
|
4603
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4494
4604
|
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
4495
4605
|
* @example
|
|
4496
4606
|
* ```js
|
|
@@ -4508,6 +4618,7 @@ var HostEvent;
|
|
|
4508
4618
|
* instance. Contact your admin or ThoughtSpot Support to enable chat history on your
|
|
4509
4619
|
* instance.
|
|
4510
4620
|
*
|
|
4621
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4511
4622
|
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
4512
4623
|
* @example
|
|
4513
4624
|
* ```js
|
|
@@ -4532,6 +4643,7 @@ var HostEvent;
|
|
|
4532
4643
|
* Trigger the **Send Test Email** action in the Liveboard schedule modal.
|
|
4533
4644
|
* Sends a test schedule email to self or all recipients.
|
|
4534
4645
|
* Requires `isSendNowLiveboardSchedulingEnabled` to be enabled.
|
|
4646
|
+
* Payload: {@link ScheduleEmailRequest}.
|
|
4535
4647
|
* @example
|
|
4536
4648
|
* ```js
|
|
4537
4649
|
* liveboardEmbed.trigger(HostEvent.SendTestScheduleEmail, {
|
|
@@ -4550,6 +4662,7 @@ var HostEvent;
|
|
|
4550
4662
|
HostEvent["SendTestScheduleEmail"] = "sendTestScheduleEmail";
|
|
4551
4663
|
/**
|
|
4552
4664
|
* Sends a user message (prompt) to the SpotterViz panel programmatically.
|
|
4665
|
+
* Payload: `{ query: string }`.
|
|
4553
4666
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4554
4667
|
* @param query - the prompt text to send.
|
|
4555
4668
|
* @example
|
|
@@ -4562,6 +4675,7 @@ var HostEvent;
|
|
|
4562
4675
|
HostEvent["SpotterVizSendUserMessage"] = "SpotterVizSendUserMessage";
|
|
4563
4676
|
/**
|
|
4564
4677
|
* Initializes a new SpotterViz conversation.
|
|
4678
|
+
* Payload: none.
|
|
4565
4679
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4566
4680
|
* @example
|
|
4567
4681
|
* ```js
|
|
@@ -4571,6 +4685,7 @@ var HostEvent;
|
|
|
4571
4685
|
HostEvent["InitSpotterVizConversation"] = "InitSpotterVizConversation";
|
|
4572
4686
|
/**
|
|
4573
4687
|
* Opens the SpotterViz panel.
|
|
4688
|
+
* Payload: none.
|
|
4574
4689
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4575
4690
|
* @example
|
|
4576
4691
|
* ```js
|
|
@@ -4580,6 +4695,7 @@ var HostEvent;
|
|
|
4580
4695
|
HostEvent["OpenSpotterVizPanel"] = "OpenSpotterVizPanel";
|
|
4581
4696
|
/**
|
|
4582
4697
|
* Closes the SpotterViz panel.
|
|
4698
|
+
* Payload: none.
|
|
4583
4699
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4584
4700
|
* @example
|
|
4585
4701
|
* ```js
|
|
@@ -4590,6 +4706,7 @@ var HostEvent;
|
|
|
4590
4706
|
/**
|
|
4591
4707
|
* Clears browser cache and fetches new data for liveboard ChartViz Containers.
|
|
4592
4708
|
* Requires `enableLiveboardDataCache` to be enabled.
|
|
4709
|
+
* Payload: {@link ScheduleEmailRequest}.
|
|
4593
4710
|
* @example
|
|
4594
4711
|
* ```js
|
|
4595
4712
|
* liveboardEmbed.trigger(HostEvent.RefreshLiveboardBrowserCache);
|
|
@@ -4785,8 +4902,8 @@ var Param;
|
|
|
4785
4902
|
Param["IsStarterPromptsEnabled"] = "enableStarterPrompts";
|
|
4786
4903
|
Param["UpdatedSpotterExperience"] = "updatedSpotterExperience";
|
|
4787
4904
|
Param["SpotterDataSources"] = "spotterDataSources";
|
|
4788
|
-
Param["AnalystId"] = "analystId";
|
|
4789
4905
|
Param["OpenSpotterOnLiveboardByDefault"] = "openSpotterOnLiveboardByDefault";
|
|
4906
|
+
Param["ShowAnswerEditPanel"] = "showAnswerEditPanel";
|
|
4790
4907
|
})(Param || (Param = {}));
|
|
4791
4908
|
/**
|
|
4792
4909
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -6791,6 +6908,237 @@ var Action;
|
|
|
6791
6908
|
* ```
|
|
6792
6909
|
*/
|
|
6793
6910
|
Action["SpotterOnLiveboard"] = "spotterOnLiveboard";
|
|
6911
|
+
/**
|
|
6912
|
+
* Controls the visibility and disabled state of the "Chart Type" menu item
|
|
6913
|
+
* in Chart Settings V2.
|
|
6914
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6915
|
+
* @example
|
|
6916
|
+
* ```js
|
|
6917
|
+
* {
|
|
6918
|
+
* hiddenActions: [Action.ChartTypeSettings],
|
|
6919
|
+
* disabledActions: [Action.ChartTypeSettings],
|
|
6920
|
+
* }
|
|
6921
|
+
* ```
|
|
6922
|
+
*/
|
|
6923
|
+
Action["ChartTypeSettings"] = "CHART_TYPE";
|
|
6924
|
+
/**
|
|
6925
|
+
* Controls the visibility and disabled state of the "Layout" menu item
|
|
6926
|
+
* in Chart Settings V2.
|
|
6927
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6928
|
+
* @example
|
|
6929
|
+
* ```js
|
|
6930
|
+
* {
|
|
6931
|
+
* hiddenActions: [Action.LayoutSettings],
|
|
6932
|
+
* disabledActions: [Action.LayoutSettings],
|
|
6933
|
+
* }
|
|
6934
|
+
* ```
|
|
6935
|
+
*/
|
|
6936
|
+
Action["LayoutSettings"] = "LAYOUT";
|
|
6937
|
+
/**
|
|
6938
|
+
* Controls the visibility and disabled state of the "Column" menu item
|
|
6939
|
+
* in Chart Settings V2.
|
|
6940
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6941
|
+
* @example
|
|
6942
|
+
* ```js
|
|
6943
|
+
* {
|
|
6944
|
+
* hiddenActions: [Action.ColumnSettings],
|
|
6945
|
+
* disabledActions: [Action.ColumnSettings],
|
|
6946
|
+
* }
|
|
6947
|
+
* ```
|
|
6948
|
+
*/
|
|
6949
|
+
Action["ColumnSettings"] = "COLUMN";
|
|
6950
|
+
/**
|
|
6951
|
+
* Controls the visibility and disabled state of the "Axis" menu item
|
|
6952
|
+
* in Chart Settings V2.
|
|
6953
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6954
|
+
* @example
|
|
6955
|
+
* ```js
|
|
6956
|
+
* {
|
|
6957
|
+
* hiddenActions: [Action.AxisSettings],
|
|
6958
|
+
* disabledActions: [Action.AxisSettings],
|
|
6959
|
+
* }
|
|
6960
|
+
* ```
|
|
6961
|
+
*/
|
|
6962
|
+
Action["AxisSettings"] = "AXIS";
|
|
6963
|
+
/**
|
|
6964
|
+
* Controls the visibility and disabled state of the "Data Label" menu item
|
|
6965
|
+
* in Chart Settings V2.
|
|
6966
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6967
|
+
* @example
|
|
6968
|
+
* ```js
|
|
6969
|
+
* {
|
|
6970
|
+
* hiddenActions: [Action.DataLabelSettings],
|
|
6971
|
+
* disabledActions: [Action.DataLabelSettings],
|
|
6972
|
+
* }
|
|
6973
|
+
* ```
|
|
6974
|
+
*/
|
|
6975
|
+
Action["DataLabelSettings"] = "DATA_LABEL";
|
|
6976
|
+
/**
|
|
6977
|
+
* Controls the visibility and disabled state of the "Tooltip" menu item
|
|
6978
|
+
* in Chart Settings V2.
|
|
6979
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6980
|
+
* @example
|
|
6981
|
+
* ```js
|
|
6982
|
+
* {
|
|
6983
|
+
* hiddenActions: [Action.TooltipSettings],
|
|
6984
|
+
* disabledActions: [Action.TooltipSettings],
|
|
6985
|
+
* }
|
|
6986
|
+
* ```
|
|
6987
|
+
*/
|
|
6988
|
+
Action["TooltipSettings"] = "TOOLTIP";
|
|
6989
|
+
/**
|
|
6990
|
+
* Controls the visibility and disabled state of the "Legend" menu item
|
|
6991
|
+
* in Chart Settings V2.
|
|
6992
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6993
|
+
* @example
|
|
6994
|
+
* ```js
|
|
6995
|
+
* {
|
|
6996
|
+
* hiddenActions: [Action.LegendSettings],
|
|
6997
|
+
* disabledActions: [Action.LegendSettings],
|
|
6998
|
+
* }
|
|
6999
|
+
* ```
|
|
7000
|
+
*/
|
|
7001
|
+
Action["LegendSettings"] = "LEGEND";
|
|
7002
|
+
/**
|
|
7003
|
+
* Controls the visibility and disabled state of the "Display" menu item
|
|
7004
|
+
* in Chart Settings V2.
|
|
7005
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7006
|
+
* @example
|
|
7007
|
+
* ```js
|
|
7008
|
+
* {
|
|
7009
|
+
* hiddenActions: [Action.DisplaySettings],
|
|
7010
|
+
* disabledActions: [Action.DisplaySettings],
|
|
7011
|
+
* }
|
|
7012
|
+
* ```
|
|
7013
|
+
*/
|
|
7014
|
+
Action["DisplaySettings"] = "DISPLAY";
|
|
7015
|
+
/**
|
|
7016
|
+
* Controls the visibility and disabled state of the "Query Details" menu
|
|
7017
|
+
* item in Chart Settings V2.
|
|
7018
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7019
|
+
* @example
|
|
7020
|
+
* ```js
|
|
7021
|
+
* {
|
|
7022
|
+
* hiddenActions: [Action.QuerySettings],
|
|
7023
|
+
* disabledActions: [Action.QuerySettings],
|
|
7024
|
+
* }
|
|
7025
|
+
* ```
|
|
7026
|
+
*/
|
|
7027
|
+
Action["QuerySettings"] = "QUERY_DETAILS";
|
|
7028
|
+
/**
|
|
7029
|
+
* Controls the visibility and disabled state of the "Custom Action" menu
|
|
7030
|
+
* item in Chart Settings V2.
|
|
7031
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7032
|
+
* @example
|
|
7033
|
+
* ```js
|
|
7034
|
+
* {
|
|
7035
|
+
* hiddenActions: [Action.CustomSettings],
|
|
7036
|
+
* disabledActions: [Action.CustomSettings],
|
|
7037
|
+
* }
|
|
7038
|
+
* ```
|
|
7039
|
+
*/
|
|
7040
|
+
Action["CustomSettings"] = "CUSTOM_ACTION";
|
|
7041
|
+
/**
|
|
7042
|
+
* Controls the visibility and disabled state of the "Muze AI" menu item
|
|
7043
|
+
* in Chart Settings V2.
|
|
7044
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7045
|
+
* @example
|
|
7046
|
+
* ```js
|
|
7047
|
+
* {
|
|
7048
|
+
* hiddenActions: [Action.MuzeAiSettings],
|
|
7049
|
+
* disabledActions: [Action.MuzeAiSettings],
|
|
7050
|
+
* }
|
|
7051
|
+
* ```
|
|
7052
|
+
*/
|
|
7053
|
+
Action["MuzeAiSettings"] = "MUZE_AI";
|
|
7054
|
+
/**
|
|
7055
|
+
* Controls the visibility and disabled state of the "R Analysis" menu item
|
|
7056
|
+
* in Chart Settings V2.
|
|
7057
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7058
|
+
* @example
|
|
7059
|
+
* ```js
|
|
7060
|
+
* {
|
|
7061
|
+
* hiddenActions: [Action.RAnalysisSettings],
|
|
7062
|
+
* disabledActions: [Action.RAnalysisSettings],
|
|
7063
|
+
* }
|
|
7064
|
+
* ```
|
|
7065
|
+
*/
|
|
7066
|
+
Action["RAnalysisSettings"] = "R_ANALYSIS";
|
|
7067
|
+
/**
|
|
7068
|
+
* Controls the visibility and disabled state of the "Add to Collection" menu item.
|
|
7069
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7070
|
+
* @example
|
|
7071
|
+
* ```js
|
|
7072
|
+
* {
|
|
7073
|
+
* hiddenActions: [Action.AddToCollection],
|
|
7074
|
+
* disabledActions: [Action.AddToCollection],
|
|
7075
|
+
* }
|
|
7076
|
+
* ```
|
|
7077
|
+
*/
|
|
7078
|
+
Action["AddToCollection"] = "addToCollection";
|
|
7079
|
+
/**
|
|
7080
|
+
* Controls the visibility and disabled state of the "Create Collection" button.
|
|
7081
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7082
|
+
* @example
|
|
7083
|
+
* ```js
|
|
7084
|
+
* {
|
|
7085
|
+
* hiddenActions: [Action.CreateCollection],
|
|
7086
|
+
* disabledActions: [Action.CreateCollection],
|
|
7087
|
+
* }
|
|
7088
|
+
* ```
|
|
7089
|
+
*/
|
|
7090
|
+
Action["CreateCollection"] = "createCollection";
|
|
7091
|
+
/**
|
|
7092
|
+
* Controls the visibility and disabled state of the "Move" menu item in a
|
|
7093
|
+
* Collection.
|
|
7094
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7095
|
+
* @example
|
|
7096
|
+
* ```js
|
|
7097
|
+
* {
|
|
7098
|
+
* hiddenActions: [Action.MoveToCollection],
|
|
7099
|
+
* disabledActions: [Action.MoveToCollection],
|
|
7100
|
+
* }
|
|
7101
|
+
* ```
|
|
7102
|
+
*/
|
|
7103
|
+
Action["MoveToCollection"] = "moveToCollection";
|
|
7104
|
+
/**
|
|
7105
|
+
* Controls the visibility and disabled state of the "Remove" menu item in a
|
|
7106
|
+
* Collection.
|
|
7107
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7108
|
+
* @example
|
|
7109
|
+
* ```js
|
|
7110
|
+
* {
|
|
7111
|
+
* hiddenActions: [Action.RemoveFromCollection],
|
|
7112
|
+
* disabledActions: [Action.RemoveFromCollection],
|
|
7113
|
+
* }
|
|
7114
|
+
* ```
|
|
7115
|
+
*/
|
|
7116
|
+
Action["RemoveFromCollection"] = "removeFromCollection";
|
|
7117
|
+
/**
|
|
7118
|
+
* Controls the visibility and disabled state of the "Delete" menu item for a
|
|
7119
|
+
* Collection.
|
|
7120
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7121
|
+
* @example
|
|
7122
|
+
* ```js
|
|
7123
|
+
* {
|
|
7124
|
+
* hiddenActions: [Action.DeleteCollection],
|
|
7125
|
+
* disabledActions: [Action.DeleteCollection],
|
|
7126
|
+
* }
|
|
7127
|
+
* ```
|
|
7128
|
+
*/
|
|
7129
|
+
Action["DeleteCollection"] = "deleteCollection";
|
|
7130
|
+
/**
|
|
7131
|
+
* Controls the visibility of the "Customize homepage" button on the
|
|
7132
|
+
* embedded home page.
|
|
7133
|
+
* @version SDK: 1.55.0 | ThoughtSpot Cloud: 26.12.0.cl
|
|
7134
|
+
* @example
|
|
7135
|
+
* ```js
|
|
7136
|
+
* {
|
|
7137
|
+
* hiddenActions: [Action.CustomizeHomepage],
|
|
7138
|
+
* }
|
|
7139
|
+
* ```
|
|
7140
|
+
*/
|
|
7141
|
+
Action["CustomizeHomepage"] = "customizeHomepage";
|
|
6794
7142
|
})(Action || (Action = {}));
|
|
6795
7143
|
var PrefetchFeatures;
|
|
6796
7144
|
(function (PrefetchFeatures) {
|
|
@@ -7295,7 +7643,7 @@ var TableContentDensity;
|
|
|
7295
7643
|
TableContentDensity["Compact"] = "COMPACT";
|
|
7296
7644
|
})(TableContentDensity || (TableContentDensity = {}));
|
|
7297
7645
|
|
|
7298
|
-
var version$1="1.52.
|
|
7646
|
+
var version$1="1.52.2-beta";var pkg = {version:version$1};
|
|
7299
7647
|
|
|
7300
7648
|
const { version } = pkg;
|
|
7301
7649
|
|
|
@@ -7468,7 +7816,7 @@ const ERROR_MESSAGE = {
|
|
|
7468
7816
|
SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
|
|
7469
7817
|
UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
|
|
7470
7818
|
INVALID_SPOTTER_DOCUMENTATION_URL: 'Invalid spotterDocumentationUrl. Please provide a valid http or https URL.',
|
|
7471
|
-
UPDATEFILTERS_INVALID_PAYLOAD: 'UpdateFilters requires a valid filter or filters array. Expected: { filter: {
|
|
7819
|
+
UPDATEFILTERS_INVALID_PAYLOAD: 'UpdateFilters requires a valid filter or filters array. Expected: { filter: { columnName, operator, values } } or { filters: [{ columnName, operator, values }, ...] }',
|
|
7472
7820
|
DRILLDOWN_INVALID_PAYLOAD: 'DrillDown requires a valid points object. Expected: { points: { clickedPoint?, selectedPoints? }, autoDrillDown?, vizId? }',
|
|
7473
7821
|
UPDATEPARAMETERS_INVALID_PAYLOAD: 'UpdateParameters received an invalid applicability. Expected: { level: LIVEBOARD | TAB | GROUP, targetId } where targetId is required for TAB and GROUP levels',
|
|
7474
7822
|
};
|
|
@@ -8117,6 +8465,43 @@ const setParamIfDefined = (queryParams, param, value, asBoolean = false) => {
|
|
|
8117
8465
|
if (value !== undefined) {
|
|
8118
8466
|
queryParams[param] = asBoolean ? !!value : value;
|
|
8119
8467
|
}
|
|
8468
|
+
};
|
|
8469
|
+
/**
|
|
8470
|
+
* Calculates the element center for the currently visible viewport of the
|
|
8471
|
+
* element, using the scroll position of the host app, the offsetTop of the
|
|
8472
|
+
* element in the host app, and the viewport height of the tab.
|
|
8473
|
+
*
|
|
8474
|
+
* The returned keys are sent to the ThoughtSpot app over postMessage, so they
|
|
8475
|
+
* are named after the iframe and must not be renamed.
|
|
8476
|
+
* @param element The element to measure
|
|
8477
|
+
* @returns The element center within the visible viewport, the element height,
|
|
8478
|
+
* and the viewport height.
|
|
8479
|
+
*/
|
|
8480
|
+
const calculateElementCenter = (element) => {
|
|
8481
|
+
const offsetTopClient = getOffsetTop(element);
|
|
8482
|
+
const scrollTopClient = window.scrollY;
|
|
8483
|
+
const viewPortHeight = window.innerHeight;
|
|
8484
|
+
const iframeHeight = element.offsetHeight;
|
|
8485
|
+
const iframeScrolled = scrollTopClient - offsetTopClient;
|
|
8486
|
+
let iframeVisibleViewPort;
|
|
8487
|
+
let iframeOffset;
|
|
8488
|
+
if (iframeScrolled < 0) {
|
|
8489
|
+
iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
|
|
8490
|
+
iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
|
|
8491
|
+
iframeOffset = 0;
|
|
8492
|
+
}
|
|
8493
|
+
else {
|
|
8494
|
+
iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
|
|
8495
|
+
iframeOffset = iframeScrolled;
|
|
8496
|
+
}
|
|
8497
|
+
const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
|
|
8498
|
+
return {
|
|
8499
|
+
iframeCenter,
|
|
8500
|
+
iframeScrolled,
|
|
8501
|
+
iframeHeight,
|
|
8502
|
+
viewPortHeight,
|
|
8503
|
+
iframeVisibleViewPort,
|
|
8504
|
+
};
|
|
8120
8505
|
};
|
|
8121
8506
|
|
|
8122
8507
|
/**
|
|
@@ -8185,6 +8570,270 @@ const DEFAULT_EMBED_WIDTH = '100%';
|
|
|
8185
8570
|
const DEFAULT_EMBED_HEIGHT = '100%';
|
|
8186
8571
|
const DEFAULT_LAZY_LOADING_MARGIN = '500px 0px';
|
|
8187
8572
|
|
|
8573
|
+
/**
|
|
8574
|
+
* Copyright (c) 2025
|
|
8575
|
+
*
|
|
8576
|
+
* Full-height support for the Liveboard and app embeds.
|
|
8577
|
+
* @summary Full height
|
|
8578
|
+
*/
|
|
8579
|
+
/**
|
|
8580
|
+
* The height the embed falls back to when the host app has not configured
|
|
8581
|
+
* `minimumHeight` or `defaultHeight`.
|
|
8582
|
+
*/
|
|
8583
|
+
const DEFAULT_MINIMUM_HEIGHT = 500;
|
|
8584
|
+
/**
|
|
8585
|
+
* Routes that are part of the Liveboard experience itself. Navigating between
|
|
8586
|
+
* these does not reset the frame height, because the ThoughtSpot app keeps
|
|
8587
|
+
* reporting a height of its own for them.
|
|
8588
|
+
*/
|
|
8589
|
+
const LIVEBOARD_RELATED_ROUTES = [
|
|
8590
|
+
'/pinboard/',
|
|
8591
|
+
'/insights/pinboard/',
|
|
8592
|
+
'/schedules/',
|
|
8593
|
+
'/embed/viz/',
|
|
8594
|
+
'/embed/insights/viz/',
|
|
8595
|
+
'/liveboard/',
|
|
8596
|
+
'/insights/liveboard/',
|
|
8597
|
+
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
8598
|
+
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
8599
|
+
];
|
|
8600
|
+
/**
|
|
8601
|
+
* Owns every piece of full-height behavior for an embed: the height
|
|
8602
|
+
* negotiation with the ThoughtSpot app, the query parameters that switch the
|
|
8603
|
+
* feature on, and the viewport listeners that drive lazy loading.
|
|
8604
|
+
*
|
|
8605
|
+
* The controller is inert unless `fullHeight` is enabled, so embeds can create
|
|
8606
|
+
* one unconditionally.
|
|
8607
|
+
*/
|
|
8608
|
+
class FullHeightController {
|
|
8609
|
+
constructor(viewConfig, host) {
|
|
8610
|
+
this.host = host;
|
|
8611
|
+
this.scrollContainers = [];
|
|
8612
|
+
/**
|
|
8613
|
+
* Sets the frame height to the height reported by the ThoughtSpot app,
|
|
8614
|
+
* never going below the configured minimum.
|
|
8615
|
+
*/
|
|
8616
|
+
this.handleEmbedHeight = (payload) => {
|
|
8617
|
+
const height = Number(payload === null || payload === void 0 ? void 0 : payload.data);
|
|
8618
|
+
if (!isNaN(height)) {
|
|
8619
|
+
this.host.setFrameHeight(Math.max(height, this.minimumHeight));
|
|
8620
|
+
}
|
|
8621
|
+
this.sendVisibleCoordinates();
|
|
8622
|
+
};
|
|
8623
|
+
/**
|
|
8624
|
+
* Answers the app's request for the center of the visible embed region.
|
|
8625
|
+
*/
|
|
8626
|
+
this.handleEmbedIframeCenter = (payload, responder) => {
|
|
8627
|
+
const iframe = this.host.getIframe();
|
|
8628
|
+
if (!iframe) {
|
|
8629
|
+
return;
|
|
8630
|
+
}
|
|
8631
|
+
responder === null || responder === void 0 ? void 0 : responder({
|
|
8632
|
+
type: EmbedEvent.EmbedIframeCenter,
|
|
8633
|
+
data: calculateElementCenter(iframe),
|
|
8634
|
+
});
|
|
8635
|
+
};
|
|
8636
|
+
/**
|
|
8637
|
+
* Answers the app's request for the currently visible embed coordinates.
|
|
8638
|
+
*/
|
|
8639
|
+
this.handleRequestVisibleCoordinates = (payload, responder) => {
|
|
8640
|
+
logger$3.info('Sending RequestVisibleEmbedCoordinates', payload);
|
|
8641
|
+
responder === null || responder === void 0 ? void 0 : responder({
|
|
8642
|
+
type: EmbedEvent.RequestVisibleEmbedCoordinates,
|
|
8643
|
+
data: this.getVisibleCoordinates(),
|
|
8644
|
+
});
|
|
8645
|
+
};
|
|
8646
|
+
/**
|
|
8647
|
+
* Resets the frame height when the app navigates away from a Liveboard,
|
|
8648
|
+
* since only Liveboard routes report a height of their own.
|
|
8649
|
+
*/
|
|
8650
|
+
this.handleRouteChange = (payload) => {
|
|
8651
|
+
var _a, _b;
|
|
8652
|
+
const currentPath = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.currentPath;
|
|
8653
|
+
if (!currentPath) {
|
|
8654
|
+
return;
|
|
8655
|
+
}
|
|
8656
|
+
if (LIVEBOARD_RELATED_ROUTES.some((route) => currentPath.startsWith(route))) {
|
|
8657
|
+
return;
|
|
8658
|
+
}
|
|
8659
|
+
this.host.setFrameHeight(((_b = this.config.frameParams) === null || _b === void 0 ? void 0 : _b.height) || this.minimumHeight);
|
|
8660
|
+
};
|
|
8661
|
+
/**
|
|
8662
|
+
* Pushes the visible embed region to the app so it can decide which
|
|
8663
|
+
* visualizations to load.
|
|
8664
|
+
*/
|
|
8665
|
+
this.sendVisibleCoordinates = () => {
|
|
8666
|
+
if (!this.isLazyLoadEnabled) {
|
|
8667
|
+
return;
|
|
8668
|
+
}
|
|
8669
|
+
const coordinates = this.getVisibleCoordinates();
|
|
8670
|
+
if (coordinates) {
|
|
8671
|
+
this.host.trigger(HostEvent.VisibleEmbedCoordinates, coordinates);
|
|
8672
|
+
}
|
|
8673
|
+
};
|
|
8674
|
+
this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
|
|
8675
|
+
this.registerEventHandlers();
|
|
8676
|
+
}
|
|
8677
|
+
/**
|
|
8678
|
+
* The view config the controller runs on: the host app's own config with
|
|
8679
|
+
* the lazy-loading defaults filled in. Read-only, so the only way to change
|
|
8680
|
+
* it is through the setter, which re-resolves the defaults.
|
|
8681
|
+
*/
|
|
8682
|
+
get viewConfig() {
|
|
8683
|
+
return this.config;
|
|
8684
|
+
}
|
|
8685
|
+
/**
|
|
8686
|
+
* Replaces the view config the controller runs on and re-resolves the
|
|
8687
|
+
* lazy-loading defaults against it. The config the caller passes is never
|
|
8688
|
+
* written to; the controller keeps a copy of its own.
|
|
8689
|
+
*/
|
|
8690
|
+
set viewConfig(viewConfig) {
|
|
8691
|
+
this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
|
|
8692
|
+
}
|
|
8693
|
+
/**
|
|
8694
|
+
* The view config with the lazy-loading settings the embed falls back to
|
|
8695
|
+
* when the host app has not chosen its own.
|
|
8696
|
+
*
|
|
8697
|
+
* Pure by design: it returns a new config rather than writing to the one it
|
|
8698
|
+
* is given, so the host app's object is left untouched.
|
|
8699
|
+
* @param viewConfig The embed's view config
|
|
8700
|
+
* @returns A copy with the defaults filled in, host app choices preserved
|
|
8701
|
+
*/
|
|
8702
|
+
static withLazyLoadingDefaults(viewConfig) {
|
|
8703
|
+
return {
|
|
8704
|
+
...viewConfig,
|
|
8705
|
+
lazyLoadingForFullHeight: viewConfig.lazyLoadingForFullHeight === undefined
|
|
8706
|
+
? true
|
|
8707
|
+
: viewConfig.lazyLoadingForFullHeight,
|
|
8708
|
+
enableScrollableContainerLazyLoading: viewConfig.enableScrollableContainerLazyLoading === undefined
|
|
8709
|
+
? true
|
|
8710
|
+
: viewConfig.enableScrollableContainerLazyLoading,
|
|
8711
|
+
lazyLoadingMargin: viewConfig.lazyLoadingMargin === undefined
|
|
8712
|
+
? DEFAULT_LAZY_LOADING_MARGIN
|
|
8713
|
+
: viewConfig.lazyLoadingMargin,
|
|
8714
|
+
};
|
|
8715
|
+
}
|
|
8716
|
+
/**
|
|
8717
|
+
* Whether the host app asked for a full-height embed.
|
|
8718
|
+
*/
|
|
8719
|
+
get isEnabled() {
|
|
8720
|
+
return this.config.fullHeight === true;
|
|
8721
|
+
}
|
|
8722
|
+
/**
|
|
8723
|
+
* Whether visualizations should load as they scroll into view, which
|
|
8724
|
+
* requires the SDK to report the visible region of the embed.
|
|
8725
|
+
*/
|
|
8726
|
+
get isLazyLoadEnabled() {
|
|
8727
|
+
return this.isEnabled && !!this.config.lazyLoadingForFullHeight;
|
|
8728
|
+
}
|
|
8729
|
+
/**
|
|
8730
|
+
* The floor for the frame height. `defaultHeight` is the deprecated
|
|
8731
|
+
* spelling of `minimumHeight` and is still honored for compatibility.
|
|
8732
|
+
*/
|
|
8733
|
+
get minimumHeight() {
|
|
8734
|
+
const { minimumHeight, defaultHeight } = this.config;
|
|
8735
|
+
return minimumHeight || defaultHeight || DEFAULT_MINIMUM_HEIGHT;
|
|
8736
|
+
}
|
|
8737
|
+
/**
|
|
8738
|
+
* Registers the embed event handlers the feature depends on. Called from
|
|
8739
|
+
* the constructor, so the handlers are in place before `render`.
|
|
8740
|
+
*/
|
|
8741
|
+
registerEventHandlers() {
|
|
8742
|
+
if (!this.isEnabled) {
|
|
8743
|
+
return;
|
|
8744
|
+
}
|
|
8745
|
+
this.host.on(EmbedEvent.RouteChange, this.handleRouteChange);
|
|
8746
|
+
this.host.on(EmbedEvent.EmbedHeight, this.handleEmbedHeight);
|
|
8747
|
+
this.host.on(EmbedEvent.EmbedIframeCenter, this.handleEmbedIframeCenter);
|
|
8748
|
+
this.host.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.handleRequestVisibleCoordinates);
|
|
8749
|
+
}
|
|
8750
|
+
/**
|
|
8751
|
+
* Adds the full-height query parameters to the embed URL params.
|
|
8752
|
+
* @param params The query parameters being built by the embed
|
|
8753
|
+
*/
|
|
8754
|
+
addQueryParams(params) {
|
|
8755
|
+
if (!this.isEnabled) {
|
|
8756
|
+
return;
|
|
8757
|
+
}
|
|
8758
|
+
params[Param.fullHeight] = true;
|
|
8759
|
+
if (!this.config.lazyLoadingForFullHeight) {
|
|
8760
|
+
return;
|
|
8761
|
+
}
|
|
8762
|
+
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
8763
|
+
if (isValidCssMargin(this.config.lazyLoadingMargin)) {
|
|
8764
|
+
params[Param.RootMarginForLazyLoad] = this.config.lazyLoadingMargin;
|
|
8765
|
+
}
|
|
8766
|
+
}
|
|
8767
|
+
/**
|
|
8768
|
+
* Attaches the viewport listeners that keep lazy loading in sync. Call this
|
|
8769
|
+
* once the embed has rendered and the iframe exists.
|
|
8770
|
+
*/
|
|
8771
|
+
onRender() {
|
|
8772
|
+
this.registerLazyLoadListeners();
|
|
8773
|
+
}
|
|
8774
|
+
/**
|
|
8775
|
+
* Detaches every listener and observer owned by the controller.
|
|
8776
|
+
*/
|
|
8777
|
+
destroy() {
|
|
8778
|
+
this.unregisterLazyLoadListeners();
|
|
8779
|
+
}
|
|
8780
|
+
getVisibleCoordinates() {
|
|
8781
|
+
const iframe = this.host.getIframe();
|
|
8782
|
+
if (!iframe) {
|
|
8783
|
+
return null;
|
|
8784
|
+
}
|
|
8785
|
+
return calculateVisibleElementData(iframe, this.config.enableScrollableContainerLazyLoading);
|
|
8786
|
+
}
|
|
8787
|
+
registerLazyLoadListeners() {
|
|
8788
|
+
if (!this.isLazyLoadEnabled || !this.host.getIframe()) {
|
|
8789
|
+
return;
|
|
8790
|
+
}
|
|
8791
|
+
// Re-registering is safe: drop whatever a previous render attached.
|
|
8792
|
+
this.unregisterLazyLoadListeners();
|
|
8793
|
+
// TODO: Use passive: true, install modernizr to check for passive
|
|
8794
|
+
window.addEventListener('resize', this.sendVisibleCoordinates);
|
|
8795
|
+
window.addEventListener('scroll', this.sendVisibleCoordinates, true);
|
|
8796
|
+
if (!this.config.enableScrollableContainerLazyLoading) {
|
|
8797
|
+
return;
|
|
8798
|
+
}
|
|
8799
|
+
this.observeScrollableContainers();
|
|
8800
|
+
}
|
|
8801
|
+
/**
|
|
8802
|
+
* Tracks the ancestors that can scroll or clip the embed, so the visible
|
|
8803
|
+
* region stays correct when the embed lives inside its own scroll
|
|
8804
|
+
* container rather than the page.
|
|
8805
|
+
*/
|
|
8806
|
+
observeScrollableContainers() {
|
|
8807
|
+
const iFrame = this.host.getIframe();
|
|
8808
|
+
this.scrollContainers = getScrollableAncestors(iFrame);
|
|
8809
|
+
this.scrollContainers.forEach((scrollContainer) => {
|
|
8810
|
+
scrollContainer.addEventListener('scroll', this.sendVisibleCoordinates);
|
|
8811
|
+
});
|
|
8812
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
8813
|
+
return;
|
|
8814
|
+
}
|
|
8815
|
+
const resizeTargets = new Set([iFrame.parentElement, ...getEffectiveClippingAncestors(iFrame)].filter(Boolean));
|
|
8816
|
+
this.resizeObserver = new ResizeObserver(this.sendVisibleCoordinates);
|
|
8817
|
+
resizeTargets.forEach((resizeTarget) => {
|
|
8818
|
+
this.resizeObserver.observe(resizeTarget);
|
|
8819
|
+
});
|
|
8820
|
+
}
|
|
8821
|
+
unregisterLazyLoadListeners() {
|
|
8822
|
+
var _a;
|
|
8823
|
+
if (!this.isLazyLoadEnabled) {
|
|
8824
|
+
return;
|
|
8825
|
+
}
|
|
8826
|
+
window.removeEventListener('resize', this.sendVisibleCoordinates);
|
|
8827
|
+
window.removeEventListener('scroll', this.sendVisibleCoordinates, true);
|
|
8828
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
8829
|
+
this.resizeObserver = undefined;
|
|
8830
|
+
this.scrollContainers.forEach((scrollContainer) => {
|
|
8831
|
+
scrollContainer.removeEventListener('scroll', this.sendVisibleCoordinates);
|
|
8832
|
+
});
|
|
8833
|
+
this.scrollContainers = [];
|
|
8834
|
+
}
|
|
8835
|
+
}
|
|
8836
|
+
|
|
8188
8837
|
/** Used for built-in method references. */
|
|
8189
8838
|
var objectProto$d = Object.prototype;
|
|
8190
8839
|
|
|
@@ -9093,7 +9742,110 @@ var UIPassthroughEvent;
|
|
|
9093
9742
|
UIPassthroughEvent["GetTabs"] = "getTabs";
|
|
9094
9743
|
UIPassthroughEvent["GetGroups"] = "getGroups";
|
|
9095
9744
|
UIPassthroughEvent["GetExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
|
|
9096
|
-
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
9745
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
9746
|
+
// NOTE: HostEventRequest / HostEventResponse / TriggerPayload / TriggerResponse
|
|
9747
|
+
// live in the sibling ./host-event-contracts, which layers the
|
|
9748
|
+
// HostEventRequestMap on top of the UI-passthrough mapping above.
|
|
9749
|
+
// The former 2-tier definitions that lived here were superseded and removed.
|
|
9750
|
+
|
|
9751
|
+
/**
|
|
9752
|
+
* Copyright (c) 2026
|
|
9753
|
+
*
|
|
9754
|
+
* Dedicated transport layer for SDK <-> ThoughtSpot iframe messaging.
|
|
9755
|
+
*
|
|
9756
|
+
* Owns the postMessage/MessageChannel mechanics and origin resolution so
|
|
9757
|
+
* that embed/business logic (ts-embed.ts, hostEventClient) never touches
|
|
9758
|
+
* the wire directly. The wire format is unchanged from the historical
|
|
9759
|
+
* implementation — this layer is a pure structural extraction.
|
|
9760
|
+
*/
|
|
9761
|
+
/**
|
|
9762
|
+
* Default time to wait for the app to respond to a request-response
|
|
9763
|
+
* message before giving up and reclaiming the channel.
|
|
9764
|
+
*/
|
|
9765
|
+
const MESSAGE_RESPONSE_TIMEOUT = 30000;
|
|
9766
|
+
/**
|
|
9767
|
+
* Single implementation of origin resolution for the embedded app.
|
|
9768
|
+
* Returns the origin (scheme://host[:port]) for a ThoughtSpot host URL,
|
|
9769
|
+
* or null when it cannot be parsed.
|
|
9770
|
+
* @param thoughtSpotHost
|
|
9771
|
+
*/
|
|
9772
|
+
const resolveMessageOrigin = (thoughtSpotHost) => {
|
|
9773
|
+
try {
|
|
9774
|
+
return new URL(thoughtSpotHost).origin;
|
|
9775
|
+
}
|
|
9776
|
+
catch (e) {
|
|
9777
|
+
return null;
|
|
9778
|
+
}
|
|
9779
|
+
};
|
|
9780
|
+
/**
|
|
9781
|
+
* Validates that an inbound window message came from the embedded
|
|
9782
|
+
* ThoughtSpot app: the source window must be the embed iframe's window and,
|
|
9783
|
+
* when the expected origin is resolvable, the message origin must match it.
|
|
9784
|
+
*
|
|
9785
|
+
* Fails open (returns true) on the origin check when the expected origin
|
|
9786
|
+
* cannot be resolved, to avoid breaking unconventional-but-working setups;
|
|
9787
|
+
* a warning is logged on mismatch either way.
|
|
9788
|
+
* @param event The message event received on window.
|
|
9789
|
+
* @param iFrame The embed iframe the message should originate from.
|
|
9790
|
+
* @param thoughtSpotHost The configured ThoughtSpot host.
|
|
9791
|
+
*/
|
|
9792
|
+
const isMessageFromIframe = (event, iFrame, thoughtSpotHost) => {
|
|
9793
|
+
if (event.source !== (iFrame === null || iFrame === void 0 ? void 0 : iFrame.contentWindow)) {
|
|
9794
|
+
return false;
|
|
9795
|
+
}
|
|
9796
|
+
const expectedOrigin = resolveMessageOrigin(thoughtSpotHost);
|
|
9797
|
+
if (expectedOrigin && event.origin && event.origin !== expectedOrigin) {
|
|
9798
|
+
logger$3.warn(`Dropped message from unexpected origin ${event.origin}; expected ${expectedOrigin}`);
|
|
9799
|
+
return false;
|
|
9800
|
+
}
|
|
9801
|
+
return true;
|
|
9802
|
+
};
|
|
9803
|
+
/**
|
|
9804
|
+
* Posts a one-way message to the embedded app's iframe, optionally
|
|
9805
|
+
* transferring a MessageChannel port for the response.
|
|
9806
|
+
* @param iFrame
|
|
9807
|
+
* @param message
|
|
9808
|
+
* @param thoughtSpotHost Used as the postMessage targetOrigin.
|
|
9809
|
+
* @param channel
|
|
9810
|
+
*/
|
|
9811
|
+
const postMessageToIframe = (iFrame, message, thoughtSpotHost, channel) => {
|
|
9812
|
+
var _a;
|
|
9813
|
+
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, channel ? [channel.port2] : []);
|
|
9814
|
+
};
|
|
9815
|
+
/**
|
|
9816
|
+
* Sends a request-response message to the embedded app over a dedicated
|
|
9817
|
+
* MessageChannel. Resolves with the response payload; rejects when the app
|
|
9818
|
+
* responds with an error; resolves with a timeout Error object when no
|
|
9819
|
+
* response arrives in time (historical behavior, preserved for backward
|
|
9820
|
+
* compatibility).
|
|
9821
|
+
* @param iFrame
|
|
9822
|
+
* @param message
|
|
9823
|
+
* @param thoughtSpotHost
|
|
9824
|
+
* @param timeoutMs
|
|
9825
|
+
*/
|
|
9826
|
+
function sendMessageWithResponse(iFrame, message, thoughtSpotHost, timeoutMs = MESSAGE_RESPONSE_TIMEOUT) {
|
|
9827
|
+
return new Promise((res, rej) => {
|
|
9828
|
+
const channel = new MessageChannel();
|
|
9829
|
+
// Close the messageChannel and resolve the promise if timeout.
|
|
9830
|
+
const timeoutId = setTimeout(() => {
|
|
9831
|
+
channel.port1.close();
|
|
9832
|
+
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
9833
|
+
}, timeoutMs);
|
|
9834
|
+
channel.port1.onmessage = ({ data: responseData }) => {
|
|
9835
|
+
var _a;
|
|
9836
|
+
clearTimeout(timeoutId);
|
|
9837
|
+
channel.port1.close();
|
|
9838
|
+
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);
|
|
9839
|
+
if (error) {
|
|
9840
|
+
rej(error);
|
|
9841
|
+
}
|
|
9842
|
+
else {
|
|
9843
|
+
res(responseData);
|
|
9844
|
+
}
|
|
9845
|
+
};
|
|
9846
|
+
postMessageToIframe(iFrame, message, thoughtSpotHost, channel);
|
|
9847
|
+
});
|
|
9848
|
+
}
|
|
9097
9849
|
|
|
9098
9850
|
const EndPoints = {
|
|
9099
9851
|
AUTH_VERIFICATION: '/callosum/v1/session/info',
|
|
@@ -10027,7 +10779,7 @@ class AnswerService {
|
|
|
10027
10779
|
async getTML() {
|
|
10028
10780
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
10029
10781
|
const edoc = object[0].edoc;
|
|
10030
|
-
const YAML = await import('./index-
|
|
10782
|
+
const YAML = await import('./index-CcBYlGo9.js');
|
|
10031
10783
|
const parsedDoc = YAML.parse(edoc);
|
|
10032
10784
|
return {
|
|
10033
10785
|
answer: {
|
|
@@ -20261,27 +21013,15 @@ if (typeof Promise.withResolvers === 'undefined') {
|
|
|
20261
21013
|
const reload = (iFrame) => {
|
|
20262
21014
|
const src = iFrame.src;
|
|
20263
21015
|
iFrame.src = '';
|
|
20264
|
-
setTimeout(() => {
|
|
20265
|
-
iFrame.src = src;
|
|
20266
|
-
}, 100);
|
|
20267
|
-
};
|
|
20268
|
-
|
|
20269
|
-
* Post iframe message.
|
|
20270
|
-
* @param iFrame
|
|
20271
|
-
* @param message
|
|
20272
|
-
* @param message.type
|
|
20273
|
-
* @param message.data
|
|
20274
|
-
* @param message.context
|
|
20275
|
-
* @param thoughtSpotHost
|
|
20276
|
-
* @param channel
|
|
20277
|
-
*/
|
|
20278
|
-
function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
|
|
20279
|
-
var _a;
|
|
20280
|
-
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
|
|
20281
|
-
}
|
|
20282
|
-
const TRIGGER_TIMEOUT = 30000;
|
|
21016
|
+
setTimeout(() => {
|
|
21017
|
+
iFrame.src = src;
|
|
21018
|
+
}, 100);
|
|
21019
|
+
};
|
|
21020
|
+
const TRIGGER_TIMEOUT = MESSAGE_RESPONSE_TIMEOUT;
|
|
20283
21021
|
/**
|
|
20284
|
-
*
|
|
21022
|
+
* Processes a host event trigger: handles SDK-local events (Reload,
|
|
21023
|
+
* Present) and forwards everything else to the embedded app over the
|
|
21024
|
+
* iframe transport.
|
|
20285
21025
|
* @param iFrame
|
|
20286
21026
|
* @param messageType
|
|
20287
21027
|
* @param thoughtSpotHost
|
|
@@ -20289,42 +21029,22 @@ const TRIGGER_TIMEOUT = 30000;
|
|
|
20289
21029
|
* @param context
|
|
20290
21030
|
*/
|
|
20291
21031
|
function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
|
|
20292
|
-
|
|
20293
|
-
|
|
20294
|
-
|
|
20295
|
-
|
|
20296
|
-
|
|
20297
|
-
|
|
20298
|
-
|
|
20299
|
-
|
|
20300
|
-
|
|
20301
|
-
|
|
20302
|
-
handlePresentEvent(iFrame);
|
|
20303
|
-
}
|
|
20304
|
-
else {
|
|
20305
|
-
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
20306
|
-
}
|
|
21032
|
+
var _a;
|
|
21033
|
+
if (messageType === HostEvent.Reload) {
|
|
21034
|
+
reload(iFrame);
|
|
21035
|
+
return Promise.resolve(null);
|
|
21036
|
+
}
|
|
21037
|
+
if (messageType === HostEvent.Present) {
|
|
21038
|
+
const embedConfig = getEmbedConfig();
|
|
21039
|
+
const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
|
|
21040
|
+
if (!disableFullscreenPresentation) {
|
|
21041
|
+
handlePresentEvent(iFrame);
|
|
20307
21042
|
}
|
|
20308
|
-
|
|
20309
|
-
|
|
20310
|
-
|
|
20311
|
-
|
|
20312
|
-
|
|
20313
|
-
}, TRIGGER_TIMEOUT);
|
|
20314
|
-
channel.port1.onmessage = ({ data: responseData }) => {
|
|
20315
|
-
var _a;
|
|
20316
|
-
clearTimeout(timeoutId);
|
|
20317
|
-
channel.port1.close();
|
|
20318
|
-
const error = (responseData === null || responseData === void 0 ? void 0 : responseData.error) || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
|
|
20319
|
-
if (error) {
|
|
20320
|
-
rej(error);
|
|
20321
|
-
}
|
|
20322
|
-
else {
|
|
20323
|
-
res(responseData);
|
|
20324
|
-
}
|
|
20325
|
-
};
|
|
20326
|
-
return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
|
|
20327
|
-
});
|
|
21043
|
+
else {
|
|
21044
|
+
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
21045
|
+
}
|
|
21046
|
+
}
|
|
21047
|
+
return sendMessageWithResponse(iFrame, { type: messageType, data, context }, thoughtSpotHost, TRIGGER_TIMEOUT);
|
|
20328
21048
|
}
|
|
20329
21049
|
|
|
20330
21050
|
/**
|
|
@@ -20968,7 +21688,8 @@ var isUndefined_1 = isUndefined;
|
|
|
20968
21688
|
const isValidApplicability = (a) => {
|
|
20969
21689
|
if (isUndefined_1(a))
|
|
20970
21690
|
return true;
|
|
20971
|
-
// targetId is not required at LIVEBOARD level, since the filter applies to
|
|
21691
|
+
// targetId is not required at LIVEBOARD level, since the filter applies to
|
|
21692
|
+
// the whole Liveboard
|
|
20972
21693
|
return isPlainObject_1(a)
|
|
20973
21694
|
&& Object.values(ApplicabilityLevel).includes(a.level)
|
|
20974
21695
|
&& (a.level === ApplicabilityLevel.Liveboard || (isString_1(a.targetId) && a.targetId.trim().length > 0));
|
|
@@ -20987,8 +21708,52 @@ function isValidUpdateFiltersPayload(payload) {
|
|
|
20987
21708
|
const hasValidFilters = Array.isArray(payload.filters) && payload.filters.length > 0 && payload.filters.every(isValidFilter);
|
|
20988
21709
|
return !!(hasValidFilter || hasValidFilters);
|
|
20989
21710
|
}
|
|
21711
|
+
/**
|
|
21712
|
+
* Rewrites one filter's `columnName`/`operator` to `column`/`oper`.
|
|
21713
|
+
*
|
|
21714
|
+
* Callers may use either spelling: `columnName`/`operator` match
|
|
21715
|
+
* {@link RuntimeFilter} and the `EmbedEvent.FilterChanged` payload, so a
|
|
21716
|
+
* converted payload can be replayed as-is. But the payload is forwarded to the
|
|
21717
|
+
* embedded app unchanged, and only `column`/`oper` are known to be understood
|
|
21718
|
+
* there - so the alias must be swapped here, or it would pass validation and
|
|
21719
|
+
* then be silently ignored.
|
|
21720
|
+
*
|
|
21721
|
+
* If a caller supplies both spellings of a field - which TypeScript rejects,
|
|
21722
|
+
* but JavaScript callers can still do - the documented `columnName`/`operator`
|
|
21723
|
+
* wins. Deferring to the deprecated spelling would quietly discard the value
|
|
21724
|
+
* the rest of the SDK tells people to use.
|
|
21725
|
+
* @param filter One entry from the UpdateFilters payload.
|
|
21726
|
+
*/
|
|
21727
|
+
function resolveFilterAliases(filter) {
|
|
21728
|
+
var _a, _b;
|
|
21729
|
+
if (!isPlainObject_1(filter))
|
|
21730
|
+
return filter;
|
|
21731
|
+
const column = (_a = filter.columnName) !== null && _a !== void 0 ? _a : filter.column;
|
|
21732
|
+
const oper = (_b = filter.operator) !== null && _b !== void 0 ? _b : filter.oper;
|
|
21733
|
+
const { columnName, operator, ...rest } = filter;
|
|
21734
|
+
return {
|
|
21735
|
+
...rest,
|
|
21736
|
+
...(isUndefined_1(column) ? {} : { column }),
|
|
21737
|
+
...(isUndefined_1(oper) ? {} : { oper }),
|
|
21738
|
+
};
|
|
21739
|
+
}
|
|
21740
|
+
/**
|
|
21741
|
+
* Rewrites every filter in an UpdateFilters payload to use `column`/`oper`,
|
|
21742
|
+
* whichever spelling the caller supplied. Call after validation.
|
|
21743
|
+
* @param payload The UpdateFilters host event payload.
|
|
21744
|
+
*/
|
|
21745
|
+
function resolveUpdateFiltersAliases(payload) {
|
|
21746
|
+
if (!isPlainObject_1(payload))
|
|
21747
|
+
return payload;
|
|
21748
|
+
return {
|
|
21749
|
+
...payload,
|
|
21750
|
+
...(payload.filter ? { filter: resolveFilterAliases(payload.filter) } : {}),
|
|
21751
|
+
...(Array.isArray(payload.filters) ? { filters: payload.filters.map(resolveFilterAliases) } : {}),
|
|
21752
|
+
};
|
|
21753
|
+
}
|
|
20990
21754
|
function isValidUpdateParametersPayload(payload) {
|
|
20991
|
-
// Only validates the applicability of each parameter (null treated as
|
|
21755
|
+
// Only validates the applicability of each parameter (null treated as
|
|
21756
|
+
// absent); the rest is forwarded as-is for backward compatibility.
|
|
20992
21757
|
if (!Array.isArray(payload))
|
|
20993
21758
|
return true;
|
|
20994
21759
|
return payload.every((p) => {
|
|
@@ -21036,7 +21801,8 @@ function throwUpdateParametersValidationError() {
|
|
|
21036
21801
|
/**
|
|
21037
21802
|
* Maps HostEvent to its corresponding UIPassthroughEvent.
|
|
21038
21803
|
* Includes both custom-handler events (Pin, SaveAnswer, UpdateFilters, DrillDown)
|
|
21039
|
-
* and getter events (GetAnswerSession, GetFilters, etc.) that use
|
|
21804
|
+
* and getter events (GetAnswerSession, GetFilters, etc.) that use
|
|
21805
|
+
* getDataWithPassthroughFallback.
|
|
21040
21806
|
*/
|
|
21041
21807
|
const PASSTHROUGH_MAP = {
|
|
21042
21808
|
// Custom handlers (setters with special logic)
|
|
@@ -21186,13 +21952,22 @@ class HostEventClient {
|
|
|
21186
21952
|
if (!isValidUpdateFiltersPayload(payload)) {
|
|
21187
21953
|
throwUpdateFiltersValidationError();
|
|
21188
21954
|
}
|
|
21189
|
-
|
|
21955
|
+
// The shared contract accepts both current (columnName/operator) and
|
|
21956
|
+
// legacy (column/oper) filter field names, but only the legacy pair is
|
|
21957
|
+
// understood downstream, so the payload is rewritten before it is
|
|
21958
|
+
// forwarded — otherwise a columnName/operator filter passes validation
|
|
21959
|
+
// here and is then silently ignored by the app. The cast bridges the
|
|
21960
|
+
// UIPassthrough FilterUpdate type, which still declares only the legacy
|
|
21961
|
+
// names.
|
|
21962
|
+
const resolvedPayload = resolveUpdateFiltersAliases(payload);
|
|
21963
|
+
return this.handleHostEventWithParam(UIPassthroughEvent.UpdateFilters, resolvedPayload, context);
|
|
21190
21964
|
}
|
|
21191
21965
|
handleUpdateParametersEvent(payload, context) {
|
|
21192
21966
|
if (!isValidUpdateParametersPayload(payload)) {
|
|
21193
21967
|
throwUpdateParametersValidationError();
|
|
21194
21968
|
}
|
|
21195
|
-
// UpdateParameters has no UI passthrough contract; dispatch over the
|
|
21969
|
+
// UpdateParameters has no UI passthrough contract; dispatch over the
|
|
21970
|
+
// legacy channel
|
|
21196
21971
|
return this.hostEventFallback(HostEvent.UpdateParameters, payload, context);
|
|
21197
21972
|
}
|
|
21198
21973
|
handleDrillDownEvent(payload, context) {
|
|
@@ -21203,8 +21978,8 @@ class HostEventClient {
|
|
|
21203
21978
|
}
|
|
21204
21979
|
/**
|
|
21205
21980
|
* Dispatches a host event using the appropriate channel:
|
|
21206
|
-
* 1. If the embedded app supports UI passthrough for this event, use it (custom
|
|
21207
|
-
* 2. Otherwise fall back to the legacy host event channel.
|
|
21981
|
+
* 1. If the embedded app supports UI passthrough for this event, use it (custom
|
|
21982
|
+
* handler or getter). 2. Otherwise fall back to the legacy host event channel.
|
|
21208
21983
|
*
|
|
21209
21984
|
* @param hostEvent - The host event to trigger
|
|
21210
21985
|
* @param payload - Optional payload for the event
|
|
@@ -21213,7 +21988,8 @@ class HostEventClient {
|
|
|
21213
21988
|
async triggerHostEvent(hostEvent, payload, context) {
|
|
21214
21989
|
const customHandler = this.customHandlers[hostEvent];
|
|
21215
21990
|
const passthroughEvent = PASSTHROUGH_MAP[hostEvent];
|
|
21216
|
-
// If embedded app supports passthrough but not this event, use legacy
|
|
21991
|
+
// If embedded app supports passthrough but not this event, use legacy
|
|
21992
|
+
// channel
|
|
21217
21993
|
const keys = passthroughEvent ? await this.getAvailableUIPassthroughKeys(context) : [];
|
|
21218
21994
|
if (passthroughEvent && keys.length > 0 && !keys.includes(passthroughEvent)) {
|
|
21219
21995
|
return this.hostEventFallback(hostEvent, payload, context);
|
|
@@ -21420,6 +22196,63 @@ const TS_EMBED_ID = '_thoughtspot-embed';
|
|
|
21420
22196
|
*/
|
|
21421
22197
|
const PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY = 'tsEmbedOriginalPosition';
|
|
21422
22198
|
const PRERENDER_WRAPPER_ID_PREFIX = 'tsEmbed-pre-render-wrapper-';
|
|
22199
|
+
// The container applies UpdateEmbedParams through React state, so a delivered
|
|
22200
|
+
// post is not the same as the params being in effect.
|
|
22201
|
+
const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
|
|
22202
|
+
// The container ignores runtimeFilterParams/runtimeParameterParams unless
|
|
22203
|
+
// truthy, so null or '' leaves the previous embed's values in place. '&' is
|
|
22204
|
+
// truthy and parses to {}.
|
|
22205
|
+
const NO_RUNTIME_PARAMS = '&';
|
|
22206
|
+
/**
|
|
22207
|
+
* Query parameters that stay on the iframe `src` while config is excluded from
|
|
22208
|
+
* the URL, which is the default unless the embed sets the
|
|
22209
|
+
* `excludeConfigFromURL` additional flag to `false`. These are the parameters the
|
|
22210
|
+
* application shell needs before it can receive a postMessage at all: the
|
|
22211
|
+
* embed marker, the host application URL used to validate the message origin,
|
|
22212
|
+
* the SDK version, the flags that pick the authentication flow, and the
|
|
22213
|
+
* boot-time settings that would otherwise be applied a frame late (viewport,
|
|
22214
|
+
* log level, locale, formatting and org). Everything else is delivered over
|
|
22215
|
+
* `HostEvent.UpdateEmbedParams`.
|
|
22216
|
+
* @internal
|
|
22217
|
+
*/
|
|
22218
|
+
const BOOTSTRAP_URL_PARAMS = new Set([
|
|
22219
|
+
Param.EmbedApp,
|
|
22220
|
+
Param.HostAppUrl,
|
|
22221
|
+
Param.Version,
|
|
22222
|
+
Param.AuthType,
|
|
22223
|
+
Param.AutoLogin,
|
|
22224
|
+
Param.DisableLoginRedirect,
|
|
22225
|
+
Param.ForceSAMLAutoRedirect,
|
|
22226
|
+
Param.cookieless,
|
|
22227
|
+
Param.preAuthCache,
|
|
22228
|
+
Param.blockNonEmbedFullAppAccess,
|
|
22229
|
+
Param.OverrideOrgId,
|
|
22230
|
+
Param.ViewPortHeight,
|
|
22231
|
+
Param.ViewPortWidth,
|
|
22232
|
+
Param.ClientLogLevel,
|
|
22233
|
+
Param.OverrideNativeConsole,
|
|
22234
|
+
Param.PendoTrackingKey,
|
|
22235
|
+
Param.NumberFormatLocale,
|
|
22236
|
+
Param.DateFormatLocale,
|
|
22237
|
+
Param.CurrencyFormat,
|
|
22238
|
+
Param.Locale,
|
|
22239
|
+
Param.searchEmbed,
|
|
22240
|
+
Param.livedBoardEmbed,
|
|
22241
|
+
Param.isSpotterAgentEmbed,
|
|
22242
|
+
Param.SpotterEnabled,
|
|
22243
|
+
Param.IsFullAppEmbed,
|
|
22244
|
+
Param.IsOnBeforeGetVizDataInterceptEnabled,
|
|
22245
|
+
Param.LinkOverride,
|
|
22246
|
+
Param.EnableLinkOverridesV2,
|
|
22247
|
+
Param.DisableRedirectionLinksInNewTab,
|
|
22248
|
+
Param.OverrideHistoryState,
|
|
22249
|
+
Param.ForceTable,
|
|
22250
|
+
Param.StringIDsUrl,
|
|
22251
|
+
Param.DataSources,
|
|
22252
|
+
Param.ExposeTranslationIDs,
|
|
22253
|
+
Param.IconSpriteUrl,
|
|
22254
|
+
Param.Tag,
|
|
22255
|
+
]);
|
|
21423
22256
|
/**
|
|
21424
22257
|
* The event id map from v2 event names to v1 event id
|
|
21425
22258
|
* v1 events are the classic embed events implemented in Blink v1
|
|
@@ -21446,6 +22279,7 @@ class TsEmbed {
|
|
|
21446
22279
|
* The key to store the embed instance in the DOM node
|
|
21447
22280
|
*/
|
|
21448
22281
|
this.embedNodeKey = '__tsEmbed';
|
|
22282
|
+
this.embedContainerLoadedKey = '__tsEmbedContainerLoaded';
|
|
21449
22283
|
this.isAppInitialized = false;
|
|
21450
22284
|
/**
|
|
21451
22285
|
* Should we encode URL Query Params using base64 encoding which ThoughtSpot
|
|
@@ -21466,7 +22300,7 @@ class TsEmbed {
|
|
|
21466
22300
|
const eventType = this.getEventType(event);
|
|
21467
22301
|
const eventPort = this.getEventPort(event);
|
|
21468
22302
|
const eventData = this.formatEventData(event, eventType);
|
|
21469
|
-
if (event
|
|
22303
|
+
if (isMessageFromIframe(event, this.iFrame, this.thoughtSpotHost)) {
|
|
21470
22304
|
const processedEventData = processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.hostElement);
|
|
21471
22305
|
if (eventType === EmbedEvent.ApiIntercept) {
|
|
21472
22306
|
this.handleApiInterceptEvent({ eventData, eventPort });
|
|
@@ -21608,20 +22442,28 @@ class TsEmbed {
|
|
|
21608
22442
|
this.createEmbedContainerHandler = (source) => () => {
|
|
21609
22443
|
const processEmbedContainerReady = () => {
|
|
21610
22444
|
logger$3.debug('processEmbedContainerReady');
|
|
21611
|
-
this.
|
|
22445
|
+
this.markEmbedContainerLoaded();
|
|
21612
22446
|
this.executeEmbedContainerReadyCallbacks();
|
|
21613
22447
|
};
|
|
21614
22448
|
if (source === EmbedEvent.AuthInit) {
|
|
21615
22449
|
const AUTH_INIT_FALLBACK_DELAY = 1000;
|
|
21616
22450
|
// Wait for 1 second to ensure the embed container is loaded
|
|
21617
22451
|
// This is a workaround to ensure the embed container is loaded
|
|
21618
|
-
// this is needed until all clusters have EmbedListenerReady
|
|
22452
|
+
// this is needed until all clusters have EmbedListenerReady
|
|
22453
|
+
// event
|
|
21619
22454
|
setTimeout(processEmbedContainerReady, AUTH_INIT_FALLBACK_DELAY);
|
|
21620
22455
|
}
|
|
21621
22456
|
else if (source === EmbedEvent.EmbedListenerReady) {
|
|
21622
22457
|
processEmbedContainerReady();
|
|
22458
|
+
if (this.isConfigExcludedFromUrl()) {
|
|
22459
|
+
this.triggerUpdateEmbedParams();
|
|
22460
|
+
}
|
|
21623
22461
|
}
|
|
21624
22462
|
};
|
|
22463
|
+
// Subclasses that navigate the pre-render on show must await this before
|
|
22464
|
+
// triggering Navigate. Resolves even on failure, so navigation is never
|
|
22465
|
+
// blocked.
|
|
22466
|
+
this.preRenderParamsApplied = Promise.resolve();
|
|
21625
22467
|
this.hostElement = getDOMNode(domSelector);
|
|
21626
22468
|
this.eventHandlerMap = new Map();
|
|
21627
22469
|
this.isError = false;
|
|
@@ -21938,6 +22780,7 @@ class TsEmbed {
|
|
|
21938
22780
|
return `${basePath}#`;
|
|
21939
22781
|
}
|
|
21940
22782
|
async getUpdateEmbedParamsObject() {
|
|
22783
|
+
var _a, _b;
|
|
21941
22784
|
const queryParams = this.getEmbedParamsObject();
|
|
21942
22785
|
// Values are URL-serialized (e.g. dataSources as '["guid"]'); parse
|
|
21943
22786
|
// them back so the event payload matches a URL load (SCAL-334713).
|
|
@@ -21945,7 +22788,17 @@ class TsEmbed {
|
|
|
21945
22788
|
queryParams[key] = deserializeParam(queryParams[key]);
|
|
21946
22789
|
});
|
|
21947
22790
|
const appInitData = await this.getAppInitData();
|
|
21948
|
-
return {
|
|
22791
|
+
return {
|
|
22792
|
+
...this.viewConfig,
|
|
22793
|
+
...queryParams,
|
|
22794
|
+
...appInitData,
|
|
22795
|
+
// A show cycle has no URL to carry these, so the payload always
|
|
22796
|
+
// states them — including "none", which is the case that leaks the
|
|
22797
|
+
// previous filters.
|
|
22798
|
+
runtimeFilterParams: getFilterQuery((_a = this.viewConfig.runtimeFilters) !== null && _a !== void 0 ? _a : []) || NO_RUNTIME_PARAMS,
|
|
22799
|
+
runtimeParameterParams: getRuntimeParameters((_b = this.viewConfig.runtimeParameters) !== null && _b !== void 0 ? _b : [])
|
|
22800
|
+
|| NO_RUNTIME_PARAMS,
|
|
22801
|
+
};
|
|
21949
22802
|
}
|
|
21950
22803
|
/**
|
|
21951
22804
|
* Common query params set for all the embed modes.
|
|
@@ -22109,13 +22962,20 @@ class TsEmbed {
|
|
|
22109
22962
|
return path;
|
|
22110
22963
|
}
|
|
22111
22964
|
getEmbedParams() {
|
|
22112
|
-
const queryParams = this.
|
|
22965
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
22113
22966
|
return getQueryParamString(queryParams);
|
|
22114
22967
|
}
|
|
22115
22968
|
getEmbedParamsObject() {
|
|
22116
22969
|
const params = this.getBaseQueryParams();
|
|
22117
22970
|
return params;
|
|
22118
22971
|
}
|
|
22972
|
+
getUrlQueryParamsObject() {
|
|
22973
|
+
const queryParams = this.getEmbedParamsObject();
|
|
22974
|
+
if (!this.isConfigExcludedFromUrl()) {
|
|
22975
|
+
return queryParams;
|
|
22976
|
+
}
|
|
22977
|
+
return Object.fromEntries(Object.entries(queryParams).filter(([key]) => BOOTSTRAP_URL_PARAMS.has(key)));
|
|
22978
|
+
}
|
|
22119
22979
|
getRootIframeSrc() {
|
|
22120
22980
|
const query = this.getEmbedParams();
|
|
22121
22981
|
return this.getEmbedBasePath(query);
|
|
@@ -22576,40 +23436,6 @@ class TsEmbed {
|
|
|
22576
23436
|
getCompatibleEventType(eventType) {
|
|
22577
23437
|
return V1EventMap[eventType] || eventType;
|
|
22578
23438
|
}
|
|
22579
|
-
/**
|
|
22580
|
-
* Calculates the iframe center for the current visible viewPort
|
|
22581
|
-
* of iframe using Scroll position of Host App, offsetTop for iframe
|
|
22582
|
-
* in Host app. ViewPort height of the tab.
|
|
22583
|
-
* @returns iframe Center in visible viewport,
|
|
22584
|
-
* Iframe height,
|
|
22585
|
-
* View port height.
|
|
22586
|
-
*/
|
|
22587
|
-
getIframeCenter() {
|
|
22588
|
-
const offsetTopClient = getOffsetTop(this.iFrame);
|
|
22589
|
-
const scrollTopClient = window.scrollY;
|
|
22590
|
-
const viewPortHeight = window.innerHeight;
|
|
22591
|
-
const iframeHeight = this.iFrame.offsetHeight;
|
|
22592
|
-
const iframeScrolled = scrollTopClient - offsetTopClient;
|
|
22593
|
-
let iframeVisibleViewPort;
|
|
22594
|
-
let iframeOffset;
|
|
22595
|
-
if (iframeScrolled < 0) {
|
|
22596
|
-
iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
|
|
22597
|
-
iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
|
|
22598
|
-
iframeOffset = 0;
|
|
22599
|
-
}
|
|
22600
|
-
else {
|
|
22601
|
-
iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
|
|
22602
|
-
iframeOffset = iframeScrolled;
|
|
22603
|
-
}
|
|
22604
|
-
const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
|
|
22605
|
-
return {
|
|
22606
|
-
iframeCenter,
|
|
22607
|
-
iframeScrolled,
|
|
22608
|
-
iframeHeight,
|
|
22609
|
-
viewPortHeight,
|
|
22610
|
-
iframeVisibleViewPort,
|
|
22611
|
-
};
|
|
22612
|
-
}
|
|
22613
23439
|
/**
|
|
22614
23440
|
* Registers an event listener to trigger an alert when the ThoughtSpot app
|
|
22615
23441
|
* sends an event of a particular message type to the host application.
|
|
@@ -22693,13 +23519,33 @@ class TsEmbed {
|
|
|
22693
23519
|
var _a;
|
|
22694
23520
|
const embedObj = (_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
22695
23521
|
if (embedObj === this) {
|
|
22696
|
-
logger$3.
|
|
23522
|
+
logger$3.debug('embedObj is same as this');
|
|
22697
23523
|
}
|
|
22698
23524
|
return embedObj;
|
|
22699
23525
|
}
|
|
23526
|
+
takeOverPreRender() {
|
|
23527
|
+
if (!this.preRenderWrapper)
|
|
23528
|
+
return;
|
|
23529
|
+
this.preRenderWrapper[this.embedNodeKey] = this;
|
|
23530
|
+
}
|
|
23531
|
+
// The flag lives on the wrapper because it describes the iframe: an
|
|
23532
|
+
// instance hidden when the container announced itself would otherwise
|
|
23533
|
+
// report false forever.
|
|
23534
|
+
markEmbedContainerLoaded() {
|
|
23535
|
+
this.isEmbedContainerLoaded = true;
|
|
23536
|
+
if (this.preRenderWrapper) {
|
|
23537
|
+
this.preRenderWrapper[this.embedContainerLoadedKey] = true;
|
|
23538
|
+
}
|
|
23539
|
+
}
|
|
22700
23540
|
checkEmbedContainerLoaded() {
|
|
23541
|
+
var _a;
|
|
22701
23542
|
if (this.isEmbedContainerLoaded)
|
|
22702
23543
|
return true;
|
|
23544
|
+
if ((_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedContainerLoadedKey]) {
|
|
23545
|
+
this.isEmbedContainerLoaded = true;
|
|
23546
|
+
return true;
|
|
23547
|
+
}
|
|
23548
|
+
// Older builds stamped the flag on the instance, not the wrapper.
|
|
22703
23549
|
const preRenderObj = this.getPreRenderObj();
|
|
22704
23550
|
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
22705
23551
|
this.isEmbedContainerLoaded = true;
|
|
@@ -22728,8 +23574,12 @@ class TsEmbed {
|
|
|
22728
23574
|
}
|
|
22729
23575
|
/**
|
|
22730
23576
|
* Triggers an event to the embedded app
|
|
23577
|
+
*
|
|
23578
|
+
* Payload typing: from SDK 1.52.0 (ThoughtSpot Cloud 26.9.0.cl), unknown fields
|
|
23579
|
+
* on a known event's payload fail to compile. From SDK 1.54.0 (26.11.0.cl) the
|
|
23580
|
+
* payload is checked strictly against the event contract — update call sites now.
|
|
22731
23581
|
* @param {HostEvent} messageType The event type
|
|
22732
|
-
* @param {
|
|
23582
|
+
* @param {TriggerData} data The payload, typed against the event's contract
|
|
22733
23583
|
* @param {ContextType} context Optional context type to specify the context from which the event is triggered.
|
|
22734
23584
|
* Use ContextType.Search for search answer context, ContextType.Answer for answer/explore context,
|
|
22735
23585
|
* ContextType.Liveboard for liveboard context, or ContextType.Spotter for spotter context.
|
|
@@ -22746,7 +23596,11 @@ class TsEmbed {
|
|
|
22746
23596
|
* ```
|
|
22747
23597
|
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl (for context parameter)
|
|
22748
23598
|
*/
|
|
22749
|
-
async trigger(messageType,
|
|
23599
|
+
async trigger(messageType,
|
|
23600
|
+
// Contract shape is the contextual type: payload fields autocomplete
|
|
23601
|
+
// and unknown fields on object literals are flagged. Strict checks
|
|
23602
|
+
// land in SDK 1.54.0 — see TriggerData.
|
|
23603
|
+
data = {}, context) {
|
|
22750
23604
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
22751
23605
|
if (!this.isRendered) {
|
|
22752
23606
|
this.handleError({
|
|
@@ -23029,25 +23883,43 @@ class TsEmbed {
|
|
|
23029
23883
|
this.isRendered = true;
|
|
23030
23884
|
return this.renderIFrame(prerenderFrameSrc);
|
|
23031
23885
|
}
|
|
23886
|
+
isConfigExcludedFromUrl() {
|
|
23887
|
+
var _a, _b, _c;
|
|
23888
|
+
const flag = (_b = (_a = this.viewConfig.additionalFlags) === null || _a === void 0 ? void 0 : _a.excludeConfigFromURL) !== null && _b !== void 0 ? _b : (_c = this.embedConfig.additionalFlags) === null || _c === void 0 ? void 0 : _c.excludeConfigFromURL;
|
|
23889
|
+
// Enabled by default; only an explicit false opts out.
|
|
23890
|
+
return flag !== false && flag !== 'false';
|
|
23891
|
+
}
|
|
23892
|
+
async triggerUpdateEmbedParams() {
|
|
23893
|
+
try {
|
|
23894
|
+
const params = await this.getUpdateEmbedParamsObject();
|
|
23895
|
+
this.trigger(HostEvent.UpdateEmbedParams, params);
|
|
23896
|
+
}
|
|
23897
|
+
catch (error) {
|
|
23898
|
+
logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
|
|
23899
|
+
this.handleError({
|
|
23900
|
+
errorType: ErrorDetailsTypes.API,
|
|
23901
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
|
|
23902
|
+
code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
|
|
23903
|
+
error: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
23904
|
+
});
|
|
23905
|
+
}
|
|
23906
|
+
}
|
|
23032
23907
|
beforePrerenderVisible() {
|
|
23033
23908
|
// We can ignore this as its a bit expensive and the newer customers
|
|
23034
23909
|
// have moved on to UpdateEmbedParams supported clusters
|
|
23035
23910
|
// this.validatePreRenderViewConfig(this.viewConfig); removed in #517
|
|
23036
23911
|
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
23037
|
-
|
|
23038
|
-
|
|
23039
|
-
|
|
23040
|
-
|
|
23041
|
-
|
|
23042
|
-
|
|
23043
|
-
|
|
23044
|
-
|
|
23045
|
-
|
|
23046
|
-
|
|
23047
|
-
|
|
23048
|
-
error: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
23049
|
-
});
|
|
23050
|
-
}
|
|
23912
|
+
// Created synchronously: a queued navigation needs something to await
|
|
23913
|
+
// whether the container is already loaded or not.
|
|
23914
|
+
this.preRenderParamsApplied = new Promise((resolve) => {
|
|
23915
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
23916
|
+
try {
|
|
23917
|
+
await this.triggerUpdateEmbedParams();
|
|
23918
|
+
}
|
|
23919
|
+
finally {
|
|
23920
|
+
setTimeout(resolve, UPDATE_EMBED_PARAMS_SETTLE_MS);
|
|
23921
|
+
}
|
|
23922
|
+
});
|
|
23051
23923
|
});
|
|
23052
23924
|
}
|
|
23053
23925
|
/**
|
|
@@ -23077,8 +23949,9 @@ class TsEmbed {
|
|
|
23077
23949
|
if (this.hostElement) {
|
|
23078
23950
|
this.insertedDomEl = this.createPreRenderPlaceholder();
|
|
23079
23951
|
if (this.viewConfig.fullHeight) {
|
|
23080
|
-
// If fullHeight has already sized the wrapper, seed the
|
|
23081
|
-
// with the same height so syncPreRenderStyle gets
|
|
23952
|
+
// If fullHeight has already sized the wrapper, seed the
|
|
23953
|
+
// placeholder with the same height so syncPreRenderStyle gets
|
|
23954
|
+
// an accurate rect.
|
|
23082
23955
|
const existingHeight = this.preRenderWrapper.style.height;
|
|
23083
23956
|
if (existingHeight) {
|
|
23084
23957
|
this.insertedDomEl.style.height = existingHeight;
|
|
@@ -23086,12 +23959,13 @@ class TsEmbed {
|
|
|
23086
23959
|
}
|
|
23087
23960
|
const placeHolderId = this.getPreRenderIds().placeHolder;
|
|
23088
23961
|
// Remove any stale placeholder from a previous cycle. It is located
|
|
23089
|
-
// via a subtree-wide querySelector, so it may be nested deeper
|
|
23090
|
-
// direct child (E.g.: with fullHeight the host app can wrap
|
|
23091
|
-
// Element.remove() — which detaches from whatever the real
|
|
23092
|
-
// rather than hostElement.removeChild(), which throws
|
|
23093
|
-
// when the match is not a direct child. Mirrors the
|
|
23094
|
-
// cleanup in
|
|
23962
|
+
// via a subtree-wide querySelector, so it may be nested deeper
|
|
23963
|
+
// than a direct child (E.g.: with fullHeight the host app can wrap
|
|
23964
|
+
// it). Use Element.remove() — which detaches from whatever the real
|
|
23965
|
+
// parent is — rather than hostElement.removeChild(), which throws
|
|
23966
|
+
// NotFoundError when the match is not a direct child. Mirrors the
|
|
23967
|
+
// wrapper/child cleanup in
|
|
23968
|
+
// createPreRenderWrapper()/createPreRenderChild().
|
|
23095
23969
|
(_a = this.hostElement.querySelector(`#${placeHolderId}`)) === null || _a === void 0 ? void 0 : _a.remove();
|
|
23096
23970
|
this.hostElement.appendChild(this.insertedDomEl);
|
|
23097
23971
|
this.syncPreRenderStyle();
|
|
@@ -23123,6 +23997,9 @@ class TsEmbed {
|
|
|
23123
23997
|
if (this.iFrame) {
|
|
23124
23998
|
this.setupFullscreenChangeHandler();
|
|
23125
23999
|
}
|
|
24000
|
+
// Last, so everything above still sees the instance being taken over
|
|
24001
|
+
// from.
|
|
24002
|
+
this.takeOverPreRender();
|
|
23126
24003
|
return this;
|
|
23127
24004
|
}
|
|
23128
24005
|
getPreRenderPlaceHolderElement() {
|
|
@@ -23325,6 +24202,9 @@ class V1Embed extends TsEmbed {
|
|
|
23325
24202
|
* ```
|
|
23326
24203
|
*/
|
|
23327
24204
|
on(messageType, callback, options = { start: false }) {
|
|
24205
|
+
// Mirror the base TsEmbed.on generic signature so the enriched
|
|
24206
|
+
// EmbedEventPayload (e.g. CustomAction's answerService) flows through
|
|
24207
|
+
// the override too, and the class hierarchy stays assignable.
|
|
23328
24208
|
const eventType = this.getCompatibleEventType(messageType);
|
|
23329
24209
|
return super.on(eventType, callback, options);
|
|
23330
24210
|
}
|
|
@@ -23405,6 +24285,18 @@ function buildStarterPromptsAppInitData(initData, viewConfig) {
|
|
|
23405
24285
|
starterPrompts,
|
|
23406
24286
|
},
|
|
23407
24287
|
};
|
|
24288
|
+
}
|
|
24289
|
+
function buildSpotterAnalystAppInitData(initData, viewConfig) {
|
|
24290
|
+
const { spotterAnalystConfig } = viewConfig;
|
|
24291
|
+
if (!(spotterAnalystConfig === null || spotterAnalystConfig === void 0 ? void 0 : spotterAnalystConfig.analystId))
|
|
24292
|
+
return initData;
|
|
24293
|
+
return {
|
|
24294
|
+
...initData,
|
|
24295
|
+
embedParams: {
|
|
24296
|
+
...(initData.embedParams || {}),
|
|
24297
|
+
spotterAnalystConfig,
|
|
24298
|
+
},
|
|
24299
|
+
};
|
|
23408
24300
|
}
|
|
23409
24301
|
|
|
23410
24302
|
function buildSpotterVizAppInitData(initData, viewConfig) {
|
|
@@ -23565,73 +24457,17 @@ class AppEmbed extends V1Embed {
|
|
|
23565
24457
|
constructor(domSelector, viewConfig) {
|
|
23566
24458
|
viewConfig.embedComponentType = 'AppEmbed';
|
|
23567
24459
|
super(domSelector, viewConfig);
|
|
23568
|
-
this.defaultHeight = 500;
|
|
23569
|
-
this.lazyLoadScrollContainers = [];
|
|
23570
|
-
this.sendFullHeightLazyLoadData = () => {
|
|
23571
|
-
const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
23572
|
-
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
23573
|
-
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
23574
|
-
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
|
|
23575
|
-
}
|
|
23576
|
-
};
|
|
23577
|
-
/**
|
|
23578
|
-
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
23579
|
-
* It is used to send the visible coordinates data to the host application.
|
|
23580
|
-
* @param data The event payload
|
|
23581
|
-
* @param responder The responder function
|
|
23582
|
-
*/
|
|
23583
|
-
this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
|
|
23584
|
-
logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
23585
|
-
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
23586
|
-
responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
23587
|
-
};
|
|
23588
|
-
/**
|
|
23589
|
-
* Set the iframe height as per the computed height received
|
|
23590
|
-
* from the ThoughtSpot app.
|
|
23591
|
-
* @param data The event payload
|
|
23592
|
-
*/
|
|
23593
|
-
this.updateIFrameHeight = (data) => {
|
|
23594
|
-
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
23595
|
-
this.sendFullHeightLazyLoadData();
|
|
23596
|
-
};
|
|
23597
|
-
this.embedIframeCenter = (data, responder) => {
|
|
23598
|
-
const obj = this.getIframeCenter();
|
|
23599
|
-
responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
|
|
23600
|
-
};
|
|
23601
|
-
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
23602
|
-
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
23603
|
-
const liveboardRelatedRoutes = [
|
|
23604
|
-
'/pinboard/',
|
|
23605
|
-
'/insights/pinboard/',
|
|
23606
|
-
'/schedules/',
|
|
23607
|
-
'/embed/viz/',
|
|
23608
|
-
'/embed/insights/viz/',
|
|
23609
|
-
'/liveboard/',
|
|
23610
|
-
'/insights/liveboard/',
|
|
23611
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
23612
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
23613
|
-
];
|
|
23614
|
-
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
23615
|
-
// Ignore the height reset of the frame, if the navigation is
|
|
23616
|
-
// only within the liveboard page.
|
|
23617
|
-
return;
|
|
23618
|
-
}
|
|
23619
|
-
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
23620
|
-
};
|
|
23621
24460
|
if (this.viewConfig.fullHeight === true) {
|
|
23622
|
-
|
|
23623
|
-
this.
|
|
23624
|
-
|
|
23625
|
-
|
|
23626
|
-
|
|
23627
|
-
|
|
23628
|
-
|
|
23629
|
-
|
|
23630
|
-
|
|
23631
|
-
|
|
23632
|
-
this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
23633
|
-
this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
23634
|
-
this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
|
|
24461
|
+
this.fullHeightController = new FullHeightController(this.viewConfig, {
|
|
24462
|
+
getIframe: () => this.iFrame,
|
|
24463
|
+
setFrameHeight: (height) => this.setIFrameHeight(height),
|
|
24464
|
+
on: (eventType, callback) => {
|
|
24465
|
+
this.on(eventType, callback);
|
|
24466
|
+
},
|
|
24467
|
+
trigger: (hostEvent, data) => {
|
|
24468
|
+
this.trigger(hostEvent, data);
|
|
24469
|
+
},
|
|
24470
|
+
});
|
|
23635
24471
|
}
|
|
23636
24472
|
}
|
|
23637
24473
|
/**
|
|
@@ -23658,11 +24494,12 @@ class AppEmbed extends V1Embed {
|
|
|
23658
24494
|
* embedded Liveboard or visualization.
|
|
23659
24495
|
*/
|
|
23660
24496
|
getEmbedParams() {
|
|
23661
|
-
const params = this.
|
|
24497
|
+
const params = this.getUrlQueryParamsObject();
|
|
23662
24498
|
return getQueryParamString(params, true);
|
|
23663
24499
|
}
|
|
23664
24500
|
getEmbedParamsObject() {
|
|
23665
|
-
|
|
24501
|
+
var _a;
|
|
24502
|
+
const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, newConnectionsExperience, dataPanelV2 = true, updatedSpotterExperience, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, hideHomepageLeftNav = false, modularHomeExperience, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, isEnhancedFilterInteractivityEnabled, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig, spotterDataSources, isThisPeriodInDateFiltersEnabled, enableHomepageAnnouncement = false, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, hideAnswerEditPanel, } = this.viewConfig;
|
|
23666
24503
|
let params = {};
|
|
23667
24504
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
23668
24505
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -23698,6 +24535,9 @@ class AppEmbed extends V1Embed {
|
|
|
23698
24535
|
if (!isUndefined$1(coverAndFilterOptionInPDF)) {
|
|
23699
24536
|
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
23700
24537
|
}
|
|
24538
|
+
if (!isUndefined$1(hideAnswerEditPanel)) {
|
|
24539
|
+
params[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
|
|
24540
|
+
}
|
|
23701
24541
|
params = this.getBaseQueryParams(params);
|
|
23702
24542
|
if (!isUndefined$1(updatedSpotterChatPrompt)) {
|
|
23703
24543
|
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
@@ -23744,15 +24584,7 @@ class AppEmbed extends V1Embed {
|
|
|
23744
24584
|
if (hideNotification) {
|
|
23745
24585
|
params[Param.HideNotification] = !!hideNotification;
|
|
23746
24586
|
}
|
|
23747
|
-
|
|
23748
|
-
params[Param.fullHeight] = true;
|
|
23749
|
-
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
23750
|
-
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
23751
|
-
if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
|
|
23752
|
-
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
23753
|
-
}
|
|
23754
|
-
}
|
|
23755
|
-
}
|
|
24587
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
|
|
23756
24588
|
if (tag) {
|
|
23757
24589
|
params[Param.Tag] = tag;
|
|
23758
24590
|
}
|
|
@@ -23819,7 +24651,6 @@ class AppEmbed extends V1Embed {
|
|
|
23819
24651
|
if (isContinuousLiveboardPDFEnabled !== undefined) {
|
|
23820
24652
|
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
23821
24653
|
}
|
|
23822
|
-
this.defaultHeight = minimumHeight || this.defaultHeight;
|
|
23823
24654
|
if (enableLiveboardDataCache !== undefined) {
|
|
23824
24655
|
params[Param.EnableLiveboardDataCache] = enableLiveboardDataCache;
|
|
23825
24656
|
}
|
|
@@ -23958,52 +24789,13 @@ class AppEmbed extends V1Embed {
|
|
|
23958
24789
|
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
23959
24790
|
*/
|
|
23960
24791
|
destroy() {
|
|
24792
|
+
var _a;
|
|
23961
24793
|
super.destroy();
|
|
23962
|
-
this.
|
|
24794
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
23963
24795
|
}
|
|
23964
24796
|
postRender() {
|
|
23965
|
-
this.registerLazyLoadEvents();
|
|
23966
|
-
}
|
|
23967
|
-
registerLazyLoadEvents() {
|
|
23968
|
-
if (!this.iFrame) {
|
|
23969
|
-
return;
|
|
23970
|
-
}
|
|
23971
|
-
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
23972
|
-
this.unregisterLazyLoadEvents();
|
|
23973
|
-
// TODO: Use passive: true, install modernizr to check for passive
|
|
23974
|
-
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
23975
|
-
window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
23976
|
-
if (!this.viewConfig.enableScrollableContainerLazyLoading) {
|
|
23977
|
-
return;
|
|
23978
|
-
}
|
|
23979
|
-
this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
|
|
23980
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
23981
|
-
scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
23982
|
-
});
|
|
23983
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
23984
|
-
const resizeTargets = new Set([
|
|
23985
|
-
this.iFrame.parentElement,
|
|
23986
|
-
...getEffectiveClippingAncestors(this.iFrame),
|
|
23987
|
-
].filter(Boolean));
|
|
23988
|
-
this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
|
|
23989
|
-
resizeTargets.forEach((resizeTarget) => {
|
|
23990
|
-
this.lazyLoadResizeObserver.observe(resizeTarget);
|
|
23991
|
-
});
|
|
23992
|
-
}
|
|
23993
|
-
}
|
|
23994
|
-
}
|
|
23995
|
-
unregisterLazyLoadEvents() {
|
|
23996
24797
|
var _a;
|
|
23997
|
-
|
|
23998
|
-
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
23999
|
-
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24000
|
-
(_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
24001
|
-
this.lazyLoadResizeObserver = undefined;
|
|
24002
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24003
|
-
scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24004
|
-
});
|
|
24005
|
-
this.lazyLoadScrollContainers = [];
|
|
24006
|
-
}
|
|
24798
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
|
|
24007
24799
|
}
|
|
24008
24800
|
/**
|
|
24009
24801
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
@@ -24098,6 +24890,11 @@ const addPreviewStylesIfNotPresent = () => {
|
|
|
24098
24890
|
* @summary Liveboard & visualization embed
|
|
24099
24891
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
24100
24892
|
*/
|
|
24893
|
+
// Home unmounts the liveboard container, which is how its state gets cleared.
|
|
24894
|
+
// The settle window gives the container time to do it before we ask for the
|
|
24895
|
+
// liveboard back.
|
|
24896
|
+
const HOME_ROUTE = 'home';
|
|
24897
|
+
const HOME_SETTLE_MS = 200;
|
|
24101
24898
|
/**
|
|
24102
24899
|
* Embed a ThoughtSpot Liveboard or visualization. When rendered it already
|
|
24103
24900
|
* waits for the authentication to complete, so you need not wait for
|
|
@@ -24117,59 +24914,6 @@ class LiveboardEmbed extends V1Embed {
|
|
|
24117
24914
|
constructor(domSelector, viewConfig) {
|
|
24118
24915
|
viewConfig.embedComponentType = 'LiveboardEmbed';
|
|
24119
24916
|
super(domSelector, viewConfig);
|
|
24120
|
-
this.defaultHeight = 500;
|
|
24121
|
-
this.lazyLoadScrollContainers = [];
|
|
24122
|
-
this.sendFullHeightLazyLoadData = () => {
|
|
24123
|
-
const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
24124
|
-
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
24125
|
-
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
24126
|
-
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
|
|
24127
|
-
}
|
|
24128
|
-
};
|
|
24129
|
-
/**
|
|
24130
|
-
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
24131
|
-
* It is used to send the visible coordinates data to the host application.
|
|
24132
|
-
* @param data The event payload
|
|
24133
|
-
* @param responder The responder function
|
|
24134
|
-
*/
|
|
24135
|
-
this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
|
|
24136
|
-
logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
24137
|
-
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
24138
|
-
responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
24139
|
-
};
|
|
24140
|
-
/**
|
|
24141
|
-
* Set the iframe height as per the computed height received
|
|
24142
|
-
* from the ThoughtSpot app.
|
|
24143
|
-
* @param data The event payload
|
|
24144
|
-
*/
|
|
24145
|
-
this.updateIFrameHeight = (data) => {
|
|
24146
|
-
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
24147
|
-
this.sendFullHeightLazyLoadData();
|
|
24148
|
-
};
|
|
24149
|
-
this.embedIframeCenter = (data, responder) => {
|
|
24150
|
-
const obj = this.getIframeCenter();
|
|
24151
|
-
responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
|
|
24152
|
-
};
|
|
24153
|
-
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
24154
|
-
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
24155
|
-
const liveboardRelatedRoutes = [
|
|
24156
|
-
'/pinboard/',
|
|
24157
|
-
'/insights/pinboard/',
|
|
24158
|
-
'/schedules/',
|
|
24159
|
-
'/embed/viz/',
|
|
24160
|
-
'/embed/insights/viz/',
|
|
24161
|
-
'/liveboard/',
|
|
24162
|
-
'/insights/liveboard/',
|
|
24163
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
24164
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
24165
|
-
];
|
|
24166
|
-
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
24167
|
-
// Ignore the height reset of the frame, if the navigation is
|
|
24168
|
-
// only within the liveboard page.
|
|
24169
|
-
return;
|
|
24170
|
-
}
|
|
24171
|
-
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
24172
|
-
};
|
|
24173
24917
|
/**
|
|
24174
24918
|
* @hidden
|
|
24175
24919
|
* Internal state to track the current liveboard id.
|
|
@@ -24183,22 +24927,19 @@ class LiveboardEmbed extends V1Embed {
|
|
|
24183
24927
|
};
|
|
24184
24928
|
if (this.viewConfig.fullHeight === true) {
|
|
24185
24929
|
if (this.viewConfig.vizId) {
|
|
24186
|
-
logger$3.warn('Full height is currently only supported for Liveboard embeds.'
|
|
24187
|
-
'Using full height with vizId might lead to unexpected behavior.');
|
|
24188
|
-
}
|
|
24189
|
-
if (this.viewConfig.lazyLoadingForFullHeight === undefined) {
|
|
24190
|
-
this.viewConfig.lazyLoadingForFullHeight = true;
|
|
24191
|
-
}
|
|
24192
|
-
if (this.viewConfig.enableScrollableContainerLazyLoading === undefined) {
|
|
24193
|
-
this.viewConfig.enableScrollableContainerLazyLoading = true;
|
|
24194
|
-
}
|
|
24195
|
-
if (this.viewConfig.lazyLoadingMargin === undefined) {
|
|
24196
|
-
this.viewConfig.lazyLoadingMargin = DEFAULT_LAZY_LOADING_MARGIN;
|
|
24930
|
+
logger$3.warn('Full height is currently only supported for Liveboard embeds.'
|
|
24931
|
+
+ 'Using full height with vizId might lead to unexpected behavior.');
|
|
24197
24932
|
}
|
|
24198
|
-
this.
|
|
24199
|
-
|
|
24200
|
-
|
|
24201
|
-
|
|
24933
|
+
this.fullHeightController = new FullHeightController(this.viewConfig, {
|
|
24934
|
+
getIframe: () => this.iFrame,
|
|
24935
|
+
setFrameHeight: (height) => this.setIFrameHeight(height),
|
|
24936
|
+
on: (eventType, callback) => {
|
|
24937
|
+
this.on(eventType, callback);
|
|
24938
|
+
},
|
|
24939
|
+
trigger: (hostEvent, data) => {
|
|
24940
|
+
this.trigger(hostEvent, data);
|
|
24941
|
+
},
|
|
24942
|
+
});
|
|
24202
24943
|
}
|
|
24203
24944
|
}
|
|
24204
24945
|
async getAppInitData() {
|
|
@@ -24211,26 +24952,18 @@ class LiveboardEmbed extends V1Embed {
|
|
|
24211
24952
|
* embedded Liveboard or visualization.
|
|
24212
24953
|
*/
|
|
24213
24954
|
getEmbedParams() {
|
|
24214
|
-
const params = this.
|
|
24955
|
+
const params = this.getUrlQueryParamsObject();
|
|
24215
24956
|
const queryParams = getQueryParamString(params, true);
|
|
24216
24957
|
return queryParams;
|
|
24217
24958
|
}
|
|
24218
24959
|
getEmbedParamsObject() {
|
|
24960
|
+
var _a;
|
|
24219
24961
|
let params = {};
|
|
24220
24962
|
params = this.getBaseQueryParams(params);
|
|
24221
|
-
const { enableVizTransformations,
|
|
24963
|
+
const { enableVizTransformations, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, isEnhancedFilterInteractivityEnabled, enableAskSage, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, dataPanelV2 = true, updatedSpotterExperience, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, enableStopAnswerGenerationEmbed, spotterChatConfig, isThisPeriodInDateFiltersEnabled, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, } = this.viewConfig;
|
|
24222
24964
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
24223
24965
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
24224
|
-
|
|
24225
|
-
params[Param.fullHeight] = true;
|
|
24226
|
-
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
24227
|
-
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
24228
|
-
if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
|
|
24229
|
-
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
24230
|
-
}
|
|
24231
|
-
}
|
|
24232
|
-
}
|
|
24233
|
-
this.defaultHeight = minimumHeight || defaultHeight || this.defaultHeight;
|
|
24966
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
|
|
24234
24967
|
if (enableVizTransformations !== undefined) {
|
|
24235
24968
|
params[Param.EnableVizTransformations] = enableVizTransformations.toString();
|
|
24236
24969
|
}
|
|
@@ -24457,19 +25190,49 @@ class LiveboardEmbed extends V1Embed {
|
|
|
24457
25190
|
}
|
|
24458
25191
|
beforePrerenderVisible() {
|
|
24459
25192
|
super.beforePrerenderVisible();
|
|
24460
|
-
|
|
24461
|
-
|
|
24462
|
-
|
|
24463
|
-
|
|
24464
|
-
|
|
24465
|
-
|
|
24466
|
-
|
|
24467
|
-
|
|
24468
|
-
|
|
24469
|
-
|
|
25193
|
+
// Captured before showPreRender() hands the wrapper over to this
|
|
25194
|
+
// instance. Itself means a hide/show, not a hand-over, so there is
|
|
25195
|
+
// nothing stale to clear.
|
|
25196
|
+
const previous = this.getPreRenderObj();
|
|
25197
|
+
const showing = previous === this ? undefined : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
|
|
25198
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
25199
|
+
// Without this the params callback suspends on its await and
|
|
25200
|
+
// Navigate goes out first, so the container loads with the previous
|
|
25201
|
+
// config's filters.
|
|
25202
|
+
await this.preRenderParamsApplied;
|
|
25203
|
+
if (this.isShowingLiveboardRoute(showing)) {
|
|
25204
|
+
// Navigate to the route we are already on is a no-op, so the
|
|
25205
|
+
// liveboard keeps its state. Home unmounts the container, which
|
|
25206
|
+
// clears it.
|
|
25207
|
+
this.trigger(HostEvent.Navigate, HOME_ROUTE)
|
|
25208
|
+
.catch((error) => logger$3.warn('Could not route via home', error));
|
|
25209
|
+
// Not awaited above: the container never acks Navigate, so
|
|
25210
|
+
// that promise only settles on the 30s trigger timeout.
|
|
25211
|
+
await new Promise((resolve) => {
|
|
25212
|
+
setTimeout(resolve, HOME_SETTLE_MS);
|
|
25213
|
+
});
|
|
24470
25214
|
}
|
|
25215
|
+
this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId, this.viewConfig.personalizedViewId);
|
|
25216
|
+
this.currentLiveboardState = {
|
|
25217
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
25218
|
+
vizId: this.viewConfig.vizId,
|
|
25219
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
25220
|
+
personalizedViewId: this.viewConfig.personalizedViewId,
|
|
25221
|
+
};
|
|
24471
25222
|
});
|
|
24472
25223
|
}
|
|
25224
|
+
// The whole route, not just the liveboard id: the path is built from the
|
|
25225
|
+
// viz, tab and view too, so a same-liveboard show onto another tab is a
|
|
25226
|
+
// real navigation.
|
|
25227
|
+
isShowingLiveboardRoute(showing) {
|
|
25228
|
+
if (!(showing === null || showing === void 0 ? void 0 : showing.liveboardId))
|
|
25229
|
+
return false;
|
|
25230
|
+
const { liveboardId, vizId, activeTabId, personalizedViewId, } = this.viewConfig;
|
|
25231
|
+
return showing.liveboardId === liveboardId
|
|
25232
|
+
&& showing.vizId === vizId
|
|
25233
|
+
&& showing.activeTabId === activeTabId
|
|
25234
|
+
&& showing.personalizedViewId === personalizedViewId;
|
|
25235
|
+
}
|
|
24473
25236
|
async handleRenderForPrerender() {
|
|
24474
25237
|
if (isUndefined$1(this.viewConfig.liveboardId)) {
|
|
24475
25238
|
return this.prerenderGeneric();
|
|
@@ -24478,11 +25241,16 @@ class LiveboardEmbed extends V1Embed {
|
|
|
24478
25241
|
}
|
|
24479
25242
|
/**
|
|
24480
25243
|
* Triggers an event to the embedded app
|
|
25244
|
+
* Payload typing follows {@link TsEmbed.trigger}: unknown fields fail to compile
|
|
25245
|
+
* from SDK 1.52.0; strict contract checks land in SDK 1.54.0.
|
|
24481
25246
|
* @param {HostEvent} messageType The event type
|
|
24482
|
-
* @param {
|
|
25247
|
+
* @param {TriggerData} data The payload, typed against the event's contract
|
|
24483
25248
|
* @returns A promise that resolves with the response from the embedded app
|
|
24484
25249
|
*/
|
|
24485
|
-
trigger(messageType,
|
|
25250
|
+
trigger(messageType,
|
|
25251
|
+
// Mirror TsEmbed.trigger: contract shape is the contextual type and
|
|
25252
|
+
// unknown fields on object literals are flagged. Strict in SDK 1.54.0.
|
|
25253
|
+
data = {}, context) {
|
|
24486
25254
|
const dataWithVizId = data;
|
|
24487
25255
|
if (messageType === HostEvent.SetActiveTab) {
|
|
24488
25256
|
this.setActiveTab(data);
|
|
@@ -24498,52 +25266,13 @@ class LiveboardEmbed extends V1Embed {
|
|
|
24498
25266
|
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
24499
25267
|
*/
|
|
24500
25268
|
destroy() {
|
|
25269
|
+
var _a;
|
|
24501
25270
|
super.destroy();
|
|
24502
|
-
this.
|
|
25271
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
24503
25272
|
}
|
|
24504
25273
|
postRender() {
|
|
24505
|
-
this.registerLazyLoadEvents();
|
|
24506
|
-
}
|
|
24507
|
-
registerLazyLoadEvents() {
|
|
24508
|
-
if (!this.iFrame) {
|
|
24509
|
-
return;
|
|
24510
|
-
}
|
|
24511
|
-
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
24512
|
-
this.unregisterLazyLoadEvents();
|
|
24513
|
-
// TODO: Use passive: true, install modernizr to check for passive
|
|
24514
|
-
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24515
|
-
window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24516
|
-
if (!this.viewConfig.enableScrollableContainerLazyLoading) {
|
|
24517
|
-
return;
|
|
24518
|
-
}
|
|
24519
|
-
this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
|
|
24520
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24521
|
-
scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24522
|
-
});
|
|
24523
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
24524
|
-
const resizeTargets = new Set([
|
|
24525
|
-
this.iFrame.parentElement,
|
|
24526
|
-
...getEffectiveClippingAncestors(this.iFrame),
|
|
24527
|
-
].filter(Boolean));
|
|
24528
|
-
this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
|
|
24529
|
-
resizeTargets.forEach((resizeTarget) => {
|
|
24530
|
-
this.lazyLoadResizeObserver.observe(resizeTarget);
|
|
24531
|
-
});
|
|
24532
|
-
}
|
|
24533
|
-
}
|
|
24534
|
-
}
|
|
24535
|
-
unregisterLazyLoadEvents() {
|
|
24536
25274
|
var _a;
|
|
24537
|
-
|
|
24538
|
-
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24539
|
-
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24540
|
-
(_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
24541
|
-
this.lazyLoadResizeObserver = undefined;
|
|
24542
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24543
|
-
scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24544
|
-
});
|
|
24545
|
-
this.lazyLoadScrollContainers = [];
|
|
24546
|
-
}
|
|
25275
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
|
|
24547
25276
|
}
|
|
24548
25277
|
/**
|
|
24549
25278
|
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
@@ -24688,7 +25417,7 @@ class SearchEmbed extends TsEmbed {
|
|
|
24688
25417
|
}
|
|
24689
25418
|
getEmbedParamsObject() {
|
|
24690
25419
|
var _a;
|
|
24691
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, isThisPeriodInDateFiltersEnabled, newChartsLibrary, } = this.viewConfig;
|
|
25420
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, isThisPeriodInDateFiltersEnabled, newChartsLibrary, hideAnswerEditPanel, } = this.viewConfig;
|
|
24692
25421
|
const queryParams = this.getBaseQueryParams();
|
|
24693
25422
|
queryParams[Param.HideActions] = [
|
|
24694
25423
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -24711,6 +25440,9 @@ class SearchEmbed extends TsEmbed {
|
|
|
24711
25440
|
if (enableSearchAssist) {
|
|
24712
25441
|
queryParams[Param.EnableSearchAssist] = true;
|
|
24713
25442
|
}
|
|
25443
|
+
if (hideAnswerEditPanel !== undefined) {
|
|
25444
|
+
queryParams[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
|
|
25445
|
+
}
|
|
24714
25446
|
if (hideResults) {
|
|
24715
25447
|
queryParams[Param.HideResult] = true;
|
|
24716
25448
|
}
|
|
@@ -24751,7 +25483,7 @@ class SearchEmbed extends TsEmbed {
|
|
|
24751
25483
|
}
|
|
24752
25484
|
getEmbedParams() {
|
|
24753
25485
|
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
24754
|
-
const queryParams = this.
|
|
25486
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
24755
25487
|
let query = '';
|
|
24756
25488
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
24757
25489
|
if (queryParamsString) {
|
|
@@ -24839,7 +25571,7 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
24839
25571
|
* @param dataSources A list of data source GUIDs
|
|
24840
25572
|
*/
|
|
24841
25573
|
getIFrameSrc() {
|
|
24842
|
-
const queryParams = this.
|
|
25574
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
24843
25575
|
const path = 'search-bar-embed';
|
|
24844
25576
|
let query = '';
|
|
24845
25577
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
@@ -25273,7 +26005,7 @@ class ConversationMessage extends TsEmbed {
|
|
|
25273
26005
|
getIframeSrc() {
|
|
25274
26006
|
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
25275
26007
|
const path = 'conv-assist-answer';
|
|
25276
|
-
const queryParams = this.
|
|
26008
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
25277
26009
|
let query = '';
|
|
25278
26010
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
25279
26011
|
if (queryParamsString) {
|
|
@@ -25441,10 +26173,11 @@ class SpotterEmbed extends TsEmbed {
|
|
|
25441
26173
|
const defaultAppInitData = await super.getAppInitData();
|
|
25442
26174
|
const sidebarInitData = buildSpotterSidebarAppInitData(defaultAppInitData, this.viewConfig, this.handleError.bind(this));
|
|
25443
26175
|
const shareInitData = buildSpotterShareConversationAppInitData(sidebarInitData, this.viewConfig);
|
|
25444
|
-
|
|
26176
|
+
const starterPromptsInitData = buildStarterPromptsAppInitData(shareInitData, this.viewConfig);
|
|
26177
|
+
return buildSpotterAnalystAppInitData(starterPromptsInitData, this.viewConfig);
|
|
25445
26178
|
}
|
|
25446
26179
|
getEmbedParamsObject() {
|
|
25447
|
-
const { searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, updatedSpotterExperience, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig,
|
|
26180
|
+
const { searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, updatedSpotterExperience, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig, } = this.viewConfig;
|
|
25448
26181
|
const queryParams = this.getBaseQueryParams();
|
|
25449
26182
|
queryParams[Param.SpotterEnabled] = true;
|
|
25450
26183
|
// Boolean params
|
|
@@ -25457,7 +26190,6 @@ class SpotterEmbed extends TsEmbed {
|
|
|
25457
26190
|
setParamIfDefined(queryParams, Param.ShowSpotterRadiance, showSpotterRadiance, true);
|
|
25458
26191
|
setParamIfDefined(queryParams, Param.DefaultQueryMode, defaultQueryMode);
|
|
25459
26192
|
setParamIfDefined(queryParams, Param.EnableStopAnswerGenerationEmbed, enableStopAnswerGenerationEmbed, true);
|
|
25460
|
-
setParamIfDefined(queryParams, Param.AnalystId, spotterAnalystConfig === null || spotterAnalystConfig === void 0 ? void 0 : spotterAnalystConfig.analystId);
|
|
25461
26193
|
// Handle spotterChatConfig params
|
|
25462
26194
|
if (spotterChatConfig) {
|
|
25463
26195
|
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, spotterFileUploadEnabled, spotterFileUploadFileTypes, enableStarterPrompts, } = spotterChatConfig;
|
|
@@ -25481,7 +26213,7 @@ class SpotterEmbed extends TsEmbed {
|
|
|
25481
26213
|
const path = sharedConversationId
|
|
25482
26214
|
? `insights/conv-assist/s/${encodeURIComponent(sharedConversationId)}`
|
|
25483
26215
|
: 'insights/conv-assist';
|
|
25484
|
-
const queryParams = this.
|
|
26216
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
25485
26217
|
let query = '';
|
|
25486
26218
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
25487
26219
|
if (queryParamsString) {
|
|
@@ -26064,6 +26796,213 @@ const createLiveboardWithAnswers = async (answers, name) => {
|
|
|
26064
26796
|
return result;
|
|
26065
26797
|
};
|
|
26066
26798
|
|
|
26799
|
+
/**
|
|
26800
|
+
* Copyright (c) 2026
|
|
26801
|
+
*
|
|
26802
|
+
* Utility to convert the payload emitted by `EmbedEvent.FilterChanged`
|
|
26803
|
+
* into the payload shape expected by `HostEvent.UpdateFilters`, so that
|
|
26804
|
+
* the current filter state of a Liveboard can be captured and re-applied
|
|
26805
|
+
* later without having to hand-parse the event payload.
|
|
26806
|
+
* @summary Filter payload converter
|
|
26807
|
+
*/
|
|
26808
|
+
/**
|
|
26809
|
+
* Coerces an epoch/count field to a number, returning `null` when the value is
|
|
26810
|
+
* absent or not a finite number. The payload arrives as JSON from the iframe,
|
|
26811
|
+
* so a missing field can be `null` as well as `undefined`, and `Number(null)`
|
|
26812
|
+
* or `Number('')` would otherwise silently become a valid-looking `0`
|
|
26813
|
+
* (i.e. the Unix epoch, or a zero-length period).
|
|
26814
|
+
* @param value Raw value from the date filter payload.
|
|
26815
|
+
*/
|
|
26816
|
+
function toFiniteNumber(value) {
|
|
26817
|
+
if (isNil_1(value) || value === '')
|
|
26818
|
+
return null;
|
|
26819
|
+
const numericValue = Number(value);
|
|
26820
|
+
return Number.isFinite(numericValue) ? numericValue : null;
|
|
26821
|
+
}
|
|
26822
|
+
const DATE_FILTER_VALUE_EXTRACTORS = {
|
|
26823
|
+
EXACT_DATE: (dateFilter) => {
|
|
26824
|
+
const epoch = toFiniteNumber(dateFilter.epoch);
|
|
26825
|
+
return epoch === null ? [] : [epoch];
|
|
26826
|
+
},
|
|
26827
|
+
EXACT_DATE_RANGE: (dateFilter) => {
|
|
26828
|
+
var _a;
|
|
26829
|
+
const { lowEpoch, highEpoch } = (_a = dateFilter.dateRange) !== null && _a !== void 0 ? _a : {};
|
|
26830
|
+
const low = toFiniteNumber(lowEpoch);
|
|
26831
|
+
const high = toFiniteNumber(highEpoch);
|
|
26832
|
+
return low === null || high === null ? [] : [low, high];
|
|
26833
|
+
},
|
|
26834
|
+
MONTH_YEAR: (dateFilter) => (dateFilter.monthName && dateFilter.yearName
|
|
26835
|
+
? [dateFilter.monthName, dateFilter.yearName]
|
|
26836
|
+
: []),
|
|
26837
|
+
QUARTER_YEAR: (dateFilter) => (dateFilter.quarterName && dateFilter.yearName
|
|
26838
|
+
? [dateFilter.quarterName, dateFilter.yearName]
|
|
26839
|
+
: []),
|
|
26840
|
+
YEAR_ONLY: (dateFilter) => (dateFilter.yearName ? [dateFilter.yearName] : []),
|
|
26841
|
+
LAST_N_PERIOD: (dateFilter) => {
|
|
26842
|
+
const count = toFiniteNumber(dateFilter.number);
|
|
26843
|
+
return count === null ? [] : [count];
|
|
26844
|
+
},
|
|
26845
|
+
NEXT_N_PERIOD: (dateFilter) => {
|
|
26846
|
+
const count = toFiniteNumber(dateFilter.number);
|
|
26847
|
+
return count === null ? [] : [count];
|
|
26848
|
+
},
|
|
26849
|
+
};
|
|
26850
|
+
// Date filter types with no `values` (e.g. TODAY needs no operand).
|
|
26851
|
+
const PERIOD_ONLY_DATE_FILTER_TYPES = new Set([
|
|
26852
|
+
'THIS_PERIOD', 'PERIOD_TO_DATE', 'TODAY', 'YESTERDAY', 'TOMORROW',
|
|
26853
|
+
]);
|
|
26854
|
+
function convertDateFilterToParam(columnName, dateFilterContent) {
|
|
26855
|
+
var _a;
|
|
26856
|
+
const dateFilter = dateFilterContent === null || dateFilterContent === void 0 ? void 0 : dateFilterContent.dateFilter;
|
|
26857
|
+
if (!(dateFilter === null || dateFilter === void 0 ? void 0 : dateFilter.type))
|
|
26858
|
+
return null;
|
|
26859
|
+
let values;
|
|
26860
|
+
const getValues = DATE_FILTER_VALUE_EXTRACTORS[dateFilter.type];
|
|
26861
|
+
if (getValues) {
|
|
26862
|
+
values = getValues(dateFilter);
|
|
26863
|
+
// Required fields (e.g. epoch, yearName) are missing - the source data
|
|
26864
|
+
// can't be reconstructed faithfully, so skip rather than emit a filter
|
|
26865
|
+
// that would clear/corrupt this column when re-applied.
|
|
26866
|
+
if (values.length === 0)
|
|
26867
|
+
return null;
|
|
26868
|
+
}
|
|
26869
|
+
else if (PERIOD_ONLY_DATE_FILTER_TYPES.has(dateFilter.type)) {
|
|
26870
|
+
values = [];
|
|
26871
|
+
}
|
|
26872
|
+
else {
|
|
26873
|
+
// Unrecognized date filter type - skip rather than guess.
|
|
26874
|
+
return null;
|
|
26875
|
+
}
|
|
26876
|
+
const param = {
|
|
26877
|
+
columnName,
|
|
26878
|
+
operator: (_a = dateFilter.op) !== null && _a !== void 0 ? _a : RuntimeFilterOp.EQ,
|
|
26879
|
+
values,
|
|
26880
|
+
type: dateFilter.type,
|
|
26881
|
+
};
|
|
26882
|
+
if (dateFilter.datePeriod) {
|
|
26883
|
+
param.datePeriod = dateFilter.datePeriod;
|
|
26884
|
+
}
|
|
26885
|
+
if (!isNil_1(dateFilter.includeCurrentPeriod)) {
|
|
26886
|
+
param.includeCurrentPeriod = dateFilter.includeCurrentPeriod;
|
|
26887
|
+
}
|
|
26888
|
+
if (dateFilterContent.negate) {
|
|
26889
|
+
param.negate = true;
|
|
26890
|
+
}
|
|
26891
|
+
return param;
|
|
26892
|
+
}
|
|
26893
|
+
function convertFilterContentToParam(columnName, filterContent) {
|
|
26894
|
+
var _a;
|
|
26895
|
+
if (!(filterContent === null || filterContent === void 0 ? void 0 : filterContent.filterType))
|
|
26896
|
+
return null;
|
|
26897
|
+
const values = ((_a = filterContent.value) !== null && _a !== void 0 ? _a : [])
|
|
26898
|
+
.map((value) => value === null || value === void 0 ? void 0 : value.key)
|
|
26899
|
+
.filter((value) => !isNil_1(value));
|
|
26900
|
+
const param = {
|
|
26901
|
+
columnName,
|
|
26902
|
+
operator: filterContent.filterType,
|
|
26903
|
+
values,
|
|
26904
|
+
};
|
|
26905
|
+
if (filterContent.negate) {
|
|
26906
|
+
param.negate = true;
|
|
26907
|
+
}
|
|
26908
|
+
return param;
|
|
26909
|
+
}
|
|
26910
|
+
function convertFilterToParams(columnName, filter) {
|
|
26911
|
+
var _a, _b;
|
|
26912
|
+
const dateParams = ((_a = filter === null || filter === void 0 ? void 0 : filter.dateFilterContent) !== null && _a !== void 0 ? _a : [])
|
|
26913
|
+
.map((dateFilterContent) => convertDateFilterToParam(columnName, dateFilterContent));
|
|
26914
|
+
const contentParams = ((_b = filter === null || filter === void 0 ? void 0 : filter.filterContent) !== null && _b !== void 0 ? _b : [])
|
|
26915
|
+
.map((filterContent) => convertFilterContentToParam(columnName, filterContent));
|
|
26916
|
+
return [...dateParams, ...contentParams]
|
|
26917
|
+
.filter((param) => param !== null);
|
|
26918
|
+
}
|
|
26919
|
+
/**
|
|
26920
|
+
* Runtime filters need no reshaping, but they still come off the wire as JSON,
|
|
26921
|
+
* so a malformed entry is possible. Skip it rather than pass it through: an
|
|
26922
|
+
* entry missing a column, operator or values array fails
|
|
26923
|
+
* `isValidUpdateFiltersPayload`, and that rejects the *whole* `filters` array,
|
|
26924
|
+
* so one bad runtime filter would drop every other converted filter with it.
|
|
26925
|
+
* @param runtimeFilter A runtime filter from the `FilterChanged` payload.
|
|
26926
|
+
*/
|
|
26927
|
+
function convertRuntimeFilterToParam(runtimeFilter) {
|
|
26928
|
+
const { columnName, operator, values } = runtimeFilter !== null && runtimeFilter !== void 0 ? runtimeFilter : {};
|
|
26929
|
+
if (typeof columnName !== 'string' || !columnName)
|
|
26930
|
+
return null;
|
|
26931
|
+
if (typeof operator !== 'string' || !operator)
|
|
26932
|
+
return null;
|
|
26933
|
+
if (!Array.isArray(values))
|
|
26934
|
+
return null;
|
|
26935
|
+
return { columnName, operator, values };
|
|
26936
|
+
}
|
|
26937
|
+
/**
|
|
26938
|
+
* Mirrors `isValidApplicability` in `hostEventClient/utils`: a `TAB` or `GROUP`
|
|
26939
|
+
* scope is meaningless without a `targetId`, and `UpdateFilters` rejects the
|
|
26940
|
+
* whole `filters` array when any entry carries a malformed `applicability`.
|
|
26941
|
+
* @param applicability Scope taken from the `FilterChanged` payload.
|
|
26942
|
+
*/
|
|
26943
|
+
function isUsableApplicability(applicability) {
|
|
26944
|
+
const levels = Object.values(ApplicabilityLevel);
|
|
26945
|
+
if (!levels.includes(applicability.level))
|
|
26946
|
+
return false;
|
|
26947
|
+
if (applicability.level === ApplicabilityLevel.Liveboard)
|
|
26948
|
+
return true;
|
|
26949
|
+
return typeof applicability.targetId === 'string' && applicability.targetId.trim().length > 0;
|
|
26950
|
+
}
|
|
26951
|
+
function convertFilterGroupToParams(filterGroup) {
|
|
26952
|
+
var _a, _b;
|
|
26953
|
+
const columnName = (_a = filterGroup === null || filterGroup === void 0 ? void 0 : filterGroup.columnInfo) === null || _a === void 0 ? void 0 : _a.name;
|
|
26954
|
+
if (!columnName)
|
|
26955
|
+
return [];
|
|
26956
|
+
const { applicability } = filterGroup;
|
|
26957
|
+
// A filter scoped to a tab or group has to keep that scope. Replaying it
|
|
26958
|
+
// without `applicability` would silently widen it to the whole Liveboard,
|
|
26959
|
+
// changing what every other tab shows. If a scope is present but unusable,
|
|
26960
|
+
// skip the filter: widening is worse than dropping, and a malformed
|
|
26961
|
+
// applicability would fail validation for every other filter alongside it.
|
|
26962
|
+
if (!isNil_1(applicability) && !isUsableApplicability(applicability))
|
|
26963
|
+
return [];
|
|
26964
|
+
const params = ((_b = filterGroup.filters) !== null && _b !== void 0 ? _b : [])
|
|
26965
|
+
.flatMap((filter) => convertFilterToParams(columnName, filter));
|
|
26966
|
+
return isNil_1(applicability) ? params : params.map((param) => ({ ...param, applicability }));
|
|
26967
|
+
}
|
|
26968
|
+
/**
|
|
26969
|
+
* Converts the payload emitted by {@link EmbedEvent.FilterChanged} into the
|
|
26970
|
+
* payload shape expected by {@link HostEvent.UpdateFilters}, so the same
|
|
26971
|
+
* filter state can be captured and re-applied later, for example on a
|
|
26972
|
+
* subsequent page load.
|
|
26973
|
+
*
|
|
26974
|
+
* Both the Liveboard filters and the runtime filters present in the
|
|
26975
|
+
* `FilterChanged` payload are included in the returned `filters` array.
|
|
26976
|
+
*
|
|
26977
|
+
* Note: a column with multiple date-filter conditions (e.g. an OR of two
|
|
26978
|
+
* date ranges) is not guaranteed to round-trip losslessly - `HostEvent.UpdateFilters`
|
|
26979
|
+
* treats date filters as replace-not-merge per column, so only the last
|
|
26980
|
+
* converted entry for such a column will apply.
|
|
26981
|
+
* @param filterChangedPayload The filter state carried by the
|
|
26982
|
+
* `EmbedEvent.FilterChanged` callback, which is `payload.data` - the
|
|
26983
|
+
* callback argument is the event envelope, and the filters sit under its
|
|
26984
|
+
* `data` key.
|
|
26985
|
+
* @example
|
|
26986
|
+
* ```js
|
|
26987
|
+
* let savedFilters;
|
|
26988
|
+
* liveboardEmbed.on(EmbedEvent.FilterChanged, (payload) => {
|
|
26989
|
+
* savedFilters = convertFilterChangedToUpdateFiltersPayload(payload.data);
|
|
26990
|
+
* });
|
|
26991
|
+
*
|
|
26992
|
+
* // later, e.g. after a fresh page load
|
|
26993
|
+
* liveboardEmbed.trigger(HostEvent.UpdateFilters, savedFilters);
|
|
26994
|
+
* ```
|
|
26995
|
+
*/
|
|
26996
|
+
function convertFilterChangedToUpdateFiltersPayload(filterChangedPayload) {
|
|
26997
|
+
var _a, _b;
|
|
26998
|
+
const liveboardFilterParams = ((_a = filterChangedPayload === null || filterChangedPayload === void 0 ? void 0 : filterChangedPayload.liveboardFilters) !== null && _a !== void 0 ? _a : [])
|
|
26999
|
+
.flatMap(convertFilterGroupToParams);
|
|
27000
|
+
const runtimeFilterParams = ((_b = filterChangedPayload === null || filterChangedPayload === void 0 ? void 0 : filterChangedPayload.runtimeFilters) !== null && _b !== void 0 ? _b : [])
|
|
27001
|
+
.map(convertRuntimeFilterToParam)
|
|
27002
|
+
.filter((param) => param !== null);
|
|
27003
|
+
return { filters: [...liveboardFilterParams, ...runtimeFilterParams] };
|
|
27004
|
+
}
|
|
27005
|
+
|
|
26067
27006
|
/**
|
|
26068
27007
|
* Starts an automatic renderer that watches the DOM for iframes containing
|
|
26069
27008
|
* the `tsmcp=true` query parameter and replaces them with fully configured
|
|
@@ -26162,7 +27101,7 @@ class AutoFrameRenderer extends TsEmbed {
|
|
|
26162
27101
|
* @returns The constructed URL to use for the ThoughtSpot embed iframe.
|
|
26163
27102
|
*/
|
|
26164
27103
|
getMCPIframeSrc(sourceSrc) {
|
|
26165
|
-
const queryParams = this.
|
|
27104
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
26166
27105
|
const sourceURL = new URL(sourceSrc);
|
|
26167
27106
|
const existingQueryParams = sourceURL.searchParams;
|
|
26168
27107
|
const existingQueryParamsObject = Object.fromEntries(existingQueryParams);
|
|
@@ -26207,4 +27146,4 @@ class AutoFrameRenderer extends TsEmbed {
|
|
|
26207
27146
|
}
|
|
26208
27147
|
}
|
|
26209
27148
|
|
|
26210
|
-
export { Action, AnswerService, AppEmbed, ApplicabilityLevel, AuthEvent, AuthFailureType, AuthStatus, AuthType, BackgroundFormatType, BodylessConversation, ConditionalFormattingComparisonType, ConditionalFormattingOperator, ContextMenuTriggerOptions, ContextType, ConversationEmbed, CustomActionTarget, CustomActionsPosition, DataLabelFilterOperator, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedErrorCodes, EmbedErrorSeverity, EmbedEvent, ErrorDetailsTypes, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, InterceptedApiType, LegendPosition, ListPage, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, SpotterQueryMode, TableContentDensity, TableTheme, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, reloadIframe, resetCachedAuthToken, startAutoMCPFrameRenderer, tokenizedFetch, uploadMixpanelEvent };
|
|
27149
|
+
export { Action, AnswerService, AppEmbed, ApplicabilityLevel, AuthEvent, AuthFailureType, AuthStatus, AuthType, BackgroundFormatType, BodylessConversation, ConditionalFormattingComparisonType, ConditionalFormattingOperator, ContextMenuTriggerOptions, ContextType, ConversationEmbed, CustomActionTarget, CustomActionsPosition, DataLabelFilterOperator, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedErrorCodes, EmbedErrorSeverity, EmbedEvent, ErrorDetailsTypes, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, InterceptedApiType, LegendPosition, ListPage, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, SpotterQueryMode, TableContentDensity, TableTheme, UIPassthroughEvent, convertFilterChangedToUpdateFiltersPayload, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, reloadIframe, resetCachedAuthToken, startAutoMCPFrameRenderer, tokenizedFetch, uploadMixpanelEvent };
|