@thoughtspot/visual-embed-sdk 1.41.0-pre-render-1 → 1.41.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 (259) hide show
  1. package/README.md +2 -4
  2. package/cjs/package.json +3 -3
  3. package/cjs/src/authToken.d.ts +1 -0
  4. package/cjs/src/authToken.d.ts.map +1 -1
  5. package/cjs/src/authToken.js +13 -3
  6. package/cjs/src/authToken.js.map +1 -1
  7. package/cjs/src/authToken.spec.js +29 -0
  8. package/cjs/src/authToken.spec.js.map +1 -1
  9. package/cjs/src/css-variables.d.ts +2 -1
  10. package/cjs/src/css-variables.d.ts.map +1 -1
  11. package/cjs/src/embed/app.d.ts +22 -1
  12. package/cjs/src/embed/app.d.ts.map +1 -1
  13. package/cjs/src/embed/app.js +22 -1
  14. package/cjs/src/embed/app.js.map +1 -1
  15. package/cjs/src/embed/app.spec.js +70 -3
  16. package/cjs/src/embed/app.spec.js.map +1 -1
  17. package/cjs/src/embed/bodyless-conversation.d.ts +0 -1
  18. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  19. package/cjs/src/embed/bodyless-conversation.js +3 -7
  20. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  21. package/cjs/src/embed/conversation.d.ts +2 -3
  22. package/cjs/src/embed/conversation.d.ts.map +1 -1
  23. package/cjs/src/embed/conversation.js +2 -7
  24. package/cjs/src/embed/conversation.js.map +1 -1
  25. package/cjs/src/embed/liveboard.d.ts +32 -1
  26. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  27. package/cjs/src/embed/liveboard.js +8 -25
  28. package/cjs/src/embed/liveboard.js.map +1 -1
  29. package/cjs/src/embed/liveboard.spec.js +96 -28
  30. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  31. package/cjs/src/embed/sage.d.ts +0 -1
  32. package/cjs/src/embed/sage.d.ts.map +1 -1
  33. package/cjs/src/embed/sage.js +6 -10
  34. package/cjs/src/embed/sage.js.map +1 -1
  35. package/cjs/src/embed/sage.spec.js +20 -10
  36. package/cjs/src/embed/sage.spec.js.map +1 -1
  37. package/cjs/src/embed/search-bar.d.ts +0 -1
  38. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  39. package/cjs/src/embed/search-bar.js +7 -11
  40. package/cjs/src/embed/search-bar.js.map +1 -1
  41. package/cjs/src/embed/search.d.ts +0 -1
  42. package/cjs/src/embed/search.d.ts.map +1 -1
  43. package/cjs/src/embed/search.js +8 -7
  44. package/cjs/src/embed/search.js.map +1 -1
  45. package/cjs/src/embed/search.spec.js +10 -10
  46. package/cjs/src/embed/search.spec.js.map +1 -1
  47. package/cjs/src/embed/ts-embed.d.ts +5 -7
  48. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  49. package/cjs/src/embed/ts-embed.js +25 -22
  50. package/cjs/src/embed/ts-embed.js.map +1 -1
  51. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  52. package/cjs/src/embed/ts-embed.spec.js +122 -0
  53. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  54. package/cjs/src/errors.d.ts +11 -0
  55. package/cjs/src/errors.d.ts.map +1 -1
  56. package/cjs/src/errors.js +12 -1
  57. package/cjs/src/errors.js.map +1 -1
  58. package/cjs/src/index.d.ts +2 -2
  59. package/cjs/src/index.d.ts.map +1 -1
  60. package/cjs/src/index.js +3 -1
  61. package/cjs/src/index.js.map +1 -1
  62. package/cjs/src/react/index.d.ts +1 -1
  63. package/cjs/src/react/index.d.ts.map +1 -1
  64. package/cjs/src/react/index.js +4 -2
  65. package/cjs/src/react/index.js.map +1 -1
  66. package/cjs/src/react/index.spec.js +1 -1
  67. package/cjs/src/react/index.spec.js.map +1 -1
  68. package/cjs/src/types.d.ts +163 -21
  69. package/cjs/src/types.d.ts.map +1 -1
  70. package/cjs/src/types.js +65 -22
  71. package/cjs/src/types.js.map +1 -1
  72. package/cjs/src/utils/custom-actions.d.ts +12 -0
  73. package/cjs/src/utils/custom-actions.d.ts.map +1 -0
  74. package/cjs/src/utils/custom-actions.js +180 -0
  75. package/cjs/src/utils/custom-actions.js.map +1 -0
  76. package/cjs/src/utils/custom-actions.spec.d.ts +2 -0
  77. package/cjs/src/utils/custom-actions.spec.d.ts.map +1 -0
  78. package/cjs/src/utils/custom-actions.spec.js +399 -0
  79. package/cjs/src/utils/custom-actions.spec.js.map +1 -0
  80. package/cjs/src/utils/processData.d.ts.map +1 -1
  81. package/cjs/src/utils/processData.js +10 -0
  82. package/cjs/src/utils/processData.js.map +1 -1
  83. package/cjs/src/utils/processData.spec.js +11 -0
  84. package/cjs/src/utils/processData.spec.js.map +1 -1
  85. package/cjs/src/utils.d.ts +21 -0
  86. package/cjs/src/utils.d.ts.map +1 -1
  87. package/cjs/src/utils.js +32 -1
  88. package/cjs/src/utils.js.map +1 -1
  89. package/cjs/src/utils.spec.js +38 -0
  90. package/cjs/src/utils.spec.js.map +1 -1
  91. package/dist/{index-CmEQfuE3.js → index-DQueHwfQ.js} +1 -1
  92. package/dist/src/authToken.d.ts +1 -0
  93. package/dist/src/authToken.d.ts.map +1 -1
  94. package/dist/src/css-variables.d.ts +2 -1
  95. package/dist/src/css-variables.d.ts.map +1 -1
  96. package/dist/src/embed/app.d.ts +22 -1
  97. package/dist/src/embed/app.d.ts.map +1 -1
  98. package/dist/src/embed/bodyless-conversation.d.ts +0 -1
  99. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  100. package/dist/src/embed/conversation.d.ts +2 -3
  101. package/dist/src/embed/conversation.d.ts.map +1 -1
  102. package/dist/src/embed/liveboard.d.ts +32 -1
  103. package/dist/src/embed/liveboard.d.ts.map +1 -1
  104. package/dist/src/embed/sage.d.ts +0 -1
  105. package/dist/src/embed/sage.d.ts.map +1 -1
  106. package/dist/src/embed/search-bar.d.ts +0 -1
  107. package/dist/src/embed/search-bar.d.ts.map +1 -1
  108. package/dist/src/embed/search.d.ts +0 -1
  109. package/dist/src/embed/search.d.ts.map +1 -1
  110. package/dist/src/embed/ts-embed.d.ts +5 -7
  111. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  112. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  113. package/dist/src/errors.d.ts +11 -0
  114. package/dist/src/errors.d.ts.map +1 -1
  115. package/dist/src/index.d.ts +2 -2
  116. package/dist/src/index.d.ts.map +1 -1
  117. package/dist/src/react/index.d.ts +1 -1
  118. package/dist/src/react/index.d.ts.map +1 -1
  119. package/dist/src/types.d.ts +163 -21
  120. package/dist/src/types.d.ts.map +1 -1
  121. package/dist/src/utils/custom-actions.d.ts +12 -0
  122. package/dist/src/utils/custom-actions.d.ts.map +1 -0
  123. package/dist/src/utils/custom-actions.spec.d.ts +2 -0
  124. package/dist/src/utils/custom-actions.spec.d.ts.map +1 -0
  125. package/dist/src/utils/processData.d.ts.map +1 -1
  126. package/dist/src/utils.d.ts +21 -0
  127. package/dist/src/utils.d.ts.map +1 -1
  128. package/dist/tsembed-react.es.js +1773 -251
  129. package/dist/tsembed-react.js +1772 -250
  130. package/dist/tsembed.es.js +1771 -250
  131. package/dist/tsembed.js +1770 -249
  132. package/dist/visual-embed-sdk-react-full.d.ts +228 -39
  133. package/dist/visual-embed-sdk-react.d.ts +228 -39
  134. package/dist/visual-embed-sdk.d.ts +228 -39
  135. package/lib/package.json +3 -3
  136. package/lib/src/authToken.d.ts +1 -0
  137. package/lib/src/authToken.d.ts.map +1 -1
  138. package/lib/src/authToken.js +11 -2
  139. package/lib/src/authToken.js.map +1 -1
  140. package/lib/src/authToken.spec.js +30 -1
  141. package/lib/src/authToken.spec.js.map +1 -1
  142. package/lib/src/css-variables.d.ts +2 -1
  143. package/lib/src/css-variables.d.ts.map +1 -1
  144. package/lib/src/embed/app.d.ts +22 -1
  145. package/lib/src/embed/app.d.ts.map +1 -1
  146. package/lib/src/embed/app.js +22 -1
  147. package/lib/src/embed/app.js.map +1 -1
  148. package/lib/src/embed/app.spec.js +70 -3
  149. package/lib/src/embed/app.spec.js.map +1 -1
  150. package/lib/src/embed/bodyless-conversation.d.ts +0 -1
  151. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  152. package/lib/src/embed/bodyless-conversation.js +3 -7
  153. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  154. package/lib/src/embed/conversation.d.ts +2 -3
  155. package/lib/src/embed/conversation.d.ts.map +1 -1
  156. package/lib/src/embed/conversation.js +2 -7
  157. package/lib/src/embed/conversation.js.map +1 -1
  158. package/lib/src/embed/liveboard.d.ts +32 -1
  159. package/lib/src/embed/liveboard.d.ts.map +1 -1
  160. package/lib/src/embed/liveboard.js +8 -25
  161. package/lib/src/embed/liveboard.js.map +1 -1
  162. package/lib/src/embed/liveboard.spec.js +96 -28
  163. package/lib/src/embed/liveboard.spec.js.map +1 -1
  164. package/lib/src/embed/sage.d.ts +0 -1
  165. package/lib/src/embed/sage.d.ts.map +1 -1
  166. package/lib/src/embed/sage.js +6 -10
  167. package/lib/src/embed/sage.js.map +1 -1
  168. package/lib/src/embed/sage.spec.js +20 -10
  169. package/lib/src/embed/sage.spec.js.map +1 -1
  170. package/lib/src/embed/search-bar.d.ts +0 -1
  171. package/lib/src/embed/search-bar.d.ts.map +1 -1
  172. package/lib/src/embed/search-bar.js +7 -11
  173. package/lib/src/embed/search-bar.js.map +1 -1
  174. package/lib/src/embed/search.d.ts +0 -1
  175. package/lib/src/embed/search.d.ts.map +1 -1
  176. package/lib/src/embed/search.js +8 -7
  177. package/lib/src/embed/search.js.map +1 -1
  178. package/lib/src/embed/search.spec.js +11 -11
  179. package/lib/src/embed/search.spec.js.map +1 -1
  180. package/lib/src/embed/ts-embed.d.ts +5 -7
  181. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  182. package/lib/src/embed/ts-embed.js +25 -22
  183. package/lib/src/embed/ts-embed.js.map +1 -1
  184. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  185. package/lib/src/embed/ts-embed.spec.js +123 -1
  186. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  187. package/lib/src/errors.d.ts +11 -0
  188. package/lib/src/errors.d.ts.map +1 -1
  189. package/lib/src/errors.js +11 -0
  190. package/lib/src/errors.js.map +1 -1
  191. package/lib/src/index.d.ts +2 -2
  192. package/lib/src/index.d.ts.map +1 -1
  193. package/lib/src/index.js +2 -2
  194. package/lib/src/index.js.map +1 -1
  195. package/lib/src/react/index.d.ts +1 -1
  196. package/lib/src/react/index.d.ts.map +1 -1
  197. package/lib/src/react/index.js +3 -2
  198. package/lib/src/react/index.js.map +1 -1
  199. package/lib/src/react/index.spec.js +1 -1
  200. package/lib/src/react/index.spec.js.map +1 -1
  201. package/lib/src/types.d.ts +163 -21
  202. package/lib/src/types.d.ts.map +1 -1
  203. package/lib/src/types.js +64 -21
  204. package/lib/src/types.js.map +1 -1
  205. package/lib/src/utils/custom-actions.d.ts +12 -0
  206. package/lib/src/utils/custom-actions.d.ts.map +1 -0
  207. package/lib/src/utils/custom-actions.js +175 -0
  208. package/lib/src/utils/custom-actions.js.map +1 -0
  209. package/lib/src/utils/custom-actions.spec.d.ts +2 -0
  210. package/lib/src/utils/custom-actions.spec.d.ts.map +1 -0
  211. package/lib/src/utils/custom-actions.spec.js +397 -0
  212. package/lib/src/utils/custom-actions.spec.js.map +1 -0
  213. package/lib/src/utils/processData.d.ts.map +1 -1
  214. package/lib/src/utils/processData.js +10 -0
  215. package/lib/src/utils/processData.js.map +1 -1
  216. package/lib/src/utils/processData.spec.js +11 -0
  217. package/lib/src/utils/processData.spec.js.map +1 -1
  218. package/lib/src/utils.d.ts +21 -0
  219. package/lib/src/utils.d.ts.map +1 -1
  220. package/lib/src/utils.js +29 -0
  221. package/lib/src/utils.js.map +1 -1
  222. package/lib/src/utils.spec.js +39 -1
  223. package/lib/src/utils.spec.js.map +1 -1
  224. package/lib/src/visual-embed-sdk.d.ts +229 -40
  225. package/package.json +3 -3
  226. package/src/authToken.spec.ts +48 -1
  227. package/src/authToken.ts +13 -2
  228. package/src/css-variables.ts +2 -1
  229. package/src/embed/app.spec.ts +99 -3
  230. package/src/embed/app.ts +44 -1
  231. package/src/embed/bodyless-conversation.ts +3 -8
  232. package/src/embed/conversation.ts +4 -19
  233. package/src/embed/liveboard.spec.ts +128 -30
  234. package/src/embed/liveboard.ts +66 -52
  235. package/src/embed/sage.spec.ts +24 -10
  236. package/src/embed/sage.ts +7 -12
  237. package/src/embed/search-bar.tsx +7 -14
  238. package/src/embed/search.spec.ts +13 -14
  239. package/src/embed/search.ts +8 -19
  240. package/src/embed/ts-embed.spec.ts +136 -2
  241. package/src/embed/ts-embed.ts +31 -28
  242. package/src/errors.ts +12 -0
  243. package/src/index.ts +4 -0
  244. package/src/react/index.spec.tsx +1 -1
  245. package/src/react/index.tsx +5 -2
  246. package/src/types.ts +225 -79
  247. package/src/utils/custom-actions.spec.ts +431 -0
  248. package/src/utils/custom-actions.ts +217 -0
  249. package/src/utils/processData.spec.ts +12 -0
  250. package/src/utils/processData.ts +10 -0
  251. package/src/utils.spec.ts +52 -0
  252. package/src/utils.ts +31 -0
  253. package/dist/index-BDlM0f0T.js +0 -7371
  254. package/dist/index-D1pyb7RG.js +0 -7371
  255. package/dist/index-DeFzsyFF.js +0 -7371
  256. package/dist/index-Dpf0rd6w.js +0 -7371
  257. package/dist/index-UuEbsISo.js +0 -7447
  258. package/dist/index-e3Uw3YFO.js +0 -7371
  259. package/dist/index-k7pkZMhx.js +0 -7371
@@ -344,6 +344,48 @@ describe('App embed tests', () => {
344
344
  });
345
345
  });
346
346
 
347
+ test('should set isPNGInScheduledEmailsEnabled to true in url', async () => {
348
+ const appEmbed = new AppEmbed(getRootEl(), {
349
+ ...defaultViewConfig,
350
+ isPNGInScheduledEmailsEnabled: true,
351
+ } as AppViewConfig);
352
+ appEmbed.render();
353
+ await executeAfterWait(() => {
354
+ expectUrlMatchesWithParams(
355
+ getIFrameSrc(),
356
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true${defaultParamsPost}#/home`,
357
+ );
358
+ });
359
+ });
360
+
361
+ test('should set liveboardXLSXCSVDownload to true in url', async () => {
362
+ const appEmbed = new AppEmbed(getRootEl(), {
363
+ ...defaultViewConfig,
364
+ liveboardXLSXCSVDownload: true,
365
+ } as AppViewConfig);
366
+ appEmbed.render();
367
+ await executeAfterWait(() => {
368
+ expectUrlMatchesWithParams(
369
+ getIFrameSrc(),
370
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true${defaultParamsPost}#/home`,
371
+ );
372
+ });
373
+ });
374
+
375
+ test('should set liveboardXLSXCSVDownload to false in url', async () => {
376
+ const appEmbed = new AppEmbed(getRootEl(), {
377
+ ...defaultViewConfig,
378
+ liveboardXLSXCSVDownload: false,
379
+ } as AppViewConfig);
380
+ appEmbed.render();
381
+ await executeAfterWait(() => {
382
+ expectUrlMatchesWithParams(
383
+ getIFrameSrc(),
384
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=false${defaultParamsPost}#/home`,
385
+ );
386
+ });
387
+ });
388
+
347
389
  test('Should add the tag to the iframe src', async () => {
348
390
  const appEmbed = new AppEmbed(getRootEl(), {
349
391
  ...defaultViewConfig,
@@ -611,6 +653,43 @@ describe('App embed tests', () => {
611
653
  });
612
654
  });
613
655
 
656
+ test('Should add homepageVersion=v3 & navigationVersion=v3 & modularHomeExperience=true when Sliding and ModularWithStylingChanges configured in the iframe src', async () => {
657
+ const appEmbed = new AppEmbed(getRootEl(), {
658
+ ...defaultViewConfig,
659
+ discoveryExperience: {
660
+ primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
661
+ homePage: HomePage.ModularWithStylingChanges,
662
+ },
663
+ } as AppViewConfig);
664
+
665
+ appEmbed.render();
666
+ await executeAfterWait(() => {
667
+ expectUrlMatchesWithParams(
668
+ getIFrameSrc(),
669
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
670
+ );
671
+ });
672
+ });
673
+
674
+ test('Should add homepageVersion=v3 & navigationVersion=v3 & modularHomeExperience=true when homePage is ModularWithStylingChanges to the iframe src', async () => {
675
+ const appEmbed = new AppEmbed(getRootEl(), {
676
+ ...defaultViewConfig,
677
+ // primaryNavbarVersion is not included under discoveryExperience,
678
+ // then it set navigationVersion=v2 and modularHomeExperience=false.
679
+ discoveryExperience: {
680
+ homePage: HomePage.ModularWithStylingChanges,
681
+ },
682
+ } as AppViewConfig);
683
+
684
+ appEmbed.render();
685
+ await executeAfterWait(() => {
686
+ expectUrlMatchesWithParams(
687
+ getIFrameSrc(),
688
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
689
+ );
690
+ });
691
+ });
692
+
614
693
  test('Should add navigationVersion=v2 when primaryNavbarVersion is not added to the iframe src', async () => {
615
694
  const appEmbed = new AppEmbed(getRootEl(), {
616
695
  ...defaultViewConfig,
@@ -657,11 +736,27 @@ describe('App embed tests', () => {
657
736
  });
658
737
  });
659
738
 
660
- test('Should not add listpageVersion when listPageVersion is List (v2) to the iframe src', async () => {
739
+
740
+ test('Should add listpageVersion=v2 by default when no discoveryExperience is provided', async () => {
741
+ const appEmbed = new AppEmbed(getRootEl(), {
742
+ ...defaultViewConfig,
743
+ } as AppViewConfig);
744
+
745
+ appEmbed.render();
746
+ await executeAfterWait(() => {
747
+ expectUrlMatchesWithParams(
748
+ getIFrameSrc(),
749
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&listpageVersion=v2${defaultParams}${defaultParamsPost}#/home`,
750
+ );
751
+ });
752
+ });
753
+
754
+ test('Should add listpageVersion=v2 by default when discoveryExperience is provided but listPageVersion is not specified', async () => {
661
755
  const appEmbed = new AppEmbed(getRootEl(), {
662
756
  ...defaultViewConfig,
663
757
  discoveryExperience: {
664
- listPageVersion: ListPage.List,
758
+ primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
759
+ homePage: HomePage.Modular,
665
760
  },
666
761
  } as AppViewConfig);
667
762
 
@@ -669,11 +764,12 @@ describe('App embed tests', () => {
669
764
  await executeAfterWait(() => {
670
765
  expectUrlMatchesWithParams(
671
766
  getIFrameSrc(),
672
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false${defaultParams}${defaultParamsPost}#/home`,
767
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&listpageVersion=v2${defaultParams}${defaultParamsPost}#/home`,
673
768
  );
674
769
  });
675
770
  });
676
771
 
772
+
677
773
  test('Should add listpageVersion=v3 combined with other discoveryExperience options to the iframe src', async () => {
678
774
  const appEmbed = new AppEmbed(getRootEl(), {
679
775
  ...defaultViewConfig,
package/src/embed/app.ts CHANGED
@@ -107,6 +107,11 @@ export enum HomePage {
107
107
  * It serves as the foundational version of the home page.
108
108
  */
109
109
  Modular = 'v2',
110
+ /**
111
+ * ModularWithStylingChanges (v3) introduces Modular Home Experience
112
+ * with styling changes.
113
+ */
114
+ ModularWithStylingChanges = 'v3',
110
115
  }
111
116
 
112
117
  /**
@@ -532,6 +537,23 @@ export interface AppViewConfig extends AllEmbedViewConfig {
532
537
  */
533
538
  isLiveboardStylingAndGroupingEnabled?: boolean;
534
539
 
540
+ /**
541
+ * This flag is used to enable/disable the png embedding of liveboard in scheduled mails
542
+ *
543
+ * Supported embed types: `AppEmbed`, `LiveboardEmbed`
544
+ * @type {boolean}
545
+ * @version SDK: 1.42.0 | ThoughtSpot: 10.14.0.cl
546
+ * @example
547
+ * ```js
548
+ * // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
549
+ * const embed = new <EmbedComponent>('#tsEmbed', {
550
+ * ... // other embed view config
551
+ * isPNGInScheduledEmailsEnabled: true,
552
+ * })
553
+ * ```
554
+ */
555
+ isPNGInScheduledEmailsEnabled?: boolean;
556
+
535
557
  /**
536
558
  * This flag is used to enable the full height lazy load data.
537
559
  *
@@ -614,7 +636,7 @@ export class AppEmbed extends V1Embed {
614
636
  hideOrgSwitcher,
615
637
  enableSearchAssist,
616
638
  fullHeight,
617
- dataPanelV2 = false,
639
+ dataPanelV2 = true,
618
640
  hideLiveboardHeader = false,
619
641
  showLiveboardTitle = true,
620
642
  showLiveboardDescription = true,
@@ -638,7 +660,9 @@ export class AppEmbed extends V1Embed {
638
660
  enablePendoHelp = true,
639
661
  discoveryExperience,
640
662
  coverAndFilterOptionInPDF = false,
663
+ liveboardXLSXCSVDownload = false,
641
664
  isLiveboardStylingAndGroupingEnabled,
665
+ isPNGInScheduledEmailsEnabled = false,
642
666
  } = this.viewConfig;
643
667
 
644
668
  let params: any = {};
@@ -657,6 +681,7 @@ export class AppEmbed extends V1Embed {
657
681
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
658
682
  params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
659
683
  params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
684
+ params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
660
685
 
661
686
  params = this.getBaseQueryParams(params);
662
687
 
@@ -721,6 +746,10 @@ export class AppEmbed extends V1Embed {
721
746
  params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
722
747
  }
723
748
 
749
+ if (isPNGInScheduledEmailsEnabled !== undefined) {
750
+ params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
751
+ }
752
+
724
753
  params[Param.DataPanelV2Enabled] = dataPanelV2;
725
754
  params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
726
755
  params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
@@ -746,6 +775,12 @@ export class AppEmbed extends V1Embed {
746
775
  // To use v3 navigation, we must manually set the discoveryExperience
747
776
  // settings.
748
777
  params[Param.NavigationVersion] = 'v2';
778
+ // Set homePageVersion to v2 by default to reset the LD flag value
779
+ // for the homepageVersion.
780
+ params[Param.HomepageVersion] = 'v2';
781
+ // Set listpageVersion to v2 by default to reset the LD flag value
782
+ // for the listpageVersion.
783
+ params[Param.ListPageVersion] = ListPage.List;
749
784
  if (discoveryExperience) {
750
785
  // primaryNavbarVersion v3 will enabled the new left navigation
751
786
  if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
@@ -759,6 +794,14 @@ export class AppEmbed extends V1Embed {
759
794
  if (discoveryExperience.homePage === HomePage.Modular) {
760
795
  params[Param.ModularHomeExperienceEnabled] = true;
761
796
  }
797
+
798
+ // ModularWithStylingChanges (v3) introduces the styling changes
799
+ // to the Modular Homepage.
800
+ // v3 will be the base version of homePageVersion.
801
+ if (discoveryExperience.homePage === HomePage.ModularWithStylingChanges) {
802
+ params[Param.HomepageVersion] = HomePage.ModularWithStylingChanges;
803
+ }
804
+
762
805
  // listPageVersion v3 will enable the new list page
763
806
  if (discoveryExperience.listPageVersion === ListPage.ListWithUXChanges) {
764
807
  params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
@@ -39,13 +39,6 @@ export class ConversationMessage extends TsEmbed {
39
39
  super(container, viewConfig);
40
40
  }
41
41
 
42
- protected getEmbedParamsObject() {
43
- const queryParams = this.getBaseQueryParams();
44
- queryParams[Param.HideActions] = [...(queryParams[Param.HideActions] ?? [])];
45
- queryParams[Param.isSpotterAgentEmbed] = true;
46
- return queryParams;
47
- }
48
-
49
42
  public getIframeSrc() {
50
43
  const {
51
44
  sessionId,
@@ -56,8 +49,10 @@ export class ConversationMessage extends TsEmbed {
56
49
  messageId,
57
50
  } = this.viewConfig;
58
51
  const path = 'conv-assist-answer';
59
- const queryParams = this.getEmbedParamsObject();
52
+ const queryParams = this.getBaseQueryParams();
60
53
 
54
+ queryParams[Param.HideActions] = [...(queryParams[Param.HideActions] ?? [])];
55
+ queryParams[Param.isSpotterAgentEmbed] = true;
61
56
  let query = '';
62
57
  const queryParamsString = getQueryParamString(queryParams, true);
63
58
  if (queryParamsString) {
@@ -61,8 +61,8 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
61
61
  * Flag to control Data panel experience
62
62
  *
63
63
  * Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
64
- * @default false
65
- * @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.4.0.cl
64
+ * @default true
65
+ * @version SDK: 1.43.0 | ThoughtSpot Cloud: 10.14.0.cl
66
66
  * @example
67
67
  * ```js
68
68
  * // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
@@ -196,7 +196,7 @@ export class SpotterEmbed extends TsEmbed {
196
196
  super(container, viewConfig);
197
197
  }
198
198
 
199
- protected getEmbedParamsObject() {
199
+ public getIframeSrc(): string {
200
200
  const {
201
201
  worksheetId,
202
202
  searchOptions,
@@ -210,7 +210,7 @@ export class SpotterEmbed extends TsEmbed {
210
210
  runtimeParameters,
211
211
  excludeRuntimeParametersfromURL,
212
212
  } = this.viewConfig;
213
-
213
+ const path = 'insights/conv-assist';
214
214
  if (!worksheetId) {
215
215
  this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
216
216
  }
@@ -235,21 +235,6 @@ export class SpotterEmbed extends TsEmbed {
235
235
  queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
236
236
  }
237
237
 
238
- return queryParams;
239
- }
240
-
241
- public getIframeSrc(): string {
242
- const {
243
- worksheetId,
244
- searchOptions,
245
- runtimeFilters,
246
- excludeRuntimeFiltersfromURL,
247
- runtimeParameters,
248
- excludeRuntimeParametersfromURL,
249
- } = this.viewConfig;
250
- const path = 'insights/conv-assist';
251
- const queryParams = this.getEmbedParamsObject();
252
-
253
238
  let query = '';
254
239
  const queryParamsString = getQueryParamString(queryParams, true);
255
240
  if (queryParamsString) {
@@ -41,6 +41,16 @@ const thoughtSpotHost = 'tshost';
41
41
  const prefixParams = '&isLiveboardEmbed=true';
42
42
  const prefixParamsVizEmbed = '&isLiveboardEmbed=true&isVizEmbed=true';
43
43
 
44
+ const mockGetSessionInfo = (mockSessionInfo?: any) => {
45
+ jest.spyOn(SessionInfoService, 'getSessionInfo').mockResolvedValue(mockSessionInfo || {
46
+ releaseVersion: '1.0.0',
47
+ userGUID: '1234567890',
48
+ currentOrgId: 1,
49
+ privileges: [],
50
+ mixpanelToken: '1234567890',
51
+ })
52
+ };
53
+
44
54
  beforeAll(() => {
45
55
  init({
46
56
  thoughtSpotHost,
@@ -77,7 +87,7 @@ describe('Liveboard/viz embed tests', () => {
77
87
  await executeAfterWait(() => {
78
88
  expectUrlMatchesWithParams(
79
89
  getIFrameSrc(),
80
- `http://${thoughtSpotHost}/?embedApp=true${defaultParams}${prefixParams}&enableDataPanelV2=false#/embed/viz/${liveboardId}`,
90
+ `http://${thoughtSpotHost}/?embedApp=true${defaultParams}${prefixParams}&enableDataPanelV2=true#/embed/viz/${liveboardId}`,
81
91
  );
82
92
  });
83
93
  });
@@ -158,6 +168,21 @@ describe('Liveboard/viz embed tests', () => {
158
168
  });
159
169
  });
160
170
 
171
+ test('should set isPNGInScheduledEmailsEnabled to true in url', async () => {
172
+ const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
173
+ isPNGInScheduledEmailsEnabled: true,
174
+ ...defaultViewConfig,
175
+ liveboardId,
176
+ } as LiveboardViewConfig);
177
+ liveboardEmbed.render();
178
+ await executeAfterWait(() => {
179
+ expectUrlMatchesWithParams(
180
+ getIFrameSrc(),
181
+ `http://${thoughtSpotHost}/?embedApp=true${defaultParams}&isPNGInScheduledEmailsEnabled=true${prefixParams}#/embed/viz/${liveboardId}`,
182
+ );
183
+ });
184
+ });
185
+
161
186
  test('should set visible actions as empty array', async () => {
162
187
  const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
163
188
  visibleActions: [],
@@ -368,6 +393,36 @@ describe('Liveboard/viz embed tests', () => {
368
393
  });
369
394
  });
370
395
 
396
+ test('should add liveboardXLSXCSVDownload flag and set value to true to the iframe src', async () => {
397
+ const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
398
+ ...defaultViewConfig,
399
+ liveboardId,
400
+ liveboardXLSXCSVDownload: true,
401
+ } as LiveboardViewConfig);
402
+ liveboardEmbed.render();
403
+ await executeAfterWait(() => {
404
+ expectUrlMatchesWithParams(
405
+ getIFrameSrc(),
406
+ `http://${thoughtSpotHost}/?embedApp=true${defaultParams}&isLiveboardXLSXCSVDownloadEnabled=true${prefixParams}#/embed/viz/${liveboardId}`,
407
+ );
408
+ });
409
+ });
410
+
411
+ test('should add liveboardXLSXCSVDownload flag and set value to false to the iframe src', async () => {
412
+ const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
413
+ ...defaultViewConfig,
414
+ liveboardId,
415
+ liveboardXLSXCSVDownload: false,
416
+ } as LiveboardViewConfig);
417
+ liveboardEmbed.render();
418
+ await executeAfterWait(() => {
419
+ expectUrlMatchesWithParams(
420
+ getIFrameSrc(),
421
+ `http://${thoughtSpotHost}/?embedApp=true${defaultParams}&isLiveboardXLSXCSVDownloadEnabled=false&${prefixParams}#/embed/viz/${liveboardId}`,
422
+ );
423
+ });
424
+ });
425
+
371
426
  test('should not append runtime filters in URL if excludeRuntimeFiltersfromURL is true', async () => {
372
427
  const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
373
428
  ...defaultViewConfig,
@@ -602,13 +657,7 @@ describe('Liveboard/viz embed tests', () => {
602
657
  test('navigateToLiveboard should trigger the navigate event with the correct path', async (done) => {
603
658
  mockMessageChannel();
604
659
  // mock getSessionInfo
605
- jest.spyOn(SessionInfoService, 'getSessionInfo').mockResolvedValue({
606
- releaseVersion: '1.0.0',
607
- userGUID: '1234567890',
608
- currentOrgId: 1,
609
- privileges: [],
610
- mixpanelToken: '1234567890',
611
- });
660
+ mockGetSessionInfo();
612
661
  const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
613
662
  ...defaultViewConfig,
614
663
  } as LiveboardViewConfig);
@@ -635,13 +684,7 @@ describe('Liveboard/viz embed tests', () => {
635
684
  mockMessageChannel();
636
685
 
637
686
  // mock getSessionInfo
638
- jest.spyOn(SessionInfoService, 'getSessionInfo').mockResolvedValue({
639
- releaseVersion: '1.0.0',
640
- userGUID: '1234567890',
641
- currentOrgId: 1,
642
- privileges: [],
643
- mixpanelToken: '1234567890',
644
- });
687
+ mockGetSessionInfo();
645
688
 
646
689
  const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
647
690
  ...defaultViewConfig,
@@ -684,6 +727,21 @@ describe('Liveboard/viz embed tests', () => {
684
727
  });
685
728
  });
686
729
 
730
+ test('should set showSpotterLimitations parameter in url params', async () => {
731
+ const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
732
+ ...defaultViewConfig,
733
+ liveboardId,
734
+ showSpotterLimitations: true,
735
+ } as LiveboardViewConfig);
736
+ await liveboardEmbed.render();
737
+ await executeAfterWait(() => {
738
+ expectUrlMatchesWithParams(
739
+ getIFrameSrc(),
740
+ `http://${thoughtSpotHost}/?embedApp=true${defaultParams}${prefixParams}&showSpotterLimitations=true#/embed/viz/${liveboardId}`,
741
+ );
742
+ });
743
+ });
744
+
687
745
  test('SetActiveTab Hostevent should not trigger the navigate event with the correct path, for vizEmbed', async () => {
688
746
  const mockProcessTrigger = jest.spyOn(tsEmbed.TsEmbed.prototype, 'trigger');
689
747
  const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
@@ -721,12 +779,6 @@ describe('Liveboard/viz embed tests', () => {
721
779
  });
722
780
 
723
781
  describe('PreRender flow for liveboard embed', () => {
724
- beforeAll(() => {
725
- init({
726
- thoughtSpotHost: "http://tshost",
727
- authType: AuthType.None,
728
- });
729
- });
730
782
  test('it should preRender generic with liveboard id is not passed', async (done) => {
731
783
  const consoleSpy = jest.spyOn(console, 'error');
732
784
  const libEmbed = new LiveboardEmbed(getRootEl(), {
@@ -821,7 +873,6 @@ describe('Liveboard/viz embed tests', () => {
821
873
  expect((document.getElementById(libEmbed.getPreRenderIds().wrapper) as any)[ts]).toEqual(
822
874
  libEmbed,
823
875
  );
824
-
825
876
  await executeAfterWait(() => {
826
877
  const iframe = getIFrameEl();
827
878
  postMessageToParent(iframe.contentWindow, {
@@ -862,13 +913,7 @@ describe('Liveboard/viz embed tests', () => {
862
913
  preRenderId: testPreRenderId,
863
914
  });
864
915
 
865
- jest.spyOn(SessionInfoService, 'getSessionInfo').mockResolvedValue({
866
- releaseVersion: '1.0.0',
867
- userGUID: '1234567890',
868
- currentOrgId: 1,
869
- privileges: [],
870
- mixpanelToken: '1234567890',
871
- });
916
+ mockGetSessionInfo();
872
917
  let resizeObserverCb: any;
873
918
  (window as any).ResizeObserver =
874
919
  window.ResizeObserver ||
@@ -906,7 +951,6 @@ describe('Liveboard/viz embed tests', () => {
906
951
  });
907
952
  });
908
953
 
909
-
910
954
  await executeAfterWait(() => {
911
955
  const iFrame = document.getElementById(
912
956
  libEmbed.getPreRenderIds().child,
@@ -918,6 +962,60 @@ describe('Liveboard/viz embed tests', () => {
918
962
  done();
919
963
  }, 1005);
920
964
  });
965
+
966
+
967
+ test('should replace existing preRender when replaceExistingPreRender is true', async () => {
968
+ const testPreRenderId = 'testReplacePreRender';
969
+
970
+ // Stub ResizeObserver for JSDOM
971
+ (window as any).ResizeObserver = (window as any).ResizeObserver
972
+ || jest.fn().mockImplementation(() => ({
973
+ disconnect: jest.fn(),
974
+ observe: jest.fn(),
975
+ unobserve: jest.fn(),
976
+ }));
977
+
978
+ // Create initial embed and show preRender (this will create the
979
+ // preRender wrapper/child)
980
+ const embedA = new LiveboardEmbed(getRootEl(), {
981
+ preRenderId: testPreRenderId,
982
+ });
983
+
984
+ await embedA.showPreRender();
985
+
986
+ await waitFor(() => !!getIFrameEl());
987
+
988
+ const ids = embedA.getPreRenderIds();
989
+ const oldWrapper = document.getElementById(ids.wrapper);
990
+ const oldChild = document.getElementById(ids.child);
991
+
992
+ const tsKey = '__tsEmbed';
993
+ expect((oldWrapper as any)[tsKey]).toBe(embedA);
994
+
995
+ // Create a new embed instance and preRender with
996
+ // replaceExistingPreRender = true
997
+ const embedB = new LiveboardEmbed(getRootEl(), {
998
+ preRenderId: testPreRenderId,
999
+ });
1000
+ const prerenderGenericSpy = jest.spyOn(embedB, 'prerenderGeneric');
1001
+
1002
+ await embedB.preRender(false, true);
1003
+
1004
+ await waitFor(() => (document.getElementById(ids.wrapper) as any)?.[tsKey] === embedB);
1005
+
1006
+ const newWrapper = document.getElementById(ids.wrapper);
1007
+ const newChild = document.getElementById(ids.child);
1008
+
1009
+ // Should have called prerenderGeneric for the new embed instance
1010
+ expect(prerenderGenericSpy).toHaveBeenCalledTimes(1);
1011
+
1012
+ // Wrapper should be replaced (new wrapper element), child iframe
1013
+ // may be reused
1014
+ expect(newWrapper).not.toBe(oldWrapper);
1015
+
1016
+ // __tsEmbed on wrapper should now point to the new embed instance
1017
+ expect((newWrapper as any)[tsKey]).toBe(embedB);
1018
+ });
921
1019
  });
922
1020
 
923
1021
  describe('LazyLoadingForFullHeight functionality', () => {