@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.es.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 _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -596,6 +596,7 @@ var EmbedEvent;
|
|
|
596
596
|
* SearchEmbed.on(EmbedEvent.Error, (error) => {
|
|
597
597
|
* console.log(error);
|
|
598
598
|
* // { type: "Error", data: { errorType: "API", error: { message: '...', error: '...' } } }
|
|
599
|
+
* // { errorType: "API", message: '...', code: '...' } new format
|
|
599
600
|
* });
|
|
600
601
|
* ```
|
|
601
602
|
* @example
|
|
@@ -607,6 +608,7 @@ var EmbedEvent;
|
|
|
607
608
|
* // message: "Fullscreen API is not enabled",
|
|
608
609
|
* // stack: "..."
|
|
609
610
|
* // } }}
|
|
611
|
+
* // { errorType: "FULLSCREEN", message: "Fullscreen API is not enabled", code: '...' } new format
|
|
610
612
|
* })
|
|
611
613
|
* ```
|
|
612
614
|
*/
|
|
@@ -762,7 +764,8 @@ var EmbedEvent;
|
|
|
762
764
|
*/
|
|
763
765
|
EmbedEvent["ALL"] = "*";
|
|
764
766
|
/**
|
|
765
|
-
* Emitted when an Answer is saved in the app
|
|
767
|
+
* Emitted when an Answer is saved in the app.
|
|
768
|
+
* Use start:true to subscribe to when save is initiated, or end:true to subscribe to when save is completed. Default is end:true.
|
|
766
769
|
* @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
767
770
|
* @example
|
|
768
771
|
*```js
|
|
@@ -797,6 +800,7 @@ var EmbedEvent;
|
|
|
797
800
|
EmbedEvent["Download"] = "download";
|
|
798
801
|
/**
|
|
799
802
|
* Emitted when the download action is triggered on an Answer.
|
|
803
|
+
* Use start:true to subscribe to when download is initiated, or end:true to subscribe to when download is completed. Default is end:true.
|
|
800
804
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
|
|
801
805
|
* @example
|
|
802
806
|
*```js
|
|
@@ -811,6 +815,7 @@ var EmbedEvent;
|
|
|
811
815
|
EmbedEvent["DownloadAsPng"] = "downloadAsPng";
|
|
812
816
|
/**
|
|
813
817
|
* Emitted when the Download as PDF action is triggered on an Answer
|
|
818
|
+
* 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.
|
|
814
819
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
815
820
|
* @example
|
|
816
821
|
*```js
|
|
@@ -825,6 +830,7 @@ var EmbedEvent;
|
|
|
825
830
|
EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
826
831
|
/**
|
|
827
832
|
* Emitted when the Download as CSV action is triggered on an Answer.
|
|
833
|
+
* 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.
|
|
828
834
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
829
835
|
* @example
|
|
830
836
|
*```js
|
|
@@ -839,6 +845,7 @@ var EmbedEvent;
|
|
|
839
845
|
EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
|
|
840
846
|
/**
|
|
841
847
|
* Emitted when the Download as XLSX action is triggered on an Answer.
|
|
848
|
+
* 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.
|
|
842
849
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
843
850
|
* @example
|
|
844
851
|
*```js
|
|
@@ -853,6 +860,7 @@ var EmbedEvent;
|
|
|
853
860
|
EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
|
|
854
861
|
/**
|
|
855
862
|
* Emitted when an Answer is deleted in the app
|
|
863
|
+
* Use start:true to subscribe to when delete is initiated, or end:true to subscribe to when delete is completed. Default is end:true.
|
|
856
864
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
857
865
|
* @example
|
|
858
866
|
*```js
|
|
@@ -879,6 +887,7 @@ var EmbedEvent;
|
|
|
879
887
|
/**
|
|
880
888
|
* Emitted when a user initiates the Pin action to
|
|
881
889
|
* add an Answer to a Liveboard.
|
|
890
|
+
* Use start:true to subscribe to when pin is initiated, or end:true to subscribe to when pin is completed. Default is end:true.
|
|
882
891
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
883
892
|
* @example
|
|
884
893
|
*```js
|
|
@@ -992,6 +1001,7 @@ var EmbedEvent;
|
|
|
992
1001
|
/**
|
|
993
1002
|
* Emitted when the **Export TML** action is triggered on an
|
|
994
1003
|
* an embedded object in the app
|
|
1004
|
+
* Use start:true to subscribe to when export is initiated, or end:true to subscribe to when export is completed. Default is end:true.
|
|
995
1005
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
996
1006
|
* @example
|
|
997
1007
|
*```js
|
|
@@ -1017,6 +1027,7 @@ var EmbedEvent;
|
|
|
1017
1027
|
EmbedEvent["SaveAsView"] = "saveAsView";
|
|
1018
1028
|
/**
|
|
1019
1029
|
* Emitted when the user creates a copy of an Answer.
|
|
1030
|
+
* 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.
|
|
1020
1031
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1021
1032
|
* @example
|
|
1022
1033
|
*```js
|
|
@@ -3088,6 +3099,8 @@ var Param;
|
|
|
3088
3099
|
Param["HideLiveboardHeader"] = "hideLiveboardHeader";
|
|
3089
3100
|
Param["ShowLiveboardDescription"] = "showLiveboardDescription";
|
|
3090
3101
|
Param["ShowLiveboardTitle"] = "showLiveboardTitle";
|
|
3102
|
+
Param["ShowMaskedFilterChip"] = "showMaskedFilterChip";
|
|
3103
|
+
Param["IsLiveboardMasterpiecesEnabled"] = "isLiveboardMasterpiecesEnabled";
|
|
3091
3104
|
Param["HiddenTabs"] = "hideTabs";
|
|
3092
3105
|
Param["VisibleTabs"] = "visibleTabs";
|
|
3093
3106
|
Param["HideTabPanel"] = "hideTabPanel";
|
|
@@ -4459,6 +4472,46 @@ var Action;
|
|
|
4459
4472
|
* @version SDK: 1.43.0 | ThoughtSpot Cloud: 10.15.0.cl
|
|
4460
4473
|
*/
|
|
4461
4474
|
Action["LiveboardStylePanel"] = "liveboardStylePanel";
|
|
4475
|
+
/**
|
|
4476
|
+
* The **Move to Group** menu action on a Liveboard.
|
|
4477
|
+
* Allows moving a visualization to a different group.
|
|
4478
|
+
* @example
|
|
4479
|
+
* ```js
|
|
4480
|
+
* disabledActions: [Action.MoveToGroup]
|
|
4481
|
+
* ```
|
|
4482
|
+
* @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
|
|
4483
|
+
*/
|
|
4484
|
+
Action["MoveToGroup"] = "moveToGroup";
|
|
4485
|
+
/**
|
|
4486
|
+
* The **Move out of Group** menu action on a Liveboard.
|
|
4487
|
+
* Allows moving a visualization out of a group.
|
|
4488
|
+
* @example
|
|
4489
|
+
* ```js
|
|
4490
|
+
* disabledActions: [Action.MoveOutOfGroup]
|
|
4491
|
+
* ```
|
|
4492
|
+
* @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
|
|
4493
|
+
*/
|
|
4494
|
+
Action["MoveOutOfGroup"] = "moveOutOfGroup";
|
|
4495
|
+
/**
|
|
4496
|
+
* The **Create Group** menu action on a Liveboard.
|
|
4497
|
+
* Allows creating a new group.
|
|
4498
|
+
* @example
|
|
4499
|
+
* ```js
|
|
4500
|
+
* disabledActions: [Action.CreateGroup]
|
|
4501
|
+
* ```
|
|
4502
|
+
* @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
|
|
4503
|
+
*/
|
|
4504
|
+
Action["CreateGroup"] = "createGroup";
|
|
4505
|
+
/**
|
|
4506
|
+
* The **Ungroup Liveboard Group** menu action on a Liveboard.
|
|
4507
|
+
* Allows ungrouping a liveboard group.
|
|
4508
|
+
* @example
|
|
4509
|
+
* ```js
|
|
4510
|
+
* disabledActions: [Action.UngroupLiveboardGroup]
|
|
4511
|
+
* ```
|
|
4512
|
+
* @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
|
|
4513
|
+
*/
|
|
4514
|
+
Action["UngroupLiveboardGroup"] = "ungroupLiveboardGroup";
|
|
4462
4515
|
})(Action || (Action = {}));
|
|
4463
4516
|
var PrefetchFeatures;
|
|
4464
4517
|
(function (PrefetchFeatures) {
|
|
@@ -4581,6 +4634,85 @@ var LogLevel;
|
|
|
4581
4634
|
*/
|
|
4582
4635
|
LogLevel["TRACE"] = "TRACE";
|
|
4583
4636
|
})(LogLevel || (LogLevel = {}));
|
|
4637
|
+
/**
|
|
4638
|
+
* Error types emitted by embedded components.
|
|
4639
|
+
*
|
|
4640
|
+
* These enum values categorize different types of errors that can occur during
|
|
4641
|
+
* the lifecycle of an embedded ThoughtSpot component. Use these values to implement
|
|
4642
|
+
* specific error handling logic based on the error category.
|
|
4643
|
+
*
|
|
4644
|
+
* @see {@link EmbedErrorDetailsEvent} - The error event object structure
|
|
4645
|
+
* @see {@link EmbedEvent.Error} - The event that emits these errors
|
|
4646
|
+
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
4647
|
+
* @group Error Handling
|
|
4648
|
+
*/
|
|
4649
|
+
var ErrorDetailsTypes;
|
|
4650
|
+
(function (ErrorDetailsTypes) {
|
|
4651
|
+
/** API call failure */
|
|
4652
|
+
ErrorDetailsTypes["API"] = "API";
|
|
4653
|
+
/** General validation error */
|
|
4654
|
+
ErrorDetailsTypes["VALIDATION_ERROR"] = "VALIDATION_ERROR";
|
|
4655
|
+
/** Network connectivity or request error */
|
|
4656
|
+
ErrorDetailsTypes["NETWORK"] = "NETWORK";
|
|
4657
|
+
})(ErrorDetailsTypes || (ErrorDetailsTypes = {}));
|
|
4658
|
+
/**
|
|
4659
|
+
* Specific error codes for embedded component errors.
|
|
4660
|
+
*
|
|
4661
|
+
* These codes provide granular identification of errors that occur in embedded components.
|
|
4662
|
+
* They are returned in the {@link EmbedErrorDetailsEvent.code} property and allow for
|
|
4663
|
+
* precise error handling and debugging.
|
|
4664
|
+
*
|
|
4665
|
+
* The codes are organized into categories:
|
|
4666
|
+
* - **Worksheet ID not found or does not exist**: Errors related to applying or updating filters
|
|
4667
|
+
* - **Liveboard ID missing**: Errors related to missing liveboard ID
|
|
4668
|
+
* - **Conflicting actions configuration**: Errors related to conflicting actions configuration
|
|
4669
|
+
* - **Conflicting tabs configuration**: Errors related to conflicting tabs configuration
|
|
4670
|
+
* - **Initialization error**: Errors related to initialization error
|
|
4671
|
+
* - **Network error**: Errors related to network error
|
|
4672
|
+
* - **Custom action validation**: Errors related to custom action validation
|
|
4673
|
+
* - **Login failed**: Errors related to login failed
|
|
4674
|
+
* - **Render not called**: Errors related to render not called
|
|
4675
|
+
* - **Host event type undefined or invalid**: Errors related to host event type undefined or invalid
|
|
4676
|
+
*
|
|
4677
|
+
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
4678
|
+
* @group Error Handling
|
|
4679
|
+
* @see {@link EmbedErrorDetailsEvent} - The error event object that includes these codes
|
|
4680
|
+
* @see {@link ErrorDetailsTypes} - General error type categories
|
|
4681
|
+
*
|
|
4682
|
+
* @example
|
|
4683
|
+
* Handle specific error codes
|
|
4684
|
+
*
|
|
4685
|
+
* embed.on(EmbedEvent.Error, (error) => {
|
|
4686
|
+
* if (error.code === EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND) {
|
|
4687
|
+
* console.error('Worksheet ID not found:', error.message);
|
|
4688
|
+
* }
|
|
4689
|
+
* });
|
|
4690
|
+
* */
|
|
4691
|
+
var EmbedErrorCodes;
|
|
4692
|
+
(function (EmbedErrorCodes) {
|
|
4693
|
+
/** Worksheet ID not found or does not exist */
|
|
4694
|
+
EmbedErrorCodes["WORKSHEET_ID_NOT_FOUND"] = "WORKSHEET_ID_NOT_FOUND";
|
|
4695
|
+
/** Required Liveboard ID is missing from configuration */
|
|
4696
|
+
EmbedErrorCodes["LIVEBOARD_ID_MISSING"] = "LIVEBOARD_ID_MISSING";
|
|
4697
|
+
/** Conflicting action configuration detected (e.g., both hiddenActions and visibleActions specified) */
|
|
4698
|
+
EmbedErrorCodes["CONFLICTING_ACTIONS_CONFIG"] = "CONFLICTING_ACTIONS_CONFIG";
|
|
4699
|
+
/** Conflicting tab configuration detected (e.g., both hiddenTabs and visibleTabs specified) */
|
|
4700
|
+
EmbedErrorCodes["CONFLICTING_TABS_CONFIG"] = "CONFLICTING_TABS_CONFIG";
|
|
4701
|
+
/** Error during component initialization */
|
|
4702
|
+
EmbedErrorCodes["INIT_ERROR"] = "INIT_ERROR";
|
|
4703
|
+
/** Network connectivity or request error */
|
|
4704
|
+
EmbedErrorCodes["NETWORK_ERROR"] = "NETWORK_ERROR";
|
|
4705
|
+
/** Custom action validation failed */
|
|
4706
|
+
EmbedErrorCodes["CUSTOM_ACTION_VALIDATION"] = "CUSTOM_ACTION_VALIDATION";
|
|
4707
|
+
/** Authentication/login failed */
|
|
4708
|
+
EmbedErrorCodes["LOGIN_FAILED"] = "LOGIN_FAILED";
|
|
4709
|
+
/** Render method was not called before attempting to use the component */
|
|
4710
|
+
EmbedErrorCodes["RENDER_NOT_CALLED"] = "RENDER_NOT_CALLED";
|
|
4711
|
+
/** Host event type is undefined or invalid */
|
|
4712
|
+
EmbedErrorCodes["HOST_EVENT_TYPE_UNDEFINED"] = "HOST_EVENT_TYPE_UNDEFINED";
|
|
4713
|
+
/** Error parsing api intercept body */
|
|
4714
|
+
EmbedErrorCodes["PARSING_API_INTERCEPT_BODY_ERROR"] = "PARSING_API_INTERCEPT_BODY_ERROR";
|
|
4715
|
+
})(EmbedErrorCodes || (EmbedErrorCodes = {}));
|
|
4584
4716
|
/**
|
|
4585
4717
|
* Enum for the type of API intercepted
|
|
4586
4718
|
*/
|
|
@@ -7447,6 +7579,13 @@ const ERROR_MESSAGE = {
|
|
|
7447
7579
|
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',
|
|
7448
7580
|
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
7449
7581
|
OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
|
|
7582
|
+
INIT_SDK_REQUIRED: 'You need to init the ThoughtSpot SDK module first',
|
|
7583
|
+
CONFLICTING_ACTIONS_CONFIG: 'You cannot have both hidden actions and visible actions',
|
|
7584
|
+
CONFLICTING_TABS_CONFIG: 'You cannot have both hidden Tabs and visible Tabs',
|
|
7585
|
+
RENDER_BEFORE_EVENTS_REQUIRED: 'Please call render before triggering events',
|
|
7586
|
+
HOST_EVENT_TYPE_UNDEFINED: 'Host event type is undefined',
|
|
7587
|
+
LOGIN_FAILED: 'Login failed',
|
|
7588
|
+
ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
|
|
7450
7589
|
};
|
|
7451
7590
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
7452
7591
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -8356,7 +8495,7 @@ class AnswerService {
|
|
|
8356
8495
|
async getTML() {
|
|
8357
8496
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8358
8497
|
const edoc = object[0].edoc;
|
|
8359
|
-
const YAML = await import('./index-
|
|
8498
|
+
const YAML = await import('./index-BXCUJ09L.js');
|
|
8360
8499
|
const parsedDoc = YAML.parse(edoc);
|
|
8361
8500
|
return {
|
|
8362
8501
|
answer: {
|
|
@@ -17227,6 +17366,76 @@ if (typeof Promise.withResolvers === 'undefined') {
|
|
|
17227
17366
|
};
|
|
17228
17367
|
}
|
|
17229
17368
|
|
|
17369
|
+
/**
|
|
17370
|
+
* Reloads the ThoughtSpot iframe.
|
|
17371
|
+
* @param iFrame
|
|
17372
|
+
*/
|
|
17373
|
+
const reload = (iFrame) => {
|
|
17374
|
+
const src = iFrame.src;
|
|
17375
|
+
iFrame.src = '';
|
|
17376
|
+
setTimeout(() => {
|
|
17377
|
+
iFrame.src = src;
|
|
17378
|
+
}, 100);
|
|
17379
|
+
};
|
|
17380
|
+
/**
|
|
17381
|
+
* Post iframe message.
|
|
17382
|
+
* @param iFrame
|
|
17383
|
+
* @param message
|
|
17384
|
+
* @param message.type
|
|
17385
|
+
* @param message.data
|
|
17386
|
+
* @param thoughtSpotHost
|
|
17387
|
+
* @param channel
|
|
17388
|
+
*/
|
|
17389
|
+
function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
|
|
17390
|
+
var _a;
|
|
17391
|
+
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
|
|
17392
|
+
}
|
|
17393
|
+
const TRIGGER_TIMEOUT = 30000;
|
|
17394
|
+
/**
|
|
17395
|
+
*
|
|
17396
|
+
* @param iFrame
|
|
17397
|
+
* @param messageType
|
|
17398
|
+
* @param thoughtSpotHost
|
|
17399
|
+
* @param data
|
|
17400
|
+
*/
|
|
17401
|
+
function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
17402
|
+
return new Promise((res, rej) => {
|
|
17403
|
+
var _a;
|
|
17404
|
+
if (messageType === HostEvent.Reload) {
|
|
17405
|
+
reload(iFrame);
|
|
17406
|
+
return res(null);
|
|
17407
|
+
}
|
|
17408
|
+
if (messageType === HostEvent.Present) {
|
|
17409
|
+
const embedConfig = getEmbedConfig();
|
|
17410
|
+
const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
|
|
17411
|
+
if (!disableFullscreenPresentation) {
|
|
17412
|
+
handlePresentEvent(iFrame);
|
|
17413
|
+
}
|
|
17414
|
+
else {
|
|
17415
|
+
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
17416
|
+
}
|
|
17417
|
+
}
|
|
17418
|
+
const channel = new MessageChannel();
|
|
17419
|
+
channel.port1.onmessage = ({ data: responseData }) => {
|
|
17420
|
+
var _a;
|
|
17421
|
+
channel.port1.close();
|
|
17422
|
+
const error = responseData.error || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
|
|
17423
|
+
if (error) {
|
|
17424
|
+
rej(error);
|
|
17425
|
+
}
|
|
17426
|
+
else {
|
|
17427
|
+
res(responseData);
|
|
17428
|
+
}
|
|
17429
|
+
};
|
|
17430
|
+
// Close the messageChannel and resolve the promise if timeout.
|
|
17431
|
+
setTimeout(() => {
|
|
17432
|
+
channel.port1.close();
|
|
17433
|
+
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
17434
|
+
}, TRIGGER_TIMEOUT);
|
|
17435
|
+
return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
|
|
17436
|
+
});
|
|
17437
|
+
}
|
|
17438
|
+
|
|
17230
17439
|
/* eslint-disable camelcase */
|
|
17231
17440
|
/* eslint-disable import/no-mutable-exports */
|
|
17232
17441
|
/**
|
|
@@ -17572,6 +17781,19 @@ const exportTML = async (data) => {
|
|
|
17572
17781
|
.catch((error) => {
|
|
17573
17782
|
throw error;
|
|
17574
17783
|
});
|
|
17784
|
+
};
|
|
17785
|
+
/**
|
|
17786
|
+
* Reloads the ThoughtSpot iframe.
|
|
17787
|
+
* @param iFrame
|
|
17788
|
+
* @group Global methods
|
|
17789
|
+
* @version SDK: 1.43.1
|
|
17790
|
+
*/
|
|
17791
|
+
const reloadIframe = (iFrame) => {
|
|
17792
|
+
if (!iFrame) {
|
|
17793
|
+
logger$3.warn('reloadIframe called with no iFrame element.');
|
|
17794
|
+
return;
|
|
17795
|
+
}
|
|
17796
|
+
reload(iFrame);
|
|
17575
17797
|
};
|
|
17576
17798
|
|
|
17577
17799
|
/**
|
|
@@ -17705,77 +17927,7 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
|
|
|
17705
17927
|
return eventData;
|
|
17706
17928
|
}
|
|
17707
17929
|
|
|
17708
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.
|
|
17709
|
-
|
|
17710
|
-
/**
|
|
17711
|
-
* Reloads the ThoughtSpot iframe.
|
|
17712
|
-
* @param iFrame
|
|
17713
|
-
*/
|
|
17714
|
-
const reload = (iFrame) => {
|
|
17715
|
-
const src = iFrame.src;
|
|
17716
|
-
iFrame.src = '';
|
|
17717
|
-
setTimeout(() => {
|
|
17718
|
-
iFrame.src = src;
|
|
17719
|
-
}, 100);
|
|
17720
|
-
};
|
|
17721
|
-
/**
|
|
17722
|
-
* Post iframe message.
|
|
17723
|
-
* @param iFrame
|
|
17724
|
-
* @param message
|
|
17725
|
-
* @param message.type
|
|
17726
|
-
* @param message.data
|
|
17727
|
-
* @param thoughtSpotHost
|
|
17728
|
-
* @param channel
|
|
17729
|
-
*/
|
|
17730
|
-
function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
|
|
17731
|
-
var _a;
|
|
17732
|
-
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
|
|
17733
|
-
}
|
|
17734
|
-
const TRIGGER_TIMEOUT = 30000;
|
|
17735
|
-
/**
|
|
17736
|
-
*
|
|
17737
|
-
* @param iFrame
|
|
17738
|
-
* @param messageType
|
|
17739
|
-
* @param thoughtSpotHost
|
|
17740
|
-
* @param data
|
|
17741
|
-
*/
|
|
17742
|
-
function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
17743
|
-
return new Promise((res, rej) => {
|
|
17744
|
-
var _a;
|
|
17745
|
-
if (messageType === HostEvent.Reload) {
|
|
17746
|
-
reload(iFrame);
|
|
17747
|
-
return res(null);
|
|
17748
|
-
}
|
|
17749
|
-
if (messageType === HostEvent.Present) {
|
|
17750
|
-
const embedConfig = getEmbedConfig();
|
|
17751
|
-
const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
|
|
17752
|
-
if (!disableFullscreenPresentation) {
|
|
17753
|
-
handlePresentEvent(iFrame);
|
|
17754
|
-
}
|
|
17755
|
-
else {
|
|
17756
|
-
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
17757
|
-
}
|
|
17758
|
-
}
|
|
17759
|
-
const channel = new MessageChannel();
|
|
17760
|
-
channel.port1.onmessage = ({ data: responseData }) => {
|
|
17761
|
-
var _a;
|
|
17762
|
-
channel.port1.close();
|
|
17763
|
-
const error = responseData.error || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
|
|
17764
|
-
if (error) {
|
|
17765
|
-
rej(error);
|
|
17766
|
-
}
|
|
17767
|
-
else {
|
|
17768
|
-
res(responseData);
|
|
17769
|
-
}
|
|
17770
|
-
};
|
|
17771
|
-
// Close the messageChannel and resolve the promise if timeout.
|
|
17772
|
-
setTimeout(() => {
|
|
17773
|
-
channel.port1.close();
|
|
17774
|
-
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
17775
|
-
}, TRIGGER_TIMEOUT);
|
|
17776
|
-
return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
|
|
17777
|
-
});
|
|
17778
|
-
}
|
|
17930
|
+
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={".":{"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,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};
|
|
17779
17931
|
|
|
17780
17932
|
class HostEventClient {
|
|
17781
17933
|
constructor(iFrame) {
|
|
@@ -17973,9 +18125,13 @@ const handleInterceptEvent = async (params) => {
|
|
|
17973
18125
|
const { eventData, executeEvent, viewConfig, getUnsavedAnswerTml } = params;
|
|
17974
18126
|
const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
|
|
17975
18127
|
if (bodyParseError) {
|
|
17976
|
-
|
|
17977
|
-
|
|
17978
|
-
|
|
18128
|
+
const errorDetails = {
|
|
18129
|
+
errorType: ErrorDetailsTypes.API,
|
|
18130
|
+
message: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
18131
|
+
code: EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
|
|
18132
|
+
error: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
18133
|
+
};
|
|
18134
|
+
executeEvent(EmbedEvent.Error, errorDetails);
|
|
17979
18135
|
logger$3.error('Error parsing request body', bodyParseError);
|
|
17980
18136
|
return;
|
|
17981
18137
|
}
|
|
@@ -18287,19 +18443,23 @@ class TsEmbed {
|
|
|
18287
18443
|
* Throws error encountered during initialization.
|
|
18288
18444
|
*/
|
|
18289
18445
|
throwInitError() {
|
|
18290
|
-
this.handleError(
|
|
18446
|
+
this.handleError({
|
|
18447
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18448
|
+
message: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
18449
|
+
code: EmbedErrorCodes.INIT_ERROR,
|
|
18450
|
+
error: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
18451
|
+
});
|
|
18291
18452
|
}
|
|
18292
18453
|
/**
|
|
18293
18454
|
* Handles errors within the SDK
|
|
18294
18455
|
* @param error The error message or object
|
|
18456
|
+
* @param errorDetails The error details
|
|
18295
18457
|
*/
|
|
18296
|
-
handleError(
|
|
18458
|
+
handleError(errorDetails) {
|
|
18297
18459
|
this.isError = true;
|
|
18298
|
-
this.executeCallbacks(EmbedEvent.Error,
|
|
18299
|
-
error,
|
|
18300
|
-
});
|
|
18460
|
+
this.executeCallbacks(EmbedEvent.Error, errorDetails);
|
|
18301
18461
|
// Log error
|
|
18302
|
-
logger$3.error(
|
|
18462
|
+
logger$3.error(errorDetails);
|
|
18303
18463
|
}
|
|
18304
18464
|
/**
|
|
18305
18465
|
* Extracts the type field from the event payload
|
|
@@ -18378,11 +18538,14 @@ class TsEmbed {
|
|
|
18378
18538
|
};
|
|
18379
18539
|
window.addEventListener('online', onlineEventListener);
|
|
18380
18540
|
const offlineEventListener = (e) => {
|
|
18381
|
-
const
|
|
18382
|
-
|
|
18383
|
-
|
|
18384
|
-
|
|
18385
|
-
|
|
18541
|
+
const errorDetails = {
|
|
18542
|
+
errorType: ErrorDetailsTypes.NETWORK,
|
|
18543
|
+
message: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
18544
|
+
code: EmbedErrorCodes.NETWORK_ERROR,
|
|
18545
|
+
offlineWarning: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
18546
|
+
};
|
|
18547
|
+
this.executeCallbacks(EmbedEvent.Error, errorDetails);
|
|
18548
|
+
logger$3.warn(errorDetails);
|
|
18386
18549
|
};
|
|
18387
18550
|
window.addEventListener('offline', offlineEventListener);
|
|
18388
18551
|
this.subscribedListeners.online = onlineEventListener;
|
|
@@ -18462,8 +18625,10 @@ class TsEmbed {
|
|
|
18462
18625
|
]);
|
|
18463
18626
|
if (customActionsResult.errors.length > 0) {
|
|
18464
18627
|
this.handleError({
|
|
18465
|
-
|
|
18628
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18466
18629
|
message: customActionsResult.errors,
|
|
18630
|
+
code: EmbedErrorCodes.CUSTOM_ACTION_VALIDATION,
|
|
18631
|
+
error: { type: EmbedErrorCodes.CUSTOM_ACTION_VALIDATION, message: customActionsResult.errors }
|
|
18467
18632
|
});
|
|
18468
18633
|
}
|
|
18469
18634
|
const baseInitData = {
|
|
@@ -18560,11 +18725,21 @@ class TsEmbed {
|
|
|
18560
18725
|
...additionalFlagsFromView,
|
|
18561
18726
|
};
|
|
18562
18727
|
if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
|
|
18563
|
-
this.handleError(
|
|
18728
|
+
this.handleError({
|
|
18729
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18730
|
+
message: ERROR_MESSAGE.CONFLICTING_ACTIONS_CONFIG,
|
|
18731
|
+
code: EmbedErrorCodes.CONFLICTING_ACTIONS_CONFIG,
|
|
18732
|
+
error: ERROR_MESSAGE.CONFLICTING_ACTIONS_CONFIG,
|
|
18733
|
+
});
|
|
18564
18734
|
return queryParams;
|
|
18565
18735
|
}
|
|
18566
18736
|
if (Array.isArray(visibleTabs) && Array.isArray(hiddenTabs)) {
|
|
18567
|
-
this.handleError(
|
|
18737
|
+
this.handleError({
|
|
18738
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18739
|
+
message: ERROR_MESSAGE.CONFLICTING_TABS_CONFIG,
|
|
18740
|
+
code: EmbedErrorCodes.CONFLICTING_TABS_CONFIG,
|
|
18741
|
+
error: ERROR_MESSAGE.CONFLICTING_TABS_CONFIG,
|
|
18742
|
+
});
|
|
18568
18743
|
return queryParams;
|
|
18569
18744
|
}
|
|
18570
18745
|
if (primaryAction) {
|
|
@@ -18789,7 +18964,12 @@ class TsEmbed {
|
|
|
18789
18964
|
error: JSON.stringify(error),
|
|
18790
18965
|
});
|
|
18791
18966
|
this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
|
|
18792
|
-
this.handleError(
|
|
18967
|
+
this.handleError({
|
|
18968
|
+
errorType: ErrorDetailsTypes.API,
|
|
18969
|
+
message: error.message || ERROR_MESSAGE.LOGIN_FAILED,
|
|
18970
|
+
code: EmbedErrorCodes.LOGIN_FAILED,
|
|
18971
|
+
error: error,
|
|
18972
|
+
});
|
|
18793
18973
|
});
|
|
18794
18974
|
});
|
|
18795
18975
|
}
|
|
@@ -19094,11 +19274,21 @@ class TsEmbed {
|
|
|
19094
19274
|
async trigger(messageType, data = {}) {
|
|
19095
19275
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
19096
19276
|
if (!this.isRendered) {
|
|
19097
|
-
this.handleError(
|
|
19277
|
+
this.handleError({
|
|
19278
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
19279
|
+
message: ERROR_MESSAGE.RENDER_BEFORE_EVENTS_REQUIRED,
|
|
19280
|
+
code: EmbedErrorCodes.RENDER_NOT_CALLED,
|
|
19281
|
+
error: ERROR_MESSAGE.RENDER_BEFORE_EVENTS_REQUIRED,
|
|
19282
|
+
});
|
|
19098
19283
|
return null;
|
|
19099
19284
|
}
|
|
19100
19285
|
if (!messageType) {
|
|
19101
|
-
this.handleError(
|
|
19286
|
+
this.handleError({
|
|
19287
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
19288
|
+
message: ERROR_MESSAGE.HOST_EVENT_TYPE_UNDEFINED,
|
|
19289
|
+
code: EmbedErrorCodes.HOST_EVENT_TYPE_UNDEFINED,
|
|
19290
|
+
error: ERROR_MESSAGE.HOST_EVENT_TYPE_UNDEFINED,
|
|
19291
|
+
});
|
|
19102
19292
|
return null;
|
|
19103
19293
|
}
|
|
19104
19294
|
// Check if iframe exists before triggering -
|
|
@@ -19579,7 +19769,7 @@ class AppEmbed extends V1Embed {
|
|
|
19579
19769
|
constructor(domSelector, viewConfig) {
|
|
19580
19770
|
viewConfig.embedComponentType = 'AppEmbed';
|
|
19581
19771
|
super(domSelector, viewConfig);
|
|
19582
|
-
this.defaultHeight =
|
|
19772
|
+
this.defaultHeight = 500;
|
|
19583
19773
|
this.sendFullHeightLazyLoadData = () => {
|
|
19584
19774
|
const data = calculateVisibleElementData(this.iFrame);
|
|
19585
19775
|
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
|
|
@@ -19601,8 +19791,7 @@ class AppEmbed extends V1Embed {
|
|
|
19601
19791
|
* @param data The event payload
|
|
19602
19792
|
*/
|
|
19603
19793
|
this.updateIFrameHeight = (data) => {
|
|
19604
|
-
|
|
19605
|
-
this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
|
|
19794
|
+
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
19606
19795
|
this.sendFullHeightLazyLoadData();
|
|
19607
19796
|
};
|
|
19608
19797
|
this.embedIframeCenter = (data, responder) => {
|
|
@@ -19641,7 +19830,7 @@ class AppEmbed extends V1Embed {
|
|
|
19641
19830
|
* embedded Liveboard or visualization.
|
|
19642
19831
|
*/
|
|
19643
19832
|
getEmbedParams() {
|
|
19644
|
-
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$1.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;
|
|
19833
|
+
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$1.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;
|
|
19645
19834
|
let params = {};
|
|
19646
19835
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19647
19836
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19650,6 +19839,8 @@ class AppEmbed extends V1Embed {
|
|
|
19650
19839
|
params[Param.HideLiveboardHeader] = hideLiveboardHeader;
|
|
19651
19840
|
params[Param.ShowLiveboardTitle] = showLiveboardTitle;
|
|
19652
19841
|
params[Param.ShowLiveboardDescription] = !!showLiveboardDescription;
|
|
19842
|
+
params[Param.ShowMaskedFilterChip] = showMaskedFilterChip;
|
|
19843
|
+
params[Param.IsLiveboardMasterpiecesEnabled] = isLiveboardMasterpiecesEnabled;
|
|
19653
19844
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19654
19845
|
params[Param.IsFullAppEmbed] = true;
|
|
19655
19846
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
@@ -19721,6 +19912,7 @@ class AppEmbed extends V1Embed {
|
|
|
19721
19912
|
if (isCentralizedLiveboardFilterUXEnabled != undefined) {
|
|
19722
19913
|
params[Param.isCentralizedLiveboardFilterUXEnabled] = isCentralizedLiveboardFilterUXEnabled;
|
|
19723
19914
|
}
|
|
19915
|
+
this.defaultHeight = minimumHeight || this.defaultHeight;
|
|
19724
19916
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19725
19917
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
19726
19918
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -20075,7 +20267,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
20075
20267
|
getEmbedParamsObject() {
|
|
20076
20268
|
let params = {};
|
|
20077
20269
|
params = this.getBaseQueryParams(params);
|
|
20078
|
-
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;
|
|
20270
|
+
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;
|
|
20079
20271
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
20080
20272
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
20081
20273
|
if (fullHeight === true) {
|
|
@@ -20085,9 +20277,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
20085
20277
|
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
20086
20278
|
}
|
|
20087
20279
|
}
|
|
20088
|
-
|
|
20089
|
-
this.defaultHeight = defaultHeight;
|
|
20090
|
-
}
|
|
20280
|
+
this.defaultHeight = minimumHeight || defaultHeight || this.defaultHeight;
|
|
20091
20281
|
if (enableVizTransformations !== undefined) {
|
|
20092
20282
|
params[Param.EnableVizTransformations] = enableVizTransformations.toString();
|
|
20093
20283
|
}
|
|
@@ -20154,6 +20344,8 @@ class LiveboardEmbed extends V1Embed {
|
|
|
20154
20344
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
20155
20345
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
20156
20346
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
20347
|
+
params[Param.ShowMaskedFilterChip] = showMaskedFilterChip;
|
|
20348
|
+
params[Param.IsLiveboardMasterpiecesEnabled] = isLiveboardMasterpiecesEnabled;
|
|
20157
20349
|
params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
|
|
20158
20350
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
20159
20351
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
@@ -20185,7 +20377,12 @@ class LiveboardEmbed extends V1Embed {
|
|
|
20185
20377
|
const { vizId, activeTabId } = this.viewConfig;
|
|
20186
20378
|
const liveboardId = (_a = this.viewConfig.liveboardId) !== null && _a !== void 0 ? _a : this.viewConfig.pinboardId;
|
|
20187
20379
|
if (!liveboardId) {
|
|
20188
|
-
this.handleError(
|
|
20380
|
+
this.handleError({
|
|
20381
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
20382
|
+
message: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
20383
|
+
code: EmbedErrorCodes.LIVEBOARD_ID_MISSING,
|
|
20384
|
+
error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
20385
|
+
});
|
|
20189
20386
|
}
|
|
20190
20387
|
return `${this.getRootIframeSrc()}${this.getIframeSuffixSrc(liveboardId, vizId, activeTabId)}`;
|
|
20191
20388
|
}
|
|
@@ -21149,7 +21346,12 @@ class SpotterEmbed extends TsEmbed {
|
|
|
21149
21346
|
getEmbedParamsObject() {
|
|
21150
21347
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, enablePastConversationsSidebar, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, } = this.viewConfig;
|
|
21151
21348
|
if (!worksheetId) {
|
|
21152
|
-
this.handleError(
|
|
21349
|
+
this.handleError({
|
|
21350
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21351
|
+
message: ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
|
|
21352
|
+
code: EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND,
|
|
21353
|
+
error: ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
|
|
21354
|
+
});
|
|
21153
21355
|
}
|
|
21154
21356
|
const queryParams = this.getBaseQueryParams();
|
|
21155
21357
|
queryParams[Param.SpotterEnabled] = true;
|
|
@@ -21835,4 +22037,4 @@ const createLiveboardWithAnswers = async (answers, name) => {
|
|
|
21835
22037
|
return result;
|
|
21836
22038
|
};
|
|
21837
22039
|
|
|
21838
|
-
export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ConversationEmbed, CustomActionTarget, CustomActionsPosition, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedEvent, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, InterceptedApiType, ListPage, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };
|
|
22040
|
+
export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ConversationEmbed, CustomActionTarget, CustomActionsPosition, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedEvent, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, InterceptedApiType, ListPage, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, reloadIframe, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };
|