@thoughtspot/visual-embed-sdk 1.6.0-alpha.2 → 1.7.0-alpha.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 (62) hide show
  1. package/dist/src/embed/app.d.ts +9 -2
  2. package/dist/src/embed/liveboard.d.ts +19 -19
  3. package/dist/src/embed/liveboard.spec.d.ts +1 -0
  4. package/dist/src/embed/search.d.ts +2 -1
  5. package/dist/src/embed/ts-embed.d.ts +2 -11
  6. package/dist/src/test/test-utils.d.ts +1 -0
  7. package/dist/src/types.d.ts +21 -25
  8. package/dist/tsembed.es.js +63 -61
  9. package/dist/tsembed.js +62 -60
  10. package/lib/package.json +4 -1
  11. package/lib/src/embed/app.d.ts +9 -2
  12. package/lib/src/embed/app.js +18 -1
  13. package/lib/src/embed/app.js.map +1 -1
  14. package/lib/src/embed/app.spec.js +31 -0
  15. package/lib/src/embed/app.spec.js.map +1 -1
  16. package/lib/src/embed/events.spec.js +55 -2
  17. package/lib/src/embed/events.spec.js.map +1 -1
  18. package/lib/src/embed/liveboard.d.ts +19 -19
  19. package/lib/src/embed/liveboard.js +12 -13
  20. package/lib/src/embed/liveboard.js.map +1 -1
  21. package/lib/src/embed/liveboard.spec.d.ts +1 -0
  22. package/lib/src/embed/liveboard.spec.js +159 -0
  23. package/lib/src/embed/liveboard.spec.js.map +1 -0
  24. package/lib/src/embed/search.d.ts +2 -1
  25. package/lib/src/embed/search.js +11 -1
  26. package/lib/src/embed/search.js.map +1 -1
  27. package/lib/src/embed/search.spec.js +32 -20
  28. package/lib/src/embed/search.spec.js.map +1 -1
  29. package/lib/src/embed/ts-embed.d.ts +2 -11
  30. package/lib/src/embed/ts-embed.js +4 -23
  31. package/lib/src/embed/ts-embed.js.map +1 -1
  32. package/lib/src/embed/ts-embed.spec.js +63 -6
  33. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  34. package/lib/src/react/index.spec.js +1 -1
  35. package/lib/src/react/index.spec.js.map +1 -1
  36. package/lib/src/test/test-utils.d.ts +1 -0
  37. package/lib/src/test/test-utils.js +3 -0
  38. package/lib/src/test/test-utils.js.map +1 -1
  39. package/lib/src/types.d.ts +21 -25
  40. package/lib/src/types.js +18 -23
  41. package/lib/src/types.js.map +1 -1
  42. package/lib/src/visual-embed-sdk.d.ts +46 -51
  43. package/package.json +4 -1
  44. package/src/embed/app.spec.ts +40 -0
  45. package/src/embed/app.ts +21 -2
  46. package/src/embed/events.spec.ts +60 -1
  47. package/src/embed/liveboard.spec.ts +199 -0
  48. package/src/embed/liveboard.ts +21 -24
  49. package/src/embed/search.spec.ts +38 -19
  50. package/src/embed/search.ts +13 -1
  51. package/src/embed/ts-embed.spec.ts +78 -5
  52. package/src/embed/ts-embed.ts +6 -25
  53. package/src/react/index.spec.tsx +1 -1
  54. package/src/test/test-utils.ts +4 -0
  55. package/src/types.ts +21 -25
  56. package/dist/src/embed/pinboard.d.ts +0 -85
  57. package/lib/src/embed/pinboard.d.ts +0 -85
  58. package/lib/src/embed/pinboard.js +0 -107
  59. package/lib/src/embed/pinboard.js.map +0 -1
  60. package/lib/src/utils/fetchAnswers.d.ts +0 -3
  61. package/lib/src/utils/fetchAnswers.js +0 -49
  62. package/lib/src/utils/fetchAnswers.js.map +0 -1
@@ -67,7 +67,7 @@ export interface AppViewConfig extends ViewConfig {
67
67
  pageId?: Page;
68
68
  /**
69
69
  * This puts a filter tag on the application. All metadata lists in the application, such as
70
- * liveboards and answers, would be filtered by this tag.
70
+ * Liveboards and answers, would be filtered by this tag.
71
71
  */
72
72
  tag?: string;
73
73
  /**
@@ -84,7 +84,7 @@ export declare class AppEmbed extends V1Embed {
84
84
  constructor(domSelector: DOMSelector, viewConfig: AppViewConfig);
85
85
  /**
86
86
  * Constructs a map of parameters to be passed on to the
87
- * embedded liveboard or visualization.
87
+ * embedded Liveboard or visualization.
88
88
  */
89
89
  private getEmbedParams;
90
90
  /**
@@ -103,6 +103,13 @@ export declare class AppEmbed extends V1Embed {
103
103
  * @returns The URL path that the embedded app understands.
104
104
  */
105
105
  private formatPath;
106
+ /**
107
+ * Navigate to particular page for app embed. eg:answers/pinboards/home
108
+ * This is used for embedding answers, pinboards, visualizations and full application only.
109
+ * @param path The string, set to iframe src and navigate to new page
110
+ * eg: appEmbed.navigateToPage('pinboards')
111
+ */
112
+ navigateToPage(path: string): void;
106
113
  /**
107
114
  * Renders the embedded application pages in the ThoughtSpot app.
108
115
  * @param renderOptions An object containing the page ID
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2021
3
3
  *
4
- * Embed a ThoughtSpot liveboard or visualization
4
+ * Embed a ThoughtSpot Liveboard or visualization
5
5
  * https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
6
6
  * https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
7
7
  *
@@ -11,21 +11,21 @@
11
11
  import { DOMSelector } from '../types';
12
12
  import { V1Embed, ViewConfig } from './ts-embed';
13
13
  /**
14
- * The configuration for the embedded liveboard or visualization page view.
14
+ * The configuration for the embedded Liveboard or visualization page view.
15
15
  * @Category Liveboards and Charts
16
16
  */
17
17
  export interface LiveboardViewConfig extends ViewConfig {
18
18
  /**
19
19
  * If set to true, the embedded object container dynamically resizes
20
- * according to the height of the liveboard.
20
+ * according to the height of the Liveboard.
21
21
  */
22
22
  fullHeight?: boolean;
23
23
  /**
24
- * This is the minimum height(in pixels) for a full height liveboard.
25
- * Setting this height helps resolves issues with empty liveboards and
26
- * other screens navigable from a liveboard.
24
+ * This is the minimum height(in pixels) for a full height Liveboard.
25
+ * Setting this height helps resolves issues with empty Liveboards and
26
+ * other screens navigable from a Liveboard.
27
+ * *_since 1.5.0_
27
28
  * @default 500
28
- * * _since 1.5.0_
29
29
  */
30
30
  defaultHeight?: number;
31
31
  /**
@@ -33,7 +33,7 @@ export interface LiveboardViewConfig extends ViewConfig {
33
33
  */
34
34
  enableVizTransformations?: boolean;
35
35
  /**
36
- * The liveboard to display in the embedded view.
36
+ * The Liveboard to display in the embedded view.
37
37
  * Use either of liveboardId or pinboardId to reference the Liveboard to embed.
38
38
  */
39
39
  liveboardId?: string;
@@ -43,12 +43,12 @@ export interface LiveboardViewConfig extends ViewConfig {
43
43
  */
44
44
  pinboardId?: string;
45
45
  /**
46
- * The visualization within the liveboard to display.
46
+ * The visualization within the Liveboard to display.
47
47
  */
48
48
  vizId?: string;
49
49
  /**
50
50
  * If set to true, all filter chips from a
51
- * liveboard page will be read-only (no X buttons)
51
+ * Liveboard page will be read-only (no X buttons)
52
52
  */
53
53
  preventLiveboardFilterRemoval?: boolean;
54
54
  /**
@@ -58,7 +58,7 @@ export interface LiveboardViewConfig extends ViewConfig {
58
58
  preventPinboardFilterRemoval?: boolean;
59
59
  }
60
60
  /**
61
- * Embed a ThoughtSpot liveboard or visualization
61
+ * Embed a ThoughtSpot Liveboard or visualization
62
62
  * @Category Liveboards and Charts
63
63
  */
64
64
  export declare class LiveboardEmbed extends V1Embed {
@@ -67,16 +67,16 @@ export declare class LiveboardEmbed extends V1Embed {
67
67
  constructor(domSelector: DOMSelector, viewConfig: LiveboardViewConfig);
68
68
  /**
69
69
  * Construct a map of params to be passed on to the
70
- * embedded liveboard or visualization.
70
+ * embedded Liveboard or visualization.
71
71
  */
72
72
  private getEmbedParams;
73
73
  /**
74
- * Construct the URL of the embedded ThoughtSpot liveboard or visualization
74
+ * Construct the URL of the embedded ThoughtSpot Liveboard or visualization
75
75
  * to be loaded within the iframe.
76
- * @param liveboardId The GUID of the liveboard.
77
- * @param vizId The optional GUID of a visualization within the liveboard.
76
+ * @param liveboardId The GUID of the Liveboard.
77
+ * @param vizId The optional GUID of a visualization within the Liveboard.
78
78
  * @param runtimeFilters A list of runtime filters to be applied to
79
- * the liveboard or visualization on load.
79
+ * the Liveboard or visualization on load.
80
80
  */
81
81
  private getIFrameSrc;
82
82
  /**
@@ -86,10 +86,10 @@ export declare class LiveboardEmbed extends V1Embed {
86
86
  */
87
87
  private updateIFrameHeight;
88
88
  private embedIframeCenter;
89
- private handleRouteChangeFullHeightLiveboard;
89
+ private setIframeHeightForNonEmbedLiveboard;
90
90
  /**
91
- * Render an embedded ThoughtSpot liveboard or visualization
92
- * @param renderOptions An object specifying the liveboard ID,
91
+ * Render an embedded ThoughtSpot Liveboard or visualization
92
+ * @param renderOptions An object specifying the Liveboard ID,
93
93
  * visualization ID and the runtime filters.
94
94
  */
95
95
  render(): LiveboardEmbed;
@@ -0,0 +1 @@
1
+ export {};
@@ -6,7 +6,7 @@
6
6
  * @summary Search embed
7
7
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
8
8
  */
9
- import { DOMSelector } from '../types';
9
+ import { DOMSelector, Action } from '../types';
10
10
  import { ViewConfig, TsEmbed } from './ts-embed';
11
11
  /**
12
12
  * Configuration for search options
@@ -71,6 +71,7 @@ export interface SearchViewConfig extends ViewConfig {
71
71
  */
72
72
  answerId?: string;
73
73
  }
74
+ export declare const HiddenActionItemByDefaultForSearchEmbed: Action[];
74
75
  /**
75
76
  * Embed ThoughtSpot search
76
77
  *
@@ -64,7 +64,7 @@ export interface ViewConfig {
64
64
  visibleActions?: Action[];
65
65
  /**
66
66
  * The list of runtime filters to apply to a search answer,
67
- * visualization, or liveboard.
67
+ * visualization, or Liveboard.
68
68
  */
69
69
  runtimeFilters?: RuntimeFilter[];
70
70
  }
@@ -162,7 +162,7 @@ export declare class TsEmbed {
162
162
  protected getBaseQueryParams(): {};
163
163
  /**
164
164
  * Constructs the base URL string to load v1 of the ThoughtSpot app.
165
- * This is used for embedding liveboards, visualizations, and full application.
165
+ * This is used for embedding Liveboards, visualizations, and full application.
166
166
  * @param queryString The query string to append to the URL.
167
167
  * @param isAppEmbed A Boolean parameter to specify if you are embedding
168
168
  * the full application.
@@ -221,15 +221,6 @@ export declare class TsEmbed {
221
221
  * @param callback A callback function
222
222
  */
223
223
  on(messageType: EmbedEvent, callback: MessageCallback): typeof TsEmbed.prototype;
224
- /**
225
- * Navigates users to the specified application page.
226
- * Use this method to navigate users from the embedded
227
- * ThoughtSpot context to a specific page in your app.
228
- * @param path The page path string.
229
- * For example, to navigate users to a liveboard page,
230
- * define the method as navigateToPage('liveboard/&lt;liveboardId&gt;').
231
- */
232
- navigateToPage(path: string): void;
233
224
  /**
234
225
  * Triggers an event on specific Port registered against
235
226
  * for the EmbedEvent
@@ -24,4 +24,5 @@ export declare const executeAfterWait: (fn: (...args: any[]) => void, waitTime?:
24
24
  * Time (in milliseconds) to wait for async events to be triggered
25
25
  */
26
26
  export declare const EVENT_WAIT_TIME = 1000;
27
+ export declare function fixedEncodeURI(str: string): string;
27
28
  export {};
@@ -112,12 +112,13 @@ export interface EmbedConfig {
112
112
  * When there are multiple embeds, queue the render of embed to start
113
113
  * after the previous embed's render is complete. This helps in the load performance
114
114
  * by decreasing the load on the browser.
115
+ * @version 1.5.0 or later
115
116
  * @default false
116
117
  */
117
118
  queueMultiRenders?: boolean;
118
119
  /**
119
120
  * Dynamic CSS Url to be injected in the loaded application.
120
- * _Since: 1.6.0_
121
+ * @version 1.6.0 or later
121
122
  * @default ''
122
123
  */
123
124
  customCssUrl?: string;
@@ -193,7 +194,7 @@ export declare enum RuntimeFilterOp {
193
194
  IN = "IN"
194
195
  }
195
196
  /**
196
- * A filter that can be applied to ThoughtSpot answers, liveboards, or
197
+ * A filter that can be applied to ThoughtSpot answers, Liveboards, or
197
198
  * visualizations at runtime.
198
199
  */
199
200
  export interface RuntimeFilter {
@@ -231,12 +232,12 @@ export declare enum EmbedEvent {
231
232
  */
232
233
  Load = "load",
233
234
  /**
234
- * Data pertaining to answer or liveboard is received
235
- * @return data - The answer or liveboard data
235
+ * Data pertaining to answer or Liveboard is received
236
+ * @return data - The answer or Liveboard data
236
237
  */
237
238
  Data = "data",
238
239
  /**
239
- * Search/answer/liveboard filters have been applied/updated
240
+ * Search/answer/Liveboard filters have been applied/updated
240
241
  * @hidden
241
242
  */
242
243
  FiltersChanged = "filtersChanged",
@@ -259,13 +260,13 @@ export declare enum EmbedEvent {
259
260
  /**
260
261
  * A custom action has been triggered
261
262
  * @return actionId - The id of the custom action
262
- * @return data - The answer or liveboard data
263
+ * @return data - The answer or Liveboard data
263
264
  */
264
265
  CustomAction = "customAction",
265
266
  /**
266
267
  * A double click has been triggered on table/chart
267
268
  * @return ContextMenuInputPoints - data point that is double clicked
268
- * * _since: 1.5.0_
269
+ * @version 1.5.0 or later
269
270
  */
270
271
  VizPointDoubleClick = "vizPointDoubleClick",
271
272
  /**
@@ -283,8 +284,8 @@ export declare enum EmbedEvent {
283
284
  */
284
285
  AuthExpire = "ThoughtspotAuthExpired",
285
286
  /**
286
- * The height of the embedded liveboard or visualization has been computed.
287
- * @return data - The height of the embedded liveboard or visualization
287
+ * The height of the embedded Liveboard or visualization has been computed.
288
+ * @return data - The height of the embedded Liveboard or visualization
288
289
  * @hidden
289
290
  */
290
291
  EmbedHeight = "EMBED_HEIGHT",
@@ -296,7 +297,6 @@ export declare enum EmbedEvent {
296
297
  EmbedIframeCenter = "EmbedIframeCenter",
297
298
  /**
298
299
  * Detects the route change.
299
- * @hidden
300
300
  */
301
301
  RouteChange = "ROUTE_CHANGE",
302
302
  /**
@@ -308,7 +308,7 @@ export declare enum EmbedEvent {
308
308
  * Emitted when the embed does not have cookie access. This
309
309
  * happens on Safari where third-party cookies are blocked by default.
310
310
  *
311
- * @version 1.1.0
311
+ * @version 1.1.0 or later
312
312
  */
313
313
  NoCookieAccess = "noCookieAccess",
314
314
  /**
@@ -319,12 +319,12 @@ export declare enum EmbedEvent {
319
319
  SAMLComplete = "samlComplete",
320
320
  /**
321
321
  * Emitted when any modal is opened in the app
322
- * * _since: 1.6.0_
322
+ * @version 1.6.0 or later
323
323
  */
324
324
  DialogOpen = "dialog-open",
325
325
  /**
326
326
  * Emitted when any modal is closed in the app
327
- * * _since: 1.6.0_
327
+ * @version 1.6.0 or later
328
328
  */
329
329
  DialogClose = "dialog-close"
330
330
  }
@@ -345,7 +345,7 @@ export declare enum HostEvent {
345
345
  * eg. { selectedPoints: []}
346
346
  * @param columnGuid - a string guid of the column to drill by. This is optional,
347
347
  * if not provided it will auto drill by the configured column. \
348
- * * _since: 1.5.0_
348
+ * @version 1.5.0 or later
349
349
  */
350
350
  DrillDown = "triggerDrillDown",
351
351
  /**
@@ -359,10 +359,10 @@ export declare enum HostEvent {
359
359
  */
360
360
  Reload = "reload",
361
361
  /**
362
- * Set the visible Vizs on a pinboard/liveboard.
363
- * @param - an array of ids of vizs to show, the ids not passed
362
+ * Set the visible visualizations on a Liveboard.
363
+ * @param - an array of ids of visualizations to show, the ids not passed
364
364
  * will be hidden.
365
- * _since: 1.6.0_
365
+ * @version 1.6.0 or later
366
366
  */
367
367
  SetVisibleVizs = "SetPinboardVisibleVizs"
368
368
  }
@@ -416,7 +416,7 @@ export declare enum Param {
416
416
  }
417
417
  /**
418
418
  * The list of actions that can be performed on visual ThoughtSpot
419
- * entities, such as answers and liveboards.
419
+ * entities, such as answers and Liveboards.
420
420
  */
421
421
  export declare enum Action {
422
422
  Save = "save",
@@ -426,13 +426,8 @@ export declare enum Action {
426
426
  MakeACopy = "makeACopy",
427
427
  EditACopy = "editACopy",
428
428
  CopyLink = "embedDocument",
429
- /**
430
- * @hidden
431
- */
432
- PinboardSnapshot = "pinboardSnapshot",
433
- LiveboardSnapshot = "liveboardSnapshot",
434
429
  ResetLayout = "resetLayout",
435
- Schedule = "schedule",
430
+ Schedule = "subscription",
436
431
  SchedulesList = "schedule-list",
437
432
  Share = "share",
438
433
  AddFilter = "addFilter",
@@ -467,7 +462,7 @@ export declare enum Action {
467
462
  * @hidden
468
463
  */
469
464
  PinboardInfo = "pinboardInfo",
470
- LiveboardInfo = "liveboardInfo",
465
+ LiveboardInfo = "pinboardInfo",
471
466
  SendAnswerFeedback = "sendFeedback",
472
467
  /**
473
468
  * @deprecated Will be removed in next version
@@ -481,6 +476,7 @@ export declare enum Action {
481
476
  DrillInclude = "context-menu-item-include",
482
477
  DrillExclude = "context-menu-item-exclude",
483
478
  CopyToClipboard = "context-menu-item-copy-to-clipboard",
479
+ CopyAndEdit = "context-menu-item-copy-and-edit",
484
480
  DrillEdit = "context-menu-item-edit",
485
481
  EditMeasure = "context-menu-item-edit-measure",
486
482
  Separator = "context-menu-item-separator",