@thoughtspot/visual-embed-sdk 1.52.1 → 1.52.2-beta.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/cjs/package.json +10 -3
- 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.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.spec.js +24 -13
- package/cjs/src/embed/auto-frame-renderer.spec.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 +3 -3
- 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 +17 -12
- 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/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 +35 -10
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +108 -73
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +203 -30
- 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-BrJMbt8r.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 +35 -10
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.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 +252 -126
- package/dist/tsembed-react.js +251 -125
- package/dist/tsembed.es.js +460 -127
- package/dist/tsembed.js +459 -125
- package/dist/visual-embed-sdk-react-full.d.ts +233 -49
- package/dist/visual-embed-sdk-react.d.ts +139 -49
- package/dist/visual-embed-sdk.d.ts +233 -49
- package/lib/package.json +10 -3
- 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.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.spec.js +24 -13
- package/lib/src/embed/auto-frame-renderer.spec.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 +4 -4
- 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 +17 -12
- 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/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 +35 -10
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +109 -74
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +203 -30
- 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 +233 -49
- package/package.json +10 -3
- package/src/contracts/host-event-contracts.ts +55 -11
- package/src/embed/app.spec.ts +15 -0
- package/src/embed/app.ts +4 -3
- package/src/embed/auto-frame-renderer.spec.ts +24 -13
- package/src/embed/conversation.spec.ts +38 -27
- package/src/embed/conversation.ts +4 -4
- 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 +21 -15
- package/src/embed/spotter-utils.spec.ts +29 -0
- package/src/embed/spotter-utils.ts +16 -0
- package/src/embed/ts-embed.spec.ts +245 -30
- package/src/embed/ts-embed.ts +107 -74
- 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-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.52.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.52.2-beta.0 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -3973,6 +3973,12 @@
|
|
|
3973
3973
|
* ```js
|
|
3974
3974
|
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
|
|
3975
3975
|
* console.log('data', data);
|
|
3976
|
+
* // {
|
|
3977
|
+
* // liveboardFilters: [ ... ],
|
|
3978
|
+
* // runtimeFilters: [
|
|
3979
|
+
* // { columnName: "Region", operator: "IN", values: ["West"] }
|
|
3980
|
+
* // ]
|
|
3981
|
+
* // }
|
|
3976
3982
|
* ```
|
|
3977
3983
|
* @example
|
|
3978
3984
|
* ```js
|
|
@@ -3997,9 +4003,9 @@
|
|
|
3997
4003
|
*
|
|
3998
4004
|
* Each filter object must include the following attributes:
|
|
3999
4005
|
*
|
|
4000
|
-
* `
|
|
4006
|
+
* `columnName` - Name of the column to filter on.
|
|
4001
4007
|
*
|
|
4002
|
-
* `
|
|
4008
|
+
* `operator` - Filter operator, for example, EQ, IN, CONTAINS.
|
|
4003
4009
|
* For information about the supported filter operators,
|
|
4004
4010
|
* see link:https://developers.thoughtspot.com/docs/runtime-filters#rtOperator[Developer Documentation].
|
|
4005
4011
|
*
|
|
@@ -4026,8 +4032,8 @@
|
|
|
4026
4032
|
*
|
|
4027
4033
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
4028
4034
|
* filter: {
|
|
4029
|
-
*
|
|
4030
|
-
*
|
|
4035
|
+
* columnName: "item type",
|
|
4036
|
+
* operator: "IN",
|
|
4031
4037
|
* values: ["bags","shirts"]
|
|
4032
4038
|
* }
|
|
4033
4039
|
* });
|
|
@@ -4037,8 +4043,8 @@
|
|
|
4037
4043
|
*
|
|
4038
4044
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
4039
4045
|
* filter: {
|
|
4040
|
-
*
|
|
4041
|
-
*
|
|
4046
|
+
* columnName: "date",
|
|
4047
|
+
* operator: "EQ",
|
|
4042
4048
|
* values: ["JULY","2023"],
|
|
4043
4049
|
* type: "MONTH_YEAR"
|
|
4044
4050
|
* }
|
|
@@ -4049,18 +4055,18 @@
|
|
|
4049
4055
|
* ```js
|
|
4050
4056
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
4051
4057
|
* filters: [{
|
|
4052
|
-
*
|
|
4053
|
-
*
|
|
4058
|
+
* columnName: "Item Type",
|
|
4059
|
+
* operator: 'IN',
|
|
4054
4060
|
* values: ["bags","shirts"]
|
|
4055
4061
|
* },
|
|
4056
4062
|
* {
|
|
4057
|
-
*
|
|
4058
|
-
*
|
|
4063
|
+
* columnName: "Region",
|
|
4064
|
+
* operator: 'IN',
|
|
4059
4065
|
* values: ["West","Midwest"]
|
|
4060
4066
|
* },
|
|
4061
4067
|
* {
|
|
4062
|
-
*
|
|
4063
|
-
*
|
|
4068
|
+
* columnName: "Date",
|
|
4069
|
+
* operator: 'EQ',
|
|
4064
4070
|
* values: ["2023-07-31"],
|
|
4065
4071
|
* type: "EXACT_DATE"
|
|
4066
4072
|
* }]
|
|
@@ -4074,13 +4080,13 @@
|
|
|
4074
4080
|
* ```js
|
|
4075
4081
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
4076
4082
|
* filters: [{
|
|
4077
|
-
*
|
|
4078
|
-
*
|
|
4083
|
+
* columnName: "(Sample) Retail - Apparel::city",
|
|
4084
|
+
* operator: 'IN',
|
|
4079
4085
|
* values: ["atlanta"]
|
|
4080
4086
|
* },
|
|
4081
4087
|
* {
|
|
4082
|
-
*
|
|
4083
|
-
*
|
|
4088
|
+
* columnName: "(Sample) Retail - Apparel::Region",
|
|
4089
|
+
* operator: 'IN',
|
|
4084
4090
|
* values: ["West","Midwest"]
|
|
4085
4091
|
* }]
|
|
4086
4092
|
* });
|
|
@@ -4091,8 +4097,8 @@
|
|
|
4091
4097
|
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
4092
4098
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
4093
4099
|
* filter: {
|
|
4094
|
-
*
|
|
4095
|
-
*
|
|
4100
|
+
* columnName: "item type",
|
|
4101
|
+
* operator: "IN",
|
|
4096
4102
|
* values: ["shoes", "boots"]
|
|
4097
4103
|
* }
|
|
4098
4104
|
* }, ContextType.Liveboard);
|
|
@@ -4102,8 +4108,8 @@
|
|
|
4102
4108
|
* // Scope the filter to a specific Liveboard tab
|
|
4103
4109
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
4104
4110
|
* filter: {
|
|
4105
|
-
*
|
|
4106
|
-
*
|
|
4111
|
+
* columnName: "item type",
|
|
4112
|
+
* operator: "IN",
|
|
4107
4113
|
* values: ["bags", "shirts"],
|
|
4108
4114
|
* applicability: {
|
|
4109
4115
|
* level: "TAB",
|
|
@@ -4112,6 +4118,12 @@
|
|
|
4112
4118
|
* }
|
|
4113
4119
|
* });
|
|
4114
4120
|
* ```
|
|
4121
|
+
* Use `columnName` and `operator` - the same spelling as
|
|
4122
|
+
* {@link RuntimeFilter}. The older `column` and `oper` spellings are
|
|
4123
|
+
* deprecated; they are still accepted, but pass only one spelling of each
|
|
4124
|
+
* field, never both. To reapply the filter state captured from
|
|
4125
|
+
* {@link EmbedEvent.FilterChanged}, use `convertFilterChangedToUpdateFiltersPayload`
|
|
4126
|
+
* to convert its payload into the shape expected here.
|
|
4115
4127
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
4116
4128
|
*/
|
|
4117
4129
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
@@ -5097,7 +5109,6 @@
|
|
|
5097
5109
|
Param["IsStarterPromptsEnabled"] = "enableStarterPrompts";
|
|
5098
5110
|
Param["UpdatedSpotterExperience"] = "updatedSpotterExperience";
|
|
5099
5111
|
Param["SpotterDataSources"] = "spotterDataSources";
|
|
5100
|
-
Param["AnalystId"] = "analystId";
|
|
5101
5112
|
Param["OpenSpotterOnLiveboardByDefault"] = "openSpotterOnLiveboardByDefault";
|
|
5102
5113
|
Param["ShowAnswerEditPanel"] = "showAnswerEditPanel";
|
|
5103
5114
|
})(Param || (Param = {}));
|
|
@@ -7323,6 +7334,18 @@
|
|
|
7323
7334
|
* ```
|
|
7324
7335
|
*/
|
|
7325
7336
|
Action["DeleteCollection"] = "deleteCollection";
|
|
7337
|
+
/**
|
|
7338
|
+
* Controls the visibility of the "Customize homepage" button on the
|
|
7339
|
+
* embedded home page.
|
|
7340
|
+
* @version SDK: 1.55.0 | ThoughtSpot Cloud: 26.12.0.cl
|
|
7341
|
+
* @example
|
|
7342
|
+
* ```js
|
|
7343
|
+
* {
|
|
7344
|
+
* hiddenActions: [Action.CustomizeHomepage],
|
|
7345
|
+
* }
|
|
7346
|
+
* ```
|
|
7347
|
+
*/
|
|
7348
|
+
Action["CustomizeHomepage"] = "customizeHomepage";
|
|
7326
7349
|
})(exports.Action || (exports.Action = {}));
|
|
7327
7350
|
var PrefetchFeatures;
|
|
7328
7351
|
(function (PrefetchFeatures) {
|
|
@@ -7827,7 +7850,7 @@
|
|
|
7827
7850
|
TableContentDensity["Compact"] = "COMPACT";
|
|
7828
7851
|
})(TableContentDensity || (TableContentDensity = {}));
|
|
7829
7852
|
|
|
7830
|
-
var version$1="1.52.
|
|
7853
|
+
var version$1="1.52.2-beta.0";var pkg = {version:version$1};
|
|
7831
7854
|
|
|
7832
7855
|
const { version } = pkg;
|
|
7833
7856
|
|
|
@@ -7931,7 +7954,7 @@
|
|
|
7931
7954
|
SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
|
|
7932
7955
|
UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
|
|
7933
7956
|
INVALID_SPOTTER_DOCUMENTATION_URL: 'Invalid spotterDocumentationUrl. Please provide a valid http or https URL.',
|
|
7934
|
-
UPDATEFILTERS_INVALID_PAYLOAD: 'UpdateFilters requires a valid filter or filters array. Expected: { filter: {
|
|
7957
|
+
UPDATEFILTERS_INVALID_PAYLOAD: 'UpdateFilters requires a valid filter or filters array. Expected: { filter: { columnName, operator, values } } or { filters: [{ columnName, operator, values }, ...] }',
|
|
7935
7958
|
DRILLDOWN_INVALID_PAYLOAD: 'DrillDown requires a valid points object. Expected: { points: { clickedPoint?, selectedPoints? }, autoDrillDown?, vizId? }',
|
|
7936
7959
|
UPDATEPARAMETERS_INVALID_PAYLOAD: 'UpdateParameters received an invalid applicability. Expected: { level: LIVEBOARD | TAB | GROUP, targetId } where targetId is required for TAB and GROUP levels',
|
|
7937
7960
|
};
|
|
@@ -21358,7 +21381,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21358
21381
|
const isValidApplicability = (a) => {
|
|
21359
21382
|
if (isUndefined_1(a))
|
|
21360
21383
|
return true;
|
|
21361
|
-
// targetId is not required at LIVEBOARD level, since the filter applies to
|
|
21384
|
+
// targetId is not required at LIVEBOARD level, since the filter applies to
|
|
21385
|
+
// the whole Liveboard
|
|
21362
21386
|
return isPlainObject_1(a)
|
|
21363
21387
|
&& Object.values(ApplicabilityLevel).includes(a.level)
|
|
21364
21388
|
&& (a.level === ApplicabilityLevel.Liveboard || (isString_1(a.targetId) && a.targetId.trim().length > 0));
|
|
@@ -21377,8 +21401,52 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21377
21401
|
const hasValidFilters = Array.isArray(payload.filters) && payload.filters.length > 0 && payload.filters.every(isValidFilter);
|
|
21378
21402
|
return !!(hasValidFilter || hasValidFilters);
|
|
21379
21403
|
}
|
|
21404
|
+
/**
|
|
21405
|
+
* Rewrites one filter's `columnName`/`operator` to `column`/`oper`.
|
|
21406
|
+
*
|
|
21407
|
+
* Callers may use either spelling: `columnName`/`operator` match
|
|
21408
|
+
* {@link RuntimeFilter} and the `EmbedEvent.FilterChanged` payload, so a
|
|
21409
|
+
* converted payload can be replayed as-is. But the payload is forwarded to the
|
|
21410
|
+
* embedded app unchanged, and only `column`/`oper` are known to be understood
|
|
21411
|
+
* there - so the alias must be swapped here, or it would pass validation and
|
|
21412
|
+
* then be silently ignored.
|
|
21413
|
+
*
|
|
21414
|
+
* If a caller supplies both spellings of a field - which TypeScript rejects,
|
|
21415
|
+
* but JavaScript callers can still do - the documented `columnName`/`operator`
|
|
21416
|
+
* wins. Deferring to the deprecated spelling would quietly discard the value
|
|
21417
|
+
* the rest of the SDK tells people to use.
|
|
21418
|
+
* @param filter One entry from the UpdateFilters payload.
|
|
21419
|
+
*/
|
|
21420
|
+
function resolveFilterAliases(filter) {
|
|
21421
|
+
var _a, _b;
|
|
21422
|
+
if (!isPlainObject_1(filter))
|
|
21423
|
+
return filter;
|
|
21424
|
+
const column = (_a = filter.columnName) !== null && _a !== void 0 ? _a : filter.column;
|
|
21425
|
+
const oper = (_b = filter.operator) !== null && _b !== void 0 ? _b : filter.oper;
|
|
21426
|
+
const { columnName, operator, ...rest } = filter;
|
|
21427
|
+
return {
|
|
21428
|
+
...rest,
|
|
21429
|
+
...(isUndefined_1(column) ? {} : { column }),
|
|
21430
|
+
...(isUndefined_1(oper) ? {} : { oper }),
|
|
21431
|
+
};
|
|
21432
|
+
}
|
|
21433
|
+
/**
|
|
21434
|
+
* Rewrites every filter in an UpdateFilters payload to use `column`/`oper`,
|
|
21435
|
+
* whichever spelling the caller supplied. Call after validation.
|
|
21436
|
+
* @param payload The UpdateFilters host event payload.
|
|
21437
|
+
*/
|
|
21438
|
+
function resolveUpdateFiltersAliases(payload) {
|
|
21439
|
+
if (!isPlainObject_1(payload))
|
|
21440
|
+
return payload;
|
|
21441
|
+
return {
|
|
21442
|
+
...payload,
|
|
21443
|
+
...(payload.filter ? { filter: resolveFilterAliases(payload.filter) } : {}),
|
|
21444
|
+
...(Array.isArray(payload.filters) ? { filters: payload.filters.map(resolveFilterAliases) } : {}),
|
|
21445
|
+
};
|
|
21446
|
+
}
|
|
21380
21447
|
function isValidUpdateParametersPayload(payload) {
|
|
21381
|
-
// Only validates the applicability of each parameter (null treated as
|
|
21448
|
+
// Only validates the applicability of each parameter (null treated as
|
|
21449
|
+
// absent); the rest is forwarded as-is for backward compatibility.
|
|
21382
21450
|
if (!Array.isArray(payload))
|
|
21383
21451
|
return true;
|
|
21384
21452
|
return payload.every((p) => {
|
|
@@ -21426,7 +21494,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21426
21494
|
/**
|
|
21427
21495
|
* Maps HostEvent to its corresponding UIPassthroughEvent.
|
|
21428
21496
|
* Includes both custom-handler events (Pin, SaveAnswer, UpdateFilters, DrillDown)
|
|
21429
|
-
* and getter events (GetAnswerSession, GetFilters, etc.) that use
|
|
21497
|
+
* and getter events (GetAnswerSession, GetFilters, etc.) that use
|
|
21498
|
+
* getDataWithPassthroughFallback.
|
|
21430
21499
|
*/
|
|
21431
21500
|
const PASSTHROUGH_MAP = {
|
|
21432
21501
|
// Custom handlers (setters with special logic)
|
|
@@ -21577,17 +21646,21 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21577
21646
|
throwUpdateFiltersValidationError();
|
|
21578
21647
|
}
|
|
21579
21648
|
// The shared contract accepts both current (columnName/operator) and
|
|
21580
|
-
// legacy (column/oper) filter field names
|
|
21581
|
-
//
|
|
21582
|
-
//
|
|
21583
|
-
//
|
|
21584
|
-
|
|
21649
|
+
// legacy (column/oper) filter field names, but only the legacy pair is
|
|
21650
|
+
// understood downstream, so the payload is rewritten before it is
|
|
21651
|
+
// forwarded — otherwise a columnName/operator filter passes validation
|
|
21652
|
+
// here and is then silently ignored by the app. The cast bridges the
|
|
21653
|
+
// UIPassthrough FilterUpdate type, which still declares only the legacy
|
|
21654
|
+
// names.
|
|
21655
|
+
const resolvedPayload = resolveUpdateFiltersAliases(payload);
|
|
21656
|
+
return this.handleHostEventWithParam(UIPassthroughEvent.UpdateFilters, resolvedPayload, context);
|
|
21585
21657
|
}
|
|
21586
21658
|
handleUpdateParametersEvent(payload, context) {
|
|
21587
21659
|
if (!isValidUpdateParametersPayload(payload)) {
|
|
21588
21660
|
throwUpdateParametersValidationError();
|
|
21589
21661
|
}
|
|
21590
|
-
// UpdateParameters has no UI passthrough contract; dispatch over the
|
|
21662
|
+
// UpdateParameters has no UI passthrough contract; dispatch over the
|
|
21663
|
+
// legacy channel
|
|
21591
21664
|
return this.hostEventFallback(exports.HostEvent.UpdateParameters, payload, context);
|
|
21592
21665
|
}
|
|
21593
21666
|
handleDrillDownEvent(payload, context) {
|
|
@@ -21598,8 +21671,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21598
21671
|
}
|
|
21599
21672
|
/**
|
|
21600
21673
|
* Dispatches a host event using the appropriate channel:
|
|
21601
|
-
* 1. If the embedded app supports UI passthrough for this event, use it (custom
|
|
21602
|
-
* 2. Otherwise fall back to the legacy host event channel.
|
|
21674
|
+
* 1. If the embedded app supports UI passthrough for this event, use it (custom
|
|
21675
|
+
* handler or getter). 2. Otherwise fall back to the legacy host event channel.
|
|
21603
21676
|
*
|
|
21604
21677
|
* @param hostEvent - The host event to trigger
|
|
21605
21678
|
* @param payload - Optional payload for the event
|
|
@@ -21608,7 +21681,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21608
21681
|
async triggerHostEvent(hostEvent, payload, context) {
|
|
21609
21682
|
const customHandler = this.customHandlers[hostEvent];
|
|
21610
21683
|
const passthroughEvent = PASSTHROUGH_MAP[hostEvent];
|
|
21611
|
-
// If embedded app supports passthrough but not this event, use legacy
|
|
21684
|
+
// If embedded app supports passthrough but not this event, use legacy
|
|
21685
|
+
// channel
|
|
21612
21686
|
const keys = passthroughEvent ? await this.getAvailableUIPassthroughKeys(context) : [];
|
|
21613
21687
|
if (passthroughEvent && keys.length > 0 && !keys.includes(passthroughEvent)) {
|
|
21614
21688
|
return this.hostEventFallback(hostEvent, payload, context);
|
|
@@ -21815,11 +21889,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21815
21889
|
*/
|
|
21816
21890
|
const PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY = 'tsEmbedOriginalPosition';
|
|
21817
21891
|
const PRERENDER_WRAPPER_ID_PREFIX = 'tsEmbed-pre-render-wrapper-';
|
|
21892
|
+
const PRERENDER_PARKED_TRANSFORM = 'translateY(-100%)';
|
|
21893
|
+
/** The height createPreRenderWrapper() seeds before anything is measured. */
|
|
21894
|
+
const UNMEASURED_WRAPPER_HEIGHT = '100vh';
|
|
21818
21895
|
// The container applies UpdateEmbedParams through React state, so a delivered
|
|
21819
21896
|
// post is not the same as the params being in effect.
|
|
21820
21897
|
const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
|
|
21821
|
-
// The container ignores runtimeFilterParams/runtimeParameterParams unless
|
|
21822
|
-
// null or '' leaves the previous embed's values in place. '&' is
|
|
21898
|
+
// The container ignores runtimeFilterParams/runtimeParameterParams unless
|
|
21899
|
+
// truthy, so null or '' leaves the previous embed's values in place. '&' is
|
|
21900
|
+
// truthy and parses to {}.
|
|
21823
21901
|
const NO_RUNTIME_PARAMS = '&';
|
|
21824
21902
|
/**
|
|
21825
21903
|
* The event id map from v2 event names to v1 event id
|
|
@@ -21858,7 +21936,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21858
21936
|
this.shouldEncodeUrlQueryParams = false;
|
|
21859
21937
|
this.defaultHiddenActions = [exports.Action.ReportError];
|
|
21860
21938
|
this.preRenderContainerEl = document.body;
|
|
21861
|
-
this.containerScrollListener = null;
|
|
21862
21939
|
/**
|
|
21863
21940
|
* Handler for fullscreen change events
|
|
21864
21941
|
*/
|
|
@@ -22017,7 +22094,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22017
22094
|
const AUTH_INIT_FALLBACK_DELAY = 1000;
|
|
22018
22095
|
// Wait for 1 second to ensure the embed container is loaded
|
|
22019
22096
|
// This is a workaround to ensure the embed container is loaded
|
|
22020
|
-
// this is needed until all clusters have EmbedListenerReady
|
|
22097
|
+
// this is needed until all clusters have EmbedListenerReady
|
|
22098
|
+
// event
|
|
22021
22099
|
setTimeout(processEmbedContainerReady, AUTH_INIT_FALLBACK_DELAY);
|
|
22022
22100
|
}
|
|
22023
22101
|
else if (source === exports.EmbedEvent.EmbedListenerReady) {
|
|
@@ -22025,7 +22103,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22025
22103
|
}
|
|
22026
22104
|
};
|
|
22027
22105
|
// Subclasses that navigate the pre-render on show must await this before
|
|
22028
|
-
// triggering Navigate. Resolves even on failure, so navigation is never
|
|
22106
|
+
// triggering Navigate. Resolves even on failure, so navigation is never
|
|
22107
|
+
// blocked.
|
|
22029
22108
|
this.preRenderParamsApplied = Promise.resolve();
|
|
22030
22109
|
this.hostElement = getDOMNode(domSelector);
|
|
22031
22110
|
this.eventHandlerMap = new Map();
|
|
@@ -22355,8 +22434,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22355
22434
|
...this.viewConfig,
|
|
22356
22435
|
...queryParams,
|
|
22357
22436
|
...appInitData,
|
|
22358
|
-
// A show cycle has no URL to carry these, so the payload always
|
|
22359
|
-
// — including "none", which is the case that leaks the
|
|
22437
|
+
// A show cycle has no URL to carry these, so the payload always
|
|
22438
|
+
// states them — including "none", which is the case that leaks the
|
|
22439
|
+
// previous filters.
|
|
22360
22440
|
runtimeFilterParams: getFilterQuery((_a = this.viewConfig.runtimeFilters) !== null && _a !== void 0 ? _a : []) || NO_RUNTIME_PARAMS,
|
|
22361
22441
|
runtimeParameterParams: getRuntimeParameters((_b = this.viewConfig.runtimeParameters) !== null && _b !== void 0 ? _b : [])
|
|
22362
22442
|
|| NO_RUNTIME_PARAMS,
|
|
@@ -22701,7 +22781,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22701
22781
|
top: '0',
|
|
22702
22782
|
left: '0',
|
|
22703
22783
|
width: '100vw',
|
|
22704
|
-
height:
|
|
22784
|
+
height: UNMEASURED_WRAPPER_HEIGHT,
|
|
22705
22785
|
};
|
|
22706
22786
|
setStyleProperties(preRenderWrapper, initialPreRenderWrapperStyle);
|
|
22707
22787
|
return preRenderWrapper;
|
|
@@ -22769,10 +22849,26 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22769
22849
|
return placeholder;
|
|
22770
22850
|
}
|
|
22771
22851
|
/**
|
|
22772
|
-
* Resolves the configured preRenderContainer to a live element
|
|
22773
|
-
*
|
|
22774
|
-
*
|
|
22775
|
-
*
|
|
22852
|
+
* Resolves the configured preRenderContainer to a live element. A string
|
|
22853
|
+
* selector is re-queried on every call so a remounted container (E.g.: React
|
|
22854
|
+
* replacing the node) resolves to the fresh element; an element passed
|
|
22855
|
+
* directly cannot be re-resolved.
|
|
22856
|
+
*
|
|
22857
|
+
* With nothing configured the frame goes into the host element's nearest
|
|
22858
|
+
* scrolling ancestor, falling back to `document.body`.
|
|
22859
|
+
*
|
|
22860
|
+
* The wrapper is absolutely positioned, so it follows the page for free —
|
|
22861
|
+
* but only while it sits inside whatever scrolls. `document.body` is right
|
|
22862
|
+
* only when the document itself is the scroller; an app that scrolls an
|
|
22863
|
+
* inner element instead left the frame pinned to the viewport while the page
|
|
22864
|
+
* moved under it (SCAL-338563). Being inside the scroller also lets wheel
|
|
22865
|
+
* events chain out of the frame into it, which they cannot do from
|
|
22866
|
+
* `document.body`.
|
|
22867
|
+
*
|
|
22868
|
+
* A scrolling ancestor is layout chrome rather than route content, so it
|
|
22869
|
+
* outlives the embed in practice; and if it does go, the host element goes
|
|
22870
|
+
* with it and this instance is remounting anyway.
|
|
22871
|
+
* `reconcilePreRenderContainer` re-runs this on a detached container.
|
|
22776
22872
|
*/
|
|
22777
22873
|
resolvePreRenderContainerTarget() {
|
|
22778
22874
|
var _a;
|
|
@@ -22792,7 +22888,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22792
22888
|
else if (containerConfig) {
|
|
22793
22889
|
container = containerConfig;
|
|
22794
22890
|
}
|
|
22795
|
-
|
|
22891
|
+
if (container) {
|
|
22892
|
+
return container;
|
|
22893
|
+
}
|
|
22894
|
+
if (!this.hostElement) {
|
|
22895
|
+
return document.body;
|
|
22896
|
+
}
|
|
22897
|
+
return (_a = getScrollableAncestors(this.hostElement)[0]) !== null && _a !== void 0 ? _a : document.body;
|
|
22796
22898
|
}
|
|
22797
22899
|
inheritPreRenderContainer() {
|
|
22798
22900
|
var _a;
|
|
@@ -22837,8 +22939,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22837
22939
|
* Re-attaches the wrapper to a live container when the previously resolved
|
|
22838
22940
|
* one has been detached or no longer holds the wrapper — e.g. the host app
|
|
22839
22941
|
* remounted a custom preRenderContainer, which would otherwise leave a stale
|
|
22840
|
-
* reference and collapse the wrapper.
|
|
22841
|
-
* re-resolved; a container passed as an element
|
|
22942
|
+
* reference and collapse the wrapper. Selectors and the auto-resolved
|
|
22943
|
+
* scrolling ancestor are both re-resolved; a container passed as an element
|
|
22944
|
+
* is left untouched, as there is nothing to re-query.
|
|
22842
22945
|
*/
|
|
22843
22946
|
reconcilePreRenderContainer() {
|
|
22844
22947
|
const wrapper = this.preRenderWrapper;
|
|
@@ -22857,14 +22960,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22857
22960
|
if (resolved === stored && stored.contains(wrapper)) {
|
|
22858
22961
|
return;
|
|
22859
22962
|
}
|
|
22860
|
-
if (this.containerScrollListener && stored !== resolved) {
|
|
22861
|
-
if (stored !== document.body) {
|
|
22862
|
-
stored.removeEventListener('scroll', this.containerScrollListener);
|
|
22863
|
-
}
|
|
22864
|
-
if (resolved !== document.body) {
|
|
22865
|
-
resolved.addEventListener('scroll', this.containerScrollListener);
|
|
22866
|
-
}
|
|
22867
|
-
}
|
|
22868
22963
|
this.preRenderContainerEl = resolved;
|
|
22869
22964
|
this.applyPreRenderContainerPositioning();
|
|
22870
22965
|
if (wrapper.parentNode !== resolved) {
|
|
@@ -22926,11 +23021,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22926
23021
|
*/
|
|
22927
23022
|
setIFrameHeight(height) {
|
|
22928
23023
|
if (this.isPreRendered) {
|
|
23024
|
+
const next = getCssDimension(height);
|
|
22929
23025
|
if (this.insertedDomEl) {
|
|
22930
|
-
this.insertedDomEl.style.height =
|
|
23026
|
+
this.insertedDomEl.style.height = next;
|
|
22931
23027
|
}
|
|
22932
23028
|
else if (this.preRenderWrapper) {
|
|
22933
|
-
this.preRenderWrapper.style.height =
|
|
23029
|
+
this.preRenderWrapper.style.height = next;
|
|
22934
23030
|
}
|
|
22935
23031
|
}
|
|
22936
23032
|
else {
|
|
@@ -23083,8 +23179,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23083
23179
|
return;
|
|
23084
23180
|
this.preRenderWrapper[this.embedNodeKey] = this;
|
|
23085
23181
|
}
|
|
23086
|
-
// The flag lives on the wrapper because it describes the iframe: an
|
|
23087
|
-
// hidden when the container announced itself would otherwise
|
|
23182
|
+
// The flag lives on the wrapper because it describes the iframe: an
|
|
23183
|
+
// instance hidden when the container announced itself would otherwise
|
|
23184
|
+
// report false forever.
|
|
23088
23185
|
markEmbedContainerLoaded() {
|
|
23089
23186
|
this.isEmbedContainerLoaded = true;
|
|
23090
23187
|
if (this.preRenderWrapper) {
|
|
@@ -23364,34 +23461,47 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23364
23461
|
delete container.dataset[PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY];
|
|
23365
23462
|
}
|
|
23366
23463
|
/**
|
|
23367
|
-
*
|
|
23368
|
-
|
|
23369
|
-
|
|
23370
|
-
|
|
23464
|
+
* Re-sizes the wrapper when its placeholder changes size.
|
|
23465
|
+
*
|
|
23466
|
+
* Position deliberately has no equivalent. An absolutely positioned wrapper
|
|
23467
|
+
* follows its containing block for free, so a correctly placed frame is the
|
|
23468
|
+
* browser's job and costs nothing; repositioning it on scroll would mean a
|
|
23469
|
+
* layout read and a style write per frame to compensate for placing it in
|
|
23470
|
+
* the wrong box. Size is the one thing the browser will not do for us: the
|
|
23471
|
+
* placeholder grows when the embedded app reports a new height, and the
|
|
23472
|
+
* wrapper has to be told.
|
|
23473
|
+
*/
|
|
23474
|
+
observePreRenderSize() {
|
|
23475
|
+
var _a;
|
|
23476
|
+
if (this.getPreRenderConfig().doNotTrackSize || typeof ResizeObserver === 'undefined') {
|
|
23371
23477
|
return;
|
|
23372
23478
|
}
|
|
23373
|
-
const
|
|
23374
|
-
|
|
23375
|
-
|
|
23479
|
+
const placeholder = this.getPreRenderPlaceHolderElement();
|
|
23480
|
+
if (!placeholder) {
|
|
23481
|
+
return;
|
|
23482
|
+
}
|
|
23483
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
23484
|
+
this.resizeObserver = new ResizeObserver(() => this.syncPreRenderStyle());
|
|
23485
|
+
this.resizeObserver.observe(placeholder);
|
|
23376
23486
|
}
|
|
23377
23487
|
/**
|
|
23378
23488
|
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
23379
23489
|
* @version SDK: 1.19.1 | ThoughtSpot: *
|
|
23380
23490
|
*/
|
|
23381
23491
|
destroy() {
|
|
23382
|
-
var _a, _b, _c;
|
|
23492
|
+
var _a, _b, _c, _d;
|
|
23383
23493
|
try {
|
|
23384
23494
|
this.removeFullscreenChangeHandler();
|
|
23385
|
-
this.
|
|
23495
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
23386
23496
|
this.unsubscribeToEvents();
|
|
23387
|
-
(
|
|
23497
|
+
(_b = this.preRenderWrapper) === null || _b === void 0 ? void 0 : _b.remove();
|
|
23388
23498
|
this.restorePreRenderContainerPosition();
|
|
23389
23499
|
if (!this.isRendered) {
|
|
23390
23500
|
return;
|
|
23391
23501
|
}
|
|
23392
23502
|
if (!getEmbedConfig().waitForCleanupOnDestroy) {
|
|
23393
23503
|
this.trigger(exports.HostEvent.DestroyEmbed);
|
|
23394
|
-
(
|
|
23504
|
+
(_d = (_c = this.insertedDomEl) === null || _c === void 0 ? void 0 : _c.parentNode) === null || _d === void 0 ? void 0 : _d.removeChild(this.insertedDomEl);
|
|
23395
23505
|
}
|
|
23396
23506
|
else {
|
|
23397
23507
|
const cleanupTimeout = getEmbedConfig().cleanupTimeout;
|
|
@@ -23472,7 +23582,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23472
23582
|
* wrapper to overlay it.
|
|
23473
23583
|
*/
|
|
23474
23584
|
async showPreRender() {
|
|
23475
|
-
var _a
|
|
23585
|
+
var _a;
|
|
23476
23586
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_SHOW_PRE_RENDER, {
|
|
23477
23587
|
preRenderId: this.getPreRenderConfig().id,
|
|
23478
23588
|
embedComponentType: this.viewConfig.embedComponentType,
|
|
@@ -23491,54 +23601,49 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23491
23601
|
this.beforePrerenderVisible();
|
|
23492
23602
|
if (this.hostElement) {
|
|
23493
23603
|
this.insertedDomEl = this.createPreRenderPlaceholder();
|
|
23494
|
-
|
|
23495
|
-
|
|
23496
|
-
|
|
23497
|
-
|
|
23498
|
-
|
|
23499
|
-
|
|
23500
|
-
|
|
23604
|
+
// Carry a height fullHeight has already measured onto the fresh
|
|
23605
|
+
// placeholder, so a re-show does not flash at frameParams height.
|
|
23606
|
+
// UNMEASURED_WRAPPER_HEIGHT is what createPreRenderWrapper() seeds
|
|
23607
|
+
// before anything has been measured; treating that as a measurement
|
|
23608
|
+
// is what made a first reveal overshoot to a full viewport.
|
|
23609
|
+
const wrapperHeight = this.preRenderWrapper.style.height;
|
|
23610
|
+
if (this.viewConfig.fullHeight
|
|
23611
|
+
&& wrapperHeight
|
|
23612
|
+
&& wrapperHeight !== UNMEASURED_WRAPPER_HEIGHT) {
|
|
23613
|
+
this.insertedDomEl.style.height = wrapperHeight;
|
|
23501
23614
|
}
|
|
23502
23615
|
const placeHolderId = this.getPreRenderIds().placeHolder;
|
|
23503
23616
|
// Remove any stale placeholder from a previous cycle. It is located
|
|
23504
|
-
// via a subtree-wide querySelector, so it may be nested deeper
|
|
23505
|
-
// direct child (E.g.: with fullHeight the host app can wrap
|
|
23506
|
-
// Element.remove() — which detaches from whatever the real
|
|
23507
|
-
// rather than hostElement.removeChild(), which throws
|
|
23508
|
-
// when the match is not a direct child. Mirrors the
|
|
23509
|
-
// cleanup in
|
|
23617
|
+
// via a subtree-wide querySelector, so it may be nested deeper
|
|
23618
|
+
// than a direct child (E.g.: with fullHeight the host app can wrap
|
|
23619
|
+
// it). Use Element.remove() — which detaches from whatever the real
|
|
23620
|
+
// parent is — rather than hostElement.removeChild(), which throws
|
|
23621
|
+
// NotFoundError when the match is not a direct child. Mirrors the
|
|
23622
|
+
// wrapper/child cleanup in
|
|
23623
|
+
// createPreRenderWrapper()/createPreRenderChild().
|
|
23510
23624
|
(_a = this.hostElement.querySelector(`#${placeHolderId}`)) === null || _a === void 0 ? void 0 : _a.remove();
|
|
23511
23625
|
this.hostElement.appendChild(this.insertedDomEl);
|
|
23512
23626
|
this.syncPreRenderStyle();
|
|
23513
|
-
|
|
23514
|
-
if (customContainer && !this.containerScrollListener) {
|
|
23515
|
-
this.containerScrollListener = () => this.syncPreRenderStyle();
|
|
23516
|
-
customContainer.addEventListener('scroll', this.containerScrollListener);
|
|
23517
|
-
}
|
|
23518
|
-
if (!this.getPreRenderConfig().doNotTrackSize) {
|
|
23519
|
-
const observeTarget = (_b = this.insertedDomEl) !== null && _b !== void 0 ? _b : this.hostElement;
|
|
23520
|
-
this.resizeObserver = new ResizeObserver((entries) => {
|
|
23521
|
-
entries.forEach((entry) => {
|
|
23522
|
-
if (entry.target === observeTarget) {
|
|
23523
|
-
this.syncPreRenderStyle();
|
|
23524
|
-
}
|
|
23525
|
-
});
|
|
23526
|
-
});
|
|
23527
|
-
this.resizeObserver.observe(observeTarget);
|
|
23528
|
-
}
|
|
23627
|
+
this.observePreRenderSize();
|
|
23529
23628
|
}
|
|
23530
23629
|
removeStyleProperties(this.preRenderWrapper, [
|
|
23531
23630
|
'z-index',
|
|
23532
23631
|
'opacity',
|
|
23533
|
-
'pointer-events',
|
|
23534
23632
|
'overflow',
|
|
23633
|
+
'transform',
|
|
23535
23634
|
]);
|
|
23635
|
+
// Set rather than removed: a container that carries `pointer-events:
|
|
23636
|
+
// none` — the usual styling for a parking root that must not swallow
|
|
23637
|
+
// clicks — passes it down, and dropping the property here would leave
|
|
23638
|
+
// the inherited `none` in force and the frame dead to input.
|
|
23639
|
+
setStyleProperties(this.preRenderWrapper, { pointerEvents: 'auto' });
|
|
23536
23640
|
this.subscribeToEvents();
|
|
23537
23641
|
// Setup fullscreen change handler for prerendered components
|
|
23538
23642
|
if (this.iFrame) {
|
|
23539
23643
|
this.setupFullscreenChangeHandler();
|
|
23540
23644
|
}
|
|
23541
|
-
// Last, so everything above still sees the instance being taken over
|
|
23645
|
+
// Last, so everything above still sees the instance being taken over
|
|
23646
|
+
// from.
|
|
23542
23647
|
this.takeOverPreRender();
|
|
23543
23648
|
return this;
|
|
23544
23649
|
}
|
|
@@ -23584,6 +23689,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23584
23689
|
* If the component is not preRendered, it issues a warning.
|
|
23585
23690
|
*/
|
|
23586
23691
|
hidePreRender() {
|
|
23692
|
+
var _a;
|
|
23587
23693
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_HIDE_PRE_RENDER, {
|
|
23588
23694
|
preRenderId: this.getPreRenderConfig().id,
|
|
23589
23695
|
embedComponentType: this.viewConfig.embedComponentType,
|
|
@@ -23603,12 +23709,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23603
23709
|
top: '0',
|
|
23604
23710
|
left: '0',
|
|
23605
23711
|
overflow: 'hidden',
|
|
23712
|
+
// Keeps the measured size — so the next show needs no resize, which
|
|
23713
|
+
// is the point of pre-rendering — while lifting the box out of
|
|
23714
|
+
// the container's scrollable area. Overflow only extends
|
|
23715
|
+
// downwards, so a hidden frame parked above the top edge adds
|
|
23716
|
+
// none, where one left at full height shows as blank scroll space.
|
|
23717
|
+
transform: PRERENDER_PARKED_TRANSFORM,
|
|
23606
23718
|
};
|
|
23607
23719
|
setStyleProperties(this.preRenderWrapper, preRenderHideStyles);
|
|
23608
|
-
this.
|
|
23609
|
-
if (this.resizeObserver) {
|
|
23610
|
-
this.resizeObserver.disconnect();
|
|
23611
|
-
}
|
|
23720
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
23612
23721
|
const placeHolderEle = this.getPreRenderPlaceHolderElement();
|
|
23613
23722
|
if (placeHolderEle) {
|
|
23614
23723
|
placeHolderEle.parentElement.removeChild(placeHolderEle);
|
|
@@ -24364,6 +24473,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
24364
24473
|
starterPrompts,
|
|
24365
24474
|
},
|
|
24366
24475
|
};
|
|
24476
|
+
}
|
|
24477
|
+
function buildSpotterAnalystAppInitData(initData, viewConfig) {
|
|
24478
|
+
const { spotterAnalystConfig } = viewConfig;
|
|
24479
|
+
if (!(spotterAnalystConfig === null || spotterAnalystConfig === void 0 ? void 0 : spotterAnalystConfig.analystId))
|
|
24480
|
+
return initData;
|
|
24481
|
+
return {
|
|
24482
|
+
...initData,
|
|
24483
|
+
embedParams: {
|
|
24484
|
+
...(initData.embedParams || {}),
|
|
24485
|
+
spotterAnalystConfig,
|
|
24486
|
+
},
|
|
24487
|
+
};
|
|
24367
24488
|
}
|
|
24368
24489
|
|
|
24369
24490
|
function buildSpotterVizAppInitData(initData, viewConfig) {
|
|
@@ -24957,8 +25078,9 @@ query GetEurekaVizSnapshots(
|
|
|
24957
25078
|
* @summary Liveboard & visualization embed
|
|
24958
25079
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
24959
25080
|
*/
|
|
24960
|
-
// Home unmounts the liveboard container, which is how its state gets cleared.
|
|
24961
|
-
// settle window gives the container time to do it before we ask for the
|
|
25081
|
+
// Home unmounts the liveboard container, which is how its state gets cleared.
|
|
25082
|
+
// The settle window gives the container time to do it before we ask for the
|
|
25083
|
+
// liveboard back.
|
|
24962
25084
|
const HOME_ROUTE = 'home';
|
|
24963
25085
|
const HOME_SETTLE_MS = 200;
|
|
24964
25086
|
/**
|
|
@@ -25256,21 +25378,24 @@ query GetEurekaVizSnapshots(
|
|
|
25256
25378
|
}
|
|
25257
25379
|
beforePrerenderVisible() {
|
|
25258
25380
|
super.beforePrerenderVisible();
|
|
25259
|
-
// Captured before showPreRender() hands the wrapper over to this
|
|
25260
|
-
// Itself means a hide/show, not a hand-over, so there is
|
|
25381
|
+
// Captured before showPreRender() hands the wrapper over to this
|
|
25382
|
+
// instance. Itself means a hide/show, not a hand-over, so there is
|
|
25383
|
+
// nothing stale to clear.
|
|
25261
25384
|
const previous = this.getPreRenderObj();
|
|
25262
25385
|
const showing = previous === this ? undefined : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
|
|
25263
25386
|
this.executeAfterEmbedContainerLoaded(async () => {
|
|
25264
|
-
// Without this the params callback suspends on its await and
|
|
25265
|
-
// goes out first, so the container loads with the previous
|
|
25387
|
+
// Without this the params callback suspends on its await and
|
|
25388
|
+
// Navigate goes out first, so the container loads with the previous
|
|
25389
|
+
// config's filters.
|
|
25266
25390
|
await this.preRenderParamsApplied;
|
|
25267
25391
|
if (this.isShowingLiveboardRoute(showing)) {
|
|
25268
|
-
// Navigate to the route we are already on is a no-op, so the
|
|
25269
|
-
// keeps its state. Home unmounts the container, which
|
|
25392
|
+
// Navigate to the route we are already on is a no-op, so the
|
|
25393
|
+
// liveboard keeps its state. Home unmounts the container, which
|
|
25394
|
+
// clears it.
|
|
25270
25395
|
this.trigger(exports.HostEvent.Navigate, HOME_ROUTE)
|
|
25271
25396
|
.catch((error) => logger$3.warn('Could not route via home', error));
|
|
25272
|
-
// Not awaited above: the container never acks Navigate, so
|
|
25273
|
-
// only settles on the 30s trigger timeout.
|
|
25397
|
+
// Not awaited above: the container never acks Navigate, so
|
|
25398
|
+
// that promise only settles on the 30s trigger timeout.
|
|
25274
25399
|
await new Promise((resolve) => {
|
|
25275
25400
|
setTimeout(resolve, HOME_SETTLE_MS);
|
|
25276
25401
|
});
|
|
@@ -25284,8 +25409,9 @@ query GetEurekaVizSnapshots(
|
|
|
25284
25409
|
};
|
|
25285
25410
|
});
|
|
25286
25411
|
}
|
|
25287
|
-
// The whole route, not just the liveboard id: the path is built from the
|
|
25288
|
-
// and view too, so a same-liveboard show onto another tab is a
|
|
25412
|
+
// The whole route, not just the liveboard id: the path is built from the
|
|
25413
|
+
// viz, tab and view too, so a same-liveboard show onto another tab is a
|
|
25414
|
+
// real navigation.
|
|
25289
25415
|
isShowingLiveboardRoute(showing) {
|
|
25290
25416
|
if (!(showing === null || showing === void 0 ? void 0 : showing.liveboardId))
|
|
25291
25417
|
return false;
|
|
@@ -25950,10 +26076,11 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25950
26076
|
const defaultAppInitData = await super.getAppInitData();
|
|
25951
26077
|
const sidebarInitData = buildSpotterSidebarAppInitData(defaultAppInitData, this.viewConfig, this.handleError.bind(this));
|
|
25952
26078
|
const shareInitData = buildSpotterShareConversationAppInitData(sidebarInitData, this.viewConfig);
|
|
25953
|
-
|
|
26079
|
+
const starterPromptsInitData = buildStarterPromptsAppInitData(shareInitData, this.viewConfig);
|
|
26080
|
+
return buildSpotterAnalystAppInitData(starterPromptsInitData, this.viewConfig);
|
|
25954
26081
|
}
|
|
25955
26082
|
getEmbedParamsObject() {
|
|
25956
|
-
const { searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, updatedSpotterExperience, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig,
|
|
26083
|
+
const { searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, updatedSpotterExperience, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig, } = this.viewConfig;
|
|
25957
26084
|
const queryParams = this.getBaseQueryParams();
|
|
25958
26085
|
queryParams[Param.SpotterEnabled] = true;
|
|
25959
26086
|
// Boolean params
|
|
@@ -25966,7 +26093,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25966
26093
|
setParamIfDefined(queryParams, Param.ShowSpotterRadiance, showSpotterRadiance, true);
|
|
25967
26094
|
setParamIfDefined(queryParams, Param.DefaultQueryMode, defaultQueryMode);
|
|
25968
26095
|
setParamIfDefined(queryParams, Param.EnableStopAnswerGenerationEmbed, enableStopAnswerGenerationEmbed, true);
|
|
25969
|
-
setParamIfDefined(queryParams, Param.AnalystId, spotterAnalystConfig === null || spotterAnalystConfig === void 0 ? void 0 : spotterAnalystConfig.analystId);
|
|
25970
26096
|
// Handle spotterChatConfig params
|
|
25971
26097
|
if (spotterChatConfig) {
|
|
25972
26098
|
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, spotterFileUploadEnabled, spotterFileUploadFileTypes, enableStarterPrompts, } = spotterChatConfig;
|