@thoughtspot/visual-embed-sdk 1.51.1 → 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/search.spec.js +28 -0
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +86 -5
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +30 -19
- 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/cjs/src/utils.d.ts +5 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +19 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +33 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-DxLfQxoT.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 +86 -5
- 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/src/utils.d.ts +5 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +133 -35
- package/dist/tsembed-react.js +132 -34
- package/dist/tsembed.es.js +133 -35
- package/dist/tsembed.js +131 -33
- package/dist/visual-embed-sdk-react-full.d.ts +223 -54
- package/dist/visual-embed-sdk-react.d.ts +199 -53
- package/dist/visual-embed-sdk.d.ts +215 -46
- 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/search.spec.js +28 -0
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +86 -5
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +32 -21
- 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/utils.d.ts +5 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +17 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +34 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +215 -46
- 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/search.spec.ts +31 -0
- package/src/embed/ts-embed.spec.ts +70 -16
- package/src/embed/ts-embed.ts +32 -20
- 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/src/utils.spec.ts +44 -0
- package/src/utils.ts +16 -0
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
|
|
|
@@ -7591,6 +7659,23 @@ const serializeParam = (value) => {
|
|
|
7591
7659
|
}
|
|
7592
7660
|
return JSON.stringify(value);
|
|
7593
7661
|
};
|
|
7662
|
+
/**
|
|
7663
|
+
* Inverse of serializeParam: JSON.parse with fallback to the raw string,
|
|
7664
|
+
* matching how the app parses the same values from the iframe URL.
|
|
7665
|
+
*/
|
|
7666
|
+
const deserializeParam = (value) => {
|
|
7667
|
+
if (typeof value !== 'string')
|
|
7668
|
+
return value;
|
|
7669
|
+
try {
|
|
7670
|
+
const parsed = JSON.parse(value);
|
|
7671
|
+
// Numeric strings stay strings ('123' !== 123), same as the app's
|
|
7672
|
+
// URL parser — param consumers expect string ids/versions.
|
|
7673
|
+
return typeof parsed === 'number' ? value : parsed;
|
|
7674
|
+
}
|
|
7675
|
+
catch (e) {
|
|
7676
|
+
return value;
|
|
7677
|
+
}
|
|
7678
|
+
};
|
|
7594
7679
|
/**
|
|
7595
7680
|
* Convert a value to a string:
|
|
7596
7681
|
* in case of an array, we convert it to CSV.
|
|
@@ -9992,7 +10077,7 @@ class AnswerService {
|
|
|
9992
10077
|
async getTML() {
|
|
9993
10078
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
9994
10079
|
const edoc = object[0].edoc;
|
|
9995
|
-
const YAML = await import('./index-
|
|
10080
|
+
const YAML = await import('./index-BMppCU63.js');
|
|
9996
10081
|
const parsedDoc = YAML.parse(edoc);
|
|
9997
10082
|
return {
|
|
9998
10083
|
answer: {
|
|
@@ -21186,6 +21271,7 @@ const handleInterceptEvent = async (params) => {
|
|
|
21186
21271
|
errorType: ErrorDetailsTypes.API,
|
|
21187
21272
|
message: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
21188
21273
|
code: EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
|
|
21274
|
+
severity: EmbedErrorSeverity.SEV3,
|
|
21189
21275
|
error: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
21190
21276
|
};
|
|
21191
21277
|
executeEvent(EmbedEvent.Error, errorDetails);
|
|
@@ -21530,6 +21616,7 @@ class TsEmbed {
|
|
|
21530
21616
|
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21531
21617
|
message: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
21532
21618
|
code: EmbedErrorCodes.INIT_ERROR,
|
|
21619
|
+
severity: EmbedErrorSeverity.SEV1,
|
|
21533
21620
|
error: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
21534
21621
|
});
|
|
21535
21622
|
}
|
|
@@ -21540,7 +21627,10 @@ class TsEmbed {
|
|
|
21540
21627
|
*/
|
|
21541
21628
|
handleError(errorDetails) {
|
|
21542
21629
|
this.isError = true;
|
|
21543
|
-
this.executeCallbacks(EmbedEvent.Error,
|
|
21630
|
+
this.executeCallbacks(EmbedEvent.Error, {
|
|
21631
|
+
severity: EmbedErrorSeverity.SEV3,
|
|
21632
|
+
...errorDetails,
|
|
21633
|
+
});
|
|
21544
21634
|
// Log error
|
|
21545
21635
|
logger$3.error(errorDetails);
|
|
21546
21636
|
}
|
|
@@ -21625,6 +21715,7 @@ class TsEmbed {
|
|
|
21625
21715
|
errorType: ErrorDetailsTypes.NETWORK,
|
|
21626
21716
|
message: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
21627
21717
|
code: EmbedErrorCodes.NETWORK_ERROR,
|
|
21718
|
+
severity: EmbedErrorSeverity.SEV2,
|
|
21628
21719
|
offlineWarning: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
21629
21720
|
};
|
|
21630
21721
|
this.executeCallbacks(EmbedEvent.Error, errorDetails);
|
|
@@ -21782,10 +21873,14 @@ class TsEmbed {
|
|
|
21782
21873
|
return `${basePath}#`;
|
|
21783
21874
|
}
|
|
21784
21875
|
async getUpdateEmbedParamsObject() {
|
|
21785
|
-
|
|
21876
|
+
const queryParams = this.getEmbedParamsObject();
|
|
21877
|
+
// Values are URL-serialized (e.g. dataSources as '["guid"]'); parse
|
|
21878
|
+
// them back so the event payload matches a URL load (SCAL-334713).
|
|
21879
|
+
Object.keys(queryParams).forEach((key) => {
|
|
21880
|
+
queryParams[key] = deserializeParam(queryParams[key]);
|
|
21881
|
+
});
|
|
21786
21882
|
const appInitData = await this.getAppInitData();
|
|
21787
|
-
|
|
21788
|
-
return queryParams;
|
|
21883
|
+
return { ...this.viewConfig, ...queryParams, ...appInitData };
|
|
21789
21884
|
}
|
|
21790
21885
|
/**
|
|
21791
21886
|
* Common query params set for all the embed modes.
|
|
@@ -21993,9 +22088,10 @@ class TsEmbed {
|
|
|
21993
22088
|
return iFrame;
|
|
21994
22089
|
}
|
|
21995
22090
|
/**
|
|
21996
|
-
* Returns a merged {@link PreRenderConfig} object where each
|
|
21997
|
-
*
|
|
21998
|
-
*
|
|
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.
|
|
21999
22095
|
*/
|
|
22000
22096
|
getPreRenderConfig() {
|
|
22001
22097
|
var _a, _b, _c, _d;
|
|
@@ -22003,16 +22099,16 @@ class TsEmbed {
|
|
|
22003
22099
|
const preRenderCfg = (_a = viewCfg.preRenderConfig) !== null && _a !== void 0 ? _a : {};
|
|
22004
22100
|
return {
|
|
22005
22101
|
...preRenderCfg,
|
|
22006
|
-
|
|
22007
|
-
|
|
22008
|
-
|
|
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,
|
|
22009
22105
|
};
|
|
22010
22106
|
}
|
|
22011
22107
|
/**
|
|
22012
22108
|
* Returns true if this embed instance is configured for pre-rendering.
|
|
22013
22109
|
*/
|
|
22014
22110
|
isPreRenderEmbed() {
|
|
22015
|
-
return !!this.getPreRenderConfig().
|
|
22111
|
+
return !!this.getPreRenderConfig().id;
|
|
22016
22112
|
}
|
|
22017
22113
|
handleInsertionIntoDOM(child) {
|
|
22018
22114
|
if (this.isPreRenderEmbed()) {
|
|
@@ -22108,6 +22204,7 @@ class TsEmbed {
|
|
|
22108
22204
|
errorType: ErrorDetailsTypes.API,
|
|
22109
22205
|
message: error.message || ERROR_MESSAGE.LOGIN_FAILED,
|
|
22110
22206
|
code: EmbedErrorCodes.LOGIN_FAILED,
|
|
22207
|
+
severity: EmbedErrorSeverity.SEV1,
|
|
22111
22208
|
error: error,
|
|
22112
22209
|
});
|
|
22113
22210
|
});
|
|
@@ -22199,7 +22296,7 @@ class TsEmbed {
|
|
|
22199
22296
|
*/
|
|
22200
22297
|
resolvePreRenderContainerTarget() {
|
|
22201
22298
|
var _a;
|
|
22202
|
-
const containerConfig = this.getPreRenderConfig().
|
|
22299
|
+
const containerConfig = this.getPreRenderConfig().containerSelector;
|
|
22203
22300
|
let container = null;
|
|
22204
22301
|
if (typeof containerConfig === 'string') {
|
|
22205
22302
|
try {
|
|
@@ -22224,7 +22321,7 @@ class TsEmbed {
|
|
|
22224
22321
|
return;
|
|
22225
22322
|
}
|
|
22226
22323
|
const ownerContainer = (_a = preRenderedObject.preRenderContainerEl) !== null && _a !== void 0 ? _a : document.body;
|
|
22227
|
-
if (this.getPreRenderConfig().
|
|
22324
|
+
if (this.getPreRenderConfig().containerSelector
|
|
22228
22325
|
&& this.resolvePreRenderContainerTarget() !== ownerContainer) {
|
|
22229
22326
|
logger$3.warn('preRenderContainer is applied only by the component that creates the preRender; '
|
|
22230
22327
|
+ 'the one passed here is ignored. Set it on the PreRender component instead.');
|
|
@@ -22721,7 +22818,7 @@ class TsEmbed {
|
|
|
22721
22818
|
showPreRenderByDefault,
|
|
22722
22819
|
replaceExistingPreRender,
|
|
22723
22820
|
});
|
|
22724
|
-
if (!this.getPreRenderConfig().
|
|
22821
|
+
if (!this.getPreRenderConfig().id) {
|
|
22725
22822
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
22726
22823
|
return this;
|
|
22727
22824
|
}
|
|
@@ -22897,12 +22994,12 @@ class TsEmbed {
|
|
|
22897
22994
|
async showPreRender() {
|
|
22898
22995
|
var _a, _b;
|
|
22899
22996
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_SHOW_PRE_RENDER, {
|
|
22900
|
-
preRenderId: this.getPreRenderConfig().
|
|
22997
|
+
preRenderId: this.getPreRenderConfig().id,
|
|
22901
22998
|
embedComponentType: this.viewConfig.embedComponentType,
|
|
22902
22999
|
});
|
|
22903
23000
|
if (this.shouldWaitForRenderPromise)
|
|
22904
23001
|
await this.isReadyForRenderPromise;
|
|
22905
|
-
if (!this.getPreRenderConfig().
|
|
23002
|
+
if (!this.getPreRenderConfig().id) {
|
|
22906
23003
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
22907
23004
|
return this;
|
|
22908
23005
|
}
|
|
@@ -22938,7 +23035,7 @@ class TsEmbed {
|
|
|
22938
23035
|
this.containerScrollListener = () => this.syncPreRenderStyle();
|
|
22939
23036
|
customContainer.addEventListener('scroll', this.containerScrollListener);
|
|
22940
23037
|
}
|
|
22941
|
-
if (!this.getPreRenderConfig().
|
|
23038
|
+
if (!this.getPreRenderConfig().doNotTrackSize) {
|
|
22942
23039
|
const observeTarget = (_b = this.insertedDomEl) !== null && _b !== void 0 ? _b : this.hostElement;
|
|
22943
23040
|
this.resizeObserver = new ResizeObserver((entries) => {
|
|
22944
23041
|
entries.forEach((entry) => {
|
|
@@ -23006,7 +23103,7 @@ class TsEmbed {
|
|
|
23006
23103
|
*/
|
|
23007
23104
|
hidePreRender() {
|
|
23008
23105
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_HIDE_PRE_RENDER, {
|
|
23009
|
-
preRenderId: this.getPreRenderConfig().
|
|
23106
|
+
preRenderId: this.getPreRenderConfig().id,
|
|
23010
23107
|
embedComponentType: this.viewConfig.embedComponentType,
|
|
23011
23108
|
});
|
|
23012
23109
|
logger$3.debug('HidePreRender Called');
|
|
@@ -23044,7 +23141,7 @@ class TsEmbed {
|
|
|
23044
23141
|
* @property {string} child - The HTML element ID for the PreRender child.
|
|
23045
23142
|
*/
|
|
23046
23143
|
getPreRenderIds() {
|
|
23047
|
-
const preRenderId = this.getPreRenderConfig().
|
|
23144
|
+
const preRenderId = this.getPreRenderConfig().id;
|
|
23048
23145
|
return {
|
|
23049
23146
|
wrapper: `${PRERENDER_WRAPPER_ID_PREFIX}${preRenderId}`,
|
|
23050
23147
|
child: `tsEmbed-pre-render-child-${preRenderId}`,
|
|
@@ -24525,6 +24622,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
24525
24622
|
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
24526
24623
|
message: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
24527
24624
|
code: EmbedErrorCodes.LIVEBOARD_ID_MISSING,
|
|
24625
|
+
severity: EmbedErrorSeverity.SEV1,
|
|
24528
24626
|
error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
24529
24627
|
});
|
|
24530
24628
|
}
|
|
@@ -24676,7 +24774,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
24676
24774
|
if (this.isRendered) {
|
|
24677
24775
|
this.trigger(HostEvent.Navigate, path.substring(1));
|
|
24678
24776
|
}
|
|
24679
|
-
else if (this.getPreRenderConfig().
|
|
24777
|
+
else if (this.getPreRenderConfig().id) {
|
|
24680
24778
|
this.preRender(true);
|
|
24681
24779
|
}
|
|
24682
24780
|
else {
|
|
@@ -25380,7 +25478,7 @@ isPreRenderedComponent = false) => {
|
|
|
25380
25478
|
const ref = React__default.useRef(null);
|
|
25381
25479
|
const { className, style, ...embedProps } = props;
|
|
25382
25480
|
const { viewConfig, listeners } = getViewPropsAndListeners(embedProps);
|
|
25383
|
-
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;
|
|
25384
25482
|
const handleDestroy = (tsEmbed) => {
|
|
25385
25483
|
// do not destroy if it is a preRender component
|
|
25386
25484
|
if (isPreRenderedComponent)
|