@thoughtspot/visual-embed-sdk 1.49.1 → 1.49.3
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 +4 -10
- 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 +7 -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 +6 -0
- 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/spotter-viz-utils.d.ts +29 -0
- package/cjs/src/embed/spotter-viz-utils.d.ts.map +1 -1
- package/cjs/src/embed/spotter-viz-utils.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 +166 -9
- 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/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.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/graphql/answerService/answerService.spec.js +15 -0
- package/cjs/src/utils/graphql/answerService/answerService.spec.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.d.ts +10 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +25 -4
- 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-B6Rn561t.js → index-DsSQndIB.js} +303 -187
- 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 +7 -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 +6 -0
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/spotter-viz-utils.d.ts +29 -0
- package/dist/src/embed/spotter-viz-utils.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/index.d.ts +2 -2
- package/dist/src/index.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.d.ts +10 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +282 -35
- package/dist/tsembed-react.js +583 -220
- package/dist/tsembed.es.js +282 -35
- package/dist/tsembed.js +583 -220
- package/dist/visual-embed-sdk-react-full.d.ts +190 -4
- package/dist/visual-embed-sdk-react.d.ts +190 -4
- package/dist/visual-embed-sdk.d.ts +190 -4
- package/lib/package.json +4 -10
- 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 +7 -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 +6 -0
- 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/spotter-viz-utils.d.ts +29 -0
- package/lib/src/embed/spotter-viz-utils.d.ts.map +1 -1
- package/lib/src/embed/spotter-viz-utils.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 +167 -10
- 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/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.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/graphql/answerService/answerService.spec.js +15 -0
- package/lib/src/utils/graphql/answerService/answerService.spec.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.d.ts +10 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +22 -1
- 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 +190 -4
- package/package.json +4 -10
- package/src/css-variables.ts +20 -0
- package/src/embed/app.spec.ts +109 -0
- package/src/embed/app.ts +11 -1
- 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 +10 -0
- package/src/embed/spotter-viz-utils.ts +30 -0
- package/src/embed/ts-embed.spec.ts +294 -0
- package/src/embed/ts-embed.ts +180 -9
- package/src/index.ts +2 -1
- package/src/types.ts +86 -3
- package/src/utils/graphql/answerService/answerService.spec.ts +18 -0
- package/src/utils/processTrigger.spec.ts +23 -0
- package/src/utils/processTrigger.ts +8 -6
- package/src/utils.spec.ts +63 -0
- package/src/utils.ts +25 -1
|
@@ -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.
|
|
@@ -11323,6 +11468,12 @@ export interface SpotterVizStarterPrompt {
|
|
|
11323
11468
|
* customStarterPrompts: [
|
|
11324
11469
|
* { id: '1', displayText: 'Top products', fullPrompt: 'What are the top products by revenue?' }
|
|
11325
11470
|
* ],
|
|
11471
|
+
* // loaderHeadline and loaderTips require SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
11472
|
+
* loaderHeadline: 'Crunching the numbers...',
|
|
11473
|
+
* loaderTips: [
|
|
11474
|
+
* { label: 'Tip', text: 'try asking about revenue by region' },
|
|
11475
|
+
* { label: 'Tip', text: 'use natural language' },
|
|
11476
|
+
* ],
|
|
11326
11477
|
* },
|
|
11327
11478
|
* })
|
|
11328
11479
|
* ```
|
|
@@ -11367,6 +11518,29 @@ export interface SpotterVizConfig {
|
|
|
11367
11518
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
11368
11519
|
*/
|
|
11369
11520
|
inputChatPlaceholder?: string;
|
|
11521
|
+
/**
|
|
11522
|
+
* Custom headline text shown in the SpotterViz loading state.
|
|
11523
|
+
* Replaces the default loading headline.
|
|
11524
|
+
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
11525
|
+
*/
|
|
11526
|
+
loaderHeadline?: string;
|
|
11527
|
+
/**
|
|
11528
|
+
* Custom tips shown in the SpotterViz loading state.
|
|
11529
|
+
* Replaces the default loading tips with the provided list.
|
|
11530
|
+
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
11531
|
+
*/
|
|
11532
|
+
loaderTips?: SpotterVizLoaderTip[];
|
|
11533
|
+
}
|
|
11534
|
+
/**
|
|
11535
|
+
* A single tip shown in the SpotterViz loading state.
|
|
11536
|
+
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
11537
|
+
* @group Embed components
|
|
11538
|
+
*/
|
|
11539
|
+
export interface SpotterVizLoaderTip {
|
|
11540
|
+
/** Short label rendered alongside the tip (e.g. "Tip"). */
|
|
11541
|
+
label: string;
|
|
11542
|
+
/** Tip body text. */
|
|
11543
|
+
text: string;
|
|
11370
11544
|
}
|
|
11371
11545
|
/**
|
|
11372
11546
|
* Pages within the ThoughtSpot app that can be embedded.
|
|
@@ -12111,7 +12285,13 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
12111
12285
|
* description: 'Ask questions about your data',
|
|
12112
12286
|
* inputChatPlaceholder: 'Ask a question...',
|
|
12113
12287
|
* hideStarterPrompts: false,
|
|
12114
|
-
* customStarterPrompts: [{ id: '1', displayText: 'Top products', fullPrompt: 'What are the top products by revenue?' }]
|
|
12288
|
+
* customStarterPrompts: [{ id: '1', displayText: 'Top products', fullPrompt: 'What are the top products by revenue?' }],
|
|
12289
|
+
* // loaderHeadline and loaderTips require SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
12290
|
+
* loaderHeadline: 'Crunching the numbers...',
|
|
12291
|
+
* loaderTips: [
|
|
12292
|
+
* { label: 'Tip', text: 'try asking about revenue by region' },
|
|
12293
|
+
* { label: 'Tip', text: 'use natural language' },
|
|
12294
|
+
* ],
|
|
12115
12295
|
* },
|
|
12116
12296
|
* })
|
|
12117
12297
|
* ```
|
|
@@ -12808,6 +12988,12 @@ export interface LiveboardViewConfig extends BaseViewConfig, SearchLiveboardComm
|
|
|
12808
12988
|
* inputChatPlaceholder: 'Ask a question...',
|
|
12809
12989
|
* hideStarterPrompts: false,
|
|
12810
12990
|
* customStarterPrompts: [{ id: '1', displayText: 'Top products', fullPrompt: 'What are the top products by revenue?' }],
|
|
12991
|
+
* // loaderHeadline and loaderTips require SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
12992
|
+
* loaderHeadline: 'Crunching the numbers...',
|
|
12993
|
+
* loaderTips: [
|
|
12994
|
+
* { label: 'Tip', text: 'try asking about revenue by region' },
|
|
12995
|
+
* { label: 'Tip', text: 'use natural language' },
|
|
12996
|
+
* ],
|
|
12811
12997
|
* },
|
|
12812
12998
|
* })
|
|
12813
12999
|
* ```
|
|
@@ -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.
|
|
@@ -5128,11 +5184,30 @@ export declare enum HostEvent {
|
|
|
5128
5184
|
/**
|
|
5129
5185
|
* Navigate to a specific page in the embedded ThoughtSpot application.
|
|
5130
5186
|
* This is the same as calling `appEmbed.navigateToPage(path, true)`.
|
|
5131
|
-
*
|
|
5132
|
-
*
|
|
5187
|
+
*
|
|
5188
|
+
* Accepts either a plain value or an object with `path`
|
|
5189
|
+
* and an optional `replace` flag.
|
|
5190
|
+
*
|
|
5191
|
+
* @param data - A string path, a numeric history delta, or an object
|
|
5192
|
+
* `{ path: string | number, replace?: boolean }`.
|
|
5193
|
+
* - `path` — the route to navigate to, or a history delta such as `1`
|
|
5194
|
+
* or `-1` (calls `window.history.go()`).
|
|
5195
|
+
* - `replace` — when `true`, replaces the current history entry instead
|
|
5196
|
+
* of pushing a new one (uses `window.location.replace`).
|
|
5197
|
+
*
|
|
5133
5198
|
* @example
|
|
5134
5199
|
* ```js
|
|
5135
|
-
*
|
|
5200
|
+
* // Preferred: use navigateToPage directly
|
|
5201
|
+
* appEmbed.navigateToPage(-1);
|
|
5202
|
+
*
|
|
5203
|
+
* // Numeric delta — go back one step
|
|
5204
|
+
* appEmbed.trigger(HostEvent.Navigate, -1);
|
|
5205
|
+
*
|
|
5206
|
+
* // String path — push a new history entry
|
|
5207
|
+
* appEmbed.trigger(HostEvent.Navigate, 'home');
|
|
5208
|
+
*
|
|
5209
|
+
* // Object format — replace current history entry
|
|
5210
|
+
* appEmbed.trigger(HostEvent.Navigate, { path: 'home', replace: true }); // SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
5136
5211
|
* ```
|
|
5137
5212
|
* @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1.sw
|
|
5138
5213
|
*/
|
|
@@ -7587,6 +7662,16 @@ export declare enum Action {
|
|
|
7587
7662
|
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
|
|
7588
7663
|
*/
|
|
7589
7664
|
AddToFavorites = "addToFavorites",
|
|
7665
|
+
/**
|
|
7666
|
+
* Remove from Favorites option in home page v3 sidebar.
|
|
7667
|
+
* Allows removing an object from the user's favorites list from home-page v3 sidebar.
|
|
7668
|
+
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
7669
|
+
* @example
|
|
7670
|
+
* ```js
|
|
7671
|
+
* disabledActions: [Action.RemoveFromFavorites]
|
|
7672
|
+
* ```
|
|
7673
|
+
*/
|
|
7674
|
+
RemoveFromFavorites = "removeFromFavorites",
|
|
7590
7675
|
/**
|
|
7591
7676
|
* The edit icon on Liveboards (Classic experience).
|
|
7592
7677
|
* @example
|
|
@@ -8644,6 +8729,20 @@ export declare enum Action {
|
|
|
8644
8729
|
* ```
|
|
8645
8730
|
*/
|
|
8646
8731
|
SpotterViz = "spotterViz",
|
|
8732
|
+
/**
|
|
8733
|
+
* The reference-mode toggle button inside the SpotterViz chat input.
|
|
8734
|
+
* When users enable reference mode, clicking tiles, filters, or
|
|
8735
|
+
* parameters adds them as chat context. Hide this action to remove
|
|
8736
|
+
* the reference-mode capability entirely.
|
|
8737
|
+
* Visible by default.
|
|
8738
|
+
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
8739
|
+
* @example
|
|
8740
|
+
* ```js
|
|
8741
|
+
* hiddenActions: [Action.SpotterVizReferenceMode]
|
|
8742
|
+
* disabledActions: [Action.SpotterVizReferenceMode]
|
|
8743
|
+
* ```
|
|
8744
|
+
*/
|
|
8745
|
+
SpotterVizReferenceMode = "spotterVizReferenceMode",
|
|
8647
8746
|
/**
|
|
8648
8747
|
* Clears browser cache and fetches new data for liveboard ChartViz Containers.
|
|
8649
8748
|
* Requires `enableLiveboardDataCache` to be enabled.
|
|
@@ -9941,6 +10040,8 @@ declare class TsEmbed {
|
|
|
9941
10040
|
private shouldEncodeUrlQueryParams;
|
|
9942
10041
|
private defaultHiddenActions;
|
|
9943
10042
|
private resizeObserver;
|
|
10043
|
+
private preRenderContainerEl;
|
|
10044
|
+
private containerScrollListener;
|
|
9944
10045
|
protected hostEventClient: HostEventClient;
|
|
9945
10046
|
protected isReadyForRenderPromise: Promise<void>;
|
|
9946
10047
|
protected shouldWaitForRenderPromise: boolean;
|
|
@@ -10108,6 +10209,29 @@ declare class TsEmbed {
|
|
|
10108
10209
|
* aligned with the host layout.
|
|
10109
10210
|
*/
|
|
10110
10211
|
private createPreRenderPlaceholder;
|
|
10212
|
+
/**
|
|
10213
|
+
* Resolves the configured preRenderContainer to a live element, falling
|
|
10214
|
+
* back to `document.body`. A string selector is re-queried on every call so
|
|
10215
|
+
* a remounted container (E.g.: React replacing the node) resolves to the
|
|
10216
|
+
* fresh element; an element passed directly cannot be re-resolved.
|
|
10217
|
+
*/
|
|
10218
|
+
private resolvePreRenderContainerTarget;
|
|
10219
|
+
/**
|
|
10220
|
+
* Makes the container a positioning context for the absolutely positioned
|
|
10221
|
+
* wrapper, stashing the original inline `position` on the element (once) so
|
|
10222
|
+
* destroy() can restore it exactly, leaving no trace. Recording it on the
|
|
10223
|
+
* element rather than per-instance lets the override be reverted even when
|
|
10224
|
+
* embeds share the same container.
|
|
10225
|
+
*/
|
|
10226
|
+
private applyPreRenderContainerPositioning;
|
|
10227
|
+
/**
|
|
10228
|
+
* Re-attaches the wrapper to a live container when the previously resolved
|
|
10229
|
+
* one has been detached or no longer holds the wrapper — e.g. the host app
|
|
10230
|
+
* remounted a custom preRenderContainer, which would otherwise leave a stale
|
|
10231
|
+
* reference and collapse the wrapper. Only string selectors can be
|
|
10232
|
+
* re-resolved; a container passed as an element is left untouched.
|
|
10233
|
+
*/
|
|
10234
|
+
private reconcilePreRenderContainer;
|
|
10111
10235
|
protected insertIntoDOMForPreRender(child: string | Node): void;
|
|
10112
10236
|
private showPreRenderByDefault;
|
|
10113
10237
|
protected insertIntoDOM(child: string | Node): void;
|
|
@@ -10320,6 +10444,19 @@ declare class TsEmbed {
|
|
|
10320
10444
|
getThoughtSpotPostUrlParams(additionalParams?: {
|
|
10321
10445
|
[key: string]: string | number;
|
|
10322
10446
|
}): string;
|
|
10447
|
+
/**
|
|
10448
|
+
* Reverts the custom preRenderContainer's `position` to the value it had
|
|
10449
|
+
* before we overrode it to `relative` (see insertIntoDOMForPreRender).
|
|
10450
|
+
*
|
|
10451
|
+
* We restore the original inline value rather than forcing `static`, and we
|
|
10452
|
+
* skip the restore if another preRender wrapper is still mounted inside the
|
|
10453
|
+
* same container — a shared container still needs the positioning context.
|
|
10454
|
+
*/
|
|
10455
|
+
private restorePreRenderContainerPosition;
|
|
10456
|
+
/**
|
|
10457
|
+
* Detaches and clears the container scroll listener, if one is attached.
|
|
10458
|
+
*/
|
|
10459
|
+
private removeContainerScrollListener;
|
|
10323
10460
|
/**
|
|
10324
10461
|
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
10325
10462
|
* @version SDK: 1.19.1 | ThoughtSpot: *
|
|
@@ -10994,6 +11131,14 @@ export interface SpotterChatViewConfig {
|
|
|
10994
11131
|
* @version SDK: 1.49.0 | ThoughtSpot: 26.6.0.cl
|
|
10995
11132
|
*/
|
|
10996
11133
|
spotterFileUploadFileTypes?: SpotterFileUploadFileTypes;
|
|
11134
|
+
/**
|
|
11135
|
+
* Enables starter prompts in the Spotter chat interface.
|
|
11136
|
+
*
|
|
11137
|
+
* Supported embed types: SpotterEmbed, LiveboardEmbed, AppEmbed
|
|
11138
|
+
* @version SDK: 1.51.0 | ThoughtSpot: 26.8.0.cl
|
|
11139
|
+
* @default false
|
|
11140
|
+
*/
|
|
11141
|
+
enableStarterPrompts?: boolean;
|
|
10997
11142
|
}
|
|
10998
11143
|
/**
|
|
10999
11144
|
* The configuration for the embedded spotterEmbed options.
|
|
@@ -11296,6 +11441,12 @@ export interface SpotterVizStarterPrompt {
|
|
|
11296
11441
|
* customStarterPrompts: [
|
|
11297
11442
|
* { id: '1', displayText: 'Top products', fullPrompt: 'What are the top products by revenue?' }
|
|
11298
11443
|
* ],
|
|
11444
|
+
* // loaderHeadline and loaderTips require SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
11445
|
+
* loaderHeadline: 'Crunching the numbers...',
|
|
11446
|
+
* loaderTips: [
|
|
11447
|
+
* { label: 'Tip', text: 'try asking about revenue by region' },
|
|
11448
|
+
* { label: 'Tip', text: 'use natural language' },
|
|
11449
|
+
* ],
|
|
11299
11450
|
* },
|
|
11300
11451
|
* })
|
|
11301
11452
|
* ```
|
|
@@ -11340,6 +11491,29 @@ export interface SpotterVizConfig {
|
|
|
11340
11491
|
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
11341
11492
|
*/
|
|
11342
11493
|
inputChatPlaceholder?: string;
|
|
11494
|
+
/**
|
|
11495
|
+
* Custom headline text shown in the SpotterViz loading state.
|
|
11496
|
+
* Replaces the default loading headline.
|
|
11497
|
+
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
11498
|
+
*/
|
|
11499
|
+
loaderHeadline?: string;
|
|
11500
|
+
/**
|
|
11501
|
+
* Custom tips shown in the SpotterViz loading state.
|
|
11502
|
+
* Replaces the default loading tips with the provided list.
|
|
11503
|
+
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
11504
|
+
*/
|
|
11505
|
+
loaderTips?: SpotterVizLoaderTip[];
|
|
11506
|
+
}
|
|
11507
|
+
/**
|
|
11508
|
+
* A single tip shown in the SpotterViz loading state.
|
|
11509
|
+
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
11510
|
+
* @group Embed components
|
|
11511
|
+
*/
|
|
11512
|
+
export interface SpotterVizLoaderTip {
|
|
11513
|
+
/** Short label rendered alongside the tip (e.g. "Tip"). */
|
|
11514
|
+
label: string;
|
|
11515
|
+
/** Tip body text. */
|
|
11516
|
+
text: string;
|
|
11343
11517
|
}
|
|
11344
11518
|
/**
|
|
11345
11519
|
* Pages within the ThoughtSpot app that can be embedded.
|
|
@@ -12080,7 +12254,13 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
12080
12254
|
* description: 'Ask questions about your data',
|
|
12081
12255
|
* inputChatPlaceholder: 'Ask a question...',
|
|
12082
12256
|
* hideStarterPrompts: false,
|
|
12083
|
-
* customStarterPrompts: [{ id: '1', displayText: 'Top products', fullPrompt: 'What are the top products by revenue?' }]
|
|
12257
|
+
* customStarterPrompts: [{ id: '1', displayText: 'Top products', fullPrompt: 'What are the top products by revenue?' }],
|
|
12258
|
+
* // loaderHeadline and loaderTips require SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
12259
|
+
* loaderHeadline: 'Crunching the numbers...',
|
|
12260
|
+
* loaderTips: [
|
|
12261
|
+
* { label: 'Tip', text: 'try asking about revenue by region' },
|
|
12262
|
+
* { label: 'Tip', text: 'use natural language' },
|
|
12263
|
+
* ],
|
|
12084
12264
|
* },
|
|
12085
12265
|
* })
|
|
12086
12266
|
* ```
|
|
@@ -12777,6 +12957,12 @@ export interface LiveboardViewConfig extends BaseViewConfig, SearchLiveboardComm
|
|
|
12777
12957
|
* inputChatPlaceholder: 'Ask a question...',
|
|
12778
12958
|
* hideStarterPrompts: false,
|
|
12779
12959
|
* customStarterPrompts: [{ id: '1', displayText: 'Top products', fullPrompt: 'What are the top products by revenue?' }],
|
|
12960
|
+
* // loaderHeadline and loaderTips require SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
|
|
12961
|
+
* loaderHeadline: 'Crunching the numbers...',
|
|
12962
|
+
* loaderTips: [
|
|
12963
|
+
* { label: 'Tip', text: 'try asking about revenue by region' },
|
|
12964
|
+
* { label: 'Tip', text: 'use natural language' },
|
|
12965
|
+
* ],
|
|
12780
12966
|
* },
|
|
12781
12967
|
* })
|
|
12782
12968
|
* ```
|