@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.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, require('react')) :
|
|
@@ -1932,7 +1932,32 @@
|
|
|
1932
1932
|
*/
|
|
1933
1933
|
EmbedEvent["OrgSwitched"] = "orgSwitched";
|
|
1934
1934
|
/**
|
|
1935
|
-
* Emitted
|
|
1935
|
+
* Emitted before the embedded ThoughtSpot app sends a network request whose
|
|
1936
|
+
* fully resolved URL matches one of the `interceptUrls` in the view config.
|
|
1937
|
+
* The request is held until you call `responder`, which decides whether the
|
|
1938
|
+
* real request goes out or a response you supply is used in its place.
|
|
1939
|
+
*
|
|
1940
|
+
* Setting `interceptUrls` is what enables this; there is no separate enable
|
|
1941
|
+
* flag. If `responder` is not called within `interceptTimeout` (30000 ms by
|
|
1942
|
+
* default) the request fails and `EmbedEvent.Error` is emitted.
|
|
1943
|
+
*
|
|
1944
|
+
* The payload is `{ input, init, urlType }`, where `input` is the request
|
|
1945
|
+
* URL and `init` is the `fetch` init object, with `init.body` parsed into an
|
|
1946
|
+
* object when it is valid JSON. `urlType` is the matching
|
|
1947
|
+
* `InterceptedApiType`; it is `InterceptedApiType.ALL` for any URL outside
|
|
1948
|
+
* the recognized API groups.
|
|
1949
|
+
*
|
|
1950
|
+
* Interception wraps the outermost layer of `fetch`, so `init` holds the
|
|
1951
|
+
* request as the application composed it, before ThoughtSpot attaches its
|
|
1952
|
+
* authentication headers. Those headers, and any token refresh and retry,
|
|
1953
|
+
* are applied afterwards and only when you pass `execute: true`. Only
|
|
1954
|
+
* requests made through `fetch` are intercepted.
|
|
1955
|
+
*
|
|
1956
|
+
* Pass `execute: true` to let the original request proceed untouched, in
|
|
1957
|
+
* which case any `response` you supply alongside it is ignored. With
|
|
1958
|
+
* `execute: false` the request is never sent, and your `response.body` is
|
|
1959
|
+
* returned to the app as JSON, defaulting to status 200 and a
|
|
1960
|
+
* `Content-Type: application/json` header.
|
|
1936
1961
|
*
|
|
1937
1962
|
* Supported on all embed types.
|
|
1938
1963
|
*
|
|
@@ -2742,7 +2767,7 @@
|
|
|
2742
2767
|
*
|
|
2743
2768
|
* Unlike {@link HostEvent.OpenFilter}, which opens the panel of an
|
|
2744
2769
|
* existing filter, this event starts the creation of a new filter.
|
|
2745
|
-
* @version SDK: 1.
|
|
2770
|
+
* @version SDK: 1.51.1 | ThoughtSpot Cloud: 26.8.0.cl
|
|
2746
2771
|
* @example
|
|
2747
2772
|
* ```js
|
|
2748
2773
|
* liveboardEmbed.trigger(HostEvent.OpenAddFilterModal);
|
|
@@ -2758,7 +2783,7 @@
|
|
|
2758
2783
|
* Hiding the *Add parameter* button with `hiddenActions:
|
|
2759
2784
|
* [Action.AddParameter]` does not block this event, but disabling it
|
|
2760
2785
|
* with `disabledActions` does.
|
|
2761
|
-
* @version SDK: 1.
|
|
2786
|
+
* @version SDK: 1.51.1 | ThoughtSpot Cloud: 26.8.0.cl
|
|
2762
2787
|
* @example
|
|
2763
2788
|
* ```js
|
|
2764
2789
|
* liveboardEmbed.trigger(HostEvent.OpenAddParameterModal);
|
|
@@ -4636,7 +4661,13 @@
|
|
|
4636
4661
|
*/
|
|
4637
4662
|
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
4638
4663
|
/**
|
|
4639
|
-
*
|
|
4664
|
+
* Notifies the embedded ThoughtSpot app that the embed is being torn down, so that
|
|
4665
|
+
* it can release any resources it holds before the iframe is removed from the DOM.
|
|
4666
|
+
*
|
|
4667
|
+
* This is triggered for you by `embed.destroy()`; you rarely need to trigger it
|
|
4668
|
+
* directly. If `waitForCleanupOnDestroy` is set in the embed config, `destroy()`
|
|
4669
|
+
* waits for the app to acknowledge this event (up to `cleanupTimeout`) before
|
|
4670
|
+
* removing the iframe.
|
|
4640
4671
|
* @example
|
|
4641
4672
|
* ```js
|
|
4642
4673
|
* liveboardEmbed.trigger(HostEvent.DestroyEmbed);
|
|
@@ -6754,7 +6785,7 @@
|
|
|
6754
6785
|
* ```js
|
|
6755
6786
|
* hiddenActions: [Action.QuickSearchPill]
|
|
6756
6787
|
* ```
|
|
6757
|
-
* @version SDK: 1.
|
|
6788
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
6758
6789
|
*/
|
|
6759
6790
|
Action["QuickSearchPill"] = "quickSearchPill";
|
|
6760
6791
|
/**
|
|
@@ -6769,7 +6800,7 @@
|
|
|
6769
6800
|
* ```js
|
|
6770
6801
|
* hiddenActions: [Action.DeepAnalysisPill]
|
|
6771
6802
|
* ```
|
|
6772
|
-
* @version SDK: 1.
|
|
6803
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
6773
6804
|
*/
|
|
6774
6805
|
Action["DeepAnalysisPill"] = "deepAnalysisPill";
|
|
6775
6806
|
/**
|
|
@@ -6784,7 +6815,7 @@
|
|
|
6784
6815
|
* ```js
|
|
6785
6816
|
* hiddenActions: [Action.DataLiteracyPill]
|
|
6786
6817
|
* ```
|
|
6787
|
-
* @version SDK: 1.
|
|
6818
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
6788
6819
|
*/
|
|
6789
6820
|
Action["DataLiteracyPill"] = "dataLiteracyPill";
|
|
6790
6821
|
/**
|
|
@@ -7257,6 +7288,36 @@
|
|
|
7257
7288
|
/** UpdateParameters payload is invalid - malformed applicability */
|
|
7258
7289
|
EmbedErrorCodes["UPDATEPARAMETERS_INVALID_PAYLOAD"] = "UPDATEPARAMETERS_INVALID_PAYLOAD";
|
|
7259
7290
|
})(EmbedErrorCodes || (EmbedErrorCodes = {}));
|
|
7291
|
+
/**
|
|
7292
|
+
* How badly an error affects the embed, so the host can decide whether it is
|
|
7293
|
+
* worth surfacing to the end user.
|
|
7294
|
+
*
|
|
7295
|
+
* Mirrors the severity that ThoughtSpot itself stamps on errors raised inside
|
|
7296
|
+
* the embedded app, so a host can apply one rule to both sources.
|
|
7297
|
+
*
|
|
7298
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
7299
|
+
* @group Error Handling
|
|
7300
|
+
*
|
|
7301
|
+
* @example
|
|
7302
|
+
* Only surface errors that took the embed down
|
|
7303
|
+
*
|
|
7304
|
+
* ```js
|
|
7305
|
+
* embed.on(EmbedEvent.Error, (error) => {
|
|
7306
|
+
* if (error.severity === EmbedErrorSeverity.SEV1) {
|
|
7307
|
+
* showBanner(error.message);
|
|
7308
|
+
* }
|
|
7309
|
+
* });
|
|
7310
|
+
* ```
|
|
7311
|
+
*/
|
|
7312
|
+
var EmbedErrorSeverity;
|
|
7313
|
+
(function (EmbedErrorSeverity) {
|
|
7314
|
+
/** The embed cannot render. Nothing usable is on screen. */
|
|
7315
|
+
EmbedErrorSeverity[EmbedErrorSeverity["SEV1"] = 1] = "SEV1";
|
|
7316
|
+
/** Something is degraded but the embed still works. */
|
|
7317
|
+
EmbedErrorSeverity[EmbedErrorSeverity["SEV2"] = 2] = "SEV2";
|
|
7318
|
+
/** Everything else, including validation of the embedder's own input. */
|
|
7319
|
+
EmbedErrorSeverity[EmbedErrorSeverity["SEV3"] = 3] = "SEV3";
|
|
7320
|
+
})(EmbedErrorSeverity || (EmbedErrorSeverity = {}));
|
|
7260
7321
|
/**
|
|
7261
7322
|
* Context types for specifying the page context when triggering host events.
|
|
7262
7323
|
* Used as the third parameter in the `trigger` method to help ThoughtSpot
|
|
@@ -7297,20 +7358,27 @@
|
|
|
7297
7358
|
ContextType["Other"] = "other";
|
|
7298
7359
|
})(ContextType || (ContextType = {}));
|
|
7299
7360
|
/**
|
|
7300
|
-
*
|
|
7361
|
+
* Named groups of ThoughtSpot APIs that can be intercepted, for use in
|
|
7362
|
+
* `interceptUrls`. Each group expands to the underlying request URLs, so you do
|
|
7363
|
+
* not have to list them individually.
|
|
7301
7364
|
*/
|
|
7302
7365
|
var InterceptedApiType;
|
|
7303
7366
|
(function (InterceptedApiType) {
|
|
7304
7367
|
/**
|
|
7305
|
-
* The
|
|
7368
|
+
* The APIs that fetch the data backing an Answer, including its chart,
|
|
7369
|
+
* table, and headline data.
|
|
7306
7370
|
*/
|
|
7307
7371
|
InterceptedApiType["AnswerData"] = "AnswerData";
|
|
7308
7372
|
/**
|
|
7309
|
-
*
|
|
7373
|
+
* Intercepts every `fetch` request the embedded application makes, not only
|
|
7374
|
+
* the data APIs. This includes authentication, session, and metadata calls,
|
|
7375
|
+
* so the handler must respond to requests it does not recognize by passing
|
|
7376
|
+
* `execute: true`. Listing this alongside other entries in `interceptUrls`
|
|
7377
|
+
* supersedes them.
|
|
7310
7378
|
*/
|
|
7311
7379
|
InterceptedApiType["ALL"] = "ALL";
|
|
7312
7380
|
/**
|
|
7313
|
-
* The
|
|
7381
|
+
* The APIs that fetch the data backing a Liveboard.
|
|
7314
7382
|
*/
|
|
7315
7383
|
InterceptedApiType["LiveboardData"] = "LiveboardData";
|
|
7316
7384
|
})(InterceptedApiType || (InterceptedApiType = {}));
|
|
@@ -7434,7 +7502,7 @@
|
|
|
7434
7502
|
TableContentDensity["Compact"] = "COMPACT";
|
|
7435
7503
|
})(TableContentDensity || (TableContentDensity = {}));
|
|
7436
7504
|
|
|
7437
|
-
var version$1="1.
|
|
7505
|
+
var version$1="1.52.0";var pkg = {version:version$1};
|
|
7438
7506
|
|
|
7439
7507
|
const { version } = pkg;
|
|
7440
7508
|
|
|
@@ -7613,6 +7681,23 @@
|
|
|
7613
7681
|
}
|
|
7614
7682
|
return JSON.stringify(value);
|
|
7615
7683
|
};
|
|
7684
|
+
/**
|
|
7685
|
+
* Inverse of serializeParam: JSON.parse with fallback to the raw string,
|
|
7686
|
+
* matching how the app parses the same values from the iframe URL.
|
|
7687
|
+
*/
|
|
7688
|
+
const deserializeParam = (value) => {
|
|
7689
|
+
if (typeof value !== 'string')
|
|
7690
|
+
return value;
|
|
7691
|
+
try {
|
|
7692
|
+
const parsed = JSON.parse(value);
|
|
7693
|
+
// Numeric strings stay strings ('123' !== 123), same as the app's
|
|
7694
|
+
// URL parser — param consumers expect string ids/versions.
|
|
7695
|
+
return typeof parsed === 'number' ? value : parsed;
|
|
7696
|
+
}
|
|
7697
|
+
catch (e) {
|
|
7698
|
+
return value;
|
|
7699
|
+
}
|
|
7700
|
+
};
|
|
7616
7701
|
/**
|
|
7617
7702
|
* Convert a value to a string:
|
|
7618
7703
|
* in case of an array, we convert it to CSV.
|
|
@@ -21208,6 +21293,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21208
21293
|
errorType: ErrorDetailsTypes.API,
|
|
21209
21294
|
message: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
21210
21295
|
code: EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
|
|
21296
|
+
severity: EmbedErrorSeverity.SEV3,
|
|
21211
21297
|
error: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
21212
21298
|
};
|
|
21213
21299
|
executeEvent(exports.EmbedEvent.Error, errorDetails);
|
|
@@ -21552,6 +21638,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21552
21638
|
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21553
21639
|
message: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
21554
21640
|
code: EmbedErrorCodes.INIT_ERROR,
|
|
21641
|
+
severity: EmbedErrorSeverity.SEV1,
|
|
21555
21642
|
error: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
21556
21643
|
});
|
|
21557
21644
|
}
|
|
@@ -21562,7 +21649,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21562
21649
|
*/
|
|
21563
21650
|
handleError(errorDetails) {
|
|
21564
21651
|
this.isError = true;
|
|
21565
|
-
this.executeCallbacks(exports.EmbedEvent.Error,
|
|
21652
|
+
this.executeCallbacks(exports.EmbedEvent.Error, {
|
|
21653
|
+
severity: EmbedErrorSeverity.SEV3,
|
|
21654
|
+
...errorDetails,
|
|
21655
|
+
});
|
|
21566
21656
|
// Log error
|
|
21567
21657
|
logger$3.error(errorDetails);
|
|
21568
21658
|
}
|
|
@@ -21647,6 +21737,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21647
21737
|
errorType: ErrorDetailsTypes.NETWORK,
|
|
21648
21738
|
message: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
21649
21739
|
code: EmbedErrorCodes.NETWORK_ERROR,
|
|
21740
|
+
severity: EmbedErrorSeverity.SEV2,
|
|
21650
21741
|
offlineWarning: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
21651
21742
|
};
|
|
21652
21743
|
this.executeCallbacks(exports.EmbedEvent.Error, errorDetails);
|
|
@@ -21804,10 +21895,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21804
21895
|
return `${basePath}#`;
|
|
21805
21896
|
}
|
|
21806
21897
|
async getUpdateEmbedParamsObject() {
|
|
21807
|
-
|
|
21898
|
+
const queryParams = this.getEmbedParamsObject();
|
|
21899
|
+
// Values are URL-serialized (e.g. dataSources as '["guid"]'); parse
|
|
21900
|
+
// them back so the event payload matches a URL load (SCAL-334713).
|
|
21901
|
+
Object.keys(queryParams).forEach((key) => {
|
|
21902
|
+
queryParams[key] = deserializeParam(queryParams[key]);
|
|
21903
|
+
});
|
|
21808
21904
|
const appInitData = await this.getAppInitData();
|
|
21809
|
-
|
|
21810
|
-
return queryParams;
|
|
21905
|
+
return { ...this.viewConfig, ...queryParams, ...appInitData };
|
|
21811
21906
|
}
|
|
21812
21907
|
/**
|
|
21813
21908
|
* Common query params set for all the embed modes.
|
|
@@ -22015,9 +22110,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22015
22110
|
return iFrame;
|
|
22016
22111
|
}
|
|
22017
22112
|
/**
|
|
22018
|
-
* Returns a merged {@link PreRenderConfig} object where each
|
|
22019
|
-
*
|
|
22020
|
-
*
|
|
22113
|
+
* Returns a merged {@link PreRenderConfig} object where each key prefers the
|
|
22114
|
+
* value from `preRenderConfig` over its deprecated top-level `viewConfig`
|
|
22115
|
+
* counterpart (`id`/`preRenderId`, `containerSelector`/`preRenderContainer`,
|
|
22116
|
+
* `doNotTrackSize`/`doNotTrackPreRenderSize`) for backward compatibility.
|
|
22021
22117
|
*/
|
|
22022
22118
|
getPreRenderConfig() {
|
|
22023
22119
|
var _a, _b, _c, _d;
|
|
@@ -22025,16 +22121,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22025
22121
|
const preRenderCfg = (_a = viewCfg.preRenderConfig) !== null && _a !== void 0 ? _a : {};
|
|
22026
22122
|
return {
|
|
22027
22123
|
...preRenderCfg,
|
|
22028
|
-
|
|
22029
|
-
|
|
22030
|
-
|
|
22124
|
+
id: (_b = preRenderCfg.id) !== null && _b !== void 0 ? _b : viewCfg.preRenderId,
|
|
22125
|
+
containerSelector: (_c = preRenderCfg.containerSelector) !== null && _c !== void 0 ? _c : viewCfg.preRenderContainer,
|
|
22126
|
+
doNotTrackSize: (_d = preRenderCfg.doNotTrackSize) !== null && _d !== void 0 ? _d : viewCfg.doNotTrackPreRenderSize,
|
|
22031
22127
|
};
|
|
22032
22128
|
}
|
|
22033
22129
|
/**
|
|
22034
22130
|
* Returns true if this embed instance is configured for pre-rendering.
|
|
22035
22131
|
*/
|
|
22036
22132
|
isPreRenderEmbed() {
|
|
22037
|
-
return !!this.getPreRenderConfig().
|
|
22133
|
+
return !!this.getPreRenderConfig().id;
|
|
22038
22134
|
}
|
|
22039
22135
|
handleInsertionIntoDOM(child) {
|
|
22040
22136
|
if (this.isPreRenderEmbed()) {
|
|
@@ -22130,6 +22226,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22130
22226
|
errorType: ErrorDetailsTypes.API,
|
|
22131
22227
|
message: error.message || ERROR_MESSAGE.LOGIN_FAILED,
|
|
22132
22228
|
code: EmbedErrorCodes.LOGIN_FAILED,
|
|
22229
|
+
severity: EmbedErrorSeverity.SEV1,
|
|
22133
22230
|
error: error,
|
|
22134
22231
|
});
|
|
22135
22232
|
});
|
|
@@ -22221,7 +22318,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22221
22318
|
*/
|
|
22222
22319
|
resolvePreRenderContainerTarget() {
|
|
22223
22320
|
var _a;
|
|
22224
|
-
const containerConfig = this.getPreRenderConfig().
|
|
22321
|
+
const containerConfig = this.getPreRenderConfig().containerSelector;
|
|
22225
22322
|
let container = null;
|
|
22226
22323
|
if (typeof containerConfig === 'string') {
|
|
22227
22324
|
try {
|
|
@@ -22246,7 +22343,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22246
22343
|
return;
|
|
22247
22344
|
}
|
|
22248
22345
|
const ownerContainer = (_a = preRenderedObject.preRenderContainerEl) !== null && _a !== void 0 ? _a : document.body;
|
|
22249
|
-
if (this.getPreRenderConfig().
|
|
22346
|
+
if (this.getPreRenderConfig().containerSelector
|
|
22250
22347
|
&& this.resolvePreRenderContainerTarget() !== ownerContainer) {
|
|
22251
22348
|
logger$3.warn('preRenderContainer is applied only by the component that creates the preRender; '
|
|
22252
22349
|
+ 'the one passed here is ignored. Set it on the PreRender component instead.');
|
|
@@ -22743,7 +22840,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22743
22840
|
showPreRenderByDefault,
|
|
22744
22841
|
replaceExistingPreRender,
|
|
22745
22842
|
});
|
|
22746
|
-
if (!this.getPreRenderConfig().
|
|
22843
|
+
if (!this.getPreRenderConfig().id) {
|
|
22747
22844
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
22748
22845
|
return this;
|
|
22749
22846
|
}
|
|
@@ -22919,12 +23016,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22919
23016
|
async showPreRender() {
|
|
22920
23017
|
var _a, _b;
|
|
22921
23018
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_SHOW_PRE_RENDER, {
|
|
22922
|
-
preRenderId: this.getPreRenderConfig().
|
|
23019
|
+
preRenderId: this.getPreRenderConfig().id,
|
|
22923
23020
|
embedComponentType: this.viewConfig.embedComponentType,
|
|
22924
23021
|
});
|
|
22925
23022
|
if (this.shouldWaitForRenderPromise)
|
|
22926
23023
|
await this.isReadyForRenderPromise;
|
|
22927
|
-
if (!this.getPreRenderConfig().
|
|
23024
|
+
if (!this.getPreRenderConfig().id) {
|
|
22928
23025
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
22929
23026
|
return this;
|
|
22930
23027
|
}
|
|
@@ -22960,7 +23057,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22960
23057
|
this.containerScrollListener = () => this.syncPreRenderStyle();
|
|
22961
23058
|
customContainer.addEventListener('scroll', this.containerScrollListener);
|
|
22962
23059
|
}
|
|
22963
|
-
if (!this.getPreRenderConfig().
|
|
23060
|
+
if (!this.getPreRenderConfig().doNotTrackSize) {
|
|
22964
23061
|
const observeTarget = (_b = this.insertedDomEl) !== null && _b !== void 0 ? _b : this.hostElement;
|
|
22965
23062
|
this.resizeObserver = new ResizeObserver((entries) => {
|
|
22966
23063
|
entries.forEach((entry) => {
|
|
@@ -23028,7 +23125,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23028
23125
|
*/
|
|
23029
23126
|
hidePreRender() {
|
|
23030
23127
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_HIDE_PRE_RENDER, {
|
|
23031
|
-
preRenderId: this.getPreRenderConfig().
|
|
23128
|
+
preRenderId: this.getPreRenderConfig().id,
|
|
23032
23129
|
embedComponentType: this.viewConfig.embedComponentType,
|
|
23033
23130
|
});
|
|
23034
23131
|
logger$3.debug('HidePreRender Called');
|
|
@@ -23066,7 +23163,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23066
23163
|
* @property {string} child - The HTML element ID for the PreRender child.
|
|
23067
23164
|
*/
|
|
23068
23165
|
getPreRenderIds() {
|
|
23069
|
-
const preRenderId = this.getPreRenderConfig().
|
|
23166
|
+
const preRenderId = this.getPreRenderConfig().id;
|
|
23070
23167
|
return {
|
|
23071
23168
|
wrapper: `${PRERENDER_WRAPPER_ID_PREFIX}${preRenderId}`,
|
|
23072
23169
|
child: `tsEmbed-pre-render-child-${preRenderId}`,
|
|
@@ -24547,6 +24644,7 @@ query GetEurekaVizSnapshots(
|
|
|
24547
24644
|
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
24548
24645
|
message: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
24549
24646
|
code: EmbedErrorCodes.LIVEBOARD_ID_MISSING,
|
|
24647
|
+
severity: EmbedErrorSeverity.SEV1,
|
|
24550
24648
|
error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
24551
24649
|
});
|
|
24552
24650
|
}
|
|
@@ -24698,7 +24796,7 @@ query GetEurekaVizSnapshots(
|
|
|
24698
24796
|
if (this.isRendered) {
|
|
24699
24797
|
this.trigger(exports.HostEvent.Navigate, path.substring(1));
|
|
24700
24798
|
}
|
|
24701
|
-
else if (this.getPreRenderConfig().
|
|
24799
|
+
else if (this.getPreRenderConfig().id) {
|
|
24702
24800
|
this.preRender(true);
|
|
24703
24801
|
}
|
|
24704
24802
|
else {
|
|
@@ -25402,7 +25500,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25402
25500
|
const ref = React.useRef(null);
|
|
25403
25501
|
const { className, style, ...embedProps } = props;
|
|
25404
25502
|
const { viewConfig, listeners } = getViewPropsAndListeners(embedProps);
|
|
25405
|
-
const preRenderId = (_b = (_a = props.preRenderConfig) === null || _a === void 0 ? void 0 : _a.
|
|
25503
|
+
const preRenderId = (_b = (_a = props.preRenderConfig) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : props.preRenderId;
|
|
25406
25504
|
const handleDestroy = (tsEmbed) => {
|
|
25407
25505
|
// do not destroy if it is a preRender component
|
|
25408
25506
|
if (isPreRenderedComponent)
|