@thoughtspot/visual-embed-sdk 1.49.0 → 1.49.2
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/css-variables.d.ts +17 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +4 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +97 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +8 -0
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +2 -1
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +12 -0
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/events.spec.js +5 -0
- package/cjs/src/embed/events.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +4 -1
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +11 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +38 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +168 -11
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +237 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/mixpanel-service.js +2 -2
- package/cjs/src/mixpanel-service.js.map +1 -1
- package/cjs/src/types.d.ts +87 -4
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +47 -3
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/logger.js +2 -2
- package/cjs/src/utils/logger.js.map +1 -1
- package/cjs/src/utils/processTrigger.d.ts.map +1 -1
- package/cjs/src/utils/processTrigger.js +6 -5
- package/cjs/src/utils/processTrigger.js.map +1 -1
- package/cjs/src/utils/processTrigger.spec.js +13 -0
- package/cjs/src/utils/processTrigger.spec.js.map +1 -1
- package/cjs/src/utils/sdk-version.d.ts +2 -0
- package/cjs/src/utils/sdk-version.d.ts.map +1 -0
- package/cjs/src/utils/sdk-version.js +7 -0
- package/cjs/src/utils/sdk-version.js.map +1 -0
- package/cjs/src/utils.d.ts +10 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +23 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +48 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-_UGCSSDR.js → index-CS7yJ2Jj.js} +1 -1
- package/dist/src/css-variables.d.ts +17 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +8 -0
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +38 -0
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/types.d.ts +87 -4
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/processTrigger.d.ts.map +1 -1
- package/dist/src/utils/sdk-version.d.ts +2 -0
- package/dist/src/utils/sdk-version.d.ts.map +1 -0
- package/dist/src/utils.d.ts +10 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +255 -23
- package/dist/tsembed-react.js +254 -22
- package/dist/tsembed.es.js +255 -23
- package/dist/tsembed.js +254 -22
- package/dist/visual-embed-sdk-react-full.d.ts +148 -3
- package/dist/visual-embed-sdk-react.d.ts +148 -3
- package/dist/visual-embed-sdk.d.ts +148 -3
- package/lib/package.json +1 -1
- package/lib/src/css-variables.d.ts +17 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +4 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +97 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +8 -0
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +2 -1
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +12 -0
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/events.spec.js +5 -0
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +4 -1
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +11 -0
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +38 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +168 -11
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +237 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/mixpanel-service.js +1 -1
- package/lib/src/mixpanel-service.js.map +1 -1
- package/lib/src/types.d.ts +87 -4
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +47 -3
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/logger.js +1 -1
- package/lib/src/utils/logger.js.map +1 -1
- package/lib/src/utils/processTrigger.d.ts.map +1 -1
- package/lib/src/utils/processTrigger.js +6 -5
- package/lib/src/utils/processTrigger.js.map +1 -1
- package/lib/src/utils/processTrigger.spec.js +13 -0
- package/lib/src/utils/processTrigger.spec.js.map +1 -1
- package/lib/src/utils/sdk-version.d.ts +2 -0
- package/lib/src/utils/sdk-version.d.ts.map +1 -0
- package/lib/src/utils/sdk-version.js +3 -0
- package/lib/src/utils/sdk-version.js.map +1 -0
- package/lib/src/utils.d.ts +10 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +21 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +49 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +148 -3
- package/package.json +1 -1
- package/src/css-variables.ts +20 -0
- package/src/embed/app.spec.ts +109 -0
- package/src/embed/app.ts +4 -0
- package/src/embed/conversation.spec.ts +17 -0
- package/src/embed/conversation.ts +10 -0
- package/src/embed/events.spec.ts +7 -0
- package/src/embed/liveboard.spec.ts +15 -0
- package/src/embed/liveboard.ts +4 -0
- package/src/embed/ts-embed.spec.ts +294 -0
- package/src/embed/ts-embed.ts +181 -10
- package/src/mixpanel-service.ts +1 -1
- package/src/types.ts +86 -3
- package/src/utils/logger.ts +1 -1
- package/src/utils/processTrigger.spec.ts +23 -0
- package/src/utils/processTrigger.ts +8 -6
- package/src/utils/sdk-version.ts +3 -0
- package/src/utils.spec.ts +63 -0
- package/src/utils.ts +24 -0
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.49.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.49.2 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -2249,11 +2249,30 @@
|
|
|
2249
2249
|
/**
|
|
2250
2250
|
* Navigate to a specific page in the embedded ThoughtSpot application.
|
|
2251
2251
|
* This is the same as calling `appEmbed.navigateToPage(path, true)`.
|
|
2252
|
-
*
|
|
2253
|
-
*
|
|
2252
|
+
*
|
|
2253
|
+
* Accepts either a plain value or an object with `path`
|
|
2254
|
+
* and an optional `replace` flag.
|
|
2255
|
+
*
|
|
2256
|
+
* @param data - A string path, a numeric history delta, or an object
|
|
2257
|
+
* `{ path: string | number, replace?: boolean }`.
|
|
2258
|
+
* - `path` — the route to navigate to, or a history delta such as `1`
|
|
2259
|
+
* or `-1` (calls `window.history.go()`).
|
|
2260
|
+
* - `replace` — when `true`, replaces the current history entry instead
|
|
2261
|
+
* of pushing a new one (uses `window.location.replace`).
|
|
2262
|
+
*
|
|
2254
2263
|
* @example
|
|
2255
2264
|
* ```js
|
|
2256
|
-
*
|
|
2265
|
+
* // Preferred: use navigateToPage directly
|
|
2266
|
+
* appEmbed.navigateToPage(-1);
|
|
2267
|
+
*
|
|
2268
|
+
* // Numeric delta — go back one step
|
|
2269
|
+
* appEmbed.trigger(HostEvent.Navigate, -1);
|
|
2270
|
+
*
|
|
2271
|
+
* // String path — push a new history entry
|
|
2272
|
+
* appEmbed.trigger(HostEvent.Navigate, 'home');
|
|
2273
|
+
*
|
|
2274
|
+
* // Object format — replace current history entry
|
|
2275
|
+
* appEmbed.trigger(HostEvent.Navigate, { path: 'home', replace: true }); // SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
2257
2276
|
* ```
|
|
2258
2277
|
* @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1.sw
|
|
2259
2278
|
*/
|
|
@@ -4242,6 +4261,7 @@
|
|
|
4242
4261
|
Param["EnableLiveboardDataCache"] = "enableLiveboardDataCache";
|
|
4243
4262
|
Param["SpotterFileUploadEnabled"] = "spotterFileUploadEnabled";
|
|
4244
4263
|
Param["SpotterFileUploadFileTypes"] = "spotterFileUploadFileTypes";
|
|
4264
|
+
Param["IsStarterPromptsEnabled"] = "enableStarterPrompts";
|
|
4245
4265
|
})(Param || (Param = {}));
|
|
4246
4266
|
/**
|
|
4247
4267
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -4884,6 +4904,16 @@
|
|
|
4884
4904
|
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
|
|
4885
4905
|
*/
|
|
4886
4906
|
Action["AddToFavorites"] = "addToFavorites";
|
|
4907
|
+
/**
|
|
4908
|
+
* Remove from Favorites option in home page v3 sidebar.
|
|
4909
|
+
* Allows removing an object from the user's favorites list from home-page v3 sidebar.
|
|
4910
|
+
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
4911
|
+
* @example
|
|
4912
|
+
* ```js
|
|
4913
|
+
* disabledActions: [Action.RemoveFromFavorites]
|
|
4914
|
+
* ```
|
|
4915
|
+
*/
|
|
4916
|
+
Action["RemoveFromFavorites"] = "removeFromFavorites";
|
|
4887
4917
|
/**
|
|
4888
4918
|
* The edit icon on Liveboards (Classic experience).
|
|
4889
4919
|
* @example
|
|
@@ -5941,6 +5971,20 @@
|
|
|
5941
5971
|
* ```
|
|
5942
5972
|
*/
|
|
5943
5973
|
Action["SpotterViz"] = "spotterViz";
|
|
5974
|
+
/**
|
|
5975
|
+
* The reference-mode toggle button inside the SpotterViz chat input.
|
|
5976
|
+
* When users enable reference mode, clicking tiles, filters, or
|
|
5977
|
+
* parameters adds them as chat context. Hide this action to remove
|
|
5978
|
+
* the reference-mode capability entirely.
|
|
5979
|
+
* Visible by default.
|
|
5980
|
+
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
5981
|
+
* @example
|
|
5982
|
+
* ```js
|
|
5983
|
+
* hiddenActions: [Action.SpotterVizReferenceMode]
|
|
5984
|
+
* disabledActions: [Action.SpotterVizReferenceMode]
|
|
5985
|
+
* ```
|
|
5986
|
+
*/
|
|
5987
|
+
Action["SpotterVizReferenceMode"] = "spotterVizReferenceMode";
|
|
5944
5988
|
/**
|
|
5945
5989
|
* Clears browser cache and fetches new data for liveboard ChartViz Containers.
|
|
5946
5990
|
* Requires `enableLiveboardDataCache` to be enabled.
|
|
@@ -6417,7 +6461,9 @@
|
|
|
6417
6461
|
TableContentDensity["Compact"] = "COMPACT";
|
|
6418
6462
|
})(exports.TableContentDensity || (exports.TableContentDensity = {}));
|
|
6419
6463
|
|
|
6420
|
-
var version="1.49.
|
|
6464
|
+
var version$1="1.49.2";var pkg = {version:version$1};
|
|
6465
|
+
|
|
6466
|
+
const { version } = pkg;
|
|
6421
6467
|
|
|
6422
6468
|
const logFunctions = {
|
|
6423
6469
|
[exports.LogLevel.SILENT]: () => undefined,
|
|
@@ -6814,6 +6860,27 @@
|
|
|
6814
6860
|
function getDOMNode(domSelector) {
|
|
6815
6861
|
return typeof domSelector === 'string' ? document.querySelector(domSelector) : domSelector;
|
|
6816
6862
|
}
|
|
6863
|
+
/**
|
|
6864
|
+
* Resolves a CSS selector to an element. `document.querySelector` cannot pierce
|
|
6865
|
+
* shadow boundaries, so when the document lookup misses and a reference node is
|
|
6866
|
+
* provided, this also searches the shadow root the reference node lives in —
|
|
6867
|
+
* letting a selector target an element inside the same shadow root as the embed
|
|
6868
|
+
* instead of silently falling back to the light DOM.
|
|
6869
|
+
* @param selector CSS selector string.
|
|
6870
|
+
* @param referenceNode Node whose shadow root is searched when the document lookup misses.
|
|
6871
|
+
*/
|
|
6872
|
+
function querySelectorAcrossShadowRoot(selector, referenceNode) {
|
|
6873
|
+
var _a;
|
|
6874
|
+
const fromDocument = document.querySelector(selector);
|
|
6875
|
+
if (fromDocument) {
|
|
6876
|
+
return fromDocument;
|
|
6877
|
+
}
|
|
6878
|
+
const rootNode = (_a = referenceNode === null || referenceNode === void 0 ? void 0 : referenceNode.getRootNode) === null || _a === void 0 ? void 0 : _a.call(referenceNode);
|
|
6879
|
+
if (typeof ShadowRoot !== 'undefined' && rootNode instanceof ShadowRoot) {
|
|
6880
|
+
return rootNode.querySelector(selector);
|
|
6881
|
+
}
|
|
6882
|
+
return null;
|
|
6883
|
+
}
|
|
6817
6884
|
const deepMerge = (target, source) => merge(target, source);
|
|
6818
6885
|
const getOperationNameFromQuery = (query) => {
|
|
6819
6886
|
const regex = /(?:query|mutation)\s+(\w+)/;
|
|
@@ -19356,8 +19423,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19356
19423
|
}
|
|
19357
19424
|
}
|
|
19358
19425
|
const channel = new MessageChannel();
|
|
19426
|
+
// Close the messageChannel and resolve the promise if timeout.
|
|
19427
|
+
const timeoutId = setTimeout(() => {
|
|
19428
|
+
channel.port1.close();
|
|
19429
|
+
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
19430
|
+
}, TRIGGER_TIMEOUT);
|
|
19359
19431
|
channel.port1.onmessage = ({ data: responseData }) => {
|
|
19360
19432
|
var _a;
|
|
19433
|
+
clearTimeout(timeoutId);
|
|
19361
19434
|
channel.port1.close();
|
|
19362
19435
|
const error = (responseData === null || responseData === void 0 ? void 0 : responseData.error) || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
|
|
19363
19436
|
if (error) {
|
|
@@ -19367,11 +19440,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19367
19440
|
res(responseData);
|
|
19368
19441
|
}
|
|
19369
19442
|
};
|
|
19370
|
-
// Close the messageChannel and resolve the promise if timeout.
|
|
19371
|
-
setTimeout(() => {
|
|
19372
|
-
channel.port1.close();
|
|
19373
|
-
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
19374
|
-
}, TRIGGER_TIMEOUT);
|
|
19375
19443
|
return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
|
|
19376
19444
|
});
|
|
19377
19445
|
}
|
|
@@ -20289,6 +20357,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20289
20357
|
*/
|
|
20290
20358
|
const THOUGHTSPOT_PARAM_PREFIX = 'ts-';
|
|
20291
20359
|
const TS_EMBED_ID = '_thoughtspot-embed';
|
|
20360
|
+
/**
|
|
20361
|
+
* dataset key used to stash a custom preRenderContainer's original inline
|
|
20362
|
+
* `position` while we override it to `relative`. Stored on the container (not
|
|
20363
|
+
* per-instance) so the override can be reverted on destroy even when multiple
|
|
20364
|
+
* pre-rendered embeds share the same container.
|
|
20365
|
+
*/
|
|
20366
|
+
const PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY = 'tsEmbedOriginalPosition';
|
|
20367
|
+
const PRERENDER_WRAPPER_ID_PREFIX = 'tsEmbed-pre-render-wrapper-';
|
|
20292
20368
|
/**
|
|
20293
20369
|
* The event id map from v2 event names to v1 event id
|
|
20294
20370
|
* v1 events are the classic embed events implemented in Blink v1
|
|
@@ -20324,6 +20400,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20324
20400
|
*/
|
|
20325
20401
|
this.shouldEncodeUrlQueryParams = false;
|
|
20326
20402
|
this.defaultHiddenActions = [exports.Action.ReportError];
|
|
20403
|
+
this.preRenderContainerEl = null;
|
|
20404
|
+
this.containerScrollListener = null;
|
|
20327
20405
|
/**
|
|
20328
20406
|
* Handler for fullscreen change events
|
|
20329
20407
|
*/
|
|
@@ -21189,6 +21267,89 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21189
21267
|
placeholder.id = id.placeHolder;
|
|
21190
21268
|
return placeholder;
|
|
21191
21269
|
}
|
|
21270
|
+
/**
|
|
21271
|
+
* Resolves the configured preRenderContainer to a live element, falling
|
|
21272
|
+
* back to `document.body`. A string selector is re-queried on every call so
|
|
21273
|
+
* a remounted container (E.g.: React replacing the node) resolves to the
|
|
21274
|
+
* fresh element; an element passed directly cannot be re-resolved.
|
|
21275
|
+
*/
|
|
21276
|
+
resolvePreRenderContainerTarget() {
|
|
21277
|
+
var _a;
|
|
21278
|
+
const containerConfig = this.viewConfig.preRenderContainer;
|
|
21279
|
+
let container = null;
|
|
21280
|
+
if (typeof containerConfig === 'string') {
|
|
21281
|
+
try {
|
|
21282
|
+
// Resolve against the host's shadow root too, so a selector can
|
|
21283
|
+
// target a container inside the same shadow DOM as the embed —
|
|
21284
|
+
// document.querySelector alone cannot pierce shadow boundaries.
|
|
21285
|
+
container = querySelectorAcrossShadowRoot(containerConfig, this.hostElement);
|
|
21286
|
+
}
|
|
21287
|
+
catch (e) {
|
|
21288
|
+
logger$3.error(`Invalid CSS selector for preRenderContainer: ${containerConfig}`, e);
|
|
21289
|
+
}
|
|
21290
|
+
}
|
|
21291
|
+
else if (containerConfig) {
|
|
21292
|
+
container = containerConfig;
|
|
21293
|
+
}
|
|
21294
|
+
return (_a = container) !== null && _a !== void 0 ? _a : document.body;
|
|
21295
|
+
}
|
|
21296
|
+
/**
|
|
21297
|
+
* Makes the container a positioning context for the absolutely positioned
|
|
21298
|
+
* wrapper, stashing the original inline `position` on the element (once) so
|
|
21299
|
+
* destroy() can restore it exactly, leaving no trace. Recording it on the
|
|
21300
|
+
* element rather than per-instance lets the override be reverted even when
|
|
21301
|
+
* embeds share the same container.
|
|
21302
|
+
*/
|
|
21303
|
+
applyPreRenderContainerPositioning(container) {
|
|
21304
|
+
if (container === document.body) {
|
|
21305
|
+
return;
|
|
21306
|
+
}
|
|
21307
|
+
const pos = window.getComputedStyle(container).position;
|
|
21308
|
+
if (pos === 'static') {
|
|
21309
|
+
if (container.dataset[PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY] === undefined) {
|
|
21310
|
+
container.dataset[PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY] = container.style.position;
|
|
21311
|
+
}
|
|
21312
|
+
container.style.position = 'relative';
|
|
21313
|
+
}
|
|
21314
|
+
}
|
|
21315
|
+
/**
|
|
21316
|
+
* Re-attaches the wrapper to a live container when the previously resolved
|
|
21317
|
+
* one has been detached or no longer holds the wrapper — e.g. the host app
|
|
21318
|
+
* remounted a custom preRenderContainer, which would otherwise leave a stale
|
|
21319
|
+
* reference and collapse the wrapper. Only string selectors can be
|
|
21320
|
+
* re-resolved; a container passed as an element is left untouched.
|
|
21321
|
+
*/
|
|
21322
|
+
reconcilePreRenderContainer() {
|
|
21323
|
+
const wrapper = this.preRenderWrapper;
|
|
21324
|
+
const stored = this.preRenderContainerEl;
|
|
21325
|
+
// Nothing to reconcile until this instance resolved its container.
|
|
21326
|
+
if (!wrapper || !stored) {
|
|
21327
|
+
return;
|
|
21328
|
+
}
|
|
21329
|
+
const storedIsLive = stored === document.body || document.contains(stored);
|
|
21330
|
+
if (storedIsLive && stored.contains(wrapper)) {
|
|
21331
|
+
return;
|
|
21332
|
+
}
|
|
21333
|
+
const resolved = this.resolvePreRenderContainerTarget();
|
|
21334
|
+
// Re-resolution yielded the same (still stale) element — nothing we can
|
|
21335
|
+
// do, e.g. a detached container passed as an HTMLElement.
|
|
21336
|
+
if (resolved === stored && stored.contains(wrapper)) {
|
|
21337
|
+
return;
|
|
21338
|
+
}
|
|
21339
|
+
if (this.containerScrollListener && stored !== resolved) {
|
|
21340
|
+
if (stored !== document.body) {
|
|
21341
|
+
stored.removeEventListener('scroll', this.containerScrollListener);
|
|
21342
|
+
}
|
|
21343
|
+
if (resolved !== document.body) {
|
|
21344
|
+
resolved.addEventListener('scroll', this.containerScrollListener);
|
|
21345
|
+
}
|
|
21346
|
+
}
|
|
21347
|
+
this.applyPreRenderContainerPositioning(resolved);
|
|
21348
|
+
if (wrapper.parentNode !== resolved) {
|
|
21349
|
+
resolved.appendChild(wrapper);
|
|
21350
|
+
}
|
|
21351
|
+
this.preRenderContainerEl = resolved;
|
|
21352
|
+
}
|
|
21192
21353
|
insertIntoDOMForPreRender(child) {
|
|
21193
21354
|
const preRenderChild = this.createPreRenderChild(child);
|
|
21194
21355
|
const preRenderWrapper = this.createPreRenderWrapper();
|
|
@@ -21208,7 +21369,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21208
21369
|
else {
|
|
21209
21370
|
this.hidePreRender();
|
|
21210
21371
|
}
|
|
21211
|
-
|
|
21372
|
+
const targetContainer = this.resolvePreRenderContainerTarget();
|
|
21373
|
+
this.preRenderContainerEl = targetContainer;
|
|
21374
|
+
this.applyPreRenderContainerPositioning(targetContainer);
|
|
21375
|
+
targetContainer.appendChild(preRenderWrapper);
|
|
21212
21376
|
}
|
|
21213
21377
|
insertIntoDOM(child) {
|
|
21214
21378
|
var _a;
|
|
@@ -21647,6 +21811,50 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21647
21811
|
tsParams = tsParams ? `?${tsParams}` : '';
|
|
21648
21812
|
return tsParams;
|
|
21649
21813
|
}
|
|
21814
|
+
/**
|
|
21815
|
+
* Reverts the custom preRenderContainer's `position` to the value it had
|
|
21816
|
+
* before we overrode it to `relative` (see insertIntoDOMForPreRender).
|
|
21817
|
+
*
|
|
21818
|
+
* We restore the original inline value rather than forcing `static`, and we
|
|
21819
|
+
* skip the restore if another preRender wrapper is still mounted inside the
|
|
21820
|
+
* same container — a shared container still needs the positioning context.
|
|
21821
|
+
*/
|
|
21822
|
+
restorePreRenderContainerPosition() {
|
|
21823
|
+
const container = this.preRenderContainerEl;
|
|
21824
|
+
if (!container || container === document.body) {
|
|
21825
|
+
return;
|
|
21826
|
+
}
|
|
21827
|
+
// Drop our reference up front so a destroyed embed never pins a
|
|
21828
|
+
// detached container in memory; restoration uses the local handle.
|
|
21829
|
+
this.preRenderContainerEl = null;
|
|
21830
|
+
const originalPosition = container.dataset[PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY];
|
|
21831
|
+
if (originalPosition === undefined) {
|
|
21832
|
+
// We never overrode this container's position; nothing to restore.
|
|
21833
|
+
return;
|
|
21834
|
+
}
|
|
21835
|
+
// This instance's own wrapper has already been removed by now, so any
|
|
21836
|
+
// match here belongs to another embed still sharing the container — it
|
|
21837
|
+
// continues to rely on the positioning context, so leave it in place.
|
|
21838
|
+
const hasOtherWrapper = container.querySelector(`[id^="${PRERENDER_WRAPPER_ID_PREFIX}"]`);
|
|
21839
|
+
if (hasOtherWrapper) {
|
|
21840
|
+
return;
|
|
21841
|
+
}
|
|
21842
|
+
container.style.position = originalPosition;
|
|
21843
|
+
delete container.dataset[PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY];
|
|
21844
|
+
}
|
|
21845
|
+
/**
|
|
21846
|
+
* Detaches and clears the container scroll listener, if one is attached.
|
|
21847
|
+
*/
|
|
21848
|
+
removeContainerScrollListener() {
|
|
21849
|
+
if (!this.containerScrollListener) {
|
|
21850
|
+
return;
|
|
21851
|
+
}
|
|
21852
|
+
const customContainer = this.preRenderContainerEl && this.preRenderContainerEl !== document.body
|
|
21853
|
+
? this.preRenderContainerEl
|
|
21854
|
+
: null;
|
|
21855
|
+
customContainer === null || customContainer === void 0 ? void 0 : customContainer.removeEventListener('scroll', this.containerScrollListener);
|
|
21856
|
+
this.containerScrollListener = null;
|
|
21857
|
+
}
|
|
21650
21858
|
/**
|
|
21651
21859
|
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
21652
21860
|
* @version SDK: 1.19.1 | ThoughtSpot: *
|
|
@@ -21655,8 +21863,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21655
21863
|
var _a, _b, _c;
|
|
21656
21864
|
try {
|
|
21657
21865
|
this.removeFullscreenChangeHandler();
|
|
21866
|
+
this.removeContainerScrollListener();
|
|
21658
21867
|
this.unsubscribeToEvents();
|
|
21659
21868
|
(_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a.remove();
|
|
21869
|
+
this.restorePreRenderContainerPosition();
|
|
21660
21870
|
if (!this.isRendered) {
|
|
21661
21871
|
return;
|
|
21662
21872
|
}
|
|
@@ -21766,15 +21976,19 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21766
21976
|
}
|
|
21767
21977
|
this.hostElement.appendChild(this.insertedDomEl);
|
|
21768
21978
|
this.syncPreRenderStyle();
|
|
21979
|
+
const customContainer = this.preRenderContainerEl && this.preRenderContainerEl !== document.body
|
|
21980
|
+
? this.preRenderContainerEl
|
|
21981
|
+
: null;
|
|
21982
|
+
if (customContainer && !this.containerScrollListener) {
|
|
21983
|
+
this.containerScrollListener = () => this.syncPreRenderStyle();
|
|
21984
|
+
customContainer.addEventListener('scroll', this.containerScrollListener);
|
|
21985
|
+
}
|
|
21769
21986
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
21770
21987
|
const observeTarget = (_a = this.insertedDomEl) !== null && _a !== void 0 ? _a : this.hostElement;
|
|
21771
21988
|
this.resizeObserver = new ResizeObserver((entries) => {
|
|
21772
21989
|
entries.forEach((entry) => {
|
|
21773
|
-
if (entry.
|
|
21774
|
-
|
|
21775
|
-
width: `${entry.contentRect.width}px`,
|
|
21776
|
-
height: `${entry.contentRect.height}px`,
|
|
21777
|
-
});
|
|
21990
|
+
if (entry.target === observeTarget) {
|
|
21991
|
+
this.syncPreRenderStyle();
|
|
21778
21992
|
}
|
|
21779
21993
|
});
|
|
21780
21994
|
});
|
|
@@ -21806,14 +22020,24 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21806
22020
|
* is not defined or not found.
|
|
21807
22021
|
*/
|
|
21808
22022
|
syncPreRenderStyle() {
|
|
22023
|
+
var _a;
|
|
21809
22024
|
if (!this.isPreRenderConnected() || !this.getPreRenderPlaceHolderElement()) {
|
|
21810
22025
|
logger$3.error(ERROR_MESSAGE.SYNC_STYLE_CALLED_BEFORE_RENDER);
|
|
21811
22026
|
return;
|
|
21812
22027
|
}
|
|
22028
|
+
// Self-heal if the resolved container was remounted/detached, so we
|
|
22029
|
+
// never measure a stale node (which would collapse the wrapper).
|
|
22030
|
+
this.reconcilePreRenderContainer();
|
|
21813
22031
|
const elBoundingClient = this.getPreRenderPlaceHolderElement().getBoundingClientRect();
|
|
22032
|
+
const containerEl = this.preRenderContainerEl && this.preRenderContainerEl !== document.body
|
|
22033
|
+
? this.preRenderContainerEl
|
|
22034
|
+
: null;
|
|
22035
|
+
const containerRect = (_a = containerEl === null || containerEl === void 0 ? void 0 : containerEl.getBoundingClientRect()) !== null && _a !== void 0 ? _a : { x: 0, y: 0 };
|
|
22036
|
+
const scrollX = containerEl ? containerEl.scrollLeft : window.scrollX;
|
|
22037
|
+
const scrollY = containerEl ? containerEl.scrollTop : window.scrollY;
|
|
21814
22038
|
setStyleProperties(this.preRenderWrapper, {
|
|
21815
|
-
top: `${elBoundingClient.y +
|
|
21816
|
-
left: `${elBoundingClient.x +
|
|
22039
|
+
top: `${elBoundingClient.y - containerRect.y + scrollY}px`,
|
|
22040
|
+
left: `${elBoundingClient.x - containerRect.x + scrollX}px`,
|
|
21817
22041
|
width: `${elBoundingClient.width}px`,
|
|
21818
22042
|
height: `${elBoundingClient.height}px`,
|
|
21819
22043
|
position: 'absolute',
|
|
@@ -21840,6 +22064,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21840
22064
|
overflow: 'hidden',
|
|
21841
22065
|
};
|
|
21842
22066
|
setStyleProperties(this.preRenderWrapper, preRenderHideStyles);
|
|
22067
|
+
this.removeContainerScrollListener();
|
|
21843
22068
|
if (this.resizeObserver) {
|
|
21844
22069
|
this.resizeObserver.disconnect();
|
|
21845
22070
|
}
|
|
@@ -21858,7 +22083,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21858
22083
|
*/
|
|
21859
22084
|
getPreRenderIds() {
|
|
21860
22085
|
return {
|
|
21861
|
-
wrapper:
|
|
22086
|
+
wrapper: `${PRERENDER_WRAPPER_ID_PREFIX}${this.viewConfig.preRenderId}`,
|
|
21862
22087
|
child: `tsEmbed-pre-render-child-${this.viewConfig.preRenderId}`,
|
|
21863
22088
|
placeHolder: `tsEmbed-pre-render-placeholder-${this.viewConfig.preRenderId}`,
|
|
21864
22089
|
};
|
|
@@ -22295,12 +22520,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22295
22520
|
}
|
|
22296
22521
|
// Handle spotterChatConfig params
|
|
22297
22522
|
if (spotterChatConfig) {
|
|
22298
|
-
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, spotterFileUploadEnabled, spotterFileUploadFileTypes, } = spotterChatConfig;
|
|
22523
|
+
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, spotterFileUploadEnabled, spotterFileUploadFileTypes, enableStarterPrompts, } = spotterChatConfig;
|
|
22299
22524
|
setParamIfDefined(params, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
|
|
22300
22525
|
setParamIfDefined(params, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
|
|
22301
22526
|
if (spotterFileUploadEnabled !== undefined) {
|
|
22302
22527
|
params[Param.SpotterFileUploadEnabled] = spotterFileUploadEnabled;
|
|
22303
22528
|
}
|
|
22529
|
+
if (enableStarterPrompts !== undefined) {
|
|
22530
|
+
params[Param.IsStarterPromptsEnabled] = enableStarterPrompts;
|
|
22531
|
+
}
|
|
22304
22532
|
if (spotterFileUploadFileTypes !== undefined) {
|
|
22305
22533
|
params[Param.SpotterFileUploadFileTypes] = JSON.stringify(spotterFileUploadFileTypes);
|
|
22306
22534
|
}
|
|
@@ -22856,12 +23084,15 @@ query GetEurekaVizSnapshots(
|
|
|
22856
23084
|
}
|
|
22857
23085
|
// Handle spotterChatConfig params
|
|
22858
23086
|
if (spotterChatConfig) {
|
|
22859
|
-
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, spotterFileUploadEnabled, spotterFileUploadFileTypes, } = spotterChatConfig;
|
|
23087
|
+
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, spotterFileUploadEnabled, spotterFileUploadFileTypes, enableStarterPrompts, } = spotterChatConfig;
|
|
22860
23088
|
setParamIfDefined(params, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
|
|
22861
23089
|
setParamIfDefined(params, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
|
|
22862
23090
|
if (spotterFileUploadEnabled !== undefined) {
|
|
22863
23091
|
params[Param.SpotterFileUploadEnabled] = spotterFileUploadEnabled;
|
|
22864
23092
|
}
|
|
23093
|
+
if (enableStarterPrompts !== undefined) {
|
|
23094
|
+
params[Param.IsStarterPromptsEnabled] = enableStarterPrompts;
|
|
23095
|
+
}
|
|
22865
23096
|
if (spotterFileUploadFileTypes !== undefined) {
|
|
22866
23097
|
params[Param.SpotterFileUploadFileTypes] = JSON.stringify(spotterFileUploadFileTypes);
|
|
22867
23098
|
}
|
|
@@ -23980,10 +24211,11 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
23980
24211
|
setParamIfDefined(queryParams, Param.EnableStopAnswerGenerationEmbed, enableStopAnswerGenerationEmbed, true);
|
|
23981
24212
|
// Handle spotterChatConfig params
|
|
23982
24213
|
if (spotterChatConfig) {
|
|
23983
|
-
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, spotterFileUploadEnabled, spotterFileUploadFileTypes, } = spotterChatConfig;
|
|
24214
|
+
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, spotterFileUploadEnabled, spotterFileUploadFileTypes, enableStarterPrompts, } = spotterChatConfig;
|
|
23984
24215
|
setParamIfDefined(queryParams, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
|
|
23985
24216
|
setParamIfDefined(queryParams, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
|
|
23986
24217
|
setParamIfDefined(queryParams, Param.SpotterFileUploadEnabled, spotterFileUploadEnabled, true);
|
|
24218
|
+
setParamIfDefined(queryParams, Param.IsStarterPromptsEnabled, enableStarterPrompts, true);
|
|
23987
24219
|
if (spotterFileUploadFileTypes !== undefined) {
|
|
23988
24220
|
queryParams[Param.SpotterFileUploadFileTypes] = JSON.stringify(spotterFileUploadFileTypes);
|
|
23989
24221
|
}
|
|
@@ -961,6 +961,23 @@ export interface CustomCssVariables {
|
|
|
961
961
|
* header underline, left panel border, thinking step connector and dots.
|
|
962
962
|
*/
|
|
963
963
|
"--ts-var-spotterviz-border-color"?: string;
|
|
964
|
+
/**
|
|
965
|
+
* Background color of the reference-mode toggle button in the SpotterViz
|
|
966
|
+
* chat input when it is unselected and the user hovers over it.
|
|
967
|
+
*/
|
|
968
|
+
"--ts-var-spotterviz-reference-icon-hover-background"?: string;
|
|
969
|
+
/**
|
|
970
|
+
* Icon color for the reference-mode selected state — applies to
|
|
971
|
+
* both the toggle button when active and the icon badge on each
|
|
972
|
+
* referenced-entity chip in the chat input.
|
|
973
|
+
*/
|
|
974
|
+
"--ts-var-spotterviz-reference-icon-selected-color"?: string;
|
|
975
|
+
/**
|
|
976
|
+
* Background color for the reference-mode selected state — applies to
|
|
977
|
+
* both the reference mode toggle button when active and the icon badge
|
|
978
|
+
* on each referenced-entity chip in the chat input.
|
|
979
|
+
*/
|
|
980
|
+
"--ts-var-spotterviz-reference-icon-selected-background"?: string;
|
|
964
981
|
}
|
|
965
982
|
export interface SessionInterface {
|
|
966
983
|
sessionId: string;
|
|
@@ -2170,6 +2187,45 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
2170
2187
|
* ```
|
|
2171
2188
|
*/
|
|
2172
2189
|
doNotTrackPreRenderSize?: boolean;
|
|
2190
|
+
/**
|
|
2191
|
+
* The DOM element or CSS selector string specifying the container into which
|
|
2192
|
+
* the pre-rendered wrapper is inserted. Defaults to `document.body` when not
|
|
2193
|
+
* specified.
|
|
2194
|
+
*
|
|
2195
|
+
* **When to use a target container:** set this when the pre-render should
|
|
2196
|
+
* live somewhere other than `document.body` — for example when `<body>` has
|
|
2197
|
+
* `overflow: hidden` and scrolling is handled by an inner element, or when
|
|
2198
|
+
* you need the wrapper to sit inside a specific stacking/positioning context.
|
|
2199
|
+
* The wrapper is positioned to track the embedding element within this
|
|
2200
|
+
* container, so choose the scrollable/positioned ancestor you want it
|
|
2201
|
+
* aligned to.
|
|
2202
|
+
*
|
|
2203
|
+
* **Pass a stable container:** the wrapper is mounted into the resolved
|
|
2204
|
+
* container once, during `preRender()`. The container must stay mounted for
|
|
2205
|
+
* the lifetime of the pre-render — if the host app unmounts and remounts it
|
|
2206
|
+
* (for example React replacing the node), the wrapper is orphaned on the
|
|
2207
|
+
* detached node. Mount the container above the part of the tree that
|
|
2208
|
+
* re-renders so its identity is stable. Prefer a CSS selector string over a
|
|
2209
|
+
* raw element: a selector can be re-resolved to the fresh node on the next
|
|
2210
|
+
* reposition, whereas an element reference cannot be recovered once detached.
|
|
2211
|
+
*
|
|
2212
|
+
* When the embed host lives inside a Shadow DOM, a selector string is
|
|
2213
|
+
* resolved against that shadow root as well (since `document.querySelector`
|
|
2214
|
+
* cannot pierce shadow boundaries); pass the element directly if the
|
|
2215
|
+
* container lives in a different root.
|
|
2216
|
+
*
|
|
2217
|
+
* @type {string | HTMLElement}
|
|
2218
|
+
* @version SDK: 1.49.2 | ThoughtSpot: *
|
|
2219
|
+
* @example
|
|
2220
|
+
* ```js
|
|
2221
|
+
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
2222
|
+
* preRenderId: 'my-liveboard',
|
|
2223
|
+
* // Prefer a selector for a stable, scrollable container.
|
|
2224
|
+
* preRenderContainer: '#my-scroll-container',
|
|
2225
|
+
* });
|
|
2226
|
+
* ```
|
|
2227
|
+
*/
|
|
2228
|
+
preRenderContainer?: string | HTMLElement;
|
|
2173
2229
|
/**
|
|
2174
2230
|
* Enable the V2 shell. This can provide performance benefits
|
|
2175
2231
|
* due to a lighter-weight shell.
|
|
@@ -5115,11 +5171,30 @@ export declare enum HostEvent {
|
|
|
5115
5171
|
/**
|
|
5116
5172
|
* Navigate to a specific page in the embedded ThoughtSpot application.
|
|
5117
5173
|
* This is the same as calling `appEmbed.navigateToPage(path, true)`.
|
|
5118
|
-
*
|
|
5119
|
-
*
|
|
5174
|
+
*
|
|
5175
|
+
* Accepts either a plain value or an object with `path`
|
|
5176
|
+
* and an optional `replace` flag.
|
|
5177
|
+
*
|
|
5178
|
+
* @param data - A string path, a numeric history delta, or an object
|
|
5179
|
+
* `{ path: string | number, replace?: boolean }`.
|
|
5180
|
+
* - `path` — the route to navigate to, or a history delta such as `1`
|
|
5181
|
+
* or `-1` (calls `window.history.go()`).
|
|
5182
|
+
* - `replace` — when `true`, replaces the current history entry instead
|
|
5183
|
+
* of pushing a new one (uses `window.location.replace`).
|
|
5184
|
+
*
|
|
5120
5185
|
* @example
|
|
5121
5186
|
* ```js
|
|
5122
|
-
*
|
|
5187
|
+
* // Preferred: use navigateToPage directly
|
|
5188
|
+
* appEmbed.navigateToPage(-1);
|
|
5189
|
+
*
|
|
5190
|
+
* // Numeric delta — go back one step
|
|
5191
|
+
* appEmbed.trigger(HostEvent.Navigate, -1);
|
|
5192
|
+
*
|
|
5193
|
+
* // String path — push a new history entry
|
|
5194
|
+
* appEmbed.trigger(HostEvent.Navigate, 'home');
|
|
5195
|
+
*
|
|
5196
|
+
* // Object format — replace current history entry
|
|
5197
|
+
* appEmbed.trigger(HostEvent.Navigate, { path: 'home', replace: true }); // SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
5123
5198
|
* ```
|
|
5124
5199
|
* @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1.sw
|
|
5125
5200
|
*/
|
|
@@ -7592,6 +7667,16 @@ export declare enum Action {
|
|
|
7592
7667
|
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
|
|
7593
7668
|
*/
|
|
7594
7669
|
AddToFavorites = "addToFavorites",
|
|
7670
|
+
/**
|
|
7671
|
+
* Remove from Favorites option in home page v3 sidebar.
|
|
7672
|
+
* Allows removing an object from the user's favorites list from home-page v3 sidebar.
|
|
7673
|
+
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
7674
|
+
* @example
|
|
7675
|
+
* ```js
|
|
7676
|
+
* disabledActions: [Action.RemoveFromFavorites]
|
|
7677
|
+
* ```
|
|
7678
|
+
*/
|
|
7679
|
+
RemoveFromFavorites = "removeFromFavorites",
|
|
7595
7680
|
/**
|
|
7596
7681
|
* The edit icon on Liveboards (Classic experience).
|
|
7597
7682
|
* @example
|
|
@@ -8649,6 +8734,20 @@ export declare enum Action {
|
|
|
8649
8734
|
* ```
|
|
8650
8735
|
*/
|
|
8651
8736
|
SpotterViz = "spotterViz",
|
|
8737
|
+
/**
|
|
8738
|
+
* The reference-mode toggle button inside the SpotterViz chat input.
|
|
8739
|
+
* When users enable reference mode, clicking tiles, filters, or
|
|
8740
|
+
* parameters adds them as chat context. Hide this action to remove
|
|
8741
|
+
* the reference-mode capability entirely.
|
|
8742
|
+
* Visible by default.
|
|
8743
|
+
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
8744
|
+
* @example
|
|
8745
|
+
* ```js
|
|
8746
|
+
* hiddenActions: [Action.SpotterVizReferenceMode]
|
|
8747
|
+
* disabledActions: [Action.SpotterVizReferenceMode]
|
|
8748
|
+
* ```
|
|
8749
|
+
*/
|
|
8750
|
+
SpotterVizReferenceMode = "spotterVizReferenceMode",
|
|
8652
8751
|
/**
|
|
8653
8752
|
* Clears browser cache and fetches new data for liveboard ChartViz Containers.
|
|
8654
8753
|
* Requires `enableLiveboardDataCache` to be enabled.
|
|
@@ -9968,6 +10067,8 @@ declare class TsEmbed {
|
|
|
9968
10067
|
private shouldEncodeUrlQueryParams;
|
|
9969
10068
|
private defaultHiddenActions;
|
|
9970
10069
|
private resizeObserver;
|
|
10070
|
+
private preRenderContainerEl;
|
|
10071
|
+
private containerScrollListener;
|
|
9971
10072
|
protected hostEventClient: HostEventClient;
|
|
9972
10073
|
protected isReadyForRenderPromise: Promise<void>;
|
|
9973
10074
|
protected shouldWaitForRenderPromise: boolean;
|
|
@@ -10135,6 +10236,29 @@ declare class TsEmbed {
|
|
|
10135
10236
|
* aligned with the host layout.
|
|
10136
10237
|
*/
|
|
10137
10238
|
private createPreRenderPlaceholder;
|
|
10239
|
+
/**
|
|
10240
|
+
* Resolves the configured preRenderContainer to a live element, falling
|
|
10241
|
+
* back to `document.body`. A string selector is re-queried on every call so
|
|
10242
|
+
* a remounted container (E.g.: React replacing the node) resolves to the
|
|
10243
|
+
* fresh element; an element passed directly cannot be re-resolved.
|
|
10244
|
+
*/
|
|
10245
|
+
private resolvePreRenderContainerTarget;
|
|
10246
|
+
/**
|
|
10247
|
+
* Makes the container a positioning context for the absolutely positioned
|
|
10248
|
+
* wrapper, stashing the original inline `position` on the element (once) so
|
|
10249
|
+
* destroy() can restore it exactly, leaving no trace. Recording it on the
|
|
10250
|
+
* element rather than per-instance lets the override be reverted even when
|
|
10251
|
+
* embeds share the same container.
|
|
10252
|
+
*/
|
|
10253
|
+
private applyPreRenderContainerPositioning;
|
|
10254
|
+
/**
|
|
10255
|
+
* Re-attaches the wrapper to a live container when the previously resolved
|
|
10256
|
+
* one has been detached or no longer holds the wrapper — e.g. the host app
|
|
10257
|
+
* remounted a custom preRenderContainer, which would otherwise leave a stale
|
|
10258
|
+
* reference and collapse the wrapper. Only string selectors can be
|
|
10259
|
+
* re-resolved; a container passed as an element is left untouched.
|
|
10260
|
+
*/
|
|
10261
|
+
private reconcilePreRenderContainer;
|
|
10138
10262
|
protected insertIntoDOMForPreRender(child: string | Node): void;
|
|
10139
10263
|
private showPreRenderByDefault;
|
|
10140
10264
|
protected insertIntoDOM(child: string | Node): void;
|
|
@@ -10347,6 +10471,19 @@ declare class TsEmbed {
|
|
|
10347
10471
|
getThoughtSpotPostUrlParams(additionalParams?: {
|
|
10348
10472
|
[key: string]: string | number;
|
|
10349
10473
|
}): string;
|
|
10474
|
+
/**
|
|
10475
|
+
* Reverts the custom preRenderContainer's `position` to the value it had
|
|
10476
|
+
* before we overrode it to `relative` (see insertIntoDOMForPreRender).
|
|
10477
|
+
*
|
|
10478
|
+
* We restore the original inline value rather than forcing `static`, and we
|
|
10479
|
+
* skip the restore if another preRender wrapper is still mounted inside the
|
|
10480
|
+
* same container — a shared container still needs the positioning context.
|
|
10481
|
+
*/
|
|
10482
|
+
private restorePreRenderContainerPosition;
|
|
10483
|
+
/**
|
|
10484
|
+
* Detaches and clears the container scroll listener, if one is attached.
|
|
10485
|
+
*/
|
|
10486
|
+
private removeContainerScrollListener;
|
|
10350
10487
|
/**
|
|
10351
10488
|
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
10352
10489
|
* @version SDK: 1.19.1 | ThoughtSpot: *
|
|
@@ -11021,6 +11158,14 @@ export interface SpotterChatViewConfig {
|
|
|
11021
11158
|
* @version SDK: 1.49.0 | ThoughtSpot: 26.6.0.cl
|
|
11022
11159
|
*/
|
|
11023
11160
|
spotterFileUploadFileTypes?: SpotterFileUploadFileTypes;
|
|
11161
|
+
/**
|
|
11162
|
+
* Enables starter prompts in the Spotter chat interface.
|
|
11163
|
+
*
|
|
11164
|
+
* Supported embed types: SpotterEmbed, LiveboardEmbed, AppEmbed
|
|
11165
|
+
* @version SDK: 1.51.0 | ThoughtSpot: 26.8.0.cl
|
|
11166
|
+
* @default false
|
|
11167
|
+
*/
|
|
11168
|
+
enableStarterPrompts?: boolean;
|
|
11024
11169
|
}
|
|
11025
11170
|
/**
|
|
11026
11171
|
* The configuration for the embedded spotterEmbed options.
|