@thoughtspot/visual-embed-sdk 1.39.1 → 1.39.2-alpha.2

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.
Files changed (190) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/config.spec.js +9 -0
  3. package/cjs/src/config.spec.js.map +1 -1
  4. package/cjs/src/embed/app.d.ts +75 -15
  5. package/cjs/src/embed/app.d.ts.map +1 -1
  6. package/cjs/src/embed/app.js +69 -9
  7. package/cjs/src/embed/app.js.map +1 -1
  8. package/cjs/src/embed/app.spec.js +374 -12
  9. package/cjs/src/embed/app.spec.js.map +1 -1
  10. package/cjs/src/embed/bodyless-conversation.d.ts +19 -7
  11. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  12. package/cjs/src/embed/bodyless-conversation.js +24 -4
  13. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  14. package/cjs/src/embed/bodyless-conversation.spec.js +8 -190
  15. package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
  16. package/cjs/src/embed/conversation.spec.js +28 -0
  17. package/cjs/src/embed/conversation.spec.js.map +1 -1
  18. package/cjs/src/embed/embedConfig.d.ts +9 -7
  19. package/cjs/src/embed/embedConfig.d.ts.map +1 -1
  20. package/cjs/src/embed/embedConfig.js +9 -7
  21. package/cjs/src/embed/embedConfig.js.map +1 -1
  22. package/cjs/src/embed/liveboard.d.ts +56 -17
  23. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  24. package/cjs/src/embed/liveboard.js +48 -4
  25. package/cjs/src/embed/liveboard.js.map +1 -1
  26. package/cjs/src/embed/liveboard.spec.js +215 -11
  27. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  28. package/cjs/src/embed/ts-embed.d.ts +5 -0
  29. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  30. package/cjs/src/embed/ts-embed.js +16 -1
  31. package/cjs/src/embed/ts-embed.js.map +1 -1
  32. package/cjs/src/embed/ts-embed.spec.js +164 -0
  33. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  34. package/cjs/src/errors.d.ts +1 -0
  35. package/cjs/src/errors.d.ts.map +1 -1
  36. package/cjs/src/errors.js +1 -0
  37. package/cjs/src/errors.js.map +1 -1
  38. package/cjs/src/index.d.ts +2 -2
  39. package/cjs/src/index.d.ts.map +1 -1
  40. package/cjs/src/index.js +2 -1
  41. package/cjs/src/index.js.map +1 -1
  42. package/cjs/src/react/all-types-export.d.ts +1 -1
  43. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  44. package/cjs/src/react/all-types-export.js +3 -2
  45. package/cjs/src/react/all-types-export.js.map +1 -1
  46. package/cjs/src/react/index.d.ts +71 -20
  47. package/cjs/src/react/index.d.ts.map +1 -1
  48. package/cjs/src/react/index.js +79 -42
  49. package/cjs/src/react/index.js.map +1 -1
  50. package/cjs/src/react/index.spec.js +436 -100
  51. package/cjs/src/react/index.spec.js.map +1 -1
  52. package/cjs/src/types.d.ts +80 -6
  53. package/cjs/src/types.d.ts.map +1 -1
  54. package/cjs/src/types.js +45 -1
  55. package/cjs/src/types.js.map +1 -1
  56. package/cjs/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  57. package/cjs/src/utils/graphql/nlsService/conversation-service.js +2 -0
  58. package/cjs/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  59. package/cjs/src/utils/processTrigger.js +2 -1
  60. package/cjs/src/utils/processTrigger.js.map +1 -1
  61. package/cjs/src/utils.d.ts +6 -0
  62. package/cjs/src/utils.d.ts.map +1 -1
  63. package/cjs/src/utils.js +23 -3
  64. package/cjs/src/utils.js.map +1 -1
  65. package/cjs/src/utils.spec.js +237 -1
  66. package/cjs/src/utils.spec.js.map +1 -1
  67. package/dist/{index-JaFaxrvQ.js → index-CmEQfuE3.js} +1 -1
  68. package/dist/index-DeFzsyFF.js +7371 -0
  69. package/dist/index-Dpf0rd6w.js +7371 -0
  70. package/dist/index-UuEbsISo.js +7447 -0
  71. package/dist/index-e3Uw3YFO.js +7371 -0
  72. package/dist/src/embed/app.d.ts +75 -15
  73. package/dist/src/embed/app.d.ts.map +1 -1
  74. package/dist/src/embed/bodyless-conversation.d.ts +19 -7
  75. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  76. package/dist/src/embed/embedConfig.d.ts +9 -7
  77. package/dist/src/embed/embedConfig.d.ts.map +1 -1
  78. package/dist/src/embed/liveboard.d.ts +56 -17
  79. package/dist/src/embed/liveboard.d.ts.map +1 -1
  80. package/dist/src/embed/ts-embed.d.ts +5 -0
  81. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  82. package/dist/src/errors.d.ts +1 -0
  83. package/dist/src/errors.d.ts.map +1 -1
  84. package/dist/src/index.d.ts +2 -2
  85. package/dist/src/index.d.ts.map +1 -1
  86. package/dist/src/react/all-types-export.d.ts +1 -1
  87. package/dist/src/react/all-types-export.d.ts.map +1 -1
  88. package/dist/src/react/index.d.ts +71 -20
  89. package/dist/src/react/index.d.ts.map +1 -1
  90. package/dist/src/types.d.ts +80 -6
  91. package/dist/src/types.d.ts.map +1 -1
  92. package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  93. package/dist/src/utils.d.ts +6 -0
  94. package/dist/src/utils.d.ts.map +1 -1
  95. package/dist/tsembed-react.es.js +320 -78
  96. package/dist/tsembed-react.js +320 -76
  97. package/dist/tsembed.es.js +238 -31
  98. package/dist/tsembed.js +236 -29
  99. package/dist/visual-embed-sdk-react-full.d.ts +288 -72
  100. package/dist/visual-embed-sdk-react.d.ts +288 -72
  101. package/dist/visual-embed-sdk.d.ts +218 -53
  102. package/lib/package.json +1 -1
  103. package/lib/src/config.spec.js +9 -0
  104. package/lib/src/config.spec.js.map +1 -1
  105. package/lib/src/embed/app.d.ts +75 -15
  106. package/lib/src/embed/app.d.ts.map +1 -1
  107. package/lib/src/embed/app.js +69 -9
  108. package/lib/src/embed/app.js.map +1 -1
  109. package/lib/src/embed/app.spec.js +376 -14
  110. package/lib/src/embed/app.spec.js.map +1 -1
  111. package/lib/src/embed/bodyless-conversation.d.ts +19 -7
  112. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  113. package/lib/src/embed/bodyless-conversation.js +23 -4
  114. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  115. package/lib/src/embed/bodyless-conversation.spec.js +9 -191
  116. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  117. package/lib/src/embed/conversation.spec.js +30 -2
  118. package/lib/src/embed/conversation.spec.js.map +1 -1
  119. package/lib/src/embed/embedConfig.d.ts +9 -7
  120. package/lib/src/embed/embedConfig.d.ts.map +1 -1
  121. package/lib/src/embed/embedConfig.js +9 -7
  122. package/lib/src/embed/embedConfig.js.map +1 -1
  123. package/lib/src/embed/liveboard.d.ts +56 -17
  124. package/lib/src/embed/liveboard.d.ts.map +1 -1
  125. package/lib/src/embed/liveboard.js +49 -5
  126. package/lib/src/embed/liveboard.js.map +1 -1
  127. package/lib/src/embed/liveboard.spec.js +215 -11
  128. package/lib/src/embed/liveboard.spec.js.map +1 -1
  129. package/lib/src/embed/ts-embed.d.ts +5 -0
  130. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  131. package/lib/src/embed/ts-embed.js +16 -1
  132. package/lib/src/embed/ts-embed.js.map +1 -1
  133. package/lib/src/embed/ts-embed.spec.js +164 -0
  134. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  135. package/lib/src/errors.d.ts +1 -0
  136. package/lib/src/errors.d.ts.map +1 -1
  137. package/lib/src/errors.js +1 -0
  138. package/lib/src/errors.js.map +1 -1
  139. package/lib/src/index.d.ts +2 -2
  140. package/lib/src/index.d.ts.map +1 -1
  141. package/lib/src/index.js +2 -2
  142. package/lib/src/index.js.map +1 -1
  143. package/lib/src/react/all-types-export.d.ts +1 -1
  144. package/lib/src/react/all-types-export.d.ts.map +1 -1
  145. package/lib/src/react/all-types-export.js +1 -1
  146. package/lib/src/react/all-types-export.js.map +1 -1
  147. package/lib/src/react/index.d.ts +71 -20
  148. package/lib/src/react/index.d.ts.map +1 -1
  149. package/lib/src/react/index.js +79 -43
  150. package/lib/src/react/index.js.map +1 -1
  151. package/lib/src/react/index.spec.js +439 -103
  152. package/lib/src/react/index.spec.js.map +1 -1
  153. package/lib/src/types.d.ts +80 -6
  154. package/lib/src/types.d.ts.map +1 -1
  155. package/lib/src/types.js +45 -1
  156. package/lib/src/types.js.map +1 -1
  157. package/lib/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  158. package/lib/src/utils/graphql/nlsService/conversation-service.js +2 -0
  159. package/lib/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  160. package/lib/src/utils/processTrigger.js +2 -1
  161. package/lib/src/utils/processTrigger.js.map +1 -1
  162. package/lib/src/utils.d.ts +6 -0
  163. package/lib/src/utils.d.ts.map +1 -1
  164. package/lib/src/utils.js +21 -2
  165. package/lib/src/utils.js.map +1 -1
  166. package/lib/src/utils.spec.js +238 -2
  167. package/lib/src/utils.spec.js.map +1 -1
  168. package/lib/src/visual-embed-sdk.d.ts +219 -54
  169. package/package.json +1 -1
  170. package/src/config.spec.ts +11 -0
  171. package/src/embed/app.spec.ts +479 -26
  172. package/src/embed/app.ts +133 -27
  173. package/src/embed/bodyless-conversation.spec.ts +9 -203
  174. package/src/embed/bodyless-conversation.ts +24 -10
  175. package/src/embed/conversation.spec.ts +40 -2
  176. package/src/embed/embedConfig.ts +10 -8
  177. package/src/embed/liveboard.spec.ts +256 -5
  178. package/src/embed/liveboard.ts +99 -27
  179. package/src/embed/ts-embed.spec.ts +225 -0
  180. package/src/embed/ts-embed.ts +19 -0
  181. package/src/errors.ts +1 -0
  182. package/src/index.ts +2 -0
  183. package/src/react/all-types-export.ts +2 -1
  184. package/src/react/index.spec.tsx +556 -157
  185. package/src/react/index.tsx +117 -51
  186. package/src/types.ts +117 -43
  187. package/src/utils/graphql/nlsService/conversation-service.ts +2 -0
  188. package/src/utils/processTrigger.ts +1 -1
  189. package/src/utils.spec.ts +279 -2
  190. package/src/utils.ts +28 -2
@@ -8,13 +8,12 @@
8
8
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
9
9
  */
10
10
  import { logger } from '../utils/logger';
11
- import { getQueryParamString } from '../utils';
11
+ import { calculateVisibleElementData, getQueryParamString } from '../utils';
12
12
  import { Param, HostEvent, EmbedEvent, } from '../types';
13
13
  import { V1Embed } from './ts-embed';
14
14
  /**
15
15
  * Pages within the ThoughtSpot app that can be embedded.
16
16
  */
17
- // eslint-disable-next-line no-shadow
18
17
  export var Page;
19
18
  (function (Page) {
20
19
  /**
@@ -100,16 +99,46 @@ export var HomePage;
100
99
  */
101
100
  HomePage["Modular"] = "v2";
102
101
  })(HomePage || (HomePage = {}));
102
+ /**
103
+ * Define the version of the list page
104
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
105
+ */
106
+ export var ListPage;
107
+ (function (ListPage) {
108
+ /**
109
+ * List (v2) is the traditional List Experience.
110
+ * It serves as the foundational version of the list page.
111
+ */
112
+ ListPage["List"] = "v2";
113
+ /**
114
+ * ListWithUXChanges (v3) introduces the new updated list page with UX changes.
115
+ */
116
+ ListPage["ListWithUXChanges"] = "v3";
117
+ })(ListPage || (ListPage = {}));
103
118
  /**
104
119
  * Embeds full ThoughtSpot experience in a host application.
105
120
  * @group Embed components
106
121
  */
107
122
  export class AppEmbed extends V1Embed {
108
- // eslint-disable-next-line no-useless-constructor
109
123
  constructor(domSelector, viewConfig) {
110
124
  viewConfig.embedComponentType = 'AppEmbed';
111
125
  super(domSelector, viewConfig);
112
126
  this.defaultHeight = '100%';
127
+ this.sendFullHeightLazyLoadData = () => {
128
+ const data = calculateVisibleElementData(this.iFrame);
129
+ this.trigger(HostEvent.VisibleEmbedCoordinates, data);
130
+ };
131
+ /**
132
+ * This is a handler for the RequestVisibleEmbedCoordinates event.
133
+ * It is used to send the visible coordinates data to the host application.
134
+ * @param data The event payload
135
+ * @param responder The responder function
136
+ */
137
+ this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
138
+ logger.info('Sending RequestVisibleEmbedCoordinates', data);
139
+ const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
140
+ responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
141
+ };
113
142
  /**
114
143
  * Set the iframe height as per the computed height received
115
144
  * from the ThoughtSpot app.
@@ -118,6 +147,7 @@ export class AppEmbed extends V1Embed {
118
147
  this.updateIFrameHeight = (data) => {
119
148
  var _a;
120
149
  this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
150
+ this.sendFullHeightLazyLoadData();
121
151
  };
122
152
  this.embedIframeCenter = (data, responder) => {
123
153
  const obj = this.getIframeCenter();
@@ -147,6 +177,7 @@ export class AppEmbed extends V1Embed {
147
177
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
148
178
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
149
179
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
180
+ this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
150
181
  }
151
182
  }
152
183
  /**
@@ -154,9 +185,7 @@ export class AppEmbed extends V1Embed {
154
185
  * embedded Liveboard or visualization.
155
186
  */
156
187
  getEmbedParams() {
157
- const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
158
- /* eslint-disable-next-line max-len */
159
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
188
+ const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
160
189
  let params = {};
161
190
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
162
191
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -172,6 +201,7 @@ export class AppEmbed extends V1Embed {
172
201
  params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
173
202
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
174
203
  params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
204
+ params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
175
205
  params = this.getBaseQueryParams(params);
176
206
  if (hideObjectSearch) {
177
207
  params[Param.HideObjectSearch] = !!hideObjectSearch;
@@ -184,6 +214,10 @@ export class AppEmbed extends V1Embed {
184
214
  }
185
215
  if (fullHeight === true) {
186
216
  params[Param.fullHeight] = true;
217
+ if (this.viewConfig.lazyLoadingForFullHeight) {
218
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
219
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
220
+ }
187
221
  }
188
222
  if (tag) {
189
223
  params[Param.Tag] = tag;
@@ -204,7 +238,6 @@ export class AppEmbed extends V1Embed {
204
238
  params[Param.enableAskSage] = enableAskSage;
205
239
  }
206
240
  if (isOnBeforeGetVizDataInterceptEnabled) {
207
- /* eslint-disable-next-line max-len */
208
241
  params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
209
242
  }
210
243
  if (homePageSearchBarMode) {
@@ -225,11 +258,9 @@ export class AppEmbed extends V1Embed {
225
258
  === DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
226
259
  || dataPanelCustomGroupsAccordionInitialState
227
260
  === DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
228
- /* eslint-disable-next-line max-len */
229
261
  params[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
230
262
  }
231
263
  else {
232
- /* eslint-disable-next-line max-len */
233
264
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
234
265
  }
235
266
  if (discoveryExperience) {
@@ -242,6 +273,10 @@ export class AppEmbed extends V1Embed {
242
273
  if (discoveryExperience.homePage === HomePage.Modular) {
243
274
  params[Param.ModularHomeExperienceEnabled] = true;
244
275
  }
276
+ // listPageVersion v3 will enable the new list page
277
+ if (discoveryExperience.listPageVersion === ListPage.ListWithUXChanges) {
278
+ params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
279
+ }
245
280
  }
246
281
  const queryParams = getQueryParamString(params, true);
247
282
  return queryParams;
@@ -329,6 +364,30 @@ export class AppEmbed extends V1Embed {
329
364
  this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
330
365
  }
331
366
  }
367
+ /**
368
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
369
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
370
+ */
371
+ destroy() {
372
+ super.destroy();
373
+ this.unregisterLazyLoadEvents();
374
+ }
375
+ postRender() {
376
+ this.registerLazyLoadEvents();
377
+ }
378
+ registerLazyLoadEvents() {
379
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
380
+ // TODO: Use passive: true, install modernizr to check for passive
381
+ window.addEventListener('resize', this.sendFullHeightLazyLoadData);
382
+ window.addEventListener('scroll', this.sendFullHeightLazyLoadData);
383
+ }
384
+ }
385
+ unregisterLazyLoadEvents() {
386
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
387
+ window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
388
+ window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
389
+ }
390
+ }
332
391
  /**
333
392
  * Renders the embedded application pages in the ThoughtSpot app.
334
393
  * @param renderOptions An object containing the page ID
@@ -338,6 +397,7 @@ export class AppEmbed extends V1Embed {
338
397
  await super.render();
339
398
  const src = this.getIFrameSrc();
340
399
  await this.renderV1Embed(src);
400
+ this.postRender();
341
401
  return this;
342
402
  }
343
403
  }
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/embed/app.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EACH,KAAK,EAEL,SAAS,EACT,UAAU,GAGb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE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I,CAAC,UAAU,CAAC,wBAAwB,EAAE;YACxE,kEAAkE;YAClE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,0BAA0B,CAAC,CAAC;YACnE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,0BAA0B,CAAC,CAAC;SACtE;IACL,CAAC;IAEO,wBAAwB;QAC5B,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,wBAAwB,EAAE;YACxE,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,0BAA0B,CAAC,CAAC;YACtE,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,0BAA0B,CAAC,CAAC;SACzE;IACL,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,MAAM;QACf,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC;QAErB,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAE9B,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
@@ -1,6 +1,6 @@
1
- import { AppEmbed, DataPanelCustomColumnGroupsAccordionState, Page, HomePageSearchBarMode, PrimaryNavbarVersion, HomePage, } from './app';
1
+ import { AppEmbed, DataPanelCustomColumnGroupsAccordionState, Page, HomePageSearchBarMode, PrimaryNavbarVersion, HomePage, ListPage, } from './app';
2
2
  import { init } from '../index';
3
- import { Action, AuthType, EmbedEvent, HostEvent, RuntimeFilterOp, } from '../types';
3
+ import { Action, AuthType, EmbedEvent, HostEvent, RuntimeFilterOp } from '../types';
4
4
  import { executeAfterWait, getDocumentBody, getIFrameSrc, getRootEl, getIFrameEl, mockMessageChannel, defaultParams, defaultParamsForPinboardEmbed, defaultParamsWithoutHiddenActions, expectUrlMatchesWithParams, } from '../test/test-utils';
5
5
  import * as config from '../config';
6
6
  import { TsEmbed } from './ts-embed';
@@ -21,12 +21,13 @@ beforeAll(() => {
21
21
  authType: AuthType.None,
22
22
  });
23
23
  jest.spyOn(auth, 'postLoginService').mockImplementation(() => Promise.resolve({}));
24
- window.ResizeObserver = window.ResizeObserver
25
- || jest.fn().mockImplementation(() => ({
26
- disconnect: jest.fn(),
27
- observe: jest.fn(),
28
- unobserve: jest.fn(),
29
- }));
24
+ window.ResizeObserver =
25
+ window.ResizeObserver ||
26
+ jest.fn().mockImplementation(() => ({
27
+ disconnect: jest.fn(),
28
+ observe: jest.fn(),
29
+ unobserve: jest.fn(),
30
+ }));
30
31
  });
31
32
  const cleanUp = () => {
32
33
  document.body.innerHTML = getDocumentBody();
@@ -226,6 +227,16 @@ describe('App embed tests', () => {
226
227
  expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true${defaultParamsPost}#/home`);
227
228
  });
228
229
  });
230
+ test('should set coverAndFilterOptionInPDF to false in url', async () => {
231
+ const appEmbed = new AppEmbed(getRootEl(), {
232
+ ...defaultViewConfig,
233
+ coverAndFilterOptionInPDF: false,
234
+ });
235
+ appEmbed.render();
236
+ await executeAfterWait(() => {
237
+ expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&arePdfCoverFilterPageCheckboxesEnabled=false${defaultParamsPost}#/home`);
238
+ });
239
+ });
229
240
  test('should set isLiveboardStylingAndGroupingEnabled to true in url', async () => {
230
241
  const appEmbed = new AppEmbed(getRootEl(), {
231
242
  ...defaultViewConfig,
@@ -427,6 +438,44 @@ describe('App embed tests', () => {
427
438
  expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&enableAskSage=true${defaultParams}${defaultParamsPost}#/home`);
428
439
  });
429
440
  });
441
+ test('Should add listpageVersion=v3 when listPageVersion is ListWithUXChanges to the iframe src', async () => {
442
+ const appEmbed = new AppEmbed(getRootEl(), {
443
+ ...defaultViewConfig,
444
+ discoveryExperience: {
445
+ listPageVersion: ListPage.ListWithUXChanges,
446
+ },
447
+ });
448
+ appEmbed.render();
449
+ await executeAfterWait(() => {
450
+ expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&listpageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
451
+ });
452
+ });
453
+ test('Should not add listpageVersion when listPageVersion is List (v2) to the iframe src', async () => {
454
+ const appEmbed = new AppEmbed(getRootEl(), {
455
+ ...defaultViewConfig,
456
+ discoveryExperience: {
457
+ listPageVersion: ListPage.List,
458
+ },
459
+ });
460
+ appEmbed.render();
461
+ await executeAfterWait(() => {
462
+ expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false${defaultParams}${defaultParamsPost}#/home`);
463
+ });
464
+ });
465
+ test('Should add listpageVersion=v3 combined with other discoveryExperience options to the iframe src', async () => {
466
+ const appEmbed = new AppEmbed(getRootEl(), {
467
+ ...defaultViewConfig,
468
+ discoveryExperience: {
469
+ primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
470
+ homePage: HomePage.Modular,
471
+ listPageVersion: ListPage.ListWithUXChanges,
472
+ },
473
+ });
474
+ appEmbed.render();
475
+ await executeAfterWait(() => {
476
+ expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&listpageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
477
+ });
478
+ });
430
479
  test('Should add enablePendoHelp flag to the iframe src conditional on navbar', async () => {
431
480
  const appEmbed = new AppEmbed(getRootEl(), {
432
481
  ...defaultViewConfig,
@@ -486,13 +535,13 @@ describe('App embed tests', () => {
486
535
  });
487
536
  });
488
537
  test('should register event handlers to adjust iframe height', async () => {
489
- const onSpy = jest.spyOn(AppEmbed.prototype, 'on')
490
- .mockImplementation((event, callback) => {
538
+ let embedHeightCallback = () => { };
539
+ const onSpy = jest.spyOn(AppEmbed.prototype, 'on').mockImplementation((event, callback) => {
491
540
  if (event === EmbedEvent.RouteChange) {
492
541
  callback({ data: { currentPath: '/answers' } }, jest.fn());
493
542
  }
494
543
  if (event === EmbedEvent.EmbedHeight) {
495
- callback({ data: '100%' });
544
+ embedHeightCallback = callback;
496
545
  }
497
546
  if (event === EmbedEvent.EmbedIframeCenter) {
498
547
  callback({}, jest.fn());
@@ -504,14 +553,20 @@ describe('App embed tests', () => {
504
553
  const appEmbed = new AppEmbed(getRootEl(), {
505
554
  ...defaultViewConfig,
506
555
  fullHeight: true,
556
+ lazyLoadingForFullHeight: true,
507
557
  });
508
- appEmbed.render();
558
+ // Set the iframe before render
559
+ appEmbed.iFrame = document.createElement('iframe');
560
+ // Wait for render to complete
561
+ await appEmbed.render();
562
+ embedHeightCallback({ data: '100%' });
563
+ // Verify event handlers were registered
509
564
  await executeAfterWait(() => {
510
565
  expect(onSpy).toHaveBeenCalledWith(EmbedEvent.EmbedHeight, expect.anything());
511
566
  expect(onSpy).toHaveBeenCalledWith(EmbedEvent.RouteChange, expect.anything());
512
567
  expect(onSpy).toHaveBeenCalledWith(EmbedEvent.EmbedIframeCenter, expect.anything());
513
- });
514
- jest.clearAllMocks();
568
+ expect(onSpy).toHaveBeenCalledWith(EmbedEvent.RequestVisibleEmbedCoordinates, expect.anything());
569
+ }, 100);
515
570
  });
516
571
  describe('Navigate to Page API', () => {
517
572
  const path = 'pinboard/e0836cad-4fdf-42d4-bd97-567a6b2a6058';
@@ -576,5 +631,312 @@ describe('App embed tests', () => {
576
631
  expect(logger.log).toHaveBeenCalledWith('Please call render before invoking this method');
577
632
  });
578
633
  });
634
+ describe('LazyLoadingForFullHeight functionality', () => {
635
+ let mockIFrame;
636
+ beforeEach(() => {
637
+ mockIFrame = document.createElement('iframe');
638
+ mockIFrame.getBoundingClientRect = jest.fn().mockReturnValue({
639
+ top: 100,
640
+ left: 150,
641
+ bottom: 600,
642
+ right: 800,
643
+ width: 650,
644
+ height: 500,
645
+ });
646
+ jest.spyOn(document, 'createElement').mockImplementation((tagName) => {
647
+ if (tagName === 'iframe') {
648
+ return mockIFrame;
649
+ }
650
+ return document.createElement(tagName);
651
+ });
652
+ });
653
+ afterEach(() => {
654
+ jest.restoreAllMocks();
655
+ });
656
+ test('should set lazyLoadingMargin parameter when provided', async () => {
657
+ const appEmbed = new AppEmbed(getRootEl(), {
658
+ ...defaultViewConfig,
659
+ fullHeight: true,
660
+ lazyLoadingForFullHeight: true,
661
+ lazyLoadingMargin: '100px 0px',
662
+ });
663
+ await appEmbed.render();
664
+ await executeAfterWait(() => {
665
+ const iframeSrc = getIFrameSrc();
666
+ expect(iframeSrc).toContain('isLazyLoadingForEmbedEnabled=true');
667
+ expect(iframeSrc).toContain('isFullHeightPinboard=true');
668
+ expect(iframeSrc).toContain('rootMarginForLazyLoad=100px%200px');
669
+ }, 100);
670
+ });
671
+ test('should set isLazyLoadingForEmbedEnabled=true when both fullHeight and lazyLoadingForFullHeight are enabled', async () => {
672
+ // Mock the iframe element first
673
+ mockIFrame.getBoundingClientRect = jest.fn().mockReturnValue({
674
+ top: 100,
675
+ left: 150,
676
+ bottom: 600,
677
+ right: 800,
678
+ width: 650,
679
+ height: 500,
680
+ });
681
+ Object.defineProperty(mockIFrame, 'scrollHeight', { value: 500 });
682
+ // Mock the event handlers
683
+ const onSpy = jest.spyOn(AppEmbed.prototype, 'on').mockImplementation((event, callback) => {
684
+ return null;
685
+ });
686
+ jest.spyOn(TsEmbed.prototype, 'getIframeCenter').mockReturnValue({});
687
+ jest.spyOn(TsEmbed.prototype, 'setIFrameHeight').mockReturnValue({});
688
+ // Create the AppEmbed instance
689
+ const appEmbed = new AppEmbed(getRootEl(), {
690
+ ...defaultViewConfig,
691
+ fullHeight: true,
692
+ lazyLoadingForFullHeight: true,
693
+ });
694
+ // Set the iframe before render
695
+ appEmbed.iFrame = mockIFrame;
696
+ // Add the iframe to the DOM
697
+ const rootEl = getRootEl();
698
+ rootEl.appendChild(mockIFrame);
699
+ // Wait for render to complete
700
+ await appEmbed.render();
701
+ // Wait for iframe initialization and URL parameters to be set
702
+ await executeAfterWait(() => {
703
+ const iframeSrc = appEmbed.getIFrameSrc();
704
+ expect(iframeSrc).toContain('isLazyLoadingForEmbedEnabled=true');
705
+ expect(iframeSrc).toContain('isFullHeightPinboard=true');
706
+ }, 100);
707
+ });
708
+ test('should not set lazyLoadingForEmbed when lazyLoadingForFullHeight is enabled but fullHeight is false', async () => {
709
+ const appEmbed = new AppEmbed(getRootEl(), {
710
+ ...defaultViewConfig,
711
+ fullHeight: false,
712
+ lazyLoadingForFullHeight: true,
713
+ });
714
+ // Wait for render to complete
715
+ await appEmbed.render();
716
+ // Wait for iframe initialization and URL parameters to be set
717
+ await executeAfterWait(() => {
718
+ const iframeSrc = getIFrameSrc();
719
+ expect(iframeSrc).not.toContain('isLazyLoadingForEmbedEnabled=true');
720
+ expect(iframeSrc).not.toContain('isFullHeightPinboard=true');
721
+ }, 100); // 100ms wait time to ensure iframe src is set
722
+ });
723
+ test('should not set isLazyLoadingForEmbedEnabled when fullHeight is true but lazyLoadingForFullHeight is false', async () => {
724
+ const appEmbed = new AppEmbed(getRootEl(), {
725
+ ...defaultViewConfig,
726
+ fullHeight: true,
727
+ lazyLoadingForFullHeight: false,
728
+ });
729
+ // Wait for render to complete
730
+ await appEmbed.render();
731
+ // Wait for iframe initialization and URL parameters to be set
732
+ await executeAfterWait(() => {
733
+ const iframeSrc = getIFrameSrc();
734
+ expect(iframeSrc).not.toContain('isLazyLoadingForEmbedEnabled=true');
735
+ expect(iframeSrc).toContain('isFullHeightPinboard=true');
736
+ }, 100); // 100ms wait time to ensure iframe src is set
737
+ });
738
+ test('should register RequestFullHeightLazyLoadData event handler when fullHeight is enabled', async () => {
739
+ const onSpy = jest.spyOn(AppEmbed.prototype, 'on');
740
+ const appEmbed = new AppEmbed(getRootEl(), {
741
+ ...defaultViewConfig,
742
+ fullHeight: true,
743
+ });
744
+ await appEmbed.render();
745
+ expect(onSpy).toHaveBeenCalledWith(EmbedEvent.RequestVisibleEmbedCoordinates, expect.any(Function));
746
+ onSpy.mockRestore();
747
+ });
748
+ test('should send correct visible data when RequestFullHeightLazyLoadData is triggered', async () => {
749
+ const appEmbed = new AppEmbed(getRootEl(), {
750
+ ...defaultViewConfig,
751
+ fullHeight: true,
752
+ lazyLoadingForFullHeight: true,
753
+ });
754
+ const mockTrigger = jest.spyOn(appEmbed, 'trigger');
755
+ await appEmbed.render();
756
+ // Trigger the lazy load data calculation
757
+ appEmbed.sendFullHeightLazyLoadData();
758
+ expect(mockTrigger).toHaveBeenCalledWith(HostEvent.VisibleEmbedCoordinates, {
759
+ top: 0,
760
+ height: 500,
761
+ left: 0,
762
+ width: 650,
763
+ });
764
+ });
765
+ test('should calculate correct visible data for partially visible full height element', async () => {
766
+ // Mock iframe partially clipped from top and left
767
+ mockIFrame.getBoundingClientRect = jest.fn().mockReturnValue({
768
+ top: -50,
769
+ left: -30,
770
+ bottom: 700,
771
+ right: 1024,
772
+ width: 1054,
773
+ height: 750,
774
+ });
775
+ const appEmbed = new AppEmbed(getRootEl(), {
776
+ ...defaultViewConfig,
777
+ fullHeight: true,
778
+ lazyLoadingForFullHeight: true,
779
+ });
780
+ const mockTrigger = jest.spyOn(appEmbed, 'trigger');
781
+ await appEmbed.render();
782
+ // Trigger the lazy load data calculation
783
+ appEmbed.sendFullHeightLazyLoadData();
784
+ expect(mockTrigger).toHaveBeenCalledWith(HostEvent.VisibleEmbedCoordinates, {
785
+ top: 50,
786
+ height: 700,
787
+ left: 30,
788
+ width: 1024, // visible width (from 0 to 1024)
789
+ });
790
+ });
791
+ test('should add window event listeners for resize and scroll when fullHeight and lazyLoadingForFullHeight are enabled', async () => {
792
+ const addEventListenerSpy = jest.spyOn(window, 'addEventListener');
793
+ const appEmbed = new AppEmbed(getRootEl(), {
794
+ ...defaultViewConfig,
795
+ fullHeight: true,
796
+ lazyLoadingForFullHeight: true,
797
+ });
798
+ await appEmbed.render();
799
+ expect(addEventListenerSpy).toHaveBeenCalledWith('resize', expect.any(Function));
800
+ expect(addEventListenerSpy).toHaveBeenCalledWith('scroll', expect.any(Function));
801
+ addEventListenerSpy.mockRestore();
802
+ });
803
+ test('should remove window event listeners on destroy when fullHeight and lazyLoadingForFullHeight are enabled', async () => {
804
+ const removeEventListenerSpy = jest.spyOn(window, 'removeEventListener');
805
+ const appEmbed = new AppEmbed(getRootEl(), {
806
+ ...defaultViewConfig,
807
+ fullHeight: true,
808
+ lazyLoadingForFullHeight: true,
809
+ });
810
+ await appEmbed.render();
811
+ appEmbed.destroy();
812
+ expect(removeEventListenerSpy).toHaveBeenCalledWith('resize', expect.any(Function));
813
+ expect(removeEventListenerSpy).toHaveBeenCalledWith('scroll', expect.any(Function));
814
+ removeEventListenerSpy.mockRestore();
815
+ });
816
+ test('should handle RequestVisibleEmbedCoordinates event and respond with correct data', async () => {
817
+ // Mock the iframe element
818
+ mockIFrame.getBoundingClientRect = jest.fn().mockReturnValue({
819
+ top: 100,
820
+ left: 150,
821
+ bottom: 600,
822
+ right: 800,
823
+ width: 650,
824
+ height: 500,
825
+ });
826
+ Object.defineProperty(mockIFrame, 'scrollHeight', { value: 500 });
827
+ const appEmbed = new AppEmbed(getRootEl(), {
828
+ ...defaultViewConfig,
829
+ fullHeight: true,
830
+ lazyLoadingForFullHeight: true,
831
+ });
832
+ // Set the iframe before render
833
+ appEmbed.iFrame = mockIFrame;
834
+ await appEmbed.render();
835
+ // Create a mock responder function
836
+ const mockResponder = jest.fn();
837
+ // Trigger the handler directly
838
+ appEmbed.requestVisibleEmbedCoordinatesHandler({}, mockResponder);
839
+ // Verify the responder was called with the correct data
840
+ expect(mockResponder).toHaveBeenCalledWith({
841
+ type: EmbedEvent.RequestVisibleEmbedCoordinates,
842
+ data: {
843
+ top: 0,
844
+ height: 500,
845
+ left: 0,
846
+ width: 650,
847
+ },
848
+ });
849
+ });
850
+ });
851
+ describe('IFrame height management', () => {
852
+ let mockIFrame;
853
+ beforeEach(() => {
854
+ mockIFrame = document.createElement('iframe');
855
+ mockIFrame.getBoundingClientRect = jest.fn().mockReturnValue({
856
+ top: 100,
857
+ left: 150,
858
+ bottom: 600,
859
+ right: 800,
860
+ width: 650,
861
+ height: 500,
862
+ });
863
+ Object.defineProperty(mockIFrame, 'scrollHeight', { value: 500 });
864
+ });
865
+ test('should not call setIFrameHeight if currentPath starts with "/embed/viz/"', () => {
866
+ const appEmbed = new AppEmbed(getRootEl(), {
867
+ ...defaultViewConfig,
868
+ fullHeight: true,
869
+ });
870
+ const spySetIFrameHeight = jest.spyOn(appEmbed, 'setIFrameHeight');
871
+ appEmbed.render();
872
+ appEmbed.setIframeHeightForNonEmbedLiveboard({
873
+ data: { currentPath: '/embed/viz/' },
874
+ type: 'Route',
875
+ });
876
+ expect(spySetIFrameHeight).not.toHaveBeenCalled();
877
+ });
878
+ test('should not call setIFrameHeight if currentPath starts with "/embed/insights/viz/"', () => {
879
+ const appEmbed = new AppEmbed(getRootEl(), {
880
+ ...defaultViewConfig,
881
+ fullHeight: true,
882
+ });
883
+ const spySetIFrameHeight = jest.spyOn(appEmbed, 'setIFrameHeight');
884
+ appEmbed.render();
885
+ appEmbed.setIframeHeightForNonEmbedLiveboard({
886
+ data: { currentPath: '/embed/insights/viz/' },
887
+ type: 'Route',
888
+ });
889
+ expect(spySetIFrameHeight).not.toHaveBeenCalled();
890
+ });
891
+ test('should call setIFrameHeight if currentPath starts with "/some/other/path/"', () => {
892
+ const appEmbed = new AppEmbed(getRootEl(), {
893
+ ...defaultViewConfig,
894
+ fullHeight: true,
895
+ });
896
+ const spySetIFrameHeight = jest
897
+ .spyOn(appEmbed, 'setIFrameHeight')
898
+ .mockImplementation(jest.fn());
899
+ appEmbed.render();
900
+ appEmbed.setIframeHeightForNonEmbedLiveboard({
901
+ data: { currentPath: '/some/other/path/' },
902
+ type: 'Route',
903
+ });
904
+ expect(spySetIFrameHeight).toHaveBeenCalled();
905
+ });
906
+ test('should update iframe height correctly', async () => {
907
+ const appEmbed = new AppEmbed(getRootEl(), {
908
+ ...defaultViewConfig,
909
+ fullHeight: true,
910
+ });
911
+ // Set up the mock iframe
912
+ appEmbed.iFrame = mockIFrame;
913
+ document.body.appendChild(mockIFrame);
914
+ await appEmbed.render();
915
+ const mockEvent = {
916
+ data: 600,
917
+ type: EmbedEvent.EmbedHeight,
918
+ };
919
+ appEmbed.updateIFrameHeight(mockEvent);
920
+ // Check if the iframe style was updated
921
+ expect(mockIFrame.style.height).toBe('600px');
922
+ });
923
+ test('should handle updateIFrameHeight with default height', async () => {
924
+ const appEmbed = new AppEmbed(getRootEl(), {
925
+ ...defaultViewConfig,
926
+ fullHeight: true,
927
+ });
928
+ // Set up the mock iframe
929
+ appEmbed.iFrame = mockIFrame;
930
+ document.body.appendChild(mockIFrame);
931
+ await appEmbed.render();
932
+ const mockEvent = {
933
+ data: 0,
934
+ type: EmbedEvent.EmbedHeight,
935
+ };
936
+ appEmbed.updateIFrameHeight(mockEvent);
937
+ // Should use the scrollHeight
938
+ expect(mockIFrame.style.height).toBe('500px');
939
+ });
940
+ });
579
941
  });
580
942
  //# sourceMappingURL=app.spec.js.map