@thoughtspot/visual-embed-sdk 1.45.2 → 1.45.3
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/css-variables.d.ts +48 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +37 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +37 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +24 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +127 -9
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +41 -18
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +96 -3
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +38 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +38 -10
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +179 -7
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +3 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/types.d.ts +192 -40
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +184 -19
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
- package/cjs/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answer-queries.js +23 -1
- package/cjs/src/utils/graphql/answerService/answer-queries.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts +2 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.js +9 -1
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.spec.js +73 -0
- package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
- package/cjs/src/utils.d.ts +15 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +33 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +49 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-BdkKLLo1.js → index-BuwECGdm.js} +1 -1
- package/dist/src/css-variables.d.ts +48 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +37 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +127 -9
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +38 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +192 -40
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
- package/dist/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts +2 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/dist/src/utils.d.ts +15 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +364 -52
- package/dist/tsembed-react.js +363 -51
- package/dist/tsembed.es.js +364 -52
- package/dist/tsembed.js +363 -51
- package/dist/visual-embed-sdk-react-full.d.ts +696 -342
- package/dist/visual-embed-sdk-react.d.ts +685 -331
- package/dist/visual-embed-sdk.d.ts +757 -379
- package/lib/package.json +1 -1
- package/lib/src/css-variables.d.ts +48 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +37 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +39 -3
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +24 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +127 -9
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +42 -19
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +96 -3
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +38 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +39 -11
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +179 -7
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +3 -3
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js.map +1 -1
- package/lib/src/types.d.ts +192 -40
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +184 -19
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
- package/lib/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answer-queries.js +22 -0
- package/lib/src/utils/graphql/answerService/answer-queries.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts +2 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.js +9 -1
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.spec.js +73 -0
- package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
- package/lib/src/utils.d.ts +15 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +30 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +50 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/package.json +1 -1
- package/src/css-variables.ts +60 -0
- package/src/embed/app.spec.ts +32 -0
- package/src/embed/app.ts +97 -1
- package/src/embed/conversation.spec.ts +117 -3
- package/src/embed/conversation.ts +188 -29
- package/src/embed/liveboard.spec.ts +264 -10
- package/src/embed/liveboard.ts +100 -11
- package/src/errors.ts +1 -0
- package/src/index.ts +5 -1
- package/src/types.ts +193 -40
- package/src/utils/graphql/answerService/answer-queries.ts +23 -0
- package/src/utils/graphql/answerService/answerService.spec.ts +87 -0
- package/src/utils/graphql/answerService/answerService.ts +13 -1
- package/src/utils.spec.ts +56 -0
- package/src/utils.ts +36 -0
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.45.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.45.3 */
|
|
2
2
|
'use client';
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -1677,6 +1677,42 @@ var EmbedEvent;
|
|
|
1677
1677
|
* @version SDK: 1.43.0 | ThoughtSpot: 10.15.0.cl
|
|
1678
1678
|
*/
|
|
1679
1679
|
EmbedEvent["ApiIntercept"] = "ApiIntercept";
|
|
1680
|
+
/**
|
|
1681
|
+
* Emitted when a Spotter conversation is renamed.
|
|
1682
|
+
* @example
|
|
1683
|
+
* ```js
|
|
1684
|
+
* spotterEmbed.on(EmbedEvent.SpotterConversationRenamed, (payload) => {
|
|
1685
|
+
* console.log('Conversation renamed', payload);
|
|
1686
|
+
* // payload: { convId: string, oldTitle: string, newTitle: string }
|
|
1687
|
+
* })
|
|
1688
|
+
* ```
|
|
1689
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
1690
|
+
*/
|
|
1691
|
+
EmbedEvent["SpotterConversationRenamed"] = "spotterConversationRenamed";
|
|
1692
|
+
/**
|
|
1693
|
+
* Emitted when a Spotter conversation is deleted.
|
|
1694
|
+
* @example
|
|
1695
|
+
* ```js
|
|
1696
|
+
* spotterEmbed.on(EmbedEvent.SpotterConversationDeleted, (payload) => {
|
|
1697
|
+
* console.log('Conversation deleted', payload);
|
|
1698
|
+
* // payload: { convId: string, title: string }
|
|
1699
|
+
* })
|
|
1700
|
+
* ```
|
|
1701
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
1702
|
+
*/
|
|
1703
|
+
EmbedEvent["SpotterConversationDeleted"] = "spotterConversationDeleted";
|
|
1704
|
+
/**
|
|
1705
|
+
* Emitted when a Spotter conversation is selected/clicked.
|
|
1706
|
+
* @example
|
|
1707
|
+
* ```js
|
|
1708
|
+
* spotterEmbed.on(EmbedEvent.SpotterConversationSelected, (payload) => {
|
|
1709
|
+
* console.log('Conversation selected', payload);
|
|
1710
|
+
* // payload: { convId: string, title: string, worksheetId: string }
|
|
1711
|
+
* })
|
|
1712
|
+
* ```
|
|
1713
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
1714
|
+
*/
|
|
1715
|
+
EmbedEvent["SpotterConversationSelected"] = "spotterConversationSelected";
|
|
1680
1716
|
/**
|
|
1681
1717
|
* @hidden
|
|
1682
1718
|
* Emitted when the auth token is about to get expired and needs to be refreshed.
|
|
@@ -3239,7 +3275,19 @@ var Param;
|
|
|
3239
3275
|
Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
|
|
3240
3276
|
Param["EnablePastConversationsSidebar"] = "enablePastConversationsSidebar";
|
|
3241
3277
|
Param["UpdatedSpotterChatPrompt"] = "updatedSpotterChatPrompt";
|
|
3278
|
+
Param["SpotterSidebarTitle"] = "spotterSidebarTitle";
|
|
3279
|
+
Param["SpotterSidebarDefaultExpanded"] = "spotterSidebarDefaultExpanded";
|
|
3280
|
+
Param["SpotterChatRenameLabel"] = "spotterChatRenameLabel";
|
|
3281
|
+
Param["SpotterChatDeleteLabel"] = "spotterChatDeleteLabel";
|
|
3282
|
+
Param["SpotterDeleteConversationModalTitle"] = "spotterDeleteConversationModalTitle";
|
|
3283
|
+
Param["SpotterPastConversationAlertMessage"] = "spotterPastConversationAlertMessage";
|
|
3284
|
+
Param["SpotterDocumentationUrl"] = "spotterDocumentationUrl";
|
|
3285
|
+
Param["SpotterBestPracticesLabel"] = "spotterBestPracticesLabel";
|
|
3286
|
+
Param["SpotterConversationsBatchSize"] = "spotterConversationsBatchSize";
|
|
3287
|
+
Param["SpotterNewChatButtonTitle"] = "spotterNewChatButtonTitle";
|
|
3242
3288
|
Param["IsThisPeriodInDateFiltersEnabled"] = "isThisPeriodInDateFiltersEnabled";
|
|
3289
|
+
Param["HideToolResponseCardBranding"] = "hideToolResponseCardBranding";
|
|
3290
|
+
Param["ToolResponseCardBrandingLabel"] = "toolResponseCardBrandingLabel";
|
|
3243
3291
|
})(Param || (Param = {}));
|
|
3244
3292
|
/**
|
|
3245
3293
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -4665,6 +4713,96 @@ var Action;
|
|
|
4665
4713
|
* @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
|
|
4666
4714
|
*/
|
|
4667
4715
|
Action["UngroupLiveboardGroup"] = "ungroupLiveboardGroup";
|
|
4716
|
+
/**
|
|
4717
|
+
* Controls visibility of the sidebar header (title and toggle button)
|
|
4718
|
+
* in the Spotter past conversations sidebar.
|
|
4719
|
+
* @example
|
|
4720
|
+
* ```js
|
|
4721
|
+
* hiddenActions: [Action.SpotterSidebarHeader]
|
|
4722
|
+
* ```
|
|
4723
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4724
|
+
*/
|
|
4725
|
+
Action["SpotterSidebarHeader"] = "spotterSidebarHeader";
|
|
4726
|
+
/**
|
|
4727
|
+
* Controls visibility of the sidebar footer (documentation link)
|
|
4728
|
+
* in the Spotter past conversations sidebar.
|
|
4729
|
+
* @example
|
|
4730
|
+
* ```js
|
|
4731
|
+
* hiddenActions: [Action.SpotterSidebarFooter]
|
|
4732
|
+
* ```
|
|
4733
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4734
|
+
*/
|
|
4735
|
+
Action["SpotterSidebarFooter"] = "spotterSidebarFooter";
|
|
4736
|
+
/**
|
|
4737
|
+
* Controls visibility and disable state of the sidebar toggle/expand button
|
|
4738
|
+
* in the Spotter past conversations sidebar.
|
|
4739
|
+
* @example
|
|
4740
|
+
* ```js
|
|
4741
|
+
* disabledActions: [Action.SpotterSidebarToggle]
|
|
4742
|
+
* ```
|
|
4743
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4744
|
+
*/
|
|
4745
|
+
Action["SpotterSidebarToggle"] = "spotterSidebarToggle";
|
|
4746
|
+
/**
|
|
4747
|
+
* Controls visibility and disable state of the "New Chat" button
|
|
4748
|
+
* in the Spotter past conversations sidebar.
|
|
4749
|
+
* @example
|
|
4750
|
+
* ```js
|
|
4751
|
+
* disabledActions: [Action.SpotterNewChat]
|
|
4752
|
+
* ```
|
|
4753
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4754
|
+
*/
|
|
4755
|
+
Action["SpotterNewChat"] = "spotterNewChat";
|
|
4756
|
+
/**
|
|
4757
|
+
* Controls visibility of the past conversation banner alert
|
|
4758
|
+
* in the Spotter interface.
|
|
4759
|
+
* @example
|
|
4760
|
+
* ```js
|
|
4761
|
+
* hiddenActions: [Action.SpotterPastChatBanner]
|
|
4762
|
+
* ```
|
|
4763
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4764
|
+
*/
|
|
4765
|
+
Action["SpotterPastChatBanner"] = "spotterPastChatBanner";
|
|
4766
|
+
/**
|
|
4767
|
+
* Controls visibility and disable state of the conversation edit menu
|
|
4768
|
+
* (three-dot menu) in the Spotter past conversations sidebar.
|
|
4769
|
+
* @example
|
|
4770
|
+
* ```js
|
|
4771
|
+
* disabledActions: [Action.SpotterChatMenu]
|
|
4772
|
+
* ```
|
|
4773
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4774
|
+
*/
|
|
4775
|
+
Action["SpotterChatMenu"] = "spotterChatMenu";
|
|
4776
|
+
/**
|
|
4777
|
+
* Controls visibility and disable state of the rename action
|
|
4778
|
+
* in the Spotter conversation edit menu.
|
|
4779
|
+
* @example
|
|
4780
|
+
* ```js
|
|
4781
|
+
* disabledActions: [Action.SpotterChatRename]
|
|
4782
|
+
* ```
|
|
4783
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4784
|
+
*/
|
|
4785
|
+
Action["SpotterChatRename"] = "spotterChatRename";
|
|
4786
|
+
/**
|
|
4787
|
+
* Controls visibility and disable state of the delete action
|
|
4788
|
+
* in the Spotter conversation edit menu.
|
|
4789
|
+
* @example
|
|
4790
|
+
* ```js
|
|
4791
|
+
* disabledActions: [Action.SpotterChatDelete]
|
|
4792
|
+
* ```
|
|
4793
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4794
|
+
*/
|
|
4795
|
+
Action["SpotterChatDelete"] = "spotterChatDelete";
|
|
4796
|
+
/**
|
|
4797
|
+
* Controls visibility and disable state of the documentation/best practices
|
|
4798
|
+
* link in the Spotter sidebar footer.
|
|
4799
|
+
* @example
|
|
4800
|
+
* ```js
|
|
4801
|
+
* disabledActions: [Action.SpotterDocs]
|
|
4802
|
+
* ```
|
|
4803
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4804
|
+
*/
|
|
4805
|
+
Action["SpotterDocs"] = "spotterDocs";
|
|
4668
4806
|
/**
|
|
4669
4807
|
* The **Include current period** checkbox for date filters.
|
|
4670
4808
|
* Controls the visibility and availability of the option to include
|
|
@@ -4803,13 +4941,30 @@ var LogLevel;
|
|
|
4803
4941
|
* Error types emitted by embedded components.
|
|
4804
4942
|
*
|
|
4805
4943
|
* These enum values categorize different types of errors that can occur during
|
|
4806
|
-
* the lifecycle of an embedded ThoughtSpot component.
|
|
4807
|
-
*
|
|
4808
|
-
*
|
|
4809
|
-
* @see {@link EmbedErrorDetailsEvent} - The error event object structure
|
|
4810
|
-
* @see {@link EmbedEvent.Error} - The event that emits these errors
|
|
4944
|
+
* the lifecycle of an embedded ThoughtSpot component.
|
|
4945
|
+
* Use {@link EmbedErrorDetailsEvent} and {@link EmbedErrorCodes} to handle specific errors.
|
|
4811
4946
|
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
4812
4947
|
* @group Error Handling
|
|
4948
|
+
*
|
|
4949
|
+
* @example
|
|
4950
|
+
* Handle specific error types
|
|
4951
|
+
* ```js
|
|
4952
|
+
* embed.on(EmbedEvent.Error, (error) => {
|
|
4953
|
+
* switch (error.errorType) {
|
|
4954
|
+
* case ErrorDetailsTypes.API:
|
|
4955
|
+
* console.error('API error:', error.message);
|
|
4956
|
+
* break;
|
|
4957
|
+
* case ErrorDetailsTypes.VALIDATION_ERROR:
|
|
4958
|
+
* console.error('Validation error:', error.message);
|
|
4959
|
+
* break;
|
|
4960
|
+
* case ErrorDetailsTypes.NETWORK:
|
|
4961
|
+
* console.error('Network error:', error.message);
|
|
4962
|
+
* break;
|
|
4963
|
+
* default:
|
|
4964
|
+
* console.error('Unknown error:', error);
|
|
4965
|
+
* }
|
|
4966
|
+
* });
|
|
4967
|
+
* ```
|
|
4813
4968
|
*/
|
|
4814
4969
|
var ErrorDetailsTypes;
|
|
4815
4970
|
(function (ErrorDetailsTypes) {
|
|
@@ -4821,35 +4976,43 @@ var ErrorDetailsTypes;
|
|
|
4821
4976
|
ErrorDetailsTypes["NETWORK"] = "NETWORK";
|
|
4822
4977
|
})(ErrorDetailsTypes || (ErrorDetailsTypes = {}));
|
|
4823
4978
|
/**
|
|
4824
|
-
* Error codes for identifying specific issues in embedded ThoughtSpot components.
|
|
4825
|
-
*
|
|
4826
|
-
* Use these codes for precise error handling and debugging. Each code maps to a
|
|
4827
|
-
* distinct failure scenario, enabling targeted recovery strategies.
|
|
4979
|
+
* Error codes for identifying specific issues in embedded ThoughtSpot components. Use {@link EmbedErrorDetailsEvent} and {@link ErrorDetailsTypes} codes for precise error handling and debugging.
|
|
4828
4980
|
*
|
|
4829
4981
|
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
4830
4982
|
* @group Error Handling
|
|
4831
|
-
|
|
4832
|
-
* @see {@link EmbedErrorDetailsEvent} - The error event object that includes these codes
|
|
4833
|
-
* @see {@link ErrorDetailsTypes} - General error type categories
|
|
4834
|
-
*
|
|
4983
|
+
|
|
4835
4984
|
* @example
|
|
4836
4985
|
* Handle specific error codes in the error event handler
|
|
4837
|
-
*
|
|
4986
|
+
* ```js
|
|
4838
4987
|
* embed.on(EmbedEvent.Error, (error) => {
|
|
4839
|
-
*
|
|
4840
|
-
*
|
|
4988
|
+
* switch (error.code) {
|
|
4989
|
+
* case EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND:
|
|
4990
|
+
* console.error('Worksheet ID not found:', error.message);
|
|
4991
|
+
* break;
|
|
4992
|
+
* case EmbedErrorCodes.LIVEBOARD_ID_MISSING:
|
|
4993
|
+
* console.error('Liveboard ID is missing:', error.message);
|
|
4994
|
+
* break;
|
|
4995
|
+
* case EmbedErrorCodes.CONFLICTING_ACTIONS_CONFIG:
|
|
4996
|
+
* console.error('Conflicting actions configuration:', error.message);
|
|
4997
|
+
* break;
|
|
4998
|
+
* case EmbedErrorCodes.CONFLICTING_TABS_CONFIG:
|
|
4999
|
+
* console.error('Conflicting tabs configuration:', error.message);
|
|
5000
|
+
* break;
|
|
5001
|
+
* default:
|
|
5002
|
+
* console.error('Unknown error:', error);
|
|
4841
5003
|
* }
|
|
4842
5004
|
* });
|
|
4843
|
-
*
|
|
5005
|
+
* ```
|
|
5006
|
+
* */
|
|
4844
5007
|
var EmbedErrorCodes;
|
|
4845
5008
|
(function (EmbedErrorCodes) {
|
|
4846
5009
|
/** Worksheet ID not found or does not exist */
|
|
4847
5010
|
EmbedErrorCodes["WORKSHEET_ID_NOT_FOUND"] = "WORKSHEET_ID_NOT_FOUND";
|
|
4848
5011
|
/** Required Liveboard ID is missing from configuration */
|
|
4849
5012
|
EmbedErrorCodes["LIVEBOARD_ID_MISSING"] = "LIVEBOARD_ID_MISSING";
|
|
4850
|
-
/** Conflicting action configuration detected
|
|
5013
|
+
/** Conflicting action configuration detected */
|
|
4851
5014
|
EmbedErrorCodes["CONFLICTING_ACTIONS_CONFIG"] = "CONFLICTING_ACTIONS_CONFIG";
|
|
4852
|
-
/** Conflicting tab configuration detected
|
|
5015
|
+
/** Conflicting tab configuration detected */
|
|
4853
5016
|
EmbedErrorCodes["CONFLICTING_TABS_CONFIG"] = "CONFLICTING_TABS_CONFIG";
|
|
4854
5017
|
/** Error during component initialization */
|
|
4855
5018
|
EmbedErrorCodes["INIT_ERROR"] = "INIT_ERROR";
|
|
@@ -4867,6 +5030,8 @@ var EmbedErrorCodes;
|
|
|
4867
5030
|
EmbedErrorCodes["PARSING_API_INTERCEPT_BODY_ERROR"] = "PARSING_API_INTERCEPT_BODY_ERROR";
|
|
4868
5031
|
/** Failed to update embed parameters during pre-render */
|
|
4869
5032
|
EmbedErrorCodes["UPDATE_PARAMS_FAILED"] = "UPDATE_PARAMS_FAILED";
|
|
5033
|
+
/** Invalid URL provided in configuration */
|
|
5034
|
+
EmbedErrorCodes["INVALID_URL"] = "INVALID_URL";
|
|
4870
5035
|
})(EmbedErrorCodes || (EmbedErrorCodes = {}));
|
|
4871
5036
|
var ContextType;
|
|
4872
5037
|
(function (ContextType) {
|
|
@@ -5060,6 +5225,7 @@ const ERROR_MESSAGE = {
|
|
|
5060
5225
|
ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
|
|
5061
5226
|
SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
|
|
5062
5227
|
UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
|
|
5228
|
+
INVALID_SPOTTER_DOCUMENTATION_URL: 'Invalid spotterDocumentationUrl. Please provide a valid http or https URL.',
|
|
5063
5229
|
};
|
|
5064
5230
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
5065
5231
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -5544,6 +5710,36 @@ const isWindowUndefined = () => {
|
|
|
5544
5710
|
return true;
|
|
5545
5711
|
}
|
|
5546
5712
|
return false;
|
|
5713
|
+
};
|
|
5714
|
+
/**
|
|
5715
|
+
* Validates that a URL uses only http: or https: protocols.
|
|
5716
|
+
* Returns a tuple of [isValid, error] so the caller can handle validation errors.
|
|
5717
|
+
* @param url - The URL string to validate
|
|
5718
|
+
* @returns [true, null] if valid, [false, Error] if invalid
|
|
5719
|
+
*/
|
|
5720
|
+
const validateHttpUrl = (url) => {
|
|
5721
|
+
try {
|
|
5722
|
+
const parsedUrl = new URL(url);
|
|
5723
|
+
if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {
|
|
5724
|
+
return [false, new Error(`Invalid protocol: ${parsedUrl.protocol}. Only http: and https: are allowed.`)];
|
|
5725
|
+
}
|
|
5726
|
+
return [true, null];
|
|
5727
|
+
}
|
|
5728
|
+
catch (error) {
|
|
5729
|
+
return [false, error instanceof Error ? error : new Error(String(error))];
|
|
5730
|
+
}
|
|
5731
|
+
};
|
|
5732
|
+
/**
|
|
5733
|
+
* Sets a query parameter if the value is defined.
|
|
5734
|
+
* @param queryParams - The query params object to modify
|
|
5735
|
+
* @param param - The parameter key
|
|
5736
|
+
* @param value - The value to set
|
|
5737
|
+
* @param asBoolean - If true, coerces value to boolean
|
|
5738
|
+
*/
|
|
5739
|
+
const setParamIfDefined = (queryParams, param, value, asBoolean = false) => {
|
|
5740
|
+
if (value !== undefined) {
|
|
5741
|
+
queryParams[param] = asBoolean ? !!value : value;
|
|
5742
|
+
}
|
|
5547
5743
|
};
|
|
5548
5744
|
|
|
5549
5745
|
/**
|
|
@@ -8404,6 +8600,28 @@ const getSQLQuery = `
|
|
|
8404
8600
|
}
|
|
8405
8601
|
}
|
|
8406
8602
|
`;
|
|
8603
|
+
const updateDisplayMode = `
|
|
8604
|
+
mutation UpdateDisplayMode(
|
|
8605
|
+
$session: BachSessionIdInput!
|
|
8606
|
+
$displayMode: DisplayMode
|
|
8607
|
+
) {
|
|
8608
|
+
Answer__updateProperties(session: $session, displayMode: $displayMode) {
|
|
8609
|
+
id {
|
|
8610
|
+
sessionId
|
|
8611
|
+
genNo
|
|
8612
|
+
acSession {
|
|
8613
|
+
sessionId
|
|
8614
|
+
genNo
|
|
8615
|
+
}
|
|
8616
|
+
}
|
|
8617
|
+
answer {
|
|
8618
|
+
id
|
|
8619
|
+
displayMode
|
|
8620
|
+
suggestedDisplayMode
|
|
8621
|
+
}
|
|
8622
|
+
}
|
|
8623
|
+
}
|
|
8624
|
+
`;
|
|
8407
8625
|
const getAnswerTML = `
|
|
8408
8626
|
mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies: Boolean, $formatType: EDocFormatType, $exportPermissions: Boolean, $exportFqn: Boolean) {
|
|
8409
8627
|
UnsavedAnswer_getTML(
|
|
@@ -8571,7 +8789,15 @@ class AnswerService {
|
|
|
8571
8789
|
},
|
|
8572
8790
|
});
|
|
8573
8791
|
}
|
|
8574
|
-
async
|
|
8792
|
+
async updateDisplayMode(displayMode = "TABLE_MODE") {
|
|
8793
|
+
return this.executeQuery(updateDisplayMode, {
|
|
8794
|
+
displayMode,
|
|
8795
|
+
});
|
|
8796
|
+
}
|
|
8797
|
+
async getSQLQuery(fetchSQLWithAllColumns = false) {
|
|
8798
|
+
if (fetchSQLWithAllColumns) {
|
|
8799
|
+
await this.updateDisplayMode("TABLE_MODE");
|
|
8800
|
+
}
|
|
8575
8801
|
const { sql } = await this.executeQuery(getSQLQuery, {});
|
|
8576
8802
|
return sql;
|
|
8577
8803
|
}
|
|
@@ -8727,7 +8953,7 @@ class AnswerService {
|
|
|
8727
8953
|
async getTML() {
|
|
8728
8954
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8729
8955
|
const edoc = object[0].edoc;
|
|
8730
|
-
const YAML = await import('./index-
|
|
8956
|
+
const YAML = await import('./index-BuwECGdm.js');
|
|
8731
8957
|
const parsedDoc = YAML.parse(edoc);
|
|
8732
8958
|
return {
|
|
8733
8959
|
answer: {
|
|
@@ -18165,7 +18391,7 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
|
|
|
18165
18391
|
return eventData;
|
|
18166
18392
|
}
|
|
18167
18393
|
|
|
18168
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.45.
|
|
18394
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.45.3";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.23","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":"^30.0.0","@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":"^30.2.0","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:"^30.2.0","jest-environment-jsdom":"^29.7.0","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":"^29.4.6","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};
|
|
18169
18395
|
|
|
18170
18396
|
class HostEventClient {
|
|
18171
18397
|
constructor(iFrame) {
|
|
@@ -20131,7 +20357,7 @@ class AppEmbed extends V1Embed {
|
|
|
20131
20357
|
* embedded Liveboard or visualization.
|
|
20132
20358
|
*/
|
|
20133
20359
|
getEmbedParams() {
|
|
20134
|
-
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, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, minimumHeight, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
|
|
20360
|
+
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, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, spotterSidebarConfig, spotterChatConfig, minimumHeight, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
|
|
20135
20361
|
let params = {};
|
|
20136
20362
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
20137
20363
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -20155,6 +20381,41 @@ class AppEmbed extends V1Embed {
|
|
|
20155
20381
|
if (!isUndefined$1(updatedSpotterChatPrompt)) {
|
|
20156
20382
|
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
20157
20383
|
}
|
|
20384
|
+
// Handle spotterSidebarConfig params
|
|
20385
|
+
if (spotterSidebarConfig) {
|
|
20386
|
+
const { enablePastConversationsSidebar, spotterSidebarTitle, spotterSidebarDefaultExpanded, spotterChatRenameLabel, spotterChatDeleteLabel, spotterDeleteConversationModalTitle, spotterPastConversationAlertMessage, spotterDocumentationUrl, spotterBestPracticesLabel, spotterConversationsBatchSize, spotterNewChatButtonTitle, } = spotterSidebarConfig;
|
|
20387
|
+
setParamIfDefined(params, Param.EnablePastConversationsSidebar, enablePastConversationsSidebar, true);
|
|
20388
|
+
setParamIfDefined(params, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
|
|
20389
|
+
setParamIfDefined(params, Param.SpotterSidebarTitle, spotterSidebarTitle);
|
|
20390
|
+
setParamIfDefined(params, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
|
|
20391
|
+
setParamIfDefined(params, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
|
|
20392
|
+
setParamIfDefined(params, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
|
|
20393
|
+
setParamIfDefined(params, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
|
|
20394
|
+
setParamIfDefined(params, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
|
|
20395
|
+
setParamIfDefined(params, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
|
|
20396
|
+
setParamIfDefined(params, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
|
|
20397
|
+
// URL param with validation
|
|
20398
|
+
if (spotterDocumentationUrl !== undefined) {
|
|
20399
|
+
const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
|
|
20400
|
+
if (isValid) {
|
|
20401
|
+
params[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
|
|
20402
|
+
}
|
|
20403
|
+
else {
|
|
20404
|
+
this.handleError({
|
|
20405
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
20406
|
+
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
20407
|
+
code: EmbedErrorCodes.INVALID_URL,
|
|
20408
|
+
error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
20409
|
+
});
|
|
20410
|
+
}
|
|
20411
|
+
}
|
|
20412
|
+
}
|
|
20413
|
+
// Handle spotterChatConfig params
|
|
20414
|
+
if (spotterChatConfig) {
|
|
20415
|
+
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
|
|
20416
|
+
setParamIfDefined(params, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
|
|
20417
|
+
setParamIfDefined(params, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
|
|
20418
|
+
}
|
|
20158
20419
|
if (hideObjectSearch) {
|
|
20159
20420
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
20160
20421
|
}
|
|
@@ -20552,6 +20813,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
20552
20813
|
liveboardId: this.viewConfig.liveboardId,
|
|
20553
20814
|
vizId: this.viewConfig.vizId,
|
|
20554
20815
|
activeTabId: this.viewConfig.activeTabId,
|
|
20816
|
+
personalizedViewId: this.viewConfig.personalizedViewId,
|
|
20555
20817
|
};
|
|
20556
20818
|
if (this.viewConfig.fullHeight === true) {
|
|
20557
20819
|
if (this.viewConfig.vizId) {
|
|
@@ -20576,7 +20838,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
20576
20838
|
getEmbedParamsObject() {
|
|
20577
20839
|
let params = {};
|
|
20578
20840
|
params = this.getBaseQueryParams(params);
|
|
20579
|
-
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, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
|
|
20841
|
+
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, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, spotterChatConfig, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
|
|
20580
20842
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
20581
20843
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
20582
20844
|
if (fullHeight === true) {
|
|
@@ -20650,6 +20912,12 @@ class LiveboardEmbed extends V1Embed {
|
|
|
20650
20912
|
if (showSpotterLimitations !== undefined) {
|
|
20651
20913
|
params[Param.ShowSpotterLimitations] = showSpotterLimitations;
|
|
20652
20914
|
}
|
|
20915
|
+
// Handle spotterChatConfig params
|
|
20916
|
+
if (spotterChatConfig) {
|
|
20917
|
+
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
|
|
20918
|
+
setParamIfDefined(params, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
|
|
20919
|
+
setParamIfDefined(params, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
|
|
20920
|
+
}
|
|
20653
20921
|
if (isLinkParametersEnabled !== undefined) {
|
|
20654
20922
|
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
20655
20923
|
}
|
|
@@ -20673,15 +20941,31 @@ class LiveboardEmbed extends V1Embed {
|
|
|
20673
20941
|
getQueryParamString(params, true);
|
|
20674
20942
|
return params;
|
|
20675
20943
|
}
|
|
20676
|
-
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
20677
|
-
|
|
20944
|
+
getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId) {
|
|
20945
|
+
// Extract view from liveboardId if passed along with it (legacy approach)
|
|
20946
|
+
// View must be appended as query param at the end, not embedded in path
|
|
20947
|
+
let liveboardGuid = liveboardId;
|
|
20948
|
+
let legacyViewId;
|
|
20949
|
+
if (liveboardId === null || liveboardId === void 0 ? void 0 : liveboardId.includes('?')) {
|
|
20950
|
+
const [id, query] = liveboardId.split('?');
|
|
20951
|
+
liveboardGuid = id;
|
|
20952
|
+
const params = new URLSearchParams(query);
|
|
20953
|
+
legacyViewId = params.get('view') || undefined;
|
|
20954
|
+
}
|
|
20955
|
+
// personalizedViewId takes precedence over legacyViewId (when passed as part of liveboardId)
|
|
20956
|
+
const effectiveViewId = personalizedViewId || legacyViewId;
|
|
20957
|
+
let suffix = `/embed/viz/${liveboardGuid}`;
|
|
20678
20958
|
if (activeTabId) {
|
|
20679
|
-
suffix = `${suffix}/tab/${activeTabId}
|
|
20959
|
+
suffix = `${suffix}/tab/${activeTabId}`;
|
|
20680
20960
|
}
|
|
20681
20961
|
if (vizId) {
|
|
20682
20962
|
suffix = `${suffix}/${vizId}`;
|
|
20683
20963
|
}
|
|
20684
|
-
const
|
|
20964
|
+
const additionalParams = {};
|
|
20965
|
+
if (effectiveViewId) {
|
|
20966
|
+
additionalParams.view = effectiveViewId;
|
|
20967
|
+
}
|
|
20968
|
+
const tsPostHashParams = this.getThoughtSpotPostUrlParams(additionalParams);
|
|
20685
20969
|
suffix = `${suffix}${tsPostHashParams}`;
|
|
20686
20970
|
return suffix;
|
|
20687
20971
|
}
|
|
@@ -20691,7 +20975,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
20691
20975
|
*/
|
|
20692
20976
|
getIFrameSrc() {
|
|
20693
20977
|
var _a;
|
|
20694
|
-
const { vizId, activeTabId } = this.viewConfig;
|
|
20978
|
+
const { vizId, activeTabId, personalizedViewId } = this.viewConfig;
|
|
20695
20979
|
const liveboardId = (_a = this.viewConfig.liveboardId) !== null && _a !== void 0 ? _a : this.viewConfig.pinboardId;
|
|
20696
20980
|
if (!liveboardId) {
|
|
20697
20981
|
this.handleError({
|
|
@@ -20701,7 +20985,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
20701
20985
|
error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
20702
20986
|
});
|
|
20703
20987
|
}
|
|
20704
|
-
return `${this.getRootIframeSrc()}${this.getIframeSuffixSrc(liveboardId, vizId, activeTabId)}`;
|
|
20988
|
+
return `${this.getRootIframeSrc()}${this.getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId)}`;
|
|
20705
20989
|
}
|
|
20706
20990
|
setActiveTab(data) {
|
|
20707
20991
|
if (!this.viewConfig.vizId) {
|
|
@@ -20740,12 +21024,13 @@ class LiveboardEmbed extends V1Embed {
|
|
|
20740
21024
|
beforePrerenderVisible() {
|
|
20741
21025
|
const embedObj = this.getPreRenderObj();
|
|
20742
21026
|
this.executeAfterEmbedContainerLoaded(() => {
|
|
20743
|
-
this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId);
|
|
21027
|
+
this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId, this.viewConfig.personalizedViewId);
|
|
20744
21028
|
if (embedObj) {
|
|
20745
21029
|
embedObj.currentLiveboardState = {
|
|
20746
21030
|
liveboardId: this.viewConfig.liveboardId,
|
|
20747
21031
|
vizId: this.viewConfig.vizId,
|
|
20748
21032
|
activeTabId: this.viewConfig.activeTabId,
|
|
21033
|
+
personalizedViewId: this.viewConfig.personalizedViewId,
|
|
20749
21034
|
};
|
|
20750
21035
|
}
|
|
20751
21036
|
});
|
|
@@ -20810,11 +21095,12 @@ class LiveboardEmbed extends V1Embed {
|
|
|
20810
21095
|
this.postRender();
|
|
20811
21096
|
return this;
|
|
20812
21097
|
}
|
|
20813
|
-
navigateToLiveboard(liveboardId, vizId, activeTabId) {
|
|
20814
|
-
const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId);
|
|
21098
|
+
navigateToLiveboard(liveboardId, vizId, activeTabId, personalizedViewId) {
|
|
21099
|
+
const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId);
|
|
20815
21100
|
this.viewConfig.liveboardId = liveboardId;
|
|
20816
21101
|
this.viewConfig.activeTabId = activeTabId;
|
|
20817
21102
|
this.viewConfig.vizId = vizId;
|
|
21103
|
+
this.viewConfig.personalizedViewId = personalizedViewId;
|
|
20818
21104
|
if (this.isRendered) {
|
|
20819
21105
|
this.trigger(HostEvent.Navigate, path.substring(1));
|
|
20820
21106
|
}
|
|
@@ -20838,6 +21124,9 @@ class LiveboardEmbed extends V1Embed {
|
|
|
20838
21124
|
if (this.viewConfig.vizId) {
|
|
20839
21125
|
url = `${url}/${this.viewConfig.vizId}`;
|
|
20840
21126
|
}
|
|
21127
|
+
if (this.viewConfig.personalizedViewId) {
|
|
21128
|
+
url = `${url}?view=${this.viewConfig.personalizedViewId}`;
|
|
21129
|
+
}
|
|
20841
21130
|
return url;
|
|
20842
21131
|
}
|
|
20843
21132
|
}
|
|
@@ -21674,7 +21963,9 @@ class SpotterEmbed extends TsEmbed {
|
|
|
21674
21963
|
this.viewConfig = viewConfig;
|
|
21675
21964
|
}
|
|
21676
21965
|
getEmbedParamsObject() {
|
|
21677
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions,
|
|
21966
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, spotterSidebarConfig, spotterChatConfig, } = this.viewConfig;
|
|
21967
|
+
// Extract sidebar config properties
|
|
21968
|
+
const { enablePastConversationsSidebar, spotterSidebarTitle, spotterSidebarDefaultExpanded, spotterChatRenameLabel, spotterChatDeleteLabel, spotterDeleteConversationModalTitle, spotterPastConversationAlertMessage, spotterDocumentationUrl, spotterBestPracticesLabel, spotterConversationsBatchSize, spotterNewChatButtonTitle, } = spotterSidebarConfig || {};
|
|
21678
21969
|
if (!worksheetId) {
|
|
21679
21970
|
this.handleError({
|
|
21680
21971
|
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
@@ -21685,30 +21976,51 @@ class SpotterEmbed extends TsEmbed {
|
|
|
21685
21976
|
}
|
|
21686
21977
|
const queryParams = this.getBaseQueryParams();
|
|
21687
21978
|
queryParams[Param.SpotterEnabled] = true;
|
|
21688
|
-
|
|
21689
|
-
|
|
21690
|
-
|
|
21691
|
-
|
|
21692
|
-
|
|
21693
|
-
|
|
21694
|
-
|
|
21695
|
-
|
|
21696
|
-
|
|
21697
|
-
|
|
21698
|
-
|
|
21699
|
-
|
|
21700
|
-
|
|
21701
|
-
|
|
21979
|
+
// Boolean params
|
|
21980
|
+
setParamIfDefined(queryParams, Param.DisableSourceSelection, disableSourceSelection, true);
|
|
21981
|
+
setParamIfDefined(queryParams, Param.HideSourceSelection, hideSourceSelection, true);
|
|
21982
|
+
setParamIfDefined(queryParams, Param.DataPanelV2Enabled, dataPanelV2, true);
|
|
21983
|
+
setParamIfDefined(queryParams, Param.ShowSpotterLimitations, showSpotterLimitations, true);
|
|
21984
|
+
setParamIfDefined(queryParams, Param.HideSampleQuestions, hideSampleQuestions, true);
|
|
21985
|
+
setParamIfDefined(queryParams, Param.UpdatedSpotterChatPrompt, updatedSpotterChatPrompt, true);
|
|
21986
|
+
setParamIfDefined(queryParams, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
|
|
21987
|
+
// String params
|
|
21988
|
+
setParamIfDefined(queryParams, Param.SpotterSidebarTitle, spotterSidebarTitle);
|
|
21989
|
+
setParamIfDefined(queryParams, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
|
|
21990
|
+
setParamIfDefined(queryParams, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
|
|
21991
|
+
setParamIfDefined(queryParams, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
|
|
21992
|
+
setParamIfDefined(queryParams, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
|
|
21993
|
+
setParamIfDefined(queryParams, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
|
|
21994
|
+
setParamIfDefined(queryParams, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
|
|
21995
|
+
setParamIfDefined(queryParams, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
|
|
21996
|
+
// URL param with validation
|
|
21997
|
+
if (spotterDocumentationUrl !== undefined) {
|
|
21998
|
+
const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
|
|
21999
|
+
if (isValid) {
|
|
22000
|
+
queryParams[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
|
|
22001
|
+
}
|
|
22002
|
+
else {
|
|
22003
|
+
this.handleError({
|
|
22004
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
22005
|
+
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
22006
|
+
code: EmbedErrorCodes.INVALID_URL,
|
|
22007
|
+
error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
22008
|
+
});
|
|
22009
|
+
}
|
|
21702
22010
|
}
|
|
21703
|
-
|
|
21704
|
-
|
|
22011
|
+
// Handle spotterChatConfig params
|
|
22012
|
+
if (spotterChatConfig) {
|
|
22013
|
+
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
|
|
22014
|
+
setParamIfDefined(queryParams, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
|
|
22015
|
+
setParamIfDefined(queryParams, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
|
|
21705
22016
|
}
|
|
21706
22017
|
return queryParams;
|
|
21707
22018
|
}
|
|
21708
22019
|
getIframeSrc() {
|
|
21709
|
-
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL,
|
|
22020
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, spotterSidebarConfig, } = this.viewConfig;
|
|
21710
22021
|
const path = 'insights/conv-assist';
|
|
21711
22022
|
const queryParams = this.getEmbedParamsObject();
|
|
22023
|
+
const enablePastConversationsSidebar = spotterSidebarConfig === null || spotterSidebarConfig === void 0 ? void 0 : spotterSidebarConfig.enablePastConversationsSidebar;
|
|
21712
22024
|
if (!isUndefined_1(enablePastConversationsSidebar)) {
|
|
21713
22025
|
queryParams[Param.EnablePastConversationsSidebar] = !!enablePastConversationsSidebar;
|
|
21714
22026
|
}
|