@thoughtspot/visual-embed-sdk 1.45.3 → 1.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +1 -1
- package/cjs/src/auth.d.ts +35 -2
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +35 -2
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +5 -5
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +87 -119
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +1 -1
- package/cjs/src/types.d.ts +56 -52
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +55 -51
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-BuwECGdm.js → index-BQvLEoxp.js} +1 -1
- package/dist/src/auth.d.ts +35 -2
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +1 -1
- package/dist/src/types.d.ts +56 -52
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +98 -61
- package/dist/tsembed-react.js +97 -60
- package/dist/tsembed.es.js +98 -61
- package/dist/tsembed.js +97 -60
- package/dist/visual-embed-sdk-react-full.d.ts +92 -55
- package/dist/visual-embed-sdk-react.d.ts +90 -53
- package/dist/visual-embed-sdk.d.ts +92 -55
- package/lib/package.json +1 -1
- package/lib/src/auth.d.ts +35 -2
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +35 -2
- package/lib/src/auth.js.map +1 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +5 -5
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +87 -119
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +1 -1
- package/lib/src/types.d.ts +56 -52
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +55 -51
- package/lib/src/types.js.map +1 -1
- package/package.json +1 -1
- package/src/auth.ts +35 -2
- package/src/embed/app.spec.ts +171 -211
- package/src/embed/app.ts +15 -10
- package/src/embed/conversation.ts +1 -1
- package/src/types.ts +57 -53
package/src/embed/app.ts
CHANGED
|
@@ -60,7 +60,7 @@ export enum Page {
|
|
|
60
60
|
/**
|
|
61
61
|
* Monitor Alerts Page
|
|
62
62
|
*/
|
|
63
|
-
Monitor = 'monitor'
|
|
63
|
+
Monitor = 'monitor',
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/**
|
|
@@ -230,7 +230,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
230
230
|
* });
|
|
231
231
|
* ```
|
|
232
232
|
*/
|
|
233
|
-
enablePendoHelp?: boolean
|
|
233
|
+
enablePendoHelp?: boolean;
|
|
234
234
|
/**
|
|
235
235
|
* Control the visibility of the hamburger icon on
|
|
236
236
|
* the top navigation bar in the V3 navigation experience.
|
|
@@ -740,7 +740,6 @@ export class AppEmbed extends V1Embed {
|
|
|
740
740
|
|
|
741
741
|
private defaultHeight = 500;
|
|
742
742
|
|
|
743
|
-
|
|
744
743
|
constructor(domSelector: DOMSelector, viewConfig: AppViewConfig) {
|
|
745
744
|
viewConfig.embedComponentType = 'AppEmbed';
|
|
746
745
|
super(domSelector, viewConfig);
|
|
@@ -748,7 +747,10 @@ export class AppEmbed extends V1Embed {
|
|
|
748
747
|
this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
749
748
|
this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
750
749
|
this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
751
|
-
this.on(
|
|
750
|
+
this.on(
|
|
751
|
+
EmbedEvent.RequestVisibleEmbedCoordinates,
|
|
752
|
+
this.requestVisibleEmbedCoordinatesHandler,
|
|
753
|
+
);
|
|
752
754
|
}
|
|
753
755
|
}
|
|
754
756
|
|
|
@@ -942,7 +944,9 @@ export class AppEmbed extends V1Embed {
|
|
|
942
944
|
}
|
|
943
945
|
|
|
944
946
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
945
|
-
params[
|
|
947
|
+
params[
|
|
948
|
+
Param.IsLiveboardStylingAndGroupingEnabled
|
|
949
|
+
] = isLiveboardStylingAndGroupingEnabled;
|
|
946
950
|
}
|
|
947
951
|
|
|
948
952
|
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
@@ -996,6 +1000,10 @@ export class AppEmbed extends V1Embed {
|
|
|
996
1000
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
997
1001
|
}
|
|
998
1002
|
|
|
1003
|
+
if (modularHomeExperience !== undefined) {
|
|
1004
|
+
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
999
1007
|
// Set navigation to v2 by default to avoid problems like the app
|
|
1000
1008
|
// switcher (9-dot menu) not showing when v3 navigation is turned on
|
|
1001
1009
|
// at the cluster level.
|
|
@@ -1005,9 +1013,6 @@ export class AppEmbed extends V1Embed {
|
|
|
1005
1013
|
// Set homePageVersion to v2 by default to reset the LD flag value
|
|
1006
1014
|
// for the homepageVersion.
|
|
1007
1015
|
params[Param.HomepageVersion] = 'v2';
|
|
1008
|
-
// Set listpageVersion to v2 by default to reset the LD flag value
|
|
1009
|
-
// for the listpageVersion.
|
|
1010
|
-
params[Param.ListPageVersion] = ListPage.List;
|
|
1011
1016
|
if (discoveryExperience) {
|
|
1012
1017
|
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
1013
1018
|
if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
|
|
@@ -1029,8 +1034,8 @@ export class AppEmbed extends V1Embed {
|
|
|
1029
1034
|
params[Param.HomepageVersion] = HomePage.ModularWithStylingChanges;
|
|
1030
1035
|
}
|
|
1031
1036
|
|
|
1032
|
-
// listPageVersion
|
|
1033
|
-
if (discoveryExperience.listPageVersion
|
|
1037
|
+
// listPageVersion can be changed to v2 or v3
|
|
1038
|
+
if (discoveryExperience.listPageVersion !== undefined) {
|
|
1034
1039
|
params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
|
|
1035
1040
|
}
|
|
1036
1041
|
}
|
|
@@ -162,7 +162,7 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
|
|
|
162
162
|
*
|
|
163
163
|
* Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
|
|
164
164
|
* @default true
|
|
165
|
-
* @
|
|
165
|
+
* @deprecated from SDK 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
166
166
|
* @example
|
|
167
167
|
* ```js
|
|
168
168
|
* // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
|
package/src/types.ts
CHANGED
|
@@ -1361,7 +1361,7 @@ export interface SearchLiveboardCommonViewConfig {
|
|
|
1361
1361
|
*
|
|
1362
1362
|
* Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
|
|
1363
1363
|
* @default true
|
|
1364
|
-
* @
|
|
1364
|
+
* @deprecated from SDK 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
1365
1365
|
* @example
|
|
1366
1366
|
* ```js
|
|
1367
1367
|
* // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
|
|
@@ -2859,65 +2859,69 @@ export enum EmbedEvent {
|
|
|
2859
2859
|
Rename = 'rename',
|
|
2860
2860
|
/**
|
|
2861
2861
|
*
|
|
2862
|
-
* This event
|
|
2863
|
-
*
|
|
2864
|
-
*
|
|
2865
|
-
*
|
|
2866
|
-
|
|
2867
|
-
*
|
|
2868
|
-
*
|
|
2869
|
-
*
|
|
2862
|
+
* This event allows developers to intercept search execution
|
|
2863
|
+
* and implement logic that decides whether Search Data should return
|
|
2864
|
+
* data or block the search operation.
|
|
2865
|
+
*
|
|
2866
|
+
* **Prerequisite**: Set`isOnBeforeGetVizDataInterceptEnabled` to `true`
|
|
2867
|
+
* to ensure that `EmbedEvent.OnBeforeGetVizDataIntercept` is emitted
|
|
2868
|
+
* when the embedding application user tries to run a search query.
|
|
2869
|
+
*
|
|
2870
|
+
* This framework applies only to `AppEmbed` and `SearchEmbed`.
|
|
2871
|
+
* @param - Includes the following parameters:
|
|
2870
2872
|
* - `payload`: The payload received from the embed related to the Data API call.
|
|
2871
2873
|
* - `responder`: Contains elements that let developers define whether ThoughtSpot
|
|
2872
|
-
*
|
|
2873
|
-
* should be shown to the user.
|
|
2874
|
+
* will run or block the search operation, and if blocked, which error message to provide.
|
|
2874
2875
|
*
|
|
2875
|
-
* `execute` - When `execute` returns `true`, the search
|
|
2876
|
-
* When `execute` returns `false`, the search
|
|
2876
|
+
* `execute` - When `execute` returns `true`, the search is run.
|
|
2877
|
+
* When `execute` returns `false`, the search is not executed.
|
|
2877
2878
|
*
|
|
2878
|
-
* `error` - Developers can customize the error message
|
|
2879
|
-
* is `false` using the `
|
|
2880
|
-
*
|
|
2881
|
-
* `errorText` - The error message text to be shown to the user.
|
|
2882
|
-
* `errorDescription (ThoughtSpot: 10.15.0.cl and above)` - The error description to be shown to the user.
|
|
2879
|
+
* `error` - Developers can customize the user-facing error message when `execute`
|
|
2880
|
+
* is `false` by using the `error` parameters in `responder`.
|
|
2881
|
+
* `errorText` - The error message text shown to the user.
|
|
2883
2882
|
* @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
|
|
2884
2883
|
* @example
|
|
2885
|
-
|
|
2886
|
-
*
|
|
2887
|
-
*
|
|
2888
|
-
*
|
|
2889
|
-
*
|
|
2890
|
-
*
|
|
2891
|
-
*
|
|
2892
|
-
*
|
|
2893
|
-
*
|
|
2894
|
-
*
|
|
2895
|
-
*
|
|
2896
|
-
*
|
|
2897
|
-
*
|
|
2898
|
-
* })
|
|
2884
|
+
*
|
|
2885
|
+
* This example blocks search operation and returns a custom error message:
|
|
2886
|
+
* ```js
|
|
2887
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
|
|
2888
|
+
* responder({
|
|
2889
|
+
* data: {
|
|
2890
|
+
* execute: false,
|
|
2891
|
+
* error: {
|
|
2892
|
+
* // Provide a custom error message to explain why the search did not run.
|
|
2893
|
+
* errorText: 'This search query cannot be run. Please contact your administrator for more details.',
|
|
2894
|
+
* },
|
|
2895
|
+
* },
|
|
2896
|
+
* });
|
|
2897
|
+
* });
|
|
2899
2898
|
* ```
|
|
2899
|
+
* @example
|
|
2900
2900
|
*
|
|
2901
|
-
|
|
2902
|
-
*
|
|
2903
|
-
*
|
|
2904
|
-
*
|
|
2905
|
-
* responder
|
|
2906
|
-
*
|
|
2907
|
-
*
|
|
2908
|
-
*
|
|
2909
|
-
*
|
|
2910
|
-
*
|
|
2911
|
-
*
|
|
2912
|
-
*
|
|
2913
|
-
*
|
|
2914
|
-
*
|
|
2915
|
-
*
|
|
2916
|
-
*
|
|
2917
|
-
*
|
|
2918
|
-
*
|
|
2919
|
-
*
|
|
2920
|
-
|
|
2901
|
+
* This example allows the search operation to run
|
|
2902
|
+
* unless the query contains both `sales` and `county`,
|
|
2903
|
+
* and returns a custom error message if the query is rejected:
|
|
2904
|
+
* ```js
|
|
2905
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
|
|
2906
|
+
* // Record the search query submitted by the end user.
|
|
2907
|
+
* const query = payload.data.data.answer.search_query;
|
|
2908
|
+
*
|
|
2909
|
+
* responder({
|
|
2910
|
+
* data: {
|
|
2911
|
+
* // Returns true as long as the query does not include both `sales` and `county`.
|
|
2912
|
+
* execute: !(query.includes('sales') && query.includes('county')),
|
|
2913
|
+
* error: {
|
|
2914
|
+
* // Provide a custom error message when the query is blocked by your logic.
|
|
2915
|
+
* errorText:
|
|
2916
|
+
* "You can't use this query: "
|
|
2917
|
+
* + query
|
|
2918
|
+
* + ". The 'sales' measure can never be used at the 'county' level. "
|
|
2919
|
+
* + "Please try another measure or remove 'county' from your search.",
|
|
2920
|
+
* },
|
|
2921
|
+
* },
|
|
2922
|
+
* });
|
|
2923
|
+
* });
|
|
2924
|
+
* ```
|
|
2921
2925
|
*/
|
|
2922
2926
|
OnBeforeGetVizDataIntercept = 'onBeforeGetVizDataIntercept',
|
|
2923
2927
|
/**
|
|
@@ -6907,4 +6911,4 @@ export interface ContextObject {
|
|
|
6907
6911
|
type: ContextType;
|
|
6908
6912
|
objectIds: ObjectIds;
|
|
6909
6913
|
}
|
|
6910
|
-
}
|
|
6914
|
+
}
|