@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.js
CHANGED
|
@@ -194,6 +194,24 @@
|
|
|
194
194
|
}
|
|
195
195
|
return null;
|
|
196
196
|
};
|
|
197
|
+
/**
|
|
198
|
+
* Construct a runtime parameter override query string from the given option.
|
|
199
|
+
*
|
|
200
|
+
* @param runtimeParameters
|
|
201
|
+
*/
|
|
202
|
+
const getRuntimeParameters = (runtimeParameters) => {
|
|
203
|
+
if (runtimeParameters && runtimeParameters.length) {
|
|
204
|
+
const params = runtimeParameters.map((param, valueIndex) => {
|
|
205
|
+
const index = valueIndex + 1;
|
|
206
|
+
const filterExpr = [];
|
|
207
|
+
filterExpr.push(`param${index}=${encodeURIComponent(param.name)}`);
|
|
208
|
+
filterExpr.push(`paramVal${index}=${encodeURIComponent(param.value)}`);
|
|
209
|
+
return filterExpr.join('&');
|
|
210
|
+
});
|
|
211
|
+
return `${params.join('&')}`;
|
|
212
|
+
}
|
|
213
|
+
return null;
|
|
214
|
+
};
|
|
197
215
|
/**
|
|
198
216
|
* Convert a value to a string representation to be sent as a query
|
|
199
217
|
* parameter to the ThoughtSpot app.
|
|
@@ -521,6 +539,17 @@
|
|
|
521
539
|
*/
|
|
522
540
|
AuthType["Basic"] = "Basic";
|
|
523
541
|
})(AuthType || (AuthType = {}));
|
|
542
|
+
(function (HomeLeftNavItem) {
|
|
543
|
+
HomeLeftNavItem["QueryBuilder"] = "query-builder";
|
|
544
|
+
HomeLeftNavItem["Home"] = "insights-home";
|
|
545
|
+
HomeLeftNavItem["Liveboards"] = "liveboards";
|
|
546
|
+
HomeLeftNavItem["Answers"] = "answers";
|
|
547
|
+
HomeLeftNavItem["MonitorSubscription"] = "monitor-alerts";
|
|
548
|
+
HomeLeftNavItem["SpotIQAnalysis"] = "spotiq-analysis";
|
|
549
|
+
HomeLeftNavItem["Tutorials"] = "tutorials";
|
|
550
|
+
HomeLeftNavItem["Documentation"] = "documentation";
|
|
551
|
+
HomeLeftNavItem["Community"] = "community";
|
|
552
|
+
})(exports.HomeLeftNavItem || (exports.HomeLeftNavItem = {}));
|
|
524
553
|
(function (RuntimeFilterOp) {
|
|
525
554
|
/**
|
|
526
555
|
* Equals
|
|
@@ -579,6 +608,32 @@
|
|
|
579
608
|
*/
|
|
580
609
|
RuntimeFilterOp["IN"] = "IN";
|
|
581
610
|
})(exports.RuntimeFilterOp || (exports.RuntimeFilterOp = {}));
|
|
611
|
+
(function (HomepageModule) {
|
|
612
|
+
/**
|
|
613
|
+
* Search bar
|
|
614
|
+
*/
|
|
615
|
+
HomepageModule["Search"] = "search";
|
|
616
|
+
/**
|
|
617
|
+
* kPI watchlist module
|
|
618
|
+
*/
|
|
619
|
+
HomepageModule["Watchlist"] = "watchlist";
|
|
620
|
+
/**
|
|
621
|
+
* favorite objects
|
|
622
|
+
*/
|
|
623
|
+
HomepageModule["Favorite"] = "favorite";
|
|
624
|
+
/**
|
|
625
|
+
* List of answers and liveboards
|
|
626
|
+
*/
|
|
627
|
+
HomepageModule["MyLibrary"] = "mylibrary";
|
|
628
|
+
/**
|
|
629
|
+
* Trending list
|
|
630
|
+
*/
|
|
631
|
+
HomepageModule["Trending"] = "trending";
|
|
632
|
+
/**
|
|
633
|
+
* Learning videos
|
|
634
|
+
*/
|
|
635
|
+
HomepageModule["Learning"] = "learning";
|
|
636
|
+
})(exports.HomepageModule || (exports.HomepageModule = {}));
|
|
582
637
|
(function (EmbedEvent) {
|
|
583
638
|
/**
|
|
584
639
|
* Rendering has initialized.
|
|
@@ -983,23 +1038,74 @@
|
|
|
983
1038
|
*/
|
|
984
1039
|
EmbedEvent["InsertIntoSlide"] = "insertInToSlide";
|
|
985
1040
|
/**
|
|
1041
|
+
* @hidden
|
|
986
1042
|
* Emitted when a user changes any filter on a Liveboard.
|
|
987
|
-
*
|
|
988
1043
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
989
1044
|
*/
|
|
990
1045
|
EmbedEvent["FilterChanged"] = "filterChanged";
|
|
991
1046
|
/**
|
|
992
1047
|
* Emitted when a user click on Go button in Sage Embed
|
|
993
1048
|
*
|
|
994
|
-
* @version SDK : 1.
|
|
1049
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
995
1050
|
*/
|
|
996
1051
|
EmbedEvent["SageEmbedQuery"] = "sageEmbedQuery";
|
|
997
1052
|
/**
|
|
998
1053
|
* Emitten when a user select data source in Sage Embed
|
|
999
1054
|
*
|
|
1000
|
-
* @version SDK : 1.
|
|
1055
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1001
1056
|
*/
|
|
1002
1057
|
EmbedEvent["SageWorksheetUpdated"] = "sageWorksheetUpdated";
|
|
1058
|
+
/**
|
|
1059
|
+
* Emitten when a user updates a connection in Data tab
|
|
1060
|
+
*
|
|
1061
|
+
* @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
|
|
1062
|
+
*/
|
|
1063
|
+
EmbedEvent["UpdateConnection"] = "updateConnection";
|
|
1064
|
+
/**
|
|
1065
|
+
* Emitted when name, status (private or public) or filter values of a
|
|
1066
|
+
* PersonalisedView is updated.
|
|
1067
|
+
*
|
|
1068
|
+
* @returns viewName: string
|
|
1069
|
+
* @returns viewId: string
|
|
1070
|
+
* @returns liveboardId: string
|
|
1071
|
+
* @returns isPublic: boolean
|
|
1072
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1073
|
+
*/
|
|
1074
|
+
EmbedEvent["UpdatePersonalisedView"] = "updatePersonalisedView";
|
|
1075
|
+
/**
|
|
1076
|
+
* Emitted when a PersonalisedView is saved.
|
|
1077
|
+
*
|
|
1078
|
+
* @returns viewName: string
|
|
1079
|
+
* @returns viewId: string
|
|
1080
|
+
* @returns liveboardId: string
|
|
1081
|
+
* @returns isPublic: boolean
|
|
1082
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1083
|
+
*/
|
|
1084
|
+
EmbedEvent["SavePersonalisedView"] = "savePersonalisedView";
|
|
1085
|
+
/**
|
|
1086
|
+
* Emitted when a Liveboard is reset.
|
|
1087
|
+
*
|
|
1088
|
+
* @returns viewName: string
|
|
1089
|
+
* @returns viewId: string
|
|
1090
|
+
* @returns liveboardId: string
|
|
1091
|
+
* @returns isPublic: boolean
|
|
1092
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1093
|
+
*/
|
|
1094
|
+
EmbedEvent["ResetLiveboard"] = "resetLiveboard";
|
|
1095
|
+
/**
|
|
1096
|
+
* Emitted when a PersonalisedView is deleted.
|
|
1097
|
+
*
|
|
1098
|
+
* @returns views: string[]
|
|
1099
|
+
* @returns liveboardId: string
|
|
1100
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1101
|
+
*/
|
|
1102
|
+
EmbedEvent["DeletePersonalisedView"] = "deletePersonalisedView";
|
|
1103
|
+
/**
|
|
1104
|
+
* Emitten when a user creates a new worksheet
|
|
1105
|
+
*
|
|
1106
|
+
* @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
|
|
1107
|
+
*/
|
|
1108
|
+
EmbedEvent["CreateWorksheet"] = "createWorksheet";
|
|
1003
1109
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
1004
1110
|
(function (HostEvent) {
|
|
1005
1111
|
/**
|
|
@@ -1620,16 +1726,16 @@
|
|
|
1620
1726
|
*/
|
|
1621
1727
|
HostEvent["ResetSearch"] = "resetSearch";
|
|
1622
1728
|
/**
|
|
1729
|
+
* @hidden
|
|
1623
1730
|
* Gets the currents visible and runtime filters applied on a Liveboard
|
|
1624
|
-
*
|
|
1625
1731
|
* @example
|
|
1626
1732
|
* liveboardEmbed.trigger(HostEvent.GetFilters)
|
|
1627
1733
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
1628
1734
|
*/
|
|
1629
1735
|
HostEvent["GetFilters"] = "getFilters";
|
|
1630
1736
|
/**
|
|
1737
|
+
* @hidden
|
|
1631
1738
|
* Updates the visible filters on the Liveboard.
|
|
1632
|
-
*
|
|
1633
1739
|
* @param - filter: filter object containing column name and filter operation and values
|
|
1634
1740
|
* @example
|
|
1635
1741
|
*
|
|
@@ -1786,6 +1892,9 @@
|
|
|
1786
1892
|
Param["HideSampleQuestions"] = "hideSampleQuestions";
|
|
1787
1893
|
Param["WorksheetId"] = "worksheet";
|
|
1788
1894
|
Param["Query"] = "query";
|
|
1895
|
+
Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
|
|
1896
|
+
Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
|
|
1897
|
+
Param["PendoTrackingKey"] = "additionalPendoKey";
|
|
1789
1898
|
})(Param || (Param = {}));
|
|
1790
1899
|
(function (Action) {
|
|
1791
1900
|
/**
|
|
@@ -2261,7 +2370,7 @@
|
|
|
2261
2370
|
* disabledActions: [Action.QueryDetailsButtons]
|
|
2262
2371
|
* ```
|
|
2263
2372
|
*/
|
|
2264
|
-
Action["QueryDetailsButtons"] = "
|
|
2373
|
+
Action["QueryDetailsButtons"] = "queryDetailsButtons";
|
|
2265
2374
|
/**
|
|
2266
2375
|
* The **Delete** action for Answers.
|
|
2267
2376
|
*
|
|
@@ -2566,6 +2675,35 @@
|
|
|
2566
2675
|
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
2567
2676
|
*/
|
|
2568
2677
|
Action["ModifySageAnswer"] = "modifySageAnswer";
|
|
2678
|
+
/**
|
|
2679
|
+
* The **Move to Tab** menu action on visualizations in liveboard edit mode.
|
|
2680
|
+
* Allows moving a visualization to a different tab.
|
|
2681
|
+
*
|
|
2682
|
+
* @example
|
|
2683
|
+
* ```js
|
|
2684
|
+
* disabledActions: [Action.MoveToTab]
|
|
2685
|
+
* ```
|
|
2686
|
+
*/
|
|
2687
|
+
Action["MoveToTab"] = "onContainerMove";
|
|
2688
|
+
/**
|
|
2689
|
+
* The **Manage Alertsb** menu action on KPI visualizations.
|
|
2690
|
+
*
|
|
2691
|
+
* @example
|
|
2692
|
+
* ```js
|
|
2693
|
+
* disabledActions: [Action.ManageMonitor]
|
|
2694
|
+
* ```
|
|
2695
|
+
*/
|
|
2696
|
+
Action["ManageMonitor"] = "ManageMonitor";
|
|
2697
|
+
/**
|
|
2698
|
+
* Action ID for Liveboard Personalised Views dropdown
|
|
2699
|
+
*
|
|
2700
|
+
* @example
|
|
2701
|
+
* ```js
|
|
2702
|
+
* disabledActions: [Action.PersonalisedViewsDropdown]
|
|
2703
|
+
* ```
|
|
2704
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
2705
|
+
*/
|
|
2706
|
+
Action["PersonalisedViewsDropdown"] = "personalisedViewsDropdown";
|
|
2569
2707
|
})(exports.Action || (exports.Action = {}));
|
|
2570
2708
|
// eslint-disable-next-line no-shadow
|
|
2571
2709
|
var OperationType;
|
|
@@ -8645,6 +8783,7 @@
|
|
|
8645
8783
|
|
|
8646
8784
|
// Needed to avoid error in CJS builds on some bundlers.
|
|
8647
8785
|
const mixpanelLib = mixpanel_cjs || mixpanel$1;
|
|
8786
|
+
let mixpanelInstance;
|
|
8648
8787
|
const MIXPANEL_EVENT = {
|
|
8649
8788
|
VISUAL_SDK_RENDER_START: 'visual-sdk-render-start',
|
|
8650
8789
|
VISUAL_SDK_CALLED_INIT: 'visual-sdk-called-init',
|
|
@@ -8653,6 +8792,7 @@
|
|
|
8653
8792
|
VISUAL_SDK_TRIGGER: 'visual-sdk-trigger',
|
|
8654
8793
|
VISUAL_SDK_ON: 'visual-sdk-on',
|
|
8655
8794
|
VISUAL_SDK_IFRAME_LOAD_PERFORMANCE: 'visual-sdk-iframe-load-performance',
|
|
8795
|
+
VISUAL_SDK_EMBED_CREATE: 'visual-sdk-embed-create',
|
|
8656
8796
|
};
|
|
8657
8797
|
let isMixpanelInitialized = false;
|
|
8658
8798
|
let eventQueue = [];
|
|
@@ -8667,7 +8807,7 @@
|
|
|
8667
8807
|
eventQueue.push({ eventId, eventProps });
|
|
8668
8808
|
return;
|
|
8669
8809
|
}
|
|
8670
|
-
|
|
8810
|
+
mixpanelInstance.track(eventId, eventProps);
|
|
8671
8811
|
}
|
|
8672
8812
|
/**
|
|
8673
8813
|
*
|
|
@@ -8695,10 +8835,15 @@
|
|
|
8695
8835
|
const token = sessionInfo.mixpanelToken;
|
|
8696
8836
|
try {
|
|
8697
8837
|
if (token) {
|
|
8698
|
-
mixpanelLib.init(token);
|
|
8838
|
+
mixpanelInstance = mixpanelLib.init(token, undefined, 'tsEmbed');
|
|
8699
8839
|
if (!isPublicCluster) {
|
|
8700
|
-
|
|
8840
|
+
mixpanelInstance.identify(sessionInfo.userGUID);
|
|
8701
8841
|
}
|
|
8842
|
+
mixpanelInstance.register_once({
|
|
8843
|
+
clusterId: sessionInfo.clusterId,
|
|
8844
|
+
clusterName: sessionInfo.clusterName,
|
|
8845
|
+
releaseVersion: sessionInfo.releaseVersion,
|
|
8846
|
+
});
|
|
8702
8847
|
isMixpanelInitialized = true;
|
|
8703
8848
|
emptyQueue();
|
|
8704
8849
|
}
|
|
@@ -9635,6 +9780,9 @@
|
|
|
9635
9780
|
userGUID: sessionInfoResp.userGUID,
|
|
9636
9781
|
mixpanelToken,
|
|
9637
9782
|
isPublicUser: sessionInfoResp.configInfo.isPublicUser,
|
|
9783
|
+
releaseVersion: sessionInfoResp.releaseVersion,
|
|
9784
|
+
clusterId: sessionInfoResp.configInfo.selfClusterId,
|
|
9785
|
+
clusterName: sessionInfoResp.configInfo.selfClusterName,
|
|
9638
9786
|
...sessionInfoResp,
|
|
9639
9787
|
};
|
|
9640
9788
|
};
|
|
@@ -10170,7 +10318,7 @@
|
|
|
10170
10318
|
});
|
|
10171
10319
|
}
|
|
10172
10320
|
|
|
10173
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.24.0
|
|
10321
|
+
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$1={".":{"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$1,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};
|
|
10174
10322
|
|
|
10175
10323
|
/**
|
|
10176
10324
|
* Copyright (c) 2022
|
|
@@ -10218,6 +10366,7 @@
|
|
|
10218
10366
|
* @param responder
|
|
10219
10367
|
*/
|
|
10220
10368
|
this.appInitCb = async (_, responder) => {
|
|
10369
|
+
var _a, _b;
|
|
10221
10370
|
let authToken = '';
|
|
10222
10371
|
if (this.embedConfig.authType === AuthType.TrustedAuthTokenCookieless) {
|
|
10223
10372
|
authToken = await getAuthenticaionToken(this.embedConfig);
|
|
@@ -10228,8 +10377,14 @@
|
|
|
10228
10377
|
data: {
|
|
10229
10378
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
10230
10379
|
authToken,
|
|
10231
|
-
runtimeFilterParams:
|
|
10380
|
+
runtimeFilterParams: this.viewConfig.excludeRuntimeFiltersfromURL
|
|
10381
|
+
? getRuntimeFilters(this.viewConfig.runtimeFilters)
|
|
10382
|
+
: null,
|
|
10383
|
+
hiddenHomepageModules: this.viewConfig.hiddenHomepageModules || [],
|
|
10232
10384
|
hostConfig: this.embedConfig.hostConfig,
|
|
10385
|
+
hiddenHomeLeftNavItems: ((_a = this.viewConfig) === null || _a === void 0 ? void 0 : _a.hiddenHomeLeftNavItems)
|
|
10386
|
+
? (_b = this.viewConfig) === null || _b === void 0 ? void 0 : _b.hiddenHomeLeftNavItems
|
|
10387
|
+
: [],
|
|
10233
10388
|
},
|
|
10234
10389
|
});
|
|
10235
10390
|
};
|
|
@@ -10257,8 +10412,8 @@
|
|
|
10257
10412
|
* Register APP_INIT event and sendback init payload
|
|
10258
10413
|
*/
|
|
10259
10414
|
this.registerAppInit = () => {
|
|
10260
|
-
this.on(exports.EmbedEvent.APP_INIT, this.appInitCb);
|
|
10261
|
-
this.on(exports.EmbedEvent.AuthExpire, this.updateAuthToken);
|
|
10415
|
+
this.on(exports.EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
|
|
10416
|
+
this.on(exports.EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
10262
10417
|
};
|
|
10263
10418
|
this.el = getDOMNode(domSelector);
|
|
10264
10419
|
// TODO: handle error
|
|
@@ -10273,6 +10428,9 @@
|
|
|
10273
10428
|
this.viewConfig = viewConfig;
|
|
10274
10429
|
this.shouldEncodeUrlQueryParams = this.embedConfig.shouldEncodeUrlQueryParams;
|
|
10275
10430
|
this.registerAppInit();
|
|
10431
|
+
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
10432
|
+
...viewConfig,
|
|
10433
|
+
});
|
|
10276
10434
|
}
|
|
10277
10435
|
/**
|
|
10278
10436
|
* Throws error encountered during initialization.
|
|
@@ -10403,6 +10561,9 @@
|
|
|
10403
10561
|
if (this.embedConfig.authType === AuthType.TrustedAuthTokenCookieless) {
|
|
10404
10562
|
queryParams[Param.cookieless] = true;
|
|
10405
10563
|
}
|
|
10564
|
+
if (this.embedConfig.pendoTrackingKey) {
|
|
10565
|
+
queryParams[Param.PendoTrackingKey] = this.embedConfig.pendoTrackingKey;
|
|
10566
|
+
}
|
|
10406
10567
|
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, } = this.viewConfig;
|
|
10407
10568
|
if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
|
|
10408
10569
|
this.handleError('You cannot have both hidden actions and visible actions');
|
|
@@ -10555,7 +10716,6 @@
|
|
|
10555
10716
|
this.insertIntoDOM(this.embedConfig.loginFailedMessage);
|
|
10556
10717
|
return;
|
|
10557
10718
|
}
|
|
10558
|
-
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_COMPLETE);
|
|
10559
10719
|
this.iFrame = this.iFrame || this.createIframeEl(url);
|
|
10560
10720
|
this.iFrame.addEventListener('load', () => {
|
|
10561
10721
|
nextInQueue();
|
|
@@ -10566,7 +10726,9 @@
|
|
|
10566
10726
|
},
|
|
10567
10727
|
type: exports.EmbedEvent.Load,
|
|
10568
10728
|
});
|
|
10569
|
-
uploadMixpanelEvent(MIXPANEL_EVENT.
|
|
10729
|
+
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_COMPLETE, {
|
|
10730
|
+
elWidth: this.iFrame.clientWidth,
|
|
10731
|
+
elHeight: this.iFrame.clientHeight,
|
|
10570
10732
|
timeTookToLoad: loadTimestamp - initTimestamp,
|
|
10571
10733
|
});
|
|
10572
10734
|
});
|
|
@@ -10709,6 +10871,8 @@
|
|
|
10709
10871
|
* @param messageType The message type
|
|
10710
10872
|
* @param callback A callback as a function
|
|
10711
10873
|
* @param options The message options
|
|
10874
|
+
* @param isSelf
|
|
10875
|
+
* @param isRegisteredBySDK
|
|
10712
10876
|
* @example
|
|
10713
10877
|
* ```js
|
|
10714
10878
|
* tsEmbed.on(EmbedEvent.Error, (data) => {
|
|
@@ -10724,7 +10888,10 @@
|
|
|
10724
10888
|
* });
|
|
10725
10889
|
* ```
|
|
10726
10890
|
*/
|
|
10727
|
-
on(messageType, callback, options = { start: false }) {
|
|
10891
|
+
on(messageType, callback, options = { start: false }, isRegisteredBySDK = false) {
|
|
10892
|
+
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_ON}-${messageType}`, {
|
|
10893
|
+
isRegisteredBySDK,
|
|
10894
|
+
});
|
|
10728
10895
|
if (this.isRendered) {
|
|
10729
10896
|
this.handleError('Please register event handlers before calling render');
|
|
10730
10897
|
}
|
|
@@ -10881,8 +11048,10 @@
|
|
|
10881
11048
|
let queryString = queryParams;
|
|
10882
11049
|
if (!this.viewConfig.excludeRuntimeFiltersfromURL) {
|
|
10883
11050
|
const runtimeFilters = this.viewConfig.runtimeFilters;
|
|
11051
|
+
const runtimeParameters = this.viewConfig.runtimeParameters;
|
|
11052
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
10884
11053
|
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
10885
|
-
queryString = [filterQuery, queryParams].filter(Boolean).join('&');
|
|
11054
|
+
queryString = [parameterQuery, filterQuery, queryParams].filter(Boolean).join('&');
|
|
10886
11055
|
}
|
|
10887
11056
|
return this.getV1EmbedBasePath(queryString);
|
|
10888
11057
|
}
|
|
@@ -10905,7 +11074,6 @@
|
|
|
10905
11074
|
*/
|
|
10906
11075
|
on(messageType, callback, options = { start: false }) {
|
|
10907
11076
|
const eventType = this.getCompatibleEventType(messageType);
|
|
10908
|
-
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_ON}-${messageType}`);
|
|
10909
11077
|
return super.on(eventType, callback, options);
|
|
10910
11078
|
}
|
|
10911
11079
|
}
|
|
@@ -10929,7 +11097,7 @@
|
|
|
10929
11097
|
*/
|
|
10930
11098
|
getIFrameSrc() {
|
|
10931
11099
|
var _a;
|
|
10932
|
-
const { searchOptions, dataSource, dataSources } = this.viewConfig;
|
|
11100
|
+
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, } = this.viewConfig;
|
|
10933
11101
|
const path = 'search-bar-embed';
|
|
10934
11102
|
const queryParams = this.getBaseQueryParams();
|
|
10935
11103
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
@@ -10945,7 +11113,10 @@
|
|
|
10945
11113
|
queryParams[Param.executeSearch] = true;
|
|
10946
11114
|
}
|
|
10947
11115
|
}
|
|
10948
|
-
queryParams[Param.UseLastSelectedDataSource] =
|
|
11116
|
+
queryParams[Param.UseLastSelectedDataSource] = useLastSelectedSources;
|
|
11117
|
+
if (dataSource || dataSources) {
|
|
11118
|
+
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
11119
|
+
}
|
|
10949
11120
|
queryParams[Param.searchEmbed] = true;
|
|
10950
11121
|
let query = '';
|
|
10951
11122
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
@@ -11096,7 +11267,7 @@
|
|
|
11096
11267
|
}
|
|
11097
11268
|
getEmbedParams() {
|
|
11098
11269
|
var _a;
|
|
11099
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, dataPanelV2 = false, } = this.viewConfig;
|
|
11270
|
+
const { hideResults, expandAllDataSource, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, } = this.viewConfig;
|
|
11100
11271
|
const queryParams = this.getBaseQueryParams();
|
|
11101
11272
|
queryParams[Param.HideActions] = [
|
|
11102
11273
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -11125,13 +11296,19 @@
|
|
|
11125
11296
|
}
|
|
11126
11297
|
queryParams[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
11127
11298
|
queryParams[Param.DataSourceMode] = this.getDataSourceMode();
|
|
11128
|
-
queryParams[Param.UseLastSelectedDataSource] =
|
|
11299
|
+
queryParams[Param.UseLastSelectedDataSource] = useLastSelectedSources;
|
|
11300
|
+
if (dataSource || dataSources) {
|
|
11301
|
+
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
11302
|
+
}
|
|
11129
11303
|
queryParams[Param.searchEmbed] = true;
|
|
11130
11304
|
let query = '';
|
|
11131
11305
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
11132
11306
|
if (queryParamsString) {
|
|
11133
11307
|
query = `?${queryParamsString}`;
|
|
11134
11308
|
}
|
|
11309
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
11310
|
+
if (parameterQuery)
|
|
11311
|
+
query += `&${parameterQuery}`;
|
|
11135
11312
|
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
11136
11313
|
if (filterQuery && !excludeRuntimeFiltersfromURL) {
|
|
11137
11314
|
query += `&${filterQuery}`;
|
|
@@ -11248,7 +11425,7 @@
|
|
|
11248
11425
|
* embedded Liveboard or visualization.
|
|
11249
11426
|
*/
|
|
11250
11427
|
getEmbedParams() {
|
|
11251
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, } = this.viewConfig;
|
|
11428
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideHomepageLeftNav = false, modularHomeExperience = false, } = this.viewConfig;
|
|
11252
11429
|
let params = {};
|
|
11253
11430
|
params[Param.EmbedApp] = true;
|
|
11254
11431
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
@@ -11272,6 +11449,8 @@
|
|
|
11272
11449
|
params[Param.EnableSearchAssist] = enableSearchAssist;
|
|
11273
11450
|
}
|
|
11274
11451
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
11452
|
+
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
11453
|
+
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
11275
11454
|
const queryParams = getQueryParamString(params, true);
|
|
11276
11455
|
return queryParams;
|
|
11277
11456
|
}
|
|
@@ -11281,8 +11460,8 @@
|
|
|
11281
11460
|
* @param pageId The ID of the page to be embedded.
|
|
11282
11461
|
*/
|
|
11283
11462
|
getIFrameSrc() {
|
|
11284
|
-
const { pageId, path } = this.viewConfig;
|
|
11285
|
-
const pageRoute = this.formatPath(path) || this.getPageRoute(pageId);
|
|
11463
|
+
const { pageId, path, modularHomeExperience } = this.viewConfig;
|
|
11464
|
+
const pageRoute = this.formatPath(path) || this.getPageRoute(pageId, modularHomeExperience);
|
|
11286
11465
|
let url = `${this.getRootIframeSrc()}/${pageRoute}`;
|
|
11287
11466
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
11288
11467
|
url = `${url}${tsPostHashParams}`;
|
|
@@ -11292,21 +11471,22 @@
|
|
|
11292
11471
|
* Gets the ThoughtSpot route of the page for a particular page ID.
|
|
11293
11472
|
*
|
|
11294
11473
|
* @param pageId The identifier for a page in the ThoughtSpot app.
|
|
11474
|
+
* @param modularHomeExperience
|
|
11295
11475
|
*/
|
|
11296
|
-
getPageRoute(pageId) {
|
|
11476
|
+
getPageRoute(pageId, modularHomeExperience = false) {
|
|
11297
11477
|
switch (pageId) {
|
|
11298
11478
|
case exports.Page.Search:
|
|
11299
11479
|
return 'answer';
|
|
11300
11480
|
case exports.Page.Answers:
|
|
11301
|
-
return 'answers';
|
|
11481
|
+
return modularHomeExperience ? 'home/answers' : 'answers';
|
|
11302
11482
|
case exports.Page.Liveboards:
|
|
11303
|
-
return 'pinboards';
|
|
11483
|
+
return modularHomeExperience ? 'home/liveboards' : 'pinboards';
|
|
11304
11484
|
case exports.Page.Pinboards:
|
|
11305
|
-
return 'pinboards';
|
|
11485
|
+
return modularHomeExperience ? 'home/liveboards' : 'pinboards';
|
|
11306
11486
|
case exports.Page.Data:
|
|
11307
11487
|
return 'data/tables';
|
|
11308
11488
|
case exports.Page.SpotIQ:
|
|
11309
|
-
return 'insights/results';
|
|
11489
|
+
return modularHomeExperience ? 'home/spotiq-analysis' : 'insights/results';
|
|
11310
11490
|
case exports.Page.Home:
|
|
11311
11491
|
default:
|
|
11312
11492
|
return 'home';
|
|
@@ -11435,7 +11615,7 @@
|
|
|
11435
11615
|
let params = {};
|
|
11436
11616
|
params[Param.EmbedApp] = true;
|
|
11437
11617
|
params = this.getBaseQueryParams(params);
|
|
11438
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, } = this.viewConfig;
|
|
11618
|
+
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, runtimeParameters, } = this.viewConfig;
|
|
11439
11619
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
11440
11620
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
11441
11621
|
if (fullHeight === true) {
|
|
@@ -11463,7 +11643,10 @@
|
|
|
11463
11643
|
if (hideTabPanel) {
|
|
11464
11644
|
params[Param.HideTabPanel] = hideTabPanel;
|
|
11465
11645
|
}
|
|
11466
|
-
|
|
11646
|
+
let queryParams = getQueryParamString(params, true);
|
|
11647
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
11648
|
+
if (parameterQuery)
|
|
11649
|
+
queryParams += `&${parameterQuery}`;
|
|
11467
11650
|
return queryParams;
|
|
11468
11651
|
}
|
|
11469
11652
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
@@ -11679,9 +11862,11 @@
|
|
|
11679
11862
|
* return <LiveboardEmbed ref={ref} liveboardId={<id>} />
|
|
11680
11863
|
* }
|
|
11681
11864
|
* ```
|
|
11682
|
-
* @returns {React.MutableRefObject<TsEmbed>} ref
|
|
11865
|
+
* @returns {React.MutableRefObject<T extends TsEmbed>} ref
|
|
11683
11866
|
*/
|
|
11684
|
-
|
|
11867
|
+
function useEmbedRef() {
|
|
11868
|
+
return React__default['default'].useRef(null);
|
|
11869
|
+
}
|
|
11685
11870
|
|
|
11686
11871
|
exports.AppEmbed = AppEmbed$1;
|
|
11687
11872
|
exports.LiveboardEmbed = LiveboardEmbed$1;
|