@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.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 (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -864,6 +864,9 @@
|
|
|
864
864
|
EmbedEvent["Download"] = "download";
|
|
865
865
|
/**
|
|
866
866
|
* Emitted when the download action is triggered on an Answer.
|
|
867
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
868
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
869
|
+
* accepts the union now; per-context enforced next release.
|
|
867
870
|
* Use start:true to subscribe to when download is initiated, or end:true to
|
|
868
871
|
* subscribe to when download is completed. Default is end:true.
|
|
869
872
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
|
|
@@ -880,6 +883,9 @@
|
|
|
880
883
|
EmbedEvent["DownloadAsPng"] = "downloadAsPng";
|
|
881
884
|
/**
|
|
882
885
|
* Emitted when the Download as PDF action is triggered on an Answer
|
|
886
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer; plus
|
|
887
|
+
* liveboardId on Liveboard), {@link RequiredVizRequest} (Spotter). trigger()
|
|
888
|
+
* accepts the union now; per-context enforced next release.
|
|
883
889
|
* Use start:true to subscribe to when download as PDF is initiated, or end:true to
|
|
884
890
|
* subscribe to when download as PDF is completed. Default is end:true.
|
|
885
891
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -896,6 +902,9 @@
|
|
|
896
902
|
EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
897
903
|
/**
|
|
898
904
|
* Emitted when the Download as CSV action is triggered on an Answer.
|
|
905
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
906
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
907
|
+
* accepts the union now; per-context enforced next release.
|
|
899
908
|
* Use start:true to subscribe to when download as CSV is initiated, or end:true to
|
|
900
909
|
* subscribe to when download as CSV is completed. Default is end:true.
|
|
901
910
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -912,6 +921,9 @@
|
|
|
912
921
|
EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
|
|
913
922
|
/**
|
|
914
923
|
* Emitted when the Download as XLSX action is triggered on an Answer.
|
|
924
|
+
* Payload varies by context: {@link VizScopedRequest} (Search, Answer,
|
|
925
|
+
* Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
|
|
926
|
+
* accepts the union now; per-context enforced next release.
|
|
915
927
|
* Use start:true to subscribe to when download as XLSX is initiated, or end:true to
|
|
916
928
|
* subscribe to when download as XLSX is completed. Default is end:true.
|
|
917
929
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
@@ -1190,6 +1202,9 @@
|
|
|
1190
1202
|
EmbedEvent["Schedule"] = "subscription";
|
|
1191
1203
|
/**
|
|
1192
1204
|
* Emitted when a user clicks **Edit** on a Liveboard or visualization
|
|
1205
|
+
* Payload varies by context: {@link VizScopedRequest} (Liveboard),
|
|
1206
|
+
* {@link RequiredVizRequest} (Spotter, vizId required). trigger() accepts the
|
|
1207
|
+
* union now; per-context enforced next release.
|
|
1193
1208
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1194
1209
|
* @example
|
|
1195
1210
|
* ```js
|
|
@@ -2269,6 +2284,7 @@
|
|
|
2269
2284
|
* the search query string.
|
|
2270
2285
|
* Supported in `AppEmbed` and `SearchEmbed` deployments.
|
|
2271
2286
|
* Includes the following properties:
|
|
2287
|
+
* Payload: {@link SearchRequest}.
|
|
2272
2288
|
* @param - Includes the following keys:
|
|
2273
2289
|
* - `searchQuery`: Query string with search tokens.
|
|
2274
2290
|
* - `dataSources`: Data source GUID to search on.
|
|
@@ -2296,6 +2312,9 @@
|
|
|
2296
2312
|
HostEvent["Search"] = "search";
|
|
2297
2313
|
/**
|
|
2298
2314
|
* Triggers a drill on certain points of the specified column
|
|
2315
|
+
* Payload: {@link DrillDownRequest}; in Liveboard context vizId is required
|
|
2316
|
+
* ({@link RequiredVizRequest}). trigger() accepts the union now; per-context
|
|
2317
|
+
* enforced next release.
|
|
2299
2318
|
* Includes the following properties:
|
|
2300
2319
|
* @param - Includes the following keys:
|
|
2301
2320
|
* - `points`: An object containing `selectedPoints` and/or `clickedPoint`
|
|
@@ -2375,6 +2394,8 @@
|
|
|
2375
2394
|
HostEvent["Reload"] = "reload";
|
|
2376
2395
|
/**
|
|
2377
2396
|
* Get iframe URL for the current embed view.
|
|
2397
|
+
* Payload: none.
|
|
2398
|
+
* Response: {@link GetIframeUrlResponse}.
|
|
2378
2399
|
* @example
|
|
2379
2400
|
* ```js
|
|
2380
2401
|
* const url = embed.trigger(HostEvent.GetIframeUrl);
|
|
@@ -2393,6 +2414,7 @@
|
|
|
2393
2414
|
HostEvent["GetIframeUrl"] = "GetIframeUrl";
|
|
2394
2415
|
/**
|
|
2395
2416
|
* Display specific visualizations on a Liveboard.
|
|
2417
|
+
* Payload: `string[]`.
|
|
2396
2418
|
* @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
|
|
2397
2419
|
* in this parameter will be hidden.
|
|
2398
2420
|
* @example
|
|
@@ -2415,6 +2437,7 @@
|
|
|
2415
2437
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
2416
2438
|
/**
|
|
2417
2439
|
* Set a Liveboard tab as an active tab.
|
|
2440
|
+
* Payload: {@link SetActiveTabRequest}.
|
|
2418
2441
|
* @param - tabId - string of id of Tab to show
|
|
2419
2442
|
* @example
|
|
2420
2443
|
* ```js
|
|
@@ -2442,6 +2465,7 @@
|
|
|
2442
2465
|
* and `AppEmbed` only. In full application embedding, this event updates
|
|
2443
2466
|
* the runtime filters applied on the Liveboard and saved Answer objects.
|
|
2444
2467
|
*
|
|
2468
|
+
* Payload: {@link RuntimeFilter}[].
|
|
2445
2469
|
* @param - Array of {@link RuntimeFilter} objects. Each item includes:
|
|
2446
2470
|
* - `columnName`: Name of the column to filter on.
|
|
2447
2471
|
* - `operator`: {@link RuntimeFilterOp} to apply. For more information, see
|
|
@@ -2483,6 +2507,7 @@
|
|
|
2483
2507
|
* Accepts either a plain value or an object with `path`
|
|
2484
2508
|
* and an optional `replace` flag.
|
|
2485
2509
|
*
|
|
2510
|
+
* Payload: `string` | `number` | {@link NavigateRequest}.
|
|
2486
2511
|
* @param data - A string path, a numeric history delta, or an object
|
|
2487
2512
|
* `{ path: string | number, replace?: boolean }`.
|
|
2488
2513
|
* - `path` — the route to navigate to, or a history delta such as `1`
|
|
@@ -2510,6 +2535,9 @@
|
|
|
2510
2535
|
/**
|
|
2511
2536
|
* Open the filter panel for a particular column.
|
|
2512
2537
|
* Works with Search and Liveboard embed.
|
|
2538
|
+
* Payload: {@link OpenFilterRequest} (the cross-context superset). The
|
|
2539
|
+
* accepted fields vary by context: {@link OpenFilterLiveboardRequest},
|
|
2540
|
+
* {@link OpenFilterSpotterRequest}, {@link OpenFilterSearchRequest}.
|
|
2513
2541
|
* @param - { columnId: string,
|
|
2514
2542
|
* name: string,
|
|
2515
2543
|
* type: ATTRIBUTE/MEASURE,
|
|
@@ -2592,6 +2620,7 @@
|
|
|
2592
2620
|
/**
|
|
2593
2621
|
* Open the parameter panel for a particular parameter on a Liveboard.
|
|
2594
2622
|
* Mirrors {@link HostEvent.OpenFilter} for parameters.
|
|
2623
|
+
* Payload: {@link OpenParameterRequest}.
|
|
2595
2624
|
* @param - Includes the following keys:
|
|
2596
2625
|
* - `parameter`: An object identifying the parameter to open, for
|
|
2597
2626
|
* example, `{ parameterId: '<parameter-GUID>' }`.
|
|
@@ -2623,6 +2652,7 @@
|
|
|
2623
2652
|
HostEvent["OpenParameter"] = "openParameter";
|
|
2624
2653
|
/**
|
|
2625
2654
|
* Add columns to the current search query.
|
|
2655
|
+
* Payload: `{ columnIds: string[] }`.
|
|
2626
2656
|
* @param - { columnIds: string[] }
|
|
2627
2657
|
* @example
|
|
2628
2658
|
* ```js
|
|
@@ -2641,6 +2671,7 @@
|
|
|
2641
2671
|
HostEvent["AddColumns"] = "addColumns";
|
|
2642
2672
|
/**
|
|
2643
2673
|
* Remove a column from the current search query.
|
|
2674
|
+
* Payload: `{ columnId: string }`.
|
|
2644
2675
|
* @param - { columnId: string }
|
|
2645
2676
|
* @example
|
|
2646
2677
|
* ```js
|
|
@@ -2665,6 +2696,8 @@
|
|
|
2665
2696
|
* sorting, toggling of legends, and data drill down.
|
|
2666
2697
|
* For more information, see
|
|
2667
2698
|
* link:https://developers.thoughtspot.com/docs/fetch-data-and-report-apis#transient-lb-content[Liveboard data with unsaved changes].
|
|
2699
|
+
* Payload: none.
|
|
2700
|
+
* Response: {@link GetExportRequestForCurrentPinboardResponse}.
|
|
2668
2701
|
* @example
|
|
2669
2702
|
* ```js
|
|
2670
2703
|
* liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard).then(
|
|
@@ -2686,6 +2719,8 @@
|
|
|
2686
2719
|
* requiring additional user input via the *Pin to Liveboard* modal, define
|
|
2687
2720
|
* the following parameters:
|
|
2688
2721
|
*
|
|
2722
|
+
* Payload: {@link PinAnswerToLiveboardRequest}.
|
|
2723
|
+
* Response: {@link PinAnswerToLiveboardResponse}.
|
|
2689
2724
|
* @param - Includes the following keys:
|
|
2690
2725
|
* - `vizId`: GUID of the saved Answer or Spotter visualization ID to pin to a
|
|
2691
2726
|
* Liveboard.
|
|
@@ -2800,6 +2835,7 @@
|
|
|
2800
2835
|
HostEvent["LiveboardInfo"] = "pinboardInfo";
|
|
2801
2836
|
/**
|
|
2802
2837
|
* Trigger the **Schedule** action on an embedded Liveboard.
|
|
2838
|
+
* Payload: {@link VizScopedRequest}.
|
|
2803
2839
|
* @example
|
|
2804
2840
|
* ```js
|
|
2805
2841
|
* liveboardEmbed.trigger(HostEvent.Schedule)
|
|
@@ -2815,6 +2851,7 @@
|
|
|
2815
2851
|
HostEvent["Schedule"] = "subscription";
|
|
2816
2852
|
/**
|
|
2817
2853
|
* Trigger the **Manage schedule** action on an embedded Liveboard
|
|
2854
|
+
* Payload: {@link VizScopedRequest}.
|
|
2818
2855
|
* @example
|
|
2819
2856
|
* ```js
|
|
2820
2857
|
* liveboardEmbed.trigger(HostEvent.SchedulesList)
|
|
@@ -2831,6 +2868,7 @@
|
|
|
2831
2868
|
/**
|
|
2832
2869
|
* Trigger the **Export TML** action on an embedded Liveboard or
|
|
2833
2870
|
* Answer.
|
|
2871
|
+
* Payload: {@link VizScopedRequest}.
|
|
2834
2872
|
* @example
|
|
2835
2873
|
* ```js
|
|
2836
2874
|
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
@@ -2853,6 +2891,7 @@
|
|
|
2853
2891
|
/**
|
|
2854
2892
|
* Trigger the **Edit TML** action on an embedded Liveboard or
|
|
2855
2893
|
* saved Answers in the full application embedding.
|
|
2894
|
+
* Payload: {@link VizScopedRequest}.
|
|
2856
2895
|
* @example
|
|
2857
2896
|
* ```js
|
|
2858
2897
|
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
@@ -2874,6 +2913,7 @@
|
|
|
2874
2913
|
HostEvent["EditTML"] = "editTSL";
|
|
2875
2914
|
/**
|
|
2876
2915
|
* Trigger the **Update TML** action on an embedded Liveboard.
|
|
2916
|
+
* Payload: {@link VizScopedRequest}.
|
|
2877
2917
|
* @example
|
|
2878
2918
|
* ```js
|
|
2879
2919
|
* liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
@@ -2891,6 +2931,7 @@
|
|
|
2891
2931
|
* Trigger the **Download PDF** action on an embedded Liveboard,
|
|
2892
2932
|
* visualization or Answer.
|
|
2893
2933
|
*
|
|
2934
|
+
* Payload: {@link VizScopedRequest} plus optional `liveboardId`.
|
|
2894
2935
|
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2895
2936
|
*
|
|
2896
2937
|
* **NOTE**: The **Download** > **PDF** action is available on
|
|
@@ -2941,6 +2982,7 @@
|
|
|
2941
2982
|
/**
|
|
2942
2983
|
* Trigger the **AI Highlights** action on an embedded Liveboard
|
|
2943
2984
|
*
|
|
2985
|
+
* Payload: none.
|
|
2944
2986
|
* @example
|
|
2945
2987
|
* ```js
|
|
2946
2988
|
* liveboardEmbed.trigger(HostEvent.AIHighlights)
|
|
@@ -2995,6 +3037,9 @@
|
|
|
2995
3037
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
2996
3038
|
/**
|
|
2997
3039
|
* Trigger the **Delete** action for a Liveboard.
|
|
3040
|
+
* Payload varies by context: {@link RequiredVizRequest} (Liveboard, vizId
|
|
3041
|
+
* required), {@link VizScopedRequest} (Search). trigger() accepts the union
|
|
3042
|
+
* now; per-context enforced next release.
|
|
2998
3043
|
* @example
|
|
2999
3044
|
* ```js
|
|
3000
3045
|
* appEmbed.trigger(HostEvent.Remove)
|
|
@@ -3009,6 +3054,7 @@
|
|
|
3009
3054
|
HostEvent["Remove"] = "delete";
|
|
3010
3055
|
/**
|
|
3011
3056
|
* Trigger the **Explore** action on a visualization.
|
|
3057
|
+
* Payload: {@link RequiredVizRequest}.
|
|
3012
3058
|
* @param - an object with `vizId` as a key
|
|
3013
3059
|
* @example
|
|
3014
3060
|
* ```js
|
|
@@ -3028,6 +3074,7 @@
|
|
|
3028
3074
|
/**
|
|
3029
3075
|
* Trigger the **Create alert** action on a KPI chart
|
|
3030
3076
|
* in a Liveboard or saved Answer.
|
|
3077
|
+
* Payload: {@link VizScopedRequest}.
|
|
3031
3078
|
* @param - an object with `vizId` as a key
|
|
3032
3079
|
* @example
|
|
3033
3080
|
* ```js
|
|
@@ -3059,6 +3106,7 @@
|
|
|
3059
3106
|
/**
|
|
3060
3107
|
* Trigger the **Manage alerts** action on a KPI chart
|
|
3061
3108
|
* in a visualization or saved Answer.
|
|
3109
|
+
* Payload: {@link VizScopedRequest}.
|
|
3062
3110
|
* @param - an object with `vizId` as a key
|
|
3063
3111
|
* @example
|
|
3064
3112
|
* ```js
|
|
@@ -3096,6 +3144,7 @@
|
|
|
3096
3144
|
* on a Liveboard.
|
|
3097
3145
|
*
|
|
3098
3146
|
* This event is not supported in visualization embed and search embed.
|
|
3147
|
+
* Payload: {@link VizScopedRequest}.
|
|
3099
3148
|
* @param - Object parameter. Includes the following keys:
|
|
3100
3149
|
* - `vizId`: To trigger the action for a specific visualization in Liveboard embed,
|
|
3101
3150
|
* pass in `vizId` as a key. In Spotter embed, `vizId` refers to the Answer ID and
|
|
@@ -3138,6 +3187,7 @@
|
|
|
3138
3187
|
HostEvent["Edit"] = "edit";
|
|
3139
3188
|
/**
|
|
3140
3189
|
* Trigger the **Copy link** action on a Liveboard or visualization
|
|
3190
|
+
* Payload: {@link VizScopedRequest}.
|
|
3141
3191
|
* @param - object - to trigger the action for a
|
|
3142
3192
|
* specific visualization in Liveboard embed, pass in `vizId` as a key
|
|
3143
3193
|
* @example
|
|
@@ -3183,6 +3233,7 @@
|
|
|
3183
3233
|
HostEvent["CopyLink"] = "embedDocument";
|
|
3184
3234
|
/**
|
|
3185
3235
|
* Trigger the **Present** action on a Liveboard or visualization
|
|
3236
|
+
* Payload: {@link VizScopedRequest}.
|
|
3186
3237
|
* @param - object - to trigger the action for a specific visualization
|
|
3187
3238
|
* in Liveboard embed, pass in `vizId` as a key
|
|
3188
3239
|
* @example
|
|
@@ -3228,6 +3279,8 @@
|
|
|
3228
3279
|
HostEvent["Present"] = "present";
|
|
3229
3280
|
/**
|
|
3230
3281
|
* Get TML for the current search.
|
|
3282
|
+
* Payload: {@link GetTMLRequest}.
|
|
3283
|
+
* Response: `Record<string, any>`.
|
|
3231
3284
|
* @example
|
|
3232
3285
|
* ```js
|
|
3233
3286
|
* searchEmbed.trigger(HostEvent.GetTML).then((tml) => {
|
|
@@ -3277,6 +3330,7 @@
|
|
|
3277
3330
|
* Trigger the **Show underlying data** action on a
|
|
3278
3331
|
* chart or table.
|
|
3279
3332
|
*
|
|
3333
|
+
* Payload: {@link VizScopedRequest}.
|
|
3280
3334
|
* @param - an object with vizId as a key
|
|
3281
3335
|
* @example
|
|
3282
3336
|
* ```js
|
|
@@ -3310,6 +3364,7 @@
|
|
|
3310
3364
|
* Trigger the **Delete** action for a visualization
|
|
3311
3365
|
* in an embedded Liveboard, or a chart or table
|
|
3312
3366
|
* generated from Search.
|
|
3367
|
+
* Payload: {@link VizScopedRequest}.
|
|
3313
3368
|
* @param - Liveboard embed takes an object with `vizId` as a key.
|
|
3314
3369
|
* Can be left empty if embedding Search or visualization.
|
|
3315
3370
|
* @example
|
|
@@ -3338,6 +3393,7 @@
|
|
|
3338
3393
|
/**
|
|
3339
3394
|
* Trigger the **SpotIQ analyze** action on a
|
|
3340
3395
|
* chart or table.
|
|
3396
|
+
* Payload: {@link VizScopedRequest}.
|
|
3341
3397
|
* @param - Liveboard embed takes `vizId` as a
|
|
3342
3398
|
* key. Can be left undefined when embedding Search or
|
|
3343
3399
|
* visualization.
|
|
@@ -3400,6 +3456,7 @@
|
|
|
3400
3456
|
/**
|
|
3401
3457
|
* Trigger the **Download** > **PNG** action on
|
|
3402
3458
|
* charts in the embedded view.
|
|
3459
|
+
* Payload: {@link VizScopedRequest}.
|
|
3403
3460
|
* @example
|
|
3404
3461
|
* ```js
|
|
3405
3462
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPng,
|
|
@@ -3431,6 +3488,7 @@
|
|
|
3431
3488
|
/**
|
|
3432
3489
|
* Trigger the **Download** > **CSV** action on tables in
|
|
3433
3490
|
* the embedded view.
|
|
3491
|
+
* Payload: {@link VizScopedRequest}.
|
|
3434
3492
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
3435
3493
|
* @example
|
|
3436
3494
|
* ```js
|
|
@@ -3470,6 +3528,7 @@
|
|
|
3470
3528
|
/**
|
|
3471
3529
|
* Trigger the **Download** > **XLSX** action on tables
|
|
3472
3530
|
* in the embedded view.
|
|
3531
|
+
* Payload: {@link VizScopedRequest}.
|
|
3473
3532
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
3474
3533
|
* @example
|
|
3475
3534
|
* ```js
|
|
@@ -3509,6 +3568,7 @@
|
|
|
3509
3568
|
/**
|
|
3510
3569
|
* Trigger the **Share** action on an embedded
|
|
3511
3570
|
* Liveboard or Answer.
|
|
3571
|
+
* Payload: {@link VizScopedRequest}.
|
|
3512
3572
|
* @example
|
|
3513
3573
|
* ```js
|
|
3514
3574
|
* liveboardEmbed.trigger(HostEvent.Share)
|
|
@@ -3535,6 +3595,7 @@
|
|
|
3535
3595
|
* Trigger the **Save** action on a Liveboard, Answer, or Spotter.
|
|
3536
3596
|
* Saves the changes.
|
|
3537
3597
|
*
|
|
3598
|
+
* Payload: {@link VizScopedRequest}.
|
|
3538
3599
|
* @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
|
|
3539
3600
|
* It is required and can be retrieved from the data embed event.
|
|
3540
3601
|
*
|
|
@@ -3586,6 +3647,7 @@
|
|
|
3586
3647
|
/**
|
|
3587
3648
|
* Trigger the **Sync to Sheets** action on an embedded visualization or Answer
|
|
3588
3649
|
* Sends data from an Answer or Liveboard visualization to a Google sheet.
|
|
3650
|
+
* Payload: {@link VizScopedRequest}.
|
|
3589
3651
|
* @param - an object with `vizId` as a key
|
|
3590
3652
|
* @example
|
|
3591
3653
|
* ```js
|
|
@@ -3616,6 +3678,7 @@
|
|
|
3616
3678
|
* Trigger the **Sync to Other Apps** action on an embedded visualization or Answer
|
|
3617
3679
|
* Sends data from an Answer or Liveboard visualization to third-party apps such
|
|
3618
3680
|
* as Slack, Salesforce, Microsoft Teams, ServiceNow and so on.
|
|
3681
|
+
* Payload: {@link VizScopedRequest}.
|
|
3619
3682
|
* @param - an object with vizId as a key
|
|
3620
3683
|
* @example
|
|
3621
3684
|
* ```js
|
|
@@ -3646,6 +3709,7 @@
|
|
|
3646
3709
|
* Trigger the **Manage pipelines** action on an embedded
|
|
3647
3710
|
* visualization or Answer.
|
|
3648
3711
|
* Allows users to manage ThoughtSpot Sync pipelines.
|
|
3712
|
+
* Payload: {@link VizScopedRequest}.
|
|
3649
3713
|
* @param - an object with `vizId` as a key
|
|
3650
3714
|
* @example
|
|
3651
3715
|
* ```js
|
|
@@ -3674,6 +3738,7 @@
|
|
|
3674
3738
|
HostEvent["ManagePipelines"] = "manage-pipeline";
|
|
3675
3739
|
/**
|
|
3676
3740
|
* Reset search operation on the Search or Answer page.
|
|
3741
|
+
* Payload: none.
|
|
3677
3742
|
* @example
|
|
3678
3743
|
* ```js
|
|
3679
3744
|
* searchEmbed.trigger(HostEvent.ResetSearch)
|
|
@@ -3701,10 +3766,18 @@
|
|
|
3701
3766
|
* whole Liveboard.
|
|
3702
3767
|
* The `applicability` attribute is available from SDK: 1.53.0 |
|
|
3703
3768
|
* ThoughtSpot: 26.10.0.cl.
|
|
3769
|
+
* Payload: {@link GetFiltersRequest}.
|
|
3770
|
+
* Response: {@link GetFiltersResponse}.
|
|
3704
3771
|
* @example
|
|
3705
3772
|
* ```js
|
|
3706
3773
|
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
|
|
3707
3774
|
* console.log('data', data);
|
|
3775
|
+
* // {
|
|
3776
|
+
* // liveboardFilters: [ ... ],
|
|
3777
|
+
* // runtimeFilters: [
|
|
3778
|
+
* // { columnName: "Region", operator: "IN", values: ["West"] }
|
|
3779
|
+
* // ]
|
|
3780
|
+
* // }
|
|
3708
3781
|
* ```
|
|
3709
3782
|
* @example
|
|
3710
3783
|
* ```js
|
|
@@ -3720,6 +3793,7 @@
|
|
|
3720
3793
|
HostEvent["GetFilters"] = "getFilters";
|
|
3721
3794
|
/**
|
|
3722
3795
|
* Update one or several filters applied on a Liveboard.
|
|
3796
|
+
* Payload: {@link UpdateFiltersRequest}.
|
|
3723
3797
|
* @param - Includes the following keys:
|
|
3724
3798
|
* - `filter`: A single filter object containing column name, filter operator, and
|
|
3725
3799
|
* values.
|
|
@@ -3728,9 +3802,9 @@
|
|
|
3728
3802
|
*
|
|
3729
3803
|
* Each filter object must include the following attributes:
|
|
3730
3804
|
*
|
|
3731
|
-
* `
|
|
3805
|
+
* `columnName` - Name of the column to filter on.
|
|
3732
3806
|
*
|
|
3733
|
-
* `
|
|
3807
|
+
* `operator` - Filter operator, for example, EQ, IN, CONTAINS.
|
|
3734
3808
|
* For information about the supported filter operators,
|
|
3735
3809
|
* see link:https://developers.thoughtspot.com/docs/runtime-filters#rtOperator[Developer Documentation].
|
|
3736
3810
|
*
|
|
@@ -3757,8 +3831,8 @@
|
|
|
3757
3831
|
*
|
|
3758
3832
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3759
3833
|
* filter: {
|
|
3760
|
-
*
|
|
3761
|
-
*
|
|
3834
|
+
* columnName: "item type",
|
|
3835
|
+
* operator: "IN",
|
|
3762
3836
|
* values: ["bags","shirts"]
|
|
3763
3837
|
* }
|
|
3764
3838
|
* });
|
|
@@ -3768,8 +3842,8 @@
|
|
|
3768
3842
|
*
|
|
3769
3843
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3770
3844
|
* filter: {
|
|
3771
|
-
*
|
|
3772
|
-
*
|
|
3845
|
+
* columnName: "date",
|
|
3846
|
+
* operator: "EQ",
|
|
3773
3847
|
* values: ["JULY","2023"],
|
|
3774
3848
|
* type: "MONTH_YEAR"
|
|
3775
3849
|
* }
|
|
@@ -3780,18 +3854,18 @@
|
|
|
3780
3854
|
* ```js
|
|
3781
3855
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3782
3856
|
* filters: [{
|
|
3783
|
-
*
|
|
3784
|
-
*
|
|
3857
|
+
* columnName: "Item Type",
|
|
3858
|
+
* operator: 'IN',
|
|
3785
3859
|
* values: ["bags","shirts"]
|
|
3786
3860
|
* },
|
|
3787
3861
|
* {
|
|
3788
|
-
*
|
|
3789
|
-
*
|
|
3862
|
+
* columnName: "Region",
|
|
3863
|
+
* operator: 'IN',
|
|
3790
3864
|
* values: ["West","Midwest"]
|
|
3791
3865
|
* },
|
|
3792
3866
|
* {
|
|
3793
|
-
*
|
|
3794
|
-
*
|
|
3867
|
+
* columnName: "Date",
|
|
3868
|
+
* operator: 'EQ',
|
|
3795
3869
|
* values: ["2023-07-31"],
|
|
3796
3870
|
* type: "EXACT_DATE"
|
|
3797
3871
|
* }]
|
|
@@ -3805,13 +3879,13 @@
|
|
|
3805
3879
|
* ```js
|
|
3806
3880
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3807
3881
|
* filters: [{
|
|
3808
|
-
*
|
|
3809
|
-
*
|
|
3882
|
+
* columnName: "(Sample) Retail - Apparel::city",
|
|
3883
|
+
* operator: 'IN',
|
|
3810
3884
|
* values: ["atlanta"]
|
|
3811
3885
|
* },
|
|
3812
3886
|
* {
|
|
3813
|
-
*
|
|
3814
|
-
*
|
|
3887
|
+
* columnName: "(Sample) Retail - Apparel::Region",
|
|
3888
|
+
* operator: 'IN',
|
|
3815
3889
|
* values: ["West","Midwest"]
|
|
3816
3890
|
* }]
|
|
3817
3891
|
* });
|
|
@@ -3822,8 +3896,8 @@
|
|
|
3822
3896
|
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3823
3897
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3824
3898
|
* filter: {
|
|
3825
|
-
*
|
|
3826
|
-
*
|
|
3899
|
+
* columnName: "item type",
|
|
3900
|
+
* operator: "IN",
|
|
3827
3901
|
* values: ["shoes", "boots"]
|
|
3828
3902
|
* }
|
|
3829
3903
|
* }, ContextType.Liveboard);
|
|
@@ -3833,8 +3907,8 @@
|
|
|
3833
3907
|
* // Scope the filter to a specific Liveboard tab
|
|
3834
3908
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3835
3909
|
* filter: {
|
|
3836
|
-
*
|
|
3837
|
-
*
|
|
3910
|
+
* columnName: "item type",
|
|
3911
|
+
* operator: "IN",
|
|
3838
3912
|
* values: ["bags", "shirts"],
|
|
3839
3913
|
* applicability: {
|
|
3840
3914
|
* level: "TAB",
|
|
@@ -3843,11 +3917,19 @@
|
|
|
3843
3917
|
* }
|
|
3844
3918
|
* });
|
|
3845
3919
|
* ```
|
|
3920
|
+
* Use `columnName` and `operator` - the same spelling as
|
|
3921
|
+
* {@link RuntimeFilter}. The older `column` and `oper` spellings are
|
|
3922
|
+
* deprecated; they are still accepted, but pass only one spelling of each
|
|
3923
|
+
* field, never both. To reapply the filter state captured from
|
|
3924
|
+
* {@link EmbedEvent.FilterChanged}, use `convertFilterChangedToUpdateFiltersPayload`
|
|
3925
|
+
* to convert its payload into the shape expected here.
|
|
3846
3926
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
3847
3927
|
*/
|
|
3848
3928
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
3849
3929
|
/**
|
|
3850
3930
|
* Get tab details for the current Liveboard.
|
|
3931
|
+
* Payload: none.
|
|
3932
|
+
* Response: {@link GetTabsResponse}.
|
|
3851
3933
|
* @example
|
|
3852
3934
|
* ```js
|
|
3853
3935
|
* liveboardEmbed.trigger(HostEvent.GetTabs).then((tabDetails) => {
|
|
@@ -3873,6 +3955,8 @@
|
|
|
3873
3955
|
/**
|
|
3874
3956
|
* Get group details for the current Liveboard.
|
|
3875
3957
|
* Mirrors {@link HostEvent.GetTabs} for filter/parameter groups.
|
|
3958
|
+
* Payload: none.
|
|
3959
|
+
* Response: {@link GetGroupsResponse}.
|
|
3876
3960
|
* @example
|
|
3877
3961
|
* ```js
|
|
3878
3962
|
* liveboardEmbed.trigger(HostEvent.GetGroups).then((groupDetails) => {
|
|
@@ -3897,6 +3981,7 @@
|
|
|
3897
3981
|
HostEvent["GetGroups"] = "getGroups";
|
|
3898
3982
|
/**
|
|
3899
3983
|
* Set the visible tabs on a Liveboard.
|
|
3984
|
+
* Payload: `string[]`.
|
|
3900
3985
|
* @param - an array of ids of tabs to show, the IDs not passed
|
|
3901
3986
|
* will be hidden.
|
|
3902
3987
|
* @example
|
|
@@ -3919,6 +4004,7 @@
|
|
|
3919
4004
|
HostEvent["SetVisibleTabs"] = "SetPinboardVisibleTabs";
|
|
3920
4005
|
/**
|
|
3921
4006
|
* Set the hidden tabs on a Liveboard.
|
|
4007
|
+
* Payload: `string[]`.
|
|
3922
4008
|
* @param - an array of the IDs of the tabs to hide.
|
|
3923
4009
|
* The IDs not passed will be shown.
|
|
3924
4010
|
* @example
|
|
@@ -3947,6 +4033,8 @@
|
|
|
3947
4033
|
* `getAnswerService()` method on the embed instance to get an AnswerService
|
|
3948
4034
|
* object that provides a more convenient interface for working with answers.
|
|
3949
4035
|
*
|
|
4036
|
+
* Payload: {@link GetAnswerSessionRequest}.
|
|
4037
|
+
* Response: {@link GetAnswerSessionResponse}.
|
|
3950
4038
|
* @example
|
|
3951
4039
|
* ```js
|
|
3952
4040
|
* // Preferred way to get an AnswerService
|
|
@@ -3974,6 +4062,7 @@
|
|
|
3974
4062
|
HostEvent["GetAnswerSession"] = "getAnswerSession";
|
|
3975
4063
|
/**
|
|
3976
4064
|
* Trigger the *Ask Sage* action for visualizations
|
|
4065
|
+
* Payload: {@link RequiredVizRequest}.
|
|
3977
4066
|
* @example
|
|
3978
4067
|
* ```js
|
|
3979
4068
|
* liveboardEmbed.trigger(HostEvent.AskSage,
|
|
@@ -3985,6 +4074,7 @@
|
|
|
3985
4074
|
/**
|
|
3986
4075
|
* Trigger cross filter update action on a Liveboard.
|
|
3987
4076
|
*
|
|
4077
|
+
* Payload: {@link UpdateCrossFilterRequest}.
|
|
3988
4078
|
* @example
|
|
3989
4079
|
* ```js
|
|
3990
4080
|
* liveboardEmbed.trigger(HostEvent.UpdateCrossFilter, {
|
|
@@ -4000,7 +4090,9 @@
|
|
|
4000
4090
|
HostEvent["UpdateCrossFilter"] = "UpdateCrossFilter";
|
|
4001
4091
|
/**
|
|
4002
4092
|
* Trigger reset action for a personalized Liveboard view.
|
|
4003
|
-
* This event is deprecated.
|
|
4093
|
+
* This event is deprecated.
|
|
4094
|
+
* Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
|
|
4095
|
+
* Payload: none.
|
|
4004
4096
|
* @example
|
|
4005
4097
|
* ```js
|
|
4006
4098
|
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
|
|
@@ -4021,6 +4113,7 @@
|
|
|
4021
4113
|
/**
|
|
4022
4114
|
* Triggers an action to update Parameter values on embedded
|
|
4023
4115
|
* Answers, Liveboard, and Spotter answer in Edit mode.
|
|
4116
|
+
* Payload: {@link RuntimeParameter}[].
|
|
4024
4117
|
* @param - Includes the following keys for each item:
|
|
4025
4118
|
* - `name`: Name of the parameter.
|
|
4026
4119
|
* - `value`: The value to set for the parameter.
|
|
@@ -4078,6 +4171,8 @@
|
|
|
4078
4171
|
* whole Liveboard.
|
|
4079
4172
|
* The `applicability` attribute is available from SDK: 1.53.0 |
|
|
4080
4173
|
* ThoughtSpot: 26.10.0.cl.
|
|
4174
|
+
* Payload: none.
|
|
4175
|
+
* Response: {@link GetParametersResponse}.
|
|
4081
4176
|
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
4082
4177
|
* ```js
|
|
4083
4178
|
* liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
|
|
@@ -4115,6 +4210,7 @@
|
|
|
4115
4210
|
* ```js
|
|
4116
4211
|
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
|
|
4117
4212
|
* ```
|
|
4213
|
+
* Payload: {@link PersonalisedViewRequest} (`viewId` only).
|
|
4118
4214
|
* @example
|
|
4119
4215
|
* ```js
|
|
4120
4216
|
* // Update personalized view from liveboard context
|
|
@@ -4147,6 +4243,7 @@
|
|
|
4147
4243
|
* If neither is provided, the Liveboard resets to the original/default view.
|
|
4148
4244
|
* When a `viewName` is provided and multiple views share
|
|
4149
4245
|
* the same name, the first match is selected.
|
|
4246
|
+
* Payload: {@link PersonalisedViewRequest}.
|
|
4150
4247
|
* @example
|
|
4151
4248
|
* ```js
|
|
4152
4249
|
* liveboardEmbed.trigger(
|
|
@@ -4190,6 +4287,8 @@
|
|
|
4190
4287
|
* If no parameters are specified, the save action is
|
|
4191
4288
|
* triggered with a modal to prompt users to
|
|
4192
4289
|
* add a name and description for the Answer.
|
|
4290
|
+
* Payload: {@link SaveAnswerRequest}.
|
|
4291
|
+
* Response: {@link SaveAnswerResponse}.
|
|
4193
4292
|
* @param - Includes the following keys:
|
|
4194
4293
|
* - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
|
|
4195
4294
|
* embed.
|
|
@@ -4275,6 +4374,7 @@
|
|
|
4275
4374
|
/**
|
|
4276
4375
|
* Triggers a search operation with the search tokens specified in
|
|
4277
4376
|
* the search query string in spotter embed.
|
|
4377
|
+
* Payload: {@link SpotterSearchRequest}.
|
|
4278
4378
|
* @param - Includes the following keys:
|
|
4279
4379
|
* - `query`: Text string in Natural Language format.
|
|
4280
4380
|
* - `executeSearch`: Boolean to execute search and update search query.
|
|
@@ -4299,6 +4399,7 @@
|
|
|
4299
4399
|
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
4300
4400
|
/**
|
|
4301
4401
|
* Edits the last prompt in spotter embed.
|
|
4402
|
+
* Payload: `string`.
|
|
4302
4403
|
* @param - `query`: Text string
|
|
4303
4404
|
* @example
|
|
4304
4405
|
* ```js
|
|
@@ -4315,6 +4416,7 @@
|
|
|
4315
4416
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
4316
4417
|
/**
|
|
4317
4418
|
* Opens the data source preview modal in Spotter Embed.
|
|
4419
|
+
* Payload: none.
|
|
4318
4420
|
* @example
|
|
4319
4421
|
* ```js
|
|
4320
4422
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
@@ -4350,6 +4452,7 @@
|
|
|
4350
4452
|
HostEvent["DataModelInstructions"] = "DataModelInstructions";
|
|
4351
4453
|
/**
|
|
4352
4454
|
* Resets the Spotter Embed Conversation.
|
|
4455
|
+
* Payload: none.
|
|
4353
4456
|
* @example
|
|
4354
4457
|
* ```js
|
|
4355
4458
|
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
@@ -4362,6 +4465,7 @@
|
|
|
4362
4465
|
* `conversationId` is **mandatory** — you must pass the id of the
|
|
4363
4466
|
* conversation to share. Also no-op when sharing is disabled
|
|
4364
4467
|
* (enableShareConversation off) or when already in the read-only shared view.
|
|
4468
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4365
4469
|
* @example
|
|
4366
4470
|
* ```js
|
|
4367
4471
|
* spotterEmbed.trigger(HostEvent.ShareSpotterConversation, { conversationId: 'abc' });
|
|
@@ -4371,6 +4475,7 @@
|
|
|
4371
4475
|
HostEvent["ShareSpotterConversation"] = "ShareSpotterConversation";
|
|
4372
4476
|
/**
|
|
4373
4477
|
* Closes the Spotter share-conversation modal. No-op if none is open.
|
|
4478
|
+
* Payload: none.
|
|
4374
4479
|
* @example
|
|
4375
4480
|
* ```js
|
|
4376
4481
|
* spotterEmbed.trigger(HostEvent.CloseSpotterShareConversation);
|
|
@@ -4380,6 +4485,7 @@
|
|
|
4380
4485
|
HostEvent["CloseSpotterShareConversation"] = "CloseSpotterShareConversation";
|
|
4381
4486
|
/**
|
|
4382
4487
|
* Exits the read-only shared-conversation view.
|
|
4488
|
+
* Payload: none.
|
|
4383
4489
|
* @example
|
|
4384
4490
|
* ```js
|
|
4385
4491
|
* spotterEmbed.trigger(HostEvent.ExitSpotterSharedConversation);
|
|
@@ -4389,6 +4495,7 @@
|
|
|
4389
4495
|
HostEvent["ExitSpotterSharedConversation"] = "ExitSpotterSharedConversation";
|
|
4390
4496
|
/**
|
|
4391
4497
|
* Deletes the last prompt in spotter embed.
|
|
4498
|
+
* Payload: none.
|
|
4392
4499
|
* @example
|
|
4393
4500
|
* ```js
|
|
4394
4501
|
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
@@ -4398,6 +4505,7 @@
|
|
|
4398
4505
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
4399
4506
|
/**
|
|
4400
4507
|
* Toggle the visualization to chart or table view.
|
|
4508
|
+
* Payload: {@link RequiredVizRequest}.
|
|
4401
4509
|
* @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
|
|
4402
4510
|
* @example
|
|
4403
4511
|
* ```js
|
|
@@ -4436,6 +4544,7 @@
|
|
|
4436
4544
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
4437
4545
|
/**
|
|
4438
4546
|
* Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
|
|
4547
|
+
* Payload: {@link RequiredVizRequest}.
|
|
4439
4548
|
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
|
|
4440
4549
|
* @example
|
|
4441
4550
|
* ```js
|
|
@@ -4497,6 +4606,7 @@
|
|
|
4497
4606
|
* instance. Contact your admin or ThoughtSpot Support to enable chat history on your
|
|
4498
4607
|
* instance.
|
|
4499
4608
|
*
|
|
4609
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4500
4610
|
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
4501
4611
|
* @example
|
|
4502
4612
|
* ```js
|
|
@@ -4514,6 +4624,7 @@
|
|
|
4514
4624
|
* instance. Contact your admin or ThoughtSpot Support to enable chat history on your
|
|
4515
4625
|
* instance.
|
|
4516
4626
|
*
|
|
4627
|
+
* Payload: {@link ConversationScopedRequest}.
|
|
4517
4628
|
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
4518
4629
|
* @example
|
|
4519
4630
|
* ```js
|
|
@@ -4538,6 +4649,7 @@
|
|
|
4538
4649
|
* Trigger the **Send Test Email** action in the Liveboard schedule modal.
|
|
4539
4650
|
* Sends a test schedule email to self or all recipients.
|
|
4540
4651
|
* Requires `isSendNowLiveboardSchedulingEnabled` to be enabled.
|
|
4652
|
+
* Payload: {@link ScheduleEmailRequest}.
|
|
4541
4653
|
* @example
|
|
4542
4654
|
* ```js
|
|
4543
4655
|
* liveboardEmbed.trigger(HostEvent.SendTestScheduleEmail, {
|
|
@@ -4556,6 +4668,7 @@
|
|
|
4556
4668
|
HostEvent["SendTestScheduleEmail"] = "sendTestScheduleEmail";
|
|
4557
4669
|
/**
|
|
4558
4670
|
* Sends a user message (prompt) to the SpotterViz panel programmatically.
|
|
4671
|
+
* Payload: `{ query: string }`.
|
|
4559
4672
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4560
4673
|
* @param query - the prompt text to send.
|
|
4561
4674
|
* @example
|
|
@@ -4568,6 +4681,7 @@
|
|
|
4568
4681
|
HostEvent["SpotterVizSendUserMessage"] = "SpotterVizSendUserMessage";
|
|
4569
4682
|
/**
|
|
4570
4683
|
* Initializes a new SpotterViz conversation.
|
|
4684
|
+
* Payload: none.
|
|
4571
4685
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4572
4686
|
* @example
|
|
4573
4687
|
* ```js
|
|
@@ -4577,6 +4691,7 @@
|
|
|
4577
4691
|
HostEvent["InitSpotterVizConversation"] = "InitSpotterVizConversation";
|
|
4578
4692
|
/**
|
|
4579
4693
|
* Opens the SpotterViz panel.
|
|
4694
|
+
* Payload: none.
|
|
4580
4695
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4581
4696
|
* @example
|
|
4582
4697
|
* ```js
|
|
@@ -4586,6 +4701,7 @@
|
|
|
4586
4701
|
HostEvent["OpenSpotterVizPanel"] = "OpenSpotterVizPanel";
|
|
4587
4702
|
/**
|
|
4588
4703
|
* Closes the SpotterViz panel.
|
|
4704
|
+
* Payload: none.
|
|
4589
4705
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
4590
4706
|
* @example
|
|
4591
4707
|
* ```js
|
|
@@ -4596,6 +4712,7 @@
|
|
|
4596
4712
|
/**
|
|
4597
4713
|
* Clears browser cache and fetches new data for liveboard ChartViz Containers.
|
|
4598
4714
|
* Requires `enableLiveboardDataCache` to be enabled.
|
|
4715
|
+
* Payload: {@link ScheduleEmailRequest}.
|
|
4599
4716
|
* @example
|
|
4600
4717
|
* ```js
|
|
4601
4718
|
* liveboardEmbed.trigger(HostEvent.RefreshLiveboardBrowserCache);
|
|
@@ -4791,8 +4908,8 @@
|
|
|
4791
4908
|
Param["IsStarterPromptsEnabled"] = "enableStarterPrompts";
|
|
4792
4909
|
Param["UpdatedSpotterExperience"] = "updatedSpotterExperience";
|
|
4793
4910
|
Param["SpotterDataSources"] = "spotterDataSources";
|
|
4794
|
-
Param["AnalystId"] = "analystId";
|
|
4795
4911
|
Param["OpenSpotterOnLiveboardByDefault"] = "openSpotterOnLiveboardByDefault";
|
|
4912
|
+
Param["ShowAnswerEditPanel"] = "showAnswerEditPanel";
|
|
4796
4913
|
})(Param || (Param = {}));
|
|
4797
4914
|
/**
|
|
4798
4915
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -6797,6 +6914,237 @@
|
|
|
6797
6914
|
* ```
|
|
6798
6915
|
*/
|
|
6799
6916
|
Action["SpotterOnLiveboard"] = "spotterOnLiveboard";
|
|
6917
|
+
/**
|
|
6918
|
+
* Controls the visibility and disabled state of the "Chart Type" menu item
|
|
6919
|
+
* in Chart Settings V2.
|
|
6920
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6921
|
+
* @example
|
|
6922
|
+
* ```js
|
|
6923
|
+
* {
|
|
6924
|
+
* hiddenActions: [Action.ChartTypeSettings],
|
|
6925
|
+
* disabledActions: [Action.ChartTypeSettings],
|
|
6926
|
+
* }
|
|
6927
|
+
* ```
|
|
6928
|
+
*/
|
|
6929
|
+
Action["ChartTypeSettings"] = "CHART_TYPE";
|
|
6930
|
+
/**
|
|
6931
|
+
* Controls the visibility and disabled state of the "Layout" menu item
|
|
6932
|
+
* in Chart Settings V2.
|
|
6933
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6934
|
+
* @example
|
|
6935
|
+
* ```js
|
|
6936
|
+
* {
|
|
6937
|
+
* hiddenActions: [Action.LayoutSettings],
|
|
6938
|
+
* disabledActions: [Action.LayoutSettings],
|
|
6939
|
+
* }
|
|
6940
|
+
* ```
|
|
6941
|
+
*/
|
|
6942
|
+
Action["LayoutSettings"] = "LAYOUT";
|
|
6943
|
+
/**
|
|
6944
|
+
* Controls the visibility and disabled state of the "Column" menu item
|
|
6945
|
+
* in Chart Settings V2.
|
|
6946
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6947
|
+
* @example
|
|
6948
|
+
* ```js
|
|
6949
|
+
* {
|
|
6950
|
+
* hiddenActions: [Action.ColumnSettings],
|
|
6951
|
+
* disabledActions: [Action.ColumnSettings],
|
|
6952
|
+
* }
|
|
6953
|
+
* ```
|
|
6954
|
+
*/
|
|
6955
|
+
Action["ColumnSettings"] = "COLUMN";
|
|
6956
|
+
/**
|
|
6957
|
+
* Controls the visibility and disabled state of the "Axis" menu item
|
|
6958
|
+
* in Chart Settings V2.
|
|
6959
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6960
|
+
* @example
|
|
6961
|
+
* ```js
|
|
6962
|
+
* {
|
|
6963
|
+
* hiddenActions: [Action.AxisSettings],
|
|
6964
|
+
* disabledActions: [Action.AxisSettings],
|
|
6965
|
+
* }
|
|
6966
|
+
* ```
|
|
6967
|
+
*/
|
|
6968
|
+
Action["AxisSettings"] = "AXIS";
|
|
6969
|
+
/**
|
|
6970
|
+
* Controls the visibility and disabled state of the "Data Label" menu item
|
|
6971
|
+
* in Chart Settings V2.
|
|
6972
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6973
|
+
* @example
|
|
6974
|
+
* ```js
|
|
6975
|
+
* {
|
|
6976
|
+
* hiddenActions: [Action.DataLabelSettings],
|
|
6977
|
+
* disabledActions: [Action.DataLabelSettings],
|
|
6978
|
+
* }
|
|
6979
|
+
* ```
|
|
6980
|
+
*/
|
|
6981
|
+
Action["DataLabelSettings"] = "DATA_LABEL";
|
|
6982
|
+
/**
|
|
6983
|
+
* Controls the visibility and disabled state of the "Tooltip" menu item
|
|
6984
|
+
* in Chart Settings V2.
|
|
6985
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6986
|
+
* @example
|
|
6987
|
+
* ```js
|
|
6988
|
+
* {
|
|
6989
|
+
* hiddenActions: [Action.TooltipSettings],
|
|
6990
|
+
* disabledActions: [Action.TooltipSettings],
|
|
6991
|
+
* }
|
|
6992
|
+
* ```
|
|
6993
|
+
*/
|
|
6994
|
+
Action["TooltipSettings"] = "TOOLTIP";
|
|
6995
|
+
/**
|
|
6996
|
+
* Controls the visibility and disabled state of the "Legend" menu item
|
|
6997
|
+
* in Chart Settings V2.
|
|
6998
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
6999
|
+
* @example
|
|
7000
|
+
* ```js
|
|
7001
|
+
* {
|
|
7002
|
+
* hiddenActions: [Action.LegendSettings],
|
|
7003
|
+
* disabledActions: [Action.LegendSettings],
|
|
7004
|
+
* }
|
|
7005
|
+
* ```
|
|
7006
|
+
*/
|
|
7007
|
+
Action["LegendSettings"] = "LEGEND";
|
|
7008
|
+
/**
|
|
7009
|
+
* Controls the visibility and disabled state of the "Display" menu item
|
|
7010
|
+
* in Chart Settings V2.
|
|
7011
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7012
|
+
* @example
|
|
7013
|
+
* ```js
|
|
7014
|
+
* {
|
|
7015
|
+
* hiddenActions: [Action.DisplaySettings],
|
|
7016
|
+
* disabledActions: [Action.DisplaySettings],
|
|
7017
|
+
* }
|
|
7018
|
+
* ```
|
|
7019
|
+
*/
|
|
7020
|
+
Action["DisplaySettings"] = "DISPLAY";
|
|
7021
|
+
/**
|
|
7022
|
+
* Controls the visibility and disabled state of the "Query Details" menu
|
|
7023
|
+
* item in Chart Settings V2.
|
|
7024
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7025
|
+
* @example
|
|
7026
|
+
* ```js
|
|
7027
|
+
* {
|
|
7028
|
+
* hiddenActions: [Action.QuerySettings],
|
|
7029
|
+
* disabledActions: [Action.QuerySettings],
|
|
7030
|
+
* }
|
|
7031
|
+
* ```
|
|
7032
|
+
*/
|
|
7033
|
+
Action["QuerySettings"] = "QUERY_DETAILS";
|
|
7034
|
+
/**
|
|
7035
|
+
* Controls the visibility and disabled state of the "Custom Action" menu
|
|
7036
|
+
* item in Chart Settings V2.
|
|
7037
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7038
|
+
* @example
|
|
7039
|
+
* ```js
|
|
7040
|
+
* {
|
|
7041
|
+
* hiddenActions: [Action.CustomSettings],
|
|
7042
|
+
* disabledActions: [Action.CustomSettings],
|
|
7043
|
+
* }
|
|
7044
|
+
* ```
|
|
7045
|
+
*/
|
|
7046
|
+
Action["CustomSettings"] = "CUSTOM_ACTION";
|
|
7047
|
+
/**
|
|
7048
|
+
* Controls the visibility and disabled state of the "Muze AI" menu item
|
|
7049
|
+
* in Chart Settings V2.
|
|
7050
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7051
|
+
* @example
|
|
7052
|
+
* ```js
|
|
7053
|
+
* {
|
|
7054
|
+
* hiddenActions: [Action.MuzeAiSettings],
|
|
7055
|
+
* disabledActions: [Action.MuzeAiSettings],
|
|
7056
|
+
* }
|
|
7057
|
+
* ```
|
|
7058
|
+
*/
|
|
7059
|
+
Action["MuzeAiSettings"] = "MUZE_AI";
|
|
7060
|
+
/**
|
|
7061
|
+
* Controls the visibility and disabled state of the "R Analysis" menu item
|
|
7062
|
+
* in Chart Settings V2.
|
|
7063
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
7064
|
+
* @example
|
|
7065
|
+
* ```js
|
|
7066
|
+
* {
|
|
7067
|
+
* hiddenActions: [Action.RAnalysisSettings],
|
|
7068
|
+
* disabledActions: [Action.RAnalysisSettings],
|
|
7069
|
+
* }
|
|
7070
|
+
* ```
|
|
7071
|
+
*/
|
|
7072
|
+
Action["RAnalysisSettings"] = "R_ANALYSIS";
|
|
7073
|
+
/**
|
|
7074
|
+
* Controls the visibility and disabled state of the "Add to Collection" menu item.
|
|
7075
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7076
|
+
* @example
|
|
7077
|
+
* ```js
|
|
7078
|
+
* {
|
|
7079
|
+
* hiddenActions: [Action.AddToCollection],
|
|
7080
|
+
* disabledActions: [Action.AddToCollection],
|
|
7081
|
+
* }
|
|
7082
|
+
* ```
|
|
7083
|
+
*/
|
|
7084
|
+
Action["AddToCollection"] = "addToCollection";
|
|
7085
|
+
/**
|
|
7086
|
+
* Controls the visibility and disabled state of the "Create Collection" button.
|
|
7087
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7088
|
+
* @example
|
|
7089
|
+
* ```js
|
|
7090
|
+
* {
|
|
7091
|
+
* hiddenActions: [Action.CreateCollection],
|
|
7092
|
+
* disabledActions: [Action.CreateCollection],
|
|
7093
|
+
* }
|
|
7094
|
+
* ```
|
|
7095
|
+
*/
|
|
7096
|
+
Action["CreateCollection"] = "createCollection";
|
|
7097
|
+
/**
|
|
7098
|
+
* Controls the visibility and disabled state of the "Move" menu item in a
|
|
7099
|
+
* Collection.
|
|
7100
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7101
|
+
* @example
|
|
7102
|
+
* ```js
|
|
7103
|
+
* {
|
|
7104
|
+
* hiddenActions: [Action.MoveToCollection],
|
|
7105
|
+
* disabledActions: [Action.MoveToCollection],
|
|
7106
|
+
* }
|
|
7107
|
+
* ```
|
|
7108
|
+
*/
|
|
7109
|
+
Action["MoveToCollection"] = "moveToCollection";
|
|
7110
|
+
/**
|
|
7111
|
+
* Controls the visibility and disabled state of the "Remove" menu item in a
|
|
7112
|
+
* Collection.
|
|
7113
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7114
|
+
* @example
|
|
7115
|
+
* ```js
|
|
7116
|
+
* {
|
|
7117
|
+
* hiddenActions: [Action.RemoveFromCollection],
|
|
7118
|
+
* disabledActions: [Action.RemoveFromCollection],
|
|
7119
|
+
* }
|
|
7120
|
+
* ```
|
|
7121
|
+
*/
|
|
7122
|
+
Action["RemoveFromCollection"] = "removeFromCollection";
|
|
7123
|
+
/**
|
|
7124
|
+
* Controls the visibility and disabled state of the "Delete" menu item for a
|
|
7125
|
+
* Collection.
|
|
7126
|
+
* @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7127
|
+
* @example
|
|
7128
|
+
* ```js
|
|
7129
|
+
* {
|
|
7130
|
+
* hiddenActions: [Action.DeleteCollection],
|
|
7131
|
+
* disabledActions: [Action.DeleteCollection],
|
|
7132
|
+
* }
|
|
7133
|
+
* ```
|
|
7134
|
+
*/
|
|
7135
|
+
Action["DeleteCollection"] = "deleteCollection";
|
|
7136
|
+
/**
|
|
7137
|
+
* Controls the visibility of the "Customize homepage" button on the
|
|
7138
|
+
* embedded home page.
|
|
7139
|
+
* @version SDK: 1.55.0 | ThoughtSpot Cloud: 26.12.0.cl
|
|
7140
|
+
* @example
|
|
7141
|
+
* ```js
|
|
7142
|
+
* {
|
|
7143
|
+
* hiddenActions: [Action.CustomizeHomepage],
|
|
7144
|
+
* }
|
|
7145
|
+
* ```
|
|
7146
|
+
*/
|
|
7147
|
+
Action["CustomizeHomepage"] = "customizeHomepage";
|
|
6800
7148
|
})(exports.Action || (exports.Action = {}));
|
|
6801
7149
|
exports.PrefetchFeatures = void 0;
|
|
6802
7150
|
(function (PrefetchFeatures) {
|
|
@@ -7301,7 +7649,7 @@
|
|
|
7301
7649
|
TableContentDensity["Compact"] = "COMPACT";
|
|
7302
7650
|
})(exports.TableContentDensity || (exports.TableContentDensity = {}));
|
|
7303
7651
|
|
|
7304
|
-
var version$1="1.52.
|
|
7652
|
+
var version$1="1.52.2-beta";var pkg = {version:version$1};
|
|
7305
7653
|
|
|
7306
7654
|
const { version } = pkg;
|
|
7307
7655
|
|
|
@@ -7474,7 +7822,7 @@
|
|
|
7474
7822
|
SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
|
|
7475
7823
|
UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
|
|
7476
7824
|
INVALID_SPOTTER_DOCUMENTATION_URL: 'Invalid spotterDocumentationUrl. Please provide a valid http or https URL.',
|
|
7477
|
-
UPDATEFILTERS_INVALID_PAYLOAD: 'UpdateFilters requires a valid filter or filters array. Expected: { filter: {
|
|
7825
|
+
UPDATEFILTERS_INVALID_PAYLOAD: 'UpdateFilters requires a valid filter or filters array. Expected: { filter: { columnName, operator, values } } or { filters: [{ columnName, operator, values }, ...] }',
|
|
7478
7826
|
DRILLDOWN_INVALID_PAYLOAD: 'DrillDown requires a valid points object. Expected: { points: { clickedPoint?, selectedPoints? }, autoDrillDown?, vizId? }',
|
|
7479
7827
|
UPDATEPARAMETERS_INVALID_PAYLOAD: 'UpdateParameters received an invalid applicability. Expected: { level: LIVEBOARD | TAB | GROUP, targetId } where targetId is required for TAB and GROUP levels',
|
|
7480
7828
|
};
|
|
@@ -8123,6 +8471,43 @@
|
|
|
8123
8471
|
if (value !== undefined) {
|
|
8124
8472
|
queryParams[param] = asBoolean ? !!value : value;
|
|
8125
8473
|
}
|
|
8474
|
+
};
|
|
8475
|
+
/**
|
|
8476
|
+
* Calculates the element center for the currently visible viewport of the
|
|
8477
|
+
* element, using the scroll position of the host app, the offsetTop of the
|
|
8478
|
+
* element in the host app, and the viewport height of the tab.
|
|
8479
|
+
*
|
|
8480
|
+
* The returned keys are sent to the ThoughtSpot app over postMessage, so they
|
|
8481
|
+
* are named after the iframe and must not be renamed.
|
|
8482
|
+
* @param element The element to measure
|
|
8483
|
+
* @returns The element center within the visible viewport, the element height,
|
|
8484
|
+
* and the viewport height.
|
|
8485
|
+
*/
|
|
8486
|
+
const calculateElementCenter = (element) => {
|
|
8487
|
+
const offsetTopClient = getOffsetTop(element);
|
|
8488
|
+
const scrollTopClient = window.scrollY;
|
|
8489
|
+
const viewPortHeight = window.innerHeight;
|
|
8490
|
+
const iframeHeight = element.offsetHeight;
|
|
8491
|
+
const iframeScrolled = scrollTopClient - offsetTopClient;
|
|
8492
|
+
let iframeVisibleViewPort;
|
|
8493
|
+
let iframeOffset;
|
|
8494
|
+
if (iframeScrolled < 0) {
|
|
8495
|
+
iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
|
|
8496
|
+
iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
|
|
8497
|
+
iframeOffset = 0;
|
|
8498
|
+
}
|
|
8499
|
+
else {
|
|
8500
|
+
iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
|
|
8501
|
+
iframeOffset = iframeScrolled;
|
|
8502
|
+
}
|
|
8503
|
+
const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
|
|
8504
|
+
return {
|
|
8505
|
+
iframeCenter,
|
|
8506
|
+
iframeScrolled,
|
|
8507
|
+
iframeHeight,
|
|
8508
|
+
viewPortHeight,
|
|
8509
|
+
iframeVisibleViewPort,
|
|
8510
|
+
};
|
|
8126
8511
|
};
|
|
8127
8512
|
|
|
8128
8513
|
/**
|
|
@@ -8191,6 +8576,270 @@
|
|
|
8191
8576
|
const DEFAULT_EMBED_HEIGHT = '100%';
|
|
8192
8577
|
const DEFAULT_LAZY_LOADING_MARGIN = '500px 0px';
|
|
8193
8578
|
|
|
8579
|
+
/**
|
|
8580
|
+
* Copyright (c) 2025
|
|
8581
|
+
*
|
|
8582
|
+
* Full-height support for the Liveboard and app embeds.
|
|
8583
|
+
* @summary Full height
|
|
8584
|
+
*/
|
|
8585
|
+
/**
|
|
8586
|
+
* The height the embed falls back to when the host app has not configured
|
|
8587
|
+
* `minimumHeight` or `defaultHeight`.
|
|
8588
|
+
*/
|
|
8589
|
+
const DEFAULT_MINIMUM_HEIGHT = 500;
|
|
8590
|
+
/**
|
|
8591
|
+
* Routes that are part of the Liveboard experience itself. Navigating between
|
|
8592
|
+
* these does not reset the frame height, because the ThoughtSpot app keeps
|
|
8593
|
+
* reporting a height of its own for them.
|
|
8594
|
+
*/
|
|
8595
|
+
const LIVEBOARD_RELATED_ROUTES = [
|
|
8596
|
+
'/pinboard/',
|
|
8597
|
+
'/insights/pinboard/',
|
|
8598
|
+
'/schedules/',
|
|
8599
|
+
'/embed/viz/',
|
|
8600
|
+
'/embed/insights/viz/',
|
|
8601
|
+
'/liveboard/',
|
|
8602
|
+
'/insights/liveboard/',
|
|
8603
|
+
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
8604
|
+
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
8605
|
+
];
|
|
8606
|
+
/**
|
|
8607
|
+
* Owns every piece of full-height behavior for an embed: the height
|
|
8608
|
+
* negotiation with the ThoughtSpot app, the query parameters that switch the
|
|
8609
|
+
* feature on, and the viewport listeners that drive lazy loading.
|
|
8610
|
+
*
|
|
8611
|
+
* The controller is inert unless `fullHeight` is enabled, so embeds can create
|
|
8612
|
+
* one unconditionally.
|
|
8613
|
+
*/
|
|
8614
|
+
class FullHeightController {
|
|
8615
|
+
constructor(viewConfig, host) {
|
|
8616
|
+
this.host = host;
|
|
8617
|
+
this.scrollContainers = [];
|
|
8618
|
+
/**
|
|
8619
|
+
* Sets the frame height to the height reported by the ThoughtSpot app,
|
|
8620
|
+
* never going below the configured minimum.
|
|
8621
|
+
*/
|
|
8622
|
+
this.handleEmbedHeight = (payload) => {
|
|
8623
|
+
const height = Number(payload === null || payload === void 0 ? void 0 : payload.data);
|
|
8624
|
+
if (!isNaN(height)) {
|
|
8625
|
+
this.host.setFrameHeight(Math.max(height, this.minimumHeight));
|
|
8626
|
+
}
|
|
8627
|
+
this.sendVisibleCoordinates();
|
|
8628
|
+
};
|
|
8629
|
+
/**
|
|
8630
|
+
* Answers the app's request for the center of the visible embed region.
|
|
8631
|
+
*/
|
|
8632
|
+
this.handleEmbedIframeCenter = (payload, responder) => {
|
|
8633
|
+
const iframe = this.host.getIframe();
|
|
8634
|
+
if (!iframe) {
|
|
8635
|
+
return;
|
|
8636
|
+
}
|
|
8637
|
+
responder === null || responder === void 0 ? void 0 : responder({
|
|
8638
|
+
type: exports.EmbedEvent.EmbedIframeCenter,
|
|
8639
|
+
data: calculateElementCenter(iframe),
|
|
8640
|
+
});
|
|
8641
|
+
};
|
|
8642
|
+
/**
|
|
8643
|
+
* Answers the app's request for the currently visible embed coordinates.
|
|
8644
|
+
*/
|
|
8645
|
+
this.handleRequestVisibleCoordinates = (payload, responder) => {
|
|
8646
|
+
logger$3.info('Sending RequestVisibleEmbedCoordinates', payload);
|
|
8647
|
+
responder === null || responder === void 0 ? void 0 : responder({
|
|
8648
|
+
type: exports.EmbedEvent.RequestVisibleEmbedCoordinates,
|
|
8649
|
+
data: this.getVisibleCoordinates(),
|
|
8650
|
+
});
|
|
8651
|
+
};
|
|
8652
|
+
/**
|
|
8653
|
+
* Resets the frame height when the app navigates away from a Liveboard,
|
|
8654
|
+
* since only Liveboard routes report a height of their own.
|
|
8655
|
+
*/
|
|
8656
|
+
this.handleRouteChange = (payload) => {
|
|
8657
|
+
var _a, _b;
|
|
8658
|
+
const currentPath = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.currentPath;
|
|
8659
|
+
if (!currentPath) {
|
|
8660
|
+
return;
|
|
8661
|
+
}
|
|
8662
|
+
if (LIVEBOARD_RELATED_ROUTES.some((route) => currentPath.startsWith(route))) {
|
|
8663
|
+
return;
|
|
8664
|
+
}
|
|
8665
|
+
this.host.setFrameHeight(((_b = this.config.frameParams) === null || _b === void 0 ? void 0 : _b.height) || this.minimumHeight);
|
|
8666
|
+
};
|
|
8667
|
+
/**
|
|
8668
|
+
* Pushes the visible embed region to the app so it can decide which
|
|
8669
|
+
* visualizations to load.
|
|
8670
|
+
*/
|
|
8671
|
+
this.sendVisibleCoordinates = () => {
|
|
8672
|
+
if (!this.isLazyLoadEnabled) {
|
|
8673
|
+
return;
|
|
8674
|
+
}
|
|
8675
|
+
const coordinates = this.getVisibleCoordinates();
|
|
8676
|
+
if (coordinates) {
|
|
8677
|
+
this.host.trigger(exports.HostEvent.VisibleEmbedCoordinates, coordinates);
|
|
8678
|
+
}
|
|
8679
|
+
};
|
|
8680
|
+
this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
|
|
8681
|
+
this.registerEventHandlers();
|
|
8682
|
+
}
|
|
8683
|
+
/**
|
|
8684
|
+
* The view config the controller runs on: the host app's own config with
|
|
8685
|
+
* the lazy-loading defaults filled in. Read-only, so the only way to change
|
|
8686
|
+
* it is through the setter, which re-resolves the defaults.
|
|
8687
|
+
*/
|
|
8688
|
+
get viewConfig() {
|
|
8689
|
+
return this.config;
|
|
8690
|
+
}
|
|
8691
|
+
/**
|
|
8692
|
+
* Replaces the view config the controller runs on and re-resolves the
|
|
8693
|
+
* lazy-loading defaults against it. The config the caller passes is never
|
|
8694
|
+
* written to; the controller keeps a copy of its own.
|
|
8695
|
+
*/
|
|
8696
|
+
set viewConfig(viewConfig) {
|
|
8697
|
+
this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
|
|
8698
|
+
}
|
|
8699
|
+
/**
|
|
8700
|
+
* The view config with the lazy-loading settings the embed falls back to
|
|
8701
|
+
* when the host app has not chosen its own.
|
|
8702
|
+
*
|
|
8703
|
+
* Pure by design: it returns a new config rather than writing to the one it
|
|
8704
|
+
* is given, so the host app's object is left untouched.
|
|
8705
|
+
* @param viewConfig The embed's view config
|
|
8706
|
+
* @returns A copy with the defaults filled in, host app choices preserved
|
|
8707
|
+
*/
|
|
8708
|
+
static withLazyLoadingDefaults(viewConfig) {
|
|
8709
|
+
return {
|
|
8710
|
+
...viewConfig,
|
|
8711
|
+
lazyLoadingForFullHeight: viewConfig.lazyLoadingForFullHeight === undefined
|
|
8712
|
+
? true
|
|
8713
|
+
: viewConfig.lazyLoadingForFullHeight,
|
|
8714
|
+
enableScrollableContainerLazyLoading: viewConfig.enableScrollableContainerLazyLoading === undefined
|
|
8715
|
+
? true
|
|
8716
|
+
: viewConfig.enableScrollableContainerLazyLoading,
|
|
8717
|
+
lazyLoadingMargin: viewConfig.lazyLoadingMargin === undefined
|
|
8718
|
+
? DEFAULT_LAZY_LOADING_MARGIN
|
|
8719
|
+
: viewConfig.lazyLoadingMargin,
|
|
8720
|
+
};
|
|
8721
|
+
}
|
|
8722
|
+
/**
|
|
8723
|
+
* Whether the host app asked for a full-height embed.
|
|
8724
|
+
*/
|
|
8725
|
+
get isEnabled() {
|
|
8726
|
+
return this.config.fullHeight === true;
|
|
8727
|
+
}
|
|
8728
|
+
/**
|
|
8729
|
+
* Whether visualizations should load as they scroll into view, which
|
|
8730
|
+
* requires the SDK to report the visible region of the embed.
|
|
8731
|
+
*/
|
|
8732
|
+
get isLazyLoadEnabled() {
|
|
8733
|
+
return this.isEnabled && !!this.config.lazyLoadingForFullHeight;
|
|
8734
|
+
}
|
|
8735
|
+
/**
|
|
8736
|
+
* The floor for the frame height. `defaultHeight` is the deprecated
|
|
8737
|
+
* spelling of `minimumHeight` and is still honored for compatibility.
|
|
8738
|
+
*/
|
|
8739
|
+
get minimumHeight() {
|
|
8740
|
+
const { minimumHeight, defaultHeight } = this.config;
|
|
8741
|
+
return minimumHeight || defaultHeight || DEFAULT_MINIMUM_HEIGHT;
|
|
8742
|
+
}
|
|
8743
|
+
/**
|
|
8744
|
+
* Registers the embed event handlers the feature depends on. Called from
|
|
8745
|
+
* the constructor, so the handlers are in place before `render`.
|
|
8746
|
+
*/
|
|
8747
|
+
registerEventHandlers() {
|
|
8748
|
+
if (!this.isEnabled) {
|
|
8749
|
+
return;
|
|
8750
|
+
}
|
|
8751
|
+
this.host.on(exports.EmbedEvent.RouteChange, this.handleRouteChange);
|
|
8752
|
+
this.host.on(exports.EmbedEvent.EmbedHeight, this.handleEmbedHeight);
|
|
8753
|
+
this.host.on(exports.EmbedEvent.EmbedIframeCenter, this.handleEmbedIframeCenter);
|
|
8754
|
+
this.host.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.handleRequestVisibleCoordinates);
|
|
8755
|
+
}
|
|
8756
|
+
/**
|
|
8757
|
+
* Adds the full-height query parameters to the embed URL params.
|
|
8758
|
+
* @param params The query parameters being built by the embed
|
|
8759
|
+
*/
|
|
8760
|
+
addQueryParams(params) {
|
|
8761
|
+
if (!this.isEnabled) {
|
|
8762
|
+
return;
|
|
8763
|
+
}
|
|
8764
|
+
params[Param.fullHeight] = true;
|
|
8765
|
+
if (!this.config.lazyLoadingForFullHeight) {
|
|
8766
|
+
return;
|
|
8767
|
+
}
|
|
8768
|
+
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
8769
|
+
if (isValidCssMargin(this.config.lazyLoadingMargin)) {
|
|
8770
|
+
params[Param.RootMarginForLazyLoad] = this.config.lazyLoadingMargin;
|
|
8771
|
+
}
|
|
8772
|
+
}
|
|
8773
|
+
/**
|
|
8774
|
+
* Attaches the viewport listeners that keep lazy loading in sync. Call this
|
|
8775
|
+
* once the embed has rendered and the iframe exists.
|
|
8776
|
+
*/
|
|
8777
|
+
onRender() {
|
|
8778
|
+
this.registerLazyLoadListeners();
|
|
8779
|
+
}
|
|
8780
|
+
/**
|
|
8781
|
+
* Detaches every listener and observer owned by the controller.
|
|
8782
|
+
*/
|
|
8783
|
+
destroy() {
|
|
8784
|
+
this.unregisterLazyLoadListeners();
|
|
8785
|
+
}
|
|
8786
|
+
getVisibleCoordinates() {
|
|
8787
|
+
const iframe = this.host.getIframe();
|
|
8788
|
+
if (!iframe) {
|
|
8789
|
+
return null;
|
|
8790
|
+
}
|
|
8791
|
+
return calculateVisibleElementData(iframe, this.config.enableScrollableContainerLazyLoading);
|
|
8792
|
+
}
|
|
8793
|
+
registerLazyLoadListeners() {
|
|
8794
|
+
if (!this.isLazyLoadEnabled || !this.host.getIframe()) {
|
|
8795
|
+
return;
|
|
8796
|
+
}
|
|
8797
|
+
// Re-registering is safe: drop whatever a previous render attached.
|
|
8798
|
+
this.unregisterLazyLoadListeners();
|
|
8799
|
+
// TODO: Use passive: true, install modernizr to check for passive
|
|
8800
|
+
window.addEventListener('resize', this.sendVisibleCoordinates);
|
|
8801
|
+
window.addEventListener('scroll', this.sendVisibleCoordinates, true);
|
|
8802
|
+
if (!this.config.enableScrollableContainerLazyLoading) {
|
|
8803
|
+
return;
|
|
8804
|
+
}
|
|
8805
|
+
this.observeScrollableContainers();
|
|
8806
|
+
}
|
|
8807
|
+
/**
|
|
8808
|
+
* Tracks the ancestors that can scroll or clip the embed, so the visible
|
|
8809
|
+
* region stays correct when the embed lives inside its own scroll
|
|
8810
|
+
* container rather than the page.
|
|
8811
|
+
*/
|
|
8812
|
+
observeScrollableContainers() {
|
|
8813
|
+
const iFrame = this.host.getIframe();
|
|
8814
|
+
this.scrollContainers = getScrollableAncestors(iFrame);
|
|
8815
|
+
this.scrollContainers.forEach((scrollContainer) => {
|
|
8816
|
+
scrollContainer.addEventListener('scroll', this.sendVisibleCoordinates);
|
|
8817
|
+
});
|
|
8818
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
8819
|
+
return;
|
|
8820
|
+
}
|
|
8821
|
+
const resizeTargets = new Set([iFrame.parentElement, ...getEffectiveClippingAncestors(iFrame)].filter(Boolean));
|
|
8822
|
+
this.resizeObserver = new ResizeObserver(this.sendVisibleCoordinates);
|
|
8823
|
+
resizeTargets.forEach((resizeTarget) => {
|
|
8824
|
+
this.resizeObserver.observe(resizeTarget);
|
|
8825
|
+
});
|
|
8826
|
+
}
|
|
8827
|
+
unregisterLazyLoadListeners() {
|
|
8828
|
+
var _a;
|
|
8829
|
+
if (!this.isLazyLoadEnabled) {
|
|
8830
|
+
return;
|
|
8831
|
+
}
|
|
8832
|
+
window.removeEventListener('resize', this.sendVisibleCoordinates);
|
|
8833
|
+
window.removeEventListener('scroll', this.sendVisibleCoordinates, true);
|
|
8834
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
8835
|
+
this.resizeObserver = undefined;
|
|
8836
|
+
this.scrollContainers.forEach((scrollContainer) => {
|
|
8837
|
+
scrollContainer.removeEventListener('scroll', this.sendVisibleCoordinates);
|
|
8838
|
+
});
|
|
8839
|
+
this.scrollContainers = [];
|
|
8840
|
+
}
|
|
8841
|
+
}
|
|
8842
|
+
|
|
8194
8843
|
/** Used for built-in method references. */
|
|
8195
8844
|
var objectProto$d = Object.prototype;
|
|
8196
8845
|
|
|
@@ -9099,7 +9748,110 @@
|
|
|
9099
9748
|
UIPassthroughEvent["GetTabs"] = "getTabs";
|
|
9100
9749
|
UIPassthroughEvent["GetGroups"] = "getGroups";
|
|
9101
9750
|
UIPassthroughEvent["GetExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
|
|
9102
|
-
})(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
|
|
9751
|
+
})(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
|
|
9752
|
+
// NOTE: HostEventRequest / HostEventResponse / TriggerPayload / TriggerResponse
|
|
9753
|
+
// live in the sibling ./host-event-contracts, which layers the
|
|
9754
|
+
// HostEventRequestMap on top of the UI-passthrough mapping above.
|
|
9755
|
+
// The former 2-tier definitions that lived here were superseded and removed.
|
|
9756
|
+
|
|
9757
|
+
/**
|
|
9758
|
+
* Copyright (c) 2026
|
|
9759
|
+
*
|
|
9760
|
+
* Dedicated transport layer for SDK <-> ThoughtSpot iframe messaging.
|
|
9761
|
+
*
|
|
9762
|
+
* Owns the postMessage/MessageChannel mechanics and origin resolution so
|
|
9763
|
+
* that embed/business logic (ts-embed.ts, hostEventClient) never touches
|
|
9764
|
+
* the wire directly. The wire format is unchanged from the historical
|
|
9765
|
+
* implementation — this layer is a pure structural extraction.
|
|
9766
|
+
*/
|
|
9767
|
+
/**
|
|
9768
|
+
* Default time to wait for the app to respond to a request-response
|
|
9769
|
+
* message before giving up and reclaiming the channel.
|
|
9770
|
+
*/
|
|
9771
|
+
const MESSAGE_RESPONSE_TIMEOUT = 30000;
|
|
9772
|
+
/**
|
|
9773
|
+
* Single implementation of origin resolution for the embedded app.
|
|
9774
|
+
* Returns the origin (scheme://host[:port]) for a ThoughtSpot host URL,
|
|
9775
|
+
* or null when it cannot be parsed.
|
|
9776
|
+
* @param thoughtSpotHost
|
|
9777
|
+
*/
|
|
9778
|
+
const resolveMessageOrigin = (thoughtSpotHost) => {
|
|
9779
|
+
try {
|
|
9780
|
+
return new URL(thoughtSpotHost).origin;
|
|
9781
|
+
}
|
|
9782
|
+
catch (e) {
|
|
9783
|
+
return null;
|
|
9784
|
+
}
|
|
9785
|
+
};
|
|
9786
|
+
/**
|
|
9787
|
+
* Validates that an inbound window message came from the embedded
|
|
9788
|
+
* ThoughtSpot app: the source window must be the embed iframe's window and,
|
|
9789
|
+
* when the expected origin is resolvable, the message origin must match it.
|
|
9790
|
+
*
|
|
9791
|
+
* Fails open (returns true) on the origin check when the expected origin
|
|
9792
|
+
* cannot be resolved, to avoid breaking unconventional-but-working setups;
|
|
9793
|
+
* a warning is logged on mismatch either way.
|
|
9794
|
+
* @param event The message event received on window.
|
|
9795
|
+
* @param iFrame The embed iframe the message should originate from.
|
|
9796
|
+
* @param thoughtSpotHost The configured ThoughtSpot host.
|
|
9797
|
+
*/
|
|
9798
|
+
const isMessageFromIframe = (event, iFrame, thoughtSpotHost) => {
|
|
9799
|
+
if (event.source !== (iFrame === null || iFrame === void 0 ? void 0 : iFrame.contentWindow)) {
|
|
9800
|
+
return false;
|
|
9801
|
+
}
|
|
9802
|
+
const expectedOrigin = resolveMessageOrigin(thoughtSpotHost);
|
|
9803
|
+
if (expectedOrigin && event.origin && event.origin !== expectedOrigin) {
|
|
9804
|
+
logger$3.warn(`Dropped message from unexpected origin ${event.origin}; expected ${expectedOrigin}`);
|
|
9805
|
+
return false;
|
|
9806
|
+
}
|
|
9807
|
+
return true;
|
|
9808
|
+
};
|
|
9809
|
+
/**
|
|
9810
|
+
* Posts a one-way message to the embedded app's iframe, optionally
|
|
9811
|
+
* transferring a MessageChannel port for the response.
|
|
9812
|
+
* @param iFrame
|
|
9813
|
+
* @param message
|
|
9814
|
+
* @param thoughtSpotHost Used as the postMessage targetOrigin.
|
|
9815
|
+
* @param channel
|
|
9816
|
+
*/
|
|
9817
|
+
const postMessageToIframe = (iFrame, message, thoughtSpotHost, channel) => {
|
|
9818
|
+
var _a;
|
|
9819
|
+
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, channel ? [channel.port2] : []);
|
|
9820
|
+
};
|
|
9821
|
+
/**
|
|
9822
|
+
* Sends a request-response message to the embedded app over a dedicated
|
|
9823
|
+
* MessageChannel. Resolves with the response payload; rejects when the app
|
|
9824
|
+
* responds with an error; resolves with a timeout Error object when no
|
|
9825
|
+
* response arrives in time (historical behavior, preserved for backward
|
|
9826
|
+
* compatibility).
|
|
9827
|
+
* @param iFrame
|
|
9828
|
+
* @param message
|
|
9829
|
+
* @param thoughtSpotHost
|
|
9830
|
+
* @param timeoutMs
|
|
9831
|
+
*/
|
|
9832
|
+
function sendMessageWithResponse(iFrame, message, thoughtSpotHost, timeoutMs = MESSAGE_RESPONSE_TIMEOUT) {
|
|
9833
|
+
return new Promise((res, rej) => {
|
|
9834
|
+
const channel = new MessageChannel();
|
|
9835
|
+
// Close the messageChannel and resolve the promise if timeout.
|
|
9836
|
+
const timeoutId = setTimeout(() => {
|
|
9837
|
+
channel.port1.close();
|
|
9838
|
+
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
9839
|
+
}, timeoutMs);
|
|
9840
|
+
channel.port1.onmessage = ({ data: responseData }) => {
|
|
9841
|
+
var _a;
|
|
9842
|
+
clearTimeout(timeoutId);
|
|
9843
|
+
channel.port1.close();
|
|
9844
|
+
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);
|
|
9845
|
+
if (error) {
|
|
9846
|
+
rej(error);
|
|
9847
|
+
}
|
|
9848
|
+
else {
|
|
9849
|
+
res(responseData);
|
|
9850
|
+
}
|
|
9851
|
+
};
|
|
9852
|
+
postMessageToIframe(iFrame, message, thoughtSpotHost, channel);
|
|
9853
|
+
});
|
|
9854
|
+
}
|
|
9103
9855
|
|
|
9104
9856
|
const EndPoints = {
|
|
9105
9857
|
AUTH_VERIFICATION: '/callosum/v1/session/info',
|
|
@@ -20271,23 +21023,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20271
21023
|
iFrame.src = src;
|
|
20272
21024
|
}, 100);
|
|
20273
21025
|
};
|
|
21026
|
+
const TRIGGER_TIMEOUT = MESSAGE_RESPONSE_TIMEOUT;
|
|
20274
21027
|
/**
|
|
20275
|
-
*
|
|
20276
|
-
*
|
|
20277
|
-
*
|
|
20278
|
-
* @param message.type
|
|
20279
|
-
* @param message.data
|
|
20280
|
-
* @param message.context
|
|
20281
|
-
* @param thoughtSpotHost
|
|
20282
|
-
* @param channel
|
|
20283
|
-
*/
|
|
20284
|
-
function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
|
|
20285
|
-
var _a;
|
|
20286
|
-
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
|
|
20287
|
-
}
|
|
20288
|
-
const TRIGGER_TIMEOUT = 30000;
|
|
20289
|
-
/**
|
|
20290
|
-
*
|
|
21028
|
+
* Processes a host event trigger: handles SDK-local events (Reload,
|
|
21029
|
+
* Present) and forwards everything else to the embedded app over the
|
|
21030
|
+
* iframe transport.
|
|
20291
21031
|
* @param iFrame
|
|
20292
21032
|
* @param messageType
|
|
20293
21033
|
* @param thoughtSpotHost
|
|
@@ -20295,42 +21035,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20295
21035
|
* @param context
|
|
20296
21036
|
*/
|
|
20297
21037
|
function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
|
|
20298
|
-
|
|
20299
|
-
|
|
20300
|
-
|
|
20301
|
-
|
|
20302
|
-
|
|
20303
|
-
|
|
20304
|
-
|
|
20305
|
-
|
|
20306
|
-
|
|
20307
|
-
|
|
20308
|
-
handlePresentEvent(iFrame);
|
|
20309
|
-
}
|
|
20310
|
-
else {
|
|
20311
|
-
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
20312
|
-
}
|
|
21038
|
+
var _a;
|
|
21039
|
+
if (messageType === exports.HostEvent.Reload) {
|
|
21040
|
+
reload(iFrame);
|
|
21041
|
+
return Promise.resolve(null);
|
|
21042
|
+
}
|
|
21043
|
+
if (messageType === exports.HostEvent.Present) {
|
|
21044
|
+
const embedConfig = getEmbedConfig();
|
|
21045
|
+
const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
|
|
21046
|
+
if (!disableFullscreenPresentation) {
|
|
21047
|
+
handlePresentEvent(iFrame);
|
|
20313
21048
|
}
|
|
20314
|
-
|
|
20315
|
-
|
|
20316
|
-
|
|
20317
|
-
|
|
20318
|
-
|
|
20319
|
-
}, TRIGGER_TIMEOUT);
|
|
20320
|
-
channel.port1.onmessage = ({ data: responseData }) => {
|
|
20321
|
-
var _a;
|
|
20322
|
-
clearTimeout(timeoutId);
|
|
20323
|
-
channel.port1.close();
|
|
20324
|
-
const error = (responseData === null || responseData === void 0 ? void 0 : responseData.error) || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
|
|
20325
|
-
if (error) {
|
|
20326
|
-
rej(error);
|
|
20327
|
-
}
|
|
20328
|
-
else {
|
|
20329
|
-
res(responseData);
|
|
20330
|
-
}
|
|
20331
|
-
};
|
|
20332
|
-
return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
|
|
20333
|
-
});
|
|
21049
|
+
else {
|
|
21050
|
+
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
21051
|
+
}
|
|
21052
|
+
}
|
|
21053
|
+
return sendMessageWithResponse(iFrame, { type: messageType, data, context }, thoughtSpotHost, TRIGGER_TIMEOUT);
|
|
20334
21054
|
}
|
|
20335
21055
|
|
|
20336
21056
|
/**
|
|
@@ -20974,7 +21694,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20974
21694
|
const isValidApplicability = (a) => {
|
|
20975
21695
|
if (isUndefined_1(a))
|
|
20976
21696
|
return true;
|
|
20977
|
-
// targetId is not required at LIVEBOARD level, since the filter applies to
|
|
21697
|
+
// targetId is not required at LIVEBOARD level, since the filter applies to
|
|
21698
|
+
// the whole Liveboard
|
|
20978
21699
|
return isPlainObject_1(a)
|
|
20979
21700
|
&& Object.values(exports.ApplicabilityLevel).includes(a.level)
|
|
20980
21701
|
&& (a.level === exports.ApplicabilityLevel.Liveboard || (isString_1(a.targetId) && a.targetId.trim().length > 0));
|
|
@@ -20993,8 +21714,52 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20993
21714
|
const hasValidFilters = Array.isArray(payload.filters) && payload.filters.length > 0 && payload.filters.every(isValidFilter);
|
|
20994
21715
|
return !!(hasValidFilter || hasValidFilters);
|
|
20995
21716
|
}
|
|
21717
|
+
/**
|
|
21718
|
+
* Rewrites one filter's `columnName`/`operator` to `column`/`oper`.
|
|
21719
|
+
*
|
|
21720
|
+
* Callers may use either spelling: `columnName`/`operator` match
|
|
21721
|
+
* {@link RuntimeFilter} and the `EmbedEvent.FilterChanged` payload, so a
|
|
21722
|
+
* converted payload can be replayed as-is. But the payload is forwarded to the
|
|
21723
|
+
* embedded app unchanged, and only `column`/`oper` are known to be understood
|
|
21724
|
+
* there - so the alias must be swapped here, or it would pass validation and
|
|
21725
|
+
* then be silently ignored.
|
|
21726
|
+
*
|
|
21727
|
+
* If a caller supplies both spellings of a field - which TypeScript rejects,
|
|
21728
|
+
* but JavaScript callers can still do - the documented `columnName`/`operator`
|
|
21729
|
+
* wins. Deferring to the deprecated spelling would quietly discard the value
|
|
21730
|
+
* the rest of the SDK tells people to use.
|
|
21731
|
+
* @param filter One entry from the UpdateFilters payload.
|
|
21732
|
+
*/
|
|
21733
|
+
function resolveFilterAliases(filter) {
|
|
21734
|
+
var _a, _b;
|
|
21735
|
+
if (!isPlainObject_1(filter))
|
|
21736
|
+
return filter;
|
|
21737
|
+
const column = (_a = filter.columnName) !== null && _a !== void 0 ? _a : filter.column;
|
|
21738
|
+
const oper = (_b = filter.operator) !== null && _b !== void 0 ? _b : filter.oper;
|
|
21739
|
+
const { columnName, operator, ...rest } = filter;
|
|
21740
|
+
return {
|
|
21741
|
+
...rest,
|
|
21742
|
+
...(isUndefined_1(column) ? {} : { column }),
|
|
21743
|
+
...(isUndefined_1(oper) ? {} : { oper }),
|
|
21744
|
+
};
|
|
21745
|
+
}
|
|
21746
|
+
/**
|
|
21747
|
+
* Rewrites every filter in an UpdateFilters payload to use `column`/`oper`,
|
|
21748
|
+
* whichever spelling the caller supplied. Call after validation.
|
|
21749
|
+
* @param payload The UpdateFilters host event payload.
|
|
21750
|
+
*/
|
|
21751
|
+
function resolveUpdateFiltersAliases(payload) {
|
|
21752
|
+
if (!isPlainObject_1(payload))
|
|
21753
|
+
return payload;
|
|
21754
|
+
return {
|
|
21755
|
+
...payload,
|
|
21756
|
+
...(payload.filter ? { filter: resolveFilterAliases(payload.filter) } : {}),
|
|
21757
|
+
...(Array.isArray(payload.filters) ? { filters: payload.filters.map(resolveFilterAliases) } : {}),
|
|
21758
|
+
};
|
|
21759
|
+
}
|
|
20996
21760
|
function isValidUpdateParametersPayload(payload) {
|
|
20997
|
-
// Only validates the applicability of each parameter (null treated as
|
|
21761
|
+
// Only validates the applicability of each parameter (null treated as
|
|
21762
|
+
// absent); the rest is forwarded as-is for backward compatibility.
|
|
20998
21763
|
if (!Array.isArray(payload))
|
|
20999
21764
|
return true;
|
|
21000
21765
|
return payload.every((p) => {
|
|
@@ -21042,7 +21807,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21042
21807
|
/**
|
|
21043
21808
|
* Maps HostEvent to its corresponding UIPassthroughEvent.
|
|
21044
21809
|
* Includes both custom-handler events (Pin, SaveAnswer, UpdateFilters, DrillDown)
|
|
21045
|
-
* and getter events (GetAnswerSession, GetFilters, etc.) that use
|
|
21810
|
+
* and getter events (GetAnswerSession, GetFilters, etc.) that use
|
|
21811
|
+
* getDataWithPassthroughFallback.
|
|
21046
21812
|
*/
|
|
21047
21813
|
const PASSTHROUGH_MAP = {
|
|
21048
21814
|
// Custom handlers (setters with special logic)
|
|
@@ -21192,13 +21958,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21192
21958
|
if (!isValidUpdateFiltersPayload(payload)) {
|
|
21193
21959
|
throwUpdateFiltersValidationError();
|
|
21194
21960
|
}
|
|
21195
|
-
|
|
21961
|
+
// The shared contract accepts both current (columnName/operator) and
|
|
21962
|
+
// legacy (column/oper) filter field names, but only the legacy pair is
|
|
21963
|
+
// understood downstream, so the payload is rewritten before it is
|
|
21964
|
+
// forwarded — otherwise a columnName/operator filter passes validation
|
|
21965
|
+
// here and is then silently ignored by the app. The cast bridges the
|
|
21966
|
+
// UIPassthrough FilterUpdate type, which still declares only the legacy
|
|
21967
|
+
// names.
|
|
21968
|
+
const resolvedPayload = resolveUpdateFiltersAliases(payload);
|
|
21969
|
+
return this.handleHostEventWithParam(exports.UIPassthroughEvent.UpdateFilters, resolvedPayload, context);
|
|
21196
21970
|
}
|
|
21197
21971
|
handleUpdateParametersEvent(payload, context) {
|
|
21198
21972
|
if (!isValidUpdateParametersPayload(payload)) {
|
|
21199
21973
|
throwUpdateParametersValidationError();
|
|
21200
21974
|
}
|
|
21201
|
-
// UpdateParameters has no UI passthrough contract; dispatch over the
|
|
21975
|
+
// UpdateParameters has no UI passthrough contract; dispatch over the
|
|
21976
|
+
// legacy channel
|
|
21202
21977
|
return this.hostEventFallback(exports.HostEvent.UpdateParameters, payload, context);
|
|
21203
21978
|
}
|
|
21204
21979
|
handleDrillDownEvent(payload, context) {
|
|
@@ -21209,8 +21984,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21209
21984
|
}
|
|
21210
21985
|
/**
|
|
21211
21986
|
* Dispatches a host event using the appropriate channel:
|
|
21212
|
-
* 1. If the embedded app supports UI passthrough for this event, use it (custom
|
|
21213
|
-
* 2. Otherwise fall back to the legacy host event channel.
|
|
21987
|
+
* 1. If the embedded app supports UI passthrough for this event, use it (custom
|
|
21988
|
+
* handler or getter). 2. Otherwise fall back to the legacy host event channel.
|
|
21214
21989
|
*
|
|
21215
21990
|
* @param hostEvent - The host event to trigger
|
|
21216
21991
|
* @param payload - Optional payload for the event
|
|
@@ -21219,7 +21994,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21219
21994
|
async triggerHostEvent(hostEvent, payload, context) {
|
|
21220
21995
|
const customHandler = this.customHandlers[hostEvent];
|
|
21221
21996
|
const passthroughEvent = PASSTHROUGH_MAP[hostEvent];
|
|
21222
|
-
// If embedded app supports passthrough but not this event, use legacy
|
|
21997
|
+
// If embedded app supports passthrough but not this event, use legacy
|
|
21998
|
+
// channel
|
|
21223
21999
|
const keys = passthroughEvent ? await this.getAvailableUIPassthroughKeys(context) : [];
|
|
21224
22000
|
if (passthroughEvent && keys.length > 0 && !keys.includes(passthroughEvent)) {
|
|
21225
22001
|
return this.hostEventFallback(hostEvent, payload, context);
|
|
@@ -21426,6 +22202,63 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21426
22202
|
*/
|
|
21427
22203
|
const PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY = 'tsEmbedOriginalPosition';
|
|
21428
22204
|
const PRERENDER_WRAPPER_ID_PREFIX = 'tsEmbed-pre-render-wrapper-';
|
|
22205
|
+
// The container applies UpdateEmbedParams through React state, so a delivered
|
|
22206
|
+
// post is not the same as the params being in effect.
|
|
22207
|
+
const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
|
|
22208
|
+
// The container ignores runtimeFilterParams/runtimeParameterParams unless
|
|
22209
|
+
// truthy, so null or '' leaves the previous embed's values in place. '&' is
|
|
22210
|
+
// truthy and parses to {}.
|
|
22211
|
+
const NO_RUNTIME_PARAMS = '&';
|
|
22212
|
+
/**
|
|
22213
|
+
* Query parameters that stay on the iframe `src` while config is excluded from
|
|
22214
|
+
* the URL, which is the default unless the embed sets the
|
|
22215
|
+
* `excludeConfigFromURL` additional flag to `false`. These are the parameters the
|
|
22216
|
+
* application shell needs before it can receive a postMessage at all: the
|
|
22217
|
+
* embed marker, the host application URL used to validate the message origin,
|
|
22218
|
+
* the SDK version, the flags that pick the authentication flow, and the
|
|
22219
|
+
* boot-time settings that would otherwise be applied a frame late (viewport,
|
|
22220
|
+
* log level, locale, formatting and org). Everything else is delivered over
|
|
22221
|
+
* `HostEvent.UpdateEmbedParams`.
|
|
22222
|
+
* @internal
|
|
22223
|
+
*/
|
|
22224
|
+
const BOOTSTRAP_URL_PARAMS = new Set([
|
|
22225
|
+
Param.EmbedApp,
|
|
22226
|
+
Param.HostAppUrl,
|
|
22227
|
+
Param.Version,
|
|
22228
|
+
Param.AuthType,
|
|
22229
|
+
Param.AutoLogin,
|
|
22230
|
+
Param.DisableLoginRedirect,
|
|
22231
|
+
Param.ForceSAMLAutoRedirect,
|
|
22232
|
+
Param.cookieless,
|
|
22233
|
+
Param.preAuthCache,
|
|
22234
|
+
Param.blockNonEmbedFullAppAccess,
|
|
22235
|
+
Param.OverrideOrgId,
|
|
22236
|
+
Param.ViewPortHeight,
|
|
22237
|
+
Param.ViewPortWidth,
|
|
22238
|
+
Param.ClientLogLevel,
|
|
22239
|
+
Param.OverrideNativeConsole,
|
|
22240
|
+
Param.PendoTrackingKey,
|
|
22241
|
+
Param.NumberFormatLocale,
|
|
22242
|
+
Param.DateFormatLocale,
|
|
22243
|
+
Param.CurrencyFormat,
|
|
22244
|
+
Param.Locale,
|
|
22245
|
+
Param.searchEmbed,
|
|
22246
|
+
Param.livedBoardEmbed,
|
|
22247
|
+
Param.isSpotterAgentEmbed,
|
|
22248
|
+
Param.SpotterEnabled,
|
|
22249
|
+
Param.IsFullAppEmbed,
|
|
22250
|
+
Param.IsOnBeforeGetVizDataInterceptEnabled,
|
|
22251
|
+
Param.LinkOverride,
|
|
22252
|
+
Param.EnableLinkOverridesV2,
|
|
22253
|
+
Param.DisableRedirectionLinksInNewTab,
|
|
22254
|
+
Param.OverrideHistoryState,
|
|
22255
|
+
Param.ForceTable,
|
|
22256
|
+
Param.StringIDsUrl,
|
|
22257
|
+
Param.DataSources,
|
|
22258
|
+
Param.ExposeTranslationIDs,
|
|
22259
|
+
Param.IconSpriteUrl,
|
|
22260
|
+
Param.Tag,
|
|
22261
|
+
]);
|
|
21429
22262
|
/**
|
|
21430
22263
|
* The event id map from v2 event names to v1 event id
|
|
21431
22264
|
* v1 events are the classic embed events implemented in Blink v1
|
|
@@ -21452,6 +22285,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21452
22285
|
* The key to store the embed instance in the DOM node
|
|
21453
22286
|
*/
|
|
21454
22287
|
this.embedNodeKey = '__tsEmbed';
|
|
22288
|
+
this.embedContainerLoadedKey = '__tsEmbedContainerLoaded';
|
|
21455
22289
|
this.isAppInitialized = false;
|
|
21456
22290
|
/**
|
|
21457
22291
|
* Should we encode URL Query Params using base64 encoding which ThoughtSpot
|
|
@@ -21472,7 +22306,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21472
22306
|
const eventType = this.getEventType(event);
|
|
21473
22307
|
const eventPort = this.getEventPort(event);
|
|
21474
22308
|
const eventData = this.formatEventData(event, eventType);
|
|
21475
|
-
if (event
|
|
22309
|
+
if (isMessageFromIframe(event, this.iFrame, this.thoughtSpotHost)) {
|
|
21476
22310
|
const processedEventData = processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.hostElement);
|
|
21477
22311
|
if (eventType === exports.EmbedEvent.ApiIntercept) {
|
|
21478
22312
|
this.handleApiInterceptEvent({ eventData, eventPort });
|
|
@@ -21614,20 +22448,28 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21614
22448
|
this.createEmbedContainerHandler = (source) => () => {
|
|
21615
22449
|
const processEmbedContainerReady = () => {
|
|
21616
22450
|
logger$3.debug('processEmbedContainerReady');
|
|
21617
|
-
this.
|
|
22451
|
+
this.markEmbedContainerLoaded();
|
|
21618
22452
|
this.executeEmbedContainerReadyCallbacks();
|
|
21619
22453
|
};
|
|
21620
22454
|
if (source === exports.EmbedEvent.AuthInit) {
|
|
21621
22455
|
const AUTH_INIT_FALLBACK_DELAY = 1000;
|
|
21622
22456
|
// Wait for 1 second to ensure the embed container is loaded
|
|
21623
22457
|
// This is a workaround to ensure the embed container is loaded
|
|
21624
|
-
// this is needed until all clusters have EmbedListenerReady
|
|
22458
|
+
// this is needed until all clusters have EmbedListenerReady
|
|
22459
|
+
// event
|
|
21625
22460
|
setTimeout(processEmbedContainerReady, AUTH_INIT_FALLBACK_DELAY);
|
|
21626
22461
|
}
|
|
21627
22462
|
else if (source === exports.EmbedEvent.EmbedListenerReady) {
|
|
21628
22463
|
processEmbedContainerReady();
|
|
22464
|
+
if (this.isConfigExcludedFromUrl()) {
|
|
22465
|
+
this.triggerUpdateEmbedParams();
|
|
22466
|
+
}
|
|
21629
22467
|
}
|
|
21630
22468
|
};
|
|
22469
|
+
// Subclasses that navigate the pre-render on show must await this before
|
|
22470
|
+
// triggering Navigate. Resolves even on failure, so navigation is never
|
|
22471
|
+
// blocked.
|
|
22472
|
+
this.preRenderParamsApplied = Promise.resolve();
|
|
21631
22473
|
this.hostElement = getDOMNode(domSelector);
|
|
21632
22474
|
this.eventHandlerMap = new Map();
|
|
21633
22475
|
this.isError = false;
|
|
@@ -21944,6 +22786,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21944
22786
|
return `${basePath}#`;
|
|
21945
22787
|
}
|
|
21946
22788
|
async getUpdateEmbedParamsObject() {
|
|
22789
|
+
var _a, _b;
|
|
21947
22790
|
const queryParams = this.getEmbedParamsObject();
|
|
21948
22791
|
// Values are URL-serialized (e.g. dataSources as '["guid"]'); parse
|
|
21949
22792
|
// them back so the event payload matches a URL load (SCAL-334713).
|
|
@@ -21951,7 +22794,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21951
22794
|
queryParams[key] = deserializeParam(queryParams[key]);
|
|
21952
22795
|
});
|
|
21953
22796
|
const appInitData = await this.getAppInitData();
|
|
21954
|
-
return {
|
|
22797
|
+
return {
|
|
22798
|
+
...this.viewConfig,
|
|
22799
|
+
...queryParams,
|
|
22800
|
+
...appInitData,
|
|
22801
|
+
// A show cycle has no URL to carry these, so the payload always
|
|
22802
|
+
// states them — including "none", which is the case that leaks the
|
|
22803
|
+
// previous filters.
|
|
22804
|
+
runtimeFilterParams: getFilterQuery((_a = this.viewConfig.runtimeFilters) !== null && _a !== void 0 ? _a : []) || NO_RUNTIME_PARAMS,
|
|
22805
|
+
runtimeParameterParams: getRuntimeParameters((_b = this.viewConfig.runtimeParameters) !== null && _b !== void 0 ? _b : [])
|
|
22806
|
+
|| NO_RUNTIME_PARAMS,
|
|
22807
|
+
};
|
|
21955
22808
|
}
|
|
21956
22809
|
/**
|
|
21957
22810
|
* Common query params set for all the embed modes.
|
|
@@ -22115,13 +22968,20 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22115
22968
|
return path;
|
|
22116
22969
|
}
|
|
22117
22970
|
getEmbedParams() {
|
|
22118
|
-
const queryParams = this.
|
|
22971
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
22119
22972
|
return getQueryParamString(queryParams);
|
|
22120
22973
|
}
|
|
22121
22974
|
getEmbedParamsObject() {
|
|
22122
22975
|
const params = this.getBaseQueryParams();
|
|
22123
22976
|
return params;
|
|
22124
22977
|
}
|
|
22978
|
+
getUrlQueryParamsObject() {
|
|
22979
|
+
const queryParams = this.getEmbedParamsObject();
|
|
22980
|
+
if (!this.isConfigExcludedFromUrl()) {
|
|
22981
|
+
return queryParams;
|
|
22982
|
+
}
|
|
22983
|
+
return Object.fromEntries(Object.entries(queryParams).filter(([key]) => BOOTSTRAP_URL_PARAMS.has(key)));
|
|
22984
|
+
}
|
|
22125
22985
|
getRootIframeSrc() {
|
|
22126
22986
|
const query = this.getEmbedParams();
|
|
22127
22987
|
return this.getEmbedBasePath(query);
|
|
@@ -22582,40 +23442,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22582
23442
|
getCompatibleEventType(eventType) {
|
|
22583
23443
|
return V1EventMap[eventType] || eventType;
|
|
22584
23444
|
}
|
|
22585
|
-
/**
|
|
22586
|
-
* Calculates the iframe center for the current visible viewPort
|
|
22587
|
-
* of iframe using Scroll position of Host App, offsetTop for iframe
|
|
22588
|
-
* in Host app. ViewPort height of the tab.
|
|
22589
|
-
* @returns iframe Center in visible viewport,
|
|
22590
|
-
* Iframe height,
|
|
22591
|
-
* View port height.
|
|
22592
|
-
*/
|
|
22593
|
-
getIframeCenter() {
|
|
22594
|
-
const offsetTopClient = getOffsetTop(this.iFrame);
|
|
22595
|
-
const scrollTopClient = window.scrollY;
|
|
22596
|
-
const viewPortHeight = window.innerHeight;
|
|
22597
|
-
const iframeHeight = this.iFrame.offsetHeight;
|
|
22598
|
-
const iframeScrolled = scrollTopClient - offsetTopClient;
|
|
22599
|
-
let iframeVisibleViewPort;
|
|
22600
|
-
let iframeOffset;
|
|
22601
|
-
if (iframeScrolled < 0) {
|
|
22602
|
-
iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
|
|
22603
|
-
iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
|
|
22604
|
-
iframeOffset = 0;
|
|
22605
|
-
}
|
|
22606
|
-
else {
|
|
22607
|
-
iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
|
|
22608
|
-
iframeOffset = iframeScrolled;
|
|
22609
|
-
}
|
|
22610
|
-
const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
|
|
22611
|
-
return {
|
|
22612
|
-
iframeCenter,
|
|
22613
|
-
iframeScrolled,
|
|
22614
|
-
iframeHeight,
|
|
22615
|
-
viewPortHeight,
|
|
22616
|
-
iframeVisibleViewPort,
|
|
22617
|
-
};
|
|
22618
|
-
}
|
|
22619
23445
|
/**
|
|
22620
23446
|
* Registers an event listener to trigger an alert when the ThoughtSpot app
|
|
22621
23447
|
* sends an event of a particular message type to the host application.
|
|
@@ -22699,13 +23525,33 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22699
23525
|
var _a;
|
|
22700
23526
|
const embedObj = (_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
22701
23527
|
if (embedObj === this) {
|
|
22702
|
-
logger$3.
|
|
23528
|
+
logger$3.debug('embedObj is same as this');
|
|
22703
23529
|
}
|
|
22704
23530
|
return embedObj;
|
|
22705
23531
|
}
|
|
23532
|
+
takeOverPreRender() {
|
|
23533
|
+
if (!this.preRenderWrapper)
|
|
23534
|
+
return;
|
|
23535
|
+
this.preRenderWrapper[this.embedNodeKey] = this;
|
|
23536
|
+
}
|
|
23537
|
+
// The flag lives on the wrapper because it describes the iframe: an
|
|
23538
|
+
// instance hidden when the container announced itself would otherwise
|
|
23539
|
+
// report false forever.
|
|
23540
|
+
markEmbedContainerLoaded() {
|
|
23541
|
+
this.isEmbedContainerLoaded = true;
|
|
23542
|
+
if (this.preRenderWrapper) {
|
|
23543
|
+
this.preRenderWrapper[this.embedContainerLoadedKey] = true;
|
|
23544
|
+
}
|
|
23545
|
+
}
|
|
22706
23546
|
checkEmbedContainerLoaded() {
|
|
23547
|
+
var _a;
|
|
22707
23548
|
if (this.isEmbedContainerLoaded)
|
|
22708
23549
|
return true;
|
|
23550
|
+
if ((_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedContainerLoadedKey]) {
|
|
23551
|
+
this.isEmbedContainerLoaded = true;
|
|
23552
|
+
return true;
|
|
23553
|
+
}
|
|
23554
|
+
// Older builds stamped the flag on the instance, not the wrapper.
|
|
22709
23555
|
const preRenderObj = this.getPreRenderObj();
|
|
22710
23556
|
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
22711
23557
|
this.isEmbedContainerLoaded = true;
|
|
@@ -22734,8 +23580,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22734
23580
|
}
|
|
22735
23581
|
/**
|
|
22736
23582
|
* Triggers an event to the embedded app
|
|
23583
|
+
*
|
|
23584
|
+
* Payload typing: from SDK 1.52.0 (ThoughtSpot Cloud 26.9.0.cl), unknown fields
|
|
23585
|
+
* on a known event's payload fail to compile. From SDK 1.54.0 (26.11.0.cl) the
|
|
23586
|
+
* payload is checked strictly against the event contract — update call sites now.
|
|
22737
23587
|
* @param {HostEvent} messageType The event type
|
|
22738
|
-
* @param {
|
|
23588
|
+
* @param {TriggerData} data The payload, typed against the event's contract
|
|
22739
23589
|
* @param {ContextType} context Optional context type to specify the context from which the event is triggered.
|
|
22740
23590
|
* Use ContextType.Search for search answer context, ContextType.Answer for answer/explore context,
|
|
22741
23591
|
* ContextType.Liveboard for liveboard context, or ContextType.Spotter for spotter context.
|
|
@@ -22752,7 +23602,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22752
23602
|
* ```
|
|
22753
23603
|
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl (for context parameter)
|
|
22754
23604
|
*/
|
|
22755
|
-
async trigger(messageType,
|
|
23605
|
+
async trigger(messageType,
|
|
23606
|
+
// Contract shape is the contextual type: payload fields autocomplete
|
|
23607
|
+
// and unknown fields on object literals are flagged. Strict checks
|
|
23608
|
+
// land in SDK 1.54.0 — see TriggerData.
|
|
23609
|
+
data = {}, context) {
|
|
22756
23610
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
22757
23611
|
if (!this.isRendered) {
|
|
22758
23612
|
this.handleError({
|
|
@@ -23035,25 +23889,43 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23035
23889
|
this.isRendered = true;
|
|
23036
23890
|
return this.renderIFrame(prerenderFrameSrc);
|
|
23037
23891
|
}
|
|
23892
|
+
isConfigExcludedFromUrl() {
|
|
23893
|
+
var _a, _b, _c;
|
|
23894
|
+
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;
|
|
23895
|
+
// Enabled by default; only an explicit false opts out.
|
|
23896
|
+
return flag !== false && flag !== 'false';
|
|
23897
|
+
}
|
|
23898
|
+
async triggerUpdateEmbedParams() {
|
|
23899
|
+
try {
|
|
23900
|
+
const params = await this.getUpdateEmbedParamsObject();
|
|
23901
|
+
this.trigger(exports.HostEvent.UpdateEmbedParams, params);
|
|
23902
|
+
}
|
|
23903
|
+
catch (error) {
|
|
23904
|
+
logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
|
|
23905
|
+
this.handleError({
|
|
23906
|
+
errorType: exports.ErrorDetailsTypes.API,
|
|
23907
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
|
|
23908
|
+
code: exports.EmbedErrorCodes.UPDATE_PARAMS_FAILED,
|
|
23909
|
+
error: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
23910
|
+
});
|
|
23911
|
+
}
|
|
23912
|
+
}
|
|
23038
23913
|
beforePrerenderVisible() {
|
|
23039
23914
|
// We can ignore this as its a bit expensive and the newer customers
|
|
23040
23915
|
// have moved on to UpdateEmbedParams supported clusters
|
|
23041
23916
|
// this.validatePreRenderViewConfig(this.viewConfig); removed in #517
|
|
23042
23917
|
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
23043
|
-
|
|
23044
|
-
|
|
23045
|
-
|
|
23046
|
-
|
|
23047
|
-
|
|
23048
|
-
|
|
23049
|
-
|
|
23050
|
-
|
|
23051
|
-
|
|
23052
|
-
|
|
23053
|
-
|
|
23054
|
-
error: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
23055
|
-
});
|
|
23056
|
-
}
|
|
23918
|
+
// Created synchronously: a queued navigation needs something to await
|
|
23919
|
+
// whether the container is already loaded or not.
|
|
23920
|
+
this.preRenderParamsApplied = new Promise((resolve) => {
|
|
23921
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
23922
|
+
try {
|
|
23923
|
+
await this.triggerUpdateEmbedParams();
|
|
23924
|
+
}
|
|
23925
|
+
finally {
|
|
23926
|
+
setTimeout(resolve, UPDATE_EMBED_PARAMS_SETTLE_MS);
|
|
23927
|
+
}
|
|
23928
|
+
});
|
|
23057
23929
|
});
|
|
23058
23930
|
}
|
|
23059
23931
|
/**
|
|
@@ -23083,8 +23955,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23083
23955
|
if (this.hostElement) {
|
|
23084
23956
|
this.insertedDomEl = this.createPreRenderPlaceholder();
|
|
23085
23957
|
if (this.viewConfig.fullHeight) {
|
|
23086
|
-
// If fullHeight has already sized the wrapper, seed the
|
|
23087
|
-
// with the same height so syncPreRenderStyle gets
|
|
23958
|
+
// If fullHeight has already sized the wrapper, seed the
|
|
23959
|
+
// placeholder with the same height so syncPreRenderStyle gets
|
|
23960
|
+
// an accurate rect.
|
|
23088
23961
|
const existingHeight = this.preRenderWrapper.style.height;
|
|
23089
23962
|
if (existingHeight) {
|
|
23090
23963
|
this.insertedDomEl.style.height = existingHeight;
|
|
@@ -23092,12 +23965,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23092
23965
|
}
|
|
23093
23966
|
const placeHolderId = this.getPreRenderIds().placeHolder;
|
|
23094
23967
|
// Remove any stale placeholder from a previous cycle. It is located
|
|
23095
|
-
// via a subtree-wide querySelector, so it may be nested deeper
|
|
23096
|
-
// direct child (E.g.: with fullHeight the host app can wrap
|
|
23097
|
-
// Element.remove() — which detaches from whatever the real
|
|
23098
|
-
// rather than hostElement.removeChild(), which throws
|
|
23099
|
-
// when the match is not a direct child. Mirrors the
|
|
23100
|
-
// cleanup in
|
|
23968
|
+
// via a subtree-wide querySelector, so it may be nested deeper
|
|
23969
|
+
// than a direct child (E.g.: with fullHeight the host app can wrap
|
|
23970
|
+
// it). Use Element.remove() — which detaches from whatever the real
|
|
23971
|
+
// parent is — rather than hostElement.removeChild(), which throws
|
|
23972
|
+
// NotFoundError when the match is not a direct child. Mirrors the
|
|
23973
|
+
// wrapper/child cleanup in
|
|
23974
|
+
// createPreRenderWrapper()/createPreRenderChild().
|
|
23101
23975
|
(_a = this.hostElement.querySelector(`#${placeHolderId}`)) === null || _a === void 0 ? void 0 : _a.remove();
|
|
23102
23976
|
this.hostElement.appendChild(this.insertedDomEl);
|
|
23103
23977
|
this.syncPreRenderStyle();
|
|
@@ -23129,6 +24003,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23129
24003
|
if (this.iFrame) {
|
|
23130
24004
|
this.setupFullscreenChangeHandler();
|
|
23131
24005
|
}
|
|
24006
|
+
// Last, so everything above still sees the instance being taken over
|
|
24007
|
+
// from.
|
|
24008
|
+
this.takeOverPreRender();
|
|
23132
24009
|
return this;
|
|
23133
24010
|
}
|
|
23134
24011
|
getPreRenderPlaceHolderElement() {
|
|
@@ -23331,6 +24208,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23331
24208
|
* ```
|
|
23332
24209
|
*/
|
|
23333
24210
|
on(messageType, callback, options = { start: false }) {
|
|
24211
|
+
// Mirror the base TsEmbed.on generic signature so the enriched
|
|
24212
|
+
// EmbedEventPayload (e.g. CustomAction's answerService) flows through
|
|
24213
|
+
// the override too, and the class hierarchy stays assignable.
|
|
23334
24214
|
const eventType = this.getCompatibleEventType(messageType);
|
|
23335
24215
|
return super.on(eventType, callback, options);
|
|
23336
24216
|
}
|
|
@@ -23411,6 +24291,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23411
24291
|
starterPrompts,
|
|
23412
24292
|
},
|
|
23413
24293
|
};
|
|
24294
|
+
}
|
|
24295
|
+
function buildSpotterAnalystAppInitData(initData, viewConfig) {
|
|
24296
|
+
const { spotterAnalystConfig } = viewConfig;
|
|
24297
|
+
if (!(spotterAnalystConfig === null || spotterAnalystConfig === void 0 ? void 0 : spotterAnalystConfig.analystId))
|
|
24298
|
+
return initData;
|
|
24299
|
+
return {
|
|
24300
|
+
...initData,
|
|
24301
|
+
embedParams: {
|
|
24302
|
+
...(initData.embedParams || {}),
|
|
24303
|
+
spotterAnalystConfig,
|
|
24304
|
+
},
|
|
24305
|
+
};
|
|
23414
24306
|
}
|
|
23415
24307
|
|
|
23416
24308
|
function buildSpotterVizAppInitData(initData, viewConfig) {
|
|
@@ -23571,73 +24463,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23571
24463
|
constructor(domSelector, viewConfig) {
|
|
23572
24464
|
viewConfig.embedComponentType = 'AppEmbed';
|
|
23573
24465
|
super(domSelector, viewConfig);
|
|
23574
|
-
this.defaultHeight = 500;
|
|
23575
|
-
this.lazyLoadScrollContainers = [];
|
|
23576
|
-
this.sendFullHeightLazyLoadData = () => {
|
|
23577
|
-
const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
23578
|
-
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
23579
|
-
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
23580
|
-
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
23581
|
-
}
|
|
23582
|
-
};
|
|
23583
|
-
/**
|
|
23584
|
-
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
23585
|
-
* It is used to send the visible coordinates data to the host application.
|
|
23586
|
-
* @param data The event payload
|
|
23587
|
-
* @param responder The responder function
|
|
23588
|
-
*/
|
|
23589
|
-
this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
|
|
23590
|
-
logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
23591
|
-
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
23592
|
-
responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
23593
|
-
};
|
|
23594
|
-
/**
|
|
23595
|
-
* Set the iframe height as per the computed height received
|
|
23596
|
-
* from the ThoughtSpot app.
|
|
23597
|
-
* @param data The event payload
|
|
23598
|
-
*/
|
|
23599
|
-
this.updateIFrameHeight = (data) => {
|
|
23600
|
-
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
23601
|
-
this.sendFullHeightLazyLoadData();
|
|
23602
|
-
};
|
|
23603
|
-
this.embedIframeCenter = (data, responder) => {
|
|
23604
|
-
const obj = this.getIframeCenter();
|
|
23605
|
-
responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
|
|
23606
|
-
};
|
|
23607
|
-
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
23608
|
-
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
23609
|
-
const liveboardRelatedRoutes = [
|
|
23610
|
-
'/pinboard/',
|
|
23611
|
-
'/insights/pinboard/',
|
|
23612
|
-
'/schedules/',
|
|
23613
|
-
'/embed/viz/',
|
|
23614
|
-
'/embed/insights/viz/',
|
|
23615
|
-
'/liveboard/',
|
|
23616
|
-
'/insights/liveboard/',
|
|
23617
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
23618
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
23619
|
-
];
|
|
23620
|
-
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
23621
|
-
// Ignore the height reset of the frame, if the navigation is
|
|
23622
|
-
// only within the liveboard page.
|
|
23623
|
-
return;
|
|
23624
|
-
}
|
|
23625
|
-
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
23626
|
-
};
|
|
23627
24466
|
if (this.viewConfig.fullHeight === true) {
|
|
23628
|
-
|
|
23629
|
-
this.
|
|
23630
|
-
|
|
23631
|
-
|
|
23632
|
-
|
|
23633
|
-
|
|
23634
|
-
|
|
23635
|
-
|
|
23636
|
-
|
|
23637
|
-
|
|
23638
|
-
this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
23639
|
-
this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
23640
|
-
this.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
|
|
24467
|
+
this.fullHeightController = new FullHeightController(this.viewConfig, {
|
|
24468
|
+
getIframe: () => this.iFrame,
|
|
24469
|
+
setFrameHeight: (height) => this.setIFrameHeight(height),
|
|
24470
|
+
on: (eventType, callback) => {
|
|
24471
|
+
this.on(eventType, callback);
|
|
24472
|
+
},
|
|
24473
|
+
trigger: (hostEvent, data) => {
|
|
24474
|
+
this.trigger(hostEvent, data);
|
|
24475
|
+
},
|
|
24476
|
+
});
|
|
23641
24477
|
}
|
|
23642
24478
|
}
|
|
23643
24479
|
/**
|
|
@@ -23664,11 +24500,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23664
24500
|
* embedded Liveboard or visualization.
|
|
23665
24501
|
*/
|
|
23666
24502
|
getEmbedParams() {
|
|
23667
|
-
const params = this.
|
|
24503
|
+
const params = this.getUrlQueryParamsObject();
|
|
23668
24504
|
return getQueryParamString(params, true);
|
|
23669
24505
|
}
|
|
23670
24506
|
getEmbedParamsObject() {
|
|
23671
|
-
|
|
24507
|
+
var _a;
|
|
24508
|
+
const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, newConnectionsExperience, dataPanelV2 = true, updatedSpotterExperience, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, hideHomepageLeftNav = false, modularHomeExperience, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, isEnhancedFilterInteractivityEnabled, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig, spotterDataSources, isThisPeriodInDateFiltersEnabled, enableHomepageAnnouncement = false, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, hideAnswerEditPanel, } = this.viewConfig;
|
|
23672
24509
|
let params = {};
|
|
23673
24510
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
23674
24511
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -23704,6 +24541,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23704
24541
|
if (!isUndefined$1(coverAndFilterOptionInPDF)) {
|
|
23705
24542
|
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
23706
24543
|
}
|
|
24544
|
+
if (!isUndefined$1(hideAnswerEditPanel)) {
|
|
24545
|
+
params[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
|
|
24546
|
+
}
|
|
23707
24547
|
params = this.getBaseQueryParams(params);
|
|
23708
24548
|
if (!isUndefined$1(updatedSpotterChatPrompt)) {
|
|
23709
24549
|
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
@@ -23750,15 +24590,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23750
24590
|
if (hideNotification) {
|
|
23751
24591
|
params[Param.HideNotification] = !!hideNotification;
|
|
23752
24592
|
}
|
|
23753
|
-
|
|
23754
|
-
params[Param.fullHeight] = true;
|
|
23755
|
-
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
23756
|
-
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
23757
|
-
if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
|
|
23758
|
-
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
23759
|
-
}
|
|
23760
|
-
}
|
|
23761
|
-
}
|
|
24593
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
|
|
23762
24594
|
if (tag) {
|
|
23763
24595
|
params[Param.Tag] = tag;
|
|
23764
24596
|
}
|
|
@@ -23825,7 +24657,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23825
24657
|
if (isContinuousLiveboardPDFEnabled !== undefined) {
|
|
23826
24658
|
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
23827
24659
|
}
|
|
23828
|
-
this.defaultHeight = minimumHeight || this.defaultHeight;
|
|
23829
24660
|
if (enableLiveboardDataCache !== undefined) {
|
|
23830
24661
|
params[Param.EnableLiveboardDataCache] = enableLiveboardDataCache;
|
|
23831
24662
|
}
|
|
@@ -23964,52 +24795,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23964
24795
|
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
23965
24796
|
*/
|
|
23966
24797
|
destroy() {
|
|
24798
|
+
var _a;
|
|
23967
24799
|
super.destroy();
|
|
23968
|
-
this.
|
|
24800
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
23969
24801
|
}
|
|
23970
24802
|
postRender() {
|
|
23971
|
-
this.registerLazyLoadEvents();
|
|
23972
|
-
}
|
|
23973
|
-
registerLazyLoadEvents() {
|
|
23974
|
-
if (!this.iFrame) {
|
|
23975
|
-
return;
|
|
23976
|
-
}
|
|
23977
|
-
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
23978
|
-
this.unregisterLazyLoadEvents();
|
|
23979
|
-
// TODO: Use passive: true, install modernizr to check for passive
|
|
23980
|
-
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
23981
|
-
window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
23982
|
-
if (!this.viewConfig.enableScrollableContainerLazyLoading) {
|
|
23983
|
-
return;
|
|
23984
|
-
}
|
|
23985
|
-
this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
|
|
23986
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
23987
|
-
scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
23988
|
-
});
|
|
23989
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
23990
|
-
const resizeTargets = new Set([
|
|
23991
|
-
this.iFrame.parentElement,
|
|
23992
|
-
...getEffectiveClippingAncestors(this.iFrame),
|
|
23993
|
-
].filter(Boolean));
|
|
23994
|
-
this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
|
|
23995
|
-
resizeTargets.forEach((resizeTarget) => {
|
|
23996
|
-
this.lazyLoadResizeObserver.observe(resizeTarget);
|
|
23997
|
-
});
|
|
23998
|
-
}
|
|
23999
|
-
}
|
|
24000
|
-
}
|
|
24001
|
-
unregisterLazyLoadEvents() {
|
|
24002
24803
|
var _a;
|
|
24003
|
-
|
|
24004
|
-
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24005
|
-
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24006
|
-
(_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
24007
|
-
this.lazyLoadResizeObserver = undefined;
|
|
24008
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24009
|
-
scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24010
|
-
});
|
|
24011
|
-
this.lazyLoadScrollContainers = [];
|
|
24012
|
-
}
|
|
24804
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
|
|
24013
24805
|
}
|
|
24014
24806
|
/**
|
|
24015
24807
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
@@ -24104,6 +24896,11 @@ query GetEurekaVizSnapshots(
|
|
|
24104
24896
|
* @summary Liveboard & visualization embed
|
|
24105
24897
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
24106
24898
|
*/
|
|
24899
|
+
// Home unmounts the liveboard container, which is how its state gets cleared.
|
|
24900
|
+
// The settle window gives the container time to do it before we ask for the
|
|
24901
|
+
// liveboard back.
|
|
24902
|
+
const HOME_ROUTE = 'home';
|
|
24903
|
+
const HOME_SETTLE_MS = 200;
|
|
24107
24904
|
/**
|
|
24108
24905
|
* Embed a ThoughtSpot Liveboard or visualization. When rendered it already
|
|
24109
24906
|
* waits for the authentication to complete, so you need not wait for
|
|
@@ -24123,59 +24920,6 @@ query GetEurekaVizSnapshots(
|
|
|
24123
24920
|
constructor(domSelector, viewConfig) {
|
|
24124
24921
|
viewConfig.embedComponentType = 'LiveboardEmbed';
|
|
24125
24922
|
super(domSelector, viewConfig);
|
|
24126
|
-
this.defaultHeight = 500;
|
|
24127
|
-
this.lazyLoadScrollContainers = [];
|
|
24128
|
-
this.sendFullHeightLazyLoadData = () => {
|
|
24129
|
-
const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
24130
|
-
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
24131
|
-
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
24132
|
-
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
24133
|
-
}
|
|
24134
|
-
};
|
|
24135
|
-
/**
|
|
24136
|
-
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
24137
|
-
* It is used to send the visible coordinates data to the host application.
|
|
24138
|
-
* @param data The event payload
|
|
24139
|
-
* @param responder The responder function
|
|
24140
|
-
*/
|
|
24141
|
-
this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
|
|
24142
|
-
logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
24143
|
-
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
|
|
24144
|
-
responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
24145
|
-
};
|
|
24146
|
-
/**
|
|
24147
|
-
* Set the iframe height as per the computed height received
|
|
24148
|
-
* from the ThoughtSpot app.
|
|
24149
|
-
* @param data The event payload
|
|
24150
|
-
*/
|
|
24151
|
-
this.updateIFrameHeight = (data) => {
|
|
24152
|
-
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
24153
|
-
this.sendFullHeightLazyLoadData();
|
|
24154
|
-
};
|
|
24155
|
-
this.embedIframeCenter = (data, responder) => {
|
|
24156
|
-
const obj = this.getIframeCenter();
|
|
24157
|
-
responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
|
|
24158
|
-
};
|
|
24159
|
-
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
24160
|
-
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
24161
|
-
const liveboardRelatedRoutes = [
|
|
24162
|
-
'/pinboard/',
|
|
24163
|
-
'/insights/pinboard/',
|
|
24164
|
-
'/schedules/',
|
|
24165
|
-
'/embed/viz/',
|
|
24166
|
-
'/embed/insights/viz/',
|
|
24167
|
-
'/liveboard/',
|
|
24168
|
-
'/insights/liveboard/',
|
|
24169
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
24170
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
24171
|
-
];
|
|
24172
|
-
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
24173
|
-
// Ignore the height reset of the frame, if the navigation is
|
|
24174
|
-
// only within the liveboard page.
|
|
24175
|
-
return;
|
|
24176
|
-
}
|
|
24177
|
-
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
24178
|
-
};
|
|
24179
24923
|
/**
|
|
24180
24924
|
* @hidden
|
|
24181
24925
|
* Internal state to track the current liveboard id.
|
|
@@ -24189,22 +24933,19 @@ query GetEurekaVizSnapshots(
|
|
|
24189
24933
|
};
|
|
24190
24934
|
if (this.viewConfig.fullHeight === true) {
|
|
24191
24935
|
if (this.viewConfig.vizId) {
|
|
24192
|
-
logger$3.warn('Full height is currently only supported for Liveboard embeds.'
|
|
24193
|
-
'Using full height with vizId might lead to unexpected behavior.');
|
|
24194
|
-
}
|
|
24195
|
-
if (this.viewConfig.lazyLoadingForFullHeight === undefined) {
|
|
24196
|
-
this.viewConfig.lazyLoadingForFullHeight = true;
|
|
24197
|
-
}
|
|
24198
|
-
if (this.viewConfig.enableScrollableContainerLazyLoading === undefined) {
|
|
24199
|
-
this.viewConfig.enableScrollableContainerLazyLoading = true;
|
|
24936
|
+
logger$3.warn('Full height is currently only supported for Liveboard embeds.'
|
|
24937
|
+
+ 'Using full height with vizId might lead to unexpected behavior.');
|
|
24200
24938
|
}
|
|
24201
|
-
|
|
24202
|
-
this.
|
|
24203
|
-
|
|
24204
|
-
|
|
24205
|
-
|
|
24206
|
-
|
|
24207
|
-
|
|
24939
|
+
this.fullHeightController = new FullHeightController(this.viewConfig, {
|
|
24940
|
+
getIframe: () => this.iFrame,
|
|
24941
|
+
setFrameHeight: (height) => this.setIFrameHeight(height),
|
|
24942
|
+
on: (eventType, callback) => {
|
|
24943
|
+
this.on(eventType, callback);
|
|
24944
|
+
},
|
|
24945
|
+
trigger: (hostEvent, data) => {
|
|
24946
|
+
this.trigger(hostEvent, data);
|
|
24947
|
+
},
|
|
24948
|
+
});
|
|
24208
24949
|
}
|
|
24209
24950
|
}
|
|
24210
24951
|
async getAppInitData() {
|
|
@@ -24217,26 +24958,18 @@ query GetEurekaVizSnapshots(
|
|
|
24217
24958
|
* embedded Liveboard or visualization.
|
|
24218
24959
|
*/
|
|
24219
24960
|
getEmbedParams() {
|
|
24220
|
-
const params = this.
|
|
24961
|
+
const params = this.getUrlQueryParamsObject();
|
|
24221
24962
|
const queryParams = getQueryParamString(params, true);
|
|
24222
24963
|
return queryParams;
|
|
24223
24964
|
}
|
|
24224
24965
|
getEmbedParamsObject() {
|
|
24966
|
+
var _a;
|
|
24225
24967
|
let params = {};
|
|
24226
24968
|
params = this.getBaseQueryParams(params);
|
|
24227
|
-
const { enableVizTransformations,
|
|
24969
|
+
const { enableVizTransformations, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, isEnhancedFilterInteractivityEnabled, enableAskSage, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, dataPanelV2 = true, updatedSpotterExperience, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, enableStopAnswerGenerationEmbed, spotterChatConfig, isThisPeriodInDateFiltersEnabled, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, } = this.viewConfig;
|
|
24228
24970
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
24229
24971
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
24230
|
-
|
|
24231
|
-
params[Param.fullHeight] = true;
|
|
24232
|
-
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
24233
|
-
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
24234
|
-
if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
|
|
24235
|
-
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
24236
|
-
}
|
|
24237
|
-
}
|
|
24238
|
-
}
|
|
24239
|
-
this.defaultHeight = minimumHeight || defaultHeight || this.defaultHeight;
|
|
24972
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
|
|
24240
24973
|
if (enableVizTransformations !== undefined) {
|
|
24241
24974
|
params[Param.EnableVizTransformations] = enableVizTransformations.toString();
|
|
24242
24975
|
}
|
|
@@ -24463,19 +25196,49 @@ query GetEurekaVizSnapshots(
|
|
|
24463
25196
|
}
|
|
24464
25197
|
beforePrerenderVisible() {
|
|
24465
25198
|
super.beforePrerenderVisible();
|
|
24466
|
-
|
|
24467
|
-
|
|
24468
|
-
|
|
24469
|
-
|
|
24470
|
-
|
|
24471
|
-
|
|
24472
|
-
|
|
24473
|
-
|
|
24474
|
-
|
|
24475
|
-
|
|
25199
|
+
// Captured before showPreRender() hands the wrapper over to this
|
|
25200
|
+
// instance. Itself means a hide/show, not a hand-over, so there is
|
|
25201
|
+
// nothing stale to clear.
|
|
25202
|
+
const previous = this.getPreRenderObj();
|
|
25203
|
+
const showing = previous === this ? undefined : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
|
|
25204
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
25205
|
+
// Without this the params callback suspends on its await and
|
|
25206
|
+
// Navigate goes out first, so the container loads with the previous
|
|
25207
|
+
// config's filters.
|
|
25208
|
+
await this.preRenderParamsApplied;
|
|
25209
|
+
if (this.isShowingLiveboardRoute(showing)) {
|
|
25210
|
+
// Navigate to the route we are already on is a no-op, so the
|
|
25211
|
+
// liveboard keeps its state. Home unmounts the container, which
|
|
25212
|
+
// clears it.
|
|
25213
|
+
this.trigger(exports.HostEvent.Navigate, HOME_ROUTE)
|
|
25214
|
+
.catch((error) => logger$3.warn('Could not route via home', error));
|
|
25215
|
+
// Not awaited above: the container never acks Navigate, so
|
|
25216
|
+
// that promise only settles on the 30s trigger timeout.
|
|
25217
|
+
await new Promise((resolve) => {
|
|
25218
|
+
setTimeout(resolve, HOME_SETTLE_MS);
|
|
25219
|
+
});
|
|
24476
25220
|
}
|
|
25221
|
+
this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId, this.viewConfig.personalizedViewId);
|
|
25222
|
+
this.currentLiveboardState = {
|
|
25223
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
25224
|
+
vizId: this.viewConfig.vizId,
|
|
25225
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
25226
|
+
personalizedViewId: this.viewConfig.personalizedViewId,
|
|
25227
|
+
};
|
|
24477
25228
|
});
|
|
24478
25229
|
}
|
|
25230
|
+
// The whole route, not just the liveboard id: the path is built from the
|
|
25231
|
+
// viz, tab and view too, so a same-liveboard show onto another tab is a
|
|
25232
|
+
// real navigation.
|
|
25233
|
+
isShowingLiveboardRoute(showing) {
|
|
25234
|
+
if (!(showing === null || showing === void 0 ? void 0 : showing.liveboardId))
|
|
25235
|
+
return false;
|
|
25236
|
+
const { liveboardId, vizId, activeTabId, personalizedViewId, } = this.viewConfig;
|
|
25237
|
+
return showing.liveboardId === liveboardId
|
|
25238
|
+
&& showing.vizId === vizId
|
|
25239
|
+
&& showing.activeTabId === activeTabId
|
|
25240
|
+
&& showing.personalizedViewId === personalizedViewId;
|
|
25241
|
+
}
|
|
24479
25242
|
async handleRenderForPrerender() {
|
|
24480
25243
|
if (isUndefined$1(this.viewConfig.liveboardId)) {
|
|
24481
25244
|
return this.prerenderGeneric();
|
|
@@ -24484,11 +25247,16 @@ query GetEurekaVizSnapshots(
|
|
|
24484
25247
|
}
|
|
24485
25248
|
/**
|
|
24486
25249
|
* Triggers an event to the embedded app
|
|
25250
|
+
* Payload typing follows {@link TsEmbed.trigger}: unknown fields fail to compile
|
|
25251
|
+
* from SDK 1.52.0; strict contract checks land in SDK 1.54.0.
|
|
24487
25252
|
* @param {HostEvent} messageType The event type
|
|
24488
|
-
* @param {
|
|
25253
|
+
* @param {TriggerData} data The payload, typed against the event's contract
|
|
24489
25254
|
* @returns A promise that resolves with the response from the embedded app
|
|
24490
25255
|
*/
|
|
24491
|
-
trigger(messageType,
|
|
25256
|
+
trigger(messageType,
|
|
25257
|
+
// Mirror TsEmbed.trigger: contract shape is the contextual type and
|
|
25258
|
+
// unknown fields on object literals are flagged. Strict in SDK 1.54.0.
|
|
25259
|
+
data = {}, context) {
|
|
24492
25260
|
const dataWithVizId = data;
|
|
24493
25261
|
if (messageType === exports.HostEvent.SetActiveTab) {
|
|
24494
25262
|
this.setActiveTab(data);
|
|
@@ -24504,52 +25272,13 @@ query GetEurekaVizSnapshots(
|
|
|
24504
25272
|
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
24505
25273
|
*/
|
|
24506
25274
|
destroy() {
|
|
25275
|
+
var _a;
|
|
24507
25276
|
super.destroy();
|
|
24508
|
-
this.
|
|
25277
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
24509
25278
|
}
|
|
24510
25279
|
postRender() {
|
|
24511
|
-
this.registerLazyLoadEvents();
|
|
24512
|
-
}
|
|
24513
|
-
registerLazyLoadEvents() {
|
|
24514
|
-
if (!this.iFrame) {
|
|
24515
|
-
return;
|
|
24516
|
-
}
|
|
24517
|
-
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
24518
|
-
this.unregisterLazyLoadEvents();
|
|
24519
|
-
// TODO: Use passive: true, install modernizr to check for passive
|
|
24520
|
-
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24521
|
-
window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24522
|
-
if (!this.viewConfig.enableScrollableContainerLazyLoading) {
|
|
24523
|
-
return;
|
|
24524
|
-
}
|
|
24525
|
-
this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
|
|
24526
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24527
|
-
scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24528
|
-
});
|
|
24529
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
24530
|
-
const resizeTargets = new Set([
|
|
24531
|
-
this.iFrame.parentElement,
|
|
24532
|
-
...getEffectiveClippingAncestors(this.iFrame),
|
|
24533
|
-
].filter(Boolean));
|
|
24534
|
-
this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
|
|
24535
|
-
resizeTargets.forEach((resizeTarget) => {
|
|
24536
|
-
this.lazyLoadResizeObserver.observe(resizeTarget);
|
|
24537
|
-
});
|
|
24538
|
-
}
|
|
24539
|
-
}
|
|
24540
|
-
}
|
|
24541
|
-
unregisterLazyLoadEvents() {
|
|
24542
25280
|
var _a;
|
|
24543
|
-
|
|
24544
|
-
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
24545
|
-
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
24546
|
-
(_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
24547
|
-
this.lazyLoadResizeObserver = undefined;
|
|
24548
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
24549
|
-
scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
24550
|
-
});
|
|
24551
|
-
this.lazyLoadScrollContainers = [];
|
|
24552
|
-
}
|
|
25281
|
+
(_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
|
|
24553
25282
|
}
|
|
24554
25283
|
/**
|
|
24555
25284
|
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
@@ -24694,7 +25423,7 @@ query GetEurekaVizSnapshots(
|
|
|
24694
25423
|
}
|
|
24695
25424
|
getEmbedParamsObject() {
|
|
24696
25425
|
var _a;
|
|
24697
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, isThisPeriodInDateFiltersEnabled, newChartsLibrary, } = this.viewConfig;
|
|
25426
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, isThisPeriodInDateFiltersEnabled, newChartsLibrary, hideAnswerEditPanel, } = this.viewConfig;
|
|
24698
25427
|
const queryParams = this.getBaseQueryParams();
|
|
24699
25428
|
queryParams[Param.HideActions] = [
|
|
24700
25429
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -24717,6 +25446,9 @@ query GetEurekaVizSnapshots(
|
|
|
24717
25446
|
if (enableSearchAssist) {
|
|
24718
25447
|
queryParams[Param.EnableSearchAssist] = true;
|
|
24719
25448
|
}
|
|
25449
|
+
if (hideAnswerEditPanel !== undefined) {
|
|
25450
|
+
queryParams[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
|
|
25451
|
+
}
|
|
24720
25452
|
if (hideResults) {
|
|
24721
25453
|
queryParams[Param.HideResult] = true;
|
|
24722
25454
|
}
|
|
@@ -24757,7 +25489,7 @@ query GetEurekaVizSnapshots(
|
|
|
24757
25489
|
}
|
|
24758
25490
|
getEmbedParams() {
|
|
24759
25491
|
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
24760
|
-
const queryParams = this.
|
|
25492
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
24761
25493
|
let query = '';
|
|
24762
25494
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
24763
25495
|
if (queryParamsString) {
|
|
@@ -24845,7 +25577,7 @@ query GetEurekaVizSnapshots(
|
|
|
24845
25577
|
* @param dataSources A list of data source GUIDs
|
|
24846
25578
|
*/
|
|
24847
25579
|
getIFrameSrc() {
|
|
24848
|
-
const queryParams = this.
|
|
25580
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
24849
25581
|
const path = 'search-bar-embed';
|
|
24850
25582
|
let query = '';
|
|
24851
25583
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
@@ -25279,7 +26011,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25279
26011
|
getIframeSrc() {
|
|
25280
26012
|
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
25281
26013
|
const path = 'conv-assist-answer';
|
|
25282
|
-
const queryParams = this.
|
|
26014
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
25283
26015
|
let query = '';
|
|
25284
26016
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
25285
26017
|
if (queryParamsString) {
|
|
@@ -25447,10 +26179,11 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25447
26179
|
const defaultAppInitData = await super.getAppInitData();
|
|
25448
26180
|
const sidebarInitData = buildSpotterSidebarAppInitData(defaultAppInitData, this.viewConfig, this.handleError.bind(this));
|
|
25449
26181
|
const shareInitData = buildSpotterShareConversationAppInitData(sidebarInitData, this.viewConfig);
|
|
25450
|
-
|
|
26182
|
+
const starterPromptsInitData = buildStarterPromptsAppInitData(shareInitData, this.viewConfig);
|
|
26183
|
+
return buildSpotterAnalystAppInitData(starterPromptsInitData, this.viewConfig);
|
|
25451
26184
|
}
|
|
25452
26185
|
getEmbedParamsObject() {
|
|
25453
|
-
const { searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, updatedSpotterExperience, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig,
|
|
26186
|
+
const { searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, updatedSpotterExperience, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig, } = this.viewConfig;
|
|
25454
26187
|
const queryParams = this.getBaseQueryParams();
|
|
25455
26188
|
queryParams[Param.SpotterEnabled] = true;
|
|
25456
26189
|
// Boolean params
|
|
@@ -25463,7 +26196,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25463
26196
|
setParamIfDefined(queryParams, Param.ShowSpotterRadiance, showSpotterRadiance, true);
|
|
25464
26197
|
setParamIfDefined(queryParams, Param.DefaultQueryMode, defaultQueryMode);
|
|
25465
26198
|
setParamIfDefined(queryParams, Param.EnableStopAnswerGenerationEmbed, enableStopAnswerGenerationEmbed, true);
|
|
25466
|
-
setParamIfDefined(queryParams, Param.AnalystId, spotterAnalystConfig === null || spotterAnalystConfig === void 0 ? void 0 : spotterAnalystConfig.analystId);
|
|
25467
26199
|
// Handle spotterChatConfig params
|
|
25468
26200
|
if (spotterChatConfig) {
|
|
25469
26201
|
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, spotterFileUploadEnabled, spotterFileUploadFileTypes, enableStarterPrompts, } = spotterChatConfig;
|
|
@@ -25487,7 +26219,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25487
26219
|
const path = sharedConversationId
|
|
25488
26220
|
? `insights/conv-assist/s/${encodeURIComponent(sharedConversationId)}`
|
|
25489
26221
|
: 'insights/conv-assist';
|
|
25490
|
-
const queryParams = this.
|
|
26222
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
25491
26223
|
let query = '';
|
|
25492
26224
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
25493
26225
|
if (queryParamsString) {
|
|
@@ -26070,6 +26802,213 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26070
26802
|
return result;
|
|
26071
26803
|
};
|
|
26072
26804
|
|
|
26805
|
+
/**
|
|
26806
|
+
* Copyright (c) 2026
|
|
26807
|
+
*
|
|
26808
|
+
* Utility to convert the payload emitted by `EmbedEvent.FilterChanged`
|
|
26809
|
+
* into the payload shape expected by `HostEvent.UpdateFilters`, so that
|
|
26810
|
+
* the current filter state of a Liveboard can be captured and re-applied
|
|
26811
|
+
* later without having to hand-parse the event payload.
|
|
26812
|
+
* @summary Filter payload converter
|
|
26813
|
+
*/
|
|
26814
|
+
/**
|
|
26815
|
+
* Coerces an epoch/count field to a number, returning `null` when the value is
|
|
26816
|
+
* absent or not a finite number. The payload arrives as JSON from the iframe,
|
|
26817
|
+
* so a missing field can be `null` as well as `undefined`, and `Number(null)`
|
|
26818
|
+
* or `Number('')` would otherwise silently become a valid-looking `0`
|
|
26819
|
+
* (i.e. the Unix epoch, or a zero-length period).
|
|
26820
|
+
* @param value Raw value from the date filter payload.
|
|
26821
|
+
*/
|
|
26822
|
+
function toFiniteNumber(value) {
|
|
26823
|
+
if (isNil_1(value) || value === '')
|
|
26824
|
+
return null;
|
|
26825
|
+
const numericValue = Number(value);
|
|
26826
|
+
return Number.isFinite(numericValue) ? numericValue : null;
|
|
26827
|
+
}
|
|
26828
|
+
const DATE_FILTER_VALUE_EXTRACTORS = {
|
|
26829
|
+
EXACT_DATE: (dateFilter) => {
|
|
26830
|
+
const epoch = toFiniteNumber(dateFilter.epoch);
|
|
26831
|
+
return epoch === null ? [] : [epoch];
|
|
26832
|
+
},
|
|
26833
|
+
EXACT_DATE_RANGE: (dateFilter) => {
|
|
26834
|
+
var _a;
|
|
26835
|
+
const { lowEpoch, highEpoch } = (_a = dateFilter.dateRange) !== null && _a !== void 0 ? _a : {};
|
|
26836
|
+
const low = toFiniteNumber(lowEpoch);
|
|
26837
|
+
const high = toFiniteNumber(highEpoch);
|
|
26838
|
+
return low === null || high === null ? [] : [low, high];
|
|
26839
|
+
},
|
|
26840
|
+
MONTH_YEAR: (dateFilter) => (dateFilter.monthName && dateFilter.yearName
|
|
26841
|
+
? [dateFilter.monthName, dateFilter.yearName]
|
|
26842
|
+
: []),
|
|
26843
|
+
QUARTER_YEAR: (dateFilter) => (dateFilter.quarterName && dateFilter.yearName
|
|
26844
|
+
? [dateFilter.quarterName, dateFilter.yearName]
|
|
26845
|
+
: []),
|
|
26846
|
+
YEAR_ONLY: (dateFilter) => (dateFilter.yearName ? [dateFilter.yearName] : []),
|
|
26847
|
+
LAST_N_PERIOD: (dateFilter) => {
|
|
26848
|
+
const count = toFiniteNumber(dateFilter.number);
|
|
26849
|
+
return count === null ? [] : [count];
|
|
26850
|
+
},
|
|
26851
|
+
NEXT_N_PERIOD: (dateFilter) => {
|
|
26852
|
+
const count = toFiniteNumber(dateFilter.number);
|
|
26853
|
+
return count === null ? [] : [count];
|
|
26854
|
+
},
|
|
26855
|
+
};
|
|
26856
|
+
// Date filter types with no `values` (e.g. TODAY needs no operand).
|
|
26857
|
+
const PERIOD_ONLY_DATE_FILTER_TYPES = new Set([
|
|
26858
|
+
'THIS_PERIOD', 'PERIOD_TO_DATE', 'TODAY', 'YESTERDAY', 'TOMORROW',
|
|
26859
|
+
]);
|
|
26860
|
+
function convertDateFilterToParam(columnName, dateFilterContent) {
|
|
26861
|
+
var _a;
|
|
26862
|
+
const dateFilter = dateFilterContent === null || dateFilterContent === void 0 ? void 0 : dateFilterContent.dateFilter;
|
|
26863
|
+
if (!(dateFilter === null || dateFilter === void 0 ? void 0 : dateFilter.type))
|
|
26864
|
+
return null;
|
|
26865
|
+
let values;
|
|
26866
|
+
const getValues = DATE_FILTER_VALUE_EXTRACTORS[dateFilter.type];
|
|
26867
|
+
if (getValues) {
|
|
26868
|
+
values = getValues(dateFilter);
|
|
26869
|
+
// Required fields (e.g. epoch, yearName) are missing - the source data
|
|
26870
|
+
// can't be reconstructed faithfully, so skip rather than emit a filter
|
|
26871
|
+
// that would clear/corrupt this column when re-applied.
|
|
26872
|
+
if (values.length === 0)
|
|
26873
|
+
return null;
|
|
26874
|
+
}
|
|
26875
|
+
else if (PERIOD_ONLY_DATE_FILTER_TYPES.has(dateFilter.type)) {
|
|
26876
|
+
values = [];
|
|
26877
|
+
}
|
|
26878
|
+
else {
|
|
26879
|
+
// Unrecognized date filter type - skip rather than guess.
|
|
26880
|
+
return null;
|
|
26881
|
+
}
|
|
26882
|
+
const param = {
|
|
26883
|
+
columnName,
|
|
26884
|
+
operator: (_a = dateFilter.op) !== null && _a !== void 0 ? _a : exports.RuntimeFilterOp.EQ,
|
|
26885
|
+
values,
|
|
26886
|
+
type: dateFilter.type,
|
|
26887
|
+
};
|
|
26888
|
+
if (dateFilter.datePeriod) {
|
|
26889
|
+
param.datePeriod = dateFilter.datePeriod;
|
|
26890
|
+
}
|
|
26891
|
+
if (!isNil_1(dateFilter.includeCurrentPeriod)) {
|
|
26892
|
+
param.includeCurrentPeriod = dateFilter.includeCurrentPeriod;
|
|
26893
|
+
}
|
|
26894
|
+
if (dateFilterContent.negate) {
|
|
26895
|
+
param.negate = true;
|
|
26896
|
+
}
|
|
26897
|
+
return param;
|
|
26898
|
+
}
|
|
26899
|
+
function convertFilterContentToParam(columnName, filterContent) {
|
|
26900
|
+
var _a;
|
|
26901
|
+
if (!(filterContent === null || filterContent === void 0 ? void 0 : filterContent.filterType))
|
|
26902
|
+
return null;
|
|
26903
|
+
const values = ((_a = filterContent.value) !== null && _a !== void 0 ? _a : [])
|
|
26904
|
+
.map((value) => value === null || value === void 0 ? void 0 : value.key)
|
|
26905
|
+
.filter((value) => !isNil_1(value));
|
|
26906
|
+
const param = {
|
|
26907
|
+
columnName,
|
|
26908
|
+
operator: filterContent.filterType,
|
|
26909
|
+
values,
|
|
26910
|
+
};
|
|
26911
|
+
if (filterContent.negate) {
|
|
26912
|
+
param.negate = true;
|
|
26913
|
+
}
|
|
26914
|
+
return param;
|
|
26915
|
+
}
|
|
26916
|
+
function convertFilterToParams(columnName, filter) {
|
|
26917
|
+
var _a, _b;
|
|
26918
|
+
const dateParams = ((_a = filter === null || filter === void 0 ? void 0 : filter.dateFilterContent) !== null && _a !== void 0 ? _a : [])
|
|
26919
|
+
.map((dateFilterContent) => convertDateFilterToParam(columnName, dateFilterContent));
|
|
26920
|
+
const contentParams = ((_b = filter === null || filter === void 0 ? void 0 : filter.filterContent) !== null && _b !== void 0 ? _b : [])
|
|
26921
|
+
.map((filterContent) => convertFilterContentToParam(columnName, filterContent));
|
|
26922
|
+
return [...dateParams, ...contentParams]
|
|
26923
|
+
.filter((param) => param !== null);
|
|
26924
|
+
}
|
|
26925
|
+
/**
|
|
26926
|
+
* Runtime filters need no reshaping, but they still come off the wire as JSON,
|
|
26927
|
+
* so a malformed entry is possible. Skip it rather than pass it through: an
|
|
26928
|
+
* entry missing a column, operator or values array fails
|
|
26929
|
+
* `isValidUpdateFiltersPayload`, and that rejects the *whole* `filters` array,
|
|
26930
|
+
* so one bad runtime filter would drop every other converted filter with it.
|
|
26931
|
+
* @param runtimeFilter A runtime filter from the `FilterChanged` payload.
|
|
26932
|
+
*/
|
|
26933
|
+
function convertRuntimeFilterToParam(runtimeFilter) {
|
|
26934
|
+
const { columnName, operator, values } = runtimeFilter !== null && runtimeFilter !== void 0 ? runtimeFilter : {};
|
|
26935
|
+
if (typeof columnName !== 'string' || !columnName)
|
|
26936
|
+
return null;
|
|
26937
|
+
if (typeof operator !== 'string' || !operator)
|
|
26938
|
+
return null;
|
|
26939
|
+
if (!Array.isArray(values))
|
|
26940
|
+
return null;
|
|
26941
|
+
return { columnName, operator, values };
|
|
26942
|
+
}
|
|
26943
|
+
/**
|
|
26944
|
+
* Mirrors `isValidApplicability` in `hostEventClient/utils`: a `TAB` or `GROUP`
|
|
26945
|
+
* scope is meaningless without a `targetId`, and `UpdateFilters` rejects the
|
|
26946
|
+
* whole `filters` array when any entry carries a malformed `applicability`.
|
|
26947
|
+
* @param applicability Scope taken from the `FilterChanged` payload.
|
|
26948
|
+
*/
|
|
26949
|
+
function isUsableApplicability(applicability) {
|
|
26950
|
+
const levels = Object.values(exports.ApplicabilityLevel);
|
|
26951
|
+
if (!levels.includes(applicability.level))
|
|
26952
|
+
return false;
|
|
26953
|
+
if (applicability.level === exports.ApplicabilityLevel.Liveboard)
|
|
26954
|
+
return true;
|
|
26955
|
+
return typeof applicability.targetId === 'string' && applicability.targetId.trim().length > 0;
|
|
26956
|
+
}
|
|
26957
|
+
function convertFilterGroupToParams(filterGroup) {
|
|
26958
|
+
var _a, _b;
|
|
26959
|
+
const columnName = (_a = filterGroup === null || filterGroup === void 0 ? void 0 : filterGroup.columnInfo) === null || _a === void 0 ? void 0 : _a.name;
|
|
26960
|
+
if (!columnName)
|
|
26961
|
+
return [];
|
|
26962
|
+
const { applicability } = filterGroup;
|
|
26963
|
+
// A filter scoped to a tab or group has to keep that scope. Replaying it
|
|
26964
|
+
// without `applicability` would silently widen it to the whole Liveboard,
|
|
26965
|
+
// changing what every other tab shows. If a scope is present but unusable,
|
|
26966
|
+
// skip the filter: widening is worse than dropping, and a malformed
|
|
26967
|
+
// applicability would fail validation for every other filter alongside it.
|
|
26968
|
+
if (!isNil_1(applicability) && !isUsableApplicability(applicability))
|
|
26969
|
+
return [];
|
|
26970
|
+
const params = ((_b = filterGroup.filters) !== null && _b !== void 0 ? _b : [])
|
|
26971
|
+
.flatMap((filter) => convertFilterToParams(columnName, filter));
|
|
26972
|
+
return isNil_1(applicability) ? params : params.map((param) => ({ ...param, applicability }));
|
|
26973
|
+
}
|
|
26974
|
+
/**
|
|
26975
|
+
* Converts the payload emitted by {@link EmbedEvent.FilterChanged} into the
|
|
26976
|
+
* payload shape expected by {@link HostEvent.UpdateFilters}, so the same
|
|
26977
|
+
* filter state can be captured and re-applied later, for example on a
|
|
26978
|
+
* subsequent page load.
|
|
26979
|
+
*
|
|
26980
|
+
* Both the Liveboard filters and the runtime filters present in the
|
|
26981
|
+
* `FilterChanged` payload are included in the returned `filters` array.
|
|
26982
|
+
*
|
|
26983
|
+
* Note: a column with multiple date-filter conditions (e.g. an OR of two
|
|
26984
|
+
* date ranges) is not guaranteed to round-trip losslessly - `HostEvent.UpdateFilters`
|
|
26985
|
+
* treats date filters as replace-not-merge per column, so only the last
|
|
26986
|
+
* converted entry for such a column will apply.
|
|
26987
|
+
* @param filterChangedPayload The filter state carried by the
|
|
26988
|
+
* `EmbedEvent.FilterChanged` callback, which is `payload.data` - the
|
|
26989
|
+
* callback argument is the event envelope, and the filters sit under its
|
|
26990
|
+
* `data` key.
|
|
26991
|
+
* @example
|
|
26992
|
+
* ```js
|
|
26993
|
+
* let savedFilters;
|
|
26994
|
+
* liveboardEmbed.on(EmbedEvent.FilterChanged, (payload) => {
|
|
26995
|
+
* savedFilters = convertFilterChangedToUpdateFiltersPayload(payload.data);
|
|
26996
|
+
* });
|
|
26997
|
+
*
|
|
26998
|
+
* // later, e.g. after a fresh page load
|
|
26999
|
+
* liveboardEmbed.trigger(HostEvent.UpdateFilters, savedFilters);
|
|
27000
|
+
* ```
|
|
27001
|
+
*/
|
|
27002
|
+
function convertFilterChangedToUpdateFiltersPayload(filterChangedPayload) {
|
|
27003
|
+
var _a, _b;
|
|
27004
|
+
const liveboardFilterParams = ((_a = filterChangedPayload === null || filterChangedPayload === void 0 ? void 0 : filterChangedPayload.liveboardFilters) !== null && _a !== void 0 ? _a : [])
|
|
27005
|
+
.flatMap(convertFilterGroupToParams);
|
|
27006
|
+
const runtimeFilterParams = ((_b = filterChangedPayload === null || filterChangedPayload === void 0 ? void 0 : filterChangedPayload.runtimeFilters) !== null && _b !== void 0 ? _b : [])
|
|
27007
|
+
.map(convertRuntimeFilterToParam)
|
|
27008
|
+
.filter((param) => param !== null);
|
|
27009
|
+
return { filters: [...liveboardFilterParams, ...runtimeFilterParams] };
|
|
27010
|
+
}
|
|
27011
|
+
|
|
26073
27012
|
/**
|
|
26074
27013
|
* Starts an automatic renderer that watches the DOM for iframes containing
|
|
26075
27014
|
* the `tsmcp=true` query parameter and replaces them with fully configured
|
|
@@ -26168,7 +27107,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26168
27107
|
* @returns The constructed URL to use for the ThoughtSpot embed iframe.
|
|
26169
27108
|
*/
|
|
26170
27109
|
getMCPIframeSrc(sourceSrc) {
|
|
26171
|
-
const queryParams = this.
|
|
27110
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
26172
27111
|
const sourceURL = new URL(sourceSrc);
|
|
26173
27112
|
const existingQueryParams = sourceURL.searchParams;
|
|
26174
27113
|
const existingQueryParamsObject = Object.fromEntries(existingQueryParams);
|
|
@@ -33742,6 +34681,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
33742
34681
|
exports.SearchEmbed = SearchEmbed;
|
|
33743
34682
|
exports.SpotterAgentEmbed = SpotterAgentEmbed;
|
|
33744
34683
|
exports.SpotterEmbed = SpotterEmbed;
|
|
34684
|
+
exports.convertFilterChangedToUpdateFiltersPayload = convertFilterChangedToUpdateFiltersPayload;
|
|
33745
34685
|
exports.createLiveboardWithAnswers = createLiveboardWithAnswers;
|
|
33746
34686
|
exports.executeTML = executeTML;
|
|
33747
34687
|
exports.exportTML = exportTML;
|