@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.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 (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -1731,7 +1731,32 @@
|
|
|
1731
1731
|
*/
|
|
1732
1732
|
EmbedEvent["OrgSwitched"] = "orgSwitched";
|
|
1733
1733
|
/**
|
|
1734
|
-
* Emitted
|
|
1734
|
+
* Emitted before the embedded ThoughtSpot app sends a network request whose
|
|
1735
|
+
* fully resolved URL matches one of the `interceptUrls` in the view config.
|
|
1736
|
+
* The request is held until you call `responder`, which decides whether the
|
|
1737
|
+
* real request goes out or a response you supply is used in its place.
|
|
1738
|
+
*
|
|
1739
|
+
* Setting `interceptUrls` is what enables this; there is no separate enable
|
|
1740
|
+
* flag. If `responder` is not called within `interceptTimeout` (30000 ms by
|
|
1741
|
+
* default) the request fails and `EmbedEvent.Error` is emitted.
|
|
1742
|
+
*
|
|
1743
|
+
* The payload is `{ input, init, urlType }`, where `input` is the request
|
|
1744
|
+
* URL and `init` is the `fetch` init object, with `init.body` parsed into an
|
|
1745
|
+
* object when it is valid JSON. `urlType` is the matching
|
|
1746
|
+
* `InterceptedApiType`; it is `InterceptedApiType.ALL` for any URL outside
|
|
1747
|
+
* the recognized API groups.
|
|
1748
|
+
*
|
|
1749
|
+
* Interception wraps the outermost layer of `fetch`, so `init` holds the
|
|
1750
|
+
* request as the application composed it, before ThoughtSpot attaches its
|
|
1751
|
+
* authentication headers. Those headers, and any token refresh and retry,
|
|
1752
|
+
* are applied afterwards and only when you pass `execute: true`. Only
|
|
1753
|
+
* requests made through `fetch` are intercepted.
|
|
1754
|
+
*
|
|
1755
|
+
* Pass `execute: true` to let the original request proceed untouched, in
|
|
1756
|
+
* which case any `response` you supply alongside it is ignored. With
|
|
1757
|
+
* `execute: false` the request is never sent, and your `response.body` is
|
|
1758
|
+
* returned to the app as JSON, defaulting to status 200 and a
|
|
1759
|
+
* `Content-Type: application/json` header.
|
|
1735
1760
|
*
|
|
1736
1761
|
* Supported on all embed types.
|
|
1737
1762
|
*
|
|
@@ -2541,7 +2566,7 @@
|
|
|
2541
2566
|
*
|
|
2542
2567
|
* Unlike {@link HostEvent.OpenFilter}, which opens the panel of an
|
|
2543
2568
|
* existing filter, this event starts the creation of a new filter.
|
|
2544
|
-
* @version SDK: 1.
|
|
2569
|
+
* @version SDK: 1.51.1 | ThoughtSpot Cloud: 26.8.0.cl
|
|
2545
2570
|
* @example
|
|
2546
2571
|
* ```js
|
|
2547
2572
|
* liveboardEmbed.trigger(HostEvent.OpenAddFilterModal);
|
|
@@ -2557,7 +2582,7 @@
|
|
|
2557
2582
|
* Hiding the *Add parameter* button with `hiddenActions:
|
|
2558
2583
|
* [Action.AddParameter]` does not block this event, but disabling it
|
|
2559
2584
|
* with `disabledActions` does.
|
|
2560
|
-
* @version SDK: 1.
|
|
2585
|
+
* @version SDK: 1.51.1 | ThoughtSpot Cloud: 26.8.0.cl
|
|
2561
2586
|
* @example
|
|
2562
2587
|
* ```js
|
|
2563
2588
|
* liveboardEmbed.trigger(HostEvent.OpenAddParameterModal);
|
|
@@ -4435,7 +4460,13 @@
|
|
|
4435
4460
|
*/
|
|
4436
4461
|
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
4437
4462
|
/**
|
|
4438
|
-
*
|
|
4463
|
+
* Notifies the embedded ThoughtSpot app that the embed is being torn down, so that
|
|
4464
|
+
* it can release any resources it holds before the iframe is removed from the DOM.
|
|
4465
|
+
*
|
|
4466
|
+
* This is triggered for you by `embed.destroy()`; you rarely need to trigger it
|
|
4467
|
+
* directly. If `waitForCleanupOnDestroy` is set in the embed config, `destroy()`
|
|
4468
|
+
* waits for the app to acknowledge this event (up to `cleanupTimeout`) before
|
|
4469
|
+
* removing the iframe.
|
|
4439
4470
|
* @example
|
|
4440
4471
|
* ```js
|
|
4441
4472
|
* liveboardEmbed.trigger(HostEvent.DestroyEmbed);
|
|
@@ -6553,7 +6584,7 @@
|
|
|
6553
6584
|
* ```js
|
|
6554
6585
|
* hiddenActions: [Action.QuickSearchPill]
|
|
6555
6586
|
* ```
|
|
6556
|
-
* @version SDK: 1.
|
|
6587
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
6557
6588
|
*/
|
|
6558
6589
|
Action["QuickSearchPill"] = "quickSearchPill";
|
|
6559
6590
|
/**
|
|
@@ -6568,7 +6599,7 @@
|
|
|
6568
6599
|
* ```js
|
|
6569
6600
|
* hiddenActions: [Action.DeepAnalysisPill]
|
|
6570
6601
|
* ```
|
|
6571
|
-
* @version SDK: 1.
|
|
6602
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
6572
6603
|
*/
|
|
6573
6604
|
Action["DeepAnalysisPill"] = "deepAnalysisPill";
|
|
6574
6605
|
/**
|
|
@@ -6583,7 +6614,7 @@
|
|
|
6583
6614
|
* ```js
|
|
6584
6615
|
* hiddenActions: [Action.DataLiteracyPill]
|
|
6585
6616
|
* ```
|
|
6586
|
-
* @version SDK: 1.
|
|
6617
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
6587
6618
|
*/
|
|
6588
6619
|
Action["DataLiteracyPill"] = "dataLiteracyPill";
|
|
6589
6620
|
/**
|
|
@@ -7056,6 +7087,36 @@
|
|
|
7056
7087
|
/** UpdateParameters payload is invalid - malformed applicability */
|
|
7057
7088
|
EmbedErrorCodes["UPDATEPARAMETERS_INVALID_PAYLOAD"] = "UPDATEPARAMETERS_INVALID_PAYLOAD";
|
|
7058
7089
|
})(exports.EmbedErrorCodes || (exports.EmbedErrorCodes = {}));
|
|
7090
|
+
/**
|
|
7091
|
+
* How badly an error affects the embed, so the host can decide whether it is
|
|
7092
|
+
* worth surfacing to the end user.
|
|
7093
|
+
*
|
|
7094
|
+
* Mirrors the severity that ThoughtSpot itself stamps on errors raised inside
|
|
7095
|
+
* the embedded app, so a host can apply one rule to both sources.
|
|
7096
|
+
*
|
|
7097
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
7098
|
+
* @group Error Handling
|
|
7099
|
+
*
|
|
7100
|
+
* @example
|
|
7101
|
+
* Only surface errors that took the embed down
|
|
7102
|
+
*
|
|
7103
|
+
* ```js
|
|
7104
|
+
* embed.on(EmbedEvent.Error, (error) => {
|
|
7105
|
+
* if (error.severity === EmbedErrorSeverity.SEV1) {
|
|
7106
|
+
* showBanner(error.message);
|
|
7107
|
+
* }
|
|
7108
|
+
* });
|
|
7109
|
+
* ```
|
|
7110
|
+
*/
|
|
7111
|
+
exports.EmbedErrorSeverity = void 0;
|
|
7112
|
+
(function (EmbedErrorSeverity) {
|
|
7113
|
+
/** The embed cannot render. Nothing usable is on screen. */
|
|
7114
|
+
EmbedErrorSeverity[EmbedErrorSeverity["SEV1"] = 1] = "SEV1";
|
|
7115
|
+
/** Something is degraded but the embed still works. */
|
|
7116
|
+
EmbedErrorSeverity[EmbedErrorSeverity["SEV2"] = 2] = "SEV2";
|
|
7117
|
+
/** Everything else, including validation of the embedder's own input. */
|
|
7118
|
+
EmbedErrorSeverity[EmbedErrorSeverity["SEV3"] = 3] = "SEV3";
|
|
7119
|
+
})(exports.EmbedErrorSeverity || (exports.EmbedErrorSeverity = {}));
|
|
7059
7120
|
/**
|
|
7060
7121
|
* Context types for specifying the page context when triggering host events.
|
|
7061
7122
|
* Used as the third parameter in the `trigger` method to help ThoughtSpot
|
|
@@ -7096,20 +7157,27 @@
|
|
|
7096
7157
|
ContextType["Other"] = "other";
|
|
7097
7158
|
})(exports.ContextType || (exports.ContextType = {}));
|
|
7098
7159
|
/**
|
|
7099
|
-
*
|
|
7160
|
+
* Named groups of ThoughtSpot APIs that can be intercepted, for use in
|
|
7161
|
+
* `interceptUrls`. Each group expands to the underlying request URLs, so you do
|
|
7162
|
+
* not have to list them individually.
|
|
7100
7163
|
*/
|
|
7101
7164
|
exports.InterceptedApiType = void 0;
|
|
7102
7165
|
(function (InterceptedApiType) {
|
|
7103
7166
|
/**
|
|
7104
|
-
* The
|
|
7167
|
+
* The APIs that fetch the data backing an Answer, including its chart,
|
|
7168
|
+
* table, and headline data.
|
|
7105
7169
|
*/
|
|
7106
7170
|
InterceptedApiType["AnswerData"] = "AnswerData";
|
|
7107
7171
|
/**
|
|
7108
|
-
*
|
|
7172
|
+
* Intercepts every `fetch` request the embedded application makes, not only
|
|
7173
|
+
* the data APIs. This includes authentication, session, and metadata calls,
|
|
7174
|
+
* so the handler must respond to requests it does not recognize by passing
|
|
7175
|
+
* `execute: true`. Listing this alongside other entries in `interceptUrls`
|
|
7176
|
+
* supersedes them.
|
|
7109
7177
|
*/
|
|
7110
7178
|
InterceptedApiType["ALL"] = "ALL";
|
|
7111
7179
|
/**
|
|
7112
|
-
* The
|
|
7180
|
+
* The APIs that fetch the data backing a Liveboard.
|
|
7113
7181
|
*/
|
|
7114
7182
|
InterceptedApiType["LiveboardData"] = "LiveboardData";
|
|
7115
7183
|
})(exports.InterceptedApiType || (exports.InterceptedApiType = {}));
|
|
@@ -7233,7 +7301,7 @@
|
|
|
7233
7301
|
TableContentDensity["Compact"] = "COMPACT";
|
|
7234
7302
|
})(exports.TableContentDensity || (exports.TableContentDensity = {}));
|
|
7235
7303
|
|
|
7236
|
-
var version$1="1.
|
|
7304
|
+
var version$1="1.52.0";var pkg = {version:version$1};
|
|
7237
7305
|
|
|
7238
7306
|
const { version } = pkg;
|
|
7239
7307
|
|
|
@@ -7481,6 +7549,23 @@
|
|
|
7481
7549
|
}
|
|
7482
7550
|
return JSON.stringify(value);
|
|
7483
7551
|
};
|
|
7552
|
+
/**
|
|
7553
|
+
* Inverse of serializeParam: JSON.parse with fallback to the raw string,
|
|
7554
|
+
* matching how the app parses the same values from the iframe URL.
|
|
7555
|
+
*/
|
|
7556
|
+
const deserializeParam = (value) => {
|
|
7557
|
+
if (typeof value !== 'string')
|
|
7558
|
+
return value;
|
|
7559
|
+
try {
|
|
7560
|
+
const parsed = JSON.parse(value);
|
|
7561
|
+
// Numeric strings stay strings ('123' !== 123), same as the app's
|
|
7562
|
+
// URL parser — param consumers expect string ids/versions.
|
|
7563
|
+
return typeof parsed === 'number' ? value : parsed;
|
|
7564
|
+
}
|
|
7565
|
+
catch (e) {
|
|
7566
|
+
return value;
|
|
7567
|
+
}
|
|
7568
|
+
};
|
|
7484
7569
|
/**
|
|
7485
7570
|
* Convert a value to a string:
|
|
7486
7571
|
* in case of an array, we convert it to CSV.
|
|
@@ -21257,6 +21342,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21257
21342
|
errorType: exports.ErrorDetailsTypes.API,
|
|
21258
21343
|
message: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
21259
21344
|
code: exports.EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
|
|
21345
|
+
severity: exports.EmbedErrorSeverity.SEV3,
|
|
21260
21346
|
error: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
21261
21347
|
};
|
|
21262
21348
|
executeEvent(exports.EmbedEvent.Error, errorDetails);
|
|
@@ -21601,6 +21687,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21601
21687
|
errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21602
21688
|
message: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
21603
21689
|
code: exports.EmbedErrorCodes.INIT_ERROR,
|
|
21690
|
+
severity: exports.EmbedErrorSeverity.SEV1,
|
|
21604
21691
|
error: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
21605
21692
|
});
|
|
21606
21693
|
}
|
|
@@ -21611,7 +21698,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21611
21698
|
*/
|
|
21612
21699
|
handleError(errorDetails) {
|
|
21613
21700
|
this.isError = true;
|
|
21614
|
-
this.executeCallbacks(exports.EmbedEvent.Error,
|
|
21701
|
+
this.executeCallbacks(exports.EmbedEvent.Error, {
|
|
21702
|
+
severity: exports.EmbedErrorSeverity.SEV3,
|
|
21703
|
+
...errorDetails,
|
|
21704
|
+
});
|
|
21615
21705
|
// Log error
|
|
21616
21706
|
logger$3.error(errorDetails);
|
|
21617
21707
|
}
|
|
@@ -21696,6 +21786,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21696
21786
|
errorType: exports.ErrorDetailsTypes.NETWORK,
|
|
21697
21787
|
message: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
21698
21788
|
code: exports.EmbedErrorCodes.NETWORK_ERROR,
|
|
21789
|
+
severity: exports.EmbedErrorSeverity.SEV2,
|
|
21699
21790
|
offlineWarning: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
21700
21791
|
};
|
|
21701
21792
|
this.executeCallbacks(exports.EmbedEvent.Error, errorDetails);
|
|
@@ -21853,10 +21944,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21853
21944
|
return `${basePath}#`;
|
|
21854
21945
|
}
|
|
21855
21946
|
async getUpdateEmbedParamsObject() {
|
|
21856
|
-
|
|
21947
|
+
const queryParams = this.getEmbedParamsObject();
|
|
21948
|
+
// Values are URL-serialized (e.g. dataSources as '["guid"]'); parse
|
|
21949
|
+
// them back so the event payload matches a URL load (SCAL-334713).
|
|
21950
|
+
Object.keys(queryParams).forEach((key) => {
|
|
21951
|
+
queryParams[key] = deserializeParam(queryParams[key]);
|
|
21952
|
+
});
|
|
21857
21953
|
const appInitData = await this.getAppInitData();
|
|
21858
|
-
|
|
21859
|
-
return queryParams;
|
|
21954
|
+
return { ...this.viewConfig, ...queryParams, ...appInitData };
|
|
21860
21955
|
}
|
|
21861
21956
|
/**
|
|
21862
21957
|
* Common query params set for all the embed modes.
|
|
@@ -22064,9 +22159,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22064
22159
|
return iFrame;
|
|
22065
22160
|
}
|
|
22066
22161
|
/**
|
|
22067
|
-
* Returns a merged {@link PreRenderConfig} object where each
|
|
22068
|
-
*
|
|
22069
|
-
*
|
|
22162
|
+
* Returns a merged {@link PreRenderConfig} object where each key prefers the
|
|
22163
|
+
* value from `preRenderConfig` over its deprecated top-level `viewConfig`
|
|
22164
|
+
* counterpart (`id`/`preRenderId`, `containerSelector`/`preRenderContainer`,
|
|
22165
|
+
* `doNotTrackSize`/`doNotTrackPreRenderSize`) for backward compatibility.
|
|
22070
22166
|
*/
|
|
22071
22167
|
getPreRenderConfig() {
|
|
22072
22168
|
var _a, _b, _c, _d;
|
|
@@ -22074,16 +22170,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22074
22170
|
const preRenderCfg = (_a = viewCfg.preRenderConfig) !== null && _a !== void 0 ? _a : {};
|
|
22075
22171
|
return {
|
|
22076
22172
|
...preRenderCfg,
|
|
22077
|
-
|
|
22078
|
-
|
|
22079
|
-
|
|
22173
|
+
id: (_b = preRenderCfg.id) !== null && _b !== void 0 ? _b : viewCfg.preRenderId,
|
|
22174
|
+
containerSelector: (_c = preRenderCfg.containerSelector) !== null && _c !== void 0 ? _c : viewCfg.preRenderContainer,
|
|
22175
|
+
doNotTrackSize: (_d = preRenderCfg.doNotTrackSize) !== null && _d !== void 0 ? _d : viewCfg.doNotTrackPreRenderSize,
|
|
22080
22176
|
};
|
|
22081
22177
|
}
|
|
22082
22178
|
/**
|
|
22083
22179
|
* Returns true if this embed instance is configured for pre-rendering.
|
|
22084
22180
|
*/
|
|
22085
22181
|
isPreRenderEmbed() {
|
|
22086
|
-
return !!this.getPreRenderConfig().
|
|
22182
|
+
return !!this.getPreRenderConfig().id;
|
|
22087
22183
|
}
|
|
22088
22184
|
handleInsertionIntoDOM(child) {
|
|
22089
22185
|
if (this.isPreRenderEmbed()) {
|
|
@@ -22179,6 +22275,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22179
22275
|
errorType: exports.ErrorDetailsTypes.API,
|
|
22180
22276
|
message: error.message || ERROR_MESSAGE.LOGIN_FAILED,
|
|
22181
22277
|
code: exports.EmbedErrorCodes.LOGIN_FAILED,
|
|
22278
|
+
severity: exports.EmbedErrorSeverity.SEV1,
|
|
22182
22279
|
error: error,
|
|
22183
22280
|
});
|
|
22184
22281
|
});
|
|
@@ -22270,7 +22367,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22270
22367
|
*/
|
|
22271
22368
|
resolvePreRenderContainerTarget() {
|
|
22272
22369
|
var _a;
|
|
22273
|
-
const containerConfig = this.getPreRenderConfig().
|
|
22370
|
+
const containerConfig = this.getPreRenderConfig().containerSelector;
|
|
22274
22371
|
let container = null;
|
|
22275
22372
|
if (typeof containerConfig === 'string') {
|
|
22276
22373
|
try {
|
|
@@ -22295,7 +22392,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22295
22392
|
return;
|
|
22296
22393
|
}
|
|
22297
22394
|
const ownerContainer = (_a = preRenderedObject.preRenderContainerEl) !== null && _a !== void 0 ? _a : document.body;
|
|
22298
|
-
if (this.getPreRenderConfig().
|
|
22395
|
+
if (this.getPreRenderConfig().containerSelector
|
|
22299
22396
|
&& this.resolvePreRenderContainerTarget() !== ownerContainer) {
|
|
22300
22397
|
logger$3.warn('preRenderContainer is applied only by the component that creates the preRender; '
|
|
22301
22398
|
+ 'the one passed here is ignored. Set it on the PreRender component instead.');
|
|
@@ -22792,7 +22889,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22792
22889
|
showPreRenderByDefault,
|
|
22793
22890
|
replaceExistingPreRender,
|
|
22794
22891
|
});
|
|
22795
|
-
if (!this.getPreRenderConfig().
|
|
22892
|
+
if (!this.getPreRenderConfig().id) {
|
|
22796
22893
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
22797
22894
|
return this;
|
|
22798
22895
|
}
|
|
@@ -22968,12 +23065,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22968
23065
|
async showPreRender() {
|
|
22969
23066
|
var _a, _b;
|
|
22970
23067
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_SHOW_PRE_RENDER, {
|
|
22971
|
-
preRenderId: this.getPreRenderConfig().
|
|
23068
|
+
preRenderId: this.getPreRenderConfig().id,
|
|
22972
23069
|
embedComponentType: this.viewConfig.embedComponentType,
|
|
22973
23070
|
});
|
|
22974
23071
|
if (this.shouldWaitForRenderPromise)
|
|
22975
23072
|
await this.isReadyForRenderPromise;
|
|
22976
|
-
if (!this.getPreRenderConfig().
|
|
23073
|
+
if (!this.getPreRenderConfig().id) {
|
|
22977
23074
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
22978
23075
|
return this;
|
|
22979
23076
|
}
|
|
@@ -23009,7 +23106,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23009
23106
|
this.containerScrollListener = () => this.syncPreRenderStyle();
|
|
23010
23107
|
customContainer.addEventListener('scroll', this.containerScrollListener);
|
|
23011
23108
|
}
|
|
23012
|
-
if (!this.getPreRenderConfig().
|
|
23109
|
+
if (!this.getPreRenderConfig().doNotTrackSize) {
|
|
23013
23110
|
const observeTarget = (_b = this.insertedDomEl) !== null && _b !== void 0 ? _b : this.hostElement;
|
|
23014
23111
|
this.resizeObserver = new ResizeObserver((entries) => {
|
|
23015
23112
|
entries.forEach((entry) => {
|
|
@@ -23077,7 +23174,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23077
23174
|
*/
|
|
23078
23175
|
hidePreRender() {
|
|
23079
23176
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_HIDE_PRE_RENDER, {
|
|
23080
|
-
preRenderId: this.getPreRenderConfig().
|
|
23177
|
+
preRenderId: this.getPreRenderConfig().id,
|
|
23081
23178
|
embedComponentType: this.viewConfig.embedComponentType,
|
|
23082
23179
|
});
|
|
23083
23180
|
logger$3.debug('HidePreRender Called');
|
|
@@ -23115,7 +23212,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23115
23212
|
* @property {string} child - The HTML element ID for the PreRender child.
|
|
23116
23213
|
*/
|
|
23117
23214
|
getPreRenderIds() {
|
|
23118
|
-
const preRenderId = this.getPreRenderConfig().
|
|
23215
|
+
const preRenderId = this.getPreRenderConfig().id;
|
|
23119
23216
|
return {
|
|
23120
23217
|
wrapper: `${PRERENDER_WRAPPER_ID_PREFIX}${preRenderId}`,
|
|
23121
23218
|
child: `tsEmbed-pre-render-child-${preRenderId}`,
|
|
@@ -24324,6 +24421,7 @@ query GetEurekaVizSnapshots(
|
|
|
24324
24421
|
errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
|
|
24325
24422
|
message: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
24326
24423
|
code: exports.EmbedErrorCodes.LIVEBOARD_ID_MISSING,
|
|
24424
|
+
severity: exports.EmbedErrorSeverity.SEV1,
|
|
24327
24425
|
error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
24328
24426
|
});
|
|
24329
24427
|
}
|
|
@@ -24475,7 +24573,7 @@ query GetEurekaVizSnapshots(
|
|
|
24475
24573
|
if (this.isRendered) {
|
|
24476
24574
|
this.trigger(exports.HostEvent.Navigate, path.substring(1));
|
|
24477
24575
|
}
|
|
24478
|
-
else if (this.getPreRenderConfig().
|
|
24576
|
+
else if (this.getPreRenderConfig().id) {
|
|
24479
24577
|
this.preRender(true);
|
|
24480
24578
|
}
|
|
24481
24579
|
else {
|