@thoughtspot/visual-embed-sdk 1.39.2-alpha.1 → 1.39.2-alpha.3

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 (171) 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 +68 -9
  7. package/cjs/src/embed/app.js.map +1 -1
  8. package/cjs/src/embed/app.spec.js +360 -7
  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.d.ts +2 -60
  17. package/cjs/src/embed/conversation.d.ts.map +1 -1
  18. package/cjs/src/embed/conversation.js +1 -9
  19. package/cjs/src/embed/conversation.js.map +1 -1
  20. package/cjs/src/embed/conversation.spec.js +0 -102
  21. package/cjs/src/embed/conversation.spec.js.map +1 -1
  22. package/cjs/src/embed/liveboard.d.ts +56 -0
  23. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  24. package/cjs/src/embed/liveboard.js +46 -0
  25. package/cjs/src/embed/liveboard.js.map +1 -1
  26. package/cjs/src/embed/liveboard.spec.js +206 -0
  27. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  28. package/cjs/src/errors.d.ts +1 -0
  29. package/cjs/src/errors.d.ts.map +1 -1
  30. package/cjs/src/errors.js +1 -0
  31. package/cjs/src/errors.js.map +1 -1
  32. package/cjs/src/index.d.ts +2 -2
  33. package/cjs/src/index.d.ts.map +1 -1
  34. package/cjs/src/index.js +2 -1
  35. package/cjs/src/index.js.map +1 -1
  36. package/cjs/src/react/all-types-export.d.ts +1 -1
  37. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  38. package/cjs/src/react/all-types-export.js +3 -2
  39. package/cjs/src/react/all-types-export.js.map +1 -1
  40. package/cjs/src/react/index.d.ts +71 -20
  41. package/cjs/src/react/index.d.ts.map +1 -1
  42. package/cjs/src/react/index.js +79 -42
  43. package/cjs/src/react/index.js.map +1 -1
  44. package/cjs/src/react/index.spec.js +436 -100
  45. package/cjs/src/react/index.spec.js.map +1 -1
  46. package/cjs/src/types.d.ts +46 -4
  47. package/cjs/src/types.d.ts.map +1 -1
  48. package/cjs/src/types.js +28 -0
  49. package/cjs/src/types.js.map +1 -1
  50. package/cjs/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  51. package/cjs/src/utils/graphql/nlsService/conversation-service.js +2 -0
  52. package/cjs/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  53. package/cjs/src/utils/processTrigger.js +2 -1
  54. package/cjs/src/utils/processTrigger.js.map +1 -1
  55. package/cjs/src/utils.d.ts +6 -0
  56. package/cjs/src/utils.d.ts.map +1 -1
  57. package/cjs/src/utils.js +23 -3
  58. package/cjs/src/utils.js.map +1 -1
  59. package/cjs/src/utils.spec.js +237 -1
  60. package/cjs/src/utils.spec.js.map +1 -1
  61. package/dist/index-D1pyb7RG.js +7371 -0
  62. package/dist/index-e3Uw3YFO.js +7371 -0
  63. package/dist/src/embed/app.d.ts +75 -15
  64. package/dist/src/embed/app.d.ts.map +1 -1
  65. package/dist/src/embed/bodyless-conversation.d.ts +19 -7
  66. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  67. package/dist/src/embed/conversation.d.ts +2 -60
  68. package/dist/src/embed/conversation.d.ts.map +1 -1
  69. package/dist/src/embed/liveboard.d.ts +56 -0
  70. package/dist/src/embed/liveboard.d.ts.map +1 -1
  71. package/dist/src/errors.d.ts +1 -0
  72. package/dist/src/errors.d.ts.map +1 -1
  73. package/dist/src/index.d.ts +2 -2
  74. package/dist/src/index.d.ts.map +1 -1
  75. package/dist/src/react/all-types-export.d.ts +1 -1
  76. package/dist/src/react/all-types-export.d.ts.map +1 -1
  77. package/dist/src/react/index.d.ts +71 -20
  78. package/dist/src/react/index.d.ts.map +1 -1
  79. package/dist/src/types.d.ts +46 -4
  80. package/dist/src/types.d.ts.map +1 -1
  81. package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  82. package/dist/src/utils.d.ts +6 -0
  83. package/dist/src/utils.d.ts.map +1 -1
  84. package/dist/tsembed-react.es.js +276 -74
  85. package/dist/tsembed-react.js +276 -72
  86. package/dist/tsembed.es.js +194 -27
  87. package/dist/tsembed.js +192 -25
  88. package/dist/visual-embed-sdk-react-full.d.ts +246 -105
  89. package/dist/visual-embed-sdk-react.d.ts +246 -105
  90. package/dist/visual-embed-sdk.d.ts +176 -86
  91. package/lib/package.json +1 -1
  92. package/lib/src/config.spec.js +9 -0
  93. package/lib/src/config.spec.js.map +1 -1
  94. package/lib/src/embed/app.d.ts +75 -15
  95. package/lib/src/embed/app.d.ts.map +1 -1
  96. package/lib/src/embed/app.js +68 -9
  97. package/lib/src/embed/app.js.map +1 -1
  98. package/lib/src/embed/app.spec.js +361 -8
  99. package/lib/src/embed/app.spec.js.map +1 -1
  100. package/lib/src/embed/bodyless-conversation.d.ts +19 -7
  101. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  102. package/lib/src/embed/bodyless-conversation.js +23 -4
  103. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  104. package/lib/src/embed/bodyless-conversation.spec.js +9 -191
  105. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  106. package/lib/src/embed/conversation.d.ts +2 -60
  107. package/lib/src/embed/conversation.d.ts.map +1 -1
  108. package/lib/src/embed/conversation.js +2 -10
  109. package/lib/src/embed/conversation.js.map +1 -1
  110. package/lib/src/embed/conversation.spec.js +2 -104
  111. package/lib/src/embed/conversation.spec.js.map +1 -1
  112. package/lib/src/embed/liveboard.d.ts +56 -0
  113. package/lib/src/embed/liveboard.d.ts.map +1 -1
  114. package/lib/src/embed/liveboard.js +47 -1
  115. package/lib/src/embed/liveboard.js.map +1 -1
  116. package/lib/src/embed/liveboard.spec.js +206 -0
  117. package/lib/src/embed/liveboard.spec.js.map +1 -1
  118. package/lib/src/errors.d.ts +1 -0
  119. package/lib/src/errors.d.ts.map +1 -1
  120. package/lib/src/errors.js +1 -0
  121. package/lib/src/errors.js.map +1 -1
  122. package/lib/src/index.d.ts +2 -2
  123. package/lib/src/index.d.ts.map +1 -1
  124. package/lib/src/index.js +2 -2
  125. package/lib/src/index.js.map +1 -1
  126. package/lib/src/react/all-types-export.d.ts +1 -1
  127. package/lib/src/react/all-types-export.d.ts.map +1 -1
  128. package/lib/src/react/all-types-export.js +1 -1
  129. package/lib/src/react/all-types-export.js.map +1 -1
  130. package/lib/src/react/index.d.ts +71 -20
  131. package/lib/src/react/index.d.ts.map +1 -1
  132. package/lib/src/react/index.js +79 -43
  133. package/lib/src/react/index.js.map +1 -1
  134. package/lib/src/react/index.spec.js +439 -103
  135. package/lib/src/react/index.spec.js.map +1 -1
  136. package/lib/src/types.d.ts +46 -4
  137. package/lib/src/types.d.ts.map +1 -1
  138. package/lib/src/types.js +28 -0
  139. package/lib/src/types.js.map +1 -1
  140. package/lib/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  141. package/lib/src/utils/graphql/nlsService/conversation-service.js +2 -0
  142. package/lib/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  143. package/lib/src/utils/processTrigger.js +2 -1
  144. package/lib/src/utils/processTrigger.js.map +1 -1
  145. package/lib/src/utils.d.ts +6 -0
  146. package/lib/src/utils.d.ts.map +1 -1
  147. package/lib/src/utils.js +21 -2
  148. package/lib/src/utils.js.map +1 -1
  149. package/lib/src/utils.spec.js +238 -2
  150. package/lib/src/utils.spec.js.map +1 -1
  151. package/lib/src/visual-embed-sdk.d.ts +178 -88
  152. package/package.json +1 -1
  153. package/src/config.spec.ts +11 -0
  154. package/src/embed/app.spec.ts +451 -8
  155. package/src/embed/app.ts +131 -27
  156. package/src/embed/bodyless-conversation.spec.ts +9 -203
  157. package/src/embed/bodyless-conversation.ts +24 -10
  158. package/src/embed/conversation.spec.ts +5 -131
  159. package/src/embed/conversation.ts +10 -82
  160. package/src/embed/liveboard.spec.ts +254 -1
  161. package/src/embed/liveboard.ts +96 -5
  162. package/src/errors.ts +1 -0
  163. package/src/index.ts +2 -0
  164. package/src/react/all-types-export.ts +2 -1
  165. package/src/react/index.spec.tsx +556 -157
  166. package/src/react/index.tsx +117 -51
  167. package/src/types.ts +42 -0
  168. package/src/utils/graphql/nlsService/conversation-service.ts +2 -0
  169. package/src/utils/processTrigger.ts +1 -1
  170. package/src/utils.spec.ts +279 -2
  171. 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, coverAndFilterOptionInPDF = false, 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;
@@ -185,6 +214,10 @@ export class AppEmbed extends V1Embed {
185
214
  }
186
215
  if (fullHeight === true) {
187
216
  params[Param.fullHeight] = true;
217
+ if (this.viewConfig.lazyLoadingForFullHeight) {
218
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
219
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
220
+ }
188
221
  }
189
222
  if (tag) {
190
223
  params[Param.Tag] = tag;
@@ -205,7 +238,6 @@ export class AppEmbed extends V1Embed {
205
238
  params[Param.enableAskSage] = enableAskSage;
206
239
  }
207
240
  if (isOnBeforeGetVizDataInterceptEnabled) {
208
- /* eslint-disable-next-line max-len */
209
241
  params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
210
242
  }
211
243
  if (homePageSearchBarMode) {
@@ -226,11 +258,9 @@ export class AppEmbed extends V1Embed {
226
258
  === DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
227
259
  || dataPanelCustomGroupsAccordionInitialState
228
260
  === DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
229
- /* eslint-disable-next-line max-len */
230
261
  params[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
231
262
  }
232
263
  else {
233
- /* eslint-disable-next-line max-len */
234
264
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
235
265
  }
236
266
  if (discoveryExperience) {
@@ -243,6 +273,10 @@ export class AppEmbed extends V1Embed {
243
273
  if (discoveryExperience.homePage === HomePage.Modular) {
244
274
  params[Param.ModularHomeExperienceEnabled] = true;
245
275
  }
276
+ // listPageVersion v3 will enable the new list page
277
+ if (discoveryExperience.listPageVersion === ListPage.ListWithUXChanges) {
278
+ params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
279
+ }
246
280
  }
247
281
  const queryParams = getQueryParamString(params, true);
248
282
  return queryParams;
@@ -330,6 +364,30 @@ export class AppEmbed extends V1Embed {
330
364
  this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
331
365
  }
332
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, true);
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
+ }
333
391
  /**
334
392
  * Renders the embedded application pages in the ThoughtSpot app.
335
393
  * @param renderOptions An object containing the page ID
@@ -339,6 +397,7 @@ export class AppEmbed extends V1Embed {
339
397
  await super.render();
340
398
  const src = this.getIFrameSrc();
341
399
  await this.renderV1Embed(src);
400
+ this.postRender();
342
401
  return this;
343
402
  }
344
403
  }
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/embed/app.ts"],"names":[],"mapp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IAAI,IAAI,CAAC,OAAO,CAC9E,UAAU,EACV,EAAE,CACL,EAAE,CAAC;SACP;IACL,CAAC;IAED;;;OAGG;IACI,OAAO;QACV,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,IAAI,CAAC,wBAAwB,EAAE,CAAC;IACpC,CAAC;IAEO,UAAU;QACd,IAAI,CAAC,sBAAsB,EAAE,CAAC;IAClC,CAAC;IAEO,sBAAsB;QAC1B,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,IAAI,IAAI,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,EAAE,IAAI,CAAC,CAAC;SAC5E;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,4 +1,4 @@
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
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';
@@ -85,7 +85,6 @@ describe('App embed tests', () => {
85
85
  });
86
86
  });
87
87
  describe('should render the correct routes for pages', () => {
88
- /* eslint-disable no-loop-func */
89
88
  const pageRouteMap = {
90
89
  [Page.Search]: 'answer',
91
90
  [Page.Answers]: 'answers',
@@ -126,7 +125,7 @@ describe('App embed tests', () => {
126
125
  for (let i = 0; i < pageIdsForModularHomes.length; i++) {
127
126
  const pageIdsForModularHome = pageIdsForModularHomes[i];
128
127
  test(`${pageIdsForModularHome}`, async () => {
129
- const route = pageRouteMap[pageIdsForModularHome];
128
+ const route = pageRouteMapForModularHome[pageIdsForModularHome];
130
129
  const appEmbed = new AppEmbed(getRootEl(), {
131
130
  ...defaultViewConfig,
132
131
  modularHomeExperience: true,
@@ -438,6 +437,44 @@ describe('App embed tests', () => {
438
437
  expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&enableAskSage=true${defaultParams}${defaultParamsPost}#/home`);
439
438
  });
440
439
  });
440
+ test('Should add listpageVersion=v3 when listPageVersion is ListWithUXChanges to the iframe src', async () => {
441
+ const appEmbed = new AppEmbed(getRootEl(), {
442
+ ...defaultViewConfig,
443
+ discoveryExperience: {
444
+ listPageVersion: ListPage.ListWithUXChanges,
445
+ },
446
+ });
447
+ appEmbed.render();
448
+ await executeAfterWait(() => {
449
+ expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&listpageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
450
+ });
451
+ });
452
+ test('Should not add listpageVersion when listPageVersion is List (v2) to the iframe src', async () => {
453
+ const appEmbed = new AppEmbed(getRootEl(), {
454
+ ...defaultViewConfig,
455
+ discoveryExperience: {
456
+ listPageVersion: ListPage.List,
457
+ },
458
+ });
459
+ appEmbed.render();
460
+ await executeAfterWait(() => {
461
+ expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false${defaultParams}${defaultParamsPost}#/home`);
462
+ });
463
+ });
464
+ test('Should add listpageVersion=v3 combined with other discoveryExperience options to the iframe src', async () => {
465
+ const appEmbed = new AppEmbed(getRootEl(), {
466
+ ...defaultViewConfig,
467
+ discoveryExperience: {
468
+ primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
469
+ homePage: HomePage.Modular,
470
+ listPageVersion: ListPage.ListWithUXChanges,
471
+ },
472
+ });
473
+ appEmbed.render();
474
+ await executeAfterWait(() => {
475
+ expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&listpageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
476
+ });
477
+ });
441
478
  test('Should add enablePendoHelp flag to the iframe src conditional on navbar', async () => {
442
479
  const appEmbed = new AppEmbed(getRootEl(), {
443
480
  ...defaultViewConfig,
@@ -488,7 +525,6 @@ describe('App embed tests', () => {
488
525
  test('Should add dataPanelCustomGroupsAccordionInitialState flag to the iframe src', async () => {
489
526
  const appEmbed = new AppEmbed(getRootEl(), {
490
527
  ...defaultViewConfig,
491
- // eslint-disable-next-line max-len
492
528
  dataPanelCustomGroupsAccordionInitialState: DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST,
493
529
  });
494
530
  appEmbed.render();
@@ -497,12 +533,13 @@ describe('App embed tests', () => {
497
533
  });
498
534
  });
499
535
  test('should register event handlers to adjust iframe height', async () => {
536
+ let embedHeightCallback = () => { };
500
537
  const onSpy = jest.spyOn(AppEmbed.prototype, 'on').mockImplementation((event, callback) => {
501
538
  if (event === EmbedEvent.RouteChange) {
502
539
  callback({ data: { currentPath: '/answers' } }, jest.fn());
503
540
  }
504
541
  if (event === EmbedEvent.EmbedHeight) {
505
- callback({ data: '100%' });
542
+ embedHeightCallback = callback;
506
543
  }
507
544
  if (event === EmbedEvent.EmbedIframeCenter) {
508
545
  callback({}, jest.fn());
@@ -514,14 +551,20 @@ describe('App embed tests', () => {
514
551
  const appEmbed = new AppEmbed(getRootEl(), {
515
552
  ...defaultViewConfig,
516
553
  fullHeight: true,
554
+ lazyLoadingForFullHeight: true,
517
555
  });
518
- appEmbed.render();
556
+ // Set the iframe before render
557
+ appEmbed.iFrame = document.createElement('iframe');
558
+ // Wait for render to complete
559
+ await appEmbed.render();
560
+ embedHeightCallback({ data: '100%' });
561
+ // Verify event handlers were registered
519
562
  await executeAfterWait(() => {
520
563
  expect(onSpy).toHaveBeenCalledWith(EmbedEvent.EmbedHeight, expect.anything());
521
564
  expect(onSpy).toHaveBeenCalledWith(EmbedEvent.RouteChange, expect.anything());
522
565
  expect(onSpy).toHaveBeenCalledWith(EmbedEvent.EmbedIframeCenter, expect.anything());
523
- });
524
- jest.clearAllMocks();
566
+ expect(onSpy).toHaveBeenCalledWith(EmbedEvent.RequestVisibleEmbedCoordinates, expect.anything());
567
+ }, 100);
525
568
  });
526
569
  describe('Navigate to Page API', () => {
527
570
  const path = 'pinboard/e0836cad-4fdf-42d4-bd97-567a6b2a6058';
@@ -586,5 +629,315 @@ describe('App embed tests', () => {
586
629
  expect(logger.log).toHaveBeenCalledWith('Please call render before invoking this method');
587
630
  });
588
631
  });
632
+ describe('LazyLoadingForFullHeight functionality', () => {
633
+ let mockIFrame;
634
+ beforeEach(() => {
635
+ mockIFrame = document.createElement('iframe');
636
+ mockIFrame.getBoundingClientRect = jest.fn().mockReturnValue({
637
+ top: 100,
638
+ left: 150,
639
+ bottom: 600,
640
+ right: 800,
641
+ width: 650,
642
+ height: 500,
643
+ });
644
+ jest.spyOn(document, 'createElement').mockImplementation((tagName) => {
645
+ if (tagName === 'iframe') {
646
+ return mockIFrame;
647
+ }
648
+ return document.createElement(tagName);
649
+ });
650
+ });
651
+ afterEach(() => {
652
+ jest.restoreAllMocks();
653
+ });
654
+ test('should set lazyLoadingMargin parameter when provided', async () => {
655
+ const appEmbed = new AppEmbed(getRootEl(), {
656
+ ...defaultViewConfig,
657
+ fullHeight: true,
658
+ lazyLoadingForFullHeight: true,
659
+ lazyLoadingMargin: '100px 0px',
660
+ });
661
+ await appEmbed.render();
662
+ await executeAfterWait(() => {
663
+ const iframeSrc = getIFrameSrc();
664
+ expect(iframeSrc).toContain('isLazyLoadingForEmbedEnabled=true');
665
+ expect(iframeSrc).toContain('isFullHeightPinboard=true');
666
+ expect(iframeSrc).toContain('rootMarginForLazyLoad=100px%200px');
667
+ }, 100);
668
+ });
669
+ test('should set isLazyLoadingForEmbedEnabled=true when both fullHeight and lazyLoadingForFullHeight are enabled', async () => {
670
+ // Mock the iframe element first
671
+ mockIFrame.getBoundingClientRect = jest.fn().mockReturnValue({
672
+ top: 100,
673
+ left: 150,
674
+ bottom: 600,
675
+ right: 800,
676
+ width: 650,
677
+ height: 500,
678
+ });
679
+ Object.defineProperty(mockIFrame, 'scrollHeight', { value: 500 });
680
+ // Mock the event handlers
681
+ const onSpy = jest.spyOn(AppEmbed.prototype, 'on').mockImplementation((event, callback) => {
682
+ return null;
683
+ });
684
+ jest.spyOn(TsEmbed.prototype, 'getIframeCenter').mockReturnValue({});
685
+ jest.spyOn(TsEmbed.prototype, 'setIFrameHeight').mockReturnValue({});
686
+ // Create the AppEmbed instance
687
+ const appEmbed = new AppEmbed(getRootEl(), {
688
+ ...defaultViewConfig,
689
+ fullHeight: true,
690
+ lazyLoadingForFullHeight: true,
691
+ });
692
+ // Set the iframe before render
693
+ appEmbed.iFrame = mockIFrame;
694
+ // Add the iframe to the DOM
695
+ const rootEl = getRootEl();
696
+ rootEl.appendChild(mockIFrame);
697
+ // Wait for render to complete
698
+ await appEmbed.render();
699
+ // Wait for iframe initialization and URL parameters to be set
700
+ await executeAfterWait(() => {
701
+ const iframeSrc = appEmbed.getIFrameSrc();
702
+ expect(iframeSrc).toContain('isLazyLoadingForEmbedEnabled=true');
703
+ expect(iframeSrc).toContain('isFullHeightPinboard=true');
704
+ }, 100);
705
+ });
706
+ test('should not set lazyLoadingForEmbed when lazyLoadingForFullHeight is enabled but fullHeight is false', async () => {
707
+ const appEmbed = new AppEmbed(getRootEl(), {
708
+ ...defaultViewConfig,
709
+ fullHeight: false,
710
+ lazyLoadingForFullHeight: true,
711
+ });
712
+ // Wait for render to complete
713
+ await appEmbed.render();
714
+ // Wait for iframe initialization and URL parameters to be set
715
+ await executeAfterWait(() => {
716
+ const iframeSrc = getIFrameSrc();
717
+ expect(iframeSrc).not.toContain('isLazyLoadingForEmbedEnabled=true');
718
+ expect(iframeSrc).not.toContain('isFullHeightPinboard=true');
719
+ }, 100); // 100ms wait time to ensure iframe src is set
720
+ });
721
+ test('should not set isLazyLoadingForEmbedEnabled when fullHeight is true but lazyLoadingForFullHeight is false', async () => {
722
+ const appEmbed = new AppEmbed(getRootEl(), {
723
+ ...defaultViewConfig,
724
+ fullHeight: true,
725
+ lazyLoadingForFullHeight: false,
726
+ });
727
+ // Wait for render to complete
728
+ await appEmbed.render();
729
+ // Wait for iframe initialization and URL parameters to be set
730
+ await executeAfterWait(() => {
731
+ const iframeSrc = getIFrameSrc();
732
+ expect(iframeSrc).not.toContain('isLazyLoadingForEmbedEnabled=true');
733
+ expect(iframeSrc).toContain('isFullHeightPinboard=true');
734
+ }, 100); // 100ms wait time to ensure iframe src is set
735
+ });
736
+ test('should register RequestFullHeightLazyLoadData event handler when fullHeight is enabled', async () => {
737
+ const onSpy = jest.spyOn(AppEmbed.prototype, 'on');
738
+ const appEmbed = new AppEmbed(getRootEl(), {
739
+ ...defaultViewConfig,
740
+ fullHeight: true,
741
+ });
742
+ await appEmbed.render();
743
+ expect(onSpy).toHaveBeenCalledWith(EmbedEvent.RequestVisibleEmbedCoordinates, expect.any(Function));
744
+ onSpy.mockRestore();
745
+ });
746
+ test('should send correct visible data when RequestFullHeightLazyLoadData is triggered', async () => {
747
+ const appEmbed = new AppEmbed(getRootEl(), {
748
+ ...defaultViewConfig,
749
+ fullHeight: true,
750
+ lazyLoadingForFullHeight: true,
751
+ });
752
+ const mockTrigger = jest.spyOn(appEmbed, 'trigger');
753
+ await appEmbed.render();
754
+ // Trigger the lazy load data calculation
755
+ appEmbed.sendFullHeightLazyLoadData();
756
+ expect(mockTrigger).toHaveBeenCalledWith(HostEvent.VisibleEmbedCoordinates, {
757
+ top: 0,
758
+ height: 500,
759
+ left: 0,
760
+ width: 650,
761
+ });
762
+ });
763
+ test('should calculate correct visible data for partially visible full height element', async () => {
764
+ // Mock iframe partially clipped from top and left
765
+ mockIFrame.getBoundingClientRect = jest.fn().mockReturnValue({
766
+ top: -50,
767
+ left: -30,
768
+ bottom: 700,
769
+ right: 1024,
770
+ width: 1054,
771
+ height: 750,
772
+ });
773
+ const appEmbed = new AppEmbed(getRootEl(), {
774
+ ...defaultViewConfig,
775
+ fullHeight: true,
776
+ lazyLoadingForFullHeight: true,
777
+ });
778
+ const mockTrigger = jest.spyOn(appEmbed, 'trigger');
779
+ await appEmbed.render();
780
+ // Trigger the lazy load data calculation
781
+ appEmbed.sendFullHeightLazyLoadData();
782
+ expect(mockTrigger).toHaveBeenCalledWith(HostEvent.VisibleEmbedCoordinates, {
783
+ top: 50,
784
+ height: 700,
785
+ left: 30,
786
+ width: 1024, // visible width (from 0 to 1024)
787
+ });
788
+ });
789
+ test('should add window event listeners for resize and scroll when fullHeight and lazyLoadingForFullHeight are enabled', async () => {
790
+ const addEventListenerSpy = jest.spyOn(window, 'addEventListener');
791
+ const appEmbed = new AppEmbed(getRootEl(), {
792
+ ...defaultViewConfig,
793
+ fullHeight: true,
794
+ lazyLoadingForFullHeight: true,
795
+ });
796
+ await appEmbed.render();
797
+ // Wait for the post-render events to be registered
798
+ await executeAfterWait(() => {
799
+ expect(addEventListenerSpy).toHaveBeenCalledWith('resize', expect.any(Function));
800
+ expect(addEventListenerSpy).toHaveBeenCalledWith('scroll', expect.any(Function), true);
801
+ }, 100);
802
+ addEventListenerSpy.mockRestore();
803
+ });
804
+ test('should remove window event listeners on destroy when fullHeight and lazyLoadingForFullHeight are enabled', async () => {
805
+ const removeEventListenerSpy = jest.spyOn(window, 'removeEventListener');
806
+ const appEmbed = new AppEmbed(getRootEl(), {
807
+ ...defaultViewConfig,
808
+ fullHeight: true,
809
+ lazyLoadingForFullHeight: true,
810
+ });
811
+ await appEmbed.render();
812
+ appEmbed.destroy();
813
+ expect(removeEventListenerSpy).toHaveBeenCalledWith('resize', expect.any(Function));
814
+ expect(removeEventListenerSpy).toHaveBeenCalledWith('scroll', expect.any(Function));
815
+ removeEventListenerSpy.mockRestore();
816
+ });
817
+ test('should handle RequestVisibleEmbedCoordinates event and respond with correct data', async () => {
818
+ // Mock the iframe element
819
+ mockIFrame.getBoundingClientRect = jest.fn().mockReturnValue({
820
+ top: 100,
821
+ left: 150,
822
+ bottom: 600,
823
+ right: 800,
824
+ width: 650,
825
+ height: 500,
826
+ });
827
+ Object.defineProperty(mockIFrame, 'scrollHeight', { value: 500 });
828
+ const appEmbed = new AppEmbed(getRootEl(), {
829
+ ...defaultViewConfig,
830
+ fullHeight: true,
831
+ lazyLoadingForFullHeight: true,
832
+ });
833
+ // Set the iframe before render
834
+ appEmbed.iFrame = mockIFrame;
835
+ await appEmbed.render();
836
+ // Create a mock responder function
837
+ const mockResponder = jest.fn();
838
+ // Trigger the handler directly
839
+ appEmbed.requestVisibleEmbedCoordinatesHandler({}, mockResponder);
840
+ // Verify the responder was called with the correct data
841
+ expect(mockResponder).toHaveBeenCalledWith({
842
+ type: EmbedEvent.RequestVisibleEmbedCoordinates,
843
+ data: {
844
+ top: 0,
845
+ height: 500,
846
+ left: 0,
847
+ width: 650,
848
+ },
849
+ });
850
+ });
851
+ });
852
+ describe('IFrame height management', () => {
853
+ let mockIFrame;
854
+ beforeEach(() => {
855
+ mockIFrame = document.createElement('iframe');
856
+ mockIFrame.getBoundingClientRect = jest.fn().mockReturnValue({
857
+ top: 100,
858
+ left: 150,
859
+ bottom: 600,
860
+ right: 800,
861
+ width: 650,
862
+ height: 500,
863
+ });
864
+ Object.defineProperty(mockIFrame, 'scrollHeight', { value: 500 });
865
+ });
866
+ test('should not call setIFrameHeight if currentPath starts with "/embed/viz/"', () => {
867
+ const appEmbed = new AppEmbed(getRootEl(), {
868
+ ...defaultViewConfig,
869
+ fullHeight: true,
870
+ });
871
+ const spySetIFrameHeight = jest.spyOn(appEmbed, 'setIFrameHeight');
872
+ appEmbed.render();
873
+ appEmbed.setIframeHeightForNonEmbedLiveboard({
874
+ data: { currentPath: '/embed/viz/' },
875
+ type: 'Route',
876
+ });
877
+ expect(spySetIFrameHeight).not.toHaveBeenCalled();
878
+ });
879
+ test('should not call setIFrameHeight if currentPath starts with "/embed/insights/viz/"', () => {
880
+ const appEmbed = new AppEmbed(getRootEl(), {
881
+ ...defaultViewConfig,
882
+ fullHeight: true,
883
+ });
884
+ const spySetIFrameHeight = jest.spyOn(appEmbed, 'setIFrameHeight');
885
+ appEmbed.render();
886
+ appEmbed.setIframeHeightForNonEmbedLiveboard({
887
+ data: { currentPath: '/embed/insights/viz/' },
888
+ type: 'Route',
889
+ });
890
+ expect(spySetIFrameHeight).not.toHaveBeenCalled();
891
+ });
892
+ test('should call setIFrameHeight if currentPath starts with "/some/other/path/"', () => {
893
+ const appEmbed = new AppEmbed(getRootEl(), {
894
+ ...defaultViewConfig,
895
+ fullHeight: true,
896
+ });
897
+ const spySetIFrameHeight = jest
898
+ .spyOn(appEmbed, 'setIFrameHeight')
899
+ .mockImplementation(jest.fn());
900
+ appEmbed.render();
901
+ appEmbed.setIframeHeightForNonEmbedLiveboard({
902
+ data: { currentPath: '/some/other/path/' },
903
+ type: 'Route',
904
+ });
905
+ expect(spySetIFrameHeight).toHaveBeenCalled();
906
+ });
907
+ test('should update iframe height correctly', async () => {
908
+ const appEmbed = new AppEmbed(getRootEl(), {
909
+ ...defaultViewConfig,
910
+ fullHeight: true,
911
+ });
912
+ // Set up the mock iframe
913
+ appEmbed.iFrame = mockIFrame;
914
+ document.body.appendChild(mockIFrame);
915
+ await appEmbed.render();
916
+ const mockEvent = {
917
+ data: 600,
918
+ type: EmbedEvent.EmbedHeight,
919
+ };
920
+ appEmbed.updateIFrameHeight(mockEvent);
921
+ // Check if the iframe style was updated
922
+ expect(mockIFrame.style.height).toBe('600px');
923
+ });
924
+ test('should handle updateIFrameHeight with default height', async () => {
925
+ const appEmbed = new AppEmbed(getRootEl(), {
926
+ ...defaultViewConfig,
927
+ fullHeight: true,
928
+ });
929
+ // Set up the mock iframe
930
+ appEmbed.iFrame = mockIFrame;
931
+ document.body.appendChild(mockIFrame);
932
+ await appEmbed.render();
933
+ const mockEvent = {
934
+ data: 0,
935
+ type: EmbedEvent.EmbedHeight,
936
+ };
937
+ appEmbed.updateIFrameHeight(mockEvent);
938
+ // Should use the scrollHeight
939
+ expect(mockIFrame.style.height).toBe('500px');
940
+ });
941
+ });
589
942
  });
590
943
  //# sourceMappingURL=app.spec.js.map