@thoughtspot/visual-embed-sdk 1.24.0-sage.3 → 1.24.0
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/README.md +1 -1
- package/cjs/package.json +9 -1
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +3 -0
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/css-variables.d.ts +38 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +32 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +11 -8
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +46 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts +4 -1
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +6 -3
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +5 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +5 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +23 -7
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +6 -0
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +5 -2
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts +15 -2
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +8 -2
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +49 -0
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +3 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +28 -8
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +139 -3
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/mixpanel-service.d.ts +1 -0
- package/cjs/src/mixpanel-service.d.ts.map +1 -1
- package/cjs/src/mixpanel-service.js +10 -3
- package/cjs/src/mixpanel-service.js.map +1 -1
- package/cjs/src/mixpanel-service.spec.js +12 -3
- package/cjs/src/mixpanel-service.spec.js.map +1 -1
- package/cjs/src/react/index.d.ts +15 -15
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +7 -3
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +12 -0
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +176 -9
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +133 -7
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils.d.ts +7 -1
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +20 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +24 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +38 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +32 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +4 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +5 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +6 -0
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +15 -2
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +3 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/mixpanel-service.d.ts +1 -0
- package/dist/src/mixpanel-service.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +15 -15
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +176 -9
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils.d.ts +7 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +226 -35
- package/dist/tsembed-react.js +219 -34
- package/dist/tsembed.es.js +228 -36
- package/dist/tsembed.js +221 -35
- package/dist/visual-embed-sdk-react-full.d.ts +512 -248
- package/dist/visual-embed-sdk-react.d.ts +514 -250
- package/dist/visual-embed-sdk.d.ts +277 -14
- package/lib/package.json +9 -1
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +3 -0
- package/lib/src/auth.js.map +1 -1
- package/lib/src/css-variables.d.ts +38 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +32 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +11 -8
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +46 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +4 -1
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +6 -3
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +5 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +6 -3
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +23 -7
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +6 -0
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +6 -3
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +15 -2
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +9 -3
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +49 -0
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +3 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +29 -9
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +140 -4
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/mixpanel-service.d.ts +1 -0
- package/lib/src/mixpanel-service.d.ts.map +1 -1
- package/lib/src/mixpanel-service.js +10 -3
- package/lib/src/mixpanel-service.js.map +1 -1
- package/lib/src/mixpanel-service.spec.js +12 -3
- package/lib/src/mixpanel-service.spec.js.map +1 -1
- package/lib/src/react/index.d.ts +15 -15
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +5 -3
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +13 -1
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +176 -9
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +132 -6
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils.d.ts +7 -1
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +18 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +25 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +280 -17
- package/package.json +9 -1
- package/src/auth.ts +6 -3
- package/src/css-variables.ts +47 -0
- package/src/embed/app.spec.ts +63 -0
- package/src/embed/app.ts +50 -15
- package/src/embed/base.ts +9 -6
- package/src/embed/liveboard.spec.ts +29 -10
- package/src/embed/liveboard.ts +11 -2
- package/src/embed/search-bar.tsx +19 -6
- package/src/embed/search.spec.ts +61 -0
- package/src/embed/search.ts +34 -3
- package/src/embed/ts-embed.spec.ts +162 -8
- package/src/embed/ts-embed.ts +30 -9
- package/src/index.ts +4 -0
- package/src/mixpanel-service.spec.ts +12 -3
- package/src/mixpanel-service.ts +10 -3
- package/src/react/index.spec.tsx +33 -2
- package/src/react/index.tsx +37 -26
- package/src/types.ts +263 -92
- package/src/utils.spec.ts +31 -0
- package/src/utils.ts +23 -0
package/dist/tsembed-react.es.js
CHANGED
|
@@ -186,6 +186,24 @@ const getFilterQuery = (runtimeFilters) => {
|
|
|
186
186
|
}
|
|
187
187
|
return null;
|
|
188
188
|
};
|
|
189
|
+
/**
|
|
190
|
+
* Construct a runtime parameter override query string from the given option.
|
|
191
|
+
*
|
|
192
|
+
* @param runtimeParameters
|
|
193
|
+
*/
|
|
194
|
+
const getRuntimeParameters = (runtimeParameters) => {
|
|
195
|
+
if (runtimeParameters && runtimeParameters.length) {
|
|
196
|
+
const params = runtimeParameters.map((param, valueIndex) => {
|
|
197
|
+
const index = valueIndex + 1;
|
|
198
|
+
const filterExpr = [];
|
|
199
|
+
filterExpr.push(`param${index}=${encodeURIComponent(param.name)}`);
|
|
200
|
+
filterExpr.push(`paramVal${index}=${encodeURIComponent(param.value)}`);
|
|
201
|
+
return filterExpr.join('&');
|
|
202
|
+
});
|
|
203
|
+
return `${params.join('&')}`;
|
|
204
|
+
}
|
|
205
|
+
return null;
|
|
206
|
+
};
|
|
189
207
|
/**
|
|
190
208
|
* Convert a value to a string representation to be sent as a query
|
|
191
209
|
* parameter to the ThoughtSpot app.
|
|
@@ -513,6 +531,18 @@ var AuthType;
|
|
|
513
531
|
*/
|
|
514
532
|
AuthType["Basic"] = "Basic";
|
|
515
533
|
})(AuthType || (AuthType = {}));
|
|
534
|
+
var HomeLeftNavItem;
|
|
535
|
+
(function (HomeLeftNavItem) {
|
|
536
|
+
HomeLeftNavItem["QueryBuilder"] = "query-builder";
|
|
537
|
+
HomeLeftNavItem["Home"] = "insights-home";
|
|
538
|
+
HomeLeftNavItem["Liveboards"] = "liveboards";
|
|
539
|
+
HomeLeftNavItem["Answers"] = "answers";
|
|
540
|
+
HomeLeftNavItem["MonitorSubscription"] = "monitor-alerts";
|
|
541
|
+
HomeLeftNavItem["SpotIQAnalysis"] = "spotiq-analysis";
|
|
542
|
+
HomeLeftNavItem["Tutorials"] = "tutorials";
|
|
543
|
+
HomeLeftNavItem["Documentation"] = "documentation";
|
|
544
|
+
HomeLeftNavItem["Community"] = "community";
|
|
545
|
+
})(HomeLeftNavItem || (HomeLeftNavItem = {}));
|
|
516
546
|
/**
|
|
517
547
|
* A map of the supported runtime filter operations
|
|
518
548
|
*/
|
|
@@ -576,6 +606,37 @@ var RuntimeFilterOp;
|
|
|
576
606
|
*/
|
|
577
607
|
RuntimeFilterOp["IN"] = "IN";
|
|
578
608
|
})(RuntimeFilterOp || (RuntimeFilterOp = {}));
|
|
609
|
+
/**
|
|
610
|
+
* Home page module that can be hide
|
|
611
|
+
*/
|
|
612
|
+
// eslint-disable-next-line no-shadow
|
|
613
|
+
var HomepageModule;
|
|
614
|
+
(function (HomepageModule) {
|
|
615
|
+
/**
|
|
616
|
+
* Search bar
|
|
617
|
+
*/
|
|
618
|
+
HomepageModule["Search"] = "search";
|
|
619
|
+
/**
|
|
620
|
+
* kPI watchlist module
|
|
621
|
+
*/
|
|
622
|
+
HomepageModule["Watchlist"] = "watchlist";
|
|
623
|
+
/**
|
|
624
|
+
* favorite objects
|
|
625
|
+
*/
|
|
626
|
+
HomepageModule["Favorite"] = "favorite";
|
|
627
|
+
/**
|
|
628
|
+
* List of answers and liveboards
|
|
629
|
+
*/
|
|
630
|
+
HomepageModule["MyLibrary"] = "mylibrary";
|
|
631
|
+
/**
|
|
632
|
+
* Trending list
|
|
633
|
+
*/
|
|
634
|
+
HomepageModule["Trending"] = "trending";
|
|
635
|
+
/**
|
|
636
|
+
* Learning videos
|
|
637
|
+
*/
|
|
638
|
+
HomepageModule["Learning"] = "learning";
|
|
639
|
+
})(HomepageModule || (HomepageModule = {}));
|
|
579
640
|
/**
|
|
580
641
|
* Event types emitted by the embedded ThoughtSpot application.
|
|
581
642
|
*
|
|
@@ -1002,23 +1063,74 @@ var EmbedEvent;
|
|
|
1002
1063
|
*/
|
|
1003
1064
|
EmbedEvent["InsertIntoSlide"] = "insertInToSlide";
|
|
1004
1065
|
/**
|
|
1066
|
+
* @hidden
|
|
1005
1067
|
* Emitted when a user changes any filter on a Liveboard.
|
|
1006
|
-
*
|
|
1007
1068
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
1008
1069
|
*/
|
|
1009
1070
|
EmbedEvent["FilterChanged"] = "filterChanged";
|
|
1010
1071
|
/**
|
|
1011
1072
|
* Emitted when a user click on Go button in Sage Embed
|
|
1012
1073
|
*
|
|
1013
|
-
* @version SDK : 1.
|
|
1074
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1014
1075
|
*/
|
|
1015
1076
|
EmbedEvent["SageEmbedQuery"] = "sageEmbedQuery";
|
|
1016
1077
|
/**
|
|
1017
1078
|
* Emitten when a user select data source in Sage Embed
|
|
1018
1079
|
*
|
|
1019
|
-
* @version SDK : 1.
|
|
1080
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1020
1081
|
*/
|
|
1021
1082
|
EmbedEvent["SageWorksheetUpdated"] = "sageWorksheetUpdated";
|
|
1083
|
+
/**
|
|
1084
|
+
* Emitten when a user updates a connection in Data tab
|
|
1085
|
+
*
|
|
1086
|
+
* @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
|
|
1087
|
+
*/
|
|
1088
|
+
EmbedEvent["UpdateConnection"] = "updateConnection";
|
|
1089
|
+
/**
|
|
1090
|
+
* Emitted when name, status (private or public) or filter values of a
|
|
1091
|
+
* PersonalisedView is updated.
|
|
1092
|
+
*
|
|
1093
|
+
* @returns viewName: string
|
|
1094
|
+
* @returns viewId: string
|
|
1095
|
+
* @returns liveboardId: string
|
|
1096
|
+
* @returns isPublic: boolean
|
|
1097
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1098
|
+
*/
|
|
1099
|
+
EmbedEvent["UpdatePersonalisedView"] = "updatePersonalisedView";
|
|
1100
|
+
/**
|
|
1101
|
+
* Emitted when a PersonalisedView is saved.
|
|
1102
|
+
*
|
|
1103
|
+
* @returns viewName: string
|
|
1104
|
+
* @returns viewId: string
|
|
1105
|
+
* @returns liveboardId: string
|
|
1106
|
+
* @returns isPublic: boolean
|
|
1107
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1108
|
+
*/
|
|
1109
|
+
EmbedEvent["SavePersonalisedView"] = "savePersonalisedView";
|
|
1110
|
+
/**
|
|
1111
|
+
* Emitted when a Liveboard is reset.
|
|
1112
|
+
*
|
|
1113
|
+
* @returns viewName: string
|
|
1114
|
+
* @returns viewId: string
|
|
1115
|
+
* @returns liveboardId: string
|
|
1116
|
+
* @returns isPublic: boolean
|
|
1117
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1118
|
+
*/
|
|
1119
|
+
EmbedEvent["ResetLiveboard"] = "resetLiveboard";
|
|
1120
|
+
/**
|
|
1121
|
+
* Emitted when a PersonalisedView is deleted.
|
|
1122
|
+
*
|
|
1123
|
+
* @returns views: string[]
|
|
1124
|
+
* @returns liveboardId: string
|
|
1125
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1126
|
+
*/
|
|
1127
|
+
EmbedEvent["DeletePersonalisedView"] = "deletePersonalisedView";
|
|
1128
|
+
/**
|
|
1129
|
+
* Emitten when a user creates a new worksheet
|
|
1130
|
+
*
|
|
1131
|
+
* @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
|
|
1132
|
+
*/
|
|
1133
|
+
EmbedEvent["CreateWorksheet"] = "createWorksheet";
|
|
1022
1134
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
1023
1135
|
/**
|
|
1024
1136
|
* Event types that can be triggered by the host application
|
|
@@ -1663,16 +1775,16 @@ var HostEvent;
|
|
|
1663
1775
|
*/
|
|
1664
1776
|
HostEvent["ResetSearch"] = "resetSearch";
|
|
1665
1777
|
/**
|
|
1778
|
+
* @hidden
|
|
1666
1779
|
* Gets the currents visible and runtime filters applied on a Liveboard
|
|
1667
|
-
*
|
|
1668
1780
|
* @example
|
|
1669
1781
|
* liveboardEmbed.trigger(HostEvent.GetFilters)
|
|
1670
1782
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
1671
1783
|
*/
|
|
1672
1784
|
HostEvent["GetFilters"] = "getFilters";
|
|
1673
1785
|
/**
|
|
1786
|
+
* @hidden
|
|
1674
1787
|
* Updates the visible filters on the Liveboard.
|
|
1675
|
-
*
|
|
1676
1788
|
* @param - filter: filter object containing column name and filter operation and values
|
|
1677
1789
|
* @example
|
|
1678
1790
|
*
|
|
@@ -1829,6 +1941,9 @@ var Param;
|
|
|
1829
1941
|
Param["HideSampleQuestions"] = "hideSampleQuestions";
|
|
1830
1942
|
Param["WorksheetId"] = "worksheet";
|
|
1831
1943
|
Param["Query"] = "query";
|
|
1944
|
+
Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
|
|
1945
|
+
Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
|
|
1946
|
+
Param["PendoTrackingKey"] = "additionalPendoKey";
|
|
1832
1947
|
})(Param || (Param = {}));
|
|
1833
1948
|
/**
|
|
1834
1949
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -2333,7 +2448,7 @@ var Action;
|
|
|
2333
2448
|
* disabledActions: [Action.QueryDetailsButtons]
|
|
2334
2449
|
* ```
|
|
2335
2450
|
*/
|
|
2336
|
-
Action["QueryDetailsButtons"] = "
|
|
2451
|
+
Action["QueryDetailsButtons"] = "queryDetailsButtons";
|
|
2337
2452
|
/**
|
|
2338
2453
|
* The **Delete** action for Answers.
|
|
2339
2454
|
*
|
|
@@ -2638,6 +2753,35 @@ var Action;
|
|
|
2638
2753
|
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
2639
2754
|
*/
|
|
2640
2755
|
Action["ModifySageAnswer"] = "modifySageAnswer";
|
|
2756
|
+
/**
|
|
2757
|
+
* The **Move to Tab** menu action on visualizations in liveboard edit mode.
|
|
2758
|
+
* Allows moving a visualization to a different tab.
|
|
2759
|
+
*
|
|
2760
|
+
* @example
|
|
2761
|
+
* ```js
|
|
2762
|
+
* disabledActions: [Action.MoveToTab]
|
|
2763
|
+
* ```
|
|
2764
|
+
*/
|
|
2765
|
+
Action["MoveToTab"] = "onContainerMove";
|
|
2766
|
+
/**
|
|
2767
|
+
* The **Manage Alertsb** menu action on KPI visualizations.
|
|
2768
|
+
*
|
|
2769
|
+
* @example
|
|
2770
|
+
* ```js
|
|
2771
|
+
* disabledActions: [Action.ManageMonitor]
|
|
2772
|
+
* ```
|
|
2773
|
+
*/
|
|
2774
|
+
Action["ManageMonitor"] = "ManageMonitor";
|
|
2775
|
+
/**
|
|
2776
|
+
* Action ID for Liveboard Personalised Views dropdown
|
|
2777
|
+
*
|
|
2778
|
+
* @example
|
|
2779
|
+
* ```js
|
|
2780
|
+
* disabledActions: [Action.PersonalisedViewsDropdown]
|
|
2781
|
+
* ```
|
|
2782
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
2783
|
+
*/
|
|
2784
|
+
Action["PersonalisedViewsDropdown"] = "personalisedViewsDropdown";
|
|
2641
2785
|
})(Action || (Action = {}));
|
|
2642
2786
|
// eslint-disable-next-line no-shadow
|
|
2643
2787
|
var OperationType;
|
|
@@ -8717,6 +8861,7 @@ var mixpanel$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE
|
|
|
8717
8861
|
|
|
8718
8862
|
// Needed to avoid error in CJS builds on some bundlers.
|
|
8719
8863
|
const mixpanelLib = mixpanel_cjs || mixpanel$1;
|
|
8864
|
+
let mixpanelInstance;
|
|
8720
8865
|
const MIXPANEL_EVENT = {
|
|
8721
8866
|
VISUAL_SDK_RENDER_START: 'visual-sdk-render-start',
|
|
8722
8867
|
VISUAL_SDK_CALLED_INIT: 'visual-sdk-called-init',
|
|
@@ -8725,6 +8870,7 @@ const MIXPANEL_EVENT = {
|
|
|
8725
8870
|
VISUAL_SDK_TRIGGER: 'visual-sdk-trigger',
|
|
8726
8871
|
VISUAL_SDK_ON: 'visual-sdk-on',
|
|
8727
8872
|
VISUAL_SDK_IFRAME_LOAD_PERFORMANCE: 'visual-sdk-iframe-load-performance',
|
|
8873
|
+
VISUAL_SDK_EMBED_CREATE: 'visual-sdk-embed-create',
|
|
8728
8874
|
};
|
|
8729
8875
|
let isMixpanelInitialized = false;
|
|
8730
8876
|
let eventQueue = [];
|
|
@@ -8739,7 +8885,7 @@ function uploadMixpanelEvent(eventId, eventProps = {}) {
|
|
|
8739
8885
|
eventQueue.push({ eventId, eventProps });
|
|
8740
8886
|
return;
|
|
8741
8887
|
}
|
|
8742
|
-
|
|
8888
|
+
mixpanelInstance.track(eventId, eventProps);
|
|
8743
8889
|
}
|
|
8744
8890
|
/**
|
|
8745
8891
|
*
|
|
@@ -8767,10 +8913,15 @@ function initMixpanel(sessionInfo) {
|
|
|
8767
8913
|
const token = sessionInfo.mixpanelToken;
|
|
8768
8914
|
try {
|
|
8769
8915
|
if (token) {
|
|
8770
|
-
mixpanelLib.init(token);
|
|
8916
|
+
mixpanelInstance = mixpanelLib.init(token, undefined, 'tsEmbed');
|
|
8771
8917
|
if (!isPublicCluster) {
|
|
8772
|
-
|
|
8918
|
+
mixpanelInstance.identify(sessionInfo.userGUID);
|
|
8773
8919
|
}
|
|
8920
|
+
mixpanelInstance.register_once({
|
|
8921
|
+
clusterId: sessionInfo.clusterId,
|
|
8922
|
+
clusterName: sessionInfo.clusterName,
|
|
8923
|
+
releaseVersion: sessionInfo.releaseVersion,
|
|
8924
|
+
});
|
|
8774
8925
|
isMixpanelInitialized = true;
|
|
8775
8926
|
emptyQueue();
|
|
8776
8927
|
}
|
|
@@ -9707,6 +9858,9 @@ const getSessionDetails = (sessionInfoResp) => {
|
|
|
9707
9858
|
userGUID: sessionInfoResp.userGUID,
|
|
9708
9859
|
mixpanelToken,
|
|
9709
9860
|
isPublicUser: sessionInfoResp.configInfo.isPublicUser,
|
|
9861
|
+
releaseVersion: sessionInfoResp.releaseVersion,
|
|
9862
|
+
clusterId: sessionInfoResp.configInfo.selfClusterId,
|
|
9863
|
+
clusterName: sessionInfoResp.configInfo.selfClusterName,
|
|
9710
9864
|
...sessionInfoResp,
|
|
9711
9865
|
};
|
|
9712
9866
|
};
|
|
@@ -10242,7 +10396,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
10242
10396
|
});
|
|
10243
10397
|
}
|
|
10244
10398
|
|
|
10245
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.24.0
|
|
10399
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.24.0";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 . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls","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"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^40.1.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.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":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"40 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};
|
|
10246
10400
|
|
|
10247
10401
|
/**
|
|
10248
10402
|
* Copyright (c) 2022
|
|
@@ -10290,6 +10444,7 @@ class TsEmbed {
|
|
|
10290
10444
|
* @param responder
|
|
10291
10445
|
*/
|
|
10292
10446
|
this.appInitCb = async (_, responder) => {
|
|
10447
|
+
var _a, _b;
|
|
10293
10448
|
let authToken = '';
|
|
10294
10449
|
if (this.embedConfig.authType === AuthType.TrustedAuthTokenCookieless) {
|
|
10295
10450
|
authToken = await getAuthenticaionToken(this.embedConfig);
|
|
@@ -10300,8 +10455,14 @@ class TsEmbed {
|
|
|
10300
10455
|
data: {
|
|
10301
10456
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
10302
10457
|
authToken,
|
|
10303
|
-
runtimeFilterParams:
|
|
10458
|
+
runtimeFilterParams: this.viewConfig.excludeRuntimeFiltersfromURL
|
|
10459
|
+
? getRuntimeFilters(this.viewConfig.runtimeFilters)
|
|
10460
|
+
: null,
|
|
10461
|
+
hiddenHomepageModules: this.viewConfig.hiddenHomepageModules || [],
|
|
10304
10462
|
hostConfig: this.embedConfig.hostConfig,
|
|
10463
|
+
hiddenHomeLeftNavItems: ((_a = this.viewConfig) === null || _a === void 0 ? void 0 : _a.hiddenHomeLeftNavItems)
|
|
10464
|
+
? (_b = this.viewConfig) === null || _b === void 0 ? void 0 : _b.hiddenHomeLeftNavItems
|
|
10465
|
+
: [],
|
|
10305
10466
|
},
|
|
10306
10467
|
});
|
|
10307
10468
|
};
|
|
@@ -10329,8 +10490,8 @@ class TsEmbed {
|
|
|
10329
10490
|
* Register APP_INIT event and sendback init payload
|
|
10330
10491
|
*/
|
|
10331
10492
|
this.registerAppInit = () => {
|
|
10332
|
-
this.on(EmbedEvent.APP_INIT, this.appInitCb);
|
|
10333
|
-
this.on(EmbedEvent.AuthExpire, this.updateAuthToken);
|
|
10493
|
+
this.on(EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
|
|
10494
|
+
this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
10334
10495
|
};
|
|
10335
10496
|
this.el = getDOMNode(domSelector);
|
|
10336
10497
|
// TODO: handle error
|
|
@@ -10345,6 +10506,9 @@ class TsEmbed {
|
|
|
10345
10506
|
this.viewConfig = viewConfig;
|
|
10346
10507
|
this.shouldEncodeUrlQueryParams = this.embedConfig.shouldEncodeUrlQueryParams;
|
|
10347
10508
|
this.registerAppInit();
|
|
10509
|
+
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
10510
|
+
...viewConfig,
|
|
10511
|
+
});
|
|
10348
10512
|
}
|
|
10349
10513
|
/**
|
|
10350
10514
|
* Throws error encountered during initialization.
|
|
@@ -10475,6 +10639,9 @@ class TsEmbed {
|
|
|
10475
10639
|
if (this.embedConfig.authType === AuthType.TrustedAuthTokenCookieless) {
|
|
10476
10640
|
queryParams[Param.cookieless] = true;
|
|
10477
10641
|
}
|
|
10642
|
+
if (this.embedConfig.pendoTrackingKey) {
|
|
10643
|
+
queryParams[Param.PendoTrackingKey] = this.embedConfig.pendoTrackingKey;
|
|
10644
|
+
}
|
|
10478
10645
|
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, } = this.viewConfig;
|
|
10479
10646
|
if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
|
|
10480
10647
|
this.handleError('You cannot have both hidden actions and visible actions');
|
|
@@ -10627,7 +10794,6 @@ class TsEmbed {
|
|
|
10627
10794
|
this.insertIntoDOM(this.embedConfig.loginFailedMessage);
|
|
10628
10795
|
return;
|
|
10629
10796
|
}
|
|
10630
|
-
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_COMPLETE);
|
|
10631
10797
|
this.iFrame = this.iFrame || this.createIframeEl(url);
|
|
10632
10798
|
this.iFrame.addEventListener('load', () => {
|
|
10633
10799
|
nextInQueue();
|
|
@@ -10638,7 +10804,9 @@ class TsEmbed {
|
|
|
10638
10804
|
},
|
|
10639
10805
|
type: EmbedEvent.Load,
|
|
10640
10806
|
});
|
|
10641
|
-
uploadMixpanelEvent(MIXPANEL_EVENT.
|
|
10807
|
+
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_COMPLETE, {
|
|
10808
|
+
elWidth: this.iFrame.clientWidth,
|
|
10809
|
+
elHeight: this.iFrame.clientHeight,
|
|
10642
10810
|
timeTookToLoad: loadTimestamp - initTimestamp,
|
|
10643
10811
|
});
|
|
10644
10812
|
});
|
|
@@ -10781,6 +10949,8 @@ class TsEmbed {
|
|
|
10781
10949
|
* @param messageType The message type
|
|
10782
10950
|
* @param callback A callback as a function
|
|
10783
10951
|
* @param options The message options
|
|
10952
|
+
* @param isSelf
|
|
10953
|
+
* @param isRegisteredBySDK
|
|
10784
10954
|
* @example
|
|
10785
10955
|
* ```js
|
|
10786
10956
|
* tsEmbed.on(EmbedEvent.Error, (data) => {
|
|
@@ -10796,7 +10966,10 @@ class TsEmbed {
|
|
|
10796
10966
|
* });
|
|
10797
10967
|
* ```
|
|
10798
10968
|
*/
|
|
10799
|
-
on(messageType, callback, options = { start: false }) {
|
|
10969
|
+
on(messageType, callback, options = { start: false }, isRegisteredBySDK = false) {
|
|
10970
|
+
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_ON}-${messageType}`, {
|
|
10971
|
+
isRegisteredBySDK,
|
|
10972
|
+
});
|
|
10800
10973
|
if (this.isRendered) {
|
|
10801
10974
|
this.handleError('Please register event handlers before calling render');
|
|
10802
10975
|
}
|
|
@@ -10953,8 +11126,10 @@ class V1Embed extends TsEmbed {
|
|
|
10953
11126
|
let queryString = queryParams;
|
|
10954
11127
|
if (!this.viewConfig.excludeRuntimeFiltersfromURL) {
|
|
10955
11128
|
const runtimeFilters = this.viewConfig.runtimeFilters;
|
|
11129
|
+
const runtimeParameters = this.viewConfig.runtimeParameters;
|
|
11130
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
10956
11131
|
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
10957
|
-
queryString = [filterQuery, queryParams].filter(Boolean).join('&');
|
|
11132
|
+
queryString = [parameterQuery, filterQuery, queryParams].filter(Boolean).join('&');
|
|
10958
11133
|
}
|
|
10959
11134
|
return this.getV1EmbedBasePath(queryString);
|
|
10960
11135
|
}
|
|
@@ -10977,7 +11152,6 @@ class V1Embed extends TsEmbed {
|
|
|
10977
11152
|
*/
|
|
10978
11153
|
on(messageType, callback, options = { start: false }) {
|
|
10979
11154
|
const eventType = this.getCompatibleEventType(messageType);
|
|
10980
|
-
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_ON}-${messageType}`);
|
|
10981
11155
|
return super.on(eventType, callback, options);
|
|
10982
11156
|
}
|
|
10983
11157
|
}
|
|
@@ -11001,7 +11175,7 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
11001
11175
|
*/
|
|
11002
11176
|
getIFrameSrc() {
|
|
11003
11177
|
var _a;
|
|
11004
|
-
const { searchOptions, dataSource, dataSources } = this.viewConfig;
|
|
11178
|
+
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, } = this.viewConfig;
|
|
11005
11179
|
const path = 'search-bar-embed';
|
|
11006
11180
|
const queryParams = this.getBaseQueryParams();
|
|
11007
11181
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
@@ -11017,7 +11191,10 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
11017
11191
|
queryParams[Param.executeSearch] = true;
|
|
11018
11192
|
}
|
|
11019
11193
|
}
|
|
11020
|
-
queryParams[Param.UseLastSelectedDataSource] =
|
|
11194
|
+
queryParams[Param.UseLastSelectedDataSource] = useLastSelectedSources;
|
|
11195
|
+
if (dataSource || dataSources) {
|
|
11196
|
+
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
11197
|
+
}
|
|
11021
11198
|
queryParams[Param.searchEmbed] = true;
|
|
11022
11199
|
let query = '';
|
|
11023
11200
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
@@ -11168,7 +11345,7 @@ class SearchEmbed extends TsEmbed {
|
|
|
11168
11345
|
}
|
|
11169
11346
|
getEmbedParams() {
|
|
11170
11347
|
var _a;
|
|
11171
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, dataPanelV2 = false, } = this.viewConfig;
|
|
11348
|
+
const { hideResults, expandAllDataSource, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, } = this.viewConfig;
|
|
11172
11349
|
const queryParams = this.getBaseQueryParams();
|
|
11173
11350
|
queryParams[Param.HideActions] = [
|
|
11174
11351
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -11197,13 +11374,19 @@ class SearchEmbed extends TsEmbed {
|
|
|
11197
11374
|
}
|
|
11198
11375
|
queryParams[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
11199
11376
|
queryParams[Param.DataSourceMode] = this.getDataSourceMode();
|
|
11200
|
-
queryParams[Param.UseLastSelectedDataSource] =
|
|
11377
|
+
queryParams[Param.UseLastSelectedDataSource] = useLastSelectedSources;
|
|
11378
|
+
if (dataSource || dataSources) {
|
|
11379
|
+
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
11380
|
+
}
|
|
11201
11381
|
queryParams[Param.searchEmbed] = true;
|
|
11202
11382
|
let query = '';
|
|
11203
11383
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
11204
11384
|
if (queryParamsString) {
|
|
11205
11385
|
query = `?${queryParamsString}`;
|
|
11206
11386
|
}
|
|
11387
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
11388
|
+
if (parameterQuery)
|
|
11389
|
+
query += `&${parameterQuery}`;
|
|
11207
11390
|
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
11208
11391
|
if (filterQuery && !excludeRuntimeFiltersfromURL) {
|
|
11209
11392
|
query += `&${filterQuery}`;
|
|
@@ -11325,7 +11508,7 @@ class AppEmbed extends V1Embed {
|
|
|
11325
11508
|
* embedded Liveboard or visualization.
|
|
11326
11509
|
*/
|
|
11327
11510
|
getEmbedParams() {
|
|
11328
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, } = this.viewConfig;
|
|
11511
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideHomepageLeftNav = false, modularHomeExperience = false, } = this.viewConfig;
|
|
11329
11512
|
let params = {};
|
|
11330
11513
|
params[Param.EmbedApp] = true;
|
|
11331
11514
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
@@ -11349,6 +11532,8 @@ class AppEmbed extends V1Embed {
|
|
|
11349
11532
|
params[Param.EnableSearchAssist] = enableSearchAssist;
|
|
11350
11533
|
}
|
|
11351
11534
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
11535
|
+
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
11536
|
+
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
11352
11537
|
const queryParams = getQueryParamString(params, true);
|
|
11353
11538
|
return queryParams;
|
|
11354
11539
|
}
|
|
@@ -11358,8 +11543,8 @@ class AppEmbed extends V1Embed {
|
|
|
11358
11543
|
* @param pageId The ID of the page to be embedded.
|
|
11359
11544
|
*/
|
|
11360
11545
|
getIFrameSrc() {
|
|
11361
|
-
const { pageId, path } = this.viewConfig;
|
|
11362
|
-
const pageRoute = this.formatPath(path) || this.getPageRoute(pageId);
|
|
11546
|
+
const { pageId, path, modularHomeExperience } = this.viewConfig;
|
|
11547
|
+
const pageRoute = this.formatPath(path) || this.getPageRoute(pageId, modularHomeExperience);
|
|
11363
11548
|
let url = `${this.getRootIframeSrc()}/${pageRoute}`;
|
|
11364
11549
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
11365
11550
|
url = `${url}${tsPostHashParams}`;
|
|
@@ -11369,21 +11554,22 @@ class AppEmbed extends V1Embed {
|
|
|
11369
11554
|
* Gets the ThoughtSpot route of the page for a particular page ID.
|
|
11370
11555
|
*
|
|
11371
11556
|
* @param pageId The identifier for a page in the ThoughtSpot app.
|
|
11557
|
+
* @param modularHomeExperience
|
|
11372
11558
|
*/
|
|
11373
|
-
getPageRoute(pageId) {
|
|
11559
|
+
getPageRoute(pageId, modularHomeExperience = false) {
|
|
11374
11560
|
switch (pageId) {
|
|
11375
11561
|
case Page.Search:
|
|
11376
11562
|
return 'answer';
|
|
11377
11563
|
case Page.Answers:
|
|
11378
|
-
return 'answers';
|
|
11564
|
+
return modularHomeExperience ? 'home/answers' : 'answers';
|
|
11379
11565
|
case Page.Liveboards:
|
|
11380
|
-
return 'pinboards';
|
|
11566
|
+
return modularHomeExperience ? 'home/liveboards' : 'pinboards';
|
|
11381
11567
|
case Page.Pinboards:
|
|
11382
|
-
return 'pinboards';
|
|
11568
|
+
return modularHomeExperience ? 'home/liveboards' : 'pinboards';
|
|
11383
11569
|
case Page.Data:
|
|
11384
11570
|
return 'data/tables';
|
|
11385
11571
|
case Page.SpotIQ:
|
|
11386
|
-
return 'insights/results';
|
|
11572
|
+
return modularHomeExperience ? 'home/spotiq-analysis' : 'insights/results';
|
|
11387
11573
|
case Page.Home:
|
|
11388
11574
|
default:
|
|
11389
11575
|
return 'home';
|
|
@@ -11512,7 +11698,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
11512
11698
|
let params = {};
|
|
11513
11699
|
params[Param.EmbedApp] = true;
|
|
11514
11700
|
params = this.getBaseQueryParams(params);
|
|
11515
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, } = this.viewConfig;
|
|
11701
|
+
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, runtimeParameters, } = this.viewConfig;
|
|
11516
11702
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
11517
11703
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
11518
11704
|
if (fullHeight === true) {
|
|
@@ -11540,7 +11726,10 @@ class LiveboardEmbed extends V1Embed {
|
|
|
11540
11726
|
if (hideTabPanel) {
|
|
11541
11727
|
params[Param.HideTabPanel] = hideTabPanel;
|
|
11542
11728
|
}
|
|
11543
|
-
|
|
11729
|
+
let queryParams = getQueryParamString(params, true);
|
|
11730
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
11731
|
+
if (parameterQuery)
|
|
11732
|
+
queryParams += `&${parameterQuery}`;
|
|
11544
11733
|
return queryParams;
|
|
11545
11734
|
}
|
|
11546
11735
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
@@ -11756,8 +11945,10 @@ const SageEmbed$1 = componentFactory(SageEmbed);
|
|
|
11756
11945
|
* return <LiveboardEmbed ref={ref} liveboardId={<id>} />
|
|
11757
11946
|
* }
|
|
11758
11947
|
* ```
|
|
11759
|
-
* @returns {React.MutableRefObject<TsEmbed>} ref
|
|
11948
|
+
* @returns {React.MutableRefObject<T extends TsEmbed>} ref
|
|
11760
11949
|
*/
|
|
11761
|
-
|
|
11950
|
+
function useEmbedRef() {
|
|
11951
|
+
return React.useRef(null);
|
|
11952
|
+
}
|
|
11762
11953
|
|
|
11763
|
-
export { Action, AppEmbed$1 as AppEmbed, EmbedEvent, HostEvent, LiveboardEmbed$1 as LiveboardEmbed, Page, PinboardEmbed, RuntimeFilterOp, SageEmbed$1 as SageEmbed, SearchBarEmbed$1 as SearchBarEmbed, SearchEmbed$1 as SearchEmbed, useEmbedRef };
|
|
11954
|
+
export { Action, AppEmbed$1 as AppEmbed, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, LiveboardEmbed$1 as LiveboardEmbed, Page, PinboardEmbed, RuntimeFilterOp, SageEmbed$1 as SageEmbed, SearchBarEmbed$1 as SearchBarEmbed, SearchEmbed$1 as SearchEmbed, useEmbedRef };
|