@thoughtspot/visual-embed-sdk 1.39.2 → 1.40.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/config.spec.js +9 -0
- package/cjs/src/config.spec.js.map +1 -1
- package/cjs/src/embed/app.d.ts +75 -15
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +69 -9
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +378 -15
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +23 -7
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +31 -5
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.spec.js +8 -190
- package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +28 -0
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/embedConfig.d.ts +9 -7
- package/cjs/src/embed/embedConfig.d.ts.map +1 -1
- package/cjs/src/embed/embedConfig.js +9 -7
- package/cjs/src/embed/embedConfig.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +56 -17
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +48 -4
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +218 -11
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.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 +3 -2
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +73 -20
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +79 -42
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +438 -100
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +331 -13
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +296 -8
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/global-styles.js +1 -1
- package/cjs/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/cjs/src/utils/graphql/nlsService/conversation-service.js +7 -1
- package/cjs/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
- package/cjs/src/utils/processTrigger.js +2 -1
- package/cjs/src/utils/processTrigger.js.map +1 -1
- package/cjs/src/utils.d.ts +6 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +23 -3
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +237 -1
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-CmEQfuE3.js → index-CAEHQGLc.js} +1 -1
- package/dist/src/embed/app.d.ts +75 -15
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +23 -7
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/embedConfig.d.ts +9 -7
- package/dist/src/embed/embedConfig.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +56 -17
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.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 +73 -20
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +331 -13
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/dist/src/utils.d.ts +6 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +568 -87
- package/dist/tsembed-react.js +568 -85
- package/dist/tsembed.es.js +486 -40
- package/dist/tsembed.js +484 -38
- package/dist/visual-embed-sdk-react-full.d.ts +545 -79
- package/dist/visual-embed-sdk-react.d.ts +545 -79
- package/dist/visual-embed-sdk.d.ts +473 -60
- package/lib/package.json +1 -1
- package/lib/src/config.spec.js +9 -0
- package/lib/src/config.spec.js.map +1 -1
- package/lib/src/embed/app.d.ts +75 -15
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +69 -9
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +380 -17
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +23 -7
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +30 -5
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.spec.js +9 -191
- package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +30 -2
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/embedConfig.d.ts +9 -7
- package/lib/src/embed/embedConfig.d.ts.map +1 -1
- package/lib/src/embed/embedConfig.js +9 -7
- package/lib/src/embed/embedConfig.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +56 -17
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +49 -5
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +218 -11
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.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 +73 -20
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +79 -43
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +441 -103
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +331 -13
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +296 -8
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/global-styles.js +1 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.js +7 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
- package/lib/src/utils/processTrigger.js +2 -1
- package/lib/src/utils/processTrigger.js.map +1 -1
- package/lib/src/utils.d.ts +6 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +21 -2
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +238 -2
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +474 -61
- package/package.json +1 -1
- package/src/config.spec.ts +11 -0
- package/src/embed/app.spec.ts +486 -30
- package/src/embed/app.ts +133 -27
- package/src/embed/bodyless-conversation.spec.ts +9 -203
- package/src/embed/bodyless-conversation.ts +34 -10
- package/src/embed/conversation.spec.ts +40 -2
- package/src/embed/embedConfig.ts +10 -8
- package/src/embed/liveboard.spec.ts +259 -5
- package/src/embed/liveboard.ts +98 -27
- package/src/errors.ts +1 -0
- package/src/index.ts +2 -0
- package/src/react/all-types-export.ts +2 -1
- package/src/react/index.spec.tsx +558 -157
- package/src/react/index.tsx +117 -51
- package/src/types.ts +368 -50
- package/src/utils/global-styles.ts +1 -1
- package/src/utils/graphql/nlsService/conversation-service.ts +7 -1
- package/src/utils/processTrigger.ts +1 -1
- package/src/utils.spec.ts +279 -2
- package/src/utils.ts +28 -2
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.40.0 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -284,7 +284,6 @@
|
|
|
284
284
|
function removeTypename(obj) {
|
|
285
285
|
if (!obj || typeof obj !== 'object')
|
|
286
286
|
return obj;
|
|
287
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
288
287
|
for (const key in obj) {
|
|
289
288
|
if (key === '__typename') {
|
|
290
289
|
delete obj[key];
|
|
@@ -313,7 +312,11 @@
|
|
|
313
312
|
if (!(element === null || element === void 0 ? void 0 : element.style))
|
|
314
313
|
return;
|
|
315
314
|
Object.keys(styleProperties).forEach((styleProperty) => {
|
|
316
|
-
|
|
315
|
+
const styleKey = styleProperty;
|
|
316
|
+
const value = styleProperties[styleKey];
|
|
317
|
+
if (value !== undefined) {
|
|
318
|
+
element.style[styleKey] = value.toString();
|
|
319
|
+
}
|
|
317
320
|
});
|
|
318
321
|
};
|
|
319
322
|
/**
|
|
@@ -441,6 +444,22 @@
|
|
|
441
444
|
}
|
|
442
445
|
}
|
|
443
446
|
logger$3.warn('Exit fullscreen API is not supported by this browser.');
|
|
447
|
+
};
|
|
448
|
+
const calculateVisibleElementData = (element) => {
|
|
449
|
+
const rect = element.getBoundingClientRect();
|
|
450
|
+
const windowHeight = window.innerHeight;
|
|
451
|
+
const windowWidth = window.innerWidth;
|
|
452
|
+
const frameRelativeTop = Math.max(rect.top, 0);
|
|
453
|
+
const frameRelativeLeft = Math.max(rect.left, 0);
|
|
454
|
+
const frameRelativeBottom = Math.min(windowHeight, rect.bottom);
|
|
455
|
+
const frameRelativeRight = Math.min(windowWidth, rect.right);
|
|
456
|
+
const data = {
|
|
457
|
+
top: Math.max(0, rect.top * -1),
|
|
458
|
+
height: Math.max(0, frameRelativeBottom - frameRelativeTop),
|
|
459
|
+
left: Math.max(0, rect.left * -1),
|
|
460
|
+
width: Math.max(0, frameRelativeRight - frameRelativeLeft),
|
|
461
|
+
};
|
|
462
|
+
return data;
|
|
444
463
|
};
|
|
445
464
|
|
|
446
465
|
/**
|
|
@@ -659,6 +678,12 @@
|
|
|
659
678
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
660
679
|
*/
|
|
661
680
|
HomeLeftNavItem["Spotter"] = "spotter";
|
|
681
|
+
/**
|
|
682
|
+
* Favorites option in the insights left navigation,
|
|
683
|
+
* available when new navigation V3 is enabled.
|
|
684
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
685
|
+
*/
|
|
686
|
+
HomeLeftNavItem["Favorites"] = "favorites";
|
|
662
687
|
})(exports.HomeLeftNavItem || (exports.HomeLeftNavItem = {}));
|
|
663
688
|
/**
|
|
664
689
|
* A map of the supported runtime filter operations
|
|
@@ -1477,7 +1502,7 @@
|
|
|
1477
1502
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1478
1503
|
* @example
|
|
1479
1504
|
*```js
|
|
1480
|
-
* liveboardEmbed.on(EmbedEvent.
|
|
1505
|
+
* liveboardEmbed.on(EmbedEvent.LiveboardInfo, payload => {
|
|
1481
1506
|
* console.log('Liveboard details', payload);
|
|
1482
1507
|
* })
|
|
1483
1508
|
*```
|
|
@@ -1845,6 +1870,89 @@
|
|
|
1845
1870
|
* @version SDK : 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
1846
1871
|
*/
|
|
1847
1872
|
EmbedEvent["ExitPresentMode"] = "exitPresentMode";
|
|
1873
|
+
/**
|
|
1874
|
+
* Emitted when a user requests the full height lazy load data.
|
|
1875
|
+
* @version SDK : 1.39.0 | ThoughtSpot : 10.10.0.cl
|
|
1876
|
+
* @hidden
|
|
1877
|
+
*/
|
|
1878
|
+
EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
|
|
1879
|
+
/**
|
|
1880
|
+
* Emitted when Spotter response is text data
|
|
1881
|
+
* @example
|
|
1882
|
+
* ```js
|
|
1883
|
+
* spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
|
|
1884
|
+
* console.log('payload', payload);
|
|
1885
|
+
* })
|
|
1886
|
+
*```
|
|
1887
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1888
|
+
*/
|
|
1889
|
+
EmbedEvent["SpotterData"] = "SpotterData";
|
|
1890
|
+
/**
|
|
1891
|
+
* Emitted when user opens up the worksheet preview modal in Spotter embed.
|
|
1892
|
+
* @example
|
|
1893
|
+
* ```js
|
|
1894
|
+
* spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
|
|
1895
|
+
* console.log('payload', payload);
|
|
1896
|
+
* })
|
|
1897
|
+
*```
|
|
1898
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1899
|
+
*/
|
|
1900
|
+
EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
1901
|
+
/**
|
|
1902
|
+
* Emitted when the Spotter query is triggered in Spotter embed.
|
|
1903
|
+
* @example
|
|
1904
|
+
* ```js
|
|
1905
|
+
* spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
|
|
1906
|
+
* console.log('payload', payload);
|
|
1907
|
+
* })
|
|
1908
|
+
*```
|
|
1909
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1910
|
+
*/
|
|
1911
|
+
EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
|
|
1912
|
+
/**
|
|
1913
|
+
* Emitted when the last Spotter query is edited in Spotter embed.
|
|
1914
|
+
* @example
|
|
1915
|
+
* ```js
|
|
1916
|
+
* spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
|
|
1917
|
+
* console.log('payload', payload);
|
|
1918
|
+
* })
|
|
1919
|
+
*```
|
|
1920
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1921
|
+
*/
|
|
1922
|
+
EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
|
|
1923
|
+
/**
|
|
1924
|
+
* Emitted when the last Spotter query is deleted in Spotter embed.
|
|
1925
|
+
* @example
|
|
1926
|
+
* ```js
|
|
1927
|
+
* spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
|
|
1928
|
+
* console.log('payload', payload);
|
|
1929
|
+
* })
|
|
1930
|
+
*```
|
|
1931
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1932
|
+
*/
|
|
1933
|
+
EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
|
|
1934
|
+
/**
|
|
1935
|
+
* Emitted when the coversation is reset in spotter embed.
|
|
1936
|
+
* @example
|
|
1937
|
+
* ```js
|
|
1938
|
+
* spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => {
|
|
1939
|
+
* console.log('payload', payload);
|
|
1940
|
+
* })
|
|
1941
|
+
*```
|
|
1942
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1943
|
+
*/
|
|
1944
|
+
EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
1945
|
+
/**
|
|
1946
|
+
* Emitted when the *Spotter* is initialized.
|
|
1947
|
+
* @example
|
|
1948
|
+
* ```js
|
|
1949
|
+
* spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => {
|
|
1950
|
+
* console.log('payload', payload);
|
|
1951
|
+
* })
|
|
1952
|
+
*```
|
|
1953
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1954
|
+
*/
|
|
1955
|
+
EmbedEvent["SpotterInit"] = "spotterInit";
|
|
1848
1956
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
1849
1957
|
/**
|
|
1850
1958
|
* Event types that can be triggered by the host application
|
|
@@ -1862,7 +1970,7 @@
|
|
|
1862
1970
|
* // create the liveboard embed.
|
|
1863
1971
|
*
|
|
1864
1972
|
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
1865
|
-
* { columnName: 'state, operator: RuntimeFilterOp.EQ, values: [
|
|
1973
|
+
* { columnName: 'state', operator: RuntimeFilterOp.EQ, values: ["california"]}
|
|
1866
1974
|
* ]);
|
|
1867
1975
|
* ```
|
|
1868
1976
|
* @example
|
|
@@ -1934,6 +2042,7 @@
|
|
|
1934
2042
|
* done automatically on the most popular column.
|
|
1935
2043
|
* @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
|
|
1936
2044
|
* in case of a Liveboard.
|
|
2045
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
1937
2046
|
* @example
|
|
1938
2047
|
* ```js
|
|
1939
2048
|
* searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
@@ -2072,12 +2181,12 @@
|
|
|
2072
2181
|
* Works with Search and Liveboard embed.
|
|
2073
2182
|
* @param - { columnId: string,
|
|
2074
2183
|
* name: string,
|
|
2075
|
-
* type:
|
|
2076
|
-
* dataType:
|
|
2184
|
+
* type: ATTRIBUTE/MEASURE,
|
|
2185
|
+
* dataType: INT64/CHAR/DATE }
|
|
2077
2186
|
* @example
|
|
2078
2187
|
* ```js
|
|
2079
2188
|
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
2080
|
-
* {column: { columnId: '<column-GUID>', name: 'column name', type: '
|
|
2189
|
+
* {column: { columnId: '<column-GUID>', name: 'column name', type: 'ATTRIBUTE', dataType: 'INT64'}})
|
|
2081
2190
|
* ```
|
|
2082
2191
|
* @example
|
|
2083
2192
|
* ```js
|
|
@@ -2135,6 +2244,7 @@
|
|
|
2135
2244
|
* @param
|
|
2136
2245
|
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
2137
2246
|
* Optional when pinning a new chart or table generated from a Search query.
|
|
2247
|
+
* **Required** in Spotter Embed.
|
|
2138
2248
|
* @param
|
|
2139
2249
|
* `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
|
|
2140
2250
|
* specify the `newLiveboardName` parameter to create a new Liveboard.
|
|
@@ -2182,6 +2292,12 @@
|
|
|
2182
2292
|
* ```js
|
|
2183
2293
|
* appEmbed.trigger(HostEvent.Pin)
|
|
2184
2294
|
* ```
|
|
2295
|
+
* @example
|
|
2296
|
+
* ```js
|
|
2297
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
|
|
2298
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2299
|
+
* });
|
|
2300
|
+
* ```
|
|
2185
2301
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2186
2302
|
*/
|
|
2187
2303
|
HostEvent["Pin"] = "pin";
|
|
@@ -2246,12 +2362,21 @@
|
|
|
2246
2362
|
* Trigger the **Download PDF** action on an embedded Liveboard,
|
|
2247
2363
|
* visualization or Answer.
|
|
2248
2364
|
*
|
|
2365
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2366
|
+
*
|
|
2249
2367
|
* **NOTE**: The **Download** > **PDF** action is available on
|
|
2250
2368
|
* visualizations and Answers if the data is in tabular format.
|
|
2251
2369
|
* @example
|
|
2252
2370
|
* ```js
|
|
2253
2371
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
|
|
2254
2372
|
* ```
|
|
2373
|
+
* @example
|
|
2374
|
+
* ```js
|
|
2375
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
|
|
2376
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2377
|
+
* });
|
|
2378
|
+
* ```
|
|
2379
|
+
*
|
|
2255
2380
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2256
2381
|
*/
|
|
2257
2382
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
@@ -2275,6 +2400,12 @@
|
|
|
2275
2400
|
* ```js
|
|
2276
2401
|
* searchEmbed.trigger(HostEvent.MakeACopy)
|
|
2277
2402
|
* ```
|
|
2403
|
+
* @example
|
|
2404
|
+
* ```js
|
|
2405
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
|
|
2406
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2407
|
+
* });
|
|
2408
|
+
* ```
|
|
2278
2409
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2279
2410
|
*/
|
|
2280
2411
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2347,6 +2478,8 @@
|
|
|
2347
2478
|
* This event is not supported in visualization embed and search embed.
|
|
2348
2479
|
* @param - object - To trigger the action for a specific visualization
|
|
2349
2480
|
* in Liveboard embed, pass in `vizId` as a key.
|
|
2481
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2482
|
+
*
|
|
2350
2483
|
* @example
|
|
2351
2484
|
* ```js
|
|
2352
2485
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
@@ -2355,6 +2488,18 @@
|
|
|
2355
2488
|
* liveboardEmbed.trigger(HostEvent.Edit, {vizId:
|
|
2356
2489
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2357
2490
|
* ```
|
|
2491
|
+
* @example
|
|
2492
|
+
* ```js
|
|
2493
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2494
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2495
|
+
* });
|
|
2496
|
+
* ```
|
|
2497
|
+
* @example
|
|
2498
|
+
* ```js
|
|
2499
|
+
* const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2500
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2501
|
+
* });
|
|
2502
|
+
* ```
|
|
2358
2503
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2359
2504
|
*/
|
|
2360
2505
|
HostEvent["Edit"] = "edit";
|
|
@@ -2402,6 +2547,16 @@
|
|
|
2402
2547
|
* );
|
|
2403
2548
|
* })
|
|
2404
2549
|
* ```
|
|
2550
|
+
* @example
|
|
2551
|
+
* ```js
|
|
2552
|
+
* spotterEmbed.trigger(HostEvent.GetTML, {
|
|
2553
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2554
|
+
* }).then((tml) => {
|
|
2555
|
+
* console.log(
|
|
2556
|
+
* tml.answer.search_query // TML representation of the search query
|
|
2557
|
+
* );
|
|
2558
|
+
* })
|
|
2559
|
+
* ```
|
|
2405
2560
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2406
2561
|
* @important
|
|
2407
2562
|
*/
|
|
@@ -2465,6 +2620,7 @@
|
|
|
2465
2620
|
/**
|
|
2466
2621
|
* Trigger the **Download** action on charts in
|
|
2467
2622
|
* the embedded view.
|
|
2623
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2468
2624
|
* @example
|
|
2469
2625
|
* ```js
|
|
2470
2626
|
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
@@ -2473,6 +2629,11 @@
|
|
|
2473
2629
|
* ```js
|
|
2474
2630
|
* embed.trigger(HostEvent.Download)
|
|
2475
2631
|
* ```
|
|
2632
|
+
* ```js
|
|
2633
|
+
* spotterEmbed.trigger(HostEvent.Download, {
|
|
2634
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2635
|
+
* });
|
|
2636
|
+
* ```
|
|
2476
2637
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
2477
2638
|
* Use {@link DownloadAsPng}
|
|
2478
2639
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
@@ -2489,13 +2650,19 @@
|
|
|
2489
2650
|
* vizEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2490
2651
|
*
|
|
2491
2652
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2653
|
+
*
|
|
2654
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, {
|
|
2655
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2656
|
+
* })
|
|
2492
2657
|
* ```
|
|
2658
|
+
*
|
|
2493
2659
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
2494
2660
|
*/
|
|
2495
2661
|
HostEvent["DownloadAsPng"] = "downloadAsPng";
|
|
2496
2662
|
/**
|
|
2497
2663
|
* Trigger the **Download** > **CSV** action on tables in
|
|
2498
2664
|
* the embedded view.
|
|
2665
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2499
2666
|
* @example
|
|
2500
2667
|
* ```js
|
|
2501
2668
|
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
@@ -2507,12 +2674,18 @@
|
|
|
2507
2674
|
* ```js
|
|
2508
2675
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2509
2676
|
* ```
|
|
2677
|
+
* ```js
|
|
2678
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
|
|
2679
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2680
|
+
* })
|
|
2681
|
+
* ```
|
|
2510
2682
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2511
2683
|
*/
|
|
2512
2684
|
HostEvent["DownloadAsCsv"] = "downloadAsCSV";
|
|
2513
2685
|
/**
|
|
2514
2686
|
* Trigger the **Download** > **XLSX** action on tables
|
|
2515
2687
|
* in the embedded view.
|
|
2688
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2516
2689
|
* @example
|
|
2517
2690
|
* ```js
|
|
2518
2691
|
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
@@ -2524,6 +2697,11 @@
|
|
|
2524
2697
|
* ```js
|
|
2525
2698
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2526
2699
|
* ```
|
|
2700
|
+
* ```js
|
|
2701
|
+
* spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
|
|
2702
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2703
|
+
* })
|
|
2704
|
+
* ```
|
|
2527
2705
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2528
2706
|
*/
|
|
2529
2707
|
HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
@@ -2543,6 +2721,7 @@
|
|
|
2543
2721
|
/**
|
|
2544
2722
|
* Trigger the **Save** action on a Liveboard or Answer.
|
|
2545
2723
|
* Saves the changes.
|
|
2724
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2546
2725
|
* @example
|
|
2547
2726
|
* ```js
|
|
2548
2727
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
@@ -2550,6 +2729,11 @@
|
|
|
2550
2729
|
* ```js
|
|
2551
2730
|
* searchEmbed.trigger(HostEvent.Save)
|
|
2552
2731
|
* ```
|
|
2732
|
+
* ```js
|
|
2733
|
+
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2734
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2735
|
+
* })
|
|
2736
|
+
* ```
|
|
2553
2737
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2554
2738
|
*/
|
|
2555
2739
|
HostEvent["Save"] = "save";
|
|
@@ -2833,7 +3017,7 @@
|
|
|
2833
3017
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
2834
3018
|
/**
|
|
2835
3019
|
* Triggers an action to update Parameter values on embedded
|
|
2836
|
-
* Answers and
|
|
3020
|
+
* Answers, Liveboard and Spotter answer in Edit mode.
|
|
2837
3021
|
*
|
|
2838
3022
|
* @example
|
|
2839
3023
|
* ```js
|
|
@@ -2847,11 +3031,19 @@
|
|
|
2847
3031
|
HostEvent["UpdateParameters"] = "UpdateParameters";
|
|
2848
3032
|
/**
|
|
2849
3033
|
* Triggers GetParameters to fetch the runtime Parameters.
|
|
3034
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2850
3035
|
* ```js
|
|
2851
3036
|
* liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
|
|
2852
3037
|
* console.log('parameters', parameter);
|
|
2853
3038
|
* });
|
|
2854
3039
|
*```
|
|
3040
|
+
*```js
|
|
3041
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, {
|
|
3042
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
3043
|
+
* }).then((parameter) => {
|
|
3044
|
+
* console.log('parameters', parameter);
|
|
3045
|
+
* });
|
|
3046
|
+
*```
|
|
2855
3047
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2856
3048
|
*/
|
|
2857
3049
|
HostEvent["GetParameters"] = "GetParameters";
|
|
@@ -2883,7 +3075,7 @@
|
|
|
2883
3075
|
* @param - optional attributes to set Answer properties.
|
|
2884
3076
|
* `name` - Name string for the Answer.
|
|
2885
3077
|
* `description` - Description text for the Answer.
|
|
2886
|
-
*
|
|
3078
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2887
3079
|
* @example
|
|
2888
3080
|
* ```js
|
|
2889
3081
|
* const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
|
|
@@ -2891,6 +3083,14 @@
|
|
|
2891
3083
|
* description: "Total sales by states in MidWest"
|
|
2892
3084
|
* });
|
|
2893
3085
|
* ```
|
|
3086
|
+
* @example
|
|
3087
|
+
* ```js
|
|
3088
|
+
* const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
|
|
3089
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c',
|
|
3090
|
+
* name: "Sales by states",
|
|
3091
|
+
* description: "Total sales by states in MidWest"
|
|
3092
|
+
* });
|
|
3093
|
+
* ```
|
|
2894
3094
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
2895
3095
|
*/
|
|
2896
3096
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
@@ -2919,6 +3119,70 @@
|
|
|
2919
3119
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
2920
3120
|
*/
|
|
2921
3121
|
HostEvent["TransformTableVizData"] = "TransformTableVizData";
|
|
3122
|
+
/**
|
|
3123
|
+
* Triggers a search operation with the search tokens specified in
|
|
3124
|
+
* the search query string in spotter embed.
|
|
3125
|
+
* @param - `query`: Text string in Natural Language format
|
|
3126
|
+
* @param - `executeSearch`: Boolean to execute search and update search query
|
|
3127
|
+
* @example
|
|
3128
|
+
* ```js
|
|
3129
|
+
* spotterEmbed.trigger(HostEvent.SpotterSearch, {
|
|
3130
|
+
* query: 'revenue per year',
|
|
3131
|
+
* executeSearch: true,
|
|
3132
|
+
* })
|
|
3133
|
+
* ```
|
|
3134
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3135
|
+
*/
|
|
3136
|
+
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
3137
|
+
/**
|
|
3138
|
+
* Edits the last prompt in spotter embed.
|
|
3139
|
+
* @param - `query`: Text string
|
|
3140
|
+
* @example
|
|
3141
|
+
* ```js
|
|
3142
|
+
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
|
|
3143
|
+
* ```
|
|
3144
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3145
|
+
*/
|
|
3146
|
+
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
3147
|
+
/**
|
|
3148
|
+
* Opens the Worksheet preview modal in Spotter Embed.
|
|
3149
|
+
* @example
|
|
3150
|
+
* ```js
|
|
3151
|
+
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
3152
|
+
* ```
|
|
3153
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3154
|
+
*/
|
|
3155
|
+
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
3156
|
+
/**
|
|
3157
|
+
* Resets the Spotter Embed Conversation.
|
|
3158
|
+
* @example
|
|
3159
|
+
* ```js
|
|
3160
|
+
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
3161
|
+
* ```
|
|
3162
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3163
|
+
*/
|
|
3164
|
+
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
3165
|
+
/**
|
|
3166
|
+
* Deletes the last prompt in spotter embed.
|
|
3167
|
+
* @example
|
|
3168
|
+
* ```js
|
|
3169
|
+
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
3170
|
+
* ```
|
|
3171
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3172
|
+
*/
|
|
3173
|
+
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
3174
|
+
/**
|
|
3175
|
+
* Toggle the visualization to chart or table view.
|
|
3176
|
+
* @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
|
|
3177
|
+
* @example
|
|
3178
|
+
* ```js
|
|
3179
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
|
|
3180
|
+
* vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
|
|
3181
|
+
* });
|
|
3182
|
+
*```
|
|
3183
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3184
|
+
*/
|
|
3185
|
+
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
2922
3186
|
/**
|
|
2923
3187
|
* @hidden
|
|
2924
3188
|
* Trigger exit from presentation mode when user exits fullscreen.
|
|
@@ -2929,6 +3193,30 @@
|
|
|
2929
3193
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2930
3194
|
*/
|
|
2931
3195
|
HostEvent["ExitPresentMode"] = "exitPresentMode";
|
|
3196
|
+
/**
|
|
3197
|
+
* Triggers the full height lazy load data.
|
|
3198
|
+
* @example
|
|
3199
|
+
* ```js
|
|
3200
|
+
* liveboardEmbed.on(EmbedEvent.RequestVisibleEmbedCoordinates, (payload) => {
|
|
3201
|
+
* console.log(payload);
|
|
3202
|
+
* });
|
|
3203
|
+
* ```
|
|
3204
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
3205
|
+
*
|
|
3206
|
+
* @hidden
|
|
3207
|
+
*/
|
|
3208
|
+
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
3209
|
+
/**
|
|
3210
|
+
* Trigger the *Ask Spotter* action for visualizations
|
|
3211
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
3212
|
+
* @example
|
|
3213
|
+
* ```js
|
|
3214
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter,
|
|
3215
|
+
* {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
|
|
3216
|
+
* ```
|
|
3217
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3218
|
+
*/
|
|
3219
|
+
HostEvent["AskSpotter"] = "AskSpotter";
|
|
2932
3220
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
2933
3221
|
/**
|
|
2934
3222
|
* The different visual modes that the data sources panel within
|
|
@@ -3034,6 +3322,7 @@
|
|
|
3034
3322
|
Param["Query"] = "query";
|
|
3035
3323
|
Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
|
|
3036
3324
|
Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
|
|
3325
|
+
Param["ListPageVersion"] = "listpageVersion";
|
|
3037
3326
|
Param["PendoTrackingKey"] = "additionalPendoKey";
|
|
3038
3327
|
Param["LiveboardHeaderSticky"] = "isLiveboardHeaderSticky";
|
|
3039
3328
|
Param["IsProductTour"] = "isProductTour";
|
|
@@ -3068,10 +3357,12 @@
|
|
|
3068
3357
|
Param["DataSourceId"] = "dataSourceId";
|
|
3069
3358
|
Param["preAuthCache"] = "preAuthCache";
|
|
3070
3359
|
Param["ShowSpotterLimitations"] = "showSpotterLimitations";
|
|
3071
|
-
Param["CoverAndFilterOptionInPDF"] = "
|
|
3360
|
+
Param["CoverAndFilterOptionInPDF"] = "arePdfCoverFilterPageCheckboxesEnabled";
|
|
3072
3361
|
Param["PrimaryAction"] = "primaryAction";
|
|
3073
3362
|
Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
|
|
3074
3363
|
Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
|
|
3364
|
+
Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
|
|
3365
|
+
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3075
3366
|
})(Param || (Param = {}));
|
|
3076
3367
|
/**
|
|
3077
3368
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -4294,6 +4585,22 @@
|
|
|
4294
4585
|
* @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
|
|
4295
4586
|
*/
|
|
4296
4587
|
Action["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
|
|
4588
|
+
/**
|
|
4589
|
+
* Action ID for hide or disable the
|
|
4590
|
+
* Spotter in conversation training widget.
|
|
4591
|
+
* The Add to Coaching feature is currently in beta
|
|
4592
|
+
* and is disabled by default on embed deployments.
|
|
4593
|
+
* To enable this feature on your instance,
|
|
4594
|
+
* contact ThoughtSpot Support.
|
|
4595
|
+
* @example
|
|
4596
|
+
* ```js
|
|
4597
|
+
* hiddenAction: [Action.InConversationTraining]
|
|
4598
|
+
* disabledActions: [Action.InConversationTraining]
|
|
4599
|
+
*
|
|
4600
|
+
* ```
|
|
4601
|
+
* @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
|
|
4602
|
+
*/
|
|
4603
|
+
Action["InConversationTraining"] = "InConversationTraining";
|
|
4297
4604
|
})(exports.Action || (exports.Action = {}));
|
|
4298
4605
|
exports.PrefetchFeatures = void 0;
|
|
4299
4606
|
(function (PrefetchFeatures) {
|
|
@@ -6760,6 +7067,7 @@
|
|
|
6760
7067
|
CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
|
|
6761
7068
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
6762
7069
|
RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
|
|
7070
|
+
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
6763
7071
|
};
|
|
6764
7072
|
|
|
6765
7073
|
const EndPoints = {
|
|
@@ -6967,13 +7275,14 @@
|
|
|
6967
7275
|
*
|
|
6968
7276
|
* @example
|
|
6969
7277
|
* ```js
|
|
7278
|
+
* import { getInitConfig } from '@thoughtspot/visual-embed-sdk';
|
|
7279
|
+
* // Call the getInitConfig method to retrieve the embed configuration
|
|
6970
7280
|
* const config = getInitConfig();
|
|
7281
|
+
* // Log the configuration settings
|
|
6971
7282
|
* console.log(config);
|
|
6972
7283
|
* ```
|
|
6973
|
-
*
|
|
6974
|
-
*
|
|
6975
|
-
* Returns the `EmbedConfig` object, which
|
|
6976
|
-
* contains the configuration settings used to
|
|
7284
|
+
* Returns the link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[EmbedConfig]
|
|
7285
|
+
* object, which contains the configuration settings used to
|
|
6977
7286
|
* initialize the SDK, including the following:
|
|
6978
7287
|
*
|
|
6979
7288
|
* - `thoughtSpotHost` - ThoughtSpot host URL
|
|
@@ -6982,9 +7291,10 @@
|
|
|
6982
7291
|
* - `customizations` - Style, text, and icon customization settings
|
|
6983
7292
|
* that were applied during the SDK initialization.
|
|
6984
7293
|
*
|
|
6985
|
-
*
|
|
6986
|
-
*
|
|
7294
|
+
* The following JSON output shows the embed configuration
|
|
7295
|
+
* settings returned from the code in the previous example:
|
|
6987
7296
|
*
|
|
7297
|
+
* @example
|
|
6988
7298
|
* ```json
|
|
6989
7299
|
* {
|
|
6990
7300
|
* "thoughtSpotHost": "https://{ThoughtSpot-Host}",
|
|
@@ -7006,7 +7316,7 @@
|
|
|
7006
7316
|
* "authTriggerContainer": "#your-own-div"
|
|
7007
7317
|
* }
|
|
7008
7318
|
* ```
|
|
7009
|
-
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.
|
|
7319
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw, and later
|
|
7010
7320
|
* @group Global methods
|
|
7011
7321
|
*/
|
|
7012
7322
|
const getEmbedConfig = () => getValueFromWindow(configKey) || {};
|
|
@@ -15548,7 +15858,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15548
15858
|
return e;
|
|
15549
15859
|
}
|
|
15550
15860
|
|
|
15551
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
15861
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.40.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
15552
15862
|
|
|
15553
15863
|
/**
|
|
15554
15864
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15571,7 +15881,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15571
15881
|
* @param channel
|
|
15572
15882
|
*/
|
|
15573
15883
|
function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
|
|
15574
|
-
|
|
15884
|
+
var _a;
|
|
15885
|
+
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
|
|
15575
15886
|
}
|
|
15576
15887
|
const TRIGGER_TIMEOUT = 30000;
|
|
15577
15888
|
/**
|
|
@@ -16956,7 +17267,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16956
17267
|
/**
|
|
16957
17268
|
* Pages within the ThoughtSpot app that can be embedded.
|
|
16958
17269
|
*/
|
|
16959
|
-
// eslint-disable-next-line no-shadow
|
|
16960
17270
|
exports.Page = void 0;
|
|
16961
17271
|
(function (Page) {
|
|
16962
17272
|
/**
|
|
@@ -17042,16 +17352,46 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17042
17352
|
*/
|
|
17043
17353
|
HomePage["Modular"] = "v2";
|
|
17044
17354
|
})(exports.HomePage || (exports.HomePage = {}));
|
|
17355
|
+
/**
|
|
17356
|
+
* Define the version of the list page
|
|
17357
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
|
|
17358
|
+
*/
|
|
17359
|
+
exports.ListPage = void 0;
|
|
17360
|
+
(function (ListPage) {
|
|
17361
|
+
/**
|
|
17362
|
+
* List (v2) is the traditional List Experience.
|
|
17363
|
+
* It serves as the foundational version of the list page.
|
|
17364
|
+
*/
|
|
17365
|
+
ListPage["List"] = "v2";
|
|
17366
|
+
/**
|
|
17367
|
+
* ListWithUXChanges (v3) introduces the new updated list page with UX changes.
|
|
17368
|
+
*/
|
|
17369
|
+
ListPage["ListWithUXChanges"] = "v3";
|
|
17370
|
+
})(exports.ListPage || (exports.ListPage = {}));
|
|
17045
17371
|
/**
|
|
17046
17372
|
* Embeds full ThoughtSpot experience in a host application.
|
|
17047
17373
|
* @group Embed components
|
|
17048
17374
|
*/
|
|
17049
17375
|
class AppEmbed extends V1Embed {
|
|
17050
|
-
// eslint-disable-next-line no-useless-constructor
|
|
17051
17376
|
constructor(domSelector, viewConfig) {
|
|
17052
17377
|
viewConfig.embedComponentType = 'AppEmbed';
|
|
17053
17378
|
super(domSelector, viewConfig);
|
|
17054
17379
|
this.defaultHeight = '100%';
|
|
17380
|
+
this.sendFullHeightLazyLoadData = () => {
|
|
17381
|
+
const data = calculateVisibleElementData(this.iFrame);
|
|
17382
|
+
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
17383
|
+
};
|
|
17384
|
+
/**
|
|
17385
|
+
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
17386
|
+
* It is used to send the visible coordinates data to the host application.
|
|
17387
|
+
* @param data The event payload
|
|
17388
|
+
* @param responder The responder function
|
|
17389
|
+
*/
|
|
17390
|
+
this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
|
|
17391
|
+
logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
17392
|
+
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
|
|
17393
|
+
responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
17394
|
+
};
|
|
17055
17395
|
/**
|
|
17056
17396
|
* Set the iframe height as per the computed height received
|
|
17057
17397
|
* from the ThoughtSpot app.
|
|
@@ -17060,6 +17400,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17060
17400
|
this.updateIFrameHeight = (data) => {
|
|
17061
17401
|
var _a;
|
|
17062
17402
|
this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
|
|
17403
|
+
this.sendFullHeightLazyLoadData();
|
|
17063
17404
|
};
|
|
17064
17405
|
this.embedIframeCenter = (data, responder) => {
|
|
17065
17406
|
const obj = this.getIframeCenter();
|
|
@@ -17089,6 +17430,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17089
17430
|
this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
17090
17431
|
this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
17091
17432
|
this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
17433
|
+
this.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
|
|
17092
17434
|
}
|
|
17093
17435
|
}
|
|
17094
17436
|
/**
|
|
@@ -17096,9 +17438,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17096
17438
|
* embedded Liveboard or visualization.
|
|
17097
17439
|
*/
|
|
17098
17440
|
getEmbedParams() {
|
|
17099
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
17100
|
-
/* eslint-disable-next-line max-len */
|
|
17101
|
-
dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17441
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17102
17442
|
let params = {};
|
|
17103
17443
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
17104
17444
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -17114,6 +17454,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17114
17454
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
17115
17455
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17116
17456
|
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
17457
|
+
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
17117
17458
|
params = this.getBaseQueryParams(params);
|
|
17118
17459
|
if (hideObjectSearch) {
|
|
17119
17460
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
@@ -17126,6 +17467,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17126
17467
|
}
|
|
17127
17468
|
if (fullHeight === true) {
|
|
17128
17469
|
params[Param.fullHeight] = true;
|
|
17470
|
+
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
17471
|
+
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
17472
|
+
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
17473
|
+
}
|
|
17129
17474
|
}
|
|
17130
17475
|
if (tag) {
|
|
17131
17476
|
params[Param.Tag] = tag;
|
|
@@ -17146,7 +17491,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17146
17491
|
params[Param.enableAskSage] = enableAskSage;
|
|
17147
17492
|
}
|
|
17148
17493
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
17149
|
-
/* eslint-disable-next-line max-len */
|
|
17150
17494
|
params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
17151
17495
|
}
|
|
17152
17496
|
if (homePageSearchBarMode) {
|
|
@@ -17167,11 +17511,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17167
17511
|
=== exports.DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
|
|
17168
17512
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
17169
17513
|
=== exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
|
|
17170
|
-
/* eslint-disable-next-line max-len */
|
|
17171
17514
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
17172
17515
|
}
|
|
17173
17516
|
else {
|
|
17174
|
-
/* eslint-disable-next-line max-len */
|
|
17175
17517
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
17176
17518
|
}
|
|
17177
17519
|
if (discoveryExperience) {
|
|
@@ -17184,6 +17526,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17184
17526
|
if (discoveryExperience.homePage === exports.HomePage.Modular) {
|
|
17185
17527
|
params[Param.ModularHomeExperienceEnabled] = true;
|
|
17186
17528
|
}
|
|
17529
|
+
// listPageVersion v3 will enable the new list page
|
|
17530
|
+
if (discoveryExperience.listPageVersion === exports.ListPage.ListWithUXChanges) {
|
|
17531
|
+
params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
|
|
17532
|
+
}
|
|
17187
17533
|
}
|
|
17188
17534
|
const queryParams = getQueryParamString(params, true);
|
|
17189
17535
|
return queryParams;
|
|
@@ -17271,6 +17617,30 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17271
17617
|
this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
|
|
17272
17618
|
}
|
|
17273
17619
|
}
|
|
17620
|
+
/**
|
|
17621
|
+
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
17622
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
17623
|
+
*/
|
|
17624
|
+
destroy() {
|
|
17625
|
+
super.destroy();
|
|
17626
|
+
this.unregisterLazyLoadEvents();
|
|
17627
|
+
}
|
|
17628
|
+
postRender() {
|
|
17629
|
+
this.registerLazyLoadEvents();
|
|
17630
|
+
}
|
|
17631
|
+
registerLazyLoadEvents() {
|
|
17632
|
+
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
17633
|
+
// TODO: Use passive: true, install modernizr to check for passive
|
|
17634
|
+
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
17635
|
+
window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
17636
|
+
}
|
|
17637
|
+
}
|
|
17638
|
+
unregisterLazyLoadEvents() {
|
|
17639
|
+
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
17640
|
+
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
17641
|
+
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
17642
|
+
}
|
|
17643
|
+
}
|
|
17274
17644
|
/**
|
|
17275
17645
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
17276
17646
|
* @param renderOptions An object containing the page ID
|
|
@@ -17280,6 +17650,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17280
17650
|
await super.render();
|
|
17281
17651
|
const src = this.getIFrameSrc();
|
|
17282
17652
|
await this.renderV1Embed(src);
|
|
17653
|
+
this.postRender();
|
|
17283
17654
|
return this;
|
|
17284
17655
|
}
|
|
17285
17656
|
}
|
|
@@ -17321,7 +17692,7 @@ query GetEurekaVizSnapshots(
|
|
|
17321
17692
|
return;
|
|
17322
17693
|
}
|
|
17323
17694
|
const previewStyles = `
|
|
17324
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
|
|
17695
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css" integrity="sha384-PvEsKa6emq5KYa9mf+Q7eYF5C2OCacYzZ+hBngp21NA4o1A9iU9smnytEmqUFbEZ" crossorigin="anonymous">
|
|
17325
17696
|
<style id="ts-preview-style">
|
|
17326
17697
|
.ts-viz-preview-loader {
|
|
17327
17698
|
position: absolute;
|
|
@@ -17384,6 +17755,21 @@ query GetEurekaVizSnapshots(
|
|
|
17384
17755
|
viewConfig.embedComponentType = 'LiveboardEmbed';
|
|
17385
17756
|
super(domSelector, viewConfig);
|
|
17386
17757
|
this.defaultHeight = 500;
|
|
17758
|
+
this.sendFullHeightLazyLoadData = () => {
|
|
17759
|
+
const data = calculateVisibleElementData(this.iFrame);
|
|
17760
|
+
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
17761
|
+
};
|
|
17762
|
+
/**
|
|
17763
|
+
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
17764
|
+
* It is used to send the visible coordinates data to the host application.
|
|
17765
|
+
* @param data The event payload
|
|
17766
|
+
* @param responder The responder function
|
|
17767
|
+
*/
|
|
17768
|
+
this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
|
|
17769
|
+
logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
17770
|
+
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
|
|
17771
|
+
responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
17772
|
+
};
|
|
17387
17773
|
/**
|
|
17388
17774
|
* Set the iframe height as per the computed height received
|
|
17389
17775
|
* from the ThoughtSpot app.
|
|
@@ -17391,6 +17777,7 @@ query GetEurekaVizSnapshots(
|
|
|
17391
17777
|
*/
|
|
17392
17778
|
this.updateIFrameHeight = (data) => {
|
|
17393
17779
|
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
17780
|
+
this.sendFullHeightLazyLoadData();
|
|
17394
17781
|
};
|
|
17395
17782
|
this.embedIframeCenter = (data, responder) => {
|
|
17396
17783
|
const obj = this.getIframeCenter();
|
|
@@ -17424,6 +17811,7 @@ query GetEurekaVizSnapshots(
|
|
|
17424
17811
|
this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
17425
17812
|
this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
17426
17813
|
this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
17814
|
+
this.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
|
|
17427
17815
|
}
|
|
17428
17816
|
}
|
|
17429
17817
|
/**
|
|
@@ -17433,11 +17821,15 @@ query GetEurekaVizSnapshots(
|
|
|
17433
17821
|
getEmbedParams() {
|
|
17434
17822
|
let params = {};
|
|
17435
17823
|
params = this.getBaseQueryParams(params);
|
|
17436
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17824
|
+
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17437
17825
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
17438
17826
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
17439
17827
|
if (fullHeight === true) {
|
|
17440
17828
|
params[Param.fullHeight] = true;
|
|
17829
|
+
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
17830
|
+
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
17831
|
+
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
17832
|
+
}
|
|
17441
17833
|
}
|
|
17442
17834
|
if (defaultHeight) {
|
|
17443
17835
|
this.defaultHeight = defaultHeight;
|
|
@@ -17485,9 +17877,6 @@ query GetEurekaVizSnapshots(
|
|
|
17485
17877
|
if (dataSourceId !== undefined) {
|
|
17486
17878
|
params[Param.DataSourceId] = dataSourceId;
|
|
17487
17879
|
}
|
|
17488
|
-
if (coverAndFilterOptionInPDF !== undefined) {
|
|
17489
|
-
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17490
|
-
}
|
|
17491
17880
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
17492
17881
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
17493
17882
|
}
|
|
@@ -17498,6 +17887,7 @@ query GetEurekaVizSnapshots(
|
|
|
17498
17887
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17499
17888
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
17500
17889
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17890
|
+
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17501
17891
|
const queryParams = getQueryParamString(params, true);
|
|
17502
17892
|
return queryParams;
|
|
17503
17893
|
}
|
|
@@ -17595,6 +17985,30 @@ query GetEurekaVizSnapshots(
|
|
|
17595
17985
|
}
|
|
17596
17986
|
return super.trigger(messageType, dataWithVizId);
|
|
17597
17987
|
}
|
|
17988
|
+
/**
|
|
17989
|
+
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
17990
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
17991
|
+
*/
|
|
17992
|
+
destroy() {
|
|
17993
|
+
super.destroy();
|
|
17994
|
+
this.unregisterLazyLoadEvents();
|
|
17995
|
+
}
|
|
17996
|
+
postRender() {
|
|
17997
|
+
this.registerLazyLoadEvents();
|
|
17998
|
+
}
|
|
17999
|
+
registerLazyLoadEvents() {
|
|
18000
|
+
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
18001
|
+
// TODO: Use passive: true, install modernizr to check for passive
|
|
18002
|
+
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
18003
|
+
window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
|
|
18004
|
+
}
|
|
18005
|
+
}
|
|
18006
|
+
unregisterLazyLoadEvents() {
|
|
18007
|
+
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
18008
|
+
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
18009
|
+
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
18010
|
+
}
|
|
18011
|
+
}
|
|
17598
18012
|
/**
|
|
17599
18013
|
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
17600
18014
|
* @param renderOptions An object specifying the Liveboard ID,
|
|
@@ -17605,6 +18019,7 @@ query GetEurekaVizSnapshots(
|
|
|
17605
18019
|
const src = this.getIFrameSrc();
|
|
17606
18020
|
await this.renderV1Embed(src);
|
|
17607
18021
|
this.showPreviewLoader();
|
|
18022
|
+
this.postRender();
|
|
17608
18023
|
return this;
|
|
17609
18024
|
}
|
|
17610
18025
|
navigateToLiveboard(liveboardId, vizId, activeTabId) {
|
|
@@ -18256,7 +18671,13 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18256
18671
|
});
|
|
18257
18672
|
const data = responses[0].data;
|
|
18258
18673
|
return {
|
|
18259
|
-
|
|
18674
|
+
convId: this.conversationId,
|
|
18675
|
+
messageId: responses[0].msgId,
|
|
18676
|
+
data: {
|
|
18677
|
+
...data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
|
|
18678
|
+
convId: this.conversationId,
|
|
18679
|
+
messageId: responses[0].msgId,
|
|
18680
|
+
},
|
|
18260
18681
|
error: null,
|
|
18261
18682
|
};
|
|
18262
18683
|
}
|
|
@@ -18282,7 +18703,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18282
18703
|
}
|
|
18283
18704
|
getIframeSrc() {
|
|
18284
18705
|
var _a;
|
|
18285
|
-
const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
|
|
18706
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
18286
18707
|
const path = 'conv-assist-answer';
|
|
18287
18708
|
const queryParams = this.getBaseQueryParams();
|
|
18288
18709
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
@@ -18297,6 +18718,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18297
18718
|
genNo,
|
|
18298
18719
|
acSessionId,
|
|
18299
18720
|
acGenNo,
|
|
18721
|
+
convId,
|
|
18722
|
+
messageId,
|
|
18300
18723
|
});
|
|
18301
18724
|
return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
|
|
18302
18725
|
}
|
|
@@ -18338,11 +18761,10 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18338
18761
|
return { error };
|
|
18339
18762
|
}
|
|
18340
18763
|
const container = document.createElement('div');
|
|
18341
|
-
if (this.viewConfig.containerClassName) {
|
|
18342
|
-
container.className = this.viewConfig.containerClassName;
|
|
18343
|
-
}
|
|
18344
18764
|
const embed = new ConversationMessage(container, {
|
|
18345
18765
|
...this.viewConfig,
|
|
18766
|
+
convId: data.convId,
|
|
18767
|
+
messageId: data.messageId,
|
|
18346
18768
|
sessionId: data.sessionId,
|
|
18347
18769
|
genNo: data.genNo,
|
|
18348
18770
|
acSessionId: data.stateKey.transactionId,
|
|
@@ -18351,6 +18773,30 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18351
18773
|
await embed.render();
|
|
18352
18774
|
return { container, viz: embed };
|
|
18353
18775
|
}
|
|
18776
|
+
/**
|
|
18777
|
+
* Send a message to the conversation service and return only the data.
|
|
18778
|
+
* @param userMessage - The message to send to the conversation service.
|
|
18779
|
+
* @returns The data from the conversation service.
|
|
18780
|
+
*/
|
|
18781
|
+
async sendMessageData(userMessage) {
|
|
18782
|
+
try {
|
|
18783
|
+
const { data, error } = await this.conversationService.sendMessage(userMessage);
|
|
18784
|
+
if (error) {
|
|
18785
|
+
return { error };
|
|
18786
|
+
}
|
|
18787
|
+
return { data: {
|
|
18788
|
+
convId: data.convId,
|
|
18789
|
+
messageId: data.messageId,
|
|
18790
|
+
sessionId: data.sessionId,
|
|
18791
|
+
genNo: data.genNo,
|
|
18792
|
+
acSessionId: data.stateKey.transactionId,
|
|
18793
|
+
acGenNo: data.stateKey.generationNumber,
|
|
18794
|
+
} };
|
|
18795
|
+
}
|
|
18796
|
+
catch (error) {
|
|
18797
|
+
return { error: error };
|
|
18798
|
+
}
|
|
18799
|
+
}
|
|
18354
18800
|
}
|
|
18355
18801
|
/**
|
|
18356
18802
|
* Create a conversation embed, which can be integrated inside
|