@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/src/embed/liveboard.ts
CHANGED
|
@@ -12,7 +12,6 @@ import { getPreview } from '../utils/graphql/preview-service';
|
|
|
12
12
|
import { ERROR_MESSAGE } from '../errors';
|
|
13
13
|
import {
|
|
14
14
|
EmbedEvent,
|
|
15
|
-
MessagePayload,
|
|
16
15
|
Param,
|
|
17
16
|
RuntimeFilter,
|
|
18
17
|
DOMSelector,
|
|
@@ -20,23 +19,30 @@ import {
|
|
|
20
19
|
SearchLiveboardCommonViewConfig as LiveboardOtherViewConfig,
|
|
21
20
|
BaseViewConfig,
|
|
22
21
|
LiveboardAppEmbedViewConfig,
|
|
22
|
+
FullHeightViewConfig,
|
|
23
23
|
ErrorDetailsTypes,
|
|
24
24
|
EmbedErrorCodes,
|
|
25
25
|
EmbedErrorSeverity,
|
|
26
26
|
ContextType,
|
|
27
27
|
DefaultAppInitData,
|
|
28
28
|
} from '../types';
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
29
|
+
import { FullHeightController } from '../full-height';
|
|
30
|
+
import { getQueryParamString, isUndefined, setParamIfDefined } from '../utils';
|
|
31
31
|
import { getAuthPromise } from './base';
|
|
32
32
|
import { TsEmbed, V1Embed } from './ts-embed';
|
|
33
33
|
import { addPreviewStylesIfNotPresent } from '../utils/global-styles';
|
|
34
|
-
import { HostEventRequest,
|
|
34
|
+
import { HostEventRequest, TriggerData, TriggerResponse } from '../contracts/host-event-contracts';
|
|
35
35
|
import { logger } from '../utils/logger';
|
|
36
36
|
import { SpotterChatViewConfig, StarterPromptsConfig } from './conversation';
|
|
37
37
|
import { buildStarterPromptsAppInitData } from './spotter-utils';
|
|
38
38
|
import { SpotterVizConfig, buildSpotterVizAppInitData } from './spotter-viz-utils';
|
|
39
39
|
|
|
40
|
+
// Home unmounts the liveboard container, which is how its state gets cleared.
|
|
41
|
+
// The settle window gives the container time to do it before we ask for the
|
|
42
|
+
// liveboard back.
|
|
43
|
+
const HOME_ROUTE = 'home';
|
|
44
|
+
const HOME_SETTLE_MS = 200;
|
|
45
|
+
|
|
40
46
|
/**
|
|
41
47
|
* APP_INIT data shape for LiveboardEmbed.
|
|
42
48
|
* @internal
|
|
@@ -53,71 +59,11 @@ export interface LiveboardEmbedAppInitData extends DefaultAppInitData {
|
|
|
53
59
|
* The configuration for the embedded Liveboard or visualization page view.
|
|
54
60
|
* @group Embed components
|
|
55
61
|
*/
|
|
56
|
-
export interface LiveboardViewConfig
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
* **Note**: Using fullHeight loads all visualizations on the
|
|
62
|
-
* Liveboard simultaneously, which results in multiple warehouse
|
|
63
|
-
* queries and potentially a longer wait for the topmost
|
|
64
|
-
* visualizations to display on the screen.
|
|
65
|
-
* Setting `fullHeight` to `false` fetches visualizations
|
|
66
|
-
* incrementally as users scroll the page to view the charts and tables.
|
|
67
|
-
*
|
|
68
|
-
* From SDK 1.52.0, enabling `fullHeight` also turns on
|
|
69
|
-
* {@link lazyLoadingForFullHeight} and
|
|
70
|
-
* {@link enableScrollableContainerLazyLoading}, so visualizations load as
|
|
71
|
-
* they scroll into view. Set either flag to `false` to opt out.
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* Supported embed types: `LiveboardEmbed`
|
|
75
|
-
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
|
|
76
|
-
* @example
|
|
77
|
-
* ```js
|
|
78
|
-
* const embed = new LiveboardEmbed('#embed', {
|
|
79
|
-
* ... // other liveboard view config
|
|
80
|
-
* fullHeight: true,
|
|
81
|
-
* });
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
fullHeight?: boolean;
|
|
85
|
-
/**
|
|
86
|
-
* This is the minimum height (in pixels) for a full-height Liveboard.
|
|
87
|
-
* Setting this height helps resolve issues with empty Liveboards and
|
|
88
|
-
* other screens navigable from a Liveboard.
|
|
89
|
-
*
|
|
90
|
-
* Supported embed types: `LiveboardEmbed`
|
|
91
|
-
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
92
|
-
* @deprecated Use `minimumHeight` instead.
|
|
93
|
-
* @default 500
|
|
94
|
-
* @example
|
|
95
|
-
* ```js
|
|
96
|
-
* const embed = new LiveboardEmbed('#embed', {
|
|
97
|
-
* ... // other liveboard view config
|
|
98
|
-
* fullHeight: true,
|
|
99
|
-
* defaultHeight: 600,
|
|
100
|
-
* });
|
|
101
|
-
* ```
|
|
102
|
-
*/
|
|
103
|
-
defaultHeight?: number;
|
|
104
|
-
/**
|
|
105
|
-
* This is the minimum height (in pixels) for a full-height Liveboard.
|
|
106
|
-
* Setting this height helps resolve issues with empty Liveboards and
|
|
107
|
-
* other screens navigable from a Liveboard.
|
|
108
|
-
*
|
|
109
|
-
* @version SDK: 1.44.2 | ThoughtSpot: 10.15.0.cl
|
|
110
|
-
* @default 500
|
|
111
|
-
* @example
|
|
112
|
-
* ```js
|
|
113
|
-
* const embed = new LiveboardEmbed('#embed', {
|
|
114
|
-
* ... // other liveboard view config
|
|
115
|
-
* fullHeight: true,
|
|
116
|
-
* minimumHeight: 600,
|
|
117
|
-
* });
|
|
118
|
-
* ```
|
|
119
|
-
*/
|
|
120
|
-
minimumHeight?: number;
|
|
62
|
+
export interface LiveboardViewConfig
|
|
63
|
+
extends BaseViewConfig,
|
|
64
|
+
FullHeightViewConfig,
|
|
65
|
+
LiveboardOtherViewConfig,
|
|
66
|
+
LiveboardAppEmbedViewConfig {
|
|
121
67
|
/**
|
|
122
68
|
* If set to true, the context menu in visualizations will be enabled.
|
|
123
69
|
* @version SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw
|
|
@@ -409,9 +355,10 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
409
355
|
*/
|
|
410
356
|
isPNGInScheduledEmailsEnabled?: boolean;
|
|
411
357
|
/**
|
|
412
|
-
* Enables the 'what you see is what you get' PDF export for Liveboards. Each tab is
|
|
413
|
-
* following the exact UI layout, instead of splitting
|
|
414
|
-
* This feature is GA from SDK version
|
|
358
|
+
* Enables the 'what you see is what you get' PDF export for Liveboards. Each tab is
|
|
359
|
+
* rendered on a single page following the exact UI layout, instead of splitting
|
|
360
|
+
* visualizations across multiple A4 pages. This feature is GA from SDK version
|
|
361
|
+
* 1.51.0 and ThoughtSpot version 26.8.0.cl.
|
|
415
362
|
*
|
|
416
363
|
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
|
|
417
364
|
* @type {boolean}
|
|
@@ -463,77 +410,6 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
463
410
|
* ```
|
|
464
411
|
*/
|
|
465
412
|
isGranularXLSXCSVSchedulesEnabled?: boolean;
|
|
466
|
-
/**
|
|
467
|
-
* Loads visualizations only as they scroll into the viewport, instead of
|
|
468
|
-
* loading the whole full-height Liveboard at once.
|
|
469
|
-
*
|
|
470
|
-
* From SDK 1.52.0 this is enabled automatically whenever `fullHeight` is
|
|
471
|
-
* `true`. On SDK 1.51.0 and earlier it defaulted to `false` and had to be
|
|
472
|
-
* set explicitly. Set it to `false` to load every visualization upfront.
|
|
473
|
-
* The flag has no effect unless `fullHeight` is enabled.
|
|
474
|
-
*
|
|
475
|
-
* @type {boolean}
|
|
476
|
-
* @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
|
|
477
|
-
* @default true when `fullHeight` is enabled, from SDK 1.52.0
|
|
478
|
-
* @example
|
|
479
|
-
* ```js
|
|
480
|
-
* const embed = new LiveboardEmbed('#embed-container', {
|
|
481
|
-
* // ...other options
|
|
482
|
-
* fullHeight: true,
|
|
483
|
-
* lazyLoadingForFullHeight: true,
|
|
484
|
-
* })
|
|
485
|
-
* ```
|
|
486
|
-
*/
|
|
487
|
-
lazyLoadingForFullHeight?: boolean;
|
|
488
|
-
/**
|
|
489
|
-
* Computes the visible region of the embed against its scrollable and
|
|
490
|
-
* clipping ancestors, instead of treating the browser window as the only
|
|
491
|
-
* viewport, and tracks scroll and resize on those ancestors.
|
|
492
|
-
*
|
|
493
|
-
* From SDK 1.52.0 this is enabled automatically whenever `fullHeight` is
|
|
494
|
-
* `true`. On SDK 1.51.0 and earlier it defaulted to `false` and had to be
|
|
495
|
-
* set explicitly. Set it to `false` when the page scrolls with the window
|
|
496
|
-
* and the embed has no clipping ancestor, to skip the extra ancestor
|
|
497
|
-
* tracking.
|
|
498
|
-
*
|
|
499
|
-
* @type {boolean}
|
|
500
|
-
* @default true when `fullHeight` is enabled, from SDK 1.52.0
|
|
501
|
-
*/
|
|
502
|
-
enableScrollableContainerLazyLoading?: boolean;
|
|
503
|
-
/**
|
|
504
|
-
* How far outside the viewport a visualization starts loading, when
|
|
505
|
-
* {@link lazyLoadingForFullHeight} is enabled.
|
|
506
|
-
*
|
|
507
|
-
* For example, if the margin is set to '10px',
|
|
508
|
-
* the visualization will be loaded 10px before its top edge is visible in the
|
|
509
|
-
* viewport.
|
|
510
|
-
*
|
|
511
|
-
* The format is similar to CSS margin, so `'500px 0px'` extends the
|
|
512
|
-
* prefetch 500px above and below the viewport and not sideways. Accepted
|
|
513
|
-
* units are `px`, `em`, `rem`, `%`, `vh` and `vw`, plus bare `0` and
|
|
514
|
-
* `auto`; an invalid value is logged and ignored.
|
|
515
|
-
*
|
|
516
|
-
* From SDK 1.52.0 this defaults to `'500px 0px'` — roughly one
|
|
517
|
-
* visualization ahead of the scroll position, so a chart has usually
|
|
518
|
-
* finished loading by the time it scrolls into view. Use a smaller margin
|
|
519
|
-
* to cut warehouse queries further, or `'0px'` to load a visualization
|
|
520
|
-
* only once it is actually visible.
|
|
521
|
-
*
|
|
522
|
-
* @type {string}
|
|
523
|
-
* @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
|
|
524
|
-
* @default '500px 0px' when `fullHeight` is enabled, from SDK 1.52.0
|
|
525
|
-
* @example
|
|
526
|
-
* ```js
|
|
527
|
-
* const embed = new LiveboardEmbed('#embed-container', {
|
|
528
|
-
* // ...other options
|
|
529
|
-
* fullHeight: true,
|
|
530
|
-
* lazyLoadingForFullHeight: true,
|
|
531
|
-
* // Using 0px, the visualization will be only loaded when it's visible in the viewport.
|
|
532
|
-
* lazyLoadingMargin: '0px',
|
|
533
|
-
* })
|
|
534
|
-
* ```
|
|
535
|
-
*/
|
|
536
|
-
lazyLoadingMargin?: string;
|
|
537
413
|
/**
|
|
538
414
|
* showSpotterLimitations : show limitation text
|
|
539
415
|
* of the spotter underneath the chat input.
|
|
@@ -689,36 +565,26 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
689
565
|
export class LiveboardEmbed extends V1Embed {
|
|
690
566
|
protected viewConfig: LiveboardViewConfig;
|
|
691
567
|
|
|
692
|
-
private
|
|
693
|
-
|
|
694
|
-
private lazyLoadScrollContainers: HTMLElement[] = [];
|
|
695
|
-
|
|
696
|
-
private lazyLoadResizeObserver: ResizeObserver | undefined;
|
|
697
|
-
|
|
568
|
+
private readonly fullHeightController?: FullHeightController;
|
|
698
569
|
|
|
699
570
|
constructor(domSelector: DOMSelector, viewConfig: LiveboardViewConfig) {
|
|
700
571
|
viewConfig.embedComponentType = 'LiveboardEmbed';
|
|
701
572
|
super(domSelector, viewConfig);
|
|
702
573
|
if (this.viewConfig.fullHeight === true) {
|
|
703
574
|
if (this.viewConfig.vizId) {
|
|
704
|
-
logger.warn('Full height is currently only supported for Liveboard embeds.'
|
|
705
|
-
'Using full height with vizId might lead to unexpected behavior.');
|
|
575
|
+
logger.warn('Full height is currently only supported for Liveboard embeds.'
|
|
576
|
+
+ 'Using full height with vizId might lead to unexpected behavior.');
|
|
706
577
|
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
this.
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
719
|
-
this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
720
|
-
this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
721
|
-
this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
|
|
578
|
+
this.fullHeightController = new FullHeightController(this.viewConfig, {
|
|
579
|
+
getIframe: () => this.iFrame,
|
|
580
|
+
setFrameHeight: (height) => this.setIFrameHeight(height),
|
|
581
|
+
on: (eventType, callback) => {
|
|
582
|
+
this.on(eventType, callback);
|
|
583
|
+
},
|
|
584
|
+
trigger: (hostEvent, data) => {
|
|
585
|
+
this.trigger(hostEvent, data);
|
|
586
|
+
},
|
|
587
|
+
});
|
|
722
588
|
}
|
|
723
589
|
}
|
|
724
590
|
|
|
@@ -733,7 +599,7 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
733
599
|
* embedded Liveboard or visualization.
|
|
734
600
|
*/
|
|
735
601
|
protected getEmbedParams() {
|
|
736
|
-
const params = this.
|
|
602
|
+
const params = this.getUrlQueryParamsObject();
|
|
737
603
|
const queryParams = getQueryParamString(params, true);
|
|
738
604
|
return queryParams;
|
|
739
605
|
}
|
|
@@ -743,9 +609,6 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
743
609
|
params = this.getBaseQueryParams(params);
|
|
744
610
|
const {
|
|
745
611
|
enableVizTransformations,
|
|
746
|
-
fullHeight,
|
|
747
|
-
defaultHeight,
|
|
748
|
-
minimumHeight,
|
|
749
612
|
visibleVizs,
|
|
750
613
|
liveboardV2,
|
|
751
614
|
vizId,
|
|
@@ -794,16 +657,7 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
794
657
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
795
658
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
796
659
|
|
|
797
|
-
|
|
798
|
-
params[Param.fullHeight] = true;
|
|
799
|
-
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
800
|
-
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
801
|
-
if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
|
|
802
|
-
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
this.defaultHeight = minimumHeight || defaultHeight || this.defaultHeight;
|
|
660
|
+
this.fullHeightController?.addQueryParams(params);
|
|
807
661
|
if (enableVizTransformations !== undefined) {
|
|
808
662
|
params[Param.EnableVizTransformations] = enableVizTransformations.toString();
|
|
809
663
|
}
|
|
@@ -1018,32 +872,6 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
1018
872
|
return suffix;
|
|
1019
873
|
}
|
|
1020
874
|
|
|
1021
|
-
private sendFullHeightLazyLoadData = () => {
|
|
1022
|
-
const data = calculateVisibleElementData(
|
|
1023
|
-
this.iFrame,
|
|
1024
|
-
this.viewConfig.enableScrollableContainerLazyLoading,
|
|
1025
|
-
);
|
|
1026
|
-
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
1027
|
-
if(this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight){
|
|
1028
|
-
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
|
|
1029
|
-
}
|
|
1030
|
-
};
|
|
1031
|
-
|
|
1032
|
-
/**
|
|
1033
|
-
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
1034
|
-
* It is used to send the visible coordinates data to the host application.
|
|
1035
|
-
* @param data The event payload
|
|
1036
|
-
* @param responder The responder function
|
|
1037
|
-
*/
|
|
1038
|
-
private requestVisibleEmbedCoordinatesHandler = (data: MessagePayload, responder: any) => {
|
|
1039
|
-
logger.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
1040
|
-
const visibleCoordinatesData = calculateVisibleElementData(
|
|
1041
|
-
this.iFrame,
|
|
1042
|
-
this.viewConfig.enableScrollableContainerLazyLoading,
|
|
1043
|
-
);
|
|
1044
|
-
responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
875
|
/**
|
|
1048
876
|
* Construct the URL of the embedded ThoughtSpot Liveboard or visualization
|
|
1049
877
|
* to be loaded within the iFrame.
|
|
@@ -1069,44 +897,6 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
1069
897
|
)}`;
|
|
1070
898
|
}
|
|
1071
899
|
|
|
1072
|
-
/**
|
|
1073
|
-
* Set the iframe height as per the computed height received
|
|
1074
|
-
* from the ThoughtSpot app.
|
|
1075
|
-
* @param data The event payload
|
|
1076
|
-
*/
|
|
1077
|
-
private updateIFrameHeight = (data: MessagePayload) => {
|
|
1078
|
-
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
1079
|
-
this.sendFullHeightLazyLoadData();
|
|
1080
|
-
};
|
|
1081
|
-
|
|
1082
|
-
private embedIframeCenter = (data: MessagePayload, responder: any) => {
|
|
1083
|
-
const obj = this.getIframeCenter();
|
|
1084
|
-
responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
|
|
1085
|
-
};
|
|
1086
|
-
|
|
1087
|
-
private setIframeHeightForNonEmbedLiveboard = (data: MessagePayload) => {
|
|
1088
|
-
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
1089
|
-
|
|
1090
|
-
const liveboardRelatedRoutes = [
|
|
1091
|
-
'/pinboard/',
|
|
1092
|
-
'/insights/pinboard/',
|
|
1093
|
-
'/schedules/',
|
|
1094
|
-
'/embed/viz/',
|
|
1095
|
-
'/embed/insights/viz/',
|
|
1096
|
-
'/liveboard/',
|
|
1097
|
-
'/insights/liveboard/',
|
|
1098
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
1099
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
1100
|
-
];
|
|
1101
|
-
|
|
1102
|
-
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
1103
|
-
// Ignore the height reset of the frame, if the navigation is
|
|
1104
|
-
// only within the liveboard page.
|
|
1105
|
-
return;
|
|
1106
|
-
}
|
|
1107
|
-
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
1108
|
-
};
|
|
1109
|
-
|
|
1110
900
|
private setActiveTab(data: { tabId: string }) {
|
|
1111
901
|
if (!this.viewConfig.vizId) {
|
|
1112
902
|
const prefixPath = this.iFrame.src.split('#/')[1].split('/tab')[0];
|
|
@@ -1163,26 +953,59 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
1163
953
|
|
|
1164
954
|
protected beforePrerenderVisible(): void {
|
|
1165
955
|
super.beforePrerenderVisible();
|
|
1166
|
-
const embedObj = this.getPreRenderObj<LiveboardEmbed>();
|
|
1167
956
|
|
|
1168
|
-
|
|
957
|
+
// Captured before showPreRender() hands the wrapper over to this
|
|
958
|
+
// instance. Itself means a hide/show, not a hand-over, so there is
|
|
959
|
+
// nothing stale to clear.
|
|
960
|
+
const previous = this.getPreRenderObj<LiveboardEmbed>();
|
|
961
|
+
const showing = previous === this ? undefined : previous?.currentLiveboardState;
|
|
962
|
+
|
|
963
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
964
|
+
// Without this the params callback suspends on its await and
|
|
965
|
+
// Navigate goes out first, so the container loads with the previous
|
|
966
|
+
// config's filters.
|
|
967
|
+
await this.preRenderParamsApplied;
|
|
968
|
+
if (this.isShowingLiveboardRoute(showing)) {
|
|
969
|
+
// Navigate to the route we are already on is a no-op, so the
|
|
970
|
+
// liveboard keeps its state. Home unmounts the container, which
|
|
971
|
+
// clears it.
|
|
972
|
+
this.trigger(HostEvent.Navigate, HOME_ROUTE)
|
|
973
|
+
.catch((error) => logger.warn('Could not route via home', error));
|
|
974
|
+
// Not awaited above: the container never acks Navigate, so
|
|
975
|
+
// that promise only settles on the 30s trigger timeout.
|
|
976
|
+
await new Promise((resolve) => {
|
|
977
|
+
setTimeout(resolve, HOME_SETTLE_MS);
|
|
978
|
+
});
|
|
979
|
+
}
|
|
1169
980
|
this.navigateToLiveboard(
|
|
1170
981
|
this.viewConfig.liveboardId,
|
|
1171
982
|
this.viewConfig.vizId,
|
|
1172
983
|
this.viewConfig.activeTabId,
|
|
1173
984
|
this.viewConfig.personalizedViewId,
|
|
1174
985
|
);
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
};
|
|
1182
|
-
}
|
|
986
|
+
this.currentLiveboardState = {
|
|
987
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
988
|
+
vizId: this.viewConfig.vizId,
|
|
989
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
990
|
+
personalizedViewId: this.viewConfig.personalizedViewId,
|
|
991
|
+
};
|
|
1183
992
|
});
|
|
1184
993
|
}
|
|
1185
994
|
|
|
995
|
+
// The whole route, not just the liveboard id: the path is built from the
|
|
996
|
+
// viz, tab and view too, so a same-liveboard show onto another tab is a
|
|
997
|
+
// real navigation.
|
|
998
|
+
private isShowingLiveboardRoute(showing?: LiveboardEmbed['currentLiveboardState']): boolean {
|
|
999
|
+
if (!showing?.liveboardId) return false;
|
|
1000
|
+
const {
|
|
1001
|
+
liveboardId, vizId, activeTabId, personalizedViewId,
|
|
1002
|
+
} = this.viewConfig;
|
|
1003
|
+
return showing.liveboardId === liveboardId
|
|
1004
|
+
&& showing.vizId === vizId
|
|
1005
|
+
&& showing.activeTabId === activeTabId
|
|
1006
|
+
&& showing.personalizedViewId === personalizedViewId;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1186
1009
|
protected async handleRenderForPrerender(): Promise<TsEmbed> {
|
|
1187
1010
|
if (isUndefined(this.viewConfig.liveboardId)) {
|
|
1188
1011
|
return this.prerenderGeneric();
|
|
@@ -1192,8 +1015,10 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
1192
1015
|
|
|
1193
1016
|
/**
|
|
1194
1017
|
* Triggers an event to the embedded app
|
|
1018
|
+
* Payload typing follows {@link TsEmbed.trigger}: unknown fields fail to compile
|
|
1019
|
+
* from SDK 1.52.0; strict contract checks land in SDK 1.54.0.
|
|
1195
1020
|
* @param {HostEvent} messageType The event type
|
|
1196
|
-
* @param {
|
|
1021
|
+
* @param {TriggerData} data The payload, typed against the event's contract
|
|
1197
1022
|
* @returns A promise that resolves with the response from the embedded app
|
|
1198
1023
|
*/
|
|
1199
1024
|
public trigger<
|
|
@@ -1204,7 +1029,9 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
1204
1029
|
ContextT extends ContextType = ContextType,
|
|
1205
1030
|
>(
|
|
1206
1031
|
messageType: HostEventT,
|
|
1207
|
-
|
|
1032
|
+
// Mirror TsEmbed.trigger: contract shape is the contextual type and
|
|
1033
|
+
// unknown fields on object literals are flagged. Strict in SDK 1.54.0.
|
|
1034
|
+
data: TriggerData<HostEventT> = ({} as any),
|
|
1208
1035
|
context?: ContextT,
|
|
1209
1036
|
): Promise<TriggerResponse<PayloadT, HostEventT, ContextT>> {
|
|
1210
1037
|
const dataWithVizId: any = data;
|
|
@@ -1223,53 +1050,11 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
1223
1050
|
*/
|
|
1224
1051
|
public destroy() {
|
|
1225
1052
|
super.destroy();
|
|
1226
|
-
this.
|
|
1053
|
+
this.fullHeightController?.destroy();
|
|
1227
1054
|
}
|
|
1228
1055
|
|
|
1229
1056
|
private postRender() {
|
|
1230
|
-
this.
|
|
1231
|
-
}
|
|
1232
|
-
|
|
1233
|
-
private registerLazyLoadEvents() {
|
|
1234
|
-
if(!this.iFrame) {
|
|
1235
|
-
return;
|
|
1236
|
-
}
|
|
1237
|
-
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
1238
|
-
this.unregisterLazyLoadEvents();
|
|
1239
|
-
// TODO: Use passive: true, install modernizr to check for passive
|
|
1240
|
-
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
1241
|
-
window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
1242
|
-
if (!this.viewConfig.enableScrollableContainerLazyLoading) {
|
|
1243
|
-
return;
|
|
1244
|
-
}
|
|
1245
|
-
this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
|
|
1246
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
1247
|
-
scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
1248
|
-
});
|
|
1249
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
1250
|
-
const resizeTargets = new Set([
|
|
1251
|
-
this.iFrame.parentElement,
|
|
1252
|
-
...getEffectiveClippingAncestors(this.iFrame),
|
|
1253
|
-
].filter(Boolean) as HTMLElement[]);
|
|
1254
|
-
this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
|
|
1255
|
-
resizeTargets.forEach((resizeTarget) => {
|
|
1256
|
-
this.lazyLoadResizeObserver.observe(resizeTarget);
|
|
1257
|
-
});
|
|
1258
|
-
}
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
|
-
|
|
1262
|
-
private unregisterLazyLoadEvents() {
|
|
1263
|
-
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
1264
|
-
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
1265
|
-
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
1266
|
-
this.lazyLoadResizeObserver?.disconnect();
|
|
1267
|
-
this.lazyLoadResizeObserver = undefined;
|
|
1268
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
1269
|
-
scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
1270
|
-
});
|
|
1271
|
-
this.lazyLoadScrollContainers = [];
|
|
1272
|
-
}
|
|
1057
|
+
this.fullHeightController?.onRender();
|
|
1273
1058
|
}
|
|
1274
1059
|
|
|
1275
1060
|
/**
|
package/src/embed/search-bar.tsx
CHANGED
|
@@ -163,7 +163,7 @@ export class SearchBarEmbed extends TsEmbed {
|
|
|
163
163
|
* @param dataSources A list of data source GUIDs
|
|
164
164
|
*/
|
|
165
165
|
private getIFrameSrc() {
|
|
166
|
-
const queryParams = this.
|
|
166
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
167
167
|
const path = 'search-bar-embed';
|
|
168
168
|
|
|
169
169
|
let query = '';
|
package/src/embed/search.spec.ts
CHANGED
|
@@ -438,6 +438,58 @@ describe('Search embed tests', () => {
|
|
|
438
438
|
});
|
|
439
439
|
});
|
|
440
440
|
|
|
441
|
+
test('should set visibility and disable state for Chart Settings V2 menu items', async () => {
|
|
442
|
+
expect(Action.ChartTypeSettings).toBe('CHART_TYPE');
|
|
443
|
+
expect(Action.LayoutSettings).toBe('LAYOUT');
|
|
444
|
+
expect(Action.ColumnSettings).toBe('COLUMN');
|
|
445
|
+
expect(Action.AxisSettings).toBe('AXIS');
|
|
446
|
+
expect(Action.DataLabelSettings).toBe('DATA_LABEL');
|
|
447
|
+
expect(Action.TooltipSettings).toBe('TOOLTIP');
|
|
448
|
+
expect(Action.LegendSettings).toBe('LEGEND');
|
|
449
|
+
expect(Action.DisplaySettings).toBe('DISPLAY');
|
|
450
|
+
expect(Action.QuerySettings).toBe('QUERY_DETAILS');
|
|
451
|
+
expect(Action.CustomSettings).toBe('CUSTOM_ACTION');
|
|
452
|
+
expect(Action.MuzeAiSettings).toBe('MUZE_AI');
|
|
453
|
+
expect(Action.RAnalysisSettings).toBe('R_ANALYSIS');
|
|
454
|
+
|
|
455
|
+
const chartSettingsActions = [
|
|
456
|
+
Action.ChartTypeSettings,
|
|
457
|
+
Action.LayoutSettings,
|
|
458
|
+
Action.ColumnSettings,
|
|
459
|
+
Action.AxisSettings,
|
|
460
|
+
Action.DataLabelSettings,
|
|
461
|
+
Action.TooltipSettings,
|
|
462
|
+
Action.LegendSettings,
|
|
463
|
+
Action.DisplaySettings,
|
|
464
|
+
Action.QuerySettings,
|
|
465
|
+
Action.CustomSettings,
|
|
466
|
+
Action.MuzeAiSettings,
|
|
467
|
+
Action.RAnalysisSettings,
|
|
468
|
+
];
|
|
469
|
+
const searchEmbed = new SearchEmbed(getRootEl(), {
|
|
470
|
+
hiddenActions: chartSettingsActions,
|
|
471
|
+
disabledActions: chartSettingsActions,
|
|
472
|
+
disabledActionReason: 'Access denied',
|
|
473
|
+
...defaultViewConfig,
|
|
474
|
+
answerId,
|
|
475
|
+
});
|
|
476
|
+
searchEmbed.render();
|
|
477
|
+
const hideActionUrl = fixedEncodeURI(
|
|
478
|
+
JSON.stringify([
|
|
479
|
+
Action.ReportError,
|
|
480
|
+
...chartSettingsActions,
|
|
481
|
+
...HiddenActionItemByDefaultForSearchEmbed,
|
|
482
|
+
]),
|
|
483
|
+
);
|
|
484
|
+
const disableActionUrl = fixedEncodeURI(JSON.stringify(chartSettingsActions));
|
|
485
|
+
await executeAfterWait(() => {
|
|
486
|
+
expectUrlMatchesWithParams(
|
|
487
|
+
getIFrameSrc(),
|
|
488
|
+
`http://${thoughtSpotHost}/v2/?${defaultParams}&disableAction=${disableActionUrl}&disableHint=Access%20denied&hideAction=${hideActionUrl}&dataSourceMode=expand&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
|
|
489
|
+
);
|
|
490
|
+
});
|
|
491
|
+
});
|
|
492
|
+
|
|
441
493
|
test('should load saved answer', async () => {
|
|
442
494
|
const searchEmbed = new SearchEmbed(getRootEl(), {
|
|
443
495
|
...defaultViewConfig,
|
|
@@ -584,6 +636,34 @@ describe('Search embed tests', () => {
|
|
|
584
636
|
});
|
|
585
637
|
});
|
|
586
638
|
|
|
639
|
+
test('Should add showAnswerEditPanel flag set to false to the iframe src when hideAnswerEditPanel is true', async () => {
|
|
640
|
+
const searchEmbed = new SearchEmbed(getRootEl(), {
|
|
641
|
+
...defaultViewConfig,
|
|
642
|
+
hideAnswerEditPanel: true,
|
|
643
|
+
});
|
|
644
|
+
searchEmbed.render();
|
|
645
|
+
await executeAfterWait(() => {
|
|
646
|
+
expectUrlMatchesWithParams(
|
|
647
|
+
getIFrameSrc(),
|
|
648
|
+
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&showAnswerEditPanel=false&dataSourceMode=expand&useLastSelectedSources=false${prefixParams}#/embed/answer`,
|
|
649
|
+
);
|
|
650
|
+
});
|
|
651
|
+
});
|
|
652
|
+
|
|
653
|
+
test('Should add showAnswerEditPanel flag set to true to the iframe src when hideAnswerEditPanel is false', async () => {
|
|
654
|
+
const searchEmbed = new SearchEmbed(getRootEl(), {
|
|
655
|
+
...defaultViewConfig,
|
|
656
|
+
hideAnswerEditPanel: false,
|
|
657
|
+
});
|
|
658
|
+
searchEmbed.render();
|
|
659
|
+
await executeAfterWait(() => {
|
|
660
|
+
expectUrlMatchesWithParams(
|
|
661
|
+
getIFrameSrc(),
|
|
662
|
+
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&showAnswerEditPanel=true&dataSourceMode=expand&useLastSelectedSources=false${prefixParams}#/embed/answer`,
|
|
663
|
+
);
|
|
664
|
+
});
|
|
665
|
+
});
|
|
666
|
+
|
|
587
667
|
test('should set dataPanelCustomGroupsAccordionInitialState to EXPAND_FIRST when passed', async () => {
|
|
588
668
|
const searchEmbed = new SearchBarEmbed(getRootEl() as any, {
|
|
589
669
|
...defaultViewConfig,
|
|
@@ -774,6 +854,29 @@ test('should pass forceTable parameter when forceTable is true', async () => {
|
|
|
774
854
|
});
|
|
775
855
|
|
|
776
856
|
describe('SearchBarEmbed tests', () => {
|
|
857
|
+
test('should keep view config off the URL when excludeConfigFromURL is set', async () => {
|
|
858
|
+
const searchBarEmbed = new SearchBarEmbed(getRootEl() as any, {
|
|
859
|
+
...defaultViewConfig,
|
|
860
|
+
dataSources: ['source-1', 'source-2'],
|
|
861
|
+
additionalFlags: { excludeConfigFromURL: true },
|
|
862
|
+
} as any);
|
|
863
|
+
searchBarEmbed.render();
|
|
864
|
+
await executeAfterWait(() => {
|
|
865
|
+
const iframeSrc = getIFrameSrc();
|
|
866
|
+
|
|
867
|
+
// Bootstrap params stay: the handshake, the embed marker that
|
|
868
|
+
// picks the app shell, and the data sources it boots against.
|
|
869
|
+
expect(iframeSrc).toContain('hostAppUrl=');
|
|
870
|
+
expect(iframeSrc).toContain('isSearchEmbed=true');
|
|
871
|
+
expect(iframeSrc).toContain('dataSources');
|
|
872
|
+
|
|
873
|
+
// The rest of the view config goes over
|
|
874
|
+
// HostEvent.UpdateEmbedParams.
|
|
875
|
+
expect(iframeSrc).not.toContain('hideAction');
|
|
876
|
+
expect(iframeSrc).not.toContain('useLastSelectedDataSource');
|
|
877
|
+
});
|
|
878
|
+
});
|
|
879
|
+
|
|
777
880
|
test('should pass dataSources parameter when dataSources array is provided', async () => {
|
|
778
881
|
const searchBarEmbed = new SearchBarEmbed(getRootEl() as any, {
|
|
779
882
|
...defaultViewConfig,
|