@thoughtspot/visual-embed-sdk 1.52.2-beta → 1.52.2-beta.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 (82) hide show
  1. package/cjs/package.json +2 -2
  2. package/cjs/src/embed/app.js +1 -1
  3. package/cjs/src/embed/app.js.map +1 -1
  4. package/cjs/src/embed/auto-frame-renderer.js +1 -1
  5. package/cjs/src/embed/auto-frame-renderer.js.map +1 -1
  6. package/cjs/src/embed/bodyless-conversation.js +1 -1
  7. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  8. package/cjs/src/embed/conversation.js +1 -1
  9. package/cjs/src/embed/conversation.js.map +1 -1
  10. package/cjs/src/embed/liveboard.d.ts +1 -0
  11. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  12. package/cjs/src/embed/liveboard.js +16 -4
  13. package/cjs/src/embed/liveboard.js.map +1 -1
  14. package/cjs/src/embed/liveboard.spec.js +54 -0
  15. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  16. package/cjs/src/embed/search-bar.js +1 -1
  17. package/cjs/src/embed/search-bar.js.map +1 -1
  18. package/cjs/src/embed/search.js +1 -1
  19. package/cjs/src/embed/search.js.map +1 -1
  20. package/cjs/src/embed/search.spec.js +0 -20
  21. package/cjs/src/embed/search.spec.js.map +1 -1
  22. package/cjs/src/embed/ts-embed.d.ts +34 -12
  23. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  24. package/cjs/src/embed/ts-embed.js +98 -142
  25. package/cjs/src/embed/ts-embed.js.map +1 -1
  26. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  27. package/cjs/src/embed/ts-embed.spec.js +171 -138
  28. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  29. package/dist/{index-CcBYlGo9.js → index-Bt56pC82.js} +1 -1
  30. package/dist/src/embed/liveboard.d.ts +1 -0
  31. package/dist/src/embed/liveboard.d.ts.map +1 -1
  32. package/dist/src/embed/ts-embed.d.ts +34 -12
  33. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  34. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  35. package/dist/tsembed-react.es.js +161 -155
  36. package/dist/tsembed-react.js +160 -154
  37. package/dist/tsembed.es.js +162 -156
  38. package/dist/tsembed.js +161 -155
  39. package/dist/visual-embed-sdk-react-full.d.ts +35 -12
  40. package/dist/visual-embed-sdk-react.d.ts +35 -12
  41. package/dist/visual-embed-sdk.d.ts +35 -12
  42. package/lib/package.json +2 -2
  43. package/lib/src/embed/app.js +1 -1
  44. package/lib/src/embed/app.js.map +1 -1
  45. package/lib/src/embed/auto-frame-renderer.js +1 -1
  46. package/lib/src/embed/auto-frame-renderer.js.map +1 -1
  47. package/lib/src/embed/bodyless-conversation.js +1 -1
  48. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  49. package/lib/src/embed/conversation.js +1 -1
  50. package/lib/src/embed/conversation.js.map +1 -1
  51. package/lib/src/embed/liveboard.d.ts +1 -0
  52. package/lib/src/embed/liveboard.d.ts.map +1 -1
  53. package/lib/src/embed/liveboard.js +15 -4
  54. package/lib/src/embed/liveboard.js.map +1 -1
  55. package/lib/src/embed/liveboard.spec.js +54 -0
  56. package/lib/src/embed/liveboard.spec.js.map +1 -1
  57. package/lib/src/embed/search-bar.js +1 -1
  58. package/lib/src/embed/search-bar.js.map +1 -1
  59. package/lib/src/embed/search.js +1 -1
  60. package/lib/src/embed/search.js.map +1 -1
  61. package/lib/src/embed/search.spec.js +0 -20
  62. package/lib/src/embed/search.spec.js.map +1 -1
  63. package/lib/src/embed/ts-embed.d.ts +34 -12
  64. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  65. package/lib/src/embed/ts-embed.js +99 -143
  66. package/lib/src/embed/ts-embed.js.map +1 -1
  67. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  68. package/lib/src/embed/ts-embed.spec.js +172 -139
  69. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  70. package/lib/src/visual-embed-sdk.d.ts +35 -12
  71. package/package.json +2 -2
  72. package/src/embed/app.ts +1 -1
  73. package/src/embed/auto-frame-renderer.ts +1 -1
  74. package/src/embed/bodyless-conversation.ts +1 -1
  75. package/src/embed/conversation.ts +1 -1
  76. package/src/embed/liveboard.spec.ts +62 -0
  77. package/src/embed/liveboard.ts +18 -4
  78. package/src/embed/search-bar.tsx +1 -1
  79. package/src/embed/search.spec.ts +0 -23
  80. package/src/embed/search.ts +1 -1
  81. package/src/embed/ts-embed.spec.ts +213 -179
  82. package/src/embed/ts-embed.ts +96 -149
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.52.2-beta */
1
+ /* @thoughtspot/visual-embed-sdk version 1.52.2-beta.1 */
2
2
  'use client';
3
3
  import * as React from 'react';
4
4
  import React__default, { useRef, useCallback } from 'react';
@@ -7828,7 +7828,7 @@ var TableContentDensity;
7828
7828
  TableContentDensity["Compact"] = "COMPACT";
7829
7829
  })(TableContentDensity || (TableContentDensity = {}));
7830
7830
 
7831
- var version$1="1.52.2-beta";var pkg = {version:version$1};
7831
+ var version$1="1.52.2-beta.1";var pkg = {version:version$1};
7832
7832
 
7833
7833
  const { version } = pkg;
7834
7834
 
@@ -10565,7 +10565,7 @@ class AnswerService {
10565
10565
  async getTML() {
10566
10566
  const { object } = await this.executeQuery(getAnswerTML, {});
10567
10567
  const edoc = object[0].edoc;
10568
- const YAML = await import('./index-CcBYlGo9.js');
10568
+ const YAML = await import('./index-Bt56pC82.js');
10569
10569
  const parsedDoc = YAML.parse(edoc);
10570
10570
  return {
10571
10571
  answer: {
@@ -21867,6 +21867,9 @@ const TS_EMBED_ID = '_thoughtspot-embed';
21867
21867
  */
21868
21868
  const PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY = 'tsEmbedOriginalPosition';
21869
21869
  const PRERENDER_WRAPPER_ID_PREFIX = 'tsEmbed-pre-render-wrapper-';
21870
+ const PRERENDER_PARKED_TRANSFORM = 'translateY(-100%)';
21871
+ /** The height createPreRenderWrapper() seeds before anything is measured. */
21872
+ const UNMEASURED_WRAPPER_HEIGHT = '100vh';
21870
21873
  // The container applies UpdateEmbedParams through React state, so a delivered
21871
21874
  // post is not the same as the params being in effect.
21872
21875
  const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
@@ -21874,56 +21877,6 @@ const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
21874
21877
  // truthy, so null or '' leaves the previous embed's values in place. '&' is
21875
21878
  // truthy and parses to {}.
21876
21879
  const NO_RUNTIME_PARAMS = '&';
21877
- /**
21878
- * Query parameters that stay on the iframe `src` while config is excluded from
21879
- * the URL, which is the default unless the embed sets the
21880
- * `excludeConfigFromURL` additional flag to `false`. These are the parameters the
21881
- * application shell needs before it can receive a postMessage at all: the
21882
- * embed marker, the host application URL used to validate the message origin,
21883
- * the SDK version, the flags that pick the authentication flow, and the
21884
- * boot-time settings that would otherwise be applied a frame late (viewport,
21885
- * log level, locale, formatting and org). Everything else is delivered over
21886
- * `HostEvent.UpdateEmbedParams`.
21887
- * @internal
21888
- */
21889
- const BOOTSTRAP_URL_PARAMS = new Set([
21890
- Param.EmbedApp,
21891
- Param.HostAppUrl,
21892
- Param.Version,
21893
- Param.AuthType,
21894
- Param.AutoLogin,
21895
- Param.DisableLoginRedirect,
21896
- Param.ForceSAMLAutoRedirect,
21897
- Param.cookieless,
21898
- Param.preAuthCache,
21899
- Param.blockNonEmbedFullAppAccess,
21900
- Param.OverrideOrgId,
21901
- Param.ViewPortHeight,
21902
- Param.ViewPortWidth,
21903
- Param.ClientLogLevel,
21904
- Param.OverrideNativeConsole,
21905
- Param.PendoTrackingKey,
21906
- Param.NumberFormatLocale,
21907
- Param.DateFormatLocale,
21908
- Param.CurrencyFormat,
21909
- Param.Locale,
21910
- Param.searchEmbed,
21911
- Param.livedBoardEmbed,
21912
- Param.isSpotterAgentEmbed,
21913
- Param.SpotterEnabled,
21914
- Param.IsFullAppEmbed,
21915
- Param.IsOnBeforeGetVizDataInterceptEnabled,
21916
- Param.LinkOverride,
21917
- Param.EnableLinkOverridesV2,
21918
- Param.DisableRedirectionLinksInNewTab,
21919
- Param.OverrideHistoryState,
21920
- Param.ForceTable,
21921
- Param.StringIDsUrl,
21922
- Param.DataSources,
21923
- Param.ExposeTranslationIDs,
21924
- Param.IconSpriteUrl,
21925
- Param.Tag,
21926
- ]);
21927
21880
  /**
21928
21881
  * The event id map from v2 event names to v1 event id
21929
21882
  * v1 events are the classic embed events implemented in Blink v1
@@ -21961,7 +21914,6 @@ class TsEmbed {
21961
21914
  this.shouldEncodeUrlQueryParams = false;
21962
21915
  this.defaultHiddenActions = [Action.ReportError];
21963
21916
  this.preRenderContainerEl = document.body;
21964
- this.containerScrollListener = null;
21965
21917
  /**
21966
21918
  * Handler for fullscreen change events
21967
21919
  */
@@ -22126,9 +22078,6 @@ class TsEmbed {
22126
22078
  }
22127
22079
  else if (source === EmbedEvent.EmbedListenerReady) {
22128
22080
  processEmbedContainerReady();
22129
- if (this.isConfigExcludedFromUrl()) {
22130
- this.triggerUpdateEmbedParams();
22131
- }
22132
22081
  }
22133
22082
  };
22134
22083
  // Subclasses that navigate the pre-render on show must await this before
@@ -22633,20 +22582,13 @@ class TsEmbed {
22633
22582
  return path;
22634
22583
  }
22635
22584
  getEmbedParams() {
22636
- const queryParams = this.getUrlQueryParamsObject();
22585
+ const queryParams = this.getEmbedParamsObject();
22637
22586
  return getQueryParamString(queryParams);
22638
22587
  }
22639
22588
  getEmbedParamsObject() {
22640
22589
  const params = this.getBaseQueryParams();
22641
22590
  return params;
22642
22591
  }
22643
- getUrlQueryParamsObject() {
22644
- const queryParams = this.getEmbedParamsObject();
22645
- if (!this.isConfigExcludedFromUrl()) {
22646
- return queryParams;
22647
- }
22648
- return Object.fromEntries(Object.entries(queryParams).filter(([key]) => BOOTSTRAP_URL_PARAMS.has(key)));
22649
- }
22650
22592
  getRootIframeSrc() {
22651
22593
  const query = this.getEmbedParams();
22652
22594
  return this.getEmbedBasePath(query);
@@ -22817,7 +22759,7 @@ class TsEmbed {
22817
22759
  top: '0',
22818
22760
  left: '0',
22819
22761
  width: '100vw',
22820
- height: '100vh',
22762
+ height: UNMEASURED_WRAPPER_HEIGHT,
22821
22763
  };
22822
22764
  setStyleProperties(preRenderWrapper, initialPreRenderWrapperStyle);
22823
22765
  return preRenderWrapper;
@@ -22885,10 +22827,26 @@ class TsEmbed {
22885
22827
  return placeholder;
22886
22828
  }
22887
22829
  /**
22888
- * Resolves the configured preRenderContainer to a live element, falling
22889
- * back to `document.body`. A string selector is re-queried on every call so
22890
- * a remounted container (E.g.: React replacing the node) resolves to the
22891
- * fresh element; an element passed directly cannot be re-resolved.
22830
+ * Resolves the configured preRenderContainer to a live element. A string
22831
+ * selector is re-queried on every call so a remounted container (E.g.: React
22832
+ * replacing the node) resolves to the fresh element; an element passed
22833
+ * directly cannot be re-resolved.
22834
+ *
22835
+ * With nothing configured the frame goes into the host element's nearest
22836
+ * scrolling ancestor, falling back to `document.body`.
22837
+ *
22838
+ * The wrapper is absolutely positioned, so it follows the page for free —
22839
+ * but only while it sits inside whatever scrolls. `document.body` is right
22840
+ * only when the document itself is the scroller; an app that scrolls an
22841
+ * inner element instead left the frame pinned to the viewport while the page
22842
+ * moved under it (SCAL-338563). Being inside the scroller also lets wheel
22843
+ * events chain out of the frame into it, which they cannot do from
22844
+ * `document.body`.
22845
+ *
22846
+ * A scrolling ancestor is layout chrome rather than route content, so it
22847
+ * outlives the embed in practice; and if it does go, the host element goes
22848
+ * with it and this instance is remounting anyway.
22849
+ * `reconcilePreRenderContainer` re-runs this on a detached container.
22892
22850
  */
22893
22851
  resolvePreRenderContainerTarget() {
22894
22852
  var _a;
@@ -22908,7 +22866,13 @@ class TsEmbed {
22908
22866
  else if (containerConfig) {
22909
22867
  container = containerConfig;
22910
22868
  }
22911
- return (_a = container) !== null && _a !== void 0 ? _a : document.body;
22869
+ if (container) {
22870
+ return container;
22871
+ }
22872
+ if (!this.hostElement) {
22873
+ return document.body;
22874
+ }
22875
+ return (_a = getScrollableAncestors(this.hostElement)[0]) !== null && _a !== void 0 ? _a : document.body;
22912
22876
  }
22913
22877
  inheritPreRenderContainer() {
22914
22878
  var _a;
@@ -22953,8 +22917,9 @@ class TsEmbed {
22953
22917
  * Re-attaches the wrapper to a live container when the previously resolved
22954
22918
  * one has been detached or no longer holds the wrapper — e.g. the host app
22955
22919
  * remounted a custom preRenderContainer, which would otherwise leave a stale
22956
- * reference and collapse the wrapper. Only string selectors can be
22957
- * re-resolved; a container passed as an element is left untouched.
22920
+ * reference and collapse the wrapper. Selectors and the auto-resolved
22921
+ * scrolling ancestor are both re-resolved; a container passed as an element
22922
+ * is left untouched, as there is nothing to re-query.
22958
22923
  */
22959
22924
  reconcilePreRenderContainer() {
22960
22925
  const wrapper = this.preRenderWrapper;
@@ -22973,14 +22938,6 @@ class TsEmbed {
22973
22938
  if (resolved === stored && stored.contains(wrapper)) {
22974
22939
  return;
22975
22940
  }
22976
- if (this.containerScrollListener && stored !== resolved) {
22977
- if (stored !== document.body) {
22978
- stored.removeEventListener('scroll', this.containerScrollListener);
22979
- }
22980
- if (resolved !== document.body) {
22981
- resolved.addEventListener('scroll', this.containerScrollListener);
22982
- }
22983
- }
22984
22941
  this.preRenderContainerEl = resolved;
22985
22942
  this.applyPreRenderContainerPositioning();
22986
22943
  if (wrapper.parentNode !== resolved) {
@@ -23042,11 +22999,12 @@ class TsEmbed {
23042
22999
  */
23043
23000
  setIFrameHeight(height) {
23044
23001
  if (this.isPreRendered) {
23002
+ const next = getCssDimension(height);
23045
23003
  if (this.insertedDomEl) {
23046
- this.insertedDomEl.style.height = getCssDimension(height);
23004
+ this.insertedDomEl.style.height = next;
23047
23005
  }
23048
23006
  else if (this.preRenderWrapper) {
23049
- this.preRenderWrapper.style.height = getCssDimension(height);
23007
+ this.preRenderWrapper.style.height = next;
23050
23008
  }
23051
23009
  }
23052
23010
  else {
@@ -23481,34 +23439,47 @@ class TsEmbed {
23481
23439
  delete container.dataset[PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY];
23482
23440
  }
23483
23441
  /**
23484
- * Detaches and clears the container scroll listener, if one is attached.
23485
- */
23486
- removeContainerScrollListener() {
23487
- if (!this.containerScrollListener) {
23442
+ * Re-sizes the wrapper when its placeholder changes size.
23443
+ *
23444
+ * Position deliberately has no equivalent. An absolutely positioned wrapper
23445
+ * follows its containing block for free, so a correctly placed frame is the
23446
+ * browser's job and costs nothing; repositioning it on scroll would mean a
23447
+ * layout read and a style write per frame to compensate for placing it in
23448
+ * the wrong box. Size is the one thing the browser will not do for us: the
23449
+ * placeholder grows when the embedded app reports a new height, and the
23450
+ * wrapper has to be told.
23451
+ */
23452
+ observePreRenderSize() {
23453
+ var _a;
23454
+ if (this.getPreRenderConfig().doNotTrackSize || typeof ResizeObserver === 'undefined') {
23455
+ return;
23456
+ }
23457
+ const placeholder = this.getPreRenderPlaceHolderElement();
23458
+ if (!placeholder) {
23488
23459
  return;
23489
23460
  }
23490
- const customContainer = this.getCustomPreRenderContainer();
23491
- customContainer === null || customContainer === void 0 ? void 0 : customContainer.removeEventListener('scroll', this.containerScrollListener);
23492
- this.containerScrollListener = null;
23461
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
23462
+ this.resizeObserver = new ResizeObserver(() => this.syncPreRenderStyle());
23463
+ this.resizeObserver.observe(placeholder);
23493
23464
  }
23494
23465
  /**
23495
23466
  * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
23496
23467
  * @version SDK: 1.19.1 | ThoughtSpot: *
23497
23468
  */
23498
23469
  destroy() {
23499
- var _a, _b, _c;
23470
+ var _a, _b, _c, _d;
23500
23471
  try {
23501
23472
  this.removeFullscreenChangeHandler();
23502
- this.removeContainerScrollListener();
23473
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
23503
23474
  this.unsubscribeToEvents();
23504
- (_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a.remove();
23475
+ (_b = this.preRenderWrapper) === null || _b === void 0 ? void 0 : _b.remove();
23505
23476
  this.restorePreRenderContainerPosition();
23506
23477
  if (!this.isRendered) {
23507
23478
  return;
23508
23479
  }
23509
23480
  if (!getEmbedConfig().waitForCleanupOnDestroy) {
23510
23481
  this.trigger(HostEvent.DestroyEmbed);
23511
- (_c = (_b = this.insertedDomEl) === null || _b === void 0 ? void 0 : _b.parentNode) === null || _c === void 0 ? void 0 : _c.removeChild(this.insertedDomEl);
23482
+ (_d = (_c = this.insertedDomEl) === null || _c === void 0 ? void 0 : _c.parentNode) === null || _d === void 0 ? void 0 : _d.removeChild(this.insertedDomEl);
23512
23483
  }
23513
23484
  else {
23514
23485
  const cleanupTimeout = getEmbedConfig().cleanupTimeout;
@@ -23554,27 +23525,6 @@ class TsEmbed {
23554
23525
  this.isRendered = true;
23555
23526
  return this.renderIFrame(prerenderFrameSrc);
23556
23527
  }
23557
- isConfigExcludedFromUrl() {
23558
- var _a, _b, _c;
23559
- const flag = (_b = (_a = this.viewConfig.additionalFlags) === null || _a === void 0 ? void 0 : _a.excludeConfigFromURL) !== null && _b !== void 0 ? _b : (_c = this.embedConfig.additionalFlags) === null || _c === void 0 ? void 0 : _c.excludeConfigFromURL;
23560
- // Enabled by default; only an explicit false opts out.
23561
- return flag !== false && flag !== 'false';
23562
- }
23563
- async triggerUpdateEmbedParams() {
23564
- try {
23565
- const params = await this.getUpdateEmbedParamsObject();
23566
- this.trigger(HostEvent.UpdateEmbedParams, params);
23567
- }
23568
- catch (error) {
23569
- logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
23570
- this.handleError({
23571
- errorType: ErrorDetailsTypes.API,
23572
- message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
23573
- code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
23574
- error: (error === null || error === void 0 ? void 0 : error.message) || error,
23575
- });
23576
- }
23577
- }
23578
23528
  beforePrerenderVisible() {
23579
23529
  // We can ignore this as its a bit expensive and the newer customers
23580
23530
  // have moved on to UpdateEmbedParams supported clusters
@@ -23585,7 +23535,17 @@ class TsEmbed {
23585
23535
  this.preRenderParamsApplied = new Promise((resolve) => {
23586
23536
  this.executeAfterEmbedContainerLoaded(async () => {
23587
23537
  try {
23588
- await this.triggerUpdateEmbedParams();
23538
+ const params = await this.getUpdateEmbedParamsObject();
23539
+ this.trigger(HostEvent.UpdateEmbedParams, params);
23540
+ }
23541
+ catch (error) {
23542
+ logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
23543
+ this.handleError({
23544
+ errorType: ErrorDetailsTypes.API,
23545
+ message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
23546
+ code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
23547
+ error: (error === null || error === void 0 ? void 0 : error.message) || error,
23548
+ });
23589
23549
  }
23590
23550
  finally {
23591
23551
  setTimeout(resolve, UPDATE_EMBED_PARAMS_SETTLE_MS);
@@ -23600,7 +23560,7 @@ class TsEmbed {
23600
23560
  * wrapper to overlay it.
23601
23561
  */
23602
23562
  async showPreRender() {
23603
- var _a, _b;
23563
+ var _a;
23604
23564
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_SHOW_PRE_RENDER, {
23605
23565
  preRenderId: this.getPreRenderConfig().id,
23606
23566
  embedComponentType: this.viewConfig.embedComponentType,
@@ -23619,14 +23579,16 @@ class TsEmbed {
23619
23579
  this.beforePrerenderVisible();
23620
23580
  if (this.hostElement) {
23621
23581
  this.insertedDomEl = this.createPreRenderPlaceholder();
23622
- if (this.viewConfig.fullHeight) {
23623
- // If fullHeight has already sized the wrapper, seed the
23624
- // placeholder with the same height so syncPreRenderStyle gets
23625
- // an accurate rect.
23626
- const existingHeight = this.preRenderWrapper.style.height;
23627
- if (existingHeight) {
23628
- this.insertedDomEl.style.height = existingHeight;
23629
- }
23582
+ // Carry a height fullHeight has already measured onto the fresh
23583
+ // placeholder, so a re-show does not flash at frameParams height.
23584
+ // UNMEASURED_WRAPPER_HEIGHT is what createPreRenderWrapper() seeds
23585
+ // before anything has been measured; treating that as a measurement
23586
+ // is what made a first reveal overshoot to a full viewport.
23587
+ const wrapperHeight = this.preRenderWrapper.style.height;
23588
+ if (this.viewConfig.fullHeight
23589
+ && wrapperHeight
23590
+ && wrapperHeight !== UNMEASURED_WRAPPER_HEIGHT) {
23591
+ this.insertedDomEl.style.height = wrapperHeight;
23630
23592
  }
23631
23593
  const placeHolderId = this.getPreRenderIds().placeHolder;
23632
23594
  // Remove any stale placeholder from a previous cycle. It is located
@@ -23640,29 +23602,19 @@ class TsEmbed {
23640
23602
  (_a = this.hostElement.querySelector(`#${placeHolderId}`)) === null || _a === void 0 ? void 0 : _a.remove();
23641
23603
  this.hostElement.appendChild(this.insertedDomEl);
23642
23604
  this.syncPreRenderStyle();
23643
- const customContainer = this.getCustomPreRenderContainer();
23644
- if (customContainer && !this.containerScrollListener) {
23645
- this.containerScrollListener = () => this.syncPreRenderStyle();
23646
- customContainer.addEventListener('scroll', this.containerScrollListener);
23647
- }
23648
- if (!this.getPreRenderConfig().doNotTrackSize) {
23649
- const observeTarget = (_b = this.insertedDomEl) !== null && _b !== void 0 ? _b : this.hostElement;
23650
- this.resizeObserver = new ResizeObserver((entries) => {
23651
- entries.forEach((entry) => {
23652
- if (entry.target === observeTarget) {
23653
- this.syncPreRenderStyle();
23654
- }
23655
- });
23656
- });
23657
- this.resizeObserver.observe(observeTarget);
23658
- }
23605
+ this.observePreRenderSize();
23659
23606
  }
23660
23607
  removeStyleProperties(this.preRenderWrapper, [
23661
23608
  'z-index',
23662
23609
  'opacity',
23663
- 'pointer-events',
23664
23610
  'overflow',
23611
+ 'transform',
23665
23612
  ]);
23613
+ // Set rather than removed: a container that carries `pointer-events:
23614
+ // none` — the usual styling for a parking root that must not swallow
23615
+ // clicks — passes it down, and dropping the property here would leave
23616
+ // the inherited `none` in force and the frame dead to input.
23617
+ setStyleProperties(this.preRenderWrapper, { pointerEvents: 'auto' });
23666
23618
  this.subscribeToEvents();
23667
23619
  // Setup fullscreen change handler for prerendered components
23668
23620
  if (this.iFrame) {
@@ -23715,6 +23667,7 @@ class TsEmbed {
23715
23667
  * If the component is not preRendered, it issues a warning.
23716
23668
  */
23717
23669
  hidePreRender() {
23670
+ var _a;
23718
23671
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_HIDE_PRE_RENDER, {
23719
23672
  preRenderId: this.getPreRenderConfig().id,
23720
23673
  embedComponentType: this.viewConfig.embedComponentType,
@@ -23734,12 +23687,15 @@ class TsEmbed {
23734
23687
  top: '0',
23735
23688
  left: '0',
23736
23689
  overflow: 'hidden',
23690
+ // Keeps the measured size — so the next show needs no resize, which
23691
+ // is the point of pre-rendering — while lifting the box out of
23692
+ // the container's scrollable area. Overflow only extends
23693
+ // downwards, so a hidden frame parked above the top edge adds
23694
+ // none, where one left at full height shows as blank scroll space.
23695
+ transform: PRERENDER_PARKED_TRANSFORM,
23737
23696
  };
23738
23697
  setStyleProperties(this.preRenderWrapper, preRenderHideStyles);
23739
- this.removeContainerScrollListener();
23740
- if (this.resizeObserver) {
23741
- this.resizeObserver.disconnect();
23742
- }
23698
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
23743
23699
  const placeHolderEle = this.getPreRenderPlaceHolderElement();
23744
23700
  if (placeHolderEle) {
23745
23701
  placeHolderEle.parentElement.removeChild(placeHolderEle);
@@ -23924,7 +23880,7 @@ let SearchBarEmbed$1 = class SearchBarEmbed extends TsEmbed {
23924
23880
  * @param dataSources A list of data source GUIDs
23925
23881
  */
23926
23882
  getIFrameSrc() {
23927
- const queryParams = this.getUrlQueryParamsObject();
23883
+ const queryParams = this.getEmbedParamsObject();
23928
23884
  const path = 'search-bar-embed';
23929
23885
  let query = '';
23930
23886
  const queryParamsString = getQueryParamString(queryParams, true);
@@ -24111,7 +24067,7 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
24111
24067
  }
24112
24068
  getEmbedParams() {
24113
24069
  const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
24114
- const queryParams = this.getUrlQueryParamsObject();
24070
+ const queryParams = this.getEmbedParamsObject();
24115
24071
  let query = '';
24116
24072
  const queryParamsString = getQueryParamString(queryParams, true);
24117
24073
  if (queryParamsString) {
@@ -24704,7 +24660,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
24704
24660
  * embedded Liveboard or visualization.
24705
24661
  */
24706
24662
  getEmbedParams() {
24707
- const params = this.getUrlQueryParamsObject();
24663
+ const params = this.getEmbedParamsObject();
24708
24664
  return getQueryParamString(params, true);
24709
24665
  }
24710
24666
  getEmbedParamsObject() {
@@ -25021,6 +24977,46 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
25021
24977
  }
25022
24978
  };
25023
24979
 
24980
+ /**
24981
+ * This method is like `_.isEqual` except that it accepts `customizer` which
24982
+ * is invoked to compare values. If `customizer` returns `undefined`, comparisons
24983
+ * are handled by the method instead. The `customizer` is invoked with up to
24984
+ * six arguments: (objValue, othValue [, index|key, object, other, stack]).
24985
+ *
24986
+ * @static
24987
+ * @memberOf _
24988
+ * @since 4.0.0
24989
+ * @category Lang
24990
+ * @param {*} value The value to compare.
24991
+ * @param {*} other The other value to compare.
24992
+ * @param {Function} [customizer] The function to customize comparisons.
24993
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
24994
+ * @example
24995
+ *
24996
+ * function isGreeting(value) {
24997
+ * return /^h(?:i|ello)$/.test(value);
24998
+ * }
24999
+ *
25000
+ * function customizer(objValue, othValue) {
25001
+ * if (isGreeting(objValue) && isGreeting(othValue)) {
25002
+ * return true;
25003
+ * }
25004
+ * }
25005
+ *
25006
+ * var array = ['hello', 'goodbye'];
25007
+ * var other = ['hi', 'goodbye'];
25008
+ *
25009
+ * _.isEqualWith(array, other, customizer);
25010
+ * // => true
25011
+ */
25012
+ function isEqualWith(value, other, customizer) {
25013
+ customizer = typeof customizer == 'function' ? customizer : undefined;
25014
+ var result = customizer ? customizer(value, other) : undefined;
25015
+ return result === undefined ? _baseIsEqual(value, other, undefined, customizer) : !!result;
25016
+ }
25017
+
25018
+ var isEqualWith_1 = isEqualWith;
25019
+
25024
25020
  const getPreviewQuery = `
25025
25021
  query GetEurekaVizSnapshots(
25026
25022
  $vizId: String!, $liveboardId: String!) {
@@ -25162,7 +25158,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
25162
25158
  * embedded Liveboard or visualization.
25163
25159
  */
25164
25160
  getEmbedParams() {
25165
- const params = this.getUrlQueryParamsObject();
25161
+ const params = this.getEmbedParamsObject();
25166
25162
  const queryParams = getQueryParamString(params, true);
25167
25163
  return queryParams;
25168
25164
  }
@@ -25401,10 +25397,12 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
25401
25397
  beforePrerenderVisible() {
25402
25398
  super.beforePrerenderVisible();
25403
25399
  // Captured before showPreRender() hands the wrapper over to this
25404
- // instance. Itself means a hide/show, not a hand-over, so there is
25405
- // nothing stale to clear.
25400
+ // instance. React builds a new instance per mount, so an equal config
25401
+ // is a hide/show, not a hand-over: there is nothing stale to clear.
25406
25402
  const previous = this.getPreRenderObj();
25407
- const showing = previous === this ? undefined : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
25403
+ const showing = this.isSameEmbedConfig(previous)
25404
+ ? undefined
25405
+ : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
25408
25406
  this.executeAfterEmbedContainerLoaded(async () => {
25409
25407
  // Without this the params callback suspends on its await and
25410
25408
  // Navigate goes out first, so the container loads with the previous
@@ -25431,6 +25429,14 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
25431
25429
  };
25432
25430
  });
25433
25431
  }
25432
+ // Callbacks are compared as equal: React passes a fresh closure per render.
25433
+ isSameEmbedConfig(previous) {
25434
+ if (!previous)
25435
+ return false;
25436
+ if (previous === this)
25437
+ return true;
25438
+ return isEqualWith_1(previous.viewConfig, this.viewConfig, (a, b) => (typeof a === 'function' && typeof b === 'function' ? true : undefined));
25439
+ }
25434
25440
  // The whole route, not just the liveboard id: the path is built from the
25435
25441
  // viz, tab and view too, so a same-liveboard show onto another tab is a
25436
25442
  // real navigation.
@@ -25935,7 +25941,7 @@ let ConversationMessage$1 = class ConversationMessage extends TsEmbed {
25935
25941
  getIframeSrc() {
25936
25942
  const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
25937
25943
  const path = 'conv-assist-answer';
25938
- const queryParams = this.getUrlQueryParamsObject();
25944
+ const queryParams = this.getEmbedParamsObject();
25939
25945
  let query = '';
25940
25946
  const queryParamsString = getQueryParamString(queryParams, true);
25941
25947
  if (queryParamsString) {
@@ -26138,7 +26144,7 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
26138
26144
  const path = sharedConversationId
26139
26145
  ? `insights/conv-assist/s/${encodeURIComponent(sharedConversationId)}`
26140
26146
  : 'insights/conv-assist';
26141
- const queryParams = this.getUrlQueryParamsObject();
26147
+ const queryParams = this.getEmbedParamsObject();
26142
26148
  let query = '';
26143
26149
  const queryParamsString = getQueryParamString(queryParams, true);
26144
26150
  if (queryParamsString) {