@thoughtspot/visual-embed-sdk 1.52.1 → 1.52.2-beta
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 +11 -4
- package/cjs/src/contracts/host-event-contracts.d.ts +49 -11
- package/cjs/src/contracts/host-event-contracts.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +4 -3
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +1 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +10 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/auto-frame-renderer.js +1 -1
- package/cjs/src/embed/auto-frame-renderer.js.map +1 -1
- package/cjs/src/embed/auto-frame-renderer.spec.js +24 -13
- package/cjs/src/embed/auto-frame-renderer.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +1 -1
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +1 -0
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +4 -4
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +35 -24
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/embedConfig.spec.js +2 -1
- package/cjs/src/embed/embedConfig.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +2 -2
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +16 -10
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +14 -8
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts +9 -0
- package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.js +49 -3
- package/cjs/src/embed/hostEventClient/utils.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.spec.js +151 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +4 -3
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +18 -13
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +2 -1
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/search-bar.js +1 -1
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.js +1 -1
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +20 -0
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/spotter-utils.d.ts +8 -1
- package/cjs/src/embed/spotter-utils.d.ts.map +1 -1
- package/cjs/src/embed/spotter-utils.js +14 -1
- package/cjs/src/embed/spotter-utils.js.map +1 -1
- package/cjs/src/embed/spotter-utils.spec.js +26 -0
- package/cjs/src/embed/spotter-utils.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +3 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +108 -29
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +163 -23
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.js +1 -1
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +2 -1
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/types.d.ts +45 -22
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +44 -21
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/authService/tokenizedAuthService.spec.js +2 -1
- package/cjs/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
- package/cjs/src/utils/custom-actions.spec.js +4 -2
- package/cjs/src/utils/custom-actions.spec.js.map +1 -1
- package/cjs/src/utils/filterConverter.d.ts +106 -0
- package/cjs/src/utils/filterConverter.d.ts.map +1 -0
- package/cjs/src/utils/filterConverter.js +215 -0
- package/cjs/src/utils/filterConverter.js.map +1 -0
- package/cjs/src/utils/filterConverter.spec.d.ts +2 -0
- package/cjs/src/utils/filterConverter.spec.d.ts.map +1 -0
- package/cjs/src/utils/filterConverter.spec.js +709 -0
- package/cjs/src/utils/filterConverter.spec.js.map +1 -0
- package/cjs/src/utils/processData.spec.js +2 -1
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/dist/{index-C1pmYb5H.js → index-CcBYlGo9.js} +1 -1
- package/dist/src/contracts/host-event-contracts.d.ts +49 -11
- package/dist/src/contracts/host-event-contracts.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +4 -3
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +1 -0
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +2 -2
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts +9 -0
- package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +4 -3
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/spotter-utils.d.ts +8 -1
- package/dist/src/embed/spotter-utils.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +3 -0
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/types.d.ts +45 -22
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/filterConverter.d.ts +106 -0
- package/dist/src/utils/filterConverter.d.ts.map +1 -0
- package/dist/src/utils/filterConverter.spec.d.ts +2 -0
- package/dist/src/utils/filterConverter.spec.d.ts.map +1 -0
- package/dist/tsembed-react.es.js +257 -87
- package/dist/tsembed-react.js +256 -86
- package/dist/tsembed.es.js +466 -89
- package/dist/tsembed.js +465 -87
- package/dist/visual-embed-sdk-react-full.d.ts +202 -40
- package/dist/visual-embed-sdk-react.d.ts +108 -40
- package/dist/visual-embed-sdk.d.ts +202 -40
- package/lib/package.json +11 -4
- package/lib/src/contracts/host-event-contracts.d.ts +49 -11
- package/lib/src/contracts/host-event-contracts.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +4 -3
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +1 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +10 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/auto-frame-renderer.js +1 -1
- package/lib/src/embed/auto-frame-renderer.js.map +1 -1
- package/lib/src/embed/auto-frame-renderer.spec.js +24 -13
- package/lib/src/embed/auto-frame-renderer.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +1 -1
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +1 -0
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +5 -5
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +35 -24
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/embedConfig.spec.js +2 -1
- package/lib/src/embed/embedConfig.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +2 -2
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +17 -11
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +14 -8
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts +9 -0
- package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/utils.js +47 -2
- package/lib/src/embed/hostEventClient/utils.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.spec.js +152 -1
- package/lib/src/embed/hostEventClient/utils.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +4 -3
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +18 -13
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +2 -1
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/search-bar.js +1 -1
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.js +1 -1
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +20 -0
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/spotter-utils.d.ts +8 -1
- package/lib/src/embed/spotter-utils.d.ts.map +1 -1
- package/lib/src/embed/spotter-utils.js +12 -0
- package/lib/src/embed/spotter-utils.js.map +1 -1
- package/lib/src/embed/spotter-utils.spec.js +27 -1
- package/lib/src/embed/spotter-utils.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +3 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +108 -29
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +164 -24
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.js +1 -1
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +2 -1
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -1
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/types.d.ts +45 -22
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +44 -21
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/authService/tokenizedAuthService.spec.js +2 -1
- package/lib/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
- package/lib/src/utils/custom-actions.spec.js +4 -2
- package/lib/src/utils/custom-actions.spec.js.map +1 -1
- package/lib/src/utils/filterConverter.d.ts +106 -0
- package/lib/src/utils/filterConverter.d.ts.map +1 -0
- package/lib/src/utils/filterConverter.js +210 -0
- package/lib/src/utils/filterConverter.js.map +1 -0
- package/lib/src/utils/filterConverter.spec.d.ts +2 -0
- package/lib/src/utils/filterConverter.spec.d.ts.map +1 -0
- package/lib/src/utils/filterConverter.spec.js +707 -0
- package/lib/src/utils/filterConverter.spec.js.map +1 -0
- package/lib/src/utils/processData.spec.js +2 -1
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +202 -40
- package/package.json +11 -4
- package/src/contracts/host-event-contracts.ts +55 -11
- package/src/embed/app.spec.ts +15 -0
- package/src/embed/app.ts +5 -4
- package/src/embed/auto-frame-renderer.spec.ts +24 -13
- package/src/embed/auto-frame-renderer.ts +1 -1
- package/src/embed/bodyless-conversation.ts +1 -1
- package/src/embed/conversation.spec.ts +38 -27
- package/src/embed/conversation.ts +5 -5
- package/src/embed/embedConfig.spec.ts +2 -1
- package/src/embed/hostEventClient/host-event-client.spec.ts +14 -8
- package/src/embed/hostEventClient/host-event-client.ts +18 -10
- package/src/embed/hostEventClient/utils.spec.ts +176 -1
- package/src/embed/hostEventClient/utils.ts +51 -2
- package/src/embed/liveboard.spec.ts +4 -3
- package/src/embed/liveboard.ts +22 -16
- package/src/embed/search-bar.tsx +1 -1
- package/src/embed/search.spec.ts +23 -0
- package/src/embed/search.ts +1 -1
- package/src/embed/spotter-utils.spec.ts +29 -0
- package/src/embed/spotter-utils.ts +16 -0
- package/src/embed/ts-embed.spec.ts +204 -23
- package/src/embed/ts-embed.ts +114 -28
- package/src/errors.ts +1 -1
- package/src/index.ts +10 -0
- package/src/react/all-types-export.ts +4 -0
- package/src/types.ts +44 -21
- package/src/utils/authService/tokenizedAuthService.spec.ts +2 -1
- package/src/utils/custom-actions.spec.ts +4 -2
- package/src/utils/filterConverter.spec.ts +801 -0
- package/src/utils/filterConverter.ts +304 -0
- package/src/utils/processData.spec.ts +2 -1
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.52.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.52.2-beta */
|
|
2
2
|
'use client';
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -3766,6 +3766,12 @@ var HostEvent;
|
|
|
3766
3766
|
* ```js
|
|
3767
3767
|
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
|
|
3768
3768
|
* console.log('data', data);
|
|
3769
|
+
* // {
|
|
3770
|
+
* // liveboardFilters: [ ... ],
|
|
3771
|
+
* // runtimeFilters: [
|
|
3772
|
+
* // { columnName: "Region", operator: "IN", values: ["West"] }
|
|
3773
|
+
* // ]
|
|
3774
|
+
* // }
|
|
3769
3775
|
* ```
|
|
3770
3776
|
* @example
|
|
3771
3777
|
* ```js
|
|
@@ -3790,9 +3796,9 @@ var HostEvent;
|
|
|
3790
3796
|
*
|
|
3791
3797
|
* Each filter object must include the following attributes:
|
|
3792
3798
|
*
|
|
3793
|
-
* `
|
|
3799
|
+
* `columnName` - Name of the column to filter on.
|
|
3794
3800
|
*
|
|
3795
|
-
* `
|
|
3801
|
+
* `operator` - Filter operator, for example, EQ, IN, CONTAINS.
|
|
3796
3802
|
* For information about the supported filter operators,
|
|
3797
3803
|
* see link:https://developers.thoughtspot.com/docs/runtime-filters#rtOperator[Developer Documentation].
|
|
3798
3804
|
*
|
|
@@ -3819,8 +3825,8 @@ var HostEvent;
|
|
|
3819
3825
|
*
|
|
3820
3826
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3821
3827
|
* filter: {
|
|
3822
|
-
*
|
|
3823
|
-
*
|
|
3828
|
+
* columnName: "item type",
|
|
3829
|
+
* operator: "IN",
|
|
3824
3830
|
* values: ["bags","shirts"]
|
|
3825
3831
|
* }
|
|
3826
3832
|
* });
|
|
@@ -3830,8 +3836,8 @@ var HostEvent;
|
|
|
3830
3836
|
*
|
|
3831
3837
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3832
3838
|
* filter: {
|
|
3833
|
-
*
|
|
3834
|
-
*
|
|
3839
|
+
* columnName: "date",
|
|
3840
|
+
* operator: "EQ",
|
|
3835
3841
|
* values: ["JULY","2023"],
|
|
3836
3842
|
* type: "MONTH_YEAR"
|
|
3837
3843
|
* }
|
|
@@ -3842,18 +3848,18 @@ var HostEvent;
|
|
|
3842
3848
|
* ```js
|
|
3843
3849
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3844
3850
|
* filters: [{
|
|
3845
|
-
*
|
|
3846
|
-
*
|
|
3851
|
+
* columnName: "Item Type",
|
|
3852
|
+
* operator: 'IN',
|
|
3847
3853
|
* values: ["bags","shirts"]
|
|
3848
3854
|
* },
|
|
3849
3855
|
* {
|
|
3850
|
-
*
|
|
3851
|
-
*
|
|
3856
|
+
* columnName: "Region",
|
|
3857
|
+
* operator: 'IN',
|
|
3852
3858
|
* values: ["West","Midwest"]
|
|
3853
3859
|
* },
|
|
3854
3860
|
* {
|
|
3855
|
-
*
|
|
3856
|
-
*
|
|
3861
|
+
* columnName: "Date",
|
|
3862
|
+
* operator: 'EQ',
|
|
3857
3863
|
* values: ["2023-07-31"],
|
|
3858
3864
|
* type: "EXACT_DATE"
|
|
3859
3865
|
* }]
|
|
@@ -3867,13 +3873,13 @@ var HostEvent;
|
|
|
3867
3873
|
* ```js
|
|
3868
3874
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3869
3875
|
* filters: [{
|
|
3870
|
-
*
|
|
3871
|
-
*
|
|
3876
|
+
* columnName: "(Sample) Retail - Apparel::city",
|
|
3877
|
+
* operator: 'IN',
|
|
3872
3878
|
* values: ["atlanta"]
|
|
3873
3879
|
* },
|
|
3874
3880
|
* {
|
|
3875
|
-
*
|
|
3876
|
-
*
|
|
3881
|
+
* columnName: "(Sample) Retail - Apparel::Region",
|
|
3882
|
+
* operator: 'IN',
|
|
3877
3883
|
* values: ["West","Midwest"]
|
|
3878
3884
|
* }]
|
|
3879
3885
|
* });
|
|
@@ -3884,8 +3890,8 @@ var HostEvent;
|
|
|
3884
3890
|
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3885
3891
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3886
3892
|
* filter: {
|
|
3887
|
-
*
|
|
3888
|
-
*
|
|
3893
|
+
* columnName: "item type",
|
|
3894
|
+
* operator: "IN",
|
|
3889
3895
|
* values: ["shoes", "boots"]
|
|
3890
3896
|
* }
|
|
3891
3897
|
* }, ContextType.Liveboard);
|
|
@@ -3895,8 +3901,8 @@ var HostEvent;
|
|
|
3895
3901
|
* // Scope the filter to a specific Liveboard tab
|
|
3896
3902
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3897
3903
|
* filter: {
|
|
3898
|
-
*
|
|
3899
|
-
*
|
|
3904
|
+
* columnName: "item type",
|
|
3905
|
+
* operator: "IN",
|
|
3900
3906
|
* values: ["bags", "shirts"],
|
|
3901
3907
|
* applicability: {
|
|
3902
3908
|
* level: "TAB",
|
|
@@ -3905,6 +3911,12 @@ var HostEvent;
|
|
|
3905
3911
|
* }
|
|
3906
3912
|
* });
|
|
3907
3913
|
* ```
|
|
3914
|
+
* Use `columnName` and `operator` - the same spelling as
|
|
3915
|
+
* {@link RuntimeFilter}. The older `column` and `oper` spellings are
|
|
3916
|
+
* deprecated; they are still accepted, but pass only one spelling of each
|
|
3917
|
+
* field, never both. To reapply the filter state captured from
|
|
3918
|
+
* {@link EmbedEvent.FilterChanged}, use `convertFilterChangedToUpdateFiltersPayload`
|
|
3919
|
+
* to convert its payload into the shape expected here.
|
|
3908
3920
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
3909
3921
|
*/
|
|
3910
3922
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
@@ -4890,7 +4902,6 @@ var Param;
|
|
|
4890
4902
|
Param["IsStarterPromptsEnabled"] = "enableStarterPrompts";
|
|
4891
4903
|
Param["UpdatedSpotterExperience"] = "updatedSpotterExperience";
|
|
4892
4904
|
Param["SpotterDataSources"] = "spotterDataSources";
|
|
4893
|
-
Param["AnalystId"] = "analystId";
|
|
4894
4905
|
Param["OpenSpotterOnLiveboardByDefault"] = "openSpotterOnLiveboardByDefault";
|
|
4895
4906
|
Param["ShowAnswerEditPanel"] = "showAnswerEditPanel";
|
|
4896
4907
|
})(Param || (Param = {}));
|
|
@@ -7116,6 +7127,18 @@ var Action;
|
|
|
7116
7127
|
* ```
|
|
7117
7128
|
*/
|
|
7118
7129
|
Action["DeleteCollection"] = "deleteCollection";
|
|
7130
|
+
/**
|
|
7131
|
+
* Controls the visibility of the "Customize homepage" button on the
|
|
7132
|
+
* embedded home page.
|
|
7133
|
+
* @version SDK: 1.55.0 | ThoughtSpot Cloud: 26.12.0.cl
|
|
7134
|
+
* @example
|
|
7135
|
+
* ```js
|
|
7136
|
+
* {
|
|
7137
|
+
* hiddenActions: [Action.CustomizeHomepage],
|
|
7138
|
+
* }
|
|
7139
|
+
* ```
|
|
7140
|
+
*/
|
|
7141
|
+
Action["CustomizeHomepage"] = "customizeHomepage";
|
|
7119
7142
|
})(Action || (Action = {}));
|
|
7120
7143
|
var PrefetchFeatures;
|
|
7121
7144
|
(function (PrefetchFeatures) {
|
|
@@ -7620,7 +7643,7 @@ var TableContentDensity;
|
|
|
7620
7643
|
TableContentDensity["Compact"] = "COMPACT";
|
|
7621
7644
|
})(TableContentDensity || (TableContentDensity = {}));
|
|
7622
7645
|
|
|
7623
|
-
var version$1="1.52.
|
|
7646
|
+
var version$1="1.52.2-beta";var pkg = {version:version$1};
|
|
7624
7647
|
|
|
7625
7648
|
const { version } = pkg;
|
|
7626
7649
|
|
|
@@ -7793,7 +7816,7 @@ const ERROR_MESSAGE = {
|
|
|
7793
7816
|
SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
|
|
7794
7817
|
UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
|
|
7795
7818
|
INVALID_SPOTTER_DOCUMENTATION_URL: 'Invalid spotterDocumentationUrl. Please provide a valid http or https URL.',
|
|
7796
|
-
UPDATEFILTERS_INVALID_PAYLOAD: 'UpdateFilters requires a valid filter or filters array. Expected: { filter: {
|
|
7819
|
+
UPDATEFILTERS_INVALID_PAYLOAD: 'UpdateFilters requires a valid filter or filters array. Expected: { filter: { columnName, operator, values } } or { filters: [{ columnName, operator, values }, ...] }',
|
|
7797
7820
|
DRILLDOWN_INVALID_PAYLOAD: 'DrillDown requires a valid points object. Expected: { points: { clickedPoint?, selectedPoints? }, autoDrillDown?, vizId? }',
|
|
7798
7821
|
UPDATEPARAMETERS_INVALID_PAYLOAD: 'UpdateParameters received an invalid applicability. Expected: { level: LIVEBOARD | TAB | GROUP, targetId } where targetId is required for TAB and GROUP levels',
|
|
7799
7822
|
};
|
|
@@ -10756,7 +10779,7 @@ class AnswerService {
|
|
|
10756
10779
|
async getTML() {
|
|
10757
10780
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
10758
10781
|
const edoc = object[0].edoc;
|
|
10759
|
-
const YAML = await import('./index-
|
|
10782
|
+
const YAML = await import('./index-CcBYlGo9.js');
|
|
10760
10783
|
const parsedDoc = YAML.parse(edoc);
|
|
10761
10784
|
return {
|
|
10762
10785
|
answer: {
|
|
@@ -21665,7 +21688,8 @@ var isUndefined_1 = isUndefined;
|
|
|
21665
21688
|
const isValidApplicability = (a) => {
|
|
21666
21689
|
if (isUndefined_1(a))
|
|
21667
21690
|
return true;
|
|
21668
|
-
// targetId is not required at LIVEBOARD level, since the filter applies to
|
|
21691
|
+
// targetId is not required at LIVEBOARD level, since the filter applies to
|
|
21692
|
+
// the whole Liveboard
|
|
21669
21693
|
return isPlainObject_1(a)
|
|
21670
21694
|
&& Object.values(ApplicabilityLevel).includes(a.level)
|
|
21671
21695
|
&& (a.level === ApplicabilityLevel.Liveboard || (isString_1(a.targetId) && a.targetId.trim().length > 0));
|
|
@@ -21684,8 +21708,52 @@ function isValidUpdateFiltersPayload(payload) {
|
|
|
21684
21708
|
const hasValidFilters = Array.isArray(payload.filters) && payload.filters.length > 0 && payload.filters.every(isValidFilter);
|
|
21685
21709
|
return !!(hasValidFilter || hasValidFilters);
|
|
21686
21710
|
}
|
|
21711
|
+
/**
|
|
21712
|
+
* Rewrites one filter's `columnName`/`operator` to `column`/`oper`.
|
|
21713
|
+
*
|
|
21714
|
+
* Callers may use either spelling: `columnName`/`operator` match
|
|
21715
|
+
* {@link RuntimeFilter} and the `EmbedEvent.FilterChanged` payload, so a
|
|
21716
|
+
* converted payload can be replayed as-is. But the payload is forwarded to the
|
|
21717
|
+
* embedded app unchanged, and only `column`/`oper` are known to be understood
|
|
21718
|
+
* there - so the alias must be swapped here, or it would pass validation and
|
|
21719
|
+
* then be silently ignored.
|
|
21720
|
+
*
|
|
21721
|
+
* If a caller supplies both spellings of a field - which TypeScript rejects,
|
|
21722
|
+
* but JavaScript callers can still do - the documented `columnName`/`operator`
|
|
21723
|
+
* wins. Deferring to the deprecated spelling would quietly discard the value
|
|
21724
|
+
* the rest of the SDK tells people to use.
|
|
21725
|
+
* @param filter One entry from the UpdateFilters payload.
|
|
21726
|
+
*/
|
|
21727
|
+
function resolveFilterAliases(filter) {
|
|
21728
|
+
var _a, _b;
|
|
21729
|
+
if (!isPlainObject_1(filter))
|
|
21730
|
+
return filter;
|
|
21731
|
+
const column = (_a = filter.columnName) !== null && _a !== void 0 ? _a : filter.column;
|
|
21732
|
+
const oper = (_b = filter.operator) !== null && _b !== void 0 ? _b : filter.oper;
|
|
21733
|
+
const { columnName, operator, ...rest } = filter;
|
|
21734
|
+
return {
|
|
21735
|
+
...rest,
|
|
21736
|
+
...(isUndefined_1(column) ? {} : { column }),
|
|
21737
|
+
...(isUndefined_1(oper) ? {} : { oper }),
|
|
21738
|
+
};
|
|
21739
|
+
}
|
|
21740
|
+
/**
|
|
21741
|
+
* Rewrites every filter in an UpdateFilters payload to use `column`/`oper`,
|
|
21742
|
+
* whichever spelling the caller supplied. Call after validation.
|
|
21743
|
+
* @param payload The UpdateFilters host event payload.
|
|
21744
|
+
*/
|
|
21745
|
+
function resolveUpdateFiltersAliases(payload) {
|
|
21746
|
+
if (!isPlainObject_1(payload))
|
|
21747
|
+
return payload;
|
|
21748
|
+
return {
|
|
21749
|
+
...payload,
|
|
21750
|
+
...(payload.filter ? { filter: resolveFilterAliases(payload.filter) } : {}),
|
|
21751
|
+
...(Array.isArray(payload.filters) ? { filters: payload.filters.map(resolveFilterAliases) } : {}),
|
|
21752
|
+
};
|
|
21753
|
+
}
|
|
21687
21754
|
function isValidUpdateParametersPayload(payload) {
|
|
21688
|
-
// Only validates the applicability of each parameter (null treated as
|
|
21755
|
+
// Only validates the applicability of each parameter (null treated as
|
|
21756
|
+
// absent); the rest is forwarded as-is for backward compatibility.
|
|
21689
21757
|
if (!Array.isArray(payload))
|
|
21690
21758
|
return true;
|
|
21691
21759
|
return payload.every((p) => {
|
|
@@ -21733,7 +21801,8 @@ function throwUpdateParametersValidationError() {
|
|
|
21733
21801
|
/**
|
|
21734
21802
|
* Maps HostEvent to its corresponding UIPassthroughEvent.
|
|
21735
21803
|
* Includes both custom-handler events (Pin, SaveAnswer, UpdateFilters, DrillDown)
|
|
21736
|
-
* and getter events (GetAnswerSession, GetFilters, etc.) that use
|
|
21804
|
+
* and getter events (GetAnswerSession, GetFilters, etc.) that use
|
|
21805
|
+
* getDataWithPassthroughFallback.
|
|
21737
21806
|
*/
|
|
21738
21807
|
const PASSTHROUGH_MAP = {
|
|
21739
21808
|
// Custom handlers (setters with special logic)
|
|
@@ -21884,17 +21953,21 @@ class HostEventClient {
|
|
|
21884
21953
|
throwUpdateFiltersValidationError();
|
|
21885
21954
|
}
|
|
21886
21955
|
// The shared contract accepts both current (columnName/operator) and
|
|
21887
|
-
// legacy (column/oper) filter field names
|
|
21888
|
-
//
|
|
21889
|
-
//
|
|
21890
|
-
//
|
|
21891
|
-
|
|
21956
|
+
// legacy (column/oper) filter field names, but only the legacy pair is
|
|
21957
|
+
// understood downstream, so the payload is rewritten before it is
|
|
21958
|
+
// forwarded — otherwise a columnName/operator filter passes validation
|
|
21959
|
+
// here and is then silently ignored by the app. The cast bridges the
|
|
21960
|
+
// UIPassthrough FilterUpdate type, which still declares only the legacy
|
|
21961
|
+
// names.
|
|
21962
|
+
const resolvedPayload = resolveUpdateFiltersAliases(payload);
|
|
21963
|
+
return this.handleHostEventWithParam(UIPassthroughEvent.UpdateFilters, resolvedPayload, context);
|
|
21892
21964
|
}
|
|
21893
21965
|
handleUpdateParametersEvent(payload, context) {
|
|
21894
21966
|
if (!isValidUpdateParametersPayload(payload)) {
|
|
21895
21967
|
throwUpdateParametersValidationError();
|
|
21896
21968
|
}
|
|
21897
|
-
// UpdateParameters has no UI passthrough contract; dispatch over the
|
|
21969
|
+
// UpdateParameters has no UI passthrough contract; dispatch over the
|
|
21970
|
+
// legacy channel
|
|
21898
21971
|
return this.hostEventFallback(HostEvent.UpdateParameters, payload, context);
|
|
21899
21972
|
}
|
|
21900
21973
|
handleDrillDownEvent(payload, context) {
|
|
@@ -21905,8 +21978,8 @@ class HostEventClient {
|
|
|
21905
21978
|
}
|
|
21906
21979
|
/**
|
|
21907
21980
|
* Dispatches a host event using the appropriate channel:
|
|
21908
|
-
* 1. If the embedded app supports UI passthrough for this event, use it (custom
|
|
21909
|
-
* 2. Otherwise fall back to the legacy host event channel.
|
|
21981
|
+
* 1. If the embedded app supports UI passthrough for this event, use it (custom
|
|
21982
|
+
* handler or getter). 2. Otherwise fall back to the legacy host event channel.
|
|
21910
21983
|
*
|
|
21911
21984
|
* @param hostEvent - The host event to trigger
|
|
21912
21985
|
* @param payload - Optional payload for the event
|
|
@@ -21915,7 +21988,8 @@ class HostEventClient {
|
|
|
21915
21988
|
async triggerHostEvent(hostEvent, payload, context) {
|
|
21916
21989
|
const customHandler = this.customHandlers[hostEvent];
|
|
21917
21990
|
const passthroughEvent = PASSTHROUGH_MAP[hostEvent];
|
|
21918
|
-
// If embedded app supports passthrough but not this event, use legacy
|
|
21991
|
+
// If embedded app supports passthrough but not this event, use legacy
|
|
21992
|
+
// channel
|
|
21919
21993
|
const keys = passthroughEvent ? await this.getAvailableUIPassthroughKeys(context) : [];
|
|
21920
21994
|
if (passthroughEvent && keys.length > 0 && !keys.includes(passthroughEvent)) {
|
|
21921
21995
|
return this.hostEventFallback(hostEvent, payload, context);
|
|
@@ -22125,9 +22199,60 @@ const PRERENDER_WRAPPER_ID_PREFIX = 'tsEmbed-pre-render-wrapper-';
|
|
|
22125
22199
|
// The container applies UpdateEmbedParams through React state, so a delivered
|
|
22126
22200
|
// post is not the same as the params being in effect.
|
|
22127
22201
|
const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
|
|
22128
|
-
// The container ignores runtimeFilterParams/runtimeParameterParams unless
|
|
22129
|
-
// null or '' leaves the previous embed's values in place. '&' is
|
|
22202
|
+
// The container ignores runtimeFilterParams/runtimeParameterParams unless
|
|
22203
|
+
// truthy, so null or '' leaves the previous embed's values in place. '&' is
|
|
22204
|
+
// truthy and parses to {}.
|
|
22130
22205
|
const NO_RUNTIME_PARAMS = '&';
|
|
22206
|
+
/**
|
|
22207
|
+
* Query parameters that stay on the iframe `src` while config is excluded from
|
|
22208
|
+
* the URL, which is the default unless the embed sets the
|
|
22209
|
+
* `excludeConfigFromURL` additional flag to `false`. These are the parameters the
|
|
22210
|
+
* application shell needs before it can receive a postMessage at all: the
|
|
22211
|
+
* embed marker, the host application URL used to validate the message origin,
|
|
22212
|
+
* the SDK version, the flags that pick the authentication flow, and the
|
|
22213
|
+
* boot-time settings that would otherwise be applied a frame late (viewport,
|
|
22214
|
+
* log level, locale, formatting and org). Everything else is delivered over
|
|
22215
|
+
* `HostEvent.UpdateEmbedParams`.
|
|
22216
|
+
* @internal
|
|
22217
|
+
*/
|
|
22218
|
+
const BOOTSTRAP_URL_PARAMS = new Set([
|
|
22219
|
+
Param.EmbedApp,
|
|
22220
|
+
Param.HostAppUrl,
|
|
22221
|
+
Param.Version,
|
|
22222
|
+
Param.AuthType,
|
|
22223
|
+
Param.AutoLogin,
|
|
22224
|
+
Param.DisableLoginRedirect,
|
|
22225
|
+
Param.ForceSAMLAutoRedirect,
|
|
22226
|
+
Param.cookieless,
|
|
22227
|
+
Param.preAuthCache,
|
|
22228
|
+
Param.blockNonEmbedFullAppAccess,
|
|
22229
|
+
Param.OverrideOrgId,
|
|
22230
|
+
Param.ViewPortHeight,
|
|
22231
|
+
Param.ViewPortWidth,
|
|
22232
|
+
Param.ClientLogLevel,
|
|
22233
|
+
Param.OverrideNativeConsole,
|
|
22234
|
+
Param.PendoTrackingKey,
|
|
22235
|
+
Param.NumberFormatLocale,
|
|
22236
|
+
Param.DateFormatLocale,
|
|
22237
|
+
Param.CurrencyFormat,
|
|
22238
|
+
Param.Locale,
|
|
22239
|
+
Param.searchEmbed,
|
|
22240
|
+
Param.livedBoardEmbed,
|
|
22241
|
+
Param.isSpotterAgentEmbed,
|
|
22242
|
+
Param.SpotterEnabled,
|
|
22243
|
+
Param.IsFullAppEmbed,
|
|
22244
|
+
Param.IsOnBeforeGetVizDataInterceptEnabled,
|
|
22245
|
+
Param.LinkOverride,
|
|
22246
|
+
Param.EnableLinkOverridesV2,
|
|
22247
|
+
Param.DisableRedirectionLinksInNewTab,
|
|
22248
|
+
Param.OverrideHistoryState,
|
|
22249
|
+
Param.ForceTable,
|
|
22250
|
+
Param.StringIDsUrl,
|
|
22251
|
+
Param.DataSources,
|
|
22252
|
+
Param.ExposeTranslationIDs,
|
|
22253
|
+
Param.IconSpriteUrl,
|
|
22254
|
+
Param.Tag,
|
|
22255
|
+
]);
|
|
22131
22256
|
/**
|
|
22132
22257
|
* The event id map from v2 event names to v1 event id
|
|
22133
22258
|
* v1 events are the classic embed events implemented in Blink v1
|
|
@@ -22324,15 +22449,20 @@ class TsEmbed {
|
|
|
22324
22449
|
const AUTH_INIT_FALLBACK_DELAY = 1000;
|
|
22325
22450
|
// Wait for 1 second to ensure the embed container is loaded
|
|
22326
22451
|
// This is a workaround to ensure the embed container is loaded
|
|
22327
|
-
// this is needed until all clusters have EmbedListenerReady
|
|
22452
|
+
// this is needed until all clusters have EmbedListenerReady
|
|
22453
|
+
// event
|
|
22328
22454
|
setTimeout(processEmbedContainerReady, AUTH_INIT_FALLBACK_DELAY);
|
|
22329
22455
|
}
|
|
22330
22456
|
else if (source === EmbedEvent.EmbedListenerReady) {
|
|
22331
22457
|
processEmbedContainerReady();
|
|
22458
|
+
if (this.isConfigExcludedFromUrl()) {
|
|
22459
|
+
this.triggerUpdateEmbedParams();
|
|
22460
|
+
}
|
|
22332
22461
|
}
|
|
22333
22462
|
};
|
|
22334
22463
|
// Subclasses that navigate the pre-render on show must await this before
|
|
22335
|
-
// triggering Navigate. Resolves even on failure, so navigation is never
|
|
22464
|
+
// triggering Navigate. Resolves even on failure, so navigation is never
|
|
22465
|
+
// blocked.
|
|
22336
22466
|
this.preRenderParamsApplied = Promise.resolve();
|
|
22337
22467
|
this.hostElement = getDOMNode(domSelector);
|
|
22338
22468
|
this.eventHandlerMap = new Map();
|
|
@@ -22662,8 +22792,9 @@ class TsEmbed {
|
|
|
22662
22792
|
...this.viewConfig,
|
|
22663
22793
|
...queryParams,
|
|
22664
22794
|
...appInitData,
|
|
22665
|
-
// A show cycle has no URL to carry these, so the payload always
|
|
22666
|
-
// — including "none", which is the case that leaks the
|
|
22795
|
+
// A show cycle has no URL to carry these, so the payload always
|
|
22796
|
+
// states them — including "none", which is the case that leaks the
|
|
22797
|
+
// previous filters.
|
|
22667
22798
|
runtimeFilterParams: getFilterQuery((_a = this.viewConfig.runtimeFilters) !== null && _a !== void 0 ? _a : []) || NO_RUNTIME_PARAMS,
|
|
22668
22799
|
runtimeParameterParams: getRuntimeParameters((_b = this.viewConfig.runtimeParameters) !== null && _b !== void 0 ? _b : [])
|
|
22669
22800
|
|| NO_RUNTIME_PARAMS,
|
|
@@ -22831,13 +22962,20 @@ class TsEmbed {
|
|
|
22831
22962
|
return path;
|
|
22832
22963
|
}
|
|
22833
22964
|
getEmbedParams() {
|
|
22834
|
-
const queryParams = this.
|
|
22965
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
22835
22966
|
return getQueryParamString(queryParams);
|
|
22836
22967
|
}
|
|
22837
22968
|
getEmbedParamsObject() {
|
|
22838
22969
|
const params = this.getBaseQueryParams();
|
|
22839
22970
|
return params;
|
|
22840
22971
|
}
|
|
22972
|
+
getUrlQueryParamsObject() {
|
|
22973
|
+
const queryParams = this.getEmbedParamsObject();
|
|
22974
|
+
if (!this.isConfigExcludedFromUrl()) {
|
|
22975
|
+
return queryParams;
|
|
22976
|
+
}
|
|
22977
|
+
return Object.fromEntries(Object.entries(queryParams).filter(([key]) => BOOTSTRAP_URL_PARAMS.has(key)));
|
|
22978
|
+
}
|
|
22841
22979
|
getRootIframeSrc() {
|
|
22842
22980
|
const query = this.getEmbedParams();
|
|
22843
22981
|
return this.getEmbedBasePath(query);
|
|
@@ -23390,8 +23528,9 @@ class TsEmbed {
|
|
|
23390
23528
|
return;
|
|
23391
23529
|
this.preRenderWrapper[this.embedNodeKey] = this;
|
|
23392
23530
|
}
|
|
23393
|
-
// The flag lives on the wrapper because it describes the iframe: an
|
|
23394
|
-
// hidden when the container announced itself would otherwise
|
|
23531
|
+
// The flag lives on the wrapper because it describes the iframe: an
|
|
23532
|
+
// instance hidden when the container announced itself would otherwise
|
|
23533
|
+
// report false forever.
|
|
23395
23534
|
markEmbedContainerLoaded() {
|
|
23396
23535
|
this.isEmbedContainerLoaded = true;
|
|
23397
23536
|
if (this.preRenderWrapper) {
|
|
@@ -23744,6 +23883,27 @@ class TsEmbed {
|
|
|
23744
23883
|
this.isRendered = true;
|
|
23745
23884
|
return this.renderIFrame(prerenderFrameSrc);
|
|
23746
23885
|
}
|
|
23886
|
+
isConfigExcludedFromUrl() {
|
|
23887
|
+
var _a, _b, _c;
|
|
23888
|
+
const flag = (_b = (_a = this.viewConfig.additionalFlags) === null || _a === void 0 ? void 0 : _a.excludeConfigFromURL) !== null && _b !== void 0 ? _b : (_c = this.embedConfig.additionalFlags) === null || _c === void 0 ? void 0 : _c.excludeConfigFromURL;
|
|
23889
|
+
// Enabled by default; only an explicit false opts out.
|
|
23890
|
+
return flag !== false && flag !== 'false';
|
|
23891
|
+
}
|
|
23892
|
+
async triggerUpdateEmbedParams() {
|
|
23893
|
+
try {
|
|
23894
|
+
const params = await this.getUpdateEmbedParamsObject();
|
|
23895
|
+
this.trigger(HostEvent.UpdateEmbedParams, params);
|
|
23896
|
+
}
|
|
23897
|
+
catch (error) {
|
|
23898
|
+
logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
|
|
23899
|
+
this.handleError({
|
|
23900
|
+
errorType: ErrorDetailsTypes.API,
|
|
23901
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
|
|
23902
|
+
code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
|
|
23903
|
+
error: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
23904
|
+
});
|
|
23905
|
+
}
|
|
23906
|
+
}
|
|
23747
23907
|
beforePrerenderVisible() {
|
|
23748
23908
|
// We can ignore this as its a bit expensive and the newer customers
|
|
23749
23909
|
// have moved on to UpdateEmbedParams supported clusters
|
|
@@ -23754,17 +23914,7 @@ class TsEmbed {
|
|
|
23754
23914
|
this.preRenderParamsApplied = new Promise((resolve) => {
|
|
23755
23915
|
this.executeAfterEmbedContainerLoaded(async () => {
|
|
23756
23916
|
try {
|
|
23757
|
-
|
|
23758
|
-
this.trigger(HostEvent.UpdateEmbedParams, params);
|
|
23759
|
-
}
|
|
23760
|
-
catch (error) {
|
|
23761
|
-
logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
|
|
23762
|
-
this.handleError({
|
|
23763
|
-
errorType: ErrorDetailsTypes.API,
|
|
23764
|
-
message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
|
|
23765
|
-
code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
|
|
23766
|
-
error: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
23767
|
-
});
|
|
23917
|
+
await this.triggerUpdateEmbedParams();
|
|
23768
23918
|
}
|
|
23769
23919
|
finally {
|
|
23770
23920
|
setTimeout(resolve, UPDATE_EMBED_PARAMS_SETTLE_MS);
|
|
@@ -23799,8 +23949,9 @@ class TsEmbed {
|
|
|
23799
23949
|
if (this.hostElement) {
|
|
23800
23950
|
this.insertedDomEl = this.createPreRenderPlaceholder();
|
|
23801
23951
|
if (this.viewConfig.fullHeight) {
|
|
23802
|
-
// If fullHeight has already sized the wrapper, seed the
|
|
23803
|
-
// with the same height so syncPreRenderStyle gets
|
|
23952
|
+
// If fullHeight has already sized the wrapper, seed the
|
|
23953
|
+
// placeholder with the same height so syncPreRenderStyle gets
|
|
23954
|
+
// an accurate rect.
|
|
23804
23955
|
const existingHeight = this.preRenderWrapper.style.height;
|
|
23805
23956
|
if (existingHeight) {
|
|
23806
23957
|
this.insertedDomEl.style.height = existingHeight;
|
|
@@ -23808,12 +23959,13 @@ class TsEmbed {
|
|
|
23808
23959
|
}
|
|
23809
23960
|
const placeHolderId = this.getPreRenderIds().placeHolder;
|
|
23810
23961
|
// Remove any stale placeholder from a previous cycle. It is located
|
|
23811
|
-
// via a subtree-wide querySelector, so it may be nested deeper
|
|
23812
|
-
// direct child (E.g.: with fullHeight the host app can wrap
|
|
23813
|
-
// Element.remove() — which detaches from whatever the real
|
|
23814
|
-
// rather than hostElement.removeChild(), which throws
|
|
23815
|
-
// when the match is not a direct child. Mirrors the
|
|
23816
|
-
// cleanup in
|
|
23962
|
+
// via a subtree-wide querySelector, so it may be nested deeper
|
|
23963
|
+
// than a direct child (E.g.: with fullHeight the host app can wrap
|
|
23964
|
+
// it). Use Element.remove() — which detaches from whatever the real
|
|
23965
|
+
// parent is — rather than hostElement.removeChild(), which throws
|
|
23966
|
+
// NotFoundError when the match is not a direct child. Mirrors the
|
|
23967
|
+
// wrapper/child cleanup in
|
|
23968
|
+
// createPreRenderWrapper()/createPreRenderChild().
|
|
23817
23969
|
(_a = this.hostElement.querySelector(`#${placeHolderId}`)) === null || _a === void 0 ? void 0 : _a.remove();
|
|
23818
23970
|
this.hostElement.appendChild(this.insertedDomEl);
|
|
23819
23971
|
this.syncPreRenderStyle();
|
|
@@ -23845,7 +23997,8 @@ class TsEmbed {
|
|
|
23845
23997
|
if (this.iFrame) {
|
|
23846
23998
|
this.setupFullscreenChangeHandler();
|
|
23847
23999
|
}
|
|
23848
|
-
// Last, so everything above still sees the instance being taken over
|
|
24000
|
+
// Last, so everything above still sees the instance being taken over
|
|
24001
|
+
// from.
|
|
23849
24002
|
this.takeOverPreRender();
|
|
23850
24003
|
return this;
|
|
23851
24004
|
}
|
|
@@ -24132,6 +24285,18 @@ function buildStarterPromptsAppInitData(initData, viewConfig) {
|
|
|
24132
24285
|
starterPrompts,
|
|
24133
24286
|
},
|
|
24134
24287
|
};
|
|
24288
|
+
}
|
|
24289
|
+
function buildSpotterAnalystAppInitData(initData, viewConfig) {
|
|
24290
|
+
const { spotterAnalystConfig } = viewConfig;
|
|
24291
|
+
if (!(spotterAnalystConfig === null || spotterAnalystConfig === void 0 ? void 0 : spotterAnalystConfig.analystId))
|
|
24292
|
+
return initData;
|
|
24293
|
+
return {
|
|
24294
|
+
...initData,
|
|
24295
|
+
embedParams: {
|
|
24296
|
+
...(initData.embedParams || {}),
|
|
24297
|
+
spotterAnalystConfig,
|
|
24298
|
+
},
|
|
24299
|
+
};
|
|
24135
24300
|
}
|
|
24136
24301
|
|
|
24137
24302
|
function buildSpotterVizAppInitData(initData, viewConfig) {
|
|
@@ -24329,7 +24494,7 @@ class AppEmbed extends V1Embed {
|
|
|
24329
24494
|
* embedded Liveboard or visualization.
|
|
24330
24495
|
*/
|
|
24331
24496
|
getEmbedParams() {
|
|
24332
|
-
const params = this.
|
|
24497
|
+
const params = this.getUrlQueryParamsObject();
|
|
24333
24498
|
return getQueryParamString(params, true);
|
|
24334
24499
|
}
|
|
24335
24500
|
getEmbedParamsObject() {
|
|
@@ -24725,8 +24890,9 @@ const addPreviewStylesIfNotPresent = () => {
|
|
|
24725
24890
|
* @summary Liveboard & visualization embed
|
|
24726
24891
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
24727
24892
|
*/
|
|
24728
|
-
// Home unmounts the liveboard container, which is how its state gets cleared.
|
|
24729
|
-
// settle window gives the container time to do it before we ask for the
|
|
24893
|
+
// Home unmounts the liveboard container, which is how its state gets cleared.
|
|
24894
|
+
// The settle window gives the container time to do it before we ask for the
|
|
24895
|
+
// liveboard back.
|
|
24730
24896
|
const HOME_ROUTE = 'home';
|
|
24731
24897
|
const HOME_SETTLE_MS = 200;
|
|
24732
24898
|
/**
|
|
@@ -24786,7 +24952,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
24786
24952
|
* embedded Liveboard or visualization.
|
|
24787
24953
|
*/
|
|
24788
24954
|
getEmbedParams() {
|
|
24789
|
-
const params = this.
|
|
24955
|
+
const params = this.getUrlQueryParamsObject();
|
|
24790
24956
|
const queryParams = getQueryParamString(params, true);
|
|
24791
24957
|
return queryParams;
|
|
24792
24958
|
}
|
|
@@ -25024,21 +25190,24 @@ class LiveboardEmbed extends V1Embed {
|
|
|
25024
25190
|
}
|
|
25025
25191
|
beforePrerenderVisible() {
|
|
25026
25192
|
super.beforePrerenderVisible();
|
|
25027
|
-
// Captured before showPreRender() hands the wrapper over to this
|
|
25028
|
-
// Itself means a hide/show, not a hand-over, so there is
|
|
25193
|
+
// Captured before showPreRender() hands the wrapper over to this
|
|
25194
|
+
// instance. Itself means a hide/show, not a hand-over, so there is
|
|
25195
|
+
// nothing stale to clear.
|
|
25029
25196
|
const previous = this.getPreRenderObj();
|
|
25030
25197
|
const showing = previous === this ? undefined : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
|
|
25031
25198
|
this.executeAfterEmbedContainerLoaded(async () => {
|
|
25032
|
-
// Without this the params callback suspends on its await and
|
|
25033
|
-
// goes out first, so the container loads with the previous
|
|
25199
|
+
// Without this the params callback suspends on its await and
|
|
25200
|
+
// Navigate goes out first, so the container loads with the previous
|
|
25201
|
+
// config's filters.
|
|
25034
25202
|
await this.preRenderParamsApplied;
|
|
25035
25203
|
if (this.isShowingLiveboardRoute(showing)) {
|
|
25036
|
-
// Navigate to the route we are already on is a no-op, so the
|
|
25037
|
-
// keeps its state. Home unmounts the container, which
|
|
25204
|
+
// Navigate to the route we are already on is a no-op, so the
|
|
25205
|
+
// liveboard keeps its state. Home unmounts the container, which
|
|
25206
|
+
// clears it.
|
|
25038
25207
|
this.trigger(HostEvent.Navigate, HOME_ROUTE)
|
|
25039
25208
|
.catch((error) => logger$3.warn('Could not route via home', error));
|
|
25040
|
-
// Not awaited above: the container never acks Navigate, so
|
|
25041
|
-
// only settles on the 30s trigger timeout.
|
|
25209
|
+
// Not awaited above: the container never acks Navigate, so
|
|
25210
|
+
// that promise only settles on the 30s trigger timeout.
|
|
25042
25211
|
await new Promise((resolve) => {
|
|
25043
25212
|
setTimeout(resolve, HOME_SETTLE_MS);
|
|
25044
25213
|
});
|
|
@@ -25052,8 +25221,9 @@ class LiveboardEmbed extends V1Embed {
|
|
|
25052
25221
|
};
|
|
25053
25222
|
});
|
|
25054
25223
|
}
|
|
25055
|
-
// The whole route, not just the liveboard id: the path is built from the
|
|
25056
|
-
// and view too, so a same-liveboard show onto another tab is a
|
|
25224
|
+
// The whole route, not just the liveboard id: the path is built from the
|
|
25225
|
+
// viz, tab and view too, so a same-liveboard show onto another tab is a
|
|
25226
|
+
// real navigation.
|
|
25057
25227
|
isShowingLiveboardRoute(showing) {
|
|
25058
25228
|
if (!(showing === null || showing === void 0 ? void 0 : showing.liveboardId))
|
|
25059
25229
|
return false;
|
|
@@ -25313,7 +25483,7 @@ class SearchEmbed extends TsEmbed {
|
|
|
25313
25483
|
}
|
|
25314
25484
|
getEmbedParams() {
|
|
25315
25485
|
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
25316
|
-
const queryParams = this.
|
|
25486
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
25317
25487
|
let query = '';
|
|
25318
25488
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
25319
25489
|
if (queryParamsString) {
|
|
@@ -25401,7 +25571,7 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
25401
25571
|
* @param dataSources A list of data source GUIDs
|
|
25402
25572
|
*/
|
|
25403
25573
|
getIFrameSrc() {
|
|
25404
|
-
const queryParams = this.
|
|
25574
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
25405
25575
|
const path = 'search-bar-embed';
|
|
25406
25576
|
let query = '';
|
|
25407
25577
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
@@ -25835,7 +26005,7 @@ class ConversationMessage extends TsEmbed {
|
|
|
25835
26005
|
getIframeSrc() {
|
|
25836
26006
|
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
25837
26007
|
const path = 'conv-assist-answer';
|
|
25838
|
-
const queryParams = this.
|
|
26008
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
25839
26009
|
let query = '';
|
|
25840
26010
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
25841
26011
|
if (queryParamsString) {
|
|
@@ -26003,10 +26173,11 @@ class SpotterEmbed extends TsEmbed {
|
|
|
26003
26173
|
const defaultAppInitData = await super.getAppInitData();
|
|
26004
26174
|
const sidebarInitData = buildSpotterSidebarAppInitData(defaultAppInitData, this.viewConfig, this.handleError.bind(this));
|
|
26005
26175
|
const shareInitData = buildSpotterShareConversationAppInitData(sidebarInitData, this.viewConfig);
|
|
26006
|
-
|
|
26176
|
+
const starterPromptsInitData = buildStarterPromptsAppInitData(shareInitData, this.viewConfig);
|
|
26177
|
+
return buildSpotterAnalystAppInitData(starterPromptsInitData, this.viewConfig);
|
|
26007
26178
|
}
|
|
26008
26179
|
getEmbedParamsObject() {
|
|
26009
|
-
const { searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, updatedSpotterExperience, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig,
|
|
26180
|
+
const { searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, updatedSpotterExperience, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig, } = this.viewConfig;
|
|
26010
26181
|
const queryParams = this.getBaseQueryParams();
|
|
26011
26182
|
queryParams[Param.SpotterEnabled] = true;
|
|
26012
26183
|
// Boolean params
|
|
@@ -26019,7 +26190,6 @@ class SpotterEmbed extends TsEmbed {
|
|
|
26019
26190
|
setParamIfDefined(queryParams, Param.ShowSpotterRadiance, showSpotterRadiance, true);
|
|
26020
26191
|
setParamIfDefined(queryParams, Param.DefaultQueryMode, defaultQueryMode);
|
|
26021
26192
|
setParamIfDefined(queryParams, Param.EnableStopAnswerGenerationEmbed, enableStopAnswerGenerationEmbed, true);
|
|
26022
|
-
setParamIfDefined(queryParams, Param.AnalystId, spotterAnalystConfig === null || spotterAnalystConfig === void 0 ? void 0 : spotterAnalystConfig.analystId);
|
|
26023
26193
|
// Handle spotterChatConfig params
|
|
26024
26194
|
if (spotterChatConfig) {
|
|
26025
26195
|
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, spotterFileUploadEnabled, spotterFileUploadFileTypes, enableStarterPrompts, } = spotterChatConfig;
|
|
@@ -26043,7 +26213,7 @@ class SpotterEmbed extends TsEmbed {
|
|
|
26043
26213
|
const path = sharedConversationId
|
|
26044
26214
|
? `insights/conv-assist/s/${encodeURIComponent(sharedConversationId)}`
|
|
26045
26215
|
: 'insights/conv-assist';
|
|
26046
|
-
const queryParams = this.
|
|
26216
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
26047
26217
|
let query = '';
|
|
26048
26218
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
26049
26219
|
if (queryParamsString) {
|
|
@@ -26626,6 +26796,213 @@ const createLiveboardWithAnswers = async (answers, name) => {
|
|
|
26626
26796
|
return result;
|
|
26627
26797
|
};
|
|
26628
26798
|
|
|
26799
|
+
/**
|
|
26800
|
+
* Copyright (c) 2026
|
|
26801
|
+
*
|
|
26802
|
+
* Utility to convert the payload emitted by `EmbedEvent.FilterChanged`
|
|
26803
|
+
* into the payload shape expected by `HostEvent.UpdateFilters`, so that
|
|
26804
|
+
* the current filter state of a Liveboard can be captured and re-applied
|
|
26805
|
+
* later without having to hand-parse the event payload.
|
|
26806
|
+
* @summary Filter payload converter
|
|
26807
|
+
*/
|
|
26808
|
+
/**
|
|
26809
|
+
* Coerces an epoch/count field to a number, returning `null` when the value is
|
|
26810
|
+
* absent or not a finite number. The payload arrives as JSON from the iframe,
|
|
26811
|
+
* so a missing field can be `null` as well as `undefined`, and `Number(null)`
|
|
26812
|
+
* or `Number('')` would otherwise silently become a valid-looking `0`
|
|
26813
|
+
* (i.e. the Unix epoch, or a zero-length period).
|
|
26814
|
+
* @param value Raw value from the date filter payload.
|
|
26815
|
+
*/
|
|
26816
|
+
function toFiniteNumber(value) {
|
|
26817
|
+
if (isNil_1(value) || value === '')
|
|
26818
|
+
return null;
|
|
26819
|
+
const numericValue = Number(value);
|
|
26820
|
+
return Number.isFinite(numericValue) ? numericValue : null;
|
|
26821
|
+
}
|
|
26822
|
+
const DATE_FILTER_VALUE_EXTRACTORS = {
|
|
26823
|
+
EXACT_DATE: (dateFilter) => {
|
|
26824
|
+
const epoch = toFiniteNumber(dateFilter.epoch);
|
|
26825
|
+
return epoch === null ? [] : [epoch];
|
|
26826
|
+
},
|
|
26827
|
+
EXACT_DATE_RANGE: (dateFilter) => {
|
|
26828
|
+
var _a;
|
|
26829
|
+
const { lowEpoch, highEpoch } = (_a = dateFilter.dateRange) !== null && _a !== void 0 ? _a : {};
|
|
26830
|
+
const low = toFiniteNumber(lowEpoch);
|
|
26831
|
+
const high = toFiniteNumber(highEpoch);
|
|
26832
|
+
return low === null || high === null ? [] : [low, high];
|
|
26833
|
+
},
|
|
26834
|
+
MONTH_YEAR: (dateFilter) => (dateFilter.monthName && dateFilter.yearName
|
|
26835
|
+
? [dateFilter.monthName, dateFilter.yearName]
|
|
26836
|
+
: []),
|
|
26837
|
+
QUARTER_YEAR: (dateFilter) => (dateFilter.quarterName && dateFilter.yearName
|
|
26838
|
+
? [dateFilter.quarterName, dateFilter.yearName]
|
|
26839
|
+
: []),
|
|
26840
|
+
YEAR_ONLY: (dateFilter) => (dateFilter.yearName ? [dateFilter.yearName] : []),
|
|
26841
|
+
LAST_N_PERIOD: (dateFilter) => {
|
|
26842
|
+
const count = toFiniteNumber(dateFilter.number);
|
|
26843
|
+
return count === null ? [] : [count];
|
|
26844
|
+
},
|
|
26845
|
+
NEXT_N_PERIOD: (dateFilter) => {
|
|
26846
|
+
const count = toFiniteNumber(dateFilter.number);
|
|
26847
|
+
return count === null ? [] : [count];
|
|
26848
|
+
},
|
|
26849
|
+
};
|
|
26850
|
+
// Date filter types with no `values` (e.g. TODAY needs no operand).
|
|
26851
|
+
const PERIOD_ONLY_DATE_FILTER_TYPES = new Set([
|
|
26852
|
+
'THIS_PERIOD', 'PERIOD_TO_DATE', 'TODAY', 'YESTERDAY', 'TOMORROW',
|
|
26853
|
+
]);
|
|
26854
|
+
function convertDateFilterToParam(columnName, dateFilterContent) {
|
|
26855
|
+
var _a;
|
|
26856
|
+
const dateFilter = dateFilterContent === null || dateFilterContent === void 0 ? void 0 : dateFilterContent.dateFilter;
|
|
26857
|
+
if (!(dateFilter === null || dateFilter === void 0 ? void 0 : dateFilter.type))
|
|
26858
|
+
return null;
|
|
26859
|
+
let values;
|
|
26860
|
+
const getValues = DATE_FILTER_VALUE_EXTRACTORS[dateFilter.type];
|
|
26861
|
+
if (getValues) {
|
|
26862
|
+
values = getValues(dateFilter);
|
|
26863
|
+
// Required fields (e.g. epoch, yearName) are missing - the source data
|
|
26864
|
+
// can't be reconstructed faithfully, so skip rather than emit a filter
|
|
26865
|
+
// that would clear/corrupt this column when re-applied.
|
|
26866
|
+
if (values.length === 0)
|
|
26867
|
+
return null;
|
|
26868
|
+
}
|
|
26869
|
+
else if (PERIOD_ONLY_DATE_FILTER_TYPES.has(dateFilter.type)) {
|
|
26870
|
+
values = [];
|
|
26871
|
+
}
|
|
26872
|
+
else {
|
|
26873
|
+
// Unrecognized date filter type - skip rather than guess.
|
|
26874
|
+
return null;
|
|
26875
|
+
}
|
|
26876
|
+
const param = {
|
|
26877
|
+
columnName,
|
|
26878
|
+
operator: (_a = dateFilter.op) !== null && _a !== void 0 ? _a : RuntimeFilterOp.EQ,
|
|
26879
|
+
values,
|
|
26880
|
+
type: dateFilter.type,
|
|
26881
|
+
};
|
|
26882
|
+
if (dateFilter.datePeriod) {
|
|
26883
|
+
param.datePeriod = dateFilter.datePeriod;
|
|
26884
|
+
}
|
|
26885
|
+
if (!isNil_1(dateFilter.includeCurrentPeriod)) {
|
|
26886
|
+
param.includeCurrentPeriod = dateFilter.includeCurrentPeriod;
|
|
26887
|
+
}
|
|
26888
|
+
if (dateFilterContent.negate) {
|
|
26889
|
+
param.negate = true;
|
|
26890
|
+
}
|
|
26891
|
+
return param;
|
|
26892
|
+
}
|
|
26893
|
+
function convertFilterContentToParam(columnName, filterContent) {
|
|
26894
|
+
var _a;
|
|
26895
|
+
if (!(filterContent === null || filterContent === void 0 ? void 0 : filterContent.filterType))
|
|
26896
|
+
return null;
|
|
26897
|
+
const values = ((_a = filterContent.value) !== null && _a !== void 0 ? _a : [])
|
|
26898
|
+
.map((value) => value === null || value === void 0 ? void 0 : value.key)
|
|
26899
|
+
.filter((value) => !isNil_1(value));
|
|
26900
|
+
const param = {
|
|
26901
|
+
columnName,
|
|
26902
|
+
operator: filterContent.filterType,
|
|
26903
|
+
values,
|
|
26904
|
+
};
|
|
26905
|
+
if (filterContent.negate) {
|
|
26906
|
+
param.negate = true;
|
|
26907
|
+
}
|
|
26908
|
+
return param;
|
|
26909
|
+
}
|
|
26910
|
+
function convertFilterToParams(columnName, filter) {
|
|
26911
|
+
var _a, _b;
|
|
26912
|
+
const dateParams = ((_a = filter === null || filter === void 0 ? void 0 : filter.dateFilterContent) !== null && _a !== void 0 ? _a : [])
|
|
26913
|
+
.map((dateFilterContent) => convertDateFilterToParam(columnName, dateFilterContent));
|
|
26914
|
+
const contentParams = ((_b = filter === null || filter === void 0 ? void 0 : filter.filterContent) !== null && _b !== void 0 ? _b : [])
|
|
26915
|
+
.map((filterContent) => convertFilterContentToParam(columnName, filterContent));
|
|
26916
|
+
return [...dateParams, ...contentParams]
|
|
26917
|
+
.filter((param) => param !== null);
|
|
26918
|
+
}
|
|
26919
|
+
/**
|
|
26920
|
+
* Runtime filters need no reshaping, but they still come off the wire as JSON,
|
|
26921
|
+
* so a malformed entry is possible. Skip it rather than pass it through: an
|
|
26922
|
+
* entry missing a column, operator or values array fails
|
|
26923
|
+
* `isValidUpdateFiltersPayload`, and that rejects the *whole* `filters` array,
|
|
26924
|
+
* so one bad runtime filter would drop every other converted filter with it.
|
|
26925
|
+
* @param runtimeFilter A runtime filter from the `FilterChanged` payload.
|
|
26926
|
+
*/
|
|
26927
|
+
function convertRuntimeFilterToParam(runtimeFilter) {
|
|
26928
|
+
const { columnName, operator, values } = runtimeFilter !== null && runtimeFilter !== void 0 ? runtimeFilter : {};
|
|
26929
|
+
if (typeof columnName !== 'string' || !columnName)
|
|
26930
|
+
return null;
|
|
26931
|
+
if (typeof operator !== 'string' || !operator)
|
|
26932
|
+
return null;
|
|
26933
|
+
if (!Array.isArray(values))
|
|
26934
|
+
return null;
|
|
26935
|
+
return { columnName, operator, values };
|
|
26936
|
+
}
|
|
26937
|
+
/**
|
|
26938
|
+
* Mirrors `isValidApplicability` in `hostEventClient/utils`: a `TAB` or `GROUP`
|
|
26939
|
+
* scope is meaningless without a `targetId`, and `UpdateFilters` rejects the
|
|
26940
|
+
* whole `filters` array when any entry carries a malformed `applicability`.
|
|
26941
|
+
* @param applicability Scope taken from the `FilterChanged` payload.
|
|
26942
|
+
*/
|
|
26943
|
+
function isUsableApplicability(applicability) {
|
|
26944
|
+
const levels = Object.values(ApplicabilityLevel);
|
|
26945
|
+
if (!levels.includes(applicability.level))
|
|
26946
|
+
return false;
|
|
26947
|
+
if (applicability.level === ApplicabilityLevel.Liveboard)
|
|
26948
|
+
return true;
|
|
26949
|
+
return typeof applicability.targetId === 'string' && applicability.targetId.trim().length > 0;
|
|
26950
|
+
}
|
|
26951
|
+
function convertFilterGroupToParams(filterGroup) {
|
|
26952
|
+
var _a, _b;
|
|
26953
|
+
const columnName = (_a = filterGroup === null || filterGroup === void 0 ? void 0 : filterGroup.columnInfo) === null || _a === void 0 ? void 0 : _a.name;
|
|
26954
|
+
if (!columnName)
|
|
26955
|
+
return [];
|
|
26956
|
+
const { applicability } = filterGroup;
|
|
26957
|
+
// A filter scoped to a tab or group has to keep that scope. Replaying it
|
|
26958
|
+
// without `applicability` would silently widen it to the whole Liveboard,
|
|
26959
|
+
// changing what every other tab shows. If a scope is present but unusable,
|
|
26960
|
+
// skip the filter: widening is worse than dropping, and a malformed
|
|
26961
|
+
// applicability would fail validation for every other filter alongside it.
|
|
26962
|
+
if (!isNil_1(applicability) && !isUsableApplicability(applicability))
|
|
26963
|
+
return [];
|
|
26964
|
+
const params = ((_b = filterGroup.filters) !== null && _b !== void 0 ? _b : [])
|
|
26965
|
+
.flatMap((filter) => convertFilterToParams(columnName, filter));
|
|
26966
|
+
return isNil_1(applicability) ? params : params.map((param) => ({ ...param, applicability }));
|
|
26967
|
+
}
|
|
26968
|
+
/**
|
|
26969
|
+
* Converts the payload emitted by {@link EmbedEvent.FilterChanged} into the
|
|
26970
|
+
* payload shape expected by {@link HostEvent.UpdateFilters}, so the same
|
|
26971
|
+
* filter state can be captured and re-applied later, for example on a
|
|
26972
|
+
* subsequent page load.
|
|
26973
|
+
*
|
|
26974
|
+
* Both the Liveboard filters and the runtime filters present in the
|
|
26975
|
+
* `FilterChanged` payload are included in the returned `filters` array.
|
|
26976
|
+
*
|
|
26977
|
+
* Note: a column with multiple date-filter conditions (e.g. an OR of two
|
|
26978
|
+
* date ranges) is not guaranteed to round-trip losslessly - `HostEvent.UpdateFilters`
|
|
26979
|
+
* treats date filters as replace-not-merge per column, so only the last
|
|
26980
|
+
* converted entry for such a column will apply.
|
|
26981
|
+
* @param filterChangedPayload The filter state carried by the
|
|
26982
|
+
* `EmbedEvent.FilterChanged` callback, which is `payload.data` - the
|
|
26983
|
+
* callback argument is the event envelope, and the filters sit under its
|
|
26984
|
+
* `data` key.
|
|
26985
|
+
* @example
|
|
26986
|
+
* ```js
|
|
26987
|
+
* let savedFilters;
|
|
26988
|
+
* liveboardEmbed.on(EmbedEvent.FilterChanged, (payload) => {
|
|
26989
|
+
* savedFilters = convertFilterChangedToUpdateFiltersPayload(payload.data);
|
|
26990
|
+
* });
|
|
26991
|
+
*
|
|
26992
|
+
* // later, e.g. after a fresh page load
|
|
26993
|
+
* liveboardEmbed.trigger(HostEvent.UpdateFilters, savedFilters);
|
|
26994
|
+
* ```
|
|
26995
|
+
*/
|
|
26996
|
+
function convertFilterChangedToUpdateFiltersPayload(filterChangedPayload) {
|
|
26997
|
+
var _a, _b;
|
|
26998
|
+
const liveboardFilterParams = ((_a = filterChangedPayload === null || filterChangedPayload === void 0 ? void 0 : filterChangedPayload.liveboardFilters) !== null && _a !== void 0 ? _a : [])
|
|
26999
|
+
.flatMap(convertFilterGroupToParams);
|
|
27000
|
+
const runtimeFilterParams = ((_b = filterChangedPayload === null || filterChangedPayload === void 0 ? void 0 : filterChangedPayload.runtimeFilters) !== null && _b !== void 0 ? _b : [])
|
|
27001
|
+
.map(convertRuntimeFilterToParam)
|
|
27002
|
+
.filter((param) => param !== null);
|
|
27003
|
+
return { filters: [...liveboardFilterParams, ...runtimeFilterParams] };
|
|
27004
|
+
}
|
|
27005
|
+
|
|
26629
27006
|
/**
|
|
26630
27007
|
* Starts an automatic renderer that watches the DOM for iframes containing
|
|
26631
27008
|
* the `tsmcp=true` query parameter and replaces them with fully configured
|
|
@@ -26724,7 +27101,7 @@ class AutoFrameRenderer extends TsEmbed {
|
|
|
26724
27101
|
* @returns The constructed URL to use for the ThoughtSpot embed iframe.
|
|
26725
27102
|
*/
|
|
26726
27103
|
getMCPIframeSrc(sourceSrc) {
|
|
26727
|
-
const queryParams = this.
|
|
27104
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
26728
27105
|
const sourceURL = new URL(sourceSrc);
|
|
26729
27106
|
const existingQueryParams = sourceURL.searchParams;
|
|
26730
27107
|
const existingQueryParamsObject = Object.fromEntries(existingQueryParams);
|
|
@@ -26769,4 +27146,4 @@ class AutoFrameRenderer extends TsEmbed {
|
|
|
26769
27146
|
}
|
|
26770
27147
|
}
|
|
26771
27148
|
|
|
26772
|
-
export { Action, AnswerService, AppEmbed, ApplicabilityLevel, AuthEvent, AuthFailureType, AuthStatus, AuthType, BackgroundFormatType, BodylessConversation, ConditionalFormattingComparisonType, ConditionalFormattingOperator, ContextMenuTriggerOptions, ContextType, ConversationEmbed, CustomActionTarget, CustomActionsPosition, DataLabelFilterOperator, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedErrorCodes, EmbedErrorSeverity, EmbedEvent, ErrorDetailsTypes, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, InterceptedApiType, LegendPosition, ListPage, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, SpotterQueryMode, TableContentDensity, TableTheme, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, reloadIframe, resetCachedAuthToken, startAutoMCPFrameRenderer, tokenizedFetch, uploadMixpanelEvent };
|
|
27149
|
+
export { Action, AnswerService, AppEmbed, ApplicabilityLevel, AuthEvent, AuthFailureType, AuthStatus, AuthType, BackgroundFormatType, BodylessConversation, ConditionalFormattingComparisonType, ConditionalFormattingOperator, ContextMenuTriggerOptions, ContextType, ConversationEmbed, CustomActionTarget, CustomActionsPosition, DataLabelFilterOperator, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedErrorCodes, EmbedErrorSeverity, EmbedEvent, ErrorDetailsTypes, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, InterceptedApiType, LegendPosition, ListPage, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, SpotterQueryMode, TableContentDensity, TableTheme, UIPassthroughEvent, convertFilterChangedToUpdateFiltersPayload, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, reloadIframe, resetCachedAuthToken, startAutoMCPFrameRenderer, tokenizedFetch, uploadMixpanelEvent };
|