@thoughtspot/visual-embed-sdk 1.46.3 → 1.46.5-beta.1
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 +51 -17
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +1 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +10 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +46 -1
- 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/events.spec.js +72 -0
- package/cjs/src/embed/events.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +74 -3
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +7 -0
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +10 -0
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +46 -9
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +155 -0
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +1 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +11 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +96 -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/ts-embed.d.ts +41 -2
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +41 -2
- package/cjs/src/embed/ts-embed.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 +730 -32
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +734 -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/dist/{index-DyX-x6uN.js → index-DW2wEHqy.js} +1 -1
- 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 +51 -17
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +1 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +74 -3
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +10 -0
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +1 -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/ts-embed.d.ts +41 -2
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +730 -32
- 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/tsembed-react.es.js +917 -77
- package/dist/tsembed-react.js +915 -75
- package/dist/tsembed.es.js +859 -24
- package/dist/tsembed.js +857 -22
- package/dist/visual-embed-sdk-react-full.d.ts +892 -54
- package/dist/visual-embed-sdk-react.d.ts +892 -54
- package/dist/visual-embed-sdk.d.ts +912 -56
- 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 +51 -17
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +1 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +10 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +46 -1
- 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/events.spec.js +73 -1
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +74 -3
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +7 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +10 -0
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +46 -9
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +155 -0
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +1 -0
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +11 -2
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +96 -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/ts-embed.d.ts +41 -2
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +42 -3
- package/lib/src/embed/ts-embed.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 +730 -32
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +734 -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/visual-embed-sdk.d.ts +973 -116
- 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 +51 -17
- package/src/embed/app.spec.ts +62 -3
- package/src/embed/app.ts +10 -1
- package/src/embed/base.spec.ts +1 -2
- package/src/embed/base.ts +1 -4
- package/src/embed/events.spec.ts +88 -0
- package/src/embed/hostEventClient/contracts.ts +74 -2
- package/src/embed/hostEventClient/host-event-client.spec.ts +257 -0
- package/src/embed/hostEventClient/host-event-client.ts +70 -15
- package/src/embed/liveboard.spec.ts +126 -2
- package/src/embed/liveboard.ts +11 -2
- package/src/embed/sage.ts +0 -1
- package/src/embed/search.spec.ts +0 -2
- package/src/embed/ts-embed.ts +43 -3
- package/src/react/index.tsx +76 -72
- package/src/types.ts +739 -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/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-beta.1 */
|
|
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
|
|
@@ -1460,22 +1464,45 @@ var EmbedEvent;
|
|
|
1460
1464
|
/**
|
|
1461
1465
|
* Emitted when name, status (private or public) or filter values of a
|
|
1462
1466
|
* Personalised view is updated.
|
|
1467
|
+
* This event is deprecated. Use {@link EmbedEvent.UpdatePersonalizedView} instead.
|
|
1463
1468
|
* @returns viewName: string
|
|
1464
1469
|
* @returns viewId: string
|
|
1465
1470
|
* @returns liveboardId: string
|
|
1466
1471
|
* @returns isPublic: boolean
|
|
1467
1472
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
|
|
1473
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1468
1474
|
*/
|
|
1469
1475
|
EmbedEvent["UpdatePersonalisedView"] = "updatePersonalisedView";
|
|
1476
|
+
/**
|
|
1477
|
+
* Emitted when name, status (private or public) or filter values of a
|
|
1478
|
+
* Personalized view is updated.
|
|
1479
|
+
* @returns viewName: string
|
|
1480
|
+
* @returns viewId: string
|
|
1481
|
+
* @returns liveboardId: string
|
|
1482
|
+
* @returns isPublic: boolean
|
|
1483
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1484
|
+
*/
|
|
1485
|
+
EmbedEvent["UpdatePersonalizedView"] = "updatePersonalisedView";
|
|
1470
1486
|
/**
|
|
1471
1487
|
* Emitted when a Personalised view is saved.
|
|
1488
|
+
* This event is deprecated. Use {@link EmbedEvent.SavePersonalizedView} instead.
|
|
1472
1489
|
* @returns viewName: string
|
|
1473
1490
|
* @returns viewId: string
|
|
1474
1491
|
* @returns liveboardId: string
|
|
1475
1492
|
* @returns isPublic: boolean
|
|
1476
1493
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
|
|
1494
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1477
1495
|
*/
|
|
1478
1496
|
EmbedEvent["SavePersonalisedView"] = "savePersonalisedView";
|
|
1497
|
+
/**
|
|
1498
|
+
* Emitted when a Personalized view is saved.
|
|
1499
|
+
* @returns viewName: string
|
|
1500
|
+
* @returns viewId: string
|
|
1501
|
+
* @returns liveboardId: string
|
|
1502
|
+
* @returns isPublic: boolean
|
|
1503
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1504
|
+
*/
|
|
1505
|
+
EmbedEvent["SavePersonalizedView"] = "savePersonalisedView";
|
|
1479
1506
|
/**
|
|
1480
1507
|
* Emitted when a Liveboard is reset.
|
|
1481
1508
|
* @returns viewName: string
|
|
@@ -1487,11 +1514,41 @@ var EmbedEvent;
|
|
|
1487
1514
|
EmbedEvent["ResetLiveboard"] = "resetLiveboard";
|
|
1488
1515
|
/**
|
|
1489
1516
|
* Emitted when a PersonalisedView is deleted.
|
|
1517
|
+
* This event is deprecated. Use {@link EmbedEvent.DeletePersonalizedView} instead.
|
|
1490
1518
|
* @returns views: string[]
|
|
1491
1519
|
* @returns liveboardId: string
|
|
1492
1520
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
|
|
1521
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1493
1522
|
*/
|
|
1494
1523
|
EmbedEvent["DeletePersonalisedView"] = "deletePersonalisedView";
|
|
1524
|
+
/**
|
|
1525
|
+
* Emitted when a PersonalizedView is deleted.
|
|
1526
|
+
* @returns views: string[]
|
|
1527
|
+
* @returns liveboardId: string
|
|
1528
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1529
|
+
*/
|
|
1530
|
+
EmbedEvent["DeletePersonalizedView"] = "deletePersonalisedView";
|
|
1531
|
+
/**
|
|
1532
|
+
* Emitted when a user selects a different Personalized View or
|
|
1533
|
+
* resets to the original/default view on a Liveboard.
|
|
1534
|
+
* @example
|
|
1535
|
+
* ```js
|
|
1536
|
+
* liveboardEmbed.on(EmbedEvent.ChangePersonalizedView, (data) => {
|
|
1537
|
+
* console.log(data.viewName); // 'Q4 Revenue' or 'Original View'
|
|
1538
|
+
* console.log(data.viewId); // '2a021a12-...' or null (default)
|
|
1539
|
+
* console.log(data.liveboardId); // 'abc123...'
|
|
1540
|
+
* console.log(data.isPublic); // true | false
|
|
1541
|
+
* })
|
|
1542
|
+
* ```
|
|
1543
|
+
* @returns viewName: string - Name of the selected view,
|
|
1544
|
+
* or 'Original View' when reset to default.
|
|
1545
|
+
* @returns viewId: string | null - GUID of the selected view,
|
|
1546
|
+
* or null when reset to default.
|
|
1547
|
+
* @returns liveboardId: string
|
|
1548
|
+
* @returns isPublic: boolean
|
|
1549
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1550
|
+
*/
|
|
1551
|
+
EmbedEvent["ChangePersonalizedView"] = "changePersonalisedView";
|
|
1495
1552
|
/**
|
|
1496
1553
|
* Emitted when a user creates a Worksheet.
|
|
1497
1554
|
* @version SDK: 1.27.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
@@ -1525,7 +1582,8 @@ var EmbedEvent;
|
|
|
1525
1582
|
* @param - Includes the following parameters:
|
|
1526
1583
|
* - `payload`: The payload received from the embed related to the Data API call.
|
|
1527
1584
|
* - `responder`: Contains elements that let developers define whether ThoughtSpot
|
|
1528
|
-
* will run or block the search operation, and if blocked, which error message to
|
|
1585
|
+
* will run or block the search operation, and if blocked, which error message to
|
|
1586
|
+
* provide.
|
|
1529
1587
|
* - `execute` - When `execute` returns `true`, the search is run.
|
|
1530
1588
|
* When `execute` returns `false`, the search is not executed.
|
|
1531
1589
|
* - `error` - Developers can customize the user-facing error message when `execute`
|
|
@@ -1959,6 +2017,25 @@ var EmbedEvent;
|
|
|
1959
2017
|
* );
|
|
1960
2018
|
* }
|
|
1961
2019
|
* ```
|
|
2020
|
+
*
|
|
2021
|
+
* **Context Parameter (SDK: 1.45.2+)**
|
|
2022
|
+
*
|
|
2023
|
+
* Starting from SDK version 1.45.2 | ThoughtSpot: 26.3.0.cl, you can optionally pass a
|
|
2024
|
+
* `ContextType` as the third parameter to the `trigger` method to specify the context
|
|
2025
|
+
* from which the event is triggered. This helps ThoughtSpot understand the current page
|
|
2026
|
+
* context (Search, Answer, Liveboard, or Spotter) for better event handling.
|
|
2027
|
+
*
|
|
2028
|
+
* @example
|
|
2029
|
+
* ```js
|
|
2030
|
+
* import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2031
|
+
*
|
|
2032
|
+
* // Trigger Pin event with Search context
|
|
2033
|
+
* appEmbed.trigger(HostEvent.Pin, {
|
|
2034
|
+
* vizId: "123",
|
|
2035
|
+
* liveboardId: "456"
|
|
2036
|
+
* }, ContextType.Search);
|
|
2037
|
+
* ```
|
|
2038
|
+
*
|
|
1962
2039
|
* @group Events
|
|
1963
2040
|
*/
|
|
1964
2041
|
var HostEvent;
|
|
@@ -1981,6 +2058,16 @@ var HostEvent;
|
|
|
1981
2058
|
execute: true
|
|
1982
2059
|
});
|
|
1983
2060
|
* ```
|
|
2061
|
+
* @example
|
|
2062
|
+
* ```js
|
|
2063
|
+
* // Trigger search from search context
|
|
2064
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2065
|
+
* appEmbed.trigger(HostEvent.Search, {
|
|
2066
|
+
* searchQuery: "[revenue] by [region]",
|
|
2067
|
+
* dataSources: ["cd252e5c-b552-49a8-821d-3eadaa049cca"],
|
|
2068
|
+
* execute: true
|
|
2069
|
+
* }, ContextType.Search);
|
|
2070
|
+
* ```
|
|
1984
2071
|
*/
|
|
1985
2072
|
HostEvent["Search"] = "search";
|
|
1986
2073
|
/**
|
|
@@ -2031,6 +2118,24 @@ var HostEvent;
|
|
|
2031
2118
|
* });
|
|
2032
2119
|
* })
|
|
2033
2120
|
* ```
|
|
2121
|
+
* @example
|
|
2122
|
+
* ```js
|
|
2123
|
+
* // Drill down from answer context
|
|
2124
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2125
|
+
* appEmbed.trigger(HostEvent.DrillDown, {
|
|
2126
|
+
* points: { clickedPoint, selectedPoints },
|
|
2127
|
+
* autoDrillDown: true
|
|
2128
|
+
* }, ContextType.Answer);
|
|
2129
|
+
* ```
|
|
2130
|
+
* @example
|
|
2131
|
+
* ```js
|
|
2132
|
+
* // Drill down from search context
|
|
2133
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2134
|
+
* searchEmbed.trigger(HostEvent.DrillDown, {
|
|
2135
|
+
* points: { clickedPoint, selectedPoints },
|
|
2136
|
+
* columnGuid: "column-guid"
|
|
2137
|
+
* }, ContextType.Search);
|
|
2138
|
+
* ```
|
|
2034
2139
|
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
2035
2140
|
*/
|
|
2036
2141
|
HostEvent["DrillDown"] = "triggerDrillDown";
|
|
@@ -2051,6 +2156,13 @@ var HostEvent;
|
|
|
2051
2156
|
* const url = embed.trigger(HostEvent.GetIframeUrl);
|
|
2052
2157
|
* console.log("iFrameURL",url);
|
|
2053
2158
|
* ```
|
|
2159
|
+
* @example
|
|
2160
|
+
* ```js
|
|
2161
|
+
* // Get iframe URL from specific context
|
|
2162
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2163
|
+
* const url = await appEmbed.trigger(HostEvent.GetIframeUrl, {}, ContextType.Answer);
|
|
2164
|
+
* console.log("iFrameURL", url);
|
|
2165
|
+
* ```
|
|
2054
2166
|
* @version SDK: 1.35.0 | ThoughtSpot: 10.4.0.cl
|
|
2055
2167
|
*/
|
|
2056
2168
|
HostEvent["GetIframeUrl"] = "GetIframeUrl";
|
|
@@ -2064,6 +2176,15 @@ var HostEvent;
|
|
|
2064
2176
|
* '730496d6-6903-4601-937e-2c691821af3c',
|
|
2065
2177
|
* 'd547ec54-2a37-4516-a222-2b06719af726'])
|
|
2066
2178
|
* ```
|
|
2179
|
+
* @example
|
|
2180
|
+
* ```js
|
|
2181
|
+
* // Set visible vizs from liveboard context
|
|
2182
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2183
|
+
* liveboardEmbed.trigger(HostEvent.SetVisibleVizs, [
|
|
2184
|
+
* '730496d6-6903-4601-937e-2c691821af3c',
|
|
2185
|
+
* 'd547ec54-2a37-4516-a222-2b06719af726'
|
|
2186
|
+
* ], ContextType.Liveboard);
|
|
2187
|
+
* ```
|
|
2067
2188
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
2068
2189
|
*/
|
|
2069
2190
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
@@ -2076,6 +2197,14 @@ var HostEvent;
|
|
|
2076
2197
|
* tabId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2077
2198
|
* })
|
|
2078
2199
|
* ```
|
|
2200
|
+
* @example
|
|
2201
|
+
* ```js
|
|
2202
|
+
* // Set active tab from liveboard context
|
|
2203
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2204
|
+
* liveboardEmbed.trigger(HostEvent.SetActiveTab, {
|
|
2205
|
+
* tabId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2206
|
+
* }, ContextType.Liveboard);
|
|
2207
|
+
* ```
|
|
2079
2208
|
* @version SDK: 1.24.0 | ThoughtSpot: 9.5.0.cl, 9.5.1-sw
|
|
2080
2209
|
*/
|
|
2081
2210
|
HostEvent["SetActiveTab"] = "SetActiveTab";
|
|
@@ -2109,6 +2238,15 @@ var HostEvent;
|
|
|
2109
2238
|
* {columnName: "item type",operator: RuntimeFilterOp.EQ,values: ["Jackets"]}
|
|
2110
2239
|
* ])
|
|
2111
2240
|
* ```
|
|
2241
|
+
* @example
|
|
2242
|
+
* ```js
|
|
2243
|
+
* // Update runtime filters from liveboard context
|
|
2244
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2245
|
+
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
2246
|
+
* {columnName: "region", operator: RuntimeFilterOp.EQ, values: ["west"]},
|
|
2247
|
+
* {columnName: "product", operator: RuntimeFilterOp.IN, values: ["shoes", "boots"]}
|
|
2248
|
+
* ], ContextType.Liveboard);
|
|
2249
|
+
* ```
|
|
2112
2250
|
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
|
|
2113
2251
|
* @important
|
|
2114
2252
|
*/
|
|
@@ -2142,6 +2280,14 @@ var HostEvent;
|
|
|
2142
2280
|
* LiveboardEmbed.trigger(HostEvent.OpenFilter,
|
|
2143
2281
|
* { column: {columnId: '<column-GUID>'}})
|
|
2144
2282
|
* ```
|
|
2283
|
+
* @example
|
|
2284
|
+
* ```js
|
|
2285
|
+
* // Open filter from search context
|
|
2286
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2287
|
+
* searchEmbed.trigger(HostEvent.OpenFilter, {
|
|
2288
|
+
* column: { columnId: '<column-GUID>', name: 'region', type: 'ATTRIBUTE', dataType: 'CHAR'}
|
|
2289
|
+
* }, ContextType.Search);
|
|
2290
|
+
* ```
|
|
2145
2291
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2146
2292
|
*/
|
|
2147
2293
|
HostEvent["OpenFilter"] = "openFilter";
|
|
@@ -2152,6 +2298,14 @@ var HostEvent;
|
|
|
2152
2298
|
* ```js
|
|
2153
2299
|
* searchEmbed.trigger(HostEvent.AddColumns, { columnIds: ['<column-GUID>','<column-GUID>'] })
|
|
2154
2300
|
* ```
|
|
2301
|
+
* @example
|
|
2302
|
+
* ```js
|
|
2303
|
+
* // Add columns from search context
|
|
2304
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2305
|
+
* searchEmbed.trigger(HostEvent.AddColumns, {
|
|
2306
|
+
* columnIds: ['col-guid-1', 'col-guid-2']
|
|
2307
|
+
* }, ContextType.Search);
|
|
2308
|
+
* ```
|
|
2155
2309
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2156
2310
|
*/
|
|
2157
2311
|
HostEvent["AddColumns"] = "addColumns";
|
|
@@ -2162,6 +2316,14 @@ var HostEvent;
|
|
|
2162
2316
|
* ```js
|
|
2163
2317
|
* searchEmbed.trigger(HostEvent.RemoveColumn, { columnId: '<column-Guid>' })
|
|
2164
2318
|
* ```
|
|
2319
|
+
* @example
|
|
2320
|
+
* ```js
|
|
2321
|
+
* // Remove column from search context
|
|
2322
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2323
|
+
* searchEmbed.trigger(HostEvent.RemoveColumn, {
|
|
2324
|
+
* columnId: 'column-guid'
|
|
2325
|
+
* }, ContextType.Search);
|
|
2326
|
+
* ```
|
|
2165
2327
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2166
2328
|
*/
|
|
2167
2329
|
HostEvent["RemoveColumn"] = "removeColumn";
|
|
@@ -2248,6 +2410,37 @@ var HostEvent;
|
|
|
2248
2410
|
*
|
|
2249
2411
|
* spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
|
|
2250
2412
|
* ```
|
|
2413
|
+
* @example
|
|
2414
|
+
* ```js
|
|
2415
|
+
* // Using context parameter to specify the context type (SDK: 1.45.2+)
|
|
2416
|
+
* // Pin from a search answer context
|
|
2417
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2418
|
+
* appEmbed.trigger(HostEvent.Pin, {
|
|
2419
|
+
* vizId: "123",
|
|
2420
|
+
* newVizName: "Sales by region",
|
|
2421
|
+
* liveboardId: "456"
|
|
2422
|
+
* }, ContextType.Search);
|
|
2423
|
+
* ```
|
|
2424
|
+
* @example
|
|
2425
|
+
* ```js
|
|
2426
|
+
* // Pin from an answer context (explore modal/page) (SDK: 1.45.2+)
|
|
2427
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2428
|
+
* appEmbed.trigger(HostEvent.Pin, {
|
|
2429
|
+
* vizId: "789",
|
|
2430
|
+
* newVizName: "Revenue trends",
|
|
2431
|
+
* liveboardId: "456"
|
|
2432
|
+
* }, ContextType.Answer);
|
|
2433
|
+
* ```
|
|
2434
|
+
* @example
|
|
2435
|
+
* ```js
|
|
2436
|
+
* // Pin from a spotter context (SDK: 1.45.2+)
|
|
2437
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2438
|
+
* appEmbed.trigger(HostEvent.Pin, {
|
|
2439
|
+
* vizId: latestSpotterVizId,
|
|
2440
|
+
* newVizName: "AI-generated insights",
|
|
2441
|
+
* liveboardId: "456"
|
|
2442
|
+
* }, ContextType.Spotter);
|
|
2443
|
+
* ```
|
|
2251
2444
|
*
|
|
2252
2445
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2253
2446
|
*/
|
|
@@ -2258,6 +2451,12 @@ var HostEvent;
|
|
|
2258
2451
|
* @example
|
|
2259
2452
|
* ```js
|
|
2260
2453
|
* liveboardEmbed.trigger(HostEvent.LiveboardInfo)
|
|
2454
|
+
*```
|
|
2455
|
+
* @example
|
|
2456
|
+
* ```js
|
|
2457
|
+
* // Show liveboard info from liveboard context
|
|
2458
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2459
|
+
* liveboardEmbed.trigger(HostEvent.LiveboardInfo, {}, ContextType.Liveboard);
|
|
2261
2460
|
* ```
|
|
2262
2461
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2263
2462
|
*/
|
|
@@ -2268,6 +2467,12 @@ var HostEvent;
|
|
|
2268
2467
|
* ```js
|
|
2269
2468
|
* liveboardEmbed.trigger(HostEvent.Schedule)
|
|
2270
2469
|
* ```
|
|
2470
|
+
* @example
|
|
2471
|
+
* ```js
|
|
2472
|
+
* // Schedule from liveboard context
|
|
2473
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2474
|
+
* liveboardEmbed.trigger(HostEvent.Schedule, {}, ContextType.Liveboard);
|
|
2475
|
+
* ```
|
|
2271
2476
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2272
2477
|
*/
|
|
2273
2478
|
HostEvent["Schedule"] = "subscription";
|
|
@@ -2277,6 +2482,12 @@ var HostEvent;
|
|
|
2277
2482
|
* ```js
|
|
2278
2483
|
* liveboardEmbed.trigger(HostEvent.ScheduleList)
|
|
2279
2484
|
* ```
|
|
2485
|
+
* @example
|
|
2486
|
+
* ```js
|
|
2487
|
+
* // Manage schedules from liveboard context
|
|
2488
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2489
|
+
* liveboardEmbed.trigger(HostEvent.ScheduleList, {}, ContextType.Liveboard);
|
|
2490
|
+
* ```
|
|
2280
2491
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2281
2492
|
*/
|
|
2282
2493
|
HostEvent["SchedulesList"] = "schedule-list";
|
|
@@ -2287,6 +2498,18 @@ var HostEvent;
|
|
|
2287
2498
|
* ```js
|
|
2288
2499
|
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
2289
2500
|
* ```
|
|
2501
|
+
* @example
|
|
2502
|
+
* ```js
|
|
2503
|
+
* // Export TML from liveboard context
|
|
2504
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2505
|
+
* liveboardEmbed.trigger(HostEvent.ExportTML, {}, ContextType.Liveboard);
|
|
2506
|
+
* ```
|
|
2507
|
+
* @example
|
|
2508
|
+
* ```js
|
|
2509
|
+
* // Export TML from search-answer context
|
|
2510
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2511
|
+
* appEmbed.trigger(HostEvent.ExportTML, {}, ContextType.Search);
|
|
2512
|
+
* ```
|
|
2290
2513
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2291
2514
|
*/
|
|
2292
2515
|
HostEvent["ExportTML"] = "exportTSL";
|
|
@@ -2297,6 +2520,18 @@ var HostEvent;
|
|
|
2297
2520
|
* ```js
|
|
2298
2521
|
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
2299
2522
|
* ```
|
|
2523
|
+
* @example
|
|
2524
|
+
* ```js
|
|
2525
|
+
* // Edit TML from liveboard context
|
|
2526
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2527
|
+
* liveboardEmbed.trigger(HostEvent.EditTML, {}, ContextType.Liveboard);
|
|
2528
|
+
* ```
|
|
2529
|
+
* @example
|
|
2530
|
+
* ```js
|
|
2531
|
+
* // Edit TML from search-answer context
|
|
2532
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2533
|
+
* appEmbed.trigger(HostEvent.EditTML, {}, ContextType.Search);
|
|
2534
|
+
* ```
|
|
2300
2535
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2301
2536
|
*/
|
|
2302
2537
|
HostEvent["EditTML"] = "editTSL";
|
|
@@ -2306,6 +2541,12 @@ var HostEvent;
|
|
|
2306
2541
|
* ```js
|
|
2307
2542
|
* liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
2308
2543
|
* ```
|
|
2544
|
+
* @example
|
|
2545
|
+
* ```js
|
|
2546
|
+
* // Update TML from liveboard context
|
|
2547
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2548
|
+
* liveboardEmbed.trigger(HostEvent.UpdateTML, {}, ContextType.Liveboard);
|
|
2549
|
+
* ```
|
|
2309
2550
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2310
2551
|
*/
|
|
2311
2552
|
HostEvent["UpdateTML"] = "updateTSL";
|
|
@@ -2332,6 +2573,18 @@ var HostEvent;
|
|
|
2332
2573
|
*
|
|
2333
2574
|
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
|
|
2334
2575
|
* ```
|
|
2576
|
+
* @example
|
|
2577
|
+
* ```js
|
|
2578
|
+
* // Download as PDF from search-answer context
|
|
2579
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2580
|
+
* appEmbed.trigger(HostEvent.DownloadAsPdf, {}, ContextType.Search);
|
|
2581
|
+
* ```
|
|
2582
|
+
* @example
|
|
2583
|
+
* ```js
|
|
2584
|
+
* // Download as PDF from liveboard context
|
|
2585
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2586
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsPdf, {}, ContextType.Liveboard);
|
|
2587
|
+
* ```
|
|
2335
2588
|
*
|
|
2336
2589
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2337
2590
|
*/
|
|
@@ -2376,6 +2629,18 @@ var HostEvent;
|
|
|
2376
2629
|
*
|
|
2377
2630
|
* spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
|
|
2378
2631
|
* ```
|
|
2632
|
+
* @example
|
|
2633
|
+
* ```js
|
|
2634
|
+
* // Make a copy from answer context
|
|
2635
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2636
|
+
* appEmbed.trigger(HostEvent.MakeACopy, {}, ContextType.Answer);
|
|
2637
|
+
* ```
|
|
2638
|
+
* @example
|
|
2639
|
+
* ```js
|
|
2640
|
+
* // Make a copy from search context
|
|
2641
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2642
|
+
* appEmbed.trigger(HostEvent.MakeACopy, {}, ContextType.Search);
|
|
2643
|
+
* ```
|
|
2379
2644
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2380
2645
|
*/
|
|
2381
2646
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2400,6 +2665,14 @@ var HostEvent;
|
|
|
2400
2665
|
* ```js
|
|
2401
2666
|
* liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2402
2667
|
* ```
|
|
2668
|
+
* @example
|
|
2669
|
+
* ```js
|
|
2670
|
+
* // Explore from liveboard context
|
|
2671
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2672
|
+
* liveboardEmbed.trigger(HostEvent.Explore, {
|
|
2673
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2674
|
+
* }, ContextType.Liveboard);
|
|
2675
|
+
* ```
|
|
2403
2676
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2404
2677
|
*/
|
|
2405
2678
|
HostEvent["Explore"] = "explore";
|
|
@@ -2417,6 +2690,20 @@ var HostEvent;
|
|
|
2417
2690
|
* ```js
|
|
2418
2691
|
* searchEmbed.trigger(HostEvent.CreateMonitor)
|
|
2419
2692
|
* ```
|
|
2693
|
+
* @example
|
|
2694
|
+
* ```js
|
|
2695
|
+
* // Create monitor from answer context
|
|
2696
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2697
|
+
* appEmbed.trigger(HostEvent.CreateMonitor, {}, ContextType.Answer);
|
|
2698
|
+
* ```
|
|
2699
|
+
* @example
|
|
2700
|
+
* ```js
|
|
2701
|
+
* // Create monitor from liveboard context
|
|
2702
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2703
|
+
* liveboardEmbed.trigger(HostEvent.CreateMonitor, {
|
|
2704
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2705
|
+
* }, ContextType.Liveboard);
|
|
2706
|
+
* ```
|
|
2420
2707
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2421
2708
|
*/
|
|
2422
2709
|
HostEvent["CreateMonitor"] = "createMonitor";
|
|
@@ -2438,6 +2725,20 @@ var HostEvent;
|
|
|
2438
2725
|
* ```js
|
|
2439
2726
|
* vizEmbed.trigger(HostEvent.ManageMonitor)
|
|
2440
2727
|
* ```
|
|
2728
|
+
* @example
|
|
2729
|
+
* ```js
|
|
2730
|
+
* // Manage monitor from answer context
|
|
2731
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2732
|
+
* appEmbed.trigger(HostEvent.ManageMonitor, {}, ContextType.Answer);
|
|
2733
|
+
* ```
|
|
2734
|
+
* @example
|
|
2735
|
+
* ```js
|
|
2736
|
+
* // Manage monitor from liveboard context
|
|
2737
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2738
|
+
* liveboardEmbed.trigger(HostEvent.ManageMonitor, {
|
|
2739
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2740
|
+
* }, ContextType.Liveboard);
|
|
2741
|
+
* ```
|
|
2441
2742
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2442
2743
|
*/
|
|
2443
2744
|
HostEvent["ManageMonitor"] = "manageMonitor";
|
|
@@ -2463,6 +2764,26 @@ var HostEvent;
|
|
|
2463
2764
|
* ```js
|
|
2464
2765
|
* spotterEmbed.trigger(HostEvent.Edit);
|
|
2465
2766
|
* ```
|
|
2767
|
+
* @example
|
|
2768
|
+
* ```js
|
|
2769
|
+
* // Using context parameter to edit liveboard context
|
|
2770
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2771
|
+
* liveboardEmbed.trigger(HostEvent.Edit, {}, ContextType.Liveboard);
|
|
2772
|
+
* ```
|
|
2773
|
+
* @example
|
|
2774
|
+
* ```js
|
|
2775
|
+
* // Edit from search context
|
|
2776
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2777
|
+
* appEmbed.trigger(HostEvent.Edit, {}, ContextType.Search);
|
|
2778
|
+
* ```
|
|
2779
|
+
* * @example
|
|
2780
|
+
* ```js
|
|
2781
|
+
* // Edit from spotter context
|
|
2782
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2783
|
+
* appEmbed.trigger(HostEvent.Edit, {
|
|
2784
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2785
|
+
* }, ContextType.Spotter);
|
|
2786
|
+
* ```
|
|
2466
2787
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2467
2788
|
*/
|
|
2468
2789
|
HostEvent["Edit"] = "edit";
|
|
@@ -2480,6 +2801,20 @@ var HostEvent;
|
|
|
2480
2801
|
* ```js
|
|
2481
2802
|
* vizEmbed.trigger(HostEvent.CopyLink)
|
|
2482
2803
|
* ```
|
|
2804
|
+
* @example
|
|
2805
|
+
* ```js
|
|
2806
|
+
* // Copy link from liveboard context
|
|
2807
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2808
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink, {}, ContextType.Liveboard);
|
|
2809
|
+
* ```
|
|
2810
|
+
* @example
|
|
2811
|
+
* ```js
|
|
2812
|
+
* // Copy link from liveboard visualization context
|
|
2813
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2814
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink, {
|
|
2815
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2816
|
+
* }, ContextType.Liveboard);
|
|
2817
|
+
* ```
|
|
2483
2818
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2484
2819
|
*/
|
|
2485
2820
|
HostEvent["CopyLink"] = "embedDocument";
|
|
@@ -2497,6 +2832,20 @@ var HostEvent;
|
|
|
2497
2832
|
* ```js
|
|
2498
2833
|
* vizEmbed.trigger(HostEvent.Present)
|
|
2499
2834
|
* ```
|
|
2835
|
+
* @example
|
|
2836
|
+
* ```js
|
|
2837
|
+
* // Present from liveboard visualization context
|
|
2838
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2839
|
+
* liveboardEmbed.trigger(HostEvent.Present, {
|
|
2840
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2841
|
+
* }, ContextType.Liveboard);
|
|
2842
|
+
* ```
|
|
2843
|
+
* @example
|
|
2844
|
+
* ```js
|
|
2845
|
+
* // Present from liveboard context
|
|
2846
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2847
|
+
* liveboardEmbed.trigger(HostEvent.Present, {}, ContextType.Liveboard);
|
|
2848
|
+
* ```
|
|
2500
2849
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2501
2850
|
*/
|
|
2502
2851
|
HostEvent["Present"] = "present";
|
|
@@ -2525,6 +2874,22 @@ var HostEvent;
|
|
|
2525
2874
|
* tml.answer.search_query // TML representation of the search query
|
|
2526
2875
|
* );
|
|
2527
2876
|
* })
|
|
2877
|
+
* ```
|
|
2878
|
+
* @example
|
|
2879
|
+
* ```js
|
|
2880
|
+
* // Get TML from search context
|
|
2881
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2882
|
+
* appEmbed.trigger(HostEvent.GetTML, {}, ContextType.Search).then((tml) => {
|
|
2883
|
+
* console.log(tml.answer.search_query);
|
|
2884
|
+
* });
|
|
2885
|
+
* ```
|
|
2886
|
+
* @example
|
|
2887
|
+
* ```js
|
|
2888
|
+
* // Get TML from search-answer context
|
|
2889
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2890
|
+
* appEmbed.trigger(HostEvent.GetTML, {}, ContextType.Search).then((tml) => {
|
|
2891
|
+
* console.log(tml.answer);
|
|
2892
|
+
* });
|
|
2528
2893
|
* ```
|
|
2529
2894
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2530
2895
|
* @important
|
|
@@ -2546,6 +2911,20 @@ var HostEvent;
|
|
|
2546
2911
|
* ```js
|
|
2547
2912
|
* searchEmbed.trigger(HostEvent.ShowUnderlyingData)
|
|
2548
2913
|
* ```
|
|
2914
|
+
* @example
|
|
2915
|
+
* ```js
|
|
2916
|
+
* // Show underlying data from liveboard visualization context
|
|
2917
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2918
|
+
* appEmbed.trigger(HostEvent.ShowUnderlyingData, {
|
|
2919
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2920
|
+
* }, ContextType.Liveboard);
|
|
2921
|
+
* ```
|
|
2922
|
+
* @example
|
|
2923
|
+
* ```js
|
|
2924
|
+
* // Show underlying data from search context
|
|
2925
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2926
|
+
* appEmbed.trigger(HostEvent.ShowUnderlyingData, {}, ContextType.Search);
|
|
2927
|
+
* ```
|
|
2549
2928
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2550
2929
|
*/
|
|
2551
2930
|
HostEvent["ShowUnderlyingData"] = "showUnderlyingData";
|
|
@@ -2563,6 +2942,18 @@ var HostEvent;
|
|
|
2563
2942
|
* ```js
|
|
2564
2943
|
* searchEmbed.trigger(HostEvent.Delete)
|
|
2565
2944
|
* ```
|
|
2945
|
+
* @example
|
|
2946
|
+
* ```js
|
|
2947
|
+
* // Delete from liveboard context
|
|
2948
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2949
|
+
* liveboardEmbed.trigger(HostEvent.Delete, {}, ContextType.Liveboard);
|
|
2950
|
+
* ```
|
|
2951
|
+
* @example
|
|
2952
|
+
* ```js
|
|
2953
|
+
* // Delete from search context
|
|
2954
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2955
|
+
* appEmbed.trigger(HostEvent.Delete, {}, ContextType.Search);
|
|
2956
|
+
* ```
|
|
2566
2957
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2567
2958
|
*/
|
|
2568
2959
|
HostEvent["Delete"] = "onDeleteAnswer";
|
|
@@ -2583,6 +2974,20 @@ var HostEvent;
|
|
|
2583
2974
|
* ```js
|
|
2584
2975
|
* searchEmbed.trigger(HostEvent.SpotIQAnalyze)
|
|
2585
2976
|
* ```
|
|
2977
|
+
* @example
|
|
2978
|
+
* ```js
|
|
2979
|
+
* // SpotIQ analyze from search-answer context
|
|
2980
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2981
|
+
* appEmbed.trigger(HostEvent.SpotIQAnalyze, { vizId: '730496d6-6903-4601-937e-2c691821af3c' }, ContextType.Search);
|
|
2982
|
+
* ```
|
|
2983
|
+
* @example
|
|
2984
|
+
* ```js
|
|
2985
|
+
* // SpotIQ analyze from search context
|
|
2986
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2987
|
+
* liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {
|
|
2988
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2989
|
+
* }, ContextType.Liveboard);
|
|
2990
|
+
* ```
|
|
2586
2991
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2587
2992
|
*/
|
|
2588
2993
|
HostEvent["SpotIQAnalyze"] = "spotIQAnalyze";
|
|
@@ -2634,9 +3039,16 @@ var HostEvent;
|
|
|
2634
3039
|
*
|
|
2635
3040
|
* spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
|
|
2636
3041
|
* ```
|
|
3042
|
+
* @example
|
|
3043
|
+
* ```js
|
|
3044
|
+
* // Download as PNG from search-answer context
|
|
3045
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3046
|
+
* appEmbed.trigger(HostEvent.DownloadAsPng, {}, ContextType.Search);
|
|
3047
|
+
* ```
|
|
2637
3048
|
*
|
|
2638
3049
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
2639
3050
|
*/
|
|
3051
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
2640
3052
|
HostEvent["DownloadAsPng"] = "downloadAsPng";
|
|
2641
3053
|
/**
|
|
2642
3054
|
* Trigger the **Download** > **CSV** action on tables in
|
|
@@ -2662,6 +3074,18 @@ var HostEvent;
|
|
|
2662
3074
|
*
|
|
2663
3075
|
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
|
|
2664
3076
|
* ```
|
|
3077
|
+
* @example
|
|
3078
|
+
* ```js
|
|
3079
|
+
* // Download as CSV from search-answer context
|
|
3080
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3081
|
+
* appEmbed.trigger(HostEvent.DownloadAsCsv, {}, ContextType.Search);
|
|
3082
|
+
* ```
|
|
3083
|
+
* @example
|
|
3084
|
+
* ```js
|
|
3085
|
+
* // Download as CSV from search context
|
|
3086
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3087
|
+
* searchEmbed.trigger(HostEvent.DownloadAsCsv, {}, ContextType.Search);
|
|
3088
|
+
* ```
|
|
2665
3089
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2666
3090
|
*/
|
|
2667
3091
|
HostEvent["DownloadAsCsv"] = "downloadAsCSV";
|
|
@@ -2689,6 +3113,18 @@ var HostEvent;
|
|
|
2689
3113
|
*
|
|
2690
3114
|
* spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
|
|
2691
3115
|
* ```
|
|
3116
|
+
* @example
|
|
3117
|
+
* ```js
|
|
3118
|
+
* // Download as XLSX from answer context
|
|
3119
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3120
|
+
* appEmbed.trigger(HostEvent.DownloadAsXlsx, {}, ContextType.Answer);
|
|
3121
|
+
* ```
|
|
3122
|
+
* @example
|
|
3123
|
+
* ```js
|
|
3124
|
+
* // Download as XLSX from search context
|
|
3125
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3126
|
+
* searchEmbed.trigger(HostEvent.DownloadAsXlsx, {}, ContextType.Search);
|
|
3127
|
+
* ```
|
|
2692
3128
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2693
3129
|
*/
|
|
2694
3130
|
HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
@@ -2702,6 +3138,18 @@ var HostEvent;
|
|
|
2702
3138
|
* ```js
|
|
2703
3139
|
* searchEmbed.trigger(HostEvent.Share)
|
|
2704
3140
|
* ```
|
|
3141
|
+
* @example
|
|
3142
|
+
* ```js
|
|
3143
|
+
* // Share from Liveboard context
|
|
3144
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3145
|
+
* liveboardEmbed.trigger(HostEvent.Share, {}, ContextType.Liveboard);
|
|
3146
|
+
* ```
|
|
3147
|
+
* @example
|
|
3148
|
+
* ```js
|
|
3149
|
+
* // Share from search-answer context
|
|
3150
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3151
|
+
* appEmbed.trigger(HostEvent.Share, {}, ContextType.Search);
|
|
3152
|
+
* ```
|
|
2705
3153
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2706
3154
|
*/
|
|
2707
3155
|
HostEvent["Share"] = "share";
|
|
@@ -2741,6 +3189,18 @@ var HostEvent;
|
|
|
2741
3189
|
*
|
|
2742
3190
|
* spotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });
|
|
2743
3191
|
* ```
|
|
3192
|
+
* @example
|
|
3193
|
+
* ```js
|
|
3194
|
+
* // Save from answer context
|
|
3195
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3196
|
+
* appEmbed.trigger(HostEvent.Save, {}, ContextType.Answer);
|
|
3197
|
+
* ```
|
|
3198
|
+
* @example
|
|
3199
|
+
* ```js
|
|
3200
|
+
* // Save from search context
|
|
3201
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3202
|
+
* searchEmbed.trigger(HostEvent.Save, {}, ContextType.Search);
|
|
3203
|
+
* ```
|
|
2744
3204
|
*
|
|
2745
3205
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2746
3206
|
*/
|
|
@@ -2757,6 +3217,20 @@ var HostEvent;
|
|
|
2757
3217
|
* ```js
|
|
2758
3218
|
* vizEmbed.trigger(HostEvent.SyncToSheets)
|
|
2759
3219
|
* ```
|
|
3220
|
+
* @example
|
|
3221
|
+
* ```js
|
|
3222
|
+
* // Sync to sheets from answer context
|
|
3223
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3224
|
+
* appEmbed.trigger(HostEvent.SyncToSheets, {}, ContextType.Answer);
|
|
3225
|
+
* ```
|
|
3226
|
+
* @example
|
|
3227
|
+
* ```js
|
|
3228
|
+
* // Sync to sheets from liveboard context
|
|
3229
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3230
|
+
* liveboardEmbed.trigger(HostEvent.SyncToSheets, {
|
|
3231
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
3232
|
+
* }, ContextType.Liveboard);
|
|
3233
|
+
* ```
|
|
2760
3234
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2761
3235
|
*/
|
|
2762
3236
|
HostEvent["SyncToSheets"] = "sync-to-sheets";
|
|
@@ -2773,6 +3247,20 @@ var HostEvent;
|
|
|
2773
3247
|
* ```js
|
|
2774
3248
|
* vizEmbed.trigger(HostEvent.SyncToOtherApps)
|
|
2775
3249
|
* ```
|
|
3250
|
+
* @example
|
|
3251
|
+
* ```js
|
|
3252
|
+
* // Sync to other apps from answer context
|
|
3253
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3254
|
+
* appEmbed.trigger(HostEvent.SyncToOtherApps, {}, ContextType.Answer);
|
|
3255
|
+
* ```
|
|
3256
|
+
* @example
|
|
3257
|
+
* ```js
|
|
3258
|
+
* // Sync to other apps from liveboard context
|
|
3259
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3260
|
+
* liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {
|
|
3261
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
3262
|
+
* }, ContextType.Liveboard);
|
|
3263
|
+
* ```
|
|
2776
3264
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2777
3265
|
*/
|
|
2778
3266
|
HostEvent["SyncToOtherApps"] = "sync-to-other-apps";
|
|
@@ -2789,6 +3277,20 @@ var HostEvent;
|
|
|
2789
3277
|
* ```js
|
|
2790
3278
|
* vizEmbed.trigger(HostEvent.ManagePipelines)
|
|
2791
3279
|
* ```
|
|
3280
|
+
* @example
|
|
3281
|
+
* ```js
|
|
3282
|
+
* // Manage pipelines from answer context
|
|
3283
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3284
|
+
* appEmbed.trigger(HostEvent.ManagePipelines, {}, ContextType.Answer);
|
|
3285
|
+
* ```
|
|
3286
|
+
* @example
|
|
3287
|
+
* ```js
|
|
3288
|
+
* // Manage pipelines from liveboard context
|
|
3289
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3290
|
+
* liveboardEmbed.trigger(HostEvent.ManagePipelines, {
|
|
3291
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
3292
|
+
* }, ContextType.Liveboard);
|
|
3293
|
+
* ```
|
|
2792
3294
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2793
3295
|
*/
|
|
2794
3296
|
HostEvent["ManagePipelines"] = "manage-pipeline";
|
|
@@ -2801,6 +3303,12 @@ var HostEvent;
|
|
|
2801
3303
|
* ```js
|
|
2802
3304
|
* appEmbed.trigger(HostEvent.ResetSearch)
|
|
2803
3305
|
* ```
|
|
3306
|
+
* @example
|
|
3307
|
+
* ```js
|
|
3308
|
+
* // Reset search from search context
|
|
3309
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3310
|
+
* searchEmbed.trigger(HostEvent.ResetSearch, {}, ContextType.Search);
|
|
3311
|
+
* ```
|
|
2804
3312
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1.sw
|
|
2805
3313
|
*/
|
|
2806
3314
|
HostEvent["ResetSearch"] = "resetSearch";
|
|
@@ -2812,6 +3320,13 @@ var HostEvent;
|
|
|
2812
3320
|
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
|
|
2813
3321
|
* console.log('data', data);
|
|
2814
3322
|
* ```
|
|
3323
|
+
* @example
|
|
3324
|
+
* ```js
|
|
3325
|
+
* // Get filters from liveboard context
|
|
3326
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3327
|
+
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters, {}, ContextType.Liveboard);
|
|
3328
|
+
* console.log('filters', data);
|
|
3329
|
+
* ```
|
|
2815
3330
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
2816
3331
|
*/
|
|
2817
3332
|
HostEvent["GetFilters"] = "getFilters";
|
|
@@ -2819,7 +3334,8 @@ var HostEvent;
|
|
|
2819
3334
|
* Update one or several filters applied on a Liveboard.
|
|
2820
3335
|
* @param - Includes the following keys:
|
|
2821
3336
|
* - `filter`: A single filter object containing column name, filter operator, and
|
|
2822
|
-
* values.
|
|
3337
|
+
* values.
|
|
3338
|
+
* - `filters`: Multiple filter objects with column name, filter operator,
|
|
2823
3339
|
* and values for each.
|
|
2824
3340
|
*
|
|
2825
3341
|
* Each filter object must include the following attributes:
|
|
@@ -2902,6 +3418,18 @@ var HostEvent;
|
|
|
2902
3418
|
* }]
|
|
2903
3419
|
* });
|
|
2904
3420
|
* ```
|
|
3421
|
+
* @example
|
|
3422
|
+
* ```js
|
|
3423
|
+
* // Update filters from liveboard context
|
|
3424
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3425
|
+
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3426
|
+
* filter: {
|
|
3427
|
+
* column: "item type",
|
|
3428
|
+
* oper: "IN",
|
|
3429
|
+
* values: ["shoes", "boots"]
|
|
3430
|
+
* }
|
|
3431
|
+
* }, ContextType.Liveboard);
|
|
3432
|
+
* ```
|
|
2905
3433
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
2906
3434
|
*/
|
|
2907
3435
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
@@ -2915,6 +3443,14 @@ var HostEvent;
|
|
|
2915
3443
|
* );
|
|
2916
3444
|
* })
|
|
2917
3445
|
* ```
|
|
3446
|
+
* @example
|
|
3447
|
+
* ```js
|
|
3448
|
+
* // Get tabs from liveboard context
|
|
3449
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3450
|
+
* liveboardEmbed.trigger(HostEvent.GetTabs, {}, ContextType.Liveboard).then((tabDetails) => {
|
|
3451
|
+
* console.log('tabs', tabDetails);
|
|
3452
|
+
* });
|
|
3453
|
+
* ```
|
|
2918
3454
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl
|
|
2919
3455
|
*/
|
|
2920
3456
|
HostEvent["GetTabs"] = "getTabs";
|
|
@@ -2928,6 +3464,15 @@ var HostEvent;
|
|
|
2928
3464
|
* '430496d6-6903-4601-937e-2c691821af3c',
|
|
2929
3465
|
* 'f547ec54-2a37-4516-a222-2b06719af726'])
|
|
2930
3466
|
* ```
|
|
3467
|
+
* @example
|
|
3468
|
+
* ```js
|
|
3469
|
+
* // Set visible tabs from liveboard context
|
|
3470
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3471
|
+
* liveboardEmbed.trigger(HostEvent.SetVisibleTabs, [
|
|
3472
|
+
* '430496d6-6903-4601-937e-2c691821af3c',
|
|
3473
|
+
* 'f547ec54-2a37-4516-a222-2b06719af726'
|
|
3474
|
+
* ], ContextType.Liveboard);
|
|
3475
|
+
* ```
|
|
2931
3476
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
|
|
2932
3477
|
*/
|
|
2933
3478
|
HostEvent["SetVisibleTabs"] = "SetPinboardVisibleTabs";
|
|
@@ -2941,6 +3486,15 @@ var HostEvent;
|
|
|
2941
3486
|
* '630496d6-6903-4601-937e-2c691821af3c',
|
|
2942
3487
|
* 'i547ec54-2a37-4516-a222-2b06719af726'])
|
|
2943
3488
|
* ```
|
|
3489
|
+
* @example
|
|
3490
|
+
* ```js
|
|
3491
|
+
* // Set hidden tabs from liveboard context
|
|
3492
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3493
|
+
* liveboardEmbed.trigger(HostEvent.SetHiddenTabs, [
|
|
3494
|
+
* '630496d6-6903-4601-937e-2c691821af3c',
|
|
3495
|
+
* 'i547ec54-2a37-4516-a222-2b06719af726'
|
|
3496
|
+
* ], ContextType.Liveboard);
|
|
3497
|
+
* ```
|
|
2944
3498
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
|
|
2945
3499
|
*/
|
|
2946
3500
|
HostEvent["SetHiddenTabs"] = "SetPinboardHiddenTabs";
|
|
@@ -3017,13 +3571,24 @@ var HostEvent;
|
|
|
3017
3571
|
HostEvent["UpdateCrossFilter"] = "UpdateCrossFilter";
|
|
3018
3572
|
/**
|
|
3019
3573
|
* Trigger reset action for a personalized Liveboard view.
|
|
3574
|
+
* This event is deprecated. Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
|
|
3020
3575
|
* @example
|
|
3021
3576
|
* ```js
|
|
3022
3577
|
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
|
|
3023
3578
|
* ```
|
|
3024
3579
|
* @version SDK: 1.29.0 | ThoughtSpot Cloud: 10.1.0.cl, 10.1.0.sw
|
|
3580
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
3025
3581
|
*/
|
|
3026
3582
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
3583
|
+
/**
|
|
3584
|
+
* Trigger reset action for a personalized Liveboard view.
|
|
3585
|
+
* @example
|
|
3586
|
+
* ```js
|
|
3587
|
+
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalizedView);
|
|
3588
|
+
* ```
|
|
3589
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
3590
|
+
*/
|
|
3591
|
+
HostEvent["ResetLiveboardPersonalizedView"] = "ResetLiveboardPersonalisedView";
|
|
3027
3592
|
/**
|
|
3028
3593
|
* Triggers an action to update Parameter values on embedded
|
|
3029
3594
|
* Answers, Liveboard, and Spotter answer in Edit mode.
|
|
@@ -3040,6 +3605,16 @@ var HostEvent;
|
|
|
3040
3605
|
* isVisibleToUser: false
|
|
3041
3606
|
* }])
|
|
3042
3607
|
* ```
|
|
3608
|
+
* @example
|
|
3609
|
+
* ```js
|
|
3610
|
+
* // Update parameters from liveboard context
|
|
3611
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3612
|
+
* liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
|
|
3613
|
+
* name: "Region Param",
|
|
3614
|
+
* value: "West",
|
|
3615
|
+
* isVisibleToUser: true
|
|
3616
|
+
* }], ContextType.Liveboard);
|
|
3617
|
+
* ```
|
|
3043
3618
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
3044
3619
|
*/
|
|
3045
3620
|
HostEvent["UpdateParameters"] = "UpdateParameters";
|
|
@@ -3059,18 +3634,77 @@ var HostEvent;
|
|
|
3059
3634
|
* });
|
|
3060
3635
|
*
|
|
3061
3636
|
* spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
|
|
3637
|
+
*```
|
|
3638
|
+
* @example
|
|
3639
|
+
* ```js
|
|
3640
|
+
* // Get parameters from liveboard context
|
|
3641
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3642
|
+
* liveboardEmbed.trigger(HostEvent.GetParameters, {}, ContextType.Liveboard).then((parameters) => {
|
|
3643
|
+
* console.log('parameters', parameters);
|
|
3644
|
+
* });
|
|
3062
3645
|
* ```
|
|
3063
3646
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
3064
3647
|
*/
|
|
3065
3648
|
HostEvent["GetParameters"] = "GetParameters";
|
|
3066
3649
|
/**
|
|
3067
3650
|
* Triggers an event to update a personalized view of a Liveboard.
|
|
3651
|
+
* This event is deprecated. Use {@link HostEvent.UpdatePersonalizedView} instead.
|
|
3068
3652
|
* ```js
|
|
3069
3653
|
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
|
|
3070
3654
|
* ```
|
|
3655
|
+
* @example
|
|
3656
|
+
* ```js
|
|
3657
|
+
* // Update personalized view from liveboard context
|
|
3658
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3659
|
+
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {
|
|
3660
|
+
* viewId: '1234'
|
|
3661
|
+
* }, ContextType.Liveboard);
|
|
3662
|
+
* ```
|
|
3071
3663
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
3664
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
3072
3665
|
*/
|
|
3073
3666
|
HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
|
|
3667
|
+
/**
|
|
3668
|
+
* Triggers an event to update a personalized view of a Liveboard.
|
|
3669
|
+
* ```js
|
|
3670
|
+
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
|
|
3671
|
+
* ```
|
|
3672
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
3673
|
+
*/
|
|
3674
|
+
HostEvent["UpdatePersonalizedView"] = "UpdatePersonalisedView";
|
|
3675
|
+
/**
|
|
3676
|
+
* Triggers selection of a specific Personalized View on a
|
|
3677
|
+
* Liveboard without reloading the embed. Pass either a
|
|
3678
|
+
* `viewId` (GUID) or `viewName`. If both are provided, `viewId` takes precedence.
|
|
3679
|
+
* If neither is provided, the Liveboard resets to the original/default view.
|
|
3680
|
+
* When a `viewName` is provided and multiple views share
|
|
3681
|
+
* the same name, the first match is selected.
|
|
3682
|
+
* @example
|
|
3683
|
+
* ```js
|
|
3684
|
+
* liveboardEmbed.trigger(
|
|
3685
|
+
* HostEvent.SelectPersonalizedView,
|
|
3686
|
+
* { viewId: '2a021a12-1aed-425d-984b-141ee916ce72' },
|
|
3687
|
+
* )
|
|
3688
|
+
* ```
|
|
3689
|
+
* @example
|
|
3690
|
+
* ```js
|
|
3691
|
+
* // Select by name
|
|
3692
|
+
* liveboardEmbed.trigger(
|
|
3693
|
+
* HostEvent.SelectPersonalizedView,
|
|
3694
|
+
* { viewName: 'Dr Smith Cardiology' },
|
|
3695
|
+
* )
|
|
3696
|
+
* ```
|
|
3697
|
+
* @example
|
|
3698
|
+
* ```js
|
|
3699
|
+
* // Reset to default view
|
|
3700
|
+
* liveboardEmbed.trigger(
|
|
3701
|
+
* HostEvent.SelectPersonalizedView,
|
|
3702
|
+
* {},
|
|
3703
|
+
* )
|
|
3704
|
+
* ```
|
|
3705
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
3706
|
+
*/
|
|
3707
|
+
HostEvent["SelectPersonalizedView"] = "SelectPersonalisedView";
|
|
3074
3708
|
/**
|
|
3075
3709
|
* @hidden
|
|
3076
3710
|
* Notify when info call is completed successfully
|
|
@@ -3090,7 +3724,8 @@ var HostEvent;
|
|
|
3090
3724
|
* add a name and description for the Answer.
|
|
3091
3725
|
* @param - Includes the following keys:
|
|
3092
3726
|
* - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
|
|
3093
|
-
* embed.
|
|
3727
|
+
* embed.
|
|
3728
|
+
* - `name`: Optional. Name string for the Answer.
|
|
3094
3729
|
* - `description`: Optional. Description text for the Answer.
|
|
3095
3730
|
* @example
|
|
3096
3731
|
* ```js
|
|
@@ -3109,6 +3744,34 @@ var HostEvent;
|
|
|
3109
3744
|
*
|
|
3110
3745
|
* spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
|
|
3111
3746
|
* ```
|
|
3747
|
+
* @example
|
|
3748
|
+
* ```js
|
|
3749
|
+
* // Using context parameter to save answer from search context
|
|
3750
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3751
|
+
* const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
|
|
3752
|
+
* name: "Regional sales analysis",
|
|
3753
|
+
* description: "Sales breakdown by region"
|
|
3754
|
+
* }, ContextType.Search);
|
|
3755
|
+
* ```
|
|
3756
|
+
* @example
|
|
3757
|
+
* ```js
|
|
3758
|
+
* // Save answer from answer context (explore modal)
|
|
3759
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3760
|
+
* const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
|
|
3761
|
+
* name: "Modified analysis",
|
|
3762
|
+
* description: "Updated from explore view"
|
|
3763
|
+
* }, ContextType.Answer);
|
|
3764
|
+
* ```
|
|
3765
|
+
* @example
|
|
3766
|
+
* ```js
|
|
3767
|
+
* // Save answer from spotter context
|
|
3768
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3769
|
+
* const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
|
|
3770
|
+
* vizId: latestSpotterVizId,
|
|
3771
|
+
* name: "AI insights",
|
|
3772
|
+
* description: "Generated from Spotter"
|
|
3773
|
+
* }, ContextType.Spotter);
|
|
3774
|
+
* ```
|
|
3112
3775
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
3113
3776
|
*/
|
|
3114
3777
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
@@ -3150,6 +3813,15 @@ var HostEvent;
|
|
|
3150
3813
|
* executeSearch: true,
|
|
3151
3814
|
* })
|
|
3152
3815
|
* ```
|
|
3816
|
+
* @example
|
|
3817
|
+
* ```js
|
|
3818
|
+
* // Spotter search from spotter context
|
|
3819
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3820
|
+
* spotterEmbed.trigger(HostEvent.SpotterSearch, {
|
|
3821
|
+
* query: 'sales by region',
|
|
3822
|
+
* executeSearch: true
|
|
3823
|
+
* }, ContextType.Spotter);
|
|
3824
|
+
* ```
|
|
3153
3825
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3154
3826
|
*/
|
|
3155
3827
|
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
@@ -3160,6 +3832,12 @@ var HostEvent;
|
|
|
3160
3832
|
* ```js
|
|
3161
3833
|
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
|
|
3162
3834
|
* ```
|
|
3835
|
+
* @example
|
|
3836
|
+
* ```js
|
|
3837
|
+
* // Edit last prompt from spotter context
|
|
3838
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3839
|
+
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "sales by region", ContextType.Spotter);
|
|
3840
|
+
* ```
|
|
3163
3841
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3164
3842
|
*/
|
|
3165
3843
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
@@ -3169,6 +3847,12 @@ var HostEvent;
|
|
|
3169
3847
|
* ```js
|
|
3170
3848
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
3171
3849
|
* ```
|
|
3850
|
+
* @example
|
|
3851
|
+
* ```js
|
|
3852
|
+
* // Preview spotter data from spotter context
|
|
3853
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3854
|
+
* spotterEmbed.trigger(HostEvent.PreviewSpotterData, {}, ContextType.Spotter);
|
|
3855
|
+
* ```
|
|
3172
3856
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3173
3857
|
*/
|
|
3174
3858
|
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
@@ -3927,6 +4611,7 @@ var Action;
|
|
|
3927
4611
|
* disabledActions: [Action.LiveboardInfo]
|
|
3928
4612
|
* ```
|
|
3929
4613
|
*/
|
|
4614
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
3930
4615
|
Action["LiveboardInfo"] = "pinboardInfo";
|
|
3931
4616
|
/**
|
|
3932
4617
|
* @hidden
|
|
@@ -3957,6 +4642,7 @@ var Action;
|
|
|
3957
4642
|
* disabledActions: [Action.Subscription]
|
|
3958
4643
|
* ```
|
|
3959
4644
|
*/
|
|
4645
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
3960
4646
|
Action["Subscription"] = "subscription";
|
|
3961
4647
|
/**
|
|
3962
4648
|
* The **Explore** action on Liveboard visualizations
|
|
@@ -4436,13 +5122,25 @@ var Action;
|
|
|
4436
5122
|
/**
|
|
4437
5123
|
* The Liveboard Personalised Views dropdown.
|
|
4438
5124
|
* Allows navigating to a personalized Liveboard View.
|
|
5125
|
+
* This action is deprecated. Use {@link Action.PersonalizedViewsDropdown} instead.
|
|
4439
5126
|
* @example
|
|
4440
5127
|
* ```js
|
|
4441
5128
|
* disabledActions: [Action.PersonalisedViewsDropdown]
|
|
4442
5129
|
* ```
|
|
4443
5130
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 10.1.0.sw
|
|
5131
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
4444
5132
|
*/
|
|
4445
5133
|
Action["PersonalisedViewsDropdown"] = "personalisedViewsDropdown";
|
|
5134
|
+
/**
|
|
5135
|
+
* The Liveboard Personalized Views dropdown.
|
|
5136
|
+
* Allows navigating to a personalized Liveboard View.
|
|
5137
|
+
* @example
|
|
5138
|
+
* ```js
|
|
5139
|
+
* disabledActions: [Action.PersonalizedViewsDropdown]
|
|
5140
|
+
* ```
|
|
5141
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
5142
|
+
*/
|
|
5143
|
+
Action["PersonalizedViewsDropdown"] = "personalisedViewsDropdown";
|
|
4446
5144
|
/**
|
|
4447
5145
|
* Action ID for show or hide the user details on a
|
|
4448
5146
|
* Liveboard (Recently visited / social proof)
|
|
@@ -4530,14 +5228,27 @@ var Action;
|
|
|
4530
5228
|
/**
|
|
4531
5229
|
* The **Organize Favourites** action on Homepage
|
|
4532
5230
|
* *Favorites* module.
|
|
5231
|
+
* This action is deprecated. Use {@link Action.OrganizeFavorites} instead.
|
|
4533
5232
|
*
|
|
4534
5233
|
* @example
|
|
4535
5234
|
* ```js
|
|
4536
5235
|
* disabledActions: [Action.OrganiseFavourites]
|
|
4537
5236
|
* ```
|
|
4538
5237
|
* @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
|
|
5238
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
4539
5239
|
*/
|
|
4540
5240
|
Action["OrganiseFavourites"] = "organiseFavourites";
|
|
5241
|
+
/**
|
|
5242
|
+
* The **Organize Favorites** action on Homepage
|
|
5243
|
+
* *Favorites* module.
|
|
5244
|
+
*
|
|
5245
|
+
* @example
|
|
5246
|
+
* ```js
|
|
5247
|
+
* disabledActions: [Action.OrganizeFavorites]
|
|
5248
|
+
* ```
|
|
5249
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
5250
|
+
*/
|
|
5251
|
+
Action["OrganizeFavorites"] = "organiseFavourites";
|
|
4541
5252
|
/**
|
|
4542
5253
|
* The **AI Highlights** action on a Liveboard.
|
|
4543
5254
|
*
|
|
@@ -5287,6 +5998,22 @@ var EmbedErrorCodes;
|
|
|
5287
5998
|
/** Invalid URL provided in configuration */
|
|
5288
5999
|
EmbedErrorCodes["INVALID_URL"] = "INVALID_URL";
|
|
5289
6000
|
})(EmbedErrorCodes || (EmbedErrorCodes = {}));
|
|
6001
|
+
/**
|
|
6002
|
+
* Context types for specifying the page context when triggering host events.
|
|
6003
|
+
* Used as the third parameter in the `trigger` method to help ThoughtSpot
|
|
6004
|
+
* understand the current page context for better event handling.
|
|
6005
|
+
*
|
|
6006
|
+
* @example
|
|
6007
|
+
* ```js
|
|
6008
|
+
* import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
6009
|
+
*
|
|
6010
|
+
* // Trigger an event with specific context
|
|
6011
|
+
* embed.trigger(HostEvent.Pin, { vizId: "123", liveboardId: "456" }, ContextType.Search);
|
|
6012
|
+
* ```
|
|
6013
|
+
*
|
|
6014
|
+
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
6015
|
+
* @group Events
|
|
6016
|
+
*/
|
|
5290
6017
|
var ContextType;
|
|
5291
6018
|
(function (ContextType) {
|
|
5292
6019
|
/**
|
|
@@ -5305,6 +6032,10 @@ var ContextType;
|
|
|
5305
6032
|
* Spotter context for spotter modal/page.
|
|
5306
6033
|
*/
|
|
5307
6034
|
ContextType["Spotter"] = "spotter";
|
|
6035
|
+
/**
|
|
6036
|
+
* Other context for any other generic page.
|
|
6037
|
+
*/
|
|
6038
|
+
ContextType["Other"] = "other";
|
|
5308
6039
|
})(ContextType || (ContextType = {}));
|
|
5309
6040
|
/**
|
|
5310
6041
|
* Enum for the type of API intercepted
|
|
@@ -8234,6 +8965,13 @@ var UIPassthroughEvent;
|
|
|
8234
8965
|
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
8235
8966
|
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
8236
8967
|
UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
|
|
8968
|
+
UIPassthroughEvent["GetAnswerSession"] = "getAnswerSession";
|
|
8969
|
+
UIPassthroughEvent["GetFilters"] = "getFilters";
|
|
8970
|
+
UIPassthroughEvent["GetIframeUrl"] = "getIframeUrl";
|
|
8971
|
+
UIPassthroughEvent["GetParameters"] = "getParameters";
|
|
8972
|
+
UIPassthroughEvent["GetTML"] = "getTML";
|
|
8973
|
+
UIPassthroughEvent["GetTabs"] = "getTabs";
|
|
8974
|
+
UIPassthroughEvent["GetExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
|
|
8237
8975
|
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
8238
8976
|
|
|
8239
8977
|
const EndPoints = {
|
|
@@ -8867,9 +9605,11 @@ const DATA_TYPES = ['DATE', 'DATE_TIME', 'TIME'];
|
|
|
8867
9605
|
* You can use this service to:
|
|
8868
9606
|
*
|
|
8869
9607
|
* - Add or remove columns from Answers (`addColumns`, `removeColumns`,
|
|
8870
|
-
* `addColumnsByName`)
|
|
9608
|
+
* `addColumnsByName`)
|
|
9609
|
+
* - Apply filters to Answers (`addFilter`)
|
|
8871
9610
|
* - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`,
|
|
8872
|
-
* `fetchCSVBlob`, `fetchPNGBlob`)
|
|
9611
|
+
* `fetchCSVBlob`, `fetchPNGBlob`)
|
|
9612
|
+
* - Get data for specific points in visualizations
|
|
8873
9613
|
* (`getUnderlyingDataForPoint`)
|
|
8874
9614
|
* - Run custom queries (`executeQuery`)
|
|
8875
9615
|
* - Add visualizations to Liveboards (`addDisplayedVizToLiveboard`)
|
|
@@ -9163,7 +9903,7 @@ class AnswerService {
|
|
|
9163
9903
|
async getTML() {
|
|
9164
9904
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
9165
9905
|
const edoc = object[0].edoc;
|
|
9166
|
-
const YAML = await import('./index-
|
|
9906
|
+
const YAML = await import('./index-DW2wEHqy.js');
|
|
9167
9907
|
const parsedDoc = YAML.parse(edoc);
|
|
9168
9908
|
return {
|
|
9169
9909
|
answer: {
|
|
@@ -17618,7 +18358,8 @@ var AuthFailureType;
|
|
|
17618
18358
|
/**
|
|
17619
18359
|
* The current authentication token or session has expired.
|
|
17620
18360
|
*
|
|
17621
|
-
* Emitted when the embed receives an auth-expiry signal and starts auth refresh
|
|
18361
|
+
* Emitted when the embed receives an auth-expiry signal and starts auth refresh
|
|
18362
|
+
* handling.
|
|
17622
18363
|
*/
|
|
17623
18364
|
AuthFailureType["EXPIRY"] = "EXPIRY";
|
|
17624
18365
|
/**
|
|
@@ -18465,11 +19206,25 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
|
|
|
18465
19206
|
return eventData;
|
|
18466
19207
|
}
|
|
18467
19208
|
|
|
18468
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.
|
|
18469
|
-
|
|
19209
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.5-beta.1";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 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.24.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:"32 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};
|
|
19210
|
+
|
|
19211
|
+
/** Host events that use getDataWithPassthroughFallback (getter-style APIs) */
|
|
19212
|
+
const HOST_EVENT_PASSTHROUGH_MAP = {
|
|
19213
|
+
[HostEvent.GetAnswerSession]: UIPassthroughEvent.GetAnswerSession,
|
|
19214
|
+
[HostEvent.GetFilters]: UIPassthroughEvent.GetFilters,
|
|
19215
|
+
[HostEvent.GetIframeUrl]: UIPassthroughEvent.GetIframeUrl,
|
|
19216
|
+
[HostEvent.GetParameters]: UIPassthroughEvent.GetParameters,
|
|
19217
|
+
[HostEvent.GetTML]: UIPassthroughEvent.GetTML,
|
|
19218
|
+
[HostEvent.GetTabs]: UIPassthroughEvent.GetTabs,
|
|
19219
|
+
[HostEvent.getExportRequestForCurrentPinboard]: UIPassthroughEvent.GetExportRequestForCurrentPinboard,
|
|
19220
|
+
};
|
|
18470
19221
|
class HostEventClient {
|
|
18471
19222
|
constructor(iFrame) {
|
|
18472
19223
|
this.iFrame = iFrame;
|
|
19224
|
+
this.customHandlers = {
|
|
19225
|
+
[HostEvent.Pin]: (p, c) => this.handlePinEvent(p, c),
|
|
19226
|
+
[HostEvent.SaveAnswer]: (p, c) => this.handleSaveAnswerEvent(p, c),
|
|
19227
|
+
};
|
|
18473
19228
|
}
|
|
18474
19229
|
/**
|
|
18475
19230
|
* A wrapper over process trigger to
|
|
@@ -18486,7 +19241,7 @@ class HostEventClient {
|
|
|
18486
19241
|
}
|
|
18487
19242
|
async handleHostEventWithParam(apiName, parameters, context) {
|
|
18488
19243
|
var _a, _b, _c, _d;
|
|
18489
|
-
const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters, context))) === null || _a === void 0 ? void 0 : _a.
|
|
19244
|
+
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
19245
|
if (!response) {
|
|
18491
19246
|
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
18492
19247
|
throw { error };
|
|
@@ -18495,13 +19250,35 @@ class HostEventClient {
|
|
|
18495
19250
|
|| ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors)
|
|
18496
19251
|
|| ((_d = response.value) === null || _d === void 0 ? void 0 : _d.error);
|
|
18497
19252
|
if (errors) {
|
|
18498
|
-
|
|
19253
|
+
const message = typeof errors === 'string' ? errors : JSON.stringify(errors);
|
|
19254
|
+
throw { error: message };
|
|
18499
19255
|
}
|
|
18500
19256
|
return { ...response.value };
|
|
18501
19257
|
}
|
|
18502
19258
|
async hostEventFallback(hostEvent, data, context) {
|
|
18503
19259
|
return this.processTrigger(hostEvent, data, context);
|
|
18504
19260
|
}
|
|
19261
|
+
/**
|
|
19262
|
+
* For getter events that return data. Tries UI passthrough first;
|
|
19263
|
+
* if the app doesn't support it (no response data), falls back to
|
|
19264
|
+
* the legacy host event channel. Real errors are thrown as-is.
|
|
19265
|
+
*/
|
|
19266
|
+
async getDataWithPassthroughFallback(passthroughEvent, hostEvent, payload, context) {
|
|
19267
|
+
var _a, _b, _c;
|
|
19268
|
+
const response = await this.triggerUIPassthroughApi(passthroughEvent, payload || {}, context);
|
|
19269
|
+
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);
|
|
19270
|
+
if (!matched) {
|
|
19271
|
+
return this.hostEventFallback(hostEvent, payload, context);
|
|
19272
|
+
}
|
|
19273
|
+
const errors = matched.error
|
|
19274
|
+
|| ((_b = matched.value) === null || _b === void 0 ? void 0 : _b.errors)
|
|
19275
|
+
|| ((_c = matched.value) === null || _c === void 0 ? void 0 : _c.error);
|
|
19276
|
+
if (errors) {
|
|
19277
|
+
const message = typeof errors === 'string' ? errors : JSON.stringify(errors);
|
|
19278
|
+
throw new Error(message);
|
|
19279
|
+
}
|
|
19280
|
+
return { ...matched.value };
|
|
19281
|
+
}
|
|
18505
19282
|
/**
|
|
18506
19283
|
* Setter for the iframe element used for host events
|
|
18507
19284
|
* @param {HTMLIFrameElement} iFrame - the iframe element to set
|
|
@@ -18545,14 +19322,15 @@ class HostEventClient {
|
|
|
18545
19322
|
};
|
|
18546
19323
|
}
|
|
18547
19324
|
async triggerHostEvent(hostEvent, payload, context) {
|
|
18548
|
-
|
|
18549
|
-
|
|
18550
|
-
|
|
18551
|
-
|
|
18552
|
-
|
|
18553
|
-
|
|
18554
|
-
|
|
19325
|
+
const customHandler = this.customHandlers[hostEvent];
|
|
19326
|
+
if (customHandler) {
|
|
19327
|
+
return customHandler(payload, context);
|
|
19328
|
+
}
|
|
19329
|
+
const passthroughEvent = HOST_EVENT_PASSTHROUGH_MAP[hostEvent];
|
|
19330
|
+
if (passthroughEvent) {
|
|
19331
|
+
return this.getDataWithPassthroughFallback(passthroughEvent, hostEvent, payload, context);
|
|
18555
19332
|
}
|
|
19333
|
+
return this.hostEventFallback(hostEvent, payload, context);
|
|
18556
19334
|
}
|
|
18557
19335
|
}
|
|
18558
19336
|
|
|
@@ -19843,7 +20621,21 @@ class TsEmbed {
|
|
|
19843
20621
|
* Triggers an event to the embedded app
|
|
19844
20622
|
* @param {HostEvent} messageType The event type
|
|
19845
20623
|
* @param {any} data The payload to send with the message
|
|
20624
|
+
* @param {ContextType} context Optional context type to specify the context from which the event is triggered.
|
|
20625
|
+
* Use ContextType.Search for search answer context, ContextType.Answer for answer/explore context,
|
|
20626
|
+
* ContextType.Liveboard for liveboard context, or ContextType.Spotter for spotter context.
|
|
20627
|
+
* Available from SDK version 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
19846
20628
|
* @returns A promise that resolves with the response from the embedded app
|
|
20629
|
+
* @example
|
|
20630
|
+
* ```js
|
|
20631
|
+
* // Trigger Pin event with context (SDK: 1.45.2+)
|
|
20632
|
+
* import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
20633
|
+
* embed.trigger(HostEvent.Pin, {
|
|
20634
|
+
* vizId: "123",
|
|
20635
|
+
* liveboardId: "456"
|
|
20636
|
+
* }, ContextType.Search);
|
|
20637
|
+
* ```
|
|
20638
|
+
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl (for context parameter)
|
|
19847
20639
|
*/
|
|
19848
20640
|
async trigger(messageType, data = {}, context) {
|
|
19849
20641
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
@@ -19906,8 +20698,33 @@ class TsEmbed {
|
|
|
19906
20698
|
return this.render();
|
|
19907
20699
|
}
|
|
19908
20700
|
/**
|
|
19909
|
-
|
|
19910
|
-
|
|
20701
|
+
* Context object for the embedded component.
|
|
20702
|
+
* @returns {ContextObject} The current context object containing the page type and object ids.
|
|
20703
|
+
* @example
|
|
20704
|
+
* ```js
|
|
20705
|
+
* const context = await embed.getCurrentContext();
|
|
20706
|
+
* console.log(context);
|
|
20707
|
+
*
|
|
20708
|
+
* // Example output
|
|
20709
|
+
* {
|
|
20710
|
+
* stack: [
|
|
20711
|
+
* {
|
|
20712
|
+
* name: 'Liveboard',
|
|
20713
|
+
* type: ContextType.Liveboard,
|
|
20714
|
+
* objectIds: {
|
|
20715
|
+
* liveboardId: '123',
|
|
20716
|
+
* },
|
|
20717
|
+
* },
|
|
20718
|
+
* ],
|
|
20719
|
+
* currentContext: {
|
|
20720
|
+
* name: 'Liveboard',
|
|
20721
|
+
* type: ContextType.Liveboard,
|
|
20722
|
+
* objectIds: {
|
|
20723
|
+
* liveboardId: '123',
|
|
20724
|
+
* },
|
|
20725
|
+
* },
|
|
20726
|
+
* }
|
|
20727
|
+
* ```
|
|
19911
20728
|
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
19912
20729
|
*/
|
|
19913
20730
|
async getCurrentContext() {
|
|
@@ -20731,13 +21548,22 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
20731
21548
|
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
|
|
20732
21549
|
responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
20733
21550
|
};
|
|
21551
|
+
this.HEIGHT_CHANAGE_THRESHOLD = 30;
|
|
20734
21552
|
/**
|
|
20735
21553
|
* Set the iframe height as per the computed height received
|
|
20736
21554
|
* from the ThoughtSpot app.
|
|
20737
21555
|
* @param data The event payload
|
|
20738
21556
|
*/
|
|
20739
21557
|
this.updateIFrameHeight = (data) => {
|
|
20740
|
-
|
|
21558
|
+
logger$3.error('Updating iframe height', data);
|
|
21559
|
+
const currentHeight = this.iFrame.getBoundingClientRect().height;
|
|
21560
|
+
const heightToSet = Math.max(data.data, this.defaultHeight);
|
|
21561
|
+
const heightChange = Math.abs(heightToSet - currentHeight);
|
|
21562
|
+
if (heightChange < this.HEIGHT_CHANAGE_THRESHOLD) {
|
|
21563
|
+
logger$3.info('Height change is less than the threshold, skipping height update', { heightChange, heightToSet, currentHeight });
|
|
21564
|
+
return;
|
|
21565
|
+
}
|
|
21566
|
+
this.setIFrameHeight(heightToSet);
|
|
20741
21567
|
this.sendFullHeightLazyLoadData();
|
|
20742
21568
|
};
|
|
20743
21569
|
this.embedIframeCenter = (data, responder) => {
|
|
@@ -21196,13 +22022,21 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
21196
22022
|
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
|
|
21197
22023
|
responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
21198
22024
|
};
|
|
22025
|
+
this.HEIGHT_CHANAGE_THRESHOLD = 30;
|
|
21199
22026
|
/**
|
|
21200
22027
|
* Set the iframe height as per the computed height received
|
|
21201
22028
|
* from the ThoughtSpot app.
|
|
21202
22029
|
* @param data The event payload
|
|
21203
22030
|
*/
|
|
21204
22031
|
this.updateIFrameHeight = (data) => {
|
|
21205
|
-
this.
|
|
22032
|
+
const currentHeight = this.iFrame.getBoundingClientRect().height;
|
|
22033
|
+
const heightToSet = Math.max(data.data, this.defaultHeight);
|
|
22034
|
+
const heightChange = Math.abs(heightToSet - currentHeight);
|
|
22035
|
+
if (heightChange < this.HEIGHT_CHANAGE_THRESHOLD) {
|
|
22036
|
+
logger$3.info('Height change is less than the threshold, skipping height update', { heightChange, heightToSet, currentHeight });
|
|
22037
|
+
return;
|
|
22038
|
+
}
|
|
22039
|
+
this.setIFrameHeight(heightToSet);
|
|
21206
22040
|
this.sendFullHeightLazyLoadData();
|
|
21207
22041
|
};
|
|
21208
22042
|
this.embedIframeCenter = (data, responder) => {
|
|
@@ -21368,7 +22202,8 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
21368
22202
|
}
|
|
21369
22203
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId) {
|
|
21370
22204
|
// Extract view from liveboardId if passed along with it (legacy
|
|
21371
|
-
// approach)
|
|
22205
|
+
// approach)
|
|
22206
|
+
// View must be appended as query param at the end, not
|
|
21372
22207
|
// embedded in path
|
|
21373
22208
|
let liveboardGuid = liveboardId;
|
|
21374
22209
|
let legacyViewId;
|
|
@@ -22222,60 +23057,64 @@ const componentFactory = (EmbedConstructor,
|
|
|
22222
23057
|
// intended for preRendering. If set to true, the component will call the
|
|
22223
23058
|
// Embed.preRender() method instead of the usual render method, and it will
|
|
22224
23059
|
// 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);
|
|
23060
|
+
isPreRenderedComponent = false) => {
|
|
23061
|
+
const Component = React__default.forwardRef((props, forwardedRef) => {
|
|
23062
|
+
const ref = React__default.useRef(null);
|
|
23063
|
+
const { className, style, ...embedProps } = props;
|
|
23064
|
+
const { viewConfig, listeners } = getViewPropsAndListeners(embedProps);
|
|
23065
|
+
const handleDestroy = (tsEmbed) => {
|
|
23066
|
+
// do not destroy if it is a preRender component
|
|
23067
|
+
if (isPreRenderedComponent)
|
|
23068
|
+
return;
|
|
23069
|
+
// if component is connected to a preRendered component
|
|
23070
|
+
if (props.preRenderId) {
|
|
23071
|
+
tsEmbed.hidePreRender();
|
|
23072
|
+
return;
|
|
23073
|
+
}
|
|
23074
|
+
tsEmbed.destroy();
|
|
22274
23075
|
};
|
|
22275
|
-
|
|
22276
|
-
|
|
22277
|
-
|
|
22278
|
-
|
|
23076
|
+
const handlePreRenderRendering = (tsEmbed) => {
|
|
23077
|
+
tsEmbed.preRender();
|
|
23078
|
+
};
|
|
23079
|
+
const handleDefaultRendering = (tsEmbed) => {
|
|
23080
|
+
// if component is connected to a preRendered component
|
|
23081
|
+
if (props.preRenderId) {
|
|
23082
|
+
tsEmbed.showPreRender();
|
|
23083
|
+
return;
|
|
23084
|
+
}
|
|
23085
|
+
tsEmbed.render();
|
|
23086
|
+
};
|
|
23087
|
+
const handleRendering = (tsEmbed) => {
|
|
23088
|
+
if (isPreRenderedComponent) {
|
|
23089
|
+
handlePreRenderRendering(tsEmbed);
|
|
23090
|
+
return;
|
|
23091
|
+
}
|
|
23092
|
+
handleDefaultRendering(tsEmbed);
|
|
23093
|
+
};
|
|
23094
|
+
useDeepCompareEffect(() => {
|
|
23095
|
+
const tsEmbed = new EmbedConstructor(ref.current, deepMerge({
|
|
23096
|
+
insertAsSibling: viewConfig.insertAsSibling,
|
|
23097
|
+
frameParams: {
|
|
23098
|
+
class: viewConfig.insertAsSibling ? className || '' : '',
|
|
23099
|
+
},
|
|
23100
|
+
}, viewConfig));
|
|
23101
|
+
Object.keys(listeners).forEach((eventName) => {
|
|
23102
|
+
tsEmbed.on(eventName, listeners[eventName]);
|
|
23103
|
+
});
|
|
23104
|
+
handleRendering(tsEmbed);
|
|
23105
|
+
if (forwardedRef) {
|
|
23106
|
+
forwardedRef.current = tsEmbed;
|
|
23107
|
+
}
|
|
23108
|
+
return () => {
|
|
23109
|
+
handleDestroy(tsEmbed);
|
|
23110
|
+
};
|
|
23111
|
+
}, [viewConfig, listeners]);
|
|
23112
|
+
const preRenderStyles = isPreRenderedComponent ? { display: 'none' } : {};
|
|
23113
|
+
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}` }));
|
|
23114
|
+
});
|
|
23115
|
+
Component.displayName = EmbedConstructor.name || 'EmbedComponent';
|
|
23116
|
+
return Component;
|
|
23117
|
+
};
|
|
22279
23118
|
/**
|
|
22280
23119
|
* React component for Search Embed.
|
|
22281
23120
|
* @example
|
|
@@ -22489,6 +23328,7 @@ const SpotterMessage = React__default.forwardRef((props, ref) => {
|
|
|
22489
23328
|
const { message, query: _, ...otherProps } = props;
|
|
22490
23329
|
return (React__default.createElement(ConversationMessage, { ref: ref, ...message, ...otherProps }));
|
|
22491
23330
|
});
|
|
23331
|
+
SpotterMessage.displayName = 'SpotterMessage';
|
|
22492
23332
|
/**
|
|
22493
23333
|
* React component for PreRendered Conversation embed.
|
|
22494
23334
|
*
|