@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.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
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -1725,7 +1725,32 @@ var EmbedEvent;
|
|
|
1725
1725
|
*/
|
|
1726
1726
|
EmbedEvent["OrgSwitched"] = "orgSwitched";
|
|
1727
1727
|
/**
|
|
1728
|
-
* Emitted
|
|
1728
|
+
* Emitted before the embedded ThoughtSpot app sends a network request whose
|
|
1729
|
+
* fully resolved URL matches one of the `interceptUrls` in the view config.
|
|
1730
|
+
* The request is held until you call `responder`, which decides whether the
|
|
1731
|
+
* real request goes out or a response you supply is used in its place.
|
|
1732
|
+
*
|
|
1733
|
+
* Setting `interceptUrls` is what enables this; there is no separate enable
|
|
1734
|
+
* flag. If `responder` is not called within `interceptTimeout` (30000 ms by
|
|
1735
|
+
* default) the request fails and `EmbedEvent.Error` is emitted.
|
|
1736
|
+
*
|
|
1737
|
+
* The payload is `{ input, init, urlType }`, where `input` is the request
|
|
1738
|
+
* URL and `init` is the `fetch` init object, with `init.body` parsed into an
|
|
1739
|
+
* object when it is valid JSON. `urlType` is the matching
|
|
1740
|
+
* `InterceptedApiType`; it is `InterceptedApiType.ALL` for any URL outside
|
|
1741
|
+
* the recognized API groups.
|
|
1742
|
+
*
|
|
1743
|
+
* Interception wraps the outermost layer of `fetch`, so `init` holds the
|
|
1744
|
+
* request as the application composed it, before ThoughtSpot attaches its
|
|
1745
|
+
* authentication headers. Those headers, and any token refresh and retry,
|
|
1746
|
+
* are applied afterwards and only when you pass `execute: true`. Only
|
|
1747
|
+
* requests made through `fetch` are intercepted.
|
|
1748
|
+
*
|
|
1749
|
+
* Pass `execute: true` to let the original request proceed untouched, in
|
|
1750
|
+
* which case any `response` you supply alongside it is ignored. With
|
|
1751
|
+
* `execute: false` the request is never sent, and your `response.body` is
|
|
1752
|
+
* returned to the app as JSON, defaulting to status 200 and a
|
|
1753
|
+
* `Content-Type: application/json` header.
|
|
1729
1754
|
*
|
|
1730
1755
|
* Supported on all embed types.
|
|
1731
1756
|
*
|
|
@@ -2535,7 +2560,7 @@ var HostEvent;
|
|
|
2535
2560
|
*
|
|
2536
2561
|
* Unlike {@link HostEvent.OpenFilter}, which opens the panel of an
|
|
2537
2562
|
* existing filter, this event starts the creation of a new filter.
|
|
2538
|
-
* @version SDK: 1.
|
|
2563
|
+
* @version SDK: 1.51.1 | ThoughtSpot Cloud: 26.8.0.cl
|
|
2539
2564
|
* @example
|
|
2540
2565
|
* ```js
|
|
2541
2566
|
* liveboardEmbed.trigger(HostEvent.OpenAddFilterModal);
|
|
@@ -2551,7 +2576,7 @@ var HostEvent;
|
|
|
2551
2576
|
* Hiding the *Add parameter* button with `hiddenActions:
|
|
2552
2577
|
* [Action.AddParameter]` does not block this event, but disabling it
|
|
2553
2578
|
* with `disabledActions` does.
|
|
2554
|
-
* @version SDK: 1.
|
|
2579
|
+
* @version SDK: 1.51.1 | ThoughtSpot Cloud: 26.8.0.cl
|
|
2555
2580
|
* @example
|
|
2556
2581
|
* ```js
|
|
2557
2582
|
* liveboardEmbed.trigger(HostEvent.OpenAddParameterModal);
|
|
@@ -4429,7 +4454,13 @@ var HostEvent;
|
|
|
4429
4454
|
*/
|
|
4430
4455
|
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
4431
4456
|
/**
|
|
4432
|
-
*
|
|
4457
|
+
* Notifies the embedded ThoughtSpot app that the embed is being torn down, so that
|
|
4458
|
+
* it can release any resources it holds before the iframe is removed from the DOM.
|
|
4459
|
+
*
|
|
4460
|
+
* This is triggered for you by `embed.destroy()`; you rarely need to trigger it
|
|
4461
|
+
* directly. If `waitForCleanupOnDestroy` is set in the embed config, `destroy()`
|
|
4462
|
+
* waits for the app to acknowledge this event (up to `cleanupTimeout`) before
|
|
4463
|
+
* removing the iframe.
|
|
4433
4464
|
* @example
|
|
4434
4465
|
* ```js
|
|
4435
4466
|
* liveboardEmbed.trigger(HostEvent.DestroyEmbed);
|
|
@@ -6547,7 +6578,7 @@ var Action;
|
|
|
6547
6578
|
* ```js
|
|
6548
6579
|
* hiddenActions: [Action.QuickSearchPill]
|
|
6549
6580
|
* ```
|
|
6550
|
-
* @version SDK: 1.
|
|
6581
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
6551
6582
|
*/
|
|
6552
6583
|
Action["QuickSearchPill"] = "quickSearchPill";
|
|
6553
6584
|
/**
|
|
@@ -6562,7 +6593,7 @@ var Action;
|
|
|
6562
6593
|
* ```js
|
|
6563
6594
|
* hiddenActions: [Action.DeepAnalysisPill]
|
|
6564
6595
|
* ```
|
|
6565
|
-
* @version SDK: 1.
|
|
6596
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
6566
6597
|
*/
|
|
6567
6598
|
Action["DeepAnalysisPill"] = "deepAnalysisPill";
|
|
6568
6599
|
/**
|
|
@@ -6577,7 +6608,7 @@ var Action;
|
|
|
6577
6608
|
* ```js
|
|
6578
6609
|
* hiddenActions: [Action.DataLiteracyPill]
|
|
6579
6610
|
* ```
|
|
6580
|
-
* @version SDK: 1.
|
|
6611
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
6581
6612
|
*/
|
|
6582
6613
|
Action["DataLiteracyPill"] = "dataLiteracyPill";
|
|
6583
6614
|
/**
|
|
@@ -7050,6 +7081,36 @@ var EmbedErrorCodes;
|
|
|
7050
7081
|
/** UpdateParameters payload is invalid - malformed applicability */
|
|
7051
7082
|
EmbedErrorCodes["UPDATEPARAMETERS_INVALID_PAYLOAD"] = "UPDATEPARAMETERS_INVALID_PAYLOAD";
|
|
7052
7083
|
})(EmbedErrorCodes || (EmbedErrorCodes = {}));
|
|
7084
|
+
/**
|
|
7085
|
+
* How badly an error affects the embed, so the host can decide whether it is
|
|
7086
|
+
* worth surfacing to the end user.
|
|
7087
|
+
*
|
|
7088
|
+
* Mirrors the severity that ThoughtSpot itself stamps on errors raised inside
|
|
7089
|
+
* the embedded app, so a host can apply one rule to both sources.
|
|
7090
|
+
*
|
|
7091
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
7092
|
+
* @group Error Handling
|
|
7093
|
+
*
|
|
7094
|
+
* @example
|
|
7095
|
+
* Only surface errors that took the embed down
|
|
7096
|
+
*
|
|
7097
|
+
* ```js
|
|
7098
|
+
* embed.on(EmbedEvent.Error, (error) => {
|
|
7099
|
+
* if (error.severity === EmbedErrorSeverity.SEV1) {
|
|
7100
|
+
* showBanner(error.message);
|
|
7101
|
+
* }
|
|
7102
|
+
* });
|
|
7103
|
+
* ```
|
|
7104
|
+
*/
|
|
7105
|
+
var EmbedErrorSeverity;
|
|
7106
|
+
(function (EmbedErrorSeverity) {
|
|
7107
|
+
/** The embed cannot render. Nothing usable is on screen. */
|
|
7108
|
+
EmbedErrorSeverity[EmbedErrorSeverity["SEV1"] = 1] = "SEV1";
|
|
7109
|
+
/** Something is degraded but the embed still works. */
|
|
7110
|
+
EmbedErrorSeverity[EmbedErrorSeverity["SEV2"] = 2] = "SEV2";
|
|
7111
|
+
/** Everything else, including validation of the embedder's own input. */
|
|
7112
|
+
EmbedErrorSeverity[EmbedErrorSeverity["SEV3"] = 3] = "SEV3";
|
|
7113
|
+
})(EmbedErrorSeverity || (EmbedErrorSeverity = {}));
|
|
7053
7114
|
/**
|
|
7054
7115
|
* Context types for specifying the page context when triggering host events.
|
|
7055
7116
|
* Used as the third parameter in the `trigger` method to help ThoughtSpot
|
|
@@ -7090,20 +7151,27 @@ var ContextType;
|
|
|
7090
7151
|
ContextType["Other"] = "other";
|
|
7091
7152
|
})(ContextType || (ContextType = {}));
|
|
7092
7153
|
/**
|
|
7093
|
-
*
|
|
7154
|
+
* Named groups of ThoughtSpot APIs that can be intercepted, for use in
|
|
7155
|
+
* `interceptUrls`. Each group expands to the underlying request URLs, so you do
|
|
7156
|
+
* not have to list them individually.
|
|
7094
7157
|
*/
|
|
7095
7158
|
var InterceptedApiType;
|
|
7096
7159
|
(function (InterceptedApiType) {
|
|
7097
7160
|
/**
|
|
7098
|
-
* The
|
|
7161
|
+
* The APIs that fetch the data backing an Answer, including its chart,
|
|
7162
|
+
* table, and headline data.
|
|
7099
7163
|
*/
|
|
7100
7164
|
InterceptedApiType["AnswerData"] = "AnswerData";
|
|
7101
7165
|
/**
|
|
7102
|
-
*
|
|
7166
|
+
* Intercepts every `fetch` request the embedded application makes, not only
|
|
7167
|
+
* the data APIs. This includes authentication, session, and metadata calls,
|
|
7168
|
+
* so the handler must respond to requests it does not recognize by passing
|
|
7169
|
+
* `execute: true`. Listing this alongside other entries in `interceptUrls`
|
|
7170
|
+
* supersedes them.
|
|
7103
7171
|
*/
|
|
7104
7172
|
InterceptedApiType["ALL"] = "ALL";
|
|
7105
7173
|
/**
|
|
7106
|
-
* The
|
|
7174
|
+
* The APIs that fetch the data backing a Liveboard.
|
|
7107
7175
|
*/
|
|
7108
7176
|
InterceptedApiType["LiveboardData"] = "LiveboardData";
|
|
7109
7177
|
})(InterceptedApiType || (InterceptedApiType = {}));
|
|
@@ -7227,7 +7295,7 @@ var TableContentDensity;
|
|
|
7227
7295
|
TableContentDensity["Compact"] = "COMPACT";
|
|
7228
7296
|
})(TableContentDensity || (TableContentDensity = {}));
|
|
7229
7297
|
|
|
7230
|
-
var version$1="1.
|
|
7298
|
+
var version$1="1.52.0";var pkg = {version:version$1};
|
|
7231
7299
|
|
|
7232
7300
|
const { version } = pkg;
|
|
7233
7301
|
|
|
@@ -7475,6 +7543,23 @@ const serializeParam = (value) => {
|
|
|
7475
7543
|
}
|
|
7476
7544
|
return JSON.stringify(value);
|
|
7477
7545
|
};
|
|
7546
|
+
/**
|
|
7547
|
+
* Inverse of serializeParam: JSON.parse with fallback to the raw string,
|
|
7548
|
+
* matching how the app parses the same values from the iframe URL.
|
|
7549
|
+
*/
|
|
7550
|
+
const deserializeParam = (value) => {
|
|
7551
|
+
if (typeof value !== 'string')
|
|
7552
|
+
return value;
|
|
7553
|
+
try {
|
|
7554
|
+
const parsed = JSON.parse(value);
|
|
7555
|
+
// Numeric strings stay strings ('123' !== 123), same as the app's
|
|
7556
|
+
// URL parser — param consumers expect string ids/versions.
|
|
7557
|
+
return typeof parsed === 'number' ? value : parsed;
|
|
7558
|
+
}
|
|
7559
|
+
catch (e) {
|
|
7560
|
+
return value;
|
|
7561
|
+
}
|
|
7562
|
+
};
|
|
7478
7563
|
/**
|
|
7479
7564
|
* Convert a value to a string:
|
|
7480
7565
|
* in case of an array, we convert it to CSV.
|
|
@@ -9942,7 +10027,7 @@ class AnswerService {
|
|
|
9942
10027
|
async getTML() {
|
|
9943
10028
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
9944
10029
|
const edoc = object[0].edoc;
|
|
9945
|
-
const YAML = await import('./index-
|
|
10030
|
+
const YAML = await import('./index-BMppCU63.js');
|
|
9946
10031
|
const parsedDoc = YAML.parse(edoc);
|
|
9947
10032
|
return {
|
|
9948
10033
|
answer: {
|
|
@@ -21251,6 +21336,7 @@ const handleInterceptEvent = async (params) => {
|
|
|
21251
21336
|
errorType: ErrorDetailsTypes.API,
|
|
21252
21337
|
message: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
21253
21338
|
code: EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
|
|
21339
|
+
severity: EmbedErrorSeverity.SEV3,
|
|
21254
21340
|
error: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
21255
21341
|
};
|
|
21256
21342
|
executeEvent(EmbedEvent.Error, errorDetails);
|
|
@@ -21595,6 +21681,7 @@ class TsEmbed {
|
|
|
21595
21681
|
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21596
21682
|
message: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
21597
21683
|
code: EmbedErrorCodes.INIT_ERROR,
|
|
21684
|
+
severity: EmbedErrorSeverity.SEV1,
|
|
21598
21685
|
error: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
21599
21686
|
});
|
|
21600
21687
|
}
|
|
@@ -21605,7 +21692,10 @@ class TsEmbed {
|
|
|
21605
21692
|
*/
|
|
21606
21693
|
handleError(errorDetails) {
|
|
21607
21694
|
this.isError = true;
|
|
21608
|
-
this.executeCallbacks(EmbedEvent.Error,
|
|
21695
|
+
this.executeCallbacks(EmbedEvent.Error, {
|
|
21696
|
+
severity: EmbedErrorSeverity.SEV3,
|
|
21697
|
+
...errorDetails,
|
|
21698
|
+
});
|
|
21609
21699
|
// Log error
|
|
21610
21700
|
logger$3.error(errorDetails);
|
|
21611
21701
|
}
|
|
@@ -21690,6 +21780,7 @@ class TsEmbed {
|
|
|
21690
21780
|
errorType: ErrorDetailsTypes.NETWORK,
|
|
21691
21781
|
message: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
21692
21782
|
code: EmbedErrorCodes.NETWORK_ERROR,
|
|
21783
|
+
severity: EmbedErrorSeverity.SEV2,
|
|
21693
21784
|
offlineWarning: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
21694
21785
|
};
|
|
21695
21786
|
this.executeCallbacks(EmbedEvent.Error, errorDetails);
|
|
@@ -21847,10 +21938,14 @@ class TsEmbed {
|
|
|
21847
21938
|
return `${basePath}#`;
|
|
21848
21939
|
}
|
|
21849
21940
|
async getUpdateEmbedParamsObject() {
|
|
21850
|
-
|
|
21941
|
+
const queryParams = this.getEmbedParamsObject();
|
|
21942
|
+
// Values are URL-serialized (e.g. dataSources as '["guid"]'); parse
|
|
21943
|
+
// them back so the event payload matches a URL load (SCAL-334713).
|
|
21944
|
+
Object.keys(queryParams).forEach((key) => {
|
|
21945
|
+
queryParams[key] = deserializeParam(queryParams[key]);
|
|
21946
|
+
});
|
|
21851
21947
|
const appInitData = await this.getAppInitData();
|
|
21852
|
-
|
|
21853
|
-
return queryParams;
|
|
21948
|
+
return { ...this.viewConfig, ...queryParams, ...appInitData };
|
|
21854
21949
|
}
|
|
21855
21950
|
/**
|
|
21856
21951
|
* Common query params set for all the embed modes.
|
|
@@ -22058,9 +22153,10 @@ class TsEmbed {
|
|
|
22058
22153
|
return iFrame;
|
|
22059
22154
|
}
|
|
22060
22155
|
/**
|
|
22061
|
-
* Returns a merged {@link PreRenderConfig} object where each
|
|
22062
|
-
*
|
|
22063
|
-
*
|
|
22156
|
+
* Returns a merged {@link PreRenderConfig} object where each key prefers the
|
|
22157
|
+
* value from `preRenderConfig` over its deprecated top-level `viewConfig`
|
|
22158
|
+
* counterpart (`id`/`preRenderId`, `containerSelector`/`preRenderContainer`,
|
|
22159
|
+
* `doNotTrackSize`/`doNotTrackPreRenderSize`) for backward compatibility.
|
|
22064
22160
|
*/
|
|
22065
22161
|
getPreRenderConfig() {
|
|
22066
22162
|
var _a, _b, _c, _d;
|
|
@@ -22068,16 +22164,16 @@ class TsEmbed {
|
|
|
22068
22164
|
const preRenderCfg = (_a = viewCfg.preRenderConfig) !== null && _a !== void 0 ? _a : {};
|
|
22069
22165
|
return {
|
|
22070
22166
|
...preRenderCfg,
|
|
22071
|
-
|
|
22072
|
-
|
|
22073
|
-
|
|
22167
|
+
id: (_b = preRenderCfg.id) !== null && _b !== void 0 ? _b : viewCfg.preRenderId,
|
|
22168
|
+
containerSelector: (_c = preRenderCfg.containerSelector) !== null && _c !== void 0 ? _c : viewCfg.preRenderContainer,
|
|
22169
|
+
doNotTrackSize: (_d = preRenderCfg.doNotTrackSize) !== null && _d !== void 0 ? _d : viewCfg.doNotTrackPreRenderSize,
|
|
22074
22170
|
};
|
|
22075
22171
|
}
|
|
22076
22172
|
/**
|
|
22077
22173
|
* Returns true if this embed instance is configured for pre-rendering.
|
|
22078
22174
|
*/
|
|
22079
22175
|
isPreRenderEmbed() {
|
|
22080
|
-
return !!this.getPreRenderConfig().
|
|
22176
|
+
return !!this.getPreRenderConfig().id;
|
|
22081
22177
|
}
|
|
22082
22178
|
handleInsertionIntoDOM(child) {
|
|
22083
22179
|
if (this.isPreRenderEmbed()) {
|
|
@@ -22173,6 +22269,7 @@ class TsEmbed {
|
|
|
22173
22269
|
errorType: ErrorDetailsTypes.API,
|
|
22174
22270
|
message: error.message || ERROR_MESSAGE.LOGIN_FAILED,
|
|
22175
22271
|
code: EmbedErrorCodes.LOGIN_FAILED,
|
|
22272
|
+
severity: EmbedErrorSeverity.SEV1,
|
|
22176
22273
|
error: error,
|
|
22177
22274
|
});
|
|
22178
22275
|
});
|
|
@@ -22264,7 +22361,7 @@ class TsEmbed {
|
|
|
22264
22361
|
*/
|
|
22265
22362
|
resolvePreRenderContainerTarget() {
|
|
22266
22363
|
var _a;
|
|
22267
|
-
const containerConfig = this.getPreRenderConfig().
|
|
22364
|
+
const containerConfig = this.getPreRenderConfig().containerSelector;
|
|
22268
22365
|
let container = null;
|
|
22269
22366
|
if (typeof containerConfig === 'string') {
|
|
22270
22367
|
try {
|
|
@@ -22289,7 +22386,7 @@ class TsEmbed {
|
|
|
22289
22386
|
return;
|
|
22290
22387
|
}
|
|
22291
22388
|
const ownerContainer = (_a = preRenderedObject.preRenderContainerEl) !== null && _a !== void 0 ? _a : document.body;
|
|
22292
|
-
if (this.getPreRenderConfig().
|
|
22389
|
+
if (this.getPreRenderConfig().containerSelector
|
|
22293
22390
|
&& this.resolvePreRenderContainerTarget() !== ownerContainer) {
|
|
22294
22391
|
logger$3.warn('preRenderContainer is applied only by the component that creates the preRender; '
|
|
22295
22392
|
+ 'the one passed here is ignored. Set it on the PreRender component instead.');
|
|
@@ -22786,7 +22883,7 @@ class TsEmbed {
|
|
|
22786
22883
|
showPreRenderByDefault,
|
|
22787
22884
|
replaceExistingPreRender,
|
|
22788
22885
|
});
|
|
22789
|
-
if (!this.getPreRenderConfig().
|
|
22886
|
+
if (!this.getPreRenderConfig().id) {
|
|
22790
22887
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
22791
22888
|
return this;
|
|
22792
22889
|
}
|
|
@@ -22962,12 +23059,12 @@ class TsEmbed {
|
|
|
22962
23059
|
async showPreRender() {
|
|
22963
23060
|
var _a, _b;
|
|
22964
23061
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_SHOW_PRE_RENDER, {
|
|
22965
|
-
preRenderId: this.getPreRenderConfig().
|
|
23062
|
+
preRenderId: this.getPreRenderConfig().id,
|
|
22966
23063
|
embedComponentType: this.viewConfig.embedComponentType,
|
|
22967
23064
|
});
|
|
22968
23065
|
if (this.shouldWaitForRenderPromise)
|
|
22969
23066
|
await this.isReadyForRenderPromise;
|
|
22970
|
-
if (!this.getPreRenderConfig().
|
|
23067
|
+
if (!this.getPreRenderConfig().id) {
|
|
22971
23068
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
22972
23069
|
return this;
|
|
22973
23070
|
}
|
|
@@ -23003,7 +23100,7 @@ class TsEmbed {
|
|
|
23003
23100
|
this.containerScrollListener = () => this.syncPreRenderStyle();
|
|
23004
23101
|
customContainer.addEventListener('scroll', this.containerScrollListener);
|
|
23005
23102
|
}
|
|
23006
|
-
if (!this.getPreRenderConfig().
|
|
23103
|
+
if (!this.getPreRenderConfig().doNotTrackSize) {
|
|
23007
23104
|
const observeTarget = (_b = this.insertedDomEl) !== null && _b !== void 0 ? _b : this.hostElement;
|
|
23008
23105
|
this.resizeObserver = new ResizeObserver((entries) => {
|
|
23009
23106
|
entries.forEach((entry) => {
|
|
@@ -23071,7 +23168,7 @@ class TsEmbed {
|
|
|
23071
23168
|
*/
|
|
23072
23169
|
hidePreRender() {
|
|
23073
23170
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_HIDE_PRE_RENDER, {
|
|
23074
|
-
preRenderId: this.getPreRenderConfig().
|
|
23171
|
+
preRenderId: this.getPreRenderConfig().id,
|
|
23075
23172
|
embedComponentType: this.viewConfig.embedComponentType,
|
|
23076
23173
|
});
|
|
23077
23174
|
logger$3.debug('HidePreRender Called');
|
|
@@ -23109,7 +23206,7 @@ class TsEmbed {
|
|
|
23109
23206
|
* @property {string} child - The HTML element ID for the PreRender child.
|
|
23110
23207
|
*/
|
|
23111
23208
|
getPreRenderIds() {
|
|
23112
|
-
const preRenderId = this.getPreRenderConfig().
|
|
23209
|
+
const preRenderId = this.getPreRenderConfig().id;
|
|
23113
23210
|
return {
|
|
23114
23211
|
wrapper: `${PRERENDER_WRAPPER_ID_PREFIX}${preRenderId}`,
|
|
23115
23212
|
child: `tsEmbed-pre-render-child-${preRenderId}`,
|
|
@@ -24318,6 +24415,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
24318
24415
|
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
24319
24416
|
message: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
24320
24417
|
code: EmbedErrorCodes.LIVEBOARD_ID_MISSING,
|
|
24418
|
+
severity: EmbedErrorSeverity.SEV1,
|
|
24321
24419
|
error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
24322
24420
|
});
|
|
24323
24421
|
}
|
|
@@ -24469,7 +24567,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
24469
24567
|
if (this.isRendered) {
|
|
24470
24568
|
this.trigger(HostEvent.Navigate, path.substring(1));
|
|
24471
24569
|
}
|
|
24472
|
-
else if (this.getPreRenderConfig().
|
|
24570
|
+
else if (this.getPreRenderConfig().id) {
|
|
24473
24571
|
this.preRender(true);
|
|
24474
24572
|
}
|
|
24475
24573
|
else {
|
|
@@ -26109,4 +26207,4 @@ class AutoFrameRenderer extends TsEmbed {
|
|
|
26109
26207
|
}
|
|
26110
26208
|
}
|
|
26111
26209
|
|
|
26112
|
-
export { Action, AnswerService, AppEmbed, ApplicabilityLevel, AuthEvent, AuthFailureType, AuthStatus, AuthType, BackgroundFormatType, BodylessConversation, ConditionalFormattingComparisonType, ConditionalFormattingOperator, ContextMenuTriggerOptions, ContextType, ConversationEmbed, CustomActionTarget, CustomActionsPosition, DataLabelFilterOperator, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedErrorCodes, EmbedEvent, ErrorDetailsTypes, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, InterceptedApiType, LegendPosition, ListPage, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, SpotterQueryMode, TableContentDensity, TableTheme, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, reloadIframe, resetCachedAuthToken, startAutoMCPFrameRenderer, tokenizedFetch, uploadMixpanelEvent };
|
|
26210
|
+
export { Action, AnswerService, AppEmbed, ApplicabilityLevel, AuthEvent, AuthFailureType, AuthStatus, AuthType, BackgroundFormatType, BodylessConversation, ConditionalFormattingComparisonType, ConditionalFormattingOperator, ContextMenuTriggerOptions, ContextType, ConversationEmbed, CustomActionTarget, CustomActionsPosition, DataLabelFilterOperator, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedErrorCodes, EmbedErrorSeverity, EmbedEvent, ErrorDetailsTypes, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, InterceptedApiType, LegendPosition, ListPage, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, SpotterQueryMode, TableContentDensity, TableTheme, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, reloadIframe, resetCachedAuthToken, startAutoMCPFrameRenderer, tokenizedFetch, uploadMixpanelEvent };
|