@thoughtspot/visual-embed-sdk 1.44.0 → 1.44.1-test
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/api-intercept.d.ts.map +1 -1
- package/cjs/src/api-intercept.js +8 -3
- package/cjs/src/api-intercept.js.map +1 -1
- package/cjs/src/api-intercept.spec.js +19 -3
- package/cjs/src/api-intercept.spec.js.map +1 -1
- package/cjs/src/embed/app.d.ts +17 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +6 -4
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +84 -1
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts +7 -0
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +16 -1
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/base.spec.js +21 -0
- package/cjs/src/embed/base.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +6 -1
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +6 -1
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +18 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +10 -5
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +86 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +3 -2
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +51 -17
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +93 -5
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +7 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +7 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +2 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/types.d.ts +248 -6
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +134 -2
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-B2QPwxuL.js → index-BXCUJ09L.js} +1 -1
- package/dist/src/api-intercept.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +17 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +7 -0
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +18 -0
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +3 -2
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/errors.d.ts +7 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/types.d.ts +248 -6
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +293 -104
- package/dist/tsembed-react.js +292 -103
- package/dist/tsembed.es.js +307 -105
- package/dist/tsembed.js +306 -103
- package/dist/visual-embed-sdk-react-full.d.ts +245 -7
- package/dist/visual-embed-sdk-react.d.ts +238 -7
- package/dist/visual-embed-sdk.d.ts +245 -7
- package/lib/package.json +1 -1
- package/lib/src/api-intercept.d.ts.map +1 -1
- package/lib/src/api-intercept.js +9 -4
- package/lib/src/api-intercept.js.map +1 -1
- package/lib/src/api-intercept.spec.js +20 -4
- package/lib/src/api-intercept.spec.js.map +1 -1
- package/lib/src/embed/app.d.ts +17 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +6 -4
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +84 -1
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +7 -0
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +14 -0
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/base.spec.js +21 -0
- package/lib/src/embed/base.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +7 -2
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +7 -2
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +18 -0
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +11 -6
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +86 -0
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +3 -2
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +52 -18
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +94 -6
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +7 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +7 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/types.d.ts +248 -6
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +133 -1
- package/lib/src/types.js.map +1 -1
- package/package.json +1 -1
- package/src/api-intercept.spec.ts +23 -10
- package/src/api-intercept.ts +9 -4
- package/src/embed/app.spec.ts +116 -2
- package/src/embed/app.ts +26 -2
- package/src/embed/base.spec.ts +28 -0
- package/src/embed/base.ts +15 -0
- package/src/embed/conversation.spec.ts +7 -2
- package/src/embed/conversation.ts +7 -2
- package/src/embed/liveboard.spec.ts +107 -0
- package/src/embed/liveboard.ts +32 -4
- package/src/embed/ts-embed.spec.ts +107 -15
- package/src/embed/ts-embed.ts +56 -19
- package/src/errors.ts +7 -0
- package/src/index.ts +2 -0
- package/src/react/all-types-export.ts +1 -0
- package/src/types.ts +259 -6
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.44.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.44.1-test */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -786,6 +786,7 @@
|
|
|
786
786
|
* SearchEmbed.on(EmbedEvent.Error, (error) => {
|
|
787
787
|
* console.log(error);
|
|
788
788
|
* // { type: "Error", data: { errorType: "API", error: { message: '...', error: '...' } } }
|
|
789
|
+
* // { errorType: "API", message: '...', code: '...' } new format
|
|
789
790
|
* });
|
|
790
791
|
* ```
|
|
791
792
|
* @example
|
|
@@ -797,6 +798,7 @@
|
|
|
797
798
|
* // message: "Fullscreen API is not enabled",
|
|
798
799
|
* // stack: "..."
|
|
799
800
|
* // } }}
|
|
801
|
+
* // { errorType: "FULLSCREEN", message: "Fullscreen API is not enabled", code: '...' } new format
|
|
800
802
|
* })
|
|
801
803
|
* ```
|
|
802
804
|
*/
|
|
@@ -952,7 +954,8 @@
|
|
|
952
954
|
*/
|
|
953
955
|
EmbedEvent["ALL"] = "*";
|
|
954
956
|
/**
|
|
955
|
-
* Emitted when an Answer is saved in the app
|
|
957
|
+
* Emitted when an Answer is saved in the app.
|
|
958
|
+
* Use start:true to subscribe to when save is initiated, or end:true to subscribe to when save is completed. Default is end:true.
|
|
956
959
|
* @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
957
960
|
* @example
|
|
958
961
|
*```js
|
|
@@ -987,6 +990,7 @@
|
|
|
987
990
|
EmbedEvent["Download"] = "download";
|
|
988
991
|
/**
|
|
989
992
|
* Emitted when the download action is triggered on an Answer.
|
|
993
|
+
* Use start:true to subscribe to when download is initiated, or end:true to subscribe to when download is completed. Default is end:true.
|
|
990
994
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
|
|
991
995
|
* @example
|
|
992
996
|
*```js
|
|
@@ -1001,6 +1005,7 @@
|
|
|
1001
1005
|
EmbedEvent["DownloadAsPng"] = "downloadAsPng";
|
|
1002
1006
|
/**
|
|
1003
1007
|
* Emitted when the Download as PDF action is triggered on an Answer
|
|
1008
|
+
* Use start:true to subscribe to when download as PDF is initiated, or end:true to subscribe to when download as PDF is completed. Default is end:true.
|
|
1004
1009
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1005
1010
|
* @example
|
|
1006
1011
|
*```js
|
|
@@ -1015,6 +1020,7 @@
|
|
|
1015
1020
|
EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
1016
1021
|
/**
|
|
1017
1022
|
* Emitted when the Download as CSV action is triggered on an Answer.
|
|
1023
|
+
* Use start:true to subscribe to when download as CSV is initiated, or end:true to subscribe to when download as CSV is completed. Default is end:true.
|
|
1018
1024
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1019
1025
|
* @example
|
|
1020
1026
|
*```js
|
|
@@ -1029,6 +1035,7 @@
|
|
|
1029
1035
|
EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
|
|
1030
1036
|
/**
|
|
1031
1037
|
* Emitted when the Download as XLSX action is triggered on an Answer.
|
|
1038
|
+
* Use start:true to subscribe to when download as XLSX is initiated, or end:true to subscribe to when download as XLSX is completed. Default is end:true.
|
|
1032
1039
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1033
1040
|
* @example
|
|
1034
1041
|
*```js
|
|
@@ -1043,6 +1050,7 @@
|
|
|
1043
1050
|
EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
|
|
1044
1051
|
/**
|
|
1045
1052
|
* Emitted when an Answer is deleted in the app
|
|
1053
|
+
* Use start:true to subscribe to when delete is initiated, or end:true to subscribe to when delete is completed. Default is end:true.
|
|
1046
1054
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1047
1055
|
* @example
|
|
1048
1056
|
*```js
|
|
@@ -1069,6 +1077,7 @@
|
|
|
1069
1077
|
/**
|
|
1070
1078
|
* Emitted when a user initiates the Pin action to
|
|
1071
1079
|
* add an Answer to a Liveboard.
|
|
1080
|
+
* Use start:true to subscribe to when pin is initiated, or end:true to subscribe to when pin is completed. Default is end:true.
|
|
1072
1081
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1073
1082
|
* @example
|
|
1074
1083
|
*```js
|
|
@@ -1182,6 +1191,7 @@
|
|
|
1182
1191
|
/**
|
|
1183
1192
|
* Emitted when the **Export TML** action is triggered on an
|
|
1184
1193
|
* an embedded object in the app
|
|
1194
|
+
* Use start:true to subscribe to when export is initiated, or end:true to subscribe to when export is completed. Default is end:true.
|
|
1185
1195
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1186
1196
|
* @example
|
|
1187
1197
|
*```js
|
|
@@ -1207,6 +1217,7 @@
|
|
|
1207
1217
|
EmbedEvent["SaveAsView"] = "saveAsView";
|
|
1208
1218
|
/**
|
|
1209
1219
|
* Emitted when the user creates a copy of an Answer.
|
|
1220
|
+
* Use start:true to subscribe to when copy and edit is initiated, or end:true to subscribe to when copy and edit is completed. Default is end:true.
|
|
1210
1221
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1211
1222
|
* @example
|
|
1212
1223
|
*```js
|
|
@@ -3278,6 +3289,8 @@
|
|
|
3278
3289
|
Param["HideLiveboardHeader"] = "hideLiveboardHeader";
|
|
3279
3290
|
Param["ShowLiveboardDescription"] = "showLiveboardDescription";
|
|
3280
3291
|
Param["ShowLiveboardTitle"] = "showLiveboardTitle";
|
|
3292
|
+
Param["ShowMaskedFilterChip"] = "showMaskedFilterChip";
|
|
3293
|
+
Param["IsLiveboardMasterpiecesEnabled"] = "isLiveboardMasterpiecesEnabled";
|
|
3281
3294
|
Param["HiddenTabs"] = "hideTabs";
|
|
3282
3295
|
Param["VisibleTabs"] = "visibleTabs";
|
|
3283
3296
|
Param["HideTabPanel"] = "hideTabPanel";
|
|
@@ -4649,6 +4662,46 @@
|
|
|
4649
4662
|
* @version SDK: 1.43.0 | ThoughtSpot Cloud: 10.15.0.cl
|
|
4650
4663
|
*/
|
|
4651
4664
|
Action["LiveboardStylePanel"] = "liveboardStylePanel";
|
|
4665
|
+
/**
|
|
4666
|
+
* The **Move to Group** menu action on a Liveboard.
|
|
4667
|
+
* Allows moving a visualization to a different group.
|
|
4668
|
+
* @example
|
|
4669
|
+
* ```js
|
|
4670
|
+
* disabledActions: [Action.MoveToGroup]
|
|
4671
|
+
* ```
|
|
4672
|
+
* @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
|
|
4673
|
+
*/
|
|
4674
|
+
Action["MoveToGroup"] = "moveToGroup";
|
|
4675
|
+
/**
|
|
4676
|
+
* The **Move out of Group** menu action on a Liveboard.
|
|
4677
|
+
* Allows moving a visualization out of a group.
|
|
4678
|
+
* @example
|
|
4679
|
+
* ```js
|
|
4680
|
+
* disabledActions: [Action.MoveOutOfGroup]
|
|
4681
|
+
* ```
|
|
4682
|
+
* @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
|
|
4683
|
+
*/
|
|
4684
|
+
Action["MoveOutOfGroup"] = "moveOutOfGroup";
|
|
4685
|
+
/**
|
|
4686
|
+
* The **Create Group** menu action on a Liveboard.
|
|
4687
|
+
* Allows creating a new group.
|
|
4688
|
+
* @example
|
|
4689
|
+
* ```js
|
|
4690
|
+
* disabledActions: [Action.CreateGroup]
|
|
4691
|
+
* ```
|
|
4692
|
+
* @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
|
|
4693
|
+
*/
|
|
4694
|
+
Action["CreateGroup"] = "createGroup";
|
|
4695
|
+
/**
|
|
4696
|
+
* The **Ungroup Liveboard Group** menu action on a Liveboard.
|
|
4697
|
+
* Allows ungrouping a liveboard group.
|
|
4698
|
+
* @example
|
|
4699
|
+
* ```js
|
|
4700
|
+
* disabledActions: [Action.UngroupLiveboardGroup]
|
|
4701
|
+
* ```
|
|
4702
|
+
* @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
|
|
4703
|
+
*/
|
|
4704
|
+
Action["UngroupLiveboardGroup"] = "ungroupLiveboardGroup";
|
|
4652
4705
|
})(exports.Action || (exports.Action = {}));
|
|
4653
4706
|
var PrefetchFeatures;
|
|
4654
4707
|
(function (PrefetchFeatures) {
|
|
@@ -4771,6 +4824,85 @@
|
|
|
4771
4824
|
*/
|
|
4772
4825
|
LogLevel["TRACE"] = "TRACE";
|
|
4773
4826
|
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
4827
|
+
/**
|
|
4828
|
+
* Error types emitted by embedded components.
|
|
4829
|
+
*
|
|
4830
|
+
* These enum values categorize different types of errors that can occur during
|
|
4831
|
+
* the lifecycle of an embedded ThoughtSpot component. Use these values to implement
|
|
4832
|
+
* specific error handling logic based on the error category.
|
|
4833
|
+
*
|
|
4834
|
+
* @see {@link EmbedErrorDetailsEvent} - The error event object structure
|
|
4835
|
+
* @see {@link EmbedEvent.Error} - The event that emits these errors
|
|
4836
|
+
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
4837
|
+
* @group Error Handling
|
|
4838
|
+
*/
|
|
4839
|
+
var ErrorDetailsTypes;
|
|
4840
|
+
(function (ErrorDetailsTypes) {
|
|
4841
|
+
/** API call failure */
|
|
4842
|
+
ErrorDetailsTypes["API"] = "API";
|
|
4843
|
+
/** General validation error */
|
|
4844
|
+
ErrorDetailsTypes["VALIDATION_ERROR"] = "VALIDATION_ERROR";
|
|
4845
|
+
/** Network connectivity or request error */
|
|
4846
|
+
ErrorDetailsTypes["NETWORK"] = "NETWORK";
|
|
4847
|
+
})(ErrorDetailsTypes || (ErrorDetailsTypes = {}));
|
|
4848
|
+
/**
|
|
4849
|
+
* Specific error codes for embedded component errors.
|
|
4850
|
+
*
|
|
4851
|
+
* These codes provide granular identification of errors that occur in embedded components.
|
|
4852
|
+
* They are returned in the {@link EmbedErrorDetailsEvent.code} property and allow for
|
|
4853
|
+
* precise error handling and debugging.
|
|
4854
|
+
*
|
|
4855
|
+
* The codes are organized into categories:
|
|
4856
|
+
* - **Worksheet ID not found or does not exist**: Errors related to applying or updating filters
|
|
4857
|
+
* - **Liveboard ID missing**: Errors related to missing liveboard ID
|
|
4858
|
+
* - **Conflicting actions configuration**: Errors related to conflicting actions configuration
|
|
4859
|
+
* - **Conflicting tabs configuration**: Errors related to conflicting tabs configuration
|
|
4860
|
+
* - **Initialization error**: Errors related to initialization error
|
|
4861
|
+
* - **Network error**: Errors related to network error
|
|
4862
|
+
* - **Custom action validation**: Errors related to custom action validation
|
|
4863
|
+
* - **Login failed**: Errors related to login failed
|
|
4864
|
+
* - **Render not called**: Errors related to render not called
|
|
4865
|
+
* - **Host event type undefined or invalid**: Errors related to host event type undefined or invalid
|
|
4866
|
+
*
|
|
4867
|
+
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
4868
|
+
* @group Error Handling
|
|
4869
|
+
* @see {@link EmbedErrorDetailsEvent} - The error event object that includes these codes
|
|
4870
|
+
* @see {@link ErrorDetailsTypes} - General error type categories
|
|
4871
|
+
*
|
|
4872
|
+
* @example
|
|
4873
|
+
* Handle specific error codes
|
|
4874
|
+
*
|
|
4875
|
+
* embed.on(EmbedEvent.Error, (error) => {
|
|
4876
|
+
* if (error.code === EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND) {
|
|
4877
|
+
* console.error('Worksheet ID not found:', error.message);
|
|
4878
|
+
* }
|
|
4879
|
+
* });
|
|
4880
|
+
* */
|
|
4881
|
+
var EmbedErrorCodes;
|
|
4882
|
+
(function (EmbedErrorCodes) {
|
|
4883
|
+
/** Worksheet ID not found or does not exist */
|
|
4884
|
+
EmbedErrorCodes["WORKSHEET_ID_NOT_FOUND"] = "WORKSHEET_ID_NOT_FOUND";
|
|
4885
|
+
/** Required Liveboard ID is missing from configuration */
|
|
4886
|
+
EmbedErrorCodes["LIVEBOARD_ID_MISSING"] = "LIVEBOARD_ID_MISSING";
|
|
4887
|
+
/** Conflicting action configuration detected (e.g., both hiddenActions and visibleActions specified) */
|
|
4888
|
+
EmbedErrorCodes["CONFLICTING_ACTIONS_CONFIG"] = "CONFLICTING_ACTIONS_CONFIG";
|
|
4889
|
+
/** Conflicting tab configuration detected (e.g., both hiddenTabs and visibleTabs specified) */
|
|
4890
|
+
EmbedErrorCodes["CONFLICTING_TABS_CONFIG"] = "CONFLICTING_TABS_CONFIG";
|
|
4891
|
+
/** Error during component initialization */
|
|
4892
|
+
EmbedErrorCodes["INIT_ERROR"] = "INIT_ERROR";
|
|
4893
|
+
/** Network connectivity or request error */
|
|
4894
|
+
EmbedErrorCodes["NETWORK_ERROR"] = "NETWORK_ERROR";
|
|
4895
|
+
/** Custom action validation failed */
|
|
4896
|
+
EmbedErrorCodes["CUSTOM_ACTION_VALIDATION"] = "CUSTOM_ACTION_VALIDATION";
|
|
4897
|
+
/** Authentication/login failed */
|
|
4898
|
+
EmbedErrorCodes["LOGIN_FAILED"] = "LOGIN_FAILED";
|
|
4899
|
+
/** Render method was not called before attempting to use the component */
|
|
4900
|
+
EmbedErrorCodes["RENDER_NOT_CALLED"] = "RENDER_NOT_CALLED";
|
|
4901
|
+
/** Host event type is undefined or invalid */
|
|
4902
|
+
EmbedErrorCodes["HOST_EVENT_TYPE_UNDEFINED"] = "HOST_EVENT_TYPE_UNDEFINED";
|
|
4903
|
+
/** Error parsing api intercept body */
|
|
4904
|
+
EmbedErrorCodes["PARSING_API_INTERCEPT_BODY_ERROR"] = "PARSING_API_INTERCEPT_BODY_ERROR";
|
|
4905
|
+
})(EmbedErrorCodes || (EmbedErrorCodes = {}));
|
|
4774
4906
|
/**
|
|
4775
4907
|
* Enum for the type of API intercepted
|
|
4776
4908
|
*/
|
|
@@ -7584,6 +7716,13 @@
|
|
|
7584
7716
|
RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
|
|
7585
7717
|
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
7586
7718
|
OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
|
|
7719
|
+
INIT_SDK_REQUIRED: 'You need to init the ThoughtSpot SDK module first',
|
|
7720
|
+
CONFLICTING_ACTIONS_CONFIG: 'You cannot have both hidden actions and visible actions',
|
|
7721
|
+
CONFLICTING_TABS_CONFIG: 'You cannot have both hidden Tabs and visible Tabs',
|
|
7722
|
+
RENDER_BEFORE_EVENTS_REQUIRED: 'Please call render before triggering events',
|
|
7723
|
+
HOST_EVENT_TYPE_UNDEFINED: 'Host event type is undefined',
|
|
7724
|
+
LOGIN_FAILED: 'Login failed',
|
|
7725
|
+
ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
|
|
7587
7726
|
};
|
|
7588
7727
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
7589
7728
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -17338,6 +17477,76 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17338
17477
|
};
|
|
17339
17478
|
}
|
|
17340
17479
|
|
|
17480
|
+
/**
|
|
17481
|
+
* Reloads the ThoughtSpot iframe.
|
|
17482
|
+
* @param iFrame
|
|
17483
|
+
*/
|
|
17484
|
+
const reload = (iFrame) => {
|
|
17485
|
+
const src = iFrame.src;
|
|
17486
|
+
iFrame.src = '';
|
|
17487
|
+
setTimeout(() => {
|
|
17488
|
+
iFrame.src = src;
|
|
17489
|
+
}, 100);
|
|
17490
|
+
};
|
|
17491
|
+
/**
|
|
17492
|
+
* Post iframe message.
|
|
17493
|
+
* @param iFrame
|
|
17494
|
+
* @param message
|
|
17495
|
+
* @param message.type
|
|
17496
|
+
* @param message.data
|
|
17497
|
+
* @param thoughtSpotHost
|
|
17498
|
+
* @param channel
|
|
17499
|
+
*/
|
|
17500
|
+
function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
|
|
17501
|
+
var _a;
|
|
17502
|
+
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
|
|
17503
|
+
}
|
|
17504
|
+
const TRIGGER_TIMEOUT = 30000;
|
|
17505
|
+
/**
|
|
17506
|
+
*
|
|
17507
|
+
* @param iFrame
|
|
17508
|
+
* @param messageType
|
|
17509
|
+
* @param thoughtSpotHost
|
|
17510
|
+
* @param data
|
|
17511
|
+
*/
|
|
17512
|
+
function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
17513
|
+
return new Promise((res, rej) => {
|
|
17514
|
+
var _a;
|
|
17515
|
+
if (messageType === exports.HostEvent.Reload) {
|
|
17516
|
+
reload(iFrame);
|
|
17517
|
+
return res(null);
|
|
17518
|
+
}
|
|
17519
|
+
if (messageType === exports.HostEvent.Present) {
|
|
17520
|
+
const embedConfig = getEmbedConfig();
|
|
17521
|
+
const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
|
|
17522
|
+
if (!disableFullscreenPresentation) {
|
|
17523
|
+
handlePresentEvent(iFrame);
|
|
17524
|
+
}
|
|
17525
|
+
else {
|
|
17526
|
+
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
17527
|
+
}
|
|
17528
|
+
}
|
|
17529
|
+
const channel = new MessageChannel();
|
|
17530
|
+
channel.port1.onmessage = ({ data: responseData }) => {
|
|
17531
|
+
var _a;
|
|
17532
|
+
channel.port1.close();
|
|
17533
|
+
const error = responseData.error || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
|
|
17534
|
+
if (error) {
|
|
17535
|
+
rej(error);
|
|
17536
|
+
}
|
|
17537
|
+
else {
|
|
17538
|
+
res(responseData);
|
|
17539
|
+
}
|
|
17540
|
+
};
|
|
17541
|
+
// Close the messageChannel and resolve the promise if timeout.
|
|
17542
|
+
setTimeout(() => {
|
|
17543
|
+
channel.port1.close();
|
|
17544
|
+
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
17545
|
+
}, TRIGGER_TIMEOUT);
|
|
17546
|
+
return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
|
|
17547
|
+
});
|
|
17548
|
+
}
|
|
17549
|
+
|
|
17341
17550
|
/* eslint-disable camelcase */
|
|
17342
17551
|
/* eslint-disable import/no-mutable-exports */
|
|
17343
17552
|
/**
|
|
@@ -17676,77 +17885,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17676
17885
|
return eventData;
|
|
17677
17886
|
}
|
|
17678
17887
|
|
|
17679
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.
|
|
17680
|
-
|
|
17681
|
-
/**
|
|
17682
|
-
* Reloads the ThoughtSpot iframe.
|
|
17683
|
-
* @param iFrame
|
|
17684
|
-
*/
|
|
17685
|
-
const reload = (iFrame) => {
|
|
17686
|
-
const src = iFrame.src;
|
|
17687
|
-
iFrame.src = '';
|
|
17688
|
-
setTimeout(() => {
|
|
17689
|
-
iFrame.src = src;
|
|
17690
|
-
}, 100);
|
|
17691
|
-
};
|
|
17692
|
-
/**
|
|
17693
|
-
* Post iframe message.
|
|
17694
|
-
* @param iFrame
|
|
17695
|
-
* @param message
|
|
17696
|
-
* @param message.type
|
|
17697
|
-
* @param message.data
|
|
17698
|
-
* @param thoughtSpotHost
|
|
17699
|
-
* @param channel
|
|
17700
|
-
*/
|
|
17701
|
-
function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
|
|
17702
|
-
var _a;
|
|
17703
|
-
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
|
|
17704
|
-
}
|
|
17705
|
-
const TRIGGER_TIMEOUT = 30000;
|
|
17706
|
-
/**
|
|
17707
|
-
*
|
|
17708
|
-
* @param iFrame
|
|
17709
|
-
* @param messageType
|
|
17710
|
-
* @param thoughtSpotHost
|
|
17711
|
-
* @param data
|
|
17712
|
-
*/
|
|
17713
|
-
function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
17714
|
-
return new Promise((res, rej) => {
|
|
17715
|
-
var _a;
|
|
17716
|
-
if (messageType === exports.HostEvent.Reload) {
|
|
17717
|
-
reload(iFrame);
|
|
17718
|
-
return res(null);
|
|
17719
|
-
}
|
|
17720
|
-
if (messageType === exports.HostEvent.Present) {
|
|
17721
|
-
const embedConfig = getEmbedConfig();
|
|
17722
|
-
const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
|
|
17723
|
-
if (!disableFullscreenPresentation) {
|
|
17724
|
-
handlePresentEvent(iFrame);
|
|
17725
|
-
}
|
|
17726
|
-
else {
|
|
17727
|
-
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
17728
|
-
}
|
|
17729
|
-
}
|
|
17730
|
-
const channel = new MessageChannel();
|
|
17731
|
-
channel.port1.onmessage = ({ data: responseData }) => {
|
|
17732
|
-
var _a;
|
|
17733
|
-
channel.port1.close();
|
|
17734
|
-
const error = responseData.error || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
|
|
17735
|
-
if (error) {
|
|
17736
|
-
rej(error);
|
|
17737
|
-
}
|
|
17738
|
-
else {
|
|
17739
|
-
res(responseData);
|
|
17740
|
-
}
|
|
17741
|
-
};
|
|
17742
|
-
// Close the messageChannel and resolve the promise if timeout.
|
|
17743
|
-
setTimeout(() => {
|
|
17744
|
-
channel.port1.close();
|
|
17745
|
-
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
17746
|
-
}, TRIGGER_TIMEOUT);
|
|
17747
|
-
return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
|
|
17748
|
-
});
|
|
17749
|
-
}
|
|
17888
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.1-test";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$1={".":{"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","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","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","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":"^22.2.3","@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":"^26.6.3","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:"^26.6.3","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":"^26.5.5","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$1,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};
|
|
17750
17889
|
|
|
17751
17890
|
class HostEventClient {
|
|
17752
17891
|
constructor(iFrame) {
|
|
@@ -17944,9 +18083,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17944
18083
|
const { eventData, executeEvent, viewConfig, getUnsavedAnswerTml } = params;
|
|
17945
18084
|
const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
|
|
17946
18085
|
if (bodyParseError) {
|
|
17947
|
-
|
|
17948
|
-
|
|
17949
|
-
|
|
18086
|
+
const errorDetails = {
|
|
18087
|
+
errorType: ErrorDetailsTypes.API,
|
|
18088
|
+
message: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
18089
|
+
code: EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
|
|
18090
|
+
error: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
18091
|
+
};
|
|
18092
|
+
executeEvent(exports.EmbedEvent.Error, errorDetails);
|
|
17950
18093
|
logger$3.error('Error parsing request body', bodyParseError);
|
|
17951
18094
|
return;
|
|
17952
18095
|
}
|
|
@@ -18258,19 +18401,23 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18258
18401
|
* Throws error encountered during initialization.
|
|
18259
18402
|
*/
|
|
18260
18403
|
throwInitError() {
|
|
18261
|
-
this.handleError(
|
|
18404
|
+
this.handleError({
|
|
18405
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18406
|
+
message: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
18407
|
+
code: EmbedErrorCodes.INIT_ERROR,
|
|
18408
|
+
error: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
18409
|
+
});
|
|
18262
18410
|
}
|
|
18263
18411
|
/**
|
|
18264
18412
|
* Handles errors within the SDK
|
|
18265
18413
|
* @param error The error message or object
|
|
18414
|
+
* @param errorDetails The error details
|
|
18266
18415
|
*/
|
|
18267
|
-
handleError(
|
|
18416
|
+
handleError(errorDetails) {
|
|
18268
18417
|
this.isError = true;
|
|
18269
|
-
this.executeCallbacks(exports.EmbedEvent.Error,
|
|
18270
|
-
error,
|
|
18271
|
-
});
|
|
18418
|
+
this.executeCallbacks(exports.EmbedEvent.Error, errorDetails);
|
|
18272
18419
|
// Log error
|
|
18273
|
-
logger$3.error(
|
|
18420
|
+
logger$3.error(errorDetails);
|
|
18274
18421
|
}
|
|
18275
18422
|
/**
|
|
18276
18423
|
* Extracts the type field from the event payload
|
|
@@ -18349,11 +18496,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18349
18496
|
};
|
|
18350
18497
|
window.addEventListener('online', onlineEventListener);
|
|
18351
18498
|
const offlineEventListener = (e) => {
|
|
18352
|
-
const
|
|
18353
|
-
|
|
18354
|
-
|
|
18355
|
-
|
|
18356
|
-
|
|
18499
|
+
const errorDetails = {
|
|
18500
|
+
errorType: ErrorDetailsTypes.NETWORK,
|
|
18501
|
+
message: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
18502
|
+
code: EmbedErrorCodes.NETWORK_ERROR,
|
|
18503
|
+
offlineWarning: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
18504
|
+
};
|
|
18505
|
+
this.executeCallbacks(exports.EmbedEvent.Error, errorDetails);
|
|
18506
|
+
logger$3.warn(errorDetails);
|
|
18357
18507
|
};
|
|
18358
18508
|
window.addEventListener('offline', offlineEventListener);
|
|
18359
18509
|
this.subscribedListeners.online = onlineEventListener;
|
|
@@ -18433,8 +18583,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18433
18583
|
]);
|
|
18434
18584
|
if (customActionsResult.errors.length > 0) {
|
|
18435
18585
|
this.handleError({
|
|
18436
|
-
|
|
18586
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18437
18587
|
message: customActionsResult.errors,
|
|
18588
|
+
code: EmbedErrorCodes.CUSTOM_ACTION_VALIDATION,
|
|
18589
|
+
error: { type: EmbedErrorCodes.CUSTOM_ACTION_VALIDATION, message: customActionsResult.errors }
|
|
18438
18590
|
});
|
|
18439
18591
|
}
|
|
18440
18592
|
const baseInitData = {
|
|
@@ -18531,11 +18683,21 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18531
18683
|
...additionalFlagsFromView,
|
|
18532
18684
|
};
|
|
18533
18685
|
if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
|
|
18534
|
-
this.handleError(
|
|
18686
|
+
this.handleError({
|
|
18687
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18688
|
+
message: ERROR_MESSAGE.CONFLICTING_ACTIONS_CONFIG,
|
|
18689
|
+
code: EmbedErrorCodes.CONFLICTING_ACTIONS_CONFIG,
|
|
18690
|
+
error: ERROR_MESSAGE.CONFLICTING_ACTIONS_CONFIG,
|
|
18691
|
+
});
|
|
18535
18692
|
return queryParams;
|
|
18536
18693
|
}
|
|
18537
18694
|
if (Array.isArray(visibleTabs) && Array.isArray(hiddenTabs)) {
|
|
18538
|
-
this.handleError(
|
|
18695
|
+
this.handleError({
|
|
18696
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18697
|
+
message: ERROR_MESSAGE.CONFLICTING_TABS_CONFIG,
|
|
18698
|
+
code: EmbedErrorCodes.CONFLICTING_TABS_CONFIG,
|
|
18699
|
+
error: ERROR_MESSAGE.CONFLICTING_TABS_CONFIG,
|
|
18700
|
+
});
|
|
18539
18701
|
return queryParams;
|
|
18540
18702
|
}
|
|
18541
18703
|
if (primaryAction) {
|
|
@@ -18760,7 +18922,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18760
18922
|
error: JSON.stringify(error),
|
|
18761
18923
|
});
|
|
18762
18924
|
this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
|
|
18763
|
-
this.handleError(
|
|
18925
|
+
this.handleError({
|
|
18926
|
+
errorType: ErrorDetailsTypes.API,
|
|
18927
|
+
message: error.message || ERROR_MESSAGE.LOGIN_FAILED,
|
|
18928
|
+
code: EmbedErrorCodes.LOGIN_FAILED,
|
|
18929
|
+
error: error,
|
|
18930
|
+
});
|
|
18764
18931
|
});
|
|
18765
18932
|
});
|
|
18766
18933
|
}
|
|
@@ -19065,11 +19232,21 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19065
19232
|
async trigger(messageType, data = {}) {
|
|
19066
19233
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
19067
19234
|
if (!this.isRendered) {
|
|
19068
|
-
this.handleError(
|
|
19235
|
+
this.handleError({
|
|
19236
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
19237
|
+
message: ERROR_MESSAGE.RENDER_BEFORE_EVENTS_REQUIRED,
|
|
19238
|
+
code: EmbedErrorCodes.RENDER_NOT_CALLED,
|
|
19239
|
+
error: ERROR_MESSAGE.RENDER_BEFORE_EVENTS_REQUIRED,
|
|
19240
|
+
});
|
|
19069
19241
|
return null;
|
|
19070
19242
|
}
|
|
19071
19243
|
if (!messageType) {
|
|
19072
|
-
this.handleError(
|
|
19244
|
+
this.handleError({
|
|
19245
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
19246
|
+
message: ERROR_MESSAGE.HOST_EVENT_TYPE_UNDEFINED,
|
|
19247
|
+
code: EmbedErrorCodes.HOST_EVENT_TYPE_UNDEFINED,
|
|
19248
|
+
error: ERROR_MESSAGE.HOST_EVENT_TYPE_UNDEFINED,
|
|
19249
|
+
});
|
|
19073
19250
|
return null;
|
|
19074
19251
|
}
|
|
19075
19252
|
// Check if iframe exists before triggering -
|
|
@@ -19882,7 +20059,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19882
20059
|
constructor(domSelector, viewConfig) {
|
|
19883
20060
|
viewConfig.embedComponentType = 'AppEmbed';
|
|
19884
20061
|
super(domSelector, viewConfig);
|
|
19885
|
-
this.defaultHeight =
|
|
20062
|
+
this.defaultHeight = 500;
|
|
19886
20063
|
this.sendFullHeightLazyLoadData = () => {
|
|
19887
20064
|
const data = calculateVisibleElementData(this.iFrame);
|
|
19888
20065
|
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
@@ -19904,8 +20081,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19904
20081
|
* @param data The event payload
|
|
19905
20082
|
*/
|
|
19906
20083
|
this.updateIFrameHeight = (data) => {
|
|
19907
|
-
|
|
19908
|
-
this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
|
|
20084
|
+
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
19909
20085
|
this.sendFullHeightLazyLoadData();
|
|
19910
20086
|
};
|
|
19911
20087
|
this.embedIframeCenter = (data, responder) => {
|
|
@@ -19944,7 +20120,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19944
20120
|
* embedded Liveboard or visualization.
|
|
19945
20121
|
*/
|
|
19946
20122
|
getEmbedParams() {
|
|
19947
|
-
const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, } = this.viewConfig;
|
|
20123
|
+
const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, minimumHeight, } = this.viewConfig;
|
|
19948
20124
|
let params = {};
|
|
19949
20125
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19950
20126
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19953,6 +20129,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19953
20129
|
params[Param.HideLiveboardHeader] = hideLiveboardHeader;
|
|
19954
20130
|
params[Param.ShowLiveboardTitle] = showLiveboardTitle;
|
|
19955
20131
|
params[Param.ShowLiveboardDescription] = !!showLiveboardDescription;
|
|
20132
|
+
params[Param.ShowMaskedFilterChip] = showMaskedFilterChip;
|
|
20133
|
+
params[Param.IsLiveboardMasterpiecesEnabled] = isLiveboardMasterpiecesEnabled;
|
|
19956
20134
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19957
20135
|
params[Param.IsFullAppEmbed] = true;
|
|
19958
20136
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
@@ -20024,6 +20202,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20024
20202
|
if (isCentralizedLiveboardFilterUXEnabled != undefined) {
|
|
20025
20203
|
params[Param.isCentralizedLiveboardFilterUXEnabled] = isCentralizedLiveboardFilterUXEnabled;
|
|
20026
20204
|
}
|
|
20205
|
+
this.defaultHeight = minimumHeight || this.defaultHeight;
|
|
20027
20206
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
20028
20207
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
20029
20208
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -20378,7 +20557,7 @@ query GetEurekaVizSnapshots(
|
|
|
20378
20557
|
getEmbedParamsObject() {
|
|
20379
20558
|
let params = {};
|
|
20380
20559
|
params = this.getBaseQueryParams(params);
|
|
20381
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, } = this.viewConfig;
|
|
20560
|
+
const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, } = this.viewConfig;
|
|
20382
20561
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
20383
20562
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
20384
20563
|
if (fullHeight === true) {
|
|
@@ -20388,9 +20567,7 @@ query GetEurekaVizSnapshots(
|
|
|
20388
20567
|
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
20389
20568
|
}
|
|
20390
20569
|
}
|
|
20391
|
-
|
|
20392
|
-
this.defaultHeight = defaultHeight;
|
|
20393
|
-
}
|
|
20570
|
+
this.defaultHeight = minimumHeight || defaultHeight || this.defaultHeight;
|
|
20394
20571
|
if (enableVizTransformations !== undefined) {
|
|
20395
20572
|
params[Param.EnableVizTransformations] = enableVizTransformations.toString();
|
|
20396
20573
|
}
|
|
@@ -20457,6 +20634,8 @@ query GetEurekaVizSnapshots(
|
|
|
20457
20634
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
20458
20635
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
20459
20636
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
20637
|
+
params[Param.ShowMaskedFilterChip] = showMaskedFilterChip;
|
|
20638
|
+
params[Param.IsLiveboardMasterpiecesEnabled] = isLiveboardMasterpiecesEnabled;
|
|
20460
20639
|
params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
|
|
20461
20640
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
20462
20641
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
@@ -20488,7 +20667,12 @@ query GetEurekaVizSnapshots(
|
|
|
20488
20667
|
const { vizId, activeTabId } = this.viewConfig;
|
|
20489
20668
|
const liveboardId = (_a = this.viewConfig.liveboardId) !== null && _a !== void 0 ? _a : this.viewConfig.pinboardId;
|
|
20490
20669
|
if (!liveboardId) {
|
|
20491
|
-
this.handleError(
|
|
20670
|
+
this.handleError({
|
|
20671
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
20672
|
+
message: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
20673
|
+
code: EmbedErrorCodes.LIVEBOARD_ID_MISSING,
|
|
20674
|
+
error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
20675
|
+
});
|
|
20492
20676
|
}
|
|
20493
20677
|
return `${this.getRootIframeSrc()}${this.getIframeSuffixSrc(liveboardId, vizId, activeTabId)}`;
|
|
20494
20678
|
}
|
|
@@ -21192,7 +21376,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
21192
21376
|
getEmbedParamsObject() {
|
|
21193
21377
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, enablePastConversationsSidebar, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, } = this.viewConfig;
|
|
21194
21378
|
if (!worksheetId) {
|
|
21195
|
-
this.handleError(
|
|
21379
|
+
this.handleError({
|
|
21380
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21381
|
+
message: ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
|
|
21382
|
+
code: EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND,
|
|
21383
|
+
error: ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
|
|
21384
|
+
});
|
|
21196
21385
|
}
|
|
21197
21386
|
const queryParams = this.getBaseQueryParams();
|
|
21198
21387
|
queryParams[Param.SpotterEnabled] = true;
|