@thoughtspot/visual-embed-sdk 1.51.0 → 1.51.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 (212) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/config.d.ts +1 -0
  3. package/cjs/src/config.d.ts.map +1 -1
  4. package/cjs/src/config.js +2 -1
  5. package/cjs/src/config.js.map +1 -1
  6. package/cjs/src/css-variables.d.ts +27 -0
  7. package/cjs/src/css-variables.d.ts.map +1 -1
  8. package/cjs/src/embed/app.d.ts +43 -12
  9. package/cjs/src/embed/app.d.ts.map +1 -1
  10. package/cjs/src/embed/app.js +29 -3
  11. package/cjs/src/embed/app.js.map +1 -1
  12. package/cjs/src/embed/app.spec.js +253 -1
  13. package/cjs/src/embed/app.spec.js.map +1 -1
  14. package/cjs/src/embed/base.d.ts +1 -1
  15. package/cjs/src/embed/base.js +1 -1
  16. package/cjs/src/embed/conversation.d.ts +171 -1
  17. package/cjs/src/embed/conversation.d.ts.map +1 -1
  18. package/cjs/src/embed/conversation.js +4 -2
  19. package/cjs/src/embed/conversation.js.map +1 -1
  20. package/cjs/src/embed/conversation.spec.js +125 -0
  21. package/cjs/src/embed/conversation.spec.js.map +1 -1
  22. package/cjs/src/embed/events.spec.js +3 -0
  23. package/cjs/src/embed/events.spec.js.map +1 -1
  24. package/cjs/src/embed/host-events.spec.js +36 -0
  25. package/cjs/src/embed/host-events.spec.js.map +1 -1
  26. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +1 -1
  27. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  28. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +18 -0
  29. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  30. package/cjs/src/embed/liveboard.d.ts +40 -13
  31. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  32. package/cjs/src/embed/liveboard.js +25 -4
  33. package/cjs/src/embed/liveboard.js.map +1 -1
  34. package/cjs/src/embed/liveboard.spec.js +349 -2
  35. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  36. package/cjs/src/embed/spotter-utils.d.ts +8 -1
  37. package/cjs/src/embed/spotter-utils.d.ts.map +1 -1
  38. package/cjs/src/embed/spotter-utils.js +15 -1
  39. package/cjs/src/embed/spotter-utils.js.map +1 -1
  40. package/cjs/src/embed/spotter-utils.spec.js +68 -0
  41. package/cjs/src/embed/spotter-utils.spec.js.map +1 -1
  42. package/cjs/src/embed/spotter-viz-utils.d.ts +9 -10
  43. package/cjs/src/embed/spotter-viz-utils.d.ts.map +1 -1
  44. package/cjs/src/embed/spotter-viz-utils.js.map +1 -1
  45. package/cjs/src/embed/ts-embed.d.ts +16 -8
  46. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  47. package/cjs/src/embed/ts-embed.js +69 -32
  48. package/cjs/src/embed/ts-embed.js.map +1 -1
  49. package/cjs/src/embed/ts-embed.spec.js +537 -3
  50. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  51. package/cjs/src/index.d.ts +3 -3
  52. package/cjs/src/index.d.ts.map +1 -1
  53. package/cjs/src/index.js +3 -2
  54. package/cjs/src/index.js.map +1 -1
  55. package/cjs/src/react/all-types-export.d.ts +1 -1
  56. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  57. package/cjs/src/react/all-types-export.js +2 -1
  58. package/cjs/src/react/all-types-export.js.map +1 -1
  59. package/cjs/src/react/all-types-export.parity.spec.d.ts +2 -0
  60. package/cjs/src/react/all-types-export.parity.spec.d.ts.map +1 -0
  61. package/cjs/src/react/all-types-export.parity.spec.js +194 -0
  62. package/cjs/src/react/all-types-export.parity.spec.js.map +1 -0
  63. package/cjs/src/react/index.d.ts +66 -32
  64. package/cjs/src/react/index.d.ts.map +1 -1
  65. package/cjs/src/react/index.js +5 -3
  66. package/cjs/src/react/index.js.map +1 -1
  67. package/cjs/src/react/index.spec.js +101 -0
  68. package/cjs/src/react/index.spec.js.map +1 -1
  69. package/cjs/src/types.d.ts +330 -18
  70. package/cjs/src/types.d.ts.map +1 -1
  71. package/cjs/src/types.js +182 -12
  72. package/cjs/src/types.js.map +1 -1
  73. package/cjs/src/utils.spec.js +4 -0
  74. package/cjs/src/utils.spec.js.map +1 -1
  75. package/dist/{index-aBzH5ZwF.js → index-DxLfQxoT.js} +1 -1
  76. package/dist/src/config.d.ts +1 -0
  77. package/dist/src/config.d.ts.map +1 -1
  78. package/dist/src/css-variables.d.ts +27 -0
  79. package/dist/src/css-variables.d.ts.map +1 -1
  80. package/dist/src/embed/app.d.ts +43 -12
  81. package/dist/src/embed/app.d.ts.map +1 -1
  82. package/dist/src/embed/base.d.ts +1 -1
  83. package/dist/src/embed/conversation.d.ts +171 -1
  84. package/dist/src/embed/conversation.d.ts.map +1 -1
  85. package/dist/src/embed/hostEventClient/host-event-client.d.ts +1 -1
  86. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  87. package/dist/src/embed/liveboard.d.ts +40 -13
  88. package/dist/src/embed/liveboard.d.ts.map +1 -1
  89. package/dist/src/embed/spotter-utils.d.ts +8 -1
  90. package/dist/src/embed/spotter-utils.d.ts.map +1 -1
  91. package/dist/src/embed/spotter-viz-utils.d.ts +9 -10
  92. package/dist/src/embed/spotter-viz-utils.d.ts.map +1 -1
  93. package/dist/src/embed/ts-embed.d.ts +16 -8
  94. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  95. package/dist/src/index.d.ts +3 -3
  96. package/dist/src/index.d.ts.map +1 -1
  97. package/dist/src/react/all-types-export.d.ts +1 -1
  98. package/dist/src/react/all-types-export.d.ts.map +1 -1
  99. package/dist/src/react/all-types-export.parity.spec.d.ts +2 -0
  100. package/dist/src/react/all-types-export.parity.spec.d.ts.map +1 -0
  101. package/dist/src/react/index.d.ts +66 -32
  102. package/dist/src/react/index.d.ts.map +1 -1
  103. package/dist/src/types.d.ts +330 -18
  104. package/dist/src/types.d.ts.map +1 -1
  105. package/dist/tsembed-react.es.js +330 -61
  106. package/dist/tsembed-react.js +329 -60
  107. package/dist/tsembed.es.js +390 -123
  108. package/dist/tsembed.js +392 -125
  109. package/dist/visual-embed-sdk-react-full.d.ts +696 -89
  110. package/dist/visual-embed-sdk-react.d.ts +692 -88
  111. package/dist/visual-embed-sdk.d.ts +632 -59
  112. package/lib/package.json +1 -1
  113. package/lib/src/config.d.ts +1 -0
  114. package/lib/src/config.d.ts.map +1 -1
  115. package/lib/src/config.js +1 -0
  116. package/lib/src/config.js.map +1 -1
  117. package/lib/src/css-variables.d.ts +27 -0
  118. package/lib/src/css-variables.d.ts.map +1 -1
  119. package/lib/src/embed/app.d.ts +43 -12
  120. package/lib/src/embed/app.d.ts.map +1 -1
  121. package/lib/src/embed/app.js +30 -4
  122. package/lib/src/embed/app.js.map +1 -1
  123. package/lib/src/embed/app.spec.js +253 -1
  124. package/lib/src/embed/app.spec.js.map +1 -1
  125. package/lib/src/embed/base.d.ts +1 -1
  126. package/lib/src/embed/base.js +1 -1
  127. package/lib/src/embed/conversation.d.ts +171 -1
  128. package/lib/src/embed/conversation.d.ts.map +1 -1
  129. package/lib/src/embed/conversation.js +5 -3
  130. package/lib/src/embed/conversation.js.map +1 -1
  131. package/lib/src/embed/conversation.spec.js +125 -0
  132. package/lib/src/embed/conversation.spec.js.map +1 -1
  133. package/lib/src/embed/events.spec.js +3 -0
  134. package/lib/src/embed/events.spec.js.map +1 -1
  135. package/lib/src/embed/host-events.spec.js +36 -0
  136. package/lib/src/embed/host-events.spec.js.map +1 -1
  137. package/lib/src/embed/hostEventClient/host-event-client.d.ts +1 -1
  138. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  139. package/lib/src/embed/hostEventClient/host-event-client.spec.js +18 -0
  140. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  141. package/lib/src/embed/liveboard.d.ts +40 -13
  142. package/lib/src/embed/liveboard.d.ts.map +1 -1
  143. package/lib/src/embed/liveboard.js +25 -4
  144. package/lib/src/embed/liveboard.js.map +1 -1
  145. package/lib/src/embed/liveboard.spec.js +349 -2
  146. package/lib/src/embed/liveboard.spec.js.map +1 -1
  147. package/lib/src/embed/spotter-utils.d.ts +8 -1
  148. package/lib/src/embed/spotter-utils.d.ts.map +1 -1
  149. package/lib/src/embed/spotter-utils.js +13 -0
  150. package/lib/src/embed/spotter-utils.js.map +1 -1
  151. package/lib/src/embed/spotter-utils.spec.js +69 -1
  152. package/lib/src/embed/spotter-utils.spec.js.map +1 -1
  153. package/lib/src/embed/spotter-viz-utils.d.ts +9 -10
  154. package/lib/src/embed/spotter-viz-utils.d.ts.map +1 -1
  155. package/lib/src/embed/spotter-viz-utils.js.map +1 -1
  156. package/lib/src/embed/ts-embed.d.ts +16 -8
  157. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  158. package/lib/src/embed/ts-embed.js +69 -32
  159. package/lib/src/embed/ts-embed.js.map +1 -1
  160. package/lib/src/embed/ts-embed.spec.js +537 -3
  161. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  162. package/lib/src/index.d.ts +3 -3
  163. package/lib/src/index.d.ts.map +1 -1
  164. package/lib/src/index.js +2 -2
  165. package/lib/src/index.js.map +1 -1
  166. package/lib/src/react/all-types-export.d.ts +1 -1
  167. package/lib/src/react/all-types-export.d.ts.map +1 -1
  168. package/lib/src/react/all-types-export.js +1 -1
  169. package/lib/src/react/all-types-export.js.map +1 -1
  170. package/lib/src/react/all-types-export.parity.spec.d.ts +2 -0
  171. package/lib/src/react/all-types-export.parity.spec.d.ts.map +1 -0
  172. package/lib/src/react/all-types-export.parity.spec.js +191 -0
  173. package/lib/src/react/all-types-export.parity.spec.js.map +1 -0
  174. package/lib/src/react/index.d.ts +66 -32
  175. package/lib/src/react/index.d.ts.map +1 -1
  176. package/lib/src/react/index.js +5 -3
  177. package/lib/src/react/index.js.map +1 -1
  178. package/lib/src/react/index.spec.js +102 -1
  179. package/lib/src/react/index.spec.js.map +1 -1
  180. package/lib/src/types.d.ts +330 -18
  181. package/lib/src/types.d.ts.map +1 -1
  182. package/lib/src/types.js +182 -12
  183. package/lib/src/types.js.map +1 -1
  184. package/lib/src/utils.spec.js +4 -0
  185. package/lib/src/utils.spec.js.map +1 -1
  186. package/lib/src/visual-embed-sdk.d.ts +632 -59
  187. package/package.json +1 -1
  188. package/src/config.ts +1 -0
  189. package/src/css-variables.ts +32 -0
  190. package/src/embed/app.spec.ts +335 -1
  191. package/src/embed/app.ts +71 -13
  192. package/src/embed/base.ts +1 -1
  193. package/src/embed/conversation.spec.ts +136 -0
  194. package/src/embed/conversation.ts +181 -3
  195. package/src/embed/events.spec.ts +4 -0
  196. package/src/embed/host-events.spec.ts +48 -0
  197. package/src/embed/hostEventClient/host-event-client.spec.ts +34 -0
  198. package/src/embed/hostEventClient/host-event-client.ts +2 -2
  199. package/src/embed/liveboard.spec.ts +457 -2
  200. package/src/embed/liveboard.ts +74 -15
  201. package/src/embed/spotter-utils.spec.ts +72 -0
  202. package/src/embed/spotter-utils.ts +21 -1
  203. package/src/embed/spotter-viz-utils.ts +9 -10
  204. package/src/embed/ts-embed.spec.ts +699 -3
  205. package/src/embed/ts-embed.ts +83 -37
  206. package/src/index.ts +43 -2
  207. package/src/react/all-types-export.parity.spec.ts +208 -0
  208. package/src/react/all-types-export.ts +22 -0
  209. package/src/react/index.spec.tsx +158 -0
  210. package/src/react/index.tsx +70 -33
  211. package/src/types.ts +329 -16
  212. package/src/utils.spec.ts +5 -0
@@ -26,12 +26,14 @@ import {
26
26
  DefaultAppInitData,
27
27
  } from '../types';
28
28
  import { calculateVisibleElementData, getEffectiveClippingAncestors, getQueryParamString, getScrollableAncestors, isUndefined, isValidCssMargin, setParamIfDefined } from '../utils';
29
+ import { DEFAULT_LAZY_LOADING_MARGIN } from '../config';
29
30
  import { getAuthPromise } from './base';
30
31
  import { TsEmbed, V1Embed } from './ts-embed';
31
32
  import { addPreviewStylesIfNotPresent } from '../utils/global-styles';
32
- import { TriggerPayload, TriggerResponse } from './hostEventClient/contracts';
33
+ import { HostEventRequest, TriggerPayload, TriggerResponse } from './hostEventClient/contracts';
33
34
  import { logger } from '../utils/logger';
34
- import { SpotterChatViewConfig } from './conversation';
35
+ import { SpotterChatViewConfig, StarterPromptsConfig } from './conversation';
36
+ import { buildStarterPromptsAppInitData } from './spotter-utils';
35
37
  import { SpotterVizConfig, buildSpotterVizAppInitData } from './spotter-viz-utils';
36
38
 
37
39
  /**
@@ -41,6 +43,7 @@ import { SpotterVizConfig, buildSpotterVizAppInitData } from './spotter-viz-util
41
43
  export interface LiveboardEmbedAppInitData extends DefaultAppInitData {
42
44
  embedParams?: {
43
45
  spotterVizConfig?: SpotterVizConfig;
46
+ starterPrompts?: StarterPromptsConfig;
44
47
  };
45
48
  }
46
49
 
@@ -61,6 +64,11 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
61
64
  * Setting `fullHeight` to `false` fetches visualizations
62
65
  * incrementally as users scroll the page to view the charts and tables.
63
66
  *
67
+ * From SDK 1.52.0, enabling `fullHeight` also turns on
68
+ * {@link lazyLoadingForFullHeight} and
69
+ * {@link enableScrollableContainerLazyLoading}, so visualizations load as
70
+ * they scroll into view. Set either flag to `false` to opt out.
71
+ *
64
72
  *
65
73
  * Supported embed types: `LiveboardEmbed`
66
74
  * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
@@ -455,11 +463,17 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
455
463
  */
456
464
  isGranularXLSXCSVSchedulesEnabled?: boolean;
457
465
  /**
458
- * This flag is used to enable the full height lazy load data.
466
+ * Loads visualizations only as they scroll into the viewport, instead of
467
+ * loading the whole full-height Liveboard at once.
468
+ *
469
+ * From SDK 1.52.0 this is enabled automatically whenever `fullHeight` is
470
+ * `true`. On SDK 1.51.0 and earlier it defaulted to `false` and had to be
471
+ * set explicitly. Set it to `false` to load every visualization upfront.
472
+ * The flag has no effect unless `fullHeight` is enabled.
459
473
  *
460
474
  * @type {boolean}
461
475
  * @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
462
- * @default false
476
+ * @default true when `fullHeight` is enabled, from SDK 1.52.0
463
477
  * @example
464
478
  * ```js
465
479
  * const embed = new LiveboardEmbed('#embed-container', {
@@ -471,26 +485,42 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
471
485
  */
472
486
  lazyLoadingForFullHeight?: boolean;
473
487
  /**
474
- * This flag is used to enable container-aware full height lazy loading.
488
+ * Computes the visible region of the embed against its scrollable and
489
+ * clipping ancestors, instead of treating the browser window as the only
490
+ * viewport, and tracks scroll and resize on those ancestors.
475
491
  *
476
- * Use this when the embed is rendered inside a scrollable or clipping
477
- * container instead of relying on the browser window as the only viewport.
492
+ * From SDK 1.52.0 this is enabled automatically whenever `fullHeight` is
493
+ * `true`. On SDK 1.51.0 and earlier it defaulted to `false` and had to be
494
+ * set explicitly. Set it to `false` when the page scrolls with the window
495
+ * and the embed has no clipping ancestor, to skip the extra ancestor
496
+ * tracking.
478
497
  *
479
498
  * @type {boolean}
480
- * @default false
499
+ * @default true when `fullHeight` is enabled, from SDK 1.52.0
481
500
  */
482
501
  enableScrollableContainerLazyLoading?: boolean;
483
502
  /**
484
- * The margin to be used for lazy loading.
503
+ * How far outside the viewport a visualization starts loading, when
504
+ * {@link lazyLoadingForFullHeight} is enabled.
485
505
  *
486
506
  * For example, if the margin is set to '10px',
487
507
  * the visualization will be loaded 10px before its top edge is visible in the
488
508
  * viewport.
489
509
  *
490
- * The format is similar to CSS margin.
510
+ * The format is similar to CSS margin, so `'500px 0px'` extends the
511
+ * prefetch 500px above and below the viewport and not sideways. Accepted
512
+ * units are `px`, `em`, `rem`, `%`, `vh` and `vw`, plus bare `0` and
513
+ * `auto`; an invalid value is logged and ignored.
514
+ *
515
+ * From SDK 1.52.0 this defaults to `'500px 0px'` — roughly one
516
+ * visualization ahead of the scroll position, so a chart has usually
517
+ * finished loading by the time it scrolls into view. Use a smaller margin
518
+ * to cut warehouse queries further, or `'0px'` to load a visualization
519
+ * only once it is actually visible.
491
520
  *
492
521
  * @type {string}
493
522
  * @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
523
+ * @default '500px 0px' when `fullHeight` is enabled, from SDK 1.52.0
494
524
  * @example
495
525
  * ```js
496
526
  * const embed = new LiveboardEmbed('#embed-container', {
@@ -594,13 +624,12 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
594
624
  * inputChatPlaceholder: 'Ask a question...',
595
625
  * hideStarterPrompts: false,
596
626
  * customStarterPrompts: [{ id: '1', displayText: 'Top products', fullPrompt: 'What are the top products by revenue?' }],
597
- * // loaderHeadline and loaderTips require SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
627
+ * // The options below require SDK: 1.51.0
598
628
  * loaderHeadline: 'Crunching the numbers...',
599
629
  * loaderTips: [
600
630
  * { label: 'Tip', text: 'try asking about revenue by region' },
601
631
  * { label: 'Tip', text: 'use natural language' },
602
632
  * ],
603
- * // liveboardBrandName, spotterBrandName, insightTileBrandName, insightTileViewPlanLabel and insightTileLoaderText require SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
604
633
  * liveboardBrandName: 'Reports',
605
634
  * spotterBrandName: 'Analyst',
606
635
  * insightTileBrandName: 'Insight card',
@@ -675,6 +704,16 @@ export class LiveboardEmbed extends V1Embed {
675
704
  'Using full height with vizId might lead to unexpected behavior.');
676
705
  }
677
706
 
707
+ if (this.viewConfig.lazyLoadingForFullHeight === undefined) {
708
+ this.viewConfig.lazyLoadingForFullHeight = true;
709
+ }
710
+ if (this.viewConfig.enableScrollableContainerLazyLoading === undefined) {
711
+ this.viewConfig.enableScrollableContainerLazyLoading = true;
712
+ }
713
+ if (this.viewConfig.lazyLoadingMargin === undefined) {
714
+ this.viewConfig.lazyLoadingMargin = DEFAULT_LAZY_LOADING_MARGIN;
715
+ }
716
+
678
717
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
679
718
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
680
719
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
@@ -684,7 +723,8 @@ export class LiveboardEmbed extends V1Embed {
684
723
 
685
724
  protected async getAppInitData(): Promise<LiveboardEmbedAppInitData> {
686
725
  const defaultAppInitData = await super.getAppInitData();
687
- return buildSpotterVizAppInitData(defaultAppInitData, this.viewConfig);
726
+ const vizInitData = buildSpotterVizAppInitData(defaultAppInitData, this.viewConfig);
727
+ return buildStarterPromptsAppInitData(vizInitData, this.viewConfig);
688
728
  }
689
729
 
690
730
  /**
@@ -724,6 +764,7 @@ export class LiveboardEmbed extends V1Embed {
724
764
  isEnhancedFilterInteractivityEnabled,
725
765
  enableAskSage,
726
766
  enable2ColumnLayout,
767
+ isLiveboardAlwaysOn12ColLayout,
727
768
  dataPanelV2 = true,
728
769
  updatedSpotterExperience,
729
770
  enableCustomColumnGroups = false,
@@ -732,6 +773,7 @@ export class LiveboardEmbed extends V1Embed {
732
773
  dataSourceId,
733
774
  coverAndFilterOptionInPDF,
734
775
  isLiveboardStylingAndGroupingEnabled,
776
+ liveboardGutter,
735
777
  isPNGInScheduledEmailsEnabled = false,
736
778
  isLiveboardXLSXCSVDownloadEnabled,
737
779
  isGranularXLSXCSVSchedulesEnabled,
@@ -789,6 +831,9 @@ export class LiveboardEmbed extends V1Embed {
789
831
  if (enable2ColumnLayout !== undefined) {
790
832
  params[Param.Enable2ColumnLayout] = enable2ColumnLayout;
791
833
  }
834
+ if (isLiveboardAlwaysOn12ColLayout !== undefined) {
835
+ params[Param.IsLiveboardAlwaysOn12ColLayout] = isLiveboardAlwaysOn12ColLayout;
836
+ }
792
837
  if (hideTabPanel) {
793
838
  params[Param.HideTabPanel] = hideTabPanel;
794
839
  }
@@ -821,6 +866,10 @@ export class LiveboardEmbed extends V1Embed {
821
866
  params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
822
867
  }
823
868
 
869
+ if (liveboardGutter !== undefined) {
870
+ params[Param.LiveboardGutter] = liveboardGutter;
871
+ }
872
+
824
873
  if (isPNGInScheduledEmailsEnabled !== undefined) {
825
874
  params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
826
875
  }
@@ -849,6 +898,7 @@ export class LiveboardEmbed extends V1Embed {
849
898
  spotterFileUploadEnabled,
850
899
  spotterFileUploadFileTypes,
851
900
  enableStarterPrompts,
901
+ openSpotterOnLiveboardByDefault,
852
902
  } = spotterChatConfig;
853
903
 
854
904
  setParamIfDefined(params, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
@@ -859,6 +909,9 @@ export class LiveboardEmbed extends V1Embed {
859
909
  if (enableStarterPrompts !== undefined) {
860
910
  params[Param.IsStarterPromptsEnabled] = enableStarterPrompts;
861
911
  }
912
+ if (openSpotterOnLiveboardByDefault !== undefined) {
913
+ params[Param.OpenSpotterOnLiveboardByDefault] = openSpotterOnLiveboardByDefault;
914
+ }
862
915
  if (spotterFileUploadFileTypes !== undefined) {
863
916
  params[Param.SpotterFileUploadFileTypes] = JSON.stringify(spotterFileUploadFileTypes);
864
917
  }
@@ -1141,7 +1194,13 @@ export class LiveboardEmbed extends V1Embed {
1141
1194
  * @param {any} data The payload to send with the message
1142
1195
  * @returns A promise that resolves with the response from the embedded app
1143
1196
  */
1144
- public trigger<HostEventT extends HostEvent, PayloadT, ContextT extends ContextType>(
1197
+ public trigger<
1198
+ HostEventT extends HostEvent,
1199
+ // Must mirror TsEmbed.trigger: without the default, no-payload calls
1200
+ // through LiveboardEmbed lose the typed response and collapse to `any`.
1201
+ PayloadT = HostEventRequest<HostEventT>,
1202
+ ContextT extends ContextType = ContextType,
1203
+ >(
1145
1204
  messageType: HostEventT,
1146
1205
  data: TriggerPayload<PayloadT, HostEventT> = ({} as any),
1147
1206
  context?: ContextT,
@@ -1240,7 +1299,7 @@ export class LiveboardEmbed extends V1Embed {
1240
1299
  this.viewConfig.personalizedViewId = personalizedViewId;
1241
1300
  if (this.isRendered) {
1242
1301
  this.trigger(HostEvent.Navigate, path.substring(1));
1243
- } else if (this.viewConfig.preRenderId) {
1302
+ } else if (this.getPreRenderConfig().preRenderId) {
1244
1303
  this.preRender(true);
1245
1304
  } else {
1246
1305
  this.render();
@@ -2,6 +2,7 @@ import {
2
2
  resolveEnablePastConversationsSidebar,
3
3
  buildSpotterSidebarAppInitData,
4
4
  buildSpotterShareConversationAppInitData,
5
+ buildStarterPromptsAppInitData,
5
6
  } from './spotter-utils';
6
7
  import { ErrorDetailsTypes, EmbedErrorCodes } from '../types';
7
8
  import { ERROR_MESSAGE } from '../errors';
@@ -173,3 +174,74 @@ describe('buildSpotterShareConversationAppInitData', () => {
173
174
  expect(result.embedParams?.spotterShareConversationConfig?.enableShareConversation).toBe(true);
174
175
  });
175
176
  });
177
+
178
+ describe('buildStarterPromptsAppInitData', () => {
179
+ const base = { type: 'APP_INIT' } as any;
180
+
181
+ it('returns the payload unchanged when starterPrompts is absent', () => {
182
+ expect(buildStarterPromptsAppInitData(base, {})).toBe(base);
183
+ expect(buildStarterPromptsAppInitData(base, { spotterChatConfig: {} })).toBe(base);
184
+ });
185
+
186
+ it('nests starterPrompts under embedParams', () => {
187
+ const result = buildStarterPromptsAppInitData(base, {
188
+ spotterChatConfig: { starterPrompts: { quick: { label: 'Quick' } } },
189
+ });
190
+ expect(result.embedParams?.starterPrompts).toEqual({ quick: { label: 'Quick' } });
191
+ });
192
+
193
+ it('forwards the enable feature flag', () => {
194
+ const enabled = buildStarterPromptsAppInitData(base, {
195
+ spotterChatConfig: { starterPrompts: { enable: true, quick: { label: 'Quick' } } },
196
+ });
197
+ expect(enabled.embedParams?.starterPrompts).toEqual({ enable: true, quick: { label: 'Quick' } });
198
+
199
+ const disabled = buildStarterPromptsAppInitData(base, {
200
+ spotterChatConfig: { starterPrompts: { enable: false } },
201
+ });
202
+ expect(disabled.embedParams?.starterPrompts).toEqual({ enable: false });
203
+ });
204
+
205
+ it('preserves existing embedParams keys', () => {
206
+ const withExisting = {
207
+ ...base,
208
+ embedParams: { spotterSidebarConfig: { enablePastConversationsSidebar: true } },
209
+ } as any;
210
+ const result = buildStarterPromptsAppInitData(withExisting, {
211
+ spotterChatConfig: { starterPrompts: { quick: { label: 'Quick' } } },
212
+ });
213
+ expect(result.embedParams?.spotterSidebarConfig).toEqual({ enablePastConversationsSidebar: true });
214
+ expect(result.embedParams?.starterPrompts).toEqual({ quick: { label: 'Quick' } });
215
+ });
216
+
217
+ it('forwards every category as configured', () => {
218
+ const starterPrompts = {
219
+ enable: true,
220
+ quick: {
221
+ label: 'Quick',
222
+ questions: Array.from({ length: 6 }, (_, i) => ({
223
+ label: `q${i}`,
224
+ prompt: `prompt ${i}`,
225
+ })),
226
+ },
227
+ research: { label: 'Research', questions: [{ prompt: 'Why did revenue drop?' }] },
228
+ previewData: { label: 'Explore' },
229
+ liveboard: [
230
+ { label: 'Top products', prompt: 'What are the top products by revenue?' },
231
+ { prompt: 'How did revenue trend last quarter?' },
232
+ ],
233
+ };
234
+ const result = buildStarterPromptsAppInitData(base, {
235
+ spotterChatConfig: { starterPrompts },
236
+ });
237
+ expect(result.embedParams?.starterPrompts).toEqual(starterPrompts);
238
+ });
239
+
240
+ it('forwards the liveboard questions on their own', () => {
241
+ const liveboard = [{ label: 'Top products', prompt: 'What are the top products by revenue?' }];
242
+ const result = buildStarterPromptsAppInitData(base, {
243
+ spotterChatConfig: { starterPrompts: { enable: true, liveboard } },
244
+ });
245
+ expect(result.embedParams?.starterPrompts).toEqual({ enable: true, liveboard });
246
+ });
247
+ });
@@ -1,7 +1,12 @@
1
1
  import { DefaultAppInitData, ErrorDetailsTypes, EmbedErrorCodes } from '../types';
2
2
  import { validateHttpUrl } from '../utils';
3
3
  import { ERROR_MESSAGE } from '../errors';
4
- import type { SpotterSidebarViewConfig, SpotterShareConversationConfig } from './conversation';
4
+ import type {
5
+ SpotterSidebarViewConfig,
6
+ SpotterShareConversationConfig,
7
+ SpotterChatViewConfig,
8
+ StarterPromptsConfig,
9
+ } from './conversation';
5
10
  import type { VisualizationOverrides } from '../types';
6
11
 
7
12
  /**
@@ -94,3 +99,18 @@ export function buildSpotterShareConversationAppInitData<T extends DefaultAppIni
94
99
  },
95
100
  };
96
101
  }
102
+
103
+ export function buildStarterPromptsAppInitData<T extends DefaultAppInitData>(
104
+ initData: T,
105
+ viewConfig: { spotterChatConfig?: SpotterChatViewConfig },
106
+ ): T & { embedParams?: { starterPrompts?: StarterPromptsConfig } } {
107
+ const starterPrompts = viewConfig.spotterChatConfig?.starterPrompts;
108
+ if (!starterPrompts) return initData;
109
+ return {
110
+ ...initData,
111
+ embedParams: {
112
+ ...((initData as T & { embedParams?: Record<string, unknown> }).embedParams || {}),
113
+ starterPrompts,
114
+ },
115
+ };
116
+ }
@@ -32,13 +32,12 @@ export interface SpotterVizStarterPrompt {
32
32
  * customStarterPrompts: [
33
33
  * { id: '1', displayText: 'Top products', fullPrompt: 'What are the top products by revenue?' }
34
34
  * ],
35
- * // loaderHeadline and loaderTips require SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
35
+ * // The options below require SDK: 1.51.0
36
36
  * loaderHeadline: 'Crunching the numbers...',
37
37
  * loaderTips: [
38
38
  * { label: 'Tip', text: 'try asking about revenue by region' },
39
39
  * { label: 'Tip', text: 'use natural language' },
40
40
  * ],
41
- * // liveboardBrandName, spotterBrandName, insightTileBrandName, insightTileViewPlanLabel and insightTileLoaderText require SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
42
41
  * liveboardBrandName: 'Reports',
43
42
  * spotterBrandName: 'Analyst',
44
43
  * insightTileBrandName: 'Insight card',
@@ -91,48 +90,48 @@ export interface SpotterVizConfig {
91
90
  /**
92
91
  * Custom headline text shown in the SpotterViz loading state.
93
92
  * Replaces the default loading headline.
94
- * @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
93
+ * @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.7.0.cl
95
94
  */
96
95
  loaderHeadline?: string;
97
96
  /**
98
97
  * Custom tips shown in the SpotterViz loading state.
99
98
  * Replaces the default loading tips with the provided list.
100
- * @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
99
+ * @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.7.0.cl
101
100
  */
102
101
  loaderTips?: SpotterVizLoaderTip[];
103
102
  /**
104
103
  * Custom term used to replace "Liveboard" in the agent's responses.
105
- * @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
104
+ * @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.7.0.cl
106
105
  * @default ''
107
106
  */
108
107
  liveboardBrandName?: string;
109
108
  /**
110
109
  * Custom term used to replace "Spotter" in the agent's responses.
111
- * @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
110
+ * @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.7.0.cl
112
111
  * @default ''
113
112
  */
114
113
  spotterBrandName?: string;
115
114
  /**
116
115
  * Custom term used to replace "Insight tile" in the UI and in the agent's responses.
117
- * @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
116
+ * @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.7.0.cl
118
117
  * @default ''
119
118
  */
120
119
  insightTileBrandName?: string;
121
120
  /**
122
121
  * Custom term used to replace "View plan" in the insight tile menu.
123
- * @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
122
+ * @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.7.0.cl
124
123
  */
125
124
  insightTileViewPlanLabel?: string;
126
125
  /**
127
126
  * Custom loader text shown on the insight tile.
128
- * @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
127
+ * @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.7.0.cl
129
128
  */
130
129
  insightTileLoaderText?: string;
131
130
  }
132
131
 
133
132
  /**
134
133
  * A single tip shown in the SpotterViz loading state.
135
- * @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
134
+ * @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.7.0.cl
136
135
  * @group Embed components
137
136
  */
138
137
  export interface SpotterVizLoaderTip {