@thoughtspot/visual-embed-sdk 1.46.5-beta.1 → 1.46.5
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 +4 -4
- package/cjs/src/css-variables.d.ts +36 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +41 -2
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +26 -46
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +36 -69
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +23 -1
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +18 -33
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +129 -97
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +31 -0
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +2 -0
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +18 -0
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +69 -9
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +185 -19
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts +22 -0
- package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.js +51 -0
- package/cjs/src/embed/hostEventClient/utils.js.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/cjs/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js +115 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js.map +1 -0
- package/cjs/src/embed/liveboard.d.ts +18 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +9 -11
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +29 -71
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/spotter-utils.d.ts +20 -0
- package/cjs/src/embed/spotter-utils.d.ts.map +1 -0
- package/cjs/src/embed/spotter-utils.js +52 -0
- package/cjs/src/embed/spotter-utils.js.map +1 -0
- package/cjs/src/embed/spotter-utils.spec.d.ts +2 -0
- package/cjs/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/cjs/src/embed/spotter-utils.spec.js +54 -0
- package/cjs/src/embed/spotter-utils.spec.js.map +1 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +13 -1
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/errors.d.ts +2 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +2 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/types.d.ts +102 -1
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +101 -0
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils.d.ts +0 -9
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +1 -10
- package/cjs/src/utils.js.map +1 -1
- package/dist/index-ChNydfIz.js +7371 -0
- package/dist/index-DGV_zh53.js +7371 -0
- package/dist/src/css-variables.d.ts +36 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +41 -2
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +23 -1
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +31 -0
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +18 -0
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts +22 -0
- package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/dist/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/dist/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/dist/src/embed/liveboard.d.ts +18 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/spotter-utils.d.ts +20 -0
- package/dist/src/embed/spotter-utils.d.ts.map +1 -0
- package/dist/src/embed/spotter-utils.spec.d.ts +2 -0
- package/dist/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +2 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/types.d.ts +102 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils.d.ts +0 -9
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +324 -110
- package/dist/tsembed-react.js +323 -109
- package/dist/tsembed.es.js +324 -110
- package/dist/tsembed.js +323 -109
- package/dist/visual-embed-sdk-react-full.d.ts +266 -3
- package/dist/visual-embed-sdk-react.d.ts +266 -3
- package/dist/visual-embed-sdk.d.ts +266 -3
- package/lib/package.json +4 -4
- package/lib/src/css-variables.d.ts +36 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +41 -2
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +28 -48
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +36 -69
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +23 -1
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +19 -34
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +131 -99
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +31 -0
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +2 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +18 -0
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +69 -9
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +185 -19
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts +22 -0
- package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/utils.js +43 -0
- package/lib/src/embed/hostEventClient/utils.js.map +1 -0
- package/lib/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/lib/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/utils.spec.js +113 -0
- package/lib/src/embed/hostEventClient/utils.spec.js.map +1 -0
- package/lib/src/embed/liveboard.d.ts +18 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +9 -11
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +29 -71
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/spotter-utils.d.ts +20 -0
- package/lib/src/embed/spotter-utils.d.ts.map +1 -0
- package/lib/src/embed/spotter-utils.js +47 -0
- package/lib/src/embed/spotter-utils.js.map +1 -0
- package/lib/src/embed/spotter-utils.spec.d.ts +2 -0
- package/lib/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/lib/src/embed/spotter-utils.spec.js +52 -0
- package/lib/src/embed/spotter-utils.spec.js.map +1 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +13 -1
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/errors.d.ts +2 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +2 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/types.d.ts +102 -1
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +101 -0
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils.d.ts +0 -9
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +0 -8
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +266 -3
- package/package.json +4 -4
- package/src/css-variables.ts +45 -0
- package/src/embed/app.spec.ts +51 -92
- package/src/embed/app.ts +60 -64
- package/src/embed/conversation.spec.ts +150 -119
- package/src/embed/conversation.ts +30 -54
- package/src/embed/hostEventClient/contracts.ts +31 -0
- package/src/embed/hostEventClient/host-event-client.spec.ts +260 -19
- package/src/embed/hostEventClient/host-event-client.ts +87 -11
- package/src/embed/hostEventClient/utils.spec.ts +137 -0
- package/src/embed/hostEventClient/utils.ts +61 -0
- package/src/embed/liveboard.spec.ts +38 -93
- package/src/embed/liveboard.ts +28 -10
- package/src/embed/spotter-utils.spec.ts +56 -0
- package/src/embed/spotter-utils.ts +65 -0
- package/src/embed/ts-embed.ts +15 -1
- package/src/errors.ts +2 -0
- package/src/types.ts +104 -0
- package/src/utils.ts +0 -14
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.46.5
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.46.5 */
|
|
2
2
|
'use client';
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -893,6 +893,17 @@ var EmbedEvent;
|
|
|
893
893
|
* ```
|
|
894
894
|
*/
|
|
895
895
|
EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
|
|
896
|
+
/**
|
|
897
|
+
* Emitted when the Download Liveboard as Continuous PDF action is triggered
|
|
898
|
+
* on a Liveboard.
|
|
899
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
900
|
+
* @example
|
|
901
|
+
* ```js
|
|
902
|
+
* liveboardEmbed.on(EmbedEvent.DownloadLiveboardAsContinuousPDF, payload => {
|
|
903
|
+
* console.log('download liveboard as continuous PDF', payload)})
|
|
904
|
+
* ```
|
|
905
|
+
*/
|
|
906
|
+
EmbedEvent["DownloadLiveboardAsContinuousPDF"] = "downloadLiveboardAsContinuousPDF";
|
|
896
907
|
/**
|
|
897
908
|
* Emitted when an Answer is deleted in the app
|
|
898
909
|
* Use start:true to subscribe to when delete is initiated, or end:true to subscribe
|
|
@@ -2421,6 +2432,18 @@ var HostEvent;
|
|
|
2421
2432
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2422
2433
|
*/
|
|
2423
2434
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
2435
|
+
/**
|
|
2436
|
+
* Trigger the **Download Liveboard as Continuous PDF** action on an
|
|
2437
|
+
* embedded Liveboard.
|
|
2438
|
+
*
|
|
2439
|
+
* @example
|
|
2440
|
+
* ```js
|
|
2441
|
+
* liveboardEmbed.trigger(HostEvent.DownloadLiveboardAsContinuousPDF)
|
|
2442
|
+
* ```
|
|
2443
|
+
*
|
|
2444
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
2445
|
+
*/
|
|
2446
|
+
HostEvent["DownloadLiveboardAsContinuousPDF"] = "downloadLiveboardAsContinuousPDF";
|
|
2424
2447
|
/**
|
|
2425
2448
|
* Trigger the **AI Highlights** action on an embedded Liveboard
|
|
2426
2449
|
*
|
|
@@ -2647,6 +2670,20 @@ var HostEvent;
|
|
|
2647
2670
|
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2648
2671
|
* }, ContextType.Liveboard);
|
|
2649
2672
|
* ```
|
|
2673
|
+
* @example
|
|
2674
|
+
* ```js
|
|
2675
|
+
* // Copy link from liveboard context
|
|
2676
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2677
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink, {}, ContextType.Liveboard);
|
|
2678
|
+
* ```
|
|
2679
|
+
* @example
|
|
2680
|
+
* ```js
|
|
2681
|
+
* // Copy link from liveboard visualization context
|
|
2682
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2683
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink, {
|
|
2684
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2685
|
+
* }, ContextType.Liveboard);
|
|
2686
|
+
* ```
|
|
2650
2687
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2651
2688
|
*/
|
|
2652
2689
|
HostEvent["CopyLink"] = "embedDocument";
|
|
@@ -2678,6 +2715,20 @@ var HostEvent;
|
|
|
2678
2715
|
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2679
2716
|
* liveboardEmbed.trigger(HostEvent.Present, {}, ContextType.Liveboard);
|
|
2680
2717
|
* ```
|
|
2718
|
+
* @example
|
|
2719
|
+
* ```js
|
|
2720
|
+
* // Present from liveboard visualization context
|
|
2721
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2722
|
+
* liveboardEmbed.trigger(HostEvent.Present, {
|
|
2723
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2724
|
+
* }, ContextType.Liveboard);
|
|
2725
|
+
* ```
|
|
2726
|
+
* @example
|
|
2727
|
+
* ```js
|
|
2728
|
+
* // Present from liveboard context
|
|
2729
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2730
|
+
* liveboardEmbed.trigger(HostEvent.Present, {}, ContextType.Liveboard);
|
|
2731
|
+
* ```
|
|
2681
2732
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2682
2733
|
*/
|
|
2683
2734
|
HostEvent["Present"] = "present";
|
|
@@ -3975,6 +4026,7 @@ var Param;
|
|
|
3975
4026
|
Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
|
|
3976
4027
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3977
4028
|
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
4029
|
+
Param["IsWYSIWYGLiveboardPDFEnabled"] = "isWYSIWYGLiveboardPDFEnabled";
|
|
3978
4030
|
Param["isLiveboardXLSXCSVDownloadEnabled"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3979
4031
|
Param["isGranularXLSXCSVSchedulesEnabled"] = "isGranularXLSXCSVSchedulesEnabled";
|
|
3980
4032
|
Param["isCentralizedLiveboardFilterUXEnabled"] = "isCentralizedLiveboardFilterUXEnabled";
|
|
@@ -4319,6 +4371,16 @@ var Action;
|
|
|
4319
4371
|
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
4320
4372
|
*/
|
|
4321
4373
|
Action["DownloadLiveboard"] = "downloadLiveboard";
|
|
4374
|
+
/**
|
|
4375
|
+
* The **Download Liveboard as Continuous PDF** menu action on a Liveboard.
|
|
4376
|
+
* Allows downloading the entire Liveboard as a continuous PDF.
|
|
4377
|
+
* @example
|
|
4378
|
+
* ```js
|
|
4379
|
+
* disabledActions: [Action.DownloadLiveboardAsContinuousPDF]
|
|
4380
|
+
* ```
|
|
4381
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
4382
|
+
*/
|
|
4383
|
+
Action["DownloadLiveboardAsContinuousPDF"] = "downloadLiveboardAsContinuousPDF";
|
|
4322
4384
|
/**
|
|
4323
4385
|
* @hidden
|
|
4324
4386
|
*/
|
|
@@ -5536,6 +5598,39 @@ var Action;
|
|
|
5536
5598
|
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
5537
5599
|
*/
|
|
5538
5600
|
Action["SpotterDocs"] = "spotterDocs";
|
|
5601
|
+
/**
|
|
5602
|
+
* Controls visibility and disable state of the connector resources
|
|
5603
|
+
* section in the Spotter chat interface.
|
|
5604
|
+
* @example
|
|
5605
|
+
* ```js
|
|
5606
|
+
* hiddenActions: [Action.SpotterChatConnectorResources]
|
|
5607
|
+
* disabledActions: [Action.SpotterChatConnectorResources]
|
|
5608
|
+
* ```
|
|
5609
|
+
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
5610
|
+
*/
|
|
5611
|
+
Action["SpotterChatConnectorResources"] = "spotterChatConnectorResources";
|
|
5612
|
+
/**
|
|
5613
|
+
* Controls visibility and disable state of the connectors
|
|
5614
|
+
* in the Spotter chat interface.
|
|
5615
|
+
* @example
|
|
5616
|
+
* ```js
|
|
5617
|
+
* hiddenActions: [Action.SpotterChatConnectors]
|
|
5618
|
+
* disabledActions: [Action.SpotterChatConnectors]
|
|
5619
|
+
* ```
|
|
5620
|
+
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
5621
|
+
*/
|
|
5622
|
+
Action["SpotterChatConnectors"] = "spotterChatConnectors";
|
|
5623
|
+
/**
|
|
5624
|
+
* Controls visibility and disable state of the mode switcher
|
|
5625
|
+
* in the Spotter chat interface.
|
|
5626
|
+
* @example
|
|
5627
|
+
* ```js
|
|
5628
|
+
* hiddenActions: [Action.SpotterChatModeSwitcher]
|
|
5629
|
+
* disabledActions: [Action.SpotterChatModeSwitcher]
|
|
5630
|
+
* ```
|
|
5631
|
+
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
5632
|
+
*/
|
|
5633
|
+
Action["SpotterChatModeSwitcher"] = "spotterChatModeSwitcher";
|
|
5539
5634
|
/**
|
|
5540
5635
|
* The **Include current period** checkbox for date filters.
|
|
5541
5636
|
* Controls the visibility and availability of the option to include
|
|
@@ -5829,6 +5924,12 @@ var EmbedErrorCodes;
|
|
|
5829
5924
|
EmbedErrorCodes["UPDATE_PARAMS_FAILED"] = "UPDATE_PARAMS_FAILED";
|
|
5830
5925
|
/** Invalid URL provided in configuration */
|
|
5831
5926
|
EmbedErrorCodes["INVALID_URL"] = "INVALID_URL";
|
|
5927
|
+
/** Host event payload validation failed */
|
|
5928
|
+
EmbedErrorCodes["HOST_EVENT_VALIDATION"] = "HOST_EVENT_VALIDATION";
|
|
5929
|
+
/** UpdateFilters payload is invalid - missing or malformed filter/filters */
|
|
5930
|
+
EmbedErrorCodes["UPDATEFILTERS_INVALID_PAYLOAD"] = "UPDATEFILTERS_INVALID_PAYLOAD";
|
|
5931
|
+
/** DrillDown payload is invalid - missing or malformed points */
|
|
5932
|
+
EmbedErrorCodes["DRILLDOWN_INVALID_PAYLOAD"] = "DRILLDOWN_INVALID_PAYLOAD";
|
|
5832
5933
|
})(EmbedErrorCodes || (EmbedErrorCodes = {}));
|
|
5833
5934
|
/**
|
|
5834
5935
|
* Context types for specifying the page context when triggering host events.
|
|
@@ -6043,6 +6144,8 @@ const ERROR_MESSAGE = {
|
|
|
6043
6144
|
SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
|
|
6044
6145
|
UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
|
|
6045
6146
|
INVALID_SPOTTER_DOCUMENTATION_URL: 'Invalid spotterDocumentationUrl. Please provide a valid http or https URL.',
|
|
6147
|
+
UPDATEFILTERS_INVALID_PAYLOAD: 'UpdateFilters requires a valid filter or filters array. Expected: { filter: { column, oper, values } } or { filters: [{ column, oper, values }, ...] }',
|
|
6148
|
+
DRILLDOWN_INVALID_PAYLOAD: 'DrillDown requires a valid points object. Expected: { points: { clickedPoint?, selectedPoints? }, autoDrillDown?, vizId? }',
|
|
6046
6149
|
};
|
|
6047
6150
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
6048
6151
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -6546,14 +6649,6 @@ const validateHttpUrl = (url) => {
|
|
|
6546
6649
|
return [false, error instanceof Error ? error : new Error(String(error))];
|
|
6547
6650
|
}
|
|
6548
6651
|
};
|
|
6549
|
-
/**
|
|
6550
|
-
* Resolves enablePastConversationsSidebar with
|
|
6551
|
-
* spotterSidebarConfig taking precedence over the
|
|
6552
|
-
* standalone flag.
|
|
6553
|
-
*/
|
|
6554
|
-
const resolveEnablePastConversationsSidebar = (params) => (params.spotterSidebarConfigValue !== undefined
|
|
6555
|
-
? params.spotterSidebarConfigValue
|
|
6556
|
-
: params.standaloneValue);
|
|
6557
6652
|
/**
|
|
6558
6653
|
* Sets a query parameter if the value is defined.
|
|
6559
6654
|
* @param queryParams - The query params object to modify
|
|
@@ -8850,6 +8945,8 @@ var UIPassthroughEvent;
|
|
|
8850
8945
|
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
8851
8946
|
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
8852
8947
|
UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
|
|
8948
|
+
UIPassthroughEvent["UpdateFilters"] = "updateFilters";
|
|
8949
|
+
UIPassthroughEvent["Drilldown"] = "drillDown";
|
|
8853
8950
|
UIPassthroughEvent["GetAnswerSession"] = "getAnswerSession";
|
|
8854
8951
|
UIPassthroughEvent["GetFilters"] = "getFilters";
|
|
8855
8952
|
UIPassthroughEvent["GetIframeUrl"] = "getIframeUrl";
|
|
@@ -9788,7 +9885,7 @@ class AnswerService {
|
|
|
9788
9885
|
async getTML() {
|
|
9789
9886
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
9790
9887
|
const edoc = object[0].edoc;
|
|
9791
|
-
const YAML = await import('./index-
|
|
9888
|
+
const YAML = await import('./index-ChNydfIz.js');
|
|
9792
9889
|
const parsedDoc = YAML.parse(edoc);
|
|
9793
9890
|
return {
|
|
9794
9891
|
answer: {
|
|
@@ -19270,10 +19367,60 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
|
|
|
19270
19367
|
return eventData;
|
|
19271
19368
|
}
|
|
19272
19369
|
|
|
19273
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.5
|
|
19370
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.5";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 && node dts-config/wrap-ambient-module.mjs","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 || echo 'Warning: Coveralls upload failed but not breaking the build.'","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.59.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:"34 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};
|
|
19274
19371
|
|
|
19275
|
-
|
|
19276
|
-
|
|
19372
|
+
function isValidUpdateFiltersPayload(payload) {
|
|
19373
|
+
if (!payload)
|
|
19374
|
+
return false;
|
|
19375
|
+
const isValidFilter = (f) => !!f && typeof f.column === 'string' && typeof f.oper === 'string' && Array.isArray(f.values);
|
|
19376
|
+
const hasValidFilter = payload.filter && isValidFilter(payload.filter);
|
|
19377
|
+
const hasValidFilters = Array.isArray(payload.filters) && payload.filters.length > 0 && payload.filters.every(isValidFilter);
|
|
19378
|
+
return !!(hasValidFilter || hasValidFilters);
|
|
19379
|
+
}
|
|
19380
|
+
function isValidDrillDownPayload(payload) {
|
|
19381
|
+
if (!payload)
|
|
19382
|
+
return false;
|
|
19383
|
+
const points = payload.points;
|
|
19384
|
+
if (!points || typeof points !== 'object')
|
|
19385
|
+
return false;
|
|
19386
|
+
const hasClickedPoint = 'clickedPoint' in points && points.clickedPoint != null;
|
|
19387
|
+
const hasSelectedPoints = Array.isArray(points.selectedPoints) && points.selectedPoints.length > 0;
|
|
19388
|
+
return hasClickedPoint || hasSelectedPoints;
|
|
19389
|
+
}
|
|
19390
|
+
function createValidationError(message) {
|
|
19391
|
+
const err = new Error(message);
|
|
19392
|
+
err.isValidationError = true;
|
|
19393
|
+
err.embedErrorDetails = {
|
|
19394
|
+
type: EmbedEvent.Error,
|
|
19395
|
+
data: {
|
|
19396
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
19397
|
+
message,
|
|
19398
|
+
code: EmbedErrorCodes.HOST_EVENT_VALIDATION,
|
|
19399
|
+
error: message
|
|
19400
|
+
},
|
|
19401
|
+
status: embedEventStatus.END
|
|
19402
|
+
};
|
|
19403
|
+
throw err;
|
|
19404
|
+
}
|
|
19405
|
+
function throwUpdateFiltersValidationError() {
|
|
19406
|
+
createValidationError(ERROR_MESSAGE.UPDATEFILTERS_INVALID_PAYLOAD);
|
|
19407
|
+
}
|
|
19408
|
+
function throwDrillDownValidationError() {
|
|
19409
|
+
createValidationError(ERROR_MESSAGE.DRILLDOWN_INVALID_PAYLOAD);
|
|
19410
|
+
}
|
|
19411
|
+
|
|
19412
|
+
/**
|
|
19413
|
+
* Maps HostEvent to its corresponding UIPassthroughEvent.
|
|
19414
|
+
* Includes both custom-handler events (Pin, SaveAnswer, UpdateFilters, DrillDown)
|
|
19415
|
+
* and getter events (GetAnswerSession, GetFilters, etc.) that use getDataWithPassthroughFallback.
|
|
19416
|
+
*/
|
|
19417
|
+
const PASSTHROUGH_MAP = {
|
|
19418
|
+
// Custom handlers (setters with special logic)
|
|
19419
|
+
[HostEvent.Pin]: UIPassthroughEvent.PinAnswerToLiveboard,
|
|
19420
|
+
[HostEvent.SaveAnswer]: UIPassthroughEvent.SaveAnswer,
|
|
19421
|
+
[HostEvent.UpdateFilters]: UIPassthroughEvent.UpdateFilters,
|
|
19422
|
+
[HostEvent.DrillDown]: UIPassthroughEvent.Drilldown,
|
|
19423
|
+
// Getters (use getDataWithPassthroughFallback)
|
|
19277
19424
|
[HostEvent.GetAnswerSession]: UIPassthroughEvent.GetAnswerSession,
|
|
19278
19425
|
[HostEvent.GetFilters]: UIPassthroughEvent.GetFilters,
|
|
19279
19426
|
[HostEvent.GetIframeUrl]: UIPassthroughEvent.GetIframeUrl,
|
|
@@ -19284,10 +19431,14 @@ const HOST_EVENT_PASSTHROUGH_MAP = {
|
|
|
19284
19431
|
};
|
|
19285
19432
|
class HostEventClient {
|
|
19286
19433
|
constructor(iFrame) {
|
|
19434
|
+
/** Cached list of available UI passthrough keys from the embedded app */
|
|
19435
|
+
this.availablePassthroughKeysCache = null;
|
|
19287
19436
|
this.iFrame = iFrame;
|
|
19288
19437
|
this.customHandlers = {
|
|
19289
19438
|
[HostEvent.Pin]: (p, c) => this.handlePinEvent(p, c),
|
|
19290
19439
|
[HostEvent.SaveAnswer]: (p, c) => this.handleSaveAnswerEvent(p, c),
|
|
19440
|
+
[HostEvent.UpdateFilters]: (p, c) => this.handleUpdateFiltersEvent(p, c),
|
|
19441
|
+
[HostEvent.DrillDown]: (p, c) => this.handleDrillDownEvent(p, c),
|
|
19291
19442
|
};
|
|
19292
19443
|
}
|
|
19293
19444
|
/**
|
|
@@ -19350,6 +19501,26 @@ class HostEventClient {
|
|
|
19350
19501
|
setIframeElement(iFrame) {
|
|
19351
19502
|
this.iFrame = iFrame;
|
|
19352
19503
|
}
|
|
19504
|
+
/**
|
|
19505
|
+
* Fetches the list of available UI passthrough keys from the embedded app.
|
|
19506
|
+
* Result is cached for the session. Returns empty array on failure.
|
|
19507
|
+
*/
|
|
19508
|
+
async getAvailableUIPassthroughKeys(context) {
|
|
19509
|
+
var _a, _b;
|
|
19510
|
+
if (this.availablePassthroughKeysCache !== null) {
|
|
19511
|
+
return this.availablePassthroughKeysCache;
|
|
19512
|
+
}
|
|
19513
|
+
try {
|
|
19514
|
+
const response = await this.triggerUIPassthroughApi(UIPassthroughEvent.GetAvailableUIPassthroughs, {}, context);
|
|
19515
|
+
const matched = (_a = response === null || response === void 0 ? void 0 : response.find) === null || _a === void 0 ? void 0 : _a.call(response, (r) => r.value && !r.error);
|
|
19516
|
+
const keys = (_b = matched === null || matched === void 0 ? void 0 : matched.value) === null || _b === void 0 ? void 0 : _b.keys;
|
|
19517
|
+
this.availablePassthroughKeysCache = Array.isArray(keys) ? keys : [];
|
|
19518
|
+
return this.availablePassthroughKeysCache;
|
|
19519
|
+
}
|
|
19520
|
+
catch {
|
|
19521
|
+
return [];
|
|
19522
|
+
}
|
|
19523
|
+
}
|
|
19353
19524
|
async triggerUIPassthroughApi(apiName, parameters, context) {
|
|
19354
19525
|
const res = await this.processTrigger(HostEvent.UIPassthrough, {
|
|
19355
19526
|
type: apiName,
|
|
@@ -19385,16 +19556,41 @@ class HostEventClient {
|
|
|
19385
19556
|
answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
|
|
19386
19557
|
};
|
|
19387
19558
|
}
|
|
19559
|
+
handleUpdateFiltersEvent(payload, context) {
|
|
19560
|
+
if (!isValidUpdateFiltersPayload(payload)) {
|
|
19561
|
+
throwUpdateFiltersValidationError();
|
|
19562
|
+
}
|
|
19563
|
+
return this.handleHostEventWithParam(UIPassthroughEvent.UpdateFilters, payload, context);
|
|
19564
|
+
}
|
|
19565
|
+
handleDrillDownEvent(payload, context) {
|
|
19566
|
+
if (!isValidDrillDownPayload(payload)) {
|
|
19567
|
+
throwDrillDownValidationError();
|
|
19568
|
+
}
|
|
19569
|
+
return this.handleHostEventWithParam(UIPassthroughEvent.Drilldown, payload, context);
|
|
19570
|
+
}
|
|
19571
|
+
/**
|
|
19572
|
+
* Dispatches a host event using the appropriate channel:
|
|
19573
|
+
* 1. If the embedded app supports UI passthrough for this event, use it (custom handler or getter).
|
|
19574
|
+
* 2. Otherwise fall back to the legacy host event channel.
|
|
19575
|
+
*
|
|
19576
|
+
* @param hostEvent - The host event to trigger
|
|
19577
|
+
* @param payload - Optional payload for the event
|
|
19578
|
+
* @param context - Optional context (e.g. vizId) for scoped operations
|
|
19579
|
+
*/
|
|
19388
19580
|
async triggerHostEvent(hostEvent, payload, context) {
|
|
19389
19581
|
const customHandler = this.customHandlers[hostEvent];
|
|
19390
|
-
|
|
19391
|
-
|
|
19392
|
-
|
|
19393
|
-
|
|
19394
|
-
|
|
19395
|
-
return this.getDataWithPassthroughFallback(passthroughEvent, hostEvent, payload, context);
|
|
19582
|
+
const passthroughEvent = PASSTHROUGH_MAP[hostEvent];
|
|
19583
|
+
// If embedded app supports passthrough but not this event, use legacy channel
|
|
19584
|
+
const keys = passthroughEvent ? await this.getAvailableUIPassthroughKeys(context) : [];
|
|
19585
|
+
if (passthroughEvent && keys.length > 0 && !keys.includes(passthroughEvent)) {
|
|
19586
|
+
return this.hostEventFallback(hostEvent, payload, context);
|
|
19396
19587
|
}
|
|
19397
|
-
|
|
19588
|
+
// Custom handler (setters) > getter passthrough > legacy fallback
|
|
19589
|
+
return (customHandler
|
|
19590
|
+
? customHandler(payload, context)
|
|
19591
|
+
: passthroughEvent
|
|
19592
|
+
? this.getDataWithPassthroughFallback(passthroughEvent, hostEvent, payload, context)
|
|
19593
|
+
: this.hostEventFallback(hostEvent, payload, context));
|
|
19398
19594
|
}
|
|
19399
19595
|
}
|
|
19400
19596
|
|
|
@@ -20728,7 +20924,19 @@ class TsEmbed {
|
|
|
20728
20924
|
return null;
|
|
20729
20925
|
}
|
|
20730
20926
|
// send an empty object, this is needed for liveboard default handlers
|
|
20731
|
-
return this.hostEventClient.triggerHostEvent(messageType, data, context)
|
|
20927
|
+
return this.hostEventClient.triggerHostEvent(messageType, data, context).catch((err) => {
|
|
20928
|
+
var _a;
|
|
20929
|
+
if (err === null || err === void 0 ? void 0 : err.isValidationError) {
|
|
20930
|
+
const errorDetails = (_a = err.embedErrorDetails) !== null && _a !== void 0 ? _a : {
|
|
20931
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
20932
|
+
message: err.message || ERROR_MESSAGE.UPDATEFILTERS_INVALID_PAYLOAD,
|
|
20933
|
+
code: EmbedErrorCodes.UPDATEFILTERS_INVALID_PAYLOAD,
|
|
20934
|
+
error: err.message,
|
|
20935
|
+
};
|
|
20936
|
+
this.handleError(errorDetails);
|
|
20937
|
+
}
|
|
20938
|
+
throw err;
|
|
20939
|
+
});
|
|
20732
20940
|
}
|
|
20733
20941
|
/**
|
|
20734
20942
|
* Triggers an event to the embedded app, skipping the UI flow.
|
|
@@ -21130,6 +21338,50 @@ class V1Embed extends TsEmbed {
|
|
|
21130
21338
|
}
|
|
21131
21339
|
}
|
|
21132
21340
|
|
|
21341
|
+
/**
|
|
21342
|
+
* Resolves enablePastConversationsSidebar with
|
|
21343
|
+
* spotterSidebarConfig taking precedence over the
|
|
21344
|
+
* standalone flag.
|
|
21345
|
+
*/
|
|
21346
|
+
const resolveEnablePastConversationsSidebar = (params) => (params.spotterSidebarConfigValue !== undefined
|
|
21347
|
+
? params.spotterSidebarConfigValue
|
|
21348
|
+
: params.standaloneValue);
|
|
21349
|
+
function buildSpotterSidebarAppInitData(defaultAppInitData, viewConfig, handleError) {
|
|
21350
|
+
const { spotterSidebarConfig, enablePastConversationsSidebar } = viewConfig;
|
|
21351
|
+
const resolvedEnablePastConversations = resolveEnablePastConversationsSidebar({
|
|
21352
|
+
spotterSidebarConfigValue: spotterSidebarConfig === null || spotterSidebarConfig === void 0 ? void 0 : spotterSidebarConfig.enablePastConversationsSidebar,
|
|
21353
|
+
standaloneValue: enablePastConversationsSidebar,
|
|
21354
|
+
});
|
|
21355
|
+
const hasConfig = spotterSidebarConfig || resolvedEnablePastConversations !== undefined;
|
|
21356
|
+
if (!hasConfig)
|
|
21357
|
+
return defaultAppInitData;
|
|
21358
|
+
const resolvedSidebarConfig = {
|
|
21359
|
+
...spotterSidebarConfig,
|
|
21360
|
+
...(resolvedEnablePastConversations !== undefined && {
|
|
21361
|
+
enablePastConversationsSidebar: resolvedEnablePastConversations,
|
|
21362
|
+
}),
|
|
21363
|
+
};
|
|
21364
|
+
if (resolvedSidebarConfig.spotterDocumentationUrl !== undefined) {
|
|
21365
|
+
const [isValid, validationError] = validateHttpUrl(resolvedSidebarConfig.spotterDocumentationUrl);
|
|
21366
|
+
if (!isValid) {
|
|
21367
|
+
handleError({
|
|
21368
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21369
|
+
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
21370
|
+
code: EmbedErrorCodes.INVALID_URL,
|
|
21371
|
+
error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
21372
|
+
});
|
|
21373
|
+
delete resolvedSidebarConfig.spotterDocumentationUrl;
|
|
21374
|
+
}
|
|
21375
|
+
}
|
|
21376
|
+
return {
|
|
21377
|
+
...defaultAppInitData,
|
|
21378
|
+
embedParams: {
|
|
21379
|
+
...(defaultAppInitData.embedParams || {}),
|
|
21380
|
+
spotterSidebarConfig: resolvedSidebarConfig,
|
|
21381
|
+
},
|
|
21382
|
+
};
|
|
21383
|
+
}
|
|
21384
|
+
|
|
21133
21385
|
/**
|
|
21134
21386
|
* Copyright (c) 2022
|
|
21135
21387
|
*
|
|
@@ -21259,7 +21511,10 @@ class AppEmbed extends V1Embed {
|
|
|
21259
21511
|
this.defaultHeight = 500;
|
|
21260
21512
|
this.sendFullHeightLazyLoadData = () => {
|
|
21261
21513
|
const data = calculateVisibleElementData(this.iFrame);
|
|
21262
|
-
this
|
|
21514
|
+
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
21515
|
+
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
21516
|
+
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
|
|
21517
|
+
}
|
|
21263
21518
|
};
|
|
21264
21519
|
/**
|
|
21265
21520
|
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
@@ -21272,22 +21527,13 @@ class AppEmbed extends V1Embed {
|
|
|
21272
21527
|
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
|
|
21273
21528
|
responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
21274
21529
|
};
|
|
21275
|
-
this.HEIGHT_CHANAGE_THRESHOLD = 30;
|
|
21276
21530
|
/**
|
|
21277
21531
|
* Set the iframe height as per the computed height received
|
|
21278
21532
|
* from the ThoughtSpot app.
|
|
21279
21533
|
* @param data The event payload
|
|
21280
21534
|
*/
|
|
21281
21535
|
this.updateIFrameHeight = (data) => {
|
|
21282
|
-
|
|
21283
|
-
const currentHeight = this.iFrame.getBoundingClientRect().height;
|
|
21284
|
-
const heightToSet = Math.max(data.data, this.defaultHeight);
|
|
21285
|
-
const heightChange = Math.abs(heightToSet - currentHeight);
|
|
21286
|
-
if (heightChange < this.HEIGHT_CHANAGE_THRESHOLD) {
|
|
21287
|
-
logger$3.info('Height change is less than the threshold, skipping height update', { heightChange, heightToSet, currentHeight });
|
|
21288
|
-
return;
|
|
21289
|
-
}
|
|
21290
|
-
this.setIFrameHeight(heightToSet);
|
|
21536
|
+
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
21291
21537
|
this.sendFullHeightLazyLoadData();
|
|
21292
21538
|
};
|
|
21293
21539
|
this.embedIframeCenter = (data, responder) => {
|
|
@@ -21321,12 +21567,28 @@ class AppEmbed extends V1Embed {
|
|
|
21321
21567
|
this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
|
|
21322
21568
|
}
|
|
21323
21569
|
}
|
|
21570
|
+
/**
|
|
21571
|
+
* Extends the default APP_INIT payload with `embedParams.spotterSidebarConfig`
|
|
21572
|
+
* so the conv-assist app can read sidebar configuration on initialisation.
|
|
21573
|
+
*
|
|
21574
|
+
* Precedence for `enablePastConversationsSidebar`:
|
|
21575
|
+
* `spotterSidebarConfig.enablePastConversationsSidebar` wins over the
|
|
21576
|
+
* deprecated top-level `enablePastConversationsSidebar` flag; if the former
|
|
21577
|
+
* is absent the latter is used as a fallback.
|
|
21578
|
+
*
|
|
21579
|
+
* An invalid `spotterDocumentationUrl` triggers a validation error and is
|
|
21580
|
+
* excluded from the payload rather than forwarded to the app.
|
|
21581
|
+
*/
|
|
21582
|
+
async getAppInitData() {
|
|
21583
|
+
const defaultAppInitData = await super.getAppInitData();
|
|
21584
|
+
return buildSpotterSidebarAppInitData(defaultAppInitData, this.viewConfig, this.handleError.bind(this));
|
|
21585
|
+
}
|
|
21324
21586
|
/**
|
|
21325
21587
|
* Constructs a map of parameters to be passed on to the
|
|
21326
21588
|
* embedded Liveboard or visualization.
|
|
21327
21589
|
*/
|
|
21328
21590
|
getEmbedParams() {
|
|
21329
|
-
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,
|
|
21591
|
+
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, spotterChatConfig, minimumHeight, isThisPeriodInDateFiltersEnabled, enableHomepageAnnouncement = false, isContinuousLiveboardPDFEnabled, } = this.viewConfig;
|
|
21330
21592
|
let params = {};
|
|
21331
21593
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
21332
21594
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -21350,39 +21612,6 @@ class AppEmbed extends V1Embed {
|
|
|
21350
21612
|
if (!isUndefined(updatedSpotterChatPrompt)) {
|
|
21351
21613
|
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
21352
21614
|
}
|
|
21353
|
-
const resolvedEnablePastConversationsSidebar = resolveEnablePastConversationsSidebar({
|
|
21354
|
-
spotterSidebarConfigValue: spotterSidebarConfig === null || spotterSidebarConfig === void 0 ? void 0 : spotterSidebarConfig.enablePastConversationsSidebar,
|
|
21355
|
-
standaloneValue: this.viewConfig.enablePastConversationsSidebar,
|
|
21356
|
-
});
|
|
21357
|
-
setParamIfDefined(params, Param.EnablePastConversationsSidebar, resolvedEnablePastConversationsSidebar, true);
|
|
21358
|
-
// Handle spotterSidebarConfig params
|
|
21359
|
-
if (spotterSidebarConfig) {
|
|
21360
|
-
const { spotterSidebarTitle, spotterSidebarDefaultExpanded, spotterChatRenameLabel, spotterChatDeleteLabel, spotterDeleteConversationModalTitle, spotterPastConversationAlertMessage, spotterDocumentationUrl, spotterBestPracticesLabel, spotterConversationsBatchSize, spotterNewChatButtonTitle, } = spotterSidebarConfig;
|
|
21361
|
-
setParamIfDefined(params, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
|
|
21362
|
-
setParamIfDefined(params, Param.SpotterSidebarTitle, spotterSidebarTitle);
|
|
21363
|
-
setParamIfDefined(params, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
|
|
21364
|
-
setParamIfDefined(params, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
|
|
21365
|
-
setParamIfDefined(params, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
|
|
21366
|
-
setParamIfDefined(params, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
|
|
21367
|
-
setParamIfDefined(params, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
|
|
21368
|
-
setParamIfDefined(params, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
|
|
21369
|
-
setParamIfDefined(params, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
|
|
21370
|
-
// URL param with validation
|
|
21371
|
-
if (spotterDocumentationUrl !== undefined) {
|
|
21372
|
-
const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
|
|
21373
|
-
if (isValid) {
|
|
21374
|
-
params[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
|
|
21375
|
-
}
|
|
21376
|
-
else {
|
|
21377
|
-
this.handleError({
|
|
21378
|
-
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21379
|
-
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
21380
|
-
code: EmbedErrorCodes.INVALID_URL,
|
|
21381
|
-
error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
21382
|
-
});
|
|
21383
|
-
}
|
|
21384
|
-
}
|
|
21385
|
-
}
|
|
21386
21615
|
// Handle spotterChatConfig params
|
|
21387
21616
|
if (spotterChatConfig) {
|
|
21388
21617
|
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
|
|
@@ -21458,6 +21687,9 @@ class AppEmbed extends V1Embed {
|
|
|
21458
21687
|
if (enableHomepageAnnouncement !== undefined) {
|
|
21459
21688
|
params[Param.EnableHomepageAnnouncement] = enableHomepageAnnouncement;
|
|
21460
21689
|
}
|
|
21690
|
+
if (isContinuousLiveboardPDFEnabled !== undefined) {
|
|
21691
|
+
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
21692
|
+
}
|
|
21461
21693
|
this.defaultHeight = minimumHeight || this.defaultHeight;
|
|
21462
21694
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
21463
21695
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
@@ -21733,7 +21965,10 @@ class LiveboardEmbed extends V1Embed {
|
|
|
21733
21965
|
this.defaultHeight = 500;
|
|
21734
21966
|
this.sendFullHeightLazyLoadData = () => {
|
|
21735
21967
|
const data = calculateVisibleElementData(this.iFrame);
|
|
21736
|
-
this
|
|
21968
|
+
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
21969
|
+
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
21970
|
+
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
|
|
21971
|
+
}
|
|
21737
21972
|
};
|
|
21738
21973
|
/**
|
|
21739
21974
|
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
@@ -21746,21 +21981,13 @@ class LiveboardEmbed extends V1Embed {
|
|
|
21746
21981
|
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
|
|
21747
21982
|
responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
21748
21983
|
};
|
|
21749
|
-
this.HEIGHT_CHANAGE_THRESHOLD = 30;
|
|
21750
21984
|
/**
|
|
21751
21985
|
* Set the iframe height as per the computed height received
|
|
21752
21986
|
* from the ThoughtSpot app.
|
|
21753
21987
|
* @param data The event payload
|
|
21754
21988
|
*/
|
|
21755
21989
|
this.updateIFrameHeight = (data) => {
|
|
21756
|
-
|
|
21757
|
-
const heightToSet = Math.max(data.data, this.defaultHeight);
|
|
21758
|
-
const heightChange = Math.abs(heightToSet - currentHeight);
|
|
21759
|
-
if (heightChange < this.HEIGHT_CHANAGE_THRESHOLD) {
|
|
21760
|
-
logger$3.info('Height change is less than the threshold, skipping height update', { heightChange, heightToSet, currentHeight });
|
|
21761
|
-
return;
|
|
21762
|
-
}
|
|
21763
|
-
this.setIFrameHeight(heightToSet);
|
|
21990
|
+
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
21764
21991
|
this.sendFullHeightLazyLoadData();
|
|
21765
21992
|
};
|
|
21766
21993
|
this.embedIframeCenter = (data, responder) => {
|
|
@@ -21821,7 +22048,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
21821
22048
|
getEmbedParamsObject() {
|
|
21822
22049
|
let params = {};
|
|
21823
22050
|
params = this.getBaseQueryParams(params);
|
|
21824
|
-
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;
|
|
22051
|
+
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, isContinuousLiveboardPDFEnabled, } = this.viewConfig;
|
|
21825
22052
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
21826
22053
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
21827
22054
|
if (fullHeight === true) {
|
|
@@ -21910,6 +22137,9 @@ class LiveboardEmbed extends V1Embed {
|
|
|
21910
22137
|
if (isThisPeriodInDateFiltersEnabled !== undefined) {
|
|
21911
22138
|
params[Param.IsThisPeriodInDateFiltersEnabled] = isThisPeriodInDateFiltersEnabled;
|
|
21912
22139
|
}
|
|
22140
|
+
if (isContinuousLiveboardPDFEnabled !== undefined) {
|
|
22141
|
+
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
22142
|
+
}
|
|
21913
22143
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
21914
22144
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
21915
22145
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
@@ -22926,14 +23156,24 @@ class SpotterEmbed extends TsEmbed {
|
|
|
22926
23156
|
super(container, viewConfig);
|
|
22927
23157
|
this.viewConfig = viewConfig;
|
|
22928
23158
|
}
|
|
23159
|
+
/**
|
|
23160
|
+
* Extends the default APP_INIT payload with `embedParams.spotterSidebarConfig`
|
|
23161
|
+
* so the conv-assist app can read sidebar configuration on initialisation.
|
|
23162
|
+
*
|
|
23163
|
+
* Precedence for `enablePastConversationsSidebar`:
|
|
23164
|
+
* `spotterSidebarConfig.enablePastConversationsSidebar` wins over the
|
|
23165
|
+
* deprecated top-level `enablePastConversationsSidebar` flag; if the former
|
|
23166
|
+
* is absent the latter is used as a fallback.
|
|
23167
|
+
*
|
|
23168
|
+
* An invalid `spotterDocumentationUrl` triggers a validation error and is
|
|
23169
|
+
* excluded from the payload rather than forwarded to the app.
|
|
23170
|
+
*/
|
|
23171
|
+
async getAppInitData() {
|
|
23172
|
+
const defaultAppInitData = await super.getAppInitData();
|
|
23173
|
+
return buildSpotterSidebarAppInitData(defaultAppInitData, this.viewConfig, this.handleError.bind(this));
|
|
23174
|
+
}
|
|
22929
23175
|
getEmbedParamsObject() {
|
|
22930
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt,
|
|
22931
|
-
// Extract sidebar config properties
|
|
22932
|
-
const { enablePastConversationsSidebar: sidebarEnablePastConversationsSidebar, spotterSidebarTitle, spotterSidebarDefaultExpanded, spotterChatRenameLabel, spotterChatDeleteLabel, spotterDeleteConversationModalTitle, spotterPastConversationAlertMessage, spotterDocumentationUrl, spotterBestPracticesLabel, spotterConversationsBatchSize, spotterNewChatButtonTitle, } = spotterSidebarConfig || {};
|
|
22933
|
-
const resolvedEnablePastConversationsSidebar = resolveEnablePastConversationsSidebar({
|
|
22934
|
-
spotterSidebarConfigValue: sidebarEnablePastConversationsSidebar,
|
|
22935
|
-
standaloneValue: this.viewConfig.enablePastConversationsSidebar,
|
|
22936
|
-
});
|
|
23176
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, spotterChatConfig, } = this.viewConfig;
|
|
22937
23177
|
if (!worksheetId) {
|
|
22938
23178
|
this.handleError({
|
|
22939
23179
|
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
@@ -22951,32 +23191,6 @@ class SpotterEmbed extends TsEmbed {
|
|
|
22951
23191
|
setParamIfDefined(queryParams, Param.ShowSpotterLimitations, showSpotterLimitations, true);
|
|
22952
23192
|
setParamIfDefined(queryParams, Param.HideSampleQuestions, hideSampleQuestions, true);
|
|
22953
23193
|
setParamIfDefined(queryParams, Param.UpdatedSpotterChatPrompt, updatedSpotterChatPrompt, true);
|
|
22954
|
-
setParamIfDefined(queryParams, Param.EnablePastConversationsSidebar, resolvedEnablePastConversationsSidebar, true);
|
|
22955
|
-
setParamIfDefined(queryParams, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
|
|
22956
|
-
// String params
|
|
22957
|
-
setParamIfDefined(queryParams, Param.SpotterSidebarTitle, spotterSidebarTitle);
|
|
22958
|
-
setParamIfDefined(queryParams, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
|
|
22959
|
-
setParamIfDefined(queryParams, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
|
|
22960
|
-
setParamIfDefined(queryParams, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
|
|
22961
|
-
setParamIfDefined(queryParams, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
|
|
22962
|
-
setParamIfDefined(queryParams, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
|
|
22963
|
-
setParamIfDefined(queryParams, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
|
|
22964
|
-
setParamIfDefined(queryParams, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
|
|
22965
|
-
// URL param with validation
|
|
22966
|
-
if (spotterDocumentationUrl !== undefined) {
|
|
22967
|
-
const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
|
|
22968
|
-
if (isValid) {
|
|
22969
|
-
queryParams[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
|
|
22970
|
-
}
|
|
22971
|
-
else {
|
|
22972
|
-
this.handleError({
|
|
22973
|
-
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
22974
|
-
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
22975
|
-
code: EmbedErrorCodes.INVALID_URL,
|
|
22976
|
-
error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
22977
|
-
});
|
|
22978
|
-
}
|
|
22979
|
-
}
|
|
22980
23194
|
// Handle spotterChatConfig params
|
|
22981
23195
|
if (spotterChatConfig) {
|
|
22982
23196
|
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
|