@thoughtspot/visual-embed-sdk 1.51.2 → 1.52.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 +1 -1
- package/cjs/src/api-intercept.d.ts.map +1 -1
- package/cjs/src/api-intercept.js +1 -0
- package/cjs/src/api-intercept.js.map +1 -1
- package/cjs/src/css-variables.d.ts +1 -1
- package/cjs/src/embed/conversation.d.ts +5 -5
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +2 -1
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +4 -4
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +4 -3
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +23 -16
- 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 +55 -16
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +2 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +8 -8
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +1 -1
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +7 -7
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +124 -36
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +80 -12
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-D8_Zs-Nr.js → index-BMppCU63.js} +1 -1
- package/dist/src/api-intercept.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +1 -1
- package/dist/src/embed/conversation.d.ts +5 -5
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +4 -3
- 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/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +8 -8
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +124 -36
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +109 -32
- package/dist/tsembed-react.js +108 -31
- package/dist/tsembed.es.js +109 -32
- package/dist/tsembed.js +107 -30
- package/dist/visual-embed-sdk-react-full.d.ts +142 -53
- package/dist/visual-embed-sdk-react.d.ts +118 -52
- package/dist/visual-embed-sdk.d.ts +134 -45
- package/lib/package.json +1 -1
- package/lib/src/api-intercept.d.ts.map +1 -1
- package/lib/src/api-intercept.js +2 -1
- package/lib/src/api-intercept.js.map +1 -1
- package/lib/src/css-variables.d.ts +1 -1
- package/lib/src/embed/conversation.d.ts +5 -5
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +3 -2
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +4 -4
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +4 -3
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +24 -17
- 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 +56 -17
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/index.d.ts +8 -8
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +1 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +7 -7
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +124 -36
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +79 -11
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +134 -45
- package/package.json +1 -1
- package/src/api-intercept.ts +2 -1
- package/src/css-variables.ts +1 -1
- package/src/embed/conversation.ts +5 -5
- package/src/embed/liveboard.spec.ts +4 -4
- package/src/embed/liveboard.ts +3 -1
- package/src/embed/ts-embed.spec.ts +70 -16
- package/src/embed/ts-embed.ts +24 -16
- package/src/index.ts +2 -0
- package/src/react/all-types-export.ts +1 -0
- package/src/react/index.spec.tsx +7 -7
- package/src/react/index.tsx +9 -9
- package/src/types.ts +125 -36
package/dist/tsembed-react.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.52.0 */
|
|
2
2
|
'use client';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef, useCallback } from 'react';
|
|
@@ -1910,7 +1910,32 @@ var EmbedEvent;
|
|
|
1910
1910
|
*/
|
|
1911
1911
|
EmbedEvent["OrgSwitched"] = "orgSwitched";
|
|
1912
1912
|
/**
|
|
1913
|
-
* Emitted
|
|
1913
|
+
* Emitted before the embedded ThoughtSpot app sends a network request whose
|
|
1914
|
+
* fully resolved URL matches one of the `interceptUrls` in the view config.
|
|
1915
|
+
* The request is held until you call `responder`, which decides whether the
|
|
1916
|
+
* real request goes out or a response you supply is used in its place.
|
|
1917
|
+
*
|
|
1918
|
+
* Setting `interceptUrls` is what enables this; there is no separate enable
|
|
1919
|
+
* flag. If `responder` is not called within `interceptTimeout` (30000 ms by
|
|
1920
|
+
* default) the request fails and `EmbedEvent.Error` is emitted.
|
|
1921
|
+
*
|
|
1922
|
+
* The payload is `{ input, init, urlType }`, where `input` is the request
|
|
1923
|
+
* URL and `init` is the `fetch` init object, with `init.body` parsed into an
|
|
1924
|
+
* object when it is valid JSON. `urlType` is the matching
|
|
1925
|
+
* `InterceptedApiType`; it is `InterceptedApiType.ALL` for any URL outside
|
|
1926
|
+
* the recognized API groups.
|
|
1927
|
+
*
|
|
1928
|
+
* Interception wraps the outermost layer of `fetch`, so `init` holds the
|
|
1929
|
+
* request as the application composed it, before ThoughtSpot attaches its
|
|
1930
|
+
* authentication headers. Those headers, and any token refresh and retry,
|
|
1931
|
+
* are applied afterwards and only when you pass `execute: true`. Only
|
|
1932
|
+
* requests made through `fetch` are intercepted.
|
|
1933
|
+
*
|
|
1934
|
+
* Pass `execute: true` to let the original request proceed untouched, in
|
|
1935
|
+
* which case any `response` you supply alongside it is ignored. With
|
|
1936
|
+
* `execute: false` the request is never sent, and your `response.body` is
|
|
1937
|
+
* returned to the app as JSON, defaulting to status 200 and a
|
|
1938
|
+
* `Content-Type: application/json` header.
|
|
1914
1939
|
*
|
|
1915
1940
|
* Supported on all embed types.
|
|
1916
1941
|
*
|
|
@@ -2720,7 +2745,7 @@ var HostEvent;
|
|
|
2720
2745
|
*
|
|
2721
2746
|
* Unlike {@link HostEvent.OpenFilter}, which opens the panel of an
|
|
2722
2747
|
* existing filter, this event starts the creation of a new filter.
|
|
2723
|
-
* @version SDK: 1.
|
|
2748
|
+
* @version SDK: 1.51.1 | ThoughtSpot Cloud: 26.8.0.cl
|
|
2724
2749
|
* @example
|
|
2725
2750
|
* ```js
|
|
2726
2751
|
* liveboardEmbed.trigger(HostEvent.OpenAddFilterModal);
|
|
@@ -2736,7 +2761,7 @@ var HostEvent;
|
|
|
2736
2761
|
* Hiding the *Add parameter* button with `hiddenActions:
|
|
2737
2762
|
* [Action.AddParameter]` does not block this event, but disabling it
|
|
2738
2763
|
* with `disabledActions` does.
|
|
2739
|
-
* @version SDK: 1.
|
|
2764
|
+
* @version SDK: 1.51.1 | ThoughtSpot Cloud: 26.8.0.cl
|
|
2740
2765
|
* @example
|
|
2741
2766
|
* ```js
|
|
2742
2767
|
* liveboardEmbed.trigger(HostEvent.OpenAddParameterModal);
|
|
@@ -4614,7 +4639,13 @@ var HostEvent;
|
|
|
4614
4639
|
*/
|
|
4615
4640
|
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
4616
4641
|
/**
|
|
4617
|
-
*
|
|
4642
|
+
* Notifies the embedded ThoughtSpot app that the embed is being torn down, so that
|
|
4643
|
+
* it can release any resources it holds before the iframe is removed from the DOM.
|
|
4644
|
+
*
|
|
4645
|
+
* This is triggered for you by `embed.destroy()`; you rarely need to trigger it
|
|
4646
|
+
* directly. If `waitForCleanupOnDestroy` is set in the embed config, `destroy()`
|
|
4647
|
+
* waits for the app to acknowledge this event (up to `cleanupTimeout`) before
|
|
4648
|
+
* removing the iframe.
|
|
4618
4649
|
* @example
|
|
4619
4650
|
* ```js
|
|
4620
4651
|
* liveboardEmbed.trigger(HostEvent.DestroyEmbed);
|
|
@@ -6732,7 +6763,7 @@ var Action;
|
|
|
6732
6763
|
* ```js
|
|
6733
6764
|
* hiddenActions: [Action.QuickSearchPill]
|
|
6734
6765
|
* ```
|
|
6735
|
-
* @version SDK: 1.
|
|
6766
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
6736
6767
|
*/
|
|
6737
6768
|
Action["QuickSearchPill"] = "quickSearchPill";
|
|
6738
6769
|
/**
|
|
@@ -6747,7 +6778,7 @@ var Action;
|
|
|
6747
6778
|
* ```js
|
|
6748
6779
|
* hiddenActions: [Action.DeepAnalysisPill]
|
|
6749
6780
|
* ```
|
|
6750
|
-
* @version SDK: 1.
|
|
6781
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
6751
6782
|
*/
|
|
6752
6783
|
Action["DeepAnalysisPill"] = "deepAnalysisPill";
|
|
6753
6784
|
/**
|
|
@@ -6762,7 +6793,7 @@ var Action;
|
|
|
6762
6793
|
* ```js
|
|
6763
6794
|
* hiddenActions: [Action.DataLiteracyPill]
|
|
6764
6795
|
* ```
|
|
6765
|
-
* @version SDK: 1.
|
|
6796
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
6766
6797
|
*/
|
|
6767
6798
|
Action["DataLiteracyPill"] = "dataLiteracyPill";
|
|
6768
6799
|
/**
|
|
@@ -7235,6 +7266,36 @@ var EmbedErrorCodes;
|
|
|
7235
7266
|
/** UpdateParameters payload is invalid - malformed applicability */
|
|
7236
7267
|
EmbedErrorCodes["UPDATEPARAMETERS_INVALID_PAYLOAD"] = "UPDATEPARAMETERS_INVALID_PAYLOAD";
|
|
7237
7268
|
})(EmbedErrorCodes || (EmbedErrorCodes = {}));
|
|
7269
|
+
/**
|
|
7270
|
+
* How badly an error affects the embed, so the host can decide whether it is
|
|
7271
|
+
* worth surfacing to the end user.
|
|
7272
|
+
*
|
|
7273
|
+
* Mirrors the severity that ThoughtSpot itself stamps on errors raised inside
|
|
7274
|
+
* the embedded app, so a host can apply one rule to both sources.
|
|
7275
|
+
*
|
|
7276
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
7277
|
+
* @group Error Handling
|
|
7278
|
+
*
|
|
7279
|
+
* @example
|
|
7280
|
+
* Only surface errors that took the embed down
|
|
7281
|
+
*
|
|
7282
|
+
* ```js
|
|
7283
|
+
* embed.on(EmbedEvent.Error, (error) => {
|
|
7284
|
+
* if (error.severity === EmbedErrorSeverity.SEV1) {
|
|
7285
|
+
* showBanner(error.message);
|
|
7286
|
+
* }
|
|
7287
|
+
* });
|
|
7288
|
+
* ```
|
|
7289
|
+
*/
|
|
7290
|
+
var EmbedErrorSeverity;
|
|
7291
|
+
(function (EmbedErrorSeverity) {
|
|
7292
|
+
/** The embed cannot render. Nothing usable is on screen. */
|
|
7293
|
+
EmbedErrorSeverity[EmbedErrorSeverity["SEV1"] = 1] = "SEV1";
|
|
7294
|
+
/** Something is degraded but the embed still works. */
|
|
7295
|
+
EmbedErrorSeverity[EmbedErrorSeverity["SEV2"] = 2] = "SEV2";
|
|
7296
|
+
/** Everything else, including validation of the embedder's own input. */
|
|
7297
|
+
EmbedErrorSeverity[EmbedErrorSeverity["SEV3"] = 3] = "SEV3";
|
|
7298
|
+
})(EmbedErrorSeverity || (EmbedErrorSeverity = {}));
|
|
7238
7299
|
/**
|
|
7239
7300
|
* Context types for specifying the page context when triggering host events.
|
|
7240
7301
|
* Used as the third parameter in the `trigger` method to help ThoughtSpot
|
|
@@ -7275,20 +7336,27 @@ var ContextType;
|
|
|
7275
7336
|
ContextType["Other"] = "other";
|
|
7276
7337
|
})(ContextType || (ContextType = {}));
|
|
7277
7338
|
/**
|
|
7278
|
-
*
|
|
7339
|
+
* Named groups of ThoughtSpot APIs that can be intercepted, for use in
|
|
7340
|
+
* `interceptUrls`. Each group expands to the underlying request URLs, so you do
|
|
7341
|
+
* not have to list them individually.
|
|
7279
7342
|
*/
|
|
7280
7343
|
var InterceptedApiType;
|
|
7281
7344
|
(function (InterceptedApiType) {
|
|
7282
7345
|
/**
|
|
7283
|
-
* The
|
|
7346
|
+
* The APIs that fetch the data backing an Answer, including its chart,
|
|
7347
|
+
* table, and headline data.
|
|
7284
7348
|
*/
|
|
7285
7349
|
InterceptedApiType["AnswerData"] = "AnswerData";
|
|
7286
7350
|
/**
|
|
7287
|
-
*
|
|
7351
|
+
* Intercepts every `fetch` request the embedded application makes, not only
|
|
7352
|
+
* the data APIs. This includes authentication, session, and metadata calls,
|
|
7353
|
+
* so the handler must respond to requests it does not recognize by passing
|
|
7354
|
+
* `execute: true`. Listing this alongside other entries in `interceptUrls`
|
|
7355
|
+
* supersedes them.
|
|
7288
7356
|
*/
|
|
7289
7357
|
InterceptedApiType["ALL"] = "ALL";
|
|
7290
7358
|
/**
|
|
7291
|
-
* The
|
|
7359
|
+
* The APIs that fetch the data backing a Liveboard.
|
|
7292
7360
|
*/
|
|
7293
7361
|
InterceptedApiType["LiveboardData"] = "LiveboardData";
|
|
7294
7362
|
})(InterceptedApiType || (InterceptedApiType = {}));
|
|
@@ -7412,7 +7480,7 @@ var TableContentDensity;
|
|
|
7412
7480
|
TableContentDensity["Compact"] = "COMPACT";
|
|
7413
7481
|
})(TableContentDensity || (TableContentDensity = {}));
|
|
7414
7482
|
|
|
7415
|
-
var version$1="1.
|
|
7483
|
+
var version$1="1.52.0";var pkg = {version:version$1};
|
|
7416
7484
|
|
|
7417
7485
|
const { version } = pkg;
|
|
7418
7486
|
|
|
@@ -10009,7 +10077,7 @@ class AnswerService {
|
|
|
10009
10077
|
async getTML() {
|
|
10010
10078
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
10011
10079
|
const edoc = object[0].edoc;
|
|
10012
|
-
const YAML = await import('./index-
|
|
10080
|
+
const YAML = await import('./index-BMppCU63.js');
|
|
10013
10081
|
const parsedDoc = YAML.parse(edoc);
|
|
10014
10082
|
return {
|
|
10015
10083
|
answer: {
|
|
@@ -21203,6 +21271,7 @@ const handleInterceptEvent = async (params) => {
|
|
|
21203
21271
|
errorType: ErrorDetailsTypes.API,
|
|
21204
21272
|
message: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
21205
21273
|
code: EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
|
|
21274
|
+
severity: EmbedErrorSeverity.SEV3,
|
|
21206
21275
|
error: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
21207
21276
|
};
|
|
21208
21277
|
executeEvent(EmbedEvent.Error, errorDetails);
|
|
@@ -21547,6 +21616,7 @@ class TsEmbed {
|
|
|
21547
21616
|
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21548
21617
|
message: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
21549
21618
|
code: EmbedErrorCodes.INIT_ERROR,
|
|
21619
|
+
severity: EmbedErrorSeverity.SEV1,
|
|
21550
21620
|
error: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
21551
21621
|
});
|
|
21552
21622
|
}
|
|
@@ -21557,7 +21627,10 @@ class TsEmbed {
|
|
|
21557
21627
|
*/
|
|
21558
21628
|
handleError(errorDetails) {
|
|
21559
21629
|
this.isError = true;
|
|
21560
|
-
this.executeCallbacks(EmbedEvent.Error,
|
|
21630
|
+
this.executeCallbacks(EmbedEvent.Error, {
|
|
21631
|
+
severity: EmbedErrorSeverity.SEV3,
|
|
21632
|
+
...errorDetails,
|
|
21633
|
+
});
|
|
21561
21634
|
// Log error
|
|
21562
21635
|
logger$3.error(errorDetails);
|
|
21563
21636
|
}
|
|
@@ -21642,6 +21715,7 @@ class TsEmbed {
|
|
|
21642
21715
|
errorType: ErrorDetailsTypes.NETWORK,
|
|
21643
21716
|
message: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
21644
21717
|
code: EmbedErrorCodes.NETWORK_ERROR,
|
|
21718
|
+
severity: EmbedErrorSeverity.SEV2,
|
|
21645
21719
|
offlineWarning: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
21646
21720
|
};
|
|
21647
21721
|
this.executeCallbacks(EmbedEvent.Error, errorDetails);
|
|
@@ -22014,9 +22088,10 @@ class TsEmbed {
|
|
|
22014
22088
|
return iFrame;
|
|
22015
22089
|
}
|
|
22016
22090
|
/**
|
|
22017
|
-
* Returns a merged {@link PreRenderConfig} object where each
|
|
22018
|
-
*
|
|
22019
|
-
*
|
|
22091
|
+
* Returns a merged {@link PreRenderConfig} object where each key prefers the
|
|
22092
|
+
* value from `preRenderConfig` over its deprecated top-level `viewConfig`
|
|
22093
|
+
* counterpart (`id`/`preRenderId`, `containerSelector`/`preRenderContainer`,
|
|
22094
|
+
* `doNotTrackSize`/`doNotTrackPreRenderSize`) for backward compatibility.
|
|
22020
22095
|
*/
|
|
22021
22096
|
getPreRenderConfig() {
|
|
22022
22097
|
var _a, _b, _c, _d;
|
|
@@ -22024,16 +22099,16 @@ class TsEmbed {
|
|
|
22024
22099
|
const preRenderCfg = (_a = viewCfg.preRenderConfig) !== null && _a !== void 0 ? _a : {};
|
|
22025
22100
|
return {
|
|
22026
22101
|
...preRenderCfg,
|
|
22027
|
-
|
|
22028
|
-
|
|
22029
|
-
|
|
22102
|
+
id: (_b = preRenderCfg.id) !== null && _b !== void 0 ? _b : viewCfg.preRenderId,
|
|
22103
|
+
containerSelector: (_c = preRenderCfg.containerSelector) !== null && _c !== void 0 ? _c : viewCfg.preRenderContainer,
|
|
22104
|
+
doNotTrackSize: (_d = preRenderCfg.doNotTrackSize) !== null && _d !== void 0 ? _d : viewCfg.doNotTrackPreRenderSize,
|
|
22030
22105
|
};
|
|
22031
22106
|
}
|
|
22032
22107
|
/**
|
|
22033
22108
|
* Returns true if this embed instance is configured for pre-rendering.
|
|
22034
22109
|
*/
|
|
22035
22110
|
isPreRenderEmbed() {
|
|
22036
|
-
return !!this.getPreRenderConfig().
|
|
22111
|
+
return !!this.getPreRenderConfig().id;
|
|
22037
22112
|
}
|
|
22038
22113
|
handleInsertionIntoDOM(child) {
|
|
22039
22114
|
if (this.isPreRenderEmbed()) {
|
|
@@ -22129,6 +22204,7 @@ class TsEmbed {
|
|
|
22129
22204
|
errorType: ErrorDetailsTypes.API,
|
|
22130
22205
|
message: error.message || ERROR_MESSAGE.LOGIN_FAILED,
|
|
22131
22206
|
code: EmbedErrorCodes.LOGIN_FAILED,
|
|
22207
|
+
severity: EmbedErrorSeverity.SEV1,
|
|
22132
22208
|
error: error,
|
|
22133
22209
|
});
|
|
22134
22210
|
});
|
|
@@ -22220,7 +22296,7 @@ class TsEmbed {
|
|
|
22220
22296
|
*/
|
|
22221
22297
|
resolvePreRenderContainerTarget() {
|
|
22222
22298
|
var _a;
|
|
22223
|
-
const containerConfig = this.getPreRenderConfig().
|
|
22299
|
+
const containerConfig = this.getPreRenderConfig().containerSelector;
|
|
22224
22300
|
let container = null;
|
|
22225
22301
|
if (typeof containerConfig === 'string') {
|
|
22226
22302
|
try {
|
|
@@ -22245,7 +22321,7 @@ class TsEmbed {
|
|
|
22245
22321
|
return;
|
|
22246
22322
|
}
|
|
22247
22323
|
const ownerContainer = (_a = preRenderedObject.preRenderContainerEl) !== null && _a !== void 0 ? _a : document.body;
|
|
22248
|
-
if (this.getPreRenderConfig().
|
|
22324
|
+
if (this.getPreRenderConfig().containerSelector
|
|
22249
22325
|
&& this.resolvePreRenderContainerTarget() !== ownerContainer) {
|
|
22250
22326
|
logger$3.warn('preRenderContainer is applied only by the component that creates the preRender; '
|
|
22251
22327
|
+ 'the one passed here is ignored. Set it on the PreRender component instead.');
|
|
@@ -22742,7 +22818,7 @@ class TsEmbed {
|
|
|
22742
22818
|
showPreRenderByDefault,
|
|
22743
22819
|
replaceExistingPreRender,
|
|
22744
22820
|
});
|
|
22745
|
-
if (!this.getPreRenderConfig().
|
|
22821
|
+
if (!this.getPreRenderConfig().id) {
|
|
22746
22822
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
22747
22823
|
return this;
|
|
22748
22824
|
}
|
|
@@ -22918,12 +22994,12 @@ class TsEmbed {
|
|
|
22918
22994
|
async showPreRender() {
|
|
22919
22995
|
var _a, _b;
|
|
22920
22996
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_SHOW_PRE_RENDER, {
|
|
22921
|
-
preRenderId: this.getPreRenderConfig().
|
|
22997
|
+
preRenderId: this.getPreRenderConfig().id,
|
|
22922
22998
|
embedComponentType: this.viewConfig.embedComponentType,
|
|
22923
22999
|
});
|
|
22924
23000
|
if (this.shouldWaitForRenderPromise)
|
|
22925
23001
|
await this.isReadyForRenderPromise;
|
|
22926
|
-
if (!this.getPreRenderConfig().
|
|
23002
|
+
if (!this.getPreRenderConfig().id) {
|
|
22927
23003
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
22928
23004
|
return this;
|
|
22929
23005
|
}
|
|
@@ -22959,7 +23035,7 @@ class TsEmbed {
|
|
|
22959
23035
|
this.containerScrollListener = () => this.syncPreRenderStyle();
|
|
22960
23036
|
customContainer.addEventListener('scroll', this.containerScrollListener);
|
|
22961
23037
|
}
|
|
22962
|
-
if (!this.getPreRenderConfig().
|
|
23038
|
+
if (!this.getPreRenderConfig().doNotTrackSize) {
|
|
22963
23039
|
const observeTarget = (_b = this.insertedDomEl) !== null && _b !== void 0 ? _b : this.hostElement;
|
|
22964
23040
|
this.resizeObserver = new ResizeObserver((entries) => {
|
|
22965
23041
|
entries.forEach((entry) => {
|
|
@@ -23027,7 +23103,7 @@ class TsEmbed {
|
|
|
23027
23103
|
*/
|
|
23028
23104
|
hidePreRender() {
|
|
23029
23105
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_HIDE_PRE_RENDER, {
|
|
23030
|
-
preRenderId: this.getPreRenderConfig().
|
|
23106
|
+
preRenderId: this.getPreRenderConfig().id,
|
|
23031
23107
|
embedComponentType: this.viewConfig.embedComponentType,
|
|
23032
23108
|
});
|
|
23033
23109
|
logger$3.debug('HidePreRender Called');
|
|
@@ -23065,7 +23141,7 @@ class TsEmbed {
|
|
|
23065
23141
|
* @property {string} child - The HTML element ID for the PreRender child.
|
|
23066
23142
|
*/
|
|
23067
23143
|
getPreRenderIds() {
|
|
23068
|
-
const preRenderId = this.getPreRenderConfig().
|
|
23144
|
+
const preRenderId = this.getPreRenderConfig().id;
|
|
23069
23145
|
return {
|
|
23070
23146
|
wrapper: `${PRERENDER_WRAPPER_ID_PREFIX}${preRenderId}`,
|
|
23071
23147
|
child: `tsEmbed-pre-render-child-${preRenderId}`,
|
|
@@ -24546,6 +24622,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
24546
24622
|
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
24547
24623
|
message: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
24548
24624
|
code: EmbedErrorCodes.LIVEBOARD_ID_MISSING,
|
|
24625
|
+
severity: EmbedErrorSeverity.SEV1,
|
|
24549
24626
|
error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
24550
24627
|
});
|
|
24551
24628
|
}
|
|
@@ -24697,7 +24774,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
24697
24774
|
if (this.isRendered) {
|
|
24698
24775
|
this.trigger(HostEvent.Navigate, path.substring(1));
|
|
24699
24776
|
}
|
|
24700
|
-
else if (this.getPreRenderConfig().
|
|
24777
|
+
else if (this.getPreRenderConfig().id) {
|
|
24701
24778
|
this.preRender(true);
|
|
24702
24779
|
}
|
|
24703
24780
|
else {
|
|
@@ -25401,7 +25478,7 @@ isPreRenderedComponent = false) => {
|
|
|
25401
25478
|
const ref = React__default.useRef(null);
|
|
25402
25479
|
const { className, style, ...embedProps } = props;
|
|
25403
25480
|
const { viewConfig, listeners } = getViewPropsAndListeners(embedProps);
|
|
25404
|
-
const preRenderId = (_b = (_a = props.preRenderConfig) === null || _a === void 0 ? void 0 : _a.
|
|
25481
|
+
const preRenderId = (_b = (_a = props.preRenderConfig) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : props.preRenderId;
|
|
25405
25482
|
const handleDestroy = (tsEmbed) => {
|
|
25406
25483
|
// do not destroy if it is a preRender component
|
|
25407
25484
|
if (isPreRenderedComponent)
|