@thoughtspot/visual-embed-sdk 1.39.3 → 1.40.1-alpha.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.
Files changed (93) hide show
  1. package/cjs/src/embed/app.d.ts +56 -0
  2. package/cjs/src/embed/app.d.ts.map +1 -1
  3. package/cjs/src/embed/app.js +47 -8
  4. package/cjs/src/embed/app.js.map +1 -1
  5. package/cjs/src/embed/app.spec.js +322 -7
  6. package/cjs/src/embed/app.spec.js.map +1 -1
  7. package/cjs/src/embed/liveboard.d.ts +58 -1
  8. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  9. package/cjs/src/embed/liveboard.js +59 -8
  10. package/cjs/src/embed/liveboard.js.map +1 -1
  11. package/cjs/src/embed/liveboard.spec.js +206 -0
  12. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  13. package/cjs/src/embed/ts-embed.d.ts +7 -0
  14. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  15. package/cjs/src/embed/ts-embed.js +61 -7
  16. package/cjs/src/embed/ts-embed.js.map +1 -1
  17. package/cjs/src/types.d.ts +37 -6
  18. package/cjs/src/types.d.ts.map +1 -1
  19. package/cjs/src/types.js +35 -4
  20. package/cjs/src/types.js.map +1 -1
  21. package/cjs/src/utils/processTrigger.js +2 -1
  22. package/cjs/src/utils/processTrigger.js.map +1 -1
  23. package/cjs/src/utils.d.ts +6 -0
  24. package/cjs/src/utils.d.ts.map +1 -1
  25. package/cjs/src/utils.js +23 -3
  26. package/cjs/src/utils.js.map +1 -1
  27. package/cjs/src/utils.spec.js +212 -1
  28. package/cjs/src/utils.spec.js.map +1 -1
  29. package/dist/{index-ZrE8YYq8.js → index-CmEQfuE3.js} +1 -1
  30. package/dist/index-D1pyb7RG.js +7371 -0
  31. package/dist/index-DeFzsyFF.js +7371 -0
  32. package/dist/index-Dpf0rd6w.js +7371 -0
  33. package/dist/index-UuEbsISo.js +7447 -0
  34. package/dist/index-e3Uw3YFO.js +7371 -0
  35. package/dist/src/embed/app.d.ts +56 -0
  36. package/dist/src/embed/app.d.ts.map +1 -1
  37. package/dist/src/embed/bodyless-conversation.d.ts +0 -4
  38. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  39. package/dist/src/embed/liveboard.d.ts +56 -0
  40. package/dist/src/embed/liveboard.d.ts.map +1 -1
  41. package/dist/src/react/index.d.ts +0 -2
  42. package/dist/src/react/index.d.ts.map +1 -1
  43. package/dist/src/types.d.ts +16 -198
  44. package/dist/src/types.d.ts.map +1 -1
  45. package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  46. package/dist/src/utils.d.ts +6 -0
  47. package/dist/src/utils.d.ts.map +1 -1
  48. package/dist/tsembed-react.es.js +137 -224
  49. package/dist/tsembed-react.js +136 -223
  50. package/dist/tsembed.es.js +137 -224
  51. package/dist/tsembed.js +136 -223
  52. package/dist/visual-embed-sdk-react-full.d.ts +106 -204
  53. package/dist/visual-embed-sdk-react.d.ts +106 -204
  54. package/dist/visual-embed-sdk.d.ts +106 -202
  55. package/lib/src/embed/app.d.ts +56 -0
  56. package/lib/src/embed/app.d.ts.map +1 -1
  57. package/lib/src/embed/app.js +48 -9
  58. package/lib/src/embed/app.js.map +1 -1
  59. package/lib/src/embed/app.spec.js +322 -7
  60. package/lib/src/embed/app.spec.js.map +1 -1
  61. package/lib/src/embed/liveboard.d.ts +58 -1
  62. package/lib/src/embed/liveboard.d.ts.map +1 -1
  63. package/lib/src/embed/liveboard.js +60 -9
  64. package/lib/src/embed/liveboard.js.map +1 -1
  65. package/lib/src/embed/liveboard.spec.js +206 -0
  66. package/lib/src/embed/liveboard.spec.js.map +1 -1
  67. package/lib/src/embed/ts-embed.d.ts +7 -0
  68. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  69. package/lib/src/embed/ts-embed.js +61 -7
  70. package/lib/src/embed/ts-embed.js.map +1 -1
  71. package/lib/src/types.d.ts +37 -6
  72. package/lib/src/types.d.ts.map +1 -1
  73. package/lib/src/types.js +35 -4
  74. package/lib/src/types.js.map +1 -1
  75. package/lib/src/utils/processTrigger.js +2 -1
  76. package/lib/src/utils/processTrigger.js.map +1 -1
  77. package/lib/src/utils.d.ts +6 -0
  78. package/lib/src/utils.d.ts.map +1 -1
  79. package/lib/src/utils.js +21 -2
  80. package/lib/src/utils.js.map +1 -1
  81. package/lib/src/utils.spec.js +213 -2
  82. package/lib/src/utils.spec.js.map +1 -1
  83. package/lib/src/visual-embed-sdk.d.ts +106 -202
  84. package/package.json +1 -2
  85. package/src/embed/app.spec.ts +397 -8
  86. package/src/embed/app.ts +106 -12
  87. package/src/embed/liveboard.spec.ts +254 -1
  88. package/src/embed/liveboard.ts +109 -11
  89. package/src/embed/ts-embed.ts +84 -21
  90. package/src/types.ts +36 -5
  91. package/src/utils/processTrigger.ts +1 -1
  92. package/src/utils.spec.ts +250 -2
  93. 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
  /**
@@ -121,11 +120,25 @@ export var ListPage;
121
120
  * @group Embed components
122
121
  */
123
122
  export class AppEmbed extends V1Embed {
124
- // eslint-disable-next-line no-useless-constructor
125
123
  constructor(domSelector, viewConfig) {
126
124
  viewConfig.embedComponentType = 'AppEmbed';
127
125
  super(domSelector, viewConfig);
128
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
+ };
129
142
  /**
130
143
  * Set the iframe height as per the computed height received
131
144
  * from the ThoughtSpot app.
@@ -134,6 +147,7 @@ export class AppEmbed extends V1Embed {
134
147
  this.updateIFrameHeight = (data) => {
135
148
  var _a;
136
149
  this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
150
+ this.sendFullHeightLazyLoadData();
137
151
  };
138
152
  this.embedIframeCenter = (data, responder) => {
139
153
  const obj = this.getIframeCenter();
@@ -163,6 +177,7 @@ export class AppEmbed extends V1Embed {
163
177
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
164
178
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
165
179
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
180
+ this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
166
181
  }
167
182
  }
168
183
  /**
@@ -170,9 +185,7 @@ export class AppEmbed extends V1Embed {
170
185
  * embedded Liveboard or visualization.
171
186
  */
172
187
  getEmbedParams() {
173
- 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,
174
- /* eslint-disable-next-line max-len */
175
- 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;
176
189
  let params = {};
177
190
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
178
191
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -201,6 +214,10 @@ export class AppEmbed extends V1Embed {
201
214
  }
202
215
  if (fullHeight === true) {
203
216
  params[Param.fullHeight] = true;
217
+ if (this.viewConfig.lazyLoadingForFullHeight) {
218
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
219
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
220
+ }
204
221
  }
205
222
  if (tag) {
206
223
  params[Param.Tag] = tag;
@@ -221,7 +238,6 @@ export class AppEmbed extends V1Embed {
221
238
  params[Param.enableAskSage] = enableAskSage;
222
239
  }
223
240
  if (isOnBeforeGetVizDataInterceptEnabled) {
224
- /* eslint-disable-next-line max-len */
225
241
  params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
226
242
  }
227
243
  if (homePageSearchBarMode) {
@@ -242,11 +258,9 @@ export class AppEmbed extends V1Embed {
242
258
  === DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
243
259
  || dataPanelCustomGroupsAccordionInitialState
244
260
  === DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
245
- /* eslint-disable-next-line max-len */
246
261
  params[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
247
262
  }
248
263
  else {
249
- /* eslint-disable-next-line max-len */
250
264
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
251
265
  }
252
266
  if (discoveryExperience) {
@@ -350,6 +364,30 @@ export class AppEmbed extends V1Embed {
350
364
  this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
351
365
  }
352
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
+ }
353
391
  /**
354
392
  * Renders the embedded application pages in the ThoughtSpot app.
355
393
  * @param renderOptions An object containing the page ID
@@ -359,6 +397,7 @@ export class AppEmbed extends V1Embed {
359
397
  await super.render();
360
398
  const src = this.getIFrameSrc();
361
399
  await this.renderV1Embed(src);
400
+ this.postRender();
362
401
  return this;
363
402
  }
364
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,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;;GAEG;AACH,qCAAqC;AACrC,MAAM,CAAN,IAAY,IAiCX;AAjCD,WAAY,IAAI;IACZ;;OAEG;IACH,qBAAa,CAAA;IACb;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,2BAAmB,CAAA;IACnB;;OAEG;IACH,iCAAyB,CAAA;IACzB;;OAEG;IACH,+BAAuB,CAAA;IACvB;;OAEG;IACH,qBAAa,CAAA;IACb;;OAEG;IACH,2BAAmB,CAAA;IACnB;;OAEG;IACH,2BAAmB,CAAA;AACvB,CAAC,EAjCW,IAAI,KAAJ,IAAI,QAiCf;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,yCAaX;AAbD,WAAY,yCAAyC;IACjD;;OAEG;IAC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;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"}
@@ -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,
@@ -526,7 +525,6 @@ describe('App embed tests', () => {
526
525
  test('Should add dataPanelCustomGroupsAccordionInitialState flag to the iframe src', async () => {
527
526
  const appEmbed = new AppEmbed(getRootEl(), {
528
527
  ...defaultViewConfig,
529
- // eslint-disable-next-line max-len
530
528
  dataPanelCustomGroupsAccordionInitialState: DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST,
531
529
  });
532
530
  appEmbed.render();
@@ -535,12 +533,13 @@ describe('App embed tests', () => {
535
533
  });
536
534
  });
537
535
  test('should register event handlers to adjust iframe height', async () => {
536
+ let embedHeightCallback = () => { };
538
537
  const onSpy = jest.spyOn(AppEmbed.prototype, 'on').mockImplementation((event, callback) => {
539
538
  if (event === EmbedEvent.RouteChange) {
540
539
  callback({ data: { currentPath: '/answers' } }, jest.fn());
541
540
  }
542
541
  if (event === EmbedEvent.EmbedHeight) {
543
- callback({ data: '100%' });
542
+ embedHeightCallback = callback;
544
543
  }
545
544
  if (event === EmbedEvent.EmbedIframeCenter) {
546
545
  callback({}, jest.fn());
@@ -552,14 +551,20 @@ describe('App embed tests', () => {
552
551
  const appEmbed = new AppEmbed(getRootEl(), {
553
552
  ...defaultViewConfig,
554
553
  fullHeight: true,
554
+ lazyLoadingForFullHeight: true,
555
555
  });
556
- 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
557
562
  await executeAfterWait(() => {
558
563
  expect(onSpy).toHaveBeenCalledWith(EmbedEvent.EmbedHeight, expect.anything());
559
564
  expect(onSpy).toHaveBeenCalledWith(EmbedEvent.RouteChange, expect.anything());
560
565
  expect(onSpy).toHaveBeenCalledWith(EmbedEvent.EmbedIframeCenter, expect.anything());
561
- });
562
- jest.clearAllMocks();
566
+ expect(onSpy).toHaveBeenCalledWith(EmbedEvent.RequestVisibleEmbedCoordinates, expect.anything());
567
+ }, 100);
563
568
  });
564
569
  describe('Navigate to Page API', () => {
565
570
  const path = 'pinboard/e0836cad-4fdf-42d4-bd97-567a6b2a6058';
@@ -624,5 +629,315 @@ describe('App embed tests', () => {
624
629
  expect(logger.log).toHaveBeenCalledWith('Please call render before invoking this method');
625
630
  });
626
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
+ });
627
942
  });
628
943
  //# sourceMappingURL=app.spec.js.map