@thoughtspot/visual-embed-sdk 1.46.0 → 1.46.2

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 (176) hide show
  1. package/README.md +1 -1
  2. package/cjs/package.json +2 -2
  3. package/cjs/src/auth.d.ts +29 -4
  4. package/cjs/src/auth.d.ts.map +1 -1
  5. package/cjs/src/auth.js +30 -5
  6. package/cjs/src/auth.js.map +1 -1
  7. package/cjs/src/css-variables.d.ts +17 -17
  8. package/cjs/src/embed/app.d.ts +61 -33
  9. package/cjs/src/embed/app.d.ts.map +1 -1
  10. package/cjs/src/embed/app.js +11 -4
  11. package/cjs/src/embed/app.js.map +1 -1
  12. package/cjs/src/embed/app.spec.js +34 -1
  13. package/cjs/src/embed/app.spec.js.map +1 -1
  14. package/cjs/src/embed/base.d.ts +2 -2
  15. package/cjs/src/embed/base.js +2 -2
  16. package/cjs/src/embed/bodyless-conversation.d.ts +5 -5
  17. package/cjs/src/embed/bodyless-conversation.js +4 -4
  18. package/cjs/src/embed/conversation.d.ts +43 -30
  19. package/cjs/src/embed/conversation.d.ts.map +1 -1
  20. package/cjs/src/embed/conversation.js +10 -11
  21. package/cjs/src/embed/conversation.js.map +1 -1
  22. package/cjs/src/embed/conversation.spec.js +27 -0
  23. package/cjs/src/embed/conversation.spec.js.map +1 -1
  24. package/cjs/src/embed/liveboard.d.ts +42 -36
  25. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  26. package/cjs/src/embed/liveboard.js +3 -3
  27. package/cjs/src/embed/liveboard.js.map +1 -1
  28. package/cjs/src/embed/liveboard.spec.js +1 -1
  29. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  30. package/cjs/src/embed/sage.d.ts +5 -5
  31. package/cjs/src/embed/sage.js +1 -1
  32. package/cjs/src/embed/search-bar.d.ts +7 -7
  33. package/cjs/src/embed/search-bar.js +1 -1
  34. package/cjs/src/embed/search.d.ts +16 -14
  35. package/cjs/src/embed/search.d.ts.map +1 -1
  36. package/cjs/src/embed/search.js +3 -2
  37. package/cjs/src/embed/search.js.map +1 -1
  38. package/cjs/src/embed/ts-embed.d.ts +4 -4
  39. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  40. package/cjs/src/embed/ts-embed.js +13 -7
  41. package/cjs/src/embed/ts-embed.js.map +1 -1
  42. package/cjs/src/embed/ts-embed.spec.js +35 -0
  43. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  44. package/cjs/src/react/index.d.ts +15 -15
  45. package/cjs/src/react/index.js +12 -12
  46. package/cjs/src/tokenizedFetch.d.ts +1 -1
  47. package/cjs/src/tokenizedFetch.js +1 -1
  48. package/cjs/src/types.d.ts +653 -276
  49. package/cjs/src/types.d.ts.map +1 -1
  50. package/cjs/src/types.js +274 -208
  51. package/cjs/src/types.js.map +1 -1
  52. package/cjs/src/utils/graphql/answerService/answerService.d.ts +4 -2
  53. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  54. package/cjs/src/utils/graphql/answerService/answerService.js +6 -4
  55. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  56. package/cjs/src/utils/graphql/answerService/answerService.spec.js +55 -0
  57. package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  58. package/cjs/src/utils.d.ts +9 -0
  59. package/cjs/src/utils.d.ts.map +1 -1
  60. package/cjs/src/utils.js +10 -1
  61. package/cjs/src/utils.js.map +1 -1
  62. package/dist/{index-BQvLEoxp.js → index-DkizS4xM.js} +1 -1
  63. package/dist/src/auth.d.ts +29 -4
  64. package/dist/src/auth.d.ts.map +1 -1
  65. package/dist/src/css-variables.d.ts +17 -17
  66. package/dist/src/embed/app.d.ts +61 -33
  67. package/dist/src/embed/app.d.ts.map +1 -1
  68. package/dist/src/embed/base.d.ts +2 -2
  69. package/dist/src/embed/bodyless-conversation.d.ts +5 -5
  70. package/dist/src/embed/conversation.d.ts +43 -30
  71. package/dist/src/embed/conversation.d.ts.map +1 -1
  72. package/dist/src/embed/liveboard.d.ts +42 -36
  73. package/dist/src/embed/liveboard.d.ts.map +1 -1
  74. package/dist/src/embed/sage.d.ts +5 -5
  75. package/dist/src/embed/search-bar.d.ts +7 -7
  76. package/dist/src/embed/search.d.ts +16 -14
  77. package/dist/src/embed/search.d.ts.map +1 -1
  78. package/dist/src/embed/ts-embed.d.ts +4 -4
  79. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  80. package/dist/src/react/index.d.ts +15 -15
  81. package/dist/src/tokenizedFetch.d.ts +1 -1
  82. package/dist/src/types.d.ts +653 -276
  83. package/dist/src/types.d.ts.map +1 -1
  84. package/dist/src/utils/graphql/answerService/answerService.d.ts +4 -2
  85. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  86. package/dist/src/utils.d.ts +9 -0
  87. package/dist/src/utils.d.ts.map +1 -1
  88. package/dist/tsembed-react.es.js +383 -290
  89. package/dist/tsembed-react.js +382 -289
  90. package/dist/tsembed.es.js +375 -282
  91. package/dist/tsembed.js +374 -281
  92. package/dist/visual-embed-sdk-react-full.d.ts +880 -431
  93. package/dist/visual-embed-sdk-react.d.ts +873 -427
  94. package/dist/visual-embed-sdk.d.ts +879 -430
  95. package/lib/package.json +2 -2
  96. package/lib/src/auth.d.ts +29 -4
  97. package/lib/src/auth.d.ts.map +1 -1
  98. package/lib/src/auth.js +30 -5
  99. package/lib/src/auth.js.map +1 -1
  100. package/lib/src/css-variables.d.ts +17 -17
  101. package/lib/src/embed/app.d.ts +61 -33
  102. package/lib/src/embed/app.d.ts.map +1 -1
  103. package/lib/src/embed/app.js +12 -5
  104. package/lib/src/embed/app.js.map +1 -1
  105. package/lib/src/embed/app.spec.js +34 -1
  106. package/lib/src/embed/app.spec.js.map +1 -1
  107. package/lib/src/embed/base.d.ts +2 -2
  108. package/lib/src/embed/base.js +2 -2
  109. package/lib/src/embed/bodyless-conversation.d.ts +5 -5
  110. package/lib/src/embed/bodyless-conversation.js +4 -4
  111. package/lib/src/embed/conversation.d.ts +43 -30
  112. package/lib/src/embed/conversation.d.ts.map +1 -1
  113. package/lib/src/embed/conversation.js +11 -11
  114. package/lib/src/embed/conversation.js.map +1 -1
  115. package/lib/src/embed/conversation.spec.js +27 -0
  116. package/lib/src/embed/conversation.spec.js.map +1 -1
  117. package/lib/src/embed/liveboard.d.ts +42 -36
  118. package/lib/src/embed/liveboard.d.ts.map +1 -1
  119. package/lib/src/embed/liveboard.js +3 -3
  120. package/lib/src/embed/liveboard.js.map +1 -1
  121. package/lib/src/embed/liveboard.spec.js +1 -1
  122. package/lib/src/embed/liveboard.spec.js.map +1 -1
  123. package/lib/src/embed/sage.d.ts +5 -5
  124. package/lib/src/embed/sage.js +1 -1
  125. package/lib/src/embed/search-bar.d.ts +7 -7
  126. package/lib/src/embed/search-bar.js +1 -1
  127. package/lib/src/embed/search.d.ts +16 -14
  128. package/lib/src/embed/search.d.ts.map +1 -1
  129. package/lib/src/embed/search.js +3 -2
  130. package/lib/src/embed/search.js.map +1 -1
  131. package/lib/src/embed/ts-embed.d.ts +4 -4
  132. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  133. package/lib/src/embed/ts-embed.js +13 -7
  134. package/lib/src/embed/ts-embed.js.map +1 -1
  135. package/lib/src/embed/ts-embed.spec.js +35 -0
  136. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  137. package/lib/src/react/index.d.ts +15 -15
  138. package/lib/src/react/index.js +12 -12
  139. package/lib/src/tokenizedFetch.d.ts +1 -1
  140. package/lib/src/tokenizedFetch.js +1 -1
  141. package/lib/src/types.d.ts +653 -276
  142. package/lib/src/types.d.ts.map +1 -1
  143. package/lib/src/types.js +274 -208
  144. package/lib/src/types.js.map +1 -1
  145. package/lib/src/utils/graphql/answerService/answerService.d.ts +4 -2
  146. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  147. package/lib/src/utils/graphql/answerService/answerService.js +5 -3
  148. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  149. package/lib/src/utils/graphql/answerService/answerService.spec.js +55 -0
  150. package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  151. package/lib/src/utils.d.ts +9 -0
  152. package/lib/src/utils.d.ts.map +1 -1
  153. package/lib/src/utils.js +8 -0
  154. package/lib/src/utils.js.map +1 -1
  155. package/package.json +2 -2
  156. package/src/auth.ts +30 -5
  157. package/src/css-variables.ts +17 -17
  158. package/src/embed/app.spec.ts +46 -1
  159. package/src/embed/app.ts +73 -36
  160. package/src/embed/base.ts +2 -2
  161. package/src/embed/bodyless-conversation.ts +5 -5
  162. package/src/embed/conversation.spec.ts +37 -0
  163. package/src/embed/conversation.ts +55 -38
  164. package/src/embed/liveboard.spec.ts +1 -1
  165. package/src/embed/liveboard.ts +42 -36
  166. package/src/embed/sage.ts +5 -5
  167. package/src/embed/search-bar.tsx +7 -7
  168. package/src/embed/search.ts +16 -14
  169. package/src/embed/ts-embed.spec.ts +42 -0
  170. package/src/embed/ts-embed.ts +12 -7
  171. package/src/react/index.tsx +15 -15
  172. package/src/tokenizedFetch.ts +1 -1
  173. package/src/types.ts +652 -275
  174. package/src/utils/graphql/answerService/answerService.spec.ts +62 -0
  175. package/src/utils/graphql/answerService/answerService.ts +6 -3
  176. package/src/utils.ts +14 -0
@@ -517,42 +517,42 @@ export interface CustomCssVariables {
517
517
  /**
518
518
  * Padding of the groups in the Liveboard.
519
519
  *
520
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
520
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
521
521
  */
522
522
  '--ts-var-liveboard-group-padding'?: string;
523
523
 
524
524
  /**
525
525
  * Font size of the title of the groups in the Liveboard.
526
526
  *
527
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
527
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
528
528
  */
529
529
  '--ts-var-liveboard-group-title-font-size'?: string;
530
530
 
531
531
  /**
532
532
  * Font weight of the title of the groups in the Liveboard.
533
533
  *
534
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
534
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
535
535
  */
536
536
  '--ts-var-liveboard-group-title-font-weight'?: string;
537
537
 
538
538
  /**
539
539
  * Font size of the title of the tiles inside the groups in the Liveboard.
540
540
  *
541
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
541
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
542
542
  */
543
543
  '--ts-var-liveboard-group-tile-title-font-size'?: string;
544
544
 
545
545
  /**
546
546
  * Font weight of the title of the tiles inside the groups in the Liveboard.
547
547
  *
548
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
548
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
549
549
  */
550
550
  '--ts-var-liveboard-group-tile-title-font-weight'?: string;
551
551
 
552
552
  /**
553
553
  * Padding of the group tiles in the Liveboard.
554
554
  *
555
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
555
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
556
556
  */
557
557
  '--ts-var-liveboard-group-tile-padding'?: string;
558
558
 
@@ -564,14 +564,14 @@ export interface CustomCssVariables {
564
564
  /**
565
565
  * Background color of the groups in the Liveboard.
566
566
  *
567
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
567
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
568
568
  */
569
569
  '--ts-var-liveboard-group-background'?: string;
570
570
 
571
571
  /**
572
572
  * Border color of the groups in the Liveboard.
573
573
  *
574
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
574
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
575
575
  */
576
576
  '--ts-var-liveboard-group-border-color'?: string;
577
577
 
@@ -588,63 +588,63 @@ export interface CustomCssVariables {
588
588
  /**
589
589
  * Font color of the title of the groups in the Liveboard.
590
590
  *
591
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
591
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
592
592
  */
593
593
  '--ts-var-liveboard-group-title-font-color'?: string;
594
594
 
595
595
  /**
596
596
  * Font color of the description of the groups in the Liveboard.
597
597
  *
598
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
598
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
599
599
  */
600
600
  '--ts-var-liveboard-group-description-font-color'?: string;
601
601
 
602
602
  /**
603
603
  * Font color of the title of the tiles inside the groups in the Liveboard.
604
604
  *
605
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
605
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
606
606
  */
607
607
  '--ts-var-liveboard-group-tile-title-font-color'?: string;
608
608
 
609
609
  /**
610
610
  * Font color of the description of the tiles inside the groups in the Liveboard.
611
611
  *
612
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
612
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
613
613
  */
614
614
  '--ts-var-liveboard-group-tile-description-font-color'?: string;
615
615
 
616
616
  /**
617
617
  * Background color of the tiles inside the groups in the Liveboard.
618
618
  *
619
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
619
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
620
620
  */
621
621
  '--ts-var-liveboard-group-tile-background'?: string;
622
622
 
623
623
  /**
624
624
  * Background color of the filter chips in the Liveboard.
625
625
  *
626
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
626
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
627
627
  */
628
628
  '--ts-var-liveboard-chip-background'?: string;
629
629
 
630
630
  /**
631
631
  * Font color of the filter chips in the Liveboard.
632
632
  *
633
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
633
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
634
634
  */
635
635
  '--ts-var-liveboard-chip-color'?: string;
636
636
 
637
637
  /**
638
638
  * Background color of the filter chips in the Liveboard on hover.
639
639
  *
640
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
640
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
641
641
  */
642
642
  '--ts-var-liveboard-chip--hover-background'?: string;
643
643
 
644
644
  /**
645
645
  * Background color of the filter chips in the Liveboard on active.
646
646
  *
647
- * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
647
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
648
648
  */
649
649
  '--ts-var-liveboard-chip--active-background'?: string;
650
650
 
@@ -397,7 +397,7 @@ describe('App embed tests', () => {
397
397
  });
398
398
  });
399
399
 
400
- test('should set isLiveboardStylingAndGroupingEnabled to true in url', async () => {
400
+ test('should set isLiveboardStylingAndGroupingEnabled to true in url (deprecated, use isLiveboardMasterpiecesEnabled)', async () => {
401
401
  const appEmbed = new AppEmbed(getRootEl(), {
402
402
  ...defaultViewConfig,
403
403
  isLiveboardStylingAndGroupingEnabled: true,
@@ -425,6 +425,20 @@ describe('App embed tests', () => {
425
425
  });
426
426
  });
427
427
 
428
+ test('should set enableHomepageAnnouncement to true in url', async () => {
429
+ const appEmbed = new AppEmbed(getRootEl(), {
430
+ ...defaultViewConfig,
431
+ enableHomepageAnnouncement: true,
432
+ } as AppViewConfig);
433
+ appEmbed.render();
434
+ await executeAfterWait(() => {
435
+ expectUrlMatchesWithParams(
436
+ getIFrameSrc(),
437
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=true${defaultParamsPost}#/home`,
438
+ );
439
+ });
440
+ });
441
+
428
442
  test('should set isPNGInScheduledEmailsEnabled to true in url', async () => {
429
443
  const appEmbed = new AppEmbed(getRootEl(), {
430
444
  ...defaultViewConfig,
@@ -509,6 +523,37 @@ describe('App embed tests', () => {
509
523
  });
510
524
  });
511
525
 
526
+ test('should set deprecated standalone enablePastConversationsSidebar in url', async () => {
527
+ const appEmbed = new AppEmbed(getRootEl(), {
528
+ ...defaultViewConfig,
529
+ enablePastConversationsSidebar: true,
530
+ } as AppViewConfig);
531
+ appEmbed.render();
532
+ await executeAfterWait(() => {
533
+ expectUrlMatchesWithParams(
534
+ getIFrameSrc(),
535
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enablePastConversationsSidebar=true${defaultParamsPost}#/home`,
536
+ );
537
+ });
538
+ });
539
+
540
+ test('should prefer spotterSidebarConfig.enablePastConversationsSidebar over deprecated standalone flag in url', async () => {
541
+ const appEmbed = new AppEmbed(getRootEl(), {
542
+ ...defaultViewConfig,
543
+ enablePastConversationsSidebar: false,
544
+ spotterSidebarConfig: {
545
+ enablePastConversationsSidebar: true,
546
+ },
547
+ } as AppViewConfig);
548
+ appEmbed.render();
549
+ await executeAfterWait(() => {
550
+ expectUrlMatchesWithParams(
551
+ getIFrameSrc(),
552
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enablePastConversationsSidebar=true${defaultParamsPost}#/home`,
553
+ );
554
+ });
555
+ });
556
+
512
557
  test('should set hideToolResponseCardBranding to true in url via spotterChatConfig', async () => {
513
558
  const appEmbed = new AppEmbed(getRootEl(), {
514
559
  ...defaultViewConfig,
package/src/embed/app.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  */
10
10
 
11
11
  import { logger } from '../utils/logger';
12
- import { calculateVisibleElementData, getQueryParamString, isUndefined, isValidCssMargin, setParamIfDefined, validateHttpUrl } from '../utils';
12
+ import { calculateVisibleElementData, getQueryParamString, isUndefined, isValidCssMargin, setParamIfDefined, validateHttpUrl, resolveEnablePastConversationsSidebar } from '../utils';
13
13
  import {
14
14
  Param,
15
15
  DOMSelector,
@@ -64,7 +64,7 @@ export enum Page {
64
64
  }
65
65
 
66
66
  /**
67
- * Define the initial state os column custom group accordions
67
+ * Define the initial state of column custom group accordions
68
68
  * in data panel v2.
69
69
  */
70
70
  export enum DataPanelCustomColumnGroupsAccordionState {
@@ -140,7 +140,7 @@ export enum ListPage {
140
140
  */
141
141
  export interface DiscoveryExperience {
142
142
  /**
143
- * primaryNavbarVersion determines the version of the navigation version.
143
+ * primaryNavbarVersion determines the version of the primary navigation bar.
144
144
  */
145
145
  primaryNavbarVersion?: PrimaryNavbarVersion;
146
146
  /**
@@ -164,8 +164,8 @@ export interface AppViewConfig extends AllEmbedViewConfig {
164
164
  * This flag also controls the homepage left navigation bar.
165
165
  *
166
166
  * Supported embed types: `AppEmbed`
167
- * @default true
168
167
  * @version SDK: 1.2.0 | ThoughtSpot: 8.4.0.cl
168
+ * @default true
169
169
  * @example
170
170
  * ```js
171
171
  * const embed = new AppEmbed('#tsEmbed', {
@@ -186,8 +186,8 @@ export interface AppViewConfig extends AllEmbedViewConfig {
186
186
  * **Note**: This attribute is not supported in the classic (V1) experience.
187
187
  *
188
188
  * Supported embed types: `AppEmbed`
189
- * @default false
190
189
  * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl
190
+ * @default false
191
191
  * @example
192
192
  * ```js
193
193
  * const embed = new AppEmbed('#tsEmbed', {
@@ -204,8 +204,8 @@ export interface AppViewConfig extends AllEmbedViewConfig {
204
204
  * navigation bar is not hidden via `showPrimaryNavbar`.
205
205
  *
206
206
  * Supported embed types: `AppEmbed`
207
- * @default false
208
207
  * @version SDK: 1.2.0 | ThoughtSpot: 8.4.0.cl
208
+ * @default false
209
209
  * @example
210
210
  * ```js
211
211
  * const embed = new AppEmbed('#tsEmbed', {
@@ -216,12 +216,12 @@ export interface AppViewConfig extends AllEmbedViewConfig {
216
216
  */
217
217
  disableProfileAndHelp?: boolean;
218
218
  /**
219
- * @version SDK: 1.36.3 | ThoughtSpot: 10.1.0.cl
220
- * @default true
221
219
  * Whether the help menu in the top navigation bar should be served
222
220
  * from Pendo or ThoughtSpot's internal help items.
223
221
  *
224
222
  * Supported embed types: `AppEmbed`
223
+ * @version SDK: 1.36.3 | ThoughtSpot: 10.1.0.cl
224
+ * @default true
225
225
  * @example
226
226
  * ```js
227
227
  * const embed = new AppEmbed('#tsEmbed', {
@@ -236,8 +236,8 @@ export interface AppViewConfig extends AllEmbedViewConfig {
236
236
  * the top navigation bar in the V3 navigation experience.
237
237
  *
238
238
  * Supported embed types: `AppEmbed`
239
- * @default false
240
239
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
240
+ * @default false
241
241
  * @example
242
242
  * ```js
243
243
  * const embed = new AppEmbed('#tsEmbed', {
@@ -256,8 +256,8 @@ export interface AppViewConfig extends AllEmbedViewConfig {
256
256
  * in the classic (V1) experience.
257
257
  *
258
258
  * Supported embed types: `AppEmbed`
259
- * @default true
260
259
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
260
+ * @default true
261
261
  * @example
262
262
  * ```js
263
263
  * const embed = new AppEmbed('#tsEmbed', {
@@ -275,8 +275,8 @@ export interface AppViewConfig extends AllEmbedViewConfig {
275
275
  * in the classic (V1) and V2 experience modes.
276
276
  *
277
277
  * Supported embed types: `AppEmbed`
278
- * @default true
279
278
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
279
+ * @default true
280
280
  * @example
281
281
  * ```js
282
282
  * const embed = new AppEmbed('#tsEmbed', {
@@ -292,7 +292,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
292
292
  * In the V3 experience, it shows or hides application selection
293
293
  * icons on the left navigation panel.
294
294
  * By default, the application selection menu and icons are
295
- * shown in the UI
295
+ * shown in the UI.
296
296
  *
297
297
  * **Note**: This attribute is not supported in the classic (V1) experience.
298
298
  *
@@ -332,7 +332,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
332
332
  * takes precedence. This is the path post the `#/` in the URL of the standalone
333
333
  * ThoughtSpot app. Use this to open the embedded view to a specific path.
334
334
  *
335
- * For eg, if you want the component to open to a specific Liveboard
335
+ * For example, if you want the component to open to a specific Liveboard
336
336
  * you could set the path to `pinboard/<liveboardId>/tab/<tabId>`.
337
337
  *
338
338
  * Supported embed types: `AppEmbed`
@@ -350,7 +350,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
350
350
  * The application page to set as the start page
351
351
  * in the embedded view.
352
352
  *
353
- * Use this to open to particular page in the app. To open to a specific
353
+ * Use this to open to a particular page in the app. To open to a specific
354
354
  * path within the app, use the `path` attribute which is more flexible.
355
355
  *
356
356
  * Supported embed types: `AppEmbed`
@@ -430,8 +430,8 @@ export interface AppViewConfig extends AllEmbedViewConfig {
430
430
  * If set to true, the Search Assist feature is enabled.
431
431
  *
432
432
  * Supported embed types: `AppEmbed`
433
- * @default true
434
433
  * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
434
+ * @default true
435
435
  * @example
436
436
  * ```js
437
437
  * const embed = new AppEmbed('#tsEmbed', {
@@ -469,8 +469,8 @@ export interface AppViewConfig extends AllEmbedViewConfig {
469
469
  * For more information,
470
470
  * see link:https://developers.thoughtspot.com/docs/full-app-customize[full app embed documentation].
471
471
  * Supported embed types: `AppEmbed`
472
- * @default false
473
472
  * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl
473
+ * @default false
474
474
  * @example
475
475
  * ```js
476
476
  * const embed = new AppEmbed('#tsEmbed', {
@@ -485,8 +485,8 @@ export interface AppViewConfig extends AllEmbedViewConfig {
485
485
  * For more information, see
486
486
  * link:https://developers.thoughtspot.com/docs/full-app-customize[full app embed documentation].
487
487
  * Supported embed types: `AppEmbed`
488
- * @default false
489
488
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
489
+ * @default false
490
490
  * @example
491
491
  * ```js
492
492
  * const embed = new AppEmbed('#tsEmbed', {
@@ -501,10 +501,10 @@ export interface AppViewConfig extends AllEmbedViewConfig {
501
501
  */
502
502
  discoveryExperience?: DiscoveryExperience;
503
503
  /**
504
- * To set the initial state of the search bar in case of saved-answers.
504
+ * To set the initial state of the search bar in case of saved-answers. Use {@link collapseSearchBar} instead.
505
505
  * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
506
+ * @deprecated This flag is deprecated.
506
507
  * @default false
507
- * @deprecated Use {@link collapseSearchBar} instead
508
508
  */
509
509
  collapseSearchBarInitially?: boolean;
510
510
  /**
@@ -532,14 +532,14 @@ export interface AppViewConfig extends AllEmbedViewConfig {
532
532
  * Flag to use home page search bar mode
533
533
  *
534
534
  * Supported embed types: `AppEmbed`
535
- * @version SDK : 1.33.0 | ThoughtSpot: 10.3.0.cl
535
+ * @version SDK: 1.33.0 | ThoughtSpot: 10.3.0.cl
536
536
  */
537
537
  homePageSearchBarMode?: HomePageSearchBarMode;
538
538
  /**
539
539
  * This flag is used to enable unified search experience for full app embed.
540
540
  *
541
541
  * Supported embed types: `AppEmbed`
542
- * @version SDK: 1.34.0 | ThoughtSpot:10.5.0.cl
542
+ * @version SDK: 1.34.0 | ThoughtSpot: 10.5.0.cl
543
543
  * @default true
544
544
  * @example
545
545
  * ```js
@@ -552,7 +552,8 @@ export interface AppViewConfig extends AllEmbedViewConfig {
552
552
  isUnifiedSearchExperienceEnabled?: boolean;
553
553
 
554
554
  /**
555
- * This flag is used to enable/disable the styling and grouping in a Liveboard
555
+ * This flag is used to enable/disable the styling and grouping in a Liveboard. Use {@link isLiveboardMasterpiecesEnabled} instead.
556
+ * @deprecated This flag is deprecated.
556
557
  *
557
558
  * Supported embed types: `AppEmbed`, `LiveboardEmbed`
558
559
  * @type {boolean}
@@ -622,6 +623,9 @@ export interface AppViewConfig extends AllEmbedViewConfig {
622
623
  /**
623
624
  * This flag is used to enable the full height lazy load data.
624
625
  *
626
+ * @type {boolean}
627
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
628
+ * @default false
625
629
  * @example
626
630
  * ```js
627
631
  * const embed = new AppEmbed('#embed-container', {
@@ -630,10 +634,6 @@ export interface AppViewConfig extends AllEmbedViewConfig {
630
634
  * lazyLoadingForFullHeight: true,
631
635
  * })
632
636
  * ```
633
- *
634
- * @type {boolean}
635
- * @default false
636
- * @version SDK: 1.40.0 | ThoughtSpot:10.12.0.cl
637
637
  */
638
638
  lazyLoadingForFullHeight?: boolean;
639
639
 
@@ -641,23 +641,23 @@ export interface AppViewConfig extends AllEmbedViewConfig {
641
641
  * The margin to be used for lazy loading.
642
642
  *
643
643
  * For example, if the margin is set to '10px',
644
- * the visualization will be loaded 10px before the its top edge is visible in the
644
+ * the visualization will be loaded 10px before its top edge is visible in the
645
645
  * viewport.
646
646
  *
647
647
  * The format is similar to CSS margin.
648
648
  *
649
+ * @type {string}
650
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
649
651
  * @example
650
652
  * ```js
651
653
  * const embed = new AppEmbed('#embed-container', {
652
654
  * // ...other options
653
655
  * fullHeight: true,
654
656
  * lazyLoadingForFullHeight: true,
655
- * // Using 0px, the visualization will be only loaded when its visible in the viewport.
657
+ * // Using 0px, the visualization will be only loaded when it's visible in the viewport.
656
658
  * lazyLoadingMargin: '0px',
657
659
  * })
658
660
  * ```
659
- * @type {string}
660
- * @version SDK: 1.40.0 | ThoughtSpot:10.12.0.cl
661
661
  */
662
662
  lazyLoadingMargin?: string;
663
663
 
@@ -665,6 +665,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
665
665
  * updatedSpotterChatPrompt : Controls the updated spotter chat prompt.
666
666
  *
667
667
  * Supported embed types: `AppEmbed`
668
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
668
669
  * @default false
669
670
  * @example
670
671
  * ```js
@@ -673,25 +674,36 @@ export interface AppViewConfig extends AllEmbedViewConfig {
673
674
  * updatedSpotterChatPrompt : true,
674
675
  * })
675
676
  * ```
676
- * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
677
677
  */
678
678
  updatedSpotterChatPrompt?: boolean;
679
+ /**
680
+ * Controls the visibility of the past conversations sidebar.
681
+ *
682
+ * Supported embed types: `AppEmbed`
683
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
684
+ * @deprecated from SDK: 1.47.0 | ThoughtSpot: 26.4.0.cl
685
+ * Use `spotterSidebarConfig.enablePastConversationsSidebar`.
686
+ * @default false
687
+ */
688
+ enablePastConversationsSidebar?: boolean;
679
689
  /**
680
690
  * Configuration for the Spotter sidebar UI customization.
681
691
  * Only applicable when navigating to Spotter within the app.
682
692
  *
683
693
  * Supported embed types: `AppEmbed`
694
+ * @version SDK: 1.47.0 | ThoughtSpot: 26.4.0.cl
684
695
  * @example
685
696
  * ```js
686
697
  * const embed = new AppEmbed('#tsEmbed', {
687
- * ... //other embed view config
698
+ * // Deprecated standalone flag (backward compatibility)
699
+ * enablePastConversationsSidebar: false,
700
+ * // Recommended config; this value takes precedence
688
701
  * spotterSidebarConfig: {
689
702
  * enablePastConversationsSidebar: true,
690
703
  * spotterSidebarTitle: 'My Conversations',
691
704
  * },
692
705
  * })
693
706
  * ```
694
- * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
695
707
  */
696
708
  spotterSidebarConfig?: SpotterSidebarViewConfig;
697
709
  /**
@@ -699,6 +711,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
699
711
  * branding in tool response cards.
700
712
  *
701
713
  * Supported embed types: `AppEmbed`
714
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.4.0.cl
702
715
  * @example
703
716
  * ```js
704
717
  * const embed = new AppEmbed('#tsEmbed', {
@@ -709,7 +722,6 @@ export interface AppViewConfig extends AllEmbedViewConfig {
709
722
  * },
710
723
  * })
711
724
  * ```
712
- * @version SDK: 1.46.0 | ThoughtSpot: 26.4.0.cl
713
725
  */
714
726
  spotterChatConfig?: SpotterChatViewConfig;
715
727
  /**
@@ -729,6 +741,22 @@ export interface AppViewConfig extends AllEmbedViewConfig {
729
741
  * ```
730
742
  */
731
743
  minimumHeight?: number;
744
+ /**
745
+ * To enable the homepage announcement banner.
746
+ * Controls the visibility of the announcement section
747
+ * on the homepage.
748
+ *
749
+ * Supported embed types: `AppEmbed`
750
+ * @example
751
+ * ```js
752
+ * const embed = new AppEmbed('#tsEmbed', {
753
+ * ... // other embed view config
754
+ * enableHomepageAnnouncement: true,
755
+ * })
756
+ * ```
757
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
758
+ */
759
+ enableHomepageAnnouncement?: boolean;
732
760
  }
733
761
 
734
762
  /**
@@ -809,6 +837,7 @@ export class AppEmbed extends V1Embed {
809
837
  spotterChatConfig,
810
838
  minimumHeight,
811
839
  isThisPeriodInDateFiltersEnabled,
840
+ enableHomepageAnnouncement,
812
841
  } = this.viewConfig;
813
842
 
814
843
  let params: any = {};
@@ -837,10 +866,15 @@ export class AppEmbed extends V1Embed {
837
866
  params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
838
867
  }
839
868
 
869
+ const resolvedEnablePastConversationsSidebar = resolveEnablePastConversationsSidebar({
870
+ spotterSidebarConfigValue: spotterSidebarConfig?.enablePastConversationsSidebar,
871
+ standaloneValue: this.viewConfig.enablePastConversationsSidebar,
872
+ });
873
+ setParamIfDefined(params, Param.EnablePastConversationsSidebar, resolvedEnablePastConversationsSidebar, true);
874
+
840
875
  // Handle spotterSidebarConfig params
841
876
  if (spotterSidebarConfig) {
842
877
  const {
843
- enablePastConversationsSidebar,
844
878
  spotterSidebarTitle,
845
879
  spotterSidebarDefaultExpanded,
846
880
  spotterChatRenameLabel,
@@ -853,7 +887,6 @@ export class AppEmbed extends V1Embed {
853
887
  spotterNewChatButtonTitle,
854
888
  } = spotterSidebarConfig;
855
889
 
856
- setParamIfDefined(params, Param.EnablePastConversationsSidebar, enablePastConversationsSidebar, true);
857
890
  setParamIfDefined(params, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
858
891
  setParamIfDefined(params, Param.SpotterSidebarTitle, spotterSidebarTitle);
859
892
  setParamIfDefined(params, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
@@ -979,6 +1012,10 @@ export class AppEmbed extends V1Embed {
979
1012
  params[Param.IsThisPeriodInDateFiltersEnabled] = isThisPeriodInDateFiltersEnabled;
980
1013
  }
981
1014
 
1015
+ if (enableHomepageAnnouncement !== undefined) {
1016
+ params[Param.EnableHomepageAnnouncement] = enableHomepageAnnouncement;
1017
+ }
1018
+
982
1019
  this.defaultHeight = minimumHeight || this.defaultHeight;
983
1020
 
984
1021
  params[Param.DataPanelV2Enabled] = dataPanelV2;
package/src/embed/base.ts CHANGED
@@ -345,7 +345,7 @@ export const renderInQueue = (fn: (next?: (val?: any) => void) => Promise<any>):
345
345
  * }).catch(error => {
346
346
  * console.error(error);
347
347
  * });
348
- *```
348
+ * ```
349
349
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
350
350
  * @group Global methods
351
351
  */
@@ -466,9 +466,9 @@ export function reset(): void {
466
466
 
467
467
  /**
468
468
  * Reloads the ThoughtSpot iframe.
469
+ * @version SDK: 1.43.1
469
470
  * @param iFrame
470
471
  * @group Global methods
471
- * @version SDK: 1.43.1
472
472
  */
473
473
  export const reloadIframe = (iFrame: HTMLIFrameElement) => {
474
474
  if (!iFrame) {
@@ -17,8 +17,8 @@ export interface SpotterAgentEmbedViewConfig extends Omit<BaseViewConfig, 'prima
17
17
 
18
18
  /**
19
19
  * Configuration for conversation options.
20
- * @deprecated from SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
21
20
  * Use {@link SpotterAgentEmbedViewConfig} instead
21
+ * @deprecated from SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
22
22
  * @group Embed components
23
23
  */
24
24
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
@@ -87,6 +87,8 @@ export class ConversationMessage extends TsEmbed {
87
87
  /**
88
88
  * Create a conversation embed, which can be integrated inside
89
89
  * chatbots or other conversational interfaces.
90
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
91
+ * @group Embed components
90
92
  * @example
91
93
  * ```js
92
94
  * import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
@@ -100,8 +102,6 @@ export class ConversationMessage extends TsEmbed {
100
102
  * // append the container to the DOM
101
103
  * document.body.appendChild(container); // or to any other element
102
104
  * ```
103
- * @group Embed components
104
- * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
105
105
  */
106
106
  export class SpotterAgentEmbed {
107
107
  private conversationService: ConversationService;
@@ -164,8 +164,9 @@ export class SpotterAgentEmbed {
164
164
  /**
165
165
  * Create a conversation embed, which can be integrated inside
166
166
  * chatbots or other conversational interfaces.
167
- * @deprecated from SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
168
167
  * Use {@link SpotterAgentEmbed} instead
168
+ * @deprecated from SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
169
+ * @group Embed components
169
170
  * @example
170
171
  * ```js
171
172
  * import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
@@ -179,7 +180,6 @@ export class SpotterAgentEmbed {
179
180
  * // append the container to the DOM
180
181
  * document.body.appendChild(container); // or to any other element
181
182
  * ```
182
- * @group Embed components
183
183
  */
184
184
  export class BodylessConversation extends SpotterAgentEmbed {
185
185
  constructor(viewConfig: BodylessConversationViewConfig) {