@thoughtspot/visual-embed-sdk 1.17.2-customcss → 1.18.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -8
- package/README.md +1 -1
- package/dist/src/embed/search-bar.d.ts +1 -1
- package/dist/src/embed/search.d.ts +0 -4
- package/dist/src/embed/ts-embed.d.ts +1 -8
- package/dist/src/react/util.d.ts +1 -1
- package/dist/src/test/test-utils.d.ts +1 -1
- package/dist/src/types.d.ts +110 -18
- package/dist/tsembed.es.js +117 -28
- package/dist/tsembed.js +117 -28
- package/lib/package.json +8 -4
- package/lib/src/embed/base.js +3 -3
- package/lib/src/embed/search-bar.d.ts +1 -1
- package/lib/src/embed/search-bar.js +1 -1
- package/lib/src/embed/search.d.ts +0 -4
- package/lib/src/embed/search.js +1 -1
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +1 -8
- package/lib/src/embed/ts-embed.js +6 -10
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +1 -1
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/react/util.d.ts +1 -1
- package/lib/src/test/test-utils.d.ts +1 -1
- package/lib/src/types.d.ts +110 -18
- package/lib/src/types.js +98 -6
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils.js +7 -6
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +105 -24
- package/package.json +8 -4
- package/src/embed/base.ts +3 -3
- package/src/embed/search-bar.tsx +1 -1
- package/src/embed/search.ts +0 -5
- package/src/embed/ts-embed.spec.ts +1 -1
- package/src/embed/ts-embed.ts +5 -19
- package/src/types.ts +102 -11
- package/src/utils.ts +8 -6
package/CHANGELOG.md
CHANGED
|
@@ -6,14 +6,14 @@ This project follows Semantic Versioning.
|
|
|
6
6
|
## Unreleased
|
|
7
7
|
|
|
8
8
|
### New Features
|
|
9
|
-
- Set of new Host events to drive interactions on the embed programatically
|
|
9
|
+
- Set of new Host events to drive interactions on the embed programatically
|
|
10
10
|
|
|
11
11
|
## 1.14.1 (08-31-2022)
|
|
12
12
|
- Fixed "not logged in" message showing up on "SearchEmbed" with AuthType.None.
|
|
13
13
|
|
|
14
14
|
## 1.14.0 (08-29-2022)
|
|
15
15
|
- [AuthType.AuthServer] Now uses `POST` call to log the user in using the bearer token.
|
|
16
|
-
- `liveboardV2` flag on `LiveboardEmbed` to try out the LiveboardV2 experience.
|
|
16
|
+
- `liveboardV2` flag on `LiveboardEmbed` to try out the LiveboardV2 experience.
|
|
17
17
|
|
|
18
18
|
## 1.13.0 (07-19-2022)
|
|
19
19
|
- Release to support TS version 8.5.0.cl
|
|
@@ -29,10 +29,6 @@ This project follows Semantic Versioning.
|
|
|
29
29
|
### Fixed
|
|
30
30
|
- Typescript build that was affecting some Angular project configurations
|
|
31
31
|
|
|
32
|
-
## 1.11.2 (06-10-2022)
|
|
33
|
-
### Fixed
|
|
34
|
-
- Typescript build that was affecting some Angular project configurations
|
|
35
|
-
|
|
36
32
|
## 1.11.1 (05-30-2022)
|
|
37
33
|
### Fixed
|
|
38
34
|
- Whitelabeling - new [action](https://developers.thoughtspot.com/docs/typedoc/enums/Action.html#ReportError) for the ability to turn off TS specific error reporting by end users.
|
|
@@ -81,12 +77,12 @@ This project follows Semantic Versioning.
|
|
|
81
77
|
|
|
82
78
|
## 1.9.3 (03-22-2022)
|
|
83
79
|
|
|
84
|
-
### New Features
|
|
80
|
+
### New Features
|
|
85
81
|
- `disableLoginRedirect` option in `EmbedConfig`
|
|
86
82
|
|
|
87
83
|
## 1.9.2 (03-17-2022)
|
|
88
84
|
|
|
89
|
-
### New Features
|
|
85
|
+
### New Features
|
|
90
86
|
- Ability to trigger events on React components
|
|
91
87
|
- Added new `useEmbedRef` hook, check README for usage.
|
|
92
88
|
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
# ThoughtSpot Visual Embed SDK <br/> [](https://coveralls.io/github/ts-blink/embed-sdk?branch=main)  [](https://www.jsdelivr.com/package/npm/@thoughtspot/visual-embed-sdk)  [](https://openbase.com/js/@thoughtspot/visual-embed-sdk?utm_source=embedded&utm_medium=badge&utm_campaign=rate-badge) 
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
SDK to embed ThoughtSpot into your web apps. You need
|
|
10
|
+
SDK to embed ThoughtSpot into your web apps. You need a ThoughtSpot account to use the SDK, [click here](https://www.thoughtspot.com/trial?tsref=trialtse) to start a trial.
|
|
11
11
|
|
|
12
12
|
* [Installation](#installation)
|
|
13
13
|
* [Live Playground](#live-playground)
|
|
@@ -18,7 +18,7 @@ export interface SearchBarViewConfig extends ViewConfig {
|
|
|
18
18
|
* Embed ThoughtSpot search bar
|
|
19
19
|
*
|
|
20
20
|
* @Category Search Embed
|
|
21
|
-
* @version: SDK: 1.
|
|
21
|
+
* @version: SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
|
|
22
22
|
*/
|
|
23
23
|
export declare class SearchBarEmbed extends TsEmbed {
|
|
24
24
|
/**
|
|
@@ -44,10 +44,6 @@ export interface SearchViewConfig extends ViewConfig {
|
|
|
44
44
|
* using raw answer data.
|
|
45
45
|
*/
|
|
46
46
|
hideResults?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* If set to true, expands all the data sources panel.
|
|
49
|
-
*/
|
|
50
|
-
expandAllDataSource?: boolean;
|
|
51
47
|
/**
|
|
52
48
|
* If set to true, the Search Assist feature is enabled.
|
|
53
49
|
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
|
|
@@ -98,13 +98,6 @@ export interface ViewConfig {
|
|
|
98
98
|
additionalFlags?: {
|
|
99
99
|
[key: string]: string | number | boolean;
|
|
100
100
|
};
|
|
101
|
-
/**
|
|
102
|
-
* Dynamic CSS Url to be injected in the loaded application.
|
|
103
|
-
* You would also need to set `style-src` in the CSP settings.
|
|
104
|
-
* @version SDK: 1.17.2 | ThoughtSpot: 8.4.1-sw, 8.4.0.cl
|
|
105
|
-
* @default ''
|
|
106
|
-
*/
|
|
107
|
-
customCssUrl?: string;
|
|
108
101
|
}
|
|
109
102
|
/**
|
|
110
103
|
* Base class for embedding v2 experience
|
|
@@ -275,7 +268,7 @@ export declare class TsEmbed {
|
|
|
275
268
|
* @param messageType The event type
|
|
276
269
|
* @param data The payload to send with the message
|
|
277
270
|
*/
|
|
278
|
-
trigger(messageType: HostEvent, data
|
|
271
|
+
trigger(messageType: HostEvent, data?: any): Promise<any>;
|
|
279
272
|
/**
|
|
280
273
|
* Marks the ThoughtSpot object to have been rendered
|
|
281
274
|
* Needs to be overridden by subclasses to do the actual
|
package/dist/src/react/util.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EmbedEvent, MessageCallback } from '../types';
|
|
2
2
|
import { ViewConfig } from '../embed/ts-embed';
|
|
3
|
-
export
|
|
3
|
+
export type EmbedEventHandlers = {
|
|
4
4
|
[key in keyof typeof EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback;
|
|
5
5
|
};
|
|
6
6
|
export interface EmbedProps extends ViewConfig, EmbedEventHandlers {
|
|
@@ -2,7 +2,7 @@ export declare const defaultParamsWithoutHiddenActions: string;
|
|
|
2
2
|
export declare const defaultParams: string;
|
|
3
3
|
export declare const defaultParamsForPinboardEmbed: string;
|
|
4
4
|
export declare const getDocumentBody: () => string;
|
|
5
|
-
|
|
5
|
+
type DOMElement = HTMLElement | Document;
|
|
6
6
|
export declare const getRootEl: () => HTMLElement;
|
|
7
7
|
export declare const getRootEl2: () => HTMLElement;
|
|
8
8
|
export declare const getIFrameEl: (container?: DOMElement) => HTMLIFrameElement;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export declare enum AuthType {
|
|
|
69
69
|
*/
|
|
70
70
|
Basic = "Basic"
|
|
71
71
|
}
|
|
72
|
-
export
|
|
72
|
+
export type DOMSelector = string | HTMLElement;
|
|
73
73
|
interface customCssInterface {
|
|
74
74
|
variables?: {
|
|
75
75
|
[variableName: string]: string;
|
|
@@ -82,11 +82,11 @@ interface customCssInterface {
|
|
|
82
82
|
}
|
|
83
83
|
interface CustomStyles {
|
|
84
84
|
customCSSUrl?: string;
|
|
85
|
-
|
|
85
|
+
customCSS?: customCssInterface;
|
|
86
86
|
}
|
|
87
87
|
export interface CustomisationsInterface {
|
|
88
|
-
style
|
|
89
|
-
content
|
|
88
|
+
style?: CustomStyles;
|
|
89
|
+
content?: {
|
|
90
90
|
[key: string]: string;
|
|
91
91
|
};
|
|
92
92
|
}
|
|
@@ -226,7 +226,7 @@ export interface EmbedConfig {
|
|
|
226
226
|
*
|
|
227
227
|
* @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl
|
|
228
228
|
*/
|
|
229
|
-
|
|
229
|
+
customizations?: CustomisationsInterface;
|
|
230
230
|
/**
|
|
231
231
|
* For noRedirect SSO Auth, we need a button which the user
|
|
232
232
|
* click to trigger the flow. This is the containing element
|
|
@@ -245,7 +245,7 @@ export interface EmbedConfig {
|
|
|
245
245
|
/**
|
|
246
246
|
* MessagePayload: Embed event payload: message type, data and status (start/end)
|
|
247
247
|
*/
|
|
248
|
-
export
|
|
248
|
+
export type MessagePayload = {
|
|
249
249
|
type: string;
|
|
250
250
|
data: any;
|
|
251
251
|
status?: string;
|
|
@@ -253,22 +253,22 @@ export declare type MessagePayload = {
|
|
|
253
253
|
/**
|
|
254
254
|
* MessageOptions: By Providing options, getting specific event start / end based on option
|
|
255
255
|
*/
|
|
256
|
-
export
|
|
256
|
+
export type MessageOptions = {
|
|
257
257
|
start?: boolean;
|
|
258
258
|
};
|
|
259
259
|
/**
|
|
260
260
|
* MessageCallback: Embed event message callback
|
|
261
261
|
*/
|
|
262
|
-
export
|
|
262
|
+
export type MessageCallback = (payload: MessagePayload, responder?: (data: any) => void) => void;
|
|
263
263
|
/**
|
|
264
264
|
* MessageCallbackObj: contains message options & callback function
|
|
265
265
|
*/
|
|
266
|
-
export
|
|
266
|
+
export type MessageCallbackObj = {
|
|
267
267
|
options: MessageOptions;
|
|
268
268
|
callback: MessageCallback;
|
|
269
269
|
};
|
|
270
|
-
export
|
|
271
|
-
export
|
|
270
|
+
export type GenericCallbackFn = (...args: any[]) => any;
|
|
271
|
+
export type QueryParams = {
|
|
272
272
|
[key: string]: string;
|
|
273
273
|
};
|
|
274
274
|
/**
|
|
@@ -738,7 +738,10 @@ export declare enum HostEvent {
|
|
|
738
738
|
* Triggers the Pin action on an embedded object
|
|
739
739
|
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
740
740
|
* can be left empty for search and visualization embeds
|
|
741
|
-
* @example
|
|
741
|
+
* @example
|
|
742
|
+
* liveboardEmbed.trigger(HostEvent.Pin, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
743
|
+
* vizEmbed.trigger(HostEvent.Pin)
|
|
744
|
+
* searchEmbed.trigger(HostEvent.Pin)
|
|
742
745
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
743
746
|
*/
|
|
744
747
|
Pin = "pin",
|
|
@@ -785,8 +788,11 @@ export declare enum HostEvent {
|
|
|
785
788
|
*/
|
|
786
789
|
DownloadAsPdf = "downloadAsPdf",
|
|
787
790
|
/**
|
|
788
|
-
* Triggers the Make a copy action on a Liveboard
|
|
789
|
-
* @example
|
|
791
|
+
* Triggers the Make a copy action on a Liveboard, search or visualization
|
|
792
|
+
* @example
|
|
793
|
+
* liveboardEmbed.trigger(HostEvent.MakeACopy, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
794
|
+
* vizEmbed.trigger(HostEvent.MakeACopy)
|
|
795
|
+
* searchEmbed.trigger(HostEvent.MakeACopy)
|
|
790
796
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
791
797
|
*/
|
|
792
798
|
MakeACopy = "makeACopy",
|
|
@@ -850,15 +856,74 @@ export declare enum HostEvent {
|
|
|
850
856
|
/**
|
|
851
857
|
* Get TML for the current search.
|
|
852
858
|
* @example searchEmbed.trigger(HostEvent.GetTML)
|
|
853
|
-
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl
|
|
859
|
+
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl
|
|
854
860
|
*/
|
|
855
861
|
GetTML = "getTML",
|
|
862
|
+
/**
|
|
863
|
+
* Triggers the ShowUnderlyingData action on visualization or search
|
|
864
|
+
* @param - an object with vizId as a key
|
|
865
|
+
* @example
|
|
866
|
+
* liveboardEmbed.trigger(HostEvent.ShowUnderlyingData, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
867
|
+
* vizEmbed.trigger(HostEvent.ShowUnderlyingData)
|
|
868
|
+
* searchEmbed.trigger(HostEvent.ShowUnderlyingData)
|
|
869
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
870
|
+
*/
|
|
871
|
+
ShowUnderlyingData = "showUnderlyingData",
|
|
872
|
+
/**
|
|
873
|
+
* Triggers the Delete action on visualization or search
|
|
874
|
+
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
875
|
+
* can be left empty for search and visualization embeds
|
|
876
|
+
* @example
|
|
877
|
+
* liveboardEmbed.trigger(HostEvent.Delete, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
878
|
+
* vizEmbed.trigger(HostEvent.Delete)
|
|
879
|
+
* searchEmbed.trigger(HostEvent.Delete)
|
|
880
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
881
|
+
*/
|
|
882
|
+
Delete = "delete",
|
|
883
|
+
/**
|
|
884
|
+
* Triggers the SpotIQAnalyze action on visualization or search
|
|
885
|
+
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
886
|
+
* can be left empty for search and visualization embeds
|
|
887
|
+
* @example
|
|
888
|
+
* liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
889
|
+
* vizEmbed.trigger(HostEvent.SpotIQAnalyze)
|
|
890
|
+
* searchEmbed.trigger(HostEvent.SpotIQAnalyze)
|
|
891
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
892
|
+
*/
|
|
893
|
+
SpotIQAnalyze = "spotIQAnalyze",
|
|
894
|
+
/**
|
|
895
|
+
* Triggers the Download action on visualization or search when Displaymode is Chart
|
|
896
|
+
* @example
|
|
897
|
+
* liveboardEmbed.trigger(HostEvent.Download, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
898
|
+
* vizEmbed.trigger(HostEvent.Download)
|
|
899
|
+
* searchEmbed.trigger(HostEvent.Download)
|
|
900
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
901
|
+
*/
|
|
902
|
+
Download = "download",
|
|
903
|
+
/**
|
|
904
|
+
* Triggers the downloadAsCSV action on visualization or search when Displaymode is Table
|
|
905
|
+
* @example
|
|
906
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
907
|
+
* vizEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
908
|
+
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
909
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
910
|
+
*/
|
|
911
|
+
DownloadAsCsv = "downloadAsCSV",
|
|
912
|
+
/**
|
|
913
|
+
* Triggers the downloadAsXLSX action on visualization or search when Displaymode is Table
|
|
914
|
+
* @example
|
|
915
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
916
|
+
* vizEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
917
|
+
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
918
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
919
|
+
*/
|
|
920
|
+
DownloadAsXlsx = "downloadAsXLSX",
|
|
856
921
|
/**
|
|
857
922
|
* Triggers the Share action on a liveboard or answer
|
|
858
923
|
* @example
|
|
859
924
|
* liveboardEmbed.trigger(HostEvent.Share)
|
|
860
925
|
* searchEmbed.trigger(HostEvent.Share)
|
|
861
|
-
* @version SDK: 1.19.0 |
|
|
926
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
862
927
|
*/
|
|
863
928
|
Share = "share",
|
|
864
929
|
/**
|
|
@@ -866,9 +931,36 @@ export declare enum HostEvent {
|
|
|
866
931
|
* @example
|
|
867
932
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
868
933
|
* searchEmbed.trigger(HostEvent.Save)
|
|
869
|
-
* @version SDK: 1.19.0 |
|
|
934
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
935
|
+
*/
|
|
936
|
+
Save = "save",
|
|
937
|
+
/**
|
|
938
|
+
* Triggers the SyncToSheets action on visualization
|
|
939
|
+
* @param - an object with vizId as a key
|
|
940
|
+
* @example
|
|
941
|
+
* liveboardEmbed.trigger(HostEvent.SyncToSheets, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
942
|
+
* vizEmbed.trigger(HostEvent.SyncToSheets)
|
|
943
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
870
944
|
*/
|
|
871
|
-
|
|
945
|
+
SyncToSheets = "sync-to-sheets",
|
|
946
|
+
/**
|
|
947
|
+
* Triggers the SyncToOtherApps action on visualization
|
|
948
|
+
* @param - an object with vizId as a key
|
|
949
|
+
* @example
|
|
950
|
+
* liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
951
|
+
* vizEmbed.trigger(HostEvent.SyncToOtherApps)
|
|
952
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
953
|
+
*/
|
|
954
|
+
SyncToOtherApps = "sync-to-other-apps",
|
|
955
|
+
/**
|
|
956
|
+
* Triggers the ManagePipelines action on visualization
|
|
957
|
+
* @param - an object with vizId as a key
|
|
958
|
+
* @example
|
|
959
|
+
* liveboardEmbed.trigger(HostEvent.ManagePipelines, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
960
|
+
* vizEmbed.trigger(HostEvent.ManagePipelines)
|
|
961
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
962
|
+
*/
|
|
963
|
+
ManagePipelines = "manage-pipeline"
|
|
872
964
|
}
|
|
873
965
|
/**
|
|
874
966
|
* The different visual modes that the data sources panel within
|
package/dist/tsembed.es.js
CHANGED
|
@@ -135,12 +135,13 @@ const checkReleaseVersionInBeta = (releaseVersion, suppressBetaWarning) => {
|
|
|
135
135
|
};
|
|
136
136
|
const getCustomisations = (embedConfig) => {
|
|
137
137
|
const { customCssUrl } = embedConfig;
|
|
138
|
-
let
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
138
|
+
let customizations = embedConfig.customizations ||
|
|
139
|
+
embedConfig.customisations;
|
|
140
|
+
customizations = customizations || {};
|
|
141
|
+
customizations.style = customizations.style || {};
|
|
142
|
+
customizations.style.customCSSUrl =
|
|
143
|
+
customizations.style.customCSSUrl || customCssUrl;
|
|
144
|
+
return customizations;
|
|
144
145
|
};
|
|
145
146
|
/**
|
|
146
147
|
* Gets a reference to the DOM node given
|
|
@@ -680,7 +681,10 @@ var HostEvent;
|
|
|
680
681
|
* Triggers the Pin action on an embedded object
|
|
681
682
|
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
682
683
|
* can be left empty for search and visualization embeds
|
|
683
|
-
* @example
|
|
684
|
+
* @example
|
|
685
|
+
* liveboardEmbed.trigger(HostEvent.Pin, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
686
|
+
* vizEmbed.trigger(HostEvent.Pin)
|
|
687
|
+
* searchEmbed.trigger(HostEvent.Pin)
|
|
684
688
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
685
689
|
*/
|
|
686
690
|
HostEvent["Pin"] = "pin";
|
|
@@ -727,8 +731,11 @@ var HostEvent;
|
|
|
727
731
|
*/
|
|
728
732
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
729
733
|
/**
|
|
730
|
-
* Triggers the Make a copy action on a Liveboard
|
|
731
|
-
* @example
|
|
734
|
+
* Triggers the Make a copy action on a Liveboard, search or visualization
|
|
735
|
+
* @example
|
|
736
|
+
* liveboardEmbed.trigger(HostEvent.MakeACopy, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
737
|
+
* vizEmbed.trigger(HostEvent.MakeACopy)
|
|
738
|
+
* searchEmbed.trigger(HostEvent.MakeACopy)
|
|
732
739
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
733
740
|
*/
|
|
734
741
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -792,15 +799,74 @@ var HostEvent;
|
|
|
792
799
|
/**
|
|
793
800
|
* Get TML for the current search.
|
|
794
801
|
* @example searchEmbed.trigger(HostEvent.GetTML)
|
|
795
|
-
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl
|
|
802
|
+
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl
|
|
796
803
|
*/
|
|
797
804
|
HostEvent["GetTML"] = "getTML";
|
|
805
|
+
/**
|
|
806
|
+
* Triggers the ShowUnderlyingData action on visualization or search
|
|
807
|
+
* @param - an object with vizId as a key
|
|
808
|
+
* @example
|
|
809
|
+
* liveboardEmbed.trigger(HostEvent.ShowUnderlyingData, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
810
|
+
* vizEmbed.trigger(HostEvent.ShowUnderlyingData)
|
|
811
|
+
* searchEmbed.trigger(HostEvent.ShowUnderlyingData)
|
|
812
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
813
|
+
*/
|
|
814
|
+
HostEvent["ShowUnderlyingData"] = "showUnderlyingData";
|
|
815
|
+
/**
|
|
816
|
+
* Triggers the Delete action on visualization or search
|
|
817
|
+
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
818
|
+
* can be left empty for search and visualization embeds
|
|
819
|
+
* @example
|
|
820
|
+
* liveboardEmbed.trigger(HostEvent.Delete, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
821
|
+
* vizEmbed.trigger(HostEvent.Delete)
|
|
822
|
+
* searchEmbed.trigger(HostEvent.Delete)
|
|
823
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
824
|
+
*/
|
|
825
|
+
HostEvent["Delete"] = "delete";
|
|
826
|
+
/**
|
|
827
|
+
* Triggers the SpotIQAnalyze action on visualization or search
|
|
828
|
+
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
829
|
+
* can be left empty for search and visualization embeds
|
|
830
|
+
* @example
|
|
831
|
+
* liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
832
|
+
* vizEmbed.trigger(HostEvent.SpotIQAnalyze)
|
|
833
|
+
* searchEmbed.trigger(HostEvent.SpotIQAnalyze)
|
|
834
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
835
|
+
*/
|
|
836
|
+
HostEvent["SpotIQAnalyze"] = "spotIQAnalyze";
|
|
837
|
+
/**
|
|
838
|
+
* Triggers the Download action on visualization or search when Displaymode is Chart
|
|
839
|
+
* @example
|
|
840
|
+
* liveboardEmbed.trigger(HostEvent.Download, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
841
|
+
* vizEmbed.trigger(HostEvent.Download)
|
|
842
|
+
* searchEmbed.trigger(HostEvent.Download)
|
|
843
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
844
|
+
*/
|
|
845
|
+
HostEvent["Download"] = "download";
|
|
846
|
+
/**
|
|
847
|
+
* Triggers the downloadAsCSV action on visualization or search when Displaymode is Table
|
|
848
|
+
* @example
|
|
849
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
850
|
+
* vizEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
851
|
+
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
852
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
853
|
+
*/
|
|
854
|
+
HostEvent["DownloadAsCsv"] = "downloadAsCSV";
|
|
855
|
+
/**
|
|
856
|
+
* Triggers the downloadAsXLSX action on visualization or search when Displaymode is Table
|
|
857
|
+
* @example
|
|
858
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
859
|
+
* vizEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
860
|
+
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
861
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
862
|
+
*/
|
|
863
|
+
HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
798
864
|
/**
|
|
799
865
|
* Triggers the Share action on a liveboard or answer
|
|
800
866
|
* @example
|
|
801
867
|
* liveboardEmbed.trigger(HostEvent.Share)
|
|
802
868
|
* searchEmbed.trigger(HostEvent.Share)
|
|
803
|
-
* @version SDK: 1.19.0 |
|
|
869
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
804
870
|
*/
|
|
805
871
|
HostEvent["Share"] = "share";
|
|
806
872
|
/**
|
|
@@ -808,9 +874,36 @@ var HostEvent;
|
|
|
808
874
|
* @example
|
|
809
875
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
810
876
|
* searchEmbed.trigger(HostEvent.Save)
|
|
811
|
-
* @version SDK: 1.19.0 |
|
|
877
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
812
878
|
*/
|
|
813
879
|
HostEvent["Save"] = "save";
|
|
880
|
+
/**
|
|
881
|
+
* Triggers the SyncToSheets action on visualization
|
|
882
|
+
* @param - an object with vizId as a key
|
|
883
|
+
* @example
|
|
884
|
+
* liveboardEmbed.trigger(HostEvent.SyncToSheets, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
885
|
+
* vizEmbed.trigger(HostEvent.SyncToSheets)
|
|
886
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
887
|
+
*/
|
|
888
|
+
HostEvent["SyncToSheets"] = "sync-to-sheets";
|
|
889
|
+
/**
|
|
890
|
+
* Triggers the SyncToOtherApps action on visualization
|
|
891
|
+
* @param - an object with vizId as a key
|
|
892
|
+
* @example
|
|
893
|
+
* liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
894
|
+
* vizEmbed.trigger(HostEvent.SyncToOtherApps)
|
|
895
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
896
|
+
*/
|
|
897
|
+
HostEvent["SyncToOtherApps"] = "sync-to-other-apps";
|
|
898
|
+
/**
|
|
899
|
+
* Triggers the ManagePipelines action on visualization
|
|
900
|
+
* @param - an object with vizId as a key
|
|
901
|
+
* @example
|
|
902
|
+
* liveboardEmbed.trigger(HostEvent.ManagePipelines, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
903
|
+
* vizEmbed.trigger(HostEvent.ManagePipelines)
|
|
904
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
905
|
+
*/
|
|
906
|
+
HostEvent["ManagePipelines"] = "manage-pipeline";
|
|
814
907
|
})(HostEvent || (HostEvent = {}));
|
|
815
908
|
/**
|
|
816
909
|
* The different visual modes that the data sources panel within
|
|
@@ -9054,9 +9147,9 @@ const init = (embedConfig) => {
|
|
|
9054
9147
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_CALLED_INIT, {
|
|
9055
9148
|
authType: config.authType,
|
|
9056
9149
|
host: config.thoughtSpotHost,
|
|
9057
|
-
usedCustomizationSheet: ((_b = (_a = embedConfig.
|
|
9058
|
-
usedCustomizationVariables: ((_e = (_d = (_c = embedConfig.
|
|
9059
|
-
usedCustomizationRules: ((_h = (_g = (_f = embedConfig.
|
|
9150
|
+
usedCustomizationSheet: ((_b = (_a = embedConfig.customizations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) != null,
|
|
9151
|
+
usedCustomizationVariables: ((_e = (_d = (_c = embedConfig.customizations) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.customCSS) === null || _e === void 0 ? void 0 : _e.variables) != null,
|
|
9152
|
+
usedCustomizationRules: ((_h = (_g = (_f = embedConfig.customizations) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.customCSS) === null || _h === void 0 ? void 0 : _h.rules_UNSTABLE) !=
|
|
9060
9153
|
null,
|
|
9061
9154
|
});
|
|
9062
9155
|
if (config.callPrefetch) {
|
|
@@ -9276,7 +9369,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
9276
9369
|
});
|
|
9277
9370
|
}
|
|
9278
9371
|
|
|
9279
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.
|
|
9372
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.18.0-alpha.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**"];var exports={".":"./lib/src/index.js","./react":{"import":"./lib/src/react/index.js",require:"./cjs/src/react.index.js",types:"./lib/src/react/index.d.ts"}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","use-deep-compare-effect":"^1.8.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","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","dts-bundle":"0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"4.1.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^4.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-neo-theme":"^1.1.0","typedoc-plugin-toc-group":"0.0.5",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports,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};
|
|
9280
9373
|
|
|
9281
9374
|
/**
|
|
9282
9375
|
* Copyright (c) 2022
|
|
@@ -9450,22 +9543,18 @@ class TsEmbed {
|
|
|
9450
9543
|
this.embedConfig.autoLogin === true) {
|
|
9451
9544
|
queryParams[Param.DisableLoginRedirect] = true;
|
|
9452
9545
|
}
|
|
9546
|
+
// TODO remove this
|
|
9547
|
+
if (this.embedConfig.customCssUrl) {
|
|
9548
|
+
queryParams[Param.CustomCSSUrl] = this.embedConfig.customCssUrl;
|
|
9549
|
+
}
|
|
9453
9550
|
if (this.embedConfig.authType === AuthType.EmbeddedSSO) {
|
|
9454
9551
|
queryParams[Param.ForceSAMLAutoRedirect] = true;
|
|
9455
9552
|
}
|
|
9456
|
-
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, showAlerts, additionalFlags, locale,
|
|
9553
|
+
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, showAlerts, additionalFlags, locale, } = this.viewConfig;
|
|
9457
9554
|
if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
|
|
9458
9555
|
this.handleError('You cannot have both hidden actions and visible actions');
|
|
9459
9556
|
return queryParams;
|
|
9460
9557
|
}
|
|
9461
|
-
// TODO remove this
|
|
9462
|
-
if (this.embedConfig.customCssUrl) {
|
|
9463
|
-
queryParams[Param.CustomCSSUrl] = this.embedConfig.customCssUrl;
|
|
9464
|
-
}
|
|
9465
|
-
// If you need to override customCSS URL for a specific embed liveboard
|
|
9466
|
-
if (customCssUrl) {
|
|
9467
|
-
queryParams[Param.CustomCSSUrl] = customCssUrl;
|
|
9468
|
-
}
|
|
9469
9558
|
if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
|
|
9470
9559
|
queryParams[Param.DisableActions] = disabledActions;
|
|
9471
9560
|
}
|
|
@@ -9723,7 +9812,7 @@ class TsEmbed {
|
|
|
9723
9812
|
* @param messageType The event type
|
|
9724
9813
|
* @param data The payload to send with the message
|
|
9725
9814
|
*/
|
|
9726
|
-
trigger(messageType, data) {
|
|
9815
|
+
trigger(messageType, data = {}) {
|
|
9727
9816
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
9728
9817
|
return processTrigger(this.iFrame, messageType, this.thoughtSpotHost, data);
|
|
9729
9818
|
}
|
|
@@ -10140,7 +10229,7 @@ class SearchEmbed extends TsEmbed {
|
|
|
10140
10229
|
*/
|
|
10141
10230
|
getIFrameSrc(answerId, dataSources) {
|
|
10142
10231
|
var _a;
|
|
10143
|
-
const { hideResults,
|
|
10232
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, } = this.viewConfig;
|
|
10144
10233
|
const answerPath = answerId ? `saved-answer/${answerId}` : 'answer';
|
|
10145
10234
|
const queryParams = this.getBaseQueryParams();
|
|
10146
10235
|
queryParams[Param.HideActions] = [
|
|
@@ -10197,7 +10286,7 @@ class SearchEmbed extends TsEmbed {
|
|
|
10197
10286
|
* Embed ThoughtSpot search bar
|
|
10198
10287
|
*
|
|
10199
10288
|
* @Category Search Embed
|
|
10200
|
-
* @version: SDK: 1.
|
|
10289
|
+
* @version: SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
|
|
10201
10290
|
*/
|
|
10202
10291
|
class SearchBarEmbed extends TsEmbed {
|
|
10203
10292
|
constructor(domSelector, viewConfig) {
|