@thoughtspot/visual-embed-sdk 1.46.4 → 1.46.5
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 +3 -3
- package/cjs/src/auth.d.ts +2 -1
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +2 -1
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/authToken.d.ts.map +1 -1
- package/cjs/src/authToken.js.map +1 -1
- package/cjs/src/css-variables.d.ts +87 -17
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +41 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +25 -36
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +35 -23
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/base.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +23 -1
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +18 -33
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +129 -97
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/events.spec.js +72 -0
- package/cjs/src/embed/events.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +105 -3
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +9 -0
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +28 -0
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +106 -9
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +327 -6
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts +22 -0
- package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.js +51 -0
- package/cjs/src/embed/hostEventClient/utils.js.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/cjs/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js +115 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js.map +1 -0
- package/cjs/src/embed/liveboard.d.ts +18 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +10 -3
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +54 -2
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/spotter-utils.d.ts +20 -0
- package/cjs/src/embed/spotter-utils.d.ts.map +1 -0
- package/cjs/src/embed/spotter-utils.js +52 -0
- package/cjs/src/embed/spotter-utils.js.map +1 -0
- package/cjs/src/embed/spotter-utils.spec.d.ts +2 -0
- package/cjs/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/cjs/src/embed/spotter-utils.spec.js +54 -0
- package/cjs/src/embed/spotter-utils.spec.js.map +1 -0
- package/cjs/src/embed/ts-embed.d.ts +41 -2
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +54 -3
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/errors.d.ts +2 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +2 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +58 -53
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/types.d.ts +832 -33
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +835 -3
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts +4 -2
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.js +4 -2
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/cjs/src/utils/graphql/preview-service.d.ts.map +1 -1
- package/cjs/src/utils/graphql/preview-service.js.map +1 -1
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils.d.ts +0 -9
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +1 -10
- package/cjs/src/utils.js.map +1 -1
- package/dist/index-ChNydfIz.js +7371 -0
- package/dist/index-DW2wEHqy.js +7371 -0
- package/dist/src/auth.d.ts +2 -1
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/authToken.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +87 -17
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +41 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +23 -1
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +105 -3
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +28 -0
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts +22 -0
- package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/dist/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/dist/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/dist/src/embed/liveboard.d.ts +18 -0
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/spotter-utils.d.ts +20 -0
- package/dist/src/embed/spotter-utils.d.ts.map +1 -0
- package/dist/src/embed/spotter-utils.spec.d.ts +2 -0
- package/dist/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/dist/src/embed/ts-embed.d.ts +41 -2
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +2 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +832 -33
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts +4 -2
- package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/dist/src/utils/graphql/preview-service.d.ts.map +1 -1
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/src/utils.d.ts +0 -9
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +1208 -154
- package/dist/tsembed-react.js +1206 -152
- package/dist/tsembed.es.js +1150 -101
- package/dist/tsembed.js +1148 -99
- package/dist/visual-embed-sdk-react-full.d.ts +1156 -55
- package/dist/visual-embed-sdk-react.d.ts +1156 -55
- package/dist/visual-embed-sdk.d.ts +1179 -60
- package/lib/package.json +3 -3
- package/lib/src/auth.d.ts +2 -1
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +2 -1
- package/lib/src/auth.js.map +1 -1
- package/lib/src/authToken.d.ts.map +1 -1
- package/lib/src/authToken.js.map +1 -1
- package/lib/src/css-variables.d.ts +87 -17
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +41 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +27 -38
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +35 -23
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/base.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +23 -1
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +19 -34
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +131 -99
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/events.spec.js +73 -1
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +105 -3
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +9 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +28 -0
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +106 -9
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +327 -6
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts +22 -0
- package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/utils.js +43 -0
- package/lib/src/embed/hostEventClient/utils.js.map +1 -0
- package/lib/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/lib/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/utils.spec.js +113 -0
- package/lib/src/embed/hostEventClient/utils.spec.js.map +1 -0
- package/lib/src/embed/liveboard.d.ts +18 -0
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +10 -3
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +54 -2
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/spotter-utils.d.ts +20 -0
- package/lib/src/embed/spotter-utils.d.ts.map +1 -0
- package/lib/src/embed/spotter-utils.js +47 -0
- package/lib/src/embed/spotter-utils.js.map +1 -0
- package/lib/src/embed/spotter-utils.spec.d.ts +2 -0
- package/lib/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/lib/src/embed/spotter-utils.spec.js +52 -0
- package/lib/src/embed/spotter-utils.spec.js.map +1 -0
- package/lib/src/embed/ts-embed.d.ts +41 -2
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +55 -4
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/errors.d.ts +2 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +2 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +58 -53
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/types.d.ts +832 -33
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +835 -3
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts +4 -2
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.js +4 -2
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/lib/src/utils/graphql/preview-service.d.ts.map +1 -1
- package/lib/src/utils/graphql/preview-service.js.map +1 -1
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils.d.ts +0 -9
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +0 -8
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +1179 -60
- package/package.json +3 -3
- package/src/auth.spec.ts +1 -1
- package/src/auth.ts +2 -1
- package/src/authToken.ts +0 -1
- package/src/css-variables.ts +96 -17
- package/src/embed/app.spec.ts +48 -30
- package/src/embed/app.ts +59 -54
- package/src/embed/base.spec.ts +1 -2
- package/src/embed/base.ts +1 -4
- package/src/embed/conversation.spec.ts +150 -119
- package/src/embed/conversation.ts +30 -54
- package/src/embed/events.spec.ts +88 -0
- package/src/embed/hostEventClient/contracts.ts +105 -2
- package/src/embed/hostEventClient/host-event-client.spec.ts +504 -6
- package/src/embed/hostEventClient/host-event-client.ts +146 -15
- package/src/embed/hostEventClient/utils.spec.ts +137 -0
- package/src/embed/hostEventClient/utils.ts +61 -0
- package/src/embed/liveboard.spec.ts +71 -2
- package/src/embed/liveboard.ts +29 -2
- package/src/embed/sage.ts +0 -1
- package/src/embed/search.spec.ts +0 -2
- package/src/embed/spotter-utils.spec.ts +56 -0
- package/src/embed/spotter-utils.ts +65 -0
- package/src/embed/ts-embed.ts +58 -4
- package/src/errors.ts +2 -0
- package/src/react/index.tsx +76 -72
- package/src/types.ts +843 -31
- package/src/utils/graphql/answerService/answerService.ts +4 -5
- package/src/utils/graphql/preview-service.ts +0 -1
- package/src/utils/processData.ts +0 -5
- package/src/utils.ts +0 -14
package/dist/tsembed-react.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.46.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.46.5 */
|
|
2
2
|
'use client';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef, useCallback } from 'react';
|
|
@@ -238,6 +238,7 @@ var AuthType;
|
|
|
238
238
|
* @deprecated This option is deprecated.
|
|
239
239
|
* @hidden
|
|
240
240
|
*/
|
|
241
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
241
242
|
AuthType["SAML"] = "SSO_SAML";
|
|
242
243
|
/**
|
|
243
244
|
* SSO using SAML
|
|
@@ -283,6 +284,7 @@ var AuthType;
|
|
|
283
284
|
* });
|
|
284
285
|
* ```
|
|
285
286
|
*/
|
|
287
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
286
288
|
AuthType["SAMLRedirect"] = "SSO_SAML";
|
|
287
289
|
/**
|
|
288
290
|
* SSO using OIDC
|
|
@@ -296,6 +298,7 @@ var AuthType;
|
|
|
296
298
|
* Will make the host application redirect to the OIDC IdP.
|
|
297
299
|
* See code samples in {@link SAMLRedirect}.
|
|
298
300
|
*/
|
|
301
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
299
302
|
AuthType["OIDCRedirect"] = "SSO_OIDC";
|
|
300
303
|
/**
|
|
301
304
|
* Trusted authentication server
|
|
@@ -321,6 +324,7 @@ var AuthType;
|
|
|
321
324
|
* });
|
|
322
325
|
* ```
|
|
323
326
|
*/
|
|
327
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
324
328
|
AuthType["TrustedAuthToken"] = "AuthServer";
|
|
325
329
|
/**
|
|
326
330
|
* Trusted authentication server Cookieless, Use your own authentication
|
|
@@ -1057,6 +1061,17 @@ var EmbedEvent;
|
|
|
1057
1061
|
* ```
|
|
1058
1062
|
*/
|
|
1059
1063
|
EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
|
|
1064
|
+
/**
|
|
1065
|
+
* Emitted when the Download Liveboard as Continuous PDF action is triggered
|
|
1066
|
+
* on a Liveboard.
|
|
1067
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1068
|
+
* @example
|
|
1069
|
+
* ```js
|
|
1070
|
+
* liveboardEmbed.on(EmbedEvent.DownloadLiveboardAsContinuousPDF, payload => {
|
|
1071
|
+
* console.log('download liveboard as continuous PDF', payload)})
|
|
1072
|
+
* ```
|
|
1073
|
+
*/
|
|
1074
|
+
EmbedEvent["DownloadLiveboardAsContinuousPDF"] = "downloadLiveboardAsContinuousPDF";
|
|
1060
1075
|
/**
|
|
1061
1076
|
* Emitted when an Answer is deleted in the app
|
|
1062
1077
|
* Use start:true to subscribe to when delete is initiated, or end:true to subscribe
|
|
@@ -1460,22 +1475,45 @@ var EmbedEvent;
|
|
|
1460
1475
|
/**
|
|
1461
1476
|
* Emitted when name, status (private or public) or filter values of a
|
|
1462
1477
|
* Personalised view is updated.
|
|
1478
|
+
* This event is deprecated. Use {@link EmbedEvent.UpdatePersonalizedView} instead.
|
|
1463
1479
|
* @returns viewName: string
|
|
1464
1480
|
* @returns viewId: string
|
|
1465
1481
|
* @returns liveboardId: string
|
|
1466
1482
|
* @returns isPublic: boolean
|
|
1467
1483
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
|
|
1484
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1468
1485
|
*/
|
|
1469
1486
|
EmbedEvent["UpdatePersonalisedView"] = "updatePersonalisedView";
|
|
1487
|
+
/**
|
|
1488
|
+
* Emitted when name, status (private or public) or filter values of a
|
|
1489
|
+
* Personalized view is updated.
|
|
1490
|
+
* @returns viewName: string
|
|
1491
|
+
* @returns viewId: string
|
|
1492
|
+
* @returns liveboardId: string
|
|
1493
|
+
* @returns isPublic: boolean
|
|
1494
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1495
|
+
*/
|
|
1496
|
+
EmbedEvent["UpdatePersonalizedView"] = "updatePersonalisedView";
|
|
1470
1497
|
/**
|
|
1471
1498
|
* Emitted when a Personalised view is saved.
|
|
1499
|
+
* This event is deprecated. Use {@link EmbedEvent.SavePersonalizedView} instead.
|
|
1472
1500
|
* @returns viewName: string
|
|
1473
1501
|
* @returns viewId: string
|
|
1474
1502
|
* @returns liveboardId: string
|
|
1475
1503
|
* @returns isPublic: boolean
|
|
1476
1504
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
|
|
1505
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1477
1506
|
*/
|
|
1478
1507
|
EmbedEvent["SavePersonalisedView"] = "savePersonalisedView";
|
|
1508
|
+
/**
|
|
1509
|
+
* Emitted when a Personalized view is saved.
|
|
1510
|
+
* @returns viewName: string
|
|
1511
|
+
* @returns viewId: string
|
|
1512
|
+
* @returns liveboardId: string
|
|
1513
|
+
* @returns isPublic: boolean
|
|
1514
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1515
|
+
*/
|
|
1516
|
+
EmbedEvent["SavePersonalizedView"] = "savePersonalisedView";
|
|
1479
1517
|
/**
|
|
1480
1518
|
* Emitted when a Liveboard is reset.
|
|
1481
1519
|
* @returns viewName: string
|
|
@@ -1487,11 +1525,41 @@ var EmbedEvent;
|
|
|
1487
1525
|
EmbedEvent["ResetLiveboard"] = "resetLiveboard";
|
|
1488
1526
|
/**
|
|
1489
1527
|
* Emitted when a PersonalisedView is deleted.
|
|
1528
|
+
* This event is deprecated. Use {@link EmbedEvent.DeletePersonalizedView} instead.
|
|
1490
1529
|
* @returns views: string[]
|
|
1491
1530
|
* @returns liveboardId: string
|
|
1492
1531
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
|
|
1532
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1493
1533
|
*/
|
|
1494
1534
|
EmbedEvent["DeletePersonalisedView"] = "deletePersonalisedView";
|
|
1535
|
+
/**
|
|
1536
|
+
* Emitted when a PersonalizedView is deleted.
|
|
1537
|
+
* @returns views: string[]
|
|
1538
|
+
* @returns liveboardId: string
|
|
1539
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1540
|
+
*/
|
|
1541
|
+
EmbedEvent["DeletePersonalizedView"] = "deletePersonalisedView";
|
|
1542
|
+
/**
|
|
1543
|
+
* Emitted when a user selects a different Personalized View or
|
|
1544
|
+
* resets to the original/default view on a Liveboard.
|
|
1545
|
+
* @example
|
|
1546
|
+
* ```js
|
|
1547
|
+
* liveboardEmbed.on(EmbedEvent.ChangePersonalizedView, (data) => {
|
|
1548
|
+
* console.log(data.viewName); // 'Q4 Revenue' or 'Original View'
|
|
1549
|
+
* console.log(data.viewId); // '2a021a12-...' or null (default)
|
|
1550
|
+
* console.log(data.liveboardId); // 'abc123...'
|
|
1551
|
+
* console.log(data.isPublic); // true | false
|
|
1552
|
+
* })
|
|
1553
|
+
* ```
|
|
1554
|
+
* @returns viewName: string - Name of the selected view,
|
|
1555
|
+
* or 'Original View' when reset to default.
|
|
1556
|
+
* @returns viewId: string | null - GUID of the selected view,
|
|
1557
|
+
* or null when reset to default.
|
|
1558
|
+
* @returns liveboardId: string
|
|
1559
|
+
* @returns isPublic: boolean
|
|
1560
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1561
|
+
*/
|
|
1562
|
+
EmbedEvent["ChangePersonalizedView"] = "changePersonalisedView";
|
|
1495
1563
|
/**
|
|
1496
1564
|
* Emitted when a user creates a Worksheet.
|
|
1497
1565
|
* @version SDK: 1.27.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
@@ -1525,7 +1593,8 @@ var EmbedEvent;
|
|
|
1525
1593
|
* @param - Includes the following parameters:
|
|
1526
1594
|
* - `payload`: The payload received from the embed related to the Data API call.
|
|
1527
1595
|
* - `responder`: Contains elements that let developers define whether ThoughtSpot
|
|
1528
|
-
* will run or block the search operation, and if blocked, which error message to
|
|
1596
|
+
* will run or block the search operation, and if blocked, which error message to
|
|
1597
|
+
* provide.
|
|
1529
1598
|
* - `execute` - When `execute` returns `true`, the search is run.
|
|
1530
1599
|
* When `execute` returns `false`, the search is not executed.
|
|
1531
1600
|
* - `error` - Developers can customize the user-facing error message when `execute`
|
|
@@ -1959,6 +2028,25 @@ var EmbedEvent;
|
|
|
1959
2028
|
* );
|
|
1960
2029
|
* }
|
|
1961
2030
|
* ```
|
|
2031
|
+
*
|
|
2032
|
+
* **Context Parameter (SDK: 1.45.2+)**
|
|
2033
|
+
*
|
|
2034
|
+
* Starting from SDK version 1.45.2 | ThoughtSpot: 26.3.0.cl, you can optionally pass a
|
|
2035
|
+
* `ContextType` as the third parameter to the `trigger` method to specify the context
|
|
2036
|
+
* from which the event is triggered. This helps ThoughtSpot understand the current page
|
|
2037
|
+
* context (Search, Answer, Liveboard, or Spotter) for better event handling.
|
|
2038
|
+
*
|
|
2039
|
+
* @example
|
|
2040
|
+
* ```js
|
|
2041
|
+
* import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2042
|
+
*
|
|
2043
|
+
* // Trigger Pin event with Search context
|
|
2044
|
+
* appEmbed.trigger(HostEvent.Pin, {
|
|
2045
|
+
* vizId: "123",
|
|
2046
|
+
* liveboardId: "456"
|
|
2047
|
+
* }, ContextType.Search);
|
|
2048
|
+
* ```
|
|
2049
|
+
*
|
|
1962
2050
|
* @group Events
|
|
1963
2051
|
*/
|
|
1964
2052
|
var HostEvent;
|
|
@@ -1981,6 +2069,16 @@ var HostEvent;
|
|
|
1981
2069
|
execute: true
|
|
1982
2070
|
});
|
|
1983
2071
|
* ```
|
|
2072
|
+
* @example
|
|
2073
|
+
* ```js
|
|
2074
|
+
* // Trigger search from search context
|
|
2075
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2076
|
+
* appEmbed.trigger(HostEvent.Search, {
|
|
2077
|
+
* searchQuery: "[revenue] by [region]",
|
|
2078
|
+
* dataSources: ["cd252e5c-b552-49a8-821d-3eadaa049cca"],
|
|
2079
|
+
* execute: true
|
|
2080
|
+
* }, ContextType.Search);
|
|
2081
|
+
* ```
|
|
1984
2082
|
*/
|
|
1985
2083
|
HostEvent["Search"] = "search";
|
|
1986
2084
|
/**
|
|
@@ -2031,6 +2129,24 @@ var HostEvent;
|
|
|
2031
2129
|
* });
|
|
2032
2130
|
* })
|
|
2033
2131
|
* ```
|
|
2132
|
+
* @example
|
|
2133
|
+
* ```js
|
|
2134
|
+
* // Drill down from answer context
|
|
2135
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2136
|
+
* appEmbed.trigger(HostEvent.DrillDown, {
|
|
2137
|
+
* points: { clickedPoint, selectedPoints },
|
|
2138
|
+
* autoDrillDown: true
|
|
2139
|
+
* }, ContextType.Answer);
|
|
2140
|
+
* ```
|
|
2141
|
+
* @example
|
|
2142
|
+
* ```js
|
|
2143
|
+
* // Drill down from search context
|
|
2144
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2145
|
+
* searchEmbed.trigger(HostEvent.DrillDown, {
|
|
2146
|
+
* points: { clickedPoint, selectedPoints },
|
|
2147
|
+
* columnGuid: "column-guid"
|
|
2148
|
+
* }, ContextType.Search);
|
|
2149
|
+
* ```
|
|
2034
2150
|
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
2035
2151
|
*/
|
|
2036
2152
|
HostEvent["DrillDown"] = "triggerDrillDown";
|
|
@@ -2051,6 +2167,13 @@ var HostEvent;
|
|
|
2051
2167
|
* const url = embed.trigger(HostEvent.GetIframeUrl);
|
|
2052
2168
|
* console.log("iFrameURL",url);
|
|
2053
2169
|
* ```
|
|
2170
|
+
* @example
|
|
2171
|
+
* ```js
|
|
2172
|
+
* // Get iframe URL from specific context
|
|
2173
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2174
|
+
* const url = await appEmbed.trigger(HostEvent.GetIframeUrl, {}, ContextType.Answer);
|
|
2175
|
+
* console.log("iFrameURL", url);
|
|
2176
|
+
* ```
|
|
2054
2177
|
* @version SDK: 1.35.0 | ThoughtSpot: 10.4.0.cl
|
|
2055
2178
|
*/
|
|
2056
2179
|
HostEvent["GetIframeUrl"] = "GetIframeUrl";
|
|
@@ -2064,6 +2187,15 @@ var HostEvent;
|
|
|
2064
2187
|
* '730496d6-6903-4601-937e-2c691821af3c',
|
|
2065
2188
|
* 'd547ec54-2a37-4516-a222-2b06719af726'])
|
|
2066
2189
|
* ```
|
|
2190
|
+
* @example
|
|
2191
|
+
* ```js
|
|
2192
|
+
* // Set visible vizs from liveboard context
|
|
2193
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2194
|
+
* liveboardEmbed.trigger(HostEvent.SetVisibleVizs, [
|
|
2195
|
+
* '730496d6-6903-4601-937e-2c691821af3c',
|
|
2196
|
+
* 'd547ec54-2a37-4516-a222-2b06719af726'
|
|
2197
|
+
* ], ContextType.Liveboard);
|
|
2198
|
+
* ```
|
|
2067
2199
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
2068
2200
|
*/
|
|
2069
2201
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
@@ -2076,6 +2208,14 @@ var HostEvent;
|
|
|
2076
2208
|
* tabId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2077
2209
|
* })
|
|
2078
2210
|
* ```
|
|
2211
|
+
* @example
|
|
2212
|
+
* ```js
|
|
2213
|
+
* // Set active tab from liveboard context
|
|
2214
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2215
|
+
* liveboardEmbed.trigger(HostEvent.SetActiveTab, {
|
|
2216
|
+
* tabId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2217
|
+
* }, ContextType.Liveboard);
|
|
2218
|
+
* ```
|
|
2079
2219
|
* @version SDK: 1.24.0 | ThoughtSpot: 9.5.0.cl, 9.5.1-sw
|
|
2080
2220
|
*/
|
|
2081
2221
|
HostEvent["SetActiveTab"] = "SetActiveTab";
|
|
@@ -2109,6 +2249,15 @@ var HostEvent;
|
|
|
2109
2249
|
* {columnName: "item type",operator: RuntimeFilterOp.EQ,values: ["Jackets"]}
|
|
2110
2250
|
* ])
|
|
2111
2251
|
* ```
|
|
2252
|
+
* @example
|
|
2253
|
+
* ```js
|
|
2254
|
+
* // Update runtime filters from liveboard context
|
|
2255
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2256
|
+
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
2257
|
+
* {columnName: "region", operator: RuntimeFilterOp.EQ, values: ["west"]},
|
|
2258
|
+
* {columnName: "product", operator: RuntimeFilterOp.IN, values: ["shoes", "boots"]}
|
|
2259
|
+
* ], ContextType.Liveboard);
|
|
2260
|
+
* ```
|
|
2112
2261
|
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
|
|
2113
2262
|
* @important
|
|
2114
2263
|
*/
|
|
@@ -2142,6 +2291,14 @@ var HostEvent;
|
|
|
2142
2291
|
* LiveboardEmbed.trigger(HostEvent.OpenFilter,
|
|
2143
2292
|
* { column: {columnId: '<column-GUID>'}})
|
|
2144
2293
|
* ```
|
|
2294
|
+
* @example
|
|
2295
|
+
* ```js
|
|
2296
|
+
* // Open filter from search context
|
|
2297
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2298
|
+
* searchEmbed.trigger(HostEvent.OpenFilter, {
|
|
2299
|
+
* column: { columnId: '<column-GUID>', name: 'region', type: 'ATTRIBUTE', dataType: 'CHAR'}
|
|
2300
|
+
* }, ContextType.Search);
|
|
2301
|
+
* ```
|
|
2145
2302
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2146
2303
|
*/
|
|
2147
2304
|
HostEvent["OpenFilter"] = "openFilter";
|
|
@@ -2152,6 +2309,14 @@ var HostEvent;
|
|
|
2152
2309
|
* ```js
|
|
2153
2310
|
* searchEmbed.trigger(HostEvent.AddColumns, { columnIds: ['<column-GUID>','<column-GUID>'] })
|
|
2154
2311
|
* ```
|
|
2312
|
+
* @example
|
|
2313
|
+
* ```js
|
|
2314
|
+
* // Add columns from search context
|
|
2315
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2316
|
+
* searchEmbed.trigger(HostEvent.AddColumns, {
|
|
2317
|
+
* columnIds: ['col-guid-1', 'col-guid-2']
|
|
2318
|
+
* }, ContextType.Search);
|
|
2319
|
+
* ```
|
|
2155
2320
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2156
2321
|
*/
|
|
2157
2322
|
HostEvent["AddColumns"] = "addColumns";
|
|
@@ -2162,6 +2327,14 @@ var HostEvent;
|
|
|
2162
2327
|
* ```js
|
|
2163
2328
|
* searchEmbed.trigger(HostEvent.RemoveColumn, { columnId: '<column-Guid>' })
|
|
2164
2329
|
* ```
|
|
2330
|
+
* @example
|
|
2331
|
+
* ```js
|
|
2332
|
+
* // Remove column from search context
|
|
2333
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2334
|
+
* searchEmbed.trigger(HostEvent.RemoveColumn, {
|
|
2335
|
+
* columnId: 'column-guid'
|
|
2336
|
+
* }, ContextType.Search);
|
|
2337
|
+
* ```
|
|
2165
2338
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2166
2339
|
*/
|
|
2167
2340
|
HostEvent["RemoveColumn"] = "removeColumn";
|
|
@@ -2248,6 +2421,37 @@ var HostEvent;
|
|
|
2248
2421
|
*
|
|
2249
2422
|
* spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
|
|
2250
2423
|
* ```
|
|
2424
|
+
* @example
|
|
2425
|
+
* ```js
|
|
2426
|
+
* // Using context parameter to specify the context type (SDK: 1.45.2+)
|
|
2427
|
+
* // Pin from a search answer context
|
|
2428
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2429
|
+
* appEmbed.trigger(HostEvent.Pin, {
|
|
2430
|
+
* vizId: "123",
|
|
2431
|
+
* newVizName: "Sales by region",
|
|
2432
|
+
* liveboardId: "456"
|
|
2433
|
+
* }, ContextType.Search);
|
|
2434
|
+
* ```
|
|
2435
|
+
* @example
|
|
2436
|
+
* ```js
|
|
2437
|
+
* // Pin from an answer context (explore modal/page) (SDK: 1.45.2+)
|
|
2438
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2439
|
+
* appEmbed.trigger(HostEvent.Pin, {
|
|
2440
|
+
* vizId: "789",
|
|
2441
|
+
* newVizName: "Revenue trends",
|
|
2442
|
+
* liveboardId: "456"
|
|
2443
|
+
* }, ContextType.Answer);
|
|
2444
|
+
* ```
|
|
2445
|
+
* @example
|
|
2446
|
+
* ```js
|
|
2447
|
+
* // Pin from a spotter context (SDK: 1.45.2+)
|
|
2448
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2449
|
+
* appEmbed.trigger(HostEvent.Pin, {
|
|
2450
|
+
* vizId: latestSpotterVizId,
|
|
2451
|
+
* newVizName: "AI-generated insights",
|
|
2452
|
+
* liveboardId: "456"
|
|
2453
|
+
* }, ContextType.Spotter);
|
|
2454
|
+
* ```
|
|
2251
2455
|
*
|
|
2252
2456
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2253
2457
|
*/
|
|
@@ -2258,6 +2462,12 @@ var HostEvent;
|
|
|
2258
2462
|
* @example
|
|
2259
2463
|
* ```js
|
|
2260
2464
|
* liveboardEmbed.trigger(HostEvent.LiveboardInfo)
|
|
2465
|
+
*```
|
|
2466
|
+
* @example
|
|
2467
|
+
* ```js
|
|
2468
|
+
* // Show liveboard info from liveboard context
|
|
2469
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2470
|
+
* liveboardEmbed.trigger(HostEvent.LiveboardInfo, {}, ContextType.Liveboard);
|
|
2261
2471
|
* ```
|
|
2262
2472
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2263
2473
|
*/
|
|
@@ -2268,6 +2478,12 @@ var HostEvent;
|
|
|
2268
2478
|
* ```js
|
|
2269
2479
|
* liveboardEmbed.trigger(HostEvent.Schedule)
|
|
2270
2480
|
* ```
|
|
2481
|
+
* @example
|
|
2482
|
+
* ```js
|
|
2483
|
+
* // Schedule from liveboard context
|
|
2484
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2485
|
+
* liveboardEmbed.trigger(HostEvent.Schedule, {}, ContextType.Liveboard);
|
|
2486
|
+
* ```
|
|
2271
2487
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2272
2488
|
*/
|
|
2273
2489
|
HostEvent["Schedule"] = "subscription";
|
|
@@ -2277,6 +2493,12 @@ var HostEvent;
|
|
|
2277
2493
|
* ```js
|
|
2278
2494
|
* liveboardEmbed.trigger(HostEvent.ScheduleList)
|
|
2279
2495
|
* ```
|
|
2496
|
+
* @example
|
|
2497
|
+
* ```js
|
|
2498
|
+
* // Manage schedules from liveboard context
|
|
2499
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2500
|
+
* liveboardEmbed.trigger(HostEvent.ScheduleList, {}, ContextType.Liveboard);
|
|
2501
|
+
* ```
|
|
2280
2502
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2281
2503
|
*/
|
|
2282
2504
|
HostEvent["SchedulesList"] = "schedule-list";
|
|
@@ -2287,6 +2509,18 @@ var HostEvent;
|
|
|
2287
2509
|
* ```js
|
|
2288
2510
|
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
2289
2511
|
* ```
|
|
2512
|
+
* @example
|
|
2513
|
+
* ```js
|
|
2514
|
+
* // Export TML from liveboard context
|
|
2515
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2516
|
+
* liveboardEmbed.trigger(HostEvent.ExportTML, {}, ContextType.Liveboard);
|
|
2517
|
+
* ```
|
|
2518
|
+
* @example
|
|
2519
|
+
* ```js
|
|
2520
|
+
* // Export TML from search-answer context
|
|
2521
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2522
|
+
* appEmbed.trigger(HostEvent.ExportTML, {}, ContextType.Search);
|
|
2523
|
+
* ```
|
|
2290
2524
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2291
2525
|
*/
|
|
2292
2526
|
HostEvent["ExportTML"] = "exportTSL";
|
|
@@ -2297,6 +2531,18 @@ var HostEvent;
|
|
|
2297
2531
|
* ```js
|
|
2298
2532
|
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
2299
2533
|
* ```
|
|
2534
|
+
* @example
|
|
2535
|
+
* ```js
|
|
2536
|
+
* // Edit TML from liveboard context
|
|
2537
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2538
|
+
* liveboardEmbed.trigger(HostEvent.EditTML, {}, ContextType.Liveboard);
|
|
2539
|
+
* ```
|
|
2540
|
+
* @example
|
|
2541
|
+
* ```js
|
|
2542
|
+
* // Edit TML from search-answer context
|
|
2543
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2544
|
+
* appEmbed.trigger(HostEvent.EditTML, {}, ContextType.Search);
|
|
2545
|
+
* ```
|
|
2300
2546
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2301
2547
|
*/
|
|
2302
2548
|
HostEvent["EditTML"] = "editTSL";
|
|
@@ -2306,6 +2552,12 @@ var HostEvent;
|
|
|
2306
2552
|
* ```js
|
|
2307
2553
|
* liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
2308
2554
|
* ```
|
|
2555
|
+
* @example
|
|
2556
|
+
* ```js
|
|
2557
|
+
* // Update TML from liveboard context
|
|
2558
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2559
|
+
* liveboardEmbed.trigger(HostEvent.UpdateTML, {}, ContextType.Liveboard);
|
|
2560
|
+
* ```
|
|
2309
2561
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2310
2562
|
*/
|
|
2311
2563
|
HostEvent["UpdateTML"] = "updateTSL";
|
|
@@ -2332,10 +2584,34 @@ var HostEvent;
|
|
|
2332
2584
|
*
|
|
2333
2585
|
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
|
|
2334
2586
|
* ```
|
|
2587
|
+
* @example
|
|
2588
|
+
* ```js
|
|
2589
|
+
* // Download as PDF from search-answer context
|
|
2590
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2591
|
+
* appEmbed.trigger(HostEvent.DownloadAsPdf, {}, ContextType.Search);
|
|
2592
|
+
* ```
|
|
2593
|
+
* @example
|
|
2594
|
+
* ```js
|
|
2595
|
+
* // Download as PDF from liveboard context
|
|
2596
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2597
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsPdf, {}, ContextType.Liveboard);
|
|
2598
|
+
* ```
|
|
2335
2599
|
*
|
|
2336
2600
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2337
2601
|
*/
|
|
2338
2602
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
2603
|
+
/**
|
|
2604
|
+
* Trigger the **Download Liveboard as Continuous PDF** action on an
|
|
2605
|
+
* embedded Liveboard.
|
|
2606
|
+
*
|
|
2607
|
+
* @example
|
|
2608
|
+
* ```js
|
|
2609
|
+
* liveboardEmbed.trigger(HostEvent.DownloadLiveboardAsContinuousPDF)
|
|
2610
|
+
* ```
|
|
2611
|
+
*
|
|
2612
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
2613
|
+
*/
|
|
2614
|
+
HostEvent["DownloadLiveboardAsContinuousPDF"] = "downloadLiveboardAsContinuousPDF";
|
|
2339
2615
|
/**
|
|
2340
2616
|
* Trigger the **AI Highlights** action on an embedded Liveboard
|
|
2341
2617
|
*
|
|
@@ -2376,6 +2652,18 @@ var HostEvent;
|
|
|
2376
2652
|
*
|
|
2377
2653
|
* spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
|
|
2378
2654
|
* ```
|
|
2655
|
+
* @example
|
|
2656
|
+
* ```js
|
|
2657
|
+
* // Make a copy from answer context
|
|
2658
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2659
|
+
* appEmbed.trigger(HostEvent.MakeACopy, {}, ContextType.Answer);
|
|
2660
|
+
* ```
|
|
2661
|
+
* @example
|
|
2662
|
+
* ```js
|
|
2663
|
+
* // Make a copy from search context
|
|
2664
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2665
|
+
* appEmbed.trigger(HostEvent.MakeACopy, {}, ContextType.Search);
|
|
2666
|
+
* ```
|
|
2379
2667
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2380
2668
|
*/
|
|
2381
2669
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2400,6 +2688,14 @@ var HostEvent;
|
|
|
2400
2688
|
* ```js
|
|
2401
2689
|
* liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2402
2690
|
* ```
|
|
2691
|
+
* @example
|
|
2692
|
+
* ```js
|
|
2693
|
+
* // Explore from liveboard context
|
|
2694
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2695
|
+
* liveboardEmbed.trigger(HostEvent.Explore, {
|
|
2696
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2697
|
+
* }, ContextType.Liveboard);
|
|
2698
|
+
* ```
|
|
2403
2699
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2404
2700
|
*/
|
|
2405
2701
|
HostEvent["Explore"] = "explore";
|
|
@@ -2417,6 +2713,20 @@ var HostEvent;
|
|
|
2417
2713
|
* ```js
|
|
2418
2714
|
* searchEmbed.trigger(HostEvent.CreateMonitor)
|
|
2419
2715
|
* ```
|
|
2716
|
+
* @example
|
|
2717
|
+
* ```js
|
|
2718
|
+
* // Create monitor from answer context
|
|
2719
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2720
|
+
* appEmbed.trigger(HostEvent.CreateMonitor, {}, ContextType.Answer);
|
|
2721
|
+
* ```
|
|
2722
|
+
* @example
|
|
2723
|
+
* ```js
|
|
2724
|
+
* // Create monitor from liveboard context
|
|
2725
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2726
|
+
* liveboardEmbed.trigger(HostEvent.CreateMonitor, {
|
|
2727
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2728
|
+
* }, ContextType.Liveboard);
|
|
2729
|
+
* ```
|
|
2420
2730
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2421
2731
|
*/
|
|
2422
2732
|
HostEvent["CreateMonitor"] = "createMonitor";
|
|
@@ -2438,6 +2748,20 @@ var HostEvent;
|
|
|
2438
2748
|
* ```js
|
|
2439
2749
|
* vizEmbed.trigger(HostEvent.ManageMonitor)
|
|
2440
2750
|
* ```
|
|
2751
|
+
* @example
|
|
2752
|
+
* ```js
|
|
2753
|
+
* // Manage monitor from answer context
|
|
2754
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2755
|
+
* appEmbed.trigger(HostEvent.ManageMonitor, {}, ContextType.Answer);
|
|
2756
|
+
* ```
|
|
2757
|
+
* @example
|
|
2758
|
+
* ```js
|
|
2759
|
+
* // Manage monitor from liveboard context
|
|
2760
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2761
|
+
* liveboardEmbed.trigger(HostEvent.ManageMonitor, {
|
|
2762
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2763
|
+
* }, ContextType.Liveboard);
|
|
2764
|
+
* ```
|
|
2441
2765
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2442
2766
|
*/
|
|
2443
2767
|
HostEvent["ManageMonitor"] = "manageMonitor";
|
|
@@ -2463,6 +2787,26 @@ var HostEvent;
|
|
|
2463
2787
|
* ```js
|
|
2464
2788
|
* spotterEmbed.trigger(HostEvent.Edit);
|
|
2465
2789
|
* ```
|
|
2790
|
+
* @example
|
|
2791
|
+
* ```js
|
|
2792
|
+
* // Using context parameter to edit liveboard context
|
|
2793
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2794
|
+
* liveboardEmbed.trigger(HostEvent.Edit, {}, ContextType.Liveboard);
|
|
2795
|
+
* ```
|
|
2796
|
+
* @example
|
|
2797
|
+
* ```js
|
|
2798
|
+
* // Edit from search context
|
|
2799
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2800
|
+
* appEmbed.trigger(HostEvent.Edit, {}, ContextType.Search);
|
|
2801
|
+
* ```
|
|
2802
|
+
* * @example
|
|
2803
|
+
* ```js
|
|
2804
|
+
* // Edit from spotter context
|
|
2805
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2806
|
+
* appEmbed.trigger(HostEvent.Edit, {
|
|
2807
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2808
|
+
* }, ContextType.Spotter);
|
|
2809
|
+
* ```
|
|
2466
2810
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2467
2811
|
*/
|
|
2468
2812
|
HostEvent["Edit"] = "edit";
|
|
@@ -2480,6 +2824,34 @@ var HostEvent;
|
|
|
2480
2824
|
* ```js
|
|
2481
2825
|
* vizEmbed.trigger(HostEvent.CopyLink)
|
|
2482
2826
|
* ```
|
|
2827
|
+
* @example
|
|
2828
|
+
* ```js
|
|
2829
|
+
* // Copy link from liveboard context
|
|
2830
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2831
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink, {}, ContextType.Liveboard);
|
|
2832
|
+
* ```
|
|
2833
|
+
* @example
|
|
2834
|
+
* ```js
|
|
2835
|
+
* // Copy link from liveboard visualization context
|
|
2836
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2837
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink, {
|
|
2838
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2839
|
+
* }, ContextType.Liveboard);
|
|
2840
|
+
* ```
|
|
2841
|
+
* @example
|
|
2842
|
+
* ```js
|
|
2843
|
+
* // Copy link from liveboard context
|
|
2844
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2845
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink, {}, ContextType.Liveboard);
|
|
2846
|
+
* ```
|
|
2847
|
+
* @example
|
|
2848
|
+
* ```js
|
|
2849
|
+
* // Copy link from liveboard visualization context
|
|
2850
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2851
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink, {
|
|
2852
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2853
|
+
* }, ContextType.Liveboard);
|
|
2854
|
+
* ```
|
|
2483
2855
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2484
2856
|
*/
|
|
2485
2857
|
HostEvent["CopyLink"] = "embedDocument";
|
|
@@ -2497,6 +2869,34 @@ var HostEvent;
|
|
|
2497
2869
|
* ```js
|
|
2498
2870
|
* vizEmbed.trigger(HostEvent.Present)
|
|
2499
2871
|
* ```
|
|
2872
|
+
* @example
|
|
2873
|
+
* ```js
|
|
2874
|
+
* // Present from liveboard visualization context
|
|
2875
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2876
|
+
* liveboardEmbed.trigger(HostEvent.Present, {
|
|
2877
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2878
|
+
* }, ContextType.Liveboard);
|
|
2879
|
+
* ```
|
|
2880
|
+
* @example
|
|
2881
|
+
* ```js
|
|
2882
|
+
* // Present from liveboard context
|
|
2883
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2884
|
+
* liveboardEmbed.trigger(HostEvent.Present, {}, ContextType.Liveboard);
|
|
2885
|
+
* ```
|
|
2886
|
+
* @example
|
|
2887
|
+
* ```js
|
|
2888
|
+
* // Present from liveboard visualization context
|
|
2889
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2890
|
+
* liveboardEmbed.trigger(HostEvent.Present, {
|
|
2891
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2892
|
+
* }, ContextType.Liveboard);
|
|
2893
|
+
* ```
|
|
2894
|
+
* @example
|
|
2895
|
+
* ```js
|
|
2896
|
+
* // Present from liveboard context
|
|
2897
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2898
|
+
* liveboardEmbed.trigger(HostEvent.Present, {}, ContextType.Liveboard);
|
|
2899
|
+
* ```
|
|
2500
2900
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2501
2901
|
*/
|
|
2502
2902
|
HostEvent["Present"] = "present";
|
|
@@ -2525,6 +2925,22 @@ var HostEvent;
|
|
|
2525
2925
|
* tml.answer.search_query // TML representation of the search query
|
|
2526
2926
|
* );
|
|
2527
2927
|
* })
|
|
2928
|
+
* ```
|
|
2929
|
+
* @example
|
|
2930
|
+
* ```js
|
|
2931
|
+
* // Get TML from search context
|
|
2932
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2933
|
+
* appEmbed.trigger(HostEvent.GetTML, {}, ContextType.Search).then((tml) => {
|
|
2934
|
+
* console.log(tml.answer.search_query);
|
|
2935
|
+
* });
|
|
2936
|
+
* ```
|
|
2937
|
+
* @example
|
|
2938
|
+
* ```js
|
|
2939
|
+
* // Get TML from search-answer context
|
|
2940
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2941
|
+
* appEmbed.trigger(HostEvent.GetTML, {}, ContextType.Search).then((tml) => {
|
|
2942
|
+
* console.log(tml.answer);
|
|
2943
|
+
* });
|
|
2528
2944
|
* ```
|
|
2529
2945
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2530
2946
|
* @important
|
|
@@ -2546,6 +2962,20 @@ var HostEvent;
|
|
|
2546
2962
|
* ```js
|
|
2547
2963
|
* searchEmbed.trigger(HostEvent.ShowUnderlyingData)
|
|
2548
2964
|
* ```
|
|
2965
|
+
* @example
|
|
2966
|
+
* ```js
|
|
2967
|
+
* // Show underlying data from liveboard visualization context
|
|
2968
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2969
|
+
* appEmbed.trigger(HostEvent.ShowUnderlyingData, {
|
|
2970
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2971
|
+
* }, ContextType.Liveboard);
|
|
2972
|
+
* ```
|
|
2973
|
+
* @example
|
|
2974
|
+
* ```js
|
|
2975
|
+
* // Show underlying data from search context
|
|
2976
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2977
|
+
* appEmbed.trigger(HostEvent.ShowUnderlyingData, {}, ContextType.Search);
|
|
2978
|
+
* ```
|
|
2549
2979
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2550
2980
|
*/
|
|
2551
2981
|
HostEvent["ShowUnderlyingData"] = "showUnderlyingData";
|
|
@@ -2563,6 +2993,18 @@ var HostEvent;
|
|
|
2563
2993
|
* ```js
|
|
2564
2994
|
* searchEmbed.trigger(HostEvent.Delete)
|
|
2565
2995
|
* ```
|
|
2996
|
+
* @example
|
|
2997
|
+
* ```js
|
|
2998
|
+
* // Delete from liveboard context
|
|
2999
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3000
|
+
* liveboardEmbed.trigger(HostEvent.Delete, {}, ContextType.Liveboard);
|
|
3001
|
+
* ```
|
|
3002
|
+
* @example
|
|
3003
|
+
* ```js
|
|
3004
|
+
* // Delete from search context
|
|
3005
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3006
|
+
* appEmbed.trigger(HostEvent.Delete, {}, ContextType.Search);
|
|
3007
|
+
* ```
|
|
2566
3008
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2567
3009
|
*/
|
|
2568
3010
|
HostEvent["Delete"] = "onDeleteAnswer";
|
|
@@ -2583,6 +3025,20 @@ var HostEvent;
|
|
|
2583
3025
|
* ```js
|
|
2584
3026
|
* searchEmbed.trigger(HostEvent.SpotIQAnalyze)
|
|
2585
3027
|
* ```
|
|
3028
|
+
* @example
|
|
3029
|
+
* ```js
|
|
3030
|
+
* // SpotIQ analyze from search-answer context
|
|
3031
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3032
|
+
* appEmbed.trigger(HostEvent.SpotIQAnalyze, { vizId: '730496d6-6903-4601-937e-2c691821af3c' }, ContextType.Search);
|
|
3033
|
+
* ```
|
|
3034
|
+
* @example
|
|
3035
|
+
* ```js
|
|
3036
|
+
* // SpotIQ analyze from search context
|
|
3037
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3038
|
+
* liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {
|
|
3039
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
3040
|
+
* }, ContextType.Liveboard);
|
|
3041
|
+
* ```
|
|
2586
3042
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2587
3043
|
*/
|
|
2588
3044
|
HostEvent["SpotIQAnalyze"] = "spotIQAnalyze";
|
|
@@ -2634,9 +3090,16 @@ var HostEvent;
|
|
|
2634
3090
|
*
|
|
2635
3091
|
* spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
|
|
2636
3092
|
* ```
|
|
3093
|
+
* @example
|
|
3094
|
+
* ```js
|
|
3095
|
+
* // Download as PNG from search-answer context
|
|
3096
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3097
|
+
* appEmbed.trigger(HostEvent.DownloadAsPng, {}, ContextType.Search);
|
|
3098
|
+
* ```
|
|
2637
3099
|
*
|
|
2638
3100
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
2639
3101
|
*/
|
|
3102
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
2640
3103
|
HostEvent["DownloadAsPng"] = "downloadAsPng";
|
|
2641
3104
|
/**
|
|
2642
3105
|
* Trigger the **Download** > **CSV** action on tables in
|
|
@@ -2662,6 +3125,18 @@ var HostEvent;
|
|
|
2662
3125
|
*
|
|
2663
3126
|
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
|
|
2664
3127
|
* ```
|
|
3128
|
+
* @example
|
|
3129
|
+
* ```js
|
|
3130
|
+
* // Download as CSV from search-answer context
|
|
3131
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3132
|
+
* appEmbed.trigger(HostEvent.DownloadAsCsv, {}, ContextType.Search);
|
|
3133
|
+
* ```
|
|
3134
|
+
* @example
|
|
3135
|
+
* ```js
|
|
3136
|
+
* // Download as CSV from search context
|
|
3137
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3138
|
+
* searchEmbed.trigger(HostEvent.DownloadAsCsv, {}, ContextType.Search);
|
|
3139
|
+
* ```
|
|
2665
3140
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2666
3141
|
*/
|
|
2667
3142
|
HostEvent["DownloadAsCsv"] = "downloadAsCSV";
|
|
@@ -2689,6 +3164,18 @@ var HostEvent;
|
|
|
2689
3164
|
*
|
|
2690
3165
|
* spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
|
|
2691
3166
|
* ```
|
|
3167
|
+
* @example
|
|
3168
|
+
* ```js
|
|
3169
|
+
* // Download as XLSX from answer context
|
|
3170
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3171
|
+
* appEmbed.trigger(HostEvent.DownloadAsXlsx, {}, ContextType.Answer);
|
|
3172
|
+
* ```
|
|
3173
|
+
* @example
|
|
3174
|
+
* ```js
|
|
3175
|
+
* // Download as XLSX from search context
|
|
3176
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3177
|
+
* searchEmbed.trigger(HostEvent.DownloadAsXlsx, {}, ContextType.Search);
|
|
3178
|
+
* ```
|
|
2692
3179
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2693
3180
|
*/
|
|
2694
3181
|
HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
@@ -2702,6 +3189,18 @@ var HostEvent;
|
|
|
2702
3189
|
* ```js
|
|
2703
3190
|
* searchEmbed.trigger(HostEvent.Share)
|
|
2704
3191
|
* ```
|
|
3192
|
+
* @example
|
|
3193
|
+
* ```js
|
|
3194
|
+
* // Share from Liveboard context
|
|
3195
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3196
|
+
* liveboardEmbed.trigger(HostEvent.Share, {}, ContextType.Liveboard);
|
|
3197
|
+
* ```
|
|
3198
|
+
* @example
|
|
3199
|
+
* ```js
|
|
3200
|
+
* // Share from search-answer context
|
|
3201
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3202
|
+
* appEmbed.trigger(HostEvent.Share, {}, ContextType.Search);
|
|
3203
|
+
* ```
|
|
2705
3204
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2706
3205
|
*/
|
|
2707
3206
|
HostEvent["Share"] = "share";
|
|
@@ -2741,6 +3240,18 @@ var HostEvent;
|
|
|
2741
3240
|
*
|
|
2742
3241
|
* spotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });
|
|
2743
3242
|
* ```
|
|
3243
|
+
* @example
|
|
3244
|
+
* ```js
|
|
3245
|
+
* // Save from answer context
|
|
3246
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3247
|
+
* appEmbed.trigger(HostEvent.Save, {}, ContextType.Answer);
|
|
3248
|
+
* ```
|
|
3249
|
+
* @example
|
|
3250
|
+
* ```js
|
|
3251
|
+
* // Save from search context
|
|
3252
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3253
|
+
* searchEmbed.trigger(HostEvent.Save, {}, ContextType.Search);
|
|
3254
|
+
* ```
|
|
2744
3255
|
*
|
|
2745
3256
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2746
3257
|
*/
|
|
@@ -2757,6 +3268,20 @@ var HostEvent;
|
|
|
2757
3268
|
* ```js
|
|
2758
3269
|
* vizEmbed.trigger(HostEvent.SyncToSheets)
|
|
2759
3270
|
* ```
|
|
3271
|
+
* @example
|
|
3272
|
+
* ```js
|
|
3273
|
+
* // Sync to sheets from answer context
|
|
3274
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3275
|
+
* appEmbed.trigger(HostEvent.SyncToSheets, {}, ContextType.Answer);
|
|
3276
|
+
* ```
|
|
3277
|
+
* @example
|
|
3278
|
+
* ```js
|
|
3279
|
+
* // Sync to sheets from liveboard context
|
|
3280
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3281
|
+
* liveboardEmbed.trigger(HostEvent.SyncToSheets, {
|
|
3282
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
3283
|
+
* }, ContextType.Liveboard);
|
|
3284
|
+
* ```
|
|
2760
3285
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2761
3286
|
*/
|
|
2762
3287
|
HostEvent["SyncToSheets"] = "sync-to-sheets";
|
|
@@ -2773,6 +3298,20 @@ var HostEvent;
|
|
|
2773
3298
|
* ```js
|
|
2774
3299
|
* vizEmbed.trigger(HostEvent.SyncToOtherApps)
|
|
2775
3300
|
* ```
|
|
3301
|
+
* @example
|
|
3302
|
+
* ```js
|
|
3303
|
+
* // Sync to other apps from answer context
|
|
3304
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3305
|
+
* appEmbed.trigger(HostEvent.SyncToOtherApps, {}, ContextType.Answer);
|
|
3306
|
+
* ```
|
|
3307
|
+
* @example
|
|
3308
|
+
* ```js
|
|
3309
|
+
* // Sync to other apps from liveboard context
|
|
3310
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3311
|
+
* liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {
|
|
3312
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
3313
|
+
* }, ContextType.Liveboard);
|
|
3314
|
+
* ```
|
|
2776
3315
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2777
3316
|
*/
|
|
2778
3317
|
HostEvent["SyncToOtherApps"] = "sync-to-other-apps";
|
|
@@ -2789,6 +3328,20 @@ var HostEvent;
|
|
|
2789
3328
|
* ```js
|
|
2790
3329
|
* vizEmbed.trigger(HostEvent.ManagePipelines)
|
|
2791
3330
|
* ```
|
|
3331
|
+
* @example
|
|
3332
|
+
* ```js
|
|
3333
|
+
* // Manage pipelines from answer context
|
|
3334
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3335
|
+
* appEmbed.trigger(HostEvent.ManagePipelines, {}, ContextType.Answer);
|
|
3336
|
+
* ```
|
|
3337
|
+
* @example
|
|
3338
|
+
* ```js
|
|
3339
|
+
* // Manage pipelines from liveboard context
|
|
3340
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3341
|
+
* liveboardEmbed.trigger(HostEvent.ManagePipelines, {
|
|
3342
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
3343
|
+
* }, ContextType.Liveboard);
|
|
3344
|
+
* ```
|
|
2792
3345
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2793
3346
|
*/
|
|
2794
3347
|
HostEvent["ManagePipelines"] = "manage-pipeline";
|
|
@@ -2801,6 +3354,12 @@ var HostEvent;
|
|
|
2801
3354
|
* ```js
|
|
2802
3355
|
* appEmbed.trigger(HostEvent.ResetSearch)
|
|
2803
3356
|
* ```
|
|
3357
|
+
* @example
|
|
3358
|
+
* ```js
|
|
3359
|
+
* // Reset search from search context
|
|
3360
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3361
|
+
* searchEmbed.trigger(HostEvent.ResetSearch, {}, ContextType.Search);
|
|
3362
|
+
* ```
|
|
2804
3363
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1.sw
|
|
2805
3364
|
*/
|
|
2806
3365
|
HostEvent["ResetSearch"] = "resetSearch";
|
|
@@ -2812,6 +3371,13 @@ var HostEvent;
|
|
|
2812
3371
|
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
|
|
2813
3372
|
* console.log('data', data);
|
|
2814
3373
|
* ```
|
|
3374
|
+
* @example
|
|
3375
|
+
* ```js
|
|
3376
|
+
* // Get filters from liveboard context
|
|
3377
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3378
|
+
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters, {}, ContextType.Liveboard);
|
|
3379
|
+
* console.log('filters', data);
|
|
3380
|
+
* ```
|
|
2815
3381
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
2816
3382
|
*/
|
|
2817
3383
|
HostEvent["GetFilters"] = "getFilters";
|
|
@@ -2819,7 +3385,8 @@ var HostEvent;
|
|
|
2819
3385
|
* Update one or several filters applied on a Liveboard.
|
|
2820
3386
|
* @param - Includes the following keys:
|
|
2821
3387
|
* - `filter`: A single filter object containing column name, filter operator, and
|
|
2822
|
-
* values.
|
|
3388
|
+
* values.
|
|
3389
|
+
* - `filters`: Multiple filter objects with column name, filter operator,
|
|
2823
3390
|
* and values for each.
|
|
2824
3391
|
*
|
|
2825
3392
|
* Each filter object must include the following attributes:
|
|
@@ -2902,6 +3469,18 @@ var HostEvent;
|
|
|
2902
3469
|
* }]
|
|
2903
3470
|
* });
|
|
2904
3471
|
* ```
|
|
3472
|
+
* @example
|
|
3473
|
+
* ```js
|
|
3474
|
+
* // Update filters from liveboard context
|
|
3475
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3476
|
+
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3477
|
+
* filter: {
|
|
3478
|
+
* column: "item type",
|
|
3479
|
+
* oper: "IN",
|
|
3480
|
+
* values: ["shoes", "boots"]
|
|
3481
|
+
* }
|
|
3482
|
+
* }, ContextType.Liveboard);
|
|
3483
|
+
* ```
|
|
2905
3484
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
2906
3485
|
*/
|
|
2907
3486
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
@@ -2915,6 +3494,14 @@ var HostEvent;
|
|
|
2915
3494
|
* );
|
|
2916
3495
|
* })
|
|
2917
3496
|
* ```
|
|
3497
|
+
* @example
|
|
3498
|
+
* ```js
|
|
3499
|
+
* // Get tabs from liveboard context
|
|
3500
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3501
|
+
* liveboardEmbed.trigger(HostEvent.GetTabs, {}, ContextType.Liveboard).then((tabDetails) => {
|
|
3502
|
+
* console.log('tabs', tabDetails);
|
|
3503
|
+
* });
|
|
3504
|
+
* ```
|
|
2918
3505
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl
|
|
2919
3506
|
*/
|
|
2920
3507
|
HostEvent["GetTabs"] = "getTabs";
|
|
@@ -2928,6 +3515,15 @@ var HostEvent;
|
|
|
2928
3515
|
* '430496d6-6903-4601-937e-2c691821af3c',
|
|
2929
3516
|
* 'f547ec54-2a37-4516-a222-2b06719af726'])
|
|
2930
3517
|
* ```
|
|
3518
|
+
* @example
|
|
3519
|
+
* ```js
|
|
3520
|
+
* // Set visible tabs from liveboard context
|
|
3521
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3522
|
+
* liveboardEmbed.trigger(HostEvent.SetVisibleTabs, [
|
|
3523
|
+
* '430496d6-6903-4601-937e-2c691821af3c',
|
|
3524
|
+
* 'f547ec54-2a37-4516-a222-2b06719af726'
|
|
3525
|
+
* ], ContextType.Liveboard);
|
|
3526
|
+
* ```
|
|
2931
3527
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
|
|
2932
3528
|
*/
|
|
2933
3529
|
HostEvent["SetVisibleTabs"] = "SetPinboardVisibleTabs";
|
|
@@ -2941,6 +3537,15 @@ var HostEvent;
|
|
|
2941
3537
|
* '630496d6-6903-4601-937e-2c691821af3c',
|
|
2942
3538
|
* 'i547ec54-2a37-4516-a222-2b06719af726'])
|
|
2943
3539
|
* ```
|
|
3540
|
+
* @example
|
|
3541
|
+
* ```js
|
|
3542
|
+
* // Set hidden tabs from liveboard context
|
|
3543
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3544
|
+
* liveboardEmbed.trigger(HostEvent.SetHiddenTabs, [
|
|
3545
|
+
* '630496d6-6903-4601-937e-2c691821af3c',
|
|
3546
|
+
* 'i547ec54-2a37-4516-a222-2b06719af726'
|
|
3547
|
+
* ], ContextType.Liveboard);
|
|
3548
|
+
* ```
|
|
2944
3549
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
|
|
2945
3550
|
*/
|
|
2946
3551
|
HostEvent["SetHiddenTabs"] = "SetPinboardHiddenTabs";
|
|
@@ -3017,13 +3622,24 @@ var HostEvent;
|
|
|
3017
3622
|
HostEvent["UpdateCrossFilter"] = "UpdateCrossFilter";
|
|
3018
3623
|
/**
|
|
3019
3624
|
* Trigger reset action for a personalized Liveboard view.
|
|
3625
|
+
* This event is deprecated. Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
|
|
3020
3626
|
* @example
|
|
3021
3627
|
* ```js
|
|
3022
3628
|
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
|
|
3023
3629
|
* ```
|
|
3024
3630
|
* @version SDK: 1.29.0 | ThoughtSpot Cloud: 10.1.0.cl, 10.1.0.sw
|
|
3631
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
3025
3632
|
*/
|
|
3026
3633
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
3634
|
+
/**
|
|
3635
|
+
* Trigger reset action for a personalized Liveboard view.
|
|
3636
|
+
* @example
|
|
3637
|
+
* ```js
|
|
3638
|
+
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalizedView);
|
|
3639
|
+
* ```
|
|
3640
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
3641
|
+
*/
|
|
3642
|
+
HostEvent["ResetLiveboardPersonalizedView"] = "ResetLiveboardPersonalisedView";
|
|
3027
3643
|
/**
|
|
3028
3644
|
* Triggers an action to update Parameter values on embedded
|
|
3029
3645
|
* Answers, Liveboard, and Spotter answer in Edit mode.
|
|
@@ -3040,6 +3656,16 @@ var HostEvent;
|
|
|
3040
3656
|
* isVisibleToUser: false
|
|
3041
3657
|
* }])
|
|
3042
3658
|
* ```
|
|
3659
|
+
* @example
|
|
3660
|
+
* ```js
|
|
3661
|
+
* // Update parameters from liveboard context
|
|
3662
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3663
|
+
* liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
|
|
3664
|
+
* name: "Region Param",
|
|
3665
|
+
* value: "West",
|
|
3666
|
+
* isVisibleToUser: true
|
|
3667
|
+
* }], ContextType.Liveboard);
|
|
3668
|
+
* ```
|
|
3043
3669
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
3044
3670
|
*/
|
|
3045
3671
|
HostEvent["UpdateParameters"] = "UpdateParameters";
|
|
@@ -3059,18 +3685,77 @@ var HostEvent;
|
|
|
3059
3685
|
* });
|
|
3060
3686
|
*
|
|
3061
3687
|
* spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
|
|
3688
|
+
*```
|
|
3689
|
+
* @example
|
|
3690
|
+
* ```js
|
|
3691
|
+
* // Get parameters from liveboard context
|
|
3692
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3693
|
+
* liveboardEmbed.trigger(HostEvent.GetParameters, {}, ContextType.Liveboard).then((parameters) => {
|
|
3694
|
+
* console.log('parameters', parameters);
|
|
3695
|
+
* });
|
|
3062
3696
|
* ```
|
|
3063
3697
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
3064
3698
|
*/
|
|
3065
3699
|
HostEvent["GetParameters"] = "GetParameters";
|
|
3066
3700
|
/**
|
|
3067
3701
|
* Triggers an event to update a personalized view of a Liveboard.
|
|
3702
|
+
* This event is deprecated. Use {@link HostEvent.UpdatePersonalizedView} instead.
|
|
3068
3703
|
* ```js
|
|
3069
3704
|
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
|
|
3070
3705
|
* ```
|
|
3706
|
+
* @example
|
|
3707
|
+
* ```js
|
|
3708
|
+
* // Update personalized view from liveboard context
|
|
3709
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3710
|
+
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {
|
|
3711
|
+
* viewId: '1234'
|
|
3712
|
+
* }, ContextType.Liveboard);
|
|
3713
|
+
* ```
|
|
3071
3714
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
3715
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
3072
3716
|
*/
|
|
3073
3717
|
HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
|
|
3718
|
+
/**
|
|
3719
|
+
* Triggers an event to update a personalized view of a Liveboard.
|
|
3720
|
+
* ```js
|
|
3721
|
+
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
|
|
3722
|
+
* ```
|
|
3723
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
3724
|
+
*/
|
|
3725
|
+
HostEvent["UpdatePersonalizedView"] = "UpdatePersonalisedView";
|
|
3726
|
+
/**
|
|
3727
|
+
* Triggers selection of a specific Personalized View on a
|
|
3728
|
+
* Liveboard without reloading the embed. Pass either a
|
|
3729
|
+
* `viewId` (GUID) or `viewName`. If both are provided, `viewId` takes precedence.
|
|
3730
|
+
* If neither is provided, the Liveboard resets to the original/default view.
|
|
3731
|
+
* When a `viewName` is provided and multiple views share
|
|
3732
|
+
* the same name, the first match is selected.
|
|
3733
|
+
* @example
|
|
3734
|
+
* ```js
|
|
3735
|
+
* liveboardEmbed.trigger(
|
|
3736
|
+
* HostEvent.SelectPersonalizedView,
|
|
3737
|
+
* { viewId: '2a021a12-1aed-425d-984b-141ee916ce72' },
|
|
3738
|
+
* )
|
|
3739
|
+
* ```
|
|
3740
|
+
* @example
|
|
3741
|
+
* ```js
|
|
3742
|
+
* // Select by name
|
|
3743
|
+
* liveboardEmbed.trigger(
|
|
3744
|
+
* HostEvent.SelectPersonalizedView,
|
|
3745
|
+
* { viewName: 'Dr Smith Cardiology' },
|
|
3746
|
+
* )
|
|
3747
|
+
* ```
|
|
3748
|
+
* @example
|
|
3749
|
+
* ```js
|
|
3750
|
+
* // Reset to default view
|
|
3751
|
+
* liveboardEmbed.trigger(
|
|
3752
|
+
* HostEvent.SelectPersonalizedView,
|
|
3753
|
+
* {},
|
|
3754
|
+
* )
|
|
3755
|
+
* ```
|
|
3756
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
3757
|
+
*/
|
|
3758
|
+
HostEvent["SelectPersonalizedView"] = "SelectPersonalisedView";
|
|
3074
3759
|
/**
|
|
3075
3760
|
* @hidden
|
|
3076
3761
|
* Notify when info call is completed successfully
|
|
@@ -3090,7 +3775,8 @@ var HostEvent;
|
|
|
3090
3775
|
* add a name and description for the Answer.
|
|
3091
3776
|
* @param - Includes the following keys:
|
|
3092
3777
|
* - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
|
|
3093
|
-
* embed.
|
|
3778
|
+
* embed.
|
|
3779
|
+
* - `name`: Optional. Name string for the Answer.
|
|
3094
3780
|
* - `description`: Optional. Description text for the Answer.
|
|
3095
3781
|
* @example
|
|
3096
3782
|
* ```js
|
|
@@ -3109,6 +3795,34 @@ var HostEvent;
|
|
|
3109
3795
|
*
|
|
3110
3796
|
* spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
|
|
3111
3797
|
* ```
|
|
3798
|
+
* @example
|
|
3799
|
+
* ```js
|
|
3800
|
+
* // Using context parameter to save answer from search context
|
|
3801
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3802
|
+
* const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
|
|
3803
|
+
* name: "Regional sales analysis",
|
|
3804
|
+
* description: "Sales breakdown by region"
|
|
3805
|
+
* }, ContextType.Search);
|
|
3806
|
+
* ```
|
|
3807
|
+
* @example
|
|
3808
|
+
* ```js
|
|
3809
|
+
* // Save answer from answer context (explore modal)
|
|
3810
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3811
|
+
* const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
|
|
3812
|
+
* name: "Modified analysis",
|
|
3813
|
+
* description: "Updated from explore view"
|
|
3814
|
+
* }, ContextType.Answer);
|
|
3815
|
+
* ```
|
|
3816
|
+
* @example
|
|
3817
|
+
* ```js
|
|
3818
|
+
* // Save answer from spotter context
|
|
3819
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3820
|
+
* const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
|
|
3821
|
+
* vizId: latestSpotterVizId,
|
|
3822
|
+
* name: "AI insights",
|
|
3823
|
+
* description: "Generated from Spotter"
|
|
3824
|
+
* }, ContextType.Spotter);
|
|
3825
|
+
* ```
|
|
3112
3826
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
3113
3827
|
*/
|
|
3114
3828
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
@@ -3150,6 +3864,15 @@ var HostEvent;
|
|
|
3150
3864
|
* executeSearch: true,
|
|
3151
3865
|
* })
|
|
3152
3866
|
* ```
|
|
3867
|
+
* @example
|
|
3868
|
+
* ```js
|
|
3869
|
+
* // Spotter search from spotter context
|
|
3870
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3871
|
+
* spotterEmbed.trigger(HostEvent.SpotterSearch, {
|
|
3872
|
+
* query: 'sales by region',
|
|
3873
|
+
* executeSearch: true
|
|
3874
|
+
* }, ContextType.Spotter);
|
|
3875
|
+
* ```
|
|
3153
3876
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3154
3877
|
*/
|
|
3155
3878
|
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
@@ -3160,6 +3883,12 @@ var HostEvent;
|
|
|
3160
3883
|
* ```js
|
|
3161
3884
|
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
|
|
3162
3885
|
* ```
|
|
3886
|
+
* @example
|
|
3887
|
+
* ```js
|
|
3888
|
+
* // Edit last prompt from spotter context
|
|
3889
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3890
|
+
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "sales by region", ContextType.Spotter);
|
|
3891
|
+
* ```
|
|
3163
3892
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3164
3893
|
*/
|
|
3165
3894
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
@@ -3169,6 +3898,12 @@ var HostEvent;
|
|
|
3169
3898
|
* ```js
|
|
3170
3899
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
3171
3900
|
* ```
|
|
3901
|
+
* @example
|
|
3902
|
+
* ```js
|
|
3903
|
+
* // Preview spotter data from spotter context
|
|
3904
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3905
|
+
* spotterEmbed.trigger(HostEvent.PreviewSpotterData, {}, ContextType.Spotter);
|
|
3906
|
+
* ```
|
|
3172
3907
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3173
3908
|
*/
|
|
3174
3909
|
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
@@ -3459,6 +4194,7 @@ var Param;
|
|
|
3459
4194
|
Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
|
|
3460
4195
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3461
4196
|
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
4197
|
+
Param["IsWYSIWYGLiveboardPDFEnabled"] = "isWYSIWYGLiveboardPDFEnabled";
|
|
3462
4198
|
Param["isLiveboardXLSXCSVDownloadEnabled"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3463
4199
|
Param["isGranularXLSXCSVSchedulesEnabled"] = "isGranularXLSXCSVSchedulesEnabled";
|
|
3464
4200
|
Param["isCentralizedLiveboardFilterUXEnabled"] = "isCentralizedLiveboardFilterUXEnabled";
|
|
@@ -3803,6 +4539,16 @@ var Action;
|
|
|
3803
4539
|
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
3804
4540
|
*/
|
|
3805
4541
|
Action["DownloadLiveboard"] = "downloadLiveboard";
|
|
4542
|
+
/**
|
|
4543
|
+
* The **Download Liveboard as Continuous PDF** menu action on a Liveboard.
|
|
4544
|
+
* Allows downloading the entire Liveboard as a continuous PDF.
|
|
4545
|
+
* @example
|
|
4546
|
+
* ```js
|
|
4547
|
+
* disabledActions: [Action.DownloadLiveboardAsContinuousPDF]
|
|
4548
|
+
* ```
|
|
4549
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
4550
|
+
*/
|
|
4551
|
+
Action["DownloadLiveboardAsContinuousPDF"] = "downloadLiveboardAsContinuousPDF";
|
|
3806
4552
|
/**
|
|
3807
4553
|
* @hidden
|
|
3808
4554
|
*/
|
|
@@ -3927,6 +4673,7 @@ var Action;
|
|
|
3927
4673
|
* disabledActions: [Action.LiveboardInfo]
|
|
3928
4674
|
* ```
|
|
3929
4675
|
*/
|
|
4676
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
3930
4677
|
Action["LiveboardInfo"] = "pinboardInfo";
|
|
3931
4678
|
/**
|
|
3932
4679
|
* @hidden
|
|
@@ -3957,6 +4704,7 @@ var Action;
|
|
|
3957
4704
|
* disabledActions: [Action.Subscription]
|
|
3958
4705
|
* ```
|
|
3959
4706
|
*/
|
|
4707
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
3960
4708
|
Action["Subscription"] = "subscription";
|
|
3961
4709
|
/**
|
|
3962
4710
|
* The **Explore** action on Liveboard visualizations
|
|
@@ -4436,13 +5184,25 @@ var Action;
|
|
|
4436
5184
|
/**
|
|
4437
5185
|
* The Liveboard Personalised Views dropdown.
|
|
4438
5186
|
* Allows navigating to a personalized Liveboard View.
|
|
5187
|
+
* This action is deprecated. Use {@link Action.PersonalizedViewsDropdown} instead.
|
|
4439
5188
|
* @example
|
|
4440
5189
|
* ```js
|
|
4441
5190
|
* disabledActions: [Action.PersonalisedViewsDropdown]
|
|
4442
5191
|
* ```
|
|
4443
5192
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 10.1.0.sw
|
|
5193
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
4444
5194
|
*/
|
|
4445
5195
|
Action["PersonalisedViewsDropdown"] = "personalisedViewsDropdown";
|
|
5196
|
+
/**
|
|
5197
|
+
* The Liveboard Personalized Views dropdown.
|
|
5198
|
+
* Allows navigating to a personalized Liveboard View.
|
|
5199
|
+
* @example
|
|
5200
|
+
* ```js
|
|
5201
|
+
* disabledActions: [Action.PersonalizedViewsDropdown]
|
|
5202
|
+
* ```
|
|
5203
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
5204
|
+
*/
|
|
5205
|
+
Action["PersonalizedViewsDropdown"] = "personalisedViewsDropdown";
|
|
4446
5206
|
/**
|
|
4447
5207
|
* Action ID for show or hide the user details on a
|
|
4448
5208
|
* Liveboard (Recently visited / social proof)
|
|
@@ -4530,14 +5290,27 @@ var Action;
|
|
|
4530
5290
|
/**
|
|
4531
5291
|
* The **Organize Favourites** action on Homepage
|
|
4532
5292
|
* *Favorites* module.
|
|
5293
|
+
* This action is deprecated. Use {@link Action.OrganizeFavorites} instead.
|
|
4533
5294
|
*
|
|
4534
5295
|
* @example
|
|
4535
5296
|
* ```js
|
|
4536
5297
|
* disabledActions: [Action.OrganiseFavourites]
|
|
4537
5298
|
* ```
|
|
4538
5299
|
* @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
|
|
5300
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
4539
5301
|
*/
|
|
4540
5302
|
Action["OrganiseFavourites"] = "organiseFavourites";
|
|
5303
|
+
/**
|
|
5304
|
+
* The **Organize Favorites** action on Homepage
|
|
5305
|
+
* *Favorites* module.
|
|
5306
|
+
*
|
|
5307
|
+
* @example
|
|
5308
|
+
* ```js
|
|
5309
|
+
* disabledActions: [Action.OrganizeFavorites]
|
|
5310
|
+
* ```
|
|
5311
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
5312
|
+
*/
|
|
5313
|
+
Action["OrganizeFavorites"] = "organiseFavourites";
|
|
4541
5314
|
/**
|
|
4542
5315
|
* The **AI Highlights** action on a Liveboard.
|
|
4543
5316
|
*
|
|
@@ -4993,6 +5766,39 @@ var Action;
|
|
|
4993
5766
|
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4994
5767
|
*/
|
|
4995
5768
|
Action["SpotterDocs"] = "spotterDocs";
|
|
5769
|
+
/**
|
|
5770
|
+
* Controls visibility and disable state of the connector resources
|
|
5771
|
+
* section in the Spotter chat interface.
|
|
5772
|
+
* @example
|
|
5773
|
+
* ```js
|
|
5774
|
+
* hiddenActions: [Action.SpotterChatConnectorResources]
|
|
5775
|
+
* disabledActions: [Action.SpotterChatConnectorResources]
|
|
5776
|
+
* ```
|
|
5777
|
+
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
5778
|
+
*/
|
|
5779
|
+
Action["SpotterChatConnectorResources"] = "spotterChatConnectorResources";
|
|
5780
|
+
/**
|
|
5781
|
+
* Controls visibility and disable state of the connectors
|
|
5782
|
+
* in the Spotter chat interface.
|
|
5783
|
+
* @example
|
|
5784
|
+
* ```js
|
|
5785
|
+
* hiddenActions: [Action.SpotterChatConnectors]
|
|
5786
|
+
* disabledActions: [Action.SpotterChatConnectors]
|
|
5787
|
+
* ```
|
|
5788
|
+
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
5789
|
+
*/
|
|
5790
|
+
Action["SpotterChatConnectors"] = "spotterChatConnectors";
|
|
5791
|
+
/**
|
|
5792
|
+
* Controls visibility and disable state of the mode switcher
|
|
5793
|
+
* in the Spotter chat interface.
|
|
5794
|
+
* @example
|
|
5795
|
+
* ```js
|
|
5796
|
+
* hiddenActions: [Action.SpotterChatModeSwitcher]
|
|
5797
|
+
* disabledActions: [Action.SpotterChatModeSwitcher]
|
|
5798
|
+
* ```
|
|
5799
|
+
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
5800
|
+
*/
|
|
5801
|
+
Action["SpotterChatModeSwitcher"] = "spotterChatModeSwitcher";
|
|
4996
5802
|
/**
|
|
4997
5803
|
* The **Include current period** checkbox for date filters.
|
|
4998
5804
|
* Controls the visibility and availability of the option to include
|
|
@@ -5286,7 +6092,29 @@ var EmbedErrorCodes;
|
|
|
5286
6092
|
EmbedErrorCodes["UPDATE_PARAMS_FAILED"] = "UPDATE_PARAMS_FAILED";
|
|
5287
6093
|
/** Invalid URL provided in configuration */
|
|
5288
6094
|
EmbedErrorCodes["INVALID_URL"] = "INVALID_URL";
|
|
6095
|
+
/** Host event payload validation failed */
|
|
6096
|
+
EmbedErrorCodes["HOST_EVENT_VALIDATION"] = "HOST_EVENT_VALIDATION";
|
|
6097
|
+
/** UpdateFilters payload is invalid - missing or malformed filter/filters */
|
|
6098
|
+
EmbedErrorCodes["UPDATEFILTERS_INVALID_PAYLOAD"] = "UPDATEFILTERS_INVALID_PAYLOAD";
|
|
6099
|
+
/** DrillDown payload is invalid - missing or malformed points */
|
|
6100
|
+
EmbedErrorCodes["DRILLDOWN_INVALID_PAYLOAD"] = "DRILLDOWN_INVALID_PAYLOAD";
|
|
5289
6101
|
})(EmbedErrorCodes || (EmbedErrorCodes = {}));
|
|
6102
|
+
/**
|
|
6103
|
+
* Context types for specifying the page context when triggering host events.
|
|
6104
|
+
* Used as the third parameter in the `trigger` method to help ThoughtSpot
|
|
6105
|
+
* understand the current page context for better event handling.
|
|
6106
|
+
*
|
|
6107
|
+
* @example
|
|
6108
|
+
* ```js
|
|
6109
|
+
* import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
6110
|
+
*
|
|
6111
|
+
* // Trigger an event with specific context
|
|
6112
|
+
* embed.trigger(HostEvent.Pin, { vizId: "123", liveboardId: "456" }, ContextType.Search);
|
|
6113
|
+
* ```
|
|
6114
|
+
*
|
|
6115
|
+
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
6116
|
+
* @group Events
|
|
6117
|
+
*/
|
|
5290
6118
|
var ContextType;
|
|
5291
6119
|
(function (ContextType) {
|
|
5292
6120
|
/**
|
|
@@ -5305,6 +6133,10 @@ var ContextType;
|
|
|
5305
6133
|
* Spotter context for spotter modal/page.
|
|
5306
6134
|
*/
|
|
5307
6135
|
ContextType["Spotter"] = "spotter";
|
|
6136
|
+
/**
|
|
6137
|
+
* Other context for any other generic page.
|
|
6138
|
+
*/
|
|
6139
|
+
ContextType["Other"] = "other";
|
|
5308
6140
|
})(ContextType || (ContextType = {}));
|
|
5309
6141
|
/**
|
|
5310
6142
|
* Enum for the type of API intercepted
|
|
@@ -5427,6 +6259,8 @@ const ERROR_MESSAGE = {
|
|
|
5427
6259
|
SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
|
|
5428
6260
|
UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
|
|
5429
6261
|
INVALID_SPOTTER_DOCUMENTATION_URL: 'Invalid spotterDocumentationUrl. Please provide a valid http or https URL.',
|
|
6262
|
+
UPDATEFILTERS_INVALID_PAYLOAD: 'UpdateFilters requires a valid filter or filters array. Expected: { filter: { column, oper, values } } or { filters: [{ column, oper, values }, ...] }',
|
|
6263
|
+
DRILLDOWN_INVALID_PAYLOAD: 'DrillDown requires a valid points object. Expected: { points: { clickedPoint?, selectedPoints? }, autoDrillDown?, vizId? }',
|
|
5430
6264
|
};
|
|
5431
6265
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
5432
6266
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -5930,14 +6764,6 @@ const validateHttpUrl = (url) => {
|
|
|
5930
6764
|
return [false, error instanceof Error ? error : new Error(String(error))];
|
|
5931
6765
|
}
|
|
5932
6766
|
};
|
|
5933
|
-
/**
|
|
5934
|
-
* Resolves enablePastConversationsSidebar with
|
|
5935
|
-
* spotterSidebarConfig taking precedence over the
|
|
5936
|
-
* standalone flag.
|
|
5937
|
-
*/
|
|
5938
|
-
const resolveEnablePastConversationsSidebar = (params) => (params.spotterSidebarConfigValue !== undefined
|
|
5939
|
-
? params.spotterSidebarConfigValue
|
|
5940
|
-
: params.standaloneValue);
|
|
5941
6767
|
/**
|
|
5942
6768
|
* Sets a query parameter if the value is defined.
|
|
5943
6769
|
* @param queryParams - The query params object to modify
|
|
@@ -8234,6 +9060,15 @@ var UIPassthroughEvent;
|
|
|
8234
9060
|
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
8235
9061
|
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
8236
9062
|
UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
|
|
9063
|
+
UIPassthroughEvent["UpdateFilters"] = "updateFilters";
|
|
9064
|
+
UIPassthroughEvent["Drilldown"] = "drillDown";
|
|
9065
|
+
UIPassthroughEvent["GetAnswerSession"] = "getAnswerSession";
|
|
9066
|
+
UIPassthroughEvent["GetFilters"] = "getFilters";
|
|
9067
|
+
UIPassthroughEvent["GetIframeUrl"] = "getIframeUrl";
|
|
9068
|
+
UIPassthroughEvent["GetParameters"] = "getParameters";
|
|
9069
|
+
UIPassthroughEvent["GetTML"] = "getTML";
|
|
9070
|
+
UIPassthroughEvent["GetTabs"] = "getTabs";
|
|
9071
|
+
UIPassthroughEvent["GetExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
|
|
8237
9072
|
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
8238
9073
|
|
|
8239
9074
|
const EndPoints = {
|
|
@@ -8867,9 +9702,11 @@ const DATA_TYPES = ['DATE', 'DATE_TIME', 'TIME'];
|
|
|
8867
9702
|
* You can use this service to:
|
|
8868
9703
|
*
|
|
8869
9704
|
* - Add or remove columns from Answers (`addColumns`, `removeColumns`,
|
|
8870
|
-
* `addColumnsByName`)
|
|
9705
|
+
* `addColumnsByName`)
|
|
9706
|
+
* - Apply filters to Answers (`addFilter`)
|
|
8871
9707
|
* - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`,
|
|
8872
|
-
* `fetchCSVBlob`, `fetchPNGBlob`)
|
|
9708
|
+
* `fetchCSVBlob`, `fetchPNGBlob`)
|
|
9709
|
+
* - Get data for specific points in visualizations
|
|
8873
9710
|
* (`getUnderlyingDataForPoint`)
|
|
8874
9711
|
* - Run custom queries (`executeQuery`)
|
|
8875
9712
|
* - Add visualizations to Liveboards (`addDisplayedVizToLiveboard`)
|
|
@@ -9163,7 +10000,7 @@ class AnswerService {
|
|
|
9163
10000
|
async getTML() {
|
|
9164
10001
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
9165
10002
|
const edoc = object[0].edoc;
|
|
9166
|
-
const YAML = await import('./index-
|
|
10003
|
+
const YAML = await import('./index-ChNydfIz.js');
|
|
9167
10004
|
const parsedDoc = YAML.parse(edoc);
|
|
9168
10005
|
return {
|
|
9169
10006
|
answer: {
|
|
@@ -17618,7 +18455,8 @@ var AuthFailureType;
|
|
|
17618
18455
|
/**
|
|
17619
18456
|
* The current authentication token or session has expired.
|
|
17620
18457
|
*
|
|
17621
|
-
* Emitted when the embed receives an auth-expiry signal and starts auth refresh
|
|
18458
|
+
* Emitted when the embed receives an auth-expiry signal and starts auth refresh
|
|
18459
|
+
* handling.
|
|
17622
18460
|
*/
|
|
17623
18461
|
AuthFailureType["EXPIRY"] = "EXPIRY";
|
|
17624
18462
|
/**
|
|
@@ -18465,11 +19303,79 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
|
|
|
18465
19303
|
return eventData;
|
|
18466
19304
|
}
|
|
18467
19305
|
|
|
18468
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.
|
|
19306
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.5";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={".":{"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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js && node dts-config/wrap-ambient-module.mjs","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.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 | npx coveralls-next || echo 'Warning: Coveralls upload failed but not breaking the build.'","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.23","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":"^11.2.0","@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":"^30.0.0","@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",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",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":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","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.59.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^29.4.6","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,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"34 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};
|
|
19307
|
+
|
|
19308
|
+
function isValidUpdateFiltersPayload(payload) {
|
|
19309
|
+
if (!payload)
|
|
19310
|
+
return false;
|
|
19311
|
+
const isValidFilter = (f) => !!f && typeof f.column === 'string' && typeof f.oper === 'string' && Array.isArray(f.values);
|
|
19312
|
+
const hasValidFilter = payload.filter && isValidFilter(payload.filter);
|
|
19313
|
+
const hasValidFilters = Array.isArray(payload.filters) && payload.filters.length > 0 && payload.filters.every(isValidFilter);
|
|
19314
|
+
return !!(hasValidFilter || hasValidFilters);
|
|
19315
|
+
}
|
|
19316
|
+
function isValidDrillDownPayload(payload) {
|
|
19317
|
+
if (!payload)
|
|
19318
|
+
return false;
|
|
19319
|
+
const points = payload.points;
|
|
19320
|
+
if (!points || typeof points !== 'object')
|
|
19321
|
+
return false;
|
|
19322
|
+
const hasClickedPoint = 'clickedPoint' in points && points.clickedPoint != null;
|
|
19323
|
+
const hasSelectedPoints = Array.isArray(points.selectedPoints) && points.selectedPoints.length > 0;
|
|
19324
|
+
return hasClickedPoint || hasSelectedPoints;
|
|
19325
|
+
}
|
|
19326
|
+
function createValidationError(message) {
|
|
19327
|
+
const err = new Error(message);
|
|
19328
|
+
err.isValidationError = true;
|
|
19329
|
+
err.embedErrorDetails = {
|
|
19330
|
+
type: EmbedEvent.Error,
|
|
19331
|
+
data: {
|
|
19332
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
19333
|
+
message,
|
|
19334
|
+
code: EmbedErrorCodes.HOST_EVENT_VALIDATION,
|
|
19335
|
+
error: message
|
|
19336
|
+
},
|
|
19337
|
+
status: embedEventStatus.END
|
|
19338
|
+
};
|
|
19339
|
+
throw err;
|
|
19340
|
+
}
|
|
19341
|
+
function throwUpdateFiltersValidationError() {
|
|
19342
|
+
createValidationError(ERROR_MESSAGE.UPDATEFILTERS_INVALID_PAYLOAD);
|
|
19343
|
+
}
|
|
19344
|
+
function throwDrillDownValidationError() {
|
|
19345
|
+
createValidationError(ERROR_MESSAGE.DRILLDOWN_INVALID_PAYLOAD);
|
|
19346
|
+
}
|
|
18469
19347
|
|
|
19348
|
+
/**
|
|
19349
|
+
* Maps HostEvent to its corresponding UIPassthroughEvent.
|
|
19350
|
+
* Includes both custom-handler events (Pin, SaveAnswer, UpdateFilters, DrillDown)
|
|
19351
|
+
* and getter events (GetAnswerSession, GetFilters, etc.) that use getDataWithPassthroughFallback.
|
|
19352
|
+
*/
|
|
19353
|
+
const PASSTHROUGH_MAP = {
|
|
19354
|
+
// Custom handlers (setters with special logic)
|
|
19355
|
+
[HostEvent.Pin]: UIPassthroughEvent.PinAnswerToLiveboard,
|
|
19356
|
+
[HostEvent.SaveAnswer]: UIPassthroughEvent.SaveAnswer,
|
|
19357
|
+
[HostEvent.UpdateFilters]: UIPassthroughEvent.UpdateFilters,
|
|
19358
|
+
[HostEvent.DrillDown]: UIPassthroughEvent.Drilldown,
|
|
19359
|
+
// Getters (use getDataWithPassthroughFallback)
|
|
19360
|
+
[HostEvent.GetAnswerSession]: UIPassthroughEvent.GetAnswerSession,
|
|
19361
|
+
[HostEvent.GetFilters]: UIPassthroughEvent.GetFilters,
|
|
19362
|
+
[HostEvent.GetIframeUrl]: UIPassthroughEvent.GetIframeUrl,
|
|
19363
|
+
[HostEvent.GetParameters]: UIPassthroughEvent.GetParameters,
|
|
19364
|
+
[HostEvent.GetTML]: UIPassthroughEvent.GetTML,
|
|
19365
|
+
[HostEvent.GetTabs]: UIPassthroughEvent.GetTabs,
|
|
19366
|
+
[HostEvent.getExportRequestForCurrentPinboard]: UIPassthroughEvent.GetExportRequestForCurrentPinboard,
|
|
19367
|
+
};
|
|
18470
19368
|
class HostEventClient {
|
|
18471
19369
|
constructor(iFrame) {
|
|
19370
|
+
/** Cached list of available UI passthrough keys from the embedded app */
|
|
19371
|
+
this.availablePassthroughKeysCache = null;
|
|
18472
19372
|
this.iFrame = iFrame;
|
|
19373
|
+
this.customHandlers = {
|
|
19374
|
+
[HostEvent.Pin]: (p, c) => this.handlePinEvent(p, c),
|
|
19375
|
+
[HostEvent.SaveAnswer]: (p, c) => this.handleSaveAnswerEvent(p, c),
|
|
19376
|
+
[HostEvent.UpdateFilters]: (p, c) => this.handleUpdateFiltersEvent(p, c),
|
|
19377
|
+
[HostEvent.DrillDown]: (p, c) => this.handleDrillDownEvent(p, c),
|
|
19378
|
+
};
|
|
18473
19379
|
}
|
|
18474
19380
|
/**
|
|
18475
19381
|
* A wrapper over process trigger to
|
|
@@ -18486,7 +19392,7 @@ class HostEventClient {
|
|
|
18486
19392
|
}
|
|
18487
19393
|
async handleHostEventWithParam(apiName, parameters, context) {
|
|
18488
19394
|
var _a, _b, _c, _d;
|
|
18489
|
-
const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters, context))) === null || _a === void 0 ? void 0 : _a.
|
|
19395
|
+
const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters, context))) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value);
|
|
18490
19396
|
if (!response) {
|
|
18491
19397
|
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
18492
19398
|
throw { error };
|
|
@@ -18495,13 +19401,35 @@ class HostEventClient {
|
|
|
18495
19401
|
|| ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors)
|
|
18496
19402
|
|| ((_d = response.value) === null || _d === void 0 ? void 0 : _d.error);
|
|
18497
19403
|
if (errors) {
|
|
18498
|
-
|
|
19404
|
+
const message = typeof errors === 'string' ? errors : JSON.stringify(errors);
|
|
19405
|
+
throw { error: message };
|
|
18499
19406
|
}
|
|
18500
19407
|
return { ...response.value };
|
|
18501
19408
|
}
|
|
18502
19409
|
async hostEventFallback(hostEvent, data, context) {
|
|
18503
19410
|
return this.processTrigger(hostEvent, data, context);
|
|
18504
19411
|
}
|
|
19412
|
+
/**
|
|
19413
|
+
* For getter events that return data. Tries UI passthrough first;
|
|
19414
|
+
* if the app doesn't support it (no response data), falls back to
|
|
19415
|
+
* the legacy host event channel. Real errors are thrown as-is.
|
|
19416
|
+
*/
|
|
19417
|
+
async getDataWithPassthroughFallback(passthroughEvent, hostEvent, payload, context) {
|
|
19418
|
+
var _a, _b, _c;
|
|
19419
|
+
const response = await this.triggerUIPassthroughApi(passthroughEvent, payload || {}, context);
|
|
19420
|
+
const matched = (_a = response === null || response === void 0 ? void 0 : response.find) === null || _a === void 0 ? void 0 : _a.call(response, (r) => r.error || r.value);
|
|
19421
|
+
if (!matched) {
|
|
19422
|
+
return this.hostEventFallback(hostEvent, payload, context);
|
|
19423
|
+
}
|
|
19424
|
+
const errors = matched.error
|
|
19425
|
+
|| ((_b = matched.value) === null || _b === void 0 ? void 0 : _b.errors)
|
|
19426
|
+
|| ((_c = matched.value) === null || _c === void 0 ? void 0 : _c.error);
|
|
19427
|
+
if (errors) {
|
|
19428
|
+
const message = typeof errors === 'string' ? errors : JSON.stringify(errors);
|
|
19429
|
+
throw new Error(message);
|
|
19430
|
+
}
|
|
19431
|
+
return { ...matched.value };
|
|
19432
|
+
}
|
|
18505
19433
|
/**
|
|
18506
19434
|
* Setter for the iframe element used for host events
|
|
18507
19435
|
* @param {HTMLIFrameElement} iFrame - the iframe element to set
|
|
@@ -18509,6 +19437,26 @@ class HostEventClient {
|
|
|
18509
19437
|
setIframeElement(iFrame) {
|
|
18510
19438
|
this.iFrame = iFrame;
|
|
18511
19439
|
}
|
|
19440
|
+
/**
|
|
19441
|
+
* Fetches the list of available UI passthrough keys from the embedded app.
|
|
19442
|
+
* Result is cached for the session. Returns empty array on failure.
|
|
19443
|
+
*/
|
|
19444
|
+
async getAvailableUIPassthroughKeys(context) {
|
|
19445
|
+
var _a, _b;
|
|
19446
|
+
if (this.availablePassthroughKeysCache !== null) {
|
|
19447
|
+
return this.availablePassthroughKeysCache;
|
|
19448
|
+
}
|
|
19449
|
+
try {
|
|
19450
|
+
const response = await this.triggerUIPassthroughApi(UIPassthroughEvent.GetAvailableUIPassthroughs, {}, context);
|
|
19451
|
+
const matched = (_a = response === null || response === void 0 ? void 0 : response.find) === null || _a === void 0 ? void 0 : _a.call(response, (r) => r.value && !r.error);
|
|
19452
|
+
const keys = (_b = matched === null || matched === void 0 ? void 0 : matched.value) === null || _b === void 0 ? void 0 : _b.keys;
|
|
19453
|
+
this.availablePassthroughKeysCache = Array.isArray(keys) ? keys : [];
|
|
19454
|
+
return this.availablePassthroughKeysCache;
|
|
19455
|
+
}
|
|
19456
|
+
catch {
|
|
19457
|
+
return [];
|
|
19458
|
+
}
|
|
19459
|
+
}
|
|
18512
19460
|
async triggerUIPassthroughApi(apiName, parameters, context) {
|
|
18513
19461
|
const res = await this.processTrigger(HostEvent.UIPassthrough, {
|
|
18514
19462
|
type: apiName,
|
|
@@ -18544,15 +19492,41 @@ class HostEventClient {
|
|
|
18544
19492
|
answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
|
|
18545
19493
|
};
|
|
18546
19494
|
}
|
|
18547
|
-
|
|
18548
|
-
|
|
18549
|
-
|
|
18550
|
-
|
|
18551
|
-
|
|
18552
|
-
|
|
18553
|
-
|
|
18554
|
-
|
|
19495
|
+
handleUpdateFiltersEvent(payload, context) {
|
|
19496
|
+
if (!isValidUpdateFiltersPayload(payload)) {
|
|
19497
|
+
throwUpdateFiltersValidationError();
|
|
19498
|
+
}
|
|
19499
|
+
return this.handleHostEventWithParam(UIPassthroughEvent.UpdateFilters, payload, context);
|
|
19500
|
+
}
|
|
19501
|
+
handleDrillDownEvent(payload, context) {
|
|
19502
|
+
if (!isValidDrillDownPayload(payload)) {
|
|
19503
|
+
throwDrillDownValidationError();
|
|
18555
19504
|
}
|
|
19505
|
+
return this.handleHostEventWithParam(UIPassthroughEvent.Drilldown, payload, context);
|
|
19506
|
+
}
|
|
19507
|
+
/**
|
|
19508
|
+
* Dispatches a host event using the appropriate channel:
|
|
19509
|
+
* 1. If the embedded app supports UI passthrough for this event, use it (custom handler or getter).
|
|
19510
|
+
* 2. Otherwise fall back to the legacy host event channel.
|
|
19511
|
+
*
|
|
19512
|
+
* @param hostEvent - The host event to trigger
|
|
19513
|
+
* @param payload - Optional payload for the event
|
|
19514
|
+
* @param context - Optional context (e.g. vizId) for scoped operations
|
|
19515
|
+
*/
|
|
19516
|
+
async triggerHostEvent(hostEvent, payload, context) {
|
|
19517
|
+
const customHandler = this.customHandlers[hostEvent];
|
|
19518
|
+
const passthroughEvent = PASSTHROUGH_MAP[hostEvent];
|
|
19519
|
+
// If embedded app supports passthrough but not this event, use legacy channel
|
|
19520
|
+
const keys = passthroughEvent ? await this.getAvailableUIPassthroughKeys(context) : [];
|
|
19521
|
+
if (passthroughEvent && keys.length > 0 && !keys.includes(passthroughEvent)) {
|
|
19522
|
+
return this.hostEventFallback(hostEvent, payload, context);
|
|
19523
|
+
}
|
|
19524
|
+
// Custom handler (setters) > getter passthrough > legacy fallback
|
|
19525
|
+
return (customHandler
|
|
19526
|
+
? customHandler(payload, context)
|
|
19527
|
+
: passthroughEvent
|
|
19528
|
+
? this.getDataWithPassthroughFallback(passthroughEvent, hostEvent, payload, context)
|
|
19529
|
+
: this.hostEventFallback(hostEvent, payload, context));
|
|
18556
19530
|
}
|
|
18557
19531
|
}
|
|
18558
19532
|
|
|
@@ -19843,7 +20817,21 @@ class TsEmbed {
|
|
|
19843
20817
|
* Triggers an event to the embedded app
|
|
19844
20818
|
* @param {HostEvent} messageType The event type
|
|
19845
20819
|
* @param {any} data The payload to send with the message
|
|
20820
|
+
* @param {ContextType} context Optional context type to specify the context from which the event is triggered.
|
|
20821
|
+
* Use ContextType.Search for search answer context, ContextType.Answer for answer/explore context,
|
|
20822
|
+
* ContextType.Liveboard for liveboard context, or ContextType.Spotter for spotter context.
|
|
20823
|
+
* Available from SDK version 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
19846
20824
|
* @returns A promise that resolves with the response from the embedded app
|
|
20825
|
+
* @example
|
|
20826
|
+
* ```js
|
|
20827
|
+
* // Trigger Pin event with context (SDK: 1.45.2+)
|
|
20828
|
+
* import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
20829
|
+
* embed.trigger(HostEvent.Pin, {
|
|
20830
|
+
* vizId: "123",
|
|
20831
|
+
* liveboardId: "456"
|
|
20832
|
+
* }, ContextType.Search);
|
|
20833
|
+
* ```
|
|
20834
|
+
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl (for context parameter)
|
|
19847
20835
|
*/
|
|
19848
20836
|
async trigger(messageType, data = {}, context) {
|
|
19849
20837
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
@@ -19872,7 +20860,19 @@ class TsEmbed {
|
|
|
19872
20860
|
return null;
|
|
19873
20861
|
}
|
|
19874
20862
|
// send an empty object, this is needed for liveboard default handlers
|
|
19875
|
-
return this.hostEventClient.triggerHostEvent(messageType, data, context)
|
|
20863
|
+
return this.hostEventClient.triggerHostEvent(messageType, data, context).catch((err) => {
|
|
20864
|
+
var _a;
|
|
20865
|
+
if (err === null || err === void 0 ? void 0 : err.isValidationError) {
|
|
20866
|
+
const errorDetails = (_a = err.embedErrorDetails) !== null && _a !== void 0 ? _a : {
|
|
20867
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
20868
|
+
message: err.message || ERROR_MESSAGE.UPDATEFILTERS_INVALID_PAYLOAD,
|
|
20869
|
+
code: EmbedErrorCodes.UPDATEFILTERS_INVALID_PAYLOAD,
|
|
20870
|
+
error: err.message,
|
|
20871
|
+
};
|
|
20872
|
+
this.handleError(errorDetails);
|
|
20873
|
+
}
|
|
20874
|
+
throw err;
|
|
20875
|
+
});
|
|
19876
20876
|
}
|
|
19877
20877
|
/**
|
|
19878
20878
|
* Triggers an event to the embedded app, skipping the UI flow.
|
|
@@ -19906,8 +20906,33 @@ class TsEmbed {
|
|
|
19906
20906
|
return this.render();
|
|
19907
20907
|
}
|
|
19908
20908
|
/**
|
|
19909
|
-
|
|
19910
|
-
|
|
20909
|
+
* Context object for the embedded component.
|
|
20910
|
+
* @returns {ContextObject} The current context object containing the page type and object ids.
|
|
20911
|
+
* @example
|
|
20912
|
+
* ```js
|
|
20913
|
+
* const context = await embed.getCurrentContext();
|
|
20914
|
+
* console.log(context);
|
|
20915
|
+
*
|
|
20916
|
+
* // Example output
|
|
20917
|
+
* {
|
|
20918
|
+
* stack: [
|
|
20919
|
+
* {
|
|
20920
|
+
* name: 'Liveboard',
|
|
20921
|
+
* type: ContextType.Liveboard,
|
|
20922
|
+
* objectIds: {
|
|
20923
|
+
* liveboardId: '123',
|
|
20924
|
+
* },
|
|
20925
|
+
* },
|
|
20926
|
+
* ],
|
|
20927
|
+
* currentContext: {
|
|
20928
|
+
* name: 'Liveboard',
|
|
20929
|
+
* type: ContextType.Liveboard,
|
|
20930
|
+
* objectIds: {
|
|
20931
|
+
* liveboardId: '123',
|
|
20932
|
+
* },
|
|
20933
|
+
* },
|
|
20934
|
+
* }
|
|
20935
|
+
* ```
|
|
19911
20936
|
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
19912
20937
|
*/
|
|
19913
20938
|
async getCurrentContext() {
|
|
@@ -20589,6 +21614,50 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
|
|
|
20589
21614
|
}
|
|
20590
21615
|
};
|
|
20591
21616
|
|
|
21617
|
+
/**
|
|
21618
|
+
* Resolves enablePastConversationsSidebar with
|
|
21619
|
+
* spotterSidebarConfig taking precedence over the
|
|
21620
|
+
* standalone flag.
|
|
21621
|
+
*/
|
|
21622
|
+
const resolveEnablePastConversationsSidebar = (params) => (params.spotterSidebarConfigValue !== undefined
|
|
21623
|
+
? params.spotterSidebarConfigValue
|
|
21624
|
+
: params.standaloneValue);
|
|
21625
|
+
function buildSpotterSidebarAppInitData(defaultAppInitData, viewConfig, handleError) {
|
|
21626
|
+
const { spotterSidebarConfig, enablePastConversationsSidebar } = viewConfig;
|
|
21627
|
+
const resolvedEnablePastConversations = resolveEnablePastConversationsSidebar({
|
|
21628
|
+
spotterSidebarConfigValue: spotterSidebarConfig === null || spotterSidebarConfig === void 0 ? void 0 : spotterSidebarConfig.enablePastConversationsSidebar,
|
|
21629
|
+
standaloneValue: enablePastConversationsSidebar,
|
|
21630
|
+
});
|
|
21631
|
+
const hasConfig = spotterSidebarConfig || resolvedEnablePastConversations !== undefined;
|
|
21632
|
+
if (!hasConfig)
|
|
21633
|
+
return defaultAppInitData;
|
|
21634
|
+
const resolvedSidebarConfig = {
|
|
21635
|
+
...spotterSidebarConfig,
|
|
21636
|
+
...(resolvedEnablePastConversations !== undefined && {
|
|
21637
|
+
enablePastConversationsSidebar: resolvedEnablePastConversations,
|
|
21638
|
+
}),
|
|
21639
|
+
};
|
|
21640
|
+
if (resolvedSidebarConfig.spotterDocumentationUrl !== undefined) {
|
|
21641
|
+
const [isValid, validationError] = validateHttpUrl(resolvedSidebarConfig.spotterDocumentationUrl);
|
|
21642
|
+
if (!isValid) {
|
|
21643
|
+
handleError({
|
|
21644
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21645
|
+
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
21646
|
+
code: EmbedErrorCodes.INVALID_URL,
|
|
21647
|
+
error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
21648
|
+
});
|
|
21649
|
+
delete resolvedSidebarConfig.spotterDocumentationUrl;
|
|
21650
|
+
}
|
|
21651
|
+
}
|
|
21652
|
+
return {
|
|
21653
|
+
...defaultAppInitData,
|
|
21654
|
+
embedParams: {
|
|
21655
|
+
...(defaultAppInitData.embedParams || {}),
|
|
21656
|
+
spotterSidebarConfig: resolvedSidebarConfig,
|
|
21657
|
+
},
|
|
21658
|
+
};
|
|
21659
|
+
}
|
|
21660
|
+
|
|
20592
21661
|
/**
|
|
20593
21662
|
* Copyright (c) 2022
|
|
20594
21663
|
*
|
|
@@ -20718,7 +21787,10 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
20718
21787
|
this.defaultHeight = 500;
|
|
20719
21788
|
this.sendFullHeightLazyLoadData = () => {
|
|
20720
21789
|
const data = calculateVisibleElementData(this.iFrame);
|
|
20721
|
-
this
|
|
21790
|
+
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
21791
|
+
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
21792
|
+
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
|
|
21793
|
+
}
|
|
20722
21794
|
};
|
|
20723
21795
|
/**
|
|
20724
21796
|
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
@@ -20771,12 +21843,28 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
20771
21843
|
this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
|
|
20772
21844
|
}
|
|
20773
21845
|
}
|
|
21846
|
+
/**
|
|
21847
|
+
* Extends the default APP_INIT payload with `embedParams.spotterSidebarConfig`
|
|
21848
|
+
* so the conv-assist app can read sidebar configuration on initialisation.
|
|
21849
|
+
*
|
|
21850
|
+
* Precedence for `enablePastConversationsSidebar`:
|
|
21851
|
+
* `spotterSidebarConfig.enablePastConversationsSidebar` wins over the
|
|
21852
|
+
* deprecated top-level `enablePastConversationsSidebar` flag; if the former
|
|
21853
|
+
* is absent the latter is used as a fallback.
|
|
21854
|
+
*
|
|
21855
|
+
* An invalid `spotterDocumentationUrl` triggers a validation error and is
|
|
21856
|
+
* excluded from the payload rather than forwarded to the app.
|
|
21857
|
+
*/
|
|
21858
|
+
async getAppInitData() {
|
|
21859
|
+
const defaultAppInitData = await super.getAppInitData();
|
|
21860
|
+
return buildSpotterSidebarAppInitData(defaultAppInitData, this.viewConfig, this.handleError.bind(this));
|
|
21861
|
+
}
|
|
20774
21862
|
/**
|
|
20775
21863
|
* Constructs a map of parameters to be passed on to the
|
|
20776
21864
|
* embedded Liveboard or visualization.
|
|
20777
21865
|
*/
|
|
20778
21866
|
getEmbedParams() {
|
|
20779
|
-
const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt,
|
|
21867
|
+
const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, spotterChatConfig, minimumHeight, isThisPeriodInDateFiltersEnabled, enableHomepageAnnouncement = false, isContinuousLiveboardPDFEnabled, } = this.viewConfig;
|
|
20780
21868
|
let params = {};
|
|
20781
21869
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
20782
21870
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -20800,39 +21888,6 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
20800
21888
|
if (!isUndefined(updatedSpotterChatPrompt)) {
|
|
20801
21889
|
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
20802
21890
|
}
|
|
20803
|
-
const resolvedEnablePastConversationsSidebar = resolveEnablePastConversationsSidebar({
|
|
20804
|
-
spotterSidebarConfigValue: spotterSidebarConfig === null || spotterSidebarConfig === void 0 ? void 0 : spotterSidebarConfig.enablePastConversationsSidebar,
|
|
20805
|
-
standaloneValue: this.viewConfig.enablePastConversationsSidebar,
|
|
20806
|
-
});
|
|
20807
|
-
setParamIfDefined(params, Param.EnablePastConversationsSidebar, resolvedEnablePastConversationsSidebar, true);
|
|
20808
|
-
// Handle spotterSidebarConfig params
|
|
20809
|
-
if (spotterSidebarConfig) {
|
|
20810
|
-
const { spotterSidebarTitle, spotterSidebarDefaultExpanded, spotterChatRenameLabel, spotterChatDeleteLabel, spotterDeleteConversationModalTitle, spotterPastConversationAlertMessage, spotterDocumentationUrl, spotterBestPracticesLabel, spotterConversationsBatchSize, spotterNewChatButtonTitle, } = spotterSidebarConfig;
|
|
20811
|
-
setParamIfDefined(params, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
|
|
20812
|
-
setParamIfDefined(params, Param.SpotterSidebarTitle, spotterSidebarTitle);
|
|
20813
|
-
setParamIfDefined(params, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
|
|
20814
|
-
setParamIfDefined(params, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
|
|
20815
|
-
setParamIfDefined(params, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
|
|
20816
|
-
setParamIfDefined(params, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
|
|
20817
|
-
setParamIfDefined(params, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
|
|
20818
|
-
setParamIfDefined(params, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
|
|
20819
|
-
setParamIfDefined(params, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
|
|
20820
|
-
// URL param with validation
|
|
20821
|
-
if (spotterDocumentationUrl !== undefined) {
|
|
20822
|
-
const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
|
|
20823
|
-
if (isValid) {
|
|
20824
|
-
params[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
|
|
20825
|
-
}
|
|
20826
|
-
else {
|
|
20827
|
-
this.handleError({
|
|
20828
|
-
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
20829
|
-
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
20830
|
-
code: EmbedErrorCodes.INVALID_URL,
|
|
20831
|
-
error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
20832
|
-
});
|
|
20833
|
-
}
|
|
20834
|
-
}
|
|
20835
|
-
}
|
|
20836
21891
|
// Handle spotterChatConfig params
|
|
20837
21892
|
if (spotterChatConfig) {
|
|
20838
21893
|
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
|
|
@@ -20908,6 +21963,9 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
20908
21963
|
if (enableHomepageAnnouncement !== undefined) {
|
|
20909
21964
|
params[Param.EnableHomepageAnnouncement] = enableHomepageAnnouncement;
|
|
20910
21965
|
}
|
|
21966
|
+
if (isContinuousLiveboardPDFEnabled !== undefined) {
|
|
21967
|
+
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
21968
|
+
}
|
|
20911
21969
|
this.defaultHeight = minimumHeight || this.defaultHeight;
|
|
20912
21970
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
20913
21971
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
@@ -21183,7 +22241,10 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
21183
22241
|
this.defaultHeight = 500;
|
|
21184
22242
|
this.sendFullHeightLazyLoadData = () => {
|
|
21185
22243
|
const data = calculateVisibleElementData(this.iFrame);
|
|
21186
|
-
this
|
|
22244
|
+
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
22245
|
+
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
22246
|
+
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
|
|
22247
|
+
}
|
|
21187
22248
|
};
|
|
21188
22249
|
/**
|
|
21189
22250
|
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
@@ -21263,7 +22324,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
21263
22324
|
getEmbedParamsObject() {
|
|
21264
22325
|
let params = {};
|
|
21265
22326
|
params = this.getBaseQueryParams(params);
|
|
21266
|
-
const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, spotterChatConfig, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
|
|
22327
|
+
const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, spotterChatConfig, isThisPeriodInDateFiltersEnabled, isContinuousLiveboardPDFEnabled, } = this.viewConfig;
|
|
21267
22328
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
21268
22329
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
21269
22330
|
if (fullHeight === true) {
|
|
@@ -21352,6 +22413,9 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
21352
22413
|
if (isThisPeriodInDateFiltersEnabled !== undefined) {
|
|
21353
22414
|
params[Param.IsThisPeriodInDateFiltersEnabled] = isThisPeriodInDateFiltersEnabled;
|
|
21354
22415
|
}
|
|
22416
|
+
if (isContinuousLiveboardPDFEnabled !== undefined) {
|
|
22417
|
+
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
22418
|
+
}
|
|
21355
22419
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
21356
22420
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
21357
22421
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
@@ -21368,7 +22432,8 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
21368
22432
|
}
|
|
21369
22433
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId) {
|
|
21370
22434
|
// Extract view from liveboardId if passed along with it (legacy
|
|
21371
|
-
// approach)
|
|
22435
|
+
// approach)
|
|
22436
|
+
// View must be appended as query param at the end, not
|
|
21372
22437
|
// embedded in path
|
|
21373
22438
|
let liveboardGuid = liveboardId;
|
|
21374
22439
|
let legacyViewId;
|
|
@@ -22098,14 +23163,24 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
22098
23163
|
super(container, viewConfig);
|
|
22099
23164
|
this.viewConfig = viewConfig;
|
|
22100
23165
|
}
|
|
23166
|
+
/**
|
|
23167
|
+
* Extends the default APP_INIT payload with `embedParams.spotterSidebarConfig`
|
|
23168
|
+
* so the conv-assist app can read sidebar configuration on initialisation.
|
|
23169
|
+
*
|
|
23170
|
+
* Precedence for `enablePastConversationsSidebar`:
|
|
23171
|
+
* `spotterSidebarConfig.enablePastConversationsSidebar` wins over the
|
|
23172
|
+
* deprecated top-level `enablePastConversationsSidebar` flag; if the former
|
|
23173
|
+
* is absent the latter is used as a fallback.
|
|
23174
|
+
*
|
|
23175
|
+
* An invalid `spotterDocumentationUrl` triggers a validation error and is
|
|
23176
|
+
* excluded from the payload rather than forwarded to the app.
|
|
23177
|
+
*/
|
|
23178
|
+
async getAppInitData() {
|
|
23179
|
+
const defaultAppInitData = await super.getAppInitData();
|
|
23180
|
+
return buildSpotterSidebarAppInitData(defaultAppInitData, this.viewConfig, this.handleError.bind(this));
|
|
23181
|
+
}
|
|
22101
23182
|
getEmbedParamsObject() {
|
|
22102
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt,
|
|
22103
|
-
// Extract sidebar config properties
|
|
22104
|
-
const { enablePastConversationsSidebar: sidebarEnablePastConversationsSidebar, spotterSidebarTitle, spotterSidebarDefaultExpanded, spotterChatRenameLabel, spotterChatDeleteLabel, spotterDeleteConversationModalTitle, spotterPastConversationAlertMessage, spotterDocumentationUrl, spotterBestPracticesLabel, spotterConversationsBatchSize, spotterNewChatButtonTitle, } = spotterSidebarConfig || {};
|
|
22105
|
-
const resolvedEnablePastConversationsSidebar = resolveEnablePastConversationsSidebar({
|
|
22106
|
-
spotterSidebarConfigValue: sidebarEnablePastConversationsSidebar,
|
|
22107
|
-
standaloneValue: this.viewConfig.enablePastConversationsSidebar,
|
|
22108
|
-
});
|
|
23183
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, spotterChatConfig, } = this.viewConfig;
|
|
22109
23184
|
if (!worksheetId) {
|
|
22110
23185
|
this.handleError({
|
|
22111
23186
|
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
@@ -22123,32 +23198,6 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
22123
23198
|
setParamIfDefined(queryParams, Param.ShowSpotterLimitations, showSpotterLimitations, true);
|
|
22124
23199
|
setParamIfDefined(queryParams, Param.HideSampleQuestions, hideSampleQuestions, true);
|
|
22125
23200
|
setParamIfDefined(queryParams, Param.UpdatedSpotterChatPrompt, updatedSpotterChatPrompt, true);
|
|
22126
|
-
setParamIfDefined(queryParams, Param.EnablePastConversationsSidebar, resolvedEnablePastConversationsSidebar, true);
|
|
22127
|
-
setParamIfDefined(queryParams, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
|
|
22128
|
-
// String params
|
|
22129
|
-
setParamIfDefined(queryParams, Param.SpotterSidebarTitle, spotterSidebarTitle);
|
|
22130
|
-
setParamIfDefined(queryParams, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
|
|
22131
|
-
setParamIfDefined(queryParams, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
|
|
22132
|
-
setParamIfDefined(queryParams, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
|
|
22133
|
-
setParamIfDefined(queryParams, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
|
|
22134
|
-
setParamIfDefined(queryParams, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
|
|
22135
|
-
setParamIfDefined(queryParams, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
|
|
22136
|
-
setParamIfDefined(queryParams, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
|
|
22137
|
-
// URL param with validation
|
|
22138
|
-
if (spotterDocumentationUrl !== undefined) {
|
|
22139
|
-
const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
|
|
22140
|
-
if (isValid) {
|
|
22141
|
-
queryParams[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
|
|
22142
|
-
}
|
|
22143
|
-
else {
|
|
22144
|
-
this.handleError({
|
|
22145
|
-
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
22146
|
-
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
22147
|
-
code: EmbedErrorCodes.INVALID_URL,
|
|
22148
|
-
error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
22149
|
-
});
|
|
22150
|
-
}
|
|
22151
|
-
}
|
|
22152
23201
|
// Handle spotterChatConfig params
|
|
22153
23202
|
if (spotterChatConfig) {
|
|
22154
23203
|
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
|
|
@@ -22222,60 +23271,64 @@ const componentFactory = (EmbedConstructor,
|
|
|
22222
23271
|
// intended for preRendering. If set to true, the component will call the
|
|
22223
23272
|
// Embed.preRender() method instead of the usual render method, and it will
|
|
22224
23273
|
// not be destroyed when the component is unmounted.
|
|
22225
|
-
isPreRenderedComponent = false) =>
|
|
22226
|
-
const
|
|
22227
|
-
|
|
22228
|
-
|
|
22229
|
-
|
|
22230
|
-
|
|
22231
|
-
|
|
22232
|
-
|
|
22233
|
-
|
|
22234
|
-
|
|
22235
|
-
|
|
22236
|
-
|
|
22237
|
-
|
|
22238
|
-
|
|
22239
|
-
|
|
22240
|
-
const handlePreRenderRendering = (tsEmbed) => {
|
|
22241
|
-
tsEmbed.preRender();
|
|
22242
|
-
};
|
|
22243
|
-
const handleDefaultRendering = (tsEmbed) => {
|
|
22244
|
-
// if component is connected to a preRendered component
|
|
22245
|
-
if (props.preRenderId) {
|
|
22246
|
-
tsEmbed.showPreRender();
|
|
22247
|
-
return;
|
|
22248
|
-
}
|
|
22249
|
-
tsEmbed.render();
|
|
22250
|
-
};
|
|
22251
|
-
const handleRendering = (tsEmbed) => {
|
|
22252
|
-
if (isPreRenderedComponent) {
|
|
22253
|
-
handlePreRenderRendering(tsEmbed);
|
|
22254
|
-
return;
|
|
22255
|
-
}
|
|
22256
|
-
handleDefaultRendering(tsEmbed);
|
|
22257
|
-
};
|
|
22258
|
-
useDeepCompareEffect(() => {
|
|
22259
|
-
const tsEmbed = new EmbedConstructor(ref.current, deepMerge({
|
|
22260
|
-
insertAsSibling: viewConfig.insertAsSibling,
|
|
22261
|
-
frameParams: {
|
|
22262
|
-
class: viewConfig.insertAsSibling ? className || '' : '',
|
|
22263
|
-
},
|
|
22264
|
-
}, viewConfig));
|
|
22265
|
-
Object.keys(listeners).forEach((eventName) => {
|
|
22266
|
-
tsEmbed.on(eventName, listeners[eventName]);
|
|
22267
|
-
});
|
|
22268
|
-
handleRendering(tsEmbed);
|
|
22269
|
-
if (forwardedRef) {
|
|
22270
|
-
forwardedRef.current = tsEmbed;
|
|
22271
|
-
}
|
|
22272
|
-
return () => {
|
|
22273
|
-
handleDestroy(tsEmbed);
|
|
23274
|
+
isPreRenderedComponent = false) => {
|
|
23275
|
+
const Component = React__default.forwardRef((props, forwardedRef) => {
|
|
23276
|
+
const ref = React__default.useRef(null);
|
|
23277
|
+
const { className, style, ...embedProps } = props;
|
|
23278
|
+
const { viewConfig, listeners } = getViewPropsAndListeners(embedProps);
|
|
23279
|
+
const handleDestroy = (tsEmbed) => {
|
|
23280
|
+
// do not destroy if it is a preRender component
|
|
23281
|
+
if (isPreRenderedComponent)
|
|
23282
|
+
return;
|
|
23283
|
+
// if component is connected to a preRendered component
|
|
23284
|
+
if (props.preRenderId) {
|
|
23285
|
+
tsEmbed.hidePreRender();
|
|
23286
|
+
return;
|
|
23287
|
+
}
|
|
23288
|
+
tsEmbed.destroy();
|
|
22274
23289
|
};
|
|
22275
|
-
|
|
22276
|
-
|
|
22277
|
-
|
|
22278
|
-
|
|
23290
|
+
const handlePreRenderRendering = (tsEmbed) => {
|
|
23291
|
+
tsEmbed.preRender();
|
|
23292
|
+
};
|
|
23293
|
+
const handleDefaultRendering = (tsEmbed) => {
|
|
23294
|
+
// if component is connected to a preRendered component
|
|
23295
|
+
if (props.preRenderId) {
|
|
23296
|
+
tsEmbed.showPreRender();
|
|
23297
|
+
return;
|
|
23298
|
+
}
|
|
23299
|
+
tsEmbed.render();
|
|
23300
|
+
};
|
|
23301
|
+
const handleRendering = (tsEmbed) => {
|
|
23302
|
+
if (isPreRenderedComponent) {
|
|
23303
|
+
handlePreRenderRendering(tsEmbed);
|
|
23304
|
+
return;
|
|
23305
|
+
}
|
|
23306
|
+
handleDefaultRendering(tsEmbed);
|
|
23307
|
+
};
|
|
23308
|
+
useDeepCompareEffect(() => {
|
|
23309
|
+
const tsEmbed = new EmbedConstructor(ref.current, deepMerge({
|
|
23310
|
+
insertAsSibling: viewConfig.insertAsSibling,
|
|
23311
|
+
frameParams: {
|
|
23312
|
+
class: viewConfig.insertAsSibling ? className || '' : '',
|
|
23313
|
+
},
|
|
23314
|
+
}, viewConfig));
|
|
23315
|
+
Object.keys(listeners).forEach((eventName) => {
|
|
23316
|
+
tsEmbed.on(eventName, listeners[eventName]);
|
|
23317
|
+
});
|
|
23318
|
+
handleRendering(tsEmbed);
|
|
23319
|
+
if (forwardedRef) {
|
|
23320
|
+
forwardedRef.current = tsEmbed;
|
|
23321
|
+
}
|
|
23322
|
+
return () => {
|
|
23323
|
+
handleDestroy(tsEmbed);
|
|
23324
|
+
};
|
|
23325
|
+
}, [viewConfig, listeners]);
|
|
23326
|
+
const preRenderStyles = isPreRenderedComponent ? { display: 'none' } : {};
|
|
23327
|
+
return viewConfig.insertAsSibling ? (React__default.createElement("span", { "data-testid": "tsEmbed", ref: ref, style: { position: 'absolute', ...preRenderStyles } })) : (React__default.createElement("div", { "data-testid": "tsEmbed", ref: ref, style: { ...style, ...preRenderStyles }, className: `ts-embed-container ${className}` }));
|
|
23328
|
+
});
|
|
23329
|
+
Component.displayName = EmbedConstructor.name || 'EmbedComponent';
|
|
23330
|
+
return Component;
|
|
23331
|
+
};
|
|
22279
23332
|
/**
|
|
22280
23333
|
* React component for Search Embed.
|
|
22281
23334
|
* @example
|
|
@@ -22489,6 +23542,7 @@ const SpotterMessage = React__default.forwardRef((props, ref) => {
|
|
|
22489
23542
|
const { message, query: _, ...otherProps } = props;
|
|
22490
23543
|
return (React__default.createElement(ConversationMessage, { ref: ref, ...message, ...otherProps }));
|
|
22491
23544
|
});
|
|
23545
|
+
SpotterMessage.displayName = 'SpotterMessage';
|
|
22492
23546
|
/**
|
|
22493
23547
|
* React component for PreRendered Conversation embed.
|
|
22494
23548
|
*
|