@thoughtspot/visual-embed-sdk 1.36.9-primaryAction → 1.37.0-temp-nav

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 (127) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/auth.d.ts +2 -1
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +1 -0
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/embed/app.d.ts +76 -0
  7. package/cjs/src/embed/app.d.ts.map +1 -1
  8. package/cjs/src/embed/app.js +18 -1
  9. package/cjs/src/embed/app.js.map +1 -1
  10. package/cjs/src/embed/app.spec.js +50 -0
  11. package/cjs/src/embed/app.spec.js.map +1 -1
  12. package/cjs/src/embed/liveboard.d.ts +2 -2
  13. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  14. package/cjs/src/embed/ts-embed.js +3 -3
  15. package/cjs/src/embed/ts-embed.js.map +1 -1
  16. package/cjs/src/index.d.ts.map +1 -1
  17. package/cjs/src/index.js +1 -0
  18. package/cjs/src/index.js.map +1 -1
  19. package/cjs/src/react/index.d.ts.map +1 -1
  20. package/cjs/src/react/index.js +1 -0
  21. package/cjs/src/react/index.js.map +1 -1
  22. package/cjs/src/types.d.ts +54 -27
  23. package/cjs/src/types.d.ts.map +1 -1
  24. package/cjs/src/types.js +38 -9
  25. package/cjs/src/types.js.map +1 -1
  26. package/cjs/src/utils/graphql/answerService/answerService.d.ts +35 -15
  27. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  28. package/cjs/src/utils/graphql/answerService/answerService.js +35 -15
  29. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  30. package/cjs/src/utils/processData.js +6 -4
  31. package/cjs/src/utils/processData.js.map +1 -1
  32. package/dist/{index-BEyovSez.js → index-Cj4BVGHL.js} +2 -1
  33. package/dist/{index-Dg18PU5Z.js → index-Fhk1V_Gw.js} +1 -0
  34. package/dist/src/auth.d.ts +2 -1
  35. package/dist/src/auth.d.ts.map +1 -1
  36. package/dist/src/embed/app.d.ts +76 -0
  37. package/dist/src/embed/app.d.ts.map +1 -1
  38. package/dist/src/embed/liveboard.d.ts +2 -2
  39. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  40. package/dist/src/index.d.ts.map +1 -1
  41. package/dist/src/react/index.d.ts.map +1 -1
  42. package/dist/src/types.d.ts +54 -27
  43. package/dist/src/types.d.ts.map +1 -1
  44. package/dist/src/utils/graphql/answerService/answerService.d.ts +35 -15
  45. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  46. package/dist/tsembed-react.es.js +105 -35
  47. package/dist/tsembed-react.js +104 -34
  48. package/dist/tsembed.es.js +105 -35
  49. package/dist/tsembed.js +104 -34
  50. package/dist/visual-embed-sdk-react-full.d.ts +169 -45
  51. package/dist/visual-embed-sdk-react.d.ts +169 -45
  52. package/dist/visual-embed-sdk.d.ts +169 -45
  53. package/lib/package.json +1 -1
  54. package/lib/src/auth.d.ts +2 -1
  55. package/lib/src/auth.d.ts.map +1 -1
  56. package/lib/src/auth.js +1 -0
  57. package/lib/src/auth.js.map +1 -1
  58. package/lib/src/embed/app.d.ts +76 -0
  59. package/lib/src/embed/app.d.ts.map +1 -1
  60. package/lib/src/embed/app.js +18 -1
  61. package/lib/src/embed/app.js.map +1 -1
  62. package/lib/src/embed/app.spec.js +50 -0
  63. package/lib/src/embed/app.spec.js.map +1 -1
  64. package/lib/src/embed/liveboard.d.ts +2 -2
  65. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  66. package/lib/src/embed/ts-embed.js +3 -3
  67. package/lib/src/embed/ts-embed.js.map +1 -1
  68. package/lib/src/index.d.ts.map +1 -1
  69. package/lib/src/index.js +1 -0
  70. package/lib/src/index.js.map +1 -1
  71. package/lib/src/react/index.d.ts.map +1 -1
  72. package/lib/src/react/index.js +1 -0
  73. package/lib/src/react/index.js.map +1 -1
  74. package/lib/src/types.d.ts +54 -27
  75. package/lib/src/types.d.ts.map +1 -1
  76. package/lib/src/types.js +38 -9
  77. package/lib/src/types.js.map +1 -1
  78. package/lib/src/utils/graphql/answerService/answerService.d.ts +35 -15
  79. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  80. package/lib/src/utils/graphql/answerService/answerService.js +35 -15
  81. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  82. package/lib/src/utils/processData.js +6 -4
  83. package/lib/src/utils/processData.js.map +1 -1
  84. package/lib/src/visual-embed-sdk.d.ts +169 -45
  85. package/package.json +1 -1
  86. package/src/auth.ts +2 -1
  87. package/src/embed/app.spec.ts +70 -0
  88. package/src/embed/app.ts +104 -0
  89. package/src/embed/liveboard.ts +2 -2
  90. package/src/embed/ts-embed.ts +3 -4
  91. package/src/index.ts +2 -0
  92. package/src/react/index.tsx +2 -0
  93. package/src/types.ts +54 -31
  94. package/src/utils/graphql/answerService/answerService.ts +35 -15
  95. package/src/utils/processData.ts +6 -6
  96. package/dist/index-BJx3m5_V.js +0 -7370
  97. package/dist/index-Do_T8J8z.js +0 -7370
  98. package/dist/src/pages/embed-test.page.d.ts +0 -8
  99. package/dist/src/pages/embed-test.page.d.ts.map +0 -1
  100. package/dist/src/pages/home.page.d.ts +0 -6
  101. package/dist/src/pages/home.page.d.ts.map +0 -1
  102. package/dist/src/pages/login.page.d.ts +0 -15
  103. package/dist/src/pages/login.page.d.ts.map +0 -1
  104. package/dist/src/tests/auth.test.d.ts +0 -1
  105. package/dist/src/tests/auth.test.d.ts.map +0 -1
  106. package/dist/src/tests/e2e/auth.spec.d.ts +0 -2
  107. package/dist/src/tests/e2e/auth.spec.d.ts.map +0 -1
  108. package/lib/src/pages/embed-test.page.d.ts +0 -8
  109. package/lib/src/pages/embed-test.page.d.ts.map +0 -1
  110. package/lib/src/pages/embed-test.page.js +0 -16
  111. package/lib/src/pages/embed-test.page.js.map +0 -1
  112. package/lib/src/pages/home.page.d.ts +0 -6
  113. package/lib/src/pages/home.page.d.ts.map +0 -1
  114. package/lib/src/pages/home.page.js +0 -8
  115. package/lib/src/pages/home.page.js.map +0 -1
  116. package/lib/src/pages/login.page.d.ts +0 -15
  117. package/lib/src/pages/login.page.d.ts.map +0 -1
  118. package/lib/src/pages/login.page.js +0 -18
  119. package/lib/src/pages/login.page.js.map +0 -1
  120. package/lib/src/tests/auth.test.d.ts +0 -1
  121. package/lib/src/tests/auth.test.d.ts.map +0 -1
  122. package/lib/src/tests/auth.test.js +0 -1
  123. package/lib/src/tests/auth.test.js.map +0 -1
  124. package/lib/src/tests/e2e/auth.spec.d.ts +0 -2
  125. package/lib/src/tests/e2e/auth.spec.d.ts.map +0 -1
  126. package/lib/src/tests/e2e/auth.spec.js +0 -52
  127. package/lib/src/tests/e2e/auth.spec.js.map +0 -1
@@ -106,6 +106,20 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
106
106
  AI_ANSWER = "aiAnswer",
107
107
  NONE = "none"
108
108
  }
109
+ export interface ModularHomeExperienceV3 {
110
+ /**
111
+ * Enabled the modular homepage version 3.
112
+ */
113
+ enabled?: boolean;
114
+ /**
115
+ * homePage values are v2/v3,
116
+ * v2 will show the modular homepage experience
117
+ * v3 will show the new modular homepage v3 experience.
118
+ *
119
+ * @default v2
120
+ */
121
+ homePage?: string;
122
+ }
109
123
  /**
110
124
  * The view configuration for full app embedding.
111
125
  * @group Embed components
@@ -174,6 +188,51 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
174
188
  * ```
175
189
  */
176
190
  enablePendoHelp?: boolean;
191
+ /**
192
+ * Control the visibility of the hamburger icon on the top nav bar
193
+ * available when new navigation V3 is enabled.
194
+ *
195
+ * @default false
196
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
197
+ * @example
198
+ * ```js
199
+ * const embed = new AppEmbed('#tsEmbed', {
200
+ * ... // other options
201
+ * hideHamburger : true,
202
+ * })
203
+ * ```
204
+ */
205
+ hideHamburger?: boolean;
206
+ /**
207
+ * Control the visibility of the Eureka search on the top nav bar
208
+ * this will control for both new V2 and new navigation V3.
209
+ *
210
+ * @default true
211
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
212
+ * @example
213
+ * ```js
214
+ * const embed = new AppEmbed('#tsEmbed', {
215
+ * ... // other options
216
+ * hideObjectSearch: false,
217
+ * })
218
+ * ```
219
+ */
220
+ hideObjectSearch?: boolean;
221
+ /**
222
+ * Control the visibility of the notification on the top nav bar V3,
223
+ * available when new navigation V3 is enabled.
224
+ *
225
+ * @default true
226
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
227
+ * @example
228
+ * ```js
229
+ * const embed = new AppEmbed('#tsEmbed', {
230
+ * ... // other options
231
+ * hideNotification: false,
232
+ * })
233
+ * ```
234
+ */
235
+ hideNotification?: boolean;
177
236
  /**
178
237
  * Control the visibility of the application switcher button on the nav-bar.
179
238
  * By default, the application switcher is shown.
@@ -367,6 +426,23 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
367
426
  * ```
368
427
  */
369
428
  modularHomeExperience?: boolean;
429
+ /**
430
+ * Flag to control new navigation v3 home experience.
431
+ *
432
+ * @default false
433
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
434
+ * @example
435
+ * ```js
436
+ * const embed = new AppEmbed('#tsEmbed', {
437
+ * ... // other options
438
+ * modularHomeExperienceV3 : {
439
+ * enabled: true,
440
+ * homePage: 'v2'
441
+ * },
442
+ * })
443
+ * ```
444
+ */
445
+ modularHomeExperienceV3?: ModularHomeExperienceV3;
370
446
  /**
371
447
  * Boolean to control if Liveboard header is sticky or not.
372
448
  * @example
@@ -1062,10 +1138,10 @@ declare module '@thoughtspot/visual-embed-sdk/embed/liveboard' {
1062
1138
  dataSourceId?: string;
1063
1139
  /**
1064
1140
  * This flag is for show/hide checkboxes for include or exclude
1065
- * cover and filter pages in the Liveboard PDF
1141
+ * cover page and filters in the Liveboard PDF.
1066
1142
  * @type {boolean}
1067
1143
  * @default true
1068
- * @version SDK: 1.38.0 | ThoughtSpot:10.8.0.cl
1144
+ * @version SDK: 1.37.0 | ThoughtSpot:10.8.0.cl
1069
1145
  * @example
1070
1146
  * ```js
1071
1147
  * const embed = new LiveboardEmbed('#embed-container', {
@@ -1735,7 +1811,8 @@ declare module '@thoughtspot/visual-embed-sdk/auth' {
1735
1811
  NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
1736
1812
  EXPIRY = "EXPIRY",
1737
1813
  OTHER = "OTHER",
1738
- IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT"
1814
+ IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT",
1815
+ UNAUTHENTICATED_FAILURE = "UNAUTHENTICATED_FAILURE"
1739
1816
  }
1740
1817
  /**
1741
1818
  * Enum for auth status emitted by the emitter returned from {@link init}.
@@ -2206,7 +2283,19 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2206
2283
  /**
2207
2284
  * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
2208
2285
  */
2209
- LiveboardSchedules = "liveboard-schedules"
2286
+ LiveboardSchedules = "liveboard-schedules",
2287
+ /**
2288
+ * Create new options in the insights left navigation,
2289
+ * available when new navigation V3 is enabled.
2290
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
2291
+ */
2292
+ Create = "create",
2293
+ /**
2294
+ * Spotter option in the insights left navigation,
2295
+ * available when new navigation V3 is enabled.
2296
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
2297
+ */
2298
+ Spotter = "spotter"
2210
2299
  }
2211
2300
  export type DOMSelector = string | HTMLElement;
2212
2301
  /**
@@ -2687,6 +2776,19 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2687
2776
  * ```
2688
2777
  */
2689
2778
  disabledActions?: Action[];
2779
+ /**
2780
+ * The primary action to display on top of the viz for Liveboard and App Embed.
2781
+ * Use this to set the primary action.
2782
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
2783
+ * @example
2784
+ * ```js
2785
+ * const embed = new LiveboardEmbed('#embed', {
2786
+ * ... // other liveboard view config
2787
+ * primaryAction: Action.Download
2788
+ * });
2789
+ * ```
2790
+ */
2791
+ primaryAction?: Action | string;
2690
2792
  /**
2691
2793
  * The tooltip to display for disabled actions.
2692
2794
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
@@ -2715,21 +2817,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2715
2817
  * @important
2716
2818
  */
2717
2819
  hiddenActions?: Action[];
2718
- /**
2719
- * The primary action to display from the embedded.
2720
- * This action will be displayed from the embedded.
2721
- * Use this to set the primary action.
2722
- * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
2723
- * @example
2724
- * ```js
2725
- * const embed = new LiveboardEmbed('#embed', {
2726
- * ... // other liveboard view config
2727
- * primaryAction: 'download'
2728
- * });
2729
- * ```
2730
- * @important
2731
- */
2732
- primaryAction?: string;
2733
2820
  /**
2734
2821
  * The list of actions to display from the primary menu, more menu
2735
2822
  * (...), and the contextual menu. These will be only actions that
@@ -3128,8 +3215,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3128
3215
  * Hide list page columns
3129
3216
  * For example: hiddenListColumns = [ListPageColumns.Author]
3130
3217
  *
3131
- * **Note**: This option is appplicable only in full app embedding.
3132
- * @version SDK: 1.38.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
3218
+ * **Note**: This option is available only in full app embedding.
3219
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl
3133
3220
  * @example
3134
3221
  * ```js
3135
3222
  * const embed = new AppEmbed('#tsEmbed', {
@@ -3286,8 +3373,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3286
3373
  }
3287
3374
  /**
3288
3375
  * List page columns that can be hidden.
3289
- * **Note**: This option is applicable only in full app embedding.
3290
- * @version SDK: 1.38.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
3376
+ * **Note**: This option is applicable to full app embedding only.
3377
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl
3291
3378
  */
3292
3379
  export enum ListPageColumns {
3293
3380
  /**
@@ -4370,7 +4457,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4370
4457
  * searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
4371
4458
  * })
4372
4459
  * ```
4373
- * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl
4460
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
4374
4461
  */
4375
4462
  TableVizRendered = "TableVizRendered",
4376
4463
  /**
@@ -4383,12 +4470,12 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4383
4470
  * console.log('payload', payload);
4384
4471
  * })
4385
4472
  *```
4386
- * @version SDK : 1.38.0 | ThoughtSpot : 10.8.0.cl
4473
+ * @version SDK : 1.37.0 | ThoughtSpot : 10.8.0.cl
4387
4474
  */
4388
4475
  CreateLiveboard = "createLiveboard",
4389
4476
  /**
4390
4477
  * Emitted when a user creates a Model.
4391
- * @version SDK : 1.38.0 | ThoughtSpot : 10.8.0.cl
4478
+ * @version SDK : 1.37.0 | ThoughtSpot : 10.8.0.cl
4392
4479
  */
4393
4480
  CreateModel = "createModel"
4394
4481
  }
@@ -4830,7 +4917,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4830
4917
  * ```js
4831
4918
  * liveboardEmbed.trigger(HostEvent.Remove)
4832
4919
  * ```
4833
- * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
4920
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
4834
4921
  */
4835
4922
  Remove = "delete",
4836
4923
  /**
@@ -5291,8 +5378,17 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5291
5378
  /**
5292
5379
  * Get the Answer session for a Search or
5293
5380
  * Liveboard visualization.
5381
+ *
5382
+ * Note: This event is not typically used directly. Instead, use the
5383
+ * `getAnswerService()` method on the embed instance to get an AnswerService
5384
+ * object that provides a more convenient interface for working with answers.
5385
+ *
5294
5386
  * @example
5295
5387
  * ```js
5388
+ * // Preferred way to get an AnswerService
5389
+ * const service = await embed.getAnswerService();
5390
+ *
5391
+ * // Alternative direct usage (not recommended)
5296
5392
  * const {session} = await embed.trigger(
5297
5393
  * HostEvent.GetAnswerSession, {
5298
5394
  * vizId: '123', // For Liveboard Visualization.
@@ -5300,6 +5396,10 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5300
5396
  * ```
5301
5397
  * @example
5302
5398
  * ```js
5399
+ * // Preferred way to get an AnswerService
5400
+ * const service = await embed.getAnswerService();
5401
+ *
5402
+ * // Alternative direct usage (not recommended)
5303
5403
  * const {session} = await embed.trigger( HostEvent.GetAnswerSession )
5304
5404
  * ```
5305
5405
  * @version SDK: 1.26.0 | ThoughtSpot: 9.10.0.cl, 10.1.0.sw
@@ -5425,7 +5525,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5425
5525
  * searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
5426
5526
  * })
5427
5527
  * ```
5428
- * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl
5528
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
5429
5529
  */
5430
5530
  TransformTableVizData = "TransformTableVizData"
5431
5531
  }
@@ -5498,6 +5598,10 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5498
5598
  ShowInsertToSlide = "insertInToSlide",
5499
5599
  PrimaryNavHidden = "primaryNavHidden",
5500
5600
  HideProfleAndHelp = "profileAndHelpInNavBarHidden",
5601
+ NavigationVersion = "navigationVersion",
5602
+ HideHamburger = "hideHamburger",
5603
+ HideObjectSearch = "hideObjectSearch",
5604
+ HideNotification = "hideNotification",
5501
5605
  HideApplicationSwitcher = "applicationSwitcherHidden",
5502
5606
  HideOrgSwitcher = "orgSwitcherHidden",
5503
5607
  IsSageEmbed = "isSageEmbed",
@@ -6761,7 +6865,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
6761
6865
  * ```js
6762
6866
  * hiddenAction: [Action.ColumnRename]
6763
6867
  * ```
6764
- * @version SDK: 1.38.0 | ThoughtSpot Cloud: 10.8.0.cl
6868
+ * @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
6765
6869
  */
6766
6870
  ColumnRename = "columnRename",
6767
6871
  /**
@@ -6771,7 +6875,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
6771
6875
  * ```js
6772
6876
  * hiddenAction: [Action.CoverAndFilterOptionInPDF]
6773
6877
  * ```
6774
- * @version SDK: 1.38.0 | ThoughtSpot Cloud: 10.8.0.cl
6878
+ * @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
6775
6879
  */
6776
6880
  CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF"
6777
6881
  }
@@ -7494,29 +7598,49 @@ declare module '@thoughtspot/visual-embed-sdk/utils/graphql/answerService/answer
7494
7598
  dataValue: any;
7495
7599
  }
7496
7600
  /**
7497
- * Class representing the answer service provided with the
7498
- * custom action payload. This service could be used to run
7499
- * graphql queries in the context of the answer on which the
7500
- * custom action was triggered.
7601
+ * AnswerService provides a simple way to work with ThoughtSpot Answers.
7602
+ *
7603
+ * This service allows you to interact with ThoughtSpot Answers programmatically,
7604
+ * making it easy to customize visualizations, filter data, and extract insights
7605
+ * directly from your application.
7606
+ *
7607
+ * You can use this service to:
7608
+ * - Add or remove columns from Answers (`addColumns`, `removeColumns`, `addColumnsByName`)
7609
+ * - Apply filters to Answers (`addFilter`)
7610
+ * - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`, `fetchCSVBlob`, `fetchPNGBlob`)
7611
+ * - Get data for specific points in visualizations (`getUnderlyingDataForPoint`)
7612
+ * - Run custom queries (`executeQuery`)
7613
+ * - Add visualizations to liveboards (`addDisplayedVizToLiveboard`)
7614
+ *
7501
7615
  * @example
7502
7616
  * ```js
7503
- * embed.on(EmbedEvent.CustomAction, e => {
7504
- * const underlying = await e.answerService.getUnderlyingDataForPoint([
7505
- * 'col name 1'
7506
- * ]);
7507
- * const data = await underlying.fetchData(0, 100);
7508
- * })
7617
+ * // Get the answer service
7618
+ * embed.on(EmbedEvent.Data, async (e) => {
7619
+ * const service = await embed.getAnswerService();
7620
+ *
7621
+ * // Add columns to the answer
7622
+ * await service.addColumnsByName(["Sales", "Region"]);
7623
+ *
7624
+ * // Get the data
7625
+ * const data = await service.fetchData();
7626
+ * console.log(data);
7627
+ * });
7509
7628
  * ```
7629
+ *
7510
7630
  * @example
7511
7631
  * ```js
7512
- * embed.on(EmbedEvent.Data, async (e) => {
7513
- * const service = await embed.getAnswerService();
7514
- * await service.addColumns([
7515
- * "<column guid>"
7632
+ * // Get data for a point in a visualization
7633
+ * embed.on(EmbedEvent.CustomAction, async (e) => {
7634
+ * const underlying = await e.answerService.getUnderlyingDataForPoint([
7635
+ * 'Product Name',
7636
+ * 'Sales Amount'
7516
7637
  * ]);
7517
- * console.log(await service.fetchData());
7638
+ *
7639
+ * const data = await underlying.fetchData(0, 100);
7640
+ * console.log(data);
7518
7641
  * });
7519
7642
  * ```
7643
+ *
7520
7644
  * @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
7521
7645
  * @group Events
7522
7646
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.36.9-primaryAction",
3
+ "version": "1.37.0-temp-nav",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
package/src/auth.ts CHANGED
@@ -40,7 +40,8 @@ export enum AuthFailureType {
40
40
  NO_COOKIE_ACCESS = 'NO_COOKIE_ACCESS',
41
41
  EXPIRY = 'EXPIRY',
42
42
  OTHER = 'OTHER',
43
- IDLE_SESSION_TIMEOUT = 'IDLE_SESSION_TIMEOUT'
43
+ IDLE_SESSION_TIMEOUT = 'IDLE_SESSION_TIMEOUT',
44
+ UNAUTHENTICATED_FAILURE = 'UNAUTHENTICATED_FAILURE',
44
45
  }
45
46
 
46
47
  /**
@@ -494,6 +494,76 @@ describe('App embed tests', () => {
494
494
  });
495
495
  });
496
496
 
497
+ test('Should add hideHamburger, hideObjectSearch, hideNotification flags to the iframe src', async () => {
498
+ const appEmbed = new AppEmbed(getRootEl(), {
499
+ ...defaultViewConfig,
500
+ hideHamburger: true,
501
+ hideObjectSearch: true,
502
+ hideNotification: true,
503
+ } as AppViewConfig);
504
+
505
+ appEmbed.render();
506
+ await executeAfterWait(() => {
507
+ expectUrlMatchesWithParams(
508
+ getIFrameSrc(),
509
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&hideHamburger=true&hideObjectSearch=true&hideNotification=true${defaultParams}${defaultParamsPost}#/home`,
510
+ );
511
+ });
512
+ });
513
+
514
+ test('Should not add when hideHamburger, hideObjectSearch, hideNotification values are not true to the iframe src', async () => {
515
+ const appEmbed = new AppEmbed(getRootEl(), {
516
+ ...defaultViewConfig,
517
+ hideHamburger: false,
518
+ hideObjectSearch: undefined,
519
+ hideNotification: null,
520
+ } as AppViewConfig);
521
+
522
+ appEmbed.render();
523
+ await executeAfterWait(() => {
524
+ expectUrlMatchesWithParams(
525
+ getIFrameSrc(),
526
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false${defaultParams}${defaultParamsPost}#/home`,
527
+ );
528
+ });
529
+ });
530
+
531
+ test('Should add navigationVersion=v3 when modularHomeExperienceV3 is true to the iframe src', async () => {
532
+ const appEmbed = new AppEmbed(getRootEl(), {
533
+ ...defaultViewConfig,
534
+ modularHomeExperienceV3: {
535
+ enabled: true,
536
+ homePage: 'v2',
537
+ },
538
+ } as AppViewConfig);
539
+
540
+ appEmbed.render();
541
+ await executeAfterWait(() => {
542
+ expectUrlMatchesWithParams(
543
+ getIFrameSrc(),
544
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${defaultParams}${defaultParamsPost}#/home`,
545
+ );
546
+ });
547
+ });
548
+
549
+ test('Should not add navigationVersion when modularHomeExperienceV3 is false to the iframe src', async () => {
550
+ const appEmbed = new AppEmbed(getRootEl(), {
551
+ ...defaultViewConfig,
552
+ modularHomeExperienceV3: {
553
+ enabled: false,
554
+ homePage: 'v2',
555
+ },
556
+ } as AppViewConfig);
557
+
558
+ appEmbed.render();
559
+ await executeAfterWait(() => {
560
+ expectUrlMatchesWithParams(
561
+ getIFrameSrc(),
562
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true${defaultParams}${defaultParamsPost}#/home`,
563
+ );
564
+ });
565
+ });
566
+
497
567
  test('Should add enableAskSage flag to the iframe src', async () => {
498
568
  const appEmbed = new AppEmbed(getRootEl(), {
499
569
  ...defaultViewConfig,
package/src/embed/app.ts CHANGED
@@ -83,6 +83,22 @@ export enum HomePageSearchBarMode {
83
83
  AI_ANSWER = 'aiAnswer',
84
84
  NONE = 'none'
85
85
  }
86
+
87
+ export interface ModularHomeExperienceV3 {
88
+ /**
89
+ * Enabled the modular homepage version 3.
90
+ */
91
+ enabled?: boolean;
92
+ /**
93
+ * homePage values are v2/v3,
94
+ * v2 will show the modular homepage experience
95
+ * v3 will show the new modular homepage v3 experience.
96
+ *
97
+ * @default v2
98
+ */
99
+ homePage?: string;
100
+ }
101
+
86
102
  /**
87
103
  * The view configuration for full app embedding.
88
104
  * @group Embed components
@@ -151,6 +167,51 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
151
167
  * ```
152
168
  */
153
169
  enablePendoHelp?: boolean
170
+ /**
171
+ * Control the visibility of the hamburger icon on the top nav bar
172
+ * available when new navigation V3 is enabled.
173
+ *
174
+ * @default false
175
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
176
+ * @example
177
+ * ```js
178
+ * const embed = new AppEmbed('#tsEmbed', {
179
+ * ... // other options
180
+ * hideHamburger : true,
181
+ * })
182
+ * ```
183
+ */
184
+ hideHamburger?: boolean;
185
+ /**
186
+ * Control the visibility of the Eureka search on the top nav bar
187
+ * this will control for both new V2 and new navigation V3.
188
+ *
189
+ * @default true
190
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
191
+ * @example
192
+ * ```js
193
+ * const embed = new AppEmbed('#tsEmbed', {
194
+ * ... // other options
195
+ * hideObjectSearch: false,
196
+ * })
197
+ * ```
198
+ */
199
+ hideObjectSearch?: boolean;
200
+ /**
201
+ * Control the visibility of the notification on the top nav bar V3,
202
+ * available when new navigation V3 is enabled.
203
+ *
204
+ * @default true
205
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
206
+ * @example
207
+ * ```js
208
+ * const embed = new AppEmbed('#tsEmbed', {
209
+ * ... // other options
210
+ * hideNotification: false,
211
+ * })
212
+ * ```
213
+ */
214
+ hideNotification?: boolean;
154
215
  /**
155
216
  * Control the visibility of the application switcher button on the nav-bar.
156
217
  * By default, the application switcher is shown.
@@ -344,6 +405,23 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
344
405
  * ```
345
406
  */
346
407
  modularHomeExperience?: boolean;
408
+ /**
409
+ * Flag to control new navigation v3 home experience.
410
+ *
411
+ * @default false
412
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
413
+ * @example
414
+ * ```js
415
+ * const embed = new AppEmbed('#tsEmbed', {
416
+ * ... // other options
417
+ * modularHomeExperienceV3 : {
418
+ * enabled: true,
419
+ * homePage: 'v2'
420
+ * },
421
+ * })
422
+ * ```
423
+ */
424
+ modularHomeExperienceV3?: ModularHomeExperienceV3;
347
425
  /**
348
426
  * Boolean to control if Liveboard header is sticky or not.
349
427
  * @example
@@ -515,6 +593,9 @@ export class AppEmbed extends V1Embed {
515
593
  liveboardV2,
516
594
  showPrimaryNavbar,
517
595
  disableProfileAndHelp,
596
+ hideHamburger,
597
+ hideObjectSearch,
598
+ hideNotification,
518
599
  hideApplicationSwitcher,
519
600
  hideOrgSwitcher,
520
601
  enableSearchAssist,
@@ -525,6 +606,7 @@ export class AppEmbed extends V1Embed {
525
606
  showLiveboardDescription = true,
526
607
  hideHomepageLeftNav = false,
527
608
  modularHomeExperience = false,
609
+ modularHomeExperienceV3 = false,
528
610
  isLiveboardHeaderSticky = true,
529
611
  enableAskSage,
530
612
  collapseSearchBarInitially = false,
@@ -561,6 +643,18 @@ export class AppEmbed extends V1Embed {
561
643
 
562
644
  params = this.getBaseQueryParams(params);
563
645
 
646
+ if (hideObjectSearch) {
647
+ params[Param.HideObjectSearch] = !!hideObjectSearch;
648
+ }
649
+
650
+ if (hideHamburger) {
651
+ params[Param.HideHamburger] = !!hideHamburger;
652
+ }
653
+
654
+ if (hideNotification) {
655
+ params[Param.HideNotification] = !!hideNotification;
656
+ }
657
+
564
658
  if (fullHeight === true) {
565
659
  params[Param.fullHeight] = true;
566
660
  }
@@ -620,6 +714,16 @@ export class AppEmbed extends V1Embed {
620
714
  /* eslint-disable-next-line max-len */
621
715
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
622
716
  }
717
+
718
+ if (modularHomeExperienceV3) {
719
+ if (modularHomeExperienceV3.enabled) {
720
+ params[Param.NavigationVersion] = 'v3';
721
+ }
722
+ if (modularHomeExperienceV3.homePage === 'v2') {
723
+ params[Param.ModularHomeExperienceEnabled] = true;
724
+ }
725
+ }
726
+
623
727
  const queryParams = getQueryParamString(params, true);
624
728
 
625
729
  return queryParams;
@@ -394,10 +394,10 @@ export interface LiveboardViewConfig
394
394
 
395
395
  /**
396
396
  * This flag is for show/hide checkboxes for include or exclude
397
- * cover and filter pages in the Liveboard PDF
397
+ * cover page and filters in the Liveboard PDF.
398
398
  * @type {boolean}
399
399
  * @default true
400
- * @version SDK: 1.38.0 | ThoughtSpot:10.8.0.cl
400
+ * @version SDK: 1.37.0 | ThoughtSpot:10.8.0.cl
401
401
  * @example
402
402
  * ```js
403
403
  * const embed = new LiveboardEmbed('#embed-container', {
@@ -555,14 +555,13 @@ export class TsEmbed {
555
555
  return queryParams;
556
556
  }
557
557
 
558
- if (primaryAction) {
559
- queryParams[Param.PrimaryAction] = primaryAction;
560
- }
561
-
562
558
  if (Array.isArray(visibleTabs) && Array.isArray(hiddenTabs)) {
563
559
  this.handleError('You cannot have both hidden Tabs and visible Tabs');
564
560
  return queryParams;
565
561
  }
562
+ if (primaryAction) {
563
+ queryParams[Param.PrimaryAction] = primaryAction;
564
+ }
566
565
 
567
566
  if (disabledActions?.length) {
568
567
  queryParams[Param.DisableActions] = disabledActions;
package/src/index.ts CHANGED
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  /**
2
4
  * Copyright (c) 2023
3
5
  *
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import React, { useRef } from 'react';
2
4
  import useDeepCompareEffect from 'use-deep-compare-effect';
3
5
  import { AuthEventEmitter } from '../auth';