@thoughtspot/visual-embed-sdk 1.52.2-beta → 1.52.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +2 -2
- package/cjs/src/embed/app.js +1 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/auto-frame-renderer.js +1 -1
- package/cjs/src/embed/auto-frame-renderer.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +1 -1
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/conversation.js +1 -1
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/liveboard.js +1 -1
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/search-bar.js +1 -1
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.js +1 -1
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +0 -20
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +34 -12
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +98 -142
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +171 -138
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/dist/{index-CcBYlGo9.js → index-BrJMbt8r.js} +1 -1
- package/dist/src/embed/ts-embed.d.ts +34 -12
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +108 -152
- package/dist/tsembed-react.js +107 -151
- package/dist/tsembed.es.js +109 -153
- package/dist/tsembed.js +108 -152
- package/dist/visual-embed-sdk-react-full.d.ts +34 -12
- package/dist/visual-embed-sdk-react.d.ts +34 -12
- package/dist/visual-embed-sdk.d.ts +34 -12
- package/lib/package.json +2 -2
- package/lib/src/embed/app.js +1 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/auto-frame-renderer.js +1 -1
- package/lib/src/embed/auto-frame-renderer.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +1 -1
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/conversation.js +1 -1
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/liveboard.js +1 -1
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/search-bar.js +1 -1
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.js +1 -1
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +0 -20
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +34 -12
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +99 -143
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +172 -139
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +34 -12
- package/package.json +2 -2
- package/src/embed/app.ts +1 -1
- package/src/embed/auto-frame-renderer.ts +1 -1
- package/src/embed/bodyless-conversation.ts +1 -1
- package/src/embed/conversation.ts +1 -1
- package/src/embed/liveboard.ts +1 -1
- package/src/embed/search-bar.tsx +1 -1
- package/src/embed/search.spec.ts +0 -23
- package/src/embed/search.ts +1 -1
- package/src/embed/ts-embed.spec.ts +213 -179
- package/src/embed/ts-embed.ts +96 -149
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.52.2-beta */
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.52.2-beta.0 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -7850,7 +7850,7 @@
|
|
|
7850
7850
|
TableContentDensity["Compact"] = "COMPACT";
|
|
7851
7851
|
})(TableContentDensity || (TableContentDensity = {}));
|
|
7852
7852
|
|
|
7853
|
-
var version$1="1.52.2-beta";var pkg = {version:version$1};
|
|
7853
|
+
var version$1="1.52.2-beta.0";var pkg = {version:version$1};
|
|
7854
7854
|
|
|
7855
7855
|
const { version } = pkg;
|
|
7856
7856
|
|
|
@@ -21889,6 +21889,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21889
21889
|
*/
|
|
21890
21890
|
const PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY = 'tsEmbedOriginalPosition';
|
|
21891
21891
|
const PRERENDER_WRAPPER_ID_PREFIX = 'tsEmbed-pre-render-wrapper-';
|
|
21892
|
+
const PRERENDER_PARKED_TRANSFORM = 'translateY(-100%)';
|
|
21893
|
+
/** The height createPreRenderWrapper() seeds before anything is measured. */
|
|
21894
|
+
const UNMEASURED_WRAPPER_HEIGHT = '100vh';
|
|
21892
21895
|
// The container applies UpdateEmbedParams through React state, so a delivered
|
|
21893
21896
|
// post is not the same as the params being in effect.
|
|
21894
21897
|
const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
|
|
@@ -21896,56 +21899,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21896
21899
|
// truthy, so null or '' leaves the previous embed's values in place. '&' is
|
|
21897
21900
|
// truthy and parses to {}.
|
|
21898
21901
|
const NO_RUNTIME_PARAMS = '&';
|
|
21899
|
-
/**
|
|
21900
|
-
* Query parameters that stay on the iframe `src` while config is excluded from
|
|
21901
|
-
* the URL, which is the default unless the embed sets the
|
|
21902
|
-
* `excludeConfigFromURL` additional flag to `false`. These are the parameters the
|
|
21903
|
-
* application shell needs before it can receive a postMessage at all: the
|
|
21904
|
-
* embed marker, the host application URL used to validate the message origin,
|
|
21905
|
-
* the SDK version, the flags that pick the authentication flow, and the
|
|
21906
|
-
* boot-time settings that would otherwise be applied a frame late (viewport,
|
|
21907
|
-
* log level, locale, formatting and org). Everything else is delivered over
|
|
21908
|
-
* `HostEvent.UpdateEmbedParams`.
|
|
21909
|
-
* @internal
|
|
21910
|
-
*/
|
|
21911
|
-
const BOOTSTRAP_URL_PARAMS = new Set([
|
|
21912
|
-
Param.EmbedApp,
|
|
21913
|
-
Param.HostAppUrl,
|
|
21914
|
-
Param.Version,
|
|
21915
|
-
Param.AuthType,
|
|
21916
|
-
Param.AutoLogin,
|
|
21917
|
-
Param.DisableLoginRedirect,
|
|
21918
|
-
Param.ForceSAMLAutoRedirect,
|
|
21919
|
-
Param.cookieless,
|
|
21920
|
-
Param.preAuthCache,
|
|
21921
|
-
Param.blockNonEmbedFullAppAccess,
|
|
21922
|
-
Param.OverrideOrgId,
|
|
21923
|
-
Param.ViewPortHeight,
|
|
21924
|
-
Param.ViewPortWidth,
|
|
21925
|
-
Param.ClientLogLevel,
|
|
21926
|
-
Param.OverrideNativeConsole,
|
|
21927
|
-
Param.PendoTrackingKey,
|
|
21928
|
-
Param.NumberFormatLocale,
|
|
21929
|
-
Param.DateFormatLocale,
|
|
21930
|
-
Param.CurrencyFormat,
|
|
21931
|
-
Param.Locale,
|
|
21932
|
-
Param.searchEmbed,
|
|
21933
|
-
Param.livedBoardEmbed,
|
|
21934
|
-
Param.isSpotterAgentEmbed,
|
|
21935
|
-
Param.SpotterEnabled,
|
|
21936
|
-
Param.IsFullAppEmbed,
|
|
21937
|
-
Param.IsOnBeforeGetVizDataInterceptEnabled,
|
|
21938
|
-
Param.LinkOverride,
|
|
21939
|
-
Param.EnableLinkOverridesV2,
|
|
21940
|
-
Param.DisableRedirectionLinksInNewTab,
|
|
21941
|
-
Param.OverrideHistoryState,
|
|
21942
|
-
Param.ForceTable,
|
|
21943
|
-
Param.StringIDsUrl,
|
|
21944
|
-
Param.DataSources,
|
|
21945
|
-
Param.ExposeTranslationIDs,
|
|
21946
|
-
Param.IconSpriteUrl,
|
|
21947
|
-
Param.Tag,
|
|
21948
|
-
]);
|
|
21949
21902
|
/**
|
|
21950
21903
|
* The event id map from v2 event names to v1 event id
|
|
21951
21904
|
* v1 events are the classic embed events implemented in Blink v1
|
|
@@ -21983,7 +21936,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21983
21936
|
this.shouldEncodeUrlQueryParams = false;
|
|
21984
21937
|
this.defaultHiddenActions = [exports.Action.ReportError];
|
|
21985
21938
|
this.preRenderContainerEl = document.body;
|
|
21986
|
-
this.containerScrollListener = null;
|
|
21987
21939
|
/**
|
|
21988
21940
|
* Handler for fullscreen change events
|
|
21989
21941
|
*/
|
|
@@ -22148,9 +22100,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22148
22100
|
}
|
|
22149
22101
|
else if (source === exports.EmbedEvent.EmbedListenerReady) {
|
|
22150
22102
|
processEmbedContainerReady();
|
|
22151
|
-
if (this.isConfigExcludedFromUrl()) {
|
|
22152
|
-
this.triggerUpdateEmbedParams();
|
|
22153
|
-
}
|
|
22154
22103
|
}
|
|
22155
22104
|
};
|
|
22156
22105
|
// Subclasses that navigate the pre-render on show must await this before
|
|
@@ -22655,20 +22604,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22655
22604
|
return path;
|
|
22656
22605
|
}
|
|
22657
22606
|
getEmbedParams() {
|
|
22658
|
-
const queryParams = this.
|
|
22607
|
+
const queryParams = this.getEmbedParamsObject();
|
|
22659
22608
|
return getQueryParamString(queryParams);
|
|
22660
22609
|
}
|
|
22661
22610
|
getEmbedParamsObject() {
|
|
22662
22611
|
const params = this.getBaseQueryParams();
|
|
22663
22612
|
return params;
|
|
22664
22613
|
}
|
|
22665
|
-
getUrlQueryParamsObject() {
|
|
22666
|
-
const queryParams = this.getEmbedParamsObject();
|
|
22667
|
-
if (!this.isConfigExcludedFromUrl()) {
|
|
22668
|
-
return queryParams;
|
|
22669
|
-
}
|
|
22670
|
-
return Object.fromEntries(Object.entries(queryParams).filter(([key]) => BOOTSTRAP_URL_PARAMS.has(key)));
|
|
22671
|
-
}
|
|
22672
22614
|
getRootIframeSrc() {
|
|
22673
22615
|
const query = this.getEmbedParams();
|
|
22674
22616
|
return this.getEmbedBasePath(query);
|
|
@@ -22839,7 +22781,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22839
22781
|
top: '0',
|
|
22840
22782
|
left: '0',
|
|
22841
22783
|
width: '100vw',
|
|
22842
|
-
height:
|
|
22784
|
+
height: UNMEASURED_WRAPPER_HEIGHT,
|
|
22843
22785
|
};
|
|
22844
22786
|
setStyleProperties(preRenderWrapper, initialPreRenderWrapperStyle);
|
|
22845
22787
|
return preRenderWrapper;
|
|
@@ -22907,10 +22849,26 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22907
22849
|
return placeholder;
|
|
22908
22850
|
}
|
|
22909
22851
|
/**
|
|
22910
|
-
* Resolves the configured preRenderContainer to a live element
|
|
22911
|
-
*
|
|
22912
|
-
*
|
|
22913
|
-
*
|
|
22852
|
+
* Resolves the configured preRenderContainer to a live element. A string
|
|
22853
|
+
* selector is re-queried on every call so a remounted container (E.g.: React
|
|
22854
|
+
* replacing the node) resolves to the fresh element; an element passed
|
|
22855
|
+
* directly cannot be re-resolved.
|
|
22856
|
+
*
|
|
22857
|
+
* With nothing configured the frame goes into the host element's nearest
|
|
22858
|
+
* scrolling ancestor, falling back to `document.body`.
|
|
22859
|
+
*
|
|
22860
|
+
* The wrapper is absolutely positioned, so it follows the page for free —
|
|
22861
|
+
* but only while it sits inside whatever scrolls. `document.body` is right
|
|
22862
|
+
* only when the document itself is the scroller; an app that scrolls an
|
|
22863
|
+
* inner element instead left the frame pinned to the viewport while the page
|
|
22864
|
+
* moved under it (SCAL-338563). Being inside the scroller also lets wheel
|
|
22865
|
+
* events chain out of the frame into it, which they cannot do from
|
|
22866
|
+
* `document.body`.
|
|
22867
|
+
*
|
|
22868
|
+
* A scrolling ancestor is layout chrome rather than route content, so it
|
|
22869
|
+
* outlives the embed in practice; and if it does go, the host element goes
|
|
22870
|
+
* with it and this instance is remounting anyway.
|
|
22871
|
+
* `reconcilePreRenderContainer` re-runs this on a detached container.
|
|
22914
22872
|
*/
|
|
22915
22873
|
resolvePreRenderContainerTarget() {
|
|
22916
22874
|
var _a;
|
|
@@ -22930,7 +22888,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22930
22888
|
else if (containerConfig) {
|
|
22931
22889
|
container = containerConfig;
|
|
22932
22890
|
}
|
|
22933
|
-
|
|
22891
|
+
if (container) {
|
|
22892
|
+
return container;
|
|
22893
|
+
}
|
|
22894
|
+
if (!this.hostElement) {
|
|
22895
|
+
return document.body;
|
|
22896
|
+
}
|
|
22897
|
+
return (_a = getScrollableAncestors(this.hostElement)[0]) !== null && _a !== void 0 ? _a : document.body;
|
|
22934
22898
|
}
|
|
22935
22899
|
inheritPreRenderContainer() {
|
|
22936
22900
|
var _a;
|
|
@@ -22975,8 +22939,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22975
22939
|
* Re-attaches the wrapper to a live container when the previously resolved
|
|
22976
22940
|
* one has been detached or no longer holds the wrapper — e.g. the host app
|
|
22977
22941
|
* remounted a custom preRenderContainer, which would otherwise leave a stale
|
|
22978
|
-
* reference and collapse the wrapper.
|
|
22979
|
-
* re-resolved; a container passed as an element
|
|
22942
|
+
* reference and collapse the wrapper. Selectors and the auto-resolved
|
|
22943
|
+
* scrolling ancestor are both re-resolved; a container passed as an element
|
|
22944
|
+
* is left untouched, as there is nothing to re-query.
|
|
22980
22945
|
*/
|
|
22981
22946
|
reconcilePreRenderContainer() {
|
|
22982
22947
|
const wrapper = this.preRenderWrapper;
|
|
@@ -22995,14 +22960,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22995
22960
|
if (resolved === stored && stored.contains(wrapper)) {
|
|
22996
22961
|
return;
|
|
22997
22962
|
}
|
|
22998
|
-
if (this.containerScrollListener && stored !== resolved) {
|
|
22999
|
-
if (stored !== document.body) {
|
|
23000
|
-
stored.removeEventListener('scroll', this.containerScrollListener);
|
|
23001
|
-
}
|
|
23002
|
-
if (resolved !== document.body) {
|
|
23003
|
-
resolved.addEventListener('scroll', this.containerScrollListener);
|
|
23004
|
-
}
|
|
23005
|
-
}
|
|
23006
22963
|
this.preRenderContainerEl = resolved;
|
|
23007
22964
|
this.applyPreRenderContainerPositioning();
|
|
23008
22965
|
if (wrapper.parentNode !== resolved) {
|
|
@@ -23064,11 +23021,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23064
23021
|
*/
|
|
23065
23022
|
setIFrameHeight(height) {
|
|
23066
23023
|
if (this.isPreRendered) {
|
|
23024
|
+
const next = getCssDimension(height);
|
|
23067
23025
|
if (this.insertedDomEl) {
|
|
23068
|
-
this.insertedDomEl.style.height =
|
|
23026
|
+
this.insertedDomEl.style.height = next;
|
|
23069
23027
|
}
|
|
23070
23028
|
else if (this.preRenderWrapper) {
|
|
23071
|
-
this.preRenderWrapper.style.height =
|
|
23029
|
+
this.preRenderWrapper.style.height = next;
|
|
23072
23030
|
}
|
|
23073
23031
|
}
|
|
23074
23032
|
else {
|
|
@@ -23503,34 +23461,47 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23503
23461
|
delete container.dataset[PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY];
|
|
23504
23462
|
}
|
|
23505
23463
|
/**
|
|
23506
|
-
*
|
|
23507
|
-
|
|
23508
|
-
|
|
23509
|
-
|
|
23464
|
+
* Re-sizes the wrapper when its placeholder changes size.
|
|
23465
|
+
*
|
|
23466
|
+
* Position deliberately has no equivalent. An absolutely positioned wrapper
|
|
23467
|
+
* follows its containing block for free, so a correctly placed frame is the
|
|
23468
|
+
* browser's job and costs nothing; repositioning it on scroll would mean a
|
|
23469
|
+
* layout read and a style write per frame to compensate for placing it in
|
|
23470
|
+
* the wrong box. Size is the one thing the browser will not do for us: the
|
|
23471
|
+
* placeholder grows when the embedded app reports a new height, and the
|
|
23472
|
+
* wrapper has to be told.
|
|
23473
|
+
*/
|
|
23474
|
+
observePreRenderSize() {
|
|
23475
|
+
var _a;
|
|
23476
|
+
if (this.getPreRenderConfig().doNotTrackSize || typeof ResizeObserver === 'undefined') {
|
|
23510
23477
|
return;
|
|
23511
23478
|
}
|
|
23512
|
-
const
|
|
23513
|
-
|
|
23514
|
-
|
|
23479
|
+
const placeholder = this.getPreRenderPlaceHolderElement();
|
|
23480
|
+
if (!placeholder) {
|
|
23481
|
+
return;
|
|
23482
|
+
}
|
|
23483
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
23484
|
+
this.resizeObserver = new ResizeObserver(() => this.syncPreRenderStyle());
|
|
23485
|
+
this.resizeObserver.observe(placeholder);
|
|
23515
23486
|
}
|
|
23516
23487
|
/**
|
|
23517
23488
|
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
23518
23489
|
* @version SDK: 1.19.1 | ThoughtSpot: *
|
|
23519
23490
|
*/
|
|
23520
23491
|
destroy() {
|
|
23521
|
-
var _a, _b, _c;
|
|
23492
|
+
var _a, _b, _c, _d;
|
|
23522
23493
|
try {
|
|
23523
23494
|
this.removeFullscreenChangeHandler();
|
|
23524
|
-
this.
|
|
23495
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
23525
23496
|
this.unsubscribeToEvents();
|
|
23526
|
-
(
|
|
23497
|
+
(_b = this.preRenderWrapper) === null || _b === void 0 ? void 0 : _b.remove();
|
|
23527
23498
|
this.restorePreRenderContainerPosition();
|
|
23528
23499
|
if (!this.isRendered) {
|
|
23529
23500
|
return;
|
|
23530
23501
|
}
|
|
23531
23502
|
if (!getEmbedConfig().waitForCleanupOnDestroy) {
|
|
23532
23503
|
this.trigger(exports.HostEvent.DestroyEmbed);
|
|
23533
|
-
(
|
|
23504
|
+
(_d = (_c = this.insertedDomEl) === null || _c === void 0 ? void 0 : _c.parentNode) === null || _d === void 0 ? void 0 : _d.removeChild(this.insertedDomEl);
|
|
23534
23505
|
}
|
|
23535
23506
|
else {
|
|
23536
23507
|
const cleanupTimeout = getEmbedConfig().cleanupTimeout;
|
|
@@ -23576,27 +23547,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23576
23547
|
this.isRendered = true;
|
|
23577
23548
|
return this.renderIFrame(prerenderFrameSrc);
|
|
23578
23549
|
}
|
|
23579
|
-
isConfigExcludedFromUrl() {
|
|
23580
|
-
var _a, _b, _c;
|
|
23581
|
-
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;
|
|
23582
|
-
// Enabled by default; only an explicit false opts out.
|
|
23583
|
-
return flag !== false && flag !== 'false';
|
|
23584
|
-
}
|
|
23585
|
-
async triggerUpdateEmbedParams() {
|
|
23586
|
-
try {
|
|
23587
|
-
const params = await this.getUpdateEmbedParamsObject();
|
|
23588
|
-
this.trigger(exports.HostEvent.UpdateEmbedParams, params);
|
|
23589
|
-
}
|
|
23590
|
-
catch (error) {
|
|
23591
|
-
logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
|
|
23592
|
-
this.handleError({
|
|
23593
|
-
errorType: ErrorDetailsTypes.API,
|
|
23594
|
-
message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
|
|
23595
|
-
code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
|
|
23596
|
-
error: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
23597
|
-
});
|
|
23598
|
-
}
|
|
23599
|
-
}
|
|
23600
23550
|
beforePrerenderVisible() {
|
|
23601
23551
|
// We can ignore this as its a bit expensive and the newer customers
|
|
23602
23552
|
// have moved on to UpdateEmbedParams supported clusters
|
|
@@ -23607,7 +23557,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23607
23557
|
this.preRenderParamsApplied = new Promise((resolve) => {
|
|
23608
23558
|
this.executeAfterEmbedContainerLoaded(async () => {
|
|
23609
23559
|
try {
|
|
23610
|
-
await this.
|
|
23560
|
+
const params = await this.getUpdateEmbedParamsObject();
|
|
23561
|
+
this.trigger(exports.HostEvent.UpdateEmbedParams, params);
|
|
23562
|
+
}
|
|
23563
|
+
catch (error) {
|
|
23564
|
+
logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
|
|
23565
|
+
this.handleError({
|
|
23566
|
+
errorType: ErrorDetailsTypes.API,
|
|
23567
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
|
|
23568
|
+
code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
|
|
23569
|
+
error: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
23570
|
+
});
|
|
23611
23571
|
}
|
|
23612
23572
|
finally {
|
|
23613
23573
|
setTimeout(resolve, UPDATE_EMBED_PARAMS_SETTLE_MS);
|
|
@@ -23622,7 +23582,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23622
23582
|
* wrapper to overlay it.
|
|
23623
23583
|
*/
|
|
23624
23584
|
async showPreRender() {
|
|
23625
|
-
var _a
|
|
23585
|
+
var _a;
|
|
23626
23586
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_SHOW_PRE_RENDER, {
|
|
23627
23587
|
preRenderId: this.getPreRenderConfig().id,
|
|
23628
23588
|
embedComponentType: this.viewConfig.embedComponentType,
|
|
@@ -23641,14 +23601,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23641
23601
|
this.beforePrerenderVisible();
|
|
23642
23602
|
if (this.hostElement) {
|
|
23643
23603
|
this.insertedDomEl = this.createPreRenderPlaceholder();
|
|
23644
|
-
|
|
23645
|
-
|
|
23646
|
-
|
|
23647
|
-
|
|
23648
|
-
|
|
23649
|
-
|
|
23650
|
-
|
|
23651
|
-
|
|
23604
|
+
// Carry a height fullHeight has already measured onto the fresh
|
|
23605
|
+
// placeholder, so a re-show does not flash at frameParams height.
|
|
23606
|
+
// UNMEASURED_WRAPPER_HEIGHT is what createPreRenderWrapper() seeds
|
|
23607
|
+
// before anything has been measured; treating that as a measurement
|
|
23608
|
+
// is what made a first reveal overshoot to a full viewport.
|
|
23609
|
+
const wrapperHeight = this.preRenderWrapper.style.height;
|
|
23610
|
+
if (this.viewConfig.fullHeight
|
|
23611
|
+
&& wrapperHeight
|
|
23612
|
+
&& wrapperHeight !== UNMEASURED_WRAPPER_HEIGHT) {
|
|
23613
|
+
this.insertedDomEl.style.height = wrapperHeight;
|
|
23652
23614
|
}
|
|
23653
23615
|
const placeHolderId = this.getPreRenderIds().placeHolder;
|
|
23654
23616
|
// Remove any stale placeholder from a previous cycle. It is located
|
|
@@ -23662,29 +23624,19 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23662
23624
|
(_a = this.hostElement.querySelector(`#${placeHolderId}`)) === null || _a === void 0 ? void 0 : _a.remove();
|
|
23663
23625
|
this.hostElement.appendChild(this.insertedDomEl);
|
|
23664
23626
|
this.syncPreRenderStyle();
|
|
23665
|
-
|
|
23666
|
-
if (customContainer && !this.containerScrollListener) {
|
|
23667
|
-
this.containerScrollListener = () => this.syncPreRenderStyle();
|
|
23668
|
-
customContainer.addEventListener('scroll', this.containerScrollListener);
|
|
23669
|
-
}
|
|
23670
|
-
if (!this.getPreRenderConfig().doNotTrackSize) {
|
|
23671
|
-
const observeTarget = (_b = this.insertedDomEl) !== null && _b !== void 0 ? _b : this.hostElement;
|
|
23672
|
-
this.resizeObserver = new ResizeObserver((entries) => {
|
|
23673
|
-
entries.forEach((entry) => {
|
|
23674
|
-
if (entry.target === observeTarget) {
|
|
23675
|
-
this.syncPreRenderStyle();
|
|
23676
|
-
}
|
|
23677
|
-
});
|
|
23678
|
-
});
|
|
23679
|
-
this.resizeObserver.observe(observeTarget);
|
|
23680
|
-
}
|
|
23627
|
+
this.observePreRenderSize();
|
|
23681
23628
|
}
|
|
23682
23629
|
removeStyleProperties(this.preRenderWrapper, [
|
|
23683
23630
|
'z-index',
|
|
23684
23631
|
'opacity',
|
|
23685
|
-
'pointer-events',
|
|
23686
23632
|
'overflow',
|
|
23633
|
+
'transform',
|
|
23687
23634
|
]);
|
|
23635
|
+
// Set rather than removed: a container that carries `pointer-events:
|
|
23636
|
+
// none` — the usual styling for a parking root that must not swallow
|
|
23637
|
+
// clicks — passes it down, and dropping the property here would leave
|
|
23638
|
+
// the inherited `none` in force and the frame dead to input.
|
|
23639
|
+
setStyleProperties(this.preRenderWrapper, { pointerEvents: 'auto' });
|
|
23688
23640
|
this.subscribeToEvents();
|
|
23689
23641
|
// Setup fullscreen change handler for prerendered components
|
|
23690
23642
|
if (this.iFrame) {
|
|
@@ -23737,6 +23689,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23737
23689
|
* If the component is not preRendered, it issues a warning.
|
|
23738
23690
|
*/
|
|
23739
23691
|
hidePreRender() {
|
|
23692
|
+
var _a;
|
|
23740
23693
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_HIDE_PRE_RENDER, {
|
|
23741
23694
|
preRenderId: this.getPreRenderConfig().id,
|
|
23742
23695
|
embedComponentType: this.viewConfig.embedComponentType,
|
|
@@ -23756,12 +23709,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23756
23709
|
top: '0',
|
|
23757
23710
|
left: '0',
|
|
23758
23711
|
overflow: 'hidden',
|
|
23712
|
+
// Keeps the measured size — so the next show needs no resize, which
|
|
23713
|
+
// is the point of pre-rendering — while lifting the box out of
|
|
23714
|
+
// the container's scrollable area. Overflow only extends
|
|
23715
|
+
// downwards, so a hidden frame parked above the top edge adds
|
|
23716
|
+
// none, where one left at full height shows as blank scroll space.
|
|
23717
|
+
transform: PRERENDER_PARKED_TRANSFORM,
|
|
23759
23718
|
};
|
|
23760
23719
|
setStyleProperties(this.preRenderWrapper, preRenderHideStyles);
|
|
23761
|
-
this.
|
|
23762
|
-
if (this.resizeObserver) {
|
|
23763
|
-
this.resizeObserver.disconnect();
|
|
23764
|
-
}
|
|
23720
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
23765
23721
|
const placeHolderEle = this.getPreRenderPlaceHolderElement();
|
|
23766
23722
|
if (placeHolderEle) {
|
|
23767
23723
|
placeHolderEle.parentElement.removeChild(placeHolderEle);
|
|
@@ -23946,7 +23902,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23946
23902
|
* @param dataSources A list of data source GUIDs
|
|
23947
23903
|
*/
|
|
23948
23904
|
getIFrameSrc() {
|
|
23949
|
-
const queryParams = this.
|
|
23905
|
+
const queryParams = this.getEmbedParamsObject();
|
|
23950
23906
|
const path = 'search-bar-embed';
|
|
23951
23907
|
let query = '';
|
|
23952
23908
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
@@ -24133,7 +24089,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
24133
24089
|
}
|
|
24134
24090
|
getEmbedParams() {
|
|
24135
24091
|
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
24136
|
-
const queryParams = this.
|
|
24092
|
+
const queryParams = this.getEmbedParamsObject();
|
|
24137
24093
|
let query = '';
|
|
24138
24094
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
24139
24095
|
if (queryParamsString) {
|
|
@@ -24726,7 +24682,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
24726
24682
|
* embedded Liveboard or visualization.
|
|
24727
24683
|
*/
|
|
24728
24684
|
getEmbedParams() {
|
|
24729
|
-
const params = this.
|
|
24685
|
+
const params = this.getEmbedParamsObject();
|
|
24730
24686
|
return getQueryParamString(params, true);
|
|
24731
24687
|
}
|
|
24732
24688
|
getEmbedParamsObject() {
|
|
@@ -25184,7 +25140,7 @@ query GetEurekaVizSnapshots(
|
|
|
25184
25140
|
* embedded Liveboard or visualization.
|
|
25185
25141
|
*/
|
|
25186
25142
|
getEmbedParams() {
|
|
25187
|
-
const params = this.
|
|
25143
|
+
const params = this.getEmbedParamsObject();
|
|
25188
25144
|
const queryParams = getQueryParamString(params, true);
|
|
25189
25145
|
return queryParams;
|
|
25190
25146
|
}
|
|
@@ -25957,7 +25913,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25957
25913
|
getIframeSrc() {
|
|
25958
25914
|
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
25959
25915
|
const path = 'conv-assist-answer';
|
|
25960
|
-
const queryParams = this.
|
|
25916
|
+
const queryParams = this.getEmbedParamsObject();
|
|
25961
25917
|
let query = '';
|
|
25962
25918
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
25963
25919
|
if (queryParamsString) {
|
|
@@ -26160,7 +26116,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26160
26116
|
const path = sharedConversationId
|
|
26161
26117
|
? `insights/conv-assist/s/${encodeURIComponent(sharedConversationId)}`
|
|
26162
26118
|
: 'insights/conv-assist';
|
|
26163
|
-
const queryParams = this.
|
|
26119
|
+
const queryParams = this.getEmbedParamsObject();
|
|
26164
26120
|
let query = '';
|
|
26165
26121
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
26166
26122
|
if (queryParamsString) {
|