@thoughtspot/visual-embed-sdk 1.51.2 → 1.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +9 -1
- package/cjs/src/api-intercept.d.ts.map +1 -1
- package/cjs/src/api-intercept.js +1 -0
- package/cjs/src/api-intercept.js.map +1 -1
- package/cjs/src/contracts/contracts.spec.d.ts +2 -0
- package/cjs/src/contracts/contracts.spec.d.ts.map +1 -0
- package/cjs/src/contracts/contracts.spec.js +345 -0
- package/cjs/src/contracts/contracts.spec.js.map +1 -0
- package/cjs/src/contracts/embed-event-payloads.d.ts +73 -0
- package/cjs/src/contracts/embed-event-payloads.d.ts.map +1 -0
- package/cjs/src/contracts/embed-event-payloads.js +3 -0
- package/cjs/src/contracts/embed-event-payloads.js.map +1 -0
- package/cjs/src/contracts/host-event-contracts.d.ts +378 -0
- package/cjs/src/contracts/host-event-contracts.d.ts.map +1 -0
- package/cjs/src/contracts/host-event-contracts.js +3 -0
- package/cjs/src/contracts/host-event-contracts.js.map +1 -0
- package/cjs/src/contracts/index.d.ts +22 -0
- package/cjs/src/contracts/index.d.ts.map +1 -0
- package/cjs/src/contracts/index.js +33 -0
- package/cjs/src/contracts/index.js.map +1 -0
- package/cjs/src/contracts/ui-passthrough-contracts.d.ts +277 -0
- package/cjs/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
- package/cjs/src/{embed/hostEventClient/contracts.js → contracts/ui-passthrough-contracts.js} +6 -2
- package/cjs/src/contracts/ui-passthrough-contracts.js.map +1 -0
- package/cjs/src/css-variables.d.ts +1 -1
- package/cjs/src/embed/app.d.ts +17 -140
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +20 -120
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +70 -26
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +5 -5
- package/cjs/src/embed/events.spec.js +12 -2
- package/cjs/src/embed/events.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +3 -2
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +23 -18
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +36 -36
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.js +3 -3
- package/cjs/src/embed/hostEventClient/utils.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +9 -161
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +68 -135
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +215 -32
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/search.d.ts +14 -0
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +4 -1
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +65 -0
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +21 -25
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +105 -72
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +380 -33
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/full-height.d.ts +137 -0
- package/cjs/src/full-height.d.ts.map +1 -0
- package/cjs/src/full-height.js +272 -0
- package/cjs/src/full-height.js.map +1 -0
- package/cjs/src/full-height.spec.d.ts +2 -0
- package/cjs/src/full-height.spec.d.ts.map +1 -0
- package/cjs/src/full-height.spec.js +835 -0
- package/cjs/src/full-height.spec.js.map +1 -0
- package/cjs/src/index.d.ts +4 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +5 -4
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/all-types-export.parity.spec.js +55 -3
- package/cjs/src/react/all-types-export.parity.spec.js.map +1 -1
- package/cjs/src/react/index.d.ts +8 -8
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +1 -1
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +7 -7
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +664 -39
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +406 -13
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/processTrigger.d.ts +3 -1
- package/cjs/src/utils/processTrigger.d.ts.map +1 -1
- package/cjs/src/utils/processTrigger.js +19 -51
- package/cjs/src/utils/processTrigger.js.map +1 -1
- package/cjs/src/utils/transport/iframe-transport.d.ts +55 -0
- package/cjs/src/utils/transport/iframe-transport.d.ts.map +1 -0
- package/cjs/src/utils/transport/iframe-transport.js +108 -0
- package/cjs/src/utils/transport/iframe-transport.js.map +1 -0
- package/cjs/src/utils/transport/iframe-transport.spec.d.ts +2 -0
- package/cjs/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
- package/cjs/src/utils/transport/iframe-transport.spec.js +140 -0
- package/cjs/src/utils/transport/iframe-transport.spec.js.map +1 -0
- package/cjs/src/utils.d.ts +18 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +39 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +62 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-D8_Zs-Nr.js → index-C1pmYb5H.js} +1 -1
- package/dist/src/api-intercept.d.ts.map +1 -1
- package/dist/src/contracts/contracts.spec.d.ts +2 -0
- package/dist/src/contracts/contracts.spec.d.ts.map +1 -0
- package/dist/src/contracts/embed-event-payloads.d.ts +73 -0
- package/dist/src/contracts/embed-event-payloads.d.ts.map +1 -0
- package/dist/src/contracts/host-event-contracts.d.ts +378 -0
- package/dist/src/contracts/host-event-contracts.d.ts.map +1 -0
- package/dist/src/contracts/index.d.ts +22 -0
- package/dist/src/contracts/index.d.ts.map +1 -0
- package/dist/src/contracts/ui-passthrough-contracts.d.ts +277 -0
- package/dist/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
- package/dist/src/css-variables.d.ts +1 -1
- package/dist/src/embed/app.d.ts +17 -140
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +5 -5
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +3 -2
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +9 -161
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +14 -0
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +21 -25
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/full-height.d.ts +137 -0
- package/dist/src/full-height.d.ts.map +1 -0
- package/dist/src/full-height.spec.d.ts +2 -0
- package/dist/src/full-height.spec.d.ts.map +1 -0
- package/dist/src/index.d.ts +4 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +8 -8
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +664 -39
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/processTrigger.d.ts +3 -1
- package/dist/src/utils/processTrigger.d.ts.map +1 -1
- package/dist/src/utils/transport/iframe-transport.d.ts +55 -0
- package/dist/src/utils/transport/iframe-transport.d.ts.map +1 -0
- package/dist/src/utils/transport/iframe-transport.spec.d.ts +2 -0
- package/dist/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
- package/dist/src/utils.d.ts +18 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +1031 -392
- package/dist/tsembed-react.js +1030 -391
- package/dist/tsembed.es.js +1031 -392
- package/dist/tsembed.js +1029 -390
- package/dist/visual-embed-sdk-react-full.d.ts +1483 -693
- package/dist/visual-embed-sdk-react.d.ts +1364 -647
- package/dist/visual-embed-sdk.d.ts +1426 -659
- package/lib/package.json +9 -1
- package/lib/src/api-intercept.d.ts.map +1 -1
- package/lib/src/api-intercept.js +2 -1
- package/lib/src/api-intercept.js.map +1 -1
- package/lib/src/contracts/contracts.spec.d.ts +2 -0
- package/lib/src/contracts/contracts.spec.d.ts.map +1 -0
- package/lib/src/contracts/contracts.spec.js +342 -0
- package/lib/src/contracts/contracts.spec.js.map +1 -0
- package/lib/src/contracts/embed-event-payloads.d.ts +73 -0
- package/lib/src/contracts/embed-event-payloads.d.ts.map +1 -0
- package/lib/src/contracts/embed-event-payloads.js +2 -0
- package/lib/src/contracts/embed-event-payloads.js.map +1 -0
- package/lib/src/contracts/host-event-contracts.d.ts +378 -0
- package/lib/src/contracts/host-event-contracts.d.ts.map +1 -0
- package/lib/src/contracts/host-event-contracts.js +2 -0
- package/lib/src/contracts/host-event-contracts.js.map +1 -0
- package/lib/src/contracts/index.d.ts +22 -0
- package/lib/src/contracts/index.d.ts.map +1 -0
- package/lib/src/contracts/index.js +22 -0
- package/lib/src/contracts/index.js.map +1 -0
- package/lib/src/contracts/ui-passthrough-contracts.d.ts +277 -0
- package/lib/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
- package/lib/src/{embed/hostEventClient/contracts.js → contracts/ui-passthrough-contracts.js} +6 -2
- package/lib/src/contracts/ui-passthrough-contracts.js.map +1 -0
- package/lib/src/css-variables.d.ts +1 -1
- package/lib/src/embed/app.d.ts +17 -140
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +22 -122
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +70 -26
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +5 -5
- package/lib/src/embed/events.spec.js +12 -2
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +3 -2
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +6 -1
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/utils.js +1 -1
- package/lib/src/embed/hostEventClient/utils.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +9 -161
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +70 -137
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +215 -32
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/search.d.ts +14 -0
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +4 -1
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +65 -0
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +21 -25
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +106 -73
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +378 -31
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/full-height.d.ts +137 -0
- package/lib/src/full-height.d.ts.map +1 -0
- package/lib/src/full-height.js +268 -0
- package/lib/src/full-height.js.map +1 -0
- package/lib/src/full-height.spec.d.ts +2 -0
- package/lib/src/full-height.spec.d.ts.map +1 -0
- package/lib/src/full-height.spec.js +833 -0
- package/lib/src/full-height.spec.js.map +1 -0
- package/lib/src/index.d.ts +4 -3
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +3 -3
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/all-types-export.parity.spec.js +55 -3
- package/lib/src/react/all-types-export.parity.spec.js.map +1 -1
- package/lib/src/react/index.d.ts +8 -8
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +1 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +7 -7
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +664 -39
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +405 -12
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processTrigger.d.ts +3 -1
- package/lib/src/utils/processTrigger.d.ts.map +1 -1
- package/lib/src/utils/processTrigger.js +19 -51
- package/lib/src/utils/processTrigger.js.map +1 -1
- package/lib/src/utils/transport/iframe-transport.d.ts +55 -0
- package/lib/src/utils/transport/iframe-transport.d.ts.map +1 -0
- package/lib/src/utils/transport/iframe-transport.js +101 -0
- package/lib/src/utils/transport/iframe-transport.js.map +1 -0
- package/lib/src/utils/transport/iframe-transport.spec.d.ts +2 -0
- package/lib/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
- package/lib/src/utils/transport/iframe-transport.spec.js +138 -0
- package/lib/src/utils/transport/iframe-transport.spec.js.map +1 -0
- package/lib/src/utils.d.ts +18 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +37 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +63 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +1426 -659
- package/package.json +9 -1
- package/src/api-intercept.ts +2 -1
- package/src/contracts/contracts.spec.ts +392 -0
- package/src/contracts/embed-event-payloads.ts +83 -0
- package/src/contracts/host-event-contracts.ts +456 -0
- package/src/contracts/index.ts +53 -0
- package/src/contracts/ui-passthrough-contracts.ts +301 -0
- package/src/css-variables.ts +1 -1
- package/src/embed/app.spec.ts +86 -34
- package/src/embed/app.ts +37 -264
- package/src/embed/conversation.ts +5 -5
- package/src/embed/events.spec.ts +14 -2
- package/src/embed/hostEventClient/host-event-client.spec.ts +2 -2
- package/src/embed/hostEventClient/host-event-client.ts +18 -5
- package/src/embed/hostEventClient/utils.ts +2 -1
- package/src/embed/liveboard.spec.ts +261 -42
- package/src/embed/liveboard.ts +78 -297
- package/src/embed/search.spec.ts +80 -0
- package/src/embed/search.ts +20 -0
- package/src/embed/ts-embed.spec.ts +518 -31
- package/src/embed/ts-embed.ts +133 -82
- package/src/full-height.spec.ts +1008 -0
- package/src/full-height.ts +361 -0
- package/src/index.ts +95 -5
- package/src/react/all-types-export.parity.spec.ts +63 -3
- package/src/react/all-types-export.ts +46 -0
- package/src/react/index.spec.tsx +7 -7
- package/src/react/index.tsx +9 -9
- package/src/types.ts +665 -37
- package/src/utils/processTrigger.ts +28 -58
- package/src/utils/transport/iframe-transport.spec.ts +177 -0
- package/src/utils/transport/iframe-transport.ts +122 -0
- package/src/utils.spec.ts +71 -0
- package/src/utils.ts +38 -0
- package/cjs/src/embed/hostEventClient/contracts.d.ts +0 -231
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +0 -1
- package/cjs/src/embed/hostEventClient/contracts.js.map +0 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +0 -231
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +0 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +0 -231
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +0 -1
- package/lib/src/embed/hostEventClient/contracts.js.map +0 -1
- package/src/embed/hostEventClient/contracts.ts +0 -262
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { HostEvent, RuntimeFilter } from '../types';
|
|
2
|
+
import { SessionInterface } from '../utils/graphql/answerService/answerService';
|
|
3
|
+
|
|
4
|
+
export interface LiveboardTab {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface LiveboardGroup {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Levels at which a filter or parameter can be applied.
|
|
18
|
+
*/
|
|
19
|
+
export enum ApplicabilityLevel {
|
|
20
|
+
Liveboard = 'LIVEBOARD',
|
|
21
|
+
Tab = 'TAB',
|
|
22
|
+
Group = 'GROUP',
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Scopes a filter or parameter to a specific target.
|
|
27
|
+
* At `LIVEBOARD` level the filter applies to the whole Liveboard, so `targetId`
|
|
28
|
+
* is not required. `level` accepts the enum or its string value, e.g. `'TAB'`.
|
|
29
|
+
*/
|
|
30
|
+
export interface Applicability {
|
|
31
|
+
level: ApplicabilityLevel | `${ApplicabilityLevel}`;
|
|
32
|
+
targetId?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface FilterUpdate {
|
|
36
|
+
column: string;
|
|
37
|
+
oper: string;
|
|
38
|
+
values: string[];
|
|
39
|
+
type?: string;
|
|
40
|
+
applicability?: Applicability;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface LiveboardFilter {
|
|
44
|
+
applicability?: Applicability;
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface LiveboardParameter {
|
|
49
|
+
applicability?: Applicability;
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export enum UIPassthroughEvent {
|
|
54
|
+
PinAnswerToLiveboard = 'addVizToPinboard',
|
|
55
|
+
SaveAnswer = 'saveAnswer',
|
|
56
|
+
GetDiscoverabilityStatus = 'getDiscoverabilityStatus',
|
|
57
|
+
GetAvailableUIPassthroughs = 'getAvailableUiPassthroughs',
|
|
58
|
+
GetAnswerConfig = 'getAnswerPageConfig',
|
|
59
|
+
GetLiveboardConfig = 'getPinboardPageConfig',
|
|
60
|
+
GetUnsavedAnswerTML = 'getUnsavedAnswerTML',
|
|
61
|
+
UpdateFilters = 'updateFilters',
|
|
62
|
+
Drilldown = 'drillDown',
|
|
63
|
+
GetAnswerSession = 'getAnswerSession',
|
|
64
|
+
GetFilters = 'getFilters',
|
|
65
|
+
GetIframeUrl = 'getIframeUrl',
|
|
66
|
+
GetParameters = 'getParameters',
|
|
67
|
+
GetTML = 'getTML',
|
|
68
|
+
GetTabs = 'getTabs',
|
|
69
|
+
GetGroups = 'getGroups',
|
|
70
|
+
GetExportRequestForCurrentPinboard = 'getExportRequestForCurrentPinboard',
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* UI passthrough contract. Each event's request/response is a named interface so it
|
|
75
|
+
* documents and imports cleanly; `UIPassthroughContractBase` maps events to the pairs.
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
/** Request for {@link UIPassthroughEvent.PinAnswerToLiveboard}. */
|
|
79
|
+
export interface PinAnswerToLiveboardRequest {
|
|
80
|
+
vizId?: string;
|
|
81
|
+
newVizName: string;
|
|
82
|
+
newVizDescription?: string;
|
|
83
|
+
liveboardId?: string;
|
|
84
|
+
tabId?: string;
|
|
85
|
+
newLiveboardName?: string;
|
|
86
|
+
newTabName?: string;
|
|
87
|
+
}
|
|
88
|
+
/** Response for {@link UIPassthroughEvent.PinAnswerToLiveboard}. */
|
|
89
|
+
export interface PinAnswerToLiveboardResponse {
|
|
90
|
+
liveboardId: string;
|
|
91
|
+
tabId: string;
|
|
92
|
+
vizId: string;
|
|
93
|
+
}
|
|
94
|
+
/** Request for {@link UIPassthroughEvent.SaveAnswer}. */
|
|
95
|
+
export interface SaveAnswerRequest {
|
|
96
|
+
name: string;
|
|
97
|
+
description: string;
|
|
98
|
+
vizId?: string;
|
|
99
|
+
isDiscoverable?: boolean;
|
|
100
|
+
}
|
|
101
|
+
/** Response for {@link UIPassthroughEvent.SaveAnswer}. */
|
|
102
|
+
export interface SaveAnswerResponse {
|
|
103
|
+
answerId: string;
|
|
104
|
+
saveResponse?: any;
|
|
105
|
+
shareResponse?: any;
|
|
106
|
+
}
|
|
107
|
+
/** Response for {@link UIPassthroughEvent.GetDiscoverabilityStatus}. */
|
|
108
|
+
export interface GetDiscoverabilityStatusResponse {
|
|
109
|
+
shouldShowDiscoverability: boolean;
|
|
110
|
+
isDiscoverabilityCheckboxUnselectedPerOrg: boolean;
|
|
111
|
+
}
|
|
112
|
+
/** Response for {@link UIPassthroughEvent.GetAvailableUIPassthroughs}. */
|
|
113
|
+
export interface GetAvailableUIPassthroughsResponse {
|
|
114
|
+
keys: string[];
|
|
115
|
+
}
|
|
116
|
+
/** Request for {@link UIPassthroughEvent.GetAnswerConfig}. */
|
|
117
|
+
export interface GetAnswerConfigRequest {
|
|
118
|
+
vizId?: string;
|
|
119
|
+
}
|
|
120
|
+
/** Request for {@link UIPassthroughEvent.GetUnsavedAnswerTML}. */
|
|
121
|
+
export interface GetUnsavedAnswerTMLRequest {
|
|
122
|
+
sessionId?: string;
|
|
123
|
+
vizId?: string;
|
|
124
|
+
}
|
|
125
|
+
/** Response for {@link UIPassthroughEvent.GetUnsavedAnswerTML}. */
|
|
126
|
+
export interface GetUnsavedAnswerTMLResponse {
|
|
127
|
+
tml: string;
|
|
128
|
+
}
|
|
129
|
+
/** Request for {@link UIPassthroughEvent.GetAnswerSession}. */
|
|
130
|
+
export interface GetAnswerSessionRequest {
|
|
131
|
+
vizId?: string;
|
|
132
|
+
}
|
|
133
|
+
/** Response for {@link UIPassthroughEvent.GetAnswerSession}. */
|
|
134
|
+
export interface GetAnswerSessionResponse {
|
|
135
|
+
session: SessionInterface;
|
|
136
|
+
embedAnswerData?: Record<string, any>;
|
|
137
|
+
}
|
|
138
|
+
/** Request for {@link UIPassthroughEvent.GetFilters}. */
|
|
139
|
+
export interface GetFiltersRequest {
|
|
140
|
+
vizId?: string;
|
|
141
|
+
}
|
|
142
|
+
/** Response for {@link UIPassthroughEvent.GetFilters}. */
|
|
143
|
+
export interface GetFiltersResponse {
|
|
144
|
+
liveboardFilters: LiveboardFilter[];
|
|
145
|
+
runtimeFilters: RuntimeFilter[];
|
|
146
|
+
}
|
|
147
|
+
/** Response for {@link UIPassthroughEvent.GetIframeUrl}. */
|
|
148
|
+
export interface GetIframeUrlResponse {
|
|
149
|
+
iframeUrl: string;
|
|
150
|
+
}
|
|
151
|
+
/** Response for {@link UIPassthroughEvent.GetParameters}. */
|
|
152
|
+
export interface GetParametersResponse {
|
|
153
|
+
parameters: LiveboardParameter[];
|
|
154
|
+
}
|
|
155
|
+
/** Request for {@link UIPassthroughEvent.GetTML}. */
|
|
156
|
+
export interface GetTMLRequest {
|
|
157
|
+
vizId?: string;
|
|
158
|
+
includeNonExecutedSearchTokens?: boolean;
|
|
159
|
+
}
|
|
160
|
+
/** Response for {@link UIPassthroughEvent.GetTabs}. */
|
|
161
|
+
export interface GetTabsResponse {
|
|
162
|
+
orderedTabIds: string[];
|
|
163
|
+
numberOfTabs: number;
|
|
164
|
+
Tabs: LiveboardTab[];
|
|
165
|
+
}
|
|
166
|
+
/** Response for {@link UIPassthroughEvent.GetGroups}. */
|
|
167
|
+
export interface GetGroupsResponse {
|
|
168
|
+
orderedGroupIds: string[];
|
|
169
|
+
numberOfGroups: number;
|
|
170
|
+
Groups: LiveboardGroup[];
|
|
171
|
+
}
|
|
172
|
+
/** Response for {@link UIPassthroughEvent.GetExportRequestForCurrentPinboard}. */
|
|
173
|
+
export interface GetExportRequestForCurrentPinboardResponse {
|
|
174
|
+
data: { v2Content: string };
|
|
175
|
+
type: UIPassthroughEvent.GetExportRequestForCurrentPinboard;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Request for {@link UIPassthroughEvent.UpdateFilters}. Not the host-event
|
|
179
|
+
* `UpdateFiltersRequest` (host-event-contracts.ts), which has a different shape.
|
|
180
|
+
*/
|
|
181
|
+
export interface UpdateFiltersPassthroughRequest {
|
|
182
|
+
filter?: FilterUpdate;
|
|
183
|
+
filters?: FilterUpdate[];
|
|
184
|
+
}
|
|
185
|
+
/** Request for {@link UIPassthroughEvent.Drilldown}. */
|
|
186
|
+
export interface DrilldownRequest {
|
|
187
|
+
points: {
|
|
188
|
+
selectedPoints?: string[];
|
|
189
|
+
clickedPoint?: string;
|
|
190
|
+
};
|
|
191
|
+
columnGuid?: string;
|
|
192
|
+
autoDrillDown?: boolean;
|
|
193
|
+
vizId?: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** Maps each UI passthrough event to its request/response pair. */
|
|
197
|
+
export type UIPassthroughContractBase = {
|
|
198
|
+
[UIPassthroughEvent.PinAnswerToLiveboard]: {
|
|
199
|
+
request: PinAnswerToLiveboardRequest;
|
|
200
|
+
response: PinAnswerToLiveboardResponse;
|
|
201
|
+
};
|
|
202
|
+
[UIPassthroughEvent.SaveAnswer]: {
|
|
203
|
+
request: SaveAnswerRequest;
|
|
204
|
+
response: SaveAnswerResponse;
|
|
205
|
+
};
|
|
206
|
+
[UIPassthroughEvent.GetDiscoverabilityStatus]: {
|
|
207
|
+
request: any;
|
|
208
|
+
response: GetDiscoverabilityStatusResponse;
|
|
209
|
+
};
|
|
210
|
+
[UIPassthroughEvent.GetAvailableUIPassthroughs]: {
|
|
211
|
+
request: any;
|
|
212
|
+
response: GetAvailableUIPassthroughsResponse;
|
|
213
|
+
};
|
|
214
|
+
[UIPassthroughEvent.GetAnswerConfig]: {
|
|
215
|
+
request: GetAnswerConfigRequest;
|
|
216
|
+
response: any;
|
|
217
|
+
};
|
|
218
|
+
[UIPassthroughEvent.GetLiveboardConfig]: {
|
|
219
|
+
request: any;
|
|
220
|
+
response: any;
|
|
221
|
+
};
|
|
222
|
+
[UIPassthroughEvent.GetUnsavedAnswerTML]: {
|
|
223
|
+
request: GetUnsavedAnswerTMLRequest;
|
|
224
|
+
response: GetUnsavedAnswerTMLResponse;
|
|
225
|
+
};
|
|
226
|
+
[UIPassthroughEvent.GetAnswerSession]: {
|
|
227
|
+
request: GetAnswerSessionRequest;
|
|
228
|
+
response: GetAnswerSessionResponse;
|
|
229
|
+
};
|
|
230
|
+
[UIPassthroughEvent.GetFilters]: {
|
|
231
|
+
request: GetFiltersRequest;
|
|
232
|
+
response: GetFiltersResponse;
|
|
233
|
+
};
|
|
234
|
+
[UIPassthroughEvent.GetIframeUrl]: {
|
|
235
|
+
request: Record<string, never>;
|
|
236
|
+
response: GetIframeUrlResponse;
|
|
237
|
+
};
|
|
238
|
+
[UIPassthroughEvent.GetParameters]: {
|
|
239
|
+
request: Record<string, never>;
|
|
240
|
+
response: GetParametersResponse;
|
|
241
|
+
};
|
|
242
|
+
[UIPassthroughEvent.GetTML]: {
|
|
243
|
+
request: GetTMLRequest;
|
|
244
|
+
response: Record<string, any>;
|
|
245
|
+
};
|
|
246
|
+
[UIPassthroughEvent.GetTabs]: {
|
|
247
|
+
request: Record<string, never>;
|
|
248
|
+
response: GetTabsResponse;
|
|
249
|
+
};
|
|
250
|
+
[UIPassthroughEvent.GetGroups]: {
|
|
251
|
+
request: Record<string, never>;
|
|
252
|
+
response: GetGroupsResponse;
|
|
253
|
+
};
|
|
254
|
+
[UIPassthroughEvent.GetExportRequestForCurrentPinboard]: {
|
|
255
|
+
request: Record<string, never>;
|
|
256
|
+
response: GetExportRequestForCurrentPinboardResponse;
|
|
257
|
+
};
|
|
258
|
+
[UIPassthroughEvent.UpdateFilters]: {
|
|
259
|
+
request: UpdateFiltersPassthroughRequest;
|
|
260
|
+
response: unknown;
|
|
261
|
+
};
|
|
262
|
+
[UIPassthroughEvent.Drilldown]: {
|
|
263
|
+
request: DrilldownRequest;
|
|
264
|
+
response: unknown;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
// UI Passthrough Request and Response
|
|
269
|
+
export type UIPassthroughRequest<T
|
|
270
|
+
extends keyof UIPassthroughContractBase
|
|
271
|
+
> = UIPassthroughContractBase[T]['request'];
|
|
272
|
+
|
|
273
|
+
export type UIPassthroughResponse<
|
|
274
|
+
T extends keyof UIPassthroughContractBase
|
|
275
|
+
> = UIPassthroughContractBase[T]['response'];
|
|
276
|
+
|
|
277
|
+
export type UIPassthroughArrayResponse<ApiName extends keyof UIPassthroughContractBase> =
|
|
278
|
+
Array<{
|
|
279
|
+
refId?: string;
|
|
280
|
+
value?: UIPassthroughResponse<ApiName>;
|
|
281
|
+
error?: any;
|
|
282
|
+
}>
|
|
283
|
+
|
|
284
|
+
// Host event and UI Passthrough Event Mapping
|
|
285
|
+
export type EmbedApiHostEventMapping = {
|
|
286
|
+
[HostEvent.Pin]: UIPassthroughEvent.PinAnswerToLiveboard;
|
|
287
|
+
[HostEvent.SaveAnswer]: UIPassthroughEvent.SaveAnswer;
|
|
288
|
+
[HostEvent.GetAnswerSession]: UIPassthroughEvent.GetAnswerSession;
|
|
289
|
+
[HostEvent.GetFilters]: UIPassthroughEvent.GetFilters;
|
|
290
|
+
[HostEvent.GetIframeUrl]: UIPassthroughEvent.GetIframeUrl;
|
|
291
|
+
[HostEvent.GetParameters]: UIPassthroughEvent.GetParameters;
|
|
292
|
+
[HostEvent.GetTML]: UIPassthroughEvent.GetTML;
|
|
293
|
+
[HostEvent.GetTabs]: UIPassthroughEvent.GetTabs;
|
|
294
|
+
[HostEvent.GetGroups]: UIPassthroughEvent.GetGroups;
|
|
295
|
+
[HostEvent.getExportRequestForCurrentPinboard]: UIPassthroughEvent.GetExportRequestForCurrentPinboard;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// NOTE: HostEventRequest / HostEventResponse / TriggerPayload / TriggerResponse
|
|
299
|
+
// live in the sibling ./host-event-contracts, which layers the
|
|
300
|
+
// HostEventRequestMap on top of the UI-passthrough mapping above.
|
|
301
|
+
// The former 2-tier definitions that lived here were superseded and removed.
|
package/src/css-variables.ts
CHANGED
|
@@ -538,7 +538,7 @@ export interface CustomCssVariables {
|
|
|
538
538
|
* Left and right margin of the header and the tab/filter section of an
|
|
539
539
|
* embedded Liveboard. Use alongside the `liveboardGutter` view config to
|
|
540
540
|
* keep the header aligned with a custom tile-grid gutter.
|
|
541
|
-
* @version SDK: 1.
|
|
541
|
+
* @version SDK: 1.51.1 | ThoughtSpot Cloud: 26.8.0.cl
|
|
542
542
|
*/
|
|
543
543
|
'--ts-var-liveboard-header-horizontal-margin'?: string;
|
|
544
544
|
|
package/src/embed/app.spec.ts
CHANGED
|
@@ -55,7 +55,7 @@ const testUrlParams = async (viewConfig: AppViewConfig, expectedUrl: string) =>
|
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
// Helper function to test
|
|
58
|
+
// Helper function to test the full-height route-change behavior
|
|
59
59
|
const testSetIframeHeightBehavior = (
|
|
60
60
|
currentPath: string,
|
|
61
61
|
shouldBeCalled: boolean
|
|
@@ -70,7 +70,7 @@ const testSetIframeHeightBehavior = (
|
|
|
70
70
|
: jest.spyOn(appEmbed, 'setIFrameHeight');
|
|
71
71
|
|
|
72
72
|
appEmbed.render();
|
|
73
|
-
appEmbed.
|
|
73
|
+
appEmbed.fullHeightController.handleRouteChange({
|
|
74
74
|
data: { currentPath },
|
|
75
75
|
type: 'Route',
|
|
76
76
|
});
|
|
@@ -1851,6 +1851,7 @@ describe('App embed tests', () => {
|
|
|
1851
1851
|
|
|
1852
1852
|
test('should register event handlers to adjust iframe height', async () => {
|
|
1853
1853
|
let embedHeightCallback: any = () => { };
|
|
1854
|
+
let embedIframeCenterCallback: any = () => { };
|
|
1854
1855
|
const onSpy = jest.spyOn(AppEmbed.prototype, 'on').mockImplementation((event, callback) => {
|
|
1855
1856
|
if (event === EmbedEvent.RouteChange) {
|
|
1856
1857
|
callback({ type: EmbedEvent.RouteChange, data: { currentPath: '/answers' } } as any, jest.fn());
|
|
@@ -1859,11 +1860,10 @@ describe('App embed tests', () => {
|
|
|
1859
1860
|
embedHeightCallback = callback;
|
|
1860
1861
|
}
|
|
1861
1862
|
if (event === EmbedEvent.EmbedIframeCenter) {
|
|
1862
|
-
|
|
1863
|
+
embedIframeCenterCallback = callback;
|
|
1863
1864
|
}
|
|
1864
1865
|
return null;
|
|
1865
1866
|
});
|
|
1866
|
-
jest.spyOn(TsEmbed.prototype as any, 'getIframeCenter').mockReturnValue({});
|
|
1867
1867
|
jest.spyOn(TsEmbed.prototype as any, 'setIFrameHeight').mockReturnValue({});
|
|
1868
1868
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1869
1869
|
...defaultViewConfig,
|
|
@@ -1879,13 +1879,27 @@ describe('App embed tests', () => {
|
|
|
1879
1879
|
await appEmbed.render();
|
|
1880
1880
|
embedHeightCallback({ data: '100%' });
|
|
1881
1881
|
|
|
1882
|
+
// The app only asks for the iframe center once the iframe exists.
|
|
1883
|
+
const centerResponder = jest.fn();
|
|
1884
|
+
embedIframeCenterCallback(
|
|
1885
|
+
{ type: EmbedEvent.EmbedIframeCenter, data: {} } as any,
|
|
1886
|
+
centerResponder,
|
|
1887
|
+
);
|
|
1888
|
+
|
|
1882
1889
|
// Verify event handlers were registered
|
|
1883
1890
|
await executeAfterWait(() => {
|
|
1884
1891
|
expect(onSpy).toHaveBeenCalledWith(EmbedEvent.EmbedHeight, expect.anything());
|
|
1885
1892
|
expect(onSpy).toHaveBeenCalledWith(EmbedEvent.RouteChange, expect.anything());
|
|
1886
1893
|
expect(onSpy).toHaveBeenCalledWith(EmbedEvent.EmbedIframeCenter, expect.anything());
|
|
1887
1894
|
expect(onSpy).toHaveBeenCalledWith(EmbedEvent.RequestVisibleEmbedCoordinates, expect.anything());
|
|
1895
|
+
expect(centerResponder).toHaveBeenCalledWith(
|
|
1896
|
+
expect.objectContaining({ type: EmbedEvent.EmbedIframeCenter }),
|
|
1897
|
+
);
|
|
1888
1898
|
}, 100);
|
|
1899
|
+
|
|
1900
|
+
// This test replaces AppEmbed.prototype.on; restore it so the mock does
|
|
1901
|
+
// not leak into the tests that follow.
|
|
1902
|
+
jest.restoreAllMocks();
|
|
1889
1903
|
});
|
|
1890
1904
|
|
|
1891
1905
|
describe('Navigate to Page API', () => {
|
|
@@ -2130,7 +2144,6 @@ describe('App embed tests', () => {
|
|
|
2130
2144
|
const onSpy = jest.spyOn(AppEmbed.prototype, 'on').mockImplementation((event, callback) => {
|
|
2131
2145
|
return null;
|
|
2132
2146
|
});
|
|
2133
|
-
jest.spyOn(TsEmbed.prototype as any, 'getIframeCenter').mockReturnValue({});
|
|
2134
2147
|
jest.spyOn(TsEmbed.prototype as any, 'setIFrameHeight').mockReturnValue({});
|
|
2135
2148
|
|
|
2136
2149
|
// Create the AppEmbed instance
|
|
@@ -2165,10 +2178,6 @@ describe('App embed tests', () => {
|
|
|
2165
2178
|
fullHeight: true,
|
|
2166
2179
|
} as AppViewConfig);
|
|
2167
2180
|
|
|
2168
|
-
expect((appEmbed as any).viewConfig.lazyLoadingForFullHeight).toBe(true);
|
|
2169
|
-
expect((appEmbed as any).viewConfig.enableScrollableContainerLazyLoading).toBe(true);
|
|
2170
|
-
expect((appEmbed as any).viewConfig.lazyLoadingMargin).toBe('500px 0px');
|
|
2171
|
-
|
|
2172
2181
|
await appEmbed.render();
|
|
2173
2182
|
|
|
2174
2183
|
await executeAfterWait(() => {
|
|
@@ -2184,11 +2193,14 @@ describe('App embed tests', () => {
|
|
|
2184
2193
|
...defaultViewConfig,
|
|
2185
2194
|
} as AppViewConfig);
|
|
2186
2195
|
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2196
|
+
await appEmbed.render();
|
|
2197
|
+
|
|
2198
|
+
await executeAfterWait(() => {
|
|
2199
|
+
const iframeSrc = getIFrameSrc();
|
|
2200
|
+
expect(iframeSrc).not.toContain('isFullHeightPinboard');
|
|
2201
|
+
expect(iframeSrc).not.toContain('isLazyLoadingForEmbedEnabled');
|
|
2202
|
+
expect(iframeSrc).not.toContain('rootMarginForLazyLoad');
|
|
2203
|
+
}, 100);
|
|
2192
2204
|
});
|
|
2193
2205
|
|
|
2194
2206
|
test('should not write the defaults back onto the caller view config', async () => {
|
|
@@ -2210,11 +2222,14 @@ describe('App embed tests', () => {
|
|
|
2210
2222
|
fullHeight: false,
|
|
2211
2223
|
} as AppViewConfig);
|
|
2212
2224
|
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2225
|
+
await appEmbed.render();
|
|
2226
|
+
|
|
2227
|
+
await executeAfterWait(() => {
|
|
2228
|
+
const iframeSrc = getIFrameSrc();
|
|
2229
|
+
expect(iframeSrc).not.toContain('isFullHeightPinboard');
|
|
2230
|
+
expect(iframeSrc).not.toContain('isLazyLoadingForEmbedEnabled');
|
|
2231
|
+
expect(iframeSrc).not.toContain('rootMarginForLazyLoad');
|
|
2232
|
+
}, 100);
|
|
2218
2233
|
});
|
|
2219
2234
|
|
|
2220
2235
|
test('should default lazyLoadingMargin when lazyLoadingForFullHeight is set explicitly', async () => {
|
|
@@ -2224,14 +2239,14 @@ describe('App embed tests', () => {
|
|
|
2224
2239
|
lazyLoadingForFullHeight: true,
|
|
2225
2240
|
} as AppViewConfig);
|
|
2226
2241
|
|
|
2227
|
-
expect((appEmbed as any).viewConfig.lazyLoadingMargin).toBe(
|
|
2228
|
-
config.DEFAULT_LAZY_LOADING_MARGIN,
|
|
2229
|
-
);
|
|
2230
|
-
|
|
2231
2242
|
await appEmbed.render();
|
|
2232
2243
|
|
|
2233
2244
|
await executeAfterWait(() => {
|
|
2234
|
-
expect(getIFrameSrc()).toContain(
|
|
2245
|
+
expect(getIFrameSrc()).toContain(
|
|
2246
|
+
`rootMarginForLazyLoad=${encodeURIComponent(
|
|
2247
|
+
config.DEFAULT_LAZY_LOADING_MARGIN,
|
|
2248
|
+
)}`,
|
|
2249
|
+
);
|
|
2235
2250
|
}, 100);
|
|
2236
2251
|
});
|
|
2237
2252
|
|
|
@@ -2455,7 +2470,7 @@ describe('App embed tests', () => {
|
|
|
2455
2470
|
await appEmbed.render();
|
|
2456
2471
|
|
|
2457
2472
|
// Trigger the lazy load data calculation
|
|
2458
|
-
(appEmbed as any).
|
|
2473
|
+
(appEmbed as any).fullHeightController.sendVisibleCoordinates();
|
|
2459
2474
|
|
|
2460
2475
|
expect(mockTrigger).toHaveBeenCalledWith(HostEvent.VisibleEmbedCoordinates, {
|
|
2461
2476
|
top: 0,
|
|
@@ -2477,7 +2492,7 @@ describe('App embed tests', () => {
|
|
|
2477
2492
|
await appEmbed.render();
|
|
2478
2493
|
|
|
2479
2494
|
// Trigger the lazy load data calculation
|
|
2480
|
-
(appEmbed as any).
|
|
2495
|
+
(appEmbed as any).fullHeightController.sendVisibleCoordinates();
|
|
2481
2496
|
|
|
2482
2497
|
expect(mockTrigger).not.toHaveBeenCalledWith(HostEvent.VisibleEmbedCoordinates, {
|
|
2483
2498
|
top: 0,
|
|
@@ -2510,7 +2525,7 @@ describe('App embed tests', () => {
|
|
|
2510
2525
|
await appEmbed.render();
|
|
2511
2526
|
|
|
2512
2527
|
// Trigger the lazy load data calculation
|
|
2513
|
-
(appEmbed as any).
|
|
2528
|
+
(appEmbed as any).fullHeightController.sendVisibleCoordinates();
|
|
2514
2529
|
|
|
2515
2530
|
expect(mockTrigger).toHaveBeenCalledWith(HostEvent.VisibleEmbedCoordinates, {
|
|
2516
2531
|
top: 50, // 50px clipped from top
|
|
@@ -2618,7 +2633,7 @@ describe('App embed tests', () => {
|
|
|
2618
2633
|
const mockResponder = jest.fn();
|
|
2619
2634
|
|
|
2620
2635
|
// Trigger the handler directly
|
|
2621
|
-
(appEmbed as any).
|
|
2636
|
+
(appEmbed as any).fullHeightController.handleRequestVisibleCoordinates({}, mockResponder);
|
|
2622
2637
|
|
|
2623
2638
|
// Verify the responder was called with the correct data
|
|
2624
2639
|
expect(mockResponder).toHaveBeenCalledWith({
|
|
@@ -2676,7 +2691,7 @@ describe('App embed tests', () => {
|
|
|
2676
2691
|
data: 600,
|
|
2677
2692
|
type: EmbedEvent.EmbedHeight,
|
|
2678
2693
|
};
|
|
2679
|
-
appEmbed.
|
|
2694
|
+
appEmbed.fullHeightController.handleEmbedHeight(mockEvent);
|
|
2680
2695
|
|
|
2681
2696
|
// Check if the iframe style was updated
|
|
2682
2697
|
expect(mockIFrame.style.height).toBe('600px');
|
|
@@ -2697,7 +2712,7 @@ describe('App embed tests', () => {
|
|
|
2697
2712
|
data: 0, // This will make it use the default height
|
|
2698
2713
|
type: EmbedEvent.EmbedHeight,
|
|
2699
2714
|
};
|
|
2700
|
-
appEmbed.
|
|
2715
|
+
appEmbed.fullHeightController.handleEmbedHeight(mockEvent);
|
|
2701
2716
|
|
|
2702
2717
|
// Should use the default height
|
|
2703
2718
|
expect(mockIFrame.style.height).toBe('500px');
|
|
@@ -2712,7 +2727,7 @@ describe('App Embed Default Height and Minimum Height Handling', () => {
|
|
|
2712
2727
|
fullHeight: true,
|
|
2713
2728
|
} as AppViewConfig);
|
|
2714
2729
|
await appEmbed.render();
|
|
2715
|
-
expect(appEmbed['
|
|
2730
|
+
expect(appEmbed['fullHeightController'].minimumHeight).toBe(500);
|
|
2716
2731
|
});
|
|
2717
2732
|
test('should set default height to 700 when default height is provided', async () => {
|
|
2718
2733
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
@@ -2721,7 +2736,7 @@ describe('App Embed Default Height and Minimum Height Handling', () => {
|
|
|
2721
2736
|
minimumHeight: 700,
|
|
2722
2737
|
} as AppViewConfig);
|
|
2723
2738
|
await appEmbed.render();
|
|
2724
|
-
expect(appEmbed['
|
|
2739
|
+
expect(appEmbed['fullHeightController'].minimumHeight).toBe(700);
|
|
2725
2740
|
});
|
|
2726
2741
|
});
|
|
2727
2742
|
|
|
@@ -2756,6 +2771,43 @@ describe('AppEmbed uncovered branch tests', () => {
|
|
|
2756
2771
|
});
|
|
2757
2772
|
});
|
|
2758
2773
|
|
|
2774
|
+
test('should set showAnswerEditPanel=false when hideAnswerEditPanel is true', async () => {
|
|
2775
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2776
|
+
...defaultViewConfig,
|
|
2777
|
+
hideAnswerEditPanel: true,
|
|
2778
|
+
} as AppViewConfig);
|
|
2779
|
+
appEmbed.render();
|
|
2780
|
+
await executeAfterWait(() => {
|
|
2781
|
+
expectUrlToHaveParamsWithValues(getIFrameSrc(), {
|
|
2782
|
+
showAnswerEditPanel: 'false',
|
|
2783
|
+
});
|
|
2784
|
+
});
|
|
2785
|
+
});
|
|
2786
|
+
|
|
2787
|
+
test('should set showAnswerEditPanel=true when hideAnswerEditPanel is false', async () => {
|
|
2788
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2789
|
+
...defaultViewConfig,
|
|
2790
|
+
hideAnswerEditPanel: false,
|
|
2791
|
+
} as AppViewConfig);
|
|
2792
|
+
appEmbed.render();
|
|
2793
|
+
await executeAfterWait(() => {
|
|
2794
|
+
expectUrlToHaveParamsWithValues(getIFrameSrc(), {
|
|
2795
|
+
showAnswerEditPanel: 'true',
|
|
2796
|
+
});
|
|
2797
|
+
});
|
|
2798
|
+
});
|
|
2799
|
+
|
|
2800
|
+
test('should not set showAnswerEditPanel param when hideAnswerEditPanel is not provided', async () => {
|
|
2801
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2802
|
+
...defaultViewConfig,
|
|
2803
|
+
} as AppViewConfig);
|
|
2804
|
+
appEmbed.render();
|
|
2805
|
+
await executeAfterWait(() => {
|
|
2806
|
+
const url = new URL(getIFrameSrc());
|
|
2807
|
+
expect(url.searchParams.has('showAnswerEditPanel')).toBe(false);
|
|
2808
|
+
});
|
|
2809
|
+
});
|
|
2810
|
+
|
|
2759
2811
|
test('should set hideObjects param when non-empty array is provided', async () => {
|
|
2760
2812
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2761
2813
|
...defaultViewConfig,
|
|
@@ -2807,7 +2859,7 @@ describe('AppEmbed uncovered branch tests', () => {
|
|
|
2807
2859
|
});
|
|
2808
2860
|
});
|
|
2809
2861
|
|
|
2810
|
-
test('
|
|
2862
|
+
test('lazy load registration should return early when iFrame is not set', () => {
|
|
2811
2863
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2812
2864
|
...defaultViewConfig,
|
|
2813
2865
|
fullHeight: true,
|
|
@@ -2815,7 +2867,7 @@ describe('AppEmbed uncovered branch tests', () => {
|
|
|
2815
2867
|
} as AppViewConfig);
|
|
2816
2868
|
// iFrame is not set (render not called), should not throw
|
|
2817
2869
|
expect(() => {
|
|
2818
|
-
(appEmbed as any).
|
|
2870
|
+
(appEmbed as any).fullHeightController.onRender();
|
|
2819
2871
|
}).not.toThrow();
|
|
2820
2872
|
});
|
|
2821
2873
|
});
|