@thoughtspot/visual-embed-sdk 1.28.0-alpha.2 → 1.28.0-preRender
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 -2
- package/cjs/src/embed/sage.d.ts +5 -5
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js +16 -1
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/sage.spec.js +11 -11
- package/cjs/src/embed/sage.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +2 -4
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/types.d.ts +28 -1
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +27 -0
- package/cjs/src/types.js.map +1 -1
- package/dist/src/embed/sage.d.ts +5 -5
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/types.d.ts +28 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +45 -5
- package/dist/tsembed-react.js +45 -5
- package/dist/tsembed.es.js +45 -5
- package/dist/tsembed.js +45 -5
- package/dist/visual-embed-sdk-react-full.d.ts +32 -5
- package/dist/visual-embed-sdk-react.d.ts +32 -5
- package/dist/visual-embed-sdk.d.ts +32 -5
- package/lib/package.json +3 -2
- package/lib/src/embed/sage.d.ts +5 -5
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js +16 -1
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/sage.spec.js +11 -11
- package/lib/src/embed/sage.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +2 -4
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/types.d.ts +28 -1
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +27 -0
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +33 -6
- package/package.json +3 -2
- package/src/embed/sage.spec.ts +11 -11
- package/src/embed/sage.ts +17 -4
- package/src/embed/ts-embed.ts +2 -4
- package/src/types.ts +30 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thoughtspot/visual-embed-sdk",
|
|
3
|
-
"version": "1.28.0-
|
|
3
|
+
"version": "1.28.0-preRender",
|
|
4
4
|
"description": "ThoughtSpot Embed SDK",
|
|
5
5
|
"module": "lib/src/index.js",
|
|
6
6
|
"main": "dist/tsembed.js",
|
|
@@ -67,7 +67,8 @@
|
|
|
67
67
|
"prepublishOnly": "npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build",
|
|
68
68
|
"check-size": "npm run build && size-limit",
|
|
69
69
|
"publish-dev": "npm publish --tag dev",
|
|
70
|
-
"publish-prod": "npm publish --tag latest"
|
|
70
|
+
"publish-prod": "npm publish --tag latest",
|
|
71
|
+
"nirmay": "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"
|
|
71
72
|
},
|
|
72
73
|
"peerDependencies": {
|
|
73
74
|
"react": "> 16.8.0",
|
package/src/embed/sage.spec.ts
CHANGED
|
@@ -40,7 +40,7 @@ describe('Sage embed tests', () => {
|
|
|
40
40
|
await executeAfterWait(() => {
|
|
41
41
|
expectUrlMatch(
|
|
42
42
|
getIFrameSrc(),
|
|
43
|
-
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSearchBarTitle=false&hideSageAnswerHeader=false&hideAction=%5B%
|
|
43
|
+
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSearchBarTitle=false&hideSageAnswerHeader=false&hideAction=%5B"reportError","save","pin","editACopy","saveAsView","updateTSL","editTSL","onDeleteAnswer","share"%5D#/embed/eureka`,
|
|
44
44
|
);
|
|
45
45
|
});
|
|
46
46
|
});
|
|
@@ -51,7 +51,7 @@ describe('Sage embed tests', () => {
|
|
|
51
51
|
await executeAfterWait(() => {
|
|
52
52
|
expectUrlMatch(
|
|
53
53
|
getIFrameSrc(),
|
|
54
|
-
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=true&hideSearchBarTitle=false&hideSageAnswerHeader=false&hideAction=%5B%
|
|
54
|
+
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=true&hideSearchBarTitle=false&hideSageAnswerHeader=false&hideAction=%5B"reportError","save","pin","editACopy","saveAsView","updateTSL","editTSL","onDeleteAnswer","share"%5D#/embed/eureka`,
|
|
55
55
|
);
|
|
56
56
|
});
|
|
57
57
|
});
|
|
@@ -65,7 +65,7 @@ describe('Sage embed tests', () => {
|
|
|
65
65
|
await executeAfterWait(() => {
|
|
66
66
|
expectUrlMatch(
|
|
67
67
|
getIFrameSrc(),
|
|
68
|
-
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=true&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSearchBarTitle=false&hideSageAnswerHeader=false&hideAction=%5B%
|
|
68
|
+
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=true&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSearchBarTitle=false&hideSageAnswerHeader=false&hideAction=%5B"reportError","save","pin","editACopy","saveAsView","updateTSL","editTSL","onDeleteAnswer","share"%5D#/embed/eureka`,
|
|
69
69
|
);
|
|
70
70
|
});
|
|
71
71
|
});
|
|
@@ -79,7 +79,7 @@ describe('Sage embed tests', () => {
|
|
|
79
79
|
await executeAfterWait(() => {
|
|
80
80
|
expectUrlMatch(
|
|
81
81
|
getIFrameSrc(),
|
|
82
|
-
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=true&hideEurekaSuggestions=false&isProductTour=false&hideSearchBarTitle=false&hideSageAnswerHeader=false&hideAction=%5B%
|
|
82
|
+
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=true&hideEurekaSuggestions=false&isProductTour=false&hideSearchBarTitle=false&hideSageAnswerHeader=false&hideAction=%5B"reportError","save","pin","editACopy","saveAsView","updateTSL","editTSL","onDeleteAnswer","share"%5D#/embed/eureka`,
|
|
83
83
|
);
|
|
84
84
|
});
|
|
85
85
|
});
|
|
@@ -93,7 +93,7 @@ describe('Sage embed tests', () => {
|
|
|
93
93
|
await executeAfterWait(() => {
|
|
94
94
|
expectUrlMatch(
|
|
95
95
|
getIFrameSrc(),
|
|
96
|
-
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSearchBarTitle=true&hideSageAnswerHeader=false&hideAction=%5B%
|
|
96
|
+
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSearchBarTitle=true&hideSageAnswerHeader=false&hideAction=%5B"reportError","save","pin","editACopy","saveAsView","updateTSL","editTSL","onDeleteAnswer","share"%5D#/embed/eureka`,
|
|
97
97
|
);
|
|
98
98
|
});
|
|
99
99
|
});
|
|
@@ -107,7 +107,7 @@ describe('Sage embed tests', () => {
|
|
|
107
107
|
await executeAfterWait(() => {
|
|
108
108
|
expectUrlMatch(
|
|
109
109
|
getIFrameSrc(),
|
|
110
|
-
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSearchBarTitle=false&hideSageAnswerHeader=true&hideAction=%5B%
|
|
110
|
+
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSearchBarTitle=false&hideSageAnswerHeader=true&hideAction=%5B"reportError","save","pin","editACopy","saveAsView","updateTSL","editTSL","onDeleteAnswer","share"%5D#/embed/eureka`,
|
|
111
111
|
);
|
|
112
112
|
});
|
|
113
113
|
});
|
|
@@ -121,7 +121,7 @@ describe('Sage embed tests', () => {
|
|
|
121
121
|
await executeAfterWait(() => {
|
|
122
122
|
expectUrlMatch(
|
|
123
123
|
getIFrameSrc(),
|
|
124
|
-
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=true&isProductTour=false&hideSearchBarTitle=false&hideSageAnswerHeader=false&hideAction=%5B%
|
|
124
|
+
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=true&isProductTour=false&hideSearchBarTitle=false&hideSageAnswerHeader=false&hideAction=%5B"reportError","save","pin","editACopy","saveAsView","updateTSL","editTSL","onDeleteAnswer","share"%5D#/embed/eureka`,
|
|
125
125
|
);
|
|
126
126
|
});
|
|
127
127
|
});
|
|
@@ -134,7 +134,7 @@ describe('Sage embed tests', () => {
|
|
|
134
134
|
await executeAfterWait(() => {
|
|
135
135
|
expectUrlMatch(
|
|
136
136
|
getIFrameSrc(),
|
|
137
|
-
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSearchBarTitle=false&hideSageAnswerHeader=false&hideAction=%5B%
|
|
137
|
+
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSearchBarTitle=false&hideSageAnswerHeader=false&hideAction=%5B"reportError","save","pin","editACopy","saveAsView","updateTSL","editTSL","onDeleteAnswer","share"%5D#/embed/eureka`,
|
|
138
138
|
);
|
|
139
139
|
});
|
|
140
140
|
});
|
|
@@ -148,7 +148,7 @@ describe('Sage embed tests', () => {
|
|
|
148
148
|
await executeAfterWait(() => {
|
|
149
149
|
expectUrlMatch(
|
|
150
150
|
getIFrameSrc(),
|
|
151
|
-
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSearchBarTitle=false&hideSageAnswerHeader=false&hideAction=%5B%
|
|
151
|
+
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSearchBarTitle=false&hideSageAnswerHeader=false&hideAction=%5B"reportError","save","pin","editACopy","saveAsView","updateTSL","editTSL","onDeleteAnswer","share"%5D#/embed/eureka?worksheet=worksheet-id`,
|
|
152
152
|
);
|
|
153
153
|
});
|
|
154
154
|
});
|
|
@@ -165,7 +165,7 @@ describe('Sage embed tests', () => {
|
|
|
165
165
|
await executeAfterWait(() => {
|
|
166
166
|
expectUrlMatch(
|
|
167
167
|
getIFrameSrc(),
|
|
168
|
-
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSearchBarTitle=false&hideSageAnswerHeader=false&hideAction=%5B%
|
|
168
|
+
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSearchBarTitle=false&hideSageAnswerHeader=false&hideAction=%5B"reportError","save","pin","editACopy","saveAsView","updateTSL","editTSL","onDeleteAnswer","share"%5D#/embed/eureka?worksheet=worksheet-id&query=test%20query`,
|
|
169
169
|
);
|
|
170
170
|
});
|
|
171
171
|
});
|
|
@@ -182,7 +182,7 @@ describe('Sage embed tests', () => {
|
|
|
182
182
|
await executeAfterWait(() => {
|
|
183
183
|
expectUrlMatch(
|
|
184
184
|
getIFrameSrc(),
|
|
185
|
-
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&hideAction=%5B%
|
|
185
|
+
`http://${thoughtSpotHost}/?embedApp=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&hideAction=%5B"reportError","save","pin","editACopy","saveAsView","updateTSL","editTSL","onDeleteAnswer","share"%5D#/embed/eureka?executeSearch=true&query=test-query`,
|
|
186
186
|
);
|
|
187
187
|
});
|
|
188
188
|
});
|
package/src/embed/sage.ts
CHANGED
|
@@ -65,17 +65,15 @@ export interface SageViewConfig
|
|
|
65
65
|
isProductTour?: boolean;
|
|
66
66
|
/**
|
|
67
67
|
* Show or hide the search bar title.
|
|
68
|
-
* @version SDK: 1.29.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
|
|
69
68
|
*
|
|
70
|
-
* @
|
|
69
|
+
* @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
|
|
71
70
|
*/
|
|
72
71
|
hideSearchBarTitle?: boolean;
|
|
73
72
|
/**
|
|
74
73
|
* Show or hide the Answer header, that is, the `AI Answer` title
|
|
75
74
|
* at the top of the Answer page.
|
|
76
|
-
* @version SDK: 1.29.0 | Thoughtspot: 9.10.0.cl
|
|
77
75
|
*
|
|
78
|
-
* @
|
|
76
|
+
* @version SDK: 1.26.0 | Thoughtspot: 9.10.0.cl
|
|
79
77
|
*/
|
|
80
78
|
hideSageAnswerHeader?: boolean;
|
|
81
79
|
/**
|
|
@@ -108,6 +106,7 @@ export interface SageViewConfig
|
|
|
108
106
|
* Show or hide sample questions.
|
|
109
107
|
* The sample questions are autogenerated based on the worksheet
|
|
110
108
|
* selected for the search operation.
|
|
109
|
+
*
|
|
111
110
|
* @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
|
|
112
111
|
*/
|
|
113
112
|
hideSampleQuestions?: boolean;
|
|
@@ -137,6 +136,16 @@ export interface SageViewConfig
|
|
|
137
136
|
*/
|
|
138
137
|
searchOptions?: SearchOptions;
|
|
139
138
|
}
|
|
139
|
+
export const HiddenActionItemByDefaultForSageEmbed = [
|
|
140
|
+
Action.Save,
|
|
141
|
+
Action.Pin,
|
|
142
|
+
Action.EditACopy,
|
|
143
|
+
Action.SaveAsView,
|
|
144
|
+
Action.UpdateTML,
|
|
145
|
+
Action.EditTML,
|
|
146
|
+
Action.AnswerDelete,
|
|
147
|
+
Action.Share,
|
|
148
|
+
];
|
|
140
149
|
/**
|
|
141
150
|
* Embed ThoughtSpot LLM and GPT-based Natural Language Search component.
|
|
142
151
|
*
|
|
@@ -188,6 +197,10 @@ export class SageEmbed extends V1Embed {
|
|
|
188
197
|
params[Param.IsProductTour] = !!isProductTour;
|
|
189
198
|
params[Param.HideSearchBarTitle] = !!hideSearchBarTitle;
|
|
190
199
|
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
200
|
+
params[Param.HideActions] = [
|
|
201
|
+
...(params[Param.HideActions] ?? []),
|
|
202
|
+
...HiddenActionItemByDefaultForSageEmbed,
|
|
203
|
+
];
|
|
191
204
|
|
|
192
205
|
return getQueryParamString(params, true);
|
|
193
206
|
}
|
package/src/embed/ts-embed.ts
CHANGED
|
@@ -1164,8 +1164,8 @@ export class TsEmbed {
|
|
|
1164
1164
|
const elBoundingClient = this.el.getBoundingClientRect();
|
|
1165
1165
|
|
|
1166
1166
|
setStyleProperties(this.preRenderWrapper, {
|
|
1167
|
-
top: `${elBoundingClient.y}px`,
|
|
1168
|
-
left: `${elBoundingClient.x}px`,
|
|
1167
|
+
top: `${elBoundingClient.y + window.scrollY}px`,
|
|
1168
|
+
left: `${elBoundingClient.x + window.scrollX}px`,
|
|
1169
1169
|
width: `${elBoundingClient.width}px`,
|
|
1170
1170
|
height: `${elBoundingClient.height}px`,
|
|
1171
1171
|
});
|
|
@@ -1186,8 +1186,6 @@ export class TsEmbed {
|
|
|
1186
1186
|
pointerEvents: 'none',
|
|
1187
1187
|
zIndex: '-1000',
|
|
1188
1188
|
position: 'absolute ',
|
|
1189
|
-
top: '0',
|
|
1190
|
-
left: '0',
|
|
1191
1189
|
};
|
|
1192
1190
|
setStyleProperties(this.preRenderWrapper, preRenderHideStyles);
|
|
1193
1191
|
|
package/src/types.ts
CHANGED
|
@@ -3733,6 +3733,36 @@ export enum Action {
|
|
|
3733
3733
|
* @version SDK: 1.29.0 | Thoughtspot: 9.12.0.cl
|
|
3734
3734
|
*/
|
|
3735
3735
|
AskAi = 'AskAi',
|
|
3736
|
+
|
|
3737
|
+
/**
|
|
3738
|
+
* The **Add KPI to Watchlist** action on Home page watchlist.
|
|
3739
|
+
* @example
|
|
3740
|
+
* ```js
|
|
3741
|
+
* disabledActions: [Action.AddToWatchlist]
|
|
3742
|
+
* ```
|
|
3743
|
+
* @version SDK : 1.27.9 | Thoughtspot: 9.12.5.cl
|
|
3744
|
+
*/
|
|
3745
|
+
AddToWatchlist = 'addToWatchlist',
|
|
3746
|
+
|
|
3747
|
+
/**
|
|
3748
|
+
* The **Remove from watchlist** menu action on KPI watchlist.
|
|
3749
|
+
* @example
|
|
3750
|
+
* ```js
|
|
3751
|
+
* disabledActions: [Action.RemoveFromWatchlist]
|
|
3752
|
+
* ```
|
|
3753
|
+
* @version SDK : 1.27.9 | Thoughtspot: 9.12.5.cl
|
|
3754
|
+
*/
|
|
3755
|
+
RemoveFromWatchlist = 'removeFromWatchlist',
|
|
3756
|
+
|
|
3757
|
+
/**
|
|
3758
|
+
* The **Copy KPI Link** menu action on KPI watchlist.
|
|
3759
|
+
* @example
|
|
3760
|
+
* ```js
|
|
3761
|
+
* disabledActions: [Action.CopyKpiLink]
|
|
3762
|
+
* ```
|
|
3763
|
+
* @version SDK : 1.27.9 | Thoughtspot: 9.12.5.cl
|
|
3764
|
+
*/
|
|
3765
|
+
CopyKpiLink = 'copyKpiLink',
|
|
3736
3766
|
}
|
|
3737
3767
|
|
|
3738
3768
|
export interface AnswerServiceType {
|