@thoughtspot/visual-embed-sdk 1.38.0-alpha.1 → 1.38.1

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.
Files changed (216) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/embed/app.d.ts +96 -156
  3. package/cjs/src/embed/app.d.ts.map +1 -1
  4. package/cjs/src/embed/app.js +6 -3
  5. package/cjs/src/embed/app.js.map +1 -1
  6. package/cjs/src/embed/app.spec.js +10 -0
  7. package/cjs/src/embed/app.spec.js.map +1 -1
  8. package/cjs/src/embed/bodyless-conversation.d.ts +4 -4
  9. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  10. package/cjs/src/embed/bodyless-conversation.js +1 -1
  11. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  12. package/cjs/src/embed/conversation.d.ts +22 -11
  13. package/cjs/src/embed/conversation.d.ts.map +1 -1
  14. package/cjs/src/embed/conversation.js +1 -1
  15. package/cjs/src/embed/conversation.js.map +1 -1
  16. package/cjs/src/embed/liveboard.d.ts +110 -167
  17. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  18. package/cjs/src/embed/liveboard.js +4 -1
  19. package/cjs/src/embed/liveboard.js.map +1 -1
  20. package/cjs/src/embed/liveboard.spec.js +11 -0
  21. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  22. package/cjs/src/embed/sage.d.ts +17 -2
  23. package/cjs/src/embed/sage.d.ts.map +1 -1
  24. package/cjs/src/embed/sage.js +2 -0
  25. package/cjs/src/embed/sage.js.map +1 -1
  26. package/cjs/src/embed/search-bar.d.ts +16 -6
  27. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  28. package/cjs/src/embed/search-bar.js.map +1 -1
  29. package/cjs/src/embed/search.d.ts +46 -14
  30. package/cjs/src/embed/search.d.ts.map +1 -1
  31. package/cjs/src/embed/search.js.map +1 -1
  32. package/cjs/src/embed/ts-embed.d.ts +19 -2
  33. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  34. package/cjs/src/embed/ts-embed.js +49 -0
  35. package/cjs/src/embed/ts-embed.js.map +1 -1
  36. package/cjs/src/embed/ts-embed.spec.js +45 -4
  37. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  38. package/cjs/src/index.d.ts +2 -2
  39. package/cjs/src/index.d.ts.map +1 -1
  40. package/cjs/src/index.js +2 -1
  41. package/cjs/src/index.js.map +1 -1
  42. package/cjs/src/react/all-types-export.d.ts +1 -1
  43. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  44. package/cjs/src/react/all-types-export.js +2 -1
  45. package/cjs/src/react/all-types-export.js.map +1 -1
  46. package/cjs/src/react/index.d.ts +1 -1
  47. package/cjs/src/react/index.d.ts.map +1 -1
  48. package/cjs/src/react/index.js +1 -1
  49. package/cjs/src/react/util.d.ts +7 -4
  50. package/cjs/src/react/util.d.ts.map +1 -1
  51. package/cjs/src/react/util.js.map +1 -1
  52. package/cjs/src/types.d.ts +482 -251
  53. package/cjs/src/types.d.ts.map +1 -1
  54. package/cjs/src/types.js +31 -14
  55. package/cjs/src/types.js.map +1 -1
  56. package/cjs/src/utils/graphql/answerService/answerService.d.ts +2 -1
  57. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  58. package/cjs/src/utils/graphql/answerService/answerService.js +2 -1
  59. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  60. package/cjs/src/utils/processData.d.ts.map +1 -1
  61. package/cjs/src/utils/processData.js +15 -0
  62. package/cjs/src/utils/processData.js.map +1 -1
  63. package/cjs/src/utils/processData.spec.js +15 -0
  64. package/cjs/src/utils/processData.spec.js.map +1 -1
  65. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  66. package/cjs/src/utils/processTrigger.js +14 -0
  67. package/cjs/src/utils/processTrigger.js.map +1 -1
  68. package/cjs/src/utils/processTrigger.spec.js +54 -0
  69. package/cjs/src/utils/processTrigger.spec.js.map +1 -1
  70. package/cjs/src/utils.d.ts +11 -2
  71. package/cjs/src/utils.d.ts.map +1 -1
  72. package/cjs/src/utils.js +70 -1
  73. package/cjs/src/utils.js.map +1 -1
  74. package/cjs/src/utils.spec.js +85 -0
  75. package/cjs/src/utils.spec.js.map +1 -1
  76. package/dist/{index-DeFzsyFF.js → index-BKIWUvTr.js} +1 -1
  77. package/dist/src/embed/app.d.ts +96 -156
  78. package/dist/src/embed/app.d.ts.map +1 -1
  79. package/dist/src/embed/bodyless-conversation.d.ts +4 -4
  80. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  81. package/dist/src/embed/conversation.d.ts +22 -11
  82. package/dist/src/embed/conversation.d.ts.map +1 -1
  83. package/dist/src/embed/liveboard.d.ts +110 -167
  84. package/dist/src/embed/liveboard.d.ts.map +1 -1
  85. package/dist/src/embed/sage.d.ts +17 -2
  86. package/dist/src/embed/sage.d.ts.map +1 -1
  87. package/dist/src/embed/search-bar.d.ts +16 -6
  88. package/dist/src/embed/search-bar.d.ts.map +1 -1
  89. package/dist/src/embed/search.d.ts +46 -14
  90. package/dist/src/embed/search.d.ts.map +1 -1
  91. package/dist/src/embed/ts-embed.d.ts +19 -2
  92. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  93. package/dist/src/index.d.ts +2 -2
  94. package/dist/src/index.d.ts.map +1 -1
  95. package/dist/src/react/all-types-export.d.ts +1 -1
  96. package/dist/src/react/all-types-export.d.ts.map +1 -1
  97. package/dist/src/react/index.d.ts +1 -1
  98. package/dist/src/react/index.d.ts.map +1 -1
  99. package/dist/src/react/util.d.ts +7 -4
  100. package/dist/src/react/util.d.ts.map +1 -1
  101. package/dist/src/types.d.ts +482 -251
  102. package/dist/src/types.d.ts.map +1 -1
  103. package/dist/src/utils/graphql/answerService/answerService.d.ts +2 -1
  104. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  105. package/dist/src/utils/processData.d.ts.map +1 -1
  106. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  107. package/dist/src/utils.d.ts +11 -2
  108. package/dist/src/utils.d.ts.map +1 -1
  109. package/dist/tsembed-react.es.js +3477 -3311
  110. package/dist/tsembed-react.js +3476 -3310
  111. package/dist/tsembed.es.js +192 -26
  112. package/dist/tsembed.js +195 -29
  113. package/dist/visual-embed-sdk-react-full.d.ts +845 -655
  114. package/dist/visual-embed-sdk-react.d.ts +845 -655
  115. package/dist/visual-embed-sdk.d.ts +827 -640
  116. package/lib/package.json +1 -1
  117. package/lib/src/embed/app.d.ts +96 -156
  118. package/lib/src/embed/app.d.ts.map +1 -1
  119. package/lib/src/embed/app.js +6 -3
  120. package/lib/src/embed/app.js.map +1 -1
  121. package/lib/src/embed/app.spec.js +10 -0
  122. package/lib/src/embed/app.spec.js.map +1 -1
  123. package/lib/src/embed/bodyless-conversation.d.ts +4 -4
  124. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  125. package/lib/src/embed/bodyless-conversation.js +1 -1
  126. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  127. package/lib/src/embed/conversation.d.ts +22 -11
  128. package/lib/src/embed/conversation.d.ts.map +1 -1
  129. package/lib/src/embed/conversation.js +1 -1
  130. package/lib/src/embed/conversation.js.map +1 -1
  131. package/lib/src/embed/liveboard.d.ts +110 -167
  132. package/lib/src/embed/liveboard.d.ts.map +1 -1
  133. package/lib/src/embed/liveboard.js +4 -1
  134. package/lib/src/embed/liveboard.js.map +1 -1
  135. package/lib/src/embed/liveboard.spec.js +11 -0
  136. package/lib/src/embed/liveboard.spec.js.map +1 -1
  137. package/lib/src/embed/sage.d.ts +17 -2
  138. package/lib/src/embed/sage.d.ts.map +1 -1
  139. package/lib/src/embed/sage.js +2 -0
  140. package/lib/src/embed/sage.js.map +1 -1
  141. package/lib/src/embed/search-bar.d.ts +16 -6
  142. package/lib/src/embed/search-bar.d.ts.map +1 -1
  143. package/lib/src/embed/search-bar.js.map +1 -1
  144. package/lib/src/embed/search.d.ts +46 -14
  145. package/lib/src/embed/search.d.ts.map +1 -1
  146. package/lib/src/embed/search.js.map +1 -1
  147. package/lib/src/embed/ts-embed.d.ts +19 -2
  148. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  149. package/lib/src/embed/ts-embed.js +49 -0
  150. package/lib/src/embed/ts-embed.js.map +1 -1
  151. package/lib/src/embed/ts-embed.spec.js +45 -4
  152. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  153. package/lib/src/index.d.ts +2 -2
  154. package/lib/src/index.d.ts.map +1 -1
  155. package/lib/src/index.js +2 -2
  156. package/lib/src/index.js.map +1 -1
  157. package/lib/src/react/all-types-export.d.ts +1 -1
  158. package/lib/src/react/all-types-export.d.ts.map +1 -1
  159. package/lib/src/react/all-types-export.js +1 -1
  160. package/lib/src/react/all-types-export.js.map +1 -1
  161. package/lib/src/react/index.d.ts +1 -1
  162. package/lib/src/react/index.d.ts.map +1 -1
  163. package/lib/src/react/index.js +1 -1
  164. package/lib/src/react/util.d.ts +7 -4
  165. package/lib/src/react/util.d.ts.map +1 -1
  166. package/lib/src/react/util.js.map +1 -1
  167. package/lib/src/types.d.ts +482 -251
  168. package/lib/src/types.d.ts.map +1 -1
  169. package/lib/src/types.js +31 -14
  170. package/lib/src/types.js.map +1 -1
  171. package/lib/src/utils/graphql/answerService/answerService.d.ts +2 -1
  172. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  173. package/lib/src/utils/graphql/answerService/answerService.js +2 -1
  174. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  175. package/lib/src/utils/processData.d.ts.map +1 -1
  176. package/lib/src/utils/processData.js +15 -0
  177. package/lib/src/utils/processData.js.map +1 -1
  178. package/lib/src/utils/processData.spec.js +15 -0
  179. package/lib/src/utils/processData.spec.js.map +1 -1
  180. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  181. package/lib/src/utils/processTrigger.js +14 -0
  182. package/lib/src/utils/processTrigger.js.map +1 -1
  183. package/lib/src/utils/processTrigger.spec.js +54 -0
  184. package/lib/src/utils/processTrigger.spec.js.map +1 -1
  185. package/lib/src/utils.d.ts +11 -2
  186. package/lib/src/utils.d.ts.map +1 -1
  187. package/lib/src/utils.js +67 -0
  188. package/lib/src/utils.js.map +1 -1
  189. package/lib/src/utils.spec.js +86 -1
  190. package/lib/src/utils.spec.js.map +1 -1
  191. package/lib/src/visual-embed-sdk.d.ts +836 -649
  192. package/package.json +1 -1
  193. package/src/embed/app.spec.ts +14 -0
  194. package/src/embed/app.ts +97 -152
  195. package/src/embed/bodyless-conversation.ts +4 -4
  196. package/src/embed/conversation.ts +23 -12
  197. package/src/embed/liveboard.spec.ts +15 -0
  198. package/src/embed/liveboard.ts +117 -172
  199. package/src/embed/sage.ts +17 -5
  200. package/src/embed/search-bar.tsx +16 -17
  201. package/src/embed/search.ts +47 -21
  202. package/src/embed/ts-embed.spec.ts +52 -4
  203. package/src/embed/ts-embed.ts +61 -6
  204. package/src/index.ts +2 -0
  205. package/src/react/all-types-export.ts +1 -0
  206. package/src/react/index.tsx +3 -3
  207. package/src/react/util.ts +6 -4
  208. package/src/types.ts +488 -253
  209. package/src/utils/graphql/answerService/answerService.ts +5 -4
  210. package/src/utils/processData.spec.ts +28 -0
  211. package/src/utils/processData.ts +17 -0
  212. package/src/utils/processTrigger.spec.ts +90 -0
  213. package/src/utils/processTrigger.ts +16 -1
  214. package/src/utils.spec.ts +113 -0
  215. package/src/utils.ts +78 -2
  216. package/dist/index-NZYq1Tu3.js +0 -7370
@@ -1,4 +1,4 @@
1
- import { DefaultAppInitData, Param, ViewConfig } from '../types';
1
+ import { SearchLiveboardCommonViewConfig, BaseViewConfig, DefaultAppInitData, Param } from '../types';
2
2
  import { getQueryParamString } from '../utils';
3
3
  import { TsEmbed } from './ts-embed';
4
4
  import { SearchOptions } from './search';
@@ -6,27 +6,18 @@ import { SearchOptions } from './search';
6
6
  /**
7
7
  * @group Embed components
8
8
  */
9
- export interface SearchBarViewConfig
10
- extends Omit<
11
- ViewConfig,
12
- | 'runtimeFilters'
13
- | 'showAlerts'
14
- | 'dataPanelV2'
15
- | 'hiddenHomepageModules'
16
- | 'hiddenHomeLeftNavItems'
17
- | 'hiddenTabs'
18
- | 'visibleTabs'
19
- | 'reorderedHomepageModules'
20
- > {
9
+ export interface SearchBarViewConfig extends BaseViewConfig, SearchLiveboardCommonViewConfig {
21
10
  /**
22
11
  * The array of data source GUIDs to set on load.
23
12
  * Only a single data source is supported currently.
13
+ *
14
+ * Supported embed types: `SearchBarEmbed`
24
15
  * @deprecated Use `dataSource` instead
25
16
  * @version: SDK: 1.1.0 | ThoughtSpot: 8.1.1-sw
26
17
  * @example
27
18
  * ```js
28
19
  * const embed = new SearchBarEmbed('#tsEmbed', {
29
- * ... // other options
20
+ * ... //other embed view config
30
21
  * dataSources:['id-2345','id-2345'],
31
22
  * })
32
23
  * ```
@@ -34,11 +25,13 @@ export interface SearchBarViewConfig
34
25
  dataSources?: string[];
35
26
  /**
36
27
  * Pass the ID of the source to be selected.
28
+ *
29
+ * Supported embed types: `SearchBarEmbed`
37
30
  * @version: SDK: 1.19.0, ThoughtSpot 9.0.0.cl, 9.0.1.sw
38
31
  * @example
39
32
  * ```js
40
33
  * const embed = new SearchBarEmbed('#tsEmbed', {
41
- * ... // other options
34
+ * ... //other embed view config
42
35
  * dataSource:'id-2345',
43
36
  * })
44
37
  * ```
@@ -46,11 +39,13 @@ export interface SearchBarViewConfig
46
39
  dataSource?: string;
47
40
  /**
48
41
  * Boolean to define if the last selected data source should be used
42
+ *
43
+ * Supported embed types: `SearchBarEmbed`
49
44
  * @version: SDK: 1.24.0, ThoughtSpot 9.5.0.cl, 9.5.0.sw
50
45
  * @example
51
46
  * ```js
52
47
  * const embed = new SearchBarEmbed('#tsEmbed', {
53
- * ... // other options
48
+ * ... //other embed view config
54
49
  * useLastSelectedSources:false,
55
50
  * })
56
51
  * ```
@@ -66,11 +61,13 @@ export interface SearchBarViewConfig
66
61
  * If it is executed, the focus is placed on the results.
67
62
  * If it’s not executed, the focus is placed at the end of
68
63
  * the token string in the search bar.
64
+ *
65
+ * Supported embed types: `SearchBarEmbed`
69
66
  * @version: SDK: 1.2.0 | ThoughtSpot: 9.4.0.sw
70
67
  * @example
71
68
  * ```js
72
69
  * const embed = new SearchBarEmbed('#tsEmbed', {
73
- * ... // other options
70
+ * ... //other embed view config
74
71
  * searchOptions: {
75
72
  * searchTokenString: '[quantity purchased] [region]',
76
73
  * executeSearch: true,
@@ -82,6 +79,8 @@ export interface SearchBarViewConfig
82
79
  /**
83
80
  * Exclude the search token string from the URL.
84
81
  * If set to true, the search token string is not appended to the URL.
82
+ *
83
+ * Supported embed types: `SearchBarEmbed`
85
84
  * @version: SDK: 1.35.7 | ThoughtSpot: 10.8.0.cl
86
85
  * @example
87
86
  * ```js
@@ -11,8 +11,9 @@ import {
11
11
  DOMSelector,
12
12
  Param,
13
13
  Action,
14
- ViewConfig,
14
+ SearchLiveboardCommonViewConfig,
15
15
  DefaultAppInitData,
16
+ BaseViewConfig,
16
17
  } from '../types';
17
18
  import {
18
19
  getQueryParamString,
@@ -68,22 +69,17 @@ export enum DataPanelCustomColumnGroupsAccordionState {
68
69
  * @group Embed components
69
70
  */
70
71
  export interface SearchViewConfig
71
- extends Omit<
72
- ViewConfig,
73
- | 'hiddenHomepageModules'
74
- | 'hiddenHomeLeftNavItems'
75
- | 'hiddenTabs'
76
- | 'visibleTabs'
77
- | 'reorderedHomepageModules'
78
- > {
72
+ extends SearchLiveboardCommonViewConfig, Omit<BaseViewConfig, 'primaryAction'> {
79
73
  /**
80
74
  * If set to true, the data sources panel is collapsed on load,
81
75
  * but can be expanded manually.
76
+ *
77
+ * Supported embed types: `SearchEmbed`
82
78
  * @version: SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw
83
79
  * @example
84
80
  * ```js
85
81
  * const embed = new SearchEmbed('#tsEmbed', {
86
- * ... // other options
82
+ * ... // other embed view config
87
83
  * collapseDataSources:true,
88
84
  * })
89
85
  * ```
@@ -92,11 +88,13 @@ export interface SearchViewConfig
92
88
  /**
93
89
  * If set to true, the data panel is collapsed on load,
94
90
  * but can be expanded manually.
91
+ *
92
+ * Supported embed types: `SearchEmbed`
95
93
  * @version: SDK: 1.34.0 | ThoughtSpot: 10.3.0.cl
96
94
  * @example
97
95
  * ```js
98
96
  * const embed = new SearchEmbed('#tsEmbed', {
99
- * ... // other options
97
+ * ... // other embed view config
100
98
  * collapseDataPanel:true,
101
99
  * })
102
100
  * ```
@@ -104,11 +102,13 @@ export interface SearchViewConfig
104
102
  collapseDataPanel?: boolean;
105
103
  /**
106
104
  * Show or hide the data sources panel.
105
+ *
106
+ * Supported embed types: `SearchEmbed`
107
107
  * @version: SDK: 1.2.0 | ThoughtSpot: 9.1.0.sw
108
108
  * @example
109
109
  * ```js
110
110
  * const embed = new SearchEmbed('#tsEmbed', {
111
- * ... // other options
111
+ * ... // other embed view config
112
112
  * hideDataSources:true,
113
113
  * })
114
114
  * ```
@@ -118,11 +118,13 @@ export interface SearchViewConfig
118
118
  * Show or hide the charts and tables in search answers.
119
119
  * This attribute can be used to create a custom visualization
120
120
  * using raw answer data.
121
+ *
122
+ * Supported embed types: `SearchEmbed`
121
123
  * @version: SDK: 1.2.0 | ThoughtSpot: 9.1.0.sw
122
124
  * @example
123
125
  * ```js
124
126
  * const embed = new SearchEmbed('#tsEmbed', {
125
- * ... // other options
127
+ * ... // other embed view config
126
128
  * hideResults:true,
127
129
  * })
128
130
  * ```
@@ -130,11 +132,13 @@ export interface SearchViewConfig
130
132
  hideResults?: boolean;
131
133
  /**
132
134
  * If set to true, the Search Assist feature is enabled.
135
+ *
136
+ * Supported embed types: `SearchEmbed`
133
137
  * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
134
138
  * @example
135
139
  * ```js
136
140
  * const embed = new SearchEmbed('#tsEmbed', {
137
- * ... // other options
141
+ * ... // other embed view config
138
142
  * enableSearchAssist:true,
139
143
  * })
140
144
  * ```
@@ -143,11 +147,13 @@ export interface SearchViewConfig
143
147
  /**
144
148
  * If set to true, the tabular view is set as the default
145
149
  * format for presenting search data.
150
+ *
151
+ * Supported embed types: `SearchEmbed`
146
152
  * @version: SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw
147
153
  * @example
148
154
  * ```js
149
155
  * const embed = new SearchEmbed('#tsEmbed', {
150
- * ... // other options
156
+ * ... // other embed view config
151
157
  * forceTable:true,
152
158
  * })
153
159
  */
@@ -156,10 +162,12 @@ export interface SearchViewConfig
156
162
  * The array of data source GUIDs to set on load.
157
163
  * Only a single data source is supported currently.
158
164
  * @deprecated Use `dataSource` instead.
165
+ *
166
+ * Supported embed types: `SearchEmbed`
159
167
  * @example
160
168
  * ```js
161
169
  * const embed = new SearchEmbed('#tsEmbed', {
162
- * ... // other options
170
+ * ... // other embed view config
163
171
  * dataSources:['id-234','id-456'],
164
172
  * })
165
173
  * ```
@@ -167,11 +175,13 @@ export interface SearchViewConfig
167
175
  dataSources?: string[];
168
176
  /**
169
177
  * The array of data source GUIDs to set on load.
178
+ *
179
+ * Supported embed types: `SearchEmbed`
170
180
  * @version: SDK: 1.19.0
171
181
  * @example
172
182
  * ```js
173
183
  * const embed = new SearchEmbed('#tsEmbed', {
174
- * ... // other options
184
+ * ... // other embed view config
175
185
  * dataSource:'id-234',
176
186
  * })
177
187
  * ```
@@ -194,6 +204,8 @@ export interface SearchViewConfig
194
204
  * If it is executed, the focus is placed on the results.
195
205
  * If it’s not executed, the focus is placed at the end of
196
206
  * the token string in the search bar.
207
+ *
208
+ * Supported embed types: `SearchEmbed`
197
209
  * @example
198
210
  * ```js
199
211
  * searchOptions: {
@@ -206,6 +218,8 @@ export interface SearchViewConfig
206
218
  /**
207
219
  * Exclude the search token string from the URL.
208
220
  * If set to true, the search token string is not appended to the URL.
221
+ *
222
+ * Supported embed types: `SearchEmbed`
209
223
  * @version: SDK: 1.35.7 | ThoughtSpot: 10.8.0.cl
210
224
  * @example
211
225
  * ```js
@@ -221,11 +235,13 @@ export interface SearchViewConfig
221
235
  excludeSearchTokenStringFromURL?: boolean;
222
236
  /**
223
237
  * The GUID of a saved answer to load initially.
238
+ *
239
+ * Supported embed types: `SearchEmbed`
224
240
  * @version: SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw
225
241
  * @example
226
242
  * ```js
227
243
  * const embed = new SearchEmbed('#tsEmbed', {
228
- * ... // other options
244
+ * ... // other embed view config
229
245
  * answerId:'sed-1234',
230
246
  * })
231
247
  * ```
@@ -234,11 +250,13 @@ export interface SearchViewConfig
234
250
  /**
235
251
  * If set to true, the search page will render without the Search Bar
236
252
  * The chart/table should still be visible.
253
+ *
254
+ * Supported embed types: `SearchEmbed`
237
255
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
238
256
  * @example
239
257
  * ```js
240
258
  * const embed = new SearchEmbed('#tsEmbed', {
241
- * ... // other options
259
+ * ... // other embed view config
242
260
  * hideSearchBar:true,
243
261
  * })
244
262
  * ```
@@ -246,6 +264,8 @@ export interface SearchViewConfig
246
264
  hideSearchBar?: boolean;
247
265
  /**
248
266
  * Flag to set if last selected dataSource should be used
267
+ *
268
+ * Supported embed types: `SearchEmbed`
249
269
  * @version: SDK: 1.24.0
250
270
  */
251
271
  useLastSelectedSources?: boolean;
@@ -258,6 +278,8 @@ export interface SearchViewConfig
258
278
  collapseSearchBarInitially?: boolean;
259
279
  /**
260
280
  * Flag to enable onBeforeSearchExecute Embed Event
281
+ *
282
+ * Supported embed types: `SearchEmbed`
261
283
  * @version: SDK: 1.29.0 | Thoughtspot: 10.1.0.cl
262
284
  */
263
285
  isOnBeforeGetVizDataInterceptEnabled?: boolean;
@@ -268,12 +290,14 @@ export interface SearchViewConfig
268
290
  * - EXPAND_ALL: Expand all the accordion initially in data panel v2.
269
291
  * - COLLAPSE_ALL: Collapse all the accordions initially in data panel v2.
270
292
  * - EXPAND_FIRST: Expand the first accordion and collapse the rest.
293
+ *
294
+ * Supported embed types: `SearchEmbed`
271
295
  * @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
272
296
  * @default DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL
273
297
  * @example
274
298
  * ```js
275
299
  * const embed = new SearchEmbed('#tsEmbed', {
276
- * ... // other options
300
+ * ... // other embed view config
277
301
  * dataPanelCustomGroupsAccordionInitialState:
278
302
  * DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL,
279
303
  * });
@@ -283,12 +307,14 @@ export interface SearchViewConfig
283
307
  /**
284
308
  * Flag to remove focus from search bar initially when user
285
309
  * lands on search embed page.
310
+ *
311
+ * Supported embed types: `SearchEmbed`
286
312
  * @version SDK: 1.32.0 | Thoughtspot: 10.3.0.cl
287
313
  * @default true
288
314
  * @example
289
315
  * ```js
290
316
  * const embed = new SearchEmbed('#tsEmbed', {
291
- * ... // other options
317
+ * ... // other embed view config
292
318
  * focusSearchBarOnRender: false,
293
319
  * });
294
320
  * ```
@@ -1993,13 +1993,13 @@ describe('Unit test case for ts embed', () => {
1993
1993
  });
1994
1994
 
1995
1995
  it('Should add contextMenuEnabledOnWhichClick flag to the iframe with right value', async () => {
1996
- const livebaordEmbed = new LiveboardEmbed(getRootEl(), {
1996
+ const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
1997
1997
  ...defaultViewConfig,
1998
1998
  liveboardId,
1999
1999
  contextMenuTrigger: ContextMenuTriggerOptions.RIGHT_CLICK,
2000
2000
  } as LiveboardViewConfig);
2001
2001
 
2002
- livebaordEmbed.render();
2002
+ liveboardEmbed.render();
2003
2003
  await executeAfterWait(() => {
2004
2004
  expectUrlMatchesWithParams(
2005
2005
  getIFrameSrc(),
@@ -2031,13 +2031,13 @@ describe('Unit test case for ts embed', () => {
2031
2031
  });
2032
2032
 
2033
2033
  it('Should add contextMenuEnabledOnWhichClick flag to the iframe with both value', async () => {
2034
- const livebaordEmbed = new LiveboardEmbed(getRootEl(), {
2034
+ const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
2035
2035
  ...defaultViewConfig,
2036
2036
  liveboardId,
2037
2037
  contextMenuTrigger: ContextMenuTriggerOptions.BOTH_CLICKS,
2038
2038
  } as LiveboardViewConfig);
2039
2039
 
2040
- livebaordEmbed.render();
2040
+ liveboardEmbed.render();
2041
2041
  await executeAfterWait(() => {
2042
2042
  expectUrlMatchesWithParams(
2043
2043
  getIFrameSrc(),
@@ -2706,4 +2706,52 @@ describe('Unit test case for ts embed', () => {
2706
2706
  );
2707
2707
  });
2708
2708
  });
2709
+
2710
+ describe('Fullscreen Change Handler', () => {
2711
+ beforeEach(() => {
2712
+ document.body.innerHTML = getDocumentBody();
2713
+ init({
2714
+ thoughtSpotHost: 'tshost',
2715
+ authType: AuthType.None,
2716
+ disableFullscreenPresentation: false,
2717
+ });
2718
+ });
2719
+
2720
+ test('should have setupFullscreenChangeHandler method', () => {
2721
+ const searchEmbed = new SearchEmbed(getRootEl(), defaultViewConfig);
2722
+ expect(typeof searchEmbed['setupFullscreenChangeHandler']).toBe('function');
2723
+ });
2724
+
2725
+ test('should have removeFullscreenChangeHandler method', () => {
2726
+ const searchEmbed = new SearchEmbed(getRootEl(), defaultViewConfig);
2727
+ expect(typeof searchEmbed['removeFullscreenChangeHandler']).toBe('function');
2728
+ });
2729
+
2730
+ test('should call setupFullscreenChangeHandler without errors', () => {
2731
+ const searchEmbed = new SearchEmbed(getRootEl(), defaultViewConfig);
2732
+ expect(() => {
2733
+ searchEmbed['setupFullscreenChangeHandler']();
2734
+ }).not.toThrow();
2735
+ });
2736
+
2737
+ test('should call removeFullscreenChangeHandler without errors', () => {
2738
+ const searchEmbed = new SearchEmbed(getRootEl(), defaultViewConfig);
2739
+ expect(() => {
2740
+ searchEmbed['removeFullscreenChangeHandler']();
2741
+ }).not.toThrow();
2742
+ });
2743
+
2744
+ test('should handle fullscreen change when feature flag is disabled', () => {
2745
+ init({
2746
+ thoughtSpotHost: 'tshost',
2747
+ authType: AuthType.None,
2748
+ disableFullscreenPresentation: true,
2749
+ });
2750
+
2751
+ const searchEmbed = new SearchEmbed(getRootEl(), defaultViewConfig);
2752
+ expect(() => {
2753
+ searchEmbed['setupFullscreenChangeHandler']();
2754
+ }).not.toThrow();
2755
+ });
2756
+ });
2709
2757
  });
@@ -52,17 +52,13 @@ import {
52
52
  Param,
53
53
  EmbedConfig,
54
54
  MessageOptions,
55
- MessagePayload,
56
55
  MessageCallbackObj,
57
- ViewConfig,
58
- FrameParams,
59
56
  ContextMenuTriggerOptions,
60
- RuntimeFilter,
61
57
  DefaultAppInitData,
58
+ AllEmbedViewConfig as ViewConfig,
62
59
  } from '../types';
63
60
  import { uploadMixpanelEvent, MIXPANEL_EVENT } from '../mixpanel-service';
64
61
  import { processEventData, processAuthFailure } from '../utils/processData';
65
- import { processTrigger } from '../utils/processTrigger';
66
62
  import pkgInfo from '../../package.json';
67
63
  import {
68
64
  getAuthPromise, renderInQueue, handleAuth, notifyAuthFailure,
@@ -132,7 +128,7 @@ export class TsEmbed {
132
128
  this.hostEventClient.setIframeElement(iFrame);
133
129
  }
134
130
 
135
- protected viewConfig: ViewConfig;
131
+ protected viewConfig: ViewConfig & { visibleTabs?: string[], hiddenTabs?: string[], showAlerts?: boolean };
136
132
 
137
133
  protected embedConfig: EmbedConfig;
138
134
 
@@ -184,6 +180,11 @@ export class TsEmbed {
184
180
 
185
181
  protected isReadyForRenderPromise;
186
182
 
183
+ /**
184
+ * Handler for fullscreen change events
185
+ */
186
+ private fullscreenChangeHandler: (() => void) | null = null;
187
+
187
188
  constructor(domSelector: DOMSelector, viewConfig?: ViewConfig) {
188
189
  this.el = getDOMNode(domSelector);
189
190
  this.eventHandlerMap = new Map();
@@ -778,6 +779,9 @@ export class TsEmbed {
778
779
  }
779
780
  });
780
781
  }
782
+
783
+ // Setup fullscreen change handler after iframe is loaded and ready
784
+ this.setupFullscreenChangeHandler();
781
785
  });
782
786
  this.iFrame.addEventListener('error', () => {
783
787
  nextInQueue();
@@ -1047,9 +1051,11 @@ export class TsEmbed {
1047
1051
  if (this.isRendered) {
1048
1052
  logger.warn('Please register event handlers before calling render');
1049
1053
  }
1054
+
1050
1055
  const callbacks = this.eventHandlerMap.get(messageType) || [];
1051
1056
  callbacks.push({ options, callback });
1052
1057
  this.eventHandlerMap.set(messageType, callbacks);
1058
+
1053
1059
  return this;
1054
1060
  }
1055
1061
 
@@ -1149,6 +1155,7 @@ export class TsEmbed {
1149
1155
  }
1150
1156
  await this.isReadyForRenderPromise;
1151
1157
  this.isRendered = true;
1158
+
1152
1159
  return this;
1153
1160
  }
1154
1161
 
@@ -1212,6 +1219,7 @@ export class TsEmbed {
1212
1219
  */
1213
1220
  public destroy(): void {
1214
1221
  try {
1222
+ this.removeFullscreenChangeHandler();
1215
1223
  this.insertedDomEl?.parentNode.removeChild(this.insertedDomEl);
1216
1224
  this.unsubscribeToEvents();
1217
1225
  } catch (e) {
@@ -1315,6 +1323,11 @@ export class TsEmbed {
1315
1323
  removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
1316
1324
 
1317
1325
  this.subscribeToEvents();
1326
+
1327
+ // Setup fullscreen change handler for prerendered components
1328
+ if (this.iFrame) {
1329
+ this.setupFullscreenChangeHandler();
1330
+ }
1318
1331
 
1319
1332
  return this;
1320
1333
  }
@@ -1391,6 +1404,48 @@ export class TsEmbed {
1391
1404
  const { session } = await this.trigger(HostEvent.GetAnswerSession, vizId ? { vizId } : {});
1392
1405
  return new AnswerService(session, null, this.embedConfig.thoughtSpotHost);
1393
1406
  }
1407
+
1408
+ /**
1409
+ * Set up fullscreen change detection to automatically trigger ExitPresentMode
1410
+ * when user exits fullscreen mode
1411
+ */
1412
+ private setupFullscreenChangeHandler() {
1413
+ const embedConfig = getEmbedConfig();
1414
+ const disableFullscreenPresentation = embedConfig?.disableFullscreenPresentation ?? true;
1415
+
1416
+ if (disableFullscreenPresentation) {
1417
+ return;
1418
+ }
1419
+
1420
+ if (this.fullscreenChangeHandler) {
1421
+ document.removeEventListener('fullscreenchange', this.fullscreenChangeHandler);
1422
+ }
1423
+
1424
+ this.fullscreenChangeHandler = () => {
1425
+ const isFullscreen = !!document.fullscreenElement;
1426
+ if (!isFullscreen) {
1427
+ logger.info('Exited fullscreen mode - triggering ExitPresentMode');
1428
+ // Only trigger if iframe is available and contentWindow is accessible
1429
+ if (this.iFrame && this.iFrame.contentWindow) {
1430
+ this.trigger(HostEvent.ExitPresentMode);
1431
+ } else {
1432
+ logger.debug('Skipping ExitPresentMode - iframe contentWindow not available');
1433
+ }
1434
+ }
1435
+ };
1436
+
1437
+ document.addEventListener('fullscreenchange', this.fullscreenChangeHandler);
1438
+ }
1439
+
1440
+ /**
1441
+ * Remove fullscreen change handler
1442
+ */
1443
+ private removeFullscreenChangeHandler() {
1444
+ if (this.fullscreenChangeHandler) {
1445
+ document.removeEventListener('fullscreenchange', this.fullscreenChangeHandler);
1446
+ this.fullscreenChangeHandler = null;
1447
+ }
1448
+ }
1394
1449
  }
1395
1450
 
1396
1451
  /**
package/src/index.ts CHANGED
@@ -15,6 +15,7 @@ import {
15
15
  HomePageSearchBarMode,
16
16
  PrimaryNavbarVersion,
17
17
  HomePage,
18
+ DataPanelCustomColumnGroupsAccordionState,
18
19
  } from './embed/app';
19
20
  import {
20
21
  init,
@@ -144,6 +145,7 @@ export {
144
145
  CustomActionPayload,
145
146
  UIPassthroughEvent,
146
147
  ListPageColumns,
148
+ DataPanelCustomColumnGroupsAccordionState,
147
149
  };
148
150
 
149
151
  export { resetCachedAuthToken } from './authToken';
@@ -57,4 +57,5 @@ export {
57
57
  RuntimeParameter,
58
58
  resetCachedAuthToken,
59
59
  UIPassthroughEvent,
60
+ DataPanelCustomColumnGroupsAccordionState,
60
61
  } from '../index';
@@ -12,12 +12,12 @@ import { LiveboardEmbed as _LiveboardEmbed, LiveboardViewConfig } from '../embed
12
12
  import { TsEmbed } from '../embed/ts-embed';
13
13
  import { SpotterAgentEmbed as _SpotterAgentEmbed, SpotterAgentEmbedViewConfig } from '../embed/bodyless-conversation';
14
14
 
15
- import { EmbedConfig, EmbedEvent, ViewConfig } from '../types';
15
+ import { EmbedConfig, EmbedEvent, AllEmbedViewConfig } from '../types';
16
16
  import { EmbedProps, getViewPropsAndListeners } from './util';
17
17
  import { SpotterEmbed as _SpotterEmbed, SpotterEmbedViewConfig, ConversationEmbed as _ConversationEmbed, ConversationViewConfig } from '../embed/conversation';
18
18
  import { init } from '../embed/base';
19
19
 
20
- const componentFactory = <T extends typeof TsEmbed, U extends EmbedProps, V extends ViewConfig>(
20
+ const componentFactory = <T extends typeof TsEmbed, U extends EmbedProps, V extends AllEmbedViewConfig>(
21
21
  EmbedConstructor: T,
22
22
  // isPreRenderedComponent: Specifies whether the component being returned is
23
23
  // intended for preRendering. If set to true, the component will call the
@@ -362,7 +362,7 @@ export const SpotterEmbed = componentFactory<
362
362
 
363
363
  /**
364
364
  * React component for LLM based conversation BI.
365
- * @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
365
+ * @deprecated from SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
366
366
  * Use {@link SpotterEmbed} instead
367
367
  * @example
368
368
  * ```tsx
package/src/react/util.ts CHANGED
@@ -1,13 +1,15 @@
1
- import { EmbedEvent, MessageCallback, ViewConfig } from '../types';
1
+ import { EmbedEvent, MessageCallback, AllEmbedViewConfig } from '../types';
2
+
3
+ interface EmbedViewConfig extends AllEmbedViewConfig, EmbedEventHandlers {}
2
4
 
3
5
  export type EmbedEventHandlers = { [key in keyof typeof EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback };
4
6
 
5
- export interface EmbedProps extends ViewConfig, EmbedEventHandlers {
7
+ export interface EmbedProps extends EmbedViewConfig {
6
8
  className?: string;
7
9
  style?: React.CSSProperties;
8
10
  }
9
11
 
10
- export interface ViewConfigAndListeners<T extends ViewConfig> {
12
+ export interface ViewConfigAndListeners<T extends EmbedViewConfig> {
11
13
  viewConfig: T;
12
14
  listeners: { [key in EmbedEvent]?: MessageCallback };
13
15
  }
@@ -18,7 +20,7 @@ export interface ViewConfigAndListeners<T extends ViewConfig> {
18
20
  */
19
21
  export function getViewPropsAndListeners<
20
22
  T extends EmbedProps,
21
- U extends ViewConfig>(props: T): ViewConfigAndListeners<U> {
23
+ U extends EmbedViewConfig>(props: T): ViewConfigAndListeners<U> {
22
24
  return Object.keys(props).reduce(
23
25
  (accu, key) => {
24
26
  if (key.startsWith('on')) {