@thoughtspot/visual-embed-sdk 1.52.0 → 1.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +9 -1
- package/cjs/src/contracts/contracts.spec.d.ts +2 -0
- package/cjs/src/contracts/contracts.spec.d.ts.map +1 -0
- package/cjs/src/contracts/contracts.spec.js +345 -0
- package/cjs/src/contracts/contracts.spec.js.map +1 -0
- package/cjs/src/contracts/embed-event-payloads.d.ts +73 -0
- package/cjs/src/contracts/embed-event-payloads.d.ts.map +1 -0
- package/cjs/src/contracts/embed-event-payloads.js +3 -0
- package/cjs/src/contracts/embed-event-payloads.js.map +1 -0
- package/cjs/src/contracts/host-event-contracts.d.ts +378 -0
- package/cjs/src/contracts/host-event-contracts.d.ts.map +1 -0
- package/cjs/src/contracts/host-event-contracts.js +3 -0
- package/cjs/src/contracts/host-event-contracts.js.map +1 -0
- package/cjs/src/contracts/index.d.ts +22 -0
- package/cjs/src/contracts/index.d.ts.map +1 -0
- package/cjs/src/contracts/index.js +33 -0
- package/cjs/src/contracts/index.js.map +1 -0
- package/cjs/src/contracts/ui-passthrough-contracts.d.ts +277 -0
- package/cjs/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
- package/cjs/src/{embed/hostEventClient/contracts.js → contracts/ui-passthrough-contracts.js} +6 -2
- package/cjs/src/contracts/ui-passthrough-contracts.js.map +1 -0
- package/cjs/src/embed/app.d.ts +17 -140
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +20 -120
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +70 -26
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/events.spec.js +12 -2
- package/cjs/src/embed/events.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +3 -2
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +23 -18
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +36 -36
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.js +3 -3
- package/cjs/src/embed/hostEventClient/utils.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +9 -161
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +66 -134
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +211 -28
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/search.d.ts +14 -0
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +4 -1
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +65 -0
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +17 -22
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +82 -56
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +325 -17
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/full-height.d.ts +137 -0
- package/cjs/src/full-height.d.ts.map +1 -0
- package/cjs/src/full-height.js +272 -0
- package/cjs/src/full-height.js.map +1 -0
- package/cjs/src/full-height.spec.d.ts +2 -0
- package/cjs/src/full-height.spec.d.ts.map +1 -0
- package/cjs/src/full-height.spec.js +835 -0
- package/cjs/src/full-height.spec.js.map +1 -0
- package/cjs/src/index.d.ts +4 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -3
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/all-types-export.parity.spec.js +55 -3
- package/cjs/src/react/all-types-export.parity.spec.js.map +1 -1
- package/cjs/src/types.d.ts +540 -3
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +326 -1
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/processTrigger.d.ts +3 -1
- package/cjs/src/utils/processTrigger.d.ts.map +1 -1
- package/cjs/src/utils/processTrigger.js +19 -51
- package/cjs/src/utils/processTrigger.js.map +1 -1
- package/cjs/src/utils/transport/iframe-transport.d.ts +55 -0
- package/cjs/src/utils/transport/iframe-transport.d.ts.map +1 -0
- package/cjs/src/utils/transport/iframe-transport.js +108 -0
- package/cjs/src/utils/transport/iframe-transport.js.map +1 -0
- package/cjs/src/utils/transport/iframe-transport.spec.d.ts +2 -0
- package/cjs/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
- package/cjs/src/utils/transport/iframe-transport.spec.js +140 -0
- package/cjs/src/utils/transport/iframe-transport.spec.js.map +1 -0
- package/cjs/src/utils.d.ts +18 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +39 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +62 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-BMppCU63.js → index-C1pmYb5H.js} +1 -1
- package/dist/src/contracts/contracts.spec.d.ts +2 -0
- package/dist/src/contracts/contracts.spec.d.ts.map +1 -0
- package/dist/src/contracts/embed-event-payloads.d.ts +73 -0
- package/dist/src/contracts/embed-event-payloads.d.ts.map +1 -0
- package/dist/src/contracts/host-event-contracts.d.ts +378 -0
- package/dist/src/contracts/host-event-contracts.d.ts.map +1 -0
- package/dist/src/contracts/index.d.ts +22 -0
- package/dist/src/contracts/index.d.ts.map +1 -0
- package/dist/src/contracts/ui-passthrough-contracts.d.ts +277 -0
- package/dist/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
- package/dist/src/embed/app.d.ts +17 -140
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +3 -2
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +9 -161
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +14 -0
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +17 -22
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/full-height.d.ts +137 -0
- package/dist/src/full-height.d.ts.map +1 -0
- package/dist/src/full-height.spec.d.ts +2 -0
- package/dist/src/full-height.spec.d.ts.map +1 -0
- package/dist/src/index.d.ts +4 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/types.d.ts +540 -3
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/processTrigger.d.ts +3 -1
- package/dist/src/utils/processTrigger.d.ts.map +1 -1
- package/dist/src/utils/transport/iframe-transport.d.ts +55 -0
- package/dist/src/utils/transport/iframe-transport.d.ts.map +1 -0
- package/dist/src/utils/transport/iframe-transport.spec.d.ts +2 -0
- package/dist/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
- package/dist/src/utils.d.ts +18 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +925 -363
- package/dist/tsembed-react.js +924 -362
- package/dist/tsembed.es.js +925 -363
- package/dist/tsembed.js +924 -362
- package/dist/visual-embed-sdk-react-full.d.ts +1357 -656
- package/dist/visual-embed-sdk-react.d.ts +1257 -606
- package/dist/visual-embed-sdk.d.ts +1320 -642
- package/lib/package.json +9 -1
- package/lib/src/contracts/contracts.spec.d.ts +2 -0
- package/lib/src/contracts/contracts.spec.d.ts.map +1 -0
- package/lib/src/contracts/contracts.spec.js +342 -0
- package/lib/src/contracts/contracts.spec.js.map +1 -0
- package/lib/src/contracts/embed-event-payloads.d.ts +73 -0
- package/lib/src/contracts/embed-event-payloads.d.ts.map +1 -0
- package/lib/src/contracts/embed-event-payloads.js +2 -0
- package/lib/src/contracts/embed-event-payloads.js.map +1 -0
- package/lib/src/contracts/host-event-contracts.d.ts +378 -0
- package/lib/src/contracts/host-event-contracts.d.ts.map +1 -0
- package/lib/src/contracts/host-event-contracts.js +2 -0
- package/lib/src/contracts/host-event-contracts.js.map +1 -0
- package/lib/src/contracts/index.d.ts +22 -0
- package/lib/src/contracts/index.d.ts.map +1 -0
- package/lib/src/contracts/index.js +22 -0
- package/lib/src/contracts/index.js.map +1 -0
- package/lib/src/contracts/ui-passthrough-contracts.d.ts +277 -0
- package/lib/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
- package/lib/src/{embed/hostEventClient/contracts.js → contracts/ui-passthrough-contracts.js} +6 -2
- package/lib/src/contracts/ui-passthrough-contracts.js.map +1 -0
- package/lib/src/embed/app.d.ts +17 -140
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +22 -122
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +70 -26
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/events.spec.js +12 -2
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +3 -2
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +6 -1
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/utils.js +1 -1
- package/lib/src/embed/hostEventClient/utils.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +9 -161
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +67 -135
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +211 -28
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/search.d.ts +14 -0
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +4 -1
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +65 -0
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +17 -22
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +82 -56
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +322 -14
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/full-height.d.ts +137 -0
- package/lib/src/full-height.d.ts.map +1 -0
- package/lib/src/full-height.js +268 -0
- package/lib/src/full-height.js.map +1 -0
- package/lib/src/full-height.spec.d.ts +2 -0
- package/lib/src/full-height.spec.d.ts.map +1 -0
- package/lib/src/full-height.spec.js +833 -0
- package/lib/src/full-height.spec.js.map +1 -0
- package/lib/src/index.d.ts +4 -3
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/all-types-export.parity.spec.js +55 -3
- package/lib/src/react/all-types-export.parity.spec.js.map +1 -1
- package/lib/src/types.d.ts +540 -3
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +326 -1
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processTrigger.d.ts +3 -1
- package/lib/src/utils/processTrigger.d.ts.map +1 -1
- package/lib/src/utils/processTrigger.js +19 -51
- package/lib/src/utils/processTrigger.js.map +1 -1
- package/lib/src/utils/transport/iframe-transport.d.ts +55 -0
- package/lib/src/utils/transport/iframe-transport.d.ts.map +1 -0
- package/lib/src/utils/transport/iframe-transport.js +101 -0
- package/lib/src/utils/transport/iframe-transport.js.map +1 -0
- package/lib/src/utils/transport/iframe-transport.spec.d.ts +2 -0
- package/lib/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
- package/lib/src/utils/transport/iframe-transport.spec.js +138 -0
- package/lib/src/utils/transport/iframe-transport.spec.js.map +1 -0
- package/lib/src/utils.d.ts +18 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +37 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +63 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +1320 -642
- package/package.json +9 -1
- package/src/contracts/contracts.spec.ts +392 -0
- package/src/contracts/embed-event-payloads.ts +83 -0
- package/src/contracts/host-event-contracts.ts +456 -0
- package/src/contracts/index.ts +53 -0
- package/src/contracts/ui-passthrough-contracts.ts +301 -0
- package/src/embed/app.spec.ts +86 -34
- package/src/embed/app.ts +37 -264
- package/src/embed/events.spec.ts +14 -2
- package/src/embed/hostEventClient/host-event-client.spec.ts +2 -2
- package/src/embed/hostEventClient/host-event-client.ts +18 -5
- package/src/embed/hostEventClient/utils.ts +2 -1
- package/src/embed/liveboard.spec.ts +257 -38
- package/src/embed/liveboard.ts +75 -296
- package/src/embed/search.spec.ts +80 -0
- package/src/embed/search.ts +20 -0
- package/src/embed/ts-embed.spec.ts +448 -15
- package/src/embed/ts-embed.ts +109 -66
- package/src/full-height.spec.ts +1008 -0
- package/src/full-height.ts +361 -0
- package/src/index.ts +93 -5
- package/src/react/all-types-export.parity.spec.ts +63 -3
- package/src/react/all-types-export.ts +45 -0
- package/src/types.ts +540 -1
- package/src/utils/processTrigger.ts +28 -58
- package/src/utils/transport/iframe-transport.spec.ts +177 -0
- package/src/utils/transport/iframe-transport.ts +122 -0
- package/src/utils.spec.ts +71 -0
- package/src/utils.ts +38 -0
- package/cjs/src/embed/hostEventClient/contracts.d.ts +0 -231
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +0 -1
- package/cjs/src/embed/hostEventClient/contracts.js.map +0 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +0 -231
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +0 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +0 -231
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +0 -1
- package/lib/src/embed/hostEventClient/contracts.js.map +0 -1
- package/src/embed/hostEventClient/contracts.ts +0 -262
package/src/embed/app.ts
CHANGED
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { logger } from '../utils/logger';
|
|
12
|
-
import {
|
|
13
|
-
import { DEFAULT_LAZY_LOADING_MARGIN } from '../config';
|
|
12
|
+
import { getQueryParamString, isUndefined, setParamIfDefined } from '../utils';
|
|
14
13
|
import {
|
|
15
14
|
Param,
|
|
16
15
|
DOMSelector,
|
|
17
16
|
HostEvent,
|
|
18
17
|
EmbedEvent,
|
|
19
|
-
MessagePayload,
|
|
20
18
|
AllEmbedViewConfig,
|
|
19
|
+
FullHeightViewConfig,
|
|
21
20
|
DefaultAppInitData,
|
|
22
21
|
VisualizationOverrides,
|
|
23
22
|
SpotterFileUploadFileTypes,
|
|
24
23
|
} from '../types';
|
|
24
|
+
import { FullHeightController } from '../full-height';
|
|
25
25
|
import { V1Embed } from './ts-embed';
|
|
26
26
|
import { SpotterChatViewConfig, SpotterSidebarViewConfig, SpotterQueryMode, SpotterShareConversationConfig, StarterPromptsConfig } from './conversation';
|
|
27
27
|
import { buildSpotterSidebarAppInitData, buildSpotterShareConversationAppInitData, buildStarterPromptsAppInitData } from './spotter-utils';
|
|
@@ -179,7 +179,7 @@ export interface DiscoveryExperience {
|
|
|
179
179
|
* The view configuration for full app embedding.
|
|
180
180
|
* @group Embed components
|
|
181
181
|
*/
|
|
182
|
-
export interface AppViewConfig extends AllEmbedViewConfig {
|
|
182
|
+
export interface AppViewConfig extends AllEmbedViewConfig, FullHeightViewConfig {
|
|
183
183
|
/**
|
|
184
184
|
* If true, the top navigation bar within the ThoughtSpot app
|
|
185
185
|
* is displayed. By default, the navigation bar is hidden.
|
|
@@ -464,34 +464,6 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
464
464
|
* ```
|
|
465
465
|
*/
|
|
466
466
|
enableSearchAssist?: boolean;
|
|
467
|
-
/**
|
|
468
|
-
* If set to true, the Liveboard container dynamically resizes
|
|
469
|
-
* according to the height of the Liveboard.
|
|
470
|
-
*
|
|
471
|
-
* **Note**: Using fullHeight loads all visualizations
|
|
472
|
-
* on the Liveboard simultaneously, which results in
|
|
473
|
-
* multiple warehouse queries and potentially a
|
|
474
|
-
* longer wait for the topmost visualizations to
|
|
475
|
-
* display on the screen. Setting fullHeight to
|
|
476
|
-
* `false` fetches visualizations incrementally as
|
|
477
|
-
* users scroll the page to view the charts and tables.
|
|
478
|
-
*
|
|
479
|
-
* From SDK 1.52.0, enabling `fullHeight` also turns on
|
|
480
|
-
* {@link lazyLoadingForFullHeight} and
|
|
481
|
-
* {@link enableScrollableContainerLazyLoading}, so visualizations load as
|
|
482
|
-
* they scroll into view. Set either flag to `false` to opt out.
|
|
483
|
-
*
|
|
484
|
-
* Supported embed types: `AppEmbed`
|
|
485
|
-
* @version SDK: 1.21.0 | ThoughtSpot: 9.4.0.cl, 9.4.0-sw
|
|
486
|
-
* @example
|
|
487
|
-
* ```js
|
|
488
|
-
* const embed = new AppEmbed('#tsEmbed', {
|
|
489
|
-
* ... // other embed view config
|
|
490
|
-
* fullHeight: true,
|
|
491
|
-
* })
|
|
492
|
-
* ```
|
|
493
|
-
*/
|
|
494
|
-
fullHeight?: boolean;
|
|
495
467
|
/**
|
|
496
468
|
* Enables the V2 navigation and modular home page experience.
|
|
497
469
|
* For more information,
|
|
@@ -693,79 +665,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
693
665
|
*/
|
|
694
666
|
isGranularXLSXCSVSchedulesEnabled?: boolean;
|
|
695
667
|
|
|
696
|
-
/**
|
|
697
|
-
* Loads visualizations only as they scroll into the viewport, instead of
|
|
698
|
-
* loading the whole full-height Liveboard at once.
|
|
699
|
-
*
|
|
700
|
-
* From SDK 1.52.0 this is enabled automatically whenever `fullHeight` is
|
|
701
|
-
* `true`. On SDK 1.51.0 and earlier it defaulted to `false` and had to be
|
|
702
|
-
* set explicitly. Set it to `false` to load every visualization upfront.
|
|
703
|
-
* The flag has no effect unless `fullHeight` is enabled.
|
|
704
|
-
*
|
|
705
|
-
* @type {boolean}
|
|
706
|
-
* @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
|
|
707
|
-
* @default true when `fullHeight` is enabled, from SDK 1.52.0
|
|
708
|
-
* @example
|
|
709
|
-
* ```js
|
|
710
|
-
* const embed = new AppEmbed('#embed-container', {
|
|
711
|
-
* // ...other options
|
|
712
|
-
* fullHeight: true,
|
|
713
|
-
* lazyLoadingForFullHeight: true,
|
|
714
|
-
* })
|
|
715
|
-
* ```
|
|
716
|
-
*/
|
|
717
|
-
lazyLoadingForFullHeight?: boolean;
|
|
718
|
-
/**
|
|
719
|
-
* Computes the visible region of the embed against its scrollable and
|
|
720
|
-
* clipping ancestors, instead of treating the browser window as the only
|
|
721
|
-
* viewport, and tracks scroll and resize on those ancestors.
|
|
722
|
-
*
|
|
723
|
-
* From SDK 1.52.0 this is enabled automatically whenever `fullHeight` is
|
|
724
|
-
* `true`. On SDK 1.51.0 and earlier it defaulted to `false` and had to be
|
|
725
|
-
* set explicitly. Set it to `false` when the page scrolls with the window
|
|
726
|
-
* and the embed has no clipping ancestor, to skip the extra ancestor
|
|
727
|
-
* tracking.
|
|
728
|
-
*
|
|
729
|
-
* @type {boolean}
|
|
730
|
-
* @default true when `fullHeight` is enabled, from SDK 1.52.0
|
|
731
|
-
* @hidden
|
|
732
|
-
*/
|
|
733
|
-
enableScrollableContainerLazyLoading?: boolean;
|
|
734
668
|
|
|
735
|
-
/**
|
|
736
|
-
* How far outside the viewport a visualization starts loading, when
|
|
737
|
-
* {@link lazyLoadingForFullHeight} is enabled.
|
|
738
|
-
*
|
|
739
|
-
* For example, if the margin is set to '10px',
|
|
740
|
-
* the visualization will be loaded 10px before its top edge is visible in the
|
|
741
|
-
* viewport.
|
|
742
|
-
*
|
|
743
|
-
* The format is similar to CSS margin, so `'500px 0px'` extends the
|
|
744
|
-
* prefetch 500px above and below the viewport and not sideways. Accepted
|
|
745
|
-
* units are `px`, `em`, `rem`, `%`, `vh` and `vw`, plus bare `0` and
|
|
746
|
-
* `auto`; an invalid value is logged and ignored.
|
|
747
|
-
*
|
|
748
|
-
* From SDK 1.52.0 this defaults to `'500px 0px'` — roughly one
|
|
749
|
-
* visualization ahead of the scroll position, so a chart has usually
|
|
750
|
-
* finished loading by the time it scrolls into view. Use a smaller margin
|
|
751
|
-
* to cut warehouse queries further, or `'0px'` to load a visualization
|
|
752
|
-
* only once it is actually visible.
|
|
753
|
-
*
|
|
754
|
-
* @type {string}
|
|
755
|
-
* @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
|
|
756
|
-
* @default '500px 0px' when `fullHeight` is enabled, from SDK 1.52.0
|
|
757
|
-
* @example
|
|
758
|
-
* ```js
|
|
759
|
-
* const embed = new AppEmbed('#embed-container', {
|
|
760
|
-
* // ...other options
|
|
761
|
-
* fullHeight: true,
|
|
762
|
-
* lazyLoadingForFullHeight: true,
|
|
763
|
-
* // Using 0px, the visualization will be only loaded when it's visible in the viewport.
|
|
764
|
-
* lazyLoadingMargin: '0px',
|
|
765
|
-
* })
|
|
766
|
-
* ```
|
|
767
|
-
*/
|
|
768
|
-
lazyLoadingMargin?: string;
|
|
769
669
|
|
|
770
670
|
/**
|
|
771
671
|
* updatedSpotterChatPrompt : Controls the updated spotter chat prompt.
|
|
@@ -954,23 +854,6 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
954
854
|
* @default false
|
|
955
855
|
*/
|
|
956
856
|
enableStopAnswerGenerationEmbed?: boolean;
|
|
957
|
-
/**
|
|
958
|
-
* This is the minimum height (in pixels) for a full-height App.
|
|
959
|
-
* Setting this height helps resolve issues with empty Apps and
|
|
960
|
-
* other screens navigable from an App.
|
|
961
|
-
*
|
|
962
|
-
* @version SDK: 1.44.2 | ThoughtSpot: 10.15.0.cl
|
|
963
|
-
* @default 500
|
|
964
|
-
* @example
|
|
965
|
-
* ```js
|
|
966
|
-
* const embed = new AppEmbed('#embed', {
|
|
967
|
-
* ... // other app view config
|
|
968
|
-
* fullHeight: true,
|
|
969
|
-
* minimumHeight: 600,
|
|
970
|
-
* });
|
|
971
|
-
* ```
|
|
972
|
-
*/
|
|
973
|
-
minimumHeight?: number;
|
|
974
857
|
/**
|
|
975
858
|
* To enable the homepage announcement banner.
|
|
976
859
|
* Controls the visibility of the announcement section
|
|
@@ -1022,6 +905,21 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
1022
905
|
* ```
|
|
1023
906
|
*/
|
|
1024
907
|
updatedSpotterExperience?: boolean;
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* If set to `true`, the answer edit panel is hidden.
|
|
911
|
+
*
|
|
912
|
+
* Supported embed types: `AppEmbed`
|
|
913
|
+
* @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
|
|
914
|
+
* @example
|
|
915
|
+
* ```js
|
|
916
|
+
* const embed = new AppEmbed('#tsEmbed', {
|
|
917
|
+
* ... // other embed view config
|
|
918
|
+
* hideAnswerEditPanel: true,
|
|
919
|
+
* })
|
|
920
|
+
* ```
|
|
921
|
+
*/
|
|
922
|
+
hideAnswerEditPanel?: boolean;
|
|
1025
923
|
}
|
|
1026
924
|
|
|
1027
925
|
/**
|
|
@@ -1044,33 +942,22 @@ export interface AppEmbedAppInitData extends DefaultAppInitData {
|
|
|
1044
942
|
export class AppEmbed extends V1Embed {
|
|
1045
943
|
protected viewConfig: AppViewConfig;
|
|
1046
944
|
|
|
1047
|
-
private
|
|
1048
|
-
|
|
1049
|
-
private lazyLoadScrollContainers: HTMLElement[] = [];
|
|
1050
|
-
|
|
1051
|
-
private lazyLoadResizeObserver: ResizeObserver | undefined;
|
|
945
|
+
private readonly fullHeightController?: FullHeightController;
|
|
1052
946
|
|
|
1053
947
|
constructor(domSelector: DOMSelector, viewConfig: AppViewConfig) {
|
|
1054
948
|
viewConfig.embedComponentType = 'AppEmbed';
|
|
1055
949
|
super(domSelector, viewConfig);
|
|
1056
950
|
if (this.viewConfig.fullHeight === true) {
|
|
1057
|
-
|
|
1058
|
-
this.
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
1068
|
-
this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
1069
|
-
this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
1070
|
-
this.on(
|
|
1071
|
-
EmbedEvent.RequestVisibleEmbedCoordinates,
|
|
1072
|
-
this.requestVisibleEmbedCoordinatesHandler,
|
|
1073
|
-
);
|
|
951
|
+
this.fullHeightController = new FullHeightController(this.viewConfig, {
|
|
952
|
+
getIframe: () => this.iFrame,
|
|
953
|
+
setFrameHeight: (height) => this.setIFrameHeight(height),
|
|
954
|
+
on: (eventType, callback) => {
|
|
955
|
+
this.on(eventType, callback);
|
|
956
|
+
},
|
|
957
|
+
trigger: (hostEvent, data) => {
|
|
958
|
+
this.trigger(hostEvent, data);
|
|
959
|
+
},
|
|
960
|
+
});
|
|
1074
961
|
}
|
|
1075
962
|
}
|
|
1076
963
|
|
|
@@ -1122,7 +1009,6 @@ export class AppEmbed extends V1Embed {
|
|
|
1122
1009
|
hideOrgSwitcher,
|
|
1123
1010
|
enableSearchAssist,
|
|
1124
1011
|
newConnectionsExperience,
|
|
1125
|
-
fullHeight,
|
|
1126
1012
|
dataPanelV2 = true,
|
|
1127
1013
|
updatedSpotterExperience,
|
|
1128
1014
|
hideLiveboardHeader = false,
|
|
@@ -1165,11 +1051,11 @@ export class AppEmbed extends V1Embed {
|
|
|
1165
1051
|
enableStopAnswerGenerationEmbed,
|
|
1166
1052
|
spotterChatConfig,
|
|
1167
1053
|
spotterDataSources,
|
|
1168
|
-
minimumHeight,
|
|
1169
1054
|
isThisPeriodInDateFiltersEnabled,
|
|
1170
1055
|
enableHomepageAnnouncement = false,
|
|
1171
1056
|
isContinuousLiveboardPDFEnabled,
|
|
1172
1057
|
enableLiveboardDataCache,
|
|
1058
|
+
hideAnswerEditPanel,
|
|
1173
1059
|
} = this.viewConfig;
|
|
1174
1060
|
|
|
1175
1061
|
let params: any = {};
|
|
@@ -1207,6 +1093,9 @@ export class AppEmbed extends V1Embed {
|
|
|
1207
1093
|
if (!isUndefined(coverAndFilterOptionInPDF)) {
|
|
1208
1094
|
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
1209
1095
|
}
|
|
1096
|
+
if (!isUndefined(hideAnswerEditPanel)) {
|
|
1097
|
+
params[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
|
|
1098
|
+
}
|
|
1210
1099
|
|
|
1211
1100
|
params = this.getBaseQueryParams(params);
|
|
1212
1101
|
|
|
@@ -1270,15 +1159,7 @@ export class AppEmbed extends V1Embed {
|
|
|
1270
1159
|
params[Param.HideNotification] = !!hideNotification;
|
|
1271
1160
|
}
|
|
1272
1161
|
|
|
1273
|
-
|
|
1274
|
-
params[Param.fullHeight] = true;
|
|
1275
|
-
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
1276
|
-
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
1277
|
-
if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
|
|
1278
|
-
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
}
|
|
1162
|
+
this.fullHeightController?.addQueryParams(params);
|
|
1282
1163
|
|
|
1283
1164
|
if (tag) {
|
|
1284
1165
|
params[Param.Tag] = tag;
|
|
@@ -1371,8 +1252,6 @@ export class AppEmbed extends V1Embed {
|
|
|
1371
1252
|
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
1372
1253
|
}
|
|
1373
1254
|
|
|
1374
|
-
this.defaultHeight = minimumHeight || this.defaultHeight;
|
|
1375
|
-
|
|
1376
1255
|
if (enableLiveboardDataCache !== undefined) {
|
|
1377
1256
|
params[Param.EnableLiveboardDataCache] = enableLiveboardDataCache;
|
|
1378
1257
|
}
|
|
@@ -1428,32 +1307,6 @@ export class AppEmbed extends V1Embed {
|
|
|
1428
1307
|
return params;
|
|
1429
1308
|
}
|
|
1430
1309
|
|
|
1431
|
-
private sendFullHeightLazyLoadData = () => {
|
|
1432
|
-
const data = calculateVisibleElementData(
|
|
1433
|
-
this.iFrame,
|
|
1434
|
-
this.viewConfig.enableScrollableContainerLazyLoading,
|
|
1435
|
-
);
|
|
1436
|
-
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
1437
|
-
if(this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight){
|
|
1438
|
-
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
|
|
1439
|
-
}
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
/**
|
|
1443
|
-
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
1444
|
-
* It is used to send the visible coordinates data to the host application.
|
|
1445
|
-
* @param data The event payload
|
|
1446
|
-
* @param responder The responder function
|
|
1447
|
-
*/
|
|
1448
|
-
private requestVisibleEmbedCoordinatesHandler = (data: MessagePayload, responder: any) => {
|
|
1449
|
-
logger.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
1450
|
-
const visibleCoordinatesData = calculateVisibleElementData(
|
|
1451
|
-
this.iFrame,
|
|
1452
|
-
this.viewConfig.enableScrollableContainerLazyLoading,
|
|
1453
|
-
);
|
|
1454
|
-
responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
1310
|
/**
|
|
1458
1311
|
* Constructs the URL of the ThoughtSpot app page to be rendered.
|
|
1459
1312
|
* @param pageId The ID of the page to be embedded.
|
|
@@ -1469,44 +1322,6 @@ export class AppEmbed extends V1Embed {
|
|
|
1469
1322
|
return url;
|
|
1470
1323
|
}
|
|
1471
1324
|
|
|
1472
|
-
/**
|
|
1473
|
-
* Set the iframe height as per the computed height received
|
|
1474
|
-
* from the ThoughtSpot app.
|
|
1475
|
-
* @param data The event payload
|
|
1476
|
-
*/
|
|
1477
|
-
protected updateIFrameHeight = (data: MessagePayload) => {
|
|
1478
|
-
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
1479
|
-
this.sendFullHeightLazyLoadData();
|
|
1480
|
-
};
|
|
1481
|
-
|
|
1482
|
-
private embedIframeCenter = (data: MessagePayload, responder: any) => {
|
|
1483
|
-
const obj = this.getIframeCenter();
|
|
1484
|
-
responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
|
|
1485
|
-
};
|
|
1486
|
-
|
|
1487
|
-
private setIframeHeightForNonEmbedLiveboard = (data: MessagePayload) => {
|
|
1488
|
-
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
1489
|
-
|
|
1490
|
-
const liveboardRelatedRoutes = [
|
|
1491
|
-
'/pinboard/',
|
|
1492
|
-
'/insights/pinboard/',
|
|
1493
|
-
'/schedules/',
|
|
1494
|
-
'/embed/viz/',
|
|
1495
|
-
'/embed/insights/viz/',
|
|
1496
|
-
'/liveboard/',
|
|
1497
|
-
'/insights/liveboard/',
|
|
1498
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
1499
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
1500
|
-
];
|
|
1501
|
-
|
|
1502
|
-
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
1503
|
-
// Ignore the height reset of the frame, if the navigation is
|
|
1504
|
-
// only within the liveboard page.
|
|
1505
|
-
return;
|
|
1506
|
-
}
|
|
1507
|
-
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
1508
|
-
};
|
|
1509
|
-
|
|
1510
1325
|
/**
|
|
1511
1326
|
* Gets the ThoughtSpot route of the page for a particular page ID.
|
|
1512
1327
|
* @param pageId The identifier for a page in the ThoughtSpot app.
|
|
@@ -1596,53 +1411,11 @@ export class AppEmbed extends V1Embed {
|
|
|
1596
1411
|
*/
|
|
1597
1412
|
public destroy() {
|
|
1598
1413
|
super.destroy();
|
|
1599
|
-
this.
|
|
1414
|
+
this.fullHeightController?.destroy();
|
|
1600
1415
|
}
|
|
1601
1416
|
|
|
1602
1417
|
private postRender() {
|
|
1603
|
-
this.
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1606
|
-
private registerLazyLoadEvents() {
|
|
1607
|
-
if (!this.iFrame) {
|
|
1608
|
-
return;
|
|
1609
|
-
}
|
|
1610
|
-
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
1611
|
-
this.unregisterLazyLoadEvents();
|
|
1612
|
-
// TODO: Use passive: true, install modernizr to check for passive
|
|
1613
|
-
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
1614
|
-
window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
1615
|
-
if (!this.viewConfig.enableScrollableContainerLazyLoading) {
|
|
1616
|
-
return;
|
|
1617
|
-
}
|
|
1618
|
-
this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
|
|
1619
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
1620
|
-
scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
1621
|
-
});
|
|
1622
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
1623
|
-
const resizeTargets = new Set([
|
|
1624
|
-
this.iFrame.parentElement,
|
|
1625
|
-
...getEffectiveClippingAncestors(this.iFrame),
|
|
1626
|
-
].filter(Boolean) as HTMLElement[]);
|
|
1627
|
-
this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
|
|
1628
|
-
resizeTargets.forEach((resizeTarget) => {
|
|
1629
|
-
this.lazyLoadResizeObserver.observe(resizeTarget);
|
|
1630
|
-
});
|
|
1631
|
-
}
|
|
1632
|
-
}
|
|
1633
|
-
}
|
|
1634
|
-
|
|
1635
|
-
private unregisterLazyLoadEvents() {
|
|
1636
|
-
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
1637
|
-
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
1638
|
-
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
1639
|
-
this.lazyLoadResizeObserver?.disconnect();
|
|
1640
|
-
this.lazyLoadResizeObserver = undefined;
|
|
1641
|
-
this.lazyLoadScrollContainers.forEach((scrollContainer) => {
|
|
1642
|
-
scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
1643
|
-
});
|
|
1644
|
-
this.lazyLoadScrollContainers = [];
|
|
1645
|
-
}
|
|
1418
|
+
this.fullHeightController?.onRender();
|
|
1646
1419
|
}
|
|
1647
1420
|
|
|
1648
1421
|
/**
|
package/src/embed/events.spec.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
LiveboardEmbed,
|
|
10
10
|
AppEmbed,
|
|
11
11
|
HostEvent,
|
|
12
|
+
MessageCallback,
|
|
12
13
|
} from '../index';
|
|
13
14
|
import {
|
|
14
15
|
EVENT_WAIT_TIME,
|
|
@@ -139,7 +140,7 @@ describe('test communication between host app and ThoughtSpot', () => {
|
|
|
139
140
|
searchEmbed.render();
|
|
140
141
|
setTimeout(() => {
|
|
141
142
|
searchEmbed.trigger(HostEvent.Search, {
|
|
142
|
-
|
|
143
|
+
searchQuery: PAYLOAD,
|
|
143
144
|
});
|
|
144
145
|
}, EVENT_WAIT_TIME);
|
|
145
146
|
executeAfterWait(() => {
|
|
@@ -147,12 +148,23 @@ describe('test communication between host app and ThoughtSpot', () => {
|
|
|
147
148
|
|
|
148
149
|
iframe.contentWindow.addEventListener('message', (e) => {
|
|
149
150
|
expect(e.data.type).toBe(HostEvent.Search);
|
|
150
|
-
expect(e.data.data.
|
|
151
|
+
expect(e.data.data.searchQuery).toBe(PAYLOAD);
|
|
151
152
|
done();
|
|
152
153
|
});
|
|
153
154
|
});
|
|
154
155
|
});
|
|
155
156
|
|
|
157
|
+
test('accepts a MessageCallback-typed handler for typed and untyped events', () => {
|
|
158
|
+
// Guardrail: on()/off() must accept the public MessageCallback type, or
|
|
159
|
+
// existing customer handlers stop compiling (checked non-strict here).
|
|
160
|
+
const legacy: MessageCallback = jest.fn();
|
|
161
|
+
const searchEmbed = new SearchEmbed(getRootEl(), {});
|
|
162
|
+
searchEmbed.on(EmbedEvent.CustomAction, legacy); // typed event
|
|
163
|
+
searchEmbed.on(EmbedEvent.Data, legacy); // untyped event
|
|
164
|
+
searchEmbed.off(EmbedEvent.Data, legacy);
|
|
165
|
+
expect(legacy).not.toHaveBeenCalled();
|
|
166
|
+
});
|
|
167
|
+
|
|
156
168
|
test('should execute multiple event handlers if registered', async () => {
|
|
157
169
|
const handlerOne = jest.fn();
|
|
158
170
|
const handlerTwo = jest.fn();
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
UIPassthroughEvent,
|
|
7
7
|
UIPassthroughRequest,
|
|
8
8
|
UIPassthroughArrayResponse,
|
|
9
|
-
|
|
10
|
-
} from '
|
|
9
|
+
} from '../../contracts/ui-passthrough-contracts';
|
|
10
|
+
import { HostEventRequest } from '../../contracts/host-event-contracts';
|
|
11
11
|
import { HostEventClient } from './host-event-client';
|
|
12
12
|
|
|
13
13
|
jest.mock('../../utils/processTrigger');
|
|
@@ -12,13 +12,17 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
UIPassthroughArrayResponse,
|
|
14
14
|
UIPassthroughEvent,
|
|
15
|
-
HostEventRequest,
|
|
16
|
-
HostEventResponse,
|
|
17
15
|
UIPassthroughRequest,
|
|
18
16
|
UIPassthroughResponse,
|
|
17
|
+
} from '../../contracts/ui-passthrough-contracts';
|
|
18
|
+
// Contract resolution from the shared contracts module — see
|
|
19
|
+
// src/contracts/host-event-contracts.ts (single source of truth).
|
|
20
|
+
import {
|
|
21
|
+
HostEventRequest,
|
|
22
|
+
HostEventResponse,
|
|
19
23
|
TriggerPayload,
|
|
20
24
|
TriggerResponse,
|
|
21
|
-
} from '
|
|
25
|
+
} from '../../contracts/host-event-contracts';
|
|
22
26
|
|
|
23
27
|
/**
|
|
24
28
|
* Maps HostEvent to its corresponding UIPassthroughEvent.
|
|
@@ -244,7 +248,16 @@ export class HostEventClient {
|
|
|
244
248
|
throwUpdateFiltersValidationError();
|
|
245
249
|
}
|
|
246
250
|
|
|
247
|
-
|
|
251
|
+
// The shared contract accepts both current (columnName/operator) and
|
|
252
|
+
// legacy (column/oper) filter field names — as does the validation
|
|
253
|
+
// above and the app at runtime. The UIPassthrough FilterUpdate type
|
|
254
|
+
// still requires the legacy names; bridge until that contract is
|
|
255
|
+
// audited.
|
|
256
|
+
return this.handleHostEventWithParam(
|
|
257
|
+
UIPassthroughEvent.UpdateFilters,
|
|
258
|
+
payload as UIPassthroughRequest<UIPassthroughEvent.UpdateFilters>,
|
|
259
|
+
context as ContextType,
|
|
260
|
+
);
|
|
248
261
|
}
|
|
249
262
|
|
|
250
263
|
protected handleUpdateParametersEvent(
|
|
@@ -287,7 +300,7 @@ export class HostEventClient {
|
|
|
287
300
|
hostEvent: HostEventT,
|
|
288
301
|
payload?: TriggerPayload<PayloadT, HostEventT>,
|
|
289
302
|
context?: ContextT,
|
|
290
|
-
): Promise<TriggerResponse<PayloadT, HostEventT,
|
|
303
|
+
): Promise<TriggerResponse<PayloadT, HostEventT, ContextT>> {
|
|
291
304
|
const customHandler = this.customHandlers[hostEvent];
|
|
292
305
|
const passthroughEvent = PASSTHROUGH_MAP[hostEvent];
|
|
293
306
|
|
|
@@ -4,7 +4,8 @@ import isString from 'lodash/isString';
|
|
|
4
4
|
import isUndefined from 'lodash/isUndefined';
|
|
5
5
|
import { EmbedErrorCodes, EmbedEvent, ErrorDetailsTypes, HostEvent } from '../../types';
|
|
6
6
|
import { ERROR_MESSAGE } from '../../errors';
|
|
7
|
-
import { ApplicabilityLevel
|
|
7
|
+
import { ApplicabilityLevel } from '../../contracts/ui-passthrough-contracts';
|
|
8
|
+
import { HostEventRequest } from '../../contracts/host-event-contracts';
|
|
8
9
|
import { embedEventStatus } from '../../utils';
|
|
9
10
|
|
|
10
11
|
const isValidApplicability = (a?: { level?: string; targetId?: string }) => {
|